@jamsrui/table 0.0.13 → 0.0.15

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/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a as p}from"./chunk-FWCSKJXK.mjs";import{a as b}from"./chunk-SLHAMQVJ.mjs";import{a as o}from"./chunk-JDEQKMB2.mjs";import"./chunk-HUU4QJ56.mjs";import{a as e}from"./chunk-ZE4OK6RY.mjs";import{a as r}from"./chunk-WKT355RZ.mjs";import"./chunk-3P4MZ6BH.mjs";import"./chunk-KWUDOLAU.mjs";import{a as t}from"./chunk-USYDSKXB.mjs";import{a as m}from"./chunk-EEYWNGAV.mjs";import{a as T,b as f}from"./chunk-DIUOKLAM.mjs";import"./chunk-NMZ5Y6UJ.mjs";import{a as l}from"./chunk-E66GNLTH.mjs";import{a}from"./chunk-K3XNFLMX.mjs";import"./chunk-TYYVDMZS.mjs";var u=Object.assign(o,{Root:o,Body:t,Cell:a,Footer:p,Header:b,Row:l,Table:e,Wrapper:r,Column:m});export{u as Table,t as TableBody,a as TableCell,m as TableColumn,T as TableConfig,p as TableFooter,b as TableHeader,l as TableRow,e as TableTable,r as TableWrapper,f as useTableConfig};
1
+ import{Table as o}from"./table.mjs";import{TableBody as e}from"./table-body.mjs";import{TableCell as r}from"./table-cell.mjs";import{TableColumn as a}from"./table-column.mjs";import{TableFooter as l}from"./table-footer.mjs";import{TableHeader as t}from"./table-header.mjs";import{TableRow as m}from"./table-row.mjs";import{TableTable as p}from"./table-table.mjs";import{TableWrapper as b}from"./table-wrapper.mjs";import{TableConfig as w,useTableConfig as y}from"./table-config.mjs";const c=Object.assign(o,{Root:o,Body:e,Cell:r,Footer:l,Header:t,Row:m,Table:p,Wrapper:b,Column:a});export{c as Table,e as TableBody,r as TableCell,a as TableColumn,w as TableConfig,l as TableFooter,t as TableHeader,m as TableRow,p as TableTable,b as TableWrapper,y as useTableConfig};
package/dist/styles.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-KWUDOLAU.mjs";export{a as tableVariants};
1
+ import{radiusVariant as r,tv as e}from"@jamsrui/utils";const a=e({slots:{root:"relative flex flex-col gap-2 overflow-hidden",wrapper:"grid w-full gap-2 overflow-x-auto",table:"group/table w-full min-w-full",thead:"h-10",th:["h-10 grow items-center px-3 text-left text-sm font-normal","data-pinned:bg-background/90 data-pinned:backdrop-blur-xl"],tbody:"",tr:"group/tr",td:["overflow-hidden px-3 text-sm","data-pinned:bg-background/90 data-pinned:backdrop-blur-xl"],tfoot:""},variants:{variant:{solid:{th:"bg-surface-secondary first:rounded-l-lg last:rounded-r-lg",root:"rounded-2xl bg-surface p-4"},bordered:{th:"border-b border-b-divider-dark bg-surface-secondary text-foreground-secondary font-normal text-xs",td:"border-b border-divider",root:"bg-surface"}},radius:r("root"),density:{compact:{td:"py-2"},standard:{td:"py-4"},comfortable:{td:"py-6"}},isHeaderSticky:{true:{thead:"sticky top-0 z-10 [&>tr]:shadow-sm",wrapper:"flex max-h-[400px] flex-col overflow-auto",th:" bg-surface-secondary/90 backdrop-blur-xl"}},allowHover:{true:{td:"md:group-hover/tr:bg-surface-secondary"},false:{td:""}},separateRows:{true:{tr:"border-b-2 border-transparent",td:"border-none bg-surface",root:"border-none bg-transparent p-0"}}},defaultVariants:{isHeaderSticky:!1,density:"compact",allowHover:!1,separateRows:!1,variant:"bordered",radius:"md"}});export{a as tableVariants};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-USYDSKXB.mjs";import"./chunk-NMZ5Y6UJ.mjs";import"./chunk-E66GNLTH.mjs";import"./chunk-K3XNFLMX.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableBody};
1
+ "use client";import{jsx as l}from"react/jsx-runtime";import{useRenderElement as n}from"@jamsrui/hooks";import{useTableContext as m}from"./table-context.mjs";import{TableEmptyState as d}from"./table-empty-state.mjs";const b=e=>{const{children:o,emptySlot:t=l(d,{}),...r}=e,{getBodyProps:p}=m(),s=o??t;return n("tbody",{props:[p(r),{children:s}]})};export{b as TableBody};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-K3XNFLMX.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableCell};
1
+ "use client";import{useRenderElement as t}from"@jamsrui/hooks";import{useTableContext as o}from"./table-context.mjs";const p=e=>{const{getCellProps:r}=o();return t("td",{props:[r(e)]})};export{p as TableCell};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-EEYWNGAV.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableColumn};
1
+ "use client";import{useRenderElement as o}from"@jamsrui/hooks";import{useTableContext as t}from"./table-context.mjs";const p=e=>{const{getColumnProps:r}=t();return o("th",{props:[r(e)]})};export{p as TableColumn};
@@ -1 +1 @@
1
- "use client";import{a,b}from"./chunk-DIUOKLAM.mjs";export{a as TableConfig,b as useTableConfig};
1
+ "use client";import{createConfigContext as e}from"@jamsrui/utils";const[r,a]=e({displayName:"TableConfig"});export{r as TableConfig,a as useTableConfig};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-TYYVDMZS.mjs";export{a as TableContext,b as useTableContext};
1
+ import{createContext as t,use as o}from"react";const n=t(null),s=()=>{const e=o(n);if(!e)throw new Error("useTableContext must be used within TableContext");return e};export{n as TableContext,s as useTableContext};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-NMZ5Y6UJ.mjs";import"./chunk-E66GNLTH.mjs";import"./chunk-K3XNFLMX.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableEmptyState};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{TableCell as l}from"./table-cell.mjs";import{TableRow as o}from"./table-row.mjs";const p=()=>e(o,{children:e(l,{className:"text-center py-12",colSpan:100,children:"No data found"})});export{p as TableEmptyState};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-FWCSKJXK.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableFooter};
1
+ "use client";import{useRenderElement as t}from"@jamsrui/hooks";import{useTableContext as r}from"./table-context.mjs";const m=e=>{const{getFooterProps:o}=r();return t("tfoot",{props:[o(e)]})};export{m as TableFooter};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-SLHAMQVJ.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableHeader};
1
+ "use client";import{useRenderElement as t}from"@jamsrui/hooks";import{useTableContext as o}from"./table-context.mjs";const a=e=>{const{getHeaderProps:r}=o();return t("thead",{props:[r(e)]})};export{a as TableHeader};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-HUU4QJ56.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableRoot};
1
+ "use client";import{useRenderElement as t}from"@jamsrui/hooks";import{useTableContext as r}from"./table-context.mjs";const m=e=>{const{getRootProps:o}=r();return t("div",{props:[o(e)]})};export{m as TableRoot};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-E66GNLTH.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableRow};
1
+ "use client";import{useRenderElement as o}from"@jamsrui/hooks";import{useTableContext as t}from"./table-context.mjs";const m=e=>{const{getRowProps:r}=t();return o("tr",{props:[r(e)]})};export{m as TableRow};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-ZE4OK6RY.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableTable};
1
+ "use client";import{useRenderElement as t}from"@jamsrui/hooks";import{useTableContext as o}from"./table-context.mjs";const p=e=>{const{getTableProps:r}=o();return t("table",{props:[r(e)]})};export{p as TableTable};
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-WKT355RZ.mjs";import"./chunk-TYYVDMZS.mjs";export{a as TableWrapper};
1
+ "use client";import{useRenderElement as p}from"@jamsrui/hooks";import{useTableContext as t}from"./table-context.mjs";const a=e=>{const{getWrapperProps:r}=t();return p("div",{props:[r(e)]})};export{a as TableWrapper};
package/dist/table.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{a}from"./chunk-JDEQKMB2.mjs";import"./chunk-HUU4QJ56.mjs";import"./chunk-ZE4OK6RY.mjs";import"./chunk-WKT355RZ.mjs";import"./chunk-3P4MZ6BH.mjs";import"./chunk-KWUDOLAU.mjs";import"./chunk-DIUOKLAM.mjs";import"./chunk-TYYVDMZS.mjs";export{a as Table};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{mergeConfigProps as p}from"@jamsrui/utils";import{useTableConfig as b}from"./table-config.mjs";import{TableContext as m}from"./table-context.mjs";import{TableRoot as T}from"./table-root.mjs";import{TableTable as n}from"./table-table.mjs";import{TableWrapper as s}from"./table-wrapper.mjs";import{useTable as i}from"./use-table.mjs";const d=o=>{const{children:t}=o,r=b(),a=p(r,r,o),l=i(a);return e(m,{value:l,children:e(T,{children:e(s,{children:e(n,{children:t})})})})};export{d as Table};
@@ -1 +1 @@
1
- import{a}from"./chunk-3P4MZ6BH.mjs";import"./chunk-KWUDOLAU.mjs";export{a as useTable};
1
+ import{useCallback as s,useMemo as g}from"react";import{cn as r,dataAttrDev as o,mapPropsVariants as w,mergeProps as G}from"@jamsrui/utils";import{tableVariants as i}from"./styles.mjs";const V=y=>{const[f,u]=w(y,i.variantKeys),{classNames:a,...l}=f,t=i(u),m=s(e=>({...e,"data-slot":o("root"),"data-component":o("table"),className:t.root({className:r(a?.root,e.className)})}),[a?.root,t]),p=s(e=>({...e,"data-slot":o("wrapper"),className:t.wrapper({className:r(a?.wrapper,e.className)})}),[a?.wrapper,t]),c=s(e=>({...G(l,e),"data-slot":o("table"),className:t.table({className:r(l.className,a?.table,e.className)})}),[a?.table,l,t]),b=s(e=>({...e,"data-slot":o("header"),className:t.thead({className:r(a?.thead,e.className)})}),[a?.thead,t]),P=s(e=>({...e,"data-slot":o("column"),className:t.th({className:r(a?.th,e.className)})}),[a?.th,t]),n=s(e=>({...e,"data-slot":o("body"),className:t.tbody({className:r(a?.tbody,e.className)})}),[a?.tbody,t]),N=s(e=>({...e,"data-slot":o("row"),className:t.tr({className:r(a?.tr,e.className)})}),[a?.tr,t]),d=s(e=>({...e,"data-slot":o("cell"),className:t.td({className:r(a?.td,e.className)})}),[a?.td,t]),T=s(e=>({...e,"data-slot":o("footer"),className:t.tfoot({className:r(a?.tfoot,e.className)})}),[a?.tfoot,t]);return g(()=>({getRootProps:m,getTableProps:c,getHeaderProps:b,getColumnProps:P,getBodyProps:n,getRowProps:N,getCellProps:d,getFooterProps:T,getWrapperProps:p}),[n,d,P,T,b,m,N,c,p])};export{V as useTable};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@jamsrui/table",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "peerDependencies": {
5
5
  "react": ">=19"
6
6
  },
7
7
  "dependencies": {
8
- "@jamsrui/hooks": "^0.0.13",
9
- "@jamsrui/core": "^0.0.11",
10
- "@jamsrui/utils": "^0.0.13"
8
+ "@jamsrui/hooks": "^0.0.15",
9
+ "@jamsrui/utils": "^0.0.15",
10
+ "@jamsrui/core": "^0.0.13"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
@@ -1 +0,0 @@
1
- import{a as m}from"./chunk-KWUDOLAU.mjs";import{useCallback as s,useMemo as g}from"react";import{cn as r,dataAttrDev as o,mapPropsVariants as w,mergeProps as G}from"@jamsrui/utils";var x=y=>{let[f,u]=w(y,m.variantKeys),{classNames:a,...l}=f,t=m(u),p=s(e=>({...e,"data-slot":o("root"),"data-component":o("table"),className:t.root({className:r(a?.root,e.className)})}),[a?.root,t]),c=s(e=>({...e,"data-slot":o("wrapper"),className:t.wrapper({className:r(a?.wrapper,e.className)})}),[a?.wrapper,t]),b=s(e=>({...G(l,e),"data-slot":o("table"),className:t.table({className:r(l.className,a?.table,e.className)})}),[a?.table,l,t]),P=s(e=>({...e,"data-slot":o("header"),className:t.thead({className:r(a?.thead,e.className)})}),[a?.thead,t]),n=s(e=>({...e,"data-slot":o("column"),className:t.th({className:r(a?.th,e.className)})}),[a?.th,t]),N=s(e=>({...e,"data-slot":o("body"),className:t.tbody({className:r(a?.tbody,e.className)})}),[a?.tbody,t]),d=s(e=>({...e,"data-slot":o("row"),className:t.tr({className:r(a?.tr,e.className)})}),[a?.tr,t]),T=s(e=>({...e,"data-slot":o("cell"),className:t.td({className:r(a?.td,e.className)})}),[a?.td,t]),i=s(e=>({...e,"data-slot":o("footer"),className:t.tfoot({className:r(a?.tfoot,e.className)})}),[a?.tfoot,t]);return g(()=>({getRootProps:p,getTableProps:b,getHeaderProps:P,getColumnProps:n,getBodyProps:N,getRowProps:d,getCellProps:T,getFooterProps:i,getWrapperProps:c}),[N,T,n,i,P,p,d,b,c])};export{x as a};
@@ -1 +0,0 @@
1
- import{createConfigContext as e}from"@jamsrui/utils";var[r,a]=e({displayName:"TableConfig"});export{r as a,a as b};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var m=r=>{let{getRowProps:o}=e();return t("tr",{props:[o(r)]})};export{m as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var p=r=>{let{getColumnProps:o}=e();return t("th",{props:[o(r)]})};export{p as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as r}from"@jamsrui/hooks";var m=o=>{let{getFooterProps:t}=e();return r("tfoot",{props:[t(o)]})};export{m as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as r}from"@jamsrui/hooks";var m=o=>{let{getRootProps:t}=e();return r("div",{props:[t(o)]})};export{m as a};
@@ -1 +0,0 @@
1
- import{a as l}from"./chunk-HUU4QJ56.mjs";import{a as p}from"./chunk-ZE4OK6RY.mjs";import{a as b}from"./chunk-WKT355RZ.mjs";import{a as m}from"./chunk-3P4MZ6BH.mjs";import{b as t}from"./chunk-DIUOKLAM.mjs";import{a}from"./chunk-TYYVDMZS.mjs";import{mergeConfigProps as i}from"@jamsrui/utils";import{jsx as e}from"react/jsx-runtime";var d=o=>{let{children:T}=o,r=t(),n=i(r,r,o),s=m(n);return e(a,{value:s,children:e(l,{children:e(b,{children:e(p,{children:T})})})})};export{d as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var p=r=>{let{getCellProps:t}=e();return o("td",{props:[t(r)]})};export{p as a};
@@ -1 +0,0 @@
1
- import{radiusVariant as r,tv as e}from"@jamsrui/utils";var a=e({slots:{root:"relative flex flex-col gap-2 overflow-hidden",wrapper:"grid w-full gap-2 overflow-x-auto",table:"group/table w-full min-w-full",thead:"h-10",th:["h-10 grow items-center px-3 text-left text-sm font-normal","data-pinned:bg-background/90 data-pinned:backdrop-blur-xl"],tbody:"",tr:"group/tr",td:["overflow-hidden px-3 text-sm","data-pinned:bg-background/90 data-pinned:backdrop-blur-xl"],tfoot:""},variants:{variant:{solid:{th:"bg-surface-secondary first:rounded-l-lg last:rounded-r-lg",root:"rounded-2xl bg-surface p-4"},bordered:{th:"border-b border-b-divider-dark bg-surface-secondary text-foreground-secondary font-normal text-xs",td:"border-b border-divider",root:"bg-surface"}},radius:r("root"),density:{compact:{td:"py-2"},standard:{td:"py-4"},comfortable:{td:"py-6"}},isHeaderSticky:{true:{thead:"sticky top-0 z-10 [&>tr]:shadow-sm",wrapper:"flex max-h-[400px] flex-col overflow-auto",th:" bg-surface-secondary/90 backdrop-blur-xl"}},allowHover:{true:{td:"md:group-hover/tr:bg-surface-secondary"},false:{td:""}},separateRows:{true:{tr:"border-b-2 border-transparent",td:"border-none bg-surface",root:"border-none bg-transparent p-0"}}},defaultVariants:{isHeaderSticky:!1,density:"compact",allowHover:!1,separateRows:!1,variant:"bordered",radius:"md"}});export{a};
@@ -1 +0,0 @@
1
- import{a as l}from"./chunk-E66GNLTH.mjs";import{a as e}from"./chunk-K3XNFLMX.mjs";import{jsx as o}from"react/jsx-runtime";var p=()=>o(l,{children:o(e,{className:"text-center py-12",colSpan:100,children:"No data found"})});export{p as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var a=r=>{let{getHeaderProps:t}=e();return o("thead",{props:[t(r)]})};export{a};
@@ -1 +0,0 @@
1
- import{createContext as t,use as o}from"react";var n=t(null),s=()=>{let e=o(n);if(!e)throw new Error("useTableContext must be used within TableContext");return e};export{n as a,s as b};
@@ -1 +0,0 @@
1
- import{a as o}from"./chunk-NMZ5Y6UJ.mjs";import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as d}from"@jamsrui/hooks";import{jsx as l}from"react/jsx-runtime";var b=t=>{let{children:r,emptySlot:p=l(o,{}),...s}=t,{getBodyProps:n}=e(),m=r??p;return d("tbody",{props:[n(s),{children:m}]})};export{b as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var a=r=>{let{getWrapperProps:p}=e();return t("div",{props:[p(r)]})};export{a};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-TYYVDMZS.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var p=r=>{let{getTableProps:t}=e();return o("table",{props:[t(r)]})};export{p as a};