@jamsrui/table 0.0.7 → 0.0.9
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.d.mts +13 -12
- package/dist/index.mjs +1 -1
- package/dist/primitive/index.d.mts +18 -0
- package/dist/primitive/index.mjs +1 -0
- package/dist/{styles.d.mts → primitive/styles.d.mts} +13 -20
- package/dist/primitive/styles.mjs +1 -0
- package/dist/{table-body.d.mts → primitive/table-body.d.mts} +1 -0
- package/dist/primitive/table-body.mjs +1 -0
- package/dist/primitive/table-config.d.mts +26 -0
- package/dist/primitive/table-config.mjs +1 -0
- package/dist/{table-context.d.mts → primitive/table-context.d.mts} +2 -2
- package/dist/primitive/table-root.d.mts +10 -0
- package/dist/primitive/table-root.mjs +1 -0
- package/dist/primitive/table.d.mts +13 -0
- package/dist/primitive/table.mjs +1 -0
- package/dist/{use-table.d.mts → primitive/use-table.d.mts} +2 -2
- package/dist/primitive/use-table.mjs +1 -0
- package/dist/{table-DoFhyPyS.d.mts → table-COowFxBr.d.mts} +10 -19
- package/dist/table-config.d.mts +14 -12
- package/dist/table.d.mts +19 -11
- package/dist/table.mjs +1 -1
- package/package.json +4 -4
- package/dist/styles.mjs +0 -1
- package/dist/table-body.mjs +0 -1
- package/dist/use-table.mjs +0 -1
- /package/dist/{table-cell.d.mts → primitive/table-cell.d.mts} +0 -0
- /package/dist/{table-cell.mjs → primitive/table-cell.mjs} +0 -0
- /package/dist/{table-column.d.mts → primitive/table-column.d.mts} +0 -0
- /package/dist/{table-column.mjs → primitive/table-column.mjs} +0 -0
- /package/dist/{table-context.mjs → primitive/table-context.mjs} +0 -0
- /package/dist/{table-empty-state.d.mts → primitive/table-empty-state.d.mts} +0 -0
- /package/dist/{table-empty-state.mjs → primitive/table-empty-state.mjs} +0 -0
- /package/dist/{table-footer.d.mts → primitive/table-footer.d.mts} +0 -0
- /package/dist/{table-footer.mjs → primitive/table-footer.mjs} +0 -0
- /package/dist/{table-header.d.mts → primitive/table-header.d.mts} +0 -0
- /package/dist/{table-header.mjs → primitive/table-header.mjs} +0 -0
- /package/dist/{table-row.d.mts → primitive/table-row.d.mts} +0 -0
- /package/dist/{table-row.mjs → primitive/table-row.mjs} +0 -0
- /package/dist/{table-root.d.mts → primitive/table-table.d.mts} +0 -0
- /package/dist/{table-root.mjs → primitive/table-table.mjs} +0 -0
- /package/dist/{table-wrapper.d.mts → primitive/table-wrapper.d.mts} +0 -0
- /package/dist/{table-wrapper.mjs → primitive/table-wrapper.mjs} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
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 '
|
|
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{
|
|
1
|
+
"use client";import{TableBody as o,TableCell as a,TableColumn as b,TableFooter as T,TableHeader as r,TableRow as f}from"./primitive";import{Table as m}from"./table";import{TableConfig as C,useTableConfig as i}from"./table-config";export{m as Table,o as TableBody,a as TableCell,b as TableColumn,C as TableConfig,T as TableFooter,r as TableHeader,f as TableRow,i 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{Table as r}from"./table";import{TableBody as a}from"./table-body";import{TableCell as p}from"./table-cell";import{TableColumn as T}from"./table-column";import{TableConfig as m,useTableConfig as x}from"./table-config";import{TableContext as n,useTableContext as C}from"./table-context";import{TableEmptyState as u}from"./table-empty-state";import{TableFooter as d}from"./table-footer";import{TableHeader as R}from"./table-header";import{TableRoot as V}from"./table-root";import{TableRow as B}from"./table-row";import{TableTable as F}from"./table-table";import{TableWrapper as P}from"./table-wrapper";import{useTable as c}from"./use-table";import{tableVariants as j}from"./styles";export{r as Table,a as TableBody,p as TableCell,T as TableColumn,m as TableConfig,n as TableContext,u as TableEmptyState,d as TableFooter,R as TableHeader,V as TableRoot,B as TableRow,F as TableTable,P as TableWrapper,j as tableVariants,c as useTable,x as useTableConfig,C as useTableContext};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _jamsrui_utils from '@jamsrui/utils';
|
|
2
2
|
import { VariantProps } from '@jamsrui/utils';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
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
|
-
|
|
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
|
|
203
|
+
export { type TableSlots, type TableVariantProps, tableVariants };
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -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{jsx as l}from"react/jsx-runtime";import{useRenderElement as n}from"@jamsrui/hooks";import{useTableContext as m}from"./table-context";import{TableEmptyState as d}from"./table-empty-state";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};
|
|
@@ -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{createConfigContext as o}from"@jamsrui/utils";const[r,a]=o({displayName:"TableConfig"});export{r as TableConfig,a as useTableConfig};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { u as useTable } from '
|
|
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,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{useRenderElement as r}from"@jamsrui/hooks";import{useTableContext as t}from"./table-context";const m=e=>{const{getRootProps:o}=t();return r("div",{props:[o(e)]})};export{m as TableRoot};
|
|
@@ -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{jsx as e}from"react/jsx-runtime";import{mergeConfigProps as p}from"@jamsrui/utils";import{useTableConfig as b}from"./table-config";import{TableContext as m}from"./table-context";import{TableRoot as T}from"./table-root";import{TableTable as n}from"./table-table";import{TableWrapper as s}from"./table-wrapper";import{useTable as f}from"./use-table";const d=o=>{const{children:t}=o,r=b(),a=p(r,r,o),l=f(a);return e(m,{value:l,children:e(T,{children:e(s,{children:e(n,{children:t})})})})};export{d as Table};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import '@jamsrui/utils';
|
|
2
2
|
import './styles.mjs';
|
|
3
|
-
export { u as useTable } from '
|
|
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{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";const x=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{x 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 {
|
|
10
|
-
import {
|
|
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<
|
|
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
|
|
package/dist/table-config.d.mts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import './table-
|
|
3
|
-
import './table-
|
|
4
|
-
import './table-
|
|
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 '
|
|
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
|
-
declare const TableConfig: (props: TableConfig.Props & {
|
|
18
|
+
declare const TableConfig: (props: Omit<Partial<TableConfig.Props>, "children"> & {
|
|
18
19
|
merge?: boolean;
|
|
20
|
+
children: React.ReactNode;
|
|
19
21
|
}) => react_jsx_runtime.JSX.Element;
|
|
20
22
|
declare namespace TableConfig {
|
|
21
23
|
interface Props extends Table.Props, GlobalConfigProps<Table.Props> {
|
package/dist/table.d.mts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import 'react/jsx-runtime';
|
|
2
|
-
|
|
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 '
|
|
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-
|
|
13
|
-
import './table-
|
|
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{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{mergeConfigProps as b}from"@jamsrui/utils";import{TableContext as T,TableRoot as n,TableTable as p,TableWrapper as s,useTable as c}from"./primitive";import{useTableConfig as m}from"./table-config";const g=o=>{const{children:r}=o,a=m(),t=b(a,a,o),l=c(t);return e(T,{value:l,children:e(n,{children:e(s,{children:e(p,{children:r})})})})};export{g as Table};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/table",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/
|
|
9
|
-
"@jamsrui/core": "^0.0.
|
|
10
|
-
"@jamsrui/
|
|
8
|
+
"@jamsrui/hooks": "^0.0.9",
|
|
9
|
+
"@jamsrui/core": "^0.0.8",
|
|
10
|
+
"@jamsrui/utils": "^0.0.9"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
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};
|
package/dist/table-body.mjs
DELETED
|
@@ -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};
|
package/dist/use-table.mjs
DELETED
|
@@ -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};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|