@agentero/design-system 0.24.4 → 0.25.0
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/mcp/manifests/components.html +3976 -10132
- package/mcp/manifests/components.json +6985 -1
- package/mcp/server.mjs +3921 -2320
- package/package.json +5 -1
- package/src/avatar-group/avatar-group.d.ts +2 -0
- package/src/data-table/data-table.d.ts +1 -1
- package/src/data-table/data-table.js +74 -74
- package/src/data-table/icons.d.ts +0 -8
- package/src/data-table/icons.js +1 -12
- package/src/data-table/index.d.ts +89 -7
- package/src/data-table/index.js +10 -19
- package/src/table/icons.d.ts +9 -0
- package/src/table/icons.js +16 -0
- package/src/table/index.d.ts +57 -0
- package/src/table/index.js +15 -0
- package/src/{data-table → table}/table.d.ts +12 -12
- package/src/{data-table → table}/table.js +2 -2
- package/src/validation-list/validation-list.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentero/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "A React component library built with Tailwind CSS v4 and Radix UI primitives",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -97,6 +97,10 @@
|
|
|
97
97
|
"types": "./src/switch/index.d.ts",
|
|
98
98
|
"import": "./src/switch/index.js"
|
|
99
99
|
},
|
|
100
|
+
"./table": {
|
|
101
|
+
"types": "./src/table/index.d.ts",
|
|
102
|
+
"import": "./src/table/index.js"
|
|
103
|
+
},
|
|
100
104
|
"./tabs": {
|
|
101
105
|
"types": "./src/tabs/index.d.ts",
|
|
102
106
|
"import": "./src/tabs/index.js"
|
|
@@ -106,6 +106,8 @@ export type AvatarGroupProps = Omit<ComponentPropsWithRef<'div'>, 'children'> &
|
|
|
106
106
|
* directly — the group clones each to force a uniform `size`/`variant` and the
|
|
107
107
|
* overlap, so wrapped children won't pick those up.
|
|
108
108
|
*
|
|
109
|
+
* @summary Overlapping row of avatars, collapsing the rest into `+N`
|
|
110
|
+
*
|
|
109
111
|
* @example
|
|
110
112
|
* <AvatarGroup size="sm" max={3}>
|
|
111
113
|
* <Avatar fallback="AL" colorize="Ada Lovelace" />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ElementType, HTMLAttributes, PropsWithChildren, RefObject } from 'react';
|
|
2
2
|
import { RowData, Table as TableType, TableOptions } from '@tanstack/react-table';
|
|
3
3
|
import { PaginationProps } from '../pagination';
|
|
4
|
-
import { TableRootProps } from '
|
|
4
|
+
import { TableRootProps } from '../table';
|
|
5
5
|
/**
|
|
6
6
|
* Shape a column's `meta` may carry; spread onto the `<th>`/`<td>`.
|
|
7
7
|
* Right alignment of the header content is derived from either `style.textAlign: 'right'`
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { tv as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { flexRender as
|
|
3
|
+
import { Table as t } from "../table/index.js";
|
|
4
|
+
import { Pagination as n } from "../pagination/pagination.js";
|
|
5
|
+
import { IconArrowUpward as r, IconSwapVert as i } from "./icons.js";
|
|
6
|
+
import { tv as a } from "tailwind-variants";
|
|
7
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as l, createContext as u, use as d, useRef as f } from "react";
|
|
9
|
+
import { flexRender as p, getCoreRowModel as m, useReactTable as h } from "@tanstack/react-table";
|
|
10
10
|
//#region src/data-table/data-table.tsx
|
|
11
|
-
var
|
|
12
|
-
let e = g
|
|
11
|
+
var g = u(null), _ = () => {
|
|
12
|
+
let e = d(g);
|
|
13
13
|
if (!e) throw Error("useDataTable must be used within a DataTable.Root");
|
|
14
14
|
return e;
|
|
15
|
-
},
|
|
15
|
+
}, v = ({ children: e, isLoading: t = !1, onRowClick: n, rowHref: r, linkComponent: i = "a", ...a }) => /* @__PURE__ */ s(g, {
|
|
16
16
|
value: {
|
|
17
|
-
table:
|
|
17
|
+
table: h({
|
|
18
18
|
...a,
|
|
19
|
-
getCoreRowModel:
|
|
19
|
+
getCoreRowModel: m()
|
|
20
20
|
}),
|
|
21
21
|
isLoading: t,
|
|
22
|
-
scrollRef:
|
|
22
|
+
scrollRef: f(null),
|
|
23
23
|
onRowClick: n,
|
|
24
24
|
rowHref: r,
|
|
25
25
|
linkComponent: i
|
|
26
26
|
},
|
|
27
|
-
children: /* @__PURE__ */
|
|
27
|
+
children: /* @__PURE__ */ s("div", {
|
|
28
28
|
"data-slot": "data-table-root",
|
|
29
29
|
className: "flex min-h-0 flex-1 flex-col",
|
|
30
30
|
children: e
|
|
31
31
|
})
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
var
|
|
33
|
+
v.displayName = "DataTable.Root";
|
|
34
|
+
var y = ({ children: e }) => /* @__PURE__ */ s("div", {
|
|
35
35
|
"data-slot": "data-table-toolbar",
|
|
36
36
|
role: "toolbar",
|
|
37
37
|
className: "flex gap-2 border-b border-border-default-base-primary px-4 py-3",
|
|
38
38
|
children: e
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
var
|
|
40
|
+
y.displayName = "DataTable.ToolBar";
|
|
41
|
+
var b = a({
|
|
42
42
|
base: "size-4 transition-transform duration-200",
|
|
43
43
|
variants: { direction: {
|
|
44
44
|
asc: "",
|
|
45
45
|
desc: "rotate-180",
|
|
46
46
|
false: ""
|
|
47
47
|
} }
|
|
48
|
-
}),
|
|
48
|
+
}), x = a({
|
|
49
49
|
base: "flex w-full appearance-none items-center bg-transparent p-0 text-left [font:inherit]",
|
|
50
50
|
variants: {
|
|
51
51
|
canSort: {
|
|
@@ -57,96 +57,96 @@ var T = u({
|
|
|
57
57
|
left: "justify-start"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
}),
|
|
61
|
-
let { table:
|
|
62
|
-
return /* @__PURE__ */
|
|
60
|
+
}), S = (e) => !!e.closest("a, button, [role=\"menu\"]"), C = ({ children: n = /* @__PURE__ */ s(w, {}), size: a = "md", sticky: u = "header", embed: d = !0, enclosed: f = !1 }) => {
|
|
61
|
+
let { table: m, isLoading: h, scrollRef: g, onRowClick: v, rowHref: y, linkComponent: C } = _(), T = m.getAllColumns().length;
|
|
62
|
+
return /* @__PURE__ */ s("div", {
|
|
63
63
|
"data-slot": "data-table-loading-overlay",
|
|
64
|
-
className: e("flex min-h-0 flex-1 flex-col transition-opacity duration-150",
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
size:
|
|
67
|
-
sticky:
|
|
68
|
-
embed:
|
|
69
|
-
enclosed:
|
|
70
|
-
ref:
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
-
let
|
|
64
|
+
className: e("flex min-h-0 flex-1 flex-col transition-opacity duration-150", h && "opacity-50"),
|
|
65
|
+
children: /* @__PURE__ */ c(t.Root, {
|
|
66
|
+
size: a,
|
|
67
|
+
sticky: u,
|
|
68
|
+
embed: d,
|
|
69
|
+
enclosed: f,
|
|
70
|
+
ref: g,
|
|
71
|
+
children: [/* @__PURE__ */ s(t.Head, { children: m.getHeaderGroups().map((e) => /* @__PURE__ */ s(t.Row, { children: e.headers.map((e) => {
|
|
72
|
+
let n = e.column.columnDef.meta, a = e.column.getCanSort(), l = e.column.getIsSorted(), u = n?.style?.textAlign === "right" || n?.className?.includes("text-right") ? "right" : "left", d = e.isPlaceholder ? null : /* @__PURE__ */ c(o, { children: [p(e.column.columnDef.header, e.getContext()), a && /* @__PURE__ */ s("span", {
|
|
73
73
|
className: "size-4",
|
|
74
|
-
children:
|
|
74
|
+
children: l ? /* @__PURE__ */ s(r, { className: b({ direction: l }) }) : /* @__PURE__ */ s(i, { className: "size-4" })
|
|
75
75
|
})] });
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
...
|
|
78
|
-
"aria-sort":
|
|
79
|
-
children:
|
|
76
|
+
return /* @__PURE__ */ s(t.Header, {
|
|
77
|
+
...n,
|
|
78
|
+
"aria-sort": a ? l === "asc" ? "ascending" : l === "desc" ? "descending" : "none" : void 0,
|
|
79
|
+
children: a ? /* @__PURE__ */ s("button", {
|
|
80
80
|
type: "button",
|
|
81
|
-
className:
|
|
81
|
+
className: x({
|
|
82
82
|
canSort: !0,
|
|
83
|
-
align:
|
|
83
|
+
align: u
|
|
84
84
|
}),
|
|
85
85
|
onClick: e.column.getToggleSortingHandler(),
|
|
86
86
|
title: e.column.getNextSortingOrder() === "asc" ? "Sort ascending" : e.column.getNextSortingOrder() === "desc" ? "Sort descending" : "Clear sort",
|
|
87
|
-
children:
|
|
88
|
-
}) : /* @__PURE__ */
|
|
89
|
-
className:
|
|
87
|
+
children: d
|
|
88
|
+
}) : /* @__PURE__ */ s("div", {
|
|
89
|
+
className: x({
|
|
90
90
|
canSort: !1,
|
|
91
|
-
align:
|
|
91
|
+
align: u
|
|
92
92
|
}),
|
|
93
|
-
children:
|
|
93
|
+
children: d
|
|
94
94
|
})
|
|
95
95
|
}, e.id);
|
|
96
|
-
}) }, e.id)) }), /* @__PURE__ */
|
|
97
|
-
let
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
className: e("has-aria-expanded:bg-bg-default-base-secondary",
|
|
100
|
-
onClick:
|
|
101
|
-
|
|
96
|
+
}) }, e.id)) }), /* @__PURE__ */ s(t.Body, { children: m.getRowModel().rows.length ? m.getRowModel().rows.map((n) => {
|
|
97
|
+
let r = y?.(n.original), i = !!v || !!r;
|
|
98
|
+
return /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(t.Row, {
|
|
99
|
+
className: e("has-aria-expanded:bg-bg-default-base-secondary", i && "cursor-pointer"),
|
|
100
|
+
onClick: i ? (e) => {
|
|
101
|
+
S(e.target) || !e.currentTarget.contains(e.target) || (v ? v(n.original) : r && e.currentTarget.querySelector("[data-row-link]")?.click());
|
|
102
102
|
} : void 0,
|
|
103
|
-
children:
|
|
104
|
-
let
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
...
|
|
107
|
-
children: [
|
|
108
|
-
href:
|
|
103
|
+
children: n.getVisibleCells().map((e, n) => {
|
|
104
|
+
let i = e.column.columnDef.meta;
|
|
105
|
+
return /* @__PURE__ */ c(t.Cell, {
|
|
106
|
+
...i,
|
|
107
|
+
children: [n === 0 && r && /* @__PURE__ */ s(C, {
|
|
108
|
+
href: r,
|
|
109
109
|
"data-row-link": !0,
|
|
110
110
|
className: "hidden",
|
|
111
111
|
tabIndex: -1,
|
|
112
112
|
"aria-hidden": "true"
|
|
113
|
-
}),
|
|
113
|
+
}), p(e.column.columnDef.cell, e.getContext())]
|
|
114
114
|
}, e.id);
|
|
115
115
|
})
|
|
116
|
-
}) },
|
|
117
|
-
}) :
|
|
118
|
-
colSpan:
|
|
119
|
-
children: /* @__PURE__ */
|
|
116
|
+
}) }, n.id);
|
|
117
|
+
}) : h ? null : /* @__PURE__ */ s(t.Row, { children: /* @__PURE__ */ s(t.Cell, {
|
|
118
|
+
colSpan: T,
|
|
119
|
+
children: /* @__PURE__ */ s("div", {
|
|
120
120
|
"data-slot": "table-empty-state",
|
|
121
121
|
className: "whitespace-normal",
|
|
122
|
-
children:
|
|
122
|
+
children: n
|
|
123
123
|
})
|
|
124
124
|
}) }) })]
|
|
125
125
|
})
|
|
126
126
|
});
|
|
127
127
|
};
|
|
128
|
-
|
|
129
|
-
var
|
|
128
|
+
C.displayName = "DataTable.Table";
|
|
129
|
+
var w = () => /* @__PURE__ */ s("div", {
|
|
130
130
|
className: "mb-6 flex flex-col items-center gap-4",
|
|
131
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ s("div", {
|
|
132
132
|
className: "text-lg",
|
|
133
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ s("b", { children: "No results." })
|
|
134
134
|
})
|
|
135
|
-
}),
|
|
135
|
+
}), T = ({ children: e }) => /* @__PURE__ */ s("div", {
|
|
136
136
|
"data-slot": "data-table-pagination",
|
|
137
137
|
className: "flex justify-end border-t border-border-default-base-primary px-6 py-3",
|
|
138
138
|
children: e
|
|
139
139
|
});
|
|
140
|
-
|
|
141
|
-
var
|
|
142
|
-
let { scrollRef:
|
|
143
|
-
return /* @__PURE__ */
|
|
140
|
+
T.displayName = "DataTable.Footer";
|
|
141
|
+
var E = (e) => {
|
|
142
|
+
let { scrollRef: t } = _();
|
|
143
|
+
return /* @__PURE__ */ s(n, {
|
|
144
144
|
...e,
|
|
145
|
-
onPageChange: (
|
|
146
|
-
|
|
145
|
+
onPageChange: (n) => {
|
|
146
|
+
t.current?.scrollTo({ top: 0 }), e.onPageChange(n);
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
|
-
|
|
150
|
+
E.displayName = "DataTable.Pagination";
|
|
151
151
|
//#endregion
|
|
152
|
-
export {
|
|
152
|
+
export { E as DataTablePagination, C as DataTableTable, T as Footer, v as Root, y as ToolBar, _ as useDataTable };
|
|
@@ -16,11 +16,3 @@ export declare const IconArrowUpward: (props: SVGProps<SVGSVGElement>) => import
|
|
|
16
16
|
* @summary 24px swap-vert icon used as the sortable (unsorted) indicator
|
|
17
17
|
*/
|
|
18
18
|
export declare const IconSwapVert: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
/**
|
|
20
|
-
* Downward chevron glyph used by the row expand/collapse button. Rotates 180°
|
|
21
|
-
* when its row is expanded (driven by `data-state=open`). The fill follows
|
|
22
|
-
* `currentColor` so it inherits the button's text color token.
|
|
23
|
-
*
|
|
24
|
-
* @summary 24px chevron-down icon used by the row expand button
|
|
25
|
-
*/
|
|
26
|
-
export declare const IconKeyboardArrowDown: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/src/data-table/icons.js
CHANGED
|
@@ -22,17 +22,6 @@ var t = (t) => /* @__PURE__ */ e("svg", {
|
|
|
22
22
|
fill: "currentColor",
|
|
23
23
|
d: "M9.163 12.644a.73.73 0 0 1-.534-.216.73.73 0 0 1-.215-.534v-6.53L6.096 7.68a.68.68 0 0 1-.507.207.767.767 0 0 1-.77-.751q0-.303.233-.535l3.47-3.47a.8.8 0 0 1 .297-.197 1.001 1.001 0 0 1 .678 0 .8.8 0 0 1 .3.198l3.493 3.494a.7.7 0 0 1 .22.517.788.788 0 0 1-.763.752.7.7 0 0 1-.526-.225L9.914 5.364v6.54q0 .315-.216.527a.73.73 0 0 1-.535.213m5.682 8.47a1 1 0 0 1-.341-.059.8.8 0 0 1-.3-.197l-3.495-3.495a.7.7 0 0 1-.22-.517.788.788 0 0 1 .763-.752.7.7 0 0 1 .527.225l2.307 2.308v-6.54q0-.315.216-.528a.73.73 0 0 1 .535-.213q.318 0 .534.216a.73.73 0 0 1 .215.534v6.531l2.318-2.317a.68.68 0 0 1 .507-.208.767.767 0 0 1 .77.752q0 .302-.233.535l-3.47 3.469a.8.8 0 0 1-.296.198 1 1 0 0 1-.337.057"
|
|
24
24
|
})
|
|
25
|
-
}), r = (t) => /* @__PURE__ */ e("svg", {
|
|
26
|
-
width: "24",
|
|
27
|
-
height: "24",
|
|
28
|
-
viewBox: "0 0 24 24",
|
|
29
|
-
fill: "none",
|
|
30
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
-
...t,
|
|
32
|
-
children: /* @__PURE__ */ e("path", {
|
|
33
|
-
fill: "currentColor",
|
|
34
|
-
d: "M12 14.677a.83.83 0 0 1-.633-.256L6.873 9.927a.73.73 0 0 1-.212-.522.7.7 0 0 1 .212-.532.72.72 0 0 1 .527-.217q.31 0 .527.217L12 12.946l4.073-4.073a.73.73 0 0 1 .522-.212.7.7 0 0 1 .532.212q.217.217.217.527a.72.72 0 0 1-.217.527l-4.494 4.494a.83.83 0 0 1-.633.256"
|
|
35
|
-
})
|
|
36
25
|
});
|
|
37
26
|
//#endregion
|
|
38
|
-
export { t as IconArrowUpward,
|
|
27
|
+
export { t as IconArrowUpward, n as IconSwapVert };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export { tableRecipe } from './table';
|
|
2
|
-
export type { TableRootProps } from './table';
|
|
3
1
|
export { useDataTable } from './data-table';
|
|
4
2
|
export type { DataTableColumnMeta, PaginationState } from './data-table';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Import from `@agentero/design-system/table` instead — that entry
|
|
5
|
+
* point carries no `@tanstack/react-table` dependency.
|
|
6
|
+
*/
|
|
5
7
|
export declare const Table: {
|
|
6
8
|
Root: {
|
|
7
|
-
({ children, ref, ...variants }: import('react').PropsWithChildren<import('
|
|
9
|
+
({ children, ref, ...variants }: import('react').PropsWithChildren<import('.').TableRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
displayName: string;
|
|
9
11
|
};
|
|
10
12
|
Head: {
|
|
@@ -57,6 +59,86 @@ export declare const Table: {
|
|
|
57
59
|
displayName: string;
|
|
58
60
|
};
|
|
59
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Import from `@agentero/design-system/table` instead.
|
|
64
|
+
*/
|
|
65
|
+
export declare const tableRecipe: import('tailwind-variants').TVReturnType<{
|
|
66
|
+
size: {
|
|
67
|
+
sm: {};
|
|
68
|
+
md: {};
|
|
69
|
+
lg: {};
|
|
70
|
+
};
|
|
71
|
+
embed: {
|
|
72
|
+
true: {
|
|
73
|
+
root: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
enclosed: {
|
|
77
|
+
true: {
|
|
78
|
+
root: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
sticky: {
|
|
82
|
+
header: {};
|
|
83
|
+
headerAndFooter: {};
|
|
84
|
+
};
|
|
85
|
+
}, {
|
|
86
|
+
root: string[];
|
|
87
|
+
scroll: string;
|
|
88
|
+
table: string;
|
|
89
|
+
}, undefined, {
|
|
90
|
+
size: {
|
|
91
|
+
sm: {};
|
|
92
|
+
md: {};
|
|
93
|
+
lg: {};
|
|
94
|
+
};
|
|
95
|
+
embed: {
|
|
96
|
+
true: {
|
|
97
|
+
root: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
enclosed: {
|
|
101
|
+
true: {
|
|
102
|
+
root: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
sticky: {
|
|
106
|
+
header: {};
|
|
107
|
+
headerAndFooter: {};
|
|
108
|
+
};
|
|
109
|
+
}, {
|
|
110
|
+
root: string[];
|
|
111
|
+
scroll: string;
|
|
112
|
+
table: string;
|
|
113
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
114
|
+
size: {
|
|
115
|
+
sm: {};
|
|
116
|
+
md: {};
|
|
117
|
+
lg: {};
|
|
118
|
+
};
|
|
119
|
+
embed: {
|
|
120
|
+
true: {
|
|
121
|
+
root: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
enclosed: {
|
|
125
|
+
true: {
|
|
126
|
+
root: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
sticky: {
|
|
130
|
+
header: {};
|
|
131
|
+
headerAndFooter: {};
|
|
132
|
+
};
|
|
133
|
+
}, {
|
|
134
|
+
root: string[];
|
|
135
|
+
scroll: string;
|
|
136
|
+
table: string;
|
|
137
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated Import from `@agentero/design-system/table` instead.
|
|
140
|
+
*/
|
|
141
|
+
export type { TableRootProps } from '../table';
|
|
60
142
|
export declare const DataTable: {
|
|
61
143
|
Root: {
|
|
62
144
|
<TData extends import('@tanstack/table-core').RowData>({ children, isLoading, onRowClick, rowHref, linkComponent, ...tableOptions }: import('react').PropsWithChildren<{
|
|
@@ -157,10 +239,10 @@ export declare const DataTable: {
|
|
|
157
239
|
};
|
|
158
240
|
Table: {
|
|
159
241
|
({ children, size, sticky, embed, enclosed }: {
|
|
160
|
-
size?: import('
|
|
161
|
-
sticky?: import('
|
|
162
|
-
embed?: import('
|
|
163
|
-
enclosed?: import('
|
|
242
|
+
size?: import('.').TableRootProps["size"];
|
|
243
|
+
sticky?: import('.').TableRootProps["sticky"];
|
|
244
|
+
embed?: import('.').TableRootProps["embed"];
|
|
245
|
+
enclosed?: import('.').TableRootProps["enclosed"];
|
|
164
246
|
} & {
|
|
165
247
|
children?: import('react').ReactNode | undefined;
|
|
166
248
|
}): import("react/jsx-runtime").JSX.Element;
|
package/src/data-table/index.js
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { tableRecipe as e } from "../table/table.js";
|
|
2
|
+
import { Table as t } from "../table/index.js";
|
|
3
|
+
import { DataTablePagination as n, DataTableTable as r, Footer as i, Root as a, ToolBar as o, useDataTable as s } from "./data-table.js";
|
|
3
4
|
//#region src/data-table/index.ts
|
|
4
|
-
var
|
|
5
|
-
Root:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Cell: t,
|
|
11
|
-
ExpandButton: n,
|
|
12
|
-
ExpandedRow: r,
|
|
13
|
-
RowActions: c
|
|
14
|
-
}, _ = {
|
|
15
|
-
Root: p,
|
|
16
|
-
ToolBar: m,
|
|
17
|
-
Table: d,
|
|
18
|
-
Footer: f,
|
|
19
|
-
Pagination: u
|
|
5
|
+
var c = t, l = e, u = {
|
|
6
|
+
Root: a,
|
|
7
|
+
ToolBar: o,
|
|
8
|
+
Table: r,
|
|
9
|
+
Footer: i,
|
|
10
|
+
Pagination: n
|
|
20
11
|
};
|
|
21
12
|
//#endregion
|
|
22
|
-
export {
|
|
13
|
+
export { u as DataTable, c as Table, l as tableRecipe, s as useDataTable };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Downward chevron glyph used by the row expand/collapse button. Rotates 180°
|
|
4
|
+
* when its row is expanded (driven by `data-state=open`). The fill follows
|
|
5
|
+
* `currentColor` so it inherits the button's text color token.
|
|
6
|
+
*
|
|
7
|
+
* @summary 24px chevron-down icon used by the row expand button
|
|
8
|
+
*/
|
|
9
|
+
export declare const IconKeyboardArrowDown: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region src/table/icons.tsx
|
|
3
|
+
var t = (t) => /* @__PURE__ */ e("svg", {
|
|
4
|
+
width: "24",
|
|
5
|
+
height: "24",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "none",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
...t,
|
|
10
|
+
children: /* @__PURE__ */ e("path", {
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
d: "M12 14.677a.83.83 0 0 1-.633-.256L6.873 9.927a.73.73 0 0 1-.212-.522.7.7 0 0 1 .212-.532.72.72 0 0 1 .527-.217q.31 0 .527.217L12 12.946l4.073-4.073a.73.73 0 0 1 .522-.212.7.7 0 0 1 .532.212q.217.217.217.527a.72.72 0 0 1-.217.527l-4.494 4.494a.83.83 0 0 1-.633.256"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as IconKeyboardArrowDown };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export { tableRecipe } from './table';
|
|
2
|
+
export type { TableRootProps } from './table';
|
|
3
|
+
export declare const Table: {
|
|
4
|
+
Root: {
|
|
5
|
+
({ children, ref, ...variants }: import('react').PropsWithChildren<import('./table').TableRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
Head: {
|
|
9
|
+
({ children, ...props }: import('react').PropsWithChildren<import('react').HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
Body: {
|
|
13
|
+
({ children, ...props }: import('react').PropsWithChildren<import('react').HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
Row: {
|
|
17
|
+
({ className, ...props }: import('react').ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
Header: {
|
|
21
|
+
({ className, ...props }: import('react').PropsWithChildren<import('react').HTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
Cell: {
|
|
25
|
+
({ className, ...props }: import('react').PropsWithChildren<import('react').TdHTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
ExpandButton: {
|
|
29
|
+
({ toggleExpanded, isExpanded, className, ...props }: {
|
|
30
|
+
toggleExpanded: () => void;
|
|
31
|
+
isExpanded: boolean;
|
|
32
|
+
} & {
|
|
33
|
+
children?: import('react').ReactNode;
|
|
34
|
+
variant?: import('../button').ButtonVariantType;
|
|
35
|
+
size?: import('../button').ButtonSizeType;
|
|
36
|
+
status?: "danger";
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
iconOnly?: boolean;
|
|
40
|
+
rounded?: boolean;
|
|
41
|
+
align?: "center" | "start" | "end" | "justify";
|
|
42
|
+
fitContent?: boolean;
|
|
43
|
+
ref?: import('react').Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
44
|
+
} & import('react').ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
45
|
+
asChild?: boolean;
|
|
46
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
ExpandedRow: {
|
|
50
|
+
({ className, ...props }: import('react').PropsWithChildren<import('react').HTMLAttributes<HTMLTableRowElement>>): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
RowActions: {
|
|
54
|
+
({ children }: import('react').PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Body as e, Cell as t, ExpandButton as n, ExpandedRow as r, Head as i, Header as a, Root as o, Row as s, RowActions as c, tableRecipe as l } from "./table.js";
|
|
2
|
+
//#region src/table/index.ts
|
|
3
|
+
var u = {
|
|
4
|
+
Root: o,
|
|
5
|
+
Head: i,
|
|
6
|
+
Body: e,
|
|
7
|
+
Row: s,
|
|
8
|
+
Header: a,
|
|
9
|
+
Cell: t,
|
|
10
|
+
ExpandButton: n,
|
|
11
|
+
ExpandedRow: r,
|
|
12
|
+
RowActions: c
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { u as Table, l as tableRecipe };
|
|
@@ -100,7 +100,7 @@ export type TableRootProps = TableVariants & {
|
|
|
100
100
|
*
|
|
101
101
|
* @example
|
|
102
102
|
* ```tsx
|
|
103
|
-
* import { Table } from '@agentero/design-system/
|
|
103
|
+
* import { Table } from '@agentero/design-system/table';
|
|
104
104
|
*
|
|
105
105
|
* <Table.Root size="md" sticky="head">
|
|
106
106
|
* <Table.Head>
|
|
@@ -116,7 +116,7 @@ export type TableRootProps = TableVariants & {
|
|
|
116
116
|
* </Table.Root>
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
119
|
-
export declare const
|
|
119
|
+
export declare const Root: {
|
|
120
120
|
({ children, ref, ...variants }: PropsWithChildren<TableRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
121
121
|
displayName: string;
|
|
122
122
|
};
|
|
@@ -125,7 +125,7 @@ export declare const TableRoot: {
|
|
|
125
125
|
*
|
|
126
126
|
* @summary `<thead>` wrapper for header rows
|
|
127
127
|
*/
|
|
128
|
-
export declare const
|
|
128
|
+
export declare const Head: {
|
|
129
129
|
({ children, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
130
130
|
displayName: string;
|
|
131
131
|
};
|
|
@@ -134,7 +134,7 @@ export declare const TableHead: {
|
|
|
134
134
|
*
|
|
135
135
|
* @summary `<tbody>` wrapper
|
|
136
136
|
*/
|
|
137
|
-
export declare const
|
|
137
|
+
export declare const Body: {
|
|
138
138
|
({ children, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
139
139
|
displayName: string;
|
|
140
140
|
};
|
|
@@ -144,7 +144,7 @@ export declare const TableBody: {
|
|
|
144
144
|
*
|
|
145
145
|
* @summary Table row element
|
|
146
146
|
*/
|
|
147
|
-
export declare const
|
|
147
|
+
export declare const Row: {
|
|
148
148
|
({ className, ...props }: ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
149
149
|
displayName: string;
|
|
150
150
|
};
|
|
@@ -153,7 +153,7 @@ export declare const TableRow: {
|
|
|
153
153
|
*
|
|
154
154
|
* @summary Header cell element
|
|
155
155
|
*/
|
|
156
|
-
export declare const
|
|
156
|
+
export declare const Header: {
|
|
157
157
|
({ className, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
158
158
|
displayName: string;
|
|
159
159
|
};
|
|
@@ -162,11 +162,11 @@ export declare const TableHeader: {
|
|
|
162
162
|
*
|
|
163
163
|
* @summary Data cell element
|
|
164
164
|
*/
|
|
165
|
-
export declare const
|
|
165
|
+
export declare const Cell: {
|
|
166
166
|
({ className, ...props }: PropsWithChildren<TdHTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
167
167
|
displayName: string;
|
|
168
168
|
};
|
|
169
|
-
type
|
|
169
|
+
type ExpandButtonProps = {
|
|
170
170
|
toggleExpanded: () => void;
|
|
171
171
|
isExpanded: boolean;
|
|
172
172
|
} & ButtonProps;
|
|
@@ -175,8 +175,8 @@ type TableExpandButtonProps = {
|
|
|
175
175
|
*
|
|
176
176
|
* @summary Expand/collapse toggle button for an expandable row
|
|
177
177
|
*/
|
|
178
|
-
export declare const
|
|
179
|
-
({ toggleExpanded, isExpanded, className, ...props }:
|
|
178
|
+
export declare const ExpandButton: {
|
|
179
|
+
({ toggleExpanded, isExpanded, className, ...props }: ExpandButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
180
180
|
displayName: string;
|
|
181
181
|
};
|
|
182
182
|
/**
|
|
@@ -185,7 +185,7 @@ export declare const TableExpandButton: {
|
|
|
185
185
|
*
|
|
186
186
|
* @summary Detail row shown under an expanded parent row
|
|
187
187
|
*/
|
|
188
|
-
export declare const
|
|
188
|
+
export declare const ExpandedRow: {
|
|
189
189
|
({ className, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableRowElement>>): import("react/jsx-runtime").JSX.Element;
|
|
190
190
|
displayName: string;
|
|
191
191
|
};
|
|
@@ -195,7 +195,7 @@ export declare const TableExpandedRow: {
|
|
|
195
195
|
*
|
|
196
196
|
* @summary Hover-revealed row action cluster
|
|
197
197
|
*/
|
|
198
|
-
export declare const
|
|
198
|
+
export declare const RowActions: {
|
|
199
199
|
({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
200
200
|
displayName: string;
|
|
201
201
|
};
|