@tirth_jasoliya/ui 1.0.10 → 1.0.11

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 (70) hide show
  1. package/dist/components/data/data-table/data-table-action-bar.cjs +1 -1
  2. package/dist/components/data/data-table/data-table-action-bar.cjs.map +1 -1
  3. package/dist/components/data/data-table/data-table-action-bar.js +1 -1
  4. package/dist/components/data/data-table/data-table-action-bar.js.map +1 -1
  5. package/dist/components/data/data-table/data-table-pagination.cjs +1 -1
  6. package/dist/components/data/data-table/data-table-pagination.cjs.map +1 -1
  7. package/dist/components/data/data-table/data-table-pagination.js +1 -1
  8. package/dist/components/data/data-table/data-table-pagination.js.map +1 -1
  9. package/dist/components/data/data-table/data-table-toolbar.cjs +1 -1
  10. package/dist/components/data/data-table/data-table-toolbar.cjs.map +1 -1
  11. package/dist/components/data/data-table/data-table-toolbar.d.cts +6 -2
  12. package/dist/components/data/data-table/data-table-toolbar.d.ts +6 -2
  13. package/dist/components/data/data-table/data-table-toolbar.js +1 -1
  14. package/dist/components/data/data-table/data-table-toolbar.js.map +1 -1
  15. package/dist/components/data/data-table/data-table-types.cjs +1 -1
  16. package/dist/components/data/data-table/data-table-types.cjs.map +1 -1
  17. package/dist/components/data/data-table/data-table-types.d.cts +48 -2
  18. package/dist/components/data/data-table/data-table-types.d.ts +48 -2
  19. package/dist/components/data/data-table/data-table.cjs +1 -1
  20. package/dist/components/data/data-table/data-table.cjs.map +1 -1
  21. package/dist/components/data/data-table/data-table.d.cts +1 -1
  22. package/dist/components/data/data-table/data-table.d.ts +1 -1
  23. package/dist/components/data/data-table/data-table.js +1 -1
  24. package/dist/components/data/data-table/data-table.js.map +1 -1
  25. package/dist/components/data/data-table/index.cjs +1 -1
  26. package/dist/components/data/data-table/index.cjs.map +1 -1
  27. package/dist/components/data/data-table/index.js +1 -1
  28. package/dist/components/data/data-table/index.js.map +1 -1
  29. package/dist/components/date-helper.cjs +3 -0
  30. package/dist/components/date-helper.cjs.map +1 -0
  31. package/dist/components/date-helper.d.cts +27 -0
  32. package/dist/components/date-helper.d.ts +27 -0
  33. package/dist/components/date-helper.js +3 -0
  34. package/dist/components/date-helper.js.map +1 -0
  35. package/dist/components/helper/date-filter.cjs +3 -0
  36. package/dist/components/helper/date-filter.cjs.map +1 -0
  37. package/dist/components/helper/date-filter.d.cts +14 -0
  38. package/dist/components/helper/date-filter.d.ts +14 -0
  39. package/dist/components/helper/date-filter.js +3 -0
  40. package/dist/components/helper/date-filter.js.map +1 -0
  41. package/dist/components/layouts/app-content.cjs +1 -1
  42. package/dist/components/layouts/app-content.cjs.map +1 -1
  43. package/dist/components/layouts/app-content.d.cts +2 -2
  44. package/dist/components/layouts/app-content.d.ts +2 -2
  45. package/dist/components/layouts/app-content.js +1 -1
  46. package/dist/components/layouts/app-content.js.map +1 -1
  47. package/dist/components/layouts/factories.cjs +1 -1
  48. package/dist/components/layouts/factories.cjs.map +1 -1
  49. package/dist/components/layouts/factories.js +1 -1
  50. package/dist/components/layouts/factories.js.map +1 -1
  51. package/dist/components/layouts/index.cjs +1 -1
  52. package/dist/components/layouts/index.cjs.map +1 -1
  53. package/dist/components/layouts/index.js +1 -1
  54. package/dist/components/layouts/index.js.map +1 -1
  55. package/dist/components/ui/calendar.cjs +3 -0
  56. package/dist/components/ui/calendar.cjs.map +1 -0
  57. package/dist/components/ui/calendar.d.cts +13 -0
  58. package/dist/components/ui/calendar.d.ts +13 -0
  59. package/dist/components/ui/calendar.js +3 -0
  60. package/dist/components/ui/calendar.js.map +1 -0
  61. package/dist/components/ui/table.cjs +1 -1
  62. package/dist/components/ui/table.cjs.map +1 -1
  63. package/dist/components/ui/table.js +1 -1
  64. package/dist/components/ui/table.js.map +1 -1
  65. package/dist/index.cjs +1 -1
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.js +1 -1
  68. package/dist/index.js.map +1 -1
  69. package/package.json +28 -16
  70. package/dist/styles.css +0 -2
@@ -1,3 +1,3 @@
1
1
  "use client"
2
- "use strict";var O=Object.create;var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var I=(t,e)=>{for(var r in e)m(t,r,{get:e[r],enumerable:!0})},w=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of L(e))!K.call(t,i)&&i!==r&&m(t,i,{get:()=>e[i],enumerable:!(a=_(e,i))||a.enumerable});return t};var R=(t,e,r)=>(r=t!=null?O(F(t)):{},w(e||!t||!t.__esModule?m(r,"default",{value:t,enumerable:!0}):r,t)),X=t=>w(m({},"__esModule",{value:!0}),t);var Q={};I(Q,{DataTableActionBar:()=>G,DataTableActionBarAction:()=>H,DataTableActionBarSelection:()=>J});module.exports=X(Q);var k=require("radix-ui"),z=require("class-variance-authority");var C=require("clsx"),D=require("tailwind-merge");function n(...t){return(0,D.twMerge)((0,C.clsx)(t))}var A=require("react/jsx-runtime"),q=(0,z.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function b({className:t,variant:e,size:r,asChild:a=!1,...i}){let c=a?k.Slot.Slot:"button";return(0,A.jsx)(c,{"data-slot":"button",className:n(q({variant:e,size:r,className:t}),"transition-none"),...i})}var N=require("radix-ui");var B=require("react/jsx-runtime");function S({className:t,orientation:e="horizontal",decorative:r=!0,...a}){return(0,B.jsx)(N.Separator.Root,{"data-slot":"separator-root",decorative:r,orientation:e,className:n("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...a})}var d=require("radix-ui");var s=require("react/jsx-runtime");function v({delayDuration:t=0,...e}){return(0,s.jsx)(d.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function y({...t}){return(0,s.jsx)(v,{children:(0,s.jsx)(d.Tooltip.Root,{"data-slot":"tooltip",...t})})}function x({...t}){return(0,s.jsx)(d.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...t})}function T({className:t,sideOffset:e=0,children:r,...a}){return(0,s.jsx)(d.Tooltip.Portal,{children:(0,s.jsxs)(d.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:e,className:n("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...a,children:[r,(0,s.jsx)(d.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var u=require("lucide-react"),f=require("framer-motion"),l=R(require("react"),1),E=R(require("react-dom"),1),o=require("react/jsx-runtime");function G({table:t,visible:e,container:r,children:a,className:i,...c}){let[g,p]=l.useState(!1);l.useLayoutEffect(()=>{p(!0)},[]),l.useEffect(()=>{function P(M){M.key==="Escape"&&t&&t.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[t]);let h=r??(g?globalThis.document?.body:null);if(!h||!t)return null;let V=e??t.getFilteredSelectedRowModel().rows.length>0;return E.createPortal((0,o.jsx)(f.AnimatePresence,{children:V&&(0,o.jsx)(f.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:n("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",i),...c,children:(0,o.jsxs)(v,{children:["1",a]})})}),h)}function H({size:t="sm",tooltip:e,isPending:r,disabled:a,className:i,children:c,...g}){let p=(0,o.jsx)(b,{variant:"secondary",size:t,className:n("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",t==="icon"?"size-8":"h-8 px-3",i),disabled:a||r,...g,children:r?(0,o.jsx)(u.Loader,{className:"animate-spin"}):c});return e?(0,o.jsxs)(y,{children:[(0,o.jsx)(x,{asChild:!0,children:p}),(0,o.jsx)(T,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,o.jsx)("p",{children:e})})]}):p}function J({table:t}){let e=l.useCallback(()=>{t&&t.toggleAllRowsSelected(!1)},[t]);return t?(0,o.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,o.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[t.getFilteredSelectedRowModel().rows.length," selected"]}),(0,o.jsx)(S,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,o.jsxs)(y,{children:[(0,o.jsx)(x,{asChild:!0,children:(0,o.jsx)(b,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:e,children:(0,o.jsx)(u.X,{className:"size-3.5"})})}),(0,o.jsxs)(T,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,o.jsx)("p",{children:"Clear selection"}),(0,o.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,o.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}0&&(module.exports={DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection});
2
+ "use strict";var O=Object.create;var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var I=(t,e)=>{for(var r in e)m(t,r,{get:e[r],enumerable:!0})},w=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of L(e))!K.call(t,i)&&i!==r&&m(t,i,{get:()=>e[i],enumerable:!(a=_(e,i))||a.enumerable});return t};var R=(t,e,r)=>(r=t!=null?O(F(t)):{},w(e||!t||!t.__esModule?m(r,"default",{value:t,enumerable:!0}):r,t)),X=t=>w(m({},"__esModule",{value:!0}),t);var Q={};I(Q,{DataTableActionBar:()=>G,DataTableActionBarAction:()=>H,DataTableActionBarSelection:()=>J});module.exports=X(Q);var k=require("radix-ui"),z=require("class-variance-authority");var C=require("clsx"),D=require("tailwind-merge");function n(...t){return(0,D.twMerge)((0,C.clsx)(t))}var A=require("react/jsx-runtime"),q=(0,z.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function b({className:t,variant:e,size:r,asChild:a=!1,...i}){let c=a?k.Slot.Slot:"button";return(0,A.jsx)(c,{"data-slot":"button",className:n(q({variant:e,size:r,className:t}),"transition-none"),...i})}var N=require("radix-ui");var B=require("react/jsx-runtime");function S({className:t,orientation:e="horizontal",decorative:r=!0,...a}){return(0,B.jsx)(N.Separator.Root,{"data-slot":"separator-root",decorative:r,orientation:e,className:n("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...a})}var d=require("radix-ui");var s=require("react/jsx-runtime");function v({delayDuration:t=0,...e}){return(0,s.jsx)(d.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function y({...t}){return(0,s.jsx)(v,{children:(0,s.jsx)(d.Tooltip.Root,{"data-slot":"tooltip",...t})})}function x({...t}){return(0,s.jsx)(d.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...t})}function T({className:t,sideOffset:e=0,children:r,...a}){return(0,s.jsx)(d.Tooltip.Portal,{children:(0,s.jsxs)(d.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:e,className:n("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...a,children:[r,(0,s.jsx)(d.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var u=require("lucide-react"),f=require("framer-motion"),l=R(require("react"),1),E=R(require("react-dom"),1),o=require("react/jsx-runtime");function G({table:t,visible:e,container:r,children:a,className:i,...c}){let[g,p]=l.useState(!1);l.useLayoutEffect(()=>{p(!0)},[]),l.useEffect(()=>{function P(M){M.key==="Escape"&&t&&t.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[t]);let h=r??(g?globalThis.document?.body:null);if(!h||!t)return null;let V=e??t.getFilteredSelectedRowModel().rows.length>0;return E.createPortal((0,o.jsx)(f.AnimatePresence,{children:V&&(0,o.jsx)(f.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:n("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",i),...c,children:(0,o.jsx)(v,{children:a})})}),h)}function H({size:t="sm",tooltip:e,isPending:r,disabled:a,className:i,children:c,...g}){let p=(0,o.jsx)(b,{variant:"secondary",size:t,className:n("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",t==="icon"?"size-8":"h-8 px-3",i),disabled:a||r,...g,children:r?(0,o.jsx)(u.Loader,{className:"animate-spin"}):c});return e?(0,o.jsxs)(y,{children:[(0,o.jsx)(x,{asChild:!0,children:p}),(0,o.jsx)(T,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,o.jsx)("p",{children:e})})]}):p}function J({table:t}){let e=l.useCallback(()=>{t&&t.toggleAllRowsSelected(!1)},[t]);return t?(0,o.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,o.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[t.getFilteredSelectedRowModel().rows.length," selected"]}),(0,o.jsx)(S,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,o.jsxs)(y,{children:[(0,o.jsx)(x,{asChild:!0,children:(0,o.jsx)(b,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:e,children:(0,o.jsx)(u.X,{className:"size-3.5"})})}),(0,o.jsxs)(T,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,o.jsx)("p",{children:"Clear selection"}),(0,o.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,o.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}0&&(module.exports={DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection});
3
3
  //# sourceMappingURL=data-table-action-bar.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/data/data-table/data-table-action-bar.tsx","../../../../src/components/ui/button.tsx","../../../../src/lib/utils.ts","../../../../src/components/ui/separator.tsx","../../../../src/components/ui/tooltip.tsx"],"sourcesContent":["import { Button } from \"../../ui/button.jsx\"\r\nimport { Separator } from \"../../ui/separator.jsx\"\r\nimport { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"../../ui/tooltip.jsx\"\r\nimport { cn } from \"../../../lib/utils.js\"\r\nimport type { Table } from \"@tanstack/react-table\"\r\nimport { Loader, X } from \"lucide-react\"\r\nimport { AnimatePresence, motion } from \"framer-motion\"\r\nimport * as React from \"react\"\r\nimport * as ReactDOM from \"react-dom\"\r\n\r\ninterface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {\r\n table: Table<TData> | null\r\n visible?: boolean\r\n container?: Element | DocumentFragment | null\r\n children: React.ReactNode\r\n}\r\n\r\nfunction DataTableActionBar<TData>({\r\n table,\r\n visible: visibleProp,\r\n container: containerProp,\r\n children,\r\n className,\r\n ...props\r\n}: DataTableActionBarProps<TData>) {\r\n const [mounted, setMounted] = React.useState(false)\r\n\r\n React.useLayoutEffect(() => {\r\n setMounted(true)\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\" && table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }\r\n\r\n window.addEventListener(\"keydown\", onKeyDown)\r\n return () => window.removeEventListener(\"keydown\", onKeyDown)\r\n }, [table])\r\n\r\n const container = containerProp ?? (mounted ? globalThis.document?.body : null)\r\n\r\n if (!container || !table) return null\r\n\r\n const visible = visibleProp ?? table.getFilteredSelectedRowModel().rows.length > 0\r\n\r\n return ReactDOM.createPortal(\r\n <AnimatePresence>\r\n {visible && (\r\n <motion.div\r\n role=\"toolbar\"\r\n aria-orientation=\"horizontal\"\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n exit={{ opacity: 0, y: 20 }}\r\n transition={{ duration: 0.3, ease: \"easeInOut\" }}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <TooltipProvider>1{children}</TooltipProvider>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n container,\r\n )\r\n}\r\n\r\ninterface DataTableActionBarActionProps extends React.ComponentProps<typeof Button> {\r\n tooltip?: string\r\n isPending?: boolean\r\n}\r\n\r\nfunction DataTableActionBarAction({\r\n size = \"sm\",\r\n tooltip,\r\n isPending,\r\n disabled,\r\n className,\r\n children,\r\n ...props\r\n}: DataTableActionBarActionProps) {\r\n const trigger = (\r\n <Button\r\n variant=\"secondary\"\r\n size={size}\r\n className={cn(\r\n \"gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200\",\r\n size === \"icon\" ? \"size-8\" : \"h-8 px-3\",\r\n className,\r\n )}\r\n disabled={disabled || isPending}\r\n {...props}\r\n >\r\n {isPending ? <Loader className=\"animate-spin\" /> : children}\r\n </Button>\r\n )\r\n\r\n if (!tooltip) return trigger\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={8}\r\n className=\"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden\"\r\n >\r\n <p>{tooltip}</p>\r\n </TooltipContent>\r\n </Tooltip>\r\n )\r\n}\r\n\r\ninterface DataTableActionBarSelectionProps<TData> {\r\n table: Table<TData> | null\r\n}\r\n\r\nfunction DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>) {\r\n const onClearSelection = React.useCallback(() => {\r\n if (table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }, [table])\r\n\r\n if (!table) return null\r\n\r\n return (\r\n <div className=\"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3\">\r\n <span className=\"whitespace-nowrap text-sm font-medium\">\r\n {table.getFilteredSelectedRowModel().rows.length} selected\r\n </span>\r\n <Separator orientation=\"vertical\" className=\"mr-2 ml-3 data-[orientation=vertical]:h-4\" />\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6 rounded-md\" onClick={onClearSelection}>\r\n <X className=\"size-3.5\" />\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={10}\r\n className=\"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden\"\r\n >\r\n <p>Clear selection</p>\r\n <kbd className=\"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm\">\r\n <abbr title=\"Escape\" className=\"no-underline\">\r\n Esc\r\n </abbr>\r\n </kbd>\r\n </TooltipContent>\r\n </Tooltip>\r\n </div>\r\n )\r\n}\r\n\r\nexport { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection }\r\n\r\n/**\r\n\r\nimport { Button } from \"/..../ui/button\"\r\nimport { Separator } from \"/..../ui/separator\"\r\nimport { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"/..../ui/tooltip\"\r\nimport { cn } from \"@/lib/utils\"\r\nimport type { Table } from \"@tanstack/react-table\"\r\nimport { Loader, X } from \"lucide-react\"\r\nimport { AnimatePresence, motion } from \"framer-motion\"\r\nimport * as React from \"react\"\r\nimport * as ReactDOM from \"react-dom\"\r\nimport { Toggle } from \"../ui/toggle\"\r\n\r\ninterface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {\r\n table: Table<TData> | null\r\n visible?: boolean\r\n container?: Element | DocumentFragment | null\r\n children: React.ReactNode\r\n}\r\n\r\nfunction DataTableActionBar<TData>({\r\n table,\r\n visible: visibleProp,\r\n container: containerProp,\r\n children,\r\n className,\r\n ...props\r\n}: DataTableActionBarProps<TData>) {\r\n const [mounted, setMounted] = React.useState(false)\r\n\r\n React.useLayoutEffect(() => {\r\n setMounted(true)\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\" && table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }\r\n\r\n window.addEventListener(\"keydown\", onKeyDown)\r\n return () => window.removeEventListener(\"keydown\", onKeyDown)\r\n }, [table])\r\n\r\n const container = containerProp ?? (mounted ? globalThis.document?.body : null)\r\n\r\n if (!container || !table) return null\r\n\r\n const visible = visibleProp ?? table.getFilteredSelectedRowModel().rows.length > 0\r\n\r\n return ReactDOM.createPortal(\r\n <AnimatePresence>\r\n {visible && (\r\n <motion.div\r\n role=\"toolbar\"\r\n aria-orientation=\"horizontal\"\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n exit={{ opacity: 0, y: 20 }}\r\n transition={{ duration: 0.2, ease: \"easeInOut\" }}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-background/95 backdrop-blur-sm p-3 text-foreground shadow-lg ring-1 ring-black/5\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <TooltipProvider>{children}</TooltipProvider>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n container,\r\n )\r\n}\r\n\r\ninterface DataTableActionBarActionProps extends React.ComponentProps<typeof Toggle> {\r\n tooltip?: string\r\n isPending?: boolean\r\n}\r\n\r\nfunction DataTableActionBarAction({\r\n size = \"sm\",\r\n tooltip,\r\n isPending,\r\n disabled,\r\n className,\r\n children,\r\n ...props\r\n}: DataTableActionBarActionProps) {\r\n const trigger = (\r\n <Toggle\r\n variant=\"default\"\r\n size={size}\r\n className={cn(\r\n \"gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200 p-2\",\r\n className,\r\n )}\r\n disabled={disabled || isPending}\r\n {...props}\r\n >\r\n {isPending ? <Loader className=\"animate-spin\" /> : children}\r\n </Toggle>\r\n )\r\n\r\n if (!tooltip) return trigger\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={8}\r\n className=\"rounded-lg border bg-accent font-semibold text-foreground dark:bg-zinc-900 [&>span]:hidden\"\r\n >\r\n <p>{tooltip}</p>\r\n </TooltipContent>\r\n </Tooltip>\r\n )\r\n}\r\n\r\ninterface DataTableActionBarSelectionProps<TData> {\r\n table: Table<TData> | null\r\n}\r\n\r\nfunction DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>) {\r\n const onClearSelection = React.useCallback(() => {\r\n if (table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }, [table])\r\n\r\n if (!table) return null\r\n\r\n return (\r\n <div className=\"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3\">\r\n <span className=\"whitespace-nowrap text-sm font-medium\">\r\n {table.getFilteredSelectedRowModel().rows.length} selected\r\n </span>\r\n <Separator orientation=\"vertical\" className=\"mr-2 ml-3 data-[orientation=vertical]:h-4\" />\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6 rounded-md\" onClick={onClearSelection}>\r\n <X className=\"size-3.5\" />\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={10}\r\n className=\"flex items-center gap-2 rounded-lg border bg-accent px-3 py-2 font-semibold text-foreground dark:bg-zinc-900 [&>span]:hidden\"\r\n >\r\n <p>Clear selection</p>\r\n <kbd className=\"select-none rounded border bg-background px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm\">\r\n <abbr title=\"Escape\" className=\"no-underline\">\r\n Esc\r\n </abbr>\r\n </kbd>\r\n </TooltipContent>\r\n </Tooltip>\r\n </div>\r\n )\r\n}\r\n\r\nexport { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection }\r\n\r\n */","import * as React from \"react\"\nimport { Slot as SlotPrimitive } from \"radix-ui\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }), \"transition-none\")}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}","import * as React from \"react\"\nimport { Separator as SeparatorPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator-root\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","import * as React from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n )\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n )\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n"],"mappings":";0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,EAAA,6BAAAC,EAAA,gCAAAC,IAAA,eAAAC,EAAAL,GCCA,IAAAM,EAAsC,oBACtCC,EAAuC,oCCFvC,IAAAC,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CD6CI,IAAAC,EAAA,6BA5CEC,KAAiB,OACrB,8bACA,CACE,SAAU,CACR,QAAS,CACP,QACE,mEACF,YACE,8JACF,QACE,wIACF,UACE,yEACF,MACE,uEACF,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAAI,uCACJ,KAAM,QACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAEA,SAASC,EAAO,CACd,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,GAAGC,CACL,EAGK,CACH,IAAMC,EAAOF,EAAU,EAAAG,KAAc,KAAO,SAE5C,SACE,OAACD,EAAA,CACC,YAAU,SACV,UAAWE,EAAGT,EAAe,CAAE,QAAAG,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,EAAG,iBAAiB,EAC5E,GAAGI,EACN,CAEJ,CEvDA,IAAAI,EAAgD,oBAW5C,IAAAC,EAAA,6BAPJ,SAASC,EAAU,CACjB,UAAAC,EACA,YAAAC,EAAc,aACd,WAAAC,EAAa,GACb,GAA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XmBG,CAavB,CAMA,SAASK,EAAmC,CAAE,MAAAxB,CAAM,EAA4C,CAC9F,IAAMyB,EAAyB,cAAY,IAAM,CAC3CzB,GACFA,EAAM,sBAAsB,EAAK,CAErC,EAAG,CAACA,CAAK,CAAC,EAEV,OAAKA,KAGH,QAAC,OAAI,UAAU,gEACb,qBAAC,QAAK,UAAU,wCACb,UAAAA,EAAM,4BAA4B,EAAE,KAAK,OAAO,aACnD,KACA,OAAC0B,EAAA,CAAU,YAAY,WAAW,UAAU,4CAA4C,KACxF,QAACL,EAAA,CACC,oBAACC,EAAA,CAAe,QAAO,GACrB,mBAACF,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,oBAAoB,QAASK,EACzE,mBAAC,KAAE,UAAU,WAAW,EAC1B,EACF,KACA,QAACF,EAAA,CACC,WAAY,GACZ,UAAU,gHAEV,oBAAC,KAAE,2BAAe,KAClB,OAAC,OAAI,UAAU,mHACb,mBAAC,QAAK,MAAM,SAAS,UAAU,eAAe,eAE9C,EACF,GACF,GACF,GACF,EA1BiB,IA4BrB","names":["data_table_action_bar_exports","__export","DataTableActionBar","DataTableActionBarAction","DataTableActionBarSelection","__toCommonJS","import_radix_ui","import_class_variance_authority","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","buttonVariants","Button","className","variant","size","asChild","props","Comp","SlotPrimitive","cn","import_radix_ui","import_jsx_runtime","Separator","className","orientation","decorative","props","SeparatorPrimitive","cn","import_radix_ui","import_jsx_runtime","TooltipProvider","delayDuration","props","TooltipPrimitive","Tooltip","TooltipTrigger","TooltipContent","className","sideOffset","children","cn","import_lucide_react","import_framer_motion","React","ReactDOM","import_jsx_runtime","DataTableActionBar","table","visibleProp","containerProp","children","className","props","mounted","setMounted","onKeyDown","event","container","visible","cn","TooltipProvider","DataTableActionBarAction","size","tooltip","isPending","disabled","trigger","Button","Tooltip","TooltipTrigger","TooltipContent","DataTableActionBarSelection","onClearSelection","Separator"]}
1
+ {"version":3,"sources":["../../../../src/components/data/data-table/data-table-action-bar.tsx","../../../../src/components/ui/button.tsx","../../../../src/lib/utils.ts","../../../../src/components/ui/separator.tsx","../../../../src/components/ui/tooltip.tsx"],"sourcesContent":["import { Button } from \"../../ui/button.jsx\"\r\nimport { Separator } from \"../../ui/separator.jsx\"\r\nimport { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"../../ui/tooltip.jsx\"\r\nimport { cn } from \"../../../lib/utils.js\"\r\nimport type { Table } from \"@tanstack/react-table\"\r\nimport { Loader, X } from \"lucide-react\"\r\nimport { AnimatePresence, motion } from \"framer-motion\"\r\nimport * as React from \"react\"\r\nimport * as ReactDOM from \"react-dom\"\r\n\r\ninterface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {\r\n table: Table<TData> | null\r\n visible?: boolean\r\n container?: Element | DocumentFragment | null\r\n children: React.ReactNode\r\n}\r\n\r\nfunction DataTableActionBar<TData>({\r\n table,\r\n visible: visibleProp,\r\n container: containerProp,\r\n children,\r\n className,\r\n ...props\r\n}: DataTableActionBarProps<TData>) {\r\n const [mounted, setMounted] = React.useState(false)\r\n\r\n React.useLayoutEffect(() => {\r\n setMounted(true)\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\" && table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }\r\n\r\n window.addEventListener(\"keydown\", onKeyDown)\r\n return () => window.removeEventListener(\"keydown\", onKeyDown)\r\n }, [table])\r\n\r\n const container = containerProp ?? (mounted ? globalThis.document?.body : null)\r\n\r\n if (!container || !table) return null\r\n\r\n const visible = visibleProp ?? table.getFilteredSelectedRowModel().rows.length > 0\r\n\r\n return ReactDOM.createPortal(\r\n <AnimatePresence>\r\n {visible && (\r\n <motion.div\r\n role=\"toolbar\"\r\n aria-orientation=\"horizontal\"\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n exit={{ opacity: 0, y: 20 }}\r\n transition={{ duration: 0.3, ease: \"easeInOut\" }}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <TooltipProvider>{children}</TooltipProvider>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n container,\r\n )\r\n}\r\n\r\ninterface DataTableActionBarActionProps extends React.ComponentProps<typeof Button> {\r\n tooltip?: string\r\n isPending?: boolean\r\n}\r\n\r\nfunction DataTableActionBarAction({\r\n size = \"sm\",\r\n tooltip,\r\n isPending,\r\n disabled,\r\n className,\r\n children,\r\n ...props\r\n}: DataTableActionBarActionProps) {\r\n const trigger = (\r\n <Button\r\n variant=\"secondary\"\r\n size={size}\r\n className={cn(\r\n \"gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200\",\r\n size === \"icon\" ? \"size-8\" : \"h-8 px-3\",\r\n className,\r\n )}\r\n disabled={disabled || isPending}\r\n {...props}\r\n >\r\n {isPending ? <Loader className=\"animate-spin\" /> : children}\r\n </Button>\r\n )\r\n\r\n if (!tooltip) return trigger\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={8}\r\n className=\"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden\"\r\n >\r\n <p>{tooltip}</p>\r\n </TooltipContent>\r\n </Tooltip>\r\n )\r\n}\r\n\r\ninterface DataTableActionBarSelectionProps<TData> {\r\n table: Table<TData> | null\r\n}\r\n\r\nfunction DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>) {\r\n const onClearSelection = React.useCallback(() => {\r\n if (table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }, [table])\r\n\r\n if (!table) return null\r\n\r\n return (\r\n <div className=\"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3\">\r\n <span className=\"whitespace-nowrap text-sm font-medium\">\r\n {table.getFilteredSelectedRowModel().rows.length} selected\r\n </span>\r\n <Separator orientation=\"vertical\" className=\"mr-2 ml-3 data-[orientation=vertical]:h-4\" />\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6 rounded-md\" onClick={onClearSelection}>\r\n <X className=\"size-3.5\" />\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={10}\r\n className=\"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden\"\r\n >\r\n <p>Clear selection</p>\r\n <kbd className=\"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm\">\r\n <abbr title=\"Escape\" className=\"no-underline\">\r\n Esc\r\n </abbr>\r\n </kbd>\r\n </TooltipContent>\r\n </Tooltip>\r\n </div>\r\n )\r\n}\r\n\r\nexport { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection }\r\n\r\n/**\r\n\r\nimport { Button } from \"/..../ui/button\"\r\nimport { Separator } from \"/..../ui/separator\"\r\nimport { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"/..../ui/tooltip\"\r\nimport { cn } from \"@/lib/utils\"\r\nimport type { Table } from \"@tanstack/react-table\"\r\nimport { Loader, X } from \"lucide-react\"\r\nimport { AnimatePresence, motion } from \"framer-motion\"\r\nimport * as React from \"react\"\r\nimport * as ReactDOM from \"react-dom\"\r\nimport { Toggle } from \"../ui/toggle\"\r\n\r\ninterface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {\r\n table: Table<TData> | null\r\n visible?: boolean\r\n container?: Element | DocumentFragment | null\r\n children: React.ReactNode\r\n}\r\n\r\nfunction DataTableActionBar<TData>({\r\n table,\r\n visible: visibleProp,\r\n container: containerProp,\r\n children,\r\n className,\r\n ...props\r\n}: DataTableActionBarProps<TData>) {\r\n const [mounted, setMounted] = React.useState(false)\r\n\r\n React.useLayoutEffect(() => {\r\n setMounted(true)\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\" && table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }\r\n\r\n window.addEventListener(\"keydown\", onKeyDown)\r\n return () => window.removeEventListener(\"keydown\", onKeyDown)\r\n }, [table])\r\n\r\n const container = containerProp ?? (mounted ? globalThis.document?.body : null)\r\n\r\n if (!container || !table) return null\r\n\r\n const visible = visibleProp ?? table.getFilteredSelectedRowModel().rows.length > 0\r\n\r\n return ReactDOM.createPortal(\r\n <AnimatePresence>\r\n {visible && (\r\n <motion.div\r\n role=\"toolbar\"\r\n aria-orientation=\"horizontal\"\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n exit={{ opacity: 0, y: 20 }}\r\n transition={{ duration: 0.2, ease: \"easeInOut\" }}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-background/95 backdrop-blur-sm p-3 text-foreground shadow-lg ring-1 ring-black/5\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <TooltipProvider>{children}</TooltipProvider>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n container,\r\n )\r\n}\r\n\r\ninterface DataTableActionBarActionProps extends React.ComponentProps<typeof Toggle> {\r\n tooltip?: string\r\n isPending?: boolean\r\n}\r\n\r\nfunction DataTableActionBarAction({\r\n size = \"sm\",\r\n tooltip,\r\n isPending,\r\n disabled,\r\n className,\r\n children,\r\n ...props\r\n}: DataTableActionBarActionProps) {\r\n const trigger = (\r\n <Toggle\r\n variant=\"default\"\r\n size={size}\r\n className={cn(\r\n \"gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200 p-2\",\r\n className,\r\n )}\r\n disabled={disabled || isPending}\r\n {...props}\r\n >\r\n {isPending ? <Loader className=\"animate-spin\" /> : children}\r\n </Toggle>\r\n )\r\n\r\n if (!tooltip) return trigger\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={8}\r\n className=\"rounded-lg border bg-accent font-semibold text-foreground dark:bg-zinc-900 [&>span]:hidden\"\r\n >\r\n <p>{tooltip}</p>\r\n </TooltipContent>\r\n </Tooltip>\r\n )\r\n}\r\n\r\ninterface DataTableActionBarSelectionProps<TData> {\r\n table: Table<TData> | null\r\n}\r\n\r\nfunction DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>) {\r\n const onClearSelection = React.useCallback(() => {\r\n if (table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }, [table])\r\n\r\n if (!table) return null\r\n\r\n return (\r\n <div className=\"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3\">\r\n <span className=\"whitespace-nowrap text-sm font-medium\">\r\n {table.getFilteredSelectedRowModel().rows.length} selected\r\n </span>\r\n <Separator orientation=\"vertical\" className=\"mr-2 ml-3 data-[orientation=vertical]:h-4\" />\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6 rounded-md\" onClick={onClearSelection}>\r\n <X className=\"size-3.5\" />\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={10}\r\n className=\"flex items-center gap-2 rounded-lg border bg-accent px-3 py-2 font-semibold text-foreground dark:bg-zinc-900 [&>span]:hidden\"\r\n >\r\n <p>Clear selection</p>\r\n <kbd className=\"select-none rounded border bg-background px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm\">\r\n <abbr title=\"Escape\" className=\"no-underline\">\r\n Esc\r\n </abbr>\r\n </kbd>\r\n </TooltipContent>\r\n </Tooltip>\r\n </div>\r\n )\r\n}\r\n\r\nexport { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection }\r\n\r\n */","import * as React from \"react\"\nimport { Slot as SlotPrimitive } from \"radix-ui\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }), \"transition-none\")}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}","import * as React from \"react\"\nimport { Separator as SeparatorPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator-root\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","import * as React from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n )\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n )\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n"],"mappings":";0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,EAAA,6BAAAC,EAAA,gCAAAC,IAAA,eAAAC,EAAAL,GCCA,IAAAM,EAAsC,oBACtCC,EAAuC,oCCFvC,IAAAC,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CD6CI,IAAAC,EAAA,6BA5CEC,KAAiB,OACrB,8bACA,CACE,SAAU,CACR,QAAS,CACP,QACE,mEACF,YACE,8JACF,QACE,wIACF,UACE,yEACF,MACE,uEACF,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAAI,uCACJ,KAAM,QACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAEA,SAASC,EAAO,CACd,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,GAAGC,CACL,EAGK,CACH,IAAMC,EAAOF,EAAU,EAAAG,KAAc,KAAO,SAE5C,SACE,OAACD,EAAA,CACC,YAAU,SACV,UAAWE,EAAGT,EAAe,CAAE,QAAAG,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,EAAG,iBAAi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QAACK,EAAA,CACC,oBAACC,EAAA,CAAe,QAAO,GAAE,SAAAH,EAAQ,KACjC,OAACI,EAAA,CACC,WAAY,EACZ,UAAU,+EAEV,mBAAC,KAAG,SAAAP,EAAQ,EACd,GACF,EAXmBG,CAavB,CAMA,SAASK,EAAmC,CAAE,MAAAxB,CAAM,EAA4C,CAC9F,IAAMyB,EAAyB,cAAY,IAAM,CAC3CzB,GACFA,EAAM,sBAAsB,EAAK,CAErC,EAAG,CAACA,CAAK,CAAC,EAEV,OAAKA,KAGH,QAAC,OAAI,UAAU,gEACb,qBAAC,QAAK,UAAU,wCACb,UAAAA,EAAM,4BAA4B,EAAE,KAAK,OAAO,aACnD,KACA,OAAC0B,EAAA,CAAU,YAAY,WAAW,UAAU,4CAA4C,KACxF,QAACL,EAAA,CACC,oBAACC,EAAA,CAAe,QAAO,GACrB,mBAACF,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,oBAAoB,QAASK,EACzE,mBAAC,KAAE,UAAU,WAAW,EAC1B,EACF,KACA,QAACF,EAAA,CACC,WAAY,GACZ,UAAU,gHAEV,oBAAC,KAAE,2BAAe,KAClB,OAAC,OAAI,UAAU,mHACb,mBAAC,QAAK,MAAM,SAAS,UAAU,eAAe,eAE9C,EACF,GACF,GACF,GACF,EA1BiB,IA4BrB","names":["data_table_action_bar_exports","__export","DataTableActionBar","DataTableActionBarAction","DataTableActionBarSelection","__toCommonJS","import_radix_ui","import_class_variance_authority","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","buttonVariants","Button","className","variant","size","asChild","props","Comp","SlotPrimitive","cn","import_radix_ui","import_jsx_runtime","Separator","className","orientation","decorative","props","SeparatorPrimitive","cn","import_radix_ui","import_jsx_runtime","TooltipProvider","delayDuration","props","TooltipPrimitive","Tooltip","TooltipTrigger","TooltipContent","className","sideOffset","children","cn","import_lucide_react","import_framer_motion","React","ReactDOM","import_jsx_runtime","DataTableActionBar","table","visibleProp","containerProp","children","className","props","mounted","setMounted","onKeyDown","event","container","visible","cn","TooltipProvider","DataTableActionBarAction","size","tooltip","isPending","disabled","trigger","Button","Tooltip","TooltipTrigger","TooltipContent","DataTableActionBarSelection","onClearSelection","Separator"]}
@@ -1,3 +1,3 @@
1
1
  "use client"
2
- import{Slot as k}from"radix-ui";import{cva as z}from"class-variance-authority";import{clsx as C}from"clsx";import{twMerge as D}from"tailwind-merge";function i(...t){return D(C(t))}import{jsx as N}from"react/jsx-runtime";var A=z("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function f({className:t,variant:e,size:r,asChild:a=!1,...c}){let p=a?k.Slot:"button";return N(p,{"data-slot":"button",className:i(A({variant:e,size:r,className:t}),"transition-none"),...c})}import{Separator as S}from"radix-ui";import{jsx as B}from"react/jsx-runtime";function h({className:t,orientation:e="horizontal",decorative:r=!0,...a}){return B(S.Root,{"data-slot":"separator-root",decorative:r,orientation:e,className:i("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...a})}import{Tooltip as s}from"radix-ui";import{jsx as l,jsxs as E}from"react/jsx-runtime";function g({delayDuration:t=0,...e}){return l(s.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function b({...t}){return l(g,{children:l(s.Root,{"data-slot":"tooltip",...t})})}function v({...t}){return l(s.Trigger,{"data-slot":"tooltip-trigger",...t})}function y({className:t,sideOffset:e=0,children:r,...a}){return l(s.Portal,{children:E(s.Content,{"data-slot":"tooltip-content",sideOffset:e,className:i("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...a,children:[r,l(s.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Loader as V,X as M}from"lucide-react";import{AnimatePresence as O,motion as _}from"framer-motion";import*as n from"react";import*as P from"react-dom";import{jsx as o,jsxs as d}from"react/jsx-runtime";function nt({table:t,visible:e,container:r,children:a,className:c,...p}){let[u,m]=n.useState(!1);n.useLayoutEffect(()=>{m(!0)},[]),n.useEffect(()=>{function T(R){R.key==="Escape"&&t&&t.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[t]);let x=r??(u?globalThis.document?.body:null);if(!x||!t)return null;let w=e??t.getFilteredSelectedRowModel().rows.length>0;return P.createPortal(o(O,{children:w&&o(_.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:i("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",c),...p,children:d(g,{children:["1",a]})})}),x)}function st({size:t="sm",tooltip:e,isPending:r,disabled:a,className:c,children:p,...u}){let m=o(f,{variant:"secondary",size:t,className:i("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",t==="icon"?"size-8":"h-8 px-3",c),disabled:a||r,...u,children:r?o(V,{className:"animate-spin"}):p});return e?d(b,{children:[o(v,{asChild:!0,children:m}),o(y,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:o("p",{children:e})})]}):m}function lt({table:t}){let e=n.useCallback(()=>{t&&t.toggleAllRowsSelected(!1)},[t]);return t?d("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[d("span",{className:"whitespace-nowrap text-sm font-medium",children:[t.getFilteredSelectedRowModel().rows.length," selected"]}),o(h,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),d(b,{children:[o(v,{asChild:!0,children:o(f,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:e,children:o(M,{className:"size-3.5"})})}),d(y,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[o("p",{children:"Clear selection"}),o("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:o("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}export{nt as DataTableActionBar,st as DataTableActionBarAction,lt as DataTableActionBarSelection};
2
+ import{Slot as k}from"radix-ui";import{cva as z}from"class-variance-authority";import{clsx as C}from"clsx";import{twMerge as D}from"tailwind-merge";function i(...t){return D(C(t))}import{jsx as N}from"react/jsx-runtime";var A=z("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function f({className:t,variant:o,size:r,asChild:a=!1,...d}){let c=a?k.Slot:"button";return N(c,{"data-slot":"button",className:i(A({variant:o,size:r,className:t}),"transition-none"),...d})}import{Separator as S}from"radix-ui";import{jsx as B}from"react/jsx-runtime";function h({className:t,orientation:o="horizontal",decorative:r=!0,...a}){return B(S.Root,{"data-slot":"separator-root",decorative:r,orientation:o,className:i("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...a})}import{Tooltip as s}from"radix-ui";import{jsx as l,jsxs as E}from"react/jsx-runtime";function g({delayDuration:t=0,...o}){return l(s.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...o})}function b({...t}){return l(g,{children:l(s.Root,{"data-slot":"tooltip",...t})})}function v({...t}){return l(s.Trigger,{"data-slot":"tooltip-trigger",...t})}function y({className:t,sideOffset:o=0,children:r,...a}){return l(s.Portal,{children:E(s.Content,{"data-slot":"tooltip-content",sideOffset:o,className:i("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...a,children:[r,l(s.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Loader as V,X as M}from"lucide-react";import{AnimatePresence as O,motion as _}from"framer-motion";import*as n from"react";import*as P from"react-dom";import{jsx as e,jsxs as p}from"react/jsx-runtime";function nt({table:t,visible:o,container:r,children:a,className:d,...c}){let[u,m]=n.useState(!1);n.useLayoutEffect(()=>{m(!0)},[]),n.useEffect(()=>{function T(R){R.key==="Escape"&&t&&t.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[t]);let x=r??(u?globalThis.document?.body:null);if(!x||!t)return null;let w=o??t.getFilteredSelectedRowModel().rows.length>0;return P.createPortal(e(O,{children:w&&e(_.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:i("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",d),...c,children:e(g,{children:a})})}),x)}function st({size:t="sm",tooltip:o,isPending:r,disabled:a,className:d,children:c,...u}){let m=e(f,{variant:"secondary",size:t,className:i("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",t==="icon"?"size-8":"h-8 px-3",d),disabled:a||r,...u,children:r?e(V,{className:"animate-spin"}):c});return o?p(b,{children:[e(v,{asChild:!0,children:m}),e(y,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:e("p",{children:o})})]}):m}function lt({table:t}){let o=n.useCallback(()=>{t&&t.toggleAllRowsSelected(!1)},[t]);return t?p("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[p("span",{className:"whitespace-nowrap text-sm font-medium",children:[t.getFilteredSelectedRowModel().rows.length," selected"]}),e(h,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),p(b,{children:[e(v,{asChild:!0,children:e(f,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:o,children:e(M,{className:"size-3.5"})})}),p(y,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[e("p",{children:"Clear selection"}),e("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:e("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}export{nt as DataTableActionBar,st as DataTableActionBarAction,lt as DataTableActionBarSelection};
3
3
  //# sourceMappingURL=data-table-action-bar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ui/button.tsx","../../../../src/lib/utils.ts","../../../../src/components/ui/separator.tsx","../../../../src/components/ui/tooltip.tsx","../../../../src/components/data/data-table/data-table-action-bar.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot as SlotPrimitive } from \"radix-ui\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }), \"transition-none\")}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}","import * as React from \"react\"\nimport { Separator as SeparatorPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator-root\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","import * as React from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n )\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n )\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","import { Button } from \"../../ui/button.jsx\"\r\nimport { Separator } from \"../../ui/separator.jsx\"\r\nimport { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"../../ui/tooltip.jsx\"\r\nimport { cn } from \"../../../lib/utils.js\"\r\nimport type { Table } from \"@tanstack/react-table\"\r\nimport { Loader, X } from \"lucide-react\"\r\nimport { AnimatePresence, motion } from \"framer-motion\"\r\nimport * as React from \"react\"\r\nimport * as ReactDOM from \"react-dom\"\r\n\r\ninterface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {\r\n table: Table<TData> | null\r\n visible?: boolean\r\n container?: Element | DocumentFragment | null\r\n children: React.ReactNode\r\n}\r\n\r\nfunction DataTableActionBar<TData>({\r\n table,\r\n visible: visibleProp,\r\n container: containerProp,\r\n children,\r\n className,\r\n ...props\r\n}: DataTableActionBarProps<TData>) {\r\n const [mounted, setMounted] = React.useState(false)\r\n\r\n React.useLayoutEffect(() => {\r\n setMounted(true)\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\" && table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }\r\n\r\n window.addEventListener(\"keydown\", onKeyDown)\r\n return () => window.removeEventListener(\"keydown\", onKeyDown)\r\n }, [table])\r\n\r\n const container = containerProp ?? (mounted ? globalThis.document?.body : null)\r\n\r\n if (!container || !table) return null\r\n\r\n const visible = visibleProp ?? table.getFilteredSelectedRowModel().rows.length > 0\r\n\r\n return ReactDOM.createPortal(\r\n <AnimatePresence>\r\n {visible && (\r\n <motion.div\r\n role=\"toolbar\"\r\n aria-orientation=\"horizontal\"\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n exit={{ opacity: 0, y: 20 }}\r\n transition={{ duration: 0.3, ease: \"easeInOut\" }}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <TooltipProvider>1{children}</TooltipProvider>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n container,\r\n )\r\n}\r\n\r\ninterface DataTableActionBarActionProps extends React.ComponentProps<typeof Button> {\r\n tooltip?: string\r\n isPending?: boolean\r\n}\r\n\r\nfunction DataTableActionBarAction({\r\n size = \"sm\",\r\n tooltip,\r\n isPending,\r\n disabled,\r\n className,\r\n children,\r\n ...props\r\n}: DataTableActionBarActionProps) {\r\n const trigger = (\r\n <Button\r\n variant=\"secondary\"\r\n size={size}\r\n className={cn(\r\n \"gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200\",\r\n size === \"icon\" ? \"size-8\" : \"h-8 px-3\",\r\n className,\r\n )}\r\n disabled={disabled || isPending}\r\n {...props}\r\n >\r\n {isPending ? <Loader className=\"animate-spin\" /> : children}\r\n </Button>\r\n )\r\n\r\n if (!tooltip) return trigger\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={8}\r\n className=\"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden\"\r\n >\r\n <p>{tooltip}</p>\r\n </TooltipContent>\r\n </Tooltip>\r\n )\r\n}\r\n\r\ninterface DataTableActionBarSelectionProps<TData> {\r\n table: Table<TData> | null\r\n}\r\n\r\nfunction DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>) {\r\n const onClearSelection = React.useCallback(() => {\r\n if (table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }, [table])\r\n\r\n if (!table) return null\r\n\r\n return (\r\n <div className=\"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3\">\r\n <span className=\"whitespace-nowrap text-sm font-medium\">\r\n {table.getFilteredSelectedRowModel().rows.length} selected\r\n </span>\r\n <Separator orientation=\"vertical\" className=\"mr-2 ml-3 data-[orientation=vertical]:h-4\" />\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6 rounded-md\" onClick={onClearSelection}>\r\n <X className=\"size-3.5\" />\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={10}\r\n className=\"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden\"\r\n >\r\n <p>Clear selection</p>\r\n <kbd className=\"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm\">\r\n <abbr title=\"Escape\" className=\"no-underline\">\r\n Esc\r\n </abbr>\r\n </kbd>\r\n </TooltipContent>\r\n </Tooltip>\r\n </div>\r\n )\r\n}\r\n\r\nexport { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection }\r\n\r\n/**\r\n\r\nimport { Button } from \"/..../ui/button\"\r\nimport { Separator } from \"/..../ui/separator\"\r\nimport { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"/..../ui/tooltip\"\r\nimport { cn } from \"@/lib/utils\"\r\nimport type { Table } from \"@tanstack/react-table\"\r\nimport { Loader, X } from \"lucide-react\"\r\nimport { AnimatePresence, motion } from \"framer-motion\"\r\nimport * as React from \"react\"\r\nimport * as ReactDOM from \"react-dom\"\r\nimport { Toggle } from \"../ui/toggle\"\r\n\r\ninterface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {\r\n table: Table<TData> | null\r\n visible?: boolean\r\n container?: Element | DocumentFragment | null\r\n children: React.ReactNode\r\n}\r\n\r\nfunction DataTableActionBar<TData>({\r\n table,\r\n visible: visibleProp,\r\n container: containerProp,\r\n children,\r\n className,\r\n ...props\r\n}: DataTableActionBarProps<TData>) {\r\n const [mounted, setMounted] = React.useState(false)\r\n\r\n React.useLayoutEffect(() => {\r\n setMounted(true)\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\" && table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }\r\n\r\n window.addEventListener(\"keydown\", onKeyDown)\r\n return () => window.removeEventListener(\"keydown\", onKeyDown)\r\n }, [table])\r\n\r\n const container = containerProp ?? (mounted ? globalThis.document?.body : null)\r\n\r\n if (!container || !table) return null\r\n\r\n const visible = visibleProp ?? table.getFilteredSelectedRowModel().rows.length > 0\r\n\r\n return ReactDOM.createPortal(\r\n <AnimatePresence>\r\n {visible && (\r\n <motion.div\r\n role=\"toolbar\"\r\n aria-orientation=\"horizontal\"\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n exit={{ opacity: 0, y: 20 }}\r\n transition={{ duration: 0.2, ease: \"easeInOut\" }}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-background/95 backdrop-blur-sm p-3 text-foreground shadow-lg ring-1 ring-black/5\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <TooltipProvider>{children}</TooltipProvider>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n container,\r\n )\r\n}\r\n\r\ninterface DataTableActionBarActionProps extends React.ComponentProps<typeof Toggle> {\r\n tooltip?: string\r\n isPending?: boolean\r\n}\r\n\r\nfunction DataTableActionBarAction({\r\n size = \"sm\",\r\n tooltip,\r\n isPending,\r\n disabled,\r\n className,\r\n children,\r\n ...props\r\n}: DataTableActionBarActionProps) {\r\n const trigger = (\r\n <Toggle\r\n variant=\"default\"\r\n size={size}\r\n className={cn(\r\n \"gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200 p-2\",\r\n className,\r\n )}\r\n disabled={disabled || isPending}\r\n {...props}\r\n >\r\n {isPending ? <Loader className=\"animate-spin\" /> : children}\r\n </Toggle>\r\n )\r\n\r\n if (!tooltip) return trigger\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={8}\r\n className=\"rounded-lg border bg-accent font-semibold text-foreground dark:bg-zinc-900 [&>span]:hidden\"\r\n >\r\n <p>{tooltip}</p>\r\n </TooltipContent>\r\n </Tooltip>\r\n )\r\n}\r\n\r\ninterface DataTableActionBarSelectionProps<TData> {\r\n table: Table<TData> | null\r\n}\r\n\r\nfunction DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>) {\r\n const onClearSelection = React.useCallback(() => {\r\n if (table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }, [table])\r\n\r\n if (!table) return null\r\n\r\n return (\r\n <div className=\"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3\">\r\n <span className=\"whitespace-nowrap text-sm font-medium\">\r\n {table.getFilteredSelectedRowModel().rows.length} selected\r\n </span>\r\n <Separator orientation=\"vertical\" className=\"mr-2 ml-3 data-[orientation=vertical]:h-4\" />\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6 rounded-md\" onClick={onClearSelection}>\r\n <X className=\"size-3.5\" />\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={10}\r\n className=\"flex items-center gap-2 rounded-lg border bg-accent px-3 py-2 font-semibold text-foreground dark:bg-zinc-900 [&>span]:hidden\"\r\n >\r\n <p>Clear selection</p>\r\n <kbd className=\"select-none rounded border bg-background px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm\">\r\n <abbr title=\"Escape\" className=\"no-underline\">\r\n Esc\r\n </abbr>\r\n </kbd>\r\n </TooltipContent>\r\n </Tooltip>\r\n </div>\r\n )\r\n}\r\n\r\nexport { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection }\r\n\r\n */"],"mappings":";AACA,OAAS,QAAQA,MAAqB,WACtC,OAAS,OAAAC,MAA8B,2BCFvC,OAAS,QAAAC,MAA6B,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CD6CI,cAAAC,MAAA,oBA5CJ,IAAMC,EAAiBC,EACrB,8bACA,CACE,SAAU,CACR,QAAS,CACP,QACE,mEACF,YACE,8JACF,QACE,wIACF,UACE,yEACF,MACE,uEACF,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAAI,uCACJ,KAAM,QACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAEA,SAASC,EAAO,CACd,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,GAAGC,CACL,EAGK,CACH,IAAMC,EAAOF,EAAUG,EAAc,KAAO,SAE5C,OACEV,EAACS,EAAA,CACC,YAAU,SACV,UAAWE,EAAGV,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,EAAG,iBAAiB,EAC5E,GAAGI,EACN,CAEJ,CEvDA,OAAS,aAAaI,MAA0B,WAW5C,cAAAC,MAAA,oBAPJ,SAASC,EAAU,CACjB,UAAAC,EACA,YAAAC,EAAc,aACd,WAAAC,EAAa,GACb,GAAGC,CACL,EAAyD,CACvD,OACEL,EAACM,EAAmB,KAAnB,CACC,YAAU,iBACV,WAAYF,EACZ,YAAaD,EACb,UAAWI,EACT,iKACAL,CACF,EACC,GAAGG,EACN,CAEJ,CCtBA,OAAS,WAAWG,MAAwB,WASxC,cAAAC,EAgCE,QAAAC,MAhCF,oBALJ,SAASC,E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CzB,GACFA,EAAM,sBAAsB,EAAK,CAErC,EAAG,CAACA,CAAK,CAAC,EAEV,OAAKA,EAGHF,EAAC,OAAI,UAAU,gEACb,UAAAA,EAAC,QAAK,UAAU,wCACb,UAAAE,EAAM,4BAA4B,EAAE,KAAK,OAAO,aACnD,EACAH,EAAC6B,EAAA,CAAU,YAAY,WAAW,UAAU,4CAA4C,EACxF5B,EAACuB,EAAA,CACC,UAAAxB,EAACyB,EAAA,CAAe,QAAO,GACrB,SAAAzB,EAACuB,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,oBAAoB,QAASK,EACzE,SAAA5B,EAACL,EAAA,CAAE,UAAU,WAAW,EAC1B,EACF,EACAM,EAACyB,EAAA,CACC,WAAY,GACZ,UAAU,gHAEV,UAAA1B,EAAC,KAAE,2BAAe,EAClBA,EAAC,OAAI,UAAU,mHACb,SAAAA,EAAC,QAAK,MAAM,SAAS,UAAU,eAAe,eAE9C,EACF,GACF,GACF,GACF,EA1BiB,IA4BrB","names":["SlotPrimitive","cva","clsx","twMerge","cn","inputs","jsx","buttonVariants","cva","Button","className","variant","size","asChild","props","Comp","SlotPrimitive","cn","SeparatorPrimitive","jsx","Separator","className","orientation","decorative","props","SeparatorPrimitive","cn","TooltipPrimitive","jsx","jsxs","TooltipProvider","delayDuration","props","TooltipPrimitive","Tooltip","TooltipTrigger","TooltipContent","className","sideOffset","children","cn","Loader","X","AnimatePresence","motion","React","ReactDOM","jsx","jsxs","DataTableActionBar","table","visibleProp","containerProp","children","className","props","mounted","setMounted","onKeyDown","event","container","visible","cn","TooltipProvider","DataTableActionBarAction","size","tooltip","isPending","disabled","trigger","Button","Tooltip","TooltipTrigger","TooltipContent","DataTableActionBarSelection","onClearSelection","Separator"]}
1
+ {"version":3,"sources":["../../../../src/components/ui/button.tsx","../../../../src/lib/utils.ts","../../../../src/components/ui/separator.tsx","../../../../src/components/ui/tooltip.tsx","../../../../src/components/data/data-table/data-table-action-bar.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot as SlotPrimitive } from \"radix-ui\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }), \"transition-none\")}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}","import * as React from \"react\"\nimport { Separator as SeparatorPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator-root\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","import * as React from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n )\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n )\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","import { Button } from \"../../ui/button.jsx\"\r\nimport { Separator } from \"../../ui/separator.jsx\"\r\nimport { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"../../ui/tooltip.jsx\"\r\nimport { cn } from \"../../../lib/utils.js\"\r\nimport type { Table } from \"@tanstack/react-table\"\r\nimport { Loader, X } from \"lucide-react\"\r\nimport { AnimatePresence, motion } from \"framer-motion\"\r\nimport * as React from \"react\"\r\nimport * as ReactDOM from \"react-dom\"\r\n\r\ninterface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {\r\n table: Table<TData> | null\r\n visible?: boolean\r\n container?: Element | DocumentFragment | null\r\n children: React.ReactNode\r\n}\r\n\r\nfunction DataTableActionBar<TData>({\r\n table,\r\n visible: visibleProp,\r\n container: containerProp,\r\n children,\r\n className,\r\n ...props\r\n}: DataTableActionBarProps<TData>) {\r\n const [mounted, setMounted] = React.useState(false)\r\n\r\n React.useLayoutEffect(() => {\r\n setMounted(true)\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\" && table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }\r\n\r\n window.addEventListener(\"keydown\", onKeyDown)\r\n return () => window.removeEventListener(\"keydown\", onKeyDown)\r\n }, [table])\r\n\r\n const container = containerProp ?? (mounted ? globalThis.document?.body : null)\r\n\r\n if (!container || !table) return null\r\n\r\n const visible = visibleProp ?? table.getFilteredSelectedRowModel().rows.length > 0\r\n\r\n return ReactDOM.createPortal(\r\n <AnimatePresence>\r\n {visible && (\r\n <motion.div\r\n role=\"toolbar\"\r\n aria-orientation=\"horizontal\"\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n exit={{ opacity: 0, y: 20 }}\r\n transition={{ duration: 0.3, ease: \"easeInOut\" }}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <TooltipProvider>{children}</TooltipProvider>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n container,\r\n )\r\n}\r\n\r\ninterface DataTableActionBarActionProps extends React.ComponentProps<typeof Button> {\r\n tooltip?: string\r\n isPending?: boolean\r\n}\r\n\r\nfunction DataTableActionBarAction({\r\n size = \"sm\",\r\n tooltip,\r\n isPending,\r\n disabled,\r\n className,\r\n children,\r\n ...props\r\n}: DataTableActionBarActionProps) {\r\n const trigger = (\r\n <Button\r\n variant=\"secondary\"\r\n size={size}\r\n className={cn(\r\n \"gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200\",\r\n size === \"icon\" ? \"size-8\" : \"h-8 px-3\",\r\n className,\r\n )}\r\n disabled={disabled || isPending}\r\n {...props}\r\n >\r\n {isPending ? <Loader className=\"animate-spin\" /> : children}\r\n </Button>\r\n )\r\n\r\n if (!tooltip) return trigger\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={8}\r\n className=\"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden\"\r\n >\r\n <p>{tooltip}</p>\r\n </TooltipContent>\r\n </Tooltip>\r\n )\r\n}\r\n\r\ninterface DataTableActionBarSelectionProps<TData> {\r\n table: Table<TData> | null\r\n}\r\n\r\nfunction DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>) {\r\n const onClearSelection = React.useCallback(() => {\r\n if (table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }, [table])\r\n\r\n if (!table) return null\r\n\r\n return (\r\n <div className=\"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3\">\r\n <span className=\"whitespace-nowrap text-sm font-medium\">\r\n {table.getFilteredSelectedRowModel().rows.length} selected\r\n </span>\r\n <Separator orientation=\"vertical\" className=\"mr-2 ml-3 data-[orientation=vertical]:h-4\" />\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6 rounded-md\" onClick={onClearSelection}>\r\n <X className=\"size-3.5\" />\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={10}\r\n className=\"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden\"\r\n >\r\n <p>Clear selection</p>\r\n <kbd className=\"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm\">\r\n <abbr title=\"Escape\" className=\"no-underline\">\r\n Esc\r\n </abbr>\r\n </kbd>\r\n </TooltipContent>\r\n </Tooltip>\r\n </div>\r\n )\r\n}\r\n\r\nexport { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection }\r\n\r\n/**\r\n\r\nimport { Button } from \"/..../ui/button\"\r\nimport { Separator } from \"/..../ui/separator\"\r\nimport { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"/..../ui/tooltip\"\r\nimport { cn } from \"@/lib/utils\"\r\nimport type { Table } from \"@tanstack/react-table\"\r\nimport { Loader, X } from \"lucide-react\"\r\nimport { AnimatePresence, motion } from \"framer-motion\"\r\nimport * as React from \"react\"\r\nimport * as ReactDOM from \"react-dom\"\r\nimport { Toggle } from \"../ui/toggle\"\r\n\r\ninterface DataTableActionBarProps<TData> extends React.ComponentProps<typeof motion.div> {\r\n table: Table<TData> | null\r\n visible?: boolean\r\n container?: Element | DocumentFragment | null\r\n children: React.ReactNode\r\n}\r\n\r\nfunction DataTableActionBar<TData>({\r\n table,\r\n visible: visibleProp,\r\n container: containerProp,\r\n children,\r\n className,\r\n ...props\r\n}: DataTableActionBarProps<TData>) {\r\n const [mounted, setMounted] = React.useState(false)\r\n\r\n React.useLayoutEffect(() => {\r\n setMounted(true)\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n function onKeyDown(event: KeyboardEvent) {\r\n if (event.key === \"Escape\" && table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }\r\n\r\n window.addEventListener(\"keydown\", onKeyDown)\r\n return () => window.removeEventListener(\"keydown\", onKeyDown)\r\n }, [table])\r\n\r\n const container = containerProp ?? (mounted ? globalThis.document?.body : null)\r\n\r\n if (!container || !table) return null\r\n\r\n const visible = visibleProp ?? table.getFilteredSelectedRowModel().rows.length > 0\r\n\r\n return ReactDOM.createPortal(\r\n <AnimatePresence>\r\n {visible && (\r\n <motion.div\r\n role=\"toolbar\"\r\n aria-orientation=\"horizontal\"\r\n initial={{ opacity: 0, y: 20 }}\r\n animate={{ opacity: 1, y: 0 }}\r\n exit={{ opacity: 0, y: 20 }}\r\n transition={{ duration: 0.2, ease: \"easeInOut\" }}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-background/95 backdrop-blur-sm p-3 text-foreground shadow-lg ring-1 ring-black/5\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <TooltipProvider>{children}</TooltipProvider>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n container,\r\n )\r\n}\r\n\r\ninterface DataTableActionBarActionProps extends React.ComponentProps<typeof Toggle> {\r\n tooltip?: string\r\n isPending?: boolean\r\n}\r\n\r\nfunction DataTableActionBarAction({\r\n size = \"sm\",\r\n tooltip,\r\n isPending,\r\n disabled,\r\n className,\r\n children,\r\n ...props\r\n}: DataTableActionBarActionProps) {\r\n const trigger = (\r\n <Toggle\r\n variant=\"default\"\r\n size={size}\r\n className={cn(\r\n \"gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200 p-2\",\r\n className,\r\n )}\r\n disabled={disabled || isPending}\r\n {...props}\r\n >\r\n {isPending ? <Loader className=\"animate-spin\" /> : children}\r\n </Toggle>\r\n )\r\n\r\n if (!tooltip) return trigger\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={8}\r\n className=\"rounded-lg border bg-accent font-semibold text-foreground dark:bg-zinc-900 [&>span]:hidden\"\r\n >\r\n <p>{tooltip}</p>\r\n </TooltipContent>\r\n </Tooltip>\r\n )\r\n}\r\n\r\ninterface DataTableActionBarSelectionProps<TData> {\r\n table: Table<TData> | null\r\n}\r\n\r\nfunction DataTableActionBarSelection<TData>({ table }: DataTableActionBarSelectionProps<TData>) {\r\n const onClearSelection = React.useCallback(() => {\r\n if (table) {\r\n table.toggleAllRowsSelected(false)\r\n }\r\n }, [table])\r\n\r\n if (!table) return null\r\n\r\n return (\r\n <div className=\"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3\">\r\n <span className=\"whitespace-nowrap text-sm font-medium\">\r\n {table.getFilteredSelectedRowModel().rows.length} selected\r\n </span>\r\n <Separator orientation=\"vertical\" className=\"mr-2 ml-3 data-[orientation=vertical]:h-4\" />\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6 rounded-md\" onClick={onClearSelection}>\r\n <X className=\"size-3.5\" />\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent\r\n sideOffset={10}\r\n className=\"flex items-center gap-2 rounded-lg border bg-accent px-3 py-2 font-semibold text-foreground dark:bg-zinc-900 [&>span]:hidden\"\r\n >\r\n <p>Clear selection</p>\r\n <kbd className=\"select-none rounded border bg-background px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm\">\r\n <abbr title=\"Escape\" className=\"no-underline\">\r\n Esc\r\n </abbr>\r\n </kbd>\r\n </TooltipContent>\r\n </Tooltip>\r\n </div>\r\n )\r\n}\r\n\r\nexport { DataTableActionBar, DataTableActionBarAction, DataTableActionBarSelection }\r\n\r\n */"],"mappings":";AACA,OAAS,QAAQA,MAAqB,WACtC,OAAS,OAAAC,MAA8B,2BCFvC,OAAS,QAAAC,MAA6B,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CD6CI,cAAAC,MAAA,oBA5CJ,IAAMC,EAAiBC,EACrB,8bACA,CACE,SAAU,CACR,QAAS,CACP,QACE,mEACF,YACE,8JACF,QACE,wIACF,UACE,yEACF,MACE,uEACF,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAAI,uCACJ,KAAM,QACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAEA,SAASC,EAAO,CACd,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,GAAGC,CACL,EAGK,CACH,IAAMC,EAAOF,EAAUG,EAAc,KAAO,SAE5C,OACEV,EAACS,EAAA,CACC,YAAU,SACV,UAAWE,EAAGV,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,EAAG,iBAAiB,EAC5E,GAAGI,EACN,CAEJ,CEvDA,OAAS,aAAaI,MAA0B,WAW5C,cAAAC,MAAA,oBAPJ,SAASC,EAAU,CACjB,UAAAC,EACA,YAAAC,EAAc,aACd,WAAAC,EAAa,GACb,GAAGC,CACL,EAAyD,CACvD,OACEL,EAACM,EA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EAAA,CACC,WAAY,EACZ,UAAU,+EAEV,SAAA1B,EAAC,KAAG,SAAAmB,EAAQ,EACd,GACF,EAXmBG,CAavB,CAMA,SAASK,GAAmC,CAAE,MAAAxB,CAAM,EAA4C,CAC9F,IAAMyB,EAAyB,cAAY,IAAM,CAC3CzB,GACFA,EAAM,sBAAsB,EAAK,CAErC,EAAG,CAACA,CAAK,CAAC,EAEV,OAAKA,EAGHF,EAAC,OAAI,UAAU,gEACb,UAAAA,EAAC,QAAK,UAAU,wCACb,UAAAE,EAAM,4BAA4B,EAAE,KAAK,OAAO,aACnD,EACAH,EAAC6B,EAAA,CAAU,YAAY,WAAW,UAAU,4CAA4C,EACxF5B,EAACuB,EAAA,CACC,UAAAxB,EAACyB,EAAA,CAAe,QAAO,GACrB,SAAAzB,EAACuB,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,oBAAoB,QAASK,EACzE,SAAA5B,EAACL,EAAA,CAAE,UAAU,WAAW,EAC1B,EACF,EACAM,EAACyB,EAAA,CACC,WAAY,GACZ,UAAU,gHAEV,UAAA1B,EAAC,KAAE,2BAAe,EAClBA,EAAC,OAAI,UAAU,mHACb,SAAAA,EAAC,QAAK,MAAM,SAAS,UAAU,eAAe,eAE9C,EACF,GACF,GACF,GACF,EA1BiB,IA4BrB","names":["SlotPrimitive","cva","clsx","twMerge","cn","inputs","jsx","buttonVariants","cva","Button","className","variant","size","asChild","props","Comp","SlotPrimitive","cn","SeparatorPrimitive","jsx","Separator","className","orientation","decorative","props","SeparatorPrimitive","cn","TooltipPrimitive","jsx","jsxs","TooltipProvider","delayDuration","props","TooltipPrimitive","Tooltip","TooltipTrigger","TooltipContent","className","sideOffset","children","cn","Loader","X","AnimatePresence","motion","React","ReactDOM","jsx","jsxs","DataTableActionBar","table","visibleProp","containerProp","children","className","props","mounted","setMounted","onKeyDown","event","container","visible","cn","TooltipProvider","DataTableActionBarAction","size","tooltip","isPending","disabled","trigger","Button","Tooltip","TooltipTrigger","TooltipContent","DataTableActionBarSelection","onClearSelection","Separator"]}
@@ -1,3 +1,3 @@
1
1
  "use client"
2
- "use strict";var u=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var z=(e,t)=>{for(var o in t)u(e,o,{get:t[o],enumerable:!0})},k=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of C(t))!N.call(e,s)&&s!==o&&u(e,s,{get:()=>t[s],enumerable:!(r=w(t,s))||r.enumerable});return e};var I=e=>k(u({},"__esModule",{value:!0}),e);var D={};z(D,{DataTablePagination:()=>V});module.exports=I(D);var v=require("radix-ui"),f=require("class-variance-authority");var m=require("clsx"),g=require("tailwind-merge");function l(...e){return(0,g.twMerge)((0,m.clsx)(e))}var x=require("react/jsx-runtime"),R=(0,f.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function p({className:e,variant:t,size:o,asChild:r=!1,...s}){let d=r?v.Slot.Slot:"button";return(0,x.jsx)(d,{"data-slot":"button",className:l(R({variant:t,size:o,className:e}),"transition-none"),...s})}var n=require("radix-ui"),c=require("lucide-react");var i=require("react/jsx-runtime");function S({...e}){return(0,i.jsx)(n.Select.Root,{"data-slot":"select",...e})}function h({...e}){return(0,i.jsx)(n.Select.Value,{"data-slot":"select-value",...e})}function P({className:e,size:t="default",children:o,...r}){return(0,i.jsxs)(n.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:l("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[o,(0,i.jsx)(n.Select.Icon,{asChild:!0,children:(0,i.jsx)(c.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function b({className:e,children:t,position:o="popper",...r}){return(0,i.jsx)(n.Select.Portal,{children:(0,i.jsxs)(n.Select.Content,{"data-slot":"select-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:[(0,i.jsx)(T,{}),(0,i.jsx)(n.Select.Viewport,{className:l("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,i.jsx)(B,{})]})})}function y({className:e,children:t,...o}){return(0,i.jsxs)(n.Select.Item,{"data-slot":"select-item",className:l("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...o,children:[(0,i.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,i.jsx)(n.Select.ItemIndicator,{children:(0,i.jsx)(c.CheckIcon,{className:"size-4"})})}),(0,i.jsx)(n.Select.ItemText,{children:t})]})}function T({className:e,...t}){return(0,i.jsx)(n.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:l("flex cursor-default items-center justify-center py-1",e),...t,children:(0,i.jsx)(c.ChevronUpIcon,{className:"size-4"})})}function B({className:e,...t}){return(0,i.jsx)(n.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:l("flex cursor-default items-center justify-center py-1",e),...t,children:(0,i.jsx)(c.ChevronDownIcon,{className:"size-4"})})}var a=require("react/jsx-runtime");function V({table:e,config:t}){return t.enabled?(0,a.jsx)("div",{className:"rounded-xl",children:(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,a.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,a.jsxs)(S,{value:`${e.getState().pagination.pageSize}`,onValueChange:o=>e.setPageSize(Number(o)),children:[(0,a.jsx)(P,{className:"h-9 w-[70px] rounded-lg",children:(0,a.jsx)(h,{})}),(0,a.jsx)(b,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(o=>(0,a.jsx)(y,{value:`${o}`,children:o},o))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(p,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,a.jsx)(p,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,a.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(o,r)=>{let s=e.getState().pagination.pageIndex,d=s-2+r+1;return d<1||d>e.getPageCount()?null:(0,a.jsx)(p,{variant:d===s+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(d-1),children:d},d)})}),(0,a.jsx)(p,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,a.jsx)(p,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}0&&(module.exports={DataTablePagination});
2
+ "use strict";var u=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var z=(e,t)=>{for(var o in t)u(e,o,{get:t[o],enumerable:!0})},k=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of C(t))!N.call(e,s)&&s!==o&&u(e,s,{get:()=>t[s],enumerable:!(r=w(t,s))||r.enumerable});return e};var I=e=>k(u({},"__esModule",{value:!0}),e);var D={};z(D,{DataTablePagination:()=>V});module.exports=I(D);var v=require("radix-ui"),f=require("class-variance-authority");var m=require("clsx"),g=require("tailwind-merge");function l(...e){return(0,g.twMerge)((0,m.clsx)(e))}var x=require("react/jsx-runtime"),R=(0,f.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function p({className:e,variant:t,size:o,asChild:r=!1,...s}){let d=r?v.Slot.Slot:"button";return(0,x.jsx)(d,{"data-slot":"button",className:l(R({variant:t,size:o,className:e}),"transition-none"),...s})}var n=require("radix-ui"),c=require("lucide-react");var i=require("react/jsx-runtime");function S({...e}){return(0,i.jsx)(n.Select.Root,{"data-slot":"select",...e})}function h({...e}){return(0,i.jsx)(n.Select.Value,{"data-slot":"select-value",...e})}function P({className:e,size:t="default",children:o,...r}){return(0,i.jsxs)(n.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:l("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[o,(0,i.jsx)(n.Select.Icon,{asChild:!0,children:(0,i.jsx)(c.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function b({className:e,children:t,position:o="popper",...r}){return(0,i.jsx)(n.Select.Portal,{children:(0,i.jsxs)(n.Select.Content,{"data-slot":"select-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:[(0,i.jsx)(T,{}),(0,i.jsx)(n.Select.Viewport,{className:l("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,i.jsx)(B,{})]})})}function y({className:e,children:t,...o}){return(0,i.jsxs)(n.Select.Item,{"data-slot":"select-item",className:l("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...o,children:[(0,i.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,i.jsx)(n.Select.ItemIndicator,{children:(0,i.jsx)(c.CheckIcon,{className:"size-4"})})}),(0,i.jsx)(n.Select.ItemText,{children:t})]})}function T({className:e,...t}){return(0,i.jsx)(n.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:l("flex cursor-default items-center justify-center py-1",e),...t,children:(0,i.jsx)(c.ChevronUpIcon,{className:"size-4"})})}function B({className:e,...t}){return(0,i.jsx)(n.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:l("flex cursor-default items-center justify-center py-1",e),...t,children:(0,i.jsx)(c.ChevronDownIcon,{className:"size-4"})})}var a=require("react/jsx-runtime");function V({table:e,config:t}){return t.enabled?(0,a.jsx)("div",{className:"rounded-xl",children:(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,a.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,a.jsxs)(S,{value:`${e.getState().pagination.pageSize}`,onValueChange:o=>e.setPageSize(Number(o)),children:[(0,a.jsx)(P,{className:"h-9 w-[70px] rounded-lg",children:(0,a.jsx)(h,{})}),(0,a.jsx)(b,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(o=>(0,a.jsx)(y,{value:`${o}`,children:o},o))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(p,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,a.jsx)(p,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,a.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(o,r)=>{let s=e.getState().pagination.pageIndex,d=s+r;return d<1||d>e.getPageCount()?null:(0,a.jsx)(p,{variant:d===s+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(d-1),children:d},d)})}),(0,a.jsx)(p,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,a.jsx)(p,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}0&&(module.exports={DataTablePagination});
3
3
  //# sourceMappingURL=data-table-pagination.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/data/data-table/data-table-pagination.tsx","../../../../src/components/ui/button.tsx","../../../../src/lib/utils.ts","../../../../src/components/ui/select.tsx"],"sourcesContent":["import type { Table } from \"@tanstack/react-table\"\r\n\r\nimport { Button } from \"../../ui/button.jsx\"\r\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../../ui/select.jsx\"\r\nimport type { PaginationConfig } from \"./data-table-types.js\"\r\n\r\ninterface DataTablePaginationProps<TData> {\r\n table: Table<TData>\r\n config: PaginationConfig\r\n}\r\n\r\nexport function DataTablePagination<TData>({ table, config }: DataTablePaginationProps<TData>) {\r\n if (!config.enabled) return null\r\n\r\n return (\r\n <div className=\"rounded-xl\">\r\n <div>\r\n <div className=\"flex items-center justify-between\">\r\n <div className=\"flex items-center gap-6 text-sm text-muted-foreground\">\r\n {config.showInfo !== false && (\r\n <span>\r\n Showing {table.getState().pagination.pageIndex * table.getState().pagination.pageSize + 1} to{\" \"}\r\n {Math.min(\r\n (table.getState().pagination.pageIndex + 1) * table.getState().pagination.pageSize,\r\n table.getFilteredRowModel().rows.length,\r\n )}{\" \"}\r\n of {table.getFilteredRowModel().rows.length} entries\r\n </span>\r\n )}\r\n </div>\r\n\r\n <div className=\"flex items-center gap-4\">\r\n {config.pageSizeOptions && (\r\n <div className=\"flex items-center gap-2\">\r\n <span className=\"text-sm font-medium\">Rows per page:</span>\r\n <Select\r\n value={`${table.getState().pagination.pageSize}`}\r\n onValueChange={(value) => table.setPageSize(Number(value))}\r\n >\r\n <SelectTrigger className=\"h-9 w-[70px] rounded-lg\">\r\n <SelectValue />\r\n </SelectTrigger>\r\n <SelectContent side=\"top\" className=\"rounded-lg\">\r\n {config.pageSizeOptions.map((pageSize) => (\r\n <SelectItem key={pageSize} value={`${pageSize}`}>\r\n {pageSize}\r\n </SelectItem>\r\n ))}\r\n </SelectContent>\r\n </Select>\r\n </div>\r\n )}\r\n\r\n <div className=\"flex items-center gap-2\">\r\n <Button\r\n variant=\"outline\"\r\n size=\"sm\"\r\n onClick={() => table.setPageIndex(0)}\r\n disabled={!table.getCanPreviousPage()}\r\n className=\"rounded-lg\"\r\n >\r\n First\r\n </Button>\r\n <Button\r\n variant=\"outline\"\r\n size=\"sm\"\r\n onClick={() => table.previousPage()}\r\n disabled={!table.getCanPreviousPage()}\r\n className=\"rounded-lg\"\r\n >\r\n Previous\r\n </Button>\r\n\r\n {config.showPageNumbers && (\r\n <div className=\"flex items-center gap-1\">\r\n {Array.from({ length: Math.min(5, table.getPageCount()) }, (_, i) => {\r\n const pageIndex = table.getState().pagination.pageIndex\r\n const pageNumber = pageIndex - 2 + i + 1\r\n if (pageNumber < 1 || pageNumber > table.getPageCount()) return null\r\n\r\n return (\r\n <Button\r\n key={pageNumber}\r\n variant={pageNumber === pageIndex + 1 ? \"default\" : \"outline\"}\r\n size=\"sm\"\r\n className=\"size-8 p-0 rounded-lg\"\r\n onClick={() => table.setPageIndex(pageNumber - 1)}\r\n >\r\n {pageNumber}\r\n </Button>\r\n )\r\n })}\r\n </div>\r\n )}\r\n\r\n <Button\r\n variant=\"outline\"\r\n size=\"sm\"\r\n onClick={() => table.nextPage()}\r\n disabled={!table.getCanNextPage()}\r\n className=\"rounded-lg\"\r\n >\r\n Next\r\n </Button>\r\n <Button\r\n variant=\"outline\"\r\n size=\"sm\"\r\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\r\n disabled={!table.getCanNextPage()}\r\n className=\"rounded-lg\"\r\n >\r\n Last\r\n </Button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n","import * as React from \"react\"\nimport { Slot as SlotPrimitive } from \"radix-ui\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }), \"transition-none\")}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}","import * as React from \"react\"\nimport { Select as SelectPrimitive } from \"radix-ui\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"popper\",\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GCCA,IAAAI,EAAsC,oBACtCC,EAAuC,oCCFvC,IAAAC,EAAsC,gBACtCC,EAAwB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EAAGD,EAAM,aAAa,CAAC,CAAE,EAAG,CAACU,EAAGC,IAAM,CACnE,IAAMC,EAAYZ,EAAM,SAAS,EAAE,WAAW,UACxCa,EAAaD,EAAY,EAAID,EAAI,EACvC,OAAIE,EAAa,GAAKA,EAAab,EAAM,aAAa,EAAU,QAG9D,OAACS,EAAA,CAEC,QAASI,IAAeD,EAAY,EAAI,UAAY,UACpD,KAAK,KACL,UAAU,wBACV,QAAS,IAAMZ,EAAM,aAAaa,EAAa,CAAC,EAE/C,SAAAA,GANIA,CAOP,CAEJ,CAAC,EACH,KAGF,OAACJ,EAAA,CACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAMT,EAAM,SAAS,EAC9B,SAAU,CAACA,EAAM,eAAe,EAChC,UAAU,aACX,gBAED,KACA,OAACS,EAAA,CACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAMT,EAAM,aAAaA,EAAM,aAAa,EAAI,CAAC,EAC1D,SAAU,CAACA,EAAM,eAAe,EAChC,UAAU,aACX,gBAED,GACF,GACF,GACF,EACF,EACF,EAzG0B,IA2G9B","names":["data_table_pagination_exports","__export","DataTablePagination","__toCommonJS","import_radix_ui","import_class_variance_authority","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","buttonVariants","Button","className","variant","size","asChild","props","Comp","SlotPrimitive","cn","import_radix_ui","import_lucide_react","import_jsx_runtime","Select","props","SelectPrimitive","SelectValue","props","SelectPrimitive","SelectTrigger","className","size","children","cn","SelectContent","position","SelectScrollUpButton","SelectScrollDownButton","SelectItem","className","children","props","SelectPrimitive","cn","SelectScrollUpButton","className","props","SelectPrimitive","cn","SelectScrollDownButton","import_jsx_runtime","DataTablePagination","table","config","Select","value","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","Button","_","i","pageIndex","pageNumber"]}
1
+ {"version":3,"sources":["../../../../src/components/data/data-table/data-table-pagination.tsx","../../../../src/components/ui/button.tsx","../../../../src/lib/utils.ts","../../../../src/components/ui/select.tsx"],"sourcesContent":["import type { Table } from \"@tanstack/react-table\"\r\n\r\nimport { Button } from \"../../ui/button.jsx\"\r\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../../ui/select.jsx\"\r\nimport type { PaginationConfig } from \"./data-table-types.js\"\r\n\r\ninterface DataTablePaginationProps<TData> {\r\n table: Table<TData>\r\n config: PaginationConfig\r\n}\r\n\r\nexport function DataTablePagination<TData>({ table, config }: DataTablePaginationProps<TData>) {\r\n if (!config.enabled) return null\r\n\r\n return (\r\n <div className=\"rounded-xl\">\r\n <div>\r\n <div className=\"flex items-center justify-between\">\r\n <div className=\"flex items-center gap-6 text-sm text-muted-foreground\">\r\n {config.showInfo !== false && (\r\n <span>\r\n Showing {table.getState().pagination.pageIndex * table.getState().pagination.pageSize + 1} to{\" \"}\r\n {Math.min(\r\n (table.getState().pagination.pageIndex + 1) * table.getState().pagination.pageSize,\r\n table.getFilteredRowModel().rows.length,\r\n )}{\" \"}\r\n of {table.getFilteredRowModel().rows.length} entries\r\n </span>\r\n )}\r\n </div>\r\n\r\n <div className=\"flex items-center gap-4\">\r\n {config.pageSizeOptions && (\r\n <div className=\"flex items-center gap-2\">\r\n <span className=\"text-sm font-medium\">Rows per page:</span>\r\n <Select\r\n value={`${table.getState().pagination.pageSize}`}\r\n onValueChange={(value) => table.setPageSize(Number(value))}\r\n >\r\n <SelectTrigger className=\"h-9 w-[70px] rounded-lg\">\r\n <SelectValue />\r\n </SelectTrigger>\r\n <SelectContent side=\"top\" className=\"rounded-lg\">\r\n {config.pageSizeOptions.map((pageSize) => (\r\n <SelectItem key={pageSize} value={`${pageSize}`}>\r\n {pageSize}\r\n </SelectItem>\r\n ))}\r\n </SelectContent>\r\n </Select>\r\n </div>\r\n )}\r\n\r\n <div className=\"flex items-center gap-2\">\r\n <Button\r\n variant=\"outline\"\r\n size=\"sm\"\r\n onClick={() => table.setPageIndex(0)}\r\n disabled={!table.getCanPreviousPage()}\r\n className=\"rounded-lg\"\r\n >\r\n First\r\n </Button>\r\n <Button\r\n variant=\"outline\"\r\n size=\"sm\"\r\n onClick={() => table.previousPage()}\r\n disabled={!table.getCanPreviousPage()}\r\n className=\"rounded-lg\"\r\n >\r\n Previous\r\n </Button>\r\n\r\n {config.showPageNumbers && (\r\n <div className=\"flex items-center gap-1\">\r\n {Array.from({ length: Math.min(5, table.getPageCount()) }, (_, i) => {\r\n const pageIndex = table.getState().pagination.pageIndex\r\n const pageNumber = pageIndex + i\r\n if (pageNumber < 1 || pageNumber > table.getPageCount()) return null\r\n return (\r\n <Button\r\n key={pageNumber}\r\n variant={pageNumber === pageIndex + 1 ? \"default\" : \"outline\"}\r\n size=\"sm\"\r\n className=\"size-8 p-0 rounded-lg\"\r\n onClick={() => table.setPageIndex(pageNumber - 1)}\r\n >\r\n {pageNumber}\r\n </Button>\r\n )\r\n })}\r\n </div>\r\n )}\r\n\r\n <Button\r\n variant=\"outline\"\r\n size=\"sm\"\r\n onClick={() => table.nextPage()}\r\n disabled={!table.getCanNextPage()}\r\n className=\"rounded-lg\"\r\n >\r\n Next\r\n </Button>\r\n <Button\r\n variant=\"outline\"\r\n size=\"sm\"\r\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\r\n disabled={!table.getCanNextPage()}\r\n className=\"rounded-lg\"\r\n >\r\n Last\r\n </Button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n","import * as React from \"react\"\nimport { Slot as SlotPrimitive } from \"radix-ui\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }), \"transition-none\")}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}","import * as React from \"react\"\nimport { Select as SelectPrimitive } from \"radix-ui\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"popper\",\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GCCA,IAAAI,EAAsC,oBACtCC,EAAuC,oCCFvC,IAAAC,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CD6CI,IAAAC,EAAA,6BA5CEC,KAAiB,OACrB,8bACA,CACE,SAAU,CACR,QAAS,CACP,QACE,mEACF,YACE,8JACF,QACE,wIACF,UACE,yEACF,MACE,uEACF,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAA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S,IAAMZ,EAAM,aAAaa,EAAa,CAAC,EAE/C,SAAAA,GANIA,CAOP,CAEJ,CAAC,EACH,KAGF,OAACJ,EAAA,CACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAMT,EAAM,SAAS,EAC9B,SAAU,CAACA,EAAM,eAAe,EAChC,UAAU,aACX,gBAED,KACA,OAACS,EAAA,CACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAMT,EAAM,aAAaA,EAAM,aAAa,EAAI,CAAC,EAC1D,SAAU,CAACA,EAAM,eAAe,EAChC,UAAU,aACX,gBAED,GACF,GACF,GACF,EACF,EACF,EAxG0B,IA0G9B","names":["data_table_pagination_exports","__export","DataTablePagination","__toCommonJS","import_radix_ui","import_class_variance_authority","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","buttonVariants","Button","className","variant","size","asChild","props","Comp","SlotPrimitive","cn","import_radix_ui","import_lucide_react","import_jsx_runtime","Select","props","SelectPrimitive","SelectValue","props","SelectPrimitive","SelectTrigger","className","size","children","cn","SelectContent","position","SelectScrollUpButton","SelectScrollDownButton","SelectItem","className","children","props","SelectPrimitive","cn","SelectScrollUpButton","className","props","SelectPrimitive","cn","SelectScrollDownButton","import_jsx_runtime","DataTablePagination","table","config","Select","value","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","Button","_","i","pageIndex","pageNumber"]}
@@ -1,3 +1,3 @@
1
1
  "use client"
2
- import{Slot as b}from"radix-ui";import{cva as y}from"class-variance-authority";import{clsx as h}from"clsx";import{twMerge as P}from"tailwind-merge";function r(...e){return P(h(e))}import{jsx as C}from"react/jsx-runtime";var w=y("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function d({className:e,variant:t,size:a,asChild:l=!1,...p}){let s=l?b.Slot:"button";return C(s,{"data-slot":"button",className:r(w({variant:t,size:a,className:e}),"transition-none"),...p})}import{Select as n}from"radix-ui";import{CheckIcon as N,ChevronDownIcon as m,ChevronUpIcon as z}from"lucide-react";import{jsx as o,jsxs as u}from"react/jsx-runtime";function g({...e}){return o(n.Root,{"data-slot":"select",...e})}function v({...e}){return o(n.Value,{"data-slot":"select-value",...e})}function f({className:e,size:t="default",children:a,...l}){return u(n.Trigger,{"data-slot":"select-trigger","data-size":t,className:r("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l,children:[a,o(n.Icon,{asChild:!0,children:o(m,{className:"size-4 opacity-50"})})]})}function x({className:e,children:t,position:a="popper",...l}){return o(n.Portal,{children:u(n.Content,{"data-slot":"select-content",className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...l,children:[o(k,{}),o(n.Viewport,{className:r("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),o(I,{})]})})}function S({className:e,children:t,...a}){return u(n.Item,{"data-slot":"select-item",className:r("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[o("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o(n.ItemIndicator,{children:o(N,{className:"size-4"})})}),o(n.ItemText,{children:t})]})}function k({className:e,...t}){return o(n.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:o(z,{className:"size-4"})})}function I({className:e,...t}){return o(n.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:o(m,{className:"size-4"})})}import{jsx as i,jsxs as c}from"react/jsx-runtime";function q({table:e,config:t}){return t.enabled?i("div",{className:"rounded-xl",children:i("div",{children:c("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&c("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),c("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&c("div",{className:"flex items-center gap-2",children:[i("span",{className:"text-sm font-medium",children:"Rows per page:"}),c(g,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[i(f,{className:"h-9 w-[70px] rounded-lg",children:i(v,{})}),i(x,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>i(S,{value:`${a}`,children:a},a))})]})]}),c("div",{className:"flex items-center gap-2",children:[i(d,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),i(d,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&i("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,l)=>{let p=e.getState().pagination.pageIndex,s=p-2+l+1;return s<1||s>e.getPageCount()?null:i(d,{variant:s===p+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(s-1),children:s},s)})}),i(d,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),i(d,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}export{q as DataTablePagination};
2
+ import{Slot as b}from"radix-ui";import{cva as y}from"class-variance-authority";import{clsx as h}from"clsx";import{twMerge as P}from"tailwind-merge";function r(...e){return P(h(e))}import{jsx as C}from"react/jsx-runtime";var w=y("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function d({className:e,variant:t,size:a,asChild:l=!1,...p}){let s=l?b.Slot:"button";return C(s,{"data-slot":"button",className:r(w({variant:t,size:a,className:e}),"transition-none"),...p})}import{Select as n}from"radix-ui";import{CheckIcon as N,ChevronDownIcon as m,ChevronUpIcon as z}from"lucide-react";import{jsx as o,jsxs as u}from"react/jsx-runtime";function g({...e}){return o(n.Root,{"data-slot":"select",...e})}function v({...e}){return o(n.Value,{"data-slot":"select-value",...e})}function f({className:e,size:t="default",children:a,...l}){return u(n.Trigger,{"data-slot":"select-trigger","data-size":t,className:r("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l,children:[a,o(n.Icon,{asChild:!0,children:o(m,{className:"size-4 opacity-50"})})]})}function x({className:e,children:t,position:a="popper",...l}){return o(n.Portal,{children:u(n.Content,{"data-slot":"select-content",className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...l,children:[o(k,{}),o(n.Viewport,{className:r("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),o(I,{})]})})}function S({className:e,children:t,...a}){return u(n.Item,{"data-slot":"select-item",className:r("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[o("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o(n.ItemIndicator,{children:o(N,{className:"size-4"})})}),o(n.ItemText,{children:t})]})}function k({className:e,...t}){return o(n.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:o(z,{className:"size-4"})})}function I({className:e,...t}){return o(n.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:o(m,{className:"size-4"})})}import{jsx as i,jsxs as c}from"react/jsx-runtime";function q({table:e,config:t}){return t.enabled?i("div",{className:"rounded-xl",children:i("div",{children:c("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&c("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),c("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&c("div",{className:"flex items-center gap-2",children:[i("span",{className:"text-sm font-medium",children:"Rows per page:"}),c(g,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[i(f,{className:"h-9 w-[70px] rounded-lg",children:i(v,{})}),i(x,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>i(S,{value:`${a}`,children:a},a))})]})]}),c("div",{className:"flex items-center gap-2",children:[i(d,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),i(d,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&i("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,l)=>{let p=e.getState().pagination.pageIndex,s=p+l;return s<1||s>e.getPageCount()?null:i(d,{variant:s===p+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(s-1),children:s},s)})}),i(d,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),i(d,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}export{q as DataTablePagination};
3
3
  //# sourceMappingURL=data-table-pagination.js.map