@customafk/lunas-ui 0.2.10 → 0.2.12
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/{alert-LqhAi5XB.d.cts → alert-Bi9GgWBf.d.cts} +5 -5
- package/dist/{alert-Dt_GDCm5.d.mts → alert-DBdAWJoD.d.mts} +7 -7
- package/dist/{alert-DQHE-pdI.mjs → alert-DjfDTXIK.mjs} +1 -1
- package/dist/{alert-DQHE-pdI.mjs.map → alert-DjfDTXIK.mjs.map} +1 -1
- package/dist/{alert-BqJVf4wD.cjs → alert-kJbUcjIR.cjs} +1 -1
- package/dist/{alert-BqJVf4wD.cjs.map → alert-kJbUcjIR.cjs.map} +1 -1
- package/dist/{badge-DaaGIpeV.d.mts → badge-BrBsWjjy.d.mts} +3 -3
- package/dist/{badge-Gsrn62XW.d.cts → badge-OocBN04L.d.cts} +3 -3
- package/dist/{button-gKqh2psz.d.cts → button-Bg7LOzPN.d.cts} +4 -4
- package/dist/{button-CjlinfYI.d.mts → button-CM0enIRc.d.mts} +4 -4
- package/dist/{calendar-B2V4Lv0T.cjs → calendar-BMXIBCsr.cjs} +1 -1
- package/dist/{calendar-B2V4Lv0T.cjs.map → calendar-BMXIBCsr.cjs.map} +1 -1
- package/dist/{calendar-Cw1G0sVL.mjs → calendar-WMJIKojX.mjs} +1 -1
- package/dist/{calendar-Cw1G0sVL.mjs.map → calendar-WMJIKojX.mjs.map} +1 -1
- package/dist/cards/simple-card.d.cts +2 -2
- package/dist/cards/simple-card.d.mts +2 -2
- package/dist/{cms-layout-r9TmK6hi.cjs → cms-layout-BLJpfFpE.cjs} +1 -1
- package/dist/{cms-layout-r9TmK6hi.cjs.map → cms-layout-BLJpfFpE.cjs.map} +1 -1
- package/dist/{cms-layout-Bp6rU_of.mjs → cms-layout-BYzUepEk.mjs} +1 -1
- package/dist/{cms-layout-Bp6rU_of.mjs.map → cms-layout-BYzUepEk.mjs.map} +1 -1
- package/dist/data-display/statistic.d.mts +4 -4
- package/dist/{dialog-DrJyRArf.d.mts → dialog-BXi5bgG0.d.cts} +12 -12
- package/dist/{dialog-Coe4g5Lp.d.cts → dialog-DLOes4WS.d.mts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +26 -26
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
- package/dist/dialogs/detail-dialog/index.mjs +1 -1
- package/dist/dialogs/detail-dialog/index.mjs.map +1 -1
- package/dist/features/descriptions/index.cjs +1 -1
- package/dist/features/descriptions/index.cjs.map +1 -1
- package/dist/features/descriptions/index.d.cts +25 -2
- package/dist/features/descriptions/index.d.mts +25 -2
- package/dist/features/descriptions/index.mjs +1 -1
- package/dist/features/descriptions/index.mjs.map +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.mts +2 -2
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.d.cts +90 -16
- package/dist/features/tables/index.d.mts +90 -16
- 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 +1 -1
- package/dist/features/tanstack-form/index.d.mts +1 -1
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/{field-DfsTE4Ie.mjs → field-C5HOxxiX.mjs} +2 -2
- package/dist/{field-DfsTE4Ie.mjs.map → field-C5HOxxiX.mjs.map} +1 -1
- package/dist/{field-C51eJ6QN.cjs → field-D1wvj5Wj.cjs} +2 -2
- package/dist/{field-C51eJ6QN.cjs.map → field-D1wvj5Wj.cjs.map} +1 -1
- package/dist/{index-rnLTzTi7.d.cts → index-CkmisxOx.d.cts} +173 -173
- package/dist/{index-DzSTWYsk.d.mts → index-Cyc9v5Az.d.mts} +122 -122
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +1 -1
- package/dist/{input-DpaSVQ7H.d.mts → input-CvWCE7ft.d.mts} +6 -6
- package/dist/{input-BRVTkuUg.d.cts → input-D9N-kPNc.d.cts} +6 -6
- package/dist/{label-3vAlNtF9.mjs → label-COqDQDMy.mjs} +1 -1
- package/dist/{label-3vAlNtF9.mjs.map → label-COqDQDMy.mjs.map} +1 -1
- package/dist/{label-zyBJYydC.cjs → label-DYsRdKMt.cjs} +1 -1
- package/dist/{label-zyBJYydC.cjs.map → label-DYsRdKMt.cjs.map} +1 -1
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.mjs +1 -1
- package/dist/layouts/flex.d.cts +7 -7
- package/dist/layouts/flex.d.mts +9 -9
- package/dist/layouts/payment-layout/index.cjs +1 -1
- package/dist/layouts/payment-layout/index.mjs +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/{payment-layout-C9pP5HdT.cjs → payment-layout-C8_xrnVn.cjs} +1 -1
- package/dist/{payment-layout-C9pP5HdT.cjs.map → payment-layout-C8_xrnVn.cjs.map} +1 -1
- package/dist/{payment-layout-D-69gOPJ.mjs → payment-layout-CVBTGjMw.mjs} +1 -1
- package/dist/{payment-layout-D-69gOPJ.mjs.map → payment-layout-CVBTGjMw.mjs.map} +1 -1
- package/dist/{popover-CmoqhK17.cjs → popover-AEt-aSy3.cjs} +1 -1
- package/dist/{popover-CmoqhK17.cjs.map → popover-AEt-aSy3.cjs.map} +1 -1
- package/dist/{popover-BFJhuzW3.mjs → popover-OJXFbqJi.mjs} +1 -1
- package/dist/{popover-BFJhuzW3.mjs.map → popover-OJXFbqJi.mjs.map} +1 -1
- package/dist/{radio-group-D5OurBIG.mjs → radio-group-5ktXGXSv.mjs} +1 -1
- package/dist/{radio-group-D5OurBIG.mjs.map → radio-group-5ktXGXSv.mjs.map} +1 -1
- package/dist/{radio-group-DAv2EU3F.cjs → radio-group-C7FAAawm.cjs} +1 -1
- package/dist/{radio-group-DAv2EU3F.cjs.map → radio-group-C7FAAawm.cjs.map} +1 -1
- package/dist/{select-DRCKwnTV.mjs → select-DrHceSnf.mjs} +1 -1
- package/dist/{select-DRCKwnTV.mjs.map → select-DrHceSnf.mjs.map} +1 -1
- package/dist/{select-DfvSMRUq.cjs → select-DzylYFes.cjs} +1 -1
- package/dist/{select-DfvSMRUq.cjs.map → select-DzylYFes.cjs.map} +1 -1
- package/dist/tables-BQkO4mz6.cjs +4 -0
- package/dist/tables-BQkO4mz6.cjs.map +1 -0
- package/dist/tables-iT8uH25j.mjs +4 -0
- package/dist/tables-iT8uH25j.mjs.map +1 -0
- package/dist/{tanstack-form-Bb9JXuEq.cjs → tanstack-form-BUjk7DIz.cjs} +2 -2
- package/dist/{tanstack-form-Bb9JXuEq.cjs.map → tanstack-form-BUjk7DIz.cjs.map} +1 -1
- package/dist/{tanstack-form-BwyHENeF.mjs → tanstack-form-DtZdrifK.mjs} +2 -2
- package/dist/{tanstack-form-BwyHENeF.mjs.map → tanstack-form-DtZdrifK.mjs.map} +1 -1
- package/dist/{textarea-CvoBIPlJ.cjs → textarea-DZ86A_cm.cjs} +1 -1
- package/dist/{textarea-CvoBIPlJ.cjs.map → textarea-DZ86A_cm.cjs.map} +1 -1
- package/dist/{textarea-5RD9ToTV.mjs → textarea-Dd1fBf_4.mjs} +1 -1
- package/dist/{textarea-5RD9ToTV.mjs.map → textarea-Dd1fBf_4.mjs.map} +1 -1
- package/dist/typography/paragraph.d.cts +5 -5
- package/dist/typography/paragraph.d.mts +5 -5
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.cjs +1 -1
- package/dist/ui/alert.d.cts +1 -1
- package/dist/ui/alert.d.mts +1 -1
- package/dist/ui/alert.mjs +1 -1
- 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 +1 -1
- package/dist/ui/badge.d.mts +1 -1
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.d.cts +7 -7
- package/dist/ui/button-group.d.mts +7 -7
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +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.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/checkbox.d.cts +2 -2
- package/dist/ui/checkbox.d.mts +2 -2
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +9 -9
- package/dist/ui/field.cjs +1 -1
- package/dist/ui/field.d.cts +23 -23
- package/dist/ui/field.d.mts +25 -25
- package/dist/ui/field.mjs +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/form.cjs +1 -1
- package/dist/ui/form.d.cts +11 -11
- package/dist/ui/form.d.mts +11 -11
- package/dist/ui/form.mjs +1 -1
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/item.d.cts +15 -15
- package/dist/ui/item.d.mts +15 -15
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/label.mjs +1 -1
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +17 -17
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +1 -1
- package/dist/ui/navigation-menu.d.cts +9 -9
- package/dist/ui/navigation-menu.d.mts +9 -9
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/popover.cjs +1 -1
- package/dist/ui/popover.d.cts +6 -6
- package/dist/ui/popover.d.mts +6 -6
- package/dist/ui/popover.mjs +1 -1
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.cjs +1 -1
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/radio-group.mjs +1 -1
- 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.cjs +1 -1
- package/dist/ui/select.d.cts +9 -9
- package/dist/ui/select.d.mts +9 -9
- package/dist/ui/select.mjs +1 -1
- package/dist/ui/separator.d.cts +2 -2
- package/dist/ui/separator.d.mts +2 -2
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sidebar.d.cts +28 -28
- package/dist/ui/sidebar.d.mts +28 -28
- 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.cjs +1 -1
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/textarea.mjs +1 -1
- 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 +4 -4
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.mts +5 -5
- package/package.json +1 -1
- package/dist/tables-Chn2pQSc.cjs +0 -4
- package/dist/tables-Chn2pQSc.cjs.map +0 -1
- package/dist/tables-eLIhswqW.mjs +0 -4
- package/dist/tables-eLIhswqW.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime49 from "react/jsx-runtime";
|
|
2
2
|
import { Dialog } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/dialog.d.ts
|
|
@@ -33,24 +33,24 @@ import { Dialog } from "radix-ui";
|
|
|
33
33
|
*/
|
|
34
34
|
declare function Dialog$1({
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<typeof Dialog.Root>):
|
|
36
|
+
}: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime49.JSX.Element;
|
|
37
37
|
/** Element that opens the dialog when clicked; typically wrapped with `asChild` around a `Button`. */
|
|
38
38
|
declare function DialogTrigger({
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof Dialog.Trigger>):
|
|
40
|
+
}: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime49.JSX.Element;
|
|
41
41
|
/** Renders dialog overlay and content into a portal outside the normal React tree. */
|
|
42
42
|
declare function DialogPortal({
|
|
43
43
|
...props
|
|
44
|
-
}: React.ComponentProps<typeof Dialog.Portal>):
|
|
44
|
+
}: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime49.JSX.Element;
|
|
45
45
|
/** Button that closes the dialog; can be composed with `asChild` to use a custom element. */
|
|
46
46
|
declare function DialogClose({
|
|
47
47
|
...props
|
|
48
|
-
}: React.ComponentProps<typeof Dialog.Close>):
|
|
48
|
+
}: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime49.JSX.Element;
|
|
49
49
|
/** Semi-transparent backdrop rendered behind the dialog panel with fade-in/out animation. */
|
|
50
50
|
declare function DialogOverlay({
|
|
51
51
|
className,
|
|
52
52
|
...props
|
|
53
|
-
}: React.ComponentProps<typeof Dialog.Overlay>):
|
|
53
|
+
}: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime49.JSX.Element;
|
|
54
54
|
/**
|
|
55
55
|
* Animated dialog panel centred on screen; includes `DialogOverlay` and an optional close button.
|
|
56
56
|
*
|
|
@@ -64,27 +64,27 @@ declare function DialogContent({
|
|
|
64
64
|
}: React.ComponentProps<typeof Dialog.Content> & {
|
|
65
65
|
/** When `true` (default), renders an `×` close button fixed to the top-right corner of the panel. */
|
|
66
66
|
showCloseButton?: boolean;
|
|
67
|
-
}):
|
|
67
|
+
}): react_jsx_runtime49.JSX.Element;
|
|
68
68
|
/** Layout wrapper for the dialog title and description, stacked vertically with left alignment on wider screens. */
|
|
69
69
|
declare function DialogHeader({
|
|
70
70
|
className,
|
|
71
71
|
...props
|
|
72
|
-
}: React.ComponentProps<'div'>):
|
|
72
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime49.JSX.Element;
|
|
73
73
|
/** Layout wrapper for dialog action buttons, stacked on mobile and right-aligned in a row on wider screens. */
|
|
74
74
|
declare function DialogFooter({
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'div'>):
|
|
77
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime49.JSX.Element;
|
|
78
78
|
/** Accessible heading for the dialog panel, styled with the h3 heading variant and announced by screen readers. */
|
|
79
79
|
declare function DialogTitle({
|
|
80
80
|
className,
|
|
81
81
|
...props
|
|
82
|
-
}: React.ComponentProps<typeof Dialog.Title>):
|
|
82
|
+
}: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime49.JSX.Element;
|
|
83
83
|
/** Muted supporting text that describes the dialog's purpose; read by screen readers alongside the title. */
|
|
84
84
|
declare function DialogDescription({
|
|
85
85
|
className,
|
|
86
86
|
...props
|
|
87
|
-
}: React.ComponentProps<typeof Dialog.Description>):
|
|
87
|
+
}: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime49.JSX.Element;
|
|
88
88
|
//#endregion
|
|
89
89
|
export { DialogFooter as a, DialogPortal as c, DialogDescription as i, DialogTitle as l, DialogClose as n, DialogHeader as o, DialogContent as r, DialogOverlay as s, Dialog$1 as t, DialogTrigger as u };
|
|
90
|
-
//# sourceMappingURL=dialog-
|
|
90
|
+
//# sourceMappingURL=dialog-DLOes4WS.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as Button } from "../../../button-
|
|
1
|
+
import { t as Button } from "../../../button-Bg7LOzPN.cjs";
|
|
2
2
|
import { Separator } from "../../../ui/separator.cjs";
|
|
3
3
|
import { TooltipContent } from "../../../ui/tooltip.cjs";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
5
|
+
import * as class_variance_authority_types1 from "class-variance-authority/types";
|
|
6
6
|
import { VariantProps } from "class-variance-authority";
|
|
7
7
|
|
|
8
8
|
//#region packages/components/dialogs/detail-dialog/components/sidebar.d.ts
|
|
@@ -50,7 +50,7 @@ declare function SidebarProvider({
|
|
|
50
50
|
open?: boolean;
|
|
51
51
|
/** Callback fired when the open state changes in controlled mode. */
|
|
52
52
|
onOpenChange?: (open: boolean) => void;
|
|
53
|
-
}):
|
|
53
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
54
54
|
/**
|
|
55
55
|
* Responsive sidebar container that supports desktop icon-collapse and a mobile Sheet overlay.
|
|
56
56
|
*
|
|
@@ -77,7 +77,7 @@ declare function Sidebar({
|
|
|
77
77
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
78
78
|
/** Collapse behaviour — slides off-canvas, shrinks to icon strip, or stays fixed. Defaults to `'offcanvas'`. */
|
|
79
79
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
80
|
-
}):
|
|
80
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
81
81
|
/**
|
|
82
82
|
* Icon button that toggles the detail-dialog sidebar open or collapsed.
|
|
83
83
|
*
|
|
@@ -92,66 +92,66 @@ declare function DetailDialogSidebarTrigger({
|
|
|
92
92
|
className,
|
|
93
93
|
onClick,
|
|
94
94
|
...props
|
|
95
|
-
}: React.ComponentProps<typeof Button>):
|
|
95
|
+
}: React.ComponentProps<typeof Button>): react_jsx_runtime5.JSX.Element;
|
|
96
96
|
declare function DetailDialogSidebarRail({
|
|
97
97
|
className,
|
|
98
98
|
...props
|
|
99
|
-
}: React.ComponentProps<'button'>):
|
|
99
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime5.JSX.Element;
|
|
100
100
|
declare function SidebarInset({
|
|
101
101
|
className,
|
|
102
102
|
...props
|
|
103
|
-
}: React.ComponentProps<'main'>):
|
|
103
|
+
}: React.ComponentProps<'main'>): react_jsx_runtime5.JSX.Element;
|
|
104
104
|
declare function DetailDialogSidebarHeader({
|
|
105
105
|
className,
|
|
106
106
|
...props
|
|
107
|
-
}: React.ComponentProps<'div'>):
|
|
107
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
108
108
|
declare function DetailDialogSidebarFooter({
|
|
109
109
|
className,
|
|
110
110
|
children,
|
|
111
111
|
...props
|
|
112
|
-
}: React.ComponentProps<'div'>):
|
|
112
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
113
113
|
declare function DetailDialogSidebarSeparator({
|
|
114
114
|
className,
|
|
115
115
|
...props
|
|
116
|
-
}: React.ComponentProps<typeof Separator>):
|
|
116
|
+
}: React.ComponentProps<typeof Separator>): react_jsx_runtime5.JSX.Element;
|
|
117
117
|
declare function DetailDialogSidebarContent({
|
|
118
118
|
className,
|
|
119
119
|
...props
|
|
120
|
-
}: React.ComponentProps<'div'>):
|
|
120
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
121
121
|
declare function DetailDialogSidebarGroup({
|
|
122
122
|
className,
|
|
123
123
|
...props
|
|
124
|
-
}: React.ComponentProps<'div'>):
|
|
124
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
125
125
|
declare function DetailDialogSidebarGroupLabel({
|
|
126
126
|
className,
|
|
127
127
|
asChild,
|
|
128
128
|
...props
|
|
129
129
|
}: React.ComponentProps<'div'> & {
|
|
130
130
|
asChild?: boolean;
|
|
131
|
-
}):
|
|
131
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
132
132
|
declare function DetailDialogSidebarGroupAction({
|
|
133
133
|
className,
|
|
134
134
|
asChild,
|
|
135
135
|
...props
|
|
136
136
|
}: React.ComponentProps<'button'> & {
|
|
137
137
|
asChild?: boolean;
|
|
138
|
-
}):
|
|
138
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
139
139
|
declare function DetailDialogSidebarGroupContent({
|
|
140
140
|
className,
|
|
141
141
|
...props
|
|
142
|
-
}: React.ComponentProps<'div'>):
|
|
142
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
143
143
|
declare function DetailDialogSidebarMenu({
|
|
144
144
|
className,
|
|
145
145
|
...props
|
|
146
|
-
}: React.ComponentProps<'ul'>):
|
|
146
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime5.JSX.Element;
|
|
147
147
|
declare function DetailDialogSidebarMenuItem({
|
|
148
148
|
className,
|
|
149
149
|
...props
|
|
150
|
-
}: React.ComponentProps<'li'>):
|
|
150
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime5.JSX.Element;
|
|
151
151
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
152
152
|
variant?: "outline" | "default" | null | undefined;
|
|
153
153
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
154
|
-
} &
|
|
154
|
+
} & class_variance_authority_types1.ClassProp) | undefined) => string;
|
|
155
155
|
declare function DetailDialogSidebarMenuButton({
|
|
156
156
|
asChild,
|
|
157
157
|
isActive,
|
|
@@ -164,7 +164,7 @@ declare function DetailDialogSidebarMenuButton({
|
|
|
164
164
|
asChild?: boolean;
|
|
165
165
|
isActive?: boolean;
|
|
166
166
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
167
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
167
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime5.JSX.Element;
|
|
168
168
|
declare function DetailDialogSidebarMenuAction({
|
|
169
169
|
className,
|
|
170
170
|
asChild,
|
|
@@ -173,26 +173,26 @@ declare function DetailDialogSidebarMenuAction({
|
|
|
173
173
|
}: React.ComponentProps<'button'> & {
|
|
174
174
|
asChild?: boolean;
|
|
175
175
|
showOnHover?: boolean;
|
|
176
|
-
}):
|
|
176
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
177
177
|
declare function DetailDialogSidebarMenuBadge({
|
|
178
178
|
className,
|
|
179
179
|
...props
|
|
180
|
-
}: React.ComponentProps<'div'>):
|
|
180
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
181
181
|
declare function DetailDialogSidebarMenuSkeleton({
|
|
182
182
|
className,
|
|
183
183
|
showIcon,
|
|
184
184
|
...props
|
|
185
185
|
}: React.ComponentProps<'div'> & {
|
|
186
186
|
showIcon?: boolean;
|
|
187
|
-
}):
|
|
187
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
188
188
|
declare function DetailDialogSidebarMenuSub({
|
|
189
189
|
className,
|
|
190
190
|
...props
|
|
191
|
-
}: React.ComponentProps<'ul'>):
|
|
191
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime5.JSX.Element;
|
|
192
192
|
declare function DetailDialogSidebarMenuSubItem({
|
|
193
193
|
className,
|
|
194
194
|
...props
|
|
195
|
-
}: React.ComponentProps<'li'>):
|
|
195
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime5.JSX.Element;
|
|
196
196
|
declare function DetailDialogSidebarMenuSubButton({
|
|
197
197
|
asChild,
|
|
198
198
|
size,
|
|
@@ -203,7 +203,7 @@ declare function DetailDialogSidebarMenuSubButton({
|
|
|
203
203
|
asChild?: boolean;
|
|
204
204
|
size?: 'sm' | 'md';
|
|
205
205
|
isActive?: boolean;
|
|
206
|
-
}):
|
|
206
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
207
207
|
//#endregion
|
|
208
208
|
export { DetailDialogSidebarContent, DetailDialogSidebarFooter, DetailDialogSidebarGroup, DetailDialogSidebarGroupAction, DetailDialogSidebarGroupContent, DetailDialogSidebarGroupLabel, DetailDialogSidebarHeader, DetailDialogSidebarMenu, DetailDialogSidebarMenuAction, DetailDialogSidebarMenuBadge, DetailDialogSidebarMenuButton, DetailDialogSidebarMenuItem, DetailDialogSidebarMenuSkeleton, DetailDialogSidebarMenuSub, DetailDialogSidebarMenuSubButton, DetailDialogSidebarMenuSubItem, DetailDialogSidebarRail, DetailDialogSidebarSeparator, DetailDialogSidebarTrigger, Sidebar, SidebarInset, SidebarProvider, useSidebar };
|
|
209
209
|
//# sourceMappingURL=sidebar.d.cts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as Button } from "../../../button-
|
|
1
|
+
import { t as Button } from "../../../button-CM0enIRc.mjs";
|
|
2
2
|
import { Separator } from "../../../ui/separator.mjs";
|
|
3
3
|
import { TooltipContent } from "../../../ui/tooltip.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
|
-
import * as
|
|
6
|
+
import * as class_variance_authority_types2 from "class-variance-authority/types";
|
|
7
7
|
|
|
8
8
|
//#region packages/components/dialogs/detail-dialog/components/sidebar.d.ts
|
|
9
9
|
type SidebarContextProps = {
|
|
@@ -50,7 +50,7 @@ declare function SidebarProvider({
|
|
|
50
50
|
open?: boolean;
|
|
51
51
|
/** Callback fired when the open state changes in controlled mode. */
|
|
52
52
|
onOpenChange?: (open: boolean) => void;
|
|
53
|
-
}):
|
|
53
|
+
}): react_jsx_runtime11.JSX.Element;
|
|
54
54
|
/**
|
|
55
55
|
* Responsive sidebar container that supports desktop icon-collapse and a mobile Sheet overlay.
|
|
56
56
|
*
|
|
@@ -77,7 +77,7 @@ declare function Sidebar({
|
|
|
77
77
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
78
78
|
/** Collapse behaviour — slides off-canvas, shrinks to icon strip, or stays fixed. Defaults to `'offcanvas'`. */
|
|
79
79
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
80
|
-
}):
|
|
80
|
+
}): react_jsx_runtime11.JSX.Element;
|
|
81
81
|
/**
|
|
82
82
|
* Icon button that toggles the detail-dialog sidebar open or collapsed.
|
|
83
83
|
*
|
|
@@ -92,66 +92,66 @@ declare function DetailDialogSidebarTrigger({
|
|
|
92
92
|
className,
|
|
93
93
|
onClick,
|
|
94
94
|
...props
|
|
95
|
-
}: React.ComponentProps<typeof Button>):
|
|
95
|
+
}: React.ComponentProps<typeof Button>): react_jsx_runtime11.JSX.Element;
|
|
96
96
|
declare function DetailDialogSidebarRail({
|
|
97
97
|
className,
|
|
98
98
|
...props
|
|
99
|
-
}: React.ComponentProps<'button'>):
|
|
99
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime11.JSX.Element;
|
|
100
100
|
declare function SidebarInset({
|
|
101
101
|
className,
|
|
102
102
|
...props
|
|
103
|
-
}: React.ComponentProps<'main'>):
|
|
103
|
+
}: React.ComponentProps<'main'>): react_jsx_runtime11.JSX.Element;
|
|
104
104
|
declare function DetailDialogSidebarHeader({
|
|
105
105
|
className,
|
|
106
106
|
...props
|
|
107
|
-
}: React.ComponentProps<'div'>):
|
|
107
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime11.JSX.Element;
|
|
108
108
|
declare function DetailDialogSidebarFooter({
|
|
109
109
|
className,
|
|
110
110
|
children,
|
|
111
111
|
...props
|
|
112
|
-
}: React.ComponentProps<'div'>):
|
|
112
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime11.JSX.Element;
|
|
113
113
|
declare function DetailDialogSidebarSeparator({
|
|
114
114
|
className,
|
|
115
115
|
...props
|
|
116
|
-
}: React.ComponentProps<typeof Separator>):
|
|
116
|
+
}: React.ComponentProps<typeof Separator>): react_jsx_runtime11.JSX.Element;
|
|
117
117
|
declare function DetailDialogSidebarContent({
|
|
118
118
|
className,
|
|
119
119
|
...props
|
|
120
|
-
}: React.ComponentProps<'div'>):
|
|
120
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime11.JSX.Element;
|
|
121
121
|
declare function DetailDialogSidebarGroup({
|
|
122
122
|
className,
|
|
123
123
|
...props
|
|
124
|
-
}: React.ComponentProps<'div'>):
|
|
124
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime11.JSX.Element;
|
|
125
125
|
declare function DetailDialogSidebarGroupLabel({
|
|
126
126
|
className,
|
|
127
127
|
asChild,
|
|
128
128
|
...props
|
|
129
129
|
}: React.ComponentProps<'div'> & {
|
|
130
130
|
asChild?: boolean;
|
|
131
|
-
}):
|
|
131
|
+
}): react_jsx_runtime11.JSX.Element;
|
|
132
132
|
declare function DetailDialogSidebarGroupAction({
|
|
133
133
|
className,
|
|
134
134
|
asChild,
|
|
135
135
|
...props
|
|
136
136
|
}: React.ComponentProps<'button'> & {
|
|
137
137
|
asChild?: boolean;
|
|
138
|
-
}):
|
|
138
|
+
}): react_jsx_runtime11.JSX.Element;
|
|
139
139
|
declare function DetailDialogSidebarGroupContent({
|
|
140
140
|
className,
|
|
141
141
|
...props
|
|
142
|
-
}: React.ComponentProps<'div'>):
|
|
142
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime11.JSX.Element;
|
|
143
143
|
declare function DetailDialogSidebarMenu({
|
|
144
144
|
className,
|
|
145
145
|
...props
|
|
146
|
-
}: React.ComponentProps<'ul'>):
|
|
146
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime11.JSX.Element;
|
|
147
147
|
declare function DetailDialogSidebarMenuItem({
|
|
148
148
|
className,
|
|
149
149
|
...props
|
|
150
|
-
}: React.ComponentProps<'li'>):
|
|
150
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime11.JSX.Element;
|
|
151
151
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
152
152
|
variant?: "outline" | "default" | null | undefined;
|
|
153
153
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
154
|
-
} &
|
|
154
|
+
} & class_variance_authority_types2.ClassProp) | undefined) => string;
|
|
155
155
|
declare function DetailDialogSidebarMenuButton({
|
|
156
156
|
asChild,
|
|
157
157
|
isActive,
|
|
@@ -164,7 +164,7 @@ declare function DetailDialogSidebarMenuButton({
|
|
|
164
164
|
asChild?: boolean;
|
|
165
165
|
isActive?: boolean;
|
|
166
166
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
167
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
167
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime11.JSX.Element;
|
|
168
168
|
declare function DetailDialogSidebarMenuAction({
|
|
169
169
|
className,
|
|
170
170
|
asChild,
|
|
@@ -173,26 +173,26 @@ declare function DetailDialogSidebarMenuAction({
|
|
|
173
173
|
}: React.ComponentProps<'button'> & {
|
|
174
174
|
asChild?: boolean;
|
|
175
175
|
showOnHover?: boolean;
|
|
176
|
-
}):
|
|
176
|
+
}): react_jsx_runtime11.JSX.Element;
|
|
177
177
|
declare function DetailDialogSidebarMenuBadge({
|
|
178
178
|
className,
|
|
179
179
|
...props
|
|
180
|
-
}: React.ComponentProps<'div'>):
|
|
180
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime11.JSX.Element;
|
|
181
181
|
declare function DetailDialogSidebarMenuSkeleton({
|
|
182
182
|
className,
|
|
183
183
|
showIcon,
|
|
184
184
|
...props
|
|
185
185
|
}: React.ComponentProps<'div'> & {
|
|
186
186
|
showIcon?: boolean;
|
|
187
|
-
}):
|
|
187
|
+
}): react_jsx_runtime11.JSX.Element;
|
|
188
188
|
declare function DetailDialogSidebarMenuSub({
|
|
189
189
|
className,
|
|
190
190
|
...props
|
|
191
|
-
}: React.ComponentProps<'ul'>):
|
|
191
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime11.JSX.Element;
|
|
192
192
|
declare function DetailDialogSidebarMenuSubItem({
|
|
193
193
|
className,
|
|
194
194
|
...props
|
|
195
|
-
}: React.ComponentProps<'li'>):
|
|
195
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime11.JSX.Element;
|
|
196
196
|
declare function DetailDialogSidebarMenuSubButton({
|
|
197
197
|
asChild,
|
|
198
198
|
size,
|
|
@@ -203,7 +203,7 @@ declare function DetailDialogSidebarMenuSubButton({
|
|
|
203
203
|
asChild?: boolean;
|
|
204
204
|
size?: 'sm' | 'md';
|
|
205
205
|
isActive?: boolean;
|
|
206
|
-
}):
|
|
206
|
+
}): react_jsx_runtime11.JSX.Element;
|
|
207
207
|
//#endregion
|
|
208
208
|
export { DetailDialogSidebarContent, DetailDialogSidebarFooter, DetailDialogSidebarGroup, DetailDialogSidebarGroupAction, DetailDialogSidebarGroupContent, DetailDialogSidebarGroupLabel, DetailDialogSidebarHeader, DetailDialogSidebarMenu, DetailDialogSidebarMenuAction, DetailDialogSidebarMenuBadge, DetailDialogSidebarMenuButton, DetailDialogSidebarMenuItem, DetailDialogSidebarMenuSkeleton, DetailDialogSidebarMenuSub, DetailDialogSidebarMenuSubButton, DetailDialogSidebarMenuSubItem, DetailDialogSidebarRail, DetailDialogSidebarSeparator, DetailDialogSidebarTrigger, Sidebar, SidebarInset, SidebarProvider, useSidebar };
|
|
209
209
|
//# sourceMappingURL=sidebar.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-tnhb123u.cjs`),require(`../../button-CwDT3m4m.cjs`),require(`../../skeleton-BfMCjXYM.cjs`);const t=require(`../../flex-BbbogTsZ.cjs`),n=require(`../../date-a3RI5Pwo.cjs`);require(`../../tooltip-itUmYz9k.cjs`);const r=require(`../../typography/title.cjs`);require(`../../separator-BwZb12bh.cjs`),require(`../../sheet-CaDXTx7n.cjs`);const i=require(`../../sidebar-CcJCnqLb.cjs`);let a=require(`lucide-react`),o=require(`react`),s=require(`react/jsx-runtime`),c=require(`@customafk/react-toolkit/utils`),l=require(`radix-ui`);const u=({open:e,isLoading:u,title:d,createdAt:f,onOpenChange:p,sidebar:m,children:h})=>{let{content:g,footer:_}=m||{},v=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]);return(0,s.jsx)(l.Dialog.Root,{"data-slot":`detail-dialog`,open:e,onOpenChange:p,children:(0,s.jsxs)(l.Dialog.Portal,{"data-slot":`detail-dialog-portal`,children:[(0,s.jsx)(l.Dialog.Overlay,{"data-slot":`detail-dialog-overlay`,className:`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,s.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:(0,s.jsxs)(l.Dialog.Content,{"data-slot":`dialog-content`,className:(0,c.cn)(`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-80 data-[state=open]:zoom-in-80`,`relative z-50 grid`,`gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200`,`h-full max-h-dvh w-full max-w-svw`,`sm:rounded-lg`,`sm:max-w-lg`,`md:max-h-[calc(100dvh-2rem)]`,`md:max-w-[calc(100svw-2rem)]`),onInteractOutside:v,children:[(0,s.jsxs)(i.S,{children:[(0,s.jsxs)(i.b,{collapsible:`icon`,children:[(0,s.jsx)(i.s,{children:(0,s.jsx)(i.c,{children:(0,s.jsx)(i.f,{children:(0,s.jsxs)(i.d,{size:`lg`,tabIndex:-1,children:[(0,s.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,s.jsx)(a.CatIcon,{size:16})}),(0,s.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,s.jsx)(`span`,{className:`truncate font-medium`,children:m?.title||`Detail Dialog`}),(0,s.jsx)(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),(0,s.jsx)(i.t,{children:g}),(0,s.jsx)(i.n,{children:_})]}),(0,s.jsx)(`main`,{"data-slot":`detail-dialog-main`,className:`relative h-full flex-1`,children:(0,s.jsxs)(t.t,{padding:`none`,gap:`none`,vertical:!0,align:`stretch`,className:`absolute inset-0 size-full`,children:[(0,s.jsxs)(`header`,{className:`flex w-full flex-0 items-start gap-x-2.5 border-b border-border-weak bg-card py-2.5 pr-12 pl-2`,children:[(0,s.jsx)(i.y,{}),(0,s.jsxs)(t.t,{vertical:!0,align:`start`,padding:`none`,width:`null`,wrap:!1,className:`flex-1 gap-0`,children:[(0,s.jsx)(r.Title,{level:5,className:`line-clamp-1 truncate text-wrap`,children:d||`Detail Dialog`}),!!f&&(0,s.jsxs)(t.t,{padding:`none`,className:`relative items-center text-text-positive-weak`,children:[(0,s.jsx)(a.CalendarIcon,{size:12}),(0,s.jsx)(n.t,{showTime:!0,showHoliday:!0,date:f,format:`full`})]})]})]}),u?(0,s.jsx)(t.t,{justify:`center`,className:`inset-shadow-sm w-full flex-1 bg-muted-muted`,children:(0,s.jsx)(`div`,{className:`loader`})}):(0,s.jsx)(`section`,{"data-slot":`detail-dialog-body`,className:`relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-tnhb123u.cjs`),require(`../../button-CwDT3m4m.cjs`),require(`../../skeleton-BfMCjXYM.cjs`);const t=require(`../../flex-BbbogTsZ.cjs`),n=require(`../../date-a3RI5Pwo.cjs`);require(`../../tooltip-itUmYz9k.cjs`);const r=require(`../../typography/title.cjs`);require(`../../separator-BwZb12bh.cjs`),require(`../../sheet-CaDXTx7n.cjs`);const i=require(`../../sidebar-CcJCnqLb.cjs`);let a=require(`lucide-react`),o=require(`react`),s=require(`react/jsx-runtime`),c=require(`@customafk/react-toolkit/utils`),l=require(`radix-ui`);const u=({open:e,isLoading:u,title:d,createdAt:f,onOpenChange:p,sidebar:m,children:h})=>{let{content:g,footer:_}=m||{},v=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]);return(0,s.jsx)(l.Dialog.Root,{"data-slot":`detail-dialog`,open:e,onOpenChange:p,children:(0,s.jsxs)(l.Dialog.Portal,{"data-slot":`detail-dialog-portal`,children:[(0,s.jsx)(l.Dialog.Overlay,{"data-slot":`detail-dialog-overlay`,className:`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,s.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:(0,s.jsxs)(l.Dialog.Content,{"data-slot":`dialog-content`,className:(0,c.cn)(`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-80 data-[state=open]:zoom-in-80`,`relative z-50 grid`,`gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200`,`h-full max-h-dvh w-full max-w-svw`,`sm:rounded-lg`,`sm:max-w-lg`,`md:max-h-[calc(100dvh-2rem)]`,`md:max-w-[calc(100svw-2rem)]`),onInteractOutside:v,children:[(0,s.jsxs)(i.S,{children:[(0,s.jsxs)(i.b,{collapsible:`icon`,children:[(0,s.jsx)(i.s,{children:(0,s.jsx)(i.c,{children:(0,s.jsx)(i.f,{children:(0,s.jsxs)(i.d,{size:`lg`,tabIndex:-1,children:[(0,s.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,s.jsx)(a.CatIcon,{size:16})}),(0,s.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,s.jsx)(`span`,{className:`truncate font-medium`,children:m?.title||`Detail Dialog`}),(0,s.jsx)(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),(0,s.jsx)(i.t,{children:g}),(0,s.jsx)(i.n,{children:_})]}),(0,s.jsx)(`main`,{"data-slot":`detail-dialog-main`,className:`relative h-full flex-1`,children:(0,s.jsxs)(t.t,{padding:`none`,gap:`none`,vertical:!0,align:`stretch`,className:`absolute inset-0 size-full`,children:[(0,s.jsxs)(`header`,{className:`flex w-full flex-0 items-start gap-x-2.5 border-b border-border-weak bg-card py-2.5 pr-12 pl-2`,children:[(0,s.jsx)(i.y,{}),(0,s.jsxs)(t.t,{vertical:!0,align:`start`,padding:`none`,width:`null`,wrap:!1,className:`flex-1 gap-0`,children:[(0,s.jsx)(r.Title,{level:5,className:`line-clamp-1 truncate text-wrap`,children:d||`Detail Dialog`}),!!f&&(0,s.jsxs)(t.t,{padding:`none`,className:`relative items-center text-text-positive-weak`,children:[(0,s.jsx)(a.CalendarIcon,{size:12}),(0,s.jsx)(n.t,{showTime:!0,showHoliday:!0,date:f,format:`full`})]})]})]}),u?(0,s.jsx)(t.t,{justify:`center`,className:`inset-shadow-sm w-full flex-1 bg-muted-muted`,children:(0,s.jsx)(`div`,{className:`loader`})}):(0,s.jsx)(`section`,{"data-slot":`detail-dialog-body`,className:`relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-white`,children:h})]})})]}),(0,s.jsx)(l.Dialog.Close,{"data-slot":`dialog-close`,tabIndex:-1,asChild:!0,className:`absolute top-3 right-3`,children:(0,s.jsx)(`button`,{className:`flex cursor-pointer items-center justify-center rounded-full 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,s.jsx)(a.XIcon,{size:24})})})]})})]})})};exports.DetailDialog=u;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DetailDialog: React.FC<React.PropsWithChildren<DetailDialogProps>>","DialogPrimitive","SidebarProvider","Sidebar","DetailDialogSidebarHeader","DetailDialogSidebarMenu","DetailDialogSidebarMenuItem","DetailDialogSidebarMenuButton","CatIcon","DetailDialogSidebarContent","DetailDialogSidebarFooter","Flex","DetailDialogSidebarTrigger","Title","CalendarIcon","DateDisplay","XIcon"],"sources":["../../../packages/components/dialogs/detail-dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\n\nimport { CalendarIcon, CatIcon, XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { DateDisplay } from '@/components/data-display/date';\nimport { Flex } from '@/components/layouts/flex';\nimport { Title } from '@/components/typography/title';\n\nimport {\n DetailDialogSidebarContent,\n DetailDialogSidebarFooter,\n DetailDialogSidebarHeader,\n DetailDialogSidebarMenu,\n DetailDialogSidebarMenuButton,\n DetailDialogSidebarMenuItem,\n DetailDialogSidebarTrigger,\n Sidebar,\n SidebarProvider,\n} from './components/sidebar';\n\ntype DetailDialogSidebar = {\n /** Title shown in the collapsible sidebar header. Defaults to `'Detail Dialog'`. */\n title?: string;\n /** Arbitrary content rendered inside the sidebar scrollable area. */\n content?: React.ReactNode;\n /** Arbitrary content rendered at the bottom of the sidebar footer. */\n footer?: React.ReactNode;\n};\n\nexport type DetailDialogProps = {\n /** Controls whether the dialog is open. */\n open?: boolean;\n /** When `true`, replaces the main content area with a centered loading spinner. */\n isLoading?: boolean;\n /** Primary title displayed in the dialog header. */\n title: string;\n /** ISO string, `Date` object, or Unix timestamp shown as a formatted creation date below the title. */\n createdAt?: string | Date | number | null;\n /** Optional sidebar configuration — title, body content, and footer content. */\n sidebar?: DetailDialogSidebar;\n /** Callback invoked when the dialog open state changes. */\n onOpenChange?: (open: boolean) => void;\n};\n\n/**\n * Full-screen detail dialog with a collapsible sidebar, a header with creation date, and a scrollable content area.\n *\n * @example\n * ```tsx\n * import { DetailDialog } from '@customafk/lunas-ui/dialogs/detail-dialog';\n *\n * <DetailDialog\n * open={open}\n * title=\"Order #1234\"\n * createdAt=\"2024-01-15T09:00:00Z\"\n * sidebar={{ title: 'Navigation', content: <nav>...</nav> }}\n * onOpenChange={setOpen}\n * >\n * <p>Detail content goes here.</p>\n * </DetailDialog>\n * ```\n */\nexport const DetailDialog: React.FC<React.PropsWithChildren<DetailDialogProps>> = ({ open, isLoading, title, createdAt, onOpenChange, sidebar, children }) => {\n const { content: SidebarContent, footer: SidebarFooter } = sidebar || {};\n\n const handleInteractOutside = useCallback<NonNullable<React.ComponentProps<typeof DialogPrimitive.Content>['onInteractOutside']>>(event => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n return (\n <DialogPrimitive.Root data-slot=\"detail-dialog\" open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal data-slot=\"detail-dialog-portal\">\n <DialogPrimitive.Overlay\n data-slot=\"detail-dialog-overlay\"\n className=\"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\"\n />\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-80 data-[state=open]:zoom-in-80',\n 'relative z-50 grid',\n 'gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200',\n 'h-full max-h-dvh w-full max-w-svw',\n 'sm:rounded-lg',\n 'sm:max-w-lg',\n 'md:max-h-[calc(100dvh-2rem)]',\n 'md:max-w-[calc(100svw-2rem)]'\n )}\n onInteractOutside={handleInteractOutside}\n >\n <SidebarProvider>\n <Sidebar collapsible=\"icon\">\n <DetailDialogSidebarHeader>\n <DetailDialogSidebarMenu>\n <DetailDialogSidebarMenuItem>\n <DetailDialogSidebarMenuButton size=\"lg\" tabIndex={-1}>\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <CatIcon size={16} />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{sidebar?.title || 'Detail Dialog'}</span>\n <span className=\"truncate text-xs\">Lunas Enterprise</span>\n </div>\n </DetailDialogSidebarMenuButton>\n </DetailDialogSidebarMenuItem>\n </DetailDialogSidebarMenu>\n </DetailDialogSidebarHeader>\n <DetailDialogSidebarContent>{SidebarContent}</DetailDialogSidebarContent>\n <DetailDialogSidebarFooter>{SidebarFooter}</DetailDialogSidebarFooter>\n </Sidebar>\n\n <main data-slot=\"detail-dialog-main\" className=\"relative h-full flex-1\">\n <Flex padding=\"none\" gap=\"none\" vertical align=\"stretch\" className=\"absolute inset-0 size-full\">\n <header className=\"flex w-full flex-0 items-start gap-x-2.5 border-b border-border-weak bg-card py-2.5 pr-12 pl-2\">\n <DetailDialogSidebarTrigger />\n <Flex vertical align=\"start\" padding=\"none\" width=\"null\" wrap={false} className=\"flex-1 gap-0\">\n <Title level={5} className=\"line-clamp-1 truncate text-wrap\">\n {title || 'Detail Dialog'}\n </Title>\n {!!createdAt && (\n <Flex padding=\"none\" className=\"relative items-center text-text-positive-weak\">\n <CalendarIcon size={12} />\n <DateDisplay showTime showHoliday date={createdAt} format=\"full\" />\n </Flex>\n )}\n </Flex>\n </header>\n {isLoading ? (\n <Flex justify=\"center\" className=\"inset-shadow-sm w-full flex-1 bg-muted-muted\">\n <div className=\"loader\" />\n </Flex>\n ) : (\n <section data-slot=\"detail-dialog-body\" className=\"relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-card\">\n {children}\n </section>\n )}\n </Flex>\n </main>\n </SidebarProvider>\n\n <DialogPrimitive.Close data-slot=\"dialog-close\" tabIndex={-1} asChild className=\"absolute top-3 right-3\">\n <button className=\"flex cursor-pointer items-center justify-center rounded-full 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\">\n <XIcon size={24} />\n </button>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </div>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["DetailDialog: React.FC<React.PropsWithChildren<DetailDialogProps>>","DialogPrimitive","SidebarProvider","Sidebar","DetailDialogSidebarHeader","DetailDialogSidebarMenu","DetailDialogSidebarMenuItem","DetailDialogSidebarMenuButton","CatIcon","DetailDialogSidebarContent","DetailDialogSidebarFooter","Flex","DetailDialogSidebarTrigger","Title","CalendarIcon","DateDisplay","XIcon"],"sources":["../../../packages/components/dialogs/detail-dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\n\nimport { CalendarIcon, CatIcon, XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { DateDisplay } from '@/components/data-display/date';\nimport { Flex } from '@/components/layouts/flex';\nimport { Title } from '@/components/typography/title';\n\nimport {\n DetailDialogSidebarContent,\n DetailDialogSidebarFooter,\n DetailDialogSidebarHeader,\n DetailDialogSidebarMenu,\n DetailDialogSidebarMenuButton,\n DetailDialogSidebarMenuItem,\n DetailDialogSidebarTrigger,\n Sidebar,\n SidebarProvider,\n} from './components/sidebar';\n\ntype DetailDialogSidebar = {\n /** Title shown in the collapsible sidebar header. Defaults to `'Detail Dialog'`. */\n title?: string;\n /** Arbitrary content rendered inside the sidebar scrollable area. */\n content?: React.ReactNode;\n /** Arbitrary content rendered at the bottom of the sidebar footer. */\n footer?: React.ReactNode;\n};\n\nexport type DetailDialogProps = {\n /** Controls whether the dialog is open. */\n open?: boolean;\n /** When `true`, replaces the main content area with a centered loading spinner. */\n isLoading?: boolean;\n /** Primary title displayed in the dialog header. */\n title: string;\n /** ISO string, `Date` object, or Unix timestamp shown as a formatted creation date below the title. */\n createdAt?: string | Date | number | null;\n /** Optional sidebar configuration — title, body content, and footer content. */\n sidebar?: DetailDialogSidebar;\n /** Callback invoked when the dialog open state changes. */\n onOpenChange?: (open: boolean) => void;\n};\n\n/**\n * Full-screen detail dialog with a collapsible sidebar, a header with creation date, and a scrollable content area.\n *\n * @example\n * ```tsx\n * import { DetailDialog } from '@customafk/lunas-ui/dialogs/detail-dialog';\n *\n * <DetailDialog\n * open={open}\n * title=\"Order #1234\"\n * createdAt=\"2024-01-15T09:00:00Z\"\n * sidebar={{ title: 'Navigation', content: <nav>...</nav> }}\n * onOpenChange={setOpen}\n * >\n * <p>Detail content goes here.</p>\n * </DetailDialog>\n * ```\n */\nexport const DetailDialog: React.FC<React.PropsWithChildren<DetailDialogProps>> = ({ open, isLoading, title, createdAt, onOpenChange, sidebar, children }) => {\n const { content: SidebarContent, footer: SidebarFooter } = sidebar || {};\n\n const handleInteractOutside = useCallback<NonNullable<React.ComponentProps<typeof DialogPrimitive.Content>['onInteractOutside']>>(event => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n return (\n <DialogPrimitive.Root data-slot=\"detail-dialog\" open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal data-slot=\"detail-dialog-portal\">\n <DialogPrimitive.Overlay\n data-slot=\"detail-dialog-overlay\"\n className=\"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\"\n />\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-80 data-[state=open]:zoom-in-80',\n 'relative z-50 grid',\n 'gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200',\n 'h-full max-h-dvh w-full max-w-svw',\n 'sm:rounded-lg',\n 'sm:max-w-lg',\n 'md:max-h-[calc(100dvh-2rem)]',\n 'md:max-w-[calc(100svw-2rem)]'\n )}\n onInteractOutside={handleInteractOutside}\n >\n <SidebarProvider>\n <Sidebar collapsible=\"icon\">\n <DetailDialogSidebarHeader>\n <DetailDialogSidebarMenu>\n <DetailDialogSidebarMenuItem>\n <DetailDialogSidebarMenuButton size=\"lg\" tabIndex={-1}>\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <CatIcon size={16} />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{sidebar?.title || 'Detail Dialog'}</span>\n <span className=\"truncate text-xs\">Lunas Enterprise</span>\n </div>\n </DetailDialogSidebarMenuButton>\n </DetailDialogSidebarMenuItem>\n </DetailDialogSidebarMenu>\n </DetailDialogSidebarHeader>\n <DetailDialogSidebarContent>{SidebarContent}</DetailDialogSidebarContent>\n <DetailDialogSidebarFooter>{SidebarFooter}</DetailDialogSidebarFooter>\n </Sidebar>\n\n <main data-slot=\"detail-dialog-main\" className=\"relative h-full flex-1\">\n <Flex padding=\"none\" gap=\"none\" vertical align=\"stretch\" className=\"absolute inset-0 size-full\">\n <header className=\"flex w-full flex-0 items-start gap-x-2.5 border-b border-border-weak bg-card py-2.5 pr-12 pl-2\">\n <DetailDialogSidebarTrigger />\n <Flex vertical align=\"start\" padding=\"none\" width=\"null\" wrap={false} className=\"flex-1 gap-0\">\n <Title level={5} className=\"line-clamp-1 truncate text-wrap\">\n {title || 'Detail Dialog'}\n </Title>\n {!!createdAt && (\n <Flex padding=\"none\" className=\"relative items-center text-text-positive-weak\">\n <CalendarIcon size={12} />\n <DateDisplay showTime showHoliday date={createdAt} format=\"full\" />\n </Flex>\n )}\n </Flex>\n </header>\n {isLoading ? (\n <Flex justify=\"center\" className=\"inset-shadow-sm w-full flex-1 bg-muted-muted\">\n <div className=\"loader\" />\n </Flex>\n ) : (\n <section data-slot=\"detail-dialog-body\" className=\"relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-white\">\n {children}\n </section>\n )}\n </Flex>\n </main>\n </SidebarProvider>\n\n <DialogPrimitive.Close data-slot=\"dialog-close\" tabIndex={-1} asChild className=\"absolute top-3 right-3\">\n <button className=\"flex cursor-pointer items-center justify-center rounded-full 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\">\n <XIcon size={24} />\n </button>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </div>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n"],"mappings":"mmBAmEA,MAAaA,GAAsE,CAAE,OAAM,YAAW,QAAO,YAAW,eAAc,UAAS,cAAe,CAC5J,GAAM,CAAE,QAAS,EAAgB,OAAQ,GAAkB,GAAW,EAAE,CAElE,GAAA,EAAA,EAAA,aAA4H,GAAS,CACzI,EAAM,gBAAgB,CACtB,EAAM,iBAAiB,EACtB,EAAE,CAAC,CAEN,OACE,EAAA,EAAA,KAACC,EAAAA,OAAgB,KAAA,CAAK,YAAU,gBAAsB,OAAoB,yBACxE,EAAA,EAAA,MAACA,EAAAA,OAAgB,OAAA,CAAO,YAAU,kCAChC,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,wBACV,UAAU,0JACV,EACF,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,gEACb,EAAA,EAAA,MAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,WAAA,EAAA,EAAA,IACE,+DACA,6DACA,+DACA,qBACA,2GACA,oCACA,gBACA,cACA,+BACA,+BACD,CACD,kBAAmB,aAEnB,EAAA,EAAA,MAACC,EAAAA,EAAAA,CAAAA,SAAAA,EACC,EAAA,EAAA,MAACC,EAAAA,EAAAA,CAAQ,YAAY,kBACnB,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,MAACC,EAAAA,EAAAA,CAA8B,KAAK,KAAK,SAAU,cACjD,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,gIACb,EAAA,EAAA,KAACC,EAAAA,QAAAA,CAAQ,KAAM,GAAA,CAAM,EACjB,EACN,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,yDACb,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,gCAAwB,GAAS,OAAS,iBAAuB,EACjF,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,4BAAmB,oBAAuB,CAAA,EACtD,CAAA,EACwB,CAAA,CACJ,CAAA,CACN,CAAA,CACA,EAC5B,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,SAA4B,EAAA,CAA4C,EACzE,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,SAA2B,EAAA,CAA0C,GAC9D,EAEV,EAAA,EAAA,KAAC,OAAA,CAAK,YAAU,qBAAqB,UAAU,mCAC7C,EAAA,EAAA,MAACC,EAAAA,EAAAA,CAAK,QAAQ,OAAO,IAAI,OAAO,SAAA,GAAS,MAAM,UAAU,UAAU,wCACjE,EAAA,EAAA,MAAC,SAAA,CAAO,UAAU,4GAChB,EAAA,EAAA,KAACC,EAAAA,EAAAA,EAAAA,CAA6B,EAC9B,EAAA,EAAA,MAACD,EAAAA,EAAAA,CAAK,SAAA,GAAS,MAAM,QAAQ,QAAQ,OAAO,MAAM,OAAO,KAAM,GAAO,UAAU,0BAC9E,EAAA,EAAA,KAACE,EAAAA,MAAAA,CAAM,MAAO,EAAG,UAAU,2CACxB,GAAS,iBACJ,CACP,CAAC,CAAC,IACD,EAAA,EAAA,MAACF,EAAAA,EAAAA,CAAK,QAAQ,OAAO,UAAU,2DAC7B,EAAA,EAAA,KAACG,EAAAA,aAAAA,CAAa,KAAM,GAAA,CAAM,EAC1B,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAY,SAAA,GAAS,YAAA,GAAY,KAAM,EAAW,OAAO,QAAS,CAAA,EAC9D,CAAA,EAEJ,CAAA,EACA,CACR,GACC,EAAA,EAAA,KAACJ,EAAAA,EAAAA,CAAK,QAAQ,SAAS,UAAU,yDAC/B,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,SAAA,CAAW,EACrB,EAEP,EAAA,EAAA,KAAC,UAAA,CAAQ,YAAU,qBAAqB,UAAU,sFAC/C,YACO,CAAA,EAEP,EACF,CAAA,CAAA,CACS,EAElB,EAAA,EAAA,KAACV,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,SAAU,GAAI,QAAA,GAAQ,UAAU,mCAC9E,EAAA,EAAA,KAAC,SAAA,CAAO,UAAU,4QAChB,EAAA,EAAA,KAACe,EAAAA,MAAAA,CAAM,KAAM,GAAA,CAAM,EACZ,EACa,CAAA,EACA,EACtB,CAAA,EACiB,EACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import"../../button.variants-DeCyas1F.mjs";import"../../button-C6ybzxxj.mjs";import"../../skeleton-BPxcW2yu.mjs";import{t as e}from"../../flex-BLMTj7Ev.mjs";import{t}from"../../date-CVz9xdCg.mjs";import"../../tooltip-Bj0iOG4s.mjs";import{Title as n}from"../../typography/title.mjs";import"../../separator-BMsbHAVt.mjs";import"../../sheet-DMIqn1iv.mjs";import{S as r,b as i,c as a,d as o,f as s,n as c,s as l,t as u,y as d}from"../../sidebar-QmCQFs8h.mjs";import{CalendarIcon as f,CatIcon as p,XIcon as m}from"lucide-react";import{useCallback as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{cn as v}from"@customafk/react-toolkit/utils";import{Dialog as y}from"radix-ui";const b=({open:b,isLoading:x,title:S,createdAt:C,onOpenChange:w,sidebar:T,children:E})=>{let{content:D,footer:O}=T||{},k=h(e=>{e.preventDefault(),e.stopPropagation()},[]);return g(y.Root,{"data-slot":`detail-dialog`,open:b,onOpenChange:w,children:_(y.Portal,{"data-slot":`detail-dialog-portal`,children:[g(y.Overlay,{"data-slot":`detail-dialog-overlay`,className:`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),g(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:_(y.Content,{"data-slot":`dialog-content`,className:v(`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-80 data-[state=open]:zoom-in-80`,`relative z-50 grid`,`gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200`,`h-full max-h-dvh w-full max-w-svw`,`sm:rounded-lg`,`sm:max-w-lg`,`md:max-h-[calc(100dvh-2rem)]`,`md:max-w-[calc(100svw-2rem)]`),onInteractOutside:k,children:[_(r,{children:[_(i,{collapsible:`icon`,children:[g(l,{children:g(a,{children:g(s,{children:_(o,{size:`lg`,tabIndex:-1,children:[g(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:g(p,{size:16})}),_(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[g(`span`,{className:`truncate font-medium`,children:T?.title||`Detail Dialog`}),g(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),g(u,{children:D}),g(c,{children:O})]}),g(`main`,{"data-slot":`detail-dialog-main`,className:`relative h-full flex-1`,children:_(e,{padding:`none`,gap:`none`,vertical:!0,align:`stretch`,className:`absolute inset-0 size-full`,children:[_(`header`,{className:`flex w-full flex-0 items-start gap-x-2.5 border-b border-border-weak bg-card py-2.5 pr-12 pl-2`,children:[g(d,{}),_(e,{vertical:!0,align:`start`,padding:`none`,width:`null`,wrap:!1,className:`flex-1 gap-0`,children:[g(n,{level:5,className:`line-clamp-1 truncate text-wrap`,children:S||`Detail Dialog`}),!!C&&_(e,{padding:`none`,className:`relative items-center text-text-positive-weak`,children:[g(f,{size:12}),g(t,{showTime:!0,showHoliday:!0,date:C,format:`full`})]})]})]}),x?g(e,{justify:`center`,className:`inset-shadow-sm w-full flex-1 bg-muted-muted`,children:g(`div`,{className:`loader`})}):g(`section`,{"data-slot":`detail-dialog-body`,className:`relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-
|
|
1
|
+
"use client";import"../../button.variants-DeCyas1F.mjs";import"../../button-C6ybzxxj.mjs";import"../../skeleton-BPxcW2yu.mjs";import{t as e}from"../../flex-BLMTj7Ev.mjs";import{t}from"../../date-CVz9xdCg.mjs";import"../../tooltip-Bj0iOG4s.mjs";import{Title as n}from"../../typography/title.mjs";import"../../separator-BMsbHAVt.mjs";import"../../sheet-DMIqn1iv.mjs";import{S as r,b as i,c as a,d as o,f as s,n as c,s as l,t as u,y as d}from"../../sidebar-QmCQFs8h.mjs";import{CalendarIcon as f,CatIcon as p,XIcon as m}from"lucide-react";import{useCallback as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{cn as v}from"@customafk/react-toolkit/utils";import{Dialog as y}from"radix-ui";const b=({open:b,isLoading:x,title:S,createdAt:C,onOpenChange:w,sidebar:T,children:E})=>{let{content:D,footer:O}=T||{},k=h(e=>{e.preventDefault(),e.stopPropagation()},[]);return g(y.Root,{"data-slot":`detail-dialog`,open:b,onOpenChange:w,children:_(y.Portal,{"data-slot":`detail-dialog-portal`,children:[g(y.Overlay,{"data-slot":`detail-dialog-overlay`,className:`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),g(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:_(y.Content,{"data-slot":`dialog-content`,className:v(`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-80 data-[state=open]:zoom-in-80`,`relative z-50 grid`,`gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200`,`h-full max-h-dvh w-full max-w-svw`,`sm:rounded-lg`,`sm:max-w-lg`,`md:max-h-[calc(100dvh-2rem)]`,`md:max-w-[calc(100svw-2rem)]`),onInteractOutside:k,children:[_(r,{children:[_(i,{collapsible:`icon`,children:[g(l,{children:g(a,{children:g(s,{children:_(o,{size:`lg`,tabIndex:-1,children:[g(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:g(p,{size:16})}),_(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[g(`span`,{className:`truncate font-medium`,children:T?.title||`Detail Dialog`}),g(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),g(u,{children:D}),g(c,{children:O})]}),g(`main`,{"data-slot":`detail-dialog-main`,className:`relative h-full flex-1`,children:_(e,{padding:`none`,gap:`none`,vertical:!0,align:`stretch`,className:`absolute inset-0 size-full`,children:[_(`header`,{className:`flex w-full flex-0 items-start gap-x-2.5 border-b border-border-weak bg-card py-2.5 pr-12 pl-2`,children:[g(d,{}),_(e,{vertical:!0,align:`start`,padding:`none`,width:`null`,wrap:!1,className:`flex-1 gap-0`,children:[g(n,{level:5,className:`line-clamp-1 truncate text-wrap`,children:S||`Detail Dialog`}),!!C&&_(e,{padding:`none`,className:`relative items-center text-text-positive-weak`,children:[g(f,{size:12}),g(t,{showTime:!0,showHoliday:!0,date:C,format:`full`})]})]})]}),x?g(e,{justify:`center`,className:`inset-shadow-sm w-full flex-1 bg-muted-muted`,children:g(`div`,{className:`loader`})}):g(`section`,{"data-slot":`detail-dialog-body`,className:`relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-white`,children:E})]})})]}),g(y.Close,{"data-slot":`dialog-close`,tabIndex:-1,asChild:!0,className:`absolute top-3 right-3`,children:g(`button`,{className:`flex cursor-pointer items-center justify-center rounded-full 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:g(m,{size:24})})})]})})]})})};export{b as DetailDialog};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["DetailDialog: React.FC<React.PropsWithChildren<DetailDialogProps>>","DialogPrimitive"],"sources":["../../../packages/components/dialogs/detail-dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\n\nimport { CalendarIcon, CatIcon, XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { DateDisplay } from '@/components/data-display/date';\nimport { Flex } from '@/components/layouts/flex';\nimport { Title } from '@/components/typography/title';\n\nimport {\n DetailDialogSidebarContent,\n DetailDialogSidebarFooter,\n DetailDialogSidebarHeader,\n DetailDialogSidebarMenu,\n DetailDialogSidebarMenuButton,\n DetailDialogSidebarMenuItem,\n DetailDialogSidebarTrigger,\n Sidebar,\n SidebarProvider,\n} from './components/sidebar';\n\ntype DetailDialogSidebar = {\n /** Title shown in the collapsible sidebar header. Defaults to `'Detail Dialog'`. */\n title?: string;\n /** Arbitrary content rendered inside the sidebar scrollable area. */\n content?: React.ReactNode;\n /** Arbitrary content rendered at the bottom of the sidebar footer. */\n footer?: React.ReactNode;\n};\n\nexport type DetailDialogProps = {\n /** Controls whether the dialog is open. */\n open?: boolean;\n /** When `true`, replaces the main content area with a centered loading spinner. */\n isLoading?: boolean;\n /** Primary title displayed in the dialog header. */\n title: string;\n /** ISO string, `Date` object, or Unix timestamp shown as a formatted creation date below the title. */\n createdAt?: string | Date | number | null;\n /** Optional sidebar configuration — title, body content, and footer content. */\n sidebar?: DetailDialogSidebar;\n /** Callback invoked when the dialog open state changes. */\n onOpenChange?: (open: boolean) => void;\n};\n\n/**\n * Full-screen detail dialog with a collapsible sidebar, a header with creation date, and a scrollable content area.\n *\n * @example\n * ```tsx\n * import { DetailDialog } from '@customafk/lunas-ui/dialogs/detail-dialog';\n *\n * <DetailDialog\n * open={open}\n * title=\"Order #1234\"\n * createdAt=\"2024-01-15T09:00:00Z\"\n * sidebar={{ title: 'Navigation', content: <nav>...</nav> }}\n * onOpenChange={setOpen}\n * >\n * <p>Detail content goes here.</p>\n * </DetailDialog>\n * ```\n */\nexport const DetailDialog: React.FC<React.PropsWithChildren<DetailDialogProps>> = ({ open, isLoading, title, createdAt, onOpenChange, sidebar, children }) => {\n const { content: SidebarContent, footer: SidebarFooter } = sidebar || {};\n\n const handleInteractOutside = useCallback<NonNullable<React.ComponentProps<typeof DialogPrimitive.Content>['onInteractOutside']>>(event => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n return (\n <DialogPrimitive.Root data-slot=\"detail-dialog\" open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal data-slot=\"detail-dialog-portal\">\n <DialogPrimitive.Overlay\n data-slot=\"detail-dialog-overlay\"\n className=\"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\"\n />\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-80 data-[state=open]:zoom-in-80',\n 'relative z-50 grid',\n 'gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200',\n 'h-full max-h-dvh w-full max-w-svw',\n 'sm:rounded-lg',\n 'sm:max-w-lg',\n 'md:max-h-[calc(100dvh-2rem)]',\n 'md:max-w-[calc(100svw-2rem)]'\n )}\n onInteractOutside={handleInteractOutside}\n >\n <SidebarProvider>\n <Sidebar collapsible=\"icon\">\n <DetailDialogSidebarHeader>\n <DetailDialogSidebarMenu>\n <DetailDialogSidebarMenuItem>\n <DetailDialogSidebarMenuButton size=\"lg\" tabIndex={-1}>\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <CatIcon size={16} />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{sidebar?.title || 'Detail Dialog'}</span>\n <span className=\"truncate text-xs\">Lunas Enterprise</span>\n </div>\n </DetailDialogSidebarMenuButton>\n </DetailDialogSidebarMenuItem>\n </DetailDialogSidebarMenu>\n </DetailDialogSidebarHeader>\n <DetailDialogSidebarContent>{SidebarContent}</DetailDialogSidebarContent>\n <DetailDialogSidebarFooter>{SidebarFooter}</DetailDialogSidebarFooter>\n </Sidebar>\n\n <main data-slot=\"detail-dialog-main\" className=\"relative h-full flex-1\">\n <Flex padding=\"none\" gap=\"none\" vertical align=\"stretch\" className=\"absolute inset-0 size-full\">\n <header className=\"flex w-full flex-0 items-start gap-x-2.5 border-b border-border-weak bg-card py-2.5 pr-12 pl-2\">\n <DetailDialogSidebarTrigger />\n <Flex vertical align=\"start\" padding=\"none\" width=\"null\" wrap={false} className=\"flex-1 gap-0\">\n <Title level={5} className=\"line-clamp-1 truncate text-wrap\">\n {title || 'Detail Dialog'}\n </Title>\n {!!createdAt && (\n <Flex padding=\"none\" className=\"relative items-center text-text-positive-weak\">\n <CalendarIcon size={12} />\n <DateDisplay showTime showHoliday date={createdAt} format=\"full\" />\n </Flex>\n )}\n </Flex>\n </header>\n {isLoading ? (\n <Flex justify=\"center\" className=\"inset-shadow-sm w-full flex-1 bg-muted-muted\">\n <div className=\"loader\" />\n </Flex>\n ) : (\n <section data-slot=\"detail-dialog-body\" className=\"relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["DetailDialog: React.FC<React.PropsWithChildren<DetailDialogProps>>","DialogPrimitive"],"sources":["../../../packages/components/dialogs/detail-dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\n\nimport { CalendarIcon, CatIcon, XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { DateDisplay } from '@/components/data-display/date';\nimport { Flex } from '@/components/layouts/flex';\nimport { Title } from '@/components/typography/title';\n\nimport {\n DetailDialogSidebarContent,\n DetailDialogSidebarFooter,\n DetailDialogSidebarHeader,\n DetailDialogSidebarMenu,\n DetailDialogSidebarMenuButton,\n DetailDialogSidebarMenuItem,\n DetailDialogSidebarTrigger,\n Sidebar,\n SidebarProvider,\n} from './components/sidebar';\n\ntype DetailDialogSidebar = {\n /** Title shown in the collapsible sidebar header. Defaults to `'Detail Dialog'`. */\n title?: string;\n /** Arbitrary content rendered inside the sidebar scrollable area. */\n content?: React.ReactNode;\n /** Arbitrary content rendered at the bottom of the sidebar footer. */\n footer?: React.ReactNode;\n};\n\nexport type DetailDialogProps = {\n /** Controls whether the dialog is open. */\n open?: boolean;\n /** When `true`, replaces the main content area with a centered loading spinner. */\n isLoading?: boolean;\n /** Primary title displayed in the dialog header. */\n title: string;\n /** ISO string, `Date` object, or Unix timestamp shown as a formatted creation date below the title. */\n createdAt?: string | Date | number | null;\n /** Optional sidebar configuration — title, body content, and footer content. */\n sidebar?: DetailDialogSidebar;\n /** Callback invoked when the dialog open state changes. */\n onOpenChange?: (open: boolean) => void;\n};\n\n/**\n * Full-screen detail dialog with a collapsible sidebar, a header with creation date, and a scrollable content area.\n *\n * @example\n * ```tsx\n * import { DetailDialog } from '@customafk/lunas-ui/dialogs/detail-dialog';\n *\n * <DetailDialog\n * open={open}\n * title=\"Order #1234\"\n * createdAt=\"2024-01-15T09:00:00Z\"\n * sidebar={{ title: 'Navigation', content: <nav>...</nav> }}\n * onOpenChange={setOpen}\n * >\n * <p>Detail content goes here.</p>\n * </DetailDialog>\n * ```\n */\nexport const DetailDialog: React.FC<React.PropsWithChildren<DetailDialogProps>> = ({ open, isLoading, title, createdAt, onOpenChange, sidebar, children }) => {\n const { content: SidebarContent, footer: SidebarFooter } = sidebar || {};\n\n const handleInteractOutside = useCallback<NonNullable<React.ComponentProps<typeof DialogPrimitive.Content>['onInteractOutside']>>(event => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n return (\n <DialogPrimitive.Root data-slot=\"detail-dialog\" open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal data-slot=\"detail-dialog-portal\">\n <DialogPrimitive.Overlay\n data-slot=\"detail-dialog-overlay\"\n className=\"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\"\n />\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-80 data-[state=open]:zoom-in-80',\n 'relative z-50 grid',\n 'gap-4 overflow-hidden rounded-none border-none bg-background p-0 shadow-dialog outline-none duration-200',\n 'h-full max-h-dvh w-full max-w-svw',\n 'sm:rounded-lg',\n 'sm:max-w-lg',\n 'md:max-h-[calc(100dvh-2rem)]',\n 'md:max-w-[calc(100svw-2rem)]'\n )}\n onInteractOutside={handleInteractOutside}\n >\n <SidebarProvider>\n <Sidebar collapsible=\"icon\">\n <DetailDialogSidebarHeader>\n <DetailDialogSidebarMenu>\n <DetailDialogSidebarMenuItem>\n <DetailDialogSidebarMenuButton size=\"lg\" tabIndex={-1}>\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <CatIcon size={16} />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{sidebar?.title || 'Detail Dialog'}</span>\n <span className=\"truncate text-xs\">Lunas Enterprise</span>\n </div>\n </DetailDialogSidebarMenuButton>\n </DetailDialogSidebarMenuItem>\n </DetailDialogSidebarMenu>\n </DetailDialogSidebarHeader>\n <DetailDialogSidebarContent>{SidebarContent}</DetailDialogSidebarContent>\n <DetailDialogSidebarFooter>{SidebarFooter}</DetailDialogSidebarFooter>\n </Sidebar>\n\n <main data-slot=\"detail-dialog-main\" className=\"relative h-full flex-1\">\n <Flex padding=\"none\" gap=\"none\" vertical align=\"stretch\" className=\"absolute inset-0 size-full\">\n <header className=\"flex w-full flex-0 items-start gap-x-2.5 border-b border-border-weak bg-card py-2.5 pr-12 pl-2\">\n <DetailDialogSidebarTrigger />\n <Flex vertical align=\"start\" padding=\"none\" width=\"null\" wrap={false} className=\"flex-1 gap-0\">\n <Title level={5} className=\"line-clamp-1 truncate text-wrap\">\n {title || 'Detail Dialog'}\n </Title>\n {!!createdAt && (\n <Flex padding=\"none\" className=\"relative items-center text-text-positive-weak\">\n <CalendarIcon size={12} />\n <DateDisplay showTime showHoliday date={createdAt} format=\"full\" />\n </Flex>\n )}\n </Flex>\n </header>\n {isLoading ? (\n <Flex justify=\"center\" className=\"inset-shadow-sm w-full flex-1 bg-muted-muted\">\n <div className=\"loader\" />\n </Flex>\n ) : (\n <section data-slot=\"detail-dialog-body\" className=\"relative inset-shadow-sm flex flex-1 snap-y flex-col gap-0 overflow-y-auto bg-white\">\n {children}\n </section>\n )}\n </Flex>\n </main>\n </SidebarProvider>\n\n <DialogPrimitive.Close data-slot=\"dialog-close\" tabIndex={-1} asChild className=\"absolute top-3 right-3\">\n <button className=\"flex cursor-pointer items-center justify-center rounded-full 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\">\n <XIcon size={24} />\n </button>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </div>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n"],"mappings":"osBAmEA,MAAaA,GAAsE,CAAE,OAAM,YAAW,QAAO,YAAW,eAAc,UAAS,cAAe,CAC5J,GAAM,CAAE,QAAS,EAAgB,OAAQ,GAAkB,GAAW,EAAE,CAElE,EAAwB,EAAoG,GAAS,CACzI,EAAM,gBAAgB,CACtB,EAAM,iBAAiB,EACtB,EAAE,CAAC,CAEN,OACE,EAACC,EAAgB,KAAA,CAAK,YAAU,gBAAsB,OAAoB,wBACxE,EAACA,EAAgB,OAAA,CAAO,YAAU,iCAChC,EAACA,EAAgB,QAAA,CACf,YAAU,wBACV,UAAU,0JACV,CACF,EAAC,MAAA,CAAI,UAAU,+DACb,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,+DACA,6DACA,+DACA,qBACA,2GACA,oCACA,gBACA,cACA,+BACA,+BACD,CACD,kBAAmB,YAEnB,EAAC,EAAA,CAAA,SAAA,CACC,EAAC,EAAA,CAAQ,YAAY,iBACnB,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAA8B,KAAK,KAAK,SAAU,aACjD,EAAC,MAAA,CAAI,UAAU,+HACb,EAAC,EAAA,CAAQ,KAAM,GAAA,CAAM,EACjB,CACN,EAAC,MAAA,CAAI,UAAU,wDACb,EAAC,OAAA,CAAK,UAAU,gCAAwB,GAAS,OAAS,iBAAuB,CACjF,EAAC,OAAA,CAAK,UAAU,4BAAmB,oBAAuB,CAAA,EACtD,CAAA,EACwB,CAAA,CACJ,CAAA,CACN,CAAA,CACA,CAC5B,EAAC,EAAA,CAAA,SAA4B,EAAA,CAA4C,CACzE,EAAC,EAAA,CAAA,SAA2B,EAAA,CAA0C,GAC9D,CAEV,EAAC,OAAA,CAAK,YAAU,qBAAqB,UAAU,kCAC7C,EAAC,EAAA,CAAK,QAAQ,OAAO,IAAI,OAAO,SAAA,GAAS,MAAM,UAAU,UAAU,uCACjE,EAAC,SAAA,CAAO,UAAU,2GAChB,EAAC,EAAA,EAAA,CAA6B,CAC9B,EAAC,EAAA,CAAK,SAAA,GAAS,MAAM,QAAQ,QAAQ,OAAO,MAAM,OAAO,KAAM,GAAO,UAAU,yBAC9E,EAAC,EAAA,CAAM,MAAO,EAAG,UAAU,2CACxB,GAAS,iBACJ,CACP,CAAC,CAAC,GACD,EAAC,EAAA,CAAK,QAAQ,OAAO,UAAU,0DAC7B,EAAC,EAAA,CAAa,KAAM,GAAA,CAAM,CAC1B,EAAC,EAAA,CAAY,SAAA,GAAS,YAAA,GAAY,KAAM,EAAW,OAAO,QAAS,CAAA,EAC9D,CAAA,EAEJ,CAAA,EACA,CACR,EACC,EAAC,EAAA,CAAK,QAAQ,SAAS,UAAU,wDAC/B,EAAC,MAAA,CAAI,UAAU,SAAA,CAAW,EACrB,CAEP,EAAC,UAAA,CAAQ,YAAU,qBAAqB,UAAU,sFAC/C,YACO,CAAA,EAEP,EACF,CAAA,CAAA,CACS,CAElB,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,SAAU,GAAI,QAAA,GAAQ,UAAU,kCAC9E,EAAC,SAAA,CAAO,UAAU,2QAChB,EAAC,EAAA,CAAM,KAAM,GAAA,CAAM,EACZ,EACa,CAAA,EACA,EACtB,CAAA,EACiB,EACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../paragraph-DN85Huc4.cjs`);require(`../../skeleton-BfMCjXYM.cjs`);const n=require(`../../image-B1Dm5LWk.cjs`);require(`../../flex-BbbogTsZ.cjs`);const r=require(`../../date-a3RI5Pwo.cjs`),i=require(`../../badge-uQ0pIZbQ.cjs`),a=require(`../../tooltip-itUmYz9k.cjs`);require(`../../avatar-CTS9-raY.cjs`);const o=require(`../../user-BEyYLDNK.cjs`);let s=require(`lucide-react`),c=require(`react`),l=require(`react/jsx-runtime`),u=require(`@customafk/react-toolkit/utils`),d=require(`class-variance-authority`);const f=()=>(0,l.jsx)(`span`,{"data-slot":`description-empty`,"aria-label":`Empty value`,className:`select-none font-medium text-sm text-text-positive-muted`,children:`—`}),p=({label:e,color:t=`secondary`,variant:n=`soft`,size:r=`sm`})=>e?(0,l.jsx)(i.t,{"data-slot":`description-badge`,color:t,variant:n,size:r,children:e}):(0,l.jsx)(f,{}),m=({value:e,trueLabel:t=`Yes`,falseLabel:n=`No`})=>e==null?(0,l.jsx)(f,{}):(0,l.jsx)(i.t,{"data-slot":`description-boolean`,variant:`soft`,color:e?`success`:`danger`,size:`sm`,children:e?t:n}),h=({value:e,truncate:t=!0})=>{let[n,r]=(0,c.useState)(!1),i=(0,c.useCallback)(async()=>{e&&(await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500))},[e]);return e?(0,l.jsxs)(`button`,{type:`button`,"data-slot":`description-copy`,onClick:i,className:(0,u.cn)(`group inline-flex max-w-full cursor-pointer items-center gap-1.5 rounded-sm border border-border-weak bg-secondary-muted px-2 py-0.5 font-mono text-xs text-text-positive-weak transition-[border-color,color,box-shadow] hover:border-border hover:text-text-positive hover:shadow-xs`,t&&`min-w-0`),children:[(0,l.jsx)(`span`,{className:(0,u.cn)(`tabular-nums`,t&&`truncate`),children:e}),n?(0,l.jsx)(s.CheckIcon,{size:12,className:`shrink-0 text-success`}):(0,l.jsx)(s.CopyIcon,{size:12,className:`shrink-0 opacity-50 group-hover:opacity-100`})]}):(0,l.jsx)(f,{})},g=({date:e})=>e==null?(0,l.jsx)(f,{}):(0,l.jsx)(a.r,{children:(0,l.jsxs)(a.t,{children:[(0,l.jsx)(a.i,{asChild:!0,children:(0,l.jsx)(r.t,{"data-slot":`description-date`,date:e,format:`medium`,className:`cursor-help underline decoration-dashed decoration-border-strong underline-offset-2`})}),(0,l.jsx)(a.n,{children:(0,l.jsx)(r.t,{date:e,format:`full`,showTime:!0,className:`text-xs font-medium`})})]})}),_=({images:e})=>{if(!e?.length)return(0,l.jsx)(f,{});let t=e.length===1;return(0,l.jsx)(`div`,{"data-slot":`description-images`,className:`flex flex-wrap gap-4`,children:e.map(e=>(0,l.jsx)(`div`,{className:t?`group relative size-42 overflow-hidden rounded-sm border border-border shadow-xs transition-shadow hover:shadow-card`:`group relative size-16 overflow-hidden rounded-lg border border-border shadow-xs transition-shadow hover:shadow-card`,children:(0,l.jsx)(n.t,{src:e.src,alt:e.alt,width:`100%`,height:`100%`,className:`transition-transform duration-200 group-hover:scale-105`})},e.id))})},v=({href:e,label:t,external:n=!0,className:r})=>e?(0,l.jsxs)(`a`,{"data-slot":`description-link`,href:e,target:n?`_blank`:void 0,rel:n?`noopener noreferrer`:void 0,className:(0,u.cn)(`inline-flex max-w-full items-center gap-1 text-sm text-primary underline decoration-dashed underline-offset-2 transition-colors hover:text-primary-strong hover:decoration-solid`,r),children:[!n&&(0,l.jsx)(s.LinkIcon,{size:12,className:`shrink-0 opacity-70`}),(0,l.jsx)(`span`,{className:`truncate`,children:t??e}),n&&(0,l.jsx)(s.ExternalLinkIcon,{size:12,className:`shrink-0 opacity-70`})]}):(0,l.jsx)(f,{}),y=({content:e})=>e==null?(0,l.jsx)(f,{}):(0,l.jsxs)(a.t,{children:[(0,l.jsx)(a.i,{asChild:!0,children:(0,l.jsx)(t.t,{"data-slot":`description-longtext`,variant:`sm`,className:`line-clamp-2 cursor-pointer whitespace-pre-line break-all text-start text-sm underline decoration-dashed decoration-border-strong underline-offset-2`,children:e})}),(0,l.jsx)(a.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,l.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,l.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,l.jsxs)(`p`,{className:`w-full text-end text-text-positive-subtle`,children:[e.toString().length,` chars`]})]})})]}),b=({name:e})=>e?(0,l.jsxs)(a.t,{children:[(0,l.jsx)(a.i,{asChild:!0,children:(0,l.jsx)(t.t,{"data-slot":`description-name`,variant:`sm`,className:`line-clamp-2 w-full cursor-pointer truncate underline decoration-dashed decoration-border-strong underline-offset-2`,children:e})}),(0,l.jsx)(a.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,l.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,l.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,l.jsxs)(`p`,{className:`w-full text-end text-text-positive-subtle`,children:[e.length,` chars`]})]})})]}):(0,l.jsx)(f,{}),x=({value:e})=>(0,l.jsxs)(a.t,{children:[(0,l.jsx)(a.i,{"data-slot":`description-phone`,children:(0,l.jsx)(t.t,{variant:`sm`,className:`tabular-nums transition-colors`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,l.jsx)(a.n,{align:`start`,children:(0,l.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),S=(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}},C=(0,d.cva)(`inline-flex items-center gap-1 font-number tabular-nums transition-colors`,{variants:{size:{xs:`text-xs`,sm:`text-sm`,md:`text-base`,lg:`text-lg`,xl:`text-xl`},trend:{neutral:`text-text-positive`,up:`text-success`,down:`text-danger`}},defaultVariants:{size:`sm`,trend:`neutral`}}),w=(0,c.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:n,suffix:r,precision:i,roundingMode:a=`round`,showTrailingZeros:o=!1,size:s=`sm`,trend:d=`neutral`,value:p=0,className:m})=>{let h=(0,c.useMemo)(()=>{let e={};return typeof i==`number`&&i>=0&&(o&&(e.minimumFractionDigits=i),e.maximumFractionDigits=i),e},[i,o]),g=(0,c.useCallback)(e=>{let t=e;return typeof i==`number`&&i>=0&&(t=S(e,i,a)),t.toLocaleString(`en-US`,h)},[a,h,i]),_=(0,c.useMemo)(()=>{if(typeof p==`number`)return Number.isNaN(p)||!Number.isFinite(p)?`N/A`:g(p);if(typeof p==`string`){let e=p.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:g(t)}return`N/A`},[p,g]),v=(0,c.useMemo)(()=>e===`.`&&t===`,`?_:_.replace(/,/g,t).replace(/\./g,e),[_,e,t]);return v===`0`||v===`N/A`||!v?(0,l.jsx)(f,{}):(0,l.jsxs)(`div`,{"data-slot":`description-statistic`,className:(0,u.cn)(C({size:s,trend:d}),m),children:[n&&(0,l.jsx)(`span`,{"data-slot":`description-statistic-prefix`,children:n}),(0,l.jsx)(`p`,{"data-slot":`description-statistic-value`,children:v}),r&&(0,l.jsx)(`span`,{"data-slot":`description-statistic-suffix`,children:r})]})});w.displayName=`DescriptionStatistic`;const T={primary:`bg-primary`,secondary:`bg-secondary`,muted:`bg-muted`,accent:`bg-accent`,info:`bg-info`,success:`bg-success`,warning:`bg-warning`,danger:`bg-danger`},E=({label:e,color:t=`info`,dot:n=!0})=>e?(0,l.jsxs)(i.t,{"data-slot":`description-status`,variant:`soft`,color:t,size:`sm`,className:`gap-1.5`,children:[n&&(0,l.jsx)(`span`,{className:(0,u.cn)(`inline-block size-1.5 shrink-0 rounded-full`,T[t])}),e]}):(0,l.jsx)(f,{}),D=({tags:e,max:t=5,color:n=`secondary`,variant:r=`soft`})=>{if(!e?.length)return(0,l.jsx)(f,{});let a=e.slice(0,t),o=e.length-a.length;return(0,l.jsxs)(`div`,{"data-slot":`description-tag-list`,className:`flex flex-wrap gap-1`,children:[a.map((e,t)=>(0,l.jsx)(i.t,{variant:r,color:n,size:`sm`,children:e},t)),o>0&&(0,l.jsxs)(i.t,{variant:`outline`,color:`muted`,size:`sm`,children:[`+`,o]})]})},O=({uuid:e,username:t,email:n})=>!e||!t||!n?(0,l.jsx)(f,{}):(0,l.jsx)(o.t,{uuid:e,username:t,email:n}),k=({label:e,labelColSpan:t=3,orientation:n=`horizontal`,action:r,children:i})=>n===`vertical`?(0,l.jsxs)(`div`,{"data-slot":`description-item`,className:`flex flex-col border-b border-b-border last:border-b-0`,children:[(0,l.jsxs)(`div`,{"data-slot":`description-item-label`,className:`flex items-center justify-between border-b border-b-border bg-secondary-muted py-2 pr-2 pl-4 text-sm font-medium text-text-positive-weak`,children:[(0,l.jsx)(`span`,{children:e}),r&&(0,l.jsx)(`div`,{className:`shrink-0`,children:r})]}),(0,l.jsx)(`div`,{"data-slot":`description-item-value`,className:`flex flex-wrap items-center gap-2 py-3 pr-2 pl-4 text-sm text-text-positive`,children:i})]}):(0,l.jsxs)(`div`,{"data-slot":`description-item`,style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},className:`grid border-b border-b-border last:border-b-0`,children:[(0,l.jsxs)(`div`,{"data-slot":`description-item-label`,style:{gridColumn:`span ${t} / span ${t}`},className:`flex min-w-full items-center justify-between overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm font-medium text-text-positive-weak tabular-nums`,children:[(0,l.jsx)(`span`,{children:e}),r&&(0,l.jsx)(`div`,{className:`shrink-0 pr-1`,children:r})]}),(0,l.jsx)(`div`,{"data-slot":`description-item-value`,style:{gridColumn:`span ${12-t} / span ${12-t}`},className:`flex flex-wrap items-center gap-2 py-3 pr-2 pl-4 text-sm text-text-positive`,children:i})]}),A=({title:e,description:t,extra:n,className:r})=>(0,l.jsxs)(`div`,{"data-slot":`description-header`,className:(0,u.cn)(`sticky top-0 z-10 flex items-start justify-between gap-4 border-b border-b-border bg-card px-4 py-3`,r),children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,l.jsx)(`p`,{className:`text-sm font-semibold text-text-positive`,children:e}),t&&(0,l.jsx)(`p`,{className:`text-xs text-text-positive-weak`,children:t})]}),n&&(0,l.jsx)(`div`,{className:`shrink-0`,children:n})]}),j=({title:e,className:t})=>(0,l.jsxs)(`div`,{"data-slot":`description-section`,className:(0,u.cn)(`flex items-center gap-3 border-b border-b-border bg-secondary-muted px-4 py-2`,t),children:[e&&(0,l.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-wide text-text-positive-muted`,children:e}),(0,l.jsx)(`div`,{className:`h-px flex-1 bg-border-weak`})]}),M=({rows:e})=>(0,l.jsxs)(`div`,{"data-slot":`description-loading`,className:`animate-pulse`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between border-b border-b-border px-4 py-3`,children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,l.jsx)(`div`,{className:`h-3.5 w-36 rounded bg-border`}),(0,l.jsx)(`div`,{className:`h-2.5 w-24 rounded bg-border-weak`})]}),(0,l.jsx)(`div`,{className:`h-5 w-16 rounded bg-border-weak`})]}),Array.from({length:e}).map((e,t)=>(0,l.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},className:`grid border-b border-b-border last:border-b-0`,children:[(0,l.jsx)(`div`,{style:{gridColumn:`span 3 / span 3`},className:`flex items-center border-r border-r-border bg-secondary-muted py-3 pl-4 pr-2`,children:(0,l.jsx)(`div`,{className:`h-3 w-20 rounded bg-border`})}),(0,l.jsx)(`div`,{style:{gridColumn:`span 9 / span 9`},className:`flex items-center py-3 pl-4 pr-2`,children:(0,l.jsx)(`div`,{className:`h-3 w-28 rounded bg-border-weak`})})]},t))]}),N=({children:e,className:t,nested:n=!1,loading:r=!1,loadingRows:i=4})=>(0,l.jsx)(`div`,{"data-slot":`description`,className:(0,u.cn)(`relative flex flex-col bg-card`,n?`w-full overflow-hidden rounded-md border border-border`:`size-full overflow-y-auto rounded-lg border border-border shadow-card ring-1 ring-border-weak`,t),children:r?(0,l.jsx)(M,{rows:i}):e});exports.Description=N,exports.DescriptionBadge=p,exports.DescriptionBoolean=m,exports.DescriptionCopy=h,exports.DescriptionDate=g,exports.DescriptionEmpty=f,exports.DescriptionHeader=A,exports.DescriptionImages=_,exports.DescriptionItem=k,exports.DescriptionLink=v,exports.DescriptionLongText=y,exports.DescriptionName=b,exports.DescriptionNumberPhone=x,exports.DescriptionSection=j,exports.DescriptionStatistic=w,exports.DescriptionStatus=E,exports.DescriptionTagList=D,exports.DescriptionUser=O;
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../paragraph-DN85Huc4.cjs`);require(`../../skeleton-BfMCjXYM.cjs`);const n=require(`../../image-B1Dm5LWk.cjs`);require(`../../flex-BbbogTsZ.cjs`);const r=require(`../../date-a3RI5Pwo.cjs`),i=require(`../../badge-uQ0pIZbQ.cjs`),a=require(`../../tooltip-itUmYz9k.cjs`);require(`../../avatar-CTS9-raY.cjs`);const o=require(`../../user-BEyYLDNK.cjs`);let s=require(`lucide-react`),c=require(`react`),l=require(`react/jsx-runtime`),u=require(`@customafk/react-toolkit/utils`),d=require(`class-variance-authority`);const f=()=>(0,l.jsx)(`span`,{"data-slot":`description-empty`,"aria-label":`Empty value`,className:`select-none font-medium text-sm text-text-positive-muted`,children:`—`}),p=({label:e,color:t=`secondary`,variant:n=`soft`,size:r=`sm`})=>e?(0,l.jsx)(i.t,{"data-slot":`description-badge`,color:t,variant:n,size:r,children:e}):(0,l.jsx)(f,{}),m=({value:e,trueLabel:t=`Yes`,falseLabel:n=`No`})=>e==null?(0,l.jsx)(f,{}):(0,l.jsx)(i.t,{"data-slot":`description-boolean`,variant:`soft`,color:e?`success`:`danger`,size:`sm`,children:e?t:n}),h=({value:e,truncate:t=!0})=>{let[n,r]=(0,c.useState)(!1),i=(0,c.useCallback)(async()=>{e&&(await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500))},[e]);return e?(0,l.jsxs)(`button`,{type:`button`,"data-slot":`description-copy`,onClick:i,className:(0,u.cn)(`group inline-flex max-w-full cursor-pointer items-center gap-1.5 rounded-sm border border-border-weak bg-secondary-muted px-2 py-0.5 font-mono text-xs text-text-positive-weak transition-[border-color,color,box-shadow] hover:border-border hover:text-text-positive hover:shadow-xs`,t&&`min-w-0`),children:[(0,l.jsx)(`span`,{className:(0,u.cn)(`tabular-nums`,t&&`truncate`),children:e}),n?(0,l.jsx)(s.CheckIcon,{size:12,className:`shrink-0 text-success`}):(0,l.jsx)(s.CopyIcon,{size:12,className:`shrink-0 opacity-50 group-hover:opacity-100`})]}):(0,l.jsx)(f,{})},g=({date:e})=>e==null?(0,l.jsx)(f,{}):(0,l.jsx)(a.r,{children:(0,l.jsxs)(a.t,{children:[(0,l.jsx)(a.i,{asChild:!0,children:(0,l.jsx)(r.t,{"data-slot":`description-date`,date:e,format:`medium`,className:`cursor-help underline decoration-dashed decoration-border-strong underline-offset-2`})}),(0,l.jsx)(a.n,{children:(0,l.jsx)(r.t,{date:e,format:`full`,showTime:!0,className:`text-xs font-medium`})})]})}),_=({images:e})=>{if(!e?.length)return(0,l.jsx)(f,{});let t=e.length===1;return(0,l.jsx)(`div`,{"data-slot":`description-images`,className:`flex flex-wrap gap-4`,children:e.map(e=>(0,l.jsx)(`div`,{className:t?`group relative size-42 overflow-hidden rounded-sm border border-border shadow-xs transition-shadow hover:shadow-card`:`group relative size-16 overflow-hidden rounded-lg border border-border shadow-xs transition-shadow hover:shadow-card`,children:(0,l.jsx)(n.t,{src:e.src,alt:e.alt,width:`100%`,height:`100%`,className:`transition-transform duration-200 group-hover:scale-105`})},e.id))})},v=({href:e,label:t,external:n=!0,className:r})=>e?(0,l.jsxs)(`a`,{"data-slot":`description-link`,href:e,target:n?`_blank`:void 0,rel:n?`noopener noreferrer`:void 0,className:(0,u.cn)(`inline-flex max-w-full items-center gap-1 text-sm text-primary underline decoration-dashed underline-offset-2 transition-colors hover:text-primary-strong hover:decoration-solid`,r),children:[!n&&(0,l.jsx)(s.LinkIcon,{size:12,className:`shrink-0 opacity-70`}),(0,l.jsx)(`span`,{className:`truncate`,children:t??e}),n&&(0,l.jsx)(s.ExternalLinkIcon,{size:12,className:`shrink-0 opacity-70`})]}):(0,l.jsx)(f,{}),y=({content:e})=>e==null?(0,l.jsx)(f,{}):(0,l.jsxs)(a.t,{children:[(0,l.jsx)(a.i,{asChild:!0,children:(0,l.jsx)(t.t,{"data-slot":`description-longtext`,variant:`sm`,className:`line-clamp-2 cursor-pointer whitespace-pre-line break-all text-start text-sm underline decoration-dashed decoration-border-strong underline-offset-2`,children:e})}),(0,l.jsx)(a.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,l.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,l.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,l.jsxs)(`p`,{className:`w-full text-end text-text-positive-subtle`,children:[e.toString().length,` chars`]})]})})]}),b=({name:e})=>e?(0,l.jsxs)(a.t,{children:[(0,l.jsx)(a.i,{asChild:!0,children:(0,l.jsx)(t.t,{"data-slot":`description-name`,variant:`sm`,className:`line-clamp-2 w-full cursor-pointer truncate underline decoration-dashed decoration-border-strong underline-offset-2`,children:e})}),(0,l.jsx)(a.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,l.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,l.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,l.jsxs)(`p`,{className:`w-full text-end text-text-positive-subtle`,children:[e.length,` chars`]})]})})]}):(0,l.jsx)(f,{}),x=({value:e})=>(0,l.jsxs)(a.t,{children:[(0,l.jsx)(a.i,{"data-slot":`description-phone`,children:(0,l.jsx)(t.t,{variant:`sm`,className:`tabular-nums transition-colors`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,l.jsx)(a.n,{align:`start`,children:(0,l.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),S=(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}},C=(0,d.cva)(`inline-flex items-center gap-1 font-number tabular-nums transition-colors`,{variants:{size:{xs:`text-xs`,sm:`text-sm`,md:`text-base`,lg:`text-lg`,xl:`text-xl`},trend:{neutral:`text-text-positive`,up:`text-success`,down:`text-danger`}},defaultVariants:{size:`sm`,trend:`neutral`}}),w=(0,c.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:n,suffix:r,precision:i,roundingMode:a=`round`,showTrailingZeros:o=!1,size:s=`sm`,trend:d=`neutral`,value:p=0,className:m})=>{let h=(0,c.useMemo)(()=>{let e={};return typeof i==`number`&&i>=0&&(o&&(e.minimumFractionDigits=i),e.maximumFractionDigits=i),e},[i,o]),g=(0,c.useCallback)(e=>{let t=e;return typeof i==`number`&&i>=0&&(t=S(e,i,a)),t.toLocaleString(`en-US`,h)},[a,h,i]),_=(0,c.useMemo)(()=>{if(typeof p==`number`)return Number.isNaN(p)||!Number.isFinite(p)?`N/A`:g(p);if(typeof p==`string`){let e=p.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:g(t)}return`N/A`},[p,g]),v=(0,c.useMemo)(()=>e===`.`&&t===`,`?_:_.replace(/,/g,t).replace(/\./g,e),[_,e,t]);return v===`0`||v===`N/A`||!v?(0,l.jsx)(f,{}):(0,l.jsxs)(`div`,{"data-slot":`description-statistic`,className:(0,u.cn)(C({size:s,trend:d}),m),children:[n&&(0,l.jsx)(`span`,{"data-slot":`description-statistic-prefix`,children:n}),(0,l.jsx)(`p`,{"data-slot":`description-statistic-value`,children:v}),r&&(0,l.jsx)(`span`,{"data-slot":`description-statistic-suffix`,children:r})]})});w.displayName=`DescriptionStatistic`;const T={primary:`bg-primary`,secondary:`bg-secondary`,muted:`bg-muted`,accent:`bg-accent`,info:`bg-info`,success:`bg-success`,warning:`bg-warning`,danger:`bg-danger`},E=({label:e,color:t=`info`,dot:n=!0})=>e?(0,l.jsxs)(i.t,{"data-slot":`description-status`,variant:`soft`,color:t,size:`sm`,className:`gap-1.5`,children:[n&&(0,l.jsx)(`span`,{className:(0,u.cn)(`inline-block size-1.5 shrink-0 rounded-full`,T[t])}),e]}):(0,l.jsx)(f,{}),D=({tags:e,max:t=5,color:n=`secondary`,variant:r=`soft`})=>{if(!e?.length)return(0,l.jsx)(f,{});let a=e.slice(0,t),o=e.length-a.length;return(0,l.jsxs)(`div`,{"data-slot":`description-tag-list`,className:`flex flex-wrap gap-1`,children:[a.map((e,t)=>(0,l.jsx)(i.t,{variant:r,color:n,size:`sm`,children:e},t)),o>0&&(0,l.jsxs)(i.t,{variant:`outline`,color:`muted`,size:`sm`,children:[`+`,o]})]})},O=({uuid:e,username:t,email:n})=>!e||!t||!n?(0,l.jsx)(f,{}):(0,l.jsx)(o.t,{uuid:e,username:t,email:n}),k=(0,c.createContext)(!1),A=({label:e,labelColSpan:t=3,orientation:n=`horizontal`,action:r,children:i})=>n===`vertical`?(0,l.jsxs)(`div`,{"data-slot":`description-item`,className:`flex flex-col border-b border-b-border last:border-b-0`,children:[(0,l.jsxs)(`div`,{"data-slot":`description-item-label`,className:`flex items-center justify-between border-b border-b-border bg-secondary-muted py-2 pr-2 pl-4 text-sm font-medium text-text-positive-weak`,children:[(0,l.jsx)(`span`,{children:e}),r&&(0,l.jsx)(`div`,{className:`shrink-0`,children:r})]}),(0,l.jsx)(`div`,{"data-slot":`description-item-value`,className:`flex flex-wrap items-center gap-2 py-3 pr-2 pl-4 text-sm text-text-positive`,children:i})]}):(0,l.jsxs)(`div`,{"data-slot":`description-item`,style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},className:`grid border-b border-b-border last:border-b-0`,children:[(0,l.jsxs)(`div`,{"data-slot":`description-item-label`,style:{gridColumn:`span ${t} / span ${t}`},className:`flex min-w-full items-center justify-between overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm font-medium text-text-positive-weak tabular-nums`,children:[(0,l.jsx)(`span`,{children:e}),r&&(0,l.jsx)(`div`,{className:`shrink-0 pr-1`,children:r})]}),(0,l.jsx)(`div`,{"data-slot":`description-item-value`,style:{gridColumn:`span ${12-t} / span ${12-t}`},className:`flex flex-wrap items-center gap-2 py-3 pr-2 pl-4 text-sm text-text-positive`,children:i})]}),j=({title:e,description:t,extra:n,className:r})=>(0,l.jsxs)(`div`,{"data-slot":`description-header`,className:(0,u.cn)(`sticky top-0 z-10 flex items-start justify-between gap-4 border-b border-b-border bg-card px-4 py-3`,r),children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,l.jsx)(`p`,{className:`text-sm font-semibold text-text-positive`,children:e}),t&&(0,l.jsx)(`p`,{className:`text-xs text-text-positive-weak`,children:t})]}),n&&(0,l.jsx)(`div`,{className:`shrink-0`,children:n})]}),M=({title:e,className:t})=>(0,l.jsxs)(`div`,{"data-slot":`description-section`,className:(0,u.cn)(`flex items-center gap-3 border-b border-b-border bg-secondary-muted px-4 py-2`,t),children:[e&&(0,l.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-wide text-text-positive-muted`,children:e}),(0,l.jsx)(`div`,{className:`h-px flex-1 bg-border-weak`})]}),N=({rows:e})=>(0,l.jsxs)(`div`,{"data-slot":`description-loading`,className:`animate-pulse`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between border-b border-b-border px-4 py-3`,children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,l.jsx)(`div`,{className:`h-3.5 w-36 rounded bg-border`}),(0,l.jsx)(`div`,{className:`h-2.5 w-24 rounded bg-border-weak`})]}),(0,l.jsx)(`div`,{className:`h-5 w-16 rounded bg-border-weak`})]}),Array.from({length:e}).map((e,t)=>(0,l.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},className:`grid border-b border-b-border last:border-b-0`,children:[(0,l.jsx)(`div`,{style:{gridColumn:`span 3 / span 3`},className:`flex items-center border-r border-r-border bg-secondary-muted py-3 pl-4 pr-2`,children:(0,l.jsx)(`div`,{className:`h-3 w-20 rounded bg-border`})}),(0,l.jsx)(`div`,{style:{gridColumn:`span 9 / span 9`},className:`flex items-center py-3 pl-4 pr-2`,children:(0,l.jsx)(`div`,{className:`h-3 w-28 rounded bg-border-weak`})})]},t))]}),P=({children:e,className:t,nested:n=!1,loading:r=!1,loadingRows:i=4})=>{let a=(0,c.useContext)(k);return(0,l.jsx)(`div`,{"data-slot":`description`,className:(0,u.cn)(`relative flex flex-col bg-card`,a?`border-b border-b-border last:border-b-0`:n?`w-full overflow-hidden rounded-md border border-border`:`size-full overflow-y-auto rounded-lg border border-border shadow-card ring-1 ring-border-weak`,t),children:r?(0,l.jsx)(N,{rows:i}):e})},F=({children:e,className:t})=>(0,l.jsx)(k.Provider,{value:!0,children:(0,l.jsx)(`div`,{"data-slot":`description-group`,className:(0,u.cn)(`relative size-full overflow-y-auto rounded-lg border border-border bg-card shadow-card ring-1 ring-border-weak`,t),children:e})});exports.Description=P,exports.DescriptionBadge=p,exports.DescriptionBoolean=m,exports.DescriptionCopy=h,exports.DescriptionDate=g,exports.DescriptionEmpty=f,exports.DescriptionGroup=F,exports.DescriptionHeader=j,exports.DescriptionImages=_,exports.DescriptionItem=A,exports.DescriptionLink=v,exports.DescriptionLongText=y,exports.DescriptionName=b,exports.DescriptionNumberPhone=x,exports.DescriptionSection=M,exports.DescriptionStatistic=w,exports.DescriptionStatus=E,exports.DescriptionTagList=D,exports.DescriptionUser=O;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|