@jamsrui/table 0.0.8 → 0.0.10

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/chunk-2F5JM5AO.mjs +1 -0
  2. package/dist/chunk-2UOENW6T.mjs +1 -0
  3. package/dist/chunk-64OJE7BG.mjs +1 -0
  4. package/dist/chunk-6TH4QLR4.mjs +1 -0
  5. package/dist/chunk-BHSFC5BI.mjs +1 -0
  6. package/dist/chunk-EALHLWMO.mjs +1 -0
  7. package/dist/chunk-F5AMPC53.mjs +1 -0
  8. package/dist/chunk-G56JYZMX.mjs +1 -0
  9. package/dist/chunk-GSDCBY3X.mjs +1 -0
  10. package/dist/chunk-HZMKIGNF.mjs +0 -0
  11. package/dist/chunk-IPKE7YHM.mjs +1 -0
  12. package/dist/chunk-J4ZX6AQY.mjs +1 -0
  13. package/dist/chunk-NO7Q6M3H.mjs +1 -0
  14. package/dist/chunk-RJDA7IF5.mjs +1 -0
  15. package/dist/chunk-VJMTZ2OI.mjs +1 -0
  16. package/dist/chunk-VV6AJGJT.mjs +1 -0
  17. package/dist/chunk-XPEMMX4W.mjs +1 -0
  18. package/dist/chunk-YJQDUGSR.mjs +1 -0
  19. package/dist/index.d.mts +13 -12
  20. package/dist/index.mjs +1 -1
  21. package/dist/primitive/index.d.mts +18 -0
  22. package/dist/primitive/index.mjs +1 -0
  23. package/dist/{styles.d.mts → primitive/styles.d.mts} +13 -20
  24. package/dist/primitive/styles.mjs +1 -0
  25. package/dist/{table-body.d.mts → primitive/table-body.d.mts} +1 -0
  26. package/dist/primitive/table-body.mjs +1 -0
  27. package/dist/primitive/table-cell.mjs +1 -0
  28. package/dist/primitive/table-column.mjs +1 -0
  29. package/dist/primitive/table-config.d.mts +26 -0
  30. package/dist/primitive/table-config.mjs +1 -0
  31. package/dist/{table-context.d.mts → primitive/table-context.d.mts} +2 -2
  32. package/dist/primitive/table-context.mjs +1 -0
  33. package/dist/primitive/table-empty-state.mjs +1 -0
  34. package/dist/primitive/table-footer.mjs +1 -0
  35. package/dist/primitive/table-header.mjs +1 -0
  36. package/dist/primitive/table-root.d.mts +10 -0
  37. package/dist/primitive/table-root.mjs +1 -0
  38. package/dist/primitive/table-row.mjs +1 -0
  39. package/dist/primitive/table-table.mjs +1 -0
  40. package/dist/primitive/table-wrapper.mjs +1 -0
  41. package/dist/primitive/table.d.mts +13 -0
  42. package/dist/primitive/table.mjs +1 -0
  43. package/dist/{use-table.d.mts → primitive/use-table.d.mts} +2 -2
  44. package/dist/primitive/use-table.mjs +1 -0
  45. package/dist/{table-DoFhyPyS.d.mts → table-COowFxBr.d.mts} +10 -19
  46. package/dist/table-config.d.mts +12 -11
  47. package/dist/table-config.mjs +1 -1
  48. package/dist/table.d.mts +19 -11
  49. package/dist/table.mjs +1 -1
  50. package/package.json +5 -6
  51. package/dist/styles.mjs +0 -1
  52. package/dist/table-body.mjs +0 -1
  53. package/dist/table-cell.mjs +0 -1
  54. package/dist/table-column.mjs +0 -1
  55. package/dist/table-context.mjs +0 -1
  56. package/dist/table-empty-state.mjs +0 -1
  57. package/dist/table-footer.mjs +0 -1
  58. package/dist/table-header.mjs +0 -1
  59. package/dist/table-root.mjs +0 -1
  60. package/dist/table-row.mjs +0 -1
  61. package/dist/table-wrapper.mjs +0 -1
  62. package/dist/use-table.mjs +0 -1
  63. /package/dist/{table-cell.d.mts → primitive/table-cell.d.mts} +0 -0
  64. /package/dist/{table-column.d.mts → primitive/table-column.d.mts} +0 -0
  65. /package/dist/{table-empty-state.d.mts → primitive/table-empty-state.d.mts} +0 -0
  66. /package/dist/{table-footer.d.mts → primitive/table-footer.d.mts} +0 -0
  67. /package/dist/{table-header.d.mts → primitive/table-header.d.mts} +0 -0
  68. /package/dist/{table-row.d.mts → primitive/table-row.d.mts} +0 -0
  69. /package/dist/{table-root.d.mts → primitive/table-table.d.mts} +0 -0
  70. /package/dist/{table-wrapper.d.mts → primitive/table-wrapper.d.mts} +0 -0
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-EALHLWMO.mjs";import{b as e}from"./chunk-2F5JM5AO.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};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
1
+ import{createConfigContext as o}from"@jamsrui/utils";var[r,a]=o({displayName:"TableConfig"});export{r as a,a as b};
@@ -0,0 +1 @@
1
+ import{a as m}from"./chunk-64OJE7BG.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};
@@ -0,0 +1 @@
1
+ import{a as l}from"./chunk-IPKE7YHM.mjs";import{a as e}from"./chunk-VJMTZ2OI.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};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-2F5JM5AO.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var n=r=>{let{getHeaderProps:t}=e();return o("thead",{props:[t(r)]})};export{n as a};
@@ -0,0 +1 @@
1
+ import{createConfigContext as o}from"@jamsrui/utils";var[r,a]=o({displayName:"TableConfig"});export{r as a,a as b};
@@ -0,0 +1 @@
1
+ import{a as b}from"./chunk-RJDA7IF5.mjs";import{a as m}from"./chunk-BHSFC5BI.mjs";import{b as t}from"./chunk-6TH4QLR4.mjs";import{a as l}from"./chunk-NO7Q6M3H.mjs";import{a as p}from"./chunk-VV6AJGJT.mjs";import{a}from"./chunk-2F5JM5AO.mjs";import{mergeConfigProps as f}from"@jamsrui/utils";import{jsx as e}from"react/jsx-runtime";var d=o=>{let{children:T}=o,r=t(),n=f(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};
File without changes
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-2F5JM5AO.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};
@@ -0,0 +1 @@
1
+ import{b as n}from"./chunk-G56JYZMX.mjs";import{a as b}from"./chunk-RJDA7IF5.mjs";import{a as T}from"./chunk-BHSFC5BI.mjs";import{a as t}from"./chunk-NO7Q6M3H.mjs";import{a as l}from"./chunk-VV6AJGJT.mjs";import{a as r}from"./chunk-2F5JM5AO.mjs";import{mergeConfigProps as m}from"@jamsrui/utils";import{jsx as e}from"react/jsx-runtime";var g=o=>{let{children:p}=o,a=n(),s=m(a,a,o),c=T(s);return e(r,{value:c,children:e(t,{children:e(b,{children:e(l,{children:p})})})})};export{g as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-2F5JM5AO.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var m=o=>{let{getRootProps:r}=e();return t("div",{props:[r(o)]})};export{m as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-2F5JM5AO.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var a=r=>{let{getWrapperProps:p}=e();return t("div",{props:[p(r)]})};export{a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-2F5JM5AO.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var n=r=>{let{getCellProps:t}=e();return o("td",{props:[t(r)]})};export{n as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-2F5JM5AO.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var l=r=>{let{getTableProps:t}=e();return o("table",{props:[t(r)]})};export{l as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-2F5JM5AO.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var s=r=>{let{getColumnProps:o}=e();return t("th",{props:[o(r)]})};export{s as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-2F5JM5AO.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var m=o=>{let{getFooterProps:r}=e();return t("tfoot",{props:[r(o)]})};export{m as a};
package/dist/index.d.mts CHANGED
@@ -1,15 +1,16 @@
1
- export { T as Table } from './table-DoFhyPyS.mjs';
2
- export { TableBody } from './table-body.mjs';
3
- export { TableCell } from './table-cell.mjs';
4
- export { TableColumn } from './table-column.mjs';
1
+ export { TableBody } from './primitive/table-body.mjs';
2
+ export { TableCell } from './primitive/table-cell.mjs';
3
+ export { TableColumn } from './primitive/table-column.mjs';
4
+ export { TableFooter } from './primitive/table-footer.mjs';
5
+ export { TableHeader } from './primitive/table-header.mjs';
6
+ export { TableRow } from './primitive/table-row.mjs';
7
+ export { Table } from './table.mjs';
5
8
  export { TableConfig, useTableConfig } from './table-config.mjs';
6
- export { TableHeader } from './table-header.mjs';
7
- export { TableRow } from './table-row.mjs';
8
- import 'react/jsx-runtime';
9
- import '@jamsrui/utils';
10
- import './styles.mjs';
11
- import 'tailwind-variants';
12
- import './table-footer.mjs';
13
9
  import 'react';
14
- import './table-wrapper.mjs';
10
+ import '@jamsrui/utils';
11
+ import 'react/jsx-runtime';
12
+ import './table-COowFxBr.mjs';
13
+ import './primitive/styles.mjs';
14
+ import './primitive/table-root.mjs';
15
+ import './primitive/table-wrapper.mjs';
15
16
  import '@jamsrui/core';
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{Table as r}from"./table";import{TableBody as a}from"./table-body";import{TableCell as b}from"./table-cell";import{TableColumn as t}from"./table-column";import{TableConfig as p,useTableConfig as x}from"./table-config";import{TableHeader as C}from"./table-header";import{TableRow as u}from"./table-row";export{r as Table,a as TableBody,b as TableCell,t as TableColumn,p as TableConfig,C as TableHeader,u as TableRow,x as useTableConfig};
1
+ "use client";import{a as t}from"./chunk-J4ZX6AQY.mjs";import{a as r,b as f}from"./chunk-G56JYZMX.mjs";import"./chunk-HZMKIGNF.mjs";import"./chunk-GSDCBY3X.mjs";import"./chunk-RJDA7IF5.mjs";import"./chunk-BHSFC5BI.mjs";import"./chunk-6TH4QLR4.mjs";import{a as b}from"./chunk-YJQDUGSR.mjs";import{a as T}from"./chunk-F5AMPC53.mjs";import"./chunk-NO7Q6M3H.mjs";import"./chunk-VV6AJGJT.mjs";import"./chunk-64OJE7BG.mjs";import{a as o}from"./chunk-2UOENW6T.mjs";import"./chunk-EALHLWMO.mjs";import{a as l}from"./chunk-IPKE7YHM.mjs";import{a as e}from"./chunk-VJMTZ2OI.mjs";import{a}from"./chunk-XPEMMX4W.mjs";import"./chunk-2F5JM5AO.mjs";export{t as Table,o as TableBody,e as TableCell,a as TableColumn,r as TableConfig,b as TableFooter,T as TableHeader,l as TableRow,f as useTableConfig};
@@ -0,0 +1,18 @@
1
+ export { T as Table, u as useTable } from '../table-COowFxBr.mjs';
2
+ export { TableBody } from './table-body.mjs';
3
+ export { TableCell } from './table-cell.mjs';
4
+ export { TableColumn } from './table-column.mjs';
5
+ export { TableConfig, useTableConfig } from './table-config.mjs';
6
+ export { TableContext, useTableContext } from './table-context.mjs';
7
+ export { TableEmptyState } from './table-empty-state.mjs';
8
+ export { TableFooter } from './table-footer.mjs';
9
+ export { TableHeader } from './table-header.mjs';
10
+ export { TableRoot } from './table-root.mjs';
11
+ export { TableRow } from './table-row.mjs';
12
+ export { TableTable } from './table-table.mjs';
13
+ export { TableWrapper } from './table-wrapper.mjs';
14
+ export { TableSlots, TableVariantProps, tableVariants } from './styles.mjs';
15
+ import 'react/jsx-runtime';
16
+ import '@jamsrui/utils';
17
+ import 'react';
18
+ import '@jamsrui/core';
@@ -0,0 +1 @@
1
+ import"../chunk-HZMKIGNF.mjs";import{a as j}from"../chunk-GSDCBY3X.mjs";import{a as g}from"../chunk-RJDA7IF5.mjs";import{a as i}from"../chunk-BHSFC5BI.mjs";import{a,b}from"../chunk-6TH4QLR4.mjs";import{a as p}from"../chunk-YJQDUGSR.mjs";import{a as q}from"../chunk-F5AMPC53.mjs";import{a as e}from"../chunk-NO7Q6M3H.mjs";import{a as f}from"../chunk-VV6AJGJT.mjs";import{a as h}from"../chunk-64OJE7BG.mjs";import{a as n}from"../chunk-2UOENW6T.mjs";import{a as m}from"../chunk-EALHLWMO.mjs";import{a as l}from"../chunk-IPKE7YHM.mjs";import{a as k}from"../chunk-VJMTZ2OI.mjs";import{a as o}from"../chunk-XPEMMX4W.mjs";import{a as c,b as d}from"../chunk-2F5JM5AO.mjs";export{j as Table,n as TableBody,k as TableCell,o as TableColumn,a as TableConfig,c as TableContext,m as TableEmptyState,p as TableFooter,q as TableHeader,e as TableRoot,l as TableRow,f as TableTable,g as TableWrapper,h as tableVariants,i as useTable,b as useTableConfig,d as useTableContext};
@@ -1,8 +1,7 @@
1
- import * as tailwind_variants from 'tailwind-variants';
1
+ import * as _jamsrui_utils from '@jamsrui/utils';
2
2
  import { VariantProps } from '@jamsrui/utils';
3
3
 
4
- declare const test = "";
5
- declare const tableVariants: tailwind_variants.TVReturnType<{
4
+ declare const tableVariants: _jamsrui_utils.TVReturnType<{
6
5
  variant: {
7
6
  solid: {
8
7
  th: string;
@@ -39,6 +38,7 @@ declare const tableVariants: tailwind_variants.TVReturnType<{
39
38
  true: {
40
39
  thead: string;
41
40
  wrapper: string;
41
+ th: string;
42
42
  };
43
43
  };
44
44
  allowHover: {
@@ -61,14 +61,11 @@ declare const tableVariants: tailwind_variants.TVReturnType<{
61
61
  wrapper: string;
62
62
  table: string;
63
63
  thead: string;
64
- th: string;
64
+ th: string[];
65
65
  tbody: string;
66
66
  tr: string;
67
- td: string;
67
+ td: string[];
68
68
  tfoot: string;
69
- sortIcon: string;
70
- emptyWrapper: string;
71
- loadingWrapper: string;
72
69
  }, undefined, {
73
70
  variant: {
74
71
  solid: {
@@ -106,6 +103,7 @@ declare const tableVariants: tailwind_variants.TVReturnType<{
106
103
  true: {
107
104
  thead: string;
108
105
  wrapper: string;
106
+ th: string;
109
107
  };
110
108
  };
111
109
  allowHover: {
@@ -128,15 +126,12 @@ declare const tableVariants: tailwind_variants.TVReturnType<{
128
126
  wrapper: string;
129
127
  table: string;
130
128
  thead: string;
131
- th: string;
129
+ th: string[];
132
130
  tbody: string;
133
131
  tr: string;
134
- td: string;
132
+ td: string[];
135
133
  tfoot: string;
136
- sortIcon: string;
137
- emptyWrapper: string;
138
- loadingWrapper: string;
139
- }, tailwind_variants.TVReturnType<{
134
+ }, _jamsrui_utils.TVReturnType<{
140
135
  variant: {
141
136
  solid: {
142
137
  th: string;
@@ -173,6 +168,7 @@ declare const tableVariants: tailwind_variants.TVReturnType<{
173
168
  true: {
174
169
  thead: string;
175
170
  wrapper: string;
171
+ th: string;
176
172
  };
177
173
  };
178
174
  allowHover: {
@@ -195,16 +191,13 @@ declare const tableVariants: tailwind_variants.TVReturnType<{
195
191
  wrapper: string;
196
192
  table: string;
197
193
  thead: string;
198
- th: string;
194
+ th: string[];
199
195
  tbody: string;
200
196
  tr: string;
201
- td: string;
197
+ td: string[];
202
198
  tfoot: string;
203
- sortIcon: string;
204
- emptyWrapper: string;
205
- loadingWrapper: string;
206
199
  }, undefined, unknown, unknown, undefined>>;
207
200
  type TableVariantProps = VariantProps<typeof tableVariants>;
208
201
  type TableSlots = keyof ReturnType<typeof tableVariants>;
209
202
 
210
- export { type TableSlots, type TableVariantProps, tableVariants, test };
203
+ export { type TableSlots, type TableVariantProps, tableVariants };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-64OJE7BG.mjs";export{a as tableVariants};
@@ -4,6 +4,7 @@ import { UIProps } from '@jamsrui/utils';
4
4
  declare const TableBody: (props: TableBody.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
5
  declare namespace TableBody {
6
6
  interface Props extends UIProps<"tbody"> {
7
+ emptySlot?: React.ReactNode;
7
8
  }
8
9
  }
9
10
 
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-2UOENW6T.mjs";import"../chunk-EALHLWMO.mjs";import"../chunk-IPKE7YHM.mjs";import"../chunk-VJMTZ2OI.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableBody};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-VJMTZ2OI.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableCell};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-XPEMMX4W.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableColumn};
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { GlobalConfigProps } from '@jamsrui/core';
3
+ import { T as Table } from '../table-COowFxBr.mjs';
4
+ import '@jamsrui/utils';
5
+ import './styles.mjs';
6
+ import './table-body.mjs';
7
+ import 'react';
8
+ import './table-cell.mjs';
9
+ import './table-column.mjs';
10
+ import './table-footer.mjs';
11
+ import './table-header.mjs';
12
+ import './table-root.mjs';
13
+ import './table-row.mjs';
14
+ import './table-wrapper.mjs';
15
+
16
+ declare const useTableConfig: () => TableConfig.Props;
17
+ declare const TableConfig: (props: Omit<Partial<TableConfig.Props>, "children"> & {
18
+ merge?: boolean;
19
+ children: React.ReactNode;
20
+ }) => react_jsx_runtime.JSX.Element;
21
+ declare namespace TableConfig {
22
+ interface Props extends Table.Props, GlobalConfigProps<Table.Props> {
23
+ }
24
+ }
25
+
26
+ export { TableConfig, useTableConfig };
@@ -0,0 +1 @@
1
+ import{a,b}from"../chunk-6TH4QLR4.mjs";export{a as TableConfig,b as useTableConfig};
@@ -1,14 +1,14 @@
1
1
  import * as react from 'react';
2
- import { u as useTable } from './table-DoFhyPyS.mjs';
2
+ import { u as useTable } from '../table-COowFxBr.mjs';
3
3
  import 'react/jsx-runtime';
4
4
  import '@jamsrui/utils';
5
5
  import './styles.mjs';
6
- import 'tailwind-variants';
7
6
  import './table-body.mjs';
8
7
  import './table-cell.mjs';
9
8
  import './table-column.mjs';
10
9
  import './table-footer.mjs';
11
10
  import './table-header.mjs';
11
+ import './table-root.mjs';
12
12
  import './table-row.mjs';
13
13
  import './table-wrapper.mjs';
14
14
 
@@ -0,0 +1 @@
1
+ import{a,b}from"../chunk-2F5JM5AO.mjs";export{a as TableContext,b as useTableContext};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-EALHLWMO.mjs";import"../chunk-IPKE7YHM.mjs";import"../chunk-VJMTZ2OI.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableEmptyState};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-YJQDUGSR.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableFooter};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-F5AMPC53.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableHeader};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const TableRoot: (props: TableRoot.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace TableRoot {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { TableRoot };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-NO7Q6M3H.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableRoot};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-IPKE7YHM.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableRow};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-VV6AJGJT.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableTable};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-RJDA7IF5.mjs";import"../chunk-2F5JM5AO.mjs";export{a as TableWrapper};
@@ -0,0 +1,13 @@
1
+ import 'react/jsx-runtime';
2
+ export { T as Table } from '../table-COowFxBr.mjs';
3
+ import '@jamsrui/utils';
4
+ import './styles.mjs';
5
+ import './table-body.mjs';
6
+ import 'react';
7
+ import './table-cell.mjs';
8
+ import './table-column.mjs';
9
+ import './table-footer.mjs';
10
+ import './table-header.mjs';
11
+ import './table-root.mjs';
12
+ import './table-row.mjs';
13
+ import './table-wrapper.mjs';
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-GSDCBY3X.mjs";import"../chunk-RJDA7IF5.mjs";import"../chunk-BHSFC5BI.mjs";import"../chunk-6TH4QLR4.mjs";import"../chunk-NO7Q6M3H.mjs";import"../chunk-VV6AJGJT.mjs";import"../chunk-64OJE7BG.mjs";import"../chunk-2F5JM5AO.mjs";export{a as Table};
@@ -1,13 +1,13 @@
1
1
  import '@jamsrui/utils';
2
2
  import './styles.mjs';
3
- export { u as useTable } from './table-DoFhyPyS.mjs';
3
+ export { u as useTable } from '../table-COowFxBr.mjs';
4
4
  import './table-body.mjs';
5
5
  import './table-cell.mjs';
6
6
  import './table-column.mjs';
7
7
  import './table-footer.mjs';
8
8
  import './table-header.mjs';
9
+ import './table-root.mjs';
9
10
  import './table-row.mjs';
10
11
  import './table-wrapper.mjs';
11
- import 'tailwind-variants';
12
12
  import 'react/jsx-runtime';
13
13
  import 'react';
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-BHSFC5BI.mjs";import"../chunk-64OJE7BG.mjs";export{a as useTable};
@@ -1,16 +1,17 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { PropGetter, UIProps, SlotsToClassNames } from '@jamsrui/utils';
3
- import { TableVariantProps, TableSlots } from './styles.mjs';
4
- import { TableBody } from './table-body.mjs';
5
- import { TableCell } from './table-cell.mjs';
6
- import { TableColumn } from './table-column.mjs';
7
- import { TableFooter } from './table-footer.mjs';
8
- import { TableHeader } from './table-header.mjs';
9
- import { TableRow } from './table-row.mjs';
10
- import { TableWrapper } from './table-wrapper.mjs';
3
+ import { TableVariantProps, TableSlots } from './primitive/styles.mjs';
4
+ import { TableBody } from './primitive/table-body.mjs';
5
+ import { TableCell } from './primitive/table-cell.mjs';
6
+ import { TableColumn } from './primitive/table-column.mjs';
7
+ import { TableFooter } from './primitive/table-footer.mjs';
8
+ import { TableHeader } from './primitive/table-header.mjs';
9
+ import { TableRoot } from './primitive/table-root.mjs';
10
+ import { TableRow } from './primitive/table-row.mjs';
11
+ import { TableWrapper } from './primitive/table-wrapper.mjs';
11
12
 
12
13
  declare const useTable: (props: useTable.Props) => {
13
- getRootProps: PropGetter<Table.Props>;
14
+ getRootProps: PropGetter<TableRoot.Props>;
14
15
  getTableProps: PropGetter<Table.Props>;
15
16
  getHeaderProps: PropGetter<TableHeader.Props>;
16
17
  getColumnProps: PropGetter<TableColumn.Props>;
@@ -23,16 +24,6 @@ declare const useTable: (props: useTable.Props) => {
23
24
  declare namespace useTable {
24
25
  interface Props extends UIProps<"table">, TableVariantProps {
25
26
  classNames?: SlotsToClassNames<TableSlots>;
26
- slotProps?: {
27
- table?: Table.Props;
28
- header?: TableHeader.Props;
29
- column?: TableColumn.Props;
30
- body?: TableBody.Props;
31
- row?: TableRow.Props;
32
- cell?: TableCell.Props;
33
- footer?: TableFooter.Props;
34
- wrapper?: TableWrapper.Props;
35
- };
36
27
  }
37
28
  }
38
29
 
@@ -1,17 +1,18 @@
1
- import { T as Table } from './table-DoFhyPyS.mjs';
2
- import './table-body.mjs';
3
- import './table-cell.mjs';
4
- import './table-column.mjs';
1
+ import './primitive/table-body.mjs';
2
+ import './primitive/table-cell.mjs';
3
+ import './primitive/table-column.mjs';
4
+ import './primitive/table-footer.mjs';
5
+ import './primitive/table-header.mjs';
6
+ import './primitive/table-row.mjs';
7
+ import { Table } from './table.mjs';
5
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
9
  import { GlobalConfigProps } from '@jamsrui/core';
7
- import './table-header.mjs';
8
- import './table-row.mjs';
9
- import '@jamsrui/utils';
10
- import './styles.mjs';
11
- import 'tailwind-variants';
12
- import './table-footer.mjs';
13
10
  import 'react';
14
- import './table-wrapper.mjs';
11
+ import '@jamsrui/utils';
12
+ import './table-COowFxBr.mjs';
13
+ import './primitive/styles.mjs';
14
+ import './primitive/table-root.mjs';
15
+ import './primitive/table-wrapper.mjs';
15
16
 
16
17
  declare const useTableConfig: () => TableConfig.Props;
17
18
  declare const TableConfig: (props: Omit<Partial<TableConfig.Props>, "children"> & {
@@ -1 +1 @@
1
- import{createConfigContext as o}from"@jamsrui/utils";const[r,a]=o({displayName:"TableConfig"});export{r as TableConfig,a as useTableConfig};
1
+ import{a,b}from"./chunk-G56JYZMX.mjs";export{a as TableConfig,b as useTableConfig};
package/dist/table.d.mts CHANGED
@@ -1,13 +1,21 @@
1
- import 'react/jsx-runtime';
2
- export { T as Table } from './table-DoFhyPyS.mjs';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { u as useTable } from './table-COowFxBr.mjs';
3
3
  import '@jamsrui/utils';
4
- import './styles.mjs';
5
- import 'tailwind-variants';
6
- import './table-body.mjs';
4
+ import './primitive/styles.mjs';
5
+ import './primitive/table-body.mjs';
7
6
  import 'react';
8
- import './table-cell.mjs';
9
- import './table-column.mjs';
10
- import './table-footer.mjs';
11
- import './table-header.mjs';
12
- import './table-row.mjs';
13
- import './table-wrapper.mjs';
7
+ import './primitive/table-cell.mjs';
8
+ import './primitive/table-column.mjs';
9
+ import './primitive/table-footer.mjs';
10
+ import './primitive/table-header.mjs';
11
+ import './primitive/table-root.mjs';
12
+ import './primitive/table-row.mjs';
13
+ import './primitive/table-wrapper.mjs';
14
+
15
+ declare const Table: (props: Table.Props) => react_jsx_runtime.JSX.Element;
16
+ declare namespace Table {
17
+ interface Props extends useTable.Props {
18
+ }
19
+ }
20
+
21
+ export { Table };
package/dist/table.mjs CHANGED
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useRenderElement as m}from"@jamsrui/hooks";import{mergeConfigProps as b}from"@jamsrui/utils";import{useTableConfig as c}from"./table-config";import{TableContext as i}from"./table-context";import{TableTable as T}from"./table-root";import{TableWrapper as f}from"./table-wrapper";import{useTable as d}from"./use-table";const E=o=>{const{children:n}=o,r=c(),p=b(r,r,o),t=d(p),{getRootProps:l}=t,s=e(f,{children:e(T,{children:n})}),a=m("div",{props:[l({}),{children:s}]});return e(i,{value:t,children:a})};export{E as Table};
1
+ import{a}from"./chunk-J4ZX6AQY.mjs";import"./chunk-G56JYZMX.mjs";import"./chunk-HZMKIGNF.mjs";import"./chunk-GSDCBY3X.mjs";import"./chunk-RJDA7IF5.mjs";import"./chunk-BHSFC5BI.mjs";import"./chunk-6TH4QLR4.mjs";import"./chunk-YJQDUGSR.mjs";import"./chunk-F5AMPC53.mjs";import"./chunk-NO7Q6M3H.mjs";import"./chunk-VV6AJGJT.mjs";import"./chunk-64OJE7BG.mjs";import"./chunk-2UOENW6T.mjs";import"./chunk-EALHLWMO.mjs";import"./chunk-IPKE7YHM.mjs";import"./chunk-VJMTZ2OI.mjs";import"./chunk-XPEMMX4W.mjs";import"./chunk-2F5JM5AO.mjs";export{a as Table};
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@jamsrui/table",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "peerDependencies": {
5
5
  "react": ">=19"
6
6
  },
7
7
  "dependencies": {
8
- "@jamsrui/hooks": "^0.0.8",
9
- "@jamsrui/core": "^0.0.7",
10
- "@jamsrui/utils": "^0.0.8"
8
+ "@jamsrui/core": "^0.0.9",
9
+ "@jamsrui/hooks": "^0.0.10",
10
+ "@jamsrui/utils": "^0.0.10"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
14
14
  "types": "./dist/index.d.ts",
15
- "import": "./dist/index.mjs",
16
- "require": "./dist/index.js"
15
+ "import": "./dist/index.mjs"
17
16
  }
18
17
  },
19
18
  "description": "A modern and beautiful Next.js UI components library.",
package/dist/styles.mjs DELETED
@@ -1 +0,0 @@
1
- import{radiusVariant as r,tv as t}from"@jamsrui/utils";const o="",a=t({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 whitespace-nowrap px-3 text-left text-sm",tbody:"",tr:"group/tr",td:"overflow-hidden whitespace-nowrap px-3 text-sm",tfoot:"",sortIcon:"",emptyWrapper:"",loadingWrapper:""},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-stroke-secondary",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 bg-surface [&>tr]:shadow-sm",wrapper:"flex max-h-[400px] flex-col overflow-auto"}},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:"solid",radius:"md"}});export{a as tableVariants,o as test};
@@ -1 +0,0 @@
1
- import{jsx as d}from"react/jsx-runtime";import{useRenderElement as n}from"@jamsrui/hooks";import{useTableContext as p}from"./table-context";import{TableEmptyState as s}from"./table-empty-state";const i=e=>{const{children:o}=e,{getBodyProps:r}=p(),t=o??d(s,{});return n("tbody",{props:[r(e),{children:t}]})};export{i as TableBody};
@@ -1 +0,0 @@
1
- import{useRenderElement as t}from"@jamsrui/hooks";import{useTableContext as o}from"./table-context";const n=e=>{const{getCellProps:r}=o();return t("td",{props:[r(e)]})};export{n as TableCell};
@@ -1 +0,0 @@
1
- import{useRenderElement as o}from"@jamsrui/hooks";import{useTableContext as t}from"./table-context";const s=e=>{const{getColumnProps:r}=t();return o("th",{props:[r(e)]})};export{s as TableColumn};
@@ -1 +0,0 @@
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 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{TableCell as l}from"./table-cell";import{TableRow as o}from"./table-row";const p=()=>e(o,{children:e(l,{className:"text-center py-12",colSpan:100,children:"No data found"})});export{p as TableEmptyState};
@@ -1 +0,0 @@
1
- import{useRenderElement as r}from"@jamsrui/hooks";import{useTableContext as t}from"./table-context";const m=e=>{const{getFooterProps:o}=t();return r("tfoot",{props:[o(e)]})};export{m as TableFooter};
@@ -1 +0,0 @@
1
- import{useRenderElement as t}from"@jamsrui/hooks";import{useTableContext as o}from"./table-context";const n=e=>{const{getHeaderProps:r}=o();return t("thead",{props:[r(e)]})};export{n as TableHeader};
@@ -1 +0,0 @@
1
- import{useRenderElement as t}from"@jamsrui/hooks";import{useTableContext as o}from"./table-context";const l=e=>{const{getTableProps:r}=o();return t("table",{props:[r(e)]})};export{l as TableTable};
@@ -1 +0,0 @@
1
- import{useRenderElement as o}from"@jamsrui/hooks";import{useTableContext as t}from"./table-context";const m=e=>{const{getRowProps:r}=t();return o("tr",{props:[r(e)]})};export{m as TableRow};
@@ -1 +0,0 @@
1
- import{useRenderElement as p}from"@jamsrui/hooks";import{useTableContext as t}from"./table-context";const a=e=>{const{getWrapperProps:r}=t();return p("div",{props:[r(e)]})};export{a as TableWrapper};
@@ -1 +0,0 @@
1
- import{useCallback as r,useMemo as C}from"react";import{cn as l,dataAttrDev as s,mapPropsVariants as g,mergeProps as p}from"@jamsrui/utils";import{tableVariants as w}from"./styles";const B=u=>{const[m,h]=g(u,w.variantKeys),{classNames:o,slotProps:e,...c}=m,t=w(h),b=r(()=>({...c,"data-slot":s("root"),"data-component":s("table"),className:t.root({className:l(o?.root,m.className)})}),[m.className,o?.root,c,t]),P=r(a=>({...p(e?.wrapper,a),"data-slot":s("wrapper"),className:t.wrapper({className:l(e?.wrapper?.className,o?.wrapper,a.className)})}),[o?.wrapper,e?.wrapper,t]),d=r(a=>({...p(e?.table,a),"data-slot":s("table"),className:t.table({className:l(e?.table?.className,o?.table,a.className)})}),[o?.table,e?.table,t]),N=r(a=>({...p(e?.header,a),"data-slot":s("header"),className:t.thead({className:l(e?.header?.className,o?.thead,a.className)})}),[o?.thead,e?.header,t]),n=r(a=>({...p(e?.column,a),"data-slot":s("column"),className:t.th({className:l(e?.column,o?.th,a.className)})}),[o?.th,e?.column,t]),T=r(a=>({...p(e?.body,a),"data-slot":s("body"),className:t.tbody({className:l(e?.body?.className,o?.tbody,a.className)})}),[o?.tbody,e?.body,t]),y=r(a=>({...p(e?.row,a),"data-slot":s("row"),className:t.tr({className:l(e?.row?.className,o?.tr,a.className)})}),[o?.tr,e?.row,t]),f=r(a=>({...p(e?.cell,a),"data-slot":s("cell"),className:t.td({className:l(e?.cell?.className,o?.td,a.className)})}),[o?.td,e?.cell,t]),i=r(a=>({...p(e?.footer,a),"data-slot":s("footer"),className:t.tfoot({className:l(e?.footer?.className,o?.tfoot,a.className)})}),[o?.tfoot,e?.footer,t]);return C(()=>({getRootProps:b,getTableProps:d,getHeaderProps:N,getColumnProps:n,getBodyProps:T,getRowProps:y,getCellProps:f,getFooterProps:i,getWrapperProps:P}),[T,f,n,i,N,b,y,d,P])};export{B as useTable};