@devalok/shilp-sutra 0.16.1 → 0.17.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/dist/shell/bottom-navbar.js +13 -13
- package/dist/tailwind/index.cjs +1 -1
- package/dist/tailwind/preset.js +1 -1
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +193 -188
- package/dist/ui/table.js +13 -13
- package/llms-full.txt +154 -0
- package/llms.txt +13 -3
- package/package.json +1 -1
|
@@ -7,14 +7,14 @@ import { IconX as y, IconDots as w } from "@tabler/icons-react";
|
|
|
7
7
|
import { c as s } from "../_chunks/utils.js";
|
|
8
8
|
function k({ count: a }) {
|
|
9
9
|
if (!a || a <= 0) return null;
|
|
10
|
-
const i = a > 99 ? "99+" : String(a),
|
|
10
|
+
const i = a > 99 ? "99+" : String(a), l = a >= 10;
|
|
11
11
|
return /* @__PURE__ */ t(
|
|
12
12
|
"span",
|
|
13
13
|
{
|
|
14
14
|
"aria-label": `${a} notifications`,
|
|
15
15
|
className: s(
|
|
16
|
-
"absolute -right-1
|
|
17
|
-
|
|
16
|
+
"absolute -right-1 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-error text-[10px] font-semibold leading-none text-text-on-color animate-in zoom-in-75",
|
|
17
|
+
l ? "px-0.5" : ""
|
|
18
18
|
),
|
|
19
19
|
children: i
|
|
20
20
|
}
|
|
@@ -23,14 +23,14 @@ function k({ count: a }) {
|
|
|
23
23
|
function M({
|
|
24
24
|
item: a,
|
|
25
25
|
isActive: i,
|
|
26
|
-
onClick:
|
|
26
|
+
onClick: l
|
|
27
27
|
}) {
|
|
28
|
-
const
|
|
28
|
+
const n = f();
|
|
29
29
|
return /* @__PURE__ */ t(
|
|
30
|
-
|
|
30
|
+
n,
|
|
31
31
|
{
|
|
32
32
|
href: a.href,
|
|
33
|
-
onClick:
|
|
33
|
+
onClick: l,
|
|
34
34
|
"aria-label": a.title,
|
|
35
35
|
"aria-current": i ? "page" : void 0,
|
|
36
36
|
className: s(
|
|
@@ -61,12 +61,12 @@ const j = g.forwardRef(
|
|
|
61
61
|
({
|
|
62
62
|
currentPath: a = "/",
|
|
63
63
|
user: i,
|
|
64
|
-
primaryItems:
|
|
65
|
-
moreItems:
|
|
64
|
+
primaryItems: l = [],
|
|
65
|
+
moreItems: n = [],
|
|
66
66
|
className: p,
|
|
67
67
|
...x
|
|
68
68
|
}, b) => {
|
|
69
|
-
const h = f(), [o, d] = N(!1), c = (e, u = !1) => u || e === "/" ? a === e : a.startsWith(e), m =
|
|
69
|
+
const h = f(), [o, d] = N(!1), c = (e, u = !1) => u || e === "/" ? a === e : a.startsWith(e), m = n.some(
|
|
70
70
|
(e) => c(e.href, e.exact)
|
|
71
71
|
);
|
|
72
72
|
return /* @__PURE__ */ r(v, { children: [
|
|
@@ -101,7 +101,7 @@ const j = g.forwardRef(
|
|
|
101
101
|
}
|
|
102
102
|
)
|
|
103
103
|
] }),
|
|
104
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-ds-03", children:
|
|
104
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-ds-03", children: n.map((e) => /* @__PURE__ */ r(
|
|
105
105
|
h,
|
|
106
106
|
{
|
|
107
107
|
href: e.href,
|
|
@@ -134,7 +134,7 @@ const j = g.forwardRef(
|
|
|
134
134
|
p
|
|
135
135
|
),
|
|
136
136
|
children: [
|
|
137
|
-
|
|
137
|
+
l.map((e) => /* @__PURE__ */ t(
|
|
138
138
|
M,
|
|
139
139
|
{
|
|
140
140
|
item: e,
|
|
@@ -142,7 +142,7 @@ const j = g.forwardRef(
|
|
|
142
142
|
},
|
|
143
143
|
e.href
|
|
144
144
|
)),
|
|
145
|
-
|
|
145
|
+
n.length > 0 && /* @__PURE__ */ t(
|
|
146
146
|
"button",
|
|
147
147
|
{
|
|
148
148
|
type: "button",
|
package/dist/tailwind/index.cjs
CHANGED
|
@@ -435,7 +435,7 @@ const a = {
|
|
|
435
435
|
animation: {
|
|
436
436
|
ripple: "ripple var(--duration-slow-01) linear",
|
|
437
437
|
"ripple-icon": "ripple var(--duration-moderate-02) linear forwards",
|
|
438
|
-
shake: "shake
|
|
438
|
+
shake: "shake 0.4s var(--ease-productive-standard) both",
|
|
439
439
|
"progress-indeterminate": "progress-indeterminate var(--duration-slow-02) var(--ease-productive-standard) infinite",
|
|
440
440
|
"skeleton-shimmer": "skeleton-shimmer var(--duration-slow-02) var(--ease-linear) infinite",
|
|
441
441
|
"caret-blink": "caret-blink 1.25s ease-out infinite",
|
package/dist/tailwind/preset.js
CHANGED
|
@@ -435,7 +435,7 @@ const a = {
|
|
|
435
435
|
animation: {
|
|
436
436
|
ripple: "ripple var(--duration-slow-01) linear",
|
|
437
437
|
"ripple-icon": "ripple var(--duration-moderate-02) linear forwards",
|
|
438
|
-
shake: "shake
|
|
438
|
+
shake: "shake 0.4s var(--ease-productive-standard) both",
|
|
439
439
|
"progress-indeterminate": "progress-indeterminate var(--duration-slow-02) var(--ease-productive-standard) infinite",
|
|
440
440
|
"skeleton-shimmer": "skeleton-shimmer var(--duration-slow-02) var(--ease-linear) infinite",
|
|
441
441
|
"caret-blink": "caret-blink 1.25s ease-out infinite",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/ui/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EACL,KAAK,SAAS,EAkBf,MAAM,uBAAuB,CAAA;AAwB9B,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAWrE,yDAAyD;AACzD,MAAM,WAAW,UAAU,CAAC,KAAK;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,IAAI,CAAA;IACxC,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC3B,QAAQ,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AgB,EAChB,UAAkB,EAClB,YAAoB,EACpB,SAAiB,EACjB,QAAQ,EAAE,eAAe,EACzB,eAAe,EACf,UAAkB,EAClB,iBAAiB,EACjB,OAAe,EACf,OAAO,EAAE,cAA2B,EACpC,aAAa,EAAE,oBAAoB,EACnC,QAAgB,EAChB,UAAU,EACV,UAAkB,EAClB,cAAc,EACd,WAAmB,EACnB,gBAAqB,EACrB,SAAe,EACf,MAAM,EACN,UAAU,EACV,OAAe,EACf,WAAW,EACX,gBAAgB,EAChB,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,gBAAgB,EAC5B,YAAoB,EACpB,YAAoB,EACpB,UAAU,EACV,WAAW,GACZ,EAAE,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,2CAoxB/B;yBAtzBe,SAAS"}
|
package/dist/ui/data-table.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { useReactTable as
|
|
5
|
-
import { useVirtualizer as
|
|
6
|
-
import { IconArrowUp as
|
|
7
|
-
import { Table as
|
|
8
|
-
import { B as
|
|
9
|
-
import { C as
|
|
10
|
-
import { Skeleton as
|
|
11
|
-
import { c as
|
|
12
|
-
import { DataTableToolbar as
|
|
13
|
-
const
|
|
3
|
+
import et, { useState as u, useRef as V, useEffect as D, useCallback as j, useMemo as tt } from "react";
|
|
4
|
+
import { useReactTable as lt, getExpandedRowModel as nt, getPaginationRowModel as ot, getFilteredRowModel as st, getSortedRowModel as rt, getCoreRowModel as at, flexRender as te } from "@tanstack/react-table";
|
|
5
|
+
import { useVirtualizer as ct } from "@tanstack/react-virtual";
|
|
6
|
+
import { IconArrowUp as dt, IconArrowDown as it, IconArrowsSort as ut, IconSearch as mt, IconChevronLeft as ft, IconChevronRight as Se, IconX as gt } from "@tabler/icons-react";
|
|
7
|
+
import { Table as pt, TableHeader as ht, TableRow as z, TableHead as Ce, TableBody as O, TableCell as B } from "./table.js";
|
|
8
|
+
import { B as bt } from "../_chunks/button.js";
|
|
9
|
+
import { C as Ne } from "../_chunks/checkbox.js";
|
|
10
|
+
import { Skeleton as we } from "./skeleton.js";
|
|
11
|
+
import { c as r } from "../_chunks/utils.js";
|
|
12
|
+
import { DataTableToolbar as xt } from "./data-table-toolbar.js";
|
|
13
|
+
const yt = {
|
|
14
14
|
compact: "py-ds-02",
|
|
15
15
|
standard: "py-ds-05",
|
|
16
16
|
comfortable: "py-ds-07"
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function St({
|
|
19
19
|
initialValue: A,
|
|
20
20
|
onSave: m,
|
|
21
21
|
onCancel: K
|
|
22
22
|
}) {
|
|
23
|
-
const [I, S] = u(A),
|
|
23
|
+
const [I, S] = u(A), p = V(null);
|
|
24
24
|
D(() => {
|
|
25
25
|
var i, E;
|
|
26
|
-
(i =
|
|
26
|
+
(i = p.current) == null || i.focus(), (E = p.current) == null || E.select();
|
|
27
27
|
}, []);
|
|
28
|
-
const
|
|
28
|
+
const h = j(() => {
|
|
29
29
|
m(I);
|
|
30
30
|
}, [m, I]);
|
|
31
31
|
return /* @__PURE__ */ n(
|
|
32
32
|
"input",
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
34
|
+
ref: p,
|
|
35
35
|
type: "text",
|
|
36
36
|
value: I,
|
|
37
37
|
onChange: (i) => S(i.target.value),
|
|
38
|
-
onBlur:
|
|
38
|
+
onBlur: h,
|
|
39
39
|
onKeyDown: (i) => {
|
|
40
|
-
i.key === "Enter" ? (i.preventDefault(),
|
|
40
|
+
i.key === "Enter" ? (i.preventDefault(), h()) : i.key === "Escape" && (i.preventDefault(), K());
|
|
41
41
|
},
|
|
42
|
-
className:
|
|
42
|
+
className: r(
|
|
43
43
|
"h-ds-xs-plus w-full rounded-ds-md",
|
|
44
44
|
"border border-border-interactive bg-field",
|
|
45
45
|
"px-ds-02 text-ds-sm",
|
|
@@ -50,51 +50,52 @@ function yt({
|
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
53
|
+
const Ct = 'button, a, input, select, textarea, [role="checkbox"]';
|
|
54
|
+
function Nt({
|
|
55
55
|
columns: A,
|
|
56
56
|
data: m,
|
|
57
57
|
className: K,
|
|
58
58
|
noResultsText: I,
|
|
59
59
|
sortable: S = !1,
|
|
60
|
-
filterable:
|
|
61
|
-
globalFilter:
|
|
60
|
+
filterable: p = !1,
|
|
61
|
+
globalFilter: h = !1,
|
|
62
62
|
paginated: i = !1,
|
|
63
63
|
pageSize: E,
|
|
64
|
-
pageSizeOptions:
|
|
64
|
+
pageSizeOptions: ke,
|
|
65
65
|
selectable: C = !1,
|
|
66
66
|
onSelectionChange: G,
|
|
67
|
-
toolbar:
|
|
68
|
-
density:
|
|
67
|
+
toolbar: le = !1,
|
|
68
|
+
density: Re = "standard",
|
|
69
69
|
columnPinning: N,
|
|
70
|
-
editable:
|
|
70
|
+
editable: ze = !1,
|
|
71
71
|
onCellEdit: L,
|
|
72
|
-
expandable:
|
|
73
|
-
renderExpanded:
|
|
72
|
+
expandable: $ = !1,
|
|
73
|
+
renderExpanded: ne,
|
|
74
74
|
virtualRows: b = !1,
|
|
75
|
-
virtualRowHeight:
|
|
76
|
-
maxHeight:
|
|
77
|
-
onSort:
|
|
78
|
-
emptyState:
|
|
79
|
-
loading:
|
|
75
|
+
virtualRowHeight: De = 48,
|
|
76
|
+
maxHeight: Ie = 600,
|
|
77
|
+
onSort: F,
|
|
78
|
+
emptyState: oe,
|
|
79
|
+
loading: Ee = !1,
|
|
80
80
|
selectedIds: Y,
|
|
81
|
-
selectableFilter:
|
|
81
|
+
selectableFilter: se,
|
|
82
82
|
getRowId: g,
|
|
83
83
|
pagination: o,
|
|
84
84
|
singleExpand: U = !1,
|
|
85
|
-
stickyHeader:
|
|
86
|
-
onRowClick:
|
|
87
|
-
bulkActions:
|
|
85
|
+
stickyHeader: Fe = !1,
|
|
86
|
+
onRowClick: T,
|
|
87
|
+
bulkActions: _
|
|
88
88
|
}) {
|
|
89
|
-
const [Te,
|
|
89
|
+
const [Te, re] = u([]), [Me, Ve] = u([]), [W, X] = u(""), [je, q] = u({
|
|
90
90
|
pageIndex: o ? o.page - 1 : 0,
|
|
91
91
|
pageSize: (o == null ? void 0 : o.pageSize) ?? E ?? 10
|
|
92
|
-
}), [x, ae] = u({}), [
|
|
92
|
+
}), [x, ae] = u({}), [$e, _e] = u({}), [ce, He] = u({
|
|
93
93
|
left: (N == null ? void 0 : N.left) ?? [],
|
|
94
94
|
right: (N == null ? void 0 : N.right) ?? []
|
|
95
|
-
}), [
|
|
95
|
+
}), [de, Oe] = u(Re), [w, J] = u(null), [Be, ie] = u({}), ue = V(null), Q = V(!1);
|
|
96
96
|
D(() => {
|
|
97
97
|
if (Y) {
|
|
98
|
+
Q.current = !0;
|
|
98
99
|
const e = {};
|
|
99
100
|
Y.forEach((t) => {
|
|
100
101
|
e[t] = !0;
|
|
@@ -107,17 +108,17 @@ function Ct({
|
|
|
107
108
|
pageSize: o.pageSize
|
|
108
109
|
}));
|
|
109
110
|
}, [o == null ? void 0 : o.page, o == null ? void 0 : o.pageSize]);
|
|
110
|
-
const
|
|
111
|
+
const Ae = j(
|
|
111
112
|
(e) => {
|
|
112
|
-
|
|
113
|
+
re((t) => {
|
|
113
114
|
const l = typeof e == "function" ? e(t) : e;
|
|
114
|
-
return
|
|
115
|
+
return F && (l.length === 0 && t.length > 0 ? F(t[0].id, !1) : l.length > 0 && F(l[0].id, l[0].desc ? "desc" : "asc")), l;
|
|
115
116
|
});
|
|
116
117
|
},
|
|
117
|
-
[
|
|
118
|
-
),
|
|
118
|
+
[F]
|
|
119
|
+
), Ke = j(
|
|
119
120
|
(e) => {
|
|
120
|
-
|
|
121
|
+
ie((t) => {
|
|
121
122
|
const l = typeof e == "function" ? e(t) : e;
|
|
122
123
|
if (!U || l === !0 || typeof l != "object") return l;
|
|
123
124
|
const s = typeof t == "object" ? Object.keys(t).filter((f) => t[f]) : [], R = Object.keys(l).filter((f) => l[f]).filter((f) => !s.includes(f));
|
|
@@ -125,22 +126,22 @@ function Ct({
|
|
|
125
126
|
});
|
|
126
127
|
},
|
|
127
128
|
[U]
|
|
128
|
-
),
|
|
129
|
+
), Z = V(o == null ? void 0 : o.onPageChange);
|
|
129
130
|
D(() => {
|
|
130
|
-
|
|
131
|
+
Z.current = o == null ? void 0 : o.onPageChange;
|
|
131
132
|
}, [o == null ? void 0 : o.onPageChange]);
|
|
132
|
-
const
|
|
133
|
+
const Ge = j(
|
|
133
134
|
(e) => {
|
|
134
135
|
q((t) => {
|
|
135
136
|
const l = typeof e == "function" ? e(t) : e;
|
|
136
|
-
return
|
|
137
|
+
return Z.current && l.pageIndex !== t.pageIndex && Z.current(l.pageIndex + 1), l;
|
|
137
138
|
});
|
|
138
139
|
},
|
|
139
140
|
[]
|
|
140
|
-
),
|
|
141
|
+
), Le = {
|
|
141
142
|
id: "_select",
|
|
142
143
|
header: ({ table: e }) => /* @__PURE__ */ n(
|
|
143
|
-
|
|
144
|
+
Ne,
|
|
144
145
|
{
|
|
145
146
|
checked: e.getIsAllPageRowsSelected(),
|
|
146
147
|
indeterminate: e.getIsSomePageRowsSelected(),
|
|
@@ -149,7 +150,7 @@ function Ct({
|
|
|
149
150
|
}
|
|
150
151
|
),
|
|
151
152
|
cell: ({ row: e }) => /* @__PURE__ */ n(
|
|
152
|
-
|
|
153
|
+
Ne,
|
|
153
154
|
{
|
|
154
155
|
checked: e.getIsSelected(),
|
|
155
156
|
disabled: !e.getCanSelect(),
|
|
@@ -160,7 +161,7 @@ function Ct({
|
|
|
160
161
|
enableSorting: !1,
|
|
161
162
|
enableColumnFilter: !1,
|
|
162
163
|
enableHiding: !1
|
|
163
|
-
},
|
|
164
|
+
}, Ye = {
|
|
164
165
|
id: "_expand",
|
|
165
166
|
header: () => null,
|
|
166
167
|
cell: ({ row: e }) => /* @__PURE__ */ n(
|
|
@@ -171,10 +172,10 @@ function Ct({
|
|
|
171
172
|
"aria-label": e.getIsExpanded() ? "Collapse row" : "Expand row",
|
|
172
173
|
className: "flex items-center justify-center p-ds-01 rounded-ds-sm hover:bg-layer-02 transition-colors",
|
|
173
174
|
children: /* @__PURE__ */ n(
|
|
174
|
-
|
|
175
|
+
Se,
|
|
175
176
|
{
|
|
176
177
|
size: 16,
|
|
177
|
-
className:
|
|
178
|
+
className: r(
|
|
178
179
|
"transition-transform duration-moderate-02",
|
|
179
180
|
e.getIsExpanded() && "rotate-90"
|
|
180
181
|
),
|
|
@@ -187,63 +188,67 @@ function Ct({
|
|
|
187
188
|
enableColumnFilter: !1,
|
|
188
189
|
enableHiding: !1
|
|
189
190
|
}, k = [
|
|
190
|
-
...C ? [
|
|
191
|
-
|
|
191
|
+
...C ? [Le] : [],
|
|
192
|
+
...$ ? [Ye] : [],
|
|
192
193
|
...A
|
|
193
|
-
], M = !!o,
|
|
194
|
-
columnVisibility:
|
|
195
|
-
columnPinning:
|
|
194
|
+
], M = !!o, v = i || M, y = {
|
|
195
|
+
columnVisibility: $e,
|
|
196
|
+
columnPinning: ce
|
|
196
197
|
};
|
|
197
|
-
S && (y.sorting = Te), (
|
|
198
|
-
const
|
|
198
|
+
S && (y.sorting = Te), (p || h) && (y.columnFilters = Me, y.globalFilter = W), v && (y.pagination = je), C && (y.rowSelection = x), $ && (y.expanded = Be);
|
|
199
|
+
const me = S && !!F, a = lt({
|
|
199
200
|
data: m,
|
|
200
201
|
columns: k,
|
|
201
202
|
state: y,
|
|
202
|
-
onColumnVisibilityChange:
|
|
203
|
-
onColumnPinningChange:
|
|
203
|
+
onColumnVisibilityChange: _e,
|
|
204
|
+
onColumnPinningChange: He,
|
|
204
205
|
getCoreRowModel: at(),
|
|
205
206
|
...S && {
|
|
206
|
-
onSortingChange:
|
|
207
|
-
...
|
|
207
|
+
onSortingChange: me ? Ae : re,
|
|
208
|
+
...me ? { manualSorting: !0 } : { getSortedRowModel: rt() }
|
|
208
209
|
},
|
|
209
|
-
...(
|
|
210
|
-
onColumnFiltersChange:
|
|
210
|
+
...(p || h) && {
|
|
211
|
+
onColumnFiltersChange: Ve,
|
|
211
212
|
onGlobalFilterChange: X,
|
|
212
|
-
getFilteredRowModel:
|
|
213
|
+
getFilteredRowModel: st()
|
|
213
214
|
},
|
|
214
|
-
...
|
|
215
|
-
onPaginationChange: M ?
|
|
215
|
+
...v && {
|
|
216
|
+
onPaginationChange: M ? Ge : q,
|
|
216
217
|
...M ? {
|
|
217
218
|
manualPagination: !0,
|
|
218
219
|
pageCount: Math.ceil(
|
|
219
220
|
o.total / o.pageSize
|
|
220
221
|
)
|
|
221
|
-
} : { getPaginationRowModel:
|
|
222
|
+
} : { getPaginationRowModel: ot() }
|
|
222
223
|
},
|
|
223
224
|
...C && {
|
|
224
225
|
onRowSelectionChange: ae,
|
|
225
|
-
enableRowSelection:
|
|
226
|
+
enableRowSelection: se ? (e) => se(e.original) : !0
|
|
226
227
|
},
|
|
227
|
-
|
|
228
|
-
onExpandedChange: U ?
|
|
229
|
-
getExpandedRowModel:
|
|
228
|
+
...$ && {
|
|
229
|
+
onExpandedChange: U ? Ke : ie,
|
|
230
|
+
getExpandedRowModel: nt()
|
|
230
231
|
},
|
|
231
232
|
...g && {
|
|
232
233
|
getRowId: (e) => g(e)
|
|
233
234
|
}
|
|
234
|
-
}),
|
|
235
|
+
}), P = V(G);
|
|
235
236
|
D(() => {
|
|
236
|
-
|
|
237
|
+
P.current = G;
|
|
237
238
|
}, [G]), D(() => {
|
|
238
|
-
if (
|
|
239
|
+
if (Q.current) {
|
|
240
|
+
Q.current = !1;
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (!P.current) return;
|
|
239
244
|
const e = Object.keys(x).filter((l) => x[l]), t = m.filter((l, s) => {
|
|
240
245
|
const c = g ? g(m[s]) : String(s);
|
|
241
246
|
return e.includes(c);
|
|
242
247
|
});
|
|
243
|
-
|
|
248
|
+
P.current(t);
|
|
244
249
|
}, [x, m, g]);
|
|
245
|
-
function
|
|
246
|
-
const { left: t = [], right: l = [] } =
|
|
250
|
+
function fe(e) {
|
|
251
|
+
const { left: t = [], right: l = [] } = ce, s = t.indexOf(e), c = l.indexOf(e);
|
|
247
252
|
return s !== -1 ? {
|
|
248
253
|
className: "sticky bg-layer-01 z-raised",
|
|
249
254
|
style: { left: 0 }
|
|
@@ -252,23 +257,23 @@ function Ct({
|
|
|
252
257
|
style: { right: 0 }
|
|
253
258
|
} : { className: "", style: {} };
|
|
254
259
|
}
|
|
255
|
-
function
|
|
256
|
-
if (!
|
|
257
|
-
const t =
|
|
260
|
+
function Ue(e) {
|
|
261
|
+
if (!ze || e === "_select" || e === "_expand") return !1;
|
|
262
|
+
const t = a.getColumn(e);
|
|
258
263
|
if (!t) return !1;
|
|
259
264
|
const l = t.columnDef.meta;
|
|
260
265
|
return (l == null ? void 0 : l.enableEditing) !== !1;
|
|
261
266
|
}
|
|
262
|
-
const
|
|
263
|
-
count: b ?
|
|
264
|
-
getScrollElement: () =>
|
|
265
|
-
estimateSize: () =>
|
|
267
|
+
const ge = yt[de], H = a.getRowModel().rows, pe = ct({
|
|
268
|
+
count: b ? H.length : 0,
|
|
269
|
+
getScrollElement: () => ue.current,
|
|
270
|
+
estimateSize: () => De,
|
|
266
271
|
overscan: 10
|
|
267
|
-
}),
|
|
272
|
+
}), We = (o == null ? void 0 : o.pageSize) ?? E ?? 5, Xe = k.length, qe = j(
|
|
268
273
|
(e, t) => {
|
|
269
|
-
!
|
|
274
|
+
!T || t.target.closest(Ct) || T(e);
|
|
270
275
|
},
|
|
271
|
-
[
|
|
276
|
+
[T]
|
|
272
277
|
);
|
|
273
278
|
function he(e, t) {
|
|
274
279
|
const l = e.getVisibleCells();
|
|
@@ -277,30 +282,30 @@ function Ct({
|
|
|
277
282
|
{
|
|
278
283
|
"data-state": e.getIsSelected() && "selected",
|
|
279
284
|
style: t,
|
|
280
|
-
className:
|
|
285
|
+
className: r(
|
|
281
286
|
b ? "absolute w-full flex" : void 0,
|
|
282
|
-
|
|
287
|
+
T && "cursor-pointer"
|
|
283
288
|
),
|
|
284
|
-
onClick:
|
|
289
|
+
onClick: T ? (s) => qe(e.original, s) : void 0,
|
|
285
290
|
children: l.map((s) => {
|
|
286
|
-
const c =
|
|
291
|
+
const c = fe(s.column.id), R = (w == null ? void 0 : w.rowIndex) === e.index && (w == null ? void 0 : w.columnId) === s.column.id;
|
|
287
292
|
return /* @__PURE__ */ n(
|
|
288
|
-
|
|
293
|
+
B,
|
|
289
294
|
{
|
|
290
|
-
className:
|
|
291
|
-
|
|
295
|
+
className: r(
|
|
296
|
+
ge,
|
|
292
297
|
c.className,
|
|
293
298
|
b && "flex-1"
|
|
294
299
|
),
|
|
295
300
|
style: c.style,
|
|
296
301
|
onDoubleClick: () => {
|
|
297
|
-
|
|
302
|
+
Ue(s.column.id) && J({
|
|
298
303
|
rowIndex: e.index,
|
|
299
304
|
columnId: s.column.id
|
|
300
305
|
});
|
|
301
306
|
},
|
|
302
307
|
children: R ? /* @__PURE__ */ n(
|
|
303
|
-
|
|
308
|
+
St,
|
|
304
309
|
{
|
|
305
310
|
initialValue: String(s.getValue() ?? ""),
|
|
306
311
|
onSave: (f) => {
|
|
@@ -308,7 +313,7 @@ function Ct({
|
|
|
308
313
|
},
|
|
309
314
|
onCancel: () => J(null)
|
|
310
315
|
}
|
|
311
|
-
) :
|
|
316
|
+
) : te(s.column.columnDef.cell, s.getContext())
|
|
312
317
|
},
|
|
313
318
|
s.id
|
|
314
319
|
);
|
|
@@ -317,68 +322,68 @@ function Ct({
|
|
|
317
322
|
e.id
|
|
318
323
|
);
|
|
319
324
|
}
|
|
320
|
-
function
|
|
321
|
-
return
|
|
325
|
+
function Je(e, t) {
|
|
326
|
+
return !$ || !e.getIsExpanded() || !ne ? null : /* @__PURE__ */ n(
|
|
322
327
|
z,
|
|
323
328
|
{
|
|
324
329
|
style: t,
|
|
325
330
|
className: b ? "absolute w-full flex" : void 0,
|
|
326
331
|
children: /* @__PURE__ */ n(
|
|
327
|
-
|
|
332
|
+
B,
|
|
328
333
|
{
|
|
329
334
|
colSpan: k.length,
|
|
330
|
-
className:
|
|
335
|
+
className: r(
|
|
331
336
|
"bg-layer-02 p-ds-05",
|
|
332
337
|
b && "flex-1"
|
|
333
338
|
),
|
|
334
|
-
children:
|
|
339
|
+
children: ne(e.original)
|
|
335
340
|
}
|
|
336
341
|
)
|
|
337
342
|
},
|
|
338
343
|
`${e.id}-expanded`
|
|
339
344
|
);
|
|
340
345
|
}
|
|
341
|
-
function
|
|
346
|
+
function Qe() {
|
|
342
347
|
const e = ["w-3/4", "w-1/2", "w-2/3", "w-full"];
|
|
343
|
-
return /* @__PURE__ */ n(
|
|
344
|
-
var
|
|
345
|
-
const f = (((
|
|
348
|
+
return /* @__PURE__ */ n(O, { children: Array.from({ length: We }, (t, l) => /* @__PURE__ */ n(z, { children: Array.from({ length: Xe }, (s, c) => {
|
|
349
|
+
var xe, ye;
|
|
350
|
+
const f = (((xe = k[c]) == null ? void 0 : xe.id) ?? ((ye = k[c]) == null ? void 0 : ye.header)) === "_select";
|
|
346
351
|
return /* @__PURE__ */ n(
|
|
347
|
-
|
|
352
|
+
B,
|
|
348
353
|
{
|
|
349
|
-
className:
|
|
350
|
-
children: f ? /* @__PURE__ */ n(
|
|
354
|
+
className: ge,
|
|
355
|
+
children: f ? /* @__PURE__ */ n(we, { variant: "text", className: "h-4 w-4", animation: "pulse" }) : /* @__PURE__ */ n(we, { variant: "text", className: r("h-4", e[c % e.length]), animation: "pulse" })
|
|
351
356
|
},
|
|
352
357
|
`skeleton-${l}-${c}`
|
|
353
358
|
);
|
|
354
359
|
}) }, `skeleton-${l}`)) });
|
|
355
360
|
}
|
|
356
|
-
function
|
|
357
|
-
if (
|
|
358
|
-
return
|
|
359
|
-
if (!
|
|
360
|
-
return /* @__PURE__ */ n(
|
|
361
|
-
|
|
361
|
+
function Ze() {
|
|
362
|
+
if (Ee)
|
|
363
|
+
return Qe();
|
|
364
|
+
if (!H.length)
|
|
365
|
+
return /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(
|
|
366
|
+
B,
|
|
362
367
|
{
|
|
363
368
|
colSpan: k.length,
|
|
364
|
-
className:
|
|
369
|
+
className: r(
|
|
365
370
|
"h-24 text-center",
|
|
366
|
-
!
|
|
371
|
+
!oe && "text-text-tertiary"
|
|
367
372
|
),
|
|
368
|
-
children:
|
|
373
|
+
children: oe || I || "No results."
|
|
369
374
|
}
|
|
370
375
|
) }) });
|
|
371
376
|
if (b) {
|
|
372
|
-
const e =
|
|
377
|
+
const e = pe.getVirtualItems(), t = pe.getTotalSize();
|
|
373
378
|
return /* @__PURE__ */ n(
|
|
374
|
-
|
|
379
|
+
O,
|
|
375
380
|
{
|
|
376
381
|
style: {
|
|
377
382
|
height: `${t}px`,
|
|
378
383
|
position: "relative"
|
|
379
384
|
},
|
|
380
385
|
children: e.map((l) => {
|
|
381
|
-
const s =
|
|
386
|
+
const s = H[l.index];
|
|
382
387
|
return he(s, {
|
|
383
388
|
position: "absolute",
|
|
384
389
|
top: 0,
|
|
@@ -391,30 +396,30 @@ function Ct({
|
|
|
391
396
|
}
|
|
392
397
|
);
|
|
393
398
|
}
|
|
394
|
-
return /* @__PURE__ */ n(
|
|
399
|
+
return /* @__PURE__ */ n(O, { children: H.map((e) => /* @__PURE__ */ d(et.Fragment, { children: [
|
|
395
400
|
he(e),
|
|
396
|
-
|
|
401
|
+
Je(e)
|
|
397
402
|
] }, e.id)) });
|
|
398
403
|
}
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
404
|
+
const ee = tt(() => {
|
|
405
|
+
if (!_ || !C) return [];
|
|
401
406
|
const e = Object.keys(x).filter((t) => x[t]);
|
|
402
407
|
return m.filter((t, l) => {
|
|
403
408
|
const s = g ? g(m[l]) : String(l);
|
|
404
409
|
return e.includes(s);
|
|
405
410
|
});
|
|
406
|
-
}, [
|
|
411
|
+
}, [_, C, x, m, g]), ve = ee.length > 0, Pe = M ? o.total : a.getFilteredRowModel().rows.length, be = /* @__PURE__ */ d(pt, { children: [
|
|
407
412
|
/* @__PURE__ */ d(
|
|
408
413
|
ht,
|
|
409
414
|
{
|
|
410
|
-
className:
|
|
411
|
-
|
|
415
|
+
className: r(
|
|
416
|
+
Fe && "sticky top-0 z-10 bg-surface"
|
|
412
417
|
),
|
|
413
418
|
children: [
|
|
414
|
-
|
|
415
|
-
const l = S && t.column.getCanSort(), s = t.column.getIsSorted(), c =
|
|
419
|
+
a.getHeaderGroups().map((e) => /* @__PURE__ */ n(z, { children: e.headers.map((t) => {
|
|
420
|
+
const l = S && t.column.getCanSort(), s = t.column.getIsSorted(), c = fe(t.column.id);
|
|
416
421
|
return /* @__PURE__ */ n(
|
|
417
|
-
|
|
422
|
+
Ce,
|
|
418
423
|
{
|
|
419
424
|
className: c.className,
|
|
420
425
|
style: c.style,
|
|
@@ -422,7 +427,7 @@ function Ct({
|
|
|
422
427
|
"button",
|
|
423
428
|
{
|
|
424
429
|
type: "button",
|
|
425
|
-
className:
|
|
430
|
+
className: r(
|
|
426
431
|
"flex items-center gap-ds-01 font-medium",
|
|
427
432
|
"cursor-pointer select-none",
|
|
428
433
|
"-ml-ds-01 rounded-ds-sm px-ds-01 py-ds-01",
|
|
@@ -431,24 +436,24 @@ function Ct({
|
|
|
431
436
|
onClick: t.column.getToggleSortingHandler(),
|
|
432
437
|
"aria-label": `Sort by ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
|
|
433
438
|
children: [
|
|
434
|
-
|
|
439
|
+
te(
|
|
435
440
|
t.column.columnDef.header,
|
|
436
441
|
t.getContext()
|
|
437
442
|
),
|
|
438
443
|
s === "asc" ? /* @__PURE__ */ n(
|
|
439
|
-
|
|
444
|
+
dt,
|
|
440
445
|
{
|
|
441
446
|
className: "h-ico-sm w-ico-sm text-text-secondary",
|
|
442
447
|
"aria-hidden": "true"
|
|
443
448
|
}
|
|
444
449
|
) : s === "desc" ? /* @__PURE__ */ n(
|
|
445
|
-
|
|
450
|
+
it,
|
|
446
451
|
{
|
|
447
452
|
className: "h-ico-sm w-ico-sm text-text-secondary",
|
|
448
453
|
"aria-hidden": "true"
|
|
449
454
|
}
|
|
450
455
|
) : /* @__PURE__ */ n(
|
|
451
|
-
|
|
456
|
+
ut,
|
|
452
457
|
{
|
|
453
458
|
className: "h-ico-sm w-ico-sm text-text-tertiary",
|
|
454
459
|
"aria-hidden": "true"
|
|
@@ -456,7 +461,7 @@ function Ct({
|
|
|
456
461
|
)
|
|
457
462
|
]
|
|
458
463
|
}
|
|
459
|
-
) :
|
|
464
|
+
) : te(
|
|
460
465
|
t.column.columnDef.header,
|
|
461
466
|
t.getContext()
|
|
462
467
|
)
|
|
@@ -464,7 +469,7 @@ function Ct({
|
|
|
464
469
|
t.id
|
|
465
470
|
);
|
|
466
471
|
}) }, e.id)),
|
|
467
|
-
|
|
472
|
+
p && a.getHeaderGroups().map((e) => /* @__PURE__ */ n(z, { children: e.headers.map((t) => /* @__PURE__ */ n(Ce, { className: "py-ds-01", children: t.isPlaceholder || t.column.columnDef.enableColumnFilter === !1 ? null : /* @__PURE__ */ n(
|
|
468
473
|
"input",
|
|
469
474
|
{
|
|
470
475
|
type: "text",
|
|
@@ -472,7 +477,7 @@ function Ct({
|
|
|
472
477
|
onChange: (l) => t.column.setFilterValue(l.target.value),
|
|
473
478
|
placeholder: `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : ""}...`,
|
|
474
479
|
"aria-label": `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
|
|
475
|
-
className:
|
|
480
|
+
className: r(
|
|
476
481
|
"h-ds-xs-plus w-full rounded-ds-md",
|
|
477
482
|
"border border-border bg-field",
|
|
478
483
|
"px-ds-02 text-ds-sm",
|
|
@@ -484,23 +489,23 @@ function Ct({
|
|
|
484
489
|
]
|
|
485
490
|
}
|
|
486
491
|
),
|
|
487
|
-
|
|
492
|
+
Ze()
|
|
488
493
|
] });
|
|
489
|
-
return /* @__PURE__ */ d("div", { className:
|
|
490
|
-
|
|
491
|
-
|
|
494
|
+
return /* @__PURE__ */ d("div", { className: r(K), children: [
|
|
495
|
+
le && /* @__PURE__ */ n(
|
|
496
|
+
xt,
|
|
492
497
|
{
|
|
493
|
-
table:
|
|
494
|
-
globalFilter:
|
|
498
|
+
table: a,
|
|
499
|
+
globalFilter: h,
|
|
495
500
|
globalFilterValue: W,
|
|
496
501
|
onGlobalFilterChange: X,
|
|
497
|
-
density:
|
|
498
|
-
onDensityChange:
|
|
502
|
+
density: de,
|
|
503
|
+
onDensityChange: Oe
|
|
499
504
|
}
|
|
500
505
|
),
|
|
501
|
-
|
|
506
|
+
h && !le && /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03 pb-ds-04 border-b border-border-subtle mb-ds-04", children: [
|
|
502
507
|
/* @__PURE__ */ n(
|
|
503
|
-
|
|
508
|
+
mt,
|
|
504
509
|
{
|
|
505
510
|
size: 16,
|
|
506
511
|
className: "text-icon-secondary",
|
|
@@ -515,7 +520,7 @@ function Ct({
|
|
|
515
520
|
onChange: (e) => X(e.target.value),
|
|
516
521
|
placeholder: "Search all columns...",
|
|
517
522
|
"aria-label": "Search all columns",
|
|
518
|
-
className:
|
|
523
|
+
className: r(
|
|
519
524
|
"flex-1 bg-transparent text-ds-md",
|
|
520
525
|
"text-text-primary placeholder:text-text-placeholder",
|
|
521
526
|
"outline-none"
|
|
@@ -526,32 +531,32 @@ function Ct({
|
|
|
526
531
|
b ? /* @__PURE__ */ n(
|
|
527
532
|
"div",
|
|
528
533
|
{
|
|
529
|
-
ref:
|
|
530
|
-
style: { maxHeight: `${
|
|
531
|
-
children:
|
|
534
|
+
ref: ue,
|
|
535
|
+
style: { maxHeight: `${Ie}px`, overflowY: "auto" },
|
|
536
|
+
children: be
|
|
532
537
|
}
|
|
533
|
-
) :
|
|
534
|
-
|
|
538
|
+
) : be,
|
|
539
|
+
v && /* @__PURE__ */ d("div", { className: "flex items-center justify-between px-ds-03 py-ds-04 border-t border-border-subtle", children: [
|
|
535
540
|
/* @__PURE__ */ d("span", { className: "text-ds-sm text-text-secondary", children: [
|
|
536
|
-
|
|
541
|
+
Pe,
|
|
537
542
|
" total rows"
|
|
538
543
|
] }),
|
|
539
544
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
|
|
540
545
|
!M && /* @__PURE__ */ n(
|
|
541
546
|
"select",
|
|
542
547
|
{
|
|
543
|
-
value:
|
|
548
|
+
value: a.getState().pagination.pageSize,
|
|
544
549
|
onChange: (e) => {
|
|
545
|
-
|
|
550
|
+
a.setPageSize(Number(e.target.value));
|
|
546
551
|
},
|
|
547
552
|
"aria-label": "Rows per page",
|
|
548
|
-
className:
|
|
553
|
+
className: r(
|
|
549
554
|
"h-ds-sm rounded-ds-md",
|
|
550
555
|
"border border-border bg-field",
|
|
551
556
|
"px-ds-03 text-ds-sm",
|
|
552
557
|
"text-text-primary"
|
|
553
558
|
),
|
|
554
|
-
children: (
|
|
559
|
+
children: (ke ?? [10, 20, 50, 100]).map((e) => /* @__PURE__ */ d("option", { value: e, children: [
|
|
555
560
|
e,
|
|
556
561
|
" rows"
|
|
557
562
|
] }, e))
|
|
@@ -561,49 +566,49 @@ function Ct({
|
|
|
561
566
|
"button",
|
|
562
567
|
{
|
|
563
568
|
type: "button",
|
|
564
|
-
disabled: !
|
|
565
|
-
onClick: () =>
|
|
569
|
+
disabled: !a.getCanPreviousPage(),
|
|
570
|
+
onClick: () => a.previousPage(),
|
|
566
571
|
"aria-label": "Previous page",
|
|
567
|
-
className:
|
|
572
|
+
className: r(
|
|
568
573
|
"h-ds-sm w-ds-sm flex items-center justify-center",
|
|
569
574
|
"rounded-ds-md border border-border",
|
|
570
575
|
"enabled:hover:bg-layer-02",
|
|
571
576
|
"disabled:opacity-[0.38] disabled:cursor-not-allowed",
|
|
572
577
|
"transition-colors"
|
|
573
578
|
),
|
|
574
|
-
children: /* @__PURE__ */ n(
|
|
579
|
+
children: /* @__PURE__ */ n(ft, { size: 16, "aria-hidden": "true" })
|
|
575
580
|
}
|
|
576
581
|
),
|
|
577
582
|
/* @__PURE__ */ d("span", { className: "text-ds-sm text-text-secondary", children: [
|
|
578
583
|
"Page ",
|
|
579
|
-
|
|
584
|
+
a.getState().pagination.pageIndex + 1,
|
|
580
585
|
" of",
|
|
581
586
|
" ",
|
|
582
|
-
|
|
587
|
+
a.getPageCount()
|
|
583
588
|
] }),
|
|
584
589
|
/* @__PURE__ */ n(
|
|
585
590
|
"button",
|
|
586
591
|
{
|
|
587
592
|
type: "button",
|
|
588
|
-
disabled: !
|
|
589
|
-
onClick: () =>
|
|
593
|
+
disabled: !a.getCanNextPage(),
|
|
594
|
+
onClick: () => a.nextPage(),
|
|
590
595
|
"aria-label": "Next page",
|
|
591
|
-
className:
|
|
596
|
+
className: r(
|
|
592
597
|
"h-ds-sm w-ds-sm flex items-center justify-center",
|
|
593
598
|
"rounded-ds-md border border-border",
|
|
594
599
|
"enabled:hover:bg-layer-02",
|
|
595
600
|
"disabled:opacity-[0.38] disabled:cursor-not-allowed",
|
|
596
601
|
"transition-colors"
|
|
597
602
|
),
|
|
598
|
-
children: /* @__PURE__ */ n(
|
|
603
|
+
children: /* @__PURE__ */ n(Se, { size: 16, "aria-hidden": "true" })
|
|
599
604
|
}
|
|
600
605
|
)
|
|
601
606
|
] })
|
|
602
607
|
] }),
|
|
603
|
-
|
|
608
|
+
_ && C && ve && /* @__PURE__ */ d(
|
|
604
609
|
"div",
|
|
605
610
|
{
|
|
606
|
-
className:
|
|
611
|
+
className: r(
|
|
607
612
|
"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",
|
|
608
613
|
"flex items-center gap-ds-04 px-ds-05 py-ds-03",
|
|
609
614
|
"rounded-ds-lg border border-border bg-surface shadow-lg",
|
|
@@ -613,17 +618,17 @@ function Ct({
|
|
|
613
618
|
"aria-label": "Bulk actions",
|
|
614
619
|
children: [
|
|
615
620
|
/* @__PURE__ */ d("span", { className: "text-ds-sm font-medium text-text-primary whitespace-nowrap", children: [
|
|
616
|
-
|
|
621
|
+
ee.length,
|
|
617
622
|
" selected"
|
|
618
623
|
] }),
|
|
619
624
|
/* @__PURE__ */ n("div", { className: "h-5 w-px bg-border", "aria-hidden": "true" }),
|
|
620
|
-
|
|
621
|
-
|
|
625
|
+
_.map((e) => /* @__PURE__ */ n(
|
|
626
|
+
bt,
|
|
622
627
|
{
|
|
623
628
|
size: "sm",
|
|
624
629
|
variant: e.color === "error" ? "destructive" : "outline",
|
|
625
630
|
disabled: e.disabled,
|
|
626
|
-
onClick: () => e.onClick(
|
|
631
|
+
onClick: () => e.onClick(ee),
|
|
627
632
|
children: e.label
|
|
628
633
|
},
|
|
629
634
|
e.label
|
|
@@ -632,14 +637,14 @@ function Ct({
|
|
|
632
637
|
"button",
|
|
633
638
|
{
|
|
634
639
|
type: "button",
|
|
635
|
-
onClick: () =>
|
|
640
|
+
onClick: () => a.resetRowSelection(),
|
|
636
641
|
"aria-label": "Clear selection",
|
|
637
|
-
className:
|
|
642
|
+
className: r(
|
|
638
643
|
"flex items-center justify-center p-ds-01",
|
|
639
644
|
"rounded-ds-sm hover:bg-layer-02 transition-colors",
|
|
640
645
|
"text-text-secondary hover:text-text-primary"
|
|
641
646
|
),
|
|
642
|
-
children: /* @__PURE__ */ n(
|
|
647
|
+
children: /* @__PURE__ */ n(gt, { size: 16, "aria-hidden": "true" })
|
|
643
648
|
}
|
|
644
649
|
)
|
|
645
650
|
]
|
|
@@ -647,7 +652,7 @@ function Ct({
|
|
|
647
652
|
)
|
|
648
653
|
] });
|
|
649
654
|
}
|
|
650
|
-
|
|
655
|
+
Nt.displayName = "DataTable";
|
|
651
656
|
export {
|
|
652
|
-
|
|
657
|
+
Nt as DataTable
|
|
653
658
|
};
|
package/dist/ui/table.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
3
|
+
import { c as s } from "../_chunks/utils.js";
|
|
4
|
+
const r = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ o(
|
|
5
5
|
"table",
|
|
6
6
|
{
|
|
7
7
|
ref: t,
|
|
8
|
-
className:
|
|
8
|
+
className: s("w-full caption-bottom text-ds-md", e),
|
|
9
9
|
...a
|
|
10
10
|
}
|
|
11
11
|
) }));
|
|
12
|
-
|
|
13
|
-
const d = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o("thead", { ref: t, className:
|
|
12
|
+
r.displayName = "Table";
|
|
13
|
+
const d = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o("thead", { ref: t, className: s("", e), ...a }));
|
|
14
14
|
d.displayName = "TableHeader";
|
|
15
15
|
const c = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
16
16
|
"tbody",
|
|
17
17
|
{
|
|
18
18
|
ref: t,
|
|
19
|
-
className:
|
|
19
|
+
className: s("[&_tr:last-child]:border-0", e),
|
|
20
20
|
...a
|
|
21
21
|
}
|
|
22
22
|
));
|
|
@@ -25,7 +25,7 @@ const m = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
|
25
25
|
"tfoot",
|
|
26
26
|
{
|
|
27
27
|
ref: t,
|
|
28
|
-
className:
|
|
28
|
+
className: s(
|
|
29
29
|
"bg-[color-mix(in_srgb,var(--color-layer-02)_50%,transparent)] font-medium [&>tr]:last:border-b-0",
|
|
30
30
|
e
|
|
31
31
|
),
|
|
@@ -37,7 +37,7 @@ const b = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
|
37
37
|
"tr",
|
|
38
38
|
{
|
|
39
39
|
ref: t,
|
|
40
|
-
className:
|
|
40
|
+
className: s(
|
|
41
41
|
"transition-colors hover:bg-layer-02 data-[state=selected]:bg-interactive-selected",
|
|
42
42
|
e
|
|
43
43
|
),
|
|
@@ -50,7 +50,7 @@ const i = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
|
50
50
|
{
|
|
51
51
|
ref: t,
|
|
52
52
|
scope: "col",
|
|
53
|
-
className:
|
|
53
|
+
className: s(
|
|
54
54
|
"h-ds-md px-ds-03 text-left font-medium text-text-secondary [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
55
55
|
e
|
|
56
56
|
),
|
|
@@ -62,8 +62,8 @@ const f = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
|
62
62
|
"td",
|
|
63
63
|
{
|
|
64
64
|
ref: t,
|
|
65
|
-
className:
|
|
66
|
-
"py-ds-03 px-
|
|
65
|
+
className: s(
|
|
66
|
+
"py-ds-03 px-ds-03 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
67
67
|
e
|
|
68
68
|
),
|
|
69
69
|
...a
|
|
@@ -74,13 +74,13 @@ const n = l.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
|
74
74
|
"caption",
|
|
75
75
|
{
|
|
76
76
|
ref: t,
|
|
77
|
-
className:
|
|
77
|
+
className: s("mt-ds-05 text-ds-md text-text-secondary", e),
|
|
78
78
|
...a
|
|
79
79
|
}
|
|
80
80
|
));
|
|
81
81
|
n.displayName = "TableCaption";
|
|
82
82
|
export {
|
|
83
|
-
|
|
83
|
+
r as Table,
|
|
84
84
|
c as TableBody,
|
|
85
85
|
n as TableCaption,
|
|
86
86
|
f as TableCell,
|
package/llms-full.txt
CHANGED
|
@@ -1481,6 +1481,124 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
1481
1481
|
- Example:
|
|
1482
1482
|
<DateTimePicker value={dateTime} onChange={setDateTime} timeFormat="12h" minuteStep={15} />
|
|
1483
1483
|
|
|
1484
|
+
## TimePicker
|
|
1485
|
+
- Import: @devalok/shilp-sutra/composed/date-picker
|
|
1486
|
+
- Server-safe: No
|
|
1487
|
+
- Props:
|
|
1488
|
+
value: Date | null (time stored as a Date object)
|
|
1489
|
+
onChange: (date: Date) => void
|
|
1490
|
+
format: "12h" | "24h" (default: "12h")
|
|
1491
|
+
minuteStep: number (default: 1) — step interval for minutes column
|
|
1492
|
+
secondStep: number (default: 1) — step interval for seconds column
|
|
1493
|
+
showSeconds: boolean (default: false) — whether to show the seconds column
|
|
1494
|
+
placeholder: string (default: "Pick a time")
|
|
1495
|
+
disabled: boolean (default: false)
|
|
1496
|
+
className: string
|
|
1497
|
+
- Defaults: format="12h", minuteStep=1, secondStep=1, showSeconds=false
|
|
1498
|
+
- Example:
|
|
1499
|
+
<TimePicker value={time} onChange={setTime} format="24h" minuteStep={15} />
|
|
1500
|
+
<TimePicker value={time} onChange={setTime} showSeconds />
|
|
1501
|
+
- Gotchas:
|
|
1502
|
+
- Time is stored inside a Date object — only hours/minutes/seconds are meaningful
|
|
1503
|
+
- Opens as a popover with scrollable columns for hours, minutes, (optional) seconds, and AM/PM
|
|
1504
|
+
- When no value is set, selecting a time part creates a Date from the current date/time
|
|
1505
|
+
|
|
1506
|
+
## CalendarGrid
|
|
1507
|
+
- Import: @devalok/shilp-sutra/composed/date-picker
|
|
1508
|
+
- Server-safe: No
|
|
1509
|
+
- Props:
|
|
1510
|
+
currentMonth: Date (REQUIRED) — which month to display
|
|
1511
|
+
selected: Date | null — single selected date
|
|
1512
|
+
rangeStart: Date | null — range selection start
|
|
1513
|
+
rangeEnd: Date | null — range selection end
|
|
1514
|
+
hoverDate: Date | null — date currently hovered (for range preview)
|
|
1515
|
+
onSelect: (date: Date) => void (REQUIRED) — called when user clicks a date
|
|
1516
|
+
onHover: (date: Date | null) => void — called on mouse enter/leave
|
|
1517
|
+
onMonthChange: (date: Date) => void (REQUIRED) — called for prev/next month navigation
|
|
1518
|
+
onHeaderClick: () => void — called when month/year header is clicked (e.g. to switch to month/year picker view)
|
|
1519
|
+
disabledDates: (date: Date) => boolean
|
|
1520
|
+
minDate: Date
|
|
1521
|
+
maxDate: Date
|
|
1522
|
+
hidePrevNav: boolean — hide previous-month arrow
|
|
1523
|
+
hideNextNav: boolean — hide next-month arrow
|
|
1524
|
+
events: CalendarEvent[] — dot indicators on dates. CalendarEvent: { date: Date, color?: string, label?: string }
|
|
1525
|
+
- Example:
|
|
1526
|
+
<CalendarGrid
|
|
1527
|
+
currentMonth={currentMonth}
|
|
1528
|
+
selected={selectedDate}
|
|
1529
|
+
onSelect={setSelectedDate}
|
|
1530
|
+
onMonthChange={setCurrentMonth}
|
|
1531
|
+
events={[{ date: new Date('2026-03-15'), color: 'var(--color-success)' }]}
|
|
1532
|
+
/>
|
|
1533
|
+
- Gotchas:
|
|
1534
|
+
- This is a low-level building block — prefer DatePicker/DateRangePicker for most use cases
|
|
1535
|
+
- Full keyboard navigation: ArrowLeft/Right/Up/Down, Home/End, Enter/Space
|
|
1536
|
+
- Up to 3 event dots render per day cell
|
|
1537
|
+
|
|
1538
|
+
## YearPicker
|
|
1539
|
+
- Import: @devalok/shilp-sutra/composed/date-picker
|
|
1540
|
+
- Server-safe: No
|
|
1541
|
+
- Props:
|
|
1542
|
+
currentYear: number (REQUIRED) — centers the decade grid
|
|
1543
|
+
selectedYear: number — highlights the selected year
|
|
1544
|
+
onYearSelect: (year: number) => void (REQUIRED)
|
|
1545
|
+
minDate: Date — disables years before this date's year
|
|
1546
|
+
maxDate: Date — disables years after this date's year
|
|
1547
|
+
- Example:
|
|
1548
|
+
<YearPicker currentYear={2026} selectedYear={2026} onYearSelect={handleYear} />
|
|
1549
|
+
- Gotchas:
|
|
1550
|
+
- Displays a 12-year grid (3 columns x 4 rows) based on the decade of currentYear
|
|
1551
|
+
- This is a low-level building block used internally by DatePicker
|
|
1552
|
+
|
|
1553
|
+
## MonthPicker
|
|
1554
|
+
- Import: @devalok/shilp-sutra/composed/date-picker
|
|
1555
|
+
- Server-safe: No
|
|
1556
|
+
- Props:
|
|
1557
|
+
currentYear: number (REQUIRED) — which year's months to display
|
|
1558
|
+
selectedMonth: number (0-11) — highlights the selected month
|
|
1559
|
+
onMonthSelect: (month: number) => void (REQUIRED) — returns 0-11
|
|
1560
|
+
minDate: Date — disables months before this date
|
|
1561
|
+
maxDate: Date — disables months after this date
|
|
1562
|
+
- Example:
|
|
1563
|
+
<MonthPicker currentYear={2026} selectedMonth={2} onMonthSelect={handleMonth} />
|
|
1564
|
+
- Gotchas:
|
|
1565
|
+
- Month values are 0-indexed (Jan=0, Dec=11) — same as JavaScript Date.getMonth()
|
|
1566
|
+
- Displays a 4-column grid of abbreviated month names (Jan, Feb, Mar, ...)
|
|
1567
|
+
- This is a low-level building block used internally by DatePicker
|
|
1568
|
+
|
|
1569
|
+
## Presets (Date Range Presets)
|
|
1570
|
+
- Import: @devalok/shilp-sutra/composed/date-picker
|
|
1571
|
+
- Server-safe: No
|
|
1572
|
+
- Types:
|
|
1573
|
+
PresetKey: 'today' | 'yesterday' | 'last7days' | 'last30days' | 'thisMonth' | 'lastMonth' | 'thisYear'
|
|
1574
|
+
- Props:
|
|
1575
|
+
presets: PresetKey[] (REQUIRED) — which preset buttons to show
|
|
1576
|
+
onSelect: (start: Date, end: Date) => void (REQUIRED) — called with the computed date range
|
|
1577
|
+
className: string
|
|
1578
|
+
- Example:
|
|
1579
|
+
<Presets
|
|
1580
|
+
presets={['today', 'last7days', 'last30days', 'thisMonth']}
|
|
1581
|
+
onSelect={(start, end) => setRange({ start, end })}
|
|
1582
|
+
/>
|
|
1583
|
+
- Gotchas:
|
|
1584
|
+
- Typically used alongside DateRangePicker (pass presets prop to DateRangePicker for built-in sidebar)
|
|
1585
|
+
- Each preset computes start-of-day / end-of-day boundaries using date-fns
|
|
1586
|
+
|
|
1587
|
+
## useCalendar
|
|
1588
|
+
- Import: @devalok/shilp-sutra/composed/date-picker
|
|
1589
|
+
- Hook: useCalendar(initialMonth?: Date)
|
|
1590
|
+
- Returns:
|
|
1591
|
+
currentMonth: Date — the current displayed month
|
|
1592
|
+
setCurrentMonth: (date: Date) => void
|
|
1593
|
+
goToPreviousMonth: () => void
|
|
1594
|
+
goToNextMonth: () => void
|
|
1595
|
+
goToMonth: (month: number) => void — 0-indexed month
|
|
1596
|
+
goToYear: (year: number) => void
|
|
1597
|
+
- Example:
|
|
1598
|
+
const { currentMonth, goToNextMonth, goToPreviousMonth, goToMonth, goToYear } = useCalendar()
|
|
1599
|
+
<CalendarGrid currentMonth={currentMonth} onMonthChange={setCurrentMonth} ... />
|
|
1600
|
+
- Gotchas: This is a convenience hook for managing calendar month state — used internally by DatePicker
|
|
1601
|
+
|
|
1484
1602
|
## EmptyState
|
|
1485
1603
|
- Import: @devalok/shilp-sutra/composed/empty-state
|
|
1486
1604
|
- Server-safe: Yes
|
|
@@ -1710,6 +1828,42 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
1710
1828
|
<StatusBadge color="warning" label="In Review" size="sm" />
|
|
1711
1829
|
- Gotchas: When color is set, it takes priority over status for styling
|
|
1712
1830
|
|
|
1831
|
+
## UploadProgress
|
|
1832
|
+
- Import: @devalok/shilp-sutra/composed/upload-progress
|
|
1833
|
+
- Server-safe: No
|
|
1834
|
+
- Types:
|
|
1835
|
+
UploadFile: { id: string, name: string, size: number (bytes), progress?: number (0-100, undefined = indeterminate), status: 'pending' | 'uploading' | 'processing' | 'complete' | 'error', error?: string, previewUrl?: string }
|
|
1836
|
+
- Props:
|
|
1837
|
+
files: UploadFile[] (REQUIRED)
|
|
1838
|
+
onRemove: (fileId: string) => void — called when user cancels/removes a file
|
|
1839
|
+
onRetry: (fileId: string) => void — called when user retries a failed upload
|
|
1840
|
+
onDismissAll: () => void — "Dismiss all" button appears when all files are terminal (complete or error)
|
|
1841
|
+
variant: "default" | "compact" (default: "default") — default = two-line layout with progress bar; compact = single-line layout
|
|
1842
|
+
showSize: boolean (default: true) — show file size (default variant only)
|
|
1843
|
+
className: string
|
|
1844
|
+
- Also exported: formatFileSize(bytes: number) => string — utility to format bytes as human-readable (B, KB, MB, GB)
|
|
1845
|
+
- Defaults: variant="default", showSize=true
|
|
1846
|
+
- Example:
|
|
1847
|
+
<UploadProgress
|
|
1848
|
+
files={[
|
|
1849
|
+
{ id: '1', name: 'report.pdf', size: 1048576, status: 'uploading', progress: 45 },
|
|
1850
|
+
{ id: '2', name: 'photo.jpg', size: 204800, status: 'complete', previewUrl: '/thumb.jpg' },
|
|
1851
|
+
{ id: '3', name: 'data.csv', size: 51200, status: 'error', error: 'Network timeout' },
|
|
1852
|
+
]}
|
|
1853
|
+
onRemove={(id) => removeFile(id)}
|
|
1854
|
+
onRetry={(id) => retryUpload(id)}
|
|
1855
|
+
onDismissAll={() => clearAll()}
|
|
1856
|
+
/>
|
|
1857
|
+
<UploadProgress files={uploads} variant="compact" onRemove={removeFile} />
|
|
1858
|
+
- Gotchas:
|
|
1859
|
+
- Returns null when files array is empty
|
|
1860
|
+
- Summary header shows completion count and error count
|
|
1861
|
+
- Border color changes based on state: green when all complete, red tint when all terminal with errors
|
|
1862
|
+
- File icon auto-detects image files by extension or previewUrl presence
|
|
1863
|
+
- Status 'processing' renders a spinner icon and indeterminate progress
|
|
1864
|
+
- Screen reader announcements via aria-live region for completion/error events
|
|
1865
|
+
- Staggered slide-up animation (30ms delay per file)
|
|
1866
|
+
|
|
1713
1867
|
---
|
|
1714
1868
|
|
|
1715
1869
|
# SHELL COMPONENTS
|
package/llms.txt
CHANGED
|
@@ -185,12 +185,20 @@ NOTIFICATION SELECTION GUIDE:
|
|
|
185
185
|
- EmptyState: icon(ReactNode or ComponentType), title(required), description, action(ReactNode), compact
|
|
186
186
|
- PriorityIndicator: priority(LOW|MEDIUM|HIGH|URGENT) display(compact|full)
|
|
187
187
|
- SimpleTooltip: wraps Tooltip compound into single component
|
|
188
|
-
- DatePicker, DateRangePicker, DateTimePicker
|
|
188
|
+
- DatePicker, DateRangePicker, DateTimePicker
|
|
189
|
+
- TimePicker: standalone time selector — value(Date|null), onChange, format('12h'|'24h'), minuteStep, showSeconds, disabled
|
|
190
|
+
- CalendarGrid: low-level calendar widget — currentMonth, selected, rangeStart/End, onSelect, onMonthChange, events(CalendarEvent[])
|
|
191
|
+
- YearPicker: decade year grid — currentYear, selectedYear, onYearSelect, minDate, maxDate
|
|
192
|
+
- MonthPicker: month grid — currentYear, selectedMonth(0-11), onMonthSelect, minDate, maxDate
|
|
193
|
+
- Presets: date range quick-select buttons — presets(PresetKey[]), onSelect(start, end). Keys: today, yesterday, last7days, last30days, thisMonth, lastMonth, thisYear
|
|
194
|
+
- useCalendar: hook for calendar month state — returns currentMonth, goToPreviousMonth, goToNextMonth, goToMonth, goToYear
|
|
195
|
+
- UploadProgress: file upload tracker — files(UploadFile[]), onRemove, onRetry, onDismissAll, variant(default|compact), showSize. Status: pending|uploading|processing|complete|error. Also exports formatFileSize()
|
|
189
196
|
- RichTextEditor: Tiptap editor — bold/italic/underline/strike/highlight, headings, blockquote, lists (bullet/ordered/task), code, links, images (paste/drop/upload), file attachments, @mentions, emoji picker + :shortcode:, text alignment, HR. Props: onImageUpload?, onFileUpload?, mentions?, onMentionSearch?, onMentionSelect?
|
|
190
197
|
- RichTextViewer: read-only renderer for RichTextEditor HTML content (renders all above content types)
|
|
191
198
|
- CommandPalette, MemberPicker
|
|
192
199
|
- ErrorDisplay, GlobalLoading
|
|
193
|
-
- Loading skeletons: CardSkeleton, TableSkeleton, BoardSkeleton, ListSkeleton
|
|
200
|
+
- Loading skeletons: CardSkeleton, TableSkeleton, BoardSkeleton, ListSkeleton
|
|
201
|
+
- Page skeletons: DashboardSkeleton, ProjectListSkeleton, TaskDetailSkeleton (no props, server-safe)
|
|
194
202
|
|
|
195
203
|
### Shell Components (app-level layout)
|
|
196
204
|
- TopBar: pageTitle, user, onNavigate, onLogout, notificationSlot, mobileLogo, userMenuItems?(UserMenuItem[] — custom items between Profile and theme toggle, supports icon, href, onClick, separator, badge, disabled, color)
|
|
@@ -209,11 +217,13 @@ NOTIFICATION SELECTION GUIDE:
|
|
|
209
217
|
- BottomNavbar: mobile navigation, user is optional (not required to render)
|
|
210
218
|
- NotificationCenter: notifications[], onMarkRead, onMarkAllRead, onNavigate, getNotificationRoute?(returns string|null, fallback null), footerSlot?, emptyState?, headerActions?, popoverClassName?, onDismiss?(id). Notification.actions?: NotificationAction[] for inline buttons (e.g. Approve/Deny)
|
|
211
219
|
- AppCommandPalette: user, isAdmin, onNavigate, onSearch, searchResults, isSearching, onSearchResultSelect
|
|
220
|
+
- LinkProvider: wraps app with router-agnostic Link component — component(ForwardRefComponent), children. useLink() hook returns the Link component.
|
|
212
221
|
|
|
213
222
|
### Hooks
|
|
214
|
-
- useToast(): returns { toast, toasts, dismiss } — toast({ title, description, color })
|
|
223
|
+
- useToast(): returns { toast, toasts, dismiss } — toast({ title, description, color }). Also: import { toast } from '@devalok/shilp-sutra/hooks/use-toast' for imperative usage without hook
|
|
215
224
|
- useColorMode(): returns { colorMode, setColorMode, toggleColorMode }
|
|
216
225
|
- useMobile(): returns boolean (true if viewport < 768px)
|
|
226
|
+
- useLink(): returns router-agnostic Link component from LinkProvider context (shell/link-context)
|
|
217
227
|
|
|
218
228
|
## Server-Safe Components (no "use client")
|
|
219
229
|
|