@customafk/lunas-ui 0.2.80 → 0.2.82

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 (137) hide show
  1. package/dist/{analysis-panel-Bg0lCfWv.cjs → analysis-panel-BoKjkPYz.cjs} +2 -2
  2. package/dist/{analysis-panel-Bg0lCfWv.cjs.map → analysis-panel-BoKjkPYz.cjs.map} +1 -1
  3. package/dist/{analysis-panel-Cop-l4lx.mjs → analysis-panel-CZ8g9AAO.mjs} +2 -2
  4. package/dist/{analysis-panel-Cop-l4lx.mjs.map → analysis-panel-CZ8g9AAO.mjs.map} +1 -1
  5. package/dist/{badge-display-B0BKsU9T.mjs → badge-display-B5m09_Hs.mjs} +2 -2
  6. package/dist/{badge-display-B0BKsU9T.mjs.map → badge-display-B5m09_Hs.mjs.map} +1 -1
  7. package/dist/{badge-display-Dv2UTvzp.cjs → badge-display-DHbCN998.cjs} +2 -2
  8. package/dist/{badge-display-Dv2UTvzp.cjs.map → badge-display-DHbCN998.cjs.map} +1 -1
  9. package/dist/{boolean-display-CMX5AupA.mjs → boolean-display-CzHHDfHW.mjs} +2 -2
  10. package/dist/{boolean-display-CMX5AupA.mjs.map → boolean-display-CzHHDfHW.mjs.map} +1 -1
  11. package/dist/{boolean-display-CPX7H39m.cjs → boolean-display-D2wjQhNX.cjs} +2 -2
  12. package/dist/{boolean-display-CPX7H39m.cjs.map → boolean-display-D2wjQhNX.cjs.map} +1 -1
  13. package/dist/currency-display-7w-ZjVUw.mjs +2 -0
  14. package/dist/currency-display-7w-ZjVUw.mjs.map +1 -0
  15. package/dist/currency-display-B06kc2IG.cjs +2 -0
  16. package/dist/currency-display-B06kc2IG.cjs.map +1 -0
  17. package/dist/{date-display-YE8NIIrl.mjs → date-display-BO7OY_AC.mjs} +2 -2
  18. package/dist/{date-display-YE8NIIrl.mjs.map → date-display-BO7OY_AC.mjs.map} +1 -1
  19. package/dist/{date-display-DMPhFq8v.cjs → date-display-DHnZr_yf.cjs} +2 -2
  20. package/dist/{date-display-DMPhFq8v.cjs.map → date-display-DHnZr_yf.cjs.map} +1 -1
  21. package/dist/{description-display-B4KoH6ql.mjs → description-display-CBfoP3Y2.mjs} +2 -2
  22. package/dist/{description-display-B4KoH6ql.mjs.map → description-display-CBfoP3Y2.mjs.map} +1 -1
  23. package/dist/{description-display-jmAaeMBD.cjs → description-display-Cckihd1s.cjs} +2 -2
  24. package/dist/{description-display-jmAaeMBD.cjs.map → description-display-Cckihd1s.cjs.map} +1 -1
  25. package/dist/dialogs/side-panel.cjs +2 -0
  26. package/dist/dialogs/side-panel.cjs.map +1 -0
  27. package/dist/dialogs/side-panel.d.cts +2 -0
  28. package/dist/dialogs/side-panel.d.mts +2 -0
  29. package/dist/dialogs/side-panel.mjs +2 -0
  30. package/dist/dialogs/side-panel.mjs.map +1 -0
  31. package/dist/{email-display-D_k7AUmp.mjs → email-display-Bk_furIx.mjs} +2 -2
  32. package/dist/{email-display-D_k7AUmp.mjs.map → email-display-Bk_furIx.mjs.map} +1 -1
  33. package/dist/{email-display-CzvqQMhG.cjs → email-display-w-hRYIeL.cjs} +2 -2
  34. package/dist/{email-display-CzvqQMhG.cjs.map → email-display-w-hRYIeL.cjs.map} +1 -1
  35. package/dist/features/tables/index.cjs +1 -1
  36. package/dist/features/tables/index.d.cts +1 -1
  37. package/dist/features/tables/index.d.mts +1 -1
  38. package/dist/features/tables/index.mjs +1 -1
  39. package/dist/filter-BO7ISTIR.mjs +2 -0
  40. package/dist/{filter-BCNjqiBx.mjs.map → filter-BO7ISTIR.mjs.map} +1 -1
  41. package/dist/filter-CQ9BD0MV.cjs +2 -0
  42. package/dist/{filter-B5EnnL9I.cjs.map → filter-CQ9BD0MV.cjs.map} +1 -1
  43. package/dist/{flex-CIzZIICK.d.cts → flex-CrxTaAXE.d.cts} +2 -2
  44. package/dist/{flex-CIzZIICK.d.mts → flex-CrxTaAXE.d.mts} +2 -2
  45. package/dist/{index-DiloQ0Ev.d.mts → index-BPo-Lg3p.d.mts} +7 -3
  46. package/dist/{index-DmrQBf4E.d.cts → index-DaLpXe5l.d.cts} +7 -3
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.d.cts +6 -4
  49. package/dist/index.d.mts +6 -4
  50. package/dist/index.mjs +1 -1
  51. package/dist/layouts/flex.d.cts +1 -1
  52. package/dist/layouts/flex.d.mts +1 -1
  53. package/dist/layouts/ui-grid.cjs +2 -0
  54. package/dist/layouts/ui-grid.cjs.map +1 -0
  55. package/dist/layouts/ui-grid.d.cts +2 -0
  56. package/dist/layouts/ui-grid.d.mts +2 -0
  57. package/dist/layouts/ui-grid.mjs +2 -0
  58. package/dist/layouts/ui-grid.mjs.map +1 -0
  59. package/dist/{list-display-DPxZ_Jbf.cjs → list-display-DDeJoneW.cjs} +2 -2
  60. package/dist/{list-display-DPxZ_Jbf.cjs.map → list-display-DDeJoneW.cjs.map} +1 -1
  61. package/dist/{list-display-M43N3kle.mjs → list-display-DLsm8uAh.mjs} +2 -2
  62. package/dist/{list-display-M43N3kle.mjs.map → list-display-DLsm8uAh.mjs.map} +1 -1
  63. package/dist/{name-display-BJ1wPUnS.cjs → name-display-CKnyugrP.cjs} +2 -2
  64. package/dist/{name-display-BJ1wPUnS.cjs.map → name-display-CKnyugrP.cjs.map} +1 -1
  65. package/dist/{name-display-pWhLLS05.mjs → name-display-H5HFH1fU.mjs} +2 -2
  66. package/dist/{name-display-pWhLLS05.mjs.map → name-display-H5HFH1fU.mjs.map} +1 -1
  67. package/dist/{permalink-BaMvnKIz.mjs → permalink-CaCx9fi6.mjs} +2 -2
  68. package/dist/{permalink-BaMvnKIz.mjs.map → permalink-CaCx9fi6.mjs.map} +1 -1
  69. package/dist/{permalink-CMcI__V4.cjs → permalink-azuGQg2b.cjs} +2 -2
  70. package/dist/{permalink-CMcI__V4.cjs.map → permalink-azuGQg2b.cjs.map} +1 -1
  71. package/dist/{phone-number-ao2oCmrO.mjs → phone-number-Ba-f4s1Y.mjs} +2 -2
  72. package/dist/{phone-number-ao2oCmrO.mjs.map → phone-number-Ba-f4s1Y.mjs.map} +1 -1
  73. package/dist/{phone-number-F9I9sNLK.cjs → phone-number-BqRhKQdr.cjs} +2 -2
  74. package/dist/{phone-number-F9I9sNLK.cjs.map → phone-number-BqRhKQdr.cjs.map} +1 -1
  75. package/dist/{progress-display-atwRFD6e.mjs → progress-display-0UsBzt_r.mjs} +2 -2
  76. package/dist/{progress-display-atwRFD6e.mjs.map → progress-display-0UsBzt_r.mjs.map} +1 -1
  77. package/dist/{progress-display-F8xXJ3T1.cjs → progress-display-CiYWPOnq.cjs} +2 -2
  78. package/dist/{progress-display-F8xXJ3T1.cjs.map → progress-display-CiYWPOnq.cjs.map} +1 -1
  79. package/dist/{resizable-CWmitx5U.d.mts → resizable-C3uADYIg.d.cts} +2 -2
  80. package/dist/{resizable-CWmitx5U.d.cts → resizable-C3uADYIg.d.mts} +2 -2
  81. package/dist/side-panel-DPrM5ygG.d.cts +86 -0
  82. package/dist/side-panel-DPrM5ygG.d.mts +86 -0
  83. package/dist/statistic-639yMA2d.mjs +2 -0
  84. package/dist/statistic-639yMA2d.mjs.map +1 -0
  85. package/dist/statistic-CE_Jg8SN.cjs +2 -0
  86. package/dist/statistic-CE_Jg8SN.cjs.map +1 -0
  87. package/dist/{status-display-DInGGgiP.mjs → status-display-BCYpNJmd.mjs} +2 -2
  88. package/dist/{status-display-DInGGgiP.mjs.map → status-display-BCYpNJmd.mjs.map} +1 -1
  89. package/dist/{status-display-DpKsYvZJ.cjs → status-display-xcCCGpGS.cjs} +2 -2
  90. package/dist/{status-display-DpKsYvZJ.cjs.map → status-display-xcCCGpGS.cjs.map} +1 -1
  91. package/dist/{summary-bar-DKZh-VSB.cjs → summary-bar-C08g8bb1.cjs} +2 -2
  92. package/dist/{summary-bar-DKZh-VSB.cjs.map → summary-bar-C08g8bb1.cjs.map} +1 -1
  93. package/dist/{summary-bar-DX_sOiuL.mjs → summary-bar-C3NAnI3V.mjs} +2 -2
  94. package/dist/{summary-bar-DX_sOiuL.mjs.map → summary-bar-C3NAnI3V.mjs.map} +1 -1
  95. package/dist/tables-BqZ4Zs6e.cjs +2 -0
  96. package/dist/tables-BqZ4Zs6e.cjs.map +1 -0
  97. package/dist/tables-Dg3KMBKA.mjs +2 -0
  98. package/dist/tables-Dg3KMBKA.mjs.map +1 -0
  99. package/dist/tooltip-BVzKgxrZ.cjs +4 -0
  100. package/dist/tooltip-BVzKgxrZ.cjs.map +1 -0
  101. package/dist/tooltip-D7U_Nl5c.mjs +4 -0
  102. package/dist/tooltip-D7U_Nl5c.mjs.map +1 -0
  103. package/dist/ui/alert-dialog.cjs +1 -1
  104. package/dist/ui/alert-dialog.cjs.map +1 -1
  105. package/dist/ui/alert-dialog.mjs +1 -1
  106. package/dist/ui/alert-dialog.mjs.map +1 -1
  107. package/dist/ui/dialog.cjs +1 -1
  108. package/dist/ui/dialog.cjs.map +1 -1
  109. package/dist/ui/dialog.mjs +1 -1
  110. package/dist/ui/dialog.mjs.map +1 -1
  111. package/dist/ui/resizable.d.cts +1 -1
  112. package/dist/ui/resizable.d.mts +1 -1
  113. package/dist/ui/sheet.cjs +1 -1
  114. package/dist/ui/sheet.cjs.map +1 -1
  115. package/dist/ui/sheet.mjs +1 -1
  116. package/dist/ui/sheet.mjs.map +1 -1
  117. package/dist/ui-grid-CzL5J7cm.d.cts +128 -0
  118. package/dist/ui-grid-CzL5J7cm.d.mts +128 -0
  119. package/package.json +9 -1
  120. package/dist/currency-display-CanjOswc.mjs +0 -2
  121. package/dist/currency-display-CanjOswc.mjs.map +0 -1
  122. package/dist/currency-display-xxK62yo4.cjs +0 -2
  123. package/dist/currency-display-xxK62yo4.cjs.map +0 -1
  124. package/dist/filter-B5EnnL9I.cjs +0 -2
  125. package/dist/filter-BCNjqiBx.mjs +0 -2
  126. package/dist/statistic-B9OqfhOl.cjs +0 -2
  127. package/dist/statistic-B9OqfhOl.cjs.map +0 -1
  128. package/dist/statistic-CJVc9sNs.mjs +0 -2
  129. package/dist/statistic-CJVc9sNs.mjs.map +0 -1
  130. package/dist/tables-7_KgoyS-.mjs +0 -2
  131. package/dist/tables-7_KgoyS-.mjs.map +0 -1
  132. package/dist/tables-CS3NhgTc.cjs +0 -2
  133. package/dist/tables-CS3NhgTc.cjs.map +0 -1
  134. package/dist/tooltip-BcQG6Zw9.cjs +0 -4
  135. package/dist/tooltip-BcQG6Zw9.cjs.map +0 -1
  136. package/dist/tooltip-C6flMQgc.mjs +0 -4
  137. package/dist/tooltip-C6flMQgc.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use client";import{t as e}from"../heading-Fajfx88p.mjs";import{paragraphVariants as t}from"../typography/paragraph.mjs";import{t as n}from"../close-DYJZ8fkh.mjs";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{Dialog as o}from"radix-ui";function s({...e}){return i(o.Root,{"data-slot":`dialog`,...e})}function c({...e}){return i(o.Trigger,{"data-slot":`dialog-trigger`,...e})}function l({...e}){return i(o.Portal,{"data-slot":`dialog-portal`,...e})}function u({...e}){return i(o.Close,{"data-slot":`dialog-close`,...e})}function d({className:e,...t}){return i(o.Overlay,{"data-slot":`dialog-overlay`,className:r(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:fade-in-0 data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=closed]:animate-out`,e),...t})}function f({className:e,children:t,showCloseButton:s=!0,...c}){return a(l,{children:[i(d,{}),a(o.Content,{"data-slot":`dialog-content`,className:r(`fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2`,`grid w-full max-w-[calc(100%-2rem)] bg-background`,`max-h-[85dvh] gap-4 rounded-2xl p-6 shadow-dialog outline-none duration-400`,`sm:max-w-lg`,`data-[state=open]:fade-in-0 data-[state=open]:zoom-in-80 data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-80 data-[state=closed]:animate-out`,e),onOpenAutoFocus:e=>{e.preventDefault()},...c,children:[t,s&&i(o.Close,{"data-slot":`dialog-close`,tabIndex:-1,asChild:!0,className:`absolute top-3 right-3`,children:i(n,{})})]})]})}function p({className:e,...t}){return i(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function m({className:e,...t}){return i(`div`,{"data-slot":`dialog-footer`,className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function h({className:t,...n}){return i(o.Title,{"data-slot":`dialog-title`,className:r(e({level:`h3`}),t),...n})}function g({className:e,...n}){return i(o.Description,{"data-slot":`dialog-description`,className:r(t({variant:`muted`}),e),...n})}export{s as Dialog,u as DialogClose,f as DialogContent,g as DialogDescription,m as DialogFooter,p as DialogHeader,d as DialogOverlay,l as DialogPortal,h as DialogTitle,c as DialogTrigger};
1
+ "use client";import{t as e}from"../heading-Fajfx88p.mjs";import{paragraphVariants as t}from"../typography/paragraph.mjs";import{t as n}from"../close-DYJZ8fkh.mjs";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{Dialog as o}from"radix-ui";function s({...e}){return i(o.Root,{"data-slot":`dialog`,...e})}function c({...e}){return i(o.Trigger,{"data-slot":`dialog-trigger`,...e})}function l({...e}){return i(o.Portal,{"data-slot":`dialog-portal`,...e})}function u({...e}){return i(o.Close,{"data-slot":`dialog-close`,...e})}function d({className:e,...t}){return i(o.Overlay,{"data-slot":`dialog-overlay`,className:r(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:fade-in-0 data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=closed]:animate-out`,e),...t})}function f({className:e,children:t,showCloseButton:s=!0,...c}){return a(l,{children:[i(d,{}),a(o.Content,{"data-slot":`dialog-content`,className:r(`fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2`,`grid w-full max-w-[calc(100%-2rem)] bg-background`,`max-h-[85dvh] gap-4 rounded-2xl p-6 shadow-dialog outline-none duration-400`,`sm:max-w-lg`,`data-[state=open]:fade-in-0 data-[state=open]:zoom-in-80 data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-80 data-[state=closed]:animate-out`,e),onOpenAutoFocus:e=>{e.preventDefault()},...c,children:[t,s&&i(o.Close,{"data-slot":`dialog-close`,tabIndex:-1,asChild:!0,className:`absolute top-3 right-3`,children:i(n,{})})]})]})}function p({className:e,...t}){return i(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-1 text-center sm:text-left`,e),...t})}function m({className:e,...t}){return i(`div`,{"data-slot":`dialog-footer`,className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function h({className:t,...n}){return i(o.Title,{"data-slot":`dialog-title`,className:r(e({level:`h3`}),t),...n})}function g({className:e,...n}){return i(o.Description,{"data-slot":`dialog-description`,className:r(t({variant:`muted`}),`not-first:mt-0 md:text-sm`,e),...n})}export{s as Dialog,u as DialogClose,f as DialogContent,g as DialogDescription,m as DialogFooter,p as DialogHeader,d as DialogOverlay,l as DialogPortal,h as DialogTitle,c as DialogTrigger};
2
2
  //# sourceMappingURL=dialog.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.mjs","names":["DialogPrimitive"],"sources":["../../packages/components/ui/dialog.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { headingVariants } from '../typography/heading';\nimport { paragraphVariants } from '../typography/paragraph';\nimport { CloseButton } from './buttons/close';\n\n/**\n * Accessible modal dialog built on Radix UI's Dialog primitives with animated overlay, close button, and responsive sizing.\n *\n * @example\n * ```tsx\n * import {\n * Dialog, DialogTrigger, DialogContent,\n * DialogHeader, DialogTitle, DialogDescription, DialogFooter,\n * } from '@customafk/lunas-ui/ui/dialog';\n * import { Button } from '@customafk/lunas-ui/ui/button';\n *\n * <Dialog>\n * <DialogTrigger asChild>\n * <Button>Open dialog</Button>\n * </DialogTrigger>\n * <DialogContent>\n * <DialogHeader>\n * <DialogTitle>Confirm action</DialogTitle>\n * <DialogDescription>This cannot be undone.</DialogDescription>\n * </DialogHeader>\n * <DialogFooter>\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Confirm</Button>\n * </DialogFooter>\n * </DialogContent>\n * </Dialog>\n * ```\n */\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\n/** Element that opens the dialog when clicked; typically wrapped with `asChild` around a `Button`. */\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\n/** Renders dialog overlay and content into a portal outside the normal React tree. */\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\n/** Button that closes the dialog; can be composed with `asChild` to use a custom element. */\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\n/** Semi-transparent backdrop rendered behind the dialog panel with fade-in/out animation. */\nfunction DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:fade-in-0 data-[state=open]:animate-in',\n 'data-[state=closed]:fade-out-0 data-[state=closed]:animate-out',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Animated dialog panel centred on screen; includes `DialogOverlay` and an optional close button.\n *\n * @param showCloseButton - When `true` (default), renders a `CloseButton` in the top-right corner.\n */\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n /** When `true` (default), renders an `×` close button fixed to the top-right corner of the panel. */\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2',\n 'grid w-full max-w-[calc(100%-2rem)] bg-background',\n 'max-h-[85dvh] gap-4 rounded-2xl p-6 shadow-dialog outline-none duration-400',\n 'sm:max-w-lg',\n 'data-[state=open]:fade-in-0 data-[state=open]:zoom-in-80 data-[state=open]:animate-in',\n 'data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-80 data-[state=closed]:animate-out',\n className\n )}\n onOpenAutoFocus={event => {\n // Prevents focus from shifting to the content when the dialog opens, which can cause layout shift if the content includes autofocusable elements.\n event.preventDefault();\n }}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" tabIndex={-1} asChild className=\"absolute top-3 right-3\">\n <CloseButton />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\n/** Layout wrapper for the dialog title and description, stacked vertically with left alignment on wider screens. */\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"dialog-header\" className={cn('flex flex-col gap-2 text-center sm:text-left', className)} {...props} />;\n}\n\n/** Layout wrapper for dialog action buttons, stacked on mobile and right-aligned in a row on wider screens. */\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"dialog-footer\" className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)} {...props} />;\n}\n\n/** Accessible heading for the dialog panel, styled with the h3 heading variant and announced by screen readers. */\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return <DialogPrimitive.Title data-slot=\"dialog-title\" className={cn(headingVariants({ level: 'h3' }), className)} {...props} />;\n}\n\n/** Muted supporting text that describes the dialog's purpose; read by screen readers alongside the title. */\nfunction DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return <DialogPrimitive.Description data-slot=\"dialog-description\" className={cn(paragraphVariants({ variant: 'muted' }), className)} {...props} />;\n}\n\nexport { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };\n"],"mappings":"2SAqCA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAACA,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,CAAQ,CAAA,CAC9D,CAGA,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAACA,EAAgB,QAAjB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAGA,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAACA,EAAgB,OAAjB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAGA,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAGA,SAAS,EAAc,CAAE,YAAW,GAAG,GAA+D,CACpG,OACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,iCACA,2DACA,iEACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAOA,SAAS,EAAc,CACrB,YACA,WACA,kBAAkB,GAClB,GAAG,GAIF,CACD,OACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAgB,CAAA,EAChB,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,gEACA,oDACA,8EACA,cACA,wFACA,iGACA,CACF,EACA,gBAAiB,GAAS,CAExB,EAAM,eAAe,CACvB,EACA,GAAI,EAfN,SAAA,CAiBG,EACA,GACC,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,SAAU,GAAI,QAAA,GAAQ,UAAU,yBAC9E,SAAA,EAAC,EAAD,CAAc,CAAA,CACO,CAAA,CAEF,CACb,CAAA,CAAA,CAAA,CAAA,CAElB,CAGA,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,+CAAgD,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC9H,CAGA,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,yDAA0D,CAAS,EAAG,GAAI,CAAQ,CAAA,CACxI,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,UAAW,EAAG,EAAgB,CAAE,MAAO,IAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjI,CAGA,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAmE,CAC5G,OAAO,EAACA,EAAgB,YAAjB,CAA6B,YAAU,qBAAqB,UAAW,EAAG,EAAkB,CAAE,QAAS,OAAQ,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACpJ"}
1
+ {"version":3,"file":"dialog.mjs","names":["DialogPrimitive"],"sources":["../../packages/components/ui/dialog.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { headingVariants } from '../typography/heading';\nimport { paragraphVariants } from '../typography/paragraph';\nimport { CloseButton } from './buttons/close';\n\n/**\n * Accessible modal dialog built on Radix UI's Dialog primitives with animated overlay, close button, and responsive sizing.\n *\n * @example\n * ```tsx\n * import {\n * Dialog, DialogTrigger, DialogContent,\n * DialogHeader, DialogTitle, DialogDescription, DialogFooter,\n * } from '@customafk/lunas-ui/ui/dialog';\n * import { Button } from '@customafk/lunas-ui/ui/button';\n *\n * <Dialog>\n * <DialogTrigger asChild>\n * <Button>Open dialog</Button>\n * </DialogTrigger>\n * <DialogContent>\n * <DialogHeader>\n * <DialogTitle>Confirm action</DialogTitle>\n * <DialogDescription>This cannot be undone.</DialogDescription>\n * </DialogHeader>\n * <DialogFooter>\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Confirm</Button>\n * </DialogFooter>\n * </DialogContent>\n * </Dialog>\n * ```\n */\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\n/** Element that opens the dialog when clicked; typically wrapped with `asChild` around a `Button`. */\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\n/** Renders dialog overlay and content into a portal outside the normal React tree. */\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\n/** Button that closes the dialog; can be composed with `asChild` to use a custom element. */\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\n/** Semi-transparent backdrop rendered behind the dialog panel with fade-in/out animation. */\nfunction DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:fade-in-0 data-[state=open]:animate-in',\n 'data-[state=closed]:fade-out-0 data-[state=closed]:animate-out',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Animated dialog panel centred on screen; includes `DialogOverlay` and an optional close button.\n *\n * @param showCloseButton - When `true` (default), renders a `CloseButton` in the top-right corner.\n */\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n /** When `true` (default), renders an `×` close button fixed to the top-right corner of the panel. */\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2',\n 'grid w-full max-w-[calc(100%-2rem)] bg-background',\n 'max-h-[85dvh] gap-4 rounded-2xl p-6 shadow-dialog outline-none duration-400',\n 'sm:max-w-lg',\n 'data-[state=open]:fade-in-0 data-[state=open]:zoom-in-80 data-[state=open]:animate-in',\n 'data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-80 data-[state=closed]:animate-out',\n className\n )}\n onOpenAutoFocus={event => {\n // Prevents focus from shifting to the content when the dialog opens, which can cause layout shift if the content includes autofocusable elements.\n event.preventDefault();\n }}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" tabIndex={-1} asChild className=\"absolute top-3 right-3\">\n <CloseButton />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\n/** Layout wrapper for the dialog title and description, stacked vertically with left alignment on wider screens. */\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"dialog-header\" className={cn('flex flex-col gap-1 text-center sm:text-left', className)} {...props} />;\n}\n\n/** Layout wrapper for dialog action buttons, stacked on mobile and right-aligned in a row on wider screens. */\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"dialog-footer\" className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)} {...props} />;\n}\n\n/** Accessible heading for the dialog panel, styled with the h3 heading variant and announced by screen readers. */\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return <DialogPrimitive.Title data-slot=\"dialog-title\" className={cn(headingVariants({ level: 'h3' }), className)} {...props} />;\n}\n\n/** Muted supporting text that describes the dialog's purpose; read by screen readers alongside the title. */\nfunction DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(paragraphVariants({ variant: 'muted' }), 'not-first:mt-0 md:text-sm', className)}\n {...props}\n />\n );\n}\n\nexport { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };\n"],"mappings":"2SAqCA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAACA,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,CAAQ,CAAA,CAC9D,CAGA,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAACA,EAAgB,QAAjB,CAAyB,YAAU,iBAAiB,GAAI,CAAQ,CAAA,CACzE,CAGA,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAACA,EAAgB,OAAjB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAGA,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAGA,SAAS,EAAc,CAAE,YAAW,GAAG,GAA+D,CACpG,OACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,iCACA,2DACA,iEACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAOA,SAAS,EAAc,CACrB,YACA,WACA,kBAAkB,GAClB,GAAG,GAIF,CACD,OACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAgB,CAAA,EAChB,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,gEACA,oDACA,8EACA,cACA,wFACA,iGACA,CACF,EACA,gBAAiB,GAAS,CAExB,EAAM,eAAe,CACvB,EACA,GAAI,EAfN,SAAA,CAiBG,EACA,GACC,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,SAAU,GAAI,QAAA,GAAQ,UAAU,yBAC9E,SAAA,EAAC,EAAD,CAAc,CAAA,CACO,CAAA,CAEF,CACb,CAAA,CAAA,CAAA,CAAA,CAElB,CAGA,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,+CAAgD,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC9H,CAGA,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAC,MAAD,CAAK,YAAU,gBAAgB,UAAW,EAAG,yDAA0D,CAAS,EAAG,GAAI,CAAQ,CAAA,CACxI,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,UAAW,EAAG,EAAgB,CAAE,MAAO,IAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjI,CAGA,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAmE,CAC5G,OACE,EAACA,EAAgB,YAAjB,CACE,YAAU,qBACV,UAAW,EAAG,EAAkB,CAAE,QAAS,OAAQ,CAAC,EAAG,4BAA6B,CAAS,EAC7F,GAAI,CACL,CAAA,CAEL"}
@@ -1,2 +1,2 @@
1
- import { n as ResizablePanel, r as ResizablePanelGroup, t as ResizableHandle } from "../resizable-CWmitx5U.cjs";
1
+ import { n as ResizablePanel, r as ResizablePanelGroup, t as ResizableHandle } from "../resizable-C3uADYIg.cjs";
2
2
  export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
@@ -1,2 +1,2 @@
1
- import { n as ResizablePanel, r as ResizablePanelGroup, t as ResizableHandle } from "../resizable-CWmitx5U.mjs";
1
+ import { n as ResizablePanel, r as ResizablePanelGroup, t as ResizableHandle } from "../resizable-C3uADYIg.mjs";
2
2
  export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
package/dist/ui/sheet.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("lucide-react"),t=require("@customafk/react-toolkit/utils"),n=require("react/jsx-runtime"),r=require("radix-ui");function i({...e}){return(0,n.jsx)(r.Dialog.Root,{"data-slot":`sheet`,...e})}function a({...e}){return(0,n.jsx)(r.Dialog.Trigger,{"data-slot":`sheet-trigger`,...e})}function o({...e}){return(0,n.jsx)(r.Dialog.Close,{"data-slot":`sheet-close`,...e})}function s({...e}){return(0,n.jsx)(r.Dialog.Portal,{"data-slot":`sheet-portal`,...e})}function c({className:e,...i}){return(0,n.jsx)(r.Dialog.Overlay,{"data-slot":`sheet-overlay`,className:(0,t.cn)(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:animate-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,`data-[state=open]:fade-in-0`,e),...i})}function l({className:i,children:a,side:o=`right`,...l}){return(0,n.jsxs)(s,{children:[(0,n.jsx)(c,{}),(0,n.jsxs)(r.Dialog.Content,{"data-slot":`sheet-content`,className:(0,t.cn)(`bg-background`,`fixed z-50 flex flex-col gap-4 border-border-weak shadow-dropdown transition ease-in-out`,`data-[state=open]:animate-in`,`data-[state=open]:duration-500`,`data-[state=closed]:animate-out`,`data-[state=closed]:duration-300`,o===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`,o===`right`&&`data-[state=closed]:slide-out-to-right`,o===`right`&&`data-[state=open]:slide-in-from-right`,o===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm`,o===`left`&&`data-[state=closed]:slide-out-to-left`,o===`left`&&`data-[state=open]:slide-in-from-left`,o===`top`&&`inset-x-0 top-0 h-auto border-b`,o===`top`&&`data-[state=closed]:slide-out-to-top`,o===`top`&&`data-[state=open]:slide-in-from-top`,o===`bottom`&&`inset-x-0 bottom-0 h-auto border-t`,o===`bottom`&&`data-[state=closed]:slide-out-to-bottom`,o===`bottom`&&`data-[state=open]:slide-in-from-bottom`,i),...l,children:[a,(0,n.jsxs)(r.Dialog.Close,{className:(0,t.cn)(`cursor-pointer p-2 ring-offset-background`,`absolute top-2 right-2 rounded-full opacity-70 transition-opacity`,`data-[state=open]:bg-secondary`,`disabled:pointer-events-none`,`hover:opacity-100`,`hover:bg-border-muted`,`focus:ring-border-weak`,`focus:ring-4`,`focus:outline-hidden`),children:[(0,n.jsx)(e.XIcon,{className:`size-5`}),(0,n.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function u({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`sheet-header`,className:(0,t.cn)(`flex flex-0 flex-col gap-1.5 p-4`,e),...r})}function d({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`sheet-footer`,className:(0,t.cn)(`mt-auto flex flex-0 flex-col gap-2 p-4`,e),...r})}function f({className:e,...i}){return(0,n.jsx)(r.Dialog.Title,{"data-slot":`sheet-title`,className:(0,t.cn)(`font-semibold text-text-positive-strong`,e),...i})}function p({className:e,...i}){return(0,n.jsx)(r.Dialog.Description,{"data-slot":`sheet-description`,className:(0,t.cn)(`text-sm text-text-positive-weak`,e),...i})}exports.Sheet=i,exports.SheetClose=o,exports.SheetContent=l,exports.SheetDescription=p,exports.SheetFooter=d,exports.SheetHeader=u,exports.SheetTitle=f,exports.SheetTrigger=a;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("lucide-react"),t=require("@customafk/react-toolkit/utils"),n=require("react/jsx-runtime"),r=require("radix-ui");function i({...e}){return(0,n.jsx)(r.Dialog.Root,{"data-slot":`sheet`,...e})}function a({...e}){return(0,n.jsx)(r.Dialog.Trigger,{"data-slot":`sheet-trigger`,...e})}function o({...e}){return(0,n.jsx)(r.Dialog.Close,{"data-slot":`sheet-close`,...e})}function s({...e}){return(0,n.jsx)(r.Dialog.Portal,{"data-slot":`sheet-portal`,...e})}function c({className:e,...i}){return(0,n.jsx)(r.Dialog.Overlay,{"data-slot":`sheet-overlay`,className:(0,t.cn)(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:animate-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,`data-[state=open]:fade-in-0`,e),...i})}function l({className:i,children:a,side:o=`right`,...l}){return(0,n.jsxs)(s,{children:[(0,n.jsx)(c,{}),(0,n.jsxs)(r.Dialog.Content,{"data-slot":`sheet-content`,className:(0,t.cn)(`bg-background`,`fixed z-50 flex flex-col gap-4 border-border-weak shadow-dropdown transition ease-in-out`,`data-[state=open]:animate-in`,`data-[state=open]:duration-500`,`data-[state=closed]:animate-out`,`data-[state=closed]:duration-300`,o===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`,o===`right`&&`data-[state=closed]:slide-out-to-right`,o===`right`&&`data-[state=open]:slide-in-from-right`,o===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm`,o===`left`&&`data-[state=closed]:slide-out-to-left`,o===`left`&&`data-[state=open]:slide-in-from-left`,o===`top`&&`inset-x-0 top-0 h-auto border-b`,o===`top`&&`data-[state=closed]:slide-out-to-top`,o===`top`&&`data-[state=open]:slide-in-from-top`,o===`bottom`&&`inset-x-0 bottom-0 h-auto border-t`,o===`bottom`&&`data-[state=closed]:slide-out-to-bottom`,o===`bottom`&&`data-[state=open]:slide-in-from-bottom`,i),...l,children:[a,(0,n.jsxs)(r.Dialog.Close,{className:(0,t.cn)(`cursor-pointer p-2 ring-offset-background`,`absolute top-2 right-2 rounded-full opacity-70 transition-opacity`,`data-[state=open]:bg-secondary`,`disabled:pointer-events-none`,`hover:opacity-100`,`hover:bg-border-muted`,`focus:ring-border-weak`,`focus:ring-4`,`focus:outline-hidden`),children:[(0,n.jsx)(e.XIcon,{className:`size-5`}),(0,n.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function u({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`sheet-header`,className:(0,t.cn)(`flex flex-0 flex-col gap-1 p-4`,e),...r})}function d({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`sheet-footer`,className:(0,t.cn)(`mt-auto flex flex-0 flex-col gap-2 p-4`,e),...r})}function f({className:e,...i}){return(0,n.jsx)(r.Dialog.Title,{"data-slot":`sheet-title`,className:(0,t.cn)(`font-semibold text-text-positive-strong`,e),...i})}function p({className:e,...i}){return(0,n.jsx)(r.Dialog.Description,{"data-slot":`sheet-description`,className:(0,t.cn)(`text-sm text-text-positive-weak`,e),...i})}exports.Sheet=i,exports.SheetClose=o,exports.SheetContent=l,exports.SheetDescription=p,exports.SheetFooter=d,exports.SheetHeader=u,exports.SheetTitle=f,exports.SheetTrigger=a;
2
2
  //# sourceMappingURL=sheet.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.cjs","names":["SheetPrimitive","XIcon"],"sources":["../../packages/components/ui/sheet.tsx"],"sourcesContent":["'use client';\n\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Dialog as SheetPrimitive } from 'radix-ui';\n\n/**\n * Root provider for the Sheet panel — wraps all Sheet sub-components and manages open state.\n *\n * @example\n * ```tsx\n * import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription } from '@customafk/lunas-ui/ui/sheet';\n *\n * <Sheet>\n * <SheetTrigger>Open</SheetTrigger>\n * <SheetContent side=\"right\">\n * <SheetHeader>\n * <SheetTitle>Settings</SheetTitle>\n * <SheetDescription>Manage your preferences.</SheetDescription>\n * </SheetHeader>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nfunction Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n}\n\n/** Button or element that opens the Sheet when interacted with. */\nfunction SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\n/** Button that programmatically closes the Sheet. */\nfunction SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\n/** Portals Sheet content outside the current DOM hierarchy. */\nfunction SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\n/** Semi-transparent backdrop rendered behind the Sheet panel. */\nfunction SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {\n return (\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:animate-in',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * The sliding panel itself; renders on the specified `side` of the viewport and includes a built-in close button.\n */\nfunction SheetContent({\n className,\n children,\n side = 'right',\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n /** Edge of the viewport from which the sheet slides in. */\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n className={cn(\n 'bg-background',\n 'fixed z-50 flex flex-col gap-4 border-border-weak shadow-dropdown transition ease-in-out',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:duration-500',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:duration-300',\n\n side === 'right' && 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n side === 'right' && 'data-[state=closed]:slide-out-to-right',\n side === 'right' && 'data-[state=open]:slide-in-from-right',\n\n side === 'left' && 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n side === 'left' && 'data-[state=closed]:slide-out-to-left',\n side === 'left' && 'data-[state=open]:slide-in-from-left',\n\n side === 'top' && 'inset-x-0 top-0 h-auto border-b',\n side === 'top' && 'data-[state=closed]:slide-out-to-top',\n side === 'top' && 'data-[state=open]:slide-in-from-top',\n\n side === 'bottom' && 'inset-x-0 bottom-0 h-auto border-t',\n side === 'bottom' && 'data-[state=closed]:slide-out-to-bottom',\n side === 'bottom' && 'data-[state=open]:slide-in-from-bottom',\n className\n )}\n {...props}\n >\n {children}\n <SheetPrimitive.Close\n className={cn(\n 'cursor-pointer p-2 ring-offset-background',\n 'absolute top-2 right-2 rounded-full opacity-70 transition-opacity',\n 'data-[state=open]:bg-secondary',\n 'disabled:pointer-events-none',\n 'hover:opacity-100',\n 'hover:bg-border-muted',\n 'focus:ring-border-weak',\n 'focus:ring-4',\n 'focus:outline-hidden'\n )}\n >\n <XIcon className=\"size-5\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\n/** Padded container for the Sheet title and description at the top of the panel. */\nfunction SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"sheet-header\" className={cn('flex flex-0 flex-col gap-1.5 p-4', className)} {...props} />;\n}\n\n/** Sticky footer area at the bottom of the Sheet panel, typically used for action buttons. */\nfunction SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"sheet-footer\" className={cn('mt-auto flex flex-0 flex-col gap-2 p-4', className)} {...props} />;\n}\n\n/** Accessible title element for the Sheet, announced by screen readers on open. */\nfunction SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return <SheetPrimitive.Title data-slot=\"sheet-title\" className={cn('font-semibold text-text-positive-strong', className)} {...props} />;\n}\n\n/** Accessible description element for the Sheet, providing supplemental context to the title. */\nfunction SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return <SheetPrimitive.Description data-slot=\"sheet-description\" className={cn('text-sm text-text-positive-weak', className)} {...props} />;\n}\n\nexport { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };\n"],"mappings":"+MA0BA,SAAS,EAAM,CAAE,GAAG,GAA2D,CAC7E,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,KAAhB,CAAqB,YAAU,QAAQ,GAAI,CAAQ,CAAA,CAC5D,CAGA,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,QAAhB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAGA,SAAS,EAAW,CAAE,GAAG,GAA4D,CACnF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,MAAhB,CAAsB,YAAU,cAAc,GAAI,CAAQ,CAAA,CACnE,CAGA,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,OAAhB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAGA,SAAS,EAAa,CAAE,YAAW,GAAG,GAA8D,CAClG,OACE,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,QAAhB,CACE,YAAU,gBACV,WAAA,EAAA,EAAA,GAAA,CACE,iCACA,+BACA,kCACA,iCACA,8BACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAKA,SAAS,EAAa,CACpB,YACA,WACA,OAAO,QACP,GAAG,GAIF,CACD,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAe,CAAA,GACf,EAAA,EAAA,KAAA,CAACA,EAAAA,OAAe,QAAhB,CACE,YAAU,gBACV,WAAA,EAAA,EAAA,GAAA,CACE,gBACA,2FAEA,+BACA,iCACA,kCACA,mCAEA,IAAS,SAAW,sDACpB,IAAS,SAAW,yCACpB,IAAS,SAAW,wCAEpB,IAAS,QAAU,qDACnB,IAAS,QAAU,wCACnB,IAAS,QAAU,uCAEnB,IAAS,OAAS,kCAClB,IAAS,OAAS,uCAClB,IAAS,OAAS,sCAElB,IAAS,UAAY,qCACrB,IAAS,UAAY,0CACrB,IAAS,UAAY,yCACrB,CACF,EACA,GAAI,EA5BN,SAAA,CA8BG,GACD,EAAA,EAAA,KAAA,CAACA,EAAAA,OAAe,MAAhB,CACE,WAAA,EAAA,EAAA,GAAA,CACE,4CACA,oEACA,iCACA,+BACA,oBACA,wBACA,yBACA,eACA,sBACF,EAXF,SAAA,EAaE,EAAA,EAAA,IAAA,CAACC,EAAAA,MAAD,CAAO,UAAU,QAAU,CAAA,GAC3B,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,UAAU,SAAA,OAAW,CAAA,CACjB,CACA,CAAA,CAAA,CACb,CAAA,CAAA,CAAA,CAAA,CAEjB,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,eAAe,WAAA,EAAA,EAAA,GAAA,CAAc,mCAAoC,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjH,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,eAAe,WAAA,EAAA,EAAA,GAAA,CAAc,yCAA0C,CAAS,EAAG,GAAI,CAAQ,CAAA,CACvH,CAGA,SAAS,EAAW,CAAE,YAAW,GAAG,GAA4D,CAC9F,OAAO,EAAA,EAAA,IAAA,CAACD,EAAAA,OAAe,MAAhB,CAAsB,YAAU,cAAc,WAAA,EAAA,EAAA,GAAA,CAAc,0CAA2C,CAAS,EAAG,GAAI,CAAQ,CAAA,CACxI,CAGA,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAkE,CAC1G,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,YAAhB,CAA4B,YAAU,oBAAoB,WAAA,EAAA,EAAA,GAAA,CAAc,kCAAmC,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC5I"}
1
+ {"version":3,"file":"sheet.cjs","names":["SheetPrimitive","XIcon"],"sources":["../../packages/components/ui/sheet.tsx"],"sourcesContent":["'use client';\n\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Dialog as SheetPrimitive } from 'radix-ui';\n\n/**\n * Root provider for the Sheet panel — wraps all Sheet sub-components and manages open state.\n *\n * @example\n * ```tsx\n * import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription } from '@customafk/lunas-ui/ui/sheet';\n *\n * <Sheet>\n * <SheetTrigger>Open</SheetTrigger>\n * <SheetContent side=\"right\">\n * <SheetHeader>\n * <SheetTitle>Settings</SheetTitle>\n * <SheetDescription>Manage your preferences.</SheetDescription>\n * </SheetHeader>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nfunction Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n}\n\n/** Button or element that opens the Sheet when interacted with. */\nfunction SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\n/** Button that programmatically closes the Sheet. */\nfunction SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\n/** Portals Sheet content outside the current DOM hierarchy. */\nfunction SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\n/** Semi-transparent backdrop rendered behind the Sheet panel. */\nfunction SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {\n return (\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:animate-in',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * The sliding panel itself; renders on the specified `side` of the viewport and includes a built-in close button.\n */\nfunction SheetContent({\n className,\n children,\n side = 'right',\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n /** Edge of the viewport from which the sheet slides in. */\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n className={cn(\n 'bg-background',\n 'fixed z-50 flex flex-col gap-4 border-border-weak shadow-dropdown transition ease-in-out',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:duration-500',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:duration-300',\n\n side === 'right' && 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n side === 'right' && 'data-[state=closed]:slide-out-to-right',\n side === 'right' && 'data-[state=open]:slide-in-from-right',\n\n side === 'left' && 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n side === 'left' && 'data-[state=closed]:slide-out-to-left',\n side === 'left' && 'data-[state=open]:slide-in-from-left',\n\n side === 'top' && 'inset-x-0 top-0 h-auto border-b',\n side === 'top' && 'data-[state=closed]:slide-out-to-top',\n side === 'top' && 'data-[state=open]:slide-in-from-top',\n\n side === 'bottom' && 'inset-x-0 bottom-0 h-auto border-t',\n side === 'bottom' && 'data-[state=closed]:slide-out-to-bottom',\n side === 'bottom' && 'data-[state=open]:slide-in-from-bottom',\n className\n )}\n {...props}\n >\n {children}\n <SheetPrimitive.Close\n className={cn(\n 'cursor-pointer p-2 ring-offset-background',\n 'absolute top-2 right-2 rounded-full opacity-70 transition-opacity',\n 'data-[state=open]:bg-secondary',\n 'disabled:pointer-events-none',\n 'hover:opacity-100',\n 'hover:bg-border-muted',\n 'focus:ring-border-weak',\n 'focus:ring-4',\n 'focus:outline-hidden'\n )}\n >\n <XIcon className=\"size-5\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\n/** Padded container for the Sheet title and description at the top of the panel. */\nfunction SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"sheet-header\" className={cn('flex flex-0 flex-col gap-1 p-4', className)} {...props} />;\n}\n\n/** Sticky footer area at the bottom of the Sheet panel, typically used for action buttons. */\nfunction SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"sheet-footer\" className={cn('mt-auto flex flex-0 flex-col gap-2 p-4', className)} {...props} />;\n}\n\n/** Accessible title element for the Sheet, announced by screen readers on open. */\nfunction SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return <SheetPrimitive.Title data-slot=\"sheet-title\" className={cn('font-semibold text-text-positive-strong', className)} {...props} />;\n}\n\n/** Accessible description element for the Sheet, providing supplemental context to the title. */\nfunction SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return <SheetPrimitive.Description data-slot=\"sheet-description\" className={cn('text-sm text-text-positive-weak', className)} {...props} />;\n}\n\nexport { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };\n"],"mappings":"+MA0BA,SAAS,EAAM,CAAE,GAAG,GAA2D,CAC7E,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,KAAhB,CAAqB,YAAU,QAAQ,GAAI,CAAQ,CAAA,CAC5D,CAGA,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,QAAhB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAGA,SAAS,EAAW,CAAE,GAAG,GAA4D,CACnF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,MAAhB,CAAsB,YAAU,cAAc,GAAI,CAAQ,CAAA,CACnE,CAGA,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,OAAhB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAGA,SAAS,EAAa,CAAE,YAAW,GAAG,GAA8D,CAClG,OACE,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,QAAhB,CACE,YAAU,gBACV,WAAA,EAAA,EAAA,GAAA,CACE,iCACA,+BACA,kCACA,iCACA,8BACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAKA,SAAS,EAAa,CACpB,YACA,WACA,OAAO,QACP,GAAG,GAIF,CACD,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAe,CAAA,GACf,EAAA,EAAA,KAAA,CAACA,EAAAA,OAAe,QAAhB,CACE,YAAU,gBACV,WAAA,EAAA,EAAA,GAAA,CACE,gBACA,2FAEA,+BACA,iCACA,kCACA,mCAEA,IAAS,SAAW,sDACpB,IAAS,SAAW,yCACpB,IAAS,SAAW,wCAEpB,IAAS,QAAU,qDACnB,IAAS,QAAU,wCACnB,IAAS,QAAU,uCAEnB,IAAS,OAAS,kCAClB,IAAS,OAAS,uCAClB,IAAS,OAAS,sCAElB,IAAS,UAAY,qCACrB,IAAS,UAAY,0CACrB,IAAS,UAAY,yCACrB,CACF,EACA,GAAI,EA5BN,SAAA,CA8BG,GACD,EAAA,EAAA,KAAA,CAACA,EAAAA,OAAe,MAAhB,CACE,WAAA,EAAA,EAAA,GAAA,CACE,4CACA,oEACA,iCACA,+BACA,oBACA,wBACA,yBACA,eACA,sBACF,EAXF,SAAA,EAaE,EAAA,EAAA,IAAA,CAACC,EAAAA,MAAD,CAAO,UAAU,QAAU,CAAA,GAC3B,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,UAAU,SAAA,OAAW,CAAA,CACjB,CACA,CAAA,CAAA,CACb,CAAA,CAAA,CAAA,CAAA,CAEjB,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,eAAe,WAAA,EAAA,EAAA,GAAA,CAAc,iCAAkC,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC/G,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,eAAe,WAAA,EAAA,EAAA,GAAA,CAAc,yCAA0C,CAAS,EAAG,GAAI,CAAQ,CAAA,CACvH,CAGA,SAAS,EAAW,CAAE,YAAW,GAAG,GAA4D,CAC9F,OAAO,EAAA,EAAA,IAAA,CAACD,EAAAA,OAAe,MAAhB,CAAsB,YAAU,cAAc,WAAA,EAAA,EAAA,GAAA,CAAc,0CAA2C,CAAS,EAAG,GAAI,CAAQ,CAAA,CACxI,CAGA,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAkE,CAC1G,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAe,YAAhB,CAA4B,YAAU,oBAAoB,WAAA,EAAA,EAAA,GAAA,CAAc,kCAAmC,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC5I"}
package/dist/ui/sheet.mjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";import{XIcon as e}from"lucide-react";import{cn as t}from"@customafk/react-toolkit/utils";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{Dialog as i}from"radix-ui";function a({...e}){return n(i.Root,{"data-slot":`sheet`,...e})}function o({...e}){return n(i.Trigger,{"data-slot":`sheet-trigger`,...e})}function s({...e}){return n(i.Close,{"data-slot":`sheet-close`,...e})}function c({...e}){return n(i.Portal,{"data-slot":`sheet-portal`,...e})}function l({className:e,...r}){return n(i.Overlay,{"data-slot":`sheet-overlay`,className:t(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:animate-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,`data-[state=open]:fade-in-0`,e),...r})}function u({className:a,children:o,side:s=`right`,...u}){return r(c,{children:[n(l,{}),r(i.Content,{"data-slot":`sheet-content`,className:t(`bg-background`,`fixed z-50 flex flex-col gap-4 border-border-weak shadow-dropdown transition ease-in-out`,`data-[state=open]:animate-in`,`data-[state=open]:duration-500`,`data-[state=closed]:animate-out`,`data-[state=closed]:duration-300`,s===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`,s===`right`&&`data-[state=closed]:slide-out-to-right`,s===`right`&&`data-[state=open]:slide-in-from-right`,s===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm`,s===`left`&&`data-[state=closed]:slide-out-to-left`,s===`left`&&`data-[state=open]:slide-in-from-left`,s===`top`&&`inset-x-0 top-0 h-auto border-b`,s===`top`&&`data-[state=closed]:slide-out-to-top`,s===`top`&&`data-[state=open]:slide-in-from-top`,s===`bottom`&&`inset-x-0 bottom-0 h-auto border-t`,s===`bottom`&&`data-[state=closed]:slide-out-to-bottom`,s===`bottom`&&`data-[state=open]:slide-in-from-bottom`,a),...u,children:[o,r(i.Close,{className:t(`cursor-pointer p-2 ring-offset-background`,`absolute top-2 right-2 rounded-full opacity-70 transition-opacity`,`data-[state=open]:bg-secondary`,`disabled:pointer-events-none`,`hover:opacity-100`,`hover:bg-border-muted`,`focus:ring-border-weak`,`focus:ring-4`,`focus:outline-hidden`),children:[n(e,{className:`size-5`}),n(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function d({className:e,...r}){return n(`div`,{"data-slot":`sheet-header`,className:t(`flex flex-0 flex-col gap-1.5 p-4`,e),...r})}function f({className:e,...r}){return n(`div`,{"data-slot":`sheet-footer`,className:t(`mt-auto flex flex-0 flex-col gap-2 p-4`,e),...r})}function p({className:e,...r}){return n(i.Title,{"data-slot":`sheet-title`,className:t(`font-semibold text-text-positive-strong`,e),...r})}function m({className:e,...r}){return n(i.Description,{"data-slot":`sheet-description`,className:t(`text-sm text-text-positive-weak`,e),...r})}export{a as Sheet,s as SheetClose,u as SheetContent,m as SheetDescription,f as SheetFooter,d as SheetHeader,p as SheetTitle,o as SheetTrigger};
1
+ "use client";import{XIcon as e}from"lucide-react";import{cn as t}from"@customafk/react-toolkit/utils";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{Dialog as i}from"radix-ui";function a({...e}){return n(i.Root,{"data-slot":`sheet`,...e})}function o({...e}){return n(i.Trigger,{"data-slot":`sheet-trigger`,...e})}function s({...e}){return n(i.Close,{"data-slot":`sheet-close`,...e})}function c({...e}){return n(i.Portal,{"data-slot":`sheet-portal`,...e})}function l({className:e,...r}){return n(i.Overlay,{"data-slot":`sheet-overlay`,className:t(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:animate-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,`data-[state=open]:fade-in-0`,e),...r})}function u({className:a,children:o,side:s=`right`,...u}){return r(c,{children:[n(l,{}),r(i.Content,{"data-slot":`sheet-content`,className:t(`bg-background`,`fixed z-50 flex flex-col gap-4 border-border-weak shadow-dropdown transition ease-in-out`,`data-[state=open]:animate-in`,`data-[state=open]:duration-500`,`data-[state=closed]:animate-out`,`data-[state=closed]:duration-300`,s===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`,s===`right`&&`data-[state=closed]:slide-out-to-right`,s===`right`&&`data-[state=open]:slide-in-from-right`,s===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm`,s===`left`&&`data-[state=closed]:slide-out-to-left`,s===`left`&&`data-[state=open]:slide-in-from-left`,s===`top`&&`inset-x-0 top-0 h-auto border-b`,s===`top`&&`data-[state=closed]:slide-out-to-top`,s===`top`&&`data-[state=open]:slide-in-from-top`,s===`bottom`&&`inset-x-0 bottom-0 h-auto border-t`,s===`bottom`&&`data-[state=closed]:slide-out-to-bottom`,s===`bottom`&&`data-[state=open]:slide-in-from-bottom`,a),...u,children:[o,r(i.Close,{className:t(`cursor-pointer p-2 ring-offset-background`,`absolute top-2 right-2 rounded-full opacity-70 transition-opacity`,`data-[state=open]:bg-secondary`,`disabled:pointer-events-none`,`hover:opacity-100`,`hover:bg-border-muted`,`focus:ring-border-weak`,`focus:ring-4`,`focus:outline-hidden`),children:[n(e,{className:`size-5`}),n(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function d({className:e,...r}){return n(`div`,{"data-slot":`sheet-header`,className:t(`flex flex-0 flex-col gap-1 p-4`,e),...r})}function f({className:e,...r}){return n(`div`,{"data-slot":`sheet-footer`,className:t(`mt-auto flex flex-0 flex-col gap-2 p-4`,e),...r})}function p({className:e,...r}){return n(i.Title,{"data-slot":`sheet-title`,className:t(`font-semibold text-text-positive-strong`,e),...r})}function m({className:e,...r}){return n(i.Description,{"data-slot":`sheet-description`,className:t(`text-sm text-text-positive-weak`,e),...r})}export{a as Sheet,s as SheetClose,u as SheetContent,m as SheetDescription,f as SheetFooter,d as SheetHeader,p as SheetTitle,o as SheetTrigger};
2
2
  //# sourceMappingURL=sheet.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.mjs","names":["SheetPrimitive"],"sources":["../../packages/components/ui/sheet.tsx"],"sourcesContent":["'use client';\n\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Dialog as SheetPrimitive } from 'radix-ui';\n\n/**\n * Root provider for the Sheet panel — wraps all Sheet sub-components and manages open state.\n *\n * @example\n * ```tsx\n * import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription } from '@customafk/lunas-ui/ui/sheet';\n *\n * <Sheet>\n * <SheetTrigger>Open</SheetTrigger>\n * <SheetContent side=\"right\">\n * <SheetHeader>\n * <SheetTitle>Settings</SheetTitle>\n * <SheetDescription>Manage your preferences.</SheetDescription>\n * </SheetHeader>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nfunction Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n}\n\n/** Button or element that opens the Sheet when interacted with. */\nfunction SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\n/** Button that programmatically closes the Sheet. */\nfunction SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\n/** Portals Sheet content outside the current DOM hierarchy. */\nfunction SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\n/** Semi-transparent backdrop rendered behind the Sheet panel. */\nfunction SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {\n return (\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:animate-in',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * The sliding panel itself; renders on the specified `side` of the viewport and includes a built-in close button.\n */\nfunction SheetContent({\n className,\n children,\n side = 'right',\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n /** Edge of the viewport from which the sheet slides in. */\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n className={cn(\n 'bg-background',\n 'fixed z-50 flex flex-col gap-4 border-border-weak shadow-dropdown transition ease-in-out',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:duration-500',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:duration-300',\n\n side === 'right' && 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n side === 'right' && 'data-[state=closed]:slide-out-to-right',\n side === 'right' && 'data-[state=open]:slide-in-from-right',\n\n side === 'left' && 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n side === 'left' && 'data-[state=closed]:slide-out-to-left',\n side === 'left' && 'data-[state=open]:slide-in-from-left',\n\n side === 'top' && 'inset-x-0 top-0 h-auto border-b',\n side === 'top' && 'data-[state=closed]:slide-out-to-top',\n side === 'top' && 'data-[state=open]:slide-in-from-top',\n\n side === 'bottom' && 'inset-x-0 bottom-0 h-auto border-t',\n side === 'bottom' && 'data-[state=closed]:slide-out-to-bottom',\n side === 'bottom' && 'data-[state=open]:slide-in-from-bottom',\n className\n )}\n {...props}\n >\n {children}\n <SheetPrimitive.Close\n className={cn(\n 'cursor-pointer p-2 ring-offset-background',\n 'absolute top-2 right-2 rounded-full opacity-70 transition-opacity',\n 'data-[state=open]:bg-secondary',\n 'disabled:pointer-events-none',\n 'hover:opacity-100',\n 'hover:bg-border-muted',\n 'focus:ring-border-weak',\n 'focus:ring-4',\n 'focus:outline-hidden'\n )}\n >\n <XIcon className=\"size-5\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\n/** Padded container for the Sheet title and description at the top of the panel. */\nfunction SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"sheet-header\" className={cn('flex flex-0 flex-col gap-1.5 p-4', className)} {...props} />;\n}\n\n/** Sticky footer area at the bottom of the Sheet panel, typically used for action buttons. */\nfunction SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"sheet-footer\" className={cn('mt-auto flex flex-0 flex-col gap-2 p-4', className)} {...props} />;\n}\n\n/** Accessible title element for the Sheet, announced by screen readers on open. */\nfunction SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return <SheetPrimitive.Title data-slot=\"sheet-title\" className={cn('font-semibold text-text-positive-strong', className)} {...props} />;\n}\n\n/** Accessible description element for the Sheet, providing supplemental context to the title. */\nfunction SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return <SheetPrimitive.Description data-slot=\"sheet-description\" className={cn('text-sm text-text-positive-weak', className)} {...props} />;\n}\n\nexport { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };\n"],"mappings":"0LA0BA,SAAS,EAAM,CAAE,GAAG,GAA2D,CAC7E,OAAO,EAACA,EAAe,KAAhB,CAAqB,YAAU,QAAQ,GAAI,CAAQ,CAAA,CAC5D,CAGA,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAACA,EAAe,QAAhB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAGA,SAAS,EAAW,CAAE,GAAG,GAA4D,CACnF,OAAO,EAACA,EAAe,MAAhB,CAAsB,YAAU,cAAc,GAAI,CAAQ,CAAA,CACnE,CAGA,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAe,OAAhB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAGA,SAAS,EAAa,CAAE,YAAW,GAAG,GAA8D,CAClG,OACE,EAACA,EAAe,QAAhB,CACE,YAAU,gBACV,UAAW,EACT,iCACA,+BACA,kCACA,iCACA,8BACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAKA,SAAS,EAAa,CACpB,YACA,WACA,OAAO,QACP,GAAG,GAIF,CACD,OACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAe,CAAA,EACf,EAACA,EAAe,QAAhB,CACE,YAAU,gBACV,UAAW,EACT,gBACA,2FAEA,+BACA,iCACA,kCACA,mCAEA,IAAS,SAAW,sDACpB,IAAS,SAAW,yCACpB,IAAS,SAAW,wCAEpB,IAAS,QAAU,qDACnB,IAAS,QAAU,wCACnB,IAAS,QAAU,uCAEnB,IAAS,OAAS,kCAClB,IAAS,OAAS,uCAClB,IAAS,OAAS,sCAElB,IAAS,UAAY,qCACrB,IAAS,UAAY,0CACrB,IAAS,UAAY,yCACrB,CACF,EACA,GAAI,EA5BN,SAAA,CA8BG,EACD,EAACA,EAAe,MAAhB,CACE,UAAW,EACT,4CACA,oEACA,iCACA,+BACA,oBACA,wBACA,yBACA,eACA,sBACF,EAXF,SAAA,CAaE,EAAC,EAAD,CAAO,UAAU,QAAU,CAAA,EAC3B,EAAC,OAAD,CAAM,UAAU,UAAU,SAAA,OAAW,CAAA,CACjB,CACA,CAAA,CAAA,CACb,CAAA,CAAA,CAAA,CAAA,CAEjB,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAG,mCAAoC,CAAS,EAAG,GAAI,CAAQ,CAAA,CACjH,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAG,yCAA0C,CAAS,EAAG,GAAI,CAAQ,CAAA,CACvH,CAGA,SAAS,EAAW,CAAE,YAAW,GAAG,GAA4D,CAC9F,OAAO,EAACA,EAAe,MAAhB,CAAsB,YAAU,cAAc,UAAW,EAAG,0CAA2C,CAAS,EAAG,GAAI,CAAQ,CAAA,CACxI,CAGA,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAkE,CAC1G,OAAO,EAACA,EAAe,YAAhB,CAA4B,YAAU,oBAAoB,UAAW,EAAG,kCAAmC,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC5I"}
1
+ {"version":3,"file":"sheet.mjs","names":["SheetPrimitive"],"sources":["../../packages/components/ui/sheet.tsx"],"sourcesContent":["'use client';\n\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Dialog as SheetPrimitive } from 'radix-ui';\n\n/**\n * Root provider for the Sheet panel — wraps all Sheet sub-components and manages open state.\n *\n * @example\n * ```tsx\n * import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription } from '@customafk/lunas-ui/ui/sheet';\n *\n * <Sheet>\n * <SheetTrigger>Open</SheetTrigger>\n * <SheetContent side=\"right\">\n * <SheetHeader>\n * <SheetTitle>Settings</SheetTitle>\n * <SheetDescription>Manage your preferences.</SheetDescription>\n * </SheetHeader>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nfunction Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n}\n\n/** Button or element that opens the Sheet when interacted with. */\nfunction SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\n/** Button that programmatically closes the Sheet. */\nfunction SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\n/** Portals Sheet content outside the current DOM hierarchy. */\nfunction SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\n/** Semi-transparent backdrop rendered behind the Sheet panel. */\nfunction SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {\n return (\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:animate-in',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0',\n 'data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * The sliding panel itself; renders on the specified `side` of the viewport and includes a built-in close button.\n */\nfunction SheetContent({\n className,\n children,\n side = 'right',\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n /** Edge of the viewport from which the sheet slides in. */\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n className={cn(\n 'bg-background',\n 'fixed z-50 flex flex-col gap-4 border-border-weak shadow-dropdown transition ease-in-out',\n\n 'data-[state=open]:animate-in',\n 'data-[state=open]:duration-500',\n 'data-[state=closed]:animate-out',\n 'data-[state=closed]:duration-300',\n\n side === 'right' && 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n side === 'right' && 'data-[state=closed]:slide-out-to-right',\n side === 'right' && 'data-[state=open]:slide-in-from-right',\n\n side === 'left' && 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n side === 'left' && 'data-[state=closed]:slide-out-to-left',\n side === 'left' && 'data-[state=open]:slide-in-from-left',\n\n side === 'top' && 'inset-x-0 top-0 h-auto border-b',\n side === 'top' && 'data-[state=closed]:slide-out-to-top',\n side === 'top' && 'data-[state=open]:slide-in-from-top',\n\n side === 'bottom' && 'inset-x-0 bottom-0 h-auto border-t',\n side === 'bottom' && 'data-[state=closed]:slide-out-to-bottom',\n side === 'bottom' && 'data-[state=open]:slide-in-from-bottom',\n className\n )}\n {...props}\n >\n {children}\n <SheetPrimitive.Close\n className={cn(\n 'cursor-pointer p-2 ring-offset-background',\n 'absolute top-2 right-2 rounded-full opacity-70 transition-opacity',\n 'data-[state=open]:bg-secondary',\n 'disabled:pointer-events-none',\n 'hover:opacity-100',\n 'hover:bg-border-muted',\n 'focus:ring-border-weak',\n 'focus:ring-4',\n 'focus:outline-hidden'\n )}\n >\n <XIcon className=\"size-5\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\n/** Padded container for the Sheet title and description at the top of the panel. */\nfunction SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"sheet-header\" className={cn('flex flex-0 flex-col gap-1 p-4', className)} {...props} />;\n}\n\n/** Sticky footer area at the bottom of the Sheet panel, typically used for action buttons. */\nfunction SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"sheet-footer\" className={cn('mt-auto flex flex-0 flex-col gap-2 p-4', className)} {...props} />;\n}\n\n/** Accessible title element for the Sheet, announced by screen readers on open. */\nfunction SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return <SheetPrimitive.Title data-slot=\"sheet-title\" className={cn('font-semibold text-text-positive-strong', className)} {...props} />;\n}\n\n/** Accessible description element for the Sheet, providing supplemental context to the title. */\nfunction SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return <SheetPrimitive.Description data-slot=\"sheet-description\" className={cn('text-sm text-text-positive-weak', className)} {...props} />;\n}\n\nexport { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };\n"],"mappings":"0LA0BA,SAAS,EAAM,CAAE,GAAG,GAA2D,CAC7E,OAAO,EAACA,EAAe,KAAhB,CAAqB,YAAU,QAAQ,GAAI,CAAQ,CAAA,CAC5D,CAGA,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAACA,EAAe,QAAhB,CAAwB,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CACvE,CAGA,SAAS,EAAW,CAAE,GAAG,GAA4D,CACnF,OAAO,EAACA,EAAe,MAAhB,CAAsB,YAAU,cAAc,GAAI,CAAQ,CAAA,CACnE,CAGA,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAe,OAAhB,CAAuB,YAAU,eAAe,GAAI,CAAQ,CAAA,CACrE,CAGA,SAAS,EAAa,CAAE,YAAW,GAAG,GAA8D,CAClG,OACE,EAACA,EAAe,QAAhB,CACE,YAAU,gBACV,UAAW,EACT,iCACA,+BACA,kCACA,iCACA,8BACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAKA,SAAS,EAAa,CACpB,YACA,WACA,OAAO,QACP,GAAG,GAIF,CACD,OACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAe,CAAA,EACf,EAACA,EAAe,QAAhB,CACE,YAAU,gBACV,UAAW,EACT,gBACA,2FAEA,+BACA,iCACA,kCACA,mCAEA,IAAS,SAAW,sDACpB,IAAS,SAAW,yCACpB,IAAS,SAAW,wCAEpB,IAAS,QAAU,qDACnB,IAAS,QAAU,wCACnB,IAAS,QAAU,uCAEnB,IAAS,OAAS,kCAClB,IAAS,OAAS,uCAClB,IAAS,OAAS,sCAElB,IAAS,UAAY,qCACrB,IAAS,UAAY,0CACrB,IAAS,UAAY,yCACrB,CACF,EACA,GAAI,EA5BN,SAAA,CA8BG,EACD,EAACA,EAAe,MAAhB,CACE,UAAW,EACT,4CACA,oEACA,iCACA,+BACA,oBACA,wBACA,yBACA,eACA,sBACF,EAXF,SAAA,CAaE,EAAC,EAAD,CAAO,UAAU,QAAU,CAAA,EAC3B,EAAC,OAAD,CAAM,UAAU,UAAU,SAAA,OAAW,CAAA,CACjB,CACA,CAAA,CAAA,CACb,CAAA,CAAA,CAAA,CAAA,CAEjB,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAG,iCAAkC,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC/G,CAGA,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAG,yCAA0C,CAAS,EAAG,GAAI,CAAQ,CAAA,CACvH,CAGA,SAAS,EAAW,CAAE,YAAW,GAAG,GAA4D,CAC9F,OAAO,EAACA,EAAe,MAAhB,CAAsB,YAAU,cAAc,UAAW,EAAG,0CAA2C,CAAS,EAAG,GAAI,CAAQ,CAAA,CACxI,CAGA,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAkE,CAC1G,OAAO,EAACA,EAAe,YAAhB,CAA4B,YAAU,oBAAoB,UAAW,EAAG,kCAAmC,CAAS,EAAG,GAAI,CAAQ,CAAA,CAC5I"}
@@ -0,0 +1,128 @@
1
+ //#region packages/components/layouts/ui-grid.d.ts
2
+ /**
3
+ * Container-query breakpoint keys used by `UIGrid`'s `cols` and `UIGridItem`'s
4
+ * `span`, resolved against the nearest ancestor `@container/ui-grid` (i.e. the
5
+ * grid's own rendered width, not the viewport). These match Tailwind v4's default
6
+ * container-query scale exactly:
7
+ * - `'base'` — always applied, no minimum width (the fallback/mobile-first value).
8
+ * - `'sm'` — applies from **384px** (`24rem`) and up.
9
+ * - `'md'` — applies from **448px** (`28rem`) and up.
10
+ * - `'lg'` — applies from **512px** (`32rem`) and up.
11
+ * - `'xl'` — applies from **576px** (`36rem`) and up.
12
+ * - `'2xl'` — applies from **672px** (`42rem`) and up.
13
+ * - `'3xl'` — applies from **768px** (`48rem`) and up.
14
+ *
15
+ * Whichever breakpoint's minimum width is currently satisfied (in ascending
16
+ * order) wins, same cascade behavior as Tailwind's ordinary `sm:`/`md:`/`lg:`
17
+ * responsive classes.
18
+ */
19
+ type TUIGridBreakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
20
+ type TUIGridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
21
+ type TUIGridColsConfig = TUIGridCols | Partial<Record<TUIGridBreakpoint, TUIGridCols>>;
22
+ declare const GAP_CLASS: {
23
+ readonly xs: "gap-1";
24
+ readonly sm: "gap-2";
25
+ readonly md: "gap-4";
26
+ readonly lg: "gap-6";
27
+ readonly xl: "gap-8";
28
+ readonly none: "gap-0";
29
+ };
30
+ type UIGridProps = React.PropsWithChildren<{
31
+ /** Additional Tailwind classes merged on top of the generated classes. */
32
+ className?: string;
33
+ /**
34
+ * Number of base grid columns (`1`–`12`). Every `UIGridItem`'s `span` is
35
+ * expressed against this same column count at every container width.
36
+ * - A plain number fixes the column count at every width.
37
+ * - An object varies the column count as the grid's own rendered width crosses
38
+ * each container-query breakpoint (see {@link TUIGridBreakpoint} for the
39
+ * exact pixel value of each key) — e.g. "narrow container → 4 columns, wide
40
+ * container → 12 columns".
41
+ * @default 12
42
+ * @example
43
+ * ```tsx
44
+ * // 4 cols below 448px, 8 cols from 448px, 12 cols from 512px up
45
+ * <UIGrid cols={{ base: 4, md: 8, lg: 12 }} />
46
+ * ```
47
+ */
48
+ cols?: TUIGridColsConfig;
49
+ /**
50
+ * Gap between grid cells, reusing the same scale as `Flex`'s `gap` prop.
51
+ * - `'none'` — `gap-0`
52
+ * - `'xs'` — `gap-1`
53
+ * - `'sm'` — `gap-2`
54
+ * - `'md'` — `gap-4` (default)
55
+ * - `'lg'` — `gap-6`
56
+ * - `'xl'` — `gap-8`
57
+ * @default 'md'
58
+ */
59
+ gap?: keyof typeof GAP_CLASS;
60
+ }>;
61
+ /**
62
+ * A 12-column CSS Grid container with a named `@container` context, so both its
63
+ * own column count and its `UIGridItem` children's `span` can vary based on the
64
+ * grid's own rendered width instead of the viewport.
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * import { UIGrid, UIGridItem } from '@customafk/lunas-ui/layouts/ui-grid';
69
+ *
70
+ * <UIGrid gap="md" cols={{ base: 4, md: 12 }}>
71
+ * <UIGridItem span={6}>Left</UIGridItem>
72
+ * <UIGridItem span={6}>Right</UIGridItem>
73
+ * </UIGrid>
74
+ * ```
75
+ */
76
+ declare const UIGrid: import("react").MemoExoticComponent<({ cols, gap, className, children }: UIGridProps) => import("react").JSX.Element>;
77
+ type TUIGridSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
78
+ type TUIGridItemSpan = TUIGridSpan | Partial<Record<TUIGridBreakpoint, TUIGridSpan>>;
79
+ type UIGridItemProps = React.PropsWithChildren<{
80
+ /** Additional Tailwind classes merged on top of the span classes. */
81
+ className?: string;
82
+ /**
83
+ * Number of the grid's columns this item should occupy (`1`–`12`).
84
+ * - A plain number fixes the span at every container width.
85
+ * - An object varies the span as the *grid's own* rendered width crosses each
86
+ * container-query breakpoint (see {@link TUIGridBreakpoint} for the exact
87
+ * pixel value of each key), not the viewport.
88
+ * @default 12
89
+ * @example
90
+ * ```tsx
91
+ * <UIGridItem span={6} />
92
+ * // full-width below 384px, half from 384px, a third from 448px up
93
+ * <UIGridItem span={{ base: 12, sm: 6, md: 4 }} />
94
+ * ```
95
+ */
96
+ span?: TUIGridItemSpan;
97
+ /**
98
+ * Wraps `children` in a `Suspense` boundary so a lazy-loaded cell (e.g. a
99
+ * `React.lazy()` component) doesn't block sibling items from rendering.
100
+ * @default true
101
+ */
102
+ suspense?: boolean;
103
+ /**
104
+ * Fallback UI shown while suspended children are loading. Only relevant when
105
+ * `suspense` is `true`.
106
+ * @default null
107
+ */
108
+ fallback?: React.ReactNode;
109
+ }>;
110
+ /**
111
+ * A single cell inside a `UIGrid`. Spans `12` of the grid's columns by default
112
+ * (a full-width row) and can vary its span per container-query breakpoint.
113
+ *
114
+ * @example
115
+ * ```tsx
116
+ * import { UIGrid, UIGridItem } from '@customafk/lunas-ui/layouts/ui-grid';
117
+ *
118
+ * <UIGrid>
119
+ * <UIGridItem span={{ base: 12, md: 6 }} suspense fallback={<Skeleton />}>
120
+ * <LazyWidget />
121
+ * </UIGridItem>
122
+ * </UIGrid>
123
+ * ```
124
+ */
125
+ declare const UIGridItem: import("react").MemoExoticComponent<({ span, className, children, suspense, fallback }: UIGridItemProps) => import("react").JSX.Element>;
126
+ //#endregion
127
+ export { TUIGridSpan as a, TUIGridItemSpan as i, TUIGridCols as n, UIGrid as o, TUIGridColsConfig as r, UIGridItem as s, TUIGridBreakpoint as t };
128
+ //# sourceMappingURL=ui-grid-CzL5J7cm.d.cts.map
@@ -0,0 +1,128 @@
1
+ //#region packages/components/layouts/ui-grid.d.ts
2
+ /**
3
+ * Container-query breakpoint keys used by `UIGrid`'s `cols` and `UIGridItem`'s
4
+ * `span`, resolved against the nearest ancestor `@container/ui-grid` (i.e. the
5
+ * grid's own rendered width, not the viewport). These match Tailwind v4's default
6
+ * container-query scale exactly:
7
+ * - `'base'` — always applied, no minimum width (the fallback/mobile-first value).
8
+ * - `'sm'` — applies from **384px** (`24rem`) and up.
9
+ * - `'md'` — applies from **448px** (`28rem`) and up.
10
+ * - `'lg'` — applies from **512px** (`32rem`) and up.
11
+ * - `'xl'` — applies from **576px** (`36rem`) and up.
12
+ * - `'2xl'` — applies from **672px** (`42rem`) and up.
13
+ * - `'3xl'` — applies from **768px** (`48rem`) and up.
14
+ *
15
+ * Whichever breakpoint's minimum width is currently satisfied (in ascending
16
+ * order) wins, same cascade behavior as Tailwind's ordinary `sm:`/`md:`/`lg:`
17
+ * responsive classes.
18
+ */
19
+ type TUIGridBreakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
20
+ type TUIGridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
21
+ type TUIGridColsConfig = TUIGridCols | Partial<Record<TUIGridBreakpoint, TUIGridCols>>;
22
+ declare const GAP_CLASS: {
23
+ readonly xs: "gap-1";
24
+ readonly sm: "gap-2";
25
+ readonly md: "gap-4";
26
+ readonly lg: "gap-6";
27
+ readonly xl: "gap-8";
28
+ readonly none: "gap-0";
29
+ };
30
+ type UIGridProps = React.PropsWithChildren<{
31
+ /** Additional Tailwind classes merged on top of the generated classes. */
32
+ className?: string;
33
+ /**
34
+ * Number of base grid columns (`1`–`12`). Every `UIGridItem`'s `span` is
35
+ * expressed against this same column count at every container width.
36
+ * - A plain number fixes the column count at every width.
37
+ * - An object varies the column count as the grid's own rendered width crosses
38
+ * each container-query breakpoint (see {@link TUIGridBreakpoint} for the
39
+ * exact pixel value of each key) — e.g. "narrow container → 4 columns, wide
40
+ * container → 12 columns".
41
+ * @default 12
42
+ * @example
43
+ * ```tsx
44
+ * // 4 cols below 448px, 8 cols from 448px, 12 cols from 512px up
45
+ * <UIGrid cols={{ base: 4, md: 8, lg: 12 }} />
46
+ * ```
47
+ */
48
+ cols?: TUIGridColsConfig;
49
+ /**
50
+ * Gap between grid cells, reusing the same scale as `Flex`'s `gap` prop.
51
+ * - `'none'` — `gap-0`
52
+ * - `'xs'` — `gap-1`
53
+ * - `'sm'` — `gap-2`
54
+ * - `'md'` — `gap-4` (default)
55
+ * - `'lg'` — `gap-6`
56
+ * - `'xl'` — `gap-8`
57
+ * @default 'md'
58
+ */
59
+ gap?: keyof typeof GAP_CLASS;
60
+ }>;
61
+ /**
62
+ * A 12-column CSS Grid container with a named `@container` context, so both its
63
+ * own column count and its `UIGridItem` children's `span` can vary based on the
64
+ * grid's own rendered width instead of the viewport.
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * import { UIGrid, UIGridItem } from '@customafk/lunas-ui/layouts/ui-grid';
69
+ *
70
+ * <UIGrid gap="md" cols={{ base: 4, md: 12 }}>
71
+ * <UIGridItem span={6}>Left</UIGridItem>
72
+ * <UIGridItem span={6}>Right</UIGridItem>
73
+ * </UIGrid>
74
+ * ```
75
+ */
76
+ declare const UIGrid: import("react").MemoExoticComponent<({ cols, gap, className, children }: UIGridProps) => import("react").JSX.Element>;
77
+ type TUIGridSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
78
+ type TUIGridItemSpan = TUIGridSpan | Partial<Record<TUIGridBreakpoint, TUIGridSpan>>;
79
+ type UIGridItemProps = React.PropsWithChildren<{
80
+ /** Additional Tailwind classes merged on top of the span classes. */
81
+ className?: string;
82
+ /**
83
+ * Number of the grid's columns this item should occupy (`1`–`12`).
84
+ * - A plain number fixes the span at every container width.
85
+ * - An object varies the span as the *grid's own* rendered width crosses each
86
+ * container-query breakpoint (see {@link TUIGridBreakpoint} for the exact
87
+ * pixel value of each key), not the viewport.
88
+ * @default 12
89
+ * @example
90
+ * ```tsx
91
+ * <UIGridItem span={6} />
92
+ * // full-width below 384px, half from 384px, a third from 448px up
93
+ * <UIGridItem span={{ base: 12, sm: 6, md: 4 }} />
94
+ * ```
95
+ */
96
+ span?: TUIGridItemSpan;
97
+ /**
98
+ * Wraps `children` in a `Suspense` boundary so a lazy-loaded cell (e.g. a
99
+ * `React.lazy()` component) doesn't block sibling items from rendering.
100
+ * @default true
101
+ */
102
+ suspense?: boolean;
103
+ /**
104
+ * Fallback UI shown while suspended children are loading. Only relevant when
105
+ * `suspense` is `true`.
106
+ * @default null
107
+ */
108
+ fallback?: React.ReactNode;
109
+ }>;
110
+ /**
111
+ * A single cell inside a `UIGrid`. Spans `12` of the grid's columns by default
112
+ * (a full-width row) and can vary its span per container-query breakpoint.
113
+ *
114
+ * @example
115
+ * ```tsx
116
+ * import { UIGrid, UIGridItem } from '@customafk/lunas-ui/layouts/ui-grid';
117
+ *
118
+ * <UIGrid>
119
+ * <UIGridItem span={{ base: 12, md: 6 }} suspense fallback={<Skeleton />}>
120
+ * <LazyWidget />
121
+ * </UIGridItem>
122
+ * </UIGrid>
123
+ * ```
124
+ */
125
+ declare const UIGridItem: import("react").MemoExoticComponent<({ span, className, children, suspense, fallback }: UIGridItemProps) => import("react").JSX.Element>;
126
+ //#endregion
127
+ export { TUIGridSpan as a, TUIGridItemSpan as i, TUIGridCols as n, UIGrid as o, TUIGridColsConfig as r, UIGridItem as s, TUIGridBreakpoint as t };
128
+ //# sourceMappingURL=ui-grid-CzL5J7cm.d.mts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@customafk/lunas-ui",
3
- "version": "0.2.80",
3
+ "version": "0.2.82",
4
4
  "description": "UI library for Lunas Enterprise",
5
5
  "type": "module",
6
6
  "author": {
@@ -104,6 +104,10 @@
104
104
  "require": "./dist/dialogs/loading-dialog.cjs",
105
105
  "import": "./dist/dialogs/loading-dialog.mjs"
106
106
  },
107
+ "./dialogs/side-panel": {
108
+ "require": "./dist/dialogs/side-panel.cjs",
109
+ "import": "./dist/dialogs/side-panel.mjs"
110
+ },
107
111
  "./features/charts": {
108
112
  "require": "./dist/features/charts/index.cjs",
109
113
  "import": "./dist/features/charts/index.mjs"
@@ -148,6 +152,10 @@
148
152
  "require": "./dist/layouts/grid.cjs",
149
153
  "import": "./dist/layouts/grid.mjs"
150
154
  },
155
+ "./layouts/ui-grid": {
156
+ "require": "./dist/layouts/ui-grid.cjs",
157
+ "import": "./dist/layouts/ui-grid.mjs"
158
+ },
151
159
  "./layouts/payment-layout": {
152
160
  "require": "./dist/layouts/payment-layout/index.cjs",
153
161
  "import": "./dist/layouts/payment-layout/index.mjs"
@@ -1,2 +0,0 @@
1
- import{Q as e}from"./tables-7_KgoyS-.mjs";import{memo as t,useMemo as n}from"react";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i}from"react/jsx-runtime";const a=t(({value:t,currency:a=`USD`,locale:o=`en-US`,display:s=`symbol`,size:c=`md`,colorize:l=!1})=>{let u=n(()=>{let e=typeof t==`string`?Number(t.trim()):t;return e==null||Number.isNaN(e)||!Number.isFinite(e)?null:new Intl.NumberFormat(o,{style:`currency`,currency:a,currencyDisplay:s,minimumFractionDigits:0,maximumFractionDigits:0}).format(e)},[t,a,o,s]),d=n(()=>{let e=typeof t==`string`?Number(t.trim()):t;return typeof e==`number`&&e<0},[t]);return u?i(`p`,{className:r(`font-number tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`,!l&&`text-text-positive`,l&&d&&`text-danger-strong`,l&&!d&&`text-success-strong`),children:u}):i(e,{})});a.displayName=`UITableCurrencyDisplay`;export{a as UITableCurrencyDisplay};
2
- //# sourceMappingURL=currency-display-CanjOswc.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currency-display-CanjOswc.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/currency-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableCurrencyDisplay} component. */\ntype Props = {\n /** The numeric value to format as currency; falsy / `NaN` renders an empty state. */\n value: number | string | null | undefined;\n /** ISO 4217 currency code (default: `'USD'`). */\n currency?: string;\n /**\n * BCP 47 locale used for number formatting (default: `'en-US'`).\n * Controls digit grouping and decimal separators.\n */\n locale?: string;\n /** How to display the currency symbol — `'symbol'` (default), `'code'`, or `'name'`. */\n display?: 'symbol' | 'code' | 'name';\n /** Font-size variant (default: `'md'`). */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** When `true`, applies a green tint for positive and red tint for negative values. */\n colorize?: boolean;\n};\n\n/**\n * Formats a numeric value as a locale-aware currency string in a table cell.\n * Always shows exactly two decimal places and uses the browser's `Intl` API for\n * symbol placement. Renders {@link UITableEmpty} when the value is absent or\n * invalid.\n *\n * @example\n * import { UITableCurrencyDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableCurrencyDisplay value={1234.5} currency=\"USD\" colorize />\n */\nexport const UITableCurrencyDisplay = memo(({ value, currency = 'USD', locale = 'en-US', display = 'symbol', size = 'md', colorize = false }: Props) => {\n const formatted = useMemo(() => {\n const num = typeof value === 'string' ? Number(value.trim()) : value;\n if (num === null || num === undefined || Number.isNaN(num) || !Number.isFinite(num)) return null;\n\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n currencyDisplay: display,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(num);\n }, [value, currency, locale, display]);\n\n const isNegative = useMemo(() => {\n const num = typeof value === 'string' ? Number(value.trim()) : value;\n return typeof num === 'number' && num < 0;\n }, [value]);\n\n if (!formatted) return <UITableEmpty />;\n\n return (\n <p\n className={cn(\n 'font-number 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 !colorize && 'text-text-positive',\n colorize && isNegative && 'text-danger-strong',\n colorize && !isNegative && 'text-success-strong'\n )}\n >\n {formatted}\n </p>\n );\n});\nUITableCurrencyDisplay.displayName = 'UITableCurrencyDisplay';\n"],"mappings":"gLAsCA,MAAa,EAAyB,GAAM,CAAE,QAAO,WAAW,MAAO,SAAS,QAAS,UAAU,SAAU,OAAO,KAAM,WAAW,MAAmB,CACtJ,IAAM,EAAY,MAAc,CAC9B,IAAM,EAAM,OAAO,GAAU,SAAW,OAAO,EAAM,KAAK,CAAC,EAAI,EAG/D,OAFI,GAAQ,MAA6B,OAAO,MAAM,CAAG,GAAK,CAAC,OAAO,SAAS,CAAG,EAAU,KAErF,IAAI,KAAK,aAAa,EAAQ,CACnC,MAAO,WACP,WACA,gBAAiB,EACjB,sBAAuB,EACvB,sBAAuB,CACzB,CAAC,CAAC,CAAC,OAAO,CAAG,CACf,EAAG,CAAC,EAAO,EAAU,EAAQ,CAAO,CAAC,EAE/B,EAAa,MAAc,CAC/B,IAAM,EAAM,OAAO,GAAU,SAAW,OAAO,EAAM,KAAK,CAAC,EAAI,EAC/D,OAAO,OAAO,GAAQ,UAAY,EAAM,CAC1C,EAAG,CAAC,CAAK,CAAC,EAIV,OAFK,EAGH,EAAC,IAAD,CACE,UAAW,EACT,2BACA,IAAS,MAAQ,UACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,YACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,UACjB,CAAC,GAAY,qBACb,GAAY,GAAc,qBAC1B,GAAY,CAAC,GAAc,qBAC7B,EAEC,SAAA,CACA,CAAA,EAjBkB,EAAC,EAAD,CAAe,CAAA,CAmBxC,CAAC,EACD,EAAuB,YAAc"}
@@ -1,2 +0,0 @@
1
- const e=require("./tables-CS3NhgTc.cjs");let t=require("react"),n=require("@customafk/react-toolkit/utils"),r=require("react/jsx-runtime");const i=(0,t.memo)(({value:i,currency:a=`USD`,locale:o=`en-US`,display:s=`symbol`,size:c=`md`,colorize:l=!1})=>{let u=(0,t.useMemo)(()=>{let e=typeof i==`string`?Number(i.trim()):i;return e==null||Number.isNaN(e)||!Number.isFinite(e)?null:new Intl.NumberFormat(o,{style:`currency`,currency:a,currencyDisplay:s,minimumFractionDigits:0,maximumFractionDigits:0}).format(e)},[i,a,o,s]),d=(0,t.useMemo)(()=>{let e=typeof i==`string`?Number(i.trim()):i;return typeof e==`number`&&e<0},[i]);return u?(0,r.jsx)(`p`,{className:(0,n.cn)(`font-number tabular-nums`,c===`xs`&&`text-xs`,c===`sm`&&`text-sm`,c===`md`&&`text-base`,c===`lg`&&`text-lg`,c===`xl`&&`text-xl`,!l&&`text-text-positive`,l&&d&&`text-danger-strong`,l&&!d&&`text-success-strong`),children:u}):(0,r.jsx)(e.Q,{})});i.displayName=`UITableCurrencyDisplay`,exports.UITableCurrencyDisplay=i;
2
- //# sourceMappingURL=currency-display-xxK62yo4.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"currency-display-xxK62yo4.cjs","names":["UITableEmpty"],"sources":["../packages/components/features/tables/components/atoms/currency-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableCurrencyDisplay} component. */\ntype Props = {\n /** The numeric value to format as currency; falsy / `NaN` renders an empty state. */\n value: number | string | null | undefined;\n /** ISO 4217 currency code (default: `'USD'`). */\n currency?: string;\n /**\n * BCP 47 locale used for number formatting (default: `'en-US'`).\n * Controls digit grouping and decimal separators.\n */\n locale?: string;\n /** How to display the currency symbol — `'symbol'` (default), `'code'`, or `'name'`. */\n display?: 'symbol' | 'code' | 'name';\n /** Font-size variant (default: `'md'`). */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** When `true`, applies a green tint for positive and red tint for negative values. */\n colorize?: boolean;\n};\n\n/**\n * Formats a numeric value as a locale-aware currency string in a table cell.\n * Always shows exactly two decimal places and uses the browser's `Intl` API for\n * symbol placement. Renders {@link UITableEmpty} when the value is absent or\n * invalid.\n *\n * @example\n * import { UITableCurrencyDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableCurrencyDisplay value={1234.5} currency=\"USD\" colorize />\n */\nexport const UITableCurrencyDisplay = memo(({ value, currency = 'USD', locale = 'en-US', display = 'symbol', size = 'md', colorize = false }: Props) => {\n const formatted = useMemo(() => {\n const num = typeof value === 'string' ? Number(value.trim()) : value;\n if (num === null || num === undefined || Number.isNaN(num) || !Number.isFinite(num)) return null;\n\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n currencyDisplay: display,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(num);\n }, [value, currency, locale, display]);\n\n const isNegative = useMemo(() => {\n const num = typeof value === 'string' ? Number(value.trim()) : value;\n return typeof num === 'number' && num < 0;\n }, [value]);\n\n if (!formatted) return <UITableEmpty />;\n\n return (\n <p\n className={cn(\n 'font-number 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 !colorize && 'text-text-positive',\n colorize && isNegative && 'text-danger-strong',\n colorize && !isNegative && 'text-success-strong'\n )}\n >\n {formatted}\n </p>\n );\n});\nUITableCurrencyDisplay.displayName = 'UITableCurrencyDisplay';\n"],"mappings":"2IAsCA,MAAa,GAAA,EAAA,EAAA,KAAA,EAA+B,CAAE,QAAO,WAAW,MAAO,SAAS,QAAS,UAAU,SAAU,OAAO,KAAM,WAAW,MAAmB,CACtJ,IAAM,GAAA,EAAA,EAAA,QAAA,KAA0B,CAC9B,IAAM,EAAM,OAAO,GAAU,SAAW,OAAO,EAAM,KAAK,CAAC,EAAI,EAG/D,OAFI,GAAQ,MAA6B,OAAO,MAAM,CAAG,GAAK,CAAC,OAAO,SAAS,CAAG,EAAU,KAErF,IAAI,KAAK,aAAa,EAAQ,CACnC,MAAO,WACP,WACA,gBAAiB,EACjB,sBAAuB,EACvB,sBAAuB,CACzB,CAAC,CAAC,CAAC,OAAO,CAAG,CACf,EAAG,CAAC,EAAO,EAAU,EAAQ,CAAO,CAAC,EAE/B,GAAA,EAAA,EAAA,QAAA,KAA2B,CAC/B,IAAM,EAAM,OAAO,GAAU,SAAW,OAAO,EAAM,KAAK,CAAC,EAAI,EAC/D,OAAO,OAAO,GAAQ,UAAY,EAAM,CAC1C,EAAG,CAAC,CAAK,CAAC,EAIV,OAFK,GAGH,EAAA,EAAA,IAAA,CAAC,IAAD,CACE,WAAA,EAAA,EAAA,GAAA,CACE,2BACA,IAAS,MAAQ,UACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,YACjB,IAAS,MAAQ,UACjB,IAAS,MAAQ,UACjB,CAAC,GAAY,qBACb,GAAY,GAAc,qBAC1B,GAAY,CAAC,GAAc,qBAC7B,EAEC,SAAA,CACA,CAAA,GAjBkB,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,CAmBxC,CAAC,EACD,EAAuB,YAAc"}
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./tables-CS3NhgTc.cjs"),n=require("./ui/checkbox.cjs"),r=require("./ui/dropdown-menu.cjs"),i=require("./ui/resizable.cjs"),a=require("./ui/popover.cjs"),o=require("./ui/input.cjs"),s=require("./ui/separator.cjs"),c=require("./ui/label.cjs"),l=require("./ui/select.cjs");let u=require("lucide-react"),d=require("react"),f=require("@customafk/react-toolkit/utils"),p=require("react/jsx-runtime");const m={tag:(0,p.jsx)(u.TagIcon,{size:14}),"single-tag":(0,p.jsx)(u.TagIcon,{size:14}),"date-range":(0,p.jsx)(u.CalendarIcon,{size:14}),number:(0,p.jsx)(u.HashIcon,{size:14}),text:(0,p.jsx)(u.TypeIcon,{size:14}),boolean:(0,p.jsx)(u.ToggleLeftIcon,{size:14})},h=[{value:`eq`,label:`Bằng (=)`},{value:`ne`,label:`Không bằng (≠)`},{value:`gt`,label:`Lớn hơn (>)`},{value:`gte`,label:`Ít nhất (≥)`},{value:`lt`,label:`Nhỏ hơn (<)`},{value:`lte`,label:`Nhiều nhất (≤)`},{value:`between`,label:`Trong khoảng`}],g=[{value:`contains`,label:`Chứa`},{value:`equals`,label:`Bằng`},{value:`starts-with`,label:`Bắt đầu bằng`},{value:`ends-with`,label:`Kết thúc bằng`}];function _(e,t){switch(e.type){case`single-tag`:return e.value?t.options?.find(t=>t.value===e.value)?.label??e.value:`Chưa đặt`;case`tag`:return e.values.length?e.values.map(e=>t.options?.find(t=>t.value===e)?.label??e).join(`, `):`Chưa đặt`;case`date-range`:return!e.from&&!e.to?`Ngày không xác định`:e.from&&e.to?`${e.from} → ${e.to}`:e.from?`từ ${e.from}`:`đến ${e.to}`;case`number`:{let t={eq:`=`,ne:`≠`,gt:`>`,gte:`≥`,lt:`<`,lte:`≤`,between:`trong khoảng`}[e.operator];return e.value===void 0?t:e.operator===`between`?`${t} ${e.value} – ${e.valueTo??`?`}`:`${t} ${e.value}`}case`text`:{let t={contains:`chứa`,equals:`là`,"starts-with":`bắt đầu bằng`,"ends-with":`kết thúc bằng`}[e.operator];return e.value?`${t} "${e.value}"`:t}case`boolean`:return e.value===null?`Không xác định`:e.value?`Có`:`Không`}}const v=({value:e,definition:t,onChange:r})=>(0,p.jsx)(`div`,{className:`flex flex-col gap-1 p-3`,children:(t.options??[]).length===0?(0,p.jsx)(`p`,{className:`text-xs text-text-positive-muted`,children:`Không có tùy chọn`}):t.options.map(t=>(0,p.jsxs)(c.Label,{className:(0,f.cn)(`flex items-center gap-2 bg-secondary-bg-subtle hover:bg-secondary-muted px-4 py-2 rounded transition-colors`,e.values.includes(t.value)&&`bg-primary-muted hover:bg-primary-subtle`),children:[(0,p.jsx)(n.Checkbox,{checked:e.values.includes(t.value),onCheckedChange:n=>{r({type:`tag`,values:n?[...e.values,t.value]:e.values.filter(e=>e!==t.value)})}}),(0,p.jsx)(`span`,{className:`text-sm`,children:t.label})]},t.value))}),y=({value:e,definition:t,onChange:r})=>(0,p.jsx)(`div`,{className:`flex flex-col gap-1 p-3`,children:(t.options??[]).length===0?(0,p.jsx)(`p`,{className:`text-xs text-text-positive-muted`,children:`Không có tùy chọn`}):t.options.map(t=>(0,p.jsxs)(c.Label,{className:(0,f.cn)(`flex items-center gap-2 bg-secondary-bg-subtle hover:bg-secondary-muted px-4 py-2 rounded transition-colors`,e.value===t.value&&`bg-primary-muted hover:bg-primary-subtle`),children:[(0,p.jsx)(n.Checkbox,{checked:e.value===t.value,onCheckedChange:e=>{r({type:`single-tag`,value:e?t.value:null})}}),(0,p.jsx)(`span`,{className:`text-sm`,children:t.label})]},t.value))}),b=({value:e,onChange:t})=>(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 p-3`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`span`,{className:`text-text-positive-muted text-xs`,children:`Từ ngày`}),(0,p.jsx)(o.Input,{type:`date`,size:`md`,value:e.from??``,onValueChange:n=>t({...e,from:n||void 0})})]}),(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`span`,{className:`text-text-positive-muted text-xs`,children:`Đến ngày`}),(0,p.jsx)(o.Input,{type:`date`,size:`md`,value:e.to??``,onValueChange:n=>t({...e,to:n||void 0})})]})]}),x=({value:e,onChange:t})=>(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 p-3`,children:[(0,p.jsxs)(l.Select,{value:e.operator,onValueChange:n=>t({...e,operator:n}),children:[(0,p.jsx)(l.SelectTrigger,{size:`sm`,children:(0,p.jsx)(l.SelectValue,{})}),(0,p.jsx)(l.SelectContent,{children:h.map(e=>(0,p.jsx)(l.SelectItem,{value:e.value,children:e.label},e.value))})]}),(0,p.jsx)(o.Input,{type:`number`,size:`md`,placeholder:`Giá trị`,value:e.value??``,onValueChange:n=>t({...e,value:n?Number(n):void 0})}),e.operator===`between`&&(0,p.jsx)(o.Input,{type:`number`,size:`md`,placeholder:`Đến giá trị`,value:e.valueTo??``,onValueChange:n=>t({...e,valueTo:n?Number(n):void 0})})]}),S=({value:e,onChange:t})=>(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 p-3`,children:[(0,p.jsxs)(l.Select,{value:e.operator,onValueChange:n=>t({...e,operator:n}),children:[(0,p.jsx)(l.SelectTrigger,{size:`sm`,children:(0,p.jsx)(l.SelectValue,{})}),(0,p.jsx)(l.SelectContent,{children:g.map(e=>(0,p.jsx)(l.SelectItem,{value:e.value,children:e.label},e.value))})]}),(0,p.jsx)(o.Input,{type:`text`,size:`md`,placeholder:`Nhập văn bản...`,value:e.value,onValueChange:n=>t({...e,value:n})})]}),C=[{label:`Có`,value:!0},{label:`Không`,value:!1},{label:`Không xác định`,value:null}],w=({value:t,onChange:n})=>(0,p.jsx)(`div`,{className:`flex flex-col gap-1 p-3`,children:C.map(({label:r,value:i})=>(0,p.jsx)(e.Button,{type:`button`,tabIndex:-1,variant:`outline`,className:(0,f.cn)(`rounded px-3 py-1.5 text-left text-sm transition-colors`,t.value===i?`bg-primary-muted font-medium`:`hover:bg-muted-bg-subtle`),onClick:()=>n({type:`boolean`,value:i}),children:r},r))});function T({value:e,definition:t,onChange:n}){switch(e.type){case`tag`:return(0,p.jsx)(v,{value:e,definition:t,onChange:n});case`single-tag`:return(0,p.jsx)(y,{value:e,definition:t,onChange:n});case`date-range`:return(0,p.jsx)(b,{value:e,onChange:n});case`number`:return(0,p.jsx)(x,{value:e,onChange:n});case`text`:return(0,p.jsx)(S,{value:e,onChange:n});case`boolean`:return(0,p.jsx)(w,{value:e,onChange:n})}}const E=({filter:t,definition:n,onRemove:r,onUpdate:i})=>(0,p.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,p.jsxs)(a.Popover,{children:[(0,p.jsx)(a.PopoverTrigger,{asChild:!0,children:(0,p.jsxs)(e.Button,{type:`button`,variant:`outline`,color:`muted`,className:`flex-1 bg-white max-w-[calc(100%-32px)] justify-start`,innerClassName:`flex truncate gap-1.5`,children:[(0,p.jsx)(`span`,{className:`shrink-0 text-text-positive font-medium`,children:n.label}),(0,p.jsx)(`span`,{className:`truncate text-xs text-text-positive-weak`,children:_(t.value,n)})]})}),(0,p.jsxs)(a.PopoverContent,{className:`w-64 p-0`,align:`start`,side:`bottom`,children:[(0,p.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`text-text-positive-muted`,children:m[n.type]}),(0,p.jsx)(`p`,{className:`font-medium`,children:n.label})]})}),(0,p.jsx)(T,{value:t.value,definition:n,onChange:i})]})]}),(0,p.jsx)(e.Button,{type:`button`,size:`icon`,variant:`soft`,color:`danger`,className:`shrink`,onClick:r,children:(0,p.jsx)(u.Trash2Icon,{size:13})})]}),D=()=>{let{filterDefinitions:n,activeFilters:a,addFilter:o,removeFilter:c,updateFilter:l}=t.X(),[h,g]=(0,d.useState)(null),_=n.filter(e=>!a.some(t=>t.definitionId===e.id));return(0,p.jsx)(i.ResizablePanel,{defaultSize:25,className:(0,f.cn)(`bg-card`,h===null?`max-w-8!`:`min-w-64`),children:(0,p.jsxs)(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[(0,p.jsx)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:(0,p.jsx)(d.Activity,{mode:h===`filters`?`visible`:`hidden`,children:(0,p.jsxs)(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,p.jsx)(`p`,{className:`font-medium`,children:`Bộ lọc`}),(0,p.jsxs)(r.DropdownMenu,{children:[(0,p.jsx)(r.DropdownMenuTrigger,{asChild:!0,children:(0,p.jsxs)(e.Button,{variant:`outline`,color:`muted`,disabled:_.length===0,children:[(0,p.jsx)(u.ListFilterPlus,{size:13}),`Thêm bộ lọc`]})}),(0,p.jsx)(r.DropdownMenuContent,{align:`end`,children:_.map(e=>(0,p.jsxs)(r.DropdownMenuItem,{className:`flex items-center gap-2`,onClick:()=>o(e.id),children:[m[e.type],e.label]},e.id))})]})]}),(0,p.jsx)(s.Separator,{}),a.length===0?(0,p.jsx)(`p`,{className:`py-6 text-center text-xs text-text-positive-muted`,children:`Không có bộ lọc nào`}):(0,p.jsx)(`div`,{className:`flex flex-col gap-2 pt-1`,children:a.map(e=>{let t=n.find(t=>t.id===e.definitionId);return t?(0,p.jsx)(E,{filter:e,definition:t,onRemove:()=>c(e.id),onUpdate:t=>l(e.id,t)},e.id):null})})]})})}),(0,p.jsxs)(`div`,{className:`flex h-full flex-col border-l border-border bg-muted-bg-subtle text-sm`,children:[(0,p.jsxs)(`button`,{type:`button`,className:(0,f.cn)(`relative flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,h===`filters`&&`bg-card`),onClick:()=>g(h===`filters`?null:`filters`),children:[(0,p.jsx)(u.ListFilterIcon,{size:18}),a.length>0&&(0,p.jsx)(`span`,{className:`absolute top-2 right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[10px] leading-none text-primary-foreground`,children:a.length}),(0,p.jsx)(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Bộ lọc`})]}),(0,p.jsx)(s.Separator,{})]})]})})};exports.UITableFilter=D;
2
- //# sourceMappingURL=filter-B5EnnL9I.cjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{X as t}from"./tables-7_KgoyS-.mjs";import{Checkbox as n}from"./ui/checkbox.mjs";import{DropdownMenu as r,DropdownMenuContent as i,DropdownMenuItem as a,DropdownMenuTrigger as o}from"./ui/dropdown-menu.mjs";import{ResizablePanel as s}from"./ui/resizable.mjs";import{Popover as c,PopoverContent as l,PopoverTrigger as u}from"./ui/popover.mjs";import{Input as d}from"./ui/input.mjs";import{Separator as f}from"./ui/separator.mjs";import{Label as p}from"./ui/label.mjs";import{Select as m,SelectContent as h,SelectItem as g,SelectTrigger as _,SelectValue as v}from"./ui/select.mjs";import{CalendarIcon as y,HashIcon as b,ListFilterIcon as x,ListFilterPlus as S,TagIcon as C,ToggleLeftIcon as w,Trash2Icon as T,TypeIcon as E}from"lucide-react";import{Activity as D,useState as O}from"react";import{cn as k}from"@customafk/react-toolkit/utils";import{jsx as A,jsxs as j}from"react/jsx-runtime";const M={tag:A(C,{size:14}),"single-tag":A(C,{size:14}),"date-range":A(y,{size:14}),number:A(b,{size:14}),text:A(E,{size:14}),boolean:A(w,{size:14})},N=[{value:`eq`,label:`Bằng (=)`},{value:`ne`,label:`Không bằng (≠)`},{value:`gt`,label:`Lớn hơn (>)`},{value:`gte`,label:`Ít nhất (≥)`},{value:`lt`,label:`Nhỏ hơn (<)`},{value:`lte`,label:`Nhiều nhất (≤)`},{value:`between`,label:`Trong khoảng`}],P=[{value:`contains`,label:`Chứa`},{value:`equals`,label:`Bằng`},{value:`starts-with`,label:`Bắt đầu bằng`},{value:`ends-with`,label:`Kết thúc bằng`}];function F(e,t){switch(e.type){case`single-tag`:return e.value?t.options?.find(t=>t.value===e.value)?.label??e.value:`Chưa đặt`;case`tag`:return e.values.length?e.values.map(e=>t.options?.find(t=>t.value===e)?.label??e).join(`, `):`Chưa đặt`;case`date-range`:return!e.from&&!e.to?`Ngày không xác định`:e.from&&e.to?`${e.from} → ${e.to}`:e.from?`từ ${e.from}`:`đến ${e.to}`;case`number`:{let t={eq:`=`,ne:`≠`,gt:`>`,gte:`≥`,lt:`<`,lte:`≤`,between:`trong khoảng`}[e.operator];return e.value===void 0?t:e.operator===`between`?`${t} ${e.value} – ${e.valueTo??`?`}`:`${t} ${e.value}`}case`text`:{let t={contains:`chứa`,equals:`là`,"starts-with":`bắt đầu bằng`,"ends-with":`kết thúc bằng`}[e.operator];return e.value?`${t} "${e.value}"`:t}case`boolean`:return e.value===null?`Không xác định`:e.value?`Có`:`Không`}}const I=({value:e,definition:t,onChange:r})=>A(`div`,{className:`flex flex-col gap-1 p-3`,children:(t.options??[]).length===0?A(`p`,{className:`text-xs text-text-positive-muted`,children:`Không có tùy chọn`}):t.options.map(t=>j(p,{className:k(`flex items-center gap-2 bg-secondary-bg-subtle hover:bg-secondary-muted px-4 py-2 rounded transition-colors`,e.values.includes(t.value)&&`bg-primary-muted hover:bg-primary-subtle`),children:[A(n,{checked:e.values.includes(t.value),onCheckedChange:n=>{r({type:`tag`,values:n?[...e.values,t.value]:e.values.filter(e=>e!==t.value)})}}),A(`span`,{className:`text-sm`,children:t.label})]},t.value))}),L=({value:e,definition:t,onChange:r})=>A(`div`,{className:`flex flex-col gap-1 p-3`,children:(t.options??[]).length===0?A(`p`,{className:`text-xs text-text-positive-muted`,children:`Không có tùy chọn`}):t.options.map(t=>j(p,{className:k(`flex items-center gap-2 bg-secondary-bg-subtle hover:bg-secondary-muted px-4 py-2 rounded transition-colors`,e.value===t.value&&`bg-primary-muted hover:bg-primary-subtle`),children:[A(n,{checked:e.value===t.value,onCheckedChange:e=>{r({type:`single-tag`,value:e?t.value:null})}}),A(`span`,{className:`text-sm`,children:t.label})]},t.value))}),R=({value:e,onChange:t})=>j(`div`,{className:`flex flex-col gap-3 p-3`,children:[j(`div`,{className:`flex flex-col gap-1`,children:[A(`span`,{className:`text-text-positive-muted text-xs`,children:`Từ ngày`}),A(d,{type:`date`,size:`md`,value:e.from??``,onValueChange:n=>t({...e,from:n||void 0})})]}),j(`div`,{className:`flex flex-col gap-1`,children:[A(`span`,{className:`text-text-positive-muted text-xs`,children:`Đến ngày`}),A(d,{type:`date`,size:`md`,value:e.to??``,onValueChange:n=>t({...e,to:n||void 0})})]})]}),z=({value:e,onChange:t})=>j(`div`,{className:`flex flex-col gap-3 p-3`,children:[j(m,{value:e.operator,onValueChange:n=>t({...e,operator:n}),children:[A(_,{size:`sm`,children:A(v,{})}),A(h,{children:N.map(e=>A(g,{value:e.value,children:e.label},e.value))})]}),A(d,{type:`number`,size:`md`,placeholder:`Giá trị`,value:e.value??``,onValueChange:n=>t({...e,value:n?Number(n):void 0})}),e.operator===`between`&&A(d,{type:`number`,size:`md`,placeholder:`Đến giá trị`,value:e.valueTo??``,onValueChange:n=>t({...e,valueTo:n?Number(n):void 0})})]}),B=({value:e,onChange:t})=>j(`div`,{className:`flex flex-col gap-3 p-3`,children:[j(m,{value:e.operator,onValueChange:n=>t({...e,operator:n}),children:[A(_,{size:`sm`,children:A(v,{})}),A(h,{children:P.map(e=>A(g,{value:e.value,children:e.label},e.value))})]}),A(d,{type:`text`,size:`md`,placeholder:`Nhập văn bản...`,value:e.value,onValueChange:n=>t({...e,value:n})})]}),V=[{label:`Có`,value:!0},{label:`Không`,value:!1},{label:`Không xác định`,value:null}],H=({value:t,onChange:n})=>A(`div`,{className:`flex flex-col gap-1 p-3`,children:V.map(({label:r,value:i})=>A(e,{type:`button`,tabIndex:-1,variant:`outline`,className:k(`rounded px-3 py-1.5 text-left text-sm transition-colors`,t.value===i?`bg-primary-muted font-medium`:`hover:bg-muted-bg-subtle`),onClick:()=>n({type:`boolean`,value:i}),children:r},r))});function U({value:e,definition:t,onChange:n}){switch(e.type){case`tag`:return A(I,{value:e,definition:t,onChange:n});case`single-tag`:return A(L,{value:e,definition:t,onChange:n});case`date-range`:return A(R,{value:e,onChange:n});case`number`:return A(z,{value:e,onChange:n});case`text`:return A(B,{value:e,onChange:n});case`boolean`:return A(H,{value:e,onChange:n})}}const W=({filter:t,definition:n,onRemove:r,onUpdate:i})=>j(`div`,{className:`flex items-center gap-1`,children:[j(c,{children:[A(u,{asChild:!0,children:j(e,{type:`button`,variant:`outline`,color:`muted`,className:`flex-1 bg-white max-w-[calc(100%-32px)] justify-start`,innerClassName:`flex truncate gap-1.5`,children:[A(`span`,{className:`shrink-0 text-text-positive font-medium`,children:n.label}),A(`span`,{className:`truncate text-xs text-text-positive-weak`,children:F(t.value,n)})]})}),j(l,{className:`w-64 p-0`,align:`start`,side:`bottom`,children:[A(`div`,{className:`border-b border-border px-3 py-2`,children:j(`div`,{className:`flex items-center gap-1.5`,children:[A(`span`,{className:`text-text-positive-muted`,children:M[n.type]}),A(`p`,{className:`font-medium`,children:n.label})]})}),A(U,{value:t.value,definition:n,onChange:i})]})]}),A(e,{type:`button`,size:`icon`,variant:`soft`,color:`danger`,className:`shrink`,onClick:r,children:A(T,{size:13})})]}),G=()=>{let{filterDefinitions:n,activeFilters:c,addFilter:l,removeFilter:u,updateFilter:d}=t(),[p,m]=O(null),h=n.filter(e=>!c.some(t=>t.definitionId===e.id));return A(s,{defaultSize:25,className:k(`bg-card`,p===null?`max-w-8!`:`min-w-64`),children:j(`div`,{className:`relative z-20 flex size-full bg-muted-bg-subtle`,children:[A(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:A(D,{mode:p===`filters`?`visible`:`hidden`,children:j(`div`,{className:`flex size-full flex-col gap-2 p-4`,children:[j(`div`,{className:`flex items-center justify-between gap-2`,children:[A(`p`,{className:`font-medium`,children:`Bộ lọc`}),j(r,{children:[A(o,{asChild:!0,children:j(e,{variant:`outline`,color:`muted`,disabled:h.length===0,children:[A(S,{size:13}),`Thêm bộ lọc`]})}),A(i,{align:`end`,children:h.map(e=>j(a,{className:`flex items-center gap-2`,onClick:()=>l(e.id),children:[M[e.type],e.label]},e.id))})]})]}),A(f,{}),c.length===0?A(`p`,{className:`py-6 text-center text-xs text-text-positive-muted`,children:`Không có bộ lọc nào`}):A(`div`,{className:`flex flex-col gap-2 pt-1`,children:c.map(e=>{let t=n.find(t=>t.id===e.definitionId);return t?A(W,{filter:e,definition:t,onRemove:()=>u(e.id),onUpdate:t=>d(e.id,t)},e.id):null})})]})})}),j(`div`,{className:`flex h-full flex-col border-l border-border bg-muted-bg-subtle text-sm`,children:[j(`button`,{type:`button`,className:k(`relative flex h-32 cursor-pointer flex-col items-center gap-y-2 p-2 py-4`,p===`filters`&&`bg-card`),onClick:()=>m(p===`filters`?null:`filters`),children:[A(x,{size:18}),c.length>0&&A(`span`,{className:`absolute top-2 right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[10px] leading-none text-primary-foreground`,children:c.length}),A(`span`,{className:`text-nowrap [writing-mode:vertical-lr]`,children:`Bộ lọc`})]}),A(f,{})]})]})})};export{G as UITableFilter};
2
- //# sourceMappingURL=filter-BCNjqiBx.mjs.map
@@ -1,2 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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