@customafk/lunas-ui 0.1.65 → 0.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{button-B-ba_2Ct.d.cts → button-CvqhYhbD.d.mts} +6 -6
- package/dist/{button-Dj9K9IDQ.d.mts → button-D-6pyU4C.d.cts} +6 -6
- package/dist/data-display/empty.d.mts +2 -2
- package/dist/data-display/statistic.d.mts +2 -2
- package/dist/{dialog-CDJxe4km.d.mts → dialog-BOXpAEii.d.cts} +12 -12
- package/dist/{dialog-DbUT8FYE.d.cts → dialog-tMHsllmV.d.mts} +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +3 -3
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +3 -3
- package/dist/features/descriptions/index.cjs +1 -1
- package/dist/features/descriptions/index.cjs.map +1 -1
- package/dist/features/descriptions/index.mjs +1 -1
- package/dist/features/descriptions/index.mjs.map +1 -1
- package/dist/features/tables/index.d.cts +3 -3
- package/dist/features/tables/index.d.mts +1 -1
- package/dist/{input-J5RulVPU.d.cts → input-CiSjWD7c.d.cts} +3 -3
- package/dist/{input-CvKhyXfs.d.mts → input-Cr08bM_0.d.mts} +3 -3
- package/dist/layouts/app-layout/index.d.cts +28 -28
- package/dist/layouts/app-layout/index.d.mts +3 -3
- package/dist/layouts/flex.d.mts +2 -2
- package/dist/layouts/service-layout/index.d.cts +11 -11
- package/dist/layouts/service-layout/index.d.mts +3 -3
- 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/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/{separator-BLK3kO-5.d.cts → separator-C39rrpyf.d.cts} +3 -3
- package/dist/{separator-DG0RZ3MC.d.mts → separator-DXIRGezH.d.mts} +3 -3
- package/dist/{tooltip-4w6-u_Fx.d.cts → tooltip-BonDwfRD.d.mts} +6 -6
- package/dist/{tooltip-C--JxILV.d.mts → tooltip-CakdOB_s.d.cts} +6 -6
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/title.d.cts +2 -2
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.d.cts +1 -1
- package/dist/ui/alert.d.mts +7 -7
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/badge.d.cts +2 -2
- package/dist/ui/badge.d.mts +2 -2
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.d.cts +5 -5
- package/dist/ui/button-group.d.mts +5 -5
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/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 +7 -7
- package/dist/ui/empty.d.mts +7 -7
- package/dist/ui/field.d.cts +11 -11
- package/dist/ui/field.d.mts +11 -11
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/form.d.cts +7 -7
- package/dist/ui/form.d.mts +7 -7
- 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 +12 -12
- package/dist/ui/item.d.mts +12 -12
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +17 -17
- package/dist/ui/multi-select.d.mts +1 -1
- package/dist/ui/navigation-menu.d.cts +9 -9
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.mts +5 -5
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.mts +4 -4
- package/dist/ui/scroll-area.d.cts +3 -3
- package/dist/ui/scroll-area.d.mts +3 -3
- package/dist/ui/select.d.cts +11 -11
- package/dist/ui/select.d.mts +11 -11
- package/dist/ui/separator.d.cts +1 -1
- package/dist/ui/separator.d.mts +1 -1
- 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 +30 -30
- 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 +9 -9
- package/dist/ui/table.d.mts +9 -9
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.mts +5 -5
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/toggle-group.d.cts +3 -3
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle.d.cts +2 -2
- package/dist/ui/toggle.d.mts +4 -4
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.mts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as class_variance_authority_types12 from "class-variance-authority/types";
|
|
1
|
+
import * as react_jsx_runtime52 from "react/jsx-runtime";
|
|
3
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as class_variance_authority_types11 from "class-variance-authority/types";
|
|
4
4
|
|
|
5
5
|
//#region packages/components/ui/button.variants.d.ts
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@ import { VariantProps } from "class-variance-authority";
|
|
|
9
9
|
*/
|
|
10
10
|
declare const buttonVariants: (props?: ({
|
|
11
11
|
variant?: "default" | "outline" | "link" | "ghost" | "soft" | "subtle" | null | undefined;
|
|
12
|
-
color?: "muted" | "
|
|
12
|
+
color?: "muted" | "primary" | "secondary" | "success" | "important" | "info" | "warning" | "danger" | null | undefined;
|
|
13
13
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | null | undefined;
|
|
14
|
-
} &
|
|
14
|
+
} & class_variance_authority_types11.ClassProp) | undefined) => string;
|
|
15
15
|
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region packages/components/ui/button.d.ts
|
|
@@ -51,7 +51,7 @@ declare function Button({
|
|
|
51
51
|
disabled,
|
|
52
52
|
type,
|
|
53
53
|
...props
|
|
54
|
-
}: ButtonProps):
|
|
54
|
+
}: ButtonProps): react_jsx_runtime52.JSX.Element;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { ButtonProps as n, Button as t };
|
|
57
|
-
//# sourceMappingURL=button-
|
|
57
|
+
//# sourceMappingURL=button-CvqhYhbD.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime49 from "react/jsx-runtime";
|
|
2
|
+
import * as class_variance_authority_types13 from "class-variance-authority/types";
|
|
2
3
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as class_variance_authority_types12 from "class-variance-authority/types";
|
|
4
4
|
|
|
5
5
|
//#region packages/components/ui/button.variants.d.ts
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@ import * as class_variance_authority_types12 from "class-variance-authority/type
|
|
|
9
9
|
*/
|
|
10
10
|
declare const buttonVariants: (props?: ({
|
|
11
11
|
variant?: "default" | "outline" | "link" | "ghost" | "soft" | "subtle" | null | undefined;
|
|
12
|
-
color?: "muted" | "
|
|
12
|
+
color?: "muted" | "primary" | "secondary" | "success" | "important" | "info" | "warning" | "danger" | null | undefined;
|
|
13
13
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | null | undefined;
|
|
14
|
-
} &
|
|
14
|
+
} & class_variance_authority_types13.ClassProp) | undefined) => string;
|
|
15
15
|
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region packages/components/ui/button.d.ts
|
|
@@ -51,7 +51,7 @@ declare function Button({
|
|
|
51
51
|
disabled,
|
|
52
52
|
type,
|
|
53
53
|
...props
|
|
54
|
-
}: ButtonProps):
|
|
54
|
+
}: ButtonProps): react_jsx_runtime49.JSX.Element;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { ButtonProps as n, Button as t };
|
|
57
|
-
//# sourceMappingURL=button-
|
|
57
|
+
//# sourceMappingURL=button-D-6pyU4C.d.cts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/data-display/empty.d.ts
|
|
4
|
-
declare const EmptyDisplay: () =>
|
|
4
|
+
declare const EmptyDisplay: () => react_jsx_runtime1.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { EmptyDisplay };
|
|
7
7
|
//# sourceMappingURL=empty.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import * as react0 from "react";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/data-display/statistic.d.ts
|
|
@@ -23,7 +23,7 @@ declare const Statistic: react0.MemoExoticComponent<({
|
|
|
23
23
|
showTrailingZeros,
|
|
24
24
|
size,
|
|
25
25
|
value
|
|
26
|
-
}: Props) =>
|
|
26
|
+
}: Props) => react_jsx_runtime0.JSX.Element>;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { Statistic };
|
|
29
29
|
//# sourceMappingURL=statistic.d.mts.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime80 from "react/jsx-runtime";
|
|
2
2
|
import { Dialog } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/dialog.d.ts
|
|
5
5
|
declare function Dialog$1({
|
|
6
6
|
...props
|
|
7
|
-
}: React.ComponentProps<typeof Dialog.Root>):
|
|
7
|
+
}: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime80.JSX.Element;
|
|
8
8
|
declare function DialogTrigger({
|
|
9
9
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof Dialog.Trigger>):
|
|
10
|
+
}: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime80.JSX.Element;
|
|
11
11
|
declare function DialogPortal({
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof Dialog.Portal>):
|
|
13
|
+
}: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime80.JSX.Element;
|
|
14
14
|
declare function DialogClose({
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<typeof Dialog.Close>):
|
|
16
|
+
}: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime80.JSX.Element;
|
|
17
17
|
declare function DialogOverlay({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof Dialog.Overlay>):
|
|
20
|
+
}: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime80.JSX.Element;
|
|
21
21
|
declare function DialogContent({
|
|
22
22
|
className,
|
|
23
23
|
children,
|
|
@@ -25,23 +25,23 @@ declare function DialogContent({
|
|
|
25
25
|
...props
|
|
26
26
|
}: React.ComponentProps<typeof Dialog.Content> & {
|
|
27
27
|
showCloseButton?: boolean;
|
|
28
|
-
}):
|
|
28
|
+
}): react_jsx_runtime80.JSX.Element;
|
|
29
29
|
declare function DialogHeader({
|
|
30
30
|
className,
|
|
31
31
|
...props
|
|
32
|
-
}: React.ComponentProps<'div'>):
|
|
32
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime80.JSX.Element;
|
|
33
33
|
declare function DialogFooter({
|
|
34
34
|
className,
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<'div'>):
|
|
36
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime80.JSX.Element;
|
|
37
37
|
declare function DialogTitle({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof Dialog.Title>):
|
|
40
|
+
}: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime80.JSX.Element;
|
|
41
41
|
declare function DialogDescription({
|
|
42
42
|
className,
|
|
43
43
|
...props
|
|
44
|
-
}: React.ComponentProps<typeof Dialog.Description>):
|
|
44
|
+
}: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime80.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { DialogFooter as a, DialogPortal as c, DialogDescription as i, DialogTitle as l, DialogClose as n, DialogHeader as o, DialogContent as r, DialogOverlay as s, Dialog$1 as t, DialogTrigger as u };
|
|
47
|
-
//# sourceMappingURL=dialog-
|
|
47
|
+
//# sourceMappingURL=dialog-BOXpAEii.d.cts.map
|
|
@@ -44,4 +44,4 @@ declare function DialogDescription({
|
|
|
44
44
|
}: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime114.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { DialogFooter as a, DialogPortal as c, DialogDescription as i, DialogTitle as l, DialogClose as n, DialogHeader as o, DialogContent as r, DialogOverlay as s, Dialog$1 as t, DialogTrigger as u };
|
|
47
|
-
//# sourceMappingURL=dialog-
|
|
47
|
+
//# sourceMappingURL=dialog-tMHsllmV.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Button } from "../../../button-
|
|
2
|
-
import { t as Separator } from "../../../separator-
|
|
3
|
-
import { n as TooltipContent } from "../../../tooltip-
|
|
1
|
+
import { t as Button } from "../../../button-D-6pyU4C.cjs";
|
|
2
|
+
import { t as Separator } from "../../../separator-C39rrpyf.cjs";
|
|
3
|
+
import { n as TooltipContent } from "../../../tooltip-CakdOB_s.cjs";
|
|
4
4
|
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
5
5
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
6
|
import { VariantProps } from "class-variance-authority";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Button } from "../../../button-
|
|
2
|
-
import { t as Separator } from "../../../separator-
|
|
3
|
-
import { n as TooltipContent } from "../../../tooltip-
|
|
1
|
+
import { t as Button } from "../../../button-CvqhYhbD.mjs";
|
|
2
|
+
import { t as Separator } from "../../../separator-DXIRGezH.mjs";
|
|
3
|
+
import { n as TooltipContent } from "../../../tooltip-BonDwfRD.mjs";
|
|
4
4
|
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
6
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../skeleton-C4suljHP.cjs`);const t=require(`../../image-D5vQS72z.cjs`),n=require(`../../flex-BYj-xYaw.cjs`),r=require(`../../paragraph-CqAtWDb_.cjs`),i=require(`../../date-DU8xM0hQ.cjs`),a=require(`../../tooltip-a3HDmxog.cjs`);let o=require(`@customafk/react-toolkit/utils`),s=require(`react/jsx-runtime`),c=require(`react`);const l=()=>(0,s.jsx)(`div`,{className:`flex items-center gap-0 font-medium text-sm text-text-positive-muted italic`,children:(0,s.jsx)(`p`,{children:`Empty Value`})}),u=({label:e})=>e?(0,s.jsx)(`div`,{className:`w-fit rounded-full border border-border-weak px-3 py-1 font-medium text-text-positive-weak text-xs tabular-nums shadow-xs`,children:e}):(0,s.jsx)(l,{}),d=({date:e})=>e==null?(0,s.jsx)(l,{}):(0,s.jsx)(a.r,{children:(0,s.jsxs)(a.t,{children:[(0,s.jsx)(a.i,{children:(0,s.jsx)(i.t,{date:e,format:`medium`})}),(0,s.jsx)(a.n,{children:(0,s.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-xs`})})]})}),f=({images:e})=>!e||!e.length?(0,s.jsx)(l,{}):e.length===1?(0,s.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:(0,s.jsx)(`div`,{className:`group relative size-42 rounded-sm shadow-xs`,children:(0,s.jsx)(t.t,{src:e[0].src,alt:e[0].alt,width:`100%`,height:`100%`})},e[0].id)}):(0,s.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:e.map(e=>(0,s.jsx)(`div`,{className:`group relative size-16 rounded-sm shadow-xs`,children:(0,s.jsx)(t.t,{src:e.src,alt:e.alt,width:`100%`,height:`100%`})},e.id))}),p=({content:e})=>e==null?(0,s.jsx)(l,{}):(0,s.jsxs)(a.t,{children:[(0,s.jsx)(a.i,{children:(0,s.jsx)(r.t,{variant:`sm`,className:`whitespace-pre-line break-all text-start text-sm`,children:e})}),(0,s.jsx)(a.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,s.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,s.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,s.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),m=({name:e})=>e?(0,s.jsxs)(a.t,{children:[(0,s.jsx)(a.i,{children:(0,s.jsx)(r.t,{variant:`sm`,className:`line-clamp-2 w-full truncate`,children:e})}),(0,s.jsx)(a.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,s.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,s.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,s.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,s.jsx)(l,{}),h=({value:e})=>(0,s.jsxs)(a.t,{children:[(0,s.jsx)(a.i,{children:(0,s.jsx)(r.t,{variant:`sm`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,s.jsx)(a.n,{align:`start`,children:(0,s.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),g=(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}},_=(0,c.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:r,suffix:i,precision:a,roundingMode:u=`round`,showTrailingZeros:d=!1,size:f=`sm`,value:p=0})=>{let m=(0,c.useMemo)(()=>{let e={};return typeof a==`number`&&a>=0&&d&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,d]),h=(0,c.useCallback)(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=g(e,a,u)),t.toLocaleString(`en-US`,m)},[u,m,a]),_=(0,c.useMemo)(()=>{if(typeof p==`number`)return Number.isNaN(p)||!Number.isFinite(p)?`N/A`:h(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`:h(t)}return`N/A`},[p,h]),v=(0,c.useMemo)(()=>e===`.`&&t===`,`?_:_.replace(/,/g,t).replace(/\./g,e),[_,e,t]);return v===`0`||v===`N/A`||!v?(0,s.jsx)(l,{}):(0,s.jsxs)(n.t,{padding:`none`,className:(0,o.cn)(`font-number text-lg text-text-positive tabular-nums`,f===`xs`&&`text-xs`,f===`sm`&&`text-sm`,f===`md`&&`text-base`,f===`lg`&&`text-lg`,f===`xl`&&`text-xl`),children:[r,(0,s.jsx)(`p`,{children:v}),i]})});_.displayName=`DescriptionStatistic`;const v=({label:e,labelColSpan:t=3,children:n})=>(0,s.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},className:`grid border-b border-b-border`,children:[(0,s.jsx)(`div`,{style:{gridColumn:`span ${t} / span ${t}`},className:`flex min-w-full items-center justify-start overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm text-text-positive-weak tabular-nums`,children:e}),(0,s.jsx)(`div`,{style:{gridColumn:`span ${12-t} / span ${12-t}`},className:`flex flex-wrap gap-2 py-3 pr-2 pl-4 text-sm text-text-positive`,children:n})]}),y=({children:e})=>(0,s.jsx)(`div`,{"data-slot":`description-wrapper`,className:`relative flex size-full flex-col gap-y-0 space-y-0 overflow-hidden rounded-lg border border-border bg-card shadow-
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../skeleton-C4suljHP.cjs`);const t=require(`../../image-D5vQS72z.cjs`),n=require(`../../flex-BYj-xYaw.cjs`),r=require(`../../paragraph-CqAtWDb_.cjs`),i=require(`../../date-DU8xM0hQ.cjs`),a=require(`../../tooltip-a3HDmxog.cjs`);let o=require(`@customafk/react-toolkit/utils`),s=require(`react/jsx-runtime`),c=require(`react`);const l=()=>(0,s.jsx)(`div`,{className:`flex items-center gap-0 font-medium text-sm text-text-positive-muted italic`,children:(0,s.jsx)(`p`,{children:`Empty Value`})}),u=({label:e})=>e?(0,s.jsx)(`div`,{className:`w-fit rounded-full border border-border-weak px-3 py-1 font-medium text-text-positive-weak text-xs tabular-nums shadow-xs`,children:e}):(0,s.jsx)(l,{}),d=({date:e})=>e==null?(0,s.jsx)(l,{}):(0,s.jsx)(a.r,{children:(0,s.jsxs)(a.t,{children:[(0,s.jsx)(a.i,{children:(0,s.jsx)(i.t,{date:e,format:`medium`})}),(0,s.jsx)(a.n,{children:(0,s.jsx)(i.t,{date:e,format:`full`,showTime:!0,className:`font-medium text-xs`})})]})}),f=({images:e})=>!e||!e.length?(0,s.jsx)(l,{}):e.length===1?(0,s.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:(0,s.jsx)(`div`,{className:`group relative size-42 rounded-sm shadow-xs`,children:(0,s.jsx)(t.t,{src:e[0].src,alt:e[0].alt,width:`100%`,height:`100%`})},e[0].id)}):(0,s.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:e.map(e=>(0,s.jsx)(`div`,{className:`group relative size-16 rounded-sm shadow-xs`,children:(0,s.jsx)(t.t,{src:e.src,alt:e.alt,width:`100%`,height:`100%`})},e.id))}),p=({content:e})=>e==null?(0,s.jsx)(l,{}):(0,s.jsxs)(a.t,{children:[(0,s.jsx)(a.i,{children:(0,s.jsx)(r.t,{variant:`sm`,className:`whitespace-pre-line break-all text-start text-sm`,children:e})}),(0,s.jsx)(a.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,s.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,s.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,s.jsxs)(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),m=({name:e})=>e?(0,s.jsxs)(a.t,{children:[(0,s.jsx)(a.i,{children:(0,s.jsx)(r.t,{variant:`sm`,className:`line-clamp-2 w-full truncate`,children:e})}),(0,s.jsx)(a.n,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:(0,s.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,s.jsx)(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),(0,s.jsxs)(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):(0,s.jsx)(l,{}),h=({value:e})=>(0,s.jsxs)(a.t,{children:[(0,s.jsx)(a.i,{children:(0,s.jsx)(r.t,{variant:`sm`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,s.jsx)(a.n,{align:`start`,children:(0,s.jsx)(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),g=(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}},_=(0,c.memo)(({decimalSeparator:e=`.`,groupSeparator:t=`,`,prefix:r,suffix:i,precision:a,roundingMode:u=`round`,showTrailingZeros:d=!1,size:f=`sm`,value:p=0})=>{let m=(0,c.useMemo)(()=>{let e={};return typeof a==`number`&&a>=0&&d&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,d]),h=(0,c.useCallback)(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=g(e,a,u)),t.toLocaleString(`en-US`,m)},[u,m,a]),_=(0,c.useMemo)(()=>{if(typeof p==`number`)return Number.isNaN(p)||!Number.isFinite(p)?`N/A`:h(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`:h(t)}return`N/A`},[p,h]),v=(0,c.useMemo)(()=>e===`.`&&t===`,`?_:_.replace(/,/g,t).replace(/\./g,e),[_,e,t]);return v===`0`||v===`N/A`||!v?(0,s.jsx)(l,{}):(0,s.jsxs)(n.t,{padding:`none`,className:(0,o.cn)(`font-number text-lg text-text-positive tabular-nums`,f===`xs`&&`text-xs`,f===`sm`&&`text-sm`,f===`md`&&`text-base`,f===`lg`&&`text-lg`,f===`xl`&&`text-xl`),children:[r,(0,s.jsx)(`p`,{children:v}),i]})});_.displayName=`DescriptionStatistic`;const v=({label:e,labelColSpan:t=3,children:n})=>(0,s.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},className:`grid border-b border-b-border`,children:[(0,s.jsx)(`div`,{style:{gridColumn:`span ${t} / span ${t}`},className:`flex min-w-full items-center justify-start overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm text-text-positive-weak tabular-nums`,children:e}),(0,s.jsx)(`div`,{style:{gridColumn:`span ${12-t} / span ${12-t}`},className:`flex flex-wrap gap-2 py-3 pr-2 pl-4 text-sm text-text-positive`,children:n})]}),y=({children:e})=>(0,s.jsx)(`div`,{"data-slot":`description-wrapper`,className:`relative flex size-full flex-col gap-y-0 space-y-0 overflow-hidden rounded-lg border border-border bg-card shadow-xs ring-3 ring-border-muted`,children:e});exports.Description=y,exports.DescriptionBadge=u,exports.DescriptionDate=d,exports.DescriptionEmpty=l,exports.DescriptionImages=f,exports.DescriptionItem=v,exports.DescriptionLongText=p,exports.DescriptionName=m,exports.DescriptionNumberPhone=h,exports.DescriptionStatistic=_;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DescriptionEmpty: React.FC","DescriptionBadge: React.FC<{\n label: string | number | null | undefined;\n}>","DescriptionDate: React.FC<Props>","TooltipProvider","Tooltip","TooltipTrigger","DateDisplay","TooltipContent","DescriptionImages: React.FC<{\n images?:\n | Array<{\n id: string;\n src: string;\n alt: string;\n }>\n | null\n | undefined;\n}>","Image","DescriptionLongText: React.FC<{ content: string | null | undefined | number }>","Tooltip","TooltipTrigger","Paragraph","TooltipContent","DescriptionName: React.FC<{\n name?: string | null | undefined;\n}>","Tooltip","TooltipTrigger","Paragraph","TooltipContent","DescriptionNumberPhone: React.FC<React.PropsWithChildren<{ value: string }>>","Tooltip","TooltipTrigger","Paragraph","TooltipContent","options: Intl.NumberFormatOptions","Flex","DescriptionItem: React.FC<\n React.PropsWithChildren<{\n label: string;\n labelColSpan?: number;\n }>\n>","Description: React.FC<React.PropsWithChildren>"],"sources":["../../../packages/components/features/descriptions/components/empty.tsx","../../../packages/components/features/descriptions/components/badge.tsx","../../../packages/components/features/descriptions/components/date.tsx","../../../packages/components/features/descriptions/components/images.tsx","../../../packages/components/features/descriptions/components/longtext.tsx","../../../packages/components/features/descriptions/components/name.tsx","../../../packages/components/features/descriptions/components/number-phone.tsx","../../../packages/components/features/descriptions/components/statistic.tsx","../../../packages/components/features/descriptions/index.tsx"],"sourcesContent":["export const DescriptionEmpty: React.FC = () => {\n return (\n <div className=\"flex items-center gap-0 font-medium text-sm text-text-positive-muted italic\">\n <p>Empty Value</p>\n </div>\n );\n};\n","import { DescriptionEmpty } from './empty';\n\nexport const DescriptionBadge: React.FC<{\n label: string | number | null | undefined;\n}> = ({ label }) => {\n if (!label) return <DescriptionEmpty />;\n return (\n <div className=\"w-fit rounded-full border border-border-weak px-3 py-1 font-medium text-text-positive-weak text-xs tabular-nums shadow-xs\">{label}</div>\n );\n};\n","import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { DateDisplay } from '@/components/data-display/date';\nimport { DescriptionEmpty } from './empty';\n\ntype Props = {\n date: Date | string | number | null | undefined;\n};\nexport const DescriptionDate: React.FC<Props> = ({ date }) => {\n if (typeof date === 'undefined' || date === null) return <DescriptionEmpty />;\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger>\n <DateDisplay date={date} format=\"medium\" />\n </TooltipTrigger>\n <TooltipContent>\n <DateDisplay date={date} format=\"full\" showTime className=\"font-medium text-xs\" />\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n};\n","import { Image } from '@/components/ui/image';\n\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionImages: React.FC<{\n images?:\n | Array<{\n id: string;\n src: string;\n alt: string;\n }>\n | null\n | undefined;\n}> = ({ images }) => {\n if (!images || !images.length) return <DescriptionEmpty />;\n if (images.length === 1)\n return (\n <div className=\"flex flex-wrap gap-4\">\n <div key={images[0].id} className=\"group relative size-42 rounded-sm shadow-xs\">\n <Image src={images[0].src} alt={images[0].alt} width=\"100%\" height=\"100%\" />\n </div>\n </div>\n );\n return (\n <div className=\"flex flex-wrap gap-4\">\n {images.map(image => (\n <div key={image.id} className=\"group relative size-16 rounded-sm shadow-xs\">\n <Image src={image.src} alt={image.alt} width=\"100%\" height=\"100%\" />\n </div>\n ))}\n </div>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionLongText: React.FC<{ content: string | null | undefined | number }> = ({ content }) => {\n if (content === undefined || content === null) {\n return <DescriptionEmpty />;\n }\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\" className=\"whitespace-pre-line break-all text-start text-sm\">\n {content}\n </Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\" className=\"h-fit min-w-48 max-w-80 pt-4\">\n <div className=\"flex flex-col gap-y-2\">\n <p className=\"whitespace-pre-line text-wrap break-keep\">{content}</p>\n <p className=\"w-full text-end\">{content.toString().length} chars</p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionName: React.FC<{\n name?: string | null | undefined;\n}> = ({ name }) => {\n if (!name) return <DescriptionEmpty />;\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\" className=\"line-clamp-2 w-full truncate\">\n {name}\n </Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\" className=\"h-fit min-w-48 max-w-80 pt-4\">\n <div className=\"flex flex-col gap-y-2\">\n <p className=\"whitespace-pre-line text-wrap break-keep\">{name}</p>\n <p className=\"w-full text-end\">{name.length} chars</p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\n\nexport const DescriptionNumberPhone: React.FC<React.PropsWithChildren<{ value: string }>> = ({ value }) => {\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '(00) (+84) ($1) $2-$3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { memo, useCallback, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Flex } from '@/components/layouts/flex';\nimport { DescriptionEmpty } from './empty';\n\nconst applyRounding = (num: number, precisionValue: number, roundingMode?: 'round' | 'floor' | 'ceil') => {\n const multiplier = 10 ** precisionValue;\n\n switch (roundingMode) {\n case 'floor':\n return Math.floor(num * multiplier) / multiplier;\n case 'ceil':\n return Math.ceil(num * multiplier) / multiplier;\n default:\n return Math.round(num * multiplier) / multiplier;\n }\n};\n\ntype Props = {\n decimalSeparator?: string;\n groupSeparator?: string;\n prefix?: React.ReactNode;\n suffix?: React.ReactNode;\n precision?: number; // Số chữ số thập phân\n roundingMode?: 'round' | 'floor' | 'ceil'; // Kiểu làm tròn\n showTrailingZeros?: boolean; // Hiển thị số 0 cuối\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; // Kích thước của component\n value: number | string | null | undefined;\n};\n\nexport const DescriptionStatistic = memo(\n ({\n decimalSeparator = '.',\n groupSeparator = ',',\n prefix: Prefix,\n suffix: Suffix,\n precision,\n roundingMode = 'round',\n showTrailingZeros = false,\n size = 'sm',\n value = 0,\n }: Props) => {\n // Memoize number formatting options\n const formatOptions = useMemo((): Intl.NumberFormatOptions => {\n const options: Intl.NumberFormatOptions = {};\n\n if (typeof precision === 'number' && precision >= 0 && showTrailingZeros) {\n options.minimumFractionDigits = precision;\n options.maximumFractionDigits = precision;\n } else {\n options.maximumFractionDigits = precision;\n }\n\n return options;\n }, [precision, showTrailingZeros]);\n\n const formatNumber = useCallback(\n (num: number): string => {\n let processedNum = num;\n\n // Áp dụng làm tròn nếu có precision\n if (typeof precision === 'number' && precision >= 0) {\n processedNum = applyRounding(num, precision, roundingMode);\n }\n\n return processedNum.toLocaleString('en-US', formatOptions);\n },\n [roundingMode, formatOptions, precision]\n );\n\n // Memoize value processing\n const processedValue = useMemo((): string => {\n // Xử lý giá trị number\n if (typeof value === 'number') {\n if (Number.isNaN(value) || !Number.isFinite(value)) {\n return 'N/A';\n }\n return formatNumber(value);\n }\n\n // Xử lý giá trị string\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n // Nếu là chuỗi rỗng\n if (!trimmedValue) {\n return 'N/A';\n }\n\n // Thử convert sang number\n const numValue = Number(trimmedValue);\n\n if (Number.isNaN(numValue) || !Number.isFinite(numValue)) {\n // Nếu không phải số, trả về string gốc\n return 'N/A';\n }\n\n return formatNumber(numValue);\n }\n\n return 'N/A';\n }, [value, formatNumber]);\n\n // Memoize separator replacement\n const finalFormattedValue = useMemo((): string => {\n // Chỉ thay thế separators nếu khác mặc định\n if (decimalSeparator === '.' && groupSeparator === ',') {\n return processedValue;\n }\n return processedValue.replace(/,/g, groupSeparator).replace(/\\./g, decimalSeparator);\n }, [processedValue, decimalSeparator, groupSeparator]);\n\n if (finalFormattedValue === '0' || finalFormattedValue === 'N/A' || !finalFormattedValue) {\n return <DescriptionEmpty />;\n }\n\n return (\n <Flex\n padding=\"none\"\n className={cn(\n 'font-number text-lg text-text-positive tabular-nums',\n size === 'xs' && 'text-xs',\n size === 'sm' && 'text-sm',\n size === 'md' && 'text-base',\n size === 'lg' && 'text-lg',\n size === 'xl' && 'text-xl'\n )}\n >\n {Prefix}\n <p>{finalFormattedValue}</p>\n {Suffix}\n </Flex>\n );\n }\n);\nDescriptionStatistic.displayName = 'DescriptionStatistic';\n","export * from './components'\n\nexport const DescriptionItem: React.FC<\n React.PropsWithChildren<{\n label: string;\n labelColSpan?: number;\n }>\n> = ({ label, labelColSpan = 3, children }) => {\n return (\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(12, minmax(0, 1fr))',\n }}\n className=\"grid border-b border-b-border\"\n >\n <div\n style={{\n gridColumn: `span ${labelColSpan} / span ${labelColSpan}`,\n }}\n className=\"flex min-w-full items-center justify-start overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm text-text-positive-weak tabular-nums\"\n >\n {label}\n </div>\n <div\n style={{\n gridColumn: `span ${12 - labelColSpan} / span ${12 - labelColSpan}`,\n }}\n className=\"flex flex-wrap gap-2 py-3 pr-2 pl-4 text-sm text-text-positive\"\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport const Description: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <div\n data-slot=\"description-wrapper\"\n className=\"relative flex size-full flex-col gap-y-0 space-y-0 overflow-hidden rounded-lg border border-border bg-card shadow-card ring-3 ring-border-muted\"\n >\n {children}\n </div>\n );\n};\n"],"mappings":"6XAAA,MAAaA,OAET,EAAA,E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{\n label: string | number | null | undefined;\n}>","DescriptionDate: React.FC<Props>","TooltipProvider","Tooltip","TooltipTrigger","DateDisplay","TooltipContent","DescriptionImages: React.FC<{\n images?:\n | Array<{\n id: string;\n src: string;\n alt: string;\n }>\n | null\n | undefined;\n}>","Image","DescriptionLongText: React.FC<{ content: string | null | undefined | number }>","Tooltip","TooltipTrigger","Paragraph","TooltipContent","DescriptionName: React.FC<{\n name?: string | null | undefined;\n}>","Tooltip","TooltipTrigger","Paragraph","TooltipContent","DescriptionNumberPhone: React.FC<React.PropsWithChildren<{ value: string }>>","Tooltip","TooltipTrigger","Paragraph","TooltipContent","options: Intl.NumberFormatOptions","Flex","DescriptionItem: React.FC<\n React.PropsWithChildren<{\n label: string;\n labelColSpan?: number;\n }>\n>","Description: React.FC<React.PropsWithChildren>"],"sources":["../../../packages/components/features/descriptions/components/empty.tsx","../../../packages/components/features/descriptions/components/badge.tsx","../../../packages/components/features/descriptions/components/date.tsx","../../../packages/components/features/descriptions/components/images.tsx","../../../packages/components/features/descriptions/components/longtext.tsx","../../../packages/components/features/descriptions/components/name.tsx","../../../packages/components/features/descriptions/components/number-phone.tsx","../../../packages/components/features/descriptions/components/statistic.tsx","../../../packages/components/features/descriptions/index.tsx"],"sourcesContent":["export const DescriptionEmpty: React.FC = () => {\n return (\n <div className=\"flex items-center gap-0 font-medium text-sm text-text-positive-muted italic\">\n <p>Empty Value</p>\n </div>\n );\n};\n","import { DescriptionEmpty } from './empty';\n\nexport const DescriptionBadge: React.FC<{\n label: string | number | null | undefined;\n}> = ({ label }) => {\n if (!label) return <DescriptionEmpty />;\n return (\n <div className=\"w-fit rounded-full border border-border-weak px-3 py-1 font-medium text-text-positive-weak text-xs tabular-nums shadow-xs\">{label}</div>\n );\n};\n","import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { DateDisplay } from '@/components/data-display/date';\nimport { DescriptionEmpty } from './empty';\n\ntype Props = {\n date: Date | string | number | null | undefined;\n};\nexport const DescriptionDate: React.FC<Props> = ({ date }) => {\n if (typeof date === 'undefined' || date === null) return <DescriptionEmpty />;\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger>\n <DateDisplay date={date} format=\"medium\" />\n </TooltipTrigger>\n <TooltipContent>\n <DateDisplay date={date} format=\"full\" showTime className=\"font-medium text-xs\" />\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n};\n","import { Image } from '@/components/ui/image';\n\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionImages: React.FC<{\n images?:\n | Array<{\n id: string;\n src: string;\n alt: string;\n }>\n | null\n | undefined;\n}> = ({ images }) => {\n if (!images || !images.length) return <DescriptionEmpty />;\n if (images.length === 1)\n return (\n <div className=\"flex flex-wrap gap-4\">\n <div key={images[0].id} className=\"group relative size-42 rounded-sm shadow-xs\">\n <Image src={images[0].src} alt={images[0].alt} width=\"100%\" height=\"100%\" />\n </div>\n </div>\n );\n return (\n <div className=\"flex flex-wrap gap-4\">\n {images.map(image => (\n <div key={image.id} className=\"group relative size-16 rounded-sm shadow-xs\">\n <Image src={image.src} alt={image.alt} width=\"100%\" height=\"100%\" />\n </div>\n ))}\n </div>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionLongText: React.FC<{ content: string | null | undefined | number }> = ({ content }) => {\n if (content === undefined || content === null) {\n return <DescriptionEmpty />;\n }\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\" className=\"whitespace-pre-line break-all text-start text-sm\">\n {content}\n </Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\" className=\"h-fit min-w-48 max-w-80 pt-4\">\n <div className=\"flex flex-col gap-y-2\">\n <p className=\"whitespace-pre-line text-wrap break-keep\">{content}</p>\n <p className=\"w-full text-end\">{content.toString().length} chars</p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionName: React.FC<{\n name?: string | null | undefined;\n}> = ({ name }) => {\n if (!name) return <DescriptionEmpty />;\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\" className=\"line-clamp-2 w-full truncate\">\n {name}\n </Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\" className=\"h-fit min-w-48 max-w-80 pt-4\">\n <div className=\"flex flex-col gap-y-2\">\n <p className=\"whitespace-pre-line text-wrap break-keep\">{name}</p>\n <p className=\"w-full text-end\">{name.length} chars</p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\n\nexport const DescriptionNumberPhone: React.FC<React.PropsWithChildren<{ value: string }>> = ({ value }) => {\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '(00) (+84) ($1) $2-$3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { memo, useCallback, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Flex } from '@/components/layouts/flex';\nimport { DescriptionEmpty } from './empty';\n\nconst applyRounding = (num: number, precisionValue: number, roundingMode?: 'round' | 'floor' | 'ceil') => {\n const multiplier = 10 ** precisionValue;\n\n switch (roundingMode) {\n case 'floor':\n return Math.floor(num * multiplier) / multiplier;\n case 'ceil':\n return Math.ceil(num * multiplier) / multiplier;\n default:\n return Math.round(num * multiplier) / multiplier;\n }\n};\n\ntype Props = {\n decimalSeparator?: string;\n groupSeparator?: string;\n prefix?: React.ReactNode;\n suffix?: React.ReactNode;\n precision?: number; // Số chữ số thập phân\n roundingMode?: 'round' | 'floor' | 'ceil'; // Kiểu làm tròn\n showTrailingZeros?: boolean; // Hiển thị số 0 cuối\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; // Kích thước của component\n value: number | string | null | undefined;\n};\n\nexport const DescriptionStatistic = memo(\n ({\n decimalSeparator = '.',\n groupSeparator = ',',\n prefix: Prefix,\n suffix: Suffix,\n precision,\n roundingMode = 'round',\n showTrailingZeros = false,\n size = 'sm',\n value = 0,\n }: Props) => {\n // Memoize number formatting options\n const formatOptions = useMemo((): Intl.NumberFormatOptions => {\n const options: Intl.NumberFormatOptions = {};\n\n if (typeof precision === 'number' && precision >= 0 && showTrailingZeros) {\n options.minimumFractionDigits = precision;\n options.maximumFractionDigits = precision;\n } else {\n options.maximumFractionDigits = precision;\n }\n\n return options;\n }, [precision, showTrailingZeros]);\n\n const formatNumber = useCallback(\n (num: number): string => {\n let processedNum = num;\n\n // Áp dụng làm tròn nếu có precision\n if (typeof precision === 'number' && precision >= 0) {\n processedNum = applyRounding(num, precision, roundingMode);\n }\n\n return processedNum.toLocaleString('en-US', formatOptions);\n },\n [roundingMode, formatOptions, precision]\n );\n\n // Memoize value processing\n const processedValue = useMemo((): string => {\n // Xử lý giá trị number\n if (typeof value === 'number') {\n if (Number.isNaN(value) || !Number.isFinite(value)) {\n return 'N/A';\n }\n return formatNumber(value);\n }\n\n // Xử lý giá trị string\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n // Nếu là chuỗi rỗng\n if (!trimmedValue) {\n return 'N/A';\n }\n\n // Thử convert sang number\n const numValue = Number(trimmedValue);\n\n if (Number.isNaN(numValue) || !Number.isFinite(numValue)) {\n // Nếu không phải số, trả về string gốc\n return 'N/A';\n }\n\n return formatNumber(numValue);\n }\n\n return 'N/A';\n }, [value, formatNumber]);\n\n // Memoize separator replacement\n const finalFormattedValue = useMemo((): string => {\n // Chỉ thay thế separators nếu khác mặc định\n if (decimalSeparator === '.' && groupSeparator === ',') {\n return processedValue;\n }\n return processedValue.replace(/,/g, groupSeparator).replace(/\\./g, decimalSeparator);\n }, [processedValue, decimalSeparator, groupSeparator]);\n\n if (finalFormattedValue === '0' || finalFormattedValue === 'N/A' || !finalFormattedValue) {\n return <DescriptionEmpty />;\n }\n\n return (\n <Flex\n padding=\"none\"\n className={cn(\n 'font-number text-lg text-text-positive tabular-nums',\n size === 'xs' && 'text-xs',\n size === 'sm' && 'text-sm',\n size === 'md' && 'text-base',\n size === 'lg' && 'text-lg',\n size === 'xl' && 'text-xl'\n )}\n >\n {Prefix}\n <p>{finalFormattedValue}</p>\n {Suffix}\n </Flex>\n );\n }\n);\nDescriptionStatistic.displayName = 'DescriptionStatistic';\n","export * from './components'\n\nexport const DescriptionItem: React.FC<\n React.PropsWithChildren<{\n label: string;\n labelColSpan?: number;\n }>\n> = ({ label, labelColSpan = 3, children }) => {\n return (\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(12, minmax(0, 1fr))',\n }}\n className=\"grid border-b border-b-border\"\n >\n <div\n style={{\n gridColumn: `span ${labelColSpan} / span ${labelColSpan}`,\n }}\n className=\"flex min-w-full items-center justify-start overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm text-text-positive-weak tabular-nums\"\n >\n {label}\n </div>\n <div\n style={{\n gridColumn: `span ${12 - labelColSpan} / span ${12 - labelColSpan}`,\n }}\n className=\"flex flex-wrap gap-2 py-3 pr-2 pl-4 text-sm text-text-positive\"\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport const Description: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <div\n data-slot=\"description-wrapper\"\n className=\"relative flex size-full flex-col gap-y-0 space-y-0 overflow-hidden rounded-lg border border-border bg-card shadow-xs ring-3 ring-border-muted\"\n >\n {children}\n </div>\n );\n};\n"],"mappings":"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skeleton-VALtdlm9.mjs";import{t as e}from"../../image-BOLFKRA7.mjs";import{t}from"../../flex-DsiCflw0.mjs";import{t as n}from"../../paragraph-NGjcXqGV.mjs";import{t as r}from"../../date-BeK-z6-c.mjs";import{i,n as a,r as o,t as s}from"../../tooltip-pjVAbfk-.mjs";import{cn as c}from"@customafk/react-toolkit/utils";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{memo as d,useCallback as f,useMemo as p}from"react";const m=()=>l(`div`,{className:`flex items-center gap-0 font-medium text-sm text-text-positive-muted italic`,children:l(`p`,{children:`Empty Value`})}),h=({label:e})=>e?l(`div`,{className:`w-fit rounded-full border border-border-weak px-3 py-1 font-medium text-text-positive-weak text-xs tabular-nums shadow-xs`,children:e}):l(m,{}),g=({date:e})=>e==null?l(m,{}):l(o,{children:u(s,{children:[l(i,{children:l(r,{date:e,format:`medium`})}),l(a,{children:l(r,{date:e,format:`full`,showTime:!0,className:`font-medium text-xs`})})]})}),_=({images:t})=>!t||!t.length?l(m,{}):t.length===1?l(`div`,{className:`flex flex-wrap gap-4`,children:l(`div`,{className:`group relative size-42 rounded-sm shadow-xs`,children:l(e,{src:t[0].src,alt:t[0].alt,width:`100%`,height:`100%`})},t[0].id)}):l(`div`,{className:`flex flex-wrap gap-4`,children:t.map(t=>l(`div`,{className:`group relative size-16 rounded-sm shadow-xs`,children:l(e,{src:t.src,alt:t.alt,width:`100%`,height:`100%`})},t.id))}),v=({content:e})=>e==null?l(m,{}):u(s,{children:[l(i,{children:l(n,{variant:`sm`,className:`whitespace-pre-line break-all text-start text-sm`,children:e})}),l(a,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:u(`div`,{className:`flex flex-col gap-y-2`,children:[l(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),u(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),y=({name:e})=>e?u(s,{children:[l(i,{children:l(n,{variant:`sm`,className:`line-clamp-2 w-full truncate`,children:e})}),l(a,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:u(`div`,{className:`flex flex-col gap-y-2`,children:[l(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),u(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):l(m,{}),b=({value:e})=>u(s,{children:[l(i,{children:l(n,{variant:`sm`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),l(a,{align:`start`,children:l(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),x=(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}},S=d(({decimalSeparator:e=`.`,groupSeparator:n=`,`,prefix:r,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:d=`sm`,value:h=0})=>{let g=p(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),_=f(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=x(e,a,o)),t.toLocaleString(`en-US`,g)},[o,g,a]),v=p(()=>{if(typeof h==`number`)return Number.isNaN(h)||!Number.isFinite(h)?`N/A`:_(h);if(typeof h==`string`){let e=h.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:_(t)}return`N/A`},[h,_]),y=p(()=>e===`.`&&n===`,`?v:v.replace(/,/g,n).replace(/\./g,e),[v,e,n]);return y===`0`||y===`N/A`||!y?l(m,{}):u(t,{padding:`none`,className:c(`font-number text-lg text-text-positive tabular-nums`,d===`xs`&&`text-xs`,d===`sm`&&`text-sm`,d===`md`&&`text-base`,d===`lg`&&`text-lg`,d===`xl`&&`text-xl`),children:[r,l(`p`,{children:y}),i]})});S.displayName=`DescriptionStatistic`;const C=({label:e,labelColSpan:t=3,children:n})=>u(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},className:`grid border-b border-b-border`,children:[l(`div`,{style:{gridColumn:`span ${t} / span ${t}`},className:`flex min-w-full items-center justify-start overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm text-text-positive-weak tabular-nums`,children:e}),l(`div`,{style:{gridColumn:`span ${12-t} / span ${12-t}`},className:`flex flex-wrap gap-2 py-3 pr-2 pl-4 text-sm text-text-positive`,children:n})]}),w=({children:e})=>l(`div`,{"data-slot":`description-wrapper`,className:`relative flex size-full flex-col gap-y-0 space-y-0 overflow-hidden rounded-lg border border-border bg-card shadow-
|
|
1
|
+
import"../../skeleton-VALtdlm9.mjs";import{t as e}from"../../image-BOLFKRA7.mjs";import{t}from"../../flex-DsiCflw0.mjs";import{t as n}from"../../paragraph-NGjcXqGV.mjs";import{t as r}from"../../date-BeK-z6-c.mjs";import{i,n as a,r as o,t as s}from"../../tooltip-pjVAbfk-.mjs";import{cn as c}from"@customafk/react-toolkit/utils";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{memo as d,useCallback as f,useMemo as p}from"react";const m=()=>l(`div`,{className:`flex items-center gap-0 font-medium text-sm text-text-positive-muted italic`,children:l(`p`,{children:`Empty Value`})}),h=({label:e})=>e?l(`div`,{className:`w-fit rounded-full border border-border-weak px-3 py-1 font-medium text-text-positive-weak text-xs tabular-nums shadow-xs`,children:e}):l(m,{}),g=({date:e})=>e==null?l(m,{}):l(o,{children:u(s,{children:[l(i,{children:l(r,{date:e,format:`medium`})}),l(a,{children:l(r,{date:e,format:`full`,showTime:!0,className:`font-medium text-xs`})})]})}),_=({images:t})=>!t||!t.length?l(m,{}):t.length===1?l(`div`,{className:`flex flex-wrap gap-4`,children:l(`div`,{className:`group relative size-42 rounded-sm shadow-xs`,children:l(e,{src:t[0].src,alt:t[0].alt,width:`100%`,height:`100%`})},t[0].id)}):l(`div`,{className:`flex flex-wrap gap-4`,children:t.map(t=>l(`div`,{className:`group relative size-16 rounded-sm shadow-xs`,children:l(e,{src:t.src,alt:t.alt,width:`100%`,height:`100%`})},t.id))}),v=({content:e})=>e==null?l(m,{}):u(s,{children:[l(i,{children:l(n,{variant:`sm`,className:`whitespace-pre-line break-all text-start text-sm`,children:e})}),l(a,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:u(`div`,{className:`flex flex-col gap-y-2`,children:[l(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),u(`p`,{className:`w-full text-end`,children:[e.toString().length,` chars`]})]})})]}),y=({name:e})=>e?u(s,{children:[l(i,{children:l(n,{variant:`sm`,className:`line-clamp-2 w-full truncate`,children:e})}),l(a,{align:`start`,className:`h-fit min-w-48 max-w-80 pt-4`,children:u(`div`,{className:`flex flex-col gap-y-2`,children:[l(`p`,{className:`whitespace-pre-line text-wrap break-keep`,children:e}),u(`p`,{className:`w-full text-end`,children:[e.length,` chars`]})]})})]}):l(m,{}),b=({value:e})=>u(s,{children:[l(i,{children:l(n,{variant:`sm`,children:e.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),l(a,{align:`start`,children:l(`p`,{className:`tabular-nums`,children:e.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`(00) (+84) ($1) $2-$3`)})})]}),x=(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}},S=d(({decimalSeparator:e=`.`,groupSeparator:n=`,`,prefix:r,suffix:i,precision:a,roundingMode:o=`round`,showTrailingZeros:s=!1,size:d=`sm`,value:h=0})=>{let g=p(()=>{let e={};return typeof a==`number`&&a>=0&&s&&(e.minimumFractionDigits=a),e.maximumFractionDigits=a,e},[a,s]),_=f(e=>{let t=e;return typeof a==`number`&&a>=0&&(t=x(e,a,o)),t.toLocaleString(`en-US`,g)},[o,g,a]),v=p(()=>{if(typeof h==`number`)return Number.isNaN(h)||!Number.isFinite(h)?`N/A`:_(h);if(typeof h==`string`){let e=h.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:_(t)}return`N/A`},[h,_]),y=p(()=>e===`.`&&n===`,`?v:v.replace(/,/g,n).replace(/\./g,e),[v,e,n]);return y===`0`||y===`N/A`||!y?l(m,{}):u(t,{padding:`none`,className:c(`font-number text-lg text-text-positive tabular-nums`,d===`xs`&&`text-xs`,d===`sm`&&`text-sm`,d===`md`&&`text-base`,d===`lg`&&`text-lg`,d===`xl`&&`text-xl`),children:[r,l(`p`,{children:y}),i]})});S.displayName=`DescriptionStatistic`;const C=({label:e,labelColSpan:t=3,children:n})=>u(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},className:`grid border-b border-b-border`,children:[l(`div`,{style:{gridColumn:`span ${t} / span ${t}`},className:`flex min-w-full items-center justify-start overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm text-text-positive-weak tabular-nums`,children:e}),l(`div`,{style:{gridColumn:`span ${12-t} / span ${12-t}`},className:`flex flex-wrap gap-2 py-3 pr-2 pl-4 text-sm text-text-positive`,children:n})]}),w=({children:e})=>l(`div`,{"data-slot":`description-wrapper`,className:`relative flex size-full flex-col gap-y-0 space-y-0 overflow-hidden rounded-lg border border-border bg-card shadow-xs ring-3 ring-border-muted`,children:e});export{w as Description,h as DescriptionBadge,g as DescriptionDate,m as DescriptionEmpty,_ as DescriptionImages,C as DescriptionItem,v as DescriptionLongText,y as DescriptionName,b as DescriptionNumberPhone,S as DescriptionStatistic};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["DescriptionEmpty: React.FC","DescriptionBadge: React.FC<{\n label: string | number | null | undefined;\n}>","DescriptionDate: React.FC<Props>","DescriptionImages: React.FC<{\n images?:\n | Array<{\n id: string;\n src: string;\n alt: string;\n }>\n | null\n | undefined;\n}>","DescriptionLongText: React.FC<{ content: string | null | undefined | number }>","DescriptionName: React.FC<{\n name?: string | null | undefined;\n}>","DescriptionNumberPhone: React.FC<React.PropsWithChildren<{ value: string }>>","options: Intl.NumberFormatOptions","DescriptionItem: React.FC<\n React.PropsWithChildren<{\n label: string;\n labelColSpan?: number;\n }>\n>","Description: React.FC<React.PropsWithChildren>"],"sources":["../../../packages/components/features/descriptions/components/empty.tsx","../../../packages/components/features/descriptions/components/badge.tsx","../../../packages/components/features/descriptions/components/date.tsx","../../../packages/components/features/descriptions/components/images.tsx","../../../packages/components/features/descriptions/components/longtext.tsx","../../../packages/components/features/descriptions/components/name.tsx","../../../packages/components/features/descriptions/components/number-phone.tsx","../../../packages/components/features/descriptions/components/statistic.tsx","../../../packages/components/features/descriptions/index.tsx"],"sourcesContent":["export const DescriptionEmpty: React.FC = () => {\n return (\n <div className=\"flex items-center gap-0 font-medium text-sm text-text-positive-muted italic\">\n <p>Empty Value</p>\n </div>\n );\n};\n","import { DescriptionEmpty } from './empty';\n\nexport const DescriptionBadge: React.FC<{\n label: string | number | null | undefined;\n}> = ({ label }) => {\n if (!label) return <DescriptionEmpty />;\n return (\n <div className=\"w-fit rounded-full border border-border-weak px-3 py-1 font-medium text-text-positive-weak text-xs tabular-nums shadow-xs\">{label}</div>\n );\n};\n","import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { DateDisplay } from '@/components/data-display/date';\nimport { DescriptionEmpty } from './empty';\n\ntype Props = {\n date: Date | string | number | null | undefined;\n};\nexport const DescriptionDate: React.FC<Props> = ({ date }) => {\n if (typeof date === 'undefined' || date === null) return <DescriptionEmpty />;\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger>\n <DateDisplay date={date} format=\"medium\" />\n </TooltipTrigger>\n <TooltipContent>\n <DateDisplay date={date} format=\"full\" showTime className=\"font-medium text-xs\" />\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n};\n","import { Image } from '@/components/ui/image';\n\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionImages: React.FC<{\n images?:\n | Array<{\n id: string;\n src: string;\n alt: string;\n }>\n | null\n | undefined;\n}> = ({ images }) => {\n if (!images || !images.length) return <DescriptionEmpty />;\n if (images.length === 1)\n return (\n <div className=\"flex flex-wrap gap-4\">\n <div key={images[0].id} className=\"group relative size-42 rounded-sm shadow-xs\">\n <Image src={images[0].src} alt={images[0].alt} width=\"100%\" height=\"100%\" />\n </div>\n </div>\n );\n return (\n <div className=\"flex flex-wrap gap-4\">\n {images.map(image => (\n <div key={image.id} className=\"group relative size-16 rounded-sm shadow-xs\">\n <Image src={image.src} alt={image.alt} width=\"100%\" height=\"100%\" />\n </div>\n ))}\n </div>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionLongText: React.FC<{ content: string | null | undefined | number }> = ({ content }) => {\n if (content === undefined || content === null) {\n return <DescriptionEmpty />;\n }\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\" className=\"whitespace-pre-line break-all text-start text-sm\">\n {content}\n </Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\" className=\"h-fit min-w-48 max-w-80 pt-4\">\n <div className=\"flex flex-col gap-y-2\">\n <p className=\"whitespace-pre-line text-wrap break-keep\">{content}</p>\n <p className=\"w-full text-end\">{content.toString().length} chars</p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionName: React.FC<{\n name?: string | null | undefined;\n}> = ({ name }) => {\n if (!name) return <DescriptionEmpty />;\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\" className=\"line-clamp-2 w-full truncate\">\n {name}\n </Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\" className=\"h-fit min-w-48 max-w-80 pt-4\">\n <div className=\"flex flex-col gap-y-2\">\n <p className=\"whitespace-pre-line text-wrap break-keep\">{name}</p>\n <p className=\"w-full text-end\">{name.length} chars</p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\n\nexport const DescriptionNumberPhone: React.FC<React.PropsWithChildren<{ value: string }>> = ({ value }) => {\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '(00) (+84) ($1) $2-$3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { memo, useCallback, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Flex } from '@/components/layouts/flex';\nimport { DescriptionEmpty } from './empty';\n\nconst applyRounding = (num: number, precisionValue: number, roundingMode?: 'round' | 'floor' | 'ceil') => {\n const multiplier = 10 ** precisionValue;\n\n switch (roundingMode) {\n case 'floor':\n return Math.floor(num * multiplier) / multiplier;\n case 'ceil':\n return Math.ceil(num * multiplier) / multiplier;\n default:\n return Math.round(num * multiplier) / multiplier;\n }\n};\n\ntype Props = {\n decimalSeparator?: string;\n groupSeparator?: string;\n prefix?: React.ReactNode;\n suffix?: React.ReactNode;\n precision?: number; // Số chữ số thập phân\n roundingMode?: 'round' | 'floor' | 'ceil'; // Kiểu làm tròn\n showTrailingZeros?: boolean; // Hiển thị số 0 cuối\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; // Kích thước của component\n value: number | string | null | undefined;\n};\n\nexport const DescriptionStatistic = memo(\n ({\n decimalSeparator = '.',\n groupSeparator = ',',\n prefix: Prefix,\n suffix: Suffix,\n precision,\n roundingMode = 'round',\n showTrailingZeros = false,\n size = 'sm',\n value = 0,\n }: Props) => {\n // Memoize number formatting options\n const formatOptions = useMemo((): Intl.NumberFormatOptions => {\n const options: Intl.NumberFormatOptions = {};\n\n if (typeof precision === 'number' && precision >= 0 && showTrailingZeros) {\n options.minimumFractionDigits = precision;\n options.maximumFractionDigits = precision;\n } else {\n options.maximumFractionDigits = precision;\n }\n\n return options;\n }, [precision, showTrailingZeros]);\n\n const formatNumber = useCallback(\n (num: number): string => {\n let processedNum = num;\n\n // Áp dụng làm tròn nếu có precision\n if (typeof precision === 'number' && precision >= 0) {\n processedNum = applyRounding(num, precision, roundingMode);\n }\n\n return processedNum.toLocaleString('en-US', formatOptions);\n },\n [roundingMode, formatOptions, precision]\n );\n\n // Memoize value processing\n const processedValue = useMemo((): string => {\n // Xử lý giá trị number\n if (typeof value === 'number') {\n if (Number.isNaN(value) || !Number.isFinite(value)) {\n return 'N/A';\n }\n return formatNumber(value);\n }\n\n // Xử lý giá trị string\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n // Nếu là chuỗi rỗng\n if (!trimmedValue) {\n return 'N/A';\n }\n\n // Thử convert sang number\n const numValue = Number(trimmedValue);\n\n if (Number.isNaN(numValue) || !Number.isFinite(numValue)) {\n // Nếu không phải số, trả về string gốc\n return 'N/A';\n }\n\n return formatNumber(numValue);\n }\n\n return 'N/A';\n }, [value, formatNumber]);\n\n // Memoize separator replacement\n const finalFormattedValue = useMemo((): string => {\n // Chỉ thay thế separators nếu khác mặc định\n if (decimalSeparator === '.' && groupSeparator === ',') {\n return processedValue;\n }\n return processedValue.replace(/,/g, groupSeparator).replace(/\\./g, decimalSeparator);\n }, [processedValue, decimalSeparator, groupSeparator]);\n\n if (finalFormattedValue === '0' || finalFormattedValue === 'N/A' || !finalFormattedValue) {\n return <DescriptionEmpty />;\n }\n\n return (\n <Flex\n padding=\"none\"\n className={cn(\n 'font-number text-lg text-text-positive tabular-nums',\n size === 'xs' && 'text-xs',\n size === 'sm' && 'text-sm',\n size === 'md' && 'text-base',\n size === 'lg' && 'text-lg',\n size === 'xl' && 'text-xl'\n )}\n >\n {Prefix}\n <p>{finalFormattedValue}</p>\n {Suffix}\n </Flex>\n );\n }\n);\nDescriptionStatistic.displayName = 'DescriptionStatistic';\n","export * from './components'\n\nexport const DescriptionItem: React.FC<\n React.PropsWithChildren<{\n label: string;\n labelColSpan?: number;\n }>\n> = ({ label, labelColSpan = 3, children }) => {\n return (\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(12, minmax(0, 1fr))',\n }}\n className=\"grid border-b border-b-border\"\n >\n <div\n style={{\n gridColumn: `span ${labelColSpan} / span ${labelColSpan}`,\n }}\n className=\"flex min-w-full items-center justify-start overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm text-text-positive-weak tabular-nums\"\n >\n {label}\n </div>\n <div\n style={{\n gridColumn: `span ${12 - labelColSpan} / span ${12 - labelColSpan}`,\n }}\n className=\"flex flex-wrap gap-2 py-3 pr-2 pl-4 text-sm text-text-positive\"\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport const Description: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <div\n data-slot=\"description-wrapper\"\n className=\"relative flex size-full flex-col gap-y-0 space-y-0 overflow-hidden rounded-lg border border-border bg-card shadow-card ring-3 ring-border-muted\"\n >\n {children}\n </div>\n );\n};\n"],"mappings":"qbAAA,MAAaA,MAET,EAAC,MAAA,CAAI,UAAU,uFACb,EAAC,IAAA,CAAA,SAAE,cAAA,CAAe,EACd,CCFGC,GAEP,CAAE,WACD,EAEH,EAAC,MAAA,CAAI,UAAU,qIAA6H,GAAY,CAFvI,EAAC,EAAA,EAAA,CAAmB,CCG5BC,GAAoC,CAAE,UACtC,GAAiC,KAAa,EAAC,EAAA,EAAA,CAAmB,CAE3E,EAAC,EAAA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AAU,iEAET,YACG,CAAA,EACF,CAIGC,GAAkD,CAAE,cAE7D,EAAC,MAAA,CACC,YAAU,sBACV,UAAU,kJAET,YACG"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["DescriptionEmpty: React.FC","DescriptionBadge: React.FC<{\n label: string | number | null | undefined;\n}>","DescriptionDate: React.FC<Props>","DescriptionImages: React.FC<{\n images?:\n | Array<{\n id: string;\n src: string;\n alt: string;\n }>\n | null\n | undefined;\n}>","DescriptionLongText: React.FC<{ content: string | null | undefined | number }>","DescriptionName: React.FC<{\n name?: string | null | undefined;\n}>","DescriptionNumberPhone: React.FC<React.PropsWithChildren<{ value: string }>>","options: Intl.NumberFormatOptions","DescriptionItem: React.FC<\n React.PropsWithChildren<{\n label: string;\n labelColSpan?: number;\n }>\n>","Description: React.FC<React.PropsWithChildren>"],"sources":["../../../packages/components/features/descriptions/components/empty.tsx","../../../packages/components/features/descriptions/components/badge.tsx","../../../packages/components/features/descriptions/components/date.tsx","../../../packages/components/features/descriptions/components/images.tsx","../../../packages/components/features/descriptions/components/longtext.tsx","../../../packages/components/features/descriptions/components/name.tsx","../../../packages/components/features/descriptions/components/number-phone.tsx","../../../packages/components/features/descriptions/components/statistic.tsx","../../../packages/components/features/descriptions/index.tsx"],"sourcesContent":["export const DescriptionEmpty: React.FC = () => {\n return (\n <div className=\"flex items-center gap-0 font-medium text-sm text-text-positive-muted italic\">\n <p>Empty Value</p>\n </div>\n );\n};\n","import { DescriptionEmpty } from './empty';\n\nexport const DescriptionBadge: React.FC<{\n label: string | number | null | undefined;\n}> = ({ label }) => {\n if (!label) return <DescriptionEmpty />;\n return (\n <div className=\"w-fit rounded-full border border-border-weak px-3 py-1 font-medium text-text-positive-weak text-xs tabular-nums shadow-xs\">{label}</div>\n );\n};\n","import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { DateDisplay } from '@/components/data-display/date';\nimport { DescriptionEmpty } from './empty';\n\ntype Props = {\n date: Date | string | number | null | undefined;\n};\nexport const DescriptionDate: React.FC<Props> = ({ date }) => {\n if (typeof date === 'undefined' || date === null) return <DescriptionEmpty />;\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger>\n <DateDisplay date={date} format=\"medium\" />\n </TooltipTrigger>\n <TooltipContent>\n <DateDisplay date={date} format=\"full\" showTime className=\"font-medium text-xs\" />\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n};\n","import { Image } from '@/components/ui/image';\n\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionImages: React.FC<{\n images?:\n | Array<{\n id: string;\n src: string;\n alt: string;\n }>\n | null\n | undefined;\n}> = ({ images }) => {\n if (!images || !images.length) return <DescriptionEmpty />;\n if (images.length === 1)\n return (\n <div className=\"flex flex-wrap gap-4\">\n <div key={images[0].id} className=\"group relative size-42 rounded-sm shadow-xs\">\n <Image src={images[0].src} alt={images[0].alt} width=\"100%\" height=\"100%\" />\n </div>\n </div>\n );\n return (\n <div className=\"flex flex-wrap gap-4\">\n {images.map(image => (\n <div key={image.id} className=\"group relative size-16 rounded-sm shadow-xs\">\n <Image src={image.src} alt={image.alt} width=\"100%\" height=\"100%\" />\n </div>\n ))}\n </div>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionLongText: React.FC<{ content: string | null | undefined | number }> = ({ content }) => {\n if (content === undefined || content === null) {\n return <DescriptionEmpty />;\n }\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\" className=\"whitespace-pre-line break-all text-start text-sm\">\n {content}\n </Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\" className=\"h-fit min-w-48 max-w-80 pt-4\">\n <div className=\"flex flex-col gap-y-2\">\n <p className=\"whitespace-pre-line text-wrap break-keep\">{content}</p>\n <p className=\"w-full text-end\">{content.toString().length} chars</p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\nimport { DescriptionEmpty } from './empty';\n\nexport const DescriptionName: React.FC<{\n name?: string | null | undefined;\n}> = ({ name }) => {\n if (!name) return <DescriptionEmpty />;\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\" className=\"line-clamp-2 w-full truncate\">\n {name}\n </Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\" className=\"h-fit min-w-48 max-w-80 pt-4\">\n <div className=\"flex flex-col gap-y-2\">\n <p className=\"whitespace-pre-line text-wrap break-keep\">{name}</p>\n <p className=\"w-full text-end\">{name.length} chars</p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { Paragraph } from '@/components/typography/paragraph';\n\nexport const DescriptionNumberPhone: React.FC<React.PropsWithChildren<{ value: string }>> = ({ value }) => {\n return (\n <Tooltip>\n <TooltipTrigger>\n <Paragraph variant=\"sm\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</Paragraph>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '(00) (+84) ($1) $2-$3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n","import { memo, useCallback, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Flex } from '@/components/layouts/flex';\nimport { DescriptionEmpty } from './empty';\n\nconst applyRounding = (num: number, precisionValue: number, roundingMode?: 'round' | 'floor' | 'ceil') => {\n const multiplier = 10 ** precisionValue;\n\n switch (roundingMode) {\n case 'floor':\n return Math.floor(num * multiplier) / multiplier;\n case 'ceil':\n return Math.ceil(num * multiplier) / multiplier;\n default:\n return Math.round(num * multiplier) / multiplier;\n }\n};\n\ntype Props = {\n decimalSeparator?: string;\n groupSeparator?: string;\n prefix?: React.ReactNode;\n suffix?: React.ReactNode;\n precision?: number; // Số chữ số thập phân\n roundingMode?: 'round' | 'floor' | 'ceil'; // Kiểu làm tròn\n showTrailingZeros?: boolean; // Hiển thị số 0 cuối\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; // Kích thước của component\n value: number | string | null | undefined;\n};\n\nexport const DescriptionStatistic = memo(\n ({\n decimalSeparator = '.',\n groupSeparator = ',',\n prefix: Prefix,\n suffix: Suffix,\n precision,\n roundingMode = 'round',\n showTrailingZeros = false,\n size = 'sm',\n value = 0,\n }: Props) => {\n // Memoize number formatting options\n const formatOptions = useMemo((): Intl.NumberFormatOptions => {\n const options: Intl.NumberFormatOptions = {};\n\n if (typeof precision === 'number' && precision >= 0 && showTrailingZeros) {\n options.minimumFractionDigits = precision;\n options.maximumFractionDigits = precision;\n } else {\n options.maximumFractionDigits = precision;\n }\n\n return options;\n }, [precision, showTrailingZeros]);\n\n const formatNumber = useCallback(\n (num: number): string => {\n let processedNum = num;\n\n // Áp dụng làm tròn nếu có precision\n if (typeof precision === 'number' && precision >= 0) {\n processedNum = applyRounding(num, precision, roundingMode);\n }\n\n return processedNum.toLocaleString('en-US', formatOptions);\n },\n [roundingMode, formatOptions, precision]\n );\n\n // Memoize value processing\n const processedValue = useMemo((): string => {\n // Xử lý giá trị number\n if (typeof value === 'number') {\n if (Number.isNaN(value) || !Number.isFinite(value)) {\n return 'N/A';\n }\n return formatNumber(value);\n }\n\n // Xử lý giá trị string\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n // Nếu là chuỗi rỗng\n if (!trimmedValue) {\n return 'N/A';\n }\n\n // Thử convert sang number\n const numValue = Number(trimmedValue);\n\n if (Number.isNaN(numValue) || !Number.isFinite(numValue)) {\n // Nếu không phải số, trả về string gốc\n return 'N/A';\n }\n\n return formatNumber(numValue);\n }\n\n return 'N/A';\n }, [value, formatNumber]);\n\n // Memoize separator replacement\n const finalFormattedValue = useMemo((): string => {\n // Chỉ thay thế separators nếu khác mặc định\n if (decimalSeparator === '.' && groupSeparator === ',') {\n return processedValue;\n }\n return processedValue.replace(/,/g, groupSeparator).replace(/\\./g, decimalSeparator);\n }, [processedValue, decimalSeparator, groupSeparator]);\n\n if (finalFormattedValue === '0' || finalFormattedValue === 'N/A' || !finalFormattedValue) {\n return <DescriptionEmpty />;\n }\n\n return (\n <Flex\n padding=\"none\"\n className={cn(\n 'font-number text-lg text-text-positive tabular-nums',\n size === 'xs' && 'text-xs',\n size === 'sm' && 'text-sm',\n size === 'md' && 'text-base',\n size === 'lg' && 'text-lg',\n size === 'xl' && 'text-xl'\n )}\n >\n {Prefix}\n <p>{finalFormattedValue}</p>\n {Suffix}\n </Flex>\n );\n }\n);\nDescriptionStatistic.displayName = 'DescriptionStatistic';\n","export * from './components'\n\nexport const DescriptionItem: React.FC<\n React.PropsWithChildren<{\n label: string;\n labelColSpan?: number;\n }>\n> = ({ label, labelColSpan = 3, children }) => {\n return (\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(12, minmax(0, 1fr))',\n }}\n className=\"grid border-b border-b-border\"\n >\n <div\n style={{\n gridColumn: `span ${labelColSpan} / span ${labelColSpan}`,\n }}\n className=\"flex min-w-full items-center justify-start overflow-x-hidden text-wrap break-all border-r border-r-border bg-secondary-muted py-3 pr-2 pl-4 text-sm text-text-positive-weak tabular-nums\"\n >\n {label}\n </div>\n <div\n style={{\n gridColumn: `span ${12 - labelColSpan} / span ${12 - labelColSpan}`,\n }}\n className=\"flex flex-wrap gap-2 py-3 pr-2 pl-4 text-sm text-text-positive\"\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport const Description: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <div\n data-slot=\"description-wrapper\"\n className=\"relative flex size-full flex-col gap-y-0 space-y-0 overflow-hidden rounded-lg border border-border bg-card shadow-xs ring-3 ring-border-muted\"\n >\n {children}\n </div>\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AAc,uBCvInC,MAAaC,GAKR,CAAE,QAAO,eAAe,EAAG,cAE5B,EAAC,MAAA,CACC,MAAO,CACL,QAAS,OACT,oBAAqB,6BACtB,CACD,UAAU,0CAEV,EAAC,MAAA,CACC,MAAO,CACL,WAAY,QAAQ,EAAa,UAAU,IAC5C,CACD,UAAU,oMAET,GACG,CACN,EAAC,MAAA,CACC,MAAO,CACL,WAAY,QAAQ,GAAK,EAAa,UAAU,GAAK,IACtD,CACD,UAAU,iEAET,YACG,CAAA,EACF,CAIGC,GAAkD,CAAE,cAE7D,EAAC,MAAA,CACC,YAAU,sBACV,UAAU,gJAET,YACG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Input } from "../../input-
|
|
1
|
+
import { t as Input } from "../../input-CiSjWD7c.cjs";
|
|
2
2
|
import * as react_jsx_runtime338 from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react187 from "react";
|
|
4
4
|
import { AccessorKeyColumnDef, ColumnPinningState, RowData, RowSelectionState, Table } from "@tanstack/react-table";
|
|
5
5
|
import { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
|
|
6
6
|
|
|
@@ -56,7 +56,7 @@ type Props$1 = {
|
|
|
56
56
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
57
57
|
value: number | string | null | undefined;
|
|
58
58
|
};
|
|
59
|
-
declare const UITableStatisticDisplay:
|
|
59
|
+
declare const UITableStatisticDisplay: react187.MemoExoticComponent<({
|
|
60
60
|
decimalSeparator,
|
|
61
61
|
groupSeparator,
|
|
62
62
|
prefix: Prefix,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Input } from "../../input-
|
|
1
|
+
import { t as Input } from "../../input-Cr08bM_0.mjs";
|
|
2
2
|
import * as react_jsx_runtime338 from "react/jsx-runtime";
|
|
3
3
|
import * as react188 from "react";
|
|
4
4
|
import { AccessorKeyColumnDef, ColumnPinningState, RowData, RowSelectionState, Table } from "@tanstack/react-table";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime164 from "react/jsx-runtime";
|
|
2
2
|
import * as class_variance_authority_types11 from "class-variance-authority/types";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
|
|
@@ -21,7 +21,7 @@ declare function Input({
|
|
|
21
21
|
variant?: InputVariantProps['variant'];
|
|
22
22
|
size?: InputVariantProps['size'];
|
|
23
23
|
onValueChange?: (value: string) => void;
|
|
24
|
-
}):
|
|
24
|
+
}): react_jsx_runtime164.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { Input as t };
|
|
27
|
-
//# sourceMappingURL=input-
|
|
27
|
+
//# sourceMappingURL=input-CiSjWD7c.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime149 from "react/jsx-runtime";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as class_variance_authority_types10 from "class-variance-authority/types";
|
|
4
4
|
|
|
@@ -21,7 +21,7 @@ declare function Input({
|
|
|
21
21
|
variant?: InputVariantProps['variant'];
|
|
22
22
|
size?: InputVariantProps['size'];
|
|
23
23
|
onValueChange?: (value: string) => void;
|
|
24
|
-
}):
|
|
24
|
+
}): react_jsx_runtime149.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { Input as t };
|
|
27
|
-
//# sourceMappingURL=input-
|
|
27
|
+
//# sourceMappingURL=input-Cr08bM_0.d.mts.map
|