@knkcs/anker 0.0.1 → 0.0.3
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/atoms/index.d.ts +48 -12
- package/dist/atoms/index.js +77 -49
- package/dist/atoms/index.js.map +1 -1
- package/dist/{chunk-FGKGX4UF.js → chunk-7UJ4QEUW.js} +4 -3
- package/dist/chunk-7UJ4QEUW.js.map +1 -0
- package/dist/chunk-C4JI3JNA.js +147 -0
- package/dist/chunk-C4JI3JNA.js.map +1 -0
- package/dist/chunk-GJTQLZ4O.js +73 -0
- package/dist/chunk-GJTQLZ4O.js.map +1 -0
- package/dist/chunk-NJFF6S77.js +108 -0
- package/dist/chunk-NJFF6S77.js.map +1 -0
- package/dist/chunk-QU3FF5WI.js +36 -0
- package/dist/chunk-QU3FF5WI.js.map +1 -0
- package/dist/{chunk-4D3EY2W2.js → chunk-YSFUGIQM.js} +388 -34
- package/dist/chunk-YSFUGIQM.js.map +1 -0
- package/dist/components/index.d.ts +125 -12
- package/dist/components/index.js +292 -50
- package/dist/components/index.js.map +1 -1
- package/dist/forms/index.d.ts +2 -13
- package/dist/forms/index.js +81 -119
- package/dist/forms/index.js.map +1 -1
- package/dist/primitives/index.d.ts +142 -90
- package/dist/primitives/index.js +38 -116
- package/dist/primitives/index.js.map +1 -1
- package/dist/theme/index.d.ts +80 -8
- package/dist/theme/index.js +1 -1
- package/package.json +5 -1
- package/dist/chunk-4D3EY2W2.js.map +0 -1
- package/dist/chunk-4T32UC26.js +0 -81
- package/dist/chunk-4T32UC26.js.map +0 -1
- package/dist/chunk-FGKGX4UF.js.map +0 -1
- package/dist/chunk-QSCNXHMU.js +0 -32
- package/dist/chunk-QSCNXHMU.js.map +0 -1
- package/dist/chunk-YXTW5OAJ.js +0 -303
- package/dist/chunk-YXTW5OAJ.js.map +0 -1
package/dist/components/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { Skeleton } from '../chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { HStack, Code, Box as Box$1, VStack, Text as Text$1, Link, Skeleton } from '../chunk-7UJ4QEUW.js';
|
|
2
|
+
import { IconButton, formatRelativeDateTime, Button, StatusBadge } from '../chunk-GJTQLZ4O.js';
|
|
3
|
+
import { Tooltip, MenuRoot, MenuTrigger, MenuContent, MenuItem } from '../chunk-NJFF6S77.js';
|
|
3
4
|
import { Switch } from '../chunk-RJPEVNMJ.js';
|
|
4
|
-
import { createContext, Timeline, TreeView, Card as Card$1, Heading, Box, Flex, Grid, GridItem, Text, Menu, Portal, HStack
|
|
5
|
+
import { createContext, Timeline, TreeView, Card as Card$1, Heading, Box, Flex, Grid, GridItem, Text, Menu, Portal, HStack as HStack$1, Checkbox, Table, Drawer, Spacer, ButtonGroup, Collapsible, Dialog, Separator, useSlotRecipe, chakra } from '@chakra-ui/react';
|
|
6
|
+
export { createTreeCollection } from '@chakra-ui/react';
|
|
5
7
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
|
-
import React2, { createContext as createContext$1, Children, useCallback, useContext } from 'react';
|
|
8
|
+
import React2, { createContext as createContext$1, Children, useMemo, useCallback, useContext } from 'react';
|
|
7
9
|
import { Ellipsis, ChevronLeft, ChevronRight, ArrowUp, ArrowDown, ArrowUpDown, X, ChevronDown, Check } from 'lucide-react';
|
|
10
|
+
import dayjs from 'dayjs';
|
|
8
11
|
import { useReactTable, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
9
12
|
|
|
10
13
|
var Card = ({
|
|
@@ -24,7 +27,7 @@ var Card = ({
|
|
|
24
27
|
w: "full",
|
|
25
28
|
height: "full",
|
|
26
29
|
maxW,
|
|
27
|
-
|
|
30
|
+
marginInline: "auto",
|
|
28
31
|
overflow: "hidden",
|
|
29
32
|
...props,
|
|
30
33
|
children: [
|
|
@@ -89,7 +92,7 @@ var CardListItem = ({
|
|
|
89
92
|
Flex,
|
|
90
93
|
{
|
|
91
94
|
role: "row",
|
|
92
|
-
boxShadow: isActive ? "0 0 0 2px
|
|
95
|
+
boxShadow: isActive ? "0 0 0 2px token(colors.accent)" : "sm",
|
|
93
96
|
bg: "bg-surface",
|
|
94
97
|
borderRadius: "lg",
|
|
95
98
|
alignItems: "stretch",
|
|
@@ -106,6 +109,16 @@ var CardListItem = ({
|
|
|
106
109
|
overflow: "hidden",
|
|
107
110
|
onClick: handleItemClick,
|
|
108
111
|
onDoubleClick: handleItemDoubleClick,
|
|
112
|
+
...handleItemClick && {
|
|
113
|
+
role: "button",
|
|
114
|
+
tabIndex: 0,
|
|
115
|
+
onKeyDown: (e) => {
|
|
116
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
handleItemClick();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
109
122
|
children: [
|
|
110
123
|
componentLeft && /* @__PURE__ */ jsx(
|
|
111
124
|
Box,
|
|
@@ -154,6 +167,7 @@ var CardListItem = ({
|
|
|
154
167
|
alignItems: "center",
|
|
155
168
|
justifyContent: "center",
|
|
156
169
|
_hover: { opacity: 0.9 },
|
|
170
|
+
"aria-label": "Row actions",
|
|
157
171
|
children: /* @__PURE__ */ jsx(Ellipsis, { size: 20 })
|
|
158
172
|
}
|
|
159
173
|
),
|
|
@@ -176,6 +190,207 @@ var CardListItem = ({
|
|
|
176
190
|
);
|
|
177
191
|
};
|
|
178
192
|
CardListItem.displayName = "CardListItem";
|
|
193
|
+
var ActionCell = ({ actions }) => {
|
|
194
|
+
return /* @__PURE__ */ jsx(HStack, { gap: 1, children: actions.map((action) => /* @__PURE__ */ jsx(Tooltip, { content: action.label, children: action.href ? /* @__PURE__ */ jsx(
|
|
195
|
+
IconButton,
|
|
196
|
+
{
|
|
197
|
+
"aria-label": action.label,
|
|
198
|
+
size: "sm",
|
|
199
|
+
variant: action.variant ?? "ghost",
|
|
200
|
+
colorPalette: action.colorPalette,
|
|
201
|
+
disabled: action.disabled,
|
|
202
|
+
asChild: true,
|
|
203
|
+
children: /* @__PURE__ */ jsx(
|
|
204
|
+
"a",
|
|
205
|
+
{
|
|
206
|
+
href: action.href,
|
|
207
|
+
download: action.download,
|
|
208
|
+
target: action.target,
|
|
209
|
+
rel: action.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
210
|
+
children: /* @__PURE__ */ jsx(action.icon, { size: 16 })
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
) : /* @__PURE__ */ jsx(
|
|
215
|
+
IconButton,
|
|
216
|
+
{
|
|
217
|
+
"aria-label": action.label,
|
|
218
|
+
size: "sm",
|
|
219
|
+
variant: action.variant ?? "ghost",
|
|
220
|
+
colorPalette: action.colorPalette,
|
|
221
|
+
onClick: action.onClick,
|
|
222
|
+
disabled: action.disabled,
|
|
223
|
+
children: /* @__PURE__ */ jsx(action.icon, { size: 16 })
|
|
224
|
+
}
|
|
225
|
+
) }, action.label)) });
|
|
226
|
+
};
|
|
227
|
+
ActionCell.displayName = "ActionCell";
|
|
228
|
+
|
|
229
|
+
// src/components/data-table/cells/cell-utils.ts
|
|
230
|
+
var emptyCellValue = "\u2014";
|
|
231
|
+
function truncateText(text, maxLength) {
|
|
232
|
+
if (text.length <= maxLength) return text;
|
|
233
|
+
return `${text.slice(0, maxLength)}\u2026`;
|
|
234
|
+
}
|
|
235
|
+
function pluralize(count, singular, plural) {
|
|
236
|
+
return count === 1 ? singular : plural;
|
|
237
|
+
}
|
|
238
|
+
var BooleanCell = ({
|
|
239
|
+
value,
|
|
240
|
+
trueLabel = "Yes",
|
|
241
|
+
falseLabel = "No"
|
|
242
|
+
}) => {
|
|
243
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
244
|
+
return /* @__PURE__ */ jsx("span", { children: value ? trueLabel : falseLabel });
|
|
245
|
+
};
|
|
246
|
+
BooleanCell.displayName = "BooleanCell";
|
|
247
|
+
var CodeCell = ({
|
|
248
|
+
value,
|
|
249
|
+
maxLength = 80
|
|
250
|
+
}) => {
|
|
251
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
252
|
+
const display = truncateText(value, maxLength);
|
|
253
|
+
return /* @__PURE__ */ jsx(Code, { title: value, fontSize: "0.85em", children: display });
|
|
254
|
+
};
|
|
255
|
+
CodeCell.displayName = "CodeCell";
|
|
256
|
+
var ColorSwatchCell = ({ value }) => {
|
|
257
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
258
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: 2, children: [
|
|
259
|
+
/* @__PURE__ */ jsx(
|
|
260
|
+
Box$1,
|
|
261
|
+
{
|
|
262
|
+
width: "1rem",
|
|
263
|
+
height: "1rem",
|
|
264
|
+
borderRadius: "full",
|
|
265
|
+
bg: value,
|
|
266
|
+
borderWidth: "1px",
|
|
267
|
+
borderColor: "border",
|
|
268
|
+
flexShrink: 0
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
/* @__PURE__ */ jsx("span", { children: value })
|
|
272
|
+
] });
|
|
273
|
+
};
|
|
274
|
+
ColorSwatchCell.displayName = "ColorSwatchCell";
|
|
275
|
+
var CountCell = ({
|
|
276
|
+
value,
|
|
277
|
+
singular,
|
|
278
|
+
plural,
|
|
279
|
+
countFn
|
|
280
|
+
}) => {
|
|
281
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
282
|
+
let count;
|
|
283
|
+
if (countFn) {
|
|
284
|
+
count = countFn(value);
|
|
285
|
+
if (!Number.isFinite(count)) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
286
|
+
} else if (typeof value === "number") {
|
|
287
|
+
count = value;
|
|
288
|
+
} else if (Array.isArray(value)) {
|
|
289
|
+
count = value.length;
|
|
290
|
+
} else if (typeof value === "object") {
|
|
291
|
+
count = Object.keys(value).length;
|
|
292
|
+
} else {
|
|
293
|
+
return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
294
|
+
}
|
|
295
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
296
|
+
count,
|
|
297
|
+
" ",
|
|
298
|
+
pluralize(count, singular, plural)
|
|
299
|
+
] });
|
|
300
|
+
};
|
|
301
|
+
CountCell.displayName = "CountCell";
|
|
302
|
+
var DateCell = ({
|
|
303
|
+
value,
|
|
304
|
+
format = "MMM D, YYYY",
|
|
305
|
+
showRelative
|
|
306
|
+
}) => {
|
|
307
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
308
|
+
const parsed = dayjs(value);
|
|
309
|
+
if (!parsed.isValid()) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
310
|
+
const formatted = parsed.format(format);
|
|
311
|
+
if (showRelative) {
|
|
312
|
+
const relative = formatRelativeDateTime(value);
|
|
313
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: formatted, children: /* @__PURE__ */ jsx("span", { children: relative }) });
|
|
314
|
+
}
|
|
315
|
+
return /* @__PURE__ */ jsx("span", { children: formatted });
|
|
316
|
+
};
|
|
317
|
+
DateCell.displayName = "DateCell";
|
|
318
|
+
var NumberCell = ({ value, locale }) => {
|
|
319
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
320
|
+
const num = Number(value);
|
|
321
|
+
const display = Number.isNaN(num) ? String(value) : num.toLocaleString(locale);
|
|
322
|
+
return /* @__PURE__ */ jsx("span", { children: display });
|
|
323
|
+
};
|
|
324
|
+
NumberCell.displayName = "NumberCell";
|
|
325
|
+
var SlugCell = ({ value }) => {
|
|
326
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
327
|
+
return /* @__PURE__ */ jsx(Code, { children: value });
|
|
328
|
+
};
|
|
329
|
+
SlugCell.displayName = "SlugCell";
|
|
330
|
+
var StatusBadgeCell = ({
|
|
331
|
+
value,
|
|
332
|
+
colorMap,
|
|
333
|
+
fallbackColor = "gray",
|
|
334
|
+
detail,
|
|
335
|
+
detailColor = "fg.error"
|
|
336
|
+
}) => {
|
|
337
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
338
|
+
const color = colorMap?.[value] ?? fallbackColor;
|
|
339
|
+
const badge = /* @__PURE__ */ jsx(StatusBadge, { label: value, color });
|
|
340
|
+
if (detail) {
|
|
341
|
+
return /* @__PURE__ */ jsxs(VStack, { align: "start", gap: 0.5, children: [
|
|
342
|
+
badge,
|
|
343
|
+
/* @__PURE__ */ jsx(Text$1, { fontSize: "xs", color: detailColor, children: detail })
|
|
344
|
+
] });
|
|
345
|
+
}
|
|
346
|
+
return badge;
|
|
347
|
+
};
|
|
348
|
+
StatusBadgeCell.displayName = "StatusBadgeCell";
|
|
349
|
+
var SwitchCell = ({
|
|
350
|
+
checked,
|
|
351
|
+
onChange,
|
|
352
|
+
disabled,
|
|
353
|
+
colorPalette = "green",
|
|
354
|
+
label
|
|
355
|
+
}) => {
|
|
356
|
+
return /* @__PURE__ */ jsx(
|
|
357
|
+
Switch,
|
|
358
|
+
{
|
|
359
|
+
checked,
|
|
360
|
+
onCheckedChange: (details) => onChange(!!details.checked),
|
|
361
|
+
disabled,
|
|
362
|
+
colorPalette,
|
|
363
|
+
"aria-label": label,
|
|
364
|
+
onClick: (e) => e.stopPropagation()
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
};
|
|
368
|
+
SwitchCell.displayName = "SwitchCell";
|
|
369
|
+
var TruncatedTextCell = ({
|
|
370
|
+
value,
|
|
371
|
+
maxLength
|
|
372
|
+
}) => {
|
|
373
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
374
|
+
const isTruncated = maxLength != null && value.length > maxLength;
|
|
375
|
+
const display = isTruncated ? truncateText(value, maxLength) : value;
|
|
376
|
+
return /* @__PURE__ */ jsx("span", { title: isTruncated ? value : void 0, children: display });
|
|
377
|
+
};
|
|
378
|
+
TruncatedTextCell.displayName = "TruncatedTextCell";
|
|
379
|
+
var UrlCell = ({ value, label }) => {
|
|
380
|
+
if (value == null) return /* @__PURE__ */ jsx("span", { children: emptyCellValue });
|
|
381
|
+
return /* @__PURE__ */ jsx(
|
|
382
|
+
Link,
|
|
383
|
+
{
|
|
384
|
+
href: value,
|
|
385
|
+
target: "_blank",
|
|
386
|
+
rel: "noopener noreferrer",
|
|
387
|
+
title: value,
|
|
388
|
+
color: "accent",
|
|
389
|
+
children: label || value
|
|
390
|
+
}
|
|
391
|
+
);
|
|
392
|
+
};
|
|
393
|
+
UrlCell.displayName = "UrlCell";
|
|
179
394
|
var Pagination = (props) => {
|
|
180
395
|
const {
|
|
181
396
|
page,
|
|
@@ -189,7 +404,7 @@ var Pagination = (props) => {
|
|
|
189
404
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
190
405
|
const currentPage = Math.min(Math.max(1, page), totalPages);
|
|
191
406
|
const pages = getVisiblePages(currentPage, totalPages, maxVisiblePages);
|
|
192
|
-
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
407
|
+
return /* @__PURE__ */ jsxs(HStack$1, { gap: 1, children: [
|
|
193
408
|
/* @__PURE__ */ jsx(
|
|
194
409
|
IconButton,
|
|
195
410
|
{
|
|
@@ -270,40 +485,47 @@ function DataTableInner(props) {
|
|
|
270
485
|
page,
|
|
271
486
|
pageSize,
|
|
272
487
|
onPageChange,
|
|
273
|
-
variant = "line"
|
|
488
|
+
variant = "line",
|
|
489
|
+
getRowId
|
|
274
490
|
} = props;
|
|
275
|
-
const selectionColumn =
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
491
|
+
const selectionColumn = useMemo(
|
|
492
|
+
() => ({
|
|
493
|
+
id: "_select",
|
|
494
|
+
header: ({ table: table2 }) => /* @__PURE__ */ jsxs(
|
|
495
|
+
Checkbox.Root,
|
|
496
|
+
{
|
|
497
|
+
checked: table2.getIsAllPageRowsSelected() ? true : table2.getIsSomePageRowsSelected() ? "indeterminate" : false,
|
|
498
|
+
onCheckedChange: (details) => table2.toggleAllPageRowsSelected(!!details.checked),
|
|
499
|
+
"aria-label": "Select all rows",
|
|
500
|
+
size: "sm",
|
|
501
|
+
children: [
|
|
502
|
+
/* @__PURE__ */ jsx(Checkbox.HiddenInput, {}),
|
|
503
|
+
/* @__PURE__ */ jsx(Checkbox.Control, {})
|
|
504
|
+
]
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
cell: ({ row }) => /* @__PURE__ */ jsxs(
|
|
508
|
+
Checkbox.Root,
|
|
509
|
+
{
|
|
510
|
+
checked: row.getIsSelected(),
|
|
511
|
+
onCheckedChange: (details) => row.toggleSelected(!!details.checked),
|
|
512
|
+
"aria-label": `Select row ${String(row.index + 1)}`,
|
|
513
|
+
size: "sm",
|
|
514
|
+
onClick: (e) => e.stopPropagation(),
|
|
515
|
+
children: [
|
|
516
|
+
/* @__PURE__ */ jsx(Checkbox.HiddenInput, {}),
|
|
517
|
+
/* @__PURE__ */ jsx(Checkbox.Control, {})
|
|
518
|
+
]
|
|
519
|
+
}
|
|
520
|
+
),
|
|
521
|
+
enableSorting: false
|
|
522
|
+
}),
|
|
523
|
+
[]
|
|
524
|
+
);
|
|
525
|
+
const allColumns = useMemo(
|
|
526
|
+
() => selectable ? [selectionColumn, ...columns] : columns,
|
|
527
|
+
[selectable, selectionColumn, columns]
|
|
528
|
+
);
|
|
307
529
|
const table = useReactTable({
|
|
308
530
|
data,
|
|
309
531
|
columns: allColumns,
|
|
@@ -314,9 +536,10 @@ function DataTableInner(props) {
|
|
|
314
536
|
onSortingChange,
|
|
315
537
|
onRowSelectionChange,
|
|
316
538
|
getCoreRowModel: getCoreRowModel(),
|
|
317
|
-
getSortedRowModel: getSortedRowModel(),
|
|
539
|
+
...onSortingChange === void 0 ? { getSortedRowModel: getSortedRowModel() } : {},
|
|
318
540
|
enableRowSelection: selectable,
|
|
319
|
-
manualSorting: onSortingChange !== void 0
|
|
541
|
+
manualSorting: onSortingChange !== void 0,
|
|
542
|
+
...getRowId !== void 0 ? { getRowId } : {}
|
|
320
543
|
});
|
|
321
544
|
const hasPagination = total !== void 0 && page !== void 0 && pageSize !== void 0 && onPageChange !== void 0;
|
|
322
545
|
const isEmpty = !loading && data.length === 0;
|
|
@@ -332,6 +555,14 @@ function DataTableInner(props) {
|
|
|
332
555
|
onClick: canSort ? header.column.getToggleSortingHandler() : void 0,
|
|
333
556
|
"aria-sort": sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : canSort ? "none" : void 0,
|
|
334
557
|
userSelect: canSort ? "none" : void 0,
|
|
558
|
+
tabIndex: canSort ? 0 : void 0,
|
|
559
|
+
role: canSort ? "button" : void 0,
|
|
560
|
+
onKeyDown: canSort ? (e) => {
|
|
561
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
562
|
+
e.preventDefault();
|
|
563
|
+
header.column.getToggleSortingHandler()?.(e);
|
|
564
|
+
}
|
|
565
|
+
} : void 0,
|
|
335
566
|
children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 1, children: [
|
|
336
567
|
header.isPlaceholder ? null : flexRender(
|
|
337
568
|
header.column.columnDef.header,
|
|
@@ -353,6 +584,14 @@ function DataTableInner(props) {
|
|
|
353
584
|
"data-selected": row.getIsSelected() || void 0,
|
|
354
585
|
cursor: onRowClick ? "pointer" : void 0,
|
|
355
586
|
onClick: onRowClick ? () => onRowClick(row.original) : void 0,
|
|
587
|
+
tabIndex: onRowClick ? 0 : void 0,
|
|
588
|
+
role: onRowClick ? "button" : void 0,
|
|
589
|
+
onKeyDown: onRowClick ? (e) => {
|
|
590
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
591
|
+
e.preventDefault();
|
|
592
|
+
onRowClick(row.original);
|
|
593
|
+
}
|
|
594
|
+
} : void 0,
|
|
356
595
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(Table.Cell, { children: flexRender(
|
|
357
596
|
cell.column.columnDef.cell,
|
|
358
597
|
cell.getContext()
|
|
@@ -495,7 +734,7 @@ var FactBox = (props) => {
|
|
|
495
734
|
alignItems: { md: "center" },
|
|
496
735
|
justifyContent: { md: "space-between" },
|
|
497
736
|
children: [
|
|
498
|
-
/* @__PURE__ */ jsx(Box, { minW: 0, flex: "1 1 0%", children: /* @__PURE__ */ jsxs(HStack, { children: [
|
|
737
|
+
/* @__PURE__ */ jsx(Box, { minW: 0, flex: "1 1 0%", children: /* @__PURE__ */ jsxs(HStack$1, { children: [
|
|
499
738
|
/* @__PURE__ */ jsx(
|
|
500
739
|
IconButton,
|
|
501
740
|
{
|
|
@@ -522,8 +761,8 @@ var FactBox = (props) => {
|
|
|
522
761
|
children: action.icon
|
|
523
762
|
},
|
|
524
763
|
action.id
|
|
525
|
-
) : /* @__PURE__ */ jsxs(
|
|
526
|
-
/* @__PURE__ */ jsx(
|
|
764
|
+
) : /* @__PURE__ */ jsxs(MenuRoot, { children: [
|
|
765
|
+
/* @__PURE__ */ jsx(MenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
527
766
|
IconButton,
|
|
528
767
|
{
|
|
529
768
|
"aria-label": action.ariaLabel,
|
|
@@ -532,8 +771,8 @@ var FactBox = (props) => {
|
|
|
532
771
|
children: action.icon
|
|
533
772
|
}
|
|
534
773
|
) }),
|
|
535
|
-
/* @__PURE__ */ jsx(
|
|
536
|
-
|
|
774
|
+
/* @__PURE__ */ jsx(MenuContent, { children: action.items?.map((item) => /* @__PURE__ */ jsxs(
|
|
775
|
+
MenuItem,
|
|
537
776
|
{
|
|
538
777
|
onSelect: item.onSelect,
|
|
539
778
|
"aria-label": item.ariaLabel,
|
|
@@ -544,7 +783,7 @@ var FactBox = (props) => {
|
|
|
544
783
|
]
|
|
545
784
|
},
|
|
546
785
|
item.id
|
|
547
|
-
)) })
|
|
786
|
+
)) })
|
|
548
787
|
] }, action.id)
|
|
549
788
|
) }) }) : null
|
|
550
789
|
]
|
|
@@ -743,6 +982,7 @@ var Stepper = ({
|
|
|
743
982
|
const { orientation, children, ...containerProps } = props;
|
|
744
983
|
return /* @__PURE__ */ jsx(StepperContainer, { ref, orientation, ...containerProps, children: /* @__PURE__ */ jsx(StepperSteps, { orientation, children }) });
|
|
745
984
|
};
|
|
985
|
+
Stepper.displayName = "Stepper";
|
|
746
986
|
var StepperContainer = ({
|
|
747
987
|
ref,
|
|
748
988
|
...props
|
|
@@ -769,6 +1009,7 @@ var StepperContainer = ({
|
|
|
769
1009
|
}
|
|
770
1010
|
) }) });
|
|
771
1011
|
};
|
|
1012
|
+
StepperContainer.displayName = "StepperContainer";
|
|
772
1013
|
var StepperSteps = (props) => {
|
|
773
1014
|
const {
|
|
774
1015
|
children,
|
|
@@ -956,6 +1197,7 @@ TreeViewItemText.displayName = "TreeViewItemText";
|
|
|
956
1197
|
var TreeViewItemIndicator = TreeView.ItemIndicator;
|
|
957
1198
|
TreeViewItemIndicator.displayName = "TreeViewItemIndicator";
|
|
958
1199
|
var TreeViewNode = TreeView.Node;
|
|
1200
|
+
TreeViewNode.displayName = "TreeViewNode";
|
|
959
1201
|
var TreeViewLabel = TreeView.Label;
|
|
960
1202
|
TreeViewLabel.displayName = "TreeViewLabel";
|
|
961
1203
|
var Widget = ({
|
|
@@ -965,7 +1207,7 @@ var Widget = ({
|
|
|
965
1207
|
children
|
|
966
1208
|
}) => {
|
|
967
1209
|
return /* @__PURE__ */ jsx(Card$1.Root, { height: "100%", maxW: "auto", overflow: "hidden", bg: "bg-surface", children: /* @__PURE__ */ jsxs(Card$1.Body, { children: [
|
|
968
|
-
/* @__PURE__ */ jsxs(Box, {
|
|
1210
|
+
/* @__PURE__ */ jsxs(Box, { marginBlockEnd: "6", children: [
|
|
969
1211
|
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
|
|
970
1212
|
/* @__PURE__ */ jsx(Text, { fontWeight: "semibold", children: heading }),
|
|
971
1213
|
/* @__PURE__ */ jsx(Box, { color: "subtle", children: icon })
|
|
@@ -977,6 +1219,6 @@ var Widget = ({
|
|
|
977
1219
|
};
|
|
978
1220
|
Widget.displayName = "Widget";
|
|
979
1221
|
|
|
980
|
-
export { Card, CardList, CardListData, CardListItem, DataTable, DrawerRoot, FactBox, LabeledSwitch, Modal, Pagination, Stepper, StepperCompleted, StepperContainer, StepperContent, StepperIcon, StepperProvider, StepperSeparator, StepperStep, StepperStepTitle, StepperSteps, CardList as Table, CardListData as TableData, CardListItem as TableItem, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineRoot, TimelineSeparator, TimelineTitle, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, TreeViewTree, Widget, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
|
1222
|
+
export { ActionCell, BooleanCell, Card, CardList, CardListData, CardListItem, CodeCell, ColorSwatchCell, CountCell, DataTable, DateCell, DrawerRoot, FactBox, LabeledSwitch, Modal, NumberCell, Pagination, SlugCell, StatusBadgeCell, Stepper, StepperCompleted, StepperContainer, StepperContent, StepperIcon, StepperProvider, StepperSeparator, StepperStep, StepperStepTitle, StepperSteps, SwitchCell, CardList as Table, CardListData as TableData, CardListItem as TableItem, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineRoot, TimelineSeparator, TimelineTitle, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, TreeViewTree, TruncatedTextCell, UrlCell, Widget, emptyCellValue, pluralize, truncateText, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
|
981
1223
|
//# sourceMappingURL=index.js.map
|
|
982
1224
|
//# sourceMappingURL=index.js.map
|