@drawbridge/components 0.1.30 → 0.1.32
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/bridge/template-modal.js +2 -1
- package/dist/bridge/template-modal.mjs +2 -1
- package/dist/dashboard/buttons-subscription.js +65 -20
- package/dist/dashboard/buttons-subscription.mjs +64 -20
- package/dist/dashboard/card-payment-method.js +1 -1
- package/dist/dashboard/card-payment-method.mjs +1 -1
- package/dist/dashboard/card-section.js +2 -2
- package/dist/dashboard/card-section.mjs +2 -2
- package/dist/dashboard/card-setting.js +4 -3
- package/dist/dashboard/card-setting.mjs +4 -3
- package/dist/dashboard/card-task.js +22 -4
- package/dist/dashboard/card-task.mjs +22 -4
- package/dist/dashboard/card-tile.js +6 -6
- package/dist/dashboard/card-tile.mjs +6 -6
- package/dist/dashboard/drawer.js +7 -2
- package/dist/dashboard/drawer.mjs +8 -3
- package/dist/dashboard/form-organization-workflow.js +7 -3
- package/dist/dashboard/form-organization-workflow.mjs +7 -3
- package/dist/dashboard/input-combobox.js +7 -2
- package/dist/dashboard/input-combobox.mjs +7 -2
- package/dist/dashboard/lib/escape.js +48 -0
- package/dist/dashboard/lib/escape.mjs +25 -0
- package/dist/dashboard/lib/rail.js +75 -0
- package/dist/dashboard/lib/rail.mjs +46 -0
- package/dist/dashboard/lib/throttle.js +57 -0
- package/dist/dashboard/lib/throttle.mjs +34 -0
- package/dist/dashboard/list.js +1 -1
- package/dist/dashboard/list.mjs +1 -1
- package/dist/dashboard/menu.js +188 -96
- package/dist/dashboard/menu.mjs +189 -97
- package/dist/dashboard/modal.js +9 -3
- package/dist/dashboard/modal.mjs +10 -4
- package/dist/dashboard/notice.js +5 -3
- package/dist/dashboard/notice.mjs +5 -3
- package/dist/dashboard/table-cell-title.js +2 -0
- package/dist/dashboard/table-cell-title.mjs +2 -0
- package/dist/dashboard/table.js +61 -20
- package/dist/dashboard/table.mjs +61 -20
- package/dist/dashboard/template-dashboard.js +35 -133
- package/dist/dashboard/template-dashboard.mjs +36 -134
- package/dist/dashboard/template-rail.js +674 -0
- package/dist/dashboard/template-rail.mjs +640 -0
- package/dist/dashboard/template-socket.js +23 -3
- package/dist/dashboard/template-socket.mjs +23 -3
- package/dist/dashboard/template-ui.js +150 -186
- package/dist/dashboard/template-ui.mjs +151 -187
- package/dist/icons/book-open.js +46 -0
- package/dist/icons/book-open.mjs +27 -0
- package/dist/icons/task.js +46 -0
- package/dist/icons/task.mjs +27 -0
- package/dist/shared/lib/helpers.js +9 -2
- package/dist/shared/lib/helpers.mjs +9 -2
- package/dist/shared/lib/motion.js +27 -0
- package/dist/shared/lib/motion.mjs +4 -0
- package/dist/shared/overlay.js +5 -3
- package/dist/shared/overlay.mjs +5 -3
- package/package.json +28 -13
- package/types/dashboard/card-task.d.ts +5 -1
- package/types/dashboard/lib/rail.d.ts +32 -0
- package/types/dashboard/lib/throttle.d.ts +5 -0
- package/types/dashboard/table.d.ts +3 -1
- package/types/dashboard/template-dashboard.d.ts +4 -1
- package/types/dashboard/template-rail.d.ts +36 -0
- package/types/dashboard/template-ui.d.ts +2 -2
- package/types/icons/book-open.d.ts +5 -0
- package/types/icons/task.d.ts +5 -0
- package/dist/dashboard/guide.js +0 -238
- package/dist/dashboard/guide.mjs +0 -209
- package/types/dashboard/guide.d.ts +0 -23
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isValidElement, useEffect,
|
|
2
|
+
import { isValidElement, useEffect, useState } from "react";
|
|
3
3
|
import { keepPreviousData, useIsFetching, useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { notFound } from "next/navigation";
|
|
5
|
-
import { useDrawer } from "./lib/hooks.mjs";
|
|
6
5
|
import { iconLabel } from "../shared/lib/icon-labels.mjs";
|
|
7
6
|
import ProviderResource from "./provider-resource.mjs";
|
|
7
|
+
import { railFirst } from "./lib/rail.mjs";
|
|
8
|
+
import { useRail } from "./template-rail.mjs";
|
|
8
9
|
import ArrowRight from "../icons/arrow-right.mjs";
|
|
9
10
|
import LoaderIcon from "../icons/loader.mjs";
|
|
10
11
|
import Refresh from "../icons/refresh.mjs";
|
|
11
12
|
import Empty from "../shared/empty.mjs";
|
|
12
13
|
import Badge from "../shared/badge.mjs";
|
|
13
14
|
import Button from "../shared/button.mjs";
|
|
14
|
-
import List from "./list.mjs";
|
|
15
15
|
import LinkBack from "./link-back.mjs";
|
|
16
16
|
import WrapperGradient from "../wrapper-gradient.mjs";
|
|
17
17
|
import Image from "next/image";
|
|
@@ -340,143 +340,45 @@ const TemplateDashboardError = ({
|
|
|
340
340
|
const TemplateDashboardTasks = ({
|
|
341
341
|
items = []
|
|
342
342
|
}) => {
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
/* @__PURE__ */ jsx(
|
|
359
|
-
|
|
343
|
+
const { set } = useRail();
|
|
344
|
+
const first = railFirst(items);
|
|
345
|
+
if (!first) return null;
|
|
346
|
+
return /* @__PURE__ */ jsx(
|
|
347
|
+
"div",
|
|
348
|
+
{
|
|
349
|
+
...{
|
|
350
|
+
className: "px-6 md:px-12"
|
|
351
|
+
},
|
|
352
|
+
children: /* @__PURE__ */ jsx(
|
|
353
|
+
"div",
|
|
354
|
+
{
|
|
355
|
+
...{
|
|
356
|
+
className: "bg-white border border-gray rounded px-4 py-3"
|
|
357
|
+
},
|
|
358
|
+
children: /* @__PURE__ */ jsx(
|
|
359
|
+
Button,
|
|
360
360
|
{
|
|
361
361
|
...{
|
|
362
|
-
|
|
362
|
+
icon: ArrowRight,
|
|
363
|
+
justify: "between",
|
|
364
|
+
onClick: () => set("next"),
|
|
365
|
+
variant: "link"
|
|
363
366
|
},
|
|
364
|
-
children:
|
|
365
|
-
|
|
366
|
-
)
|
|
367
|
-
]
|
|
368
|
-
}
|
|
369
|
-
),
|
|
370
|
-
children: /* @__PURE__ */ jsx(
|
|
371
|
-
"div",
|
|
372
|
-
{
|
|
373
|
-
...{
|
|
374
|
-
className: "p-6"
|
|
375
|
-
},
|
|
376
|
-
children: /* @__PURE__ */ jsx(
|
|
377
|
-
List,
|
|
378
|
-
{
|
|
379
|
-
...{
|
|
380
|
-
items: [
|
|
367
|
+
children: /* @__PURE__ */ jsx(
|
|
368
|
+
"span",
|
|
381
369
|
{
|
|
382
|
-
...
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}))
|
|
389
|
-
]
|
|
370
|
+
...{
|
|
371
|
+
className: "flex-1 min-w-0 text-left whitespace-normal hover:underline"
|
|
372
|
+
},
|
|
373
|
+
children: first.title
|
|
374
|
+
}
|
|
375
|
+
)
|
|
390
376
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
});
|
|
396
|
-
const shown = useRef(null);
|
|
397
|
-
const openAll = () => {
|
|
398
|
-
const props = nextSteps();
|
|
399
|
-
shown.current = props.children;
|
|
400
|
-
open(props);
|
|
401
|
-
};
|
|
402
|
-
useEffect(
|
|
403
|
-
() => {
|
|
404
|
-
const drawer = queryClient.getQueryData(["drawer"]);
|
|
405
|
-
if (!shown.current || !(drawer == null ? void 0 : drawer.active) || drawer.children !== shown.current) return;
|
|
406
|
-
if (!first) {
|
|
407
|
-
shown.current = null;
|
|
408
|
-
close();
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
openAll();
|
|
412
|
-
},
|
|
413
|
-
// The tasks are the trigger; the rest follows them.
|
|
414
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
415
|
-
[items]
|
|
377
|
+
)
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
}
|
|
416
381
|
);
|
|
417
|
-
if (first) {
|
|
418
|
-
return /* @__PURE__ */ jsx(
|
|
419
|
-
"div",
|
|
420
|
-
{
|
|
421
|
-
...{
|
|
422
|
-
className: "px-6 md:px-12"
|
|
423
|
-
},
|
|
424
|
-
children: /* @__PURE__ */ jsx(
|
|
425
|
-
"div",
|
|
426
|
-
{
|
|
427
|
-
...{
|
|
428
|
-
className: "bg-white border border-gray rounded px-4 py-3"
|
|
429
|
-
},
|
|
430
|
-
children: /* @__PURE__ */ jsxs(
|
|
431
|
-
"div",
|
|
432
|
-
{
|
|
433
|
-
...{
|
|
434
|
-
className: "flex items-center justify-between space-x-6"
|
|
435
|
-
},
|
|
436
|
-
children: [
|
|
437
|
-
first && /* @__PURE__ */ jsx(
|
|
438
|
-
List,
|
|
439
|
-
{
|
|
440
|
-
...{
|
|
441
|
-
items: [
|
|
442
|
-
{
|
|
443
|
-
...first,
|
|
444
|
-
onClick: () => close()
|
|
445
|
-
}
|
|
446
|
-
],
|
|
447
|
-
svg: false
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
),
|
|
451
|
-
(array == null ? void 0 : array.length) > 0 && /* @__PURE__ */ jsx(
|
|
452
|
-
Button,
|
|
453
|
-
{
|
|
454
|
-
...{
|
|
455
|
-
icon: ArrowRight,
|
|
456
|
-
inline: true,
|
|
457
|
-
onClick: openAll,
|
|
458
|
-
variant: "link"
|
|
459
|
-
},
|
|
460
|
-
children: /* @__PURE__ */ jsx(
|
|
461
|
-
Badge,
|
|
462
|
-
{
|
|
463
|
-
...{
|
|
464
|
-
type: "warning"
|
|
465
|
-
},
|
|
466
|
-
children: array.length + 1
|
|
467
|
-
}
|
|
468
|
-
)
|
|
469
|
-
}
|
|
470
|
-
)
|
|
471
|
-
]
|
|
472
|
-
}
|
|
473
|
-
)
|
|
474
|
-
}
|
|
475
|
-
)
|
|
476
|
-
}
|
|
477
|
-
);
|
|
478
|
-
}
|
|
479
|
-
return null;
|
|
480
382
|
};
|
|
481
383
|
const SETTLE_QUIET = 50;
|
|
482
384
|
const SETTLE_CAP = 3e3;
|