@drawbridge/components 0.1.23 → 0.1.24

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.
Files changed (79) hide show
  1. package/dist/bridge/form-subdomain-embed.js +1 -0
  2. package/dist/bridge/form-subdomain-embed.mjs +1 -0
  3. package/dist/bridge/form-subdomain.js +5 -2
  4. package/dist/bridge/form-subdomain.mjs +5 -2
  5. package/dist/bridge/template-modal.js +2 -2
  6. package/dist/bridge/template-modal.mjs +2 -2
  7. package/dist/dashboard/buttons-subscription.js +27 -66
  8. package/dist/dashboard/buttons-subscription.mjs +27 -65
  9. package/dist/dashboard/card-payment-method.js +1 -1
  10. package/dist/dashboard/card-payment-method.mjs +1 -1
  11. package/dist/dashboard/card-section.js +2 -2
  12. package/dist/dashboard/card-section.mjs +2 -2
  13. package/dist/dashboard/card-setting.js +3 -4
  14. package/dist/dashboard/card-setting.mjs +3 -4
  15. package/dist/dashboard/card-task.js +4 -22
  16. package/dist/dashboard/card-task.mjs +4 -22
  17. package/dist/dashboard/card-tile.js +6 -6
  18. package/dist/dashboard/card-tile.mjs +6 -6
  19. package/dist/dashboard/drawer.js +2 -7
  20. package/dist/dashboard/drawer.mjs +3 -8
  21. package/dist/dashboard/form-organization-campaign.js +1 -1
  22. package/dist/dashboard/form-organization-campaign.mjs +1 -1
  23. package/dist/dashboard/form-organization-identity.js +3 -3
  24. package/dist/dashboard/form-organization-identity.mjs +3 -3
  25. package/dist/dashboard/form-organization-workflow.js +9 -7
  26. package/dist/dashboard/form-organization-workflow.mjs +9 -7
  27. package/dist/dashboard/form-organization.js +40 -3
  28. package/dist/dashboard/form-organization.mjs +40 -3
  29. package/dist/dashboard/guide.js +238 -0
  30. package/dist/dashboard/guide.mjs +209 -0
  31. package/dist/dashboard/input-combobox.js +2 -7
  32. package/dist/dashboard/input-combobox.mjs +2 -7
  33. package/dist/dashboard/list.js +1 -1
  34. package/dist/dashboard/list.mjs +1 -1
  35. package/dist/dashboard/menu.js +96 -188
  36. package/dist/dashboard/menu.mjs +97 -189
  37. package/dist/dashboard/modal.js +3 -9
  38. package/dist/dashboard/modal.mjs +4 -10
  39. package/dist/dashboard/notice.js +3 -5
  40. package/dist/dashboard/notice.mjs +3 -5
  41. package/dist/dashboard/table-cell-title.js +0 -2
  42. package/dist/dashboard/table-cell-title.mjs +0 -2
  43. package/dist/dashboard/table.js +20 -61
  44. package/dist/dashboard/table.mjs +20 -61
  45. package/dist/dashboard/template-dashboard.js +133 -35
  46. package/dist/dashboard/template-dashboard.mjs +134 -36
  47. package/dist/dashboard/template-socket.js +3 -19
  48. package/dist/dashboard/template-socket.mjs +3 -19
  49. package/dist/dashboard/template-ui.js +186 -150
  50. package/dist/dashboard/template-ui.mjs +187 -151
  51. package/dist/shared/lib/helpers.js +2 -9
  52. package/dist/shared/lib/helpers.mjs +2 -9
  53. package/dist/shared/overlay.js +3 -5
  54. package/dist/shared/overlay.mjs +3 -5
  55. package/package.json +13 -28
  56. package/types/dashboard/card-task.d.ts +1 -5
  57. package/types/dashboard/guide.d.ts +23 -0
  58. package/types/dashboard/table.d.ts +1 -3
  59. package/types/dashboard/template-dashboard.d.ts +1 -4
  60. package/types/dashboard/template-ui.d.ts +2 -2
  61. package/dist/dashboard/lib/escape.js +0 -48
  62. package/dist/dashboard/lib/escape.mjs +0 -25
  63. package/dist/dashboard/lib/rail.js +0 -75
  64. package/dist/dashboard/lib/rail.mjs +0 -46
  65. package/dist/dashboard/lib/throttle.js +0 -57
  66. package/dist/dashboard/lib/throttle.mjs +0 -34
  67. package/dist/dashboard/template-rail.js +0 -674
  68. package/dist/dashboard/template-rail.mjs +0 -640
  69. package/dist/icons/book-open.js +0 -46
  70. package/dist/icons/book-open.mjs +0 -27
  71. package/dist/icons/task.js +0 -46
  72. package/dist/icons/task.mjs +0 -27
  73. package/dist/shared/lib/motion.js +0 -27
  74. package/dist/shared/lib/motion.mjs +0 -4
  75. package/types/dashboard/lib/rail.d.ts +0 -32
  76. package/types/dashboard/lib/throttle.d.ts +0 -5
  77. package/types/dashboard/template-rail.d.ts +0 -36
  78. package/types/icons/book-open.d.ts +0 -5
  79. package/types/icons/task.d.ts +0 -5
@@ -34,12 +34,10 @@ module.exports = __toCommonJS(modal_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_react = require("react");
36
36
  var import_react2 = require("@headlessui/react");
37
- var import_motion = require("../shared/lib/motion");
38
37
  var import_times = __toESM(require("../icons/times"));
39
38
  var import_button = __toESM(require("../shared/button"));
40
39
  var import_form = require("../shared/lib/form");
41
40
  var import_overlay = __toESM(require("../shared/overlay"));
42
- var import_escape = require("./lib/escape");
43
41
  var import_hooks = require("./lib/hooks");
44
42
  let open = 0;
45
43
  const Modal = ({
@@ -59,8 +57,6 @@ const Modal = ({
59
57
  queryClient
60
58
  });
61
59
  const close = onClose || modal.close;
62
- const button = (0, import_react.useRef)(null);
63
- (0, import_escape.useEscape)(active, button);
64
60
  const classes = {
65
61
  body: [
66
62
  "relative w-full max-w-md overflow-hidden rounded-2xl bg-white text-left align-middle shadow-xl"
@@ -73,11 +69,10 @@ const Modal = ({
73
69
  // the dialog transformed during that window — an interrupted reopen
74
70
  // stuck mid-scale, and anchored children measured against the
75
71
  // transformed box (the select-width bug). Leave stays immediate;
76
- // the overlay lingers 100ms so the dialog animates out first.
77
- import_motion.motion,
72
+ // the overlay lingers 300ms so the dialog animates out first.
73
+ "transition duration-200 ease-in",
78
74
  "data-[closed]:opacity-0",
79
- "data-[closed]:scale-95",
80
- "data-[closed]:translate-y-2"
75
+ "data-[closed]:scale-95"
81
76
  ],
82
77
  inner: [
83
78
  "flex min-h-full items-center justify-center"
@@ -163,7 +158,6 @@ const Modal = ({
163
158
  // form inside the modal has unsaved edits.
164
159
  ...!onClose && { "data-guard": "modal" },
165
160
  onClick: () => close(),
166
- ref: button,
167
161
  variant: "link"
168
162
  }
169
163
  }
@@ -1,13 +1,11 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { Fragment, useEffect, useRef } from "react";
3
+ import { Fragment, useEffect } from "react";
4
4
  import { Transition } from "@headlessui/react";
5
- import { motion } from "../shared/lib/motion.mjs";
6
5
  import Times from "../icons/times.mjs";
7
6
  import Button from "../shared/button.mjs";
8
7
  import { FormScope } from "../shared/lib/form.mjs";
9
8
  import Overlay from "../shared/overlay.mjs";
10
- import { useEscape } from "./lib/escape.mjs";
11
9
  import { useModal } from "./lib/hooks.mjs";
12
10
  let open = 0;
13
11
  const Modal = ({
@@ -27,8 +25,6 @@ const Modal = ({
27
25
  queryClient
28
26
  });
29
27
  const close = onClose || modal.close;
30
- const button = useRef(null);
31
- useEscape(active, button);
32
28
  const classes = {
33
29
  body: [
34
30
  "relative w-full max-w-md overflow-hidden rounded-2xl bg-white text-left align-middle shadow-xl"
@@ -41,11 +37,10 @@ const Modal = ({
41
37
  // the dialog transformed during that window — an interrupted reopen
42
38
  // stuck mid-scale, and anchored children measured against the
43
39
  // transformed box (the select-width bug). Leave stays immediate;
44
- // the overlay lingers 100ms so the dialog animates out first.
45
- motion,
40
+ // the overlay lingers 300ms so the dialog animates out first.
41
+ "transition duration-200 ease-in",
46
42
  "data-[closed]:opacity-0",
47
- "data-[closed]:scale-95",
48
- "data-[closed]:translate-y-2"
43
+ "data-[closed]:scale-95"
49
44
  ],
50
45
  inner: [
51
46
  "flex min-h-full items-center justify-center"
@@ -131,7 +126,6 @@ const Modal = ({
131
126
  // form inside the modal has unsaved edits.
132
127
  ...!onClose && { "data-guard": "modal" },
133
128
  onClick: () => close(),
134
- ref: button,
135
129
  variant: "link"
136
130
  }
137
131
  }
@@ -34,7 +34,6 @@ module.exports = __toCommonJS(notice_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_react = require("react");
36
36
  var import_react2 = require("@headlessui/react");
37
- var import_motion = require("../shared/lib/motion");
38
37
  var import_times = __toESM(require("../icons/times"));
39
38
  var import_link = __toESM(require("./link"));
40
39
  var import_button = __toESM(require("../shared/button"));
@@ -67,11 +66,10 @@ const Notice = ({
67
66
  );
68
67
  const classes = {
69
68
  container: [
70
- "z-50 fixed right-0 md:right-12 bottom-0 w-full p-6 bg-white border-t",
69
+ "z-50 fixed right-0 bottom-0 w-full p-6 bg-white border-t",
71
70
  "md:border-t-0 md:w-auto md:p-0 md:m-6 md:bg-transparent",
72
- import_motion.motion,
73
- "data-[closed]:translate-y-full",
74
- "data-[closed]:opacity-0"
71
+ "transition duration-200 ease-in",
72
+ "data-[closed]:translate-y-full"
75
73
  ],
76
74
  inner: [
77
75
  "flex items-center justify-between space-x-4 p-4 rounded md:p-6",
@@ -2,7 +2,6 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useEffect } from "react";
4
4
  import { Transition } from "@headlessui/react";
5
- import { motion } from "../shared/lib/motion.mjs";
6
5
  import Times from "../icons/times.mjs";
7
6
  import Link from "./link.mjs";
8
7
  import Button from "../shared/button.mjs";
@@ -35,11 +34,10 @@ const Notice = ({
35
34
  );
36
35
  const classes = {
37
36
  container: [
38
- "z-50 fixed right-0 md:right-12 bottom-0 w-full p-6 bg-white border-t",
37
+ "z-50 fixed right-0 bottom-0 w-full p-6 bg-white border-t",
39
38
  "md:border-t-0 md:w-auto md:p-0 md:m-6 md:bg-transparent",
40
- motion,
41
- "data-[closed]:translate-y-full",
42
- "data-[closed]:opacity-0"
39
+ "transition duration-200 ease-in",
40
+ "data-[closed]:translate-y-full"
43
41
  ],
44
42
  inner: [
45
43
  "flex items-center justify-between space-x-4 p-4 rounded md:p-6",
@@ -160,8 +160,6 @@ const TableCellTitle = (props) => {
160
160
  import_badge.default,
161
161
  {
162
162
  ...{
163
- // The title gives way when the column does; the badge keeps its width.
164
- className: "shrink-0",
165
163
  size: "small",
166
164
  type: badge.type
167
165
  },
@@ -127,8 +127,6 @@ const TableCellTitle = (props) => {
127
127
  Badge,
128
128
  {
129
129
  ...{
130
- // The title gives way when the column does; the badge keeps its width.
131
- className: "shrink-0",
132
130
  size: "small",
133
131
  type: badge.type
134
132
  },
@@ -63,7 +63,6 @@ var import_form_action = __toESM(require("./form-action"));
63
63
  var import_warning = __toESM(require("../icons/warning"));
64
64
  var import_tooltip = __toESM(require("../shared/tooltip"));
65
65
  var import_wrapper_gradient = require("../wrapper-gradient");
66
- const CELL_PADDING = "px-4 @max-[1279px]:px-1.5";
67
66
  const STICKY_ACTIONS_FADE_BASE = "before:content-[''] before:absolute before:right-full before:top-0 before:bottom-0 before:w-8 before:bg-gradient-to-l before:from-30% before:to-transparent before:pointer-events-none";
68
67
  const STICKY_ACTIONS_FADE_BODY = STICKY_ACTIONS_FADE_BASE + " before:from-white";
69
68
  const STICKY_ACTIONS_FADE_HEADER = STICKY_ACTIONS_FADE_BASE + " before:from-gray-light";
@@ -127,7 +126,7 @@ const TableContainer = ({
127
126
  );
128
127
  };
129
128
  const TableHeader = ({
130
- classNameHeader = CELL_PADDING,
129
+ classNameHeader = "px-4",
131
130
  classNameRow,
132
131
  headers,
133
132
  headerGroups
@@ -267,7 +266,7 @@ const TableCell = ({
267
266
  // alignment (e.g. text-right) pass their own full className — the
268
267
  // default is replaced rather than merged, so there's no source-order
269
268
  // collision on `text-align`.
270
- className = CELL_PADDING + " text-left",
269
+ className = "px-4 text-left",
271
270
  truncate = true,
272
271
  ...rest
273
272
  }) => {
@@ -285,28 +284,6 @@ const TableCell = ({
285
284
  }
286
285
  );
287
286
  };
288
- const TableCellShrink = ({
289
- children,
290
- first,
291
- truncate
292
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
293
- "div",
294
- {
295
- ...{
296
- className: "grid grid-cols-[minmax(0,max-content)] " + (first ? "min-w-30" : "min-w-16")
297
- },
298
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
299
- "div",
300
- {
301
- ...{
302
- // A table that wraps its text ( truncate false ) wraps here too.
303
- className: truncate ? "min-w-0 truncate" : "min-w-0"
304
- },
305
- children
306
- }
307
- )
308
- }
309
- );
310
287
  const TableBody = ({
311
288
  children
312
289
  }) => {
@@ -414,25 +391,19 @@ const TableActionsCell = ({
414
391
  children: buttonConfig.text
415
392
  }
416
393
  );
417
- const shown = buttonConfig.tooltip ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
418
- import_tooltip.default,
419
- {
420
- ...{
421
- content: buttonConfig.tooltip
422
- },
423
- children: buttonEl
424
- }
425
- ) : buttonEl;
426
- if (controls.length > 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
427
- "div",
428
- {
429
- ...{
430
- className: "flex justify-end min-w-24"
431
- },
432
- children: shown
433
- }
434
- );
435
- return shown;
394
+ if (buttonConfig.tooltip) {
395
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
396
+ import_tooltip.default,
397
+ {
398
+ ...{
399
+ content: buttonConfig.tooltip
400
+ },
401
+ children: buttonEl
402
+ }
403
+ );
404
+ }
405
+ ;
406
+ return buttonEl;
436
407
  })()
437
408
  ]
438
409
  }
@@ -693,9 +664,6 @@ const TableRowProcessing = ({
693
664
  );
694
665
  };
695
666
  const Table = ({
696
- // false: the actions scroll with the row. For a list too wide for any laptop,
697
- // whose last columns would otherwise sit under them.
698
- fixedActions = true,
699
667
  actions,
700
668
  className,
701
669
  classNameColumn,
@@ -727,7 +695,7 @@ const Table = ({
727
695
  header: "",
728
696
  enableSorting: false,
729
697
  meta: {
730
- className: fixedActions ? "sticky right-0 z-10" : "z-10",
698
+ className: "sticky right-0 z-10",
731
699
  classNameHeader: "bg-gray-light",
732
700
  classNameCell: "bg-white"
733
701
  },
@@ -742,7 +710,7 @@ const Table = ({
742
710
  }
743
711
  ];
744
712
  },
745
- [actions, columns, fixedActions]
713
+ [actions, columns]
746
714
  );
747
715
  const table = (0, import_react_table.useReactTable)({
748
716
  columns: tableColumns,
@@ -783,18 +751,9 @@ const Table = ({
783
751
  row.id
784
752
  );
785
753
  }
786
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableRow, { className: classNameRow, children: row.getVisibleCells().map((cell, index) => {
787
- var _a2, _b, _c;
788
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { truncate, className: [(_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.className, (_b = cell.column.columnDef.meta) == null ? void 0 : _b.classNameCell, classNameColumn].filter(Boolean).join(" ") || void 0, children: index === 0 || ((_c = cell.column.columnDef.meta) == null ? void 0 : _c.shrink) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
789
- TableCellShrink,
790
- {
791
- ...{
792
- first: index === 0,
793
- truncate
794
- },
795
- children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext())
796
- }
797
- ) : (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
754
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableRow, { className: classNameRow, children: row.getVisibleCells().map((cell) => {
755
+ var _a2, _b;
756
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { truncate, className: [(_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.className, (_b = cell.column.columnDef.meta) == null ? void 0 : _b.classNameCell, classNameColumn].filter(Boolean).join(" ") || void 0, children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
798
757
  }) }, row.id);
799
758
  }) })
800
759
  ] });
@@ -20,7 +20,6 @@ import FormAction from "./form-action.mjs";
20
20
  import Warning from "../icons/warning.mjs";
21
21
  import Tooltip from "../shared/tooltip.mjs";
22
22
  import { useWrapperGradient } from "../wrapper-gradient.mjs";
23
- const CELL_PADDING = "px-4 @max-[1279px]:px-1.5";
24
23
  const STICKY_ACTIONS_FADE_BASE = "before:content-[''] before:absolute before:right-full before:top-0 before:bottom-0 before:w-8 before:bg-gradient-to-l before:from-30% before:to-transparent before:pointer-events-none";
25
24
  const STICKY_ACTIONS_FADE_BODY = STICKY_ACTIONS_FADE_BASE + " before:from-white";
26
25
  const STICKY_ACTIONS_FADE_HEADER = STICKY_ACTIONS_FADE_BASE + " before:from-gray-light";
@@ -84,7 +83,7 @@ const TableContainer = ({
84
83
  );
85
84
  };
86
85
  const TableHeader = ({
87
- classNameHeader = CELL_PADDING,
86
+ classNameHeader = "px-4",
88
87
  classNameRow,
89
88
  headers,
90
89
  headerGroups
@@ -224,7 +223,7 @@ const TableCell = ({
224
223
  // alignment (e.g. text-right) pass their own full className — the
225
224
  // default is replaced rather than merged, so there's no source-order
226
225
  // collision on `text-align`.
227
- className = CELL_PADDING + " text-left",
226
+ className = "px-4 text-left",
228
227
  truncate = true,
229
228
  ...rest
230
229
  }) => {
@@ -242,28 +241,6 @@ const TableCell = ({
242
241
  }
243
242
  );
244
243
  };
245
- const TableCellShrink = ({
246
- children,
247
- first,
248
- truncate
249
- }) => /* @__PURE__ */ jsx(
250
- "div",
251
- {
252
- ...{
253
- className: "grid grid-cols-[minmax(0,max-content)] " + (first ? "min-w-30" : "min-w-16")
254
- },
255
- children: /* @__PURE__ */ jsx(
256
- "div",
257
- {
258
- ...{
259
- // A table that wraps its text ( truncate false ) wraps here too.
260
- className: truncate ? "min-w-0 truncate" : "min-w-0"
261
- },
262
- children
263
- }
264
- )
265
- }
266
- );
267
244
  const TableBody = ({
268
245
  children
269
246
  }) => {
@@ -371,25 +348,19 @@ const TableActionsCell = ({
371
348
  children: buttonConfig.text
372
349
  }
373
350
  );
374
- const shown = buttonConfig.tooltip ? /* @__PURE__ */ jsx(
375
- Tooltip,
376
- {
377
- ...{
378
- content: buttonConfig.tooltip
379
- },
380
- children: buttonEl
381
- }
382
- ) : buttonEl;
383
- if (controls.length > 0) return /* @__PURE__ */ jsx(
384
- "div",
385
- {
386
- ...{
387
- className: "flex justify-end min-w-24"
388
- },
389
- children: shown
390
- }
391
- );
392
- return shown;
351
+ if (buttonConfig.tooltip) {
352
+ return /* @__PURE__ */ jsx(
353
+ Tooltip,
354
+ {
355
+ ...{
356
+ content: buttonConfig.tooltip
357
+ },
358
+ children: buttonEl
359
+ }
360
+ );
361
+ }
362
+ ;
363
+ return buttonEl;
393
364
  })()
394
365
  ]
395
366
  }
@@ -650,9 +621,6 @@ const TableRowProcessing = ({
650
621
  );
651
622
  };
652
623
  const Table = ({
653
- // false: the actions scroll with the row. For a list too wide for any laptop,
654
- // whose last columns would otherwise sit under them.
655
- fixedActions = true,
656
624
  actions,
657
625
  className,
658
626
  classNameColumn,
@@ -684,7 +652,7 @@ const Table = ({
684
652
  header: "",
685
653
  enableSorting: false,
686
654
  meta: {
687
- className: fixedActions ? "sticky right-0 z-10" : "z-10",
655
+ className: "sticky right-0 z-10",
688
656
  classNameHeader: "bg-gray-light",
689
657
  classNameCell: "bg-white"
690
658
  },
@@ -699,7 +667,7 @@ const Table = ({
699
667
  }
700
668
  ];
701
669
  },
702
- [actions, columns, fixedActions]
670
+ [actions, columns]
703
671
  );
704
672
  const table = useReactTable({
705
673
  columns: tableColumns,
@@ -740,18 +708,9 @@ const Table = ({
740
708
  row.id
741
709
  );
742
710
  }
743
- return /* @__PURE__ */ jsx(TableRow, { className: classNameRow, children: row.getVisibleCells().map((cell, index) => {
744
- var _a2, _b, _c;
745
- return /* @__PURE__ */ jsx(TableCell, { truncate, className: [(_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.className, (_b = cell.column.columnDef.meta) == null ? void 0 : _b.classNameCell, classNameColumn].filter(Boolean).join(" ") || void 0, children: index === 0 || ((_c = cell.column.columnDef.meta) == null ? void 0 : _c.shrink) ? /* @__PURE__ */ jsx(
746
- TableCellShrink,
747
- {
748
- ...{
749
- first: index === 0,
750
- truncate
751
- },
752
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
753
- }
754
- ) : flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
711
+ return /* @__PURE__ */ jsx(TableRow, { className: classNameRow, children: row.getVisibleCells().map((cell) => {
712
+ var _a2, _b;
713
+ return /* @__PURE__ */ jsx(TableCell, { truncate, className: [(_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.className, (_b = cell.column.columnDef.meta) == null ? void 0 : _b.classNameCell, classNameColumn].filter(Boolean).join(" ") || void 0, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
755
714
  }) }, row.id);
756
715
  }) })
757
716
  ] });
@@ -39,16 +39,16 @@ var import_jsx_runtime = require("react/jsx-runtime");
39
39
  var import_react = require("react");
40
40
  var import_react_query = require("@tanstack/react-query");
41
41
  var import_navigation = require("next/navigation");
42
+ var import_hooks = require("./lib/hooks");
42
43
  var import_icon_labels = require("../shared/lib/icon-labels");
43
44
  var import_provider_resource = __toESM(require("./provider-resource"));
44
- var import_rail = require("./lib/rail");
45
- var import_template_rail = require("./template-rail");
46
45
  var import_arrow_right = __toESM(require("../icons/arrow-right"));
47
46
  var import_loader = __toESM(require("../icons/loader"));
48
47
  var import_refresh = __toESM(require("../icons/refresh"));
49
48
  var import_empty = __toESM(require("../shared/empty"));
50
49
  var import_badge = __toESM(require("../shared/badge"));
51
50
  var import_button = __toESM(require("../shared/button"));
51
+ var import_list = __toESM(require("./list"));
52
52
  var import_link_back = __toESM(require("./link-back"));
53
53
  var import_wrapper_gradient = __toESM(require("../wrapper-gradient"));
54
54
  var import_image = __toESM(require("next/image"));
@@ -377,45 +377,143 @@ const TemplateDashboardError = ({
377
377
  const TemplateDashboardTasks = ({
378
378
  items = []
379
379
  }) => {
380
- const { set } = (0, import_template_rail.useRail)();
381
- const first = (0, import_rail.railFirst)(items);
382
- if (!first) return null;
383
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
384
- "div",
385
- {
386
- ...{
387
- className: "px-6 md:px-12"
388
- },
389
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
390
- "div",
391
- {
392
- ...{
393
- className: "bg-white border border-gray rounded px-4 py-3"
394
- },
395
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
396
- import_button.default,
380
+ const queryClient = (0, import_react_query.useQueryClient)();
381
+ const { close, open } = (0, import_hooks.useDrawer)({
382
+ queryClient
383
+ });
384
+ const array = [...items];
385
+ const first = array.shift();
386
+ const nextSteps = () => ({
387
+ title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
388
+ "span",
389
+ {
390
+ ...{
391
+ className: "flex items-center space-x-3"
392
+ },
393
+ children: [
394
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Next steps" }),
395
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
396
+ import_badge.default,
397
397
  {
398
398
  ...{
399
- icon: import_arrow_right.default,
400
- justify: "between",
401
- onClick: () => set("next"),
402
- variant: "link"
399
+ type: "warning"
403
400
  },
404
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
405
- "span",
406
- {
407
- ...{
408
- className: "flex-1 min-w-0 text-left whitespace-normal hover:underline"
409
- },
410
- children: first.title
411
- }
412
- )
401
+ children: array.length + 1
413
402
  }
414
403
  )
415
- }
416
- )
417
- }
404
+ ]
405
+ }
406
+ ),
407
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
408
+ "div",
409
+ {
410
+ ...{
411
+ className: "p-6"
412
+ },
413
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
414
+ import_list.default,
415
+ {
416
+ ...{
417
+ items: [
418
+ {
419
+ ...first,
420
+ onClick: () => close()
421
+ },
422
+ ...array.map((props) => ({
423
+ ...props,
424
+ onClick: () => close()
425
+ }))
426
+ ]
427
+ }
428
+ }
429
+ )
430
+ }
431
+ )
432
+ });
433
+ const shown = (0, import_react.useRef)(null);
434
+ const openAll = () => {
435
+ const props = nextSteps();
436
+ shown.current = props.children;
437
+ open(props);
438
+ };
439
+ (0, import_react.useEffect)(
440
+ () => {
441
+ const drawer = queryClient.getQueryData(["drawer"]);
442
+ if (!shown.current || !(drawer == null ? void 0 : drawer.active) || drawer.children !== shown.current) return;
443
+ if (!first) {
444
+ shown.current = null;
445
+ close();
446
+ return;
447
+ }
448
+ openAll();
449
+ },
450
+ // The tasks are the trigger; the rest follows them.
451
+ // eslint-disable-next-line react-hooks/exhaustive-deps
452
+ [items]
418
453
  );
454
+ if (first) {
455
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
456
+ "div",
457
+ {
458
+ ...{
459
+ className: "px-6 md:px-12"
460
+ },
461
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
462
+ "div",
463
+ {
464
+ ...{
465
+ className: "bg-white border border-gray rounded px-4 py-3"
466
+ },
467
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
468
+ "div",
469
+ {
470
+ ...{
471
+ className: "flex items-center justify-between space-x-6"
472
+ },
473
+ children: [
474
+ first && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
475
+ import_list.default,
476
+ {
477
+ ...{
478
+ items: [
479
+ {
480
+ ...first,
481
+ onClick: () => close()
482
+ }
483
+ ],
484
+ svg: false
485
+ }
486
+ }
487
+ ),
488
+ (array == null ? void 0 : array.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
489
+ import_button.default,
490
+ {
491
+ ...{
492
+ icon: import_arrow_right.default,
493
+ inline: true,
494
+ onClick: openAll,
495
+ variant: "link"
496
+ },
497
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
498
+ import_badge.default,
499
+ {
500
+ ...{
501
+ type: "warning"
502
+ },
503
+ children: array.length + 1
504
+ }
505
+ )
506
+ }
507
+ )
508
+ ]
509
+ }
510
+ )
511
+ }
512
+ )
513
+ }
514
+ );
515
+ }
516
+ return null;
419
517
  };
420
518
  const SETTLE_QUIET = 50;
421
519
  const SETTLE_CAP = 3e3;