@alkimi.org/ui-kit 0.8.2 → 0.8.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alkimi.org/ui-kit",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "packageManager": "pnpm@10.26.0",
5
5
  "description": "A React component library built with shadcn/ui and Tailwind CSS",
6
6
  "main": "./dist/index.js",
@@ -79,6 +79,7 @@
79
79
  "vite": "^7.3.0"
80
80
  },
81
81
  "dependencies": {
82
+ "@radix-ui/react-accordion": "^1.2.12",
82
83
  "@radix-ui/react-avatar": "^1.1.11",
83
84
  "@radix-ui/react-checkbox": "^1.3.3",
84
85
  "@radix-ui/react-dialog": "^1.0.5",
@@ -1,3 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
- var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var l = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');var p=l.createContext({}),u="[&_tr>th:first-child]:sticky [&_tr>th:first-child]:left-0 [&_tr>th:first-child]:z-10 [&_tr>th:first-child]:bg-background [&_tr>th:first-child]:after:absolute [&_tr>th:first-child]:after:right-0 [&_tr>th:first-child]:after:top-0 [&_tr>th:first-child]:after:h-full [&_tr>th:first-child]:after:w-px [&_tr>th:first-child]:after:bg-border [&_tr>td:first-child]:sticky [&_tr>td:first-child]:left-0 [&_tr>td:first-child]:z-10 [&_tr>td:first-child]:bg-background [&_tr>td:first-child]:after:absolute [&_tr>td:first-child]:after:right-0 [&_tr>td:first-child]:after:top-0 [&_tr>td:first-child]:after:h-full [&_tr>td:first-child]:after:w-px [&_tr>td:first-child]:after:bg-border";function g({className:t,stickyFirstColumn:e,...r}){return _jsxruntime.jsx.call(void 0, p.Provider,{value:{stickyFirstColumn:e},children:_jsxruntime.jsx.call(void 0, "div",{"data-slot":"table-container",className:_chunkFUYXCJOQjs.a.call(void 0, "relative bg-background w-full overflow-x-auto border border-border rounded-3xl",e&&u),children:_jsxruntime.jsx.call(void 0, "table",{"data-slot":"table",className:_chunkFUYXCJOQjs.a.call(void 0, "w-full caption-bottom text-sm",t),...r})})})}function y({className:t,...e}){return _jsxruntime.jsx.call(void 0, "thead",{"data-slot":"table-header",className:_chunkFUYXCJOQjs.a.call(void 0, "[&_tr]:border-b text-secondary-text",t),...e})}function R({className:t,...e}){return _jsxruntime.jsx.call(void 0, "tbody",{"data-slot":"table-body",className:_chunkFUYXCJOQjs.a.call(void 0, "[&_tr:last-child]:border-0",t),...e})}function T({className:t,...e}){return _jsxruntime.jsx.call(void 0, "tfoot",{"data-slot":"table-footer",className:_chunkFUYXCJOQjs.a.call(void 0, "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...e})}function k({className:t,isClickable:e,actionIcon:r,children:s,...i}){let c=r==="eye"?_jsxruntime.jsx.call(void 0, _lucidereact.Eye,{className:"h-4 w-4"}):r==="more"?_jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical,{className:"h-4 w-4"}):null;return _jsxruntime.jsxs.call(void 0, "tr",{"data-slot":"table-row",className:_chunkFUYXCJOQjs.a.call(void 0, "border-b border-border/50 transition-colors",e&&"cursor-pointer hover:bg-muted/50",t),...i,children:[r!==void 0&&_jsxruntime.jsx.call(void 0, m,{className:"w-12",children:c}),s]})}function v({className:t,isSticky:e,...r}){return _jsxruntime.jsx.call(void 0, "th",{"data-slot":"table-head",className:_chunkFUYXCJOQjs.a.call(void 0, "text-secondary-text h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",e&&"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border",t),...r})}function m({className:t,isSticky:e,...r}){return _jsxruntime.jsx.call(void 0, "td",{"data-slot":"table-cell",className:_chunkFUYXCJOQjs.a.call(void 0, "p-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e&&"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border",t),...r})}function P({className:t,onClick:e,children:r,asChild:s=!1,...i}){let c=n=>{n.stopPropagation(),_optionalChain([e, 'optionalCall', _2 => _2(n)])};return s&&l.isValidElement(r)?l.cloneElement(r,{onClick:n=>{n.stopPropagation();let d=r.props.onClick;_optionalChain([d, 'optionalCall', _3 => _3(n)])},className:_chunkFUYXCJOQjs.a.call(void 0, "inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:bg-muted/50 hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent",r.props.className,t)}):_jsxruntime.jsx.call(void 0, "button",{type:"button","data-slot":"table-cell-action",className:_chunkFUYXCJOQjs.a.call(void 0, "inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent",t),onClick:c,...i,children:r})}function _({className:t,...e}){return _jsxruntime.jsx.call(void 0, "caption",{"data-slot":"table-caption",className:_chunkFUYXCJOQjs.a.call(void 0, "text-muted-foreground mt-4 text-sm",t),...e})}exports.a = g; exports.b = y; exports.c = R; exports.d = T; exports.e = k; exports.f = v; exports.g = m; exports.h = P; exports.i = _;
3
- //# sourceMappingURL=chunk-2Q4N3AS5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-2Q4N3AS5.js","../src/components/table.tsx"],"names":["TableContext","stickyFirstColumnStyles","Table","className","stickyFirstColumn","props","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","isClickable","actionIcon","children","iconComponent","Eye","MoreVertical","jsxs","TableCell","TableHead","isSticky","TableCellAction","onClick","asChild","handleClick","e","childOnClick","TableCaption"],"mappings":"AAAA,22BAAY;AACZ,sDAAkC,uECCX,2CACW,+CA2B1B,IAnBFA,CAAAA,CAAqB,CAAA,CAAA,aAAA,CAAiC,CAAC,CAAC,CAAA,CAMxDC,CAAAA,CACJ,6pBAAA,CAEF,SAASC,CAAAA,CAAM,CAAE,SAAA,CAAAC,CAAAA,CAAW,iBAAA,CAAAC,CAAAA,CAAmB,GAAGC,CAAM,CAAA,CAAe,CACrE,OACEC,6BAAAA,CAACN,CAAa,QAAA,CAAb,CAAsB,KAAA,CAAO,CAAE,iBAAA,CAAAI,CAAkB,CAAA,CAChD,QAAA,CAAAE,6BAAAA,KAAC,CAAA,CACC,WAAA,CAAU,iBAAA,CACV,SAAA,CAAWC,gCAAAA,gFACT,CACAH,CAAAA,EAAqBH,CACvB,CAAA,CAEA,QAAA,CAAAK,6BAAAA,OAAC,CAAA,CACC,WAAA,CAAU,OAAA,CACV,SAAA,CAAWC,gCAAAA,+BAAG,CAAiCJ,CAAS,CAAA,CACvD,GAAGE,CAAAA,CACN,CAAA,CACF,CAAA,CACF,CAEJ,CAEA,SAASG,CAAAA,CAAY,CAAE,SAAA,CAAAL,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAkC,CAC3E,OACEC,6BAAAA,OAAC,CAAA,CACC,WAAA,CAAU,cAAA,CACV,SAAA,CAAWC,gCAAAA,qCAAG,CAAuCJ,CAAS,CAAA,CAC7D,GAAGE,CAA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,QAAA,CACL,WAAA,CAAU,mBAAA,CACV,SAAA,CAAWC,gCAAAA,4MACT,CACAJ,CACF,CAAA,CACA,OAAA,CAASsB,CAAAA,CACR,GAAGpB,CAAAA,CAEH,QAAA,CAAAS,CAAAA,CACH,CAEJ,CAEA,SAASc,CAAAA,CAAa,CACpB,SAAA,CAAAzB,CAAAA,CACA,GAAGE,CACL,CAAA,CAAoC,CAClC,OACEC,6BAAAA,SAAC,CAAA,CACC,WAAA,CAAU,eAAA,CACV,SAAA,CAAWC,gCAAAA,oCAAG,CAAsCJ,CAAS,CAAA,CAC5D,GAAGE,CAAAA,CACN,CAEJ,CAAA,sIAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-2Q4N3AS5.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Eye, MoreVertical } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TableContextValue {\n stickyFirstColumn?: boolean\n}\n\nconst TableContext = React.createContext<TableContextValue>({})\n\nexport interface TableProps extends React.ComponentProps<\"table\"> {\n stickyFirstColumn?: boolean\n}\n\nconst stickyFirstColumnStyles =\n \"[&_tr>th:first-child]:sticky [&_tr>th:first-child]:left-0 [&_tr>th:first-child]:z-10 [&_tr>th:first-child]:bg-background [&_tr>th:first-child]:after:absolute [&_tr>th:first-child]:after:right-0 [&_tr>th:first-child]:after:top-0 [&_tr>th:first-child]:after:h-full [&_tr>th:first-child]:after:w-px [&_tr>th:first-child]:after:bg-border [&_tr>td:first-child]:sticky [&_tr>td:first-child]:left-0 [&_tr>td:first-child]:z-10 [&_tr>td:first-child]:bg-background [&_tr>td:first-child]:after:absolute [&_tr>td:first-child]:after:right-0 [&_tr>td:first-child]:after:top-0 [&_tr>td:first-child]:after:h-full [&_tr>td:first-child]:after:w-px [&_tr>td:first-child]:after:bg-border\"\n\nfunction Table({ className, stickyFirstColumn, ...props }: TableProps) {\n return (\n <TableContext.Provider value={{ stickyFirstColumn }}>\n <div\n data-slot=\"table-container\"\n className={cn(\n \"relative bg-background w-full overflow-x-auto border border-border rounded-3xl\",\n stickyFirstColumn && stickyFirstColumnStyles\n )}\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n </TableContext.Provider>\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b text-secondary-text\", className)}\n {...props}\n />\n )\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableRowProps extends React.ComponentProps<\"tr\"> {\n isClickable?: boolean\n actionIcon?: \"eye\" | \"more\" | null\n}\n\nfunction TableRow({\n className,\n isClickable,\n actionIcon,\n children,\n ...props\n}: TableRowProps) {\n const iconComponent =\n actionIcon === \"eye\" ? (\n <Eye className=\"h-4 w-4\" />\n ) : actionIcon === \"more\" ? (\n <MoreVertical className=\"h-4 w-4\" />\n ) : null\n\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"border-b border-border/50 transition-colors\",\n isClickable && \"cursor-pointer hover:bg-muted/50\",\n // !isClickable && \"hover:bg-muted/50\",\n // \"data-[state=selected]:bg-secondary\",\n className\n )}\n {...props}\n >\n {actionIcon !== undefined && (\n <TableCell className=\"w-12\">{iconComponent}</TableCell>\n )}\n {children}\n </tr>\n )\n}\n\nexport interface TableHeadProps extends React.ComponentProps<\"th\"> {\n isSticky?: boolean\n}\n\nfunction TableHead({ className, isSticky, ...props }: TableHeadProps) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-secondary-text h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\n isSticky &&\n \"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableCellProps extends React.ComponentProps<\"td\"> {\n isSticky?: boolean\n}\n\nfunction TableCell({ className, isSticky, ...props }: TableCellProps) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\n isSticky &&\n \"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableCellActionProps extends React.ComponentProps<\"button\"> {\n asChild?: boolean\n}\n\nfunction TableCellAction({\n className,\n onClick,\n children,\n asChild = false,\n ...props\n}: TableCellActionProps) {\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onClick?.(e)\n }\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void\n className?: string\n }>,\n {\n onClick: (e: React.MouseEvent) => {\n e.stopPropagation()\n const childOnClick = (\n children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void\n }>\n ).props.onClick\n childOnClick?.(e)\n },\n className: cn(\n \"inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:bg-muted/50 hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent\",\n (children as React.ReactElement<{ className?: string }>).props\n .className,\n className\n ),\n }\n )\n }\n\n return (\n <button\n type=\"button\"\n data-slot=\"table-cell-action\"\n className={cn(\n \"inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent\",\n className\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n )\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCellAction,\n TableCaption,\n}\n"]}
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a}from"./chunk-S5TKCF6T.mjs";import*as l from"react";import{Eye as b,MoreVertical as f}from"lucide-react";import{jsx as o,jsxs as h}from"react/jsx-runtime";var p=l.createContext({}),u="[&_tr>th:first-child]:sticky [&_tr>th:first-child]:left-0 [&_tr>th:first-child]:z-10 [&_tr>th:first-child]:bg-background [&_tr>th:first-child]:after:absolute [&_tr>th:first-child]:after:right-0 [&_tr>th:first-child]:after:top-0 [&_tr>th:first-child]:after:h-full [&_tr>th:first-child]:after:w-px [&_tr>th:first-child]:after:bg-border [&_tr>td:first-child]:sticky [&_tr>td:first-child]:left-0 [&_tr>td:first-child]:z-10 [&_tr>td:first-child]:bg-background [&_tr>td:first-child]:after:absolute [&_tr>td:first-child]:after:right-0 [&_tr>td:first-child]:after:top-0 [&_tr>td:first-child]:after:h-full [&_tr>td:first-child]:after:w-px [&_tr>td:first-child]:after:bg-border";function g({className:t,stickyFirstColumn:e,...r}){return o(p.Provider,{value:{stickyFirstColumn:e},children:o("div",{"data-slot":"table-container",className:a("relative bg-background w-full overflow-x-auto border border-border rounded-3xl",e&&u),children:o("table",{"data-slot":"table",className:a("w-full caption-bottom text-sm",t),...r})})})}function y({className:t,...e}){return o("thead",{"data-slot":"table-header",className:a("[&_tr]:border-b text-secondary-text",t),...e})}function R({className:t,...e}){return o("tbody",{"data-slot":"table-body",className:a("[&_tr:last-child]:border-0",t),...e})}function T({className:t,...e}){return o("tfoot",{"data-slot":"table-footer",className:a("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...e})}function k({className:t,isClickable:e,actionIcon:r,children:s,...i}){let c=r==="eye"?o(b,{className:"h-4 w-4"}):r==="more"?o(f,{className:"h-4 w-4"}):null;return h("tr",{"data-slot":"table-row",className:a("border-b border-border/50 transition-colors",e&&"cursor-pointer hover:bg-muted/50",t),...i,children:[r!==void 0&&o(m,{className:"w-12",children:c}),s]})}function v({className:t,isSticky:e,...r}){return o("th",{"data-slot":"table-head",className:a("text-secondary-text h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",e&&"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border",t),...r})}function m({className:t,isSticky:e,...r}){return o("td",{"data-slot":"table-cell",className:a("p-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e&&"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border",t),...r})}function P({className:t,onClick:e,children:r,asChild:s=!1,...i}){let c=n=>{n.stopPropagation(),e?.(n)};return s&&l.isValidElement(r)?l.cloneElement(r,{onClick:n=>{n.stopPropagation();let d=r.props.onClick;d?.(n)},className:a("inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:bg-muted/50 hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent",r.props.className,t)}):o("button",{type:"button","data-slot":"table-cell-action",className:a("inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent",t),onClick:c,...i,children:r})}function _({className:t,...e}){return o("caption",{"data-slot":"table-caption",className:a("text-muted-foreground mt-4 text-sm",t),...e})}export{g as a,y as b,R as c,T as d,k as e,v as f,m as g,P as h,_ as i};
3
- //# sourceMappingURL=chunk-CMWQZYPL.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/table.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Eye, MoreVertical } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TableContextValue {\n stickyFirstColumn?: boolean\n}\n\nconst TableContext = React.createContext<TableContextValue>({})\n\nexport interface TableProps extends React.ComponentProps<\"table\"> {\n stickyFirstColumn?: boolean\n}\n\nconst stickyFirstColumnStyles =\n \"[&_tr>th:first-child]:sticky [&_tr>th:first-child]:left-0 [&_tr>th:first-child]:z-10 [&_tr>th:first-child]:bg-background [&_tr>th:first-child]:after:absolute [&_tr>th:first-child]:after:right-0 [&_tr>th:first-child]:after:top-0 [&_tr>th:first-child]:after:h-full [&_tr>th:first-child]:after:w-px [&_tr>th:first-child]:after:bg-border [&_tr>td:first-child]:sticky [&_tr>td:first-child]:left-0 [&_tr>td:first-child]:z-10 [&_tr>td:first-child]:bg-background [&_tr>td:first-child]:after:absolute [&_tr>td:first-child]:after:right-0 [&_tr>td:first-child]:after:top-0 [&_tr>td:first-child]:after:h-full [&_tr>td:first-child]:after:w-px [&_tr>td:first-child]:after:bg-border\"\n\nfunction Table({ className, stickyFirstColumn, ...props }: TableProps) {\n return (\n <TableContext.Provider value={{ stickyFirstColumn }}>\n <div\n data-slot=\"table-container\"\n className={cn(\n \"relative bg-background w-full overflow-x-auto border border-border rounded-3xl\",\n stickyFirstColumn && stickyFirstColumnStyles\n )}\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n </TableContext.Provider>\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b text-secondary-text\", className)}\n {...props}\n />\n )\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableRowProps extends React.ComponentProps<\"tr\"> {\n isClickable?: boolean\n actionIcon?: \"eye\" | \"more\" | null\n}\n\nfunction TableRow({\n className,\n isClickable,\n actionIcon,\n children,\n ...props\n}: TableRowProps) {\n const iconComponent =\n actionIcon === \"eye\" ? (\n <Eye className=\"h-4 w-4\" />\n ) : actionIcon === \"more\" ? (\n <MoreVertical className=\"h-4 w-4\" />\n ) : null\n\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"border-b border-border/50 transition-colors\",\n isClickable && \"cursor-pointer hover:bg-muted/50\",\n // !isClickable && \"hover:bg-muted/50\",\n // \"data-[state=selected]:bg-secondary\",\n className\n )}\n {...props}\n >\n {actionIcon !== undefined && (\n <TableCell className=\"w-12\">{iconComponent}</TableCell>\n )}\n {children}\n </tr>\n )\n}\n\nexport interface TableHeadProps extends React.ComponentProps<\"th\"> {\n isSticky?: boolean\n}\n\nfunction TableHead({ className, isSticky, ...props }: TableHeadProps) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-secondary-text h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\n isSticky &&\n \"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableCellProps extends React.ComponentProps<\"td\"> {\n isSticky?: boolean\n}\n\nfunction TableCell({ className, isSticky, ...props }: TableCellProps) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\n isSticky &&\n \"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableCellActionProps extends React.ComponentProps<\"button\"> {\n asChild?: boolean\n}\n\nfunction TableCellAction({\n className,\n onClick,\n children,\n asChild = false,\n ...props\n}: TableCellActionProps) {\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onClick?.(e)\n }\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void\n className?: string\n }>,\n {\n onClick: (e: React.MouseEvent) => {\n e.stopPropagation()\n const childOnClick = (\n children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void\n }>\n ).props.onClick\n childOnClick?.(e)\n },\n className: cn(\n \"inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:bg-muted/50 hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent\",\n (children as React.ReactElement<{ className?: string }>).props\n .className,\n className\n ),\n }\n )\n }\n\n return (\n <button\n type=\"button\"\n data-slot=\"table-cell-action\"\n className={cn(\n \"inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent\",\n className\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n )\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCellAction,\n TableCaption,\n}\n"],"mappings":";oCAEA,UAAYA,MAAW,QACvB,OAAS,OAAAC,EAAK,gBAAAC,MAAoB,eA2B1B,cAAAC,EA+DJ,QAAAC,MA/DI,oBAnBR,IAAMC,EAAqB,gBAAiC,CAAC,CAAC,EAMxDC,EACJ,8pBAEF,SAASC,EAAM,CAAE,UAAAC,EAAW,kBAAAC,EAAmB,GAAGC,CAAM,EAAe,CACrE,OACEP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Y,EAAU,CAAE,UAAAd,EAAW,SAAAgB,EAAU,GAAGd,CAAM,EAAmB,CACpE,OACEP,EAAC,MACC,YAAU,aACV,UAAWQ,EACT,mEACAa,GACE,oHACFhB,CACF,EACC,GAAGE,EACN,CAEJ,CAMA,SAASe,EAAgB,CACvB,UAAAjB,EACA,QAAAkB,EACA,SAAAR,EACA,QAAAS,EAAU,GACV,GAAGjB,CACL,EAAyB,CACvB,IAAMkB,EAAeC,GAA2C,CAC9DA,EAAE,gBAAgB,EAClBH,IAAUG,CAAC,CACb,EAEA,OAAIF,GAAiB,iBAAeT,CAAQ,EAC7B,eACXA,EAIA,CACE,QAAUW,GAAwB,CAChCA,EAAE,gBAAgB,EAClB,IAAMC,EACJZ,EAGA,MAAM,QACRY,IAAeD,CAAC,CAClB,EACA,UAAWlB,EACT,+NACCO,EAAwD,MACtD,UACHV,CACF,CACF,CACF,EAIAL,EAAC,UACC,KAAK,SACL,YAAU,oBACV,UAAWQ,EACT,6MACAH,CACF,EACA,QAASoB,EACR,GAAGlB,EAEH,SAAAQ,EACH,CAEJ,CAEA,SAASa,EAAa,CACpB,UAAAvB,EACA,GAAGE,CACL,EAAoC,CAClC,OACEP,EAAC,WACC,YAAU,gBACV,UAAWQ,EAAG,qCAAsCH,CAAS,EAC5D,GAAGE,EACN,CAEJ","names":["React","Eye","MoreVertical","jsx","jsxs","TableContext","stickyFirstColumnStyles","Table","className","stickyFirstColumn","props","cn","TableHeader","TableBody","TableFooter","TableRow","isClickable","actionIcon","children","iconComponent","Eye","MoreVertical","TableCell","TableHead","isSticky","TableCellAction","onClick","asChild","handleClick","e","childOnClick","TableCaption"]}