@customafk/lunas-ui 0.1.86 → 0.1.87

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.
Files changed (159) hide show
  1. package/dist/{button-D2qx5QHI.d.cts → button-70p_rB81.d.cts} +7 -7
  2. package/dist/{button-eheC-7Id.d.mts → button-BMzPKC0-.d.mts} +7 -7
  3. package/dist/cards/simple-card.d.cts +2 -2
  4. package/dist/data-display/empty.d.mts +2 -2
  5. package/dist/data-display/statistic.d.cts +2 -2
  6. package/dist/data-display/statistic.d.mts +2 -2
  7. package/dist/{dialog-5imw84-8.d.cts → dialog-B5NbVD73.d.cts} +12 -12
  8. package/dist/{dialog-T7CVHrm2.d.mts → dialog-IGmKIrTb.d.mts} +12 -12
  9. package/dist/dialogs/detail-dialog/components/sidebar.d.cts +2 -2
  10. package/dist/dialogs/detail-dialog/components/sidebar.d.mts +25 -25
  11. package/dist/features/descriptions/index.cjs.map +1 -1
  12. package/dist/features/descriptions/index.d.cts +4 -4
  13. package/dist/features/descriptions/index.mjs.map +1 -1
  14. package/dist/features/search-modal/index.d.mts +2 -2
  15. package/dist/features/tables/index.cjs +1 -1
  16. package/dist/features/tables/index.cjs.map +1 -1
  17. package/dist/features/tables/index.d.cts +10 -8
  18. package/dist/features/tables/index.d.mts +4 -2
  19. package/dist/features/tables/index.mjs +1 -1
  20. package/dist/features/tables/index.mjs.map +1 -1
  21. package/dist/features/tanstack-form/index.cjs +1 -1
  22. package/dist/features/tanstack-form/index.cjs.map +1 -1
  23. package/dist/features/tanstack-form/index.d.cts +6 -0
  24. package/dist/features/tanstack-form/index.d.mts +6 -0
  25. package/dist/features/tanstack-form/index.mjs +1 -1
  26. package/dist/features/tanstack-form/index.mjs.map +1 -1
  27. package/dist/{input-BYz8teIQ.d.mts → input-C4zZ2I8W.d.cts} +5 -5
  28. package/dist/{input-DhoSwu7d.mjs → input-CqN74taK.mjs} +2 -2
  29. package/dist/{input-DhoSwu7d.mjs.map → input-CqN74taK.mjs.map} +1 -1
  30. package/dist/{input-CbpWzuai.d.cts → input-RNF3AtQx.d.mts} +6 -6
  31. package/dist/{input-qnlHzDDm.cjs → input-dAoEznUI.cjs} +2 -2
  32. package/dist/{input-qnlHzDDm.cjs.map → input-dAoEznUI.cjs.map} +1 -1
  33. package/dist/layouts/cms-layout/index.cjs +1 -1
  34. package/dist/layouts/cms-layout/index.mjs +1 -1
  35. package/dist/layouts/flex.d.cts +8 -8
  36. package/dist/layouts/flex.d.mts +12 -12
  37. package/dist/layouts/payment-layout/index.cjs +1 -1
  38. package/dist/layouts/payment-layout/index.mjs +1 -1
  39. package/dist/pages/FeatureDeveloping.d.cts +2 -2
  40. package/dist/pages/FeatureDeveloping.d.mts +2 -2
  41. package/dist/pages/FeatureFixing.d.cts +2 -2
  42. package/dist/pages/FeatureFixing.d.mts +2 -2
  43. package/dist/pages/NotAuthorized.d.cts +2 -2
  44. package/dist/pages/NotAuthorized.d.mts +2 -2
  45. package/dist/pages/NotFound.d.cts +2 -2
  46. package/dist/pages/NotFound.d.mts +2 -2
  47. package/dist/typography/paragraph.d.cts +2 -2
  48. package/dist/typography/paragraph.d.mts +2 -2
  49. package/dist/typography/title.d.cts +2 -2
  50. package/dist/typography/title.d.mts +2 -2
  51. package/dist/ui/alert-dialog.d.mts +12 -12
  52. package/dist/ui/alert.d.cts +7 -7
  53. package/dist/ui/alert.d.mts +7 -7
  54. package/dist/ui/aspect-ratio.d.cts +2 -2
  55. package/dist/ui/aspect-ratio.d.mts +2 -2
  56. package/dist/ui/avatar.d.cts +4 -4
  57. package/dist/ui/avatar.d.mts +4 -4
  58. package/dist/ui/badge.d.cts +3 -3
  59. package/dist/ui/badge.d.mts +5 -5
  60. package/dist/ui/breadcrumb.d.cts +8 -8
  61. package/dist/ui/breadcrumb.d.mts +8 -8
  62. package/dist/ui/button-group.d.cts +4 -4
  63. package/dist/ui/button-group.d.mts +6 -6
  64. package/dist/ui/button.d.cts +1 -1
  65. package/dist/ui/button.d.mts +1 -1
  66. package/dist/ui/calendar.d.cts +4 -4
  67. package/dist/ui/calendar.d.mts +4 -4
  68. package/dist/ui/card.d.cts +8 -8
  69. package/dist/ui/card.d.mts +8 -8
  70. package/dist/ui/carousel.d.cts +7 -7
  71. package/dist/ui/carousel.d.mts +7 -7
  72. package/dist/ui/checkbox.d.cts +2 -2
  73. package/dist/ui/checkbox.d.mts +2 -2
  74. package/dist/ui/collapsible.d.cts +4 -4
  75. package/dist/ui/collapsible.d.mts +4 -4
  76. package/dist/ui/command.d.cts +11 -11
  77. package/dist/ui/command.d.mts +11 -11
  78. package/dist/ui/context-menu.d.cts +16 -16
  79. package/dist/ui/context-menu.d.mts +16 -16
  80. package/dist/ui/dialog.d.cts +1 -1
  81. package/dist/ui/dialog.d.mts +1 -1
  82. package/dist/ui/drawer.d.cts +11 -11
  83. package/dist/ui/drawer.d.mts +11 -11
  84. package/dist/ui/dropdown-menu.d.cts +16 -16
  85. package/dist/ui/dropdown-menu.d.mts +16 -16
  86. package/dist/ui/empty.d.cts +9 -9
  87. package/dist/ui/empty.d.mts +9 -9
  88. package/dist/ui/field.d.cts +24 -24
  89. package/dist/ui/field.d.mts +24 -24
  90. package/dist/ui/file-uploader.d.cts +2 -2
  91. package/dist/ui/file-uploader.d.mts +2 -2
  92. package/dist/ui/form.d.cts +11 -11
  93. package/dist/ui/form.d.mts +11 -11
  94. package/dist/ui/hover-card.d.cts +4 -4
  95. package/dist/ui/hover-card.d.mts +4 -4
  96. package/dist/ui/input-otp.d.cts +5 -5
  97. package/dist/ui/input-otp.d.mts +5 -5
  98. package/dist/ui/input.cjs +1 -1
  99. package/dist/ui/input.d.cts +1 -1
  100. package/dist/ui/input.d.mts +1 -1
  101. package/dist/ui/input.mjs +1 -1
  102. package/dist/ui/inputs/search-input.cjs +1 -1
  103. package/dist/ui/inputs/search-input.d.cts +3 -3
  104. package/dist/ui/inputs/search-input.d.mts +3 -3
  105. package/dist/ui/inputs/search-input.mjs +1 -1
  106. package/dist/ui/item.d.cts +15 -15
  107. package/dist/ui/item.d.mts +15 -15
  108. package/dist/ui/label.d.cts +2 -2
  109. package/dist/ui/label.d.mts +2 -2
  110. package/dist/ui/menubar.d.cts +17 -17
  111. package/dist/ui/menubar.d.mts +17 -17
  112. package/dist/ui/multi-select.d.cts +2 -2
  113. package/dist/ui/multi-select.d.mts +3 -3
  114. package/dist/ui/navigation-menu.d.cts +11 -11
  115. package/dist/ui/navigation-menu.d.mts +11 -11
  116. package/dist/ui/pagination.d.cts +9 -9
  117. package/dist/ui/pagination.d.mts +9 -9
  118. package/dist/ui/popover.d.cts +5 -5
  119. package/dist/ui/popover.d.mts +5 -5
  120. package/dist/ui/progress.d.cts +2 -2
  121. package/dist/ui/progress.d.mts +2 -2
  122. package/dist/ui/radio-group.d.cts +3 -3
  123. package/dist/ui/radio-group.d.mts +3 -3
  124. package/dist/ui/resizable.d.cts +4 -4
  125. package/dist/ui/resizable.d.mts +4 -4
  126. package/dist/ui/scroll-area.d.cts +6 -6
  127. package/dist/ui/scroll-area.d.mts +6 -6
  128. package/dist/ui/select.d.cts +11 -11
  129. package/dist/ui/select.d.mts +11 -11
  130. package/dist/ui/separator.d.cts +2 -2
  131. package/dist/ui/separator.d.mts +2 -2
  132. package/dist/ui/sheet.d.cts +9 -9
  133. package/dist/ui/sheet.d.mts +9 -9
  134. package/dist/ui/sidebar.cjs +1 -1
  135. package/dist/ui/sidebar.d.cts +29 -29
  136. package/dist/ui/sidebar.d.mts +27 -27
  137. package/dist/ui/sidebar.mjs +1 -1
  138. package/dist/ui/skeleton.d.cts +2 -2
  139. package/dist/ui/skeleton.d.mts +2 -2
  140. package/dist/ui/slider.d.cts +2 -2
  141. package/dist/ui/slider.d.mts +2 -2
  142. package/dist/ui/sonner.d.cts +2 -2
  143. package/dist/ui/sonner.d.mts +2 -2
  144. package/dist/ui/spinner.d.cts +2 -2
  145. package/dist/ui/switch.d.cts +2 -2
  146. package/dist/ui/switch.d.mts +2 -2
  147. package/dist/ui/table.d.cts +18 -18
  148. package/dist/ui/table.d.mts +18 -18
  149. package/dist/ui/tabs.d.cts +5 -5
  150. package/dist/ui/tabs.d.mts +5 -5
  151. package/dist/ui/textarea.d.cts +2 -2
  152. package/dist/ui/textarea.d.mts +2 -2
  153. package/dist/ui/toggle-group.d.cts +3 -3
  154. package/dist/ui/toggle-group.d.mts +3 -3
  155. package/dist/ui/toggle.d.cts +5 -5
  156. package/dist/ui/toggle.d.mts +5 -5
  157. package/dist/ui/tooltip.d.cts +5 -5
  158. package/dist/ui/tooltip.d.mts +5 -5
  159. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import * as react_jsx_runtime56 from "react/jsx-runtime";
2
- import * as class_variance_authority_types12 from "class-variance-authority/types";
1
+ import * as react_jsx_runtime64 from "react/jsx-runtime";
2
+ import * as class_variance_authority_types11 from "class-variance-authority/types";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
 
5
5
  //#region packages/components/ui/button.variants.d.ts
@@ -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" | "warning" | "success" | "info" | "primary" | "secondary" | "important" | "danger" | null | undefined;
13
- size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | null | undefined;
14
- } & class_variance_authority_types12.ClassProp) | undefined) => string;
12
+ color?: "muted" | "primary" | "secondary" | "success" | "important" | "info" | "warning" | "danger" | null | undefined;
13
+ size?: "default" | "sm" | "lg" | "md" | "xl" | "xs" | "icon" | null | undefined;
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): react_jsx_runtime56.JSX.Element;
54
+ }: ButtonProps): react_jsx_runtime64.JSX.Element;
55
55
  //#endregion
56
56
  export { ButtonProps as n, Button as t };
57
- //# sourceMappingURL=button-D2qx5QHI.d.cts.map
57
+ //# sourceMappingURL=button-70p_rB81.d.cts.map
@@ -1,6 +1,6 @@
1
- import * as react_jsx_runtime118 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime48 from "react/jsx-runtime";
2
2
  import { VariantProps } from "class-variance-authority";
3
- import * as class_variance_authority_types12 from "class-variance-authority/types";
3
+ import * as class_variance_authority_types11 from "class-variance-authority/types";
4
4
 
5
5
  //#region packages/components/ui/button.variants.d.ts
6
6
 
@@ -9,9 +9,9 @@ import * as class_variance_authority_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" | "warning" | "success" | "info" | "primary" | "secondary" | "important" | "danger" | null | undefined;
13
- size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | null | undefined;
14
- } & class_variance_authority_types12.ClassProp) | undefined) => string;
12
+ color?: "muted" | "primary" | "secondary" | "success" | "important" | "info" | "warning" | "danger" | null | undefined;
13
+ size?: "default" | "sm" | "lg" | "md" | "xl" | "xs" | "icon" | null | undefined;
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): react_jsx_runtime118.JSX.Element;
54
+ }: ButtonProps): react_jsx_runtime48.JSX.Element;
55
55
  //#endregion
56
56
  export { ButtonProps as n, Button as t };
57
- //# sourceMappingURL=button-eheC-7Id.d.mts.map
57
+ //# sourceMappingURL=button-BMzPKC0-.d.mts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
 
3
3
  //#region packages/components/cards/simple-card.d.ts
4
4
  type Props = {
@@ -13,7 +13,7 @@ declare const SimpleCard: ({
13
13
  action,
14
14
  footer,
15
15
  children
16
- }: React.PropsWithChildren<Props>) => react_jsx_runtime0.JSX.Element;
16
+ }: React.PropsWithChildren<Props>) => react_jsx_runtime1.JSX.Element;
17
17
  //#endregion
18
18
  export { SimpleCard };
19
19
  //# sourceMappingURL=simple-card.d.cts.map
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime198 from "react/jsx-runtime";
2
2
 
3
3
  //#region packages/components/data-display/empty.d.ts
4
- declare const EmptyDisplay: () => react_jsx_runtime0.JSX.Element;
4
+ declare const EmptyDisplay: () => react_jsx_runtime198.JSX.Element;
5
5
  //#endregion
6
6
  export { EmptyDisplay };
7
7
  //# sourceMappingURL=empty.d.mts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
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) => react_jsx_runtime2.JSX.Element>;
26
+ }: Props) => react_jsx_runtime0.JSX.Element>;
27
27
  //#endregion
28
28
  export { Statistic };
29
29
  //# sourceMappingURL=statistic.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime45 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) => react_jsx_runtime1.JSX.Element>;
26
+ }: Props) => react_jsx_runtime45.JSX.Element>;
27
27
  //#endregion
28
28
  export { Statistic };
29
29
  //# sourceMappingURL=statistic.d.mts.map
@@ -1,23 +1,23 @@
1
- import * as react_jsx_runtime111 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime152 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>): react_jsx_runtime111.JSX.Element;
7
+ }: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime152.JSX.Element;
8
8
  declare function DialogTrigger({
9
9
  ...props
10
- }: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime111.JSX.Element;
10
+ }: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime152.JSX.Element;
11
11
  declare function DialogPortal({
12
12
  ...props
13
- }: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime111.JSX.Element;
13
+ }: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime152.JSX.Element;
14
14
  declare function DialogClose({
15
15
  ...props
16
- }: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime111.JSX.Element;
16
+ }: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime152.JSX.Element;
17
17
  declare function DialogOverlay({
18
18
  className,
19
19
  ...props
20
- }: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime111.JSX.Element;
20
+ }: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime152.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
- }): react_jsx_runtime111.JSX.Element;
28
+ }): react_jsx_runtime152.JSX.Element;
29
29
  declare function DialogHeader({
30
30
  className,
31
31
  ...props
32
- }: React.ComponentProps<'div'>): react_jsx_runtime111.JSX.Element;
32
+ }: React.ComponentProps<'div'>): react_jsx_runtime152.JSX.Element;
33
33
  declare function DialogFooter({
34
34
  className,
35
35
  ...props
36
- }: React.ComponentProps<'div'>): react_jsx_runtime111.JSX.Element;
36
+ }: React.ComponentProps<'div'>): react_jsx_runtime152.JSX.Element;
37
37
  declare function DialogTitle({
38
38
  className,
39
39
  ...props
40
- }: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime111.JSX.Element;
40
+ }: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime152.JSX.Element;
41
41
  declare function DialogDescription({
42
42
  className,
43
43
  ...props
44
- }: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime111.JSX.Element;
44
+ }: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime152.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-5imw84-8.d.cts.map
47
+ //# sourceMappingURL=dialog-B5NbVD73.d.cts.map
@@ -1,23 +1,23 @@
1
- import * as react_jsx_runtime54 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime74 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>): react_jsx_runtime54.JSX.Element;
7
+ }: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime74.JSX.Element;
8
8
  declare function DialogTrigger({
9
9
  ...props
10
- }: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime54.JSX.Element;
10
+ }: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime74.JSX.Element;
11
11
  declare function DialogPortal({
12
12
  ...props
13
- }: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime54.JSX.Element;
13
+ }: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime74.JSX.Element;
14
14
  declare function DialogClose({
15
15
  ...props
16
- }: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime54.JSX.Element;
16
+ }: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime74.JSX.Element;
17
17
  declare function DialogOverlay({
18
18
  className,
19
19
  ...props
20
- }: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime54.JSX.Element;
20
+ }: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime74.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
- }): react_jsx_runtime54.JSX.Element;
28
+ }): react_jsx_runtime74.JSX.Element;
29
29
  declare function DialogHeader({
30
30
  className,
31
31
  ...props
32
- }: React.ComponentProps<'div'>): react_jsx_runtime54.JSX.Element;
32
+ }: React.ComponentProps<'div'>): react_jsx_runtime74.JSX.Element;
33
33
  declare function DialogFooter({
34
34
  className,
35
35
  ...props
36
- }: React.ComponentProps<'div'>): react_jsx_runtime54.JSX.Element;
36
+ }: React.ComponentProps<'div'>): react_jsx_runtime74.JSX.Element;
37
37
  declare function DialogTitle({
38
38
  className,
39
39
  ...props
40
- }: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime54.JSX.Element;
40
+ }: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime74.JSX.Element;
41
41
  declare function DialogDescription({
42
42
  className,
43
43
  ...props
44
- }: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime54.JSX.Element;
44
+ }: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime74.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-T7CVHrm2.d.mts.map
47
+ //# sourceMappingURL=dialog-IGmKIrTb.d.mts.map
@@ -1,4 +1,4 @@
1
- import { t as Button } from "../../../button-D2qx5QHI.cjs";
1
+ import { t as Button } from "../../../button-70p_rB81.cjs";
2
2
  import { Separator } from "../../../ui/separator.cjs";
3
3
  import { TooltipContent } from "../../../ui/tooltip.cjs";
4
4
  import * as react_jsx_runtime3 from "react/jsx-runtime";
@@ -103,7 +103,7 @@ declare function DetailDialogSidebarMenuItem({
103
103
  }: React.ComponentProps<'li'>): react_jsx_runtime3.JSX.Element;
104
104
  declare const sidebarMenuButtonVariants: (props?: ({
105
105
  variant?: "default" | "outline" | null | undefined;
106
- size?: "sm" | "lg" | "default" | null | undefined;
106
+ size?: "default" | "sm" | "lg" | null | undefined;
107
107
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
108
108
  declare function DetailDialogSidebarMenuButton({
109
109
  asChild,
@@ -1,7 +1,7 @@
1
- import { t as Button } from "../../../button-eheC-7Id.mjs";
1
+ import { t as Button } from "../../../button-BMzPKC0-.mjs";
2
2
  import { Separator } from "../../../ui/separator.mjs";
3
3
  import { TooltipContent } from "../../../ui/tooltip.mjs";
4
- import * as react_jsx_runtime2 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime0 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";
7
7
 
@@ -28,7 +28,7 @@ declare function SidebarProvider({
28
28
  defaultOpen?: boolean;
29
29
  open?: boolean;
30
30
  onOpenChange?: (open: boolean) => void;
31
- }): react_jsx_runtime2.JSX.Element;
31
+ }): react_jsx_runtime0.JSX.Element;
32
32
  declare function Sidebar({
33
33
  side,
34
34
  variant,
@@ -40,70 +40,70 @@ declare function Sidebar({
40
40
  side?: 'left' | 'right';
41
41
  variant?: 'sidebar' | 'floating' | 'inset';
42
42
  collapsible?: 'offcanvas' | 'icon' | 'none';
43
- }): react_jsx_runtime2.JSX.Element;
43
+ }): react_jsx_runtime0.JSX.Element;
44
44
  declare function DetailDialogSidebarTrigger({
45
45
  className,
46
46
  onClick,
47
47
  ...props
48
- }: React.ComponentProps<typeof Button>): react_jsx_runtime2.JSX.Element;
48
+ }: React.ComponentProps<typeof Button>): react_jsx_runtime0.JSX.Element;
49
49
  declare function DetailDialogSidebarRail({
50
50
  className,
51
51
  ...props
52
- }: React.ComponentProps<'button'>): react_jsx_runtime2.JSX.Element;
52
+ }: React.ComponentProps<'button'>): react_jsx_runtime0.JSX.Element;
53
53
  declare function SidebarInset({
54
54
  className,
55
55
  ...props
56
- }: React.ComponentProps<'main'>): react_jsx_runtime2.JSX.Element;
56
+ }: React.ComponentProps<'main'>): react_jsx_runtime0.JSX.Element;
57
57
  declare function DetailDialogSidebarHeader({
58
58
  className,
59
59
  ...props
60
- }: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
60
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
61
61
  declare function DetailDialogSidebarFooter({
62
62
  className,
63
63
  children,
64
64
  ...props
65
- }: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
65
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
66
66
  declare function DetailDialogSidebarSeparator({
67
67
  className,
68
68
  ...props
69
- }: React.ComponentProps<typeof Separator>): react_jsx_runtime2.JSX.Element;
69
+ }: React.ComponentProps<typeof Separator>): react_jsx_runtime0.JSX.Element;
70
70
  declare function DetailDialogSidebarContent({
71
71
  className,
72
72
  ...props
73
- }: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
73
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
74
74
  declare function DetailDialogSidebarGroup({
75
75
  className,
76
76
  ...props
77
- }: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
77
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
78
78
  declare function DetailDialogSidebarGroupLabel({
79
79
  className,
80
80
  asChild,
81
81
  ...props
82
82
  }: React.ComponentProps<'div'> & {
83
83
  asChild?: boolean;
84
- }): react_jsx_runtime2.JSX.Element;
84
+ }): react_jsx_runtime0.JSX.Element;
85
85
  declare function DetailDialogSidebarGroupAction({
86
86
  className,
87
87
  asChild,
88
88
  ...props
89
89
  }: React.ComponentProps<'button'> & {
90
90
  asChild?: boolean;
91
- }): react_jsx_runtime2.JSX.Element;
91
+ }): react_jsx_runtime0.JSX.Element;
92
92
  declare function DetailDialogSidebarGroupContent({
93
93
  className,
94
94
  ...props
95
- }: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
95
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
96
96
  declare function DetailDialogSidebarMenu({
97
97
  className,
98
98
  ...props
99
- }: React.ComponentProps<'ul'>): react_jsx_runtime2.JSX.Element;
99
+ }: React.ComponentProps<'ul'>): react_jsx_runtime0.JSX.Element;
100
100
  declare function DetailDialogSidebarMenuItem({
101
101
  className,
102
102
  ...props
103
- }: React.ComponentProps<'li'>): react_jsx_runtime2.JSX.Element;
103
+ }: React.ComponentProps<'li'>): react_jsx_runtime0.JSX.Element;
104
104
  declare const sidebarMenuButtonVariants: (props?: ({
105
105
  variant?: "default" | "outline" | null | undefined;
106
- size?: "sm" | "lg" | "default" | null | undefined;
106
+ size?: "default" | "sm" | "lg" | null | undefined;
107
107
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
108
108
  declare function DetailDialogSidebarMenuButton({
109
109
  asChild,
@@ -117,7 +117,7 @@ declare function DetailDialogSidebarMenuButton({
117
117
  asChild?: boolean;
118
118
  isActive?: boolean;
119
119
  tooltip?: string | React.ComponentProps<typeof TooltipContent>;
120
- } & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime2.JSX.Element;
120
+ } & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime0.JSX.Element;
121
121
  declare function DetailDialogSidebarMenuAction({
122
122
  className,
123
123
  asChild,
@@ -126,26 +126,26 @@ declare function DetailDialogSidebarMenuAction({
126
126
  }: React.ComponentProps<'button'> & {
127
127
  asChild?: boolean;
128
128
  showOnHover?: boolean;
129
- }): react_jsx_runtime2.JSX.Element;
129
+ }): react_jsx_runtime0.JSX.Element;
130
130
  declare function DetailDialogSidebarMenuBadge({
131
131
  className,
132
132
  ...props
133
- }: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
133
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
134
134
  declare function DetailDialogSidebarMenuSkeleton({
135
135
  className,
136
136
  showIcon,
137
137
  ...props
138
138
  }: React.ComponentProps<'div'> & {
139
139
  showIcon?: boolean;
140
- }): react_jsx_runtime2.JSX.Element;
140
+ }): react_jsx_runtime0.JSX.Element;
141
141
  declare function DetailDialogSidebarMenuSub({
142
142
  className,
143
143
  ...props
144
- }: React.ComponentProps<'ul'>): react_jsx_runtime2.JSX.Element;
144
+ }: React.ComponentProps<'ul'>): react_jsx_runtime0.JSX.Element;
145
145
  declare function DetailDialogSidebarMenuSubItem({
146
146
  className,
147
147
  ...props
148
- }: React.ComponentProps<'li'>): react_jsx_runtime2.JSX.Element;
148
+ }: React.ComponentProps<'li'>): react_jsx_runtime0.JSX.Element;
149
149
  declare function DetailDialogSidebarMenuSubButton({
150
150
  asChild,
151
151
  size,
@@ -156,7 +156,7 @@ declare function DetailDialogSidebarMenuSubButton({
156
156
  asChild?: boolean;
157
157
  size?: 'sm' | 'md';
158
158
  isActive?: boolean;
159
- }): react_jsx_runtime2.JSX.Element;
159
+ }): react_jsx_runtime0.JSX.Element;
160
160
  //#endregion
161
161
  export { DetailDialogSidebarContent, DetailDialogSidebarFooter, DetailDialogSidebarGroup, DetailDialogSidebarGroupAction, DetailDialogSidebarGroupContent, DetailDialogSidebarGroupLabel, DetailDialogSidebarHeader, DetailDialogSidebarMenu, DetailDialogSidebarMenuAction, DetailDialogSidebarMenuBadge, DetailDialogSidebarMenuButton, DetailDialogSidebarMenuItem, DetailDialogSidebarMenuSkeleton, DetailDialogSidebarMenuSub, DetailDialogSidebarMenuSubButton, DetailDialogSidebarMenuSubItem, DetailDialogSidebarRail, DetailDialogSidebarSeparator, DetailDialogSidebarTrigger, Sidebar, SidebarInset, SidebarProvider, useSidebar };
162
162
  //# sourceMappingURL=sidebar.d.mts.map
@@ -1 +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<\n React.PropsWithChildren<{\n className?: string;\n }>\n>"],"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 border border-border 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-lg border border-border 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","import { cn } from '@customafk/react-toolkit/utils';\n\nexport * 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<\n React.PropsWithChildren<{\n className?: string;\n }>\n> = ({ children, className }) => {\n return (\n <div\n data-slot=\"description-wrapper\"\n className={cn('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', className)}\n >\n {children}\n </div>\n );\n};\n"],"mappings":"6XAAA,MAAaA,OAET,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,wFACb,EAAA,EAAA,KAAC,IAAA,CAAA,SAAE,cAAA,CAAe,EACd,CCFGC,GAEP,CAAE,WACD,GAEH,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,qIAA6H,GAAY,EAFvI,EAAA,EAAA,KAAC,EAAA,EAAA,CAAmB,CCG5BC,GAAoC,CAAE,UACtC,GAAiC,MAAa,EAAA,EAAA,KAAC,EAAA,EAAA,CAAmB,EAE3E,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,MAACC,EAAAA,EAAAA,CAAAA,SAAAA,EACC,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAkB,OAAM,OAAO,UAAW,CAAA,CAC5B,EACjB,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,KAACD,EAAAA,EAAAA,CAAkB,OAAM,OAAO,OAAO,SAAA,GAAS,UAAU,uBAAwB,CAAA,CACnE,CAAA,CAAA,CACT,CAAA,CACM,CChBTE,GASP,CAAE,YACF,CAAC,GAAU,CAAC,EAAO,QAAe,EAAA,EAAA,KAAC,EAAA,EAAA,CAAmB,CACtD,EAAO,SAAW,GAElB,EAAA,EA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AO,CACL,QAAS,OACT,oBAAqB,6BACtB,CACD,UAAU,2CAEV,EAAA,EAAA,KAAC,MAAA,CACC,MAAO,CACL,WAAY,QAAQ,EAAa,UAAU,IAC5C,CACD,UAAU,oMAET,GACG,EACN,EAAA,EAAA,KAAC,MAAA,CACC,MAAO,CACL,WAAY,QAAQ,GAAK,EAAa,UAAU,GAAK,IACtD,CACD,UAAU,iEAET,YACG,CAAA,EACF,CAIGC,GAIR,CAAE,WAAU,gBAEb,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,sBACV,WAAA,EAAA,EAAA,IAAc,gJAAiJ,EAAU,CAExK,YACG"}
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<\n React.PropsWithChildren<{\n className?: string;\n }>\n>"],"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 border border-border 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-lg border border-border 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","import { cn } from '@customafk/react-toolkit/utils';\n\nexport * 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<\n React.PropsWithChildren<{\n className?: string;\n }>\n> = ({ children, className }) => {\n return (\n <div\n data-slot=\"description-wrapper\"\n className={cn(\n '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 className\n )}\n >\n {children}\n </div>\n );\n};\n"],"mappings":"6XAAA,MAAaA,OAET,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,wFACb,EAAA,EAAA,KAAC,IAAA,CAAA,SAAE,cAAA,CAAe,EACd,CCFGC,GAEP,CAAE,WACD,GAEH,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,qIAA6H,GAAY,EAFvI,EAAA,EAAA,KAAC,EAAA,EAAA,CAAmB,CCG5BC,GAAoC,CAAE,UACtC,GAAiC,MAAa,EAAA,EAAA,KAAC,EAAA,EAAA,CAAmB,EAE3E,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,MAACC,EAAAA,EAAAA,CAAAA,SAAAA,EACC,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAkB,OAAM,OAAO,UAAW,CAAA,CAC5B,EACjB,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAAA,UACC,EAAA,EAAA,KAACD,EAAAA,EAAAA,CAAkB,OAAM,OAAO,OAAO,SAAA,GAAS,UAAU,uBAAwB,CAAA,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AC,IAAA,CAAA,SAAG,EAAA,CAAwB,CAC3B,IACI,EAGZ,CACD,EAAqB,YAAc,uBCrInC,MAAaC,GAKR,CAAE,QAAO,eAAe,EAAG,eAE5B,EAAA,EAAA,MAAC,MAAA,CACC,MAAO,CACL,QAAS,OACT,oBAAqB,6BACtB,CACD,UAAU,2CAEV,EAAA,EAAA,KAAC,MAAA,CACC,MAAO,CACL,WAAY,QAAQ,EAAa,UAAU,IAC5C,CACD,UAAU,oMAET,GACG,EACN,EAAA,EAAA,KAAC,MAAA,CACC,MAAO,CACL,WAAY,QAAQ,GAAK,EAAa,UAAU,GAAK,IACtD,CACD,UAAU,iEAET,YACG,CAAA,EACF,CAIGC,GAIR,CAAE,WAAU,gBAEb,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,sBACV,WAAA,EAAA,EAAA,IACE,gJACA,EACD,CAEA,YACG"}
@@ -1,5 +1,5 @@
1
- import * as react_jsx_runtime295 from "react/jsx-runtime";
2
- import * as react187 from "react";
1
+ import * as react_jsx_runtime294 from "react/jsx-runtime";
2
+ import * as react186 from "react";
3
3
 
4
4
  //#region packages/components/features/descriptions/components/badge.d.ts
5
5
  declare const DescriptionBadge: React.FC<{
@@ -51,7 +51,7 @@ type Props = {
51
51
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
52
52
  value: number | string | null | undefined;
53
53
  };
54
- declare const DescriptionStatistic: react187.MemoExoticComponent<({
54
+ declare const DescriptionStatistic: react186.MemoExoticComponent<({
55
55
  decimalSeparator,
56
56
  groupSeparator,
57
57
  prefix: Prefix,
@@ -61,7 +61,7 @@ declare const DescriptionStatistic: react187.MemoExoticComponent<({
61
61
  showTrailingZeros,
62
62
  size,
63
63
  value
64
- }: Props) => react_jsx_runtime295.JSX.Element>;
64
+ }: Props) => react_jsx_runtime294.JSX.Element>;
65
65
  //#endregion
66
66
  //#region packages/components/features/descriptions/index.d.ts
67
67
  declare const DescriptionItem: React.FC<React.PropsWithChildren<{
@@ -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<\n React.PropsWithChildren<{\n className?: string;\n }>\n>"],"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 border border-border 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-lg border border-border 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","import { cn } from '@customafk/react-toolkit/utils';\n\nexport * 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<\n React.PropsWithChildren<{\n className?: string;\n }>\n> = ({ children, className }) => {\n return (\n <div\n data-slot=\"description-wrapper\"\n className={cn('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', className)}\n >\n {children}\n </div>\n );\n};\n"],"mappings":"qbA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AKR,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,GAIR,CAAE,WAAU,eAEb,EAAC,MAAA,CACC,YAAU,sBACV,UAAW,EAAG,gJAAiJ,EAAU,CAExK,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<\n React.PropsWithChildren<{\n className?: string;\n }>\n>"],"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 border border-border 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-lg border border-border 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","import { cn } from '@customafk/react-toolkit/utils';\n\nexport * 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<\n React.PropsWithChildren<{\n className?: string;\n }>\n> = ({ children, className }) => {\n return (\n <div\n data-slot=\"description-wrapper\"\n className={cn(\n '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 className\n )}\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,CAAA,SACC,EAAC,EAAA,CAAA,SAAA,CACC,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAAkB,OAAM,OAAO,UAAW,CAAA,CAC5B,CACjB,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAAkB,OAAM,OAAO,OAAO,SAAA,GAAS,UAAU,uBAAwB,CAAA,CACnE,CAAA,CAAA,CACT,CAAA,CACM,CChBTC,GASP,CAAE,YACF,CAAC,GAAU,CAAC,EAAO,OAAe,EAAC,EAAA,EAAA,CAAmB,CACtD,EAAO,SAAW,EAElB,EAAC,MAAA,CAAI,UAAU,gCACb,EAAC,MAAA,CAAuB,UAAU,4EAChC,EAAC,EAAA,CAAM,IAAK,EAAO,GAAG,IAAK,IAAK,EAAO,GAAG,IAAK,MAAM,OAAO,OAAO,QAAS,EADpE,EAAO,GAAG,GAEd,EACF,CAGR,EAAC,MAAA,C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