import{c as e,s as t,z as n}from"./useRouterState-DyVgzXuA.js";import{St as r}from"./button-cdxnqcgzwko8ooha-DePtDphh.js";import{t as i}from"./checkbox-kt1uojk2f9e0d0h1-B7n5h7Tt.js";var a=e(),o=n(t(),1),s={layout:{auto:{classes:``,description:`Auto table layout - columns resize based on content`},fixed:{classes:`table-fixed`,description:`Fixed table layout - columns have equal width, controlled via colgroup`}},variant:{default:{classes:``,description:`Default row variant`},selected:{classes:`bg-kumo-tint`,description:`Selected row variant`}},sticky:{left:{classes:`sticky left-0`,description:`Pin column to the left edge of the scroll container`},right:{classes:`sticky right-0`,description:`Pin column to the right edge of the scroll container`}}},c=(e,t)=>{let n=s.sticky[e].classes;return r(n,t===`head`?`z-2`:`z-1`,`bg-kumo-base`,e===`right`?`before:pointer-events-none before:absolute before:inset-y-0 before:-left-6 before:w-6 before:bg-gradient-to-r before:from-transparent before:to-kumo-base`:`before:pointer-events-none before:absolute before:inset-y-0 before:-right-6 before:w-6 before:bg-gradient-to-l before:from-transparent before:to-kumo-base`)},l={layout:`auto`,variant:`default`},u=(0,o.forwardRef)(({layout:e=`auto`,...t},n)=>{let i=r(`isolate w-full`,s.layout[e].classes,`[&_td]:border-b [&_td]:border-kumo-fill [&_tr:last-child_td]:border-b-0`,`[&_td]:p-3`,`[&_th]:border-b [&_th]:border-kumo-fill [&_th]:p-3 [&_th]:font-semibold [&_th]:text-base`,`[&_th]:bg-kumo-base`,`text-left text-kumo-default`,t.className);return(0,a.jsx)(`table`,{ref:n,...t,className:i})}),d=(0,o.forwardRef)(({variant:e=`default`,sticky:t,...n},i)=>{let o=r(e===`compact`&&`[&_th]:bg-kumo-elevated [&_th]:py-2 text-xs text-kumo-strong`,t&&`[&_th]:sticky [&_th]:top-0 [&_th]:z-1`,n.className);return(0,a.jsx)(`thead`,{ref:i,...n,className:o})}),f=(0,o.forwardRef)(({sticky:e,...t},n)=>{let i=r(`group relative`,e&&c(e,`head`),t.className);return(0,a.jsx)(`th`,{ref:n,...t,className:i})}),p=(0,o.forwardRef)(({variant:e=l.variant,...t},n)=>{let i=r(s.variant[e].classes,t.className);return(0,a.jsx)(`tr`,{ref:n,...t,className:i})}),m=(0,o.forwardRef)((e,t)=>(0,a.jsx)(`tbody`,{ref:t,...e})),h=(0,o.forwardRef)(({sticky:e,...t},n)=>{let i=r(e&&c(e,`cell`),t.className);return(0,a.jsx)(`td`,{ref:n,...t,className:i})}),g=(0,o.forwardRef)((e,t)=>(0,a.jsx)(`tfoot`,{ref:t,...e})),_=(0,o.forwardRef)((e,t)=>(0,a.jsx)(`button`,{ref:t,...e,type:`button`,"aria-label":`Resize column`,className:r(`invisible h-full group-hover:visible`,`w-[10px]`,`flex items-center justify-center`,`cursor-col-resize touch-none select-none`,`absolute top-0 right-0`,`m-0 bg-kumo-base p-0`),children:(0,a.jsx)(`span`,{className:`h-5 w-[2px] rounded bg-kumo-hairline`})})),v=(0,o.forwardRef)(({checked:e,indeterminate:t,onValueChange:n,label:o,disabled:s,...c},l)=>(0,a.jsx)(h,{ref:l,...c,className:r(`w-10 leading-none`,c.className),children:(0,a.jsx)(i,{checked:e,indeterminate:t,onCheckedChange:e=>{n?.(e)},"aria-label":o??`Select row`,disabled:s,className:`relative before:absolute before:-inset-3 before:content-['']`})})),y=(0,o.forwardRef)(({checked:e,indeterminate:t,onValueChange:n,label:o,disabled:s,...c},l)=>(0,a.jsx)(f,{ref:l,...c,className:r(`w-10 leading-none`,c.className),children:(0,a.jsx)(i,{checked:e,indeterminate:t,onCheckedChange:e=>{n?.(e)},"aria-label":o??`Select all rows`,disabled:s,className:`relative before:absolute before:-inset-3 before:content-['']`})}));u.displayName=`Table`,m.displayName=`Table.Body`,f.displayName=`Table.Head`,p.displayName=`Table.Row`,h.displayName=`Table.Cell`,g.displayName=`Table.Footer`,d.displayName=`Table.Header`,_.displayName=`Table.ResizeHandle`,v.displayName=`Table.CheckCell`,y.displayName=`Table.CheckHead`;var b=Object.assign(u,{Header:d,Head:f,Row:p,Body:m,Cell:h,CheckCell:v,CheckHead:y,Footer:g,ResizeHandle:_});export{b as t};