import{r as e,t}from"./jsx-runtime-DAs1UGHr.js";import{l as n}from"./matchContext-DoIVbOYX.js";import{Nt as r}from"./preload-helper-D7v3KC5t.js";import{t as i}from"./checkbox-CWANiedi-Dqh5g87e.js";var a=t(),o=e(n(),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`}}},c={layout:`auto`,variant:`default`},l=(0,o.forwardRef)(({layout:e=`auto`,...t},n)=>{let i=r(`w-full`,s.layout[e].classes,`[&_tr_td]:border-b [&_tr_td]:border-kumo-fill [&_tr:last-child_td]:border-b-0`,`[&_tr_td]:p-3`,`[&_tr_th]:border-b [&_tr_th]:border-kumo-fill [&_tr_th]:p-3 [&_tr_th]:font-semibold`,`[&_tr_th]:bg-kumo-base`,`text-left text-kumo-default`,t.className);return(0,a.jsx)(`table`,{ref:n,...t,className:i})}),u=(0,o.forwardRef)((e,t)=>(0,a.jsx)(`thead`,{ref:t,...e})),d=(0,o.forwardRef)((e,t)=>{let n=r(`group relative`,e.className);return(0,a.jsx)(`th`,{ref:t,...e,className:n})}),f=(0,o.forwardRef)(({variant:e=c.variant,...t},n)=>{let i=r(s.variant[e].classes,t.className);return(0,a.jsx)(`tr`,{ref:n,...t,className:i})}),p=(0,o.forwardRef)((e,t)=>(0,a.jsx)(`tbody`,{ref:t,...e})),m=(0,o.forwardRef)((e,t)=>(0,a.jsx)(`td`,{ref:t,...e})),h=(0,o.forwardRef)((e,t)=>(0,a.jsx)(`tfoot`,{ref:t,...e})),g=(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-ring`})})),_=(0,o.forwardRef)(({checked:e,onValueChange:t,label:n,disabled:o,...s},c)=>(0,a.jsx)(m,{ref:c,...s,className:r(`cursor-pointer p-0 leading-none`,o&&`cursor-default`,s.className),onClick:n=>{n.stopPropagation(),o||t?.(!e)},children:(0,a.jsx)(i,{checked:e,onClick:e=>e.stopPropagation(),onCheckedChange:t,"aria-label":n??`Select row`,disabled:o})})),v=(0,o.forwardRef)(({checked:e,onValueChange:t,label:n,disabled:o,...s},c)=>(0,a.jsx)(d,{ref:c,...s,className:r(`cursor-pointer p-0 leading-none`,o&&`cursor-default`,s.className),onClick:n=>{n.stopPropagation(),o||t?.(!e)},children:(0,a.jsx)(i,{checked:e,onClick:e=>e.stopPropagation(),onCheckedChange:t,"aria-label":n??`Select all rows`,disabled:o})}));l.displayName=`Table`,p.displayName=`Table.Body`,d.displayName=`Table.Head`,f.displayName=`Table.Row`,m.displayName=`Table.Cell`,h.displayName=`Table.Footer`,u.displayName=`Table.Header`,g.displayName=`Table.ResizeHandle`,_.displayName=`Table.CheckCell`,v.displayName=`Table.CheckHead`;var y=Object.assign(l,{Header:u,Head:d,Row:f,Body:p,Cell:m,CheckCell:_,CheckHead:v,Footer:h,ResizeHandle:g});export{y as t};