@customafk/lunas-ui 0.2.77 → 0.2.79

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 (157) hide show
  1. package/dist/{analysis-panel-CQZ0hmfN.cjs → analysis-panel-Bg0lCfWv.cjs} +2 -2
  2. package/dist/{analysis-panel-CQZ0hmfN.cjs.map → analysis-panel-Bg0lCfWv.cjs.map} +1 -1
  3. package/dist/{analysis-panel-BqZmOU58.mjs → analysis-panel-Cop-l4lx.mjs} +2 -2
  4. package/dist/{analysis-panel-BqZmOU58.mjs.map → analysis-panel-Cop-l4lx.mjs.map} +1 -1
  5. package/dist/{badge-display-RP5VTE10.mjs → badge-display-B0BKsU9T.mjs} +2 -2
  6. package/dist/{badge-display-RP5VTE10.mjs.map → badge-display-B0BKsU9T.mjs.map} +1 -1
  7. package/dist/{badge-display-DmCKpGk9.cjs → badge-display-Dv2UTvzp.cjs} +2 -2
  8. package/dist/{badge-display-DmCKpGk9.cjs.map → badge-display-Dv2UTvzp.cjs.map} +1 -1
  9. package/dist/{boolean-display-B9qxrF5f.mjs → boolean-display-CMX5AupA.mjs} +2 -2
  10. package/dist/{boolean-display-B9qxrF5f.mjs.map → boolean-display-CMX5AupA.mjs.map} +1 -1
  11. package/dist/{boolean-display-BwB-l9k0.cjs → boolean-display-CPX7H39m.cjs} +2 -2
  12. package/dist/{boolean-display-BwB-l9k0.cjs.map → boolean-display-CPX7H39m.cjs.map} +1 -1
  13. package/dist/{button-BnoPktln.d.cts → button-DQLIL8K2.d.cts} +2 -2
  14. package/dist/{button-BnoPktln.d.mts → button-DQLIL8K2.d.mts} +2 -2
  15. package/dist/{calendar-BkV5hTX2.d.mts → calendar-5VVBPn4F.d.mts} +2 -2
  16. package/dist/{calendar-iDMPT1kI.d.cts → calendar-DHcoDDIc.d.cts} +2 -2
  17. package/dist/{carousel-D7VXWJ3S.d.mts → carousel-D0jTbSoW.d.cts} +2 -2
  18. package/dist/{carousel-bBvM31sh.d.cts → carousel-qH6YsFKK.d.mts} +2 -2
  19. package/dist/cms-layout-Ba_5wSnr.mjs +2 -0
  20. package/dist/cms-layout-Ba_5wSnr.mjs.map +1 -0
  21. package/dist/cms-layout-DCJhB-GY.cjs +2 -0
  22. package/dist/cms-layout-DCJhB-GY.cjs.map +1 -0
  23. package/dist/{currency-display-CEg_HRYv.mjs → currency-display-CanjOswc.mjs} +2 -2
  24. package/dist/{currency-display-CEg_HRYv.mjs.map → currency-display-CanjOswc.mjs.map} +1 -1
  25. package/dist/{currency-display-Buxc6Ph5.cjs → currency-display-xxK62yo4.cjs} +2 -2
  26. package/dist/{currency-display-Buxc6Ph5.cjs.map → currency-display-xxK62yo4.cjs.map} +1 -1
  27. package/dist/data-display/statistic.cjs +1 -1
  28. package/dist/data-display/statistic.cjs.map +1 -1
  29. package/dist/data-display/statistic.mjs +1 -1
  30. package/dist/data-display/statistic.mjs.map +1 -1
  31. package/dist/date-display-DMPhFq8v.cjs +2 -0
  32. package/dist/date-display-DMPhFq8v.cjs.map +1 -0
  33. package/dist/date-display-YE8NIIrl.mjs +2 -0
  34. package/dist/date-display-YE8NIIrl.mjs.map +1 -0
  35. package/dist/{description-display-CW0g3aJa.mjs → description-display-B4KoH6ql.mjs} +2 -2
  36. package/dist/{description-display-CW0g3aJa.mjs.map → description-display-B4KoH6ql.mjs.map} +1 -1
  37. package/dist/{description-display-BR8nXqc_.cjs → description-display-jmAaeMBD.cjs} +2 -2
  38. package/dist/{description-display-BR8nXqc_.cjs.map → description-display-jmAaeMBD.cjs.map} +1 -1
  39. package/dist/dialogs/detail-dialog/components/sidebar.d.cts +2 -2
  40. package/dist/dialogs/detail-dialog/components/sidebar.d.mts +2 -2
  41. package/dist/{email-display-DqKYq0iM.cjs → email-display-CzvqQMhG.cjs} +2 -2
  42. package/dist/{email-display-DqKYq0iM.cjs.map → email-display-CzvqQMhG.cjs.map} +1 -1
  43. package/dist/{email-display-BKcoWmPK.mjs → email-display-D_k7AUmp.mjs} +2 -2
  44. package/dist/{email-display-BKcoWmPK.mjs.map → email-display-D_k7AUmp.mjs.map} +1 -1
  45. package/dist/features/descriptions/index.cjs +1 -1
  46. package/dist/features/descriptions/index.cjs.map +1 -1
  47. package/dist/features/descriptions/index.mjs +1 -1
  48. package/dist/features/descriptions/index.mjs.map +1 -1
  49. package/dist/features/tables/index.cjs +1 -1
  50. package/dist/features/tables/index.d.cts +1 -1
  51. package/dist/features/tables/index.d.mts +1 -1
  52. package/dist/features/tables/index.mjs +1 -1
  53. package/dist/{filter-DqedvThM.cjs → filter-B5EnnL9I.cjs} +2 -2
  54. package/dist/{filter-DqedvThM.cjs.map → filter-B5EnnL9I.cjs.map} +1 -1
  55. package/dist/{filter-CWuRGTl4.mjs → filter-BCNjqiBx.mjs} +2 -2
  56. package/dist/{filter-CWuRGTl4.mjs.map → filter-BCNjqiBx.mjs.map} +1 -1
  57. package/dist/{flex-BTPF2-F6.d.cts → flex-CWo0w9K1.d.cts} +4 -4
  58. package/dist/{flex-BTPF2-F6.d.mts → flex-CWo0w9K1.d.mts} +4 -4
  59. package/dist/{index-C9JAujMq.d.cts → index-BapooVnN.d.cts} +12 -12
  60. package/dist/{index-DnHoBjv7.d.mts → index-CFgFCg9H.d.mts} +12 -12
  61. package/dist/index.cjs +1 -1
  62. package/dist/index.d.cts +12 -12
  63. package/dist/index.d.mts +12 -12
  64. package/dist/index.mjs +1 -1
  65. package/dist/{input-D73TrUof.d.cts → input-DxNK7Wo6.d.cts} +2 -2
  66. package/dist/{input-D73TrUof.d.mts → input-DxNK7Wo6.d.mts} +2 -2
  67. package/dist/{item-ChW41yKF.d.mts → item-Brbp9t6f.d.mts} +2 -2
  68. package/dist/{item-BxUBO7Hd.d.cts → item-CtLZgUB6.d.cts} +2 -2
  69. package/dist/layouts/cms-layout/index.cjs +1 -1
  70. package/dist/layouts/cms-layout/index.mjs +1 -1
  71. package/dist/layouts/flex.d.cts +1 -1
  72. package/dist/layouts/flex.d.mts +1 -1
  73. package/dist/list-display-DPxZ_Jbf.cjs +2 -0
  74. package/dist/list-display-DPxZ_Jbf.cjs.map +1 -0
  75. package/dist/list-display-M43N3kle.mjs +2 -0
  76. package/dist/list-display-M43N3kle.mjs.map +1 -0
  77. package/dist/{name-display-B-FtblLL.cjs → name-display-BJ1wPUnS.cjs} +2 -2
  78. package/dist/{name-display-B-FtblLL.cjs.map → name-display-BJ1wPUnS.cjs.map} +1 -1
  79. package/dist/{name-display-CB9XAhXP.mjs → name-display-pWhLLS05.mjs} +2 -2
  80. package/dist/{name-display-CB9XAhXP.mjs.map → name-display-pWhLLS05.mjs.map} +1 -1
  81. package/dist/{pagination-BRw-yZBY.d.cts → pagination-BVA_yrBO.d.mts} +2 -2
  82. package/dist/{pagination-BlLiOvY9.d.mts → pagination-DqJlXNY0.d.cts} +2 -2
  83. package/dist/{permalink-I-INEarM.mjs → permalink-BaMvnKIz.mjs} +2 -2
  84. package/dist/{permalink-I-INEarM.mjs.map → permalink-BaMvnKIz.mjs.map} +1 -1
  85. package/dist/{permalink-CUIKG9VA.cjs → permalink-CMcI__V4.cjs} +2 -2
  86. package/dist/{permalink-CUIKG9VA.cjs.map → permalink-CMcI__V4.cjs.map} +1 -1
  87. package/dist/{phone-number-DJvfJg1b.cjs → phone-number-F9I9sNLK.cjs} +2 -2
  88. package/dist/{phone-number-DJvfJg1b.cjs.map → phone-number-F9I9sNLK.cjs.map} +1 -1
  89. package/dist/{phone-number-Cu7Mnl6J.mjs → phone-number-ao2oCmrO.mjs} +2 -2
  90. package/dist/{phone-number-Cu7Mnl6J.mjs.map → phone-number-ao2oCmrO.mjs.map} +1 -1
  91. package/dist/{progress-display-DbfN7U8m.cjs → progress-display-F8xXJ3T1.cjs} +2 -2
  92. package/dist/{progress-display-DbfN7U8m.cjs.map → progress-display-F8xXJ3T1.cjs.map} +1 -1
  93. package/dist/{progress-display-qgvclwy9.mjs → progress-display-atwRFD6e.mjs} +2 -2
  94. package/dist/{progress-display-qgvclwy9.mjs.map → progress-display-atwRFD6e.mjs.map} +1 -1
  95. package/dist/{resizable-CWmitx5U.d.cts → resizable-B61Fbl57.d.cts} +2 -2
  96. package/dist/{resizable-CWmitx5U.d.mts → resizable-B61Fbl57.d.mts} +2 -2
  97. package/dist/{search-input-DEvYI6Rm.d.mts → search-input-C8feOKe2.d.cts} +2 -2
  98. package/dist/{search-input-h_3MoMqK.d.cts → search-input-CoqwakbI.d.mts} +2 -2
  99. package/dist/{statistic-LL4uHlRb.cjs → statistic-B9OqfhOl.cjs} +2 -2
  100. package/dist/{statistic-LL4uHlRb.cjs.map → statistic-B9OqfhOl.cjs.map} +1 -1
  101. package/dist/{statistic-ClkqqDfk.mjs → statistic-CJVc9sNs.mjs} +2 -2
  102. package/dist/{statistic-ClkqqDfk.mjs.map → statistic-CJVc9sNs.mjs.map} +1 -1
  103. package/dist/{status-display-BUphOF18.mjs → status-display-DInGGgiP.mjs} +2 -2
  104. package/dist/{status-display-BUphOF18.mjs.map → status-display-DInGGgiP.mjs.map} +1 -1
  105. package/dist/{status-display-o9inMVvb.cjs → status-display-DpKsYvZJ.cjs} +2 -2
  106. package/dist/{status-display-o9inMVvb.cjs.map → status-display-DpKsYvZJ.cjs.map} +1 -1
  107. package/dist/{summary-bar-Mb1B9Dnf.cjs → summary-bar-DKZh-VSB.cjs} +2 -2
  108. package/dist/{summary-bar-Mb1B9Dnf.cjs.map → summary-bar-DKZh-VSB.cjs.map} +1 -1
  109. package/dist/{summary-bar-CYfgdxrQ.mjs → summary-bar-DX_sOiuL.mjs} +2 -2
  110. package/dist/{summary-bar-CYfgdxrQ.mjs.map → summary-bar-DX_sOiuL.mjs.map} +1 -1
  111. package/dist/{tables-BGzwkdFO.mjs → tables-7_KgoyS-.mjs} +2 -2
  112. package/dist/{tables-BGzwkdFO.mjs.map → tables-7_KgoyS-.mjs.map} +1 -1
  113. package/dist/{tables-078i-X0d.cjs → tables-CS3NhgTc.cjs} +2 -2
  114. package/dist/{tables-078i-X0d.cjs.map → tables-CS3NhgTc.cjs.map} +1 -1
  115. package/dist/{toggle-group--bJylFDV.d.cts → toggle-group-DM5tS0Kt.d.cts} +2 -2
  116. package/dist/{toggle-group-l_Mi7NRg.d.mts → toggle-group-_PBz44Im.d.mts} +2 -2
  117. package/dist/{toggle-CqTmiPDi.d.cts → toggle-v1PgAvdG.d.cts} +2 -2
  118. package/dist/{toggle-CqTmiPDi.d.mts → toggle-v1PgAvdG.d.mts} +2 -2
  119. package/dist/{tooltip-BcfELg8e.cjs → tooltip-BcQG6Zw9.cjs} +2 -2
  120. package/dist/{tooltip-BcfELg8e.cjs.map → tooltip-BcQG6Zw9.cjs.map} +1 -1
  121. package/dist/{tooltip-TGmzPdoR.mjs → tooltip-C6flMQgc.mjs} +2 -2
  122. package/dist/{tooltip-TGmzPdoR.mjs.map → tooltip-C6flMQgc.mjs.map} +1 -1
  123. package/dist/ui/button.d.cts +1 -1
  124. package/dist/ui/button.d.mts +1 -1
  125. package/dist/ui/calendar.d.cts +1 -1
  126. package/dist/ui/calendar.d.mts +1 -1
  127. package/dist/ui/carousel.d.cts +1 -1
  128. package/dist/ui/carousel.d.mts +1 -1
  129. package/dist/ui/input.d.cts +1 -1
  130. package/dist/ui/input.d.mts +1 -1
  131. package/dist/ui/inputs/search-input.d.cts +1 -1
  132. package/dist/ui/inputs/search-input.d.mts +1 -1
  133. package/dist/ui/item.d.cts +1 -1
  134. package/dist/ui/item.d.mts +1 -1
  135. package/dist/ui/pagination.d.cts +1 -1
  136. package/dist/ui/pagination.d.mts +1 -1
  137. package/dist/ui/resizable.d.cts +1 -1
  138. package/dist/ui/resizable.d.mts +1 -1
  139. package/dist/ui/status.d.cts +1 -1
  140. package/dist/ui/status.d.mts +1 -1
  141. package/dist/ui/toggle-group.d.cts +1 -1
  142. package/dist/ui/toggle-group.d.mts +1 -1
  143. package/dist/ui/toggle.d.cts +1 -1
  144. package/dist/ui/toggle.d.mts +1 -1
  145. package/package.json +1 -1
  146. package/dist/cms-layout-BXd2ncAV.cjs +0 -2
  147. package/dist/cms-layout-BXd2ncAV.cjs.map +0 -1
  148. package/dist/cms-layout-COIo9HiP.mjs +0 -2
  149. package/dist/cms-layout-COIo9HiP.mjs.map +0 -1
  150. package/dist/date-display-BgI7Wjqf.cjs +0 -2
  151. package/dist/date-display-BgI7Wjqf.cjs.map +0 -1
  152. package/dist/date-display-DGfHQhpu.mjs +0 -2
  153. package/dist/date-display-DGfHQhpu.mjs.map +0 -1
  154. package/dist/list-display-BRJVmji0.cjs +0 -2
  155. package/dist/list-display-BRJVmji0.cjs.map +0 -1
  156. package/dist/list-display-Co94sV4H.mjs +0 -2
  157. package/dist/list-display-Co94sV4H.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { t as Button } from "./button-BnoPktln.cjs";
1
+ import { t as Button } from "./button-DQLIL8K2.mjs";
2
2
  //#region packages/components/ui/pagination.d.ts
3
3
  /**
4
4
  * Root `<nav>` wrapper for a Pagination control with accessible ARIA attributes.
@@ -39,4 +39,4 @@ declare function PaginationNext({ className, ...props }: React.ComponentProps<ty
39
39
  declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>): import("react").JSX.Element;
40
40
  //#endregion
41
41
  export { PaginationLink as a, PaginationItem as i, PaginationContent as n, PaginationNext as o, PaginationEllipsis as r, PaginationPrevious as s, Pagination as t };
42
- //# sourceMappingURL=pagination-BRw-yZBY.d.cts.map
42
+ //# sourceMappingURL=pagination-BVA_yrBO.d.mts.map
@@ -1,4 +1,4 @@
1
- import { t as Button } from "./button-BnoPktln.mjs";
1
+ import { t as Button } from "./button-DQLIL8K2.cjs";
2
2
  //#region packages/components/ui/pagination.d.ts
3
3
  /**
4
4
  * Root `<nav>` wrapper for a Pagination control with accessible ARIA attributes.
@@ -39,4 +39,4 @@ declare function PaginationNext({ className, ...props }: React.ComponentProps<ty
39
39
  declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>): import("react").JSX.Element;
40
40
  //#endregion
41
41
  export { PaginationLink as a, PaginationItem as i, PaginationContent as n, PaginationNext as o, PaginationEllipsis as r, PaginationPrevious as s, Pagination as t };
42
- //# sourceMappingURL=pagination-BlLiOvY9.d.mts.map
42
+ //# sourceMappingURL=pagination-DqJlXNY0.d.cts.map
@@ -1,2 +1,2 @@
1
- import{Q as e}from"./tables-BGzwkdFO.mjs";import{ExternalLinkIcon as t}from"lucide-react";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({href:i,label:a})=>i?r(`a`,{href:i,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[n(`span`,{children:a||i}),n(t,{size:14})]}):n(e,{});export{i as UITablePermalink};
2
- //# sourceMappingURL=permalink-I-INEarM.mjs.map
1
+ import{Q as e}from"./tables-7_KgoyS-.mjs";import{ExternalLinkIcon as t}from"lucide-react";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({href:i,label:a})=>i?r(`a`,{href:i,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[n(`span`,{children:a||i}),n(t,{size:14})]}):n(e,{});export{i as UITablePermalink};
2
+ //# sourceMappingURL=permalink-BaMvnKIz.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"permalink-I-INEarM.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/permalink.tsx"],"sourcesContent":["import { ExternalLinkIcon } from 'lucide-react';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Renders an external-link anchor with an icon for use in table cells, opening\n * the target URL in a new tab with safe `rel` attributes. Renders\n * {@link UITableEmpty} when `href` is absent.\n *\n * @example\n * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePermalink href=\"https://example.com/records/42\" label=\"View record\" />\n */\nexport const UITablePermalink: React.FC<{\n /** The destination URL the anchor navigates to; `null`/`undefined`/empty renders an empty state. */\n href: string | null | undefined;\n /** Optional display text; falls back to the raw `href` when omitted. */\n label?: string;\n}> = ({ href, label }) => {\n if (!href) return <UITableEmpty />;\n\n return (\n <a href={href} target=\"_blank\" className=\"inline-flex items-center gap-1 truncate text-primary text-sm underline\" rel=\"noopener noreferrer\">\n <span>{label || href}</span>\n <ExternalLinkIcon size={14} />\n </a>\n );\n};\n"],"mappings":"4IAcA,MAAa,GAKP,CAAE,OAAM,WACP,EAGH,EAAC,IAAD,CAAS,OAAM,OAAO,SAAS,UAAU,yEAAyE,IAAI,sBAAtH,SAAA,CACE,EAAC,OAAD,CAAA,SAAO,GAAS,CAAW,CAAA,EAC3B,EAAC,EAAD,CAAkB,KAAM,EAAK,CAAA,CAC5B,IANa,EAAC,EAAD,CAAe,CAAA"}
1
+ {"version":3,"file":"permalink-BaMvnKIz.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/permalink.tsx"],"sourcesContent":["import { ExternalLinkIcon } from 'lucide-react';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Renders an external-link anchor with an icon for use in table cells, opening\n * the target URL in a new tab with safe `rel` attributes. Renders\n * {@link UITableEmpty} when `href` is absent.\n *\n * @example\n * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePermalink href=\"https://example.com/records/42\" label=\"View record\" />\n */\nexport const UITablePermalink: React.FC<{\n /** The destination URL the anchor navigates to; `null`/`undefined`/empty renders an empty state. */\n href: string | null | undefined;\n /** Optional display text; falls back to the raw `href` when omitted. */\n label?: string;\n}> = ({ href, label }) => {\n if (!href) return <UITableEmpty />;\n\n return (\n <a href={href} target=\"_blank\" className=\"inline-flex items-center gap-1 truncate text-primary text-sm underline\" rel=\"noopener noreferrer\">\n <span>{label || href}</span>\n <ExternalLinkIcon size={14} />\n </a>\n );\n};\n"],"mappings":"4IAcA,MAAa,GAKP,CAAE,OAAM,WACP,EAGH,EAAC,IAAD,CAAS,OAAM,OAAO,SAAS,UAAU,yEAAyE,IAAI,sBAAtH,SAAA,CACE,EAAC,OAAD,CAAA,SAAO,GAAS,CAAW,CAAA,EAC3B,EAAC,EAAD,CAAkB,KAAM,EAAK,CAAA,CAC5B,IANa,EAAC,EAAD,CAAe,CAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("./tables-078i-X0d.cjs");let t=require("lucide-react"),n=require("react/jsx-runtime");const r=({href:r,label:i})=>r?(0,n.jsxs)(`a`,{href:r,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,n.jsx)(`span`,{children:i||r}),(0,n.jsx)(t.ExternalLinkIcon,{size:14})]}):(0,n.jsx)(e.Q,{});exports.UITablePermalink=r;
2
- //# sourceMappingURL=permalink-CUIKG9VA.cjs.map
1
+ const e=require("./tables-CS3NhgTc.cjs");let t=require("lucide-react"),n=require("react/jsx-runtime");const r=({href:r,label:i})=>r?(0,n.jsxs)(`a`,{href:r,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,n.jsx)(`span`,{children:i||r}),(0,n.jsx)(t.ExternalLinkIcon,{size:14})]}):(0,n.jsx)(e.Q,{});exports.UITablePermalink=r;
2
+ //# sourceMappingURL=permalink-CMcI__V4.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"permalink-CUIKG9VA.cjs","names":["UITableEmpty","ExternalLinkIcon"],"sources":["../packages/components/features/tables/components/atoms/permalink.tsx"],"sourcesContent":["import { ExternalLinkIcon } from 'lucide-react';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Renders an external-link anchor with an icon for use in table cells, opening\n * the target URL in a new tab with safe `rel` attributes. Renders\n * {@link UITableEmpty} when `href` is absent.\n *\n * @example\n * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePermalink href=\"https://example.com/records/42\" label=\"View record\" />\n */\nexport const UITablePermalink: React.FC<{\n /** The destination URL the anchor navigates to; `null`/`undefined`/empty renders an empty state. */\n href: string | null | undefined;\n /** Optional display text; falls back to the raw `href` when omitted. */\n label?: string;\n}> = ({ href, label }) => {\n if (!href) return <UITableEmpty />;\n\n return (\n <a href={href} target=\"_blank\" className=\"inline-flex items-center gap-1 truncate text-primary text-sm underline\" rel=\"noopener noreferrer\">\n <span>{label || href}</span>\n <ExternalLinkIcon size={14} />\n </a>\n );\n};\n"],"mappings":"sGAcA,MAAa,GAKP,CAAE,OAAM,WACP,GAGH,EAAA,EAAA,KAAA,CAAC,IAAD,CAAS,OAAM,OAAO,SAAS,UAAU,yEAAyE,IAAI,sBAAtH,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAA,SAAO,GAAS,CAAW,CAAA,GAC3B,EAAA,EAAA,IAAA,CAACC,EAAAA,iBAAD,CAAkB,KAAM,EAAK,CAAA,CAC5B,KANa,EAAA,EAAA,IAAA,CAACD,EAAAA,EAAD,CAAe,CAAA"}
1
+ {"version":3,"file":"permalink-CMcI__V4.cjs","names":["UITableEmpty","ExternalLinkIcon"],"sources":["../packages/components/features/tables/components/atoms/permalink.tsx"],"sourcesContent":["import { ExternalLinkIcon } from 'lucide-react';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Renders an external-link anchor with an icon for use in table cells, opening\n * the target URL in a new tab with safe `rel` attributes. Renders\n * {@link UITableEmpty} when `href` is absent.\n *\n * @example\n * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePermalink href=\"https://example.com/records/42\" label=\"View record\" />\n */\nexport const UITablePermalink: React.FC<{\n /** The destination URL the anchor navigates to; `null`/`undefined`/empty renders an empty state. */\n href: string | null | undefined;\n /** Optional display text; falls back to the raw `href` when omitted. */\n label?: string;\n}> = ({ href, label }) => {\n if (!href) return <UITableEmpty />;\n\n return (\n <a href={href} target=\"_blank\" className=\"inline-flex items-center gap-1 truncate text-primary text-sm underline\" rel=\"noopener noreferrer\">\n <span>{label || href}</span>\n <ExternalLinkIcon size={14} />\n </a>\n );\n};\n"],"mappings":"sGAcA,MAAa,GAKP,CAAE,OAAM,WACP,GAGH,EAAA,EAAA,KAAA,CAAC,IAAD,CAAS,OAAM,OAAO,SAAS,UAAU,yEAAyE,IAAI,sBAAtH,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAA,SAAO,GAAS,CAAW,CAAA,GAC3B,EAAA,EAAA,IAAA,CAACC,EAAAA,iBAAD,CAAkB,KAAM,EAAK,CAAA,CAC5B,KANa,EAAA,EAAA,IAAA,CAACD,EAAAA,EAAD,CAAe,CAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("./ui/tooltip.cjs"),t=require("./tables-078i-X0d.cjs");let n=require("react/jsx-runtime");const r=({value:r})=>r?(0,n.jsxs)(e.Tooltip,{children:[(0,n.jsx)(e.TooltipTrigger,{asChild:!0,children:(0,n.jsx)(`p`,{className:`font-number text-text-positive text-sm tabular-nums`,children:r.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,n.jsx)(e.TooltipContent,{align:`start`,children:(0,n.jsx)(`p`,{className:`tabular-nums`,children:r.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`+84 $1 $2 $3`)})})]}):(0,n.jsx)(t.Q,{});exports.UITablePhoneNumberDisplay=r;
2
- //# sourceMappingURL=phone-number-DJvfJg1b.cjs.map
1
+ const e=require("./ui/tooltip.cjs"),t=require("./tables-CS3NhgTc.cjs");let n=require("react/jsx-runtime");const r=({value:r})=>r?(0,n.jsxs)(e.Tooltip,{children:[(0,n.jsx)(e.TooltipTrigger,{asChild:!0,children:(0,n.jsx)(`p`,{className:`font-number text-text-positive text-sm tabular-nums`,children:r.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,n.jsx)(e.TooltipContent,{align:`start`,children:(0,n.jsx)(`p`,{className:`tabular-nums`,children:r.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`+84 $1 $2 $3`)})})]}):(0,n.jsx)(t.Q,{});exports.UITablePhoneNumberDisplay=r;
2
+ //# sourceMappingURL=phone-number-F9I9sNLK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-number-DJvfJg1b.cjs","names":["UITableEmpty","Tooltip","TooltipTrigger","TooltipContent"],"sources":["../packages/components/features/tables/components/atoms/phone-number.tsx"],"sourcesContent":["import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Formats and displays a phone number string in a table cell using the\n * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international\n * dialling representation. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePhoneNumberDisplay value=\"0843456789\" />\n */\nexport const UITablePhoneNumberDisplay: React.FC<{\n /** The raw phone number string to format and display; `null`/`undefined`/empty renders an empty state. */\n value: string | null | undefined;\n}> = ({ value }) => {\n if (!value) return <UITableEmpty />;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <p className=\"font-number text-text-positive text-sm tabular-nums\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</p>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '+84 $1 $2 $3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":"0GAcA,MAAa,GAGP,CAAE,WACD,GAGH,EAAA,EAAA,KAAA,CAACC,EAAAA,QAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,eAAD,CAAgB,QAAA,GACd,UAAA,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,sDAAuD,SAAA,EAAM,QAAQ,wBAAyB,YAAY,CAAK,CAAA,CAC9G,CAAA,GAChB,EAAA,EAAA,IAAA,CAACC,EAAAA,eAAD,CAAgB,MAAM,QACpB,UAAA,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,eAAgB,SAAA,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,wBAAyB,cAAc,CAAK,CAAA,CAClF,CAAA,CACT,CAAA,CAAA,GAVQ,EAAA,EAAA,IAAA,CAACH,EAAAA,EAAD,CAAe,CAAA"}
1
+ {"version":3,"file":"phone-number-F9I9sNLK.cjs","names":["UITableEmpty","Tooltip","TooltipTrigger","TooltipContent"],"sources":["../packages/components/features/tables/components/atoms/phone-number.tsx"],"sourcesContent":["import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Formats and displays a phone number string in a table cell using the\n * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international\n * dialling representation. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePhoneNumberDisplay value=\"0843456789\" />\n */\nexport const UITablePhoneNumberDisplay: React.FC<{\n /** The raw phone number string to format and display; `null`/`undefined`/empty renders an empty state. */\n value: string | null | undefined;\n}> = ({ value }) => {\n if (!value) return <UITableEmpty />;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <p className=\"font-number text-text-positive text-sm tabular-nums\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</p>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '+84 $1 $2 $3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":"0GAcA,MAAa,GAGP,CAAE,WACD,GAGH,EAAA,EAAA,KAAA,CAACC,EAAAA,QAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,eAAD,CAAgB,QAAA,GACd,UAAA,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,sDAAuD,SAAA,EAAM,QAAQ,wBAAyB,YAAY,CAAK,CAAA,CAC9G,CAAA,GAChB,EAAA,EAAA,IAAA,CAACC,EAAAA,eAAD,CAAgB,MAAM,QACpB,UAAA,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,eAAgB,SAAA,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,wBAAyB,cAAc,CAAK,CAAA,CAClF,CAAA,CACT,CAAA,CAAA,GAVQ,EAAA,EAAA,IAAA,CAACH,EAAAA,EAAD,CAAe,CAAA"}
@@ -1,2 +1,2 @@
1
- import{Tooltip as e,TooltipContent as t,TooltipTrigger as n}from"./ui/tooltip.mjs";import{Q as r}from"./tables-BGzwkdFO.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({value:o})=>o?a(e,{children:[i(n,{asChild:!0,children:i(`p`,{className:`font-number text-text-positive text-sm tabular-nums`,children:o.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),i(t,{align:`start`,children:i(`p`,{className:`tabular-nums`,children:o.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`+84 $1 $2 $3`)})})]}):i(r,{});export{o as UITablePhoneNumberDisplay};
2
- //# sourceMappingURL=phone-number-Cu7Mnl6J.mjs.map
1
+ import{Tooltip as e,TooltipContent as t,TooltipTrigger as n}from"./ui/tooltip.mjs";import{Q as r}from"./tables-7_KgoyS-.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({value:o})=>o?a(e,{children:[i(n,{asChild:!0,children:i(`p`,{className:`font-number text-text-positive text-sm tabular-nums`,children:o.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),i(t,{align:`start`,children:i(`p`,{className:`tabular-nums`,children:o.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`+84 $1 $2 $3`)})})]}):i(r,{});export{o as UITablePhoneNumberDisplay};
2
+ //# sourceMappingURL=phone-number-ao2oCmrO.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-number-Cu7Mnl6J.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/phone-number.tsx"],"sourcesContent":["import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Formats and displays a phone number string in a table cell using the\n * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international\n * dialling representation. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePhoneNumberDisplay value=\"0843456789\" />\n */\nexport const UITablePhoneNumberDisplay: React.FC<{\n /** The raw phone number string to format and display; `null`/`undefined`/empty renders an empty state. */\n value: string | null | undefined;\n}> = ({ value }) => {\n if (!value) return <UITableEmpty />;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <p className=\"font-number text-text-positive text-sm tabular-nums\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</p>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '+84 $1 $2 $3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":"+KAcA,MAAa,GAGP,CAAE,WACD,EAGH,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAgB,QAAA,GACd,SAAA,EAAC,IAAD,CAAG,UAAU,sDAAuD,SAAA,EAAM,QAAQ,wBAAyB,YAAY,CAAK,CAAA,CAC9G,CAAA,EAChB,EAAC,EAAD,CAAgB,MAAM,QACpB,SAAA,EAAC,IAAD,CAAG,UAAU,eAAgB,SAAA,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,wBAAyB,cAAc,CAAK,CAAA,CAClF,CAAA,CACT,CAAA,CAAA,EAVQ,EAAC,EAAD,CAAe,CAAA"}
1
+ {"version":3,"file":"phone-number-ao2oCmrO.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/phone-number.tsx"],"sourcesContent":["import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Formats and displays a phone number string in a table cell using the\n * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international\n * dialling representation. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePhoneNumberDisplay value=\"0843456789\" />\n */\nexport const UITablePhoneNumberDisplay: React.FC<{\n /** The raw phone number string to format and display; `null`/`undefined`/empty renders an empty state. */\n value: string | null | undefined;\n}> = ({ value }) => {\n if (!value) return <UITableEmpty />;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <p className=\"font-number text-text-positive text-sm tabular-nums\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</p>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '+84 $1 $2 $3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":"+KAcA,MAAa,GAGP,CAAE,WACD,EAGH,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAgB,QAAA,GACd,SAAA,EAAC,IAAD,CAAG,UAAU,sDAAuD,SAAA,EAAM,QAAQ,wBAAyB,YAAY,CAAK,CAAA,CAC9G,CAAA,EAChB,EAAC,EAAD,CAAgB,MAAM,QACpB,SAAA,EAAC,IAAD,CAAG,UAAU,eAAgB,SAAA,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,wBAAyB,cAAc,CAAK,CAAA,CAClF,CAAA,CACT,CAAA,CAAA,EAVQ,EAAC,EAAD,CAAe,CAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("./tables-078i-X0d.cjs"),t=require("./ui/progress.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a=(0,n.memo)(({value:n,showLabel:a=!0,successThreshold:o=70,warningThreshold:s=40})=>{if(n==null)return(0,i.jsx)(e.Q,{});let c=Math.min(100,Math.max(0,n));return(0,i.jsxs)(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[(0,i.jsx)(t.Progress,{value:c,className:(0,r.cn)(`flex-1`,c>=o?`[&>[data-slot=progress-indicator]]:bg-success`:c>=s?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),a&&(0,i.jsxs)(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[c,`%`]})]})});a.displayName=`UITableProgressDisplay`,exports.UITableProgressDisplay=a;
2
- //# sourceMappingURL=progress-display-DbfN7U8m.cjs.map
1
+ const e=require("./tables-CS3NhgTc.cjs"),t=require("./ui/progress.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a=(0,n.memo)(({value:n,showLabel:a=!0,successThreshold:o=70,warningThreshold:s=40})=>{if(n==null)return(0,i.jsx)(e.Q,{});let c=Math.min(100,Math.max(0,n));return(0,i.jsxs)(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[(0,i.jsx)(t.Progress,{value:c,className:(0,r.cn)(`flex-1`,c>=o?`[&>[data-slot=progress-indicator]]:bg-success`:c>=s?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),a&&(0,i.jsxs)(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[c,`%`]})]})});a.displayName=`UITableProgressDisplay`,exports.UITableProgressDisplay=a;
2
+ //# sourceMappingURL=progress-display-F8xXJ3T1.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-display-DbfN7U8m.cjs","names":["UITableEmpty","Progress"],"sources":["../packages/components/features/tables/components/atoms/progress-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress } from '@/components/ui/progress';\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableProgressDisplay} component. */\ntype Props = {\n /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */\n value: number | null | undefined;\n /** When `true`, shows the numeric percentage next to the bar (default: `true`). */\n showLabel?: boolean;\n /**\n * Color thresholds applied to the progress indicator.\n * - `≥ successThreshold` → green\n * - `≥ warningThreshold` → yellow\n * - otherwise → red\n *\n * Defaults: `successThreshold = 70`, `warningThreshold = 40`.\n */\n successThreshold?: number;\n warningThreshold?: number;\n};\n\n/**\n * Renders a horizontal progress bar with an optional percentage label for a\n * table cell. The bar color shifts from red → yellow → green based on\n * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableProgressDisplay value={75} />\n */\nexport const UITableProgressDisplay = memo(({ value, showLabel = true, successThreshold = 70, warningThreshold = 40 }: Props) => {\n if (value === null || value === undefined) return <UITableEmpty />;\n\n const clamped = Math.min(100, Math.max(0, value));\n\n const indicatorClass =\n clamped >= successThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-success'\n : clamped >= warningThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-warning'\n : '[&>[data-slot=progress-indicator]]:bg-danger';\n\n return (\n <div className=\"flex w-full min-w-24 items-center gap-x-2\">\n <Progress value={clamped} className={cn('flex-1', indicatorClass)} />\n {showLabel && <span className=\"w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums\">{clamped}%</span>}\n </div>\n );\n});\nUITableProgressDisplay.displayName = 'UITableProgressDisplay';\n"],"mappings":"0KAqCA,MAAa,GAAA,EAAA,EAAA,KAAA,EAA+B,CAAE,QAAO,YAAY,GAAM,mBAAmB,GAAI,mBAAmB,MAAgB,CAC/H,GAAI,GAAU,KAA6B,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,EAEjE,IAAM,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAShD,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,4CAAf,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,SAAD,CAAU,MAAO,EAAS,WAAA,EAAA,EAAA,GAAA,CAAc,SAR1C,GAAW,EACP,gDACA,GAAW,EACT,gDACA,8CAI4D,CAAI,CAAA,EACnE,IAAa,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,mFAAhB,SAAA,CAAoG,EAAQ,GAAO,CAC9H,CAAA,CAAA,GAET,CAAC,EACD,EAAuB,YAAc"}
1
+ {"version":3,"file":"progress-display-F8xXJ3T1.cjs","names":["UITableEmpty","Progress"],"sources":["../packages/components/features/tables/components/atoms/progress-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress } from '@/components/ui/progress';\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableProgressDisplay} component. */\ntype Props = {\n /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */\n value: number | null | undefined;\n /** When `true`, shows the numeric percentage next to the bar (default: `true`). */\n showLabel?: boolean;\n /**\n * Color thresholds applied to the progress indicator.\n * - `≥ successThreshold` → green\n * - `≥ warningThreshold` → yellow\n * - otherwise → red\n *\n * Defaults: `successThreshold = 70`, `warningThreshold = 40`.\n */\n successThreshold?: number;\n warningThreshold?: number;\n};\n\n/**\n * Renders a horizontal progress bar with an optional percentage label for a\n * table cell. The bar color shifts from red → yellow → green based on\n * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableProgressDisplay value={75} />\n */\nexport const UITableProgressDisplay = memo(({ value, showLabel = true, successThreshold = 70, warningThreshold = 40 }: Props) => {\n if (value === null || value === undefined) return <UITableEmpty />;\n\n const clamped = Math.min(100, Math.max(0, value));\n\n const indicatorClass =\n clamped >= successThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-success'\n : clamped >= warningThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-warning'\n : '[&>[data-slot=progress-indicator]]:bg-danger';\n\n return (\n <div className=\"flex w-full min-w-24 items-center gap-x-2\">\n <Progress value={clamped} className={cn('flex-1', indicatorClass)} />\n {showLabel && <span className=\"w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums\">{clamped}%</span>}\n </div>\n );\n});\nUITableProgressDisplay.displayName = 'UITableProgressDisplay';\n"],"mappings":"0KAqCA,MAAa,GAAA,EAAA,EAAA,KAAA,EAA+B,CAAE,QAAO,YAAY,GAAM,mBAAmB,GAAI,mBAAmB,MAAgB,CAC/H,GAAI,GAAU,KAA6B,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,EAEjE,IAAM,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAShD,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,4CAAf,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,SAAD,CAAU,MAAO,EAAS,WAAA,EAAA,EAAA,GAAA,CAAc,SAR1C,GAAW,EACP,gDACA,GAAW,EACT,gDACA,8CAI4D,CAAI,CAAA,EACnE,IAAa,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,mFAAhB,SAAA,CAAoG,EAAQ,GAAO,CAC9H,CAAA,CAAA,GAET,CAAC,EACD,EAAuB,YAAc"}
@@ -1,2 +1,2 @@
1
- import{Q as e}from"./tables-BGzwkdFO.mjs";import{Progress as t}from"./ui/progress.mjs";import{memo as n}from"react";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=n(({value:n,showLabel:o=!0,successThreshold:s=70,warningThreshold:c=40})=>{if(n==null)return i(e,{});let l=Math.min(100,Math.max(0,n));return a(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[i(t,{value:l,className:r(`flex-1`,l>=s?`[&>[data-slot=progress-indicator]]:bg-success`:l>=c?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),o&&a(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[l,`%`]})]})});o.displayName=`UITableProgressDisplay`;export{o as UITableProgressDisplay};
2
- //# sourceMappingURL=progress-display-qgvclwy9.mjs.map
1
+ import{Q as e}from"./tables-7_KgoyS-.mjs";import{Progress as t}from"./ui/progress.mjs";import{memo as n}from"react";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=n(({value:n,showLabel:o=!0,successThreshold:s=70,warningThreshold:c=40})=>{if(n==null)return i(e,{});let l=Math.min(100,Math.max(0,n));return a(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[i(t,{value:l,className:r(`flex-1`,l>=s?`[&>[data-slot=progress-indicator]]:bg-success`:l>=c?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),o&&a(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[l,`%`]})]})});o.displayName=`UITableProgressDisplay`;export{o as UITableProgressDisplay};
2
+ //# sourceMappingURL=progress-display-atwRFD6e.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-display-qgvclwy9.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/progress-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress } from '@/components/ui/progress';\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableProgressDisplay} component. */\ntype Props = {\n /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */\n value: number | null | undefined;\n /** When `true`, shows the numeric percentage next to the bar (default: `true`). */\n showLabel?: boolean;\n /**\n * Color thresholds applied to the progress indicator.\n * - `≥ successThreshold` → green\n * - `≥ warningThreshold` → yellow\n * - otherwise → red\n *\n * Defaults: `successThreshold = 70`, `warningThreshold = 40`.\n */\n successThreshold?: number;\n warningThreshold?: number;\n};\n\n/**\n * Renders a horizontal progress bar with an optional percentage label for a\n * table cell. The bar color shifts from red → yellow → green based on\n * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableProgressDisplay value={75} />\n */\nexport const UITableProgressDisplay = memo(({ value, showLabel = true, successThreshold = 70, warningThreshold = 40 }: Props) => {\n if (value === null || value === undefined) return <UITableEmpty />;\n\n const clamped = Math.min(100, Math.max(0, value));\n\n const indicatorClass =\n clamped >= successThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-success'\n : clamped >= warningThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-warning'\n : '[&>[data-slot=progress-indicator]]:bg-danger';\n\n return (\n <div className=\"flex w-full min-w-24 items-center gap-x-2\">\n <Progress value={clamped} className={cn('flex-1', indicatorClass)} />\n {showLabel && <span className=\"w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums\">{clamped}%</span>}\n </div>\n );\n});\nUITableProgressDisplay.displayName = 'UITableProgressDisplay';\n"],"mappings":"0NAqCA,MAAa,EAAyB,GAAM,CAAE,QAAO,YAAY,GAAM,mBAAmB,GAAI,mBAAmB,MAAgB,CAC/H,GAAI,GAAU,KAA6B,OAAO,EAAC,EAAD,CAAe,CAAA,EAEjE,IAAM,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAShD,OACE,EAAC,MAAD,CAAK,UAAU,4CAAf,SAAA,CACE,EAAC,EAAD,CAAU,MAAO,EAAS,UAAW,EAAG,SAR1C,GAAW,EACP,gDACA,GAAW,EACT,gDACA,8CAI4D,CAAI,CAAA,EACnE,GAAa,EAAC,OAAD,CAAM,UAAU,mFAAhB,SAAA,CAAoG,EAAQ,GAAO,CAC9H,CAAA,CAAA,GAET,CAAC,EACD,EAAuB,YAAc"}
1
+ {"version":3,"file":"progress-display-atwRFD6e.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/progress-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress } from '@/components/ui/progress';\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableProgressDisplay} component. */\ntype Props = {\n /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */\n value: number | null | undefined;\n /** When `true`, shows the numeric percentage next to the bar (default: `true`). */\n showLabel?: boolean;\n /**\n * Color thresholds applied to the progress indicator.\n * - `≥ successThreshold` → green\n * - `≥ warningThreshold` → yellow\n * - otherwise → red\n *\n * Defaults: `successThreshold = 70`, `warningThreshold = 40`.\n */\n successThreshold?: number;\n warningThreshold?: number;\n};\n\n/**\n * Renders a horizontal progress bar with an optional percentage label for a\n * table cell. The bar color shifts from red → yellow → green based on\n * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableProgressDisplay value={75} />\n */\nexport const UITableProgressDisplay = memo(({ value, showLabel = true, successThreshold = 70, warningThreshold = 40 }: Props) => {\n if (value === null || value === undefined) return <UITableEmpty />;\n\n const clamped = Math.min(100, Math.max(0, value));\n\n const indicatorClass =\n clamped >= successThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-success'\n : clamped >= warningThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-warning'\n : '[&>[data-slot=progress-indicator]]:bg-danger';\n\n return (\n <div className=\"flex w-full min-w-24 items-center gap-x-2\">\n <Progress value={clamped} className={cn('flex-1', indicatorClass)} />\n {showLabel && <span className=\"w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums\">{clamped}%</span>}\n </div>\n );\n});\nUITableProgressDisplay.displayName = 'UITableProgressDisplay';\n"],"mappings":"0NAqCA,MAAa,EAAyB,GAAM,CAAE,QAAO,YAAY,GAAM,mBAAmB,GAAI,mBAAmB,MAAgB,CAC/H,GAAI,GAAU,KAA6B,OAAO,EAAC,EAAD,CAAe,CAAA,EAEjE,IAAM,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAShD,OACE,EAAC,MAAD,CAAK,UAAU,4CAAf,SAAA,CACE,EAAC,EAAD,CAAU,MAAO,EAAS,UAAW,EAAG,SAR1C,GAAW,EACP,gDACA,GAAW,EACT,gDACA,8CAI4D,CAAI,CAAA,EACnE,GAAa,EAAC,OAAD,CAAM,UAAU,mFAAhB,SAAA,CAAoG,EAAQ,GAAO,CAC9H,CAAA,CAAA,GAET,CAAC,EACD,EAAuB,YAAc"}
@@ -35,7 +35,7 @@ declare const ResizablePanelGroup: import("react").NamedExoticComponent<Omit<imp
35
35
  children?: import("react").ReactNode | undefined;
36
36
  } & import("react").RefAttributes<ResizablePrimitive.ImperativePanelGroupHandle>>;
37
37
  /** An individual resizable panel within a ResizablePanelGroup. */
38
- declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("react").HTMLAttributes<HTMLInputElement | HTMLElement | HTMLParagraphElement | HTMLButtonElement | HTMLDivElement | HTMLFieldSetElement | HTMLLegendElement | HTMLLabelElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
38
+ declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("react").HTMLAttributes<HTMLInputElement | HTMLElement | HTMLParagraphElement | HTMLDivElement | HTMLLabelElement | HTMLButtonElement | HTMLFieldSetElement | HTMLLegendElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
39
39
  className?: string;
40
40
  collapsedSize?: number | undefined;
41
41
  collapsible?: boolean | undefined;
@@ -60,4 +60,4 @@ declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("
60
60
  declare const ResizableHandle: import("react").NamedExoticComponent<TResizableHandle>;
61
61
  //#endregion
62
62
  export { ResizablePanel as n, ResizablePanelGroup as r, ResizableHandle as t };
63
- //# sourceMappingURL=resizable-CWmitx5U.d.cts.map
63
+ //# sourceMappingURL=resizable-B61Fbl57.d.cts.map
@@ -35,7 +35,7 @@ declare const ResizablePanelGroup: import("react").NamedExoticComponent<Omit<imp
35
35
  children?: import("react").ReactNode | undefined;
36
36
  } & import("react").RefAttributes<ResizablePrimitive.ImperativePanelGroupHandle>>;
37
37
  /** An individual resizable panel within a ResizablePanelGroup. */
38
- declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("react").HTMLAttributes<HTMLInputElement | HTMLElement | HTMLParagraphElement | HTMLButtonElement | HTMLDivElement | HTMLFieldSetElement | HTMLLegendElement | HTMLLabelElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
38
+ declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("react").HTMLAttributes<HTMLInputElement | HTMLElement | HTMLParagraphElement | HTMLDivElement | HTMLLabelElement | HTMLButtonElement | HTMLFieldSetElement | HTMLLegendElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
39
39
  className?: string;
40
40
  collapsedSize?: number | undefined;
41
41
  collapsible?: boolean | undefined;
@@ -60,4 +60,4 @@ declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("
60
60
  declare const ResizableHandle: import("react").NamedExoticComponent<TResizableHandle>;
61
61
  //#endregion
62
62
  export { ResizablePanel as n, ResizablePanelGroup as r, ResizableHandle as t };
63
- //# sourceMappingURL=resizable-CWmitx5U.d.mts.map
63
+ //# sourceMappingURL=resizable-B61Fbl57.d.mts.map
@@ -1,4 +1,4 @@
1
- import { t as Input } from "./input-D73TrUof.mjs";
1
+ import { t as Input } from "./input-DxNK7Wo6.cjs";
2
2
  //#region packages/components/ui/inputs/search-input.d.ts
3
3
  /**
4
4
  * Props for {@link SearchInput}. Accepts all native props of the underlying
@@ -20,4 +20,4 @@ type Props = React.ComponentPropsWithoutRef<typeof Input>;
20
20
  declare const SearchInput: ({ className, ...rest }: Props) => import("react").JSX.Element;
21
21
  //#endregion
22
22
  export { SearchInput as t };
23
- //# sourceMappingURL=search-input-DEvYI6Rm.d.mts.map
23
+ //# sourceMappingURL=search-input-C8feOKe2.d.cts.map
@@ -1,4 +1,4 @@
1
- import { t as Input } from "./input-D73TrUof.cjs";
1
+ import { t as Input } from "./input-DxNK7Wo6.mjs";
2
2
  //#region packages/components/ui/inputs/search-input.d.ts
3
3
  /**
4
4
  * Props for {@link SearchInput}. Accepts all native props of the underlying
@@ -20,4 +20,4 @@ type Props = React.ComponentPropsWithoutRef<typeof Input>;
20
20
  declare const SearchInput: ({ className, ...rest }: Props) => import("react").JSX.Element;
21
21
  //#endregion
22
22
  export { SearchInput as t };
23
- //# sourceMappingURL=search-input-h_3MoMqK.d.cts.map
23
+ //# sourceMappingURL=search-input-CoqwakbI.d.mts.map
@@ -1,2 +1,2 @@
1
- const e=require("./layouts/flex.cjs"),t=require("./tables-078i-X0d.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a=(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}},o=(0,n.memo)(({decimalSeparator:o=`.`,groupSeparator:s=`,`,prefix:c,suffix:l,precision:u,roundingMode:d=`round`,showTrailingZeros:f=!1,size:p=`lg`,value:m=0})=>{let h=(0,n.useMemo)(()=>{let e={};return typeof u==`number`&&u>=0&&f&&(e.minimumFractionDigits=u),e.maximumFractionDigits=u,e},[u,f]),g=(0,n.useCallback)(e=>{let t=e;return typeof u==`number`&&u>=0&&(t=a(e,u,d)),t.toLocaleString(`en-US`,h)},[d,h,u]),_=(0,n.useMemo)(()=>{if(typeof m==`number`)return Number.isNaN(m)||!Number.isFinite(m)?`N/A`:g(m);if(typeof m==`string`){let e=m.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:g(t)}return`N/A`},[m,g]),v=(0,n.useMemo)(()=>o===`.`&&s===`,`?_:_.replace(/,/g,s).replace(/\./g,o),[_,o,s]);return v===`0`||v===`N/A`||!v?(0,i.jsx)(t.Q,{}):(0,i.jsxs)(e.Flex,{padding:`none`,className:(0,r.cn)(`font-number text-lg text-text-positive tabular-nums`,p===`xs`&&`text-xs`,p===`sm`&&`text-sm`,p===`md`&&`text-base`,p===`lg`&&`text-lg`,p===`xl`&&`text-xl`),children:[c,(0,i.jsx)(`p`,{children:v}),l]})});o.displayName=`UITableStatisticDisplay`,exports.UITableStatisticDisplay=o;
2
- //# sourceMappingURL=statistic-LL4uHlRb.cjs.map
1
+ const e=require("./layouts/flex.cjs"),t=require("./tables-CS3NhgTc.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a=(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}},o=(0,n.memo)(({decimalSeparator:o=`.`,groupSeparator:s=`,`,prefix:c,suffix:l,precision:u,roundingMode:d=`round`,showTrailingZeros:f=!1,size:p=`lg`,value:m=0})=>{let h=(0,n.useMemo)(()=>{let e={};return typeof u==`number`&&u>=0&&f&&(e.minimumFractionDigits=u),e.maximumFractionDigits=u,e},[u,f]),g=(0,n.useCallback)(e=>{let t=e;return typeof u==`number`&&u>=0&&(t=a(e,u,d)),t.toLocaleString(`vi-VN`,h)},[d,h,u]),_=(0,n.useMemo)(()=>{if(typeof m==`number`)return Number.isNaN(m)||!Number.isFinite(m)?`N/A`:g(m);if(typeof m==`string`){let e=m.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:g(t)}return`N/A`},[m,g]),v=(0,n.useMemo)(()=>o===`.`&&s===`,`?_:_.replace(/,/g,s).replace(/\./g,o),[_,o,s]);return v===`0`||v===`N/A`||!v?(0,i.jsx)(t.Q,{}):(0,i.jsxs)(e.Flex,{padding:`none`,className:(0,r.cn)(`font-number text-lg text-text-positive tabular-nums`,p===`xs`&&`text-xs`,p===`sm`&&`text-sm`,p===`md`&&`text-base`,p===`lg`&&`text-lg`,p===`xl`&&`text-xl`),children:[c,(0,i.jsx)(`p`,{children:v}),l]})});o.displayName=`UITableStatisticDisplay`,exports.UITableStatisticDisplay=o;
2
+ //# sourceMappingURL=statistic-B9OqfhOl.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"statistic-LL4uHlRb.cjs","names":["UITableEmpty","Flex"],"sources":["../packages/components/features/tables/components/atoms/statistic.tsx"],"sourcesContent":["'use client';\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Flex } from '@/components/layouts/flex';\nimport { UITableEmpty } from './empty';\n\n/**\n * Applies the specified rounding mode to `num` at the given decimal precision.\n *\n * @param num - The number to round.\n * @param precisionValue - Number of decimal places to keep.\n * @param roundingMode - Rounding strategy: `'round'` (default), `'floor'`, or `'ceil'`.\n * @returns The rounded number.\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\n/** Props for the {@link UITableStatisticDisplay} component. */\ntype Props = {\n /** Character used to separate the integer and fractional parts (default: `'.'`). */\n decimalSeparator?: string;\n /** Character used to separate thousands groups (default: `','`). */\n groupSeparator?: string;\n /** Optional node rendered before the formatted number (e.g. a currency symbol). */\n prefix?: React.ReactNode;\n /** Optional node rendered after the formatted number (e.g. a unit label). */\n suffix?: React.ReactNode;\n /** Number of decimal digits to display. */\n precision?: number;\n /** Rounding strategy applied before formatting (default: `'round'`). */\n roundingMode?: 'round' | 'floor' | 'ceil';\n /** When `true`, pads the fractional part with trailing zeros up to `precision` digits. */\n showTrailingZeros?: boolean;\n /** Font-size variant for the displayed number (default: `'lg'`). */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** The numeric or string value to format; falsy / invalid values render an empty state. */\n value: number | string | null | undefined;\n};\n\n/**\n * A memoized table-cell component that formats a numeric value with configurable\n * separators, precision, rounding, and size; renders {@link UITableEmpty} when\n * the value is zero, invalid, or absent.\n *\n * @example\n * import { UITableStatisticDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableStatisticDisplay value={1234567.89} precision={2} prefix=\"$\" size=\"md\" />\n */\nexport const UITableStatisticDisplay = memo(\n ({\n decimalSeparator = '.',\n groupSeparator = ',',\n prefix: Prefix,\n suffix: Suffix,\n precision,\n roundingMode = 'round',\n showTrailingZeros = false,\n size = 'lg',\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 <UITableEmpty />;\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);\nUITableStatisticDisplay.displayName = 'UITableStatisticDisplay';\n"],"mappings":"2KAgBA,MAAM,GAAiB,EAAa,EAAwB,IAA8C,CACxG,IAAM,EAAa,IAAM,EAEzB,OAAQ,EAAR,CACE,IAAK,QACH,OAAO,KAAK,MAAM,EAAM,CAAU,EAAI,EACxC,IAAK,OACH,OAAO,KAAK,KAAK,EAAM,CAAU,EAAI,EACvC,QACE,OAAO,KAAK,MAAM,EAAM,CAAU,EAAI,CAC1C,CACF,EAkCa,GAAA,EAAA,EAAA,KAAA,EACV,CACC,mBAAmB,IACnB,iBAAiB,IACjB,OAAQ,EACR,OAAQ,EACR,YACA,eAAe,QACf,oBAAoB,GACpB,OAAO,KACP,QAAQ,KACG,CAEX,IAAM,GAAA,EAAA,EAAA,QAAA,KAAwD,CAC5D,IAAM,EAAoC,CAAC,EAS3C,OAPI,OAAO,GAAc,UAAY,GAAa,GAAK,IACrD,EAAQ,sBAAwB,GAGhC,EAAQ,sBAAwB,EAG3B,CACT,EAAG,CAAC,EAAW,CAAiB,CAAC,EAE3B,GAAA,EAAA,EAAA,YAAA,CACH,GAAwB,CACvB,IAAI,EAAe,EAOnB,OAJI,OAAO,GAAc,UAAY,GAAa,IAChD,EAAe,EAAc,EAAK,EAAW,CAAY,GAGpD,EAAa,eAAe,QAAS,CAAa,CAC3D,EACA,CAAC,EAAc,EAAe,CAAS,CACzC,EAGM,GAAA,EAAA,EAAA,QAAA,KAAuC,CAE3C,GAAI,OAAO,GAAU,SAInB,OAHI,OAAO,MAAM,CAAK,GAAK,CAAC,OAAO,SAAS,CAAK,EACxC,MAEF,EAAa,CAAK,EAI3B,GAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAe,EAAM,KAAK,EAGhC,GAAI,CAAC,EACH,MAAO,MAIT,IAAM,EAAW,OAAO,CAAY,EAOpC,OALI,OAAO,MAAM,CAAQ,GAAK,CAAC,OAAO,SAAS,CAAQ,EAE9C,MAGF,EAAa,CAAQ,CAC9B,CAEA,MAAO,KACT,EAAG,CAAC,EAAO,CAAY,CAAC,EAGlB,GAAA,EAAA,EAAA,QAAA,KAEA,IAAqB,KAAO,IAAmB,IAC1C,EAEF,EAAe,QAAQ,KAAM,CAAc,CAAC,CAAC,QAAQ,MAAO,CAAgB,EAClF,CAAC,EAAgB,EAAkB,CAAc,CAAC,EAMrD,OAJI,IAAwB,KAAO,IAAwB,OAAS,CAAC,GAC5D,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,GAItB,EAAA,EAAA,KAAA,CAACC,EAAAA,KAAD,CACE,QAAQ,OACR,WAAA,EAAA,EAAA,GAAA,CACE,sDACA,IAAS,MAAQ,UACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,YACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,SACnB,EATF,SAAA,CAWG,GACD,EAAA,EAAA,IAAA,CAAC,IAAD,CAAA,SAAI,CAAuB,CAAA,EAC1B,CACG,GAEV,CACF,EACA,EAAwB,YAAc"}
1
+ {"version":3,"file":"statistic-B9OqfhOl.cjs","names":["UITableEmpty","Flex"],"sources":["../packages/components/features/tables/components/atoms/statistic.tsx"],"sourcesContent":["'use client';\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Flex } from '@/components/layouts/flex';\nimport { UITableEmpty } from './empty';\n\n/**\n * Applies the specified rounding mode to `num` at the given decimal precision.\n *\n * @param num - The number to round.\n * @param precisionValue - Number of decimal places to keep.\n * @param roundingMode - Rounding strategy: `'round'` (default), `'floor'`, or `'ceil'`.\n * @returns The rounded number.\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\n/** Props for the {@link UITableStatisticDisplay} component. */\ntype Props = {\n /** Character used to separate the integer and fractional parts (default: `'.'`). */\n decimalSeparator?: string;\n /** Character used to separate thousands groups (default: `','`). */\n groupSeparator?: string;\n /** Optional node rendered before the formatted number (e.g. a currency symbol). */\n prefix?: React.ReactNode;\n /** Optional node rendered after the formatted number (e.g. a unit label). */\n suffix?: React.ReactNode;\n /** Number of decimal digits to display. */\n precision?: number;\n /** Rounding strategy applied before formatting (default: `'round'`). */\n roundingMode?: 'round' | 'floor' | 'ceil';\n /** When `true`, pads the fractional part with trailing zeros up to `precision` digits. */\n showTrailingZeros?: boolean;\n /** Font-size variant for the displayed number (default: `'lg'`). */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** The numeric or string value to format; falsy / invalid values render an empty state. */\n value: number | string | null | undefined;\n};\n\n/**\n * A memoized table-cell component that formats a numeric value with configurable\n * separators, precision, rounding, and size; renders {@link UITableEmpty} when\n * the value is zero, invalid, or absent.\n *\n * @example\n * import { UITableStatisticDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableStatisticDisplay value={1234567.89} precision={2} prefix=\"$\" size=\"md\" />\n */\nexport const UITableStatisticDisplay = memo(\n ({\n decimalSeparator = '.',\n groupSeparator = ',',\n prefix: Prefix,\n suffix: Suffix,\n precision,\n roundingMode = 'round',\n showTrailingZeros = false,\n size = 'lg',\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('vi-VN', 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 <UITableEmpty />;\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);\nUITableStatisticDisplay.displayName = 'UITableStatisticDisplay';\n"],"mappings":"2KAgBA,MAAM,GAAiB,EAAa,EAAwB,IAA8C,CACxG,IAAM,EAAa,IAAM,EAEzB,OAAQ,EAAR,CACE,IAAK,QACH,OAAO,KAAK,MAAM,EAAM,CAAU,EAAI,EACxC,IAAK,OACH,OAAO,KAAK,KAAK,EAAM,CAAU,EAAI,EACvC,QACE,OAAO,KAAK,MAAM,EAAM,CAAU,EAAI,CAC1C,CACF,EAkCa,GAAA,EAAA,EAAA,KAAA,EACV,CACC,mBAAmB,IACnB,iBAAiB,IACjB,OAAQ,EACR,OAAQ,EACR,YACA,eAAe,QACf,oBAAoB,GACpB,OAAO,KACP,QAAQ,KACG,CAEX,IAAM,GAAA,EAAA,EAAA,QAAA,KAAwD,CAC5D,IAAM,EAAoC,CAAC,EAS3C,OAPI,OAAO,GAAc,UAAY,GAAa,GAAK,IACrD,EAAQ,sBAAwB,GAGhC,EAAQ,sBAAwB,EAG3B,CACT,EAAG,CAAC,EAAW,CAAiB,CAAC,EAE3B,GAAA,EAAA,EAAA,YAAA,CACH,GAAwB,CACvB,IAAI,EAAe,EAOnB,OAJI,OAAO,GAAc,UAAY,GAAa,IAChD,EAAe,EAAc,EAAK,EAAW,CAAY,GAGpD,EAAa,eAAe,QAAS,CAAa,CAC3D,EACA,CAAC,EAAc,EAAe,CAAS,CACzC,EAGM,GAAA,EAAA,EAAA,QAAA,KAAuC,CAE3C,GAAI,OAAO,GAAU,SAInB,OAHI,OAAO,MAAM,CAAK,GAAK,CAAC,OAAO,SAAS,CAAK,EACxC,MAEF,EAAa,CAAK,EAI3B,GAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAe,EAAM,KAAK,EAGhC,GAAI,CAAC,EACH,MAAO,MAIT,IAAM,EAAW,OAAO,CAAY,EAOpC,OALI,OAAO,MAAM,CAAQ,GAAK,CAAC,OAAO,SAAS,CAAQ,EAE9C,MAGF,EAAa,CAAQ,CAC9B,CAEA,MAAO,KACT,EAAG,CAAC,EAAO,CAAY,CAAC,EAGlB,GAAA,EAAA,EAAA,QAAA,KAEA,IAAqB,KAAO,IAAmB,IAC1C,EAEF,EAAe,QAAQ,KAAM,CAAc,CAAC,CAAC,QAAQ,MAAO,CAAgB,EAClF,CAAC,EAAgB,EAAkB,CAAc,CAAC,EAMrD,OAJI,IAAwB,KAAO,IAAwB,OAAS,CAAC,GAC5D,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,GAItB,EAAA,EAAA,KAAA,CAACC,EAAAA,KAAD,CACE,QAAQ,OACR,WAAA,EAAA,EAAA,GAAA,CACE,sDACA,IAAS,MAAQ,UACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,YACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,SACnB,EATF,SAAA,CAWG,GACD,EAAA,EAAA,IAAA,CAAC,IAAD,CAAA,SAAI,CAAuB,CAAA,EAC1B,CACG,GAEV,CACF,EACA,EAAwB,YAAc"}
@@ -1,2 +1,2 @@
1
- import{Flex as e}from"./layouts/flex.mjs";import{Q as t}from"./tables-BGzwkdFO.mjs";import{memo as n,useCallback as r,useMemo as i}from"react";import{cn as a}from"@customafk/react-toolkit/utils";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=(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}},l=n(({decimalSeparator:n=`.`,groupSeparator:l=`,`,prefix:u,suffix:d,precision:f,roundingMode:p=`round`,showTrailingZeros:m=!1,size:h=`lg`,value:g=0})=>{let _=i(()=>{let e={};return typeof f==`number`&&f>=0&&m&&(e.minimumFractionDigits=f),e.maximumFractionDigits=f,e},[f,m]),v=r(e=>{let t=e;return typeof f==`number`&&f>=0&&(t=c(e,f,p)),t.toLocaleString(`en-US`,_)},[p,_,f]),y=i(()=>{if(typeof g==`number`)return Number.isNaN(g)||!Number.isFinite(g)?`N/A`:v(g);if(typeof g==`string`){let e=g.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:v(t)}return`N/A`},[g,v]),b=i(()=>n===`.`&&l===`,`?y:y.replace(/,/g,l).replace(/\./g,n),[y,n,l]);return b===`0`||b===`N/A`||!b?o(t,{}):s(e,{padding:`none`,className:a(`font-number text-lg text-text-positive tabular-nums`,h===`xs`&&`text-xs`,h===`sm`&&`text-sm`,h===`md`&&`text-base`,h===`lg`&&`text-lg`,h===`xl`&&`text-xl`),children:[u,o(`p`,{children:b}),d]})});l.displayName=`UITableStatisticDisplay`;export{l as UITableStatisticDisplay};
2
- //# sourceMappingURL=statistic-ClkqqDfk.mjs.map
1
+ import{Flex as e}from"./layouts/flex.mjs";import{Q as t}from"./tables-7_KgoyS-.mjs";import{memo as n,useCallback as r,useMemo as i}from"react";import{cn as a}from"@customafk/react-toolkit/utils";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=(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}},l=n(({decimalSeparator:n=`.`,groupSeparator:l=`,`,prefix:u,suffix:d,precision:f,roundingMode:p=`round`,showTrailingZeros:m=!1,size:h=`lg`,value:g=0})=>{let _=i(()=>{let e={};return typeof f==`number`&&f>=0&&m&&(e.minimumFractionDigits=f),e.maximumFractionDigits=f,e},[f,m]),v=r(e=>{let t=e;return typeof f==`number`&&f>=0&&(t=c(e,f,p)),t.toLocaleString(`vi-VN`,_)},[p,_,f]),y=i(()=>{if(typeof g==`number`)return Number.isNaN(g)||!Number.isFinite(g)?`N/A`:v(g);if(typeof g==`string`){let e=g.trim();if(!e)return`N/A`;let t=Number(e);return Number.isNaN(t)||!Number.isFinite(t)?`N/A`:v(t)}return`N/A`},[g,v]),b=i(()=>n===`.`&&l===`,`?y:y.replace(/,/g,l).replace(/\./g,n),[y,n,l]);return b===`0`||b===`N/A`||!b?o(t,{}):s(e,{padding:`none`,className:a(`font-number text-lg text-text-positive tabular-nums`,h===`xs`&&`text-xs`,h===`sm`&&`text-sm`,h===`md`&&`text-base`,h===`lg`&&`text-lg`,h===`xl`&&`text-xl`),children:[u,o(`p`,{children:b}),d]})});l.displayName=`UITableStatisticDisplay`;export{l as UITableStatisticDisplay};
2
+ //# sourceMappingURL=statistic-CJVc9sNs.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"statistic-ClkqqDfk.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/statistic.tsx"],"sourcesContent":["'use client';\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Flex } from '@/components/layouts/flex';\nimport { UITableEmpty } from './empty';\n\n/**\n * Applies the specified rounding mode to `num` at the given decimal precision.\n *\n * @param num - The number to round.\n * @param precisionValue - Number of decimal places to keep.\n * @param roundingMode - Rounding strategy: `'round'` (default), `'floor'`, or `'ceil'`.\n * @returns The rounded number.\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\n/** Props for the {@link UITableStatisticDisplay} component. */\ntype Props = {\n /** Character used to separate the integer and fractional parts (default: `'.'`). */\n decimalSeparator?: string;\n /** Character used to separate thousands groups (default: `','`). */\n groupSeparator?: string;\n /** Optional node rendered before the formatted number (e.g. a currency symbol). */\n prefix?: React.ReactNode;\n /** Optional node rendered after the formatted number (e.g. a unit label). */\n suffix?: React.ReactNode;\n /** Number of decimal digits to display. */\n precision?: number;\n /** Rounding strategy applied before formatting (default: `'round'`). */\n roundingMode?: 'round' | 'floor' | 'ceil';\n /** When `true`, pads the fractional part with trailing zeros up to `precision` digits. */\n showTrailingZeros?: boolean;\n /** Font-size variant for the displayed number (default: `'lg'`). */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** The numeric or string value to format; falsy / invalid values render an empty state. */\n value: number | string | null | undefined;\n};\n\n/**\n * A memoized table-cell component that formats a numeric value with configurable\n * separators, precision, rounding, and size; renders {@link UITableEmpty} when\n * the value is zero, invalid, or absent.\n *\n * @example\n * import { UITableStatisticDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableStatisticDisplay value={1234567.89} precision={2} prefix=\"$\" size=\"md\" />\n */\nexport const UITableStatisticDisplay = memo(\n ({\n decimalSeparator = '.',\n groupSeparator = ',',\n prefix: Prefix,\n suffix: Suffix,\n precision,\n roundingMode = 'round',\n showTrailingZeros = false,\n size = 'lg',\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 <UITableEmpty />;\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);\nUITableStatisticDisplay.displayName = 'UITableStatisticDisplay';\n"],"mappings":"qPAgBA,MAAM,GAAiB,EAAa,EAAwB,IAA8C,CACxG,IAAM,EAAa,IAAM,EAEzB,OAAQ,EAAR,CACE,IAAK,QACH,OAAO,KAAK,MAAM,EAAM,CAAU,EAAI,EACxC,IAAK,OACH,OAAO,KAAK,KAAK,EAAM,CAAU,EAAI,EACvC,QACE,OAAO,KAAK,MAAM,EAAM,CAAU,EAAI,CAC1C,CACF,EAkCa,EAA0B,GACpC,CACC,mBAAmB,IACnB,iBAAiB,IACjB,OAAQ,EACR,OAAQ,EACR,YACA,eAAe,QACf,oBAAoB,GACpB,OAAO,KACP,QAAQ,KACG,CAEX,IAAM,EAAgB,MAAwC,CAC5D,IAAM,EAAoC,CAAC,EAS3C,OAPI,OAAO,GAAc,UAAY,GAAa,GAAK,IACrD,EAAQ,sBAAwB,GAGhC,EAAQ,sBAAwB,EAG3B,CACT,EAAG,CAAC,EAAW,CAAiB,CAAC,EAE3B,EAAe,EAClB,GAAwB,CACvB,IAAI,EAAe,EAOnB,OAJI,OAAO,GAAc,UAAY,GAAa,IAChD,EAAe,EAAc,EAAK,EAAW,CAAY,GAGpD,EAAa,eAAe,QAAS,CAAa,CAC3D,EACA,CAAC,EAAc,EAAe,CAAS,CACzC,EAGM,EAAiB,MAAsB,CAE3C,GAAI,OAAO,GAAU,SAInB,OAHI,OAAO,MAAM,CAAK,GAAK,CAAC,OAAO,SAAS,CAAK,EACxC,MAEF,EAAa,CAAK,EAI3B,GAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAe,EAAM,KAAK,EAGhC,GAAI,CAAC,EACH,MAAO,MAIT,IAAM,EAAW,OAAO,CAAY,EAOpC,OALI,OAAO,MAAM,CAAQ,GAAK,CAAC,OAAO,SAAS,CAAQ,EAE9C,MAGF,EAAa,CAAQ,CAC9B,CAEA,MAAO,KACT,EAAG,CAAC,EAAO,CAAY,CAAC,EAGlB,EAAsB,MAEtB,IAAqB,KAAO,IAAmB,IAC1C,EAEF,EAAe,QAAQ,KAAM,CAAc,CAAC,CAAC,QAAQ,MAAO,CAAgB,EAClF,CAAC,EAAgB,EAAkB,CAAc,CAAC,EAMrD,OAJI,IAAwB,KAAO,IAAwB,OAAS,CAAC,EAC5D,EAAC,EAAD,CAAe,CAAA,EAItB,EAAC,EAAD,CACE,QAAQ,OACR,UAAW,EACT,sDACA,IAAS,MAAQ,UACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,YACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,SACnB,EATF,SAAA,CAWG,EACD,EAAC,IAAD,CAAA,SAAI,CAAuB,CAAA,EAC1B,CACG,GAEV,CACF,EACA,EAAwB,YAAc"}
1
+ {"version":3,"file":"statistic-CJVc9sNs.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/statistic.tsx"],"sourcesContent":["'use client';\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Flex } from '@/components/layouts/flex';\nimport { UITableEmpty } from './empty';\n\n/**\n * Applies the specified rounding mode to `num` at the given decimal precision.\n *\n * @param num - The number to round.\n * @param precisionValue - Number of decimal places to keep.\n * @param roundingMode - Rounding strategy: `'round'` (default), `'floor'`, or `'ceil'`.\n * @returns The rounded number.\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\n/** Props for the {@link UITableStatisticDisplay} component. */\ntype Props = {\n /** Character used to separate the integer and fractional parts (default: `'.'`). */\n decimalSeparator?: string;\n /** Character used to separate thousands groups (default: `','`). */\n groupSeparator?: string;\n /** Optional node rendered before the formatted number (e.g. a currency symbol). */\n prefix?: React.ReactNode;\n /** Optional node rendered after the formatted number (e.g. a unit label). */\n suffix?: React.ReactNode;\n /** Number of decimal digits to display. */\n precision?: number;\n /** Rounding strategy applied before formatting (default: `'round'`). */\n roundingMode?: 'round' | 'floor' | 'ceil';\n /** When `true`, pads the fractional part with trailing zeros up to `precision` digits. */\n showTrailingZeros?: boolean;\n /** Font-size variant for the displayed number (default: `'lg'`). */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** The numeric or string value to format; falsy / invalid values render an empty state. */\n value: number | string | null | undefined;\n};\n\n/**\n * A memoized table-cell component that formats a numeric value with configurable\n * separators, precision, rounding, and size; renders {@link UITableEmpty} when\n * the value is zero, invalid, or absent.\n *\n * @example\n * import { UITableStatisticDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableStatisticDisplay value={1234567.89} precision={2} prefix=\"$\" size=\"md\" />\n */\nexport const UITableStatisticDisplay = memo(\n ({\n decimalSeparator = '.',\n groupSeparator = ',',\n prefix: Prefix,\n suffix: Suffix,\n precision,\n roundingMode = 'round',\n showTrailingZeros = false,\n size = 'lg',\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('vi-VN', 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 <UITableEmpty />;\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);\nUITableStatisticDisplay.displayName = 'UITableStatisticDisplay';\n"],"mappings":"qPAgBA,MAAM,GAAiB,EAAa,EAAwB,IAA8C,CACxG,IAAM,EAAa,IAAM,EAEzB,OAAQ,EAAR,CACE,IAAK,QACH,OAAO,KAAK,MAAM,EAAM,CAAU,EAAI,EACxC,IAAK,OACH,OAAO,KAAK,KAAK,EAAM,CAAU,EAAI,EACvC,QACE,OAAO,KAAK,MAAM,EAAM,CAAU,EAAI,CAC1C,CACF,EAkCa,EAA0B,GACpC,CACC,mBAAmB,IACnB,iBAAiB,IACjB,OAAQ,EACR,OAAQ,EACR,YACA,eAAe,QACf,oBAAoB,GACpB,OAAO,KACP,QAAQ,KACG,CAEX,IAAM,EAAgB,MAAwC,CAC5D,IAAM,EAAoC,CAAC,EAS3C,OAPI,OAAO,GAAc,UAAY,GAAa,GAAK,IACrD,EAAQ,sBAAwB,GAGhC,EAAQ,sBAAwB,EAG3B,CACT,EAAG,CAAC,EAAW,CAAiB,CAAC,EAE3B,EAAe,EAClB,GAAwB,CACvB,IAAI,EAAe,EAOnB,OAJI,OAAO,GAAc,UAAY,GAAa,IAChD,EAAe,EAAc,EAAK,EAAW,CAAY,GAGpD,EAAa,eAAe,QAAS,CAAa,CAC3D,EACA,CAAC,EAAc,EAAe,CAAS,CACzC,EAGM,EAAiB,MAAsB,CAE3C,GAAI,OAAO,GAAU,SAInB,OAHI,OAAO,MAAM,CAAK,GAAK,CAAC,OAAO,SAAS,CAAK,EACxC,MAEF,EAAa,CAAK,EAI3B,GAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAe,EAAM,KAAK,EAGhC,GAAI,CAAC,EACH,MAAO,MAIT,IAAM,EAAW,OAAO,CAAY,EAOpC,OALI,OAAO,MAAM,CAAQ,GAAK,CAAC,OAAO,SAAS,CAAQ,EAE9C,MAGF,EAAa,CAAQ,CAC9B,CAEA,MAAO,KACT,EAAG,CAAC,EAAO,CAAY,CAAC,EAGlB,EAAsB,MAEtB,IAAqB,KAAO,IAAmB,IAC1C,EAEF,EAAe,QAAQ,KAAM,CAAc,CAAC,CAAC,QAAQ,MAAO,CAAgB,EAClF,CAAC,EAAgB,EAAkB,CAAc,CAAC,EAMrD,OAJI,IAAwB,KAAO,IAAwB,OAAS,CAAC,EAC5D,EAAC,EAAD,CAAe,CAAA,EAItB,EAAC,EAAD,CACE,QAAQ,OACR,UAAW,EACT,sDACA,IAAS,MAAQ,UACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,YACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,SACnB,EATF,SAAA,CAWG,EACD,EAAC,IAAD,CAAA,SAAI,CAAuB,CAAA,EAC1B,CACG,GAEV,CACF,EACA,EAAwB,YAAc"}
@@ -1,2 +1,2 @@
1
- import{Badge as e}from"./ui/badge.mjs";import{Q as t}from"./tables-BGzwkdFO.mjs";import{jsx as n}from"react/jsx-runtime";const r=({value:r,colorMap:i,defaultColor:a=`muted`,variant:o=`soft`})=>r==null||r===``?n(t,{}):n(e,{variant:o,color:(i&&i[r])??a,size:`sm`,className:`min-w-16 justify-center capitalize`,children:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g,` `)});export{r as UITableStatusDisplay};
2
- //# sourceMappingURL=status-display-BUphOF18.mjs.map
1
+ import{Badge as e}from"./ui/badge.mjs";import{Q as t}from"./tables-7_KgoyS-.mjs";import{jsx as n}from"react/jsx-runtime";const r=({value:r,colorMap:i,defaultColor:a=`muted`,variant:o=`soft`})=>r==null||r===``?n(t,{}):n(e,{variant:o,color:(i&&i[r])??a,size:`sm`,className:`min-w-16 justify-center capitalize`,children:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g,` `)});export{r as UITableStatusDisplay};
2
+ //# sourceMappingURL=status-display-DInGGgiP.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"status-display-BUphOF18.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/status-display.tsx"],"sourcesContent":["'use client';\n\nimport { Badge } from '@/components/ui/badge';\nimport { UITableEmpty } from './empty';\n\ntype BadgeColor = 'primary' | 'secondary' | 'muted' | 'accent' | 'info' | 'success' | 'warning' | 'danger';\n\n/** Props for the {@link UITableStatusDisplay} component. */\ntype Props = {\n /** The status string to display; `null`/`undefined` renders an empty state. */\n value: string | null | undefined;\n /**\n * Maps each status string to a badge color. Any key not present in the map\n * falls back to `defaultColor`.\n */\n colorMap?: Record<string, BadgeColor>;\n /** Color used when `value` is not found in `colorMap` (default: `'muted'`). */\n defaultColor?: BadgeColor;\n /** Badge variant forwarded to the underlying {@link Badge} (default: `'soft'`). */\n variant?: 'solid' | 'soft' | 'outline';\n};\n\n/**\n * Renders a color-coded status badge for a table cell. The mapping from status\n * string to badge color is fully configurable via `colorMap`; unknown statuses\n * fall back to `defaultColor`.\n *\n * @example\n * import { UITableStatusDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableStatusDisplay\n * value=\"active\"\n * colorMap={{ active: 'success', inactive: 'danger', pending: 'warning' }}\n * />\n */\nexport const UITableStatusDisplay: React.FC<Props> = ({ value, colorMap, defaultColor = 'muted', variant = 'soft' }) => {\n if (value === null || value === undefined || value === '') return <UITableEmpty />;\n\n const color: BadgeColor = (colorMap && colorMap[value]) ?? defaultColor;\n const label = value.charAt(0).toUpperCase() + value.slice(1).replace(/_/g, ' ');\n\n return (\n <Badge variant={variant} color={color} size=\"sm\" className=\"min-w-16 justify-center capitalize\">\n {label}\n </Badge>\n );\n};\n"],"mappings":"yHAmCA,MAAa,GAAyC,CAAE,QAAO,WAAU,eAAe,QAAS,UAAU,UACrG,GAAU,MAA+B,IAAU,GAAW,EAAC,EAAD,CAAe,CAAA,EAM/E,EAAC,EAAD,CAAgB,UAAS,OAJA,GAAY,EAAS,KAAW,EAIlB,KAAK,KAAK,UAAU,qCAH/C,SAAA,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,EAAI,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAM,GAAG,CAKrE,CAAA"}
1
+ {"version":3,"file":"status-display-DInGGgiP.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/status-display.tsx"],"sourcesContent":["'use client';\n\nimport { Badge } from '@/components/ui/badge';\nimport { UITableEmpty } from './empty';\n\ntype BadgeColor = 'primary' | 'secondary' | 'muted' | 'accent' | 'info' | 'success' | 'warning' | 'danger';\n\n/** Props for the {@link UITableStatusDisplay} component. */\ntype Props = {\n /** The status string to display; `null`/`undefined` renders an empty state. */\n value: string | null | undefined;\n /**\n * Maps each status string to a badge color. Any key not present in the map\n * falls back to `defaultColor`.\n */\n colorMap?: Record<string, BadgeColor>;\n /** Color used when `value` is not found in `colorMap` (default: `'muted'`). */\n defaultColor?: BadgeColor;\n /** Badge variant forwarded to the underlying {@link Badge} (default: `'soft'`). */\n variant?: 'solid' | 'soft' | 'outline';\n};\n\n/**\n * Renders a color-coded status badge for a table cell. The mapping from status\n * string to badge color is fully configurable via `colorMap`; unknown statuses\n * fall back to `defaultColor`.\n *\n * @example\n * import { UITableStatusDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableStatusDisplay\n * value=\"active\"\n * colorMap={{ active: 'success', inactive: 'danger', pending: 'warning' }}\n * />\n */\nexport const UITableStatusDisplay: React.FC<Props> = ({ value, colorMap, defaultColor = 'muted', variant = 'soft' }) => {\n if (value === null || value === undefined || value === '') return <UITableEmpty />;\n\n const color: BadgeColor = (colorMap && colorMap[value]) ?? defaultColor;\n const label = value.charAt(0).toUpperCase() + value.slice(1).replace(/_/g, ' ');\n\n return (\n <Badge variant={variant} color={color} size=\"sm\" className=\"min-w-16 justify-center capitalize\">\n {label}\n </Badge>\n );\n};\n"],"mappings":"yHAmCA,MAAa,GAAyC,CAAE,QAAO,WAAU,eAAe,QAAS,UAAU,UACrG,GAAU,MAA+B,IAAU,GAAW,EAAC,EAAD,CAAe,CAAA,EAM/E,EAAC,EAAD,CAAgB,UAAS,OAJA,GAAY,EAAS,KAAW,EAIlB,KAAK,KAAK,UAAU,qCAH/C,SAAA,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,EAAI,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAM,GAAG,CAKrE,CAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("./ui/badge.cjs"),t=require("./tables-078i-X0d.cjs");let n=require("react/jsx-runtime");const r=({value:r,colorMap:i,defaultColor:a=`muted`,variant:o=`soft`})=>r==null||r===``?(0,n.jsx)(t.Q,{}):(0,n.jsx)(e.Badge,{variant:o,color:(i&&i[r])??a,size:`sm`,className:`min-w-16 justify-center capitalize`,children:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g,` `)});exports.UITableStatusDisplay=r;
2
- //# sourceMappingURL=status-display-o9inMVvb.cjs.map
1
+ const e=require("./ui/badge.cjs"),t=require("./tables-CS3NhgTc.cjs");let n=require("react/jsx-runtime");const r=({value:r,colorMap:i,defaultColor:a=`muted`,variant:o=`soft`})=>r==null||r===``?(0,n.jsx)(t.Q,{}):(0,n.jsx)(e.Badge,{variant:o,color:(i&&i[r])??a,size:`sm`,className:`min-w-16 justify-center capitalize`,children:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g,` `)});exports.UITableStatusDisplay=r;
2
+ //# sourceMappingURL=status-display-DpKsYvZJ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"status-display-o9inMVvb.cjs","names":["UITableEmpty","Badge"],"sources":["../packages/components/features/tables/components/atoms/status-display.tsx"],"sourcesContent":["'use client';\n\nimport { Badge } from '@/components/ui/badge';\nimport { UITableEmpty } from './empty';\n\ntype BadgeColor = 'primary' | 'secondary' | 'muted' | 'accent' | 'info' | 'success' | 'warning' | 'danger';\n\n/** Props for the {@link UITableStatusDisplay} component. */\ntype Props = {\n /** The status string to display; `null`/`undefined` renders an empty state. */\n value: string | null | undefined;\n /**\n * Maps each status string to a badge color. Any key not present in the map\n * falls back to `defaultColor`.\n */\n colorMap?: Record<string, BadgeColor>;\n /** Color used when `value` is not found in `colorMap` (default: `'muted'`). */\n defaultColor?: BadgeColor;\n /** Badge variant forwarded to the underlying {@link Badge} (default: `'soft'`). */\n variant?: 'solid' | 'soft' | 'outline';\n};\n\n/**\n * Renders a color-coded status badge for a table cell. The mapping from status\n * string to badge color is fully configurable via `colorMap`; unknown statuses\n * fall back to `defaultColor`.\n *\n * @example\n * import { UITableStatusDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableStatusDisplay\n * value=\"active\"\n * colorMap={{ active: 'success', inactive: 'danger', pending: 'warning' }}\n * />\n */\nexport const UITableStatusDisplay: React.FC<Props> = ({ value, colorMap, defaultColor = 'muted', variant = 'soft' }) => {\n if (value === null || value === undefined || value === '') return <UITableEmpty />;\n\n const color: BadgeColor = (colorMap && colorMap[value]) ?? defaultColor;\n const label = value.charAt(0).toUpperCase() + value.slice(1).replace(/_/g, ' ');\n\n return (\n <Badge variant={variant} color={color} size=\"sm\" className=\"min-w-16 justify-center capitalize\">\n {label}\n </Badge>\n );\n};\n"],"mappings":"wGAmCA,MAAa,GAAyC,CAAE,QAAO,WAAU,eAAe,QAAS,UAAU,UACrG,GAAU,MAA+B,IAAU,IAAW,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,GAM/E,EAAA,EAAA,IAAA,CAACC,EAAAA,MAAD,CAAgB,UAAS,OAJA,GAAY,EAAS,KAAW,EAIlB,KAAK,KAAK,UAAU,qCAH/C,SAAA,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,EAAI,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAM,GAAG,CAKrE,CAAA"}
1
+ {"version":3,"file":"status-display-DpKsYvZJ.cjs","names":["UITableEmpty","Badge"],"sources":["../packages/components/features/tables/components/atoms/status-display.tsx"],"sourcesContent":["'use client';\n\nimport { Badge } from '@/components/ui/badge';\nimport { UITableEmpty } from './empty';\n\ntype BadgeColor = 'primary' | 'secondary' | 'muted' | 'accent' | 'info' | 'success' | 'warning' | 'danger';\n\n/** Props for the {@link UITableStatusDisplay} component. */\ntype Props = {\n /** The status string to display; `null`/`undefined` renders an empty state. */\n value: string | null | undefined;\n /**\n * Maps each status string to a badge color. Any key not present in the map\n * falls back to `defaultColor`.\n */\n colorMap?: Record<string, BadgeColor>;\n /** Color used when `value` is not found in `colorMap` (default: `'muted'`). */\n defaultColor?: BadgeColor;\n /** Badge variant forwarded to the underlying {@link Badge} (default: `'soft'`). */\n variant?: 'solid' | 'soft' | 'outline';\n};\n\n/**\n * Renders a color-coded status badge for a table cell. The mapping from status\n * string to badge color is fully configurable via `colorMap`; unknown statuses\n * fall back to `defaultColor`.\n *\n * @example\n * import { UITableStatusDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableStatusDisplay\n * value=\"active\"\n * colorMap={{ active: 'success', inactive: 'danger', pending: 'warning' }}\n * />\n */\nexport const UITableStatusDisplay: React.FC<Props> = ({ value, colorMap, defaultColor = 'muted', variant = 'soft' }) => {\n if (value === null || value === undefined || value === '') return <UITableEmpty />;\n\n const color: BadgeColor = (colorMap && colorMap[value]) ?? defaultColor;\n const label = value.charAt(0).toUpperCase() + value.slice(1).replace(/_/g, ' ');\n\n return (\n <Badge variant={variant} color={color} size=\"sm\" className=\"min-w-16 justify-center capitalize\">\n {label}\n </Badge>\n );\n};\n"],"mappings":"wGAmCA,MAAa,GAAyC,CAAE,QAAO,WAAU,eAAe,QAAS,UAAU,UACrG,GAAU,MAA+B,IAAU,IAAW,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,GAM/E,EAAA,EAAA,IAAA,CAACC,EAAAA,MAAD,CAAgB,UAAS,OAJA,GAAY,EAAS,KAAW,EAIlB,KAAK,KAAK,UAAU,qCAH/C,SAAA,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,EAAI,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAM,GAAG,CAKrE,CAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("./data-display/statistic.cjs"),t=require("./tables-078i-X0d.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a={up:`bg-success`,down:`bg-danger`,neutral:`bg-primary`},o=(0,n.memo)(()=>{let{summary:n,onSummaryItemClick:o}=t.Y(),{isOpen:s}=t.Z();return!s||!n||n.length===0?null:(0,i.jsx)(`div`,{"data-slot":`table-summary-bar`,className:`w-full overflow-x-auto px-2 pb-1`,children:(0,i.jsx)(`div`,{className:`grid gap-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(200px, 240px))`},children:n.map(t=>{let n=a[t.trend??`neutral`],s=!!o;return(0,i.jsxs)(`div`,{className:(0,r.cn)(`flex flex-col overflow-hidden rounded border border-border bg-card shadow-card`,s&&`cursor-pointer transition-shadow hover:shadow-md`),onClick:s?()=>o(t):void 0,role:s?`button`:void 0,tabIndex:s?0:void 0,onKeyDown:s?e=>{(e.key===`Enter`||e.key===` `)&&o(t)}:void 0,children:[(0,i.jsx)(`div`,{className:(0,r.cn)(`h-0.75 w-full shrink-0`,n)}),(0,i.jsxs)(`div`,{className:`flex flex-1 flex-col gap-2 px-5 py-4`,children:[(0,i.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-text-positive-weak`,children:t.label}),t.value!==null&&t.value!==void 0?(0,i.jsx)(e.Statistic,{value:t.value,prefix:t.prefix,suffix:t.suffix,precision:t.precision,trend:t.trend,size:`xl`,className:`font-bold`}):(0,i.jsx)(`span`,{className:`text-xl font-bold tabular-nums text-text-positive-strong`,children:`—`}),t.description&&(0,i.jsx)(`span`,{className:`text-xs text-text-positive-weak`,children:t.description})]})]},t.label)})})})});o.displayName=`UITableSummaryBar`,exports.UITableSummaryBar=o;
2
- //# sourceMappingURL=summary-bar-Mb1B9Dnf.cjs.map
1
+ const e=require("./data-display/statistic.cjs"),t=require("./tables-CS3NhgTc.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a={up:`bg-success`,down:`bg-danger`,neutral:`bg-primary`},o=(0,n.memo)(()=>{let{summary:n,onSummaryItemClick:o}=t.Y(),{isOpen:s}=t.Z();return!s||!n||n.length===0?null:(0,i.jsx)(`div`,{"data-slot":`table-summary-bar`,className:`w-full overflow-x-auto px-2 pb-1`,children:(0,i.jsx)(`div`,{className:`grid gap-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(200px, 240px))`},children:n.map(t=>{let n=a[t.trend??`neutral`],s=!!o;return(0,i.jsxs)(`div`,{className:(0,r.cn)(`flex flex-col overflow-hidden rounded border border-border bg-card shadow-card`,s&&`cursor-pointer transition-shadow hover:shadow-md`),onClick:s?()=>o(t):void 0,role:s?`button`:void 0,tabIndex:s?0:void 0,onKeyDown:s?e=>{(e.key===`Enter`||e.key===` `)&&o(t)}:void 0,children:[(0,i.jsx)(`div`,{className:(0,r.cn)(`h-0.75 w-full shrink-0`,n)}),(0,i.jsxs)(`div`,{className:`flex flex-1 flex-col gap-2 px-5 py-4`,children:[(0,i.jsx)(`span`,{className:`font-semibold text-[11px] text-text-positive-weak uppercase tracking-widest`,children:t.label}),t.value!==null&&t.value!==void 0?(0,i.jsx)(e.Statistic,{value:t.value,prefix:t.prefix,suffix:t.suffix,precision:t.precision,trend:t.trend,size:`xl`,className:`font-bold`}):(0,i.jsx)(`span`,{className:`font-bold text-text-positive-strong text-xl tabular-nums`,children:`—`}),!!t.description&&(0,i.jsx)(`span`,{className:`text-text-positive-weak text-xs`,children:t.description})]})]},t.label)})})})});o.displayName=`UITableSummaryBar`,exports.UITableSummaryBar=o;
2
+ //# sourceMappingURL=summary-bar-DKZh-VSB.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"summary-bar-Mb1B9Dnf.cjs","names":["useUITableContext","useUITableSummaryContext","Statistic"],"sources":["../packages/components/features/tables/components/table/summary-bar.tsx"],"sourcesContent":["'use client';\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Statistic } from '@/components/data-display/statistic';\nimport { useUITableContext, useUITableSummaryContext } from '../../hooks/use-context';\nimport type { SummaryItem } from '../../types';\n\nconst trendAccent: Record<NonNullable<SummaryItem['trend']>, string> = {\n up: 'bg-success',\n down: 'bg-danger',\n neutral: 'bg-primary',\n};\n\nexport const UITableSummaryBar = memo(() => {\n const { summary, onSummaryItemClick } = useUITableContext();\n const { isOpen } = useUITableSummaryContext();\n\n if (!isOpen || !summary || summary.length === 0) return null;\n\n return (\n <div data-slot=\"table-summary-bar\" className=\"w-full overflow-x-auto px-2 pb-1\">\n <div className=\"grid gap-3\" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 240px))' }}>\n {summary.map(item => {\n const accent = trendAccent[item.trend ?? 'neutral'];\n const isClickable = !!onSummaryItemClick;\n\n return (\n <div\n key={item.label}\n className={cn(\n 'flex flex-col overflow-hidden rounded border border-border bg-card shadow-card',\n isClickable && 'cursor-pointer transition-shadow hover:shadow-md'\n )}\n onClick={isClickable ? () => onSummaryItemClick(item) : undefined}\n role={isClickable ? 'button' : undefined}\n tabIndex={isClickable ? 0 : undefined}\n onKeyDown={\n isClickable\n ? e => {\n if (e.key === 'Enter' || e.key === ' ') onSummaryItemClick(item);\n }\n : undefined\n }\n >\n {/* Coloured accent strip */}\n <div className={cn('h-0.75 w-full shrink-0', accent)} />\n\n <div className=\"flex flex-1 flex-col gap-2 px-5 py-4\">\n {/* Label */}\n <span className=\"text-[11px] font-semibold uppercase tracking-widest text-text-positive-weak\">{item.label}</span>\n\n {/* Value */}\n {item.value !== null && item.value !== undefined ? (\n <Statistic\n value={item.value}\n prefix={item.prefix}\n suffix={item.suffix}\n precision={item.precision}\n trend={item.trend}\n size=\"xl\"\n className=\"font-bold\"\n />\n ) : (\n <span className=\"text-xl font-bold tabular-nums text-text-positive-strong\">—</span>\n )}\n\n {/* Description */}\n {item.description && <span className=\"text-xs text-text-positive-weak\">{item.description}</span>}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n});\nUITableSummaryBar.displayName = 'UITableSummaryBar';\n"],"mappings":"qLASA,MAAM,EAAiE,CACrE,GAAI,aACJ,KAAM,YACN,QAAS,YACX,EAEa,GAAA,EAAA,EAAA,KAAA,KAA+B,CAC1C,GAAM,CAAE,UAAS,sBAAuBA,EAAAA,EAAkB,EACpD,CAAE,UAAWC,EAAAA,EAAyB,EAI5C,MAFI,CAAC,GAAU,CAAC,GAAW,EAAQ,SAAW,EAAU,MAGtD,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,oBAAoB,UAAU,mCAC3C,UAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,aAAa,MAAO,CAAE,oBAAqB,yCAA0C,EACjG,SAAA,EAAQ,IAAI,GAAQ,CACnB,IAAM,EAAS,EAAY,EAAK,OAAS,WACnC,EAAc,CAAC,CAAC,EAEtB,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAEE,WAAA,EAAA,EAAA,GAAA,CACE,iFACA,GAAe,kDACjB,EACA,QAAS,MAAoB,EAAmB,CAAI,EAAI,IAAA,GACxD,KAAM,EAAc,SAAW,IAAA,GAC/B,SAAU,EAAc,EAAI,IAAA,GAC5B,UACE,EACI,GAAK,EACC,EAAE,MAAQ,SAAW,EAAE,MAAQ,MAAK,EAAmB,CAAI,CACjE,EACA,IAAA,GAdR,SAAA,EAkBE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,WAAA,EAAA,EAAA,GAAA,CAAc,yBAA0B,CAAM,CAAI,CAAA,GAEvD,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,uCAAf,SAAA,EAEE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,8EAA+E,SAAA,EAAK,KAAY,CAAA,EAG/G,EAAK,QAAU,MAAQ,EAAK,QAAU,IAAA,IACrC,EAAA,EAAA,IAAA,CAACC,EAAAA,UAAD,CACE,MAAO,EAAK,MACZ,OAAQ,EAAK,OACb,OAAQ,EAAK,OACb,UAAW,EAAK,UAChB,MAAO,EAAK,MACZ,KAAK,KACL,UAAU,WACX,CAAA,GAED,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2DAA2D,SAAA,GAAO,CAAA,EAInF,EAAK,cAAe,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,kCAAmC,SAAA,EAAK,WAAkB,CAAA,CAC5F,CACF,CAAA,CAAA,CAzCE,EAAA,EAAK,KAyCP,CAET,CAAC,CACE,CAAA,CACF,CAAA,CAET,CAAC,EACD,EAAkB,YAAc"}
1
+ {"version":3,"file":"summary-bar-DKZh-VSB.cjs","names":["useUITableContext","useUITableSummaryContext","Statistic"],"sources":["../packages/components/features/tables/components/table/summary-bar.tsx"],"sourcesContent":["'use client';\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Statistic } from '@/components/data-display/statistic';\nimport { useUITableContext, useUITableSummaryContext } from '../../hooks/use-context';\nimport type { SummaryItem } from '../../types';\n\nconst trendAccent: Record<NonNullable<SummaryItem['trend']>, string> = {\n up: 'bg-success',\n down: 'bg-danger',\n neutral: 'bg-primary',\n};\n\nexport const UITableSummaryBar = memo(() => {\n const { summary, onSummaryItemClick } = useUITableContext();\n const { isOpen } = useUITableSummaryContext();\n\n if (!isOpen || !summary || summary.length === 0) return null;\n\n return (\n <div data-slot=\"table-summary-bar\" className=\"w-full overflow-x-auto px-2 pb-1\">\n <div className=\"grid gap-3\" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 240px))' }}>\n {summary.map(item => {\n const accent = trendAccent[item.trend ?? 'neutral'];\n const isClickable = !!onSummaryItemClick;\n\n return (\n <div\n key={item.label}\n className={cn(\n 'flex flex-col overflow-hidden rounded border border-border bg-card shadow-card',\n isClickable && 'cursor-pointer transition-shadow hover:shadow-md'\n )}\n onClick={isClickable ? () => onSummaryItemClick(item) : undefined}\n role={isClickable ? 'button' : undefined}\n tabIndex={isClickable ? 0 : undefined}\n onKeyDown={\n isClickable\n ? e => {\n if (e.key === 'Enter' || e.key === ' ') onSummaryItemClick(item);\n }\n : undefined\n }\n >\n {/* Coloured accent strip */}\n <div className={cn('h-0.75 w-full shrink-0', accent)} />\n\n <div className=\"flex flex-1 flex-col gap-2 px-5 py-4\">\n {/* Label */}\n <span className=\"font-semibold text-[11px] text-text-positive-weak uppercase tracking-widest\">{item.label}</span>\n\n {/* Value */}\n {item.value !== null && item.value !== undefined ? (\n <Statistic\n value={item.value}\n prefix={item.prefix}\n suffix={item.suffix}\n precision={item.precision}\n trend={item.trend}\n size=\"xl\"\n className=\"font-bold\"\n />\n ) : (\n <span className=\"font-bold text-text-positive-strong text-xl tabular-nums\">—</span>\n )}\n\n {/* Description */}\n {!!item.description && <span className=\"text-text-positive-weak text-xs\">{item.description}</span>}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n});\nUITableSummaryBar.displayName = 'UITableSummaryBar';\n"],"mappings":"qLASA,MAAM,EAAiE,CACrE,GAAI,aACJ,KAAM,YACN,QAAS,YACX,EAEa,GAAA,EAAA,EAAA,KAAA,KAA+B,CAC1C,GAAM,CAAE,UAAS,sBAAuBA,EAAAA,EAAkB,EACpD,CAAE,UAAWC,EAAAA,EAAyB,EAI5C,MAFI,CAAC,GAAU,CAAC,GAAW,EAAQ,SAAW,EAAU,MAGtD,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,oBAAoB,UAAU,mCAC3C,UAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,aAAa,MAAO,CAAE,oBAAqB,yCAA0C,EACjG,SAAA,EAAQ,IAAI,GAAQ,CACnB,IAAM,EAAS,EAAY,EAAK,OAAS,WACnC,EAAc,CAAC,CAAC,EAEtB,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAEE,WAAA,EAAA,EAAA,GAAA,CACE,iFACA,GAAe,kDACjB,EACA,QAAS,MAAoB,EAAmB,CAAI,EAAI,IAAA,GACxD,KAAM,EAAc,SAAW,IAAA,GAC/B,SAAU,EAAc,EAAI,IAAA,GAC5B,UACE,EACI,GAAK,EACC,EAAE,MAAQ,SAAW,EAAE,MAAQ,MAAK,EAAmB,CAAI,CACjE,EACA,IAAA,GAdR,SAAA,EAkBE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,WAAA,EAAA,EAAA,GAAA,CAAc,yBAA0B,CAAM,CAAI,CAAA,GAEvD,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,uCAAf,SAAA,EAEE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,8EAA+E,SAAA,EAAK,KAAY,CAAA,EAG/G,EAAK,QAAU,MAAQ,EAAK,QAAU,IAAA,IACrC,EAAA,EAAA,IAAA,CAACC,EAAAA,UAAD,CACE,MAAO,EAAK,MACZ,OAAQ,EAAK,OACb,OAAQ,EAAK,OACb,UAAW,EAAK,UAChB,MAAO,EAAK,MACZ,KAAK,KACL,UAAU,WACX,CAAA,GAED,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2DAA2D,SAAA,GAAO,CAAA,EAInF,CAAC,CAAC,EAAK,cAAe,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,kCAAmC,SAAA,EAAK,WAAkB,CAAA,CAC9F,CACF,CAAA,CAAA,CAzCE,EAAA,EAAK,KAyCP,CAET,CAAC,CACE,CAAA,CACF,CAAA,CAET,CAAC,EACD,EAAkB,YAAc"}
@@ -1,2 +1,2 @@
1
- import{Statistic as e}from"./data-display/statistic.mjs";import{Y as t,Z as n}from"./tables-BGzwkdFO.mjs";import{memo as r}from"react";import{cn as i}from"@customafk/react-toolkit/utils";import{jsx as a,jsxs as o}from"react/jsx-runtime";const s={up:`bg-success`,down:`bg-danger`,neutral:`bg-primary`},c=r(()=>{let{summary:r,onSummaryItemClick:c}=t(),{isOpen:l}=n();return!l||!r||r.length===0?null:a(`div`,{"data-slot":`table-summary-bar`,className:`w-full overflow-x-auto px-2 pb-1`,children:a(`div`,{className:`grid gap-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(200px, 240px))`},children:r.map(t=>{let n=s[t.trend??`neutral`],r=!!c;return o(`div`,{className:i(`flex flex-col overflow-hidden rounded border border-border bg-card shadow-card`,r&&`cursor-pointer transition-shadow hover:shadow-md`),onClick:r?()=>c(t):void 0,role:r?`button`:void 0,tabIndex:r?0:void 0,onKeyDown:r?e=>{(e.key===`Enter`||e.key===` `)&&c(t)}:void 0,children:[a(`div`,{className:i(`h-0.75 w-full shrink-0`,n)}),o(`div`,{className:`flex flex-1 flex-col gap-2 px-5 py-4`,children:[a(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-text-positive-weak`,children:t.label}),t.value!==null&&t.value!==void 0?a(e,{value:t.value,prefix:t.prefix,suffix:t.suffix,precision:t.precision,trend:t.trend,size:`xl`,className:`font-bold`}):a(`span`,{className:`text-xl font-bold tabular-nums text-text-positive-strong`,children:`—`}),t.description&&a(`span`,{className:`text-xs text-text-positive-weak`,children:t.description})]})]},t.label)})})})});c.displayName=`UITableSummaryBar`;export{c as UITableSummaryBar};
2
- //# sourceMappingURL=summary-bar-CYfgdxrQ.mjs.map
1
+ import{Statistic as e}from"./data-display/statistic.mjs";import{Y as t,Z as n}from"./tables-7_KgoyS-.mjs";import{memo as r}from"react";import{cn as i}from"@customafk/react-toolkit/utils";import{jsx as a,jsxs as o}from"react/jsx-runtime";const s={up:`bg-success`,down:`bg-danger`,neutral:`bg-primary`},c=r(()=>{let{summary:r,onSummaryItemClick:c}=t(),{isOpen:l}=n();return!l||!r||r.length===0?null:a(`div`,{"data-slot":`table-summary-bar`,className:`w-full overflow-x-auto px-2 pb-1`,children:a(`div`,{className:`grid gap-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(200px, 240px))`},children:r.map(t=>{let n=s[t.trend??`neutral`],r=!!c;return o(`div`,{className:i(`flex flex-col overflow-hidden rounded border border-border bg-card shadow-card`,r&&`cursor-pointer transition-shadow hover:shadow-md`),onClick:r?()=>c(t):void 0,role:r?`button`:void 0,tabIndex:r?0:void 0,onKeyDown:r?e=>{(e.key===`Enter`||e.key===` `)&&c(t)}:void 0,children:[a(`div`,{className:i(`h-0.75 w-full shrink-0`,n)}),o(`div`,{className:`flex flex-1 flex-col gap-2 px-5 py-4`,children:[a(`span`,{className:`font-semibold text-[11px] text-text-positive-weak uppercase tracking-widest`,children:t.label}),t.value!==null&&t.value!==void 0?a(e,{value:t.value,prefix:t.prefix,suffix:t.suffix,precision:t.precision,trend:t.trend,size:`xl`,className:`font-bold`}):a(`span`,{className:`font-bold text-text-positive-strong text-xl tabular-nums`,children:`—`}),!!t.description&&a(`span`,{className:`text-text-positive-weak text-xs`,children:t.description})]})]},t.label)})})})});c.displayName=`UITableSummaryBar`;export{c as UITableSummaryBar};
2
+ //# sourceMappingURL=summary-bar-DX_sOiuL.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"summary-bar-CYfgdxrQ.mjs","names":[],"sources":["../packages/components/features/tables/components/table/summary-bar.tsx"],"sourcesContent":["'use client';\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Statistic } from '@/components/data-display/statistic';\nimport { useUITableContext, useUITableSummaryContext } from '../../hooks/use-context';\nimport type { SummaryItem } from '../../types';\n\nconst trendAccent: Record<NonNullable<SummaryItem['trend']>, string> = {\n up: 'bg-success',\n down: 'bg-danger',\n neutral: 'bg-primary',\n};\n\nexport const UITableSummaryBar = memo(() => {\n const { summary, onSummaryItemClick } = useUITableContext();\n const { isOpen } = useUITableSummaryContext();\n\n if (!isOpen || !summary || summary.length === 0) return null;\n\n return (\n <div data-slot=\"table-summary-bar\" className=\"w-full overflow-x-auto px-2 pb-1\">\n <div className=\"grid gap-3\" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 240px))' }}>\n {summary.map(item => {\n const accent = trendAccent[item.trend ?? 'neutral'];\n const isClickable = !!onSummaryItemClick;\n\n return (\n <div\n key={item.label}\n className={cn(\n 'flex flex-col overflow-hidden rounded border border-border bg-card shadow-card',\n isClickable && 'cursor-pointer transition-shadow hover:shadow-md'\n )}\n onClick={isClickable ? () => onSummaryItemClick(item) : undefined}\n role={isClickable ? 'button' : undefined}\n tabIndex={isClickable ? 0 : undefined}\n onKeyDown={\n isClickable\n ? e => {\n if (e.key === 'Enter' || e.key === ' ') onSummaryItemClick(item);\n }\n : undefined\n }\n >\n {/* Coloured accent strip */}\n <div className={cn('h-0.75 w-full shrink-0', accent)} />\n\n <div className=\"flex flex-1 flex-col gap-2 px-5 py-4\">\n {/* Label */}\n <span className=\"text-[11px] font-semibold uppercase tracking-widest text-text-positive-weak\">{item.label}</span>\n\n {/* Value */}\n {item.value !== null && item.value !== undefined ? (\n <Statistic\n value={item.value}\n prefix={item.prefix}\n suffix={item.suffix}\n precision={item.precision}\n trend={item.trend}\n size=\"xl\"\n className=\"font-bold\"\n />\n ) : (\n <span className=\"text-xl font-bold tabular-nums text-text-positive-strong\">—</span>\n )}\n\n {/* Description */}\n {item.description && <span className=\"text-xs text-text-positive-weak\">{item.description}</span>}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n});\nUITableSummaryBar.displayName = 'UITableSummaryBar';\n"],"mappings":"6OASA,MAAM,EAAiE,CACrE,GAAI,aACJ,KAAM,YACN,QAAS,YACX,EAEa,EAAoB,MAAW,CAC1C,GAAM,CAAE,UAAS,sBAAuB,EAAkB,EACpD,CAAE,UAAW,EAAyB,EAI5C,MAFI,CAAC,GAAU,CAAC,GAAW,EAAQ,SAAW,EAAU,KAGtD,EAAC,MAAD,CAAK,YAAU,oBAAoB,UAAU,mCAC3C,SAAA,EAAC,MAAD,CAAK,UAAU,aAAa,MAAO,CAAE,oBAAqB,yCAA0C,EACjG,SAAA,EAAQ,IAAI,GAAQ,CACnB,IAAM,EAAS,EAAY,EAAK,OAAS,WACnC,EAAc,CAAC,CAAC,EAEtB,OACE,EAAC,MAAD,CAEE,UAAW,EACT,iFACA,GAAe,kDACjB,EACA,QAAS,MAAoB,EAAmB,CAAI,EAAI,IAAA,GACxD,KAAM,EAAc,SAAW,IAAA,GAC/B,SAAU,EAAc,EAAI,IAAA,GAC5B,UACE,EACI,GAAK,EACC,EAAE,MAAQ,SAAW,EAAE,MAAQ,MAAK,EAAmB,CAAI,CACjE,EACA,IAAA,GAdR,SAAA,CAkBE,EAAC,MAAD,CAAK,UAAW,EAAG,yBAA0B,CAAM,CAAI,CAAA,EAEvD,EAAC,MAAD,CAAK,UAAU,uCAAf,SAAA,CAEE,EAAC,OAAD,CAAM,UAAU,8EAA+E,SAAA,EAAK,KAAY,CAAA,EAG/G,EAAK,QAAU,MAAQ,EAAK,QAAU,IAAA,GACrC,EAAC,EAAD,CACE,MAAO,EAAK,MACZ,OAAQ,EAAK,OACb,OAAQ,EAAK,OACb,UAAW,EAAK,UAChB,MAAO,EAAK,MACZ,KAAK,KACL,UAAU,WACX,CAAA,EAED,EAAC,OAAD,CAAM,UAAU,2DAA2D,SAAA,GAAO,CAAA,EAInF,EAAK,aAAe,EAAC,OAAD,CAAM,UAAU,kCAAmC,SAAA,EAAK,WAAkB,CAAA,CAC5F,CACF,CAAA,CAAA,CAzCE,EAAA,EAAK,KAyCP,CAET,CAAC,CACE,CAAA,CACF,CAAA,CAET,CAAC,EACD,EAAkB,YAAc"}
1
+ {"version":3,"file":"summary-bar-DX_sOiuL.mjs","names":[],"sources":["../packages/components/features/tables/components/table/summary-bar.tsx"],"sourcesContent":["'use client';\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Statistic } from '@/components/data-display/statistic';\nimport { useUITableContext, useUITableSummaryContext } from '../../hooks/use-context';\nimport type { SummaryItem } from '../../types';\n\nconst trendAccent: Record<NonNullable<SummaryItem['trend']>, string> = {\n up: 'bg-success',\n down: 'bg-danger',\n neutral: 'bg-primary',\n};\n\nexport const UITableSummaryBar = memo(() => {\n const { summary, onSummaryItemClick } = useUITableContext();\n const { isOpen } = useUITableSummaryContext();\n\n if (!isOpen || !summary || summary.length === 0) return null;\n\n return (\n <div data-slot=\"table-summary-bar\" className=\"w-full overflow-x-auto px-2 pb-1\">\n <div className=\"grid gap-3\" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 240px))' }}>\n {summary.map(item => {\n const accent = trendAccent[item.trend ?? 'neutral'];\n const isClickable = !!onSummaryItemClick;\n\n return (\n <div\n key={item.label}\n className={cn(\n 'flex flex-col overflow-hidden rounded border border-border bg-card shadow-card',\n isClickable && 'cursor-pointer transition-shadow hover:shadow-md'\n )}\n onClick={isClickable ? () => onSummaryItemClick(item) : undefined}\n role={isClickable ? 'button' : undefined}\n tabIndex={isClickable ? 0 : undefined}\n onKeyDown={\n isClickable\n ? e => {\n if (e.key === 'Enter' || e.key === ' ') onSummaryItemClick(item);\n }\n : undefined\n }\n >\n {/* Coloured accent strip */}\n <div className={cn('h-0.75 w-full shrink-0', accent)} />\n\n <div className=\"flex flex-1 flex-col gap-2 px-5 py-4\">\n {/* Label */}\n <span className=\"font-semibold text-[11px] text-text-positive-weak uppercase tracking-widest\">{item.label}</span>\n\n {/* Value */}\n {item.value !== null && item.value !== undefined ? (\n <Statistic\n value={item.value}\n prefix={item.prefix}\n suffix={item.suffix}\n precision={item.precision}\n trend={item.trend}\n size=\"xl\"\n className=\"font-bold\"\n />\n ) : (\n <span className=\"font-bold text-text-positive-strong text-xl tabular-nums\">—</span>\n )}\n\n {/* Description */}\n {!!item.description && <span className=\"text-text-positive-weak text-xs\">{item.description}</span>}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n});\nUITableSummaryBar.displayName = 'UITableSummaryBar';\n"],"mappings":"6OASA,MAAM,EAAiE,CACrE,GAAI,aACJ,KAAM,YACN,QAAS,YACX,EAEa,EAAoB,MAAW,CAC1C,GAAM,CAAE,UAAS,sBAAuB,EAAkB,EACpD,CAAE,UAAW,EAAyB,EAI5C,MAFI,CAAC,GAAU,CAAC,GAAW,EAAQ,SAAW,EAAU,KAGtD,EAAC,MAAD,CAAK,YAAU,oBAAoB,UAAU,mCAC3C,SAAA,EAAC,MAAD,CAAK,UAAU,aAAa,MAAO,CAAE,oBAAqB,yCAA0C,EACjG,SAAA,EAAQ,IAAI,GAAQ,CACnB,IAAM,EAAS,EAAY,EAAK,OAAS,WACnC,EAAc,CAAC,CAAC,EAEtB,OACE,EAAC,MAAD,CAEE,UAAW,EACT,iFACA,GAAe,kDACjB,EACA,QAAS,MAAoB,EAAmB,CAAI,EAAI,IAAA,GACxD,KAAM,EAAc,SAAW,IAAA,GAC/B,SAAU,EAAc,EAAI,IAAA,GAC5B,UACE,EACI,GAAK,EACC,EAAE,MAAQ,SAAW,EAAE,MAAQ,MAAK,EAAmB,CAAI,CACjE,EACA,IAAA,GAdR,SAAA,CAkBE,EAAC,MAAD,CAAK,UAAW,EAAG,yBAA0B,CAAM,CAAI,CAAA,EAEvD,EAAC,MAAD,CAAK,UAAU,uCAAf,SAAA,CAEE,EAAC,OAAD,CAAM,UAAU,8EAA+E,SAAA,EAAK,KAAY,CAAA,EAG/G,EAAK,QAAU,MAAQ,EAAK,QAAU,IAAA,GACrC,EAAC,EAAD,CACE,MAAO,EAAK,MACZ,OAAQ,EAAK,OACb,OAAQ,EAAK,OACb,UAAW,EAAK,UAChB,MAAO,EAAK,MACZ,KAAK,KACL,UAAU,WACX,CAAA,EAED,EAAC,OAAD,CAAM,UAAU,2DAA2D,SAAA,GAAO,CAAA,EAInF,CAAC,CAAC,EAAK,aAAe,EAAC,OAAD,CAAM,UAAU,kCAAmC,SAAA,EAAK,WAAkB,CAAA,CAC9F,CACF,CAAA,CAAA,CAzCE,EAAA,EAAK,KAyCP,CAET,CAAC,CACE,CAAA,CACF,CAAA,CAET,CAAC,EACD,EAAkB,YAAc"}