@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.
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 +7 -3
  18. package/dist/dashboard/form-organization-workflow.mjs +7 -3
  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 +23 -3
  44. package/dist/dashboard/template-socket.mjs +23 -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
@@ -49,6 +49,7 @@ var import_arrow_right = __toESM(require("../icons/arrow-right"));
49
49
  var import_flag = __toESM(require("../icons/flag"));
50
50
  var import_warning = __toESM(require("../icons/warning"));
51
51
  var import_entry = require("./lib/entry");
52
+ var import_motion = require("../shared/lib/motion");
52
53
  const TemplateModal = ({
53
54
  buttons,
54
55
  cart,
@@ -566,7 +567,7 @@ const TemplateModal = ({
566
567
  {
567
568
  ...{
568
569
  transition: true,
569
- className: "z-40 fixed inset-0 flex flex-col w-full scroll-smooth overflow-y-auto hide-scrollbar pt-6 lg:p-6 pointer-events-none transition duration-200 ease-in data-[closed]:translate-y-full"
570
+ className: "z-40 fixed inset-0 flex flex-col w-full scroll-smooth overflow-y-auto hide-scrollbar pt-6 lg:p-6 pointer-events-none data-[closed]:translate-y-full " + import_motion.motion
570
571
  },
571
572
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
572
573
  "div",
@@ -17,6 +17,7 @@ import ArrowRight from "../icons/arrow-right.mjs";
17
17
  import Flag from "../icons/flag.mjs";
18
18
  import Warning from "../icons/warning.mjs";
19
19
  import { copy, formOn, giveawayOn, panelTitle } from "./lib/entry.mjs";
20
+ import { motion } from "../shared/lib/motion.mjs";
20
21
  const TemplateModal = ({
21
22
  buttons,
22
23
  cart,
@@ -534,7 +535,7 @@ const TemplateModal = ({
534
535
  {
535
536
  ...{
536
537
  transition: true,
537
- className: "z-40 fixed inset-0 flex flex-col w-full scroll-smooth overflow-y-auto hide-scrollbar pt-6 lg:p-6 pointer-events-none transition duration-200 ease-in data-[closed]:translate-y-full"
538
+ className: "z-40 fixed inset-0 flex flex-col w-full scroll-smooth overflow-y-auto hide-scrollbar pt-6 lg:p-6 pointer-events-none data-[closed]:translate-y-full " + motion
538
539
  },
539
540
  children: /* @__PURE__ */ jsx(
540
541
  "div",
@@ -31,6 +31,7 @@ __export(buttons_subscription_exports, {
31
31
  SubscriptionBadge: () => SubscriptionBadge,
32
32
  SubscriptionButtons: () => SubscriptionButtons,
33
33
  default: () => buttons_subscription_default,
34
+ formatPeriod: () => formatPeriod,
34
35
  useSubscriptionActions: () => useSubscriptionActions
35
36
  });
36
37
  module.exports = __toCommonJS(buttons_subscription_exports);
@@ -56,28 +57,70 @@ const dateOptions = {
56
57
  month: "short",
57
58
  year: "numeric"
58
59
  };
60
+ const shortDate = {
61
+ day: "numeric",
62
+ month: "short"
63
+ };
64
+ const formatPeriod = ({ end, start }) => {
65
+ const from = new Date(start);
66
+ const to = new Date(end);
67
+ const sameYear = from.getFullYear() === to.getFullYear();
68
+ return (0, import_drawbridge_utils.formatDateString)({
69
+ date: start,
70
+ options: shortDate
71
+ }) + " \u2013 " + (0, import_drawbridge_utils.formatDateString)({
72
+ date: end,
73
+ options: !sameYear ? dateOptions : from.getMonth() === to.getMonth() ? {
74
+ day: "numeric"
75
+ } : shortDate
76
+ });
77
+ };
59
78
  const SubscriptionBadge = ({
79
+ period,
60
80
  plan,
61
81
  subscription
62
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
63
- import_badge.default,
64
- {
65
- ...((subscription == null ? void 0 : subscription.pending) || (subscription == null ? void 0 : subscription.canceledAt)) && {
66
- type: "warning"
67
- },
68
- children: [
69
- (0, import_drawbridge_utils.capitalize)(plan == null ? void 0 : plan.title),
70
- (subscription == null ? void 0 : subscription.pending) && " \u2014 downgrades " + (0, import_drawbridge_utils.formatDateString)({
71
- date: subscription.pending.effectiveAt,
72
- options: dateOptions
73
- }),
74
- !(subscription == null ? void 0 : subscription.pending) && (subscription == null ? void 0 : subscription.canceledAt) && " \u2014 cancels " + (0, import_drawbridge_utils.formatDateString)({
75
- date: subscription.canceledAt,
76
- options: dateOptions
77
- })
78
- ]
79
- }
80
- );
82
+ }) => {
83
+ const warning = Boolean((subscription == null ? void 0 : subscription.pending) || (subscription == null ? void 0 : subscription.canceledAt));
84
+ const title = (0, import_drawbridge_utils.capitalize)(plan == null ? void 0 : plan.title);
85
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
86
+ import_badge.default,
87
+ {
88
+ ...{
89
+ className: "max-w-full min-w-0",
90
+ title,
91
+ ...warning && {
92
+ type: "warning"
93
+ }
94
+ },
95
+ children: [
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
97
+ "span",
98
+ {
99
+ ...{
100
+ className: "truncate me-0"
101
+ },
102
+ children: title
103
+ }
104
+ ),
105
+ (warning || (period == null ? void 0 : period.start) && (period == null ? void 0 : period.end)) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ "span",
107
+ {
108
+ ...{
109
+ className: "shrink-0"
110
+ },
111
+ children: (subscription == null ? void 0 : subscription.pending) ? "\xA0\u2014 downgrades " + (0, import_drawbridge_utils.formatDateString)({
112
+ date: subscription.pending.effectiveAt,
113
+ options: dateOptions
114
+ }) : warning ? "\xA0\u2014 cancels " + (0, import_drawbridge_utils.formatDateString)({
115
+ date: subscription.canceledAt,
116
+ options: dateOptions
117
+ }) : "\xA0\xB7 " + formatPeriod(period)
118
+ }
119
+ )
120
+ ]
121
+ }
122
+ );
123
+ };
81
124
  const useSubscriptionActions = (params) => {
82
125
  var _a, _b, _c;
83
126
  const queryClient = (0, import_react_query.useQueryClient)();
@@ -198,7 +241,8 @@ const useSubscriptionActions = (params) => {
198
241
  },
199
242
  children: [
200
243
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Your subscription will cancel at the end of your current billing period. You'll keep all paid features until then." }),
201
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "After it cancels, your campaigns, pages, brands and prizes will be drafted, and your workflows will be paused. They won't be deleted, but you'll need to reactivate each one if you re-subscribe." }),
244
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "After it cancels, your campaigns' workflows stop running, and your campaigns, pages, brands and prizes will be drafted. They won't be deleted, but you'll need to reactivate each one if you re-subscribe." }),
245
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Your subdomain and page addresses go back to their short IDs, your ads are drafted and your members lose access." }),
202
246
  smsNumber && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
203
247
  "Your SMS number, ",
204
248
  smsNumber.number,
@@ -386,5 +430,6 @@ var buttons_subscription_default = SubscriptionButtons;
386
430
  0 && (module.exports = {
387
431
  SubscriptionBadge,
388
432
  SubscriptionButtons,
433
+ formatPeriod,
389
434
  useSubscriptionActions
390
435
  });
@@ -21,28 +21,70 @@ const dateOptions = {
21
21
  month: "short",
22
22
  year: "numeric"
23
23
  };
24
+ const shortDate = {
25
+ day: "numeric",
26
+ month: "short"
27
+ };
28
+ const formatPeriod = ({ end, start }) => {
29
+ const from = new Date(start);
30
+ const to = new Date(end);
31
+ const sameYear = from.getFullYear() === to.getFullYear();
32
+ return formatDateString({
33
+ date: start,
34
+ options: shortDate
35
+ }) + " \u2013 " + formatDateString({
36
+ date: end,
37
+ options: !sameYear ? dateOptions : from.getMonth() === to.getMonth() ? {
38
+ day: "numeric"
39
+ } : shortDate
40
+ });
41
+ };
24
42
  const SubscriptionBadge = ({
43
+ period,
25
44
  plan,
26
45
  subscription
27
- }) => /* @__PURE__ */ jsxs(
28
- Badge,
29
- {
30
- ...((subscription == null ? void 0 : subscription.pending) || (subscription == null ? void 0 : subscription.canceledAt)) && {
31
- type: "warning"
32
- },
33
- children: [
34
- capitalize(plan == null ? void 0 : plan.title),
35
- (subscription == null ? void 0 : subscription.pending) && " \u2014 downgrades " + formatDateString({
36
- date: subscription.pending.effectiveAt,
37
- options: dateOptions
38
- }),
39
- !(subscription == null ? void 0 : subscription.pending) && (subscription == null ? void 0 : subscription.canceledAt) && " \u2014 cancels " + formatDateString({
40
- date: subscription.canceledAt,
41
- options: dateOptions
42
- })
43
- ]
44
- }
45
- );
46
+ }) => {
47
+ const warning = Boolean((subscription == null ? void 0 : subscription.pending) || (subscription == null ? void 0 : subscription.canceledAt));
48
+ const title = capitalize(plan == null ? void 0 : plan.title);
49
+ return /* @__PURE__ */ jsxs(
50
+ Badge,
51
+ {
52
+ ...{
53
+ className: "max-w-full min-w-0",
54
+ title,
55
+ ...warning && {
56
+ type: "warning"
57
+ }
58
+ },
59
+ children: [
60
+ /* @__PURE__ */ jsx(
61
+ "span",
62
+ {
63
+ ...{
64
+ className: "truncate me-0"
65
+ },
66
+ children: title
67
+ }
68
+ ),
69
+ (warning || (period == null ? void 0 : period.start) && (period == null ? void 0 : period.end)) && /* @__PURE__ */ jsx(
70
+ "span",
71
+ {
72
+ ...{
73
+ className: "shrink-0"
74
+ },
75
+ children: (subscription == null ? void 0 : subscription.pending) ? "\xA0\u2014 downgrades " + formatDateString({
76
+ date: subscription.pending.effectiveAt,
77
+ options: dateOptions
78
+ }) : warning ? "\xA0\u2014 cancels " + formatDateString({
79
+ date: subscription.canceledAt,
80
+ options: dateOptions
81
+ }) : "\xA0\xB7 " + formatPeriod(period)
82
+ }
83
+ )
84
+ ]
85
+ }
86
+ );
87
+ };
46
88
  const useSubscriptionActions = (params) => {
47
89
  var _a, _b, _c;
48
90
  const queryClient = useQueryClient();
@@ -163,7 +205,8 @@ const useSubscriptionActions = (params) => {
163
205
  },
164
206
  children: [
165
207
  /* @__PURE__ */ jsx("p", { children: "Your subscription will cancel at the end of your current billing period. You'll keep all paid features until then." }),
166
- /* @__PURE__ */ jsx("p", { children: "After it cancels, your campaigns, pages, brands and prizes will be drafted, and your workflows will be paused. They won't be deleted, but you'll need to reactivate each one if you re-subscribe." }),
208
+ /* @__PURE__ */ jsx("p", { children: "After it cancels, your campaigns' workflows stop running, and your campaigns, pages, brands and prizes will be drafted. They won't be deleted, but you'll need to reactivate each one if you re-subscribe." }),
209
+ /* @__PURE__ */ jsx("p", { children: "Your subdomain and page addresses go back to their short IDs, your ads are drafted and your members lose access." }),
167
210
  smsNumber && /* @__PURE__ */ jsxs("p", { children: [
168
211
  "Your SMS number, ",
169
212
  smsNumber.number,
@@ -351,5 +394,6 @@ export {
351
394
  SubscriptionBadge,
352
395
  SubscriptionButtons,
353
396
  buttons_subscription_default as default,
397
+ formatPeriod,
354
398
  useSubscriptionActions
355
399
  };
@@ -42,7 +42,7 @@ const CardPaymentMethod = ({
42
42
  "p",
43
43
  {
44
44
  ...{
45
- className: "truncate max-w-[30ch] xl:max-w-[40ch]"
45
+ className: "truncate max-w-[30ch] @[976px]:max-w-[40ch]"
46
46
  },
47
47
  children: name
48
48
  }
@@ -20,7 +20,7 @@ const CardPaymentMethod = ({
20
20
  "p",
21
21
  {
22
22
  ...{
23
- className: "truncate max-w-[30ch] xl:max-w-[40ch]"
23
+ className: "truncate max-w-[30ch] @[976px]:max-w-[40ch]"
24
24
  },
25
25
  children: name
26
26
  }
@@ -81,7 +81,7 @@ const CardSection = ({
81
81
  "div",
82
82
  {
83
83
  ...{
84
- className: "grid grid-cols-1 gap-6 items-start xl:grid-cols-2"
84
+ className: "grid grid-cols-1 gap-6 items-start @[976px]:grid-cols-2"
85
85
  },
86
86
  children: import_react.Children.toArray(children).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
87
  "div",
@@ -89,7 +89,7 @@ const CardSection = ({
89
89
  ...{
90
90
  // The first column ( the form ) runs with the page; the others
91
91
  // stay in view beside it while it scrolls.
92
- className: "min-w-0" + (index ? " xl:sticky xl:top-6" : "")
92
+ className: "min-w-0" + (index ? " @[976px]:sticky @[976px]:top-6" : "")
93
93
  },
94
94
  children: child
95
95
  },
@@ -59,7 +59,7 @@ const CardSection = ({
59
59
  "div",
60
60
  {
61
61
  ...{
62
- className: "grid grid-cols-1 gap-6 items-start xl:grid-cols-2"
62
+ className: "grid grid-cols-1 gap-6 items-start @[976px]:grid-cols-2"
63
63
  },
64
64
  children: Children.toArray(children).map((child, index) => /* @__PURE__ */ jsx(
65
65
  "div",
@@ -67,7 +67,7 @@ const CardSection = ({
67
67
  ...{
68
68
  // The first column ( the form ) runs with the page; the others
69
69
  // stay in view beside it while it scrolls.
70
- className: "min-w-0" + (index ? " xl:sticky xl:top-6" : "")
70
+ className: "min-w-0" + (index ? " @[976px]:sticky @[976px]:top-6" : "")
71
71
  },
72
72
  children: child
73
73
  },
@@ -55,7 +55,9 @@ const CardSetting = ({
55
55
  "div",
56
56
  {
57
57
  ...{
58
- className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
58
+ className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0",
59
+ // On the row, so the guide's ring takes in the label, value and button.
60
+ "data-guide": guide
59
61
  },
60
62
  children: [
61
63
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -69,8 +71,7 @@ const CardSetting = ({
69
71
  "span",
70
72
  {
71
73
  ...{
72
- className: "text-gray-dark break-words @md:w-[33cqw] @md:shrink-0",
73
- "data-guide": guide
74
+ className: "text-gray-dark break-words @md:w-[33cqw] @md:shrink-0"
74
75
  },
75
76
  children: label
76
77
  }
@@ -23,7 +23,9 @@ const CardSetting = ({
23
23
  "div",
24
24
  {
25
25
  ...{
26
- className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
26
+ className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0",
27
+ // On the row, so the guide's ring takes in the label, value and button.
28
+ "data-guide": guide
27
29
  },
28
30
  children: [
29
31
  /* @__PURE__ */ jsxs(
@@ -37,8 +39,7 @@ const CardSetting = ({
37
39
  "span",
38
40
  {
39
41
  ...{
40
- className: "text-gray-dark break-words @md:w-[33cqw] @md:shrink-0",
41
- "data-guide": guide
42
+ className: "text-gray-dark break-words @md:w-[33cqw] @md:shrink-0"
42
43
  },
43
44
  children: label
44
45
  }
@@ -32,12 +32,16 @@ __export(card_task_exports, {
32
32
  module.exports = __toCommonJS(card_task_exports);
33
33
  var import_jsx_runtime = require("react/jsx-runtime");
34
34
  var import_react_query = require("@tanstack/react-query");
35
+ var import_badge = __toESM(require("../shared/badge"));
35
36
  var import_button = __toESM(require("../shared/button"));
36
37
  var import_link = __toESM(require("./link"));
37
38
  var import_hooks = require("./lib/hooks");
38
39
  const CardTask = ({
40
+ badge,
39
41
  className,
40
42
  message,
43
+ // stack: the button under the words, for a card too narrow to sit them side by side.
44
+ stack = false,
41
45
  title,
42
46
  type = "default",
43
47
  ...rest
@@ -46,6 +50,8 @@ const CardTask = ({
46
50
  const types = {
47
51
  default: "bg-gray border border-black",
48
52
  error: "bg-red-light border border-red",
53
+ // White: purple is Drawbridge AI's (Darren, 2026-11-07).
54
+ recommended: "bg-white border border-gray",
49
55
  success: "bg-green-light border border-green",
50
56
  warning: "bg-yellow-light border border-yellow"
51
57
  };
@@ -54,7 +60,7 @@ const CardTask = ({
54
60
  queryClient
55
61
  });
56
62
  const classes = [
57
- "flex flex-col items-start justify-between w-full rounded py-3 px-4 gap-4 md:flex-row md:items-center",
63
+ stack ? "flex flex-col items-start w-full rounded py-3 px-4 gap-3" : "flex flex-col items-start justify-between w-full rounded py-3 px-4 gap-4 md:flex-row md:items-center",
58
64
  types[type]
59
65
  ];
60
66
  if (className) {
@@ -99,10 +105,22 @@ const CardTask = ({
99
105
  "div",
100
106
  {
101
107
  ...{
102
- className: "break-word"
108
+ className: stack ? "break-word w-full space-y-1" : "break-word space-y-1"
103
109
  },
104
110
  children: [
105
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: title }),
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
112
+ badge && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
113
+ import_badge.default,
114
+ {
115
+ ...{
116
+ className: "float-right ml-3 mb-1",
117
+ type: "primary"
118
+ },
119
+ children: badge
120
+ }
121
+ ),
122
+ title
123
+ ] }),
106
124
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
107
125
  "div",
108
126
  {
@@ -119,7 +137,7 @@ const CardTask = ({
119
137
  "div",
120
138
  {
121
139
  ...{
122
- className: "w-full md:w-auto shrink-0"
140
+ className: stack ? "shrink-0" : "w-full md:w-auto shrink-0"
123
141
  },
124
142
  children: button()
125
143
  }
@@ -1,11 +1,15 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useQueryClient } from "@tanstack/react-query";
3
+ import Badge from "../shared/badge.mjs";
3
4
  import Button from "../shared/button.mjs";
4
5
  import Link from "./link.mjs";
5
6
  import { useModal } from "./lib/hooks.mjs";
6
7
  const CardTask = ({
8
+ badge,
7
9
  className,
8
10
  message,
11
+ // stack: the button under the words, for a card too narrow to sit them side by side.
12
+ stack = false,
9
13
  title,
10
14
  type = "default",
11
15
  ...rest
@@ -14,6 +18,8 @@ const CardTask = ({
14
18
  const types = {
15
19
  default: "bg-gray border border-black",
16
20
  error: "bg-red-light border border-red",
21
+ // White: purple is Drawbridge AI's (Darren, 2026-11-07).
22
+ recommended: "bg-white border border-gray",
17
23
  success: "bg-green-light border border-green",
18
24
  warning: "bg-yellow-light border border-yellow"
19
25
  };
@@ -22,7 +28,7 @@ const CardTask = ({
22
28
  queryClient
23
29
  });
24
30
  const classes = [
25
- "flex flex-col items-start justify-between w-full rounded py-3 px-4 gap-4 md:flex-row md:items-center",
31
+ stack ? "flex flex-col items-start w-full rounded py-3 px-4 gap-3" : "flex flex-col items-start justify-between w-full rounded py-3 px-4 gap-4 md:flex-row md:items-center",
26
32
  types[type]
27
33
  ];
28
34
  if (className) {
@@ -67,10 +73,22 @@ const CardTask = ({
67
73
  "div",
68
74
  {
69
75
  ...{
70
- className: "break-word"
76
+ className: stack ? "break-word w-full space-y-1" : "break-word space-y-1"
71
77
  },
72
78
  children: [
73
- /* @__PURE__ */ jsx("p", { children: title }),
79
+ /* @__PURE__ */ jsxs("p", { children: [
80
+ badge && /* @__PURE__ */ jsx(
81
+ Badge,
82
+ {
83
+ ...{
84
+ className: "float-right ml-3 mb-1",
85
+ type: "primary"
86
+ },
87
+ children: badge
88
+ }
89
+ ),
90
+ title
91
+ ] }),
74
92
  /* @__PURE__ */ jsx(
75
93
  "div",
76
94
  {
@@ -87,7 +105,7 @@ const CardTask = ({
87
105
  "div",
88
106
  {
89
107
  ...{
90
- className: "w-full md:w-auto shrink-0"
108
+ className: stack ? "shrink-0" : "w-full md:w-auto shrink-0"
91
109
  },
92
110
  children: button()
93
111
  }
@@ -45,14 +45,14 @@ var import_cdn = require("@drawbridge/drawbridge-utils/cdn");
45
45
  var import_campaign = require("../shared/lib/campaign");
46
46
  const classes = {
47
47
  container: [
48
- "group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in xl:aspect-video 2xl:space-x-12"
48
+ "group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in @[976px]:aspect-video @[1180px]:space-x-12"
49
49
  ],
50
50
  button: [
51
51
  "text-sm flex items-center space-x-2 md:text-base"
52
52
  ],
53
53
  content: [
54
54
  "relative z-10 flex flex-col justify-center",
55
- "space-y-1 w-full h-full xl:space-y-3",
55
+ "space-y-1 w-full h-full @[976px]:space-y-3",
56
56
  "items-start text-left"
57
57
  ],
58
58
  description: [
@@ -69,11 +69,11 @@ const classes = {
69
69
  "block w-full h-full bg-cover bg-center bg-no-repeat shrink-0 rounded"
70
70
  ],
71
71
  outer: [
72
- "aspect-square xl:aspect-[2/3] shrink-0"
72
+ "aspect-square @[976px]:aspect-[2/3] shrink-0"
73
73
  ]
74
74
  },
75
75
  title: [
76
- "text-lg xl:text-2xl"
76
+ "text-lg @[976px]:text-2xl"
77
77
  ],
78
78
  wrapper: [
79
79
  "flex-[0_0_100%]"
@@ -413,7 +413,7 @@ const TileCampaign = ({
413
413
  // generating, and for a finished campaign whose page carries neither
414
414
  // a gallery photo nor a preview image — that case dropped the image
415
415
  // slot entirely and left the slide as text against white.
416
- placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.png",
416
+ placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.svg",
417
417
  title: generating ? (_e = campaign == null ? void 0 : campaign.source) == null ? void 0 : _e.url : campaign == null ? void 0 : campaign.title,
418
418
  view: (_f = page == null ? void 0 : page.share) == null ? void 0 : _f.url
419
419
  }
@@ -442,7 +442,7 @@ const TilePage = ({
442
442
  image: tileImage(page),
443
443
  manage: "/organizations/" + organization + "/campaigns/" + campaign + "/pages/" + (page == null ? void 0 : page.id),
444
444
  percentage: tilePercentage((_d = (_c = page == null ? void 0 : page.process) == null ? void 0 : _c.ai) == null ? void 0 : _d.progress),
445
- placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/pages.png",
445
+ placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/pages.svg",
446
446
  // A generating page has no title of its own yet — the pages list
447
447
  // falls back to the scraped url the same way.
448
448
  title: generating ? (_e = page == null ? void 0 : page.source) == null ? void 0 : _e.url : page == null ? void 0 : page.title,
@@ -11,14 +11,14 @@ import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
11
11
  import { leadCapture } from "../shared/lib/campaign.mjs";
12
12
  const classes = {
13
13
  container: [
14
- "group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in xl:aspect-video 2xl:space-x-12"
14
+ "group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in @[976px]:aspect-video @[1180px]:space-x-12"
15
15
  ],
16
16
  button: [
17
17
  "text-sm flex items-center space-x-2 md:text-base"
18
18
  ],
19
19
  content: [
20
20
  "relative z-10 flex flex-col justify-center",
21
- "space-y-1 w-full h-full xl:space-y-3",
21
+ "space-y-1 w-full h-full @[976px]:space-y-3",
22
22
  "items-start text-left"
23
23
  ],
24
24
  description: [
@@ -35,11 +35,11 @@ const classes = {
35
35
  "block w-full h-full bg-cover bg-center bg-no-repeat shrink-0 rounded"
36
36
  ],
37
37
  outer: [
38
- "aspect-square xl:aspect-[2/3] shrink-0"
38
+ "aspect-square @[976px]:aspect-[2/3] shrink-0"
39
39
  ]
40
40
  },
41
41
  title: [
42
- "text-lg xl:text-2xl"
42
+ "text-lg @[976px]:text-2xl"
43
43
  ],
44
44
  wrapper: [
45
45
  "flex-[0_0_100%]"
@@ -379,7 +379,7 @@ const TileCampaign = ({
379
379
  // generating, and for a finished campaign whose page carries neither
380
380
  // a gallery photo nor a preview image — that case dropped the image
381
381
  // slot entirely and left the slide as text against white.
382
- placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.png",
382
+ placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.svg",
383
383
  title: generating ? (_e = campaign == null ? void 0 : campaign.source) == null ? void 0 : _e.url : campaign == null ? void 0 : campaign.title,
384
384
  view: (_f = page == null ? void 0 : page.share) == null ? void 0 : _f.url
385
385
  }
@@ -408,7 +408,7 @@ const TilePage = ({
408
408
  image: tileImage(page),
409
409
  manage: "/organizations/" + organization + "/campaigns/" + campaign + "/pages/" + (page == null ? void 0 : page.id),
410
410
  percentage: tilePercentage((_d = (_c = page == null ? void 0 : page.process) == null ? void 0 : _c.ai) == null ? void 0 : _d.progress),
411
- placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/pages.png",
411
+ placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/pages.svg",
412
412
  // A generating page has no title of its own yet — the pages list
413
413
  // falls back to the scraped url the same way.
414
414
  title: generating ? (_e = page == null ? void 0 : page.source) == null ? void 0 : _e.url : page == null ? void 0 : page.title,
@@ -33,6 +33,8 @@ module.exports = __toCommonJS(drawer_exports);
33
33
  var import_jsx_runtime = require("react/jsx-runtime");
34
34
  var import_react = require("react");
35
35
  var import_react2 = require("@headlessui/react");
36
+ var import_escape = require("./lib/escape");
37
+ var import_motion = require("../shared/lib/motion");
36
38
  var import_times = __toESM(require("../icons/times"));
37
39
  var import_button = __toESM(require("../shared/button"));
38
40
  var import_form = require("../shared/lib/form");
@@ -46,6 +48,8 @@ const Drawer = ({
46
48
  overlay = true,
47
49
  title
48
50
  }) => {
51
+ const close = (0, import_react.useRef)(null);
52
+ (0, import_escape.useEscape)(active, close);
49
53
  const classes = {
50
54
  drawer: [
51
55
  className,
@@ -54,9 +58,9 @@ const Drawer = ({
54
58
  // Enter slides in immediately (no delay): the panel used to wait
55
59
  // 300ms at translate-x-full, so a reopen before the previous leave
56
60
  // finished re-entered stuck off-screen for that delay. Leave stays
57
- // immediate; the overlay lingers 300ms so the panel slides out
61
+ // immediate; the overlay lingers 100ms so the panel slides out
58
62
  // first on close.
59
- "transition duration-200 ease-in",
63
+ import_motion.motion,
60
64
  "data-[closed]:translate-x-full"
61
65
  ],
62
66
  header: [
@@ -103,6 +107,7 @@ const Drawer = ({
103
107
  "data-guard": "drawer",
104
108
  inline: true,
105
109
  onClick: onClose,
110
+ ref: close,
106
111
  variant: "link"
107
112
  },
108
113
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(