@devalok/shilp-sutra 0.16.0 → 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 +296 -276
- 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,43 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
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
|
|
2
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
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
11
|
import { c as r } from "../_chunks/utils.js";
|
|
12
|
-
import { DataTableToolbar as
|
|
13
|
-
const
|
|
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
|
|
19
|
-
initialValue:
|
|
20
|
-
onSave:
|
|
21
|
-
onCancel:
|
|
18
|
+
function St({
|
|
19
|
+
initialValue: A,
|
|
20
|
+
onSave: m,
|
|
21
|
+
onCancel: K
|
|
22
22
|
}) {
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
var i,
|
|
26
|
-
(i =
|
|
23
|
+
const [I, S] = u(A), p = V(null);
|
|
24
|
+
D(() => {
|
|
25
|
+
var i, E;
|
|
26
|
+
(i = p.current) == null || i.focus(), (E = p.current) == null || E.select();
|
|
27
27
|
}, []);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
return /* @__PURE__ */
|
|
28
|
+
const h = j(() => {
|
|
29
|
+
m(I);
|
|
30
|
+
}, [m, I]);
|
|
31
|
+
return /* @__PURE__ */ n(
|
|
32
32
|
"input",
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
34
|
+
ref: p,
|
|
35
35
|
type: "text",
|
|
36
|
-
value:
|
|
37
|
-
onChange: (i) =>
|
|
38
|
-
onBlur:
|
|
36
|
+
value: I,
|
|
37
|
+
onChange: (i) => S(i.target.value),
|
|
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
42
|
className: r(
|
|
43
43
|
"h-ds-xs-plus w-full rounded-ds-md",
|
|
@@ -50,93 +50,98 @@ function bt({
|
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
55
|
-
columns:
|
|
56
|
-
data:
|
|
57
|
-
className:
|
|
58
|
-
noResultsText:
|
|
59
|
-
sortable:
|
|
60
|
-
filterable:
|
|
61
|
-
globalFilter:
|
|
53
|
+
const Ct = 'button, a, input, select, textarea, [role="checkbox"]';
|
|
54
|
+
function Nt({
|
|
55
|
+
columns: A,
|
|
56
|
+
data: m,
|
|
57
|
+
className: K,
|
|
58
|
+
noResultsText: I,
|
|
59
|
+
sortable: S = !1,
|
|
60
|
+
filterable: p = !1,
|
|
61
|
+
globalFilter: h = !1,
|
|
62
62
|
paginated: i = !1,
|
|
63
|
-
pageSize:
|
|
64
|
-
pageSizeOptions:
|
|
65
|
-
selectable:
|
|
66
|
-
onSelectionChange:
|
|
67
|
-
toolbar:
|
|
68
|
-
density:
|
|
69
|
-
columnPinning:
|
|
70
|
-
editable:
|
|
71
|
-
onCellEdit:
|
|
72
|
-
expandable:
|
|
73
|
-
renderExpanded:
|
|
74
|
-
virtualRows:
|
|
75
|
-
virtualRowHeight:
|
|
63
|
+
pageSize: E,
|
|
64
|
+
pageSizeOptions: ke,
|
|
65
|
+
selectable: C = !1,
|
|
66
|
+
onSelectionChange: G,
|
|
67
|
+
toolbar: le = !1,
|
|
68
|
+
density: Re = "standard",
|
|
69
|
+
columnPinning: N,
|
|
70
|
+
editable: ze = !1,
|
|
71
|
+
onCellEdit: L,
|
|
72
|
+
expandable: $ = !1,
|
|
73
|
+
renderExpanded: ne,
|
|
74
|
+
virtualRows: b = !1,
|
|
75
|
+
virtualRowHeight: De = 48,
|
|
76
76
|
maxHeight: Ie = 600,
|
|
77
|
-
onSort:
|
|
78
|
-
emptyState:
|
|
79
|
-
loading:
|
|
80
|
-
selectedIds:
|
|
81
|
-
selectableFilter:
|
|
82
|
-
getRowId:
|
|
77
|
+
onSort: F,
|
|
78
|
+
emptyState: oe,
|
|
79
|
+
loading: Ee = !1,
|
|
80
|
+
selectedIds: Y,
|
|
81
|
+
selectableFilter: se,
|
|
82
|
+
getRowId: g,
|
|
83
83
|
pagination: o,
|
|
84
|
-
singleExpand:
|
|
85
|
-
stickyHeader:
|
|
86
|
-
onRowClick:
|
|
87
|
-
bulkActions:
|
|
84
|
+
singleExpand: U = !1,
|
|
85
|
+
stickyHeader: Fe = !1,
|
|
86
|
+
onRowClick: T,
|
|
87
|
+
bulkActions: _
|
|
88
88
|
}) {
|
|
89
|
-
const [
|
|
89
|
+
const [Te, re] = u([]), [Me, Ve] = u([]), [W, X] = u(""), [je, q] = u({
|
|
90
90
|
pageIndex: o ? o.page - 1 : 0,
|
|
91
|
-
pageSize: (o == null ? void 0 : o.pageSize) ??
|
|
92
|
-
}), [
|
|
93
|
-
left: (
|
|
94
|
-
right: (
|
|
95
|
-
}), [
|
|
96
|
-
|
|
97
|
-
if (
|
|
91
|
+
pageSize: (o == null ? void 0 : o.pageSize) ?? E ?? 10
|
|
92
|
+
}), [x, ae] = u({}), [$e, _e] = u({}), [ce, He] = u({
|
|
93
|
+
left: (N == null ? void 0 : N.left) ?? [],
|
|
94
|
+
right: (N == null ? void 0 : N.right) ?? []
|
|
95
|
+
}), [de, Oe] = u(Re), [w, J] = u(null), [Be, ie] = u({}), ue = V(null), Q = V(!1);
|
|
96
|
+
D(() => {
|
|
97
|
+
if (Y) {
|
|
98
|
+
Q.current = !0;
|
|
98
99
|
const e = {};
|
|
99
|
-
|
|
100
|
+
Y.forEach((t) => {
|
|
100
101
|
e[t] = !0;
|
|
101
|
-
}),
|
|
102
|
+
}), ae(e);
|
|
102
103
|
}
|
|
103
|
-
}, [
|
|
104
|
-
o &&
|
|
104
|
+
}, [Y]), D(() => {
|
|
105
|
+
o && q((e) => ({
|
|
105
106
|
...e,
|
|
106
107
|
pageIndex: o.page - 1,
|
|
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
|
-
const
|
|
114
|
-
return
|
|
113
|
+
re((t) => {
|
|
114
|
+
const l = typeof e == "function" ? e(t) : e;
|
|
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
|
-
const
|
|
122
|
-
if (!
|
|
123
|
-
const s = typeof t == "object" ? Object.keys(t).filter((
|
|
124
|
-
return
|
|
121
|
+
ie((t) => {
|
|
122
|
+
const l = typeof e == "function" ? e(t) : e;
|
|
123
|
+
if (!U || l === !0 || typeof l != "object") return l;
|
|
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
|
+
return R.length > 0 ? { [R[R.length - 1]]: !0 } : l;
|
|
125
126
|
});
|
|
126
127
|
},
|
|
127
|
-
[
|
|
128
|
-
),
|
|
128
|
+
[U]
|
|
129
|
+
), Z = V(o == null ? void 0 : o.onPageChange);
|
|
130
|
+
D(() => {
|
|
131
|
+
Z.current = o == null ? void 0 : o.onPageChange;
|
|
132
|
+
}, [o == null ? void 0 : o.onPageChange]);
|
|
133
|
+
const Ge = j(
|
|
129
134
|
(e) => {
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
return
|
|
135
|
+
q((t) => {
|
|
136
|
+
const l = typeof e == "function" ? e(t) : e;
|
|
137
|
+
return Z.current && l.pageIndex !== t.pageIndex && Z.current(l.pageIndex + 1), l;
|
|
133
138
|
});
|
|
134
139
|
},
|
|
135
|
-
[
|
|
136
|
-
),
|
|
140
|
+
[]
|
|
141
|
+
), Le = {
|
|
137
142
|
id: "_select",
|
|
138
|
-
header: ({ table: e }) => /* @__PURE__ */
|
|
139
|
-
|
|
143
|
+
header: ({ table: e }) => /* @__PURE__ */ n(
|
|
144
|
+
Ne,
|
|
140
145
|
{
|
|
141
146
|
checked: e.getIsAllPageRowsSelected(),
|
|
142
147
|
indeterminate: e.getIsSomePageRowsSelected(),
|
|
@@ -144,8 +149,8 @@ function yt({
|
|
|
144
149
|
"aria-label": "Select all rows"
|
|
145
150
|
}
|
|
146
151
|
),
|
|
147
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
148
|
-
|
|
152
|
+
cell: ({ row: e }) => /* @__PURE__ */ n(
|
|
153
|
+
Ne,
|
|
149
154
|
{
|
|
150
155
|
checked: e.getIsSelected(),
|
|
151
156
|
disabled: !e.getCanSelect(),
|
|
@@ -156,18 +161,18 @@ function yt({
|
|
|
156
161
|
enableSorting: !1,
|
|
157
162
|
enableColumnFilter: !1,
|
|
158
163
|
enableHiding: !1
|
|
159
|
-
},
|
|
164
|
+
}, Ye = {
|
|
160
165
|
id: "_expand",
|
|
161
166
|
header: () => null,
|
|
162
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
167
|
+
cell: ({ row: e }) => /* @__PURE__ */ n(
|
|
163
168
|
"button",
|
|
164
169
|
{
|
|
165
170
|
type: "button",
|
|
166
171
|
onClick: () => e.toggleExpanded(),
|
|
167
172
|
"aria-label": e.getIsExpanded() ? "Collapse row" : "Expand row",
|
|
168
173
|
className: "flex items-center justify-center p-ds-01 rounded-ds-sm hover:bg-layer-02 transition-colors",
|
|
169
|
-
children: /* @__PURE__ */
|
|
170
|
-
|
|
174
|
+
children: /* @__PURE__ */ n(
|
|
175
|
+
Se,
|
|
171
176
|
{
|
|
172
177
|
size: 16,
|
|
173
178
|
className: r(
|
|
@@ -182,125 +187,133 @@ function yt({
|
|
|
182
187
|
enableSorting: !1,
|
|
183
188
|
enableColumnFilter: !1,
|
|
184
189
|
enableHiding: !1
|
|
185
|
-
},
|
|
186
|
-
...
|
|
187
|
-
|
|
188
|
-
...
|
|
189
|
-
],
|
|
190
|
-
columnVisibility:
|
|
191
|
-
columnPinning:
|
|
190
|
+
}, k = [
|
|
191
|
+
...C ? [Le] : [],
|
|
192
|
+
...$ ? [Ye] : [],
|
|
193
|
+
...A
|
|
194
|
+
], M = !!o, v = i || M, y = {
|
|
195
|
+
columnVisibility: $e,
|
|
196
|
+
columnPinning: ce
|
|
192
197
|
};
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
data:
|
|
196
|
-
columns:
|
|
197
|
-
state:
|
|
198
|
-
onColumnVisibilityChange:
|
|
199
|
-
onColumnPinningChange:
|
|
200
|
-
getCoreRowModel:
|
|
201
|
-
...
|
|
202
|
-
onSortingChange:
|
|
203
|
-
...
|
|
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({
|
|
200
|
+
data: m,
|
|
201
|
+
columns: k,
|
|
202
|
+
state: y,
|
|
203
|
+
onColumnVisibilityChange: _e,
|
|
204
|
+
onColumnPinningChange: He,
|
|
205
|
+
getCoreRowModel: at(),
|
|
206
|
+
...S && {
|
|
207
|
+
onSortingChange: me ? Ae : re,
|
|
208
|
+
...me ? { manualSorting: !0 } : { getSortedRowModel: rt() }
|
|
204
209
|
},
|
|
205
|
-
...(
|
|
206
|
-
onColumnFiltersChange:
|
|
207
|
-
onGlobalFilterChange:
|
|
208
|
-
getFilteredRowModel:
|
|
210
|
+
...(p || h) && {
|
|
211
|
+
onColumnFiltersChange: Ve,
|
|
212
|
+
onGlobalFilterChange: X,
|
|
213
|
+
getFilteredRowModel: st()
|
|
209
214
|
},
|
|
210
|
-
...
|
|
211
|
-
onPaginationChange:
|
|
212
|
-
...
|
|
215
|
+
...v && {
|
|
216
|
+
onPaginationChange: M ? Ge : q,
|
|
217
|
+
...M ? {
|
|
213
218
|
manualPagination: !0,
|
|
214
219
|
pageCount: Math.ceil(
|
|
215
220
|
o.total / o.pageSize
|
|
216
221
|
)
|
|
217
|
-
} : { getPaginationRowModel:
|
|
222
|
+
} : { getPaginationRowModel: ot() }
|
|
218
223
|
},
|
|
219
|
-
...
|
|
220
|
-
onRowSelectionChange:
|
|
221
|
-
enableRowSelection:
|
|
224
|
+
...C && {
|
|
225
|
+
onRowSelectionChange: ae,
|
|
226
|
+
enableRowSelection: se ? (e) => se(e.original) : !0
|
|
222
227
|
},
|
|
223
|
-
|
|
224
|
-
onExpandedChange:
|
|
225
|
-
getExpandedRowModel:
|
|
228
|
+
...$ && {
|
|
229
|
+
onExpandedChange: U ? Ke : ie,
|
|
230
|
+
getExpandedRowModel: nt()
|
|
226
231
|
},
|
|
227
|
-
...
|
|
228
|
-
getRowId: (e) =>
|
|
232
|
+
...g && {
|
|
233
|
+
getRowId: (e) => g(e)
|
|
229
234
|
}
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
}), P = V(G);
|
|
236
|
+
D(() => {
|
|
237
|
+
P.current = G;
|
|
238
|
+
}, [G]), D(() => {
|
|
239
|
+
if (Q.current) {
|
|
240
|
+
Q.current = !1;
|
|
241
|
+
return;
|
|
235
242
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
243
|
+
if (!P.current) return;
|
|
244
|
+
const e = Object.keys(x).filter((l) => x[l]), t = m.filter((l, s) => {
|
|
245
|
+
const c = g ? g(m[s]) : String(s);
|
|
246
|
+
return e.includes(c);
|
|
247
|
+
});
|
|
248
|
+
P.current(t);
|
|
249
|
+
}, [x, m, g]);
|
|
250
|
+
function fe(e) {
|
|
251
|
+
const { left: t = [], right: l = [] } = ce, s = t.indexOf(e), c = l.indexOf(e);
|
|
239
252
|
return s !== -1 ? {
|
|
240
253
|
className: "sticky bg-layer-01 z-raised",
|
|
241
254
|
style: { left: 0 }
|
|
242
|
-
} :
|
|
255
|
+
} : c !== -1 ? {
|
|
243
256
|
className: "sticky bg-layer-01 z-raised",
|
|
244
257
|
style: { right: 0 }
|
|
245
258
|
} : { className: "", style: {} };
|
|
246
259
|
}
|
|
247
|
-
function
|
|
248
|
-
if (!
|
|
260
|
+
function Ue(e) {
|
|
261
|
+
if (!ze || e === "_select" || e === "_expand") return !1;
|
|
249
262
|
const t = a.getColumn(e);
|
|
250
263
|
if (!t) return !1;
|
|
251
|
-
const
|
|
252
|
-
return (
|
|
264
|
+
const l = t.columnDef.meta;
|
|
265
|
+
return (l == null ? void 0 : l.enableEditing) !== !1;
|
|
253
266
|
}
|
|
254
|
-
const
|
|
255
|
-
count:
|
|
256
|
-
getScrollElement: () =>
|
|
257
|
-
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,
|
|
258
271
|
overscan: 10
|
|
259
|
-
}),
|
|
272
|
+
}), We = (o == null ? void 0 : o.pageSize) ?? E ?? 5, Xe = k.length, qe = j(
|
|
260
273
|
(e, t) => {
|
|
261
|
-
!
|
|
274
|
+
!T || t.target.closest(Ct) || T(e);
|
|
262
275
|
},
|
|
263
|
-
[
|
|
276
|
+
[T]
|
|
264
277
|
);
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
return /* @__PURE__ */
|
|
268
|
-
|
|
278
|
+
function he(e, t) {
|
|
279
|
+
const l = e.getVisibleCells();
|
|
280
|
+
return /* @__PURE__ */ n(
|
|
281
|
+
z,
|
|
269
282
|
{
|
|
270
283
|
"data-state": e.getIsSelected() && "selected",
|
|
271
284
|
style: t,
|
|
272
285
|
className: r(
|
|
273
|
-
|
|
274
|
-
|
|
286
|
+
b ? "absolute w-full flex" : void 0,
|
|
287
|
+
T && "cursor-pointer"
|
|
275
288
|
),
|
|
276
|
-
onClick:
|
|
277
|
-
children:
|
|
278
|
-
const
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
|
|
289
|
+
onClick: T ? (s) => qe(e.original, s) : void 0,
|
|
290
|
+
children: l.map((s) => {
|
|
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;
|
|
292
|
+
return /* @__PURE__ */ n(
|
|
293
|
+
B,
|
|
281
294
|
{
|
|
282
295
|
className: r(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
296
|
+
ge,
|
|
297
|
+
c.className,
|
|
298
|
+
b && "flex-1"
|
|
286
299
|
),
|
|
287
|
-
style:
|
|
300
|
+
style: c.style,
|
|
288
301
|
onDoubleClick: () => {
|
|
289
|
-
|
|
302
|
+
Ue(s.column.id) && J({
|
|
290
303
|
rowIndex: e.index,
|
|
291
304
|
columnId: s.column.id
|
|
292
305
|
});
|
|
293
306
|
},
|
|
294
|
-
children:
|
|
295
|
-
|
|
307
|
+
children: R ? /* @__PURE__ */ n(
|
|
308
|
+
St,
|
|
296
309
|
{
|
|
297
310
|
initialValue: String(s.getValue() ?? ""),
|
|
298
|
-
onSave: (
|
|
299
|
-
|
|
311
|
+
onSave: (f) => {
|
|
312
|
+
L == null || L(e.index, s.column.id, f), J(null);
|
|
300
313
|
},
|
|
301
|
-
onCancel: () =>
|
|
314
|
+
onCancel: () => J(null)
|
|
302
315
|
}
|
|
303
|
-
) :
|
|
316
|
+
) : te(s.column.columnDef.cell, s.getContext())
|
|
304
317
|
},
|
|
305
318
|
s.id
|
|
306
319
|
);
|
|
@@ -309,101 +322,108 @@ function yt({
|
|
|
309
322
|
e.id
|
|
310
323
|
);
|
|
311
324
|
}
|
|
312
|
-
function
|
|
313
|
-
return
|
|
314
|
-
|
|
325
|
+
function Je(e, t) {
|
|
326
|
+
return !$ || !e.getIsExpanded() || !ne ? null : /* @__PURE__ */ n(
|
|
327
|
+
z,
|
|
315
328
|
{
|
|
316
329
|
style: t,
|
|
317
|
-
className:
|
|
318
|
-
children: /* @__PURE__ */
|
|
319
|
-
|
|
330
|
+
className: b ? "absolute w-full flex" : void 0,
|
|
331
|
+
children: /* @__PURE__ */ n(
|
|
332
|
+
B,
|
|
320
333
|
{
|
|
321
|
-
colSpan:
|
|
334
|
+
colSpan: k.length,
|
|
322
335
|
className: r(
|
|
323
336
|
"bg-layer-02 p-ds-05",
|
|
324
|
-
|
|
337
|
+
b && "flex-1"
|
|
325
338
|
),
|
|
326
|
-
children:
|
|
339
|
+
children: ne(e.original)
|
|
327
340
|
}
|
|
328
341
|
)
|
|
329
342
|
},
|
|
330
343
|
`${e.id}-expanded`
|
|
331
344
|
);
|
|
332
345
|
}
|
|
333
|
-
function
|
|
346
|
+
function Qe() {
|
|
334
347
|
const e = ["w-3/4", "w-1/2", "w-2/3", "w-full"];
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
-
var
|
|
337
|
-
const
|
|
338
|
-
return /* @__PURE__ */
|
|
339
|
-
|
|
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";
|
|
351
|
+
return /* @__PURE__ */ n(
|
|
352
|
+
B,
|
|
340
353
|
{
|
|
341
|
-
className:
|
|
342
|
-
children:
|
|
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" })
|
|
343
356
|
},
|
|
344
|
-
`skeleton-${
|
|
357
|
+
`skeleton-${l}-${c}`
|
|
345
358
|
);
|
|
346
|
-
}) }, `skeleton-${
|
|
359
|
+
}) }, `skeleton-${l}`)) });
|
|
347
360
|
}
|
|
348
|
-
function
|
|
349
|
-
if (
|
|
350
|
-
return
|
|
351
|
-
if (!
|
|
352
|
-
return /* @__PURE__ */
|
|
353
|
-
|
|
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,
|
|
354
367
|
{
|
|
355
|
-
colSpan:
|
|
368
|
+
colSpan: k.length,
|
|
356
369
|
className: r(
|
|
357
370
|
"h-24 text-center",
|
|
358
|
-
!
|
|
371
|
+
!oe && "text-text-tertiary"
|
|
359
372
|
),
|
|
360
|
-
children:
|
|
373
|
+
children: oe || I || "No results."
|
|
361
374
|
}
|
|
362
375
|
) }) });
|
|
363
|
-
if (
|
|
364
|
-
const e =
|
|
365
|
-
return /* @__PURE__ */
|
|
366
|
-
|
|
376
|
+
if (b) {
|
|
377
|
+
const e = pe.getVirtualItems(), t = pe.getTotalSize();
|
|
378
|
+
return /* @__PURE__ */ n(
|
|
379
|
+
O,
|
|
367
380
|
{
|
|
368
381
|
style: {
|
|
369
382
|
height: `${t}px`,
|
|
370
383
|
position: "relative"
|
|
371
384
|
},
|
|
372
|
-
children: e.map((
|
|
373
|
-
const s =
|
|
374
|
-
return
|
|
385
|
+
children: e.map((l) => {
|
|
386
|
+
const s = H[l.index];
|
|
387
|
+
return he(s, {
|
|
375
388
|
position: "absolute",
|
|
376
389
|
top: 0,
|
|
377
390
|
left: 0,
|
|
378
391
|
width: "100%",
|
|
379
|
-
height: `${
|
|
380
|
-
transform: `translateY(${
|
|
392
|
+
height: `${l.size}px`,
|
|
393
|
+
transform: `translateY(${l.start}px)`
|
|
381
394
|
});
|
|
382
395
|
})
|
|
383
396
|
}
|
|
384
397
|
);
|
|
385
398
|
}
|
|
386
|
-
return /* @__PURE__ */
|
|
387
|
-
|
|
388
|
-
|
|
399
|
+
return /* @__PURE__ */ n(O, { children: H.map((e) => /* @__PURE__ */ d(et.Fragment, { children: [
|
|
400
|
+
he(e),
|
|
401
|
+
Je(e)
|
|
389
402
|
] }, e.id)) });
|
|
390
403
|
}
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
404
|
+
const ee = tt(() => {
|
|
405
|
+
if (!_ || !C) return [];
|
|
406
|
+
const e = Object.keys(x).filter((t) => x[t]);
|
|
407
|
+
return m.filter((t, l) => {
|
|
408
|
+
const s = g ? g(m[l]) : String(l);
|
|
409
|
+
return e.includes(s);
|
|
410
|
+
});
|
|
411
|
+
}, [_, C, x, m, g]), ve = ee.length > 0, Pe = M ? o.total : a.getFilteredRowModel().rows.length, be = /* @__PURE__ */ d(pt, { children: [
|
|
412
|
+
/* @__PURE__ */ d(
|
|
413
|
+
ht,
|
|
394
414
|
{
|
|
395
415
|
className: r(
|
|
396
|
-
|
|
416
|
+
Fe && "sticky top-0 z-10 bg-surface"
|
|
397
417
|
),
|
|
398
418
|
children: [
|
|
399
|
-
a.getHeaderGroups().map((e) => /* @__PURE__ */
|
|
400
|
-
const
|
|
401
|
-
return /* @__PURE__ */
|
|
402
|
-
|
|
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);
|
|
421
|
+
return /* @__PURE__ */ n(
|
|
422
|
+
Ce,
|
|
403
423
|
{
|
|
404
|
-
className:
|
|
405
|
-
style:
|
|
406
|
-
children: t.isPlaceholder ? null :
|
|
424
|
+
className: c.className,
|
|
425
|
+
style: c.style,
|
|
426
|
+
children: t.isPlaceholder ? null : l ? /* @__PURE__ */ d(
|
|
407
427
|
"button",
|
|
408
428
|
{
|
|
409
429
|
type: "button",
|
|
@@ -416,24 +436,24 @@ function yt({
|
|
|
416
436
|
onClick: t.column.getToggleSortingHandler(),
|
|
417
437
|
"aria-label": `Sort by ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
|
|
418
438
|
children: [
|
|
419
|
-
|
|
439
|
+
te(
|
|
420
440
|
t.column.columnDef.header,
|
|
421
441
|
t.getContext()
|
|
422
442
|
),
|
|
423
|
-
s === "asc" ? /* @__PURE__ */
|
|
424
|
-
|
|
443
|
+
s === "asc" ? /* @__PURE__ */ n(
|
|
444
|
+
dt,
|
|
425
445
|
{
|
|
426
446
|
className: "h-ico-sm w-ico-sm text-text-secondary",
|
|
427
447
|
"aria-hidden": "true"
|
|
428
448
|
}
|
|
429
|
-
) : s === "desc" ? /* @__PURE__ */
|
|
430
|
-
|
|
449
|
+
) : s === "desc" ? /* @__PURE__ */ n(
|
|
450
|
+
it,
|
|
431
451
|
{
|
|
432
452
|
className: "h-ico-sm w-ico-sm text-text-secondary",
|
|
433
453
|
"aria-hidden": "true"
|
|
434
454
|
}
|
|
435
|
-
) : /* @__PURE__ */
|
|
436
|
-
|
|
455
|
+
) : /* @__PURE__ */ n(
|
|
456
|
+
ut,
|
|
437
457
|
{
|
|
438
458
|
className: "h-ico-sm w-ico-sm text-text-tertiary",
|
|
439
459
|
"aria-hidden": "true"
|
|
@@ -441,7 +461,7 @@ function yt({
|
|
|
441
461
|
)
|
|
442
462
|
]
|
|
443
463
|
}
|
|
444
|
-
) :
|
|
464
|
+
) : te(
|
|
445
465
|
t.column.columnDef.header,
|
|
446
466
|
t.getContext()
|
|
447
467
|
)
|
|
@@ -449,12 +469,12 @@ function yt({
|
|
|
449
469
|
t.id
|
|
450
470
|
);
|
|
451
471
|
}) }, e.id)),
|
|
452
|
-
|
|
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(
|
|
453
473
|
"input",
|
|
454
474
|
{
|
|
455
475
|
type: "text",
|
|
456
476
|
value: t.column.getFilterValue() ?? "",
|
|
457
|
-
onChange: (
|
|
477
|
+
onChange: (l) => t.column.setFilterValue(l.target.value),
|
|
458
478
|
placeholder: `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : ""}...`,
|
|
459
479
|
"aria-label": `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
|
|
460
480
|
className: r(
|
|
@@ -469,35 +489,35 @@ function yt({
|
|
|
469
489
|
]
|
|
470
490
|
}
|
|
471
491
|
),
|
|
472
|
-
|
|
492
|
+
Ze()
|
|
473
493
|
] });
|
|
474
|
-
return /* @__PURE__ */
|
|
475
|
-
|
|
476
|
-
|
|
494
|
+
return /* @__PURE__ */ d("div", { className: r(K), children: [
|
|
495
|
+
le && /* @__PURE__ */ n(
|
|
496
|
+
xt,
|
|
477
497
|
{
|
|
478
498
|
table: a,
|
|
479
|
-
globalFilter:
|
|
480
|
-
globalFilterValue:
|
|
481
|
-
onGlobalFilterChange:
|
|
482
|
-
density:
|
|
483
|
-
onDensityChange:
|
|
499
|
+
globalFilter: h,
|
|
500
|
+
globalFilterValue: W,
|
|
501
|
+
onGlobalFilterChange: X,
|
|
502
|
+
density: de,
|
|
503
|
+
onDensityChange: Oe
|
|
484
504
|
}
|
|
485
505
|
),
|
|
486
|
-
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
|
|
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: [
|
|
507
|
+
/* @__PURE__ */ n(
|
|
508
|
+
mt,
|
|
489
509
|
{
|
|
490
510
|
size: 16,
|
|
491
511
|
className: "text-icon-secondary",
|
|
492
512
|
"aria-hidden": "true"
|
|
493
513
|
}
|
|
494
514
|
),
|
|
495
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ n(
|
|
496
516
|
"input",
|
|
497
517
|
{
|
|
498
518
|
type: "text",
|
|
499
|
-
value:
|
|
500
|
-
onChange: (e) =>
|
|
519
|
+
value: W,
|
|
520
|
+
onChange: (e) => X(e.target.value),
|
|
501
521
|
placeholder: "Search all columns...",
|
|
502
522
|
"aria-label": "Search all columns",
|
|
503
523
|
className: r(
|
|
@@ -508,21 +528,21 @@ function yt({
|
|
|
508
528
|
}
|
|
509
529
|
)
|
|
510
530
|
] }),
|
|
511
|
-
|
|
531
|
+
b ? /* @__PURE__ */ n(
|
|
512
532
|
"div",
|
|
513
533
|
{
|
|
514
|
-
ref:
|
|
534
|
+
ref: ue,
|
|
515
535
|
style: { maxHeight: `${Ie}px`, overflowY: "auto" },
|
|
516
|
-
children:
|
|
536
|
+
children: be
|
|
517
537
|
}
|
|
518
|
-
) :
|
|
519
|
-
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
|
|
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: [
|
|
540
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm text-text-secondary", children: [
|
|
541
|
+
Pe,
|
|
522
542
|
" total rows"
|
|
523
543
|
] }),
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
!
|
|
544
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
|
|
545
|
+
!M && /* @__PURE__ */ n(
|
|
526
546
|
"select",
|
|
527
547
|
{
|
|
528
548
|
value: a.getState().pagination.pageSize,
|
|
@@ -536,13 +556,13 @@ function yt({
|
|
|
536
556
|
"px-ds-03 text-ds-sm",
|
|
537
557
|
"text-text-primary"
|
|
538
558
|
),
|
|
539
|
-
children: (
|
|
559
|
+
children: (ke ?? [10, 20, 50, 100]).map((e) => /* @__PURE__ */ d("option", { value: e, children: [
|
|
540
560
|
e,
|
|
541
561
|
" rows"
|
|
542
562
|
] }, e))
|
|
543
563
|
}
|
|
544
564
|
),
|
|
545
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ n(
|
|
546
566
|
"button",
|
|
547
567
|
{
|
|
548
568
|
type: "button",
|
|
@@ -556,17 +576,17 @@ function yt({
|
|
|
556
576
|
"disabled:opacity-[0.38] disabled:cursor-not-allowed",
|
|
557
577
|
"transition-colors"
|
|
558
578
|
),
|
|
559
|
-
children: /* @__PURE__ */
|
|
579
|
+
children: /* @__PURE__ */ n(ft, { size: 16, "aria-hidden": "true" })
|
|
560
580
|
}
|
|
561
581
|
),
|
|
562
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm text-text-secondary", children: [
|
|
563
583
|
"Page ",
|
|
564
584
|
a.getState().pagination.pageIndex + 1,
|
|
565
585
|
" of",
|
|
566
586
|
" ",
|
|
567
587
|
a.getPageCount()
|
|
568
588
|
] }),
|
|
569
|
-
/* @__PURE__ */
|
|
589
|
+
/* @__PURE__ */ n(
|
|
570
590
|
"button",
|
|
571
591
|
{
|
|
572
592
|
type: "button",
|
|
@@ -580,12 +600,12 @@ function yt({
|
|
|
580
600
|
"disabled:opacity-[0.38] disabled:cursor-not-allowed",
|
|
581
601
|
"transition-colors"
|
|
582
602
|
),
|
|
583
|
-
children: /* @__PURE__ */
|
|
603
|
+
children: /* @__PURE__ */ n(Se, { size: 16, "aria-hidden": "true" })
|
|
584
604
|
}
|
|
585
605
|
)
|
|
586
606
|
] })
|
|
587
607
|
] }),
|
|
588
|
-
|
|
608
|
+
_ && C && ve && /* @__PURE__ */ d(
|
|
589
609
|
"div",
|
|
590
610
|
{
|
|
591
611
|
className: r(
|
|
@@ -597,23 +617,23 @@ function yt({
|
|
|
597
617
|
role: "toolbar",
|
|
598
618
|
"aria-label": "Bulk actions",
|
|
599
619
|
children: [
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
|
|
620
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm font-medium text-text-primary whitespace-nowrap", children: [
|
|
621
|
+
ee.length,
|
|
602
622
|
" selected"
|
|
603
623
|
] }),
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
-
|
|
606
|
-
|
|
624
|
+
/* @__PURE__ */ n("div", { className: "h-5 w-px bg-border", "aria-hidden": "true" }),
|
|
625
|
+
_.map((e) => /* @__PURE__ */ n(
|
|
626
|
+
bt,
|
|
607
627
|
{
|
|
608
628
|
size: "sm",
|
|
609
629
|
variant: e.color === "error" ? "destructive" : "outline",
|
|
610
630
|
disabled: e.disabled,
|
|
611
|
-
onClick: () => e.onClick(
|
|
631
|
+
onClick: () => e.onClick(ee),
|
|
612
632
|
children: e.label
|
|
613
633
|
},
|
|
614
634
|
e.label
|
|
615
635
|
)),
|
|
616
|
-
/* @__PURE__ */
|
|
636
|
+
/* @__PURE__ */ n(
|
|
617
637
|
"button",
|
|
618
638
|
{
|
|
619
639
|
type: "button",
|
|
@@ -624,7 +644,7 @@ function yt({
|
|
|
624
644
|
"rounded-ds-sm hover:bg-layer-02 transition-colors",
|
|
625
645
|
"text-text-secondary hover:text-text-primary"
|
|
626
646
|
),
|
|
627
|
-
children: /* @__PURE__ */
|
|
647
|
+
children: /* @__PURE__ */ n(gt, { size: 16, "aria-hidden": "true" })
|
|
628
648
|
}
|
|
629
649
|
)
|
|
630
650
|
]
|
|
@@ -632,7 +652,7 @@ function yt({
|
|
|
632
652
|
)
|
|
633
653
|
] });
|
|
634
654
|
}
|
|
635
|
-
|
|
655
|
+
Nt.displayName = "DataTable";
|
|
636
656
|
export {
|
|
637
|
-
|
|
657
|
+
Nt as DataTable
|
|
638
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
|
|