@drawbridge/components 0.1.46 → 0.1.47
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/form-subdomain-shop.js +4 -1
- package/dist/bridge/form-subdomain-shop.mjs +4 -1
- package/dist/bridge/form-subdomain.js +23 -5
- package/dist/bridge/form-subdomain.mjs +23 -5
- package/dist/bridge/lib/entry.js +41 -0
- package/dist/bridge/lib/entry.mjs +40 -0
- package/dist/bridge/product-tile.js +4 -0
- package/dist/bridge/product-tile.mjs +4 -0
- package/dist/bridge/template-layout.js +27 -8
- package/dist/bridge/template-layout.mjs +28 -9
- package/dist/bridge/template-modal.js +11 -1
- package/dist/bridge/template-modal.mjs +11 -1
- package/dist/dashboard/avatar.js +2 -3
- package/dist/dashboard/avatar.mjs +2 -3
- package/dist/dashboard/campaign-form.js +172 -153
- package/dist/dashboard/campaign-form.mjs +172 -153
- package/dist/dashboard/campaign-share.js +347 -0
- package/dist/dashboard/campaign-share.mjs +314 -0
- package/dist/dashboard/card-affiliate.js +1 -1
- package/dist/dashboard/card-affiliate.mjs +1 -1
- package/dist/dashboard/card-campaign-switch.js +4 -1
- package/dist/dashboard/card-campaign-switch.mjs +4 -1
- package/dist/dashboard/form-organization-campaign-page.js +73 -39
- package/dist/dashboard/form-organization-campaign-page.mjs +73 -39
- package/dist/dashboard/input-combobox.js +6 -0
- package/dist/dashboard/input-combobox.mjs +6 -0
- package/dist/dashboard/input-fields.js +26 -3
- package/dist/dashboard/input-fields.mjs +26 -3
- package/dist/dashboard/input-font.js +2 -0
- package/dist/dashboard/input-font.mjs +2 -0
- package/dist/dashboard/input-group-ai.js +15 -3
- package/dist/dashboard/input-group-ai.mjs +15 -3
- package/dist/dashboard/lib/ab-tests.js +2 -2
- package/dist/dashboard/lib/ab-tests.mjs +2 -2
- package/dist/dashboard/lib/menu.js +19 -0
- package/dist/dashboard/lib/menu.mjs +18 -0
- package/dist/dashboard/menu.js +13 -2
- package/dist/dashboard/menu.mjs +13 -2
- package/dist/dashboard/preview.js +119 -52
- package/dist/dashboard/preview.mjs +119 -52
- package/dist/dashboard/recharts.js +10 -4
- package/dist/dashboard/recharts.mjs +10 -4
- package/dist/dashboard/template-dashboard.js +11 -1
- package/dist/dashboard/template-dashboard.mjs +11 -1
- package/dist/dashboard/template-design.js +209 -130
- package/dist/dashboard/template-design.mjs +210 -131
- package/dist/dashboard/template-ui.js +157 -55
- package/dist/dashboard/template-ui.mjs +158 -56
- package/dist/icons/flags.js +134 -0
- package/dist/icons/flags.mjs +115 -0
- package/dist/shared/carousel.js +14 -5
- package/dist/shared/carousel.mjs +14 -5
- package/package.json +11 -1
- package/types/bridge/form-subdomain.d.ts +13 -0
- package/types/bridge/lib/entry.d.ts +5 -0
- package/types/bridge/product-tile.d.ts +2 -0
- package/types/dashboard/campaign-share.d.ts +16 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +8 -1
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/preview.d.ts +11 -3
- package/types/icons/flags.d.ts +5 -0
|
@@ -45,6 +45,9 @@ var import_switch = __toESM(require("../icons/switch"));
|
|
|
45
45
|
var import_times = __toESM(require("../icons/times"));
|
|
46
46
|
var import_link = __toESM(require("./link"));
|
|
47
47
|
var import_arrow_left = __toESM(require("../icons/arrow-left"));
|
|
48
|
+
var import_cog = __toESM(require("../icons/cog"));
|
|
49
|
+
var import_indicator = __toESM(require("../shared/indicator"));
|
|
50
|
+
var import_menu3 = require("./lib/menu");
|
|
48
51
|
var import_button = __toESM(require("../shared/button"));
|
|
49
52
|
var import_form = require("../shared/lib/form");
|
|
50
53
|
var import_helpers = require("../shared/lib/helpers");
|
|
@@ -56,70 +59,136 @@ const isAccountPath = (path) => path === "/account" || path.startsWith("/account
|
|
|
56
59
|
const TemplateUIHeaderBack = ({
|
|
57
60
|
href,
|
|
58
61
|
icon: Icon = import_arrow_left.default,
|
|
62
|
+
label,
|
|
63
|
+
level,
|
|
59
64
|
title
|
|
60
65
|
}) => {
|
|
61
66
|
const scope = (0, import_react.useContext)(import_form.FormScope);
|
|
62
67
|
return (
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
// min-w-0 lets the header shrink the row, so a long title truncates.
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
66
70
|
"div",
|
|
67
71
|
{
|
|
68
72
|
...{
|
|
69
|
-
className: "
|
|
73
|
+
className: "flex items-center w-full min-w-0 h-9 gap-3"
|
|
70
74
|
},
|
|
71
|
-
children:
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
...{
|
|
80
|
+
className: "shrink-0 transform duration-300 hover:opacity-70"
|
|
81
|
+
},
|
|
82
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
import_button.default,
|
|
84
|
+
{
|
|
85
|
+
...{
|
|
86
|
+
"aria-label": label,
|
|
87
|
+
"data-guard": scope,
|
|
88
|
+
element: import_link.default,
|
|
89
|
+
href,
|
|
90
|
+
variant: "link"
|
|
91
|
+
},
|
|
92
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
+
Icon,
|
|
94
|
+
{
|
|
95
|
+
...{
|
|
96
|
+
"aria-hidden": true,
|
|
97
|
+
className: "bg-gray-dark w-9 h-9 p-2.5 rounded-md text-white"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
106
|
+
"span",
|
|
107
|
+
{
|
|
108
|
+
...{
|
|
109
|
+
// pt-0.5: capitals have no descenders, so the pair reads 2px high
|
|
110
|
+
// beside the 36px buttons without it ( Darren, 2026-11-22 ).
|
|
111
|
+
className: "flex flex-col min-w-0 pt-1 leading-tight"
|
|
112
|
+
},
|
|
113
|
+
children: [
|
|
114
|
+
level && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
...{
|
|
118
|
+
className: "text-[10px] text-white/40 uppercase tracking-wider"
|
|
119
|
+
},
|
|
120
|
+
children: level
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
124
|
+
"span",
|
|
125
|
+
{
|
|
126
|
+
...{
|
|
127
|
+
className: "truncate text-white"
|
|
128
|
+
},
|
|
129
|
+
children: title
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
const TemplateUIHeaderSettings = ({
|
|
141
|
+
active,
|
|
142
|
+
error,
|
|
143
|
+
href
|
|
144
|
+
}) => {
|
|
145
|
+
const scope = (0, import_react.useContext)(import_form.FormScope);
|
|
146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
...{
|
|
150
|
+
// Impeccable audit, 2026-11-21: the link fills the whole lit box, so a
|
|
151
|
+
// click anywhere on it opens Settings, not only on the icon.
|
|
152
|
+
className: "relative flex items-center justify-center w-9 h-9 shrink-0 rounded-md transform duration-300 [&>a]:absolute [&>a]:inset-0 [&>a]:!w-full [&>a]:h-full [&>a]:flex [&>a]:items-center [&>a]:justify-center " + (active ? "bg-gray-dark" : "hover:bg-gray-dark/50")
|
|
153
|
+
},
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
156
|
import_button.default,
|
|
73
157
|
{
|
|
74
158
|
...{
|
|
159
|
+
"aria-label": "Settings",
|
|
75
160
|
"data-guard": scope,
|
|
161
|
+
"data-guide": "button-settings",
|
|
76
162
|
element: import_link.default,
|
|
77
163
|
href,
|
|
78
|
-
|
|
164
|
+
inline: true,
|
|
79
165
|
variant: "link"
|
|
80
166
|
},
|
|
81
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
82
|
-
|
|
167
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
168
|
+
import_cog.default,
|
|
83
169
|
{
|
|
84
170
|
...{
|
|
85
|
-
className: "
|
|
86
|
-
}
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
|
-
Icon,
|
|
90
|
-
{
|
|
91
|
-
...{
|
|
92
|
-
className: "bg-gray-dark w-9 h-9 p-2.5 rounded-md text-white shrink-0"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
-
"span",
|
|
98
|
-
{
|
|
99
|
-
...{
|
|
100
|
-
className: "flex flex-col leading-tight space-y-1 py-1 w-full truncate"
|
|
101
|
-
},
|
|
102
|
-
children: title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
-
"span",
|
|
104
|
-
{
|
|
105
|
-
...{
|
|
106
|
-
className: "w-full truncate text-white"
|
|
107
|
-
},
|
|
108
|
-
children: title
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
)
|
|
113
|
-
]
|
|
171
|
+
className: "w-5 h-5 text-white"
|
|
172
|
+
}
|
|
114
173
|
}
|
|
115
174
|
)
|
|
116
175
|
}
|
|
176
|
+
),
|
|
177
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
178
|
+
import_indicator.default,
|
|
179
|
+
{
|
|
180
|
+
...{
|
|
181
|
+
className: "absolute top-1.5 right-1.5 w-2 h-2",
|
|
182
|
+
type: "warning"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
117
185
|
)
|
|
118
|
-
|
|
119
|
-
|
|
186
|
+
]
|
|
187
|
+
}
|
|
120
188
|
);
|
|
121
189
|
};
|
|
122
190
|
const TemplateUiHeader = ({
|
|
191
|
+
account,
|
|
123
192
|
actions,
|
|
124
193
|
active,
|
|
125
194
|
campaign = {},
|
|
@@ -132,6 +201,12 @@ const TemplateUiHeader = ({
|
|
|
132
201
|
"w-full flex items-center justify-between px-6 bg-black gap-6 grow-0",
|
|
133
202
|
offsets.header
|
|
134
203
|
];
|
|
204
|
+
const settings = (0, import_menu3.headerSettings)({
|
|
205
|
+
campaign,
|
|
206
|
+
organization,
|
|
207
|
+
params,
|
|
208
|
+
path
|
|
209
|
+
});
|
|
135
210
|
if (className) {
|
|
136
211
|
classes.push(className);
|
|
137
212
|
}
|
|
@@ -142,30 +217,52 @@ const TemplateUiHeader = ({
|
|
|
142
217
|
className: classes.join(" ")
|
|
143
218
|
},
|
|
144
219
|
children: [
|
|
145
|
-
(params == null ? void 0 : params.organization) && !isAccountPath(path) && !path.includes("/admin") && /* @__PURE__ */ (0, import_jsx_runtime.
|
|
146
|
-
|
|
147
|
-
{
|
|
148
|
-
...{
|
|
149
|
-
href: "/organizations/" + (params == null ? void 0 : params.organization) + "/campaigns",
|
|
150
|
-
title: campaign == null ? void 0 : campaign.title
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
-
TemplateUIHeaderBack,
|
|
220
|
+
(params == null ? void 0 : params.organization) && !isAccountPath(path) && !path.includes("/admin") && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
221
|
+
"div",
|
|
155
222
|
{
|
|
156
223
|
...{
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
224
|
+
className: "flex items-center w-full min-w-0 gap-2"
|
|
225
|
+
},
|
|
226
|
+
children: [
|
|
227
|
+
params.organization && params.campaign ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
+
TemplateUIHeaderBack,
|
|
229
|
+
{
|
|
230
|
+
...{
|
|
231
|
+
href: "/organizations/" + (params == null ? void 0 : params.organization) + "/campaigns",
|
|
232
|
+
label: "Back to campaigns",
|
|
233
|
+
level: "Campaign",
|
|
234
|
+
title: campaign == null ? void 0 : campaign.title
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
238
|
+
TemplateUIHeaderBack,
|
|
239
|
+
{
|
|
240
|
+
...{
|
|
241
|
+
href: "/organizations",
|
|
242
|
+
icon: import_switch.default,
|
|
243
|
+
label: "Switch organization",
|
|
244
|
+
level: "Organization",
|
|
245
|
+
title: organization == null ? void 0 : organization.title
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
settings && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
250
|
+
TemplateUIHeaderSettings,
|
|
251
|
+
{
|
|
252
|
+
...settings
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
]
|
|
161
256
|
}
|
|
162
|
-
)
|
|
257
|
+
),
|
|
163
258
|
isAccountPath(path) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
164
259
|
TemplateUIHeaderBack,
|
|
165
260
|
{
|
|
166
261
|
...{
|
|
167
262
|
href: "/",
|
|
168
|
-
|
|
263
|
+
label: "Back to Dashboard",
|
|
264
|
+
level: "Account",
|
|
265
|
+
title: (0, import_helpers.formatUserName)(account) || "Dashboard"
|
|
169
266
|
}
|
|
170
267
|
}
|
|
171
268
|
),
|
|
@@ -174,6 +271,8 @@ const TemplateUiHeader = ({
|
|
|
174
271
|
{
|
|
175
272
|
...{
|
|
176
273
|
href: "/",
|
|
274
|
+
label: "Back to Dashboard",
|
|
275
|
+
level: "Admin",
|
|
177
276
|
title: "Dashboard"
|
|
178
277
|
}
|
|
179
278
|
}
|
|
@@ -183,6 +282,7 @@ const TemplateUiHeader = ({
|
|
|
183
282
|
{
|
|
184
283
|
...{
|
|
185
284
|
href: "/",
|
|
285
|
+
label: "Back to Dashboard",
|
|
186
286
|
title: "Dashboard"
|
|
187
287
|
}
|
|
188
288
|
}
|
|
@@ -356,6 +456,7 @@ const TemplateUi = ({
|
|
|
356
456
|
TemplateUiHeader,
|
|
357
457
|
{
|
|
358
458
|
...{
|
|
459
|
+
account: account == null ? void 0 : account.data,
|
|
359
460
|
actions,
|
|
360
461
|
active: (_c = menu == null ? void 0 : menu.data) == null ? void 0 : _c.active,
|
|
361
462
|
campaign: campaign == null ? void 0 : campaign.data,
|
|
@@ -377,6 +478,7 @@ const TemplateUi = ({
|
|
|
377
478
|
TemplateUiHeader,
|
|
378
479
|
{
|
|
379
480
|
...{
|
|
481
|
+
account: account == null ? void 0 : account.data,
|
|
380
482
|
actions,
|
|
381
483
|
active: (_e = menu == null ? void 0 : menu.data) == null ? void 0 : _e.active,
|
|
382
484
|
campaign: campaign == null ? void 0 : campaign.data,
|
|
@@ -13,9 +13,12 @@ import Switch from "../icons/switch.mjs";
|
|
|
13
13
|
import Times from "../icons/times.mjs";
|
|
14
14
|
import Link from "./link.mjs";
|
|
15
15
|
import ArrowLeft from "../icons/arrow-left.mjs";
|
|
16
|
+
import Cog from "../icons/cog.mjs";
|
|
17
|
+
import Indicator from "../shared/indicator.mjs";
|
|
18
|
+
import { headerSettings } from "./lib/menu.mjs";
|
|
16
19
|
import Button from "../shared/button.mjs";
|
|
17
20
|
import { FormScope } from "../shared/lib/form.mjs";
|
|
18
|
-
import { alertFor } from "../shared/lib/helpers.mjs";
|
|
21
|
+
import { alertFor, formatUserName } from "../shared/lib/helpers.mjs";
|
|
19
22
|
const offsets = {
|
|
20
23
|
header: "h-16 md:h-20",
|
|
21
24
|
paddingTop: "pt-16 md:pt-0"
|
|
@@ -24,70 +27,136 @@ const isAccountPath = (path) => path === "/account" || path.startsWith("/account
|
|
|
24
27
|
const TemplateUIHeaderBack = ({
|
|
25
28
|
href,
|
|
26
29
|
icon: Icon = ArrowLeft,
|
|
30
|
+
label,
|
|
31
|
+
level,
|
|
27
32
|
title
|
|
28
33
|
}) => {
|
|
29
34
|
const scope = useContext(FormScope);
|
|
30
35
|
return (
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
/* @__PURE__ */ jsx(
|
|
36
|
+
// min-w-0 lets the header shrink the row, so a long title truncates.
|
|
37
|
+
/* @__PURE__ */ jsxs(
|
|
34
38
|
"div",
|
|
35
39
|
{
|
|
36
40
|
...{
|
|
37
|
-
className: "
|
|
41
|
+
className: "flex items-center w-full min-w-0 h-9 gap-3"
|
|
38
42
|
},
|
|
39
|
-
children:
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
...{
|
|
48
|
+
className: "shrink-0 transform duration-300 hover:opacity-70"
|
|
49
|
+
},
|
|
50
|
+
children: /* @__PURE__ */ jsx(
|
|
51
|
+
Button,
|
|
52
|
+
{
|
|
53
|
+
...{
|
|
54
|
+
"aria-label": label,
|
|
55
|
+
"data-guard": scope,
|
|
56
|
+
element: Link,
|
|
57
|
+
href,
|
|
58
|
+
variant: "link"
|
|
59
|
+
},
|
|
60
|
+
children: /* @__PURE__ */ jsx(
|
|
61
|
+
Icon,
|
|
62
|
+
{
|
|
63
|
+
...{
|
|
64
|
+
"aria-hidden": true,
|
|
65
|
+
className: "bg-gray-dark w-9 h-9 p-2.5 rounded-md text-white"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
title && /* @__PURE__ */ jsxs(
|
|
74
|
+
"span",
|
|
75
|
+
{
|
|
76
|
+
...{
|
|
77
|
+
// pt-0.5: capitals have no descenders, so the pair reads 2px high
|
|
78
|
+
// beside the 36px buttons without it ( Darren, 2026-11-22 ).
|
|
79
|
+
className: "flex flex-col min-w-0 pt-1 leading-tight"
|
|
80
|
+
},
|
|
81
|
+
children: [
|
|
82
|
+
level && /* @__PURE__ */ jsx(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
...{
|
|
86
|
+
className: "text-[10px] text-white/40 uppercase tracking-wider"
|
|
87
|
+
},
|
|
88
|
+
children: level
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
"span",
|
|
93
|
+
{
|
|
94
|
+
...{
|
|
95
|
+
className: "truncate text-white"
|
|
96
|
+
},
|
|
97
|
+
children: title
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
const TemplateUIHeaderSettings = ({
|
|
109
|
+
active,
|
|
110
|
+
error,
|
|
111
|
+
href
|
|
112
|
+
}) => {
|
|
113
|
+
const scope = useContext(FormScope);
|
|
114
|
+
return /* @__PURE__ */ jsxs(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
...{
|
|
118
|
+
// Impeccable audit, 2026-11-21: the link fills the whole lit box, so a
|
|
119
|
+
// click anywhere on it opens Settings, not only on the icon.
|
|
120
|
+
className: "relative flex items-center justify-center w-9 h-9 shrink-0 rounded-md transform duration-300 [&>a]:absolute [&>a]:inset-0 [&>a]:!w-full [&>a]:h-full [&>a]:flex [&>a]:items-center [&>a]:justify-center " + (active ? "bg-gray-dark" : "hover:bg-gray-dark/50")
|
|
121
|
+
},
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ jsx(
|
|
40
124
|
Button,
|
|
41
125
|
{
|
|
42
126
|
...{
|
|
127
|
+
"aria-label": "Settings",
|
|
43
128
|
"data-guard": scope,
|
|
129
|
+
"data-guide": "button-settings",
|
|
44
130
|
element: Link,
|
|
45
131
|
href,
|
|
46
|
-
|
|
132
|
+
inline: true,
|
|
47
133
|
variant: "link"
|
|
48
134
|
},
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
|
|
135
|
+
children: /* @__PURE__ */ jsx(
|
|
136
|
+
Cog,
|
|
51
137
|
{
|
|
52
138
|
...{
|
|
53
|
-
className: "
|
|
54
|
-
}
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ jsx(
|
|
57
|
-
Icon,
|
|
58
|
-
{
|
|
59
|
-
...{
|
|
60
|
-
className: "bg-gray-dark w-9 h-9 p-2.5 rounded-md text-white shrink-0"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
),
|
|
64
|
-
/* @__PURE__ */ jsx(
|
|
65
|
-
"span",
|
|
66
|
-
{
|
|
67
|
-
...{
|
|
68
|
-
className: "flex flex-col leading-tight space-y-1 py-1 w-full truncate"
|
|
69
|
-
},
|
|
70
|
-
children: title && /* @__PURE__ */ jsx(
|
|
71
|
-
"span",
|
|
72
|
-
{
|
|
73
|
-
...{
|
|
74
|
-
className: "w-full truncate text-white"
|
|
75
|
-
},
|
|
76
|
-
children: title
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
]
|
|
139
|
+
className: "w-5 h-5 text-white"
|
|
140
|
+
}
|
|
82
141
|
}
|
|
83
142
|
)
|
|
84
143
|
}
|
|
144
|
+
),
|
|
145
|
+
error && /* @__PURE__ */ jsx(
|
|
146
|
+
Indicator,
|
|
147
|
+
{
|
|
148
|
+
...{
|
|
149
|
+
className: "absolute top-1.5 right-1.5 w-2 h-2",
|
|
150
|
+
type: "warning"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
85
153
|
)
|
|
86
|
-
|
|
87
|
-
|
|
154
|
+
]
|
|
155
|
+
}
|
|
88
156
|
);
|
|
89
157
|
};
|
|
90
158
|
const TemplateUiHeader = ({
|
|
159
|
+
account,
|
|
91
160
|
actions,
|
|
92
161
|
active,
|
|
93
162
|
campaign = {},
|
|
@@ -100,6 +169,12 @@ const TemplateUiHeader = ({
|
|
|
100
169
|
"w-full flex items-center justify-between px-6 bg-black gap-6 grow-0",
|
|
101
170
|
offsets.header
|
|
102
171
|
];
|
|
172
|
+
const settings = headerSettings({
|
|
173
|
+
campaign,
|
|
174
|
+
organization,
|
|
175
|
+
params,
|
|
176
|
+
path
|
|
177
|
+
});
|
|
103
178
|
if (className) {
|
|
104
179
|
classes.push(className);
|
|
105
180
|
}
|
|
@@ -110,30 +185,52 @@ const TemplateUiHeader = ({
|
|
|
110
185
|
className: classes.join(" ")
|
|
111
186
|
},
|
|
112
187
|
children: [
|
|
113
|
-
(params == null ? void 0 : params.organization) && !isAccountPath(path) && !path.includes("/admin") && /* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
{
|
|
116
|
-
...{
|
|
117
|
-
href: "/organizations/" + (params == null ? void 0 : params.organization) + "/campaigns",
|
|
118
|
-
title: campaign == null ? void 0 : campaign.title
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
) : /* @__PURE__ */ jsx(
|
|
122
|
-
TemplateUIHeaderBack,
|
|
188
|
+
(params == null ? void 0 : params.organization) && !isAccountPath(path) && !path.includes("/admin") && /* @__PURE__ */ jsxs(
|
|
189
|
+
"div",
|
|
123
190
|
{
|
|
124
191
|
...{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
192
|
+
className: "flex items-center w-full min-w-0 gap-2"
|
|
193
|
+
},
|
|
194
|
+
children: [
|
|
195
|
+
params.organization && params.campaign ? /* @__PURE__ */ jsx(
|
|
196
|
+
TemplateUIHeaderBack,
|
|
197
|
+
{
|
|
198
|
+
...{
|
|
199
|
+
href: "/organizations/" + (params == null ? void 0 : params.organization) + "/campaigns",
|
|
200
|
+
label: "Back to campaigns",
|
|
201
|
+
level: "Campaign",
|
|
202
|
+
title: campaign == null ? void 0 : campaign.title
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
) : /* @__PURE__ */ jsx(
|
|
206
|
+
TemplateUIHeaderBack,
|
|
207
|
+
{
|
|
208
|
+
...{
|
|
209
|
+
href: "/organizations",
|
|
210
|
+
icon: Switch,
|
|
211
|
+
label: "Switch organization",
|
|
212
|
+
level: "Organization",
|
|
213
|
+
title: organization == null ? void 0 : organization.title
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
settings && /* @__PURE__ */ jsx(
|
|
218
|
+
TemplateUIHeaderSettings,
|
|
219
|
+
{
|
|
220
|
+
...settings
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
]
|
|
129
224
|
}
|
|
130
|
-
)
|
|
225
|
+
),
|
|
131
226
|
isAccountPath(path) && /* @__PURE__ */ jsx(
|
|
132
227
|
TemplateUIHeaderBack,
|
|
133
228
|
{
|
|
134
229
|
...{
|
|
135
230
|
href: "/",
|
|
136
|
-
|
|
231
|
+
label: "Back to Dashboard",
|
|
232
|
+
level: "Account",
|
|
233
|
+
title: formatUserName(account) || "Dashboard"
|
|
137
234
|
}
|
|
138
235
|
}
|
|
139
236
|
),
|
|
@@ -142,6 +239,8 @@ const TemplateUiHeader = ({
|
|
|
142
239
|
{
|
|
143
240
|
...{
|
|
144
241
|
href: "/",
|
|
242
|
+
label: "Back to Dashboard",
|
|
243
|
+
level: "Admin",
|
|
145
244
|
title: "Dashboard"
|
|
146
245
|
}
|
|
147
246
|
}
|
|
@@ -151,6 +250,7 @@ const TemplateUiHeader = ({
|
|
|
151
250
|
{
|
|
152
251
|
...{
|
|
153
252
|
href: "/",
|
|
253
|
+
label: "Back to Dashboard",
|
|
154
254
|
title: "Dashboard"
|
|
155
255
|
}
|
|
156
256
|
}
|
|
@@ -324,6 +424,7 @@ const TemplateUi = ({
|
|
|
324
424
|
TemplateUiHeader,
|
|
325
425
|
{
|
|
326
426
|
...{
|
|
427
|
+
account: account == null ? void 0 : account.data,
|
|
327
428
|
actions,
|
|
328
429
|
active: (_c = menu == null ? void 0 : menu.data) == null ? void 0 : _c.active,
|
|
329
430
|
campaign: campaign == null ? void 0 : campaign.data,
|
|
@@ -345,6 +446,7 @@ const TemplateUi = ({
|
|
|
345
446
|
TemplateUiHeader,
|
|
346
447
|
{
|
|
347
448
|
...{
|
|
449
|
+
account: account == null ? void 0 : account.data,
|
|
348
450
|
actions,
|
|
349
451
|
active: (_e = menu == null ? void 0 : menu.data) == null ? void 0 : _e.active,
|
|
350
452
|
campaign: campaign == null ? void 0 : campaign.data,
|