@drawbridge/components 0.1.31 → 0.1.33

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 (69) hide show
  1. package/dist/bridge/template-modal.js +2 -1
  2. package/dist/bridge/template-modal.mjs +2 -1
  3. package/dist/dashboard/buttons-subscription.js +65 -20
  4. package/dist/dashboard/buttons-subscription.mjs +64 -20
  5. package/dist/dashboard/card-payment-method.js +1 -1
  6. package/dist/dashboard/card-payment-method.mjs +1 -1
  7. package/dist/dashboard/card-section.js +2 -2
  8. package/dist/dashboard/card-section.mjs +2 -2
  9. package/dist/dashboard/card-setting.js +4 -3
  10. package/dist/dashboard/card-setting.mjs +4 -3
  11. package/dist/dashboard/card-task.js +22 -4
  12. package/dist/dashboard/card-task.mjs +22 -4
  13. package/dist/dashboard/card-tile.js +6 -6
  14. package/dist/dashboard/card-tile.mjs +6 -6
  15. package/dist/dashboard/drawer.js +7 -2
  16. package/dist/dashboard/drawer.mjs +8 -3
  17. package/dist/dashboard/form-organization-workflow.js +87 -65
  18. package/dist/dashboard/form-organization-workflow.mjs +87 -65
  19. package/dist/dashboard/input-combobox.js +7 -2
  20. package/dist/dashboard/input-combobox.mjs +7 -2
  21. package/dist/dashboard/lib/escape.js +48 -0
  22. package/dist/dashboard/lib/escape.mjs +25 -0
  23. package/dist/dashboard/lib/rail.js +75 -0
  24. package/dist/dashboard/lib/rail.mjs +46 -0
  25. package/dist/dashboard/lib/throttle.js +57 -0
  26. package/dist/dashboard/lib/throttle.mjs +34 -0
  27. package/dist/dashboard/list.js +1 -1
  28. package/dist/dashboard/list.mjs +1 -1
  29. package/dist/dashboard/menu.js +188 -96
  30. package/dist/dashboard/menu.mjs +189 -97
  31. package/dist/dashboard/modal.js +9 -3
  32. package/dist/dashboard/modal.mjs +10 -4
  33. package/dist/dashboard/notice.js +5 -3
  34. package/dist/dashboard/notice.mjs +5 -3
  35. package/dist/dashboard/table-cell-title.js +2 -0
  36. package/dist/dashboard/table-cell-title.mjs +2 -0
  37. package/dist/dashboard/table.js +61 -20
  38. package/dist/dashboard/table.mjs +61 -20
  39. package/dist/dashboard/template-dashboard.js +35 -133
  40. package/dist/dashboard/template-dashboard.mjs +36 -134
  41. package/dist/dashboard/template-rail.js +674 -0
  42. package/dist/dashboard/template-rail.mjs +640 -0
  43. package/dist/dashboard/template-socket.js +19 -3
  44. package/dist/dashboard/template-socket.mjs +19 -3
  45. package/dist/dashboard/template-ui.js +150 -186
  46. package/dist/dashboard/template-ui.mjs +151 -187
  47. package/dist/icons/book-open.js +46 -0
  48. package/dist/icons/book-open.mjs +27 -0
  49. package/dist/icons/task.js +46 -0
  50. package/dist/icons/task.mjs +27 -0
  51. package/dist/shared/lib/helpers.js +9 -2
  52. package/dist/shared/lib/helpers.mjs +9 -2
  53. package/dist/shared/lib/motion.js +27 -0
  54. package/dist/shared/lib/motion.mjs +4 -0
  55. package/dist/shared/overlay.js +5 -3
  56. package/dist/shared/overlay.mjs +5 -3
  57. package/package.json +28 -13
  58. package/types/dashboard/card-task.d.ts +5 -1
  59. package/types/dashboard/lib/rail.d.ts +32 -0
  60. package/types/dashboard/lib/throttle.d.ts +5 -0
  61. package/types/dashboard/table.d.ts +3 -1
  62. package/types/dashboard/template-dashboard.d.ts +4 -1
  63. package/types/dashboard/template-rail.d.ts +36 -0
  64. package/types/dashboard/template-ui.d.ts +2 -2
  65. package/types/icons/book-open.d.ts +5 -0
  66. package/types/icons/task.d.ts +5 -0
  67. package/dist/dashboard/guide.js +0 -238
  68. package/dist/dashboard/guide.mjs +0 -209
  69. package/types/dashboard/guide.d.ts +0 -23
@@ -0,0 +1,674 @@
1
+ "use client";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var template_rail_exports = {};
30
+ __export(template_rail_exports, {
31
+ TemplateRailBook: () => TemplateRailBook,
32
+ default: () => template_rail_default,
33
+ useRail: () => useRail
34
+ });
35
+ module.exports = __toCommonJS(template_rail_exports);
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_react = require("react");
38
+ var import_react_dom = require("react-dom");
39
+ var import_react_query = require("@tanstack/react-query");
40
+ var import_rail = require("./lib/rail");
41
+ var import_card_task = __toESM(require("./card-task"));
42
+ var import_badge = __toESM(require("../shared/badge"));
43
+ var import_button = __toESM(require("../shared/button"));
44
+ var import_empty = __toESM(require("../shared/empty"));
45
+ var import_tooltip = __toESM(require("../shared/tooltip"));
46
+ var import_book_open = __toESM(require("../icons/book-open"));
47
+ var import_task = __toESM(require("../icons/task"));
48
+ var import_times = __toESM(require("../icons/times"));
49
+ const titles = {
50
+ guide: "Screen guide",
51
+ next: "Next steps"
52
+ };
53
+ const RING_MS = 3e3;
54
+ const useRail = () => {
55
+ var _a;
56
+ const queryClient = (0, import_react_query.useQueryClient)();
57
+ const rail = (0, import_react_query.useQuery)({
58
+ queryFn: () => ({
59
+ panel: null
60
+ }),
61
+ queryKey: ["rail"]
62
+ });
63
+ return {
64
+ panel: ((_a = rail.data) == null ? void 0 : _a.panel) || null,
65
+ set: (panel) => queryClient.setQueryData(
66
+ ["rail"],
67
+ {
68
+ panel
69
+ }
70
+ )
71
+ };
72
+ };
73
+ const Group = ({
74
+ items,
75
+ onFollow,
76
+ title
77
+ }) => items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
78
+ "section",
79
+ {
80
+ ...{
81
+ className: "space-y-3"
82
+ },
83
+ children: [
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
85
+ "p",
86
+ {
87
+ ...{
88
+ className: "flex items-center gap-2 text-sm text-gray-dark"
89
+ },
90
+ children: [
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: title }),
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
93
+ import_badge.default,
94
+ {
95
+ ...{
96
+ size: "small"
97
+ },
98
+ children: items.length
99
+ }
100
+ )
101
+ ]
102
+ }
103
+ ),
104
+ items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
105
+ import_card_task.default,
106
+ {
107
+ ...{
108
+ badge: item.area,
109
+ message: item.why,
110
+ stack: true,
111
+ title: item.title,
112
+ type: item.kind === "required" ? "warning" : "recommended",
113
+ ...item.href && {
114
+ button: {
115
+ href: item.href,
116
+ onClick: onFollow,
117
+ text: item.button
118
+ }
119
+ }
120
+ }
121
+ },
122
+ item.href + item.title + index
123
+ ))
124
+ ]
125
+ }
126
+ );
127
+ const NextSteps = ({
128
+ items,
129
+ onFollow
130
+ }) => items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
+ import_empty.default,
132
+ {
133
+ ...{
134
+ variant: "secondary"
135
+ },
136
+ children: "Everything is up to date"
137
+ }
138
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
139
+ "div",
140
+ {
141
+ ...{
142
+ className: "space-y-6"
143
+ },
144
+ children: [
145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
146
+ Group,
147
+ {
148
+ ...{
149
+ items: items.filter(({ kind }) => kind === "required"),
150
+ onFollow,
151
+ title: "Required"
152
+ }
153
+ }
154
+ ),
155
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
156
+ Group,
157
+ {
158
+ ...{
159
+ items: items.filter(({ kind }) => kind === "recommended"),
160
+ onFollow,
161
+ title: "Recommended"
162
+ }
163
+ }
164
+ )
165
+ ]
166
+ }
167
+ );
168
+ const ScreenGuide = ({
169
+ guide,
170
+ onShow
171
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
172
+ "ol",
173
+ {
174
+ ...{
175
+ className: "divide-y divide-gray"
176
+ },
177
+ children: guide.steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
178
+ "li",
179
+ {
180
+ ...{
181
+ className: "grid grid-cols-[28px_minmax(0,1fr)] gap-3 py-4 first:pt-0 last:pb-0"
182
+ },
183
+ children: [
184
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
185
+ import_badge.default,
186
+ {
187
+ ...{
188
+ className: "self-start"
189
+ },
190
+ children: index + 1
191
+ }
192
+ ),
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
194
+ "div",
195
+ {
196
+ ...{
197
+ className: "space-y-2 min-w-0"
198
+ },
199
+ children: [
200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
201
+ "p",
202
+ {
203
+ ...{
204
+ className: "font-medium"
205
+ },
206
+ children: step.title
207
+ }
208
+ ),
209
+ step.content.map((line, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
210
+ "p",
211
+ {
212
+ ...{
213
+ className: "text-sm"
214
+ },
215
+ children: line
216
+ },
217
+ key
218
+ )),
219
+ step.target !== "body" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
220
+ import_button.default,
221
+ {
222
+ ...{
223
+ inline: true,
224
+ onClick: () => onShow(step.target),
225
+ size: "small",
226
+ variant: "secondary"
227
+ },
228
+ children: "Show me"
229
+ }
230
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
231
+ "p",
232
+ {
233
+ ...{
234
+ className: "text-sm text-gray-dark"
235
+ },
236
+ children: "Applies to the whole screen"
237
+ }
238
+ )
239
+ ]
240
+ }
241
+ )
242
+ ]
243
+ },
244
+ index
245
+ ))
246
+ }
247
+ );
248
+ const RailButton = ({
249
+ count,
250
+ icon: Icon,
251
+ label,
252
+ onClick,
253
+ pressed
254
+ }) => {
255
+ const [hovered, setHovered] = (0, import_react.useState)(false);
256
+ const open = hovered && !pressed;
257
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
258
+ import_tooltip.default,
259
+ {
260
+ ...{
261
+ content: label,
262
+ open,
263
+ placement: "left",
264
+ // Shut is not drawn at all: a closing label faded over the panel.
265
+ ...!open && {
266
+ styles: {
267
+ floater: {
268
+ display: "none"
269
+ }
270
+ }
271
+ }
272
+ },
273
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
274
+ import_button.default,
275
+ {
276
+ ...{
277
+ "aria-label": count ? label + ", " + count + " required" : label,
278
+ "aria-pressed": pressed,
279
+ inline: true,
280
+ onClick: () => {
281
+ setHovered(false);
282
+ onClick();
283
+ },
284
+ onMouseEnter: () => setHovered(true),
285
+ onMouseLeave: () => setHovered(false),
286
+ variant: "link"
287
+ },
288
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
289
+ "span",
290
+ {
291
+ ...{
292
+ className: "relative flex items-center justify-center w-9 h-9 rounded transition duration-300 " + (pressed ? "bg-gray-light ring-1 ring-gray" : "hover:bg-gray-light")
293
+ },
294
+ children: [
295
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
296
+ Icon,
297
+ {
298
+ ...{
299
+ className: "w-5 h-5"
300
+ }
301
+ }
302
+ ),
303
+ count > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
304
+ import_badge.default,
305
+ {
306
+ ...{
307
+ className: "absolute -top-1.5 -right-1 px-1!",
308
+ size: "small",
309
+ type: "warning"
310
+ },
311
+ children: count
312
+ }
313
+ )
314
+ ]
315
+ }
316
+ )
317
+ }
318
+ )
319
+ }
320
+ );
321
+ };
322
+ const Ring = ({
323
+ rect
324
+ }) => rect && (0, import_react_dom.createPortal)(
325
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
326
+ "div",
327
+ {
328
+ ...{
329
+ "data-rail-ring": true,
330
+ className: "fixed z-[60] rounded pointer-events-none ring-4 ring-green-dark ring-offset-2 ring-offset-white",
331
+ style: {
332
+ height: rect.height,
333
+ left: rect.left,
334
+ top: rect.top,
335
+ width: rect.width
336
+ }
337
+ }
338
+ }
339
+ ),
340
+ document.body
341
+ );
342
+ const scrollBox = (element) => {
343
+ let box = element.parentElement;
344
+ while (box && !(/auto|scroll/.test(getComputedStyle(box).overflowY) && box.scrollHeight > box.clientHeight)) {
345
+ box = box.parentElement;
346
+ }
347
+ ;
348
+ return box;
349
+ };
350
+ const scrollTo = (box, element) => {
351
+ const from = box.getBoundingClientRect();
352
+ const to = element.getBoundingClientRect();
353
+ box.scrollTo({
354
+ behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth",
355
+ top: box.scrollTop + to.top - from.top - (box.clientHeight - to.height) / 2
356
+ });
357
+ };
358
+ const TemplateRail = ({
359
+ account,
360
+ campaign,
361
+ children,
362
+ guide,
363
+ organization,
364
+ params = {},
365
+ path = ""
366
+ }) => {
367
+ const queryClient = (0, import_react_query.useQueryClient)();
368
+ const { panel, set } = useRail();
369
+ const page = (0, import_react_query.useQuery)({
370
+ enabled: false,
371
+ // the page's builder loads it
372
+ queryKey: ["organization-campaign-page", params]
373
+ });
374
+ const items = (0, import_rail.railItems)({
375
+ account,
376
+ campaign,
377
+ organization,
378
+ page: page.data,
379
+ params,
380
+ path
381
+ });
382
+ const view = (0, import_rail.railView)({
383
+ guide,
384
+ panel
385
+ });
386
+ const toggle = (next) => set(view === next ? null : next);
387
+ const close = () => set(null);
388
+ const aside = (0, import_react.useRef)(null);
389
+ const opened = (0, import_react.useRef)(Boolean(view));
390
+ const arrived = (0, import_react.useRef)(Boolean(view));
391
+ if (!view) arrived.current = false;
392
+ const opener = (0, import_react.useRef)(null);
393
+ const [ring, setRing] = (0, import_react.useState)(null);
394
+ const [rect, setRect] = (0, import_react.useState)(null);
395
+ const [away, setAway] = (0, import_react.useState)(false);
396
+ (0, import_react.useEffect)(
397
+ () => {
398
+ if (!ring) return void 0;
399
+ const element = document.querySelector(ring.target);
400
+ const box = element && scrollBox(element);
401
+ const shown = element && element.getClientRects().length > 0 && (0, import_rail.railOnScreen)(
402
+ (box || element).getBoundingClientRect(),
403
+ {
404
+ height: window.innerHeight,
405
+ width: window.innerWidth
406
+ }
407
+ );
408
+ if (!shown) {
409
+ queryClient.setQueryData(
410
+ ["notice"],
411
+ {
412
+ active: true,
413
+ response: {
414
+ message: "That isn't on this page right now"
415
+ }
416
+ }
417
+ );
418
+ setRing(null);
419
+ return void 0;
420
+ }
421
+ if (box) scrollTo(box, element);
422
+ const end = Date.now() + RING_MS;
423
+ let frame;
424
+ const step = () => {
425
+ if (Date.now() > end || !element.isConnected) {
426
+ setRect(null);
427
+ setAway(false);
428
+ setRing(null);
429
+ return;
430
+ }
431
+ const box2 = element.getBoundingClientRect();
432
+ setRect(box2);
433
+ setAway(aside.current ? (0, import_rail.railOverlap)(box2, aside.current.getBoundingClientRect()) : false);
434
+ frame = window.requestAnimationFrame(step);
435
+ };
436
+ step();
437
+ return () => {
438
+ window.cancelAnimationFrame(frame);
439
+ setRect(null);
440
+ setAway(false);
441
+ };
442
+ },
443
+ [queryClient, ring]
444
+ );
445
+ (0, import_react.useEffect)(
446
+ () => {
447
+ var _a, _b;
448
+ const open = Boolean(view);
449
+ if (open === opened.current) return;
450
+ opened.current = open;
451
+ if (open) {
452
+ opener.current = document.activeElement;
453
+ (_a = aside.current) == null ? void 0 : _a.focus();
454
+ return;
455
+ }
456
+ if ((_b = opener.current) == null ? void 0 : _b.isConnected) opener.current.focus();
457
+ opener.current = null;
458
+ },
459
+ [view]
460
+ );
461
+ const phone = () => window.matchMedia("(max-width: 767px)").matches;
462
+ const onKeyDown = (event) => {
463
+ if (event.key === "Escape") {
464
+ event.preventDefault();
465
+ close();
466
+ return;
467
+ }
468
+ if (event.key !== "Tab" || !phone()) return;
469
+ const next = (0, import_rail.railTabTarget)({
470
+ active: document.activeElement,
471
+ items: [...aside.current.querySelectorAll("a[href], button:not([disabled])")],
472
+ shift: event.shiftKey
473
+ });
474
+ if (next) {
475
+ event.preventDefault();
476
+ next.focus();
477
+ }
478
+ };
479
+ const onFollow = () => {
480
+ if (phone()) close();
481
+ };
482
+ const onShow = (target) => setRing({
483
+ nonce: Date.now(),
484
+ target
485
+ });
486
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
487
+ "div",
488
+ {
489
+ ...{
490
+ className: "relative flex h-full w-full min-w-0 md:w-3/4 lg:w-4/5"
491
+ },
492
+ children: [
493
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
494
+ "div",
495
+ {
496
+ ...{
497
+ className: "@container flex flex-col h-full flex-1 min-w-0"
498
+ },
499
+ children
500
+ }
501
+ ),
502
+ view && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
503
+ "aside",
504
+ {
505
+ ...{
506
+ "aria-label": titles[view],
507
+ className: "fixed inset-0 z-[35] flex flex-col bg-white outline-none transition duration-200 ease-out motion-reduce:transition-none md:absolute md:inset-auto md:top-0 md:bottom-0 md:right-12 md:z-20 md:w-96 md:border-l md:border-gray 2xl:static 2xl:z-auto 2xl:h-full 2xl:shrink-0 " + (arrived.current ? "" : "starting:opacity-0 starting:translate-x-4 ") + (away ? "opacity-0 pointer-events-none" : ""),
508
+ onKeyDown,
509
+ ref: aside,
510
+ tabIndex: -1
511
+ },
512
+ children: [
513
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
514
+ "div",
515
+ {
516
+ ...{
517
+ className: "flex items-center justify-between h-14 px-6 shrink-0 border-b border-gray"
518
+ },
519
+ children: [
520
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
521
+ "span",
522
+ {
523
+ ...{
524
+ className: "font-medium"
525
+ },
526
+ children: titles[view]
527
+ }
528
+ ),
529
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
530
+ "span",
531
+ {
532
+ ...{
533
+ className: "flex md:hidden"
534
+ },
535
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
536
+ import_button.default,
537
+ {
538
+ ...{
539
+ "aria-label": "Close",
540
+ inline: true,
541
+ onClick: close,
542
+ variant: "link"
543
+ },
544
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
545
+ import_times.default,
546
+ {
547
+ ...{
548
+ className: "w-6 h-6"
549
+ }
550
+ }
551
+ )
552
+ }
553
+ )
554
+ }
555
+ )
556
+ ]
557
+ }
558
+ ),
559
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
560
+ "div",
561
+ {
562
+ ...{
563
+ className: "flex-1 min-h-0 overflow-y-auto p-6"
564
+ },
565
+ children: [
566
+ view === "next" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
567
+ NextSteps,
568
+ {
569
+ ...{
570
+ items,
571
+ onFollow
572
+ }
573
+ }
574
+ ),
575
+ view === "guide" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
576
+ ScreenGuide,
577
+ {
578
+ ...{
579
+ guide,
580
+ onShow
581
+ }
582
+ }
583
+ )
584
+ ]
585
+ }
586
+ )
587
+ ]
588
+ }
589
+ ),
590
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
591
+ "nav",
592
+ {
593
+ ...{
594
+ "aria-label": "Rail",
595
+ className: "hidden md:flex flex-col items-center gap-2 w-12 h-full shrink-0 py-3 bg-white border-l border-gray relative z-20"
596
+ },
597
+ children: [
598
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
599
+ RailButton,
600
+ {
601
+ ...{
602
+ count: (0, import_rail.railCount)(items),
603
+ icon: import_task.default,
604
+ label: titles.next,
605
+ onClick: () => toggle("next"),
606
+ pressed: view === "next"
607
+ }
608
+ }
609
+ ),
610
+ guide && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
611
+ RailButton,
612
+ {
613
+ ...{
614
+ icon: import_book_open.default,
615
+ label: titles.guide,
616
+ onClick: () => toggle("guide"),
617
+ pressed: view === "guide"
618
+ }
619
+ }
620
+ )
621
+ ]
622
+ }
623
+ ),
624
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
625
+ Ring,
626
+ {
627
+ ...{
628
+ rect
629
+ }
630
+ }
631
+ )
632
+ ]
633
+ }
634
+ );
635
+ };
636
+ const TemplateRailBook = ({
637
+ guide
638
+ }) => {
639
+ const { set } = useRail();
640
+ if (!guide) return null;
641
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
642
+ "div",
643
+ {
644
+ ...{
645
+ className: "flex text-white transform duration-300 hover:opacity-70 md:hidden"
646
+ },
647
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
648
+ import_button.default,
649
+ {
650
+ ...{
651
+ "aria-label": titles.guide,
652
+ inline: true,
653
+ onClick: () => set("guide"),
654
+ variant: "link"
655
+ },
656
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
657
+ import_book_open.default,
658
+ {
659
+ ...{
660
+ className: "w-6 h-6 shrink-0"
661
+ }
662
+ }
663
+ )
664
+ }
665
+ )
666
+ }
667
+ );
668
+ };
669
+ var template_rail_default = TemplateRail;
670
+ // Annotate the CommonJS export names for ESM import in node:
671
+ 0 && (module.exports = {
672
+ TemplateRailBook,
673
+ useRail
674
+ });