@designa8/vibedesign-attio-internal-v1-2-176b 0.1.2 → 0.1.4
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/README.md +1 -1
- package/dist/index.cjs +158 -59
- package/dist/index.js +172 -73
- package/package.json +1 -1
- package/src/atoms/DataTable/DataTable.tsx +27 -3
- package/src/atoms/DataTable/preview.tsx +68 -2
- package/src/atoms/DataTableDesktop/DataTableDesktop.tsx +56 -18
- package/src/atoms/DataTableMobile/DataTableMobile.tsx +117 -45
- package/src/atoms/Wizard/Wizard.tsx +20 -4
- package/src/atoms/Wizard/preview.tsx +98 -50
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-attio-internal-v1-2-176b
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.1.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.1.4**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -3245,6 +3245,7 @@ function DataTableDesktopInner({
|
|
|
3245
3245
|
views,
|
|
3246
3246
|
view,
|
|
3247
3247
|
onViewChange,
|
|
3248
|
+
toolbarStart,
|
|
3248
3249
|
filters = [],
|
|
3249
3250
|
onRemoveFilter,
|
|
3250
3251
|
onClearFilters,
|
|
@@ -3254,7 +3255,11 @@ function DataTableDesktopInner({
|
|
|
3254
3255
|
onSortChange,
|
|
3255
3256
|
selectedIds,
|
|
3256
3257
|
onSelectionChange,
|
|
3258
|
+
onRowClick,
|
|
3259
|
+
countLabel = (count) => `${count} records`,
|
|
3257
3260
|
pageSize = 10,
|
|
3261
|
+
page: pageProp,
|
|
3262
|
+
onPageChange,
|
|
3258
3263
|
emptyTitle = "No companies yet",
|
|
3259
3264
|
emptyDescription = "Import companies to get started.",
|
|
3260
3265
|
importLabel = "Import companies",
|
|
@@ -3275,14 +3280,19 @@ function DataTableDesktopInner({
|
|
|
3275
3280
|
if (selectedIds === void 0) setInnerSel(ids);
|
|
3276
3281
|
onSelectionChange?.(ids);
|
|
3277
3282
|
};
|
|
3278
|
-
const [
|
|
3283
|
+
const [innerPage, setInnerPage] = React33.useState(1);
|
|
3284
|
+
const page = pageProp ?? innerPage;
|
|
3285
|
+
const setPage = (next) => {
|
|
3286
|
+
if (pageProp === void 0) setInnerPage(next);
|
|
3287
|
+
onPageChange?.(next);
|
|
3288
|
+
};
|
|
3279
3289
|
const sorted = React33.useMemo(() => {
|
|
3280
3290
|
if (!sort) return rows;
|
|
3281
3291
|
const out = [...rows].sort((a, b) => compare(a[sort.key], b[sort.key]));
|
|
3282
3292
|
return sort.direction === "descending" ? out.reverse() : out;
|
|
3283
3293
|
}, [rows, sort]);
|
|
3284
3294
|
const pageCount = Math.max(1, Math.ceil(sorted.length / pageSize));
|
|
3285
|
-
const safePage = Math.min(page, pageCount);
|
|
3295
|
+
const safePage = Math.min(Math.max(page, 1), pageCount);
|
|
3286
3296
|
const visible = sorted.slice((safePage - 1) * pageSize, safePage * pageSize);
|
|
3287
3297
|
const allIds = rows.map((r) => r.id);
|
|
3288
3298
|
const allSelected = allIds.length > 0 && allIds.every((id) => selected.includes(id));
|
|
@@ -3296,7 +3306,8 @@ function DataTableDesktopInner({
|
|
|
3296
3306
|
...rest,
|
|
3297
3307
|
children: [
|
|
3298
3308
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-sm border-b border-hairline px-base py-sm", children: [
|
|
3299
|
-
|
|
3309
|
+
toolbarStart ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "min-w-0 flex-1", children: toolbarStart }) : null,
|
|
3310
|
+
views && views.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn31("min-w-0", toolbarStart ? "w-2/5 shrink-0" : "w-2/5"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3300
3311
|
Dropdown,
|
|
3301
3312
|
{
|
|
3302
3313
|
"aria-label": "View",
|
|
@@ -3306,7 +3317,7 @@ function DataTableDesktopInner({
|
|
|
3306
3317
|
onValueChange: onViewChange
|
|
3307
3318
|
}
|
|
3308
3319
|
) }) : null,
|
|
3309
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ml-auto flex items-center gap-xs", children: [
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ml-auto flex shrink-0 items-center gap-xs", children: [
|
|
3310
3321
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "relative inline-flex", children: [
|
|
3311
3322
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3312
3323
|
IconButton,
|
|
@@ -3376,24 +3387,38 @@ function DataTableDesktopInner({
|
|
|
3376
3387
|
c.key
|
|
3377
3388
|
))
|
|
3378
3389
|
] }) }),
|
|
3379
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("tbody", { children: visible.map((row) =>
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3390
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("tbody", { children: visible.map((row) => {
|
|
3391
|
+
const rowLabel = labelKey ? String(row[labelKey] ?? row.id) : row.id;
|
|
3392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3393
|
+
TableRow,
|
|
3394
|
+
{
|
|
3395
|
+
selectable: true,
|
|
3396
|
+
selected: selected.includes(row.id),
|
|
3397
|
+
onSelectedChange: (v) => setSelected(v ? [...selected, row.id] : selected.filter((id) => id !== row.id)),
|
|
3398
|
+
rowLabel,
|
|
3399
|
+
align: columns.map((c) => c.align),
|
|
3400
|
+
cells: columns.map((c) => c.render ? c.render(row) : row[c.key]),
|
|
3401
|
+
...onRowClick ? {
|
|
3402
|
+
onClick: () => onRowClick(row),
|
|
3403
|
+
tabIndex: 0,
|
|
3404
|
+
"aria-label": `Open ${rowLabel}`,
|
|
3405
|
+
onKeyDown: (event) => {
|
|
3406
|
+
if (event.key === "Enter") {
|
|
3407
|
+
event.preventDefault();
|
|
3408
|
+
onRowClick(row);
|
|
3409
|
+
}
|
|
3410
|
+
},
|
|
3411
|
+
className: "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-blue"
|
|
3412
|
+
} : {}
|
|
3413
|
+
},
|
|
3414
|
+
row.id
|
|
3415
|
+
);
|
|
3416
|
+
}) })
|
|
3391
3417
|
] }) }),
|
|
3392
3418
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-base border-t border-hairline px-base py-sm", children: [
|
|
3393
3419
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "shrink-0 whitespace-nowrap text-body-sm text-muted", children: [
|
|
3394
3420
|
selected.length > 0 ? `${selected.length} selected \xB7 ` : "",
|
|
3395
|
-
rows.length
|
|
3396
|
-
" count"
|
|
3421
|
+
countLabel(rows.length)
|
|
3397
3422
|
] }),
|
|
3398
3423
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ml-auto flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Pagination, { pageCount, page: safePage, onPageChange: setPage, size: "sm" }) })
|
|
3399
3424
|
] })
|
|
@@ -3417,12 +3442,19 @@ function DataTableMobileInner({
|
|
|
3417
3442
|
columns,
|
|
3418
3443
|
rows,
|
|
3419
3444
|
rowLabelKey,
|
|
3445
|
+
toolbarStart,
|
|
3420
3446
|
filters = [],
|
|
3421
3447
|
onRemoveFilter,
|
|
3422
3448
|
sort: sortProp,
|
|
3423
3449
|
onSortChange,
|
|
3424
3450
|
selectedIds,
|
|
3425
3451
|
onSelectionChange,
|
|
3452
|
+
onRowClick,
|
|
3453
|
+
mobileDescription,
|
|
3454
|
+
countLabel = (count) => `${count} records`,
|
|
3455
|
+
pageSize = 10,
|
|
3456
|
+
page: pageProp,
|
|
3457
|
+
onPageChange,
|
|
3426
3458
|
emptyTitle = "No companies yet",
|
|
3427
3459
|
emptyDescription = "Import companies to get started.",
|
|
3428
3460
|
importLabel = "Import companies",
|
|
@@ -3445,11 +3477,20 @@ function DataTableMobileInner({
|
|
|
3445
3477
|
if (selectedIds === void 0) setInnerSel(ids);
|
|
3446
3478
|
onSelectionChange?.(ids);
|
|
3447
3479
|
};
|
|
3480
|
+
const [innerPage, setInnerPage] = React34.useState(1);
|
|
3481
|
+
const page = pageProp ?? innerPage;
|
|
3482
|
+
const setPage = (next) => {
|
|
3483
|
+
if (pageProp === void 0) setInnerPage(next);
|
|
3484
|
+
onPageChange?.(next);
|
|
3485
|
+
};
|
|
3448
3486
|
const sorted = React34.useMemo(() => {
|
|
3449
3487
|
if (!sort) return rows;
|
|
3450
3488
|
const out = [...rows].sort((a, b) => compare2(a[sort.key], b[sort.key]));
|
|
3451
3489
|
return sort.direction === "descending" ? out.reverse() : out;
|
|
3452
3490
|
}, [rows, sort]);
|
|
3491
|
+
const pageCount = Math.max(1, Math.ceil(sorted.length / pageSize));
|
|
3492
|
+
const safePage = Math.min(Math.max(page, 1), pageCount);
|
|
3493
|
+
const visible = sorted.slice((safePage - 1) * pageSize, safePage * pageSize);
|
|
3453
3494
|
const allIds = rows.map((r) => r.id);
|
|
3454
3495
|
const allSelected = allIds.length > 0 && allIds.every((id) => selected.includes(id));
|
|
3455
3496
|
const someSelected = !allSelected && allIds.some((id) => selected.includes(id));
|
|
@@ -3461,48 +3502,79 @@ function DataTableMobileInner({
|
|
|
3461
3502
|
className: cn32("flex w-full flex-col overflow-hidden rounded-xl border border-hairline bg-surface shadow-card", className),
|
|
3462
3503
|
...rest,
|
|
3463
3504
|
children: [
|
|
3505
|
+
toolbarStart ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center gap-sm border-b border-hairline px-md py-sm", children: toolbarStart }) : null,
|
|
3464
3506
|
filters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex flex-wrap items-center gap-sm border-b border-hairline px-md py-sm", children: filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Chip, { size: "sm", label: f.label, icon: "funnel", onRemove: () => onRemoveFilter?.(f.id) }, f.id)) }) : null,
|
|
3465
3507
|
rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col items-center justify-center gap-sm px-base py-xl text-center", children: [
|
|
3466
3508
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { name: "database", size: 24, className: "text-muted" }),
|
|
3467
3509
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "m-0 text-label-md text-ink", children: emptyTitle }),
|
|
3468
3510
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "m-0 text-body-sm text-muted", children: emptyDescription }),
|
|
3469
3511
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { variant: "secondary", size: "lg", onClick: onImport, leadingIcon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { name: "download", size: 16 }), children: importLabel })
|
|
3470
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.
|
|
3471
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("
|
|
3472
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3512
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
3513
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("table", { className: "w-full border-collapse", "aria-label": label, children: [
|
|
3514
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("tr", { children: [
|
|
3515
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("th", { scope: "col", className: "w-10 border-b border-hairline bg-surface py-0 pl-base pr-xs text-left align-middle", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3516
|
+
Checkbox,
|
|
3517
|
+
{
|
|
3518
|
+
"aria-label": allSelected ? "Deselect all rows" : "Select all rows",
|
|
3519
|
+
checked: allSelected,
|
|
3520
|
+
indeterminate: someSelected,
|
|
3521
|
+
onCheckedChange: (v) => setSelected(v ? allIds : []),
|
|
3522
|
+
className: "flex"
|
|
3523
|
+
}
|
|
3524
|
+
) }),
|
|
3525
|
+
col ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3526
|
+
TableHeaderCell,
|
|
3527
|
+
{
|
|
3528
|
+
label: col.label,
|
|
3529
|
+
icon: col.icon,
|
|
3530
|
+
className: "min-w-0",
|
|
3531
|
+
sort: sort?.key === col.key ? sort.direction : "none",
|
|
3532
|
+
onSortChange: col.sortable ? (next) => setSort(next === "none" ? null : { key: col.key, direction: next }) : void 0
|
|
3533
|
+
}
|
|
3534
|
+
) : null
|
|
3535
|
+
] }) }),
|
|
3536
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tbody", { children: visible.map((row) => {
|
|
3537
|
+
const rowLabel = labelKey ? String(row[labelKey] ?? row.id) : row.id;
|
|
3538
|
+
const content = col ? col.render ? col.render(row) : row[col.key] : null;
|
|
3539
|
+
const description = mobileDescription?.(row);
|
|
3540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3541
|
+
TableRow,
|
|
3542
|
+
{
|
|
3543
|
+
selectable: true,
|
|
3544
|
+
selected: selected.includes(row.id),
|
|
3545
|
+
onSelectedChange: (v) => setSelected(v ? [...selected, row.id] : selected.filter((id) => id !== row.id)),
|
|
3546
|
+
rowLabel,
|
|
3547
|
+
className: "[&>td]:h-11",
|
|
3548
|
+
cells: [
|
|
3549
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "flex min-w-0 flex-col gap-xxs", children: [
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "min-w-0", children: content }),
|
|
3551
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "min-w-0 text-body-sm text-muted", children: description })
|
|
3552
|
+
] }) : content
|
|
3553
|
+
],
|
|
3554
|
+
...onRowClick ? {
|
|
3555
|
+
onClick: () => onRowClick(row),
|
|
3556
|
+
tabIndex: 0,
|
|
3557
|
+
"aria-label": `Open ${rowLabel}`,
|
|
3558
|
+
onKeyDown: (event) => {
|
|
3559
|
+
if (event.key === "Enter") {
|
|
3560
|
+
event.preventDefault();
|
|
3561
|
+
onRowClick(row);
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
} : {}
|
|
3565
|
+
},
|
|
3566
|
+
row.id
|
|
3567
|
+
);
|
|
3568
|
+
}) })
|
|
3492
3569
|
] }) }),
|
|
3493
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
cells: [col ? col.render ? col.render(row) : row[col.key] : null]
|
|
3502
|
-
},
|
|
3503
|
-
row.id
|
|
3504
|
-
)) })
|
|
3505
|
-
] }) })
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-base border-t border-hairline px-md py-sm", children: [
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "shrink-0 whitespace-nowrap text-body-sm text-muted", children: [
|
|
3572
|
+
selected.length > 0 ? `${selected.length} selected \xB7 ` : "",
|
|
3573
|
+
countLabel(rows.length)
|
|
3574
|
+
] }),
|
|
3575
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ml-auto flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Pagination, { pageCount, page: safePage, onPageChange: setPage, size: "sm" }) })
|
|
3576
|
+
] })
|
|
3577
|
+
] })
|
|
3506
3578
|
]
|
|
3507
3579
|
}
|
|
3508
3580
|
);
|
|
@@ -3514,7 +3586,18 @@ DataTableMobile.displayName = "DataTableMobile";
|
|
|
3514
3586
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3515
3587
|
var cn33 = (...parts) => parts.filter(Boolean).join(" ");
|
|
3516
3588
|
var DataTable = React35.forwardRef(
|
|
3517
|
-
({
|
|
3589
|
+
({
|
|
3590
|
+
sort,
|
|
3591
|
+
onSortChange,
|
|
3592
|
+
selectedIds,
|
|
3593
|
+
onSelectionChange,
|
|
3594
|
+
page,
|
|
3595
|
+
onPageChange,
|
|
3596
|
+
mobileDescription,
|
|
3597
|
+
rootClassName,
|
|
3598
|
+
className,
|
|
3599
|
+
...rest
|
|
3600
|
+
}, ref) => {
|
|
3518
3601
|
const [innerSort, setInnerSort] = React35.useState(null);
|
|
3519
3602
|
const currentSort = sort === void 0 ? innerSort : sort;
|
|
3520
3603
|
const changeSort = (s) => {
|
|
@@ -3527,17 +3610,25 @@ var DataTable = React35.forwardRef(
|
|
|
3527
3610
|
if (selectedIds === void 0) setInnerSel(ids);
|
|
3528
3611
|
onSelectionChange?.(ids);
|
|
3529
3612
|
};
|
|
3613
|
+
const [innerPage, setInnerPage] = React35.useState(1);
|
|
3614
|
+
const currentPage = page ?? innerPage;
|
|
3615
|
+
const changePage = (next) => {
|
|
3616
|
+
if (page === void 0) setInnerPage(next);
|
|
3617
|
+
onPageChange?.(next);
|
|
3618
|
+
};
|
|
3530
3619
|
const shared = {
|
|
3531
3620
|
...rest,
|
|
3532
3621
|
className,
|
|
3533
3622
|
sort: currentSort,
|
|
3534
3623
|
onSortChange: changeSort,
|
|
3535
3624
|
selectedIds: currentSel,
|
|
3536
|
-
onSelectionChange: changeSel
|
|
3625
|
+
onSelectionChange: changeSel,
|
|
3626
|
+
page: currentPage,
|
|
3627
|
+
onPageChange: changePage
|
|
3537
3628
|
};
|
|
3538
3629
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref, className: cn33("w-full rounded-xl", rootClassName), children: [
|
|
3539
3630
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DataTableDesktop, { ...shared }) }),
|
|
3540
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DataTableMobile, { ...shared }) })
|
|
3631
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DataTableMobile, { ...shared, mobileDescription }) })
|
|
3541
3632
|
] });
|
|
3542
3633
|
}
|
|
3543
3634
|
);
|
|
@@ -8836,6 +8927,10 @@ Typography.displayName = "Typography";
|
|
|
8836
8927
|
var React82 = __toESM(require("react"));
|
|
8837
8928
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
8838
8929
|
var cn80 = (...parts) => parts.filter(Boolean).join(" ");
|
|
8930
|
+
var appearances = {
|
|
8931
|
+
card: "rounded-xl border border-hairline bg-surface p-lg shadow-card",
|
|
8932
|
+
plain: "rounded-none border-0 bg-transparent p-0 shadow-none"
|
|
8933
|
+
};
|
|
8839
8934
|
var Wizard = React82.forwardRef(
|
|
8840
8935
|
({
|
|
8841
8936
|
steps,
|
|
@@ -8849,6 +8944,8 @@ var Wizard = React82.forwardRef(
|
|
|
8849
8944
|
backLabel = "Back",
|
|
8850
8945
|
cancelLabel = "Cancel",
|
|
8851
8946
|
label = "Setup",
|
|
8947
|
+
appearance = "card",
|
|
8948
|
+
completing = false,
|
|
8852
8949
|
className,
|
|
8853
8950
|
...rest
|
|
8854
8951
|
}, ref) => {
|
|
@@ -8866,7 +8963,8 @@ var Wizard = React82.forwardRef(
|
|
|
8866
8963
|
{
|
|
8867
8964
|
ref,
|
|
8868
8965
|
"aria-label": label,
|
|
8869
|
-
|
|
8966
|
+
"aria-busy": completing || void 0,
|
|
8967
|
+
className: cn80("flex w-full flex-col gap-lg", appearances[appearance], className),
|
|
8870
8968
|
...rest,
|
|
8871
8969
|
children: [
|
|
8872
8970
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("ol", { className: "m-0 flex list-none items-center gap-md p-0", "aria-label": "Progress", children: steps.map((s, i) => {
|
|
@@ -8932,12 +9030,13 @@ var Wizard = React82.forwardRef(
|
|
|
8932
9030
|
s.id
|
|
8933
9031
|
)) }),
|
|
8934
9032
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("footer", { className: "flex items-center justify-end gap-sm", children: [
|
|
8935
|
-
current === 0 ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { variant: "secondary", onClick: onCancel, children: cancelLabel }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { variant: "secondary", onClick: () => go(current - 1), children: backLabel }),
|
|
9033
|
+
current === 0 ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { variant: "secondary", onClick: onCancel, disabled: completing, children: cancelLabel }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { variant: "secondary", onClick: () => go(current - 1), disabled: completing, children: backLabel }),
|
|
8936
9034
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8937
9035
|
Button,
|
|
8938
9036
|
{
|
|
8939
9037
|
variant: "primary",
|
|
8940
|
-
disabled: active?.canContinue === false,
|
|
9038
|
+
disabled: active?.canContinue === false || completing && !isLast,
|
|
9039
|
+
loading: completing && isLast,
|
|
8941
9040
|
onClick: () => isLast ? onComplete?.() : go(current + 1),
|
|
8942
9041
|
children: isLast ? completeLabel : continueLabel
|
|
8943
9042
|
}
|