@omnibase/shadcn 0.4.1 → 0.4.3
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/index.cjs +822 -343
- package/dist/index.d.cts +49 -12
- package/dist/index.d.ts +49 -12
- package/dist/index.js +813 -344
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
@@ -30,10 +31,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
31
|
// src/index.ts
|
|
31
32
|
var index_exports = {};
|
|
32
33
|
__export(index_exports, {
|
|
33
|
-
|
|
34
|
+
LoginForm: () => LoginForm,
|
|
34
35
|
PricingTable: () => PricingTable,
|
|
36
|
+
RecoveryForm: () => RecoveryForm,
|
|
37
|
+
RegistrationForm: () => RegistrationForm,
|
|
38
|
+
SettingsForm: () => SettingsForm,
|
|
35
39
|
SwitchActiveTenant: () => SwitchActiveTenant,
|
|
36
|
-
TenantCreator: () => TenantCreator
|
|
40
|
+
TenantCreator: () => TenantCreator,
|
|
41
|
+
VerificationForm: () => VerificationForm,
|
|
42
|
+
filterInputNodes: () => filterInputNodes,
|
|
43
|
+
findAnchorNode: () => findAnchorNode,
|
|
44
|
+
findCsrfToken: () => findCsrfToken,
|
|
45
|
+
findSubmitButton: () => findSubmitButton,
|
|
46
|
+
groupNodesByGroup: () => groupNodesByGroup,
|
|
47
|
+
isUiNodeInputAttributes: () => isUiNodeInputAttributes,
|
|
48
|
+
sortNodes: () => sortNodes
|
|
37
49
|
});
|
|
38
50
|
module.exports = __toCommonJS(index_exports);
|
|
39
51
|
|
|
@@ -116,12 +128,131 @@ function CardFooter({ className, ...props }) {
|
|
|
116
128
|
);
|
|
117
129
|
}
|
|
118
130
|
|
|
119
|
-
// src/components/ui/
|
|
120
|
-
var
|
|
121
|
-
|
|
131
|
+
// src/components/ui/messages.tsx
|
|
132
|
+
var React3 = __toESM(require("react"), 1);
|
|
133
|
+
|
|
134
|
+
// src/components/ui/alert.tsx
|
|
135
|
+
var React2 = __toESM(require("react"), 1);
|
|
122
136
|
var import_class_variance_authority = require("class-variance-authority");
|
|
123
137
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
124
|
-
var
|
|
138
|
+
var alertVariants = (0, import_class_variance_authority.cva)(
|
|
139
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
140
|
+
{
|
|
141
|
+
variants: {
|
|
142
|
+
variant: {
|
|
143
|
+
default: "bg-background text-foreground",
|
|
144
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
145
|
+
warning: "border-yellow-500/50 text-yellow-700 bg-yellow-50 dark:border-yellow-500 dark:text-yellow-200 dark:bg-yellow-950/20 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-200",
|
|
146
|
+
success: "border-green-500/50 text-green-700 bg-green-50 dark:border-green-500 dark:text-green-200 dark:bg-green-950/20 [&>svg]:text-green-600 dark:[&>svg]:text-green-200",
|
|
147
|
+
info: "border-blue-500/50 text-blue-700 bg-blue-50 dark:border-blue-500 dark:text-blue-200 dark:bg-blue-950/20 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-200"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
defaultVariants: {
|
|
151
|
+
variant: "default"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
var Alert = React2.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
ref,
|
|
159
|
+
role: "alert",
|
|
160
|
+
className: cn(alertVariants({ variant }), className),
|
|
161
|
+
...props
|
|
162
|
+
}
|
|
163
|
+
));
|
|
164
|
+
Alert.displayName = "Alert";
|
|
165
|
+
var AlertTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
166
|
+
"h5",
|
|
167
|
+
{
|
|
168
|
+
ref,
|
|
169
|
+
className: cn("mb-1 font-medium leading-none tracking-tight", className),
|
|
170
|
+
...props
|
|
171
|
+
}
|
|
172
|
+
));
|
|
173
|
+
AlertTitle.displayName = "AlertTitle";
|
|
174
|
+
var AlertDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
ref,
|
|
178
|
+
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
179
|
+
...props
|
|
180
|
+
}
|
|
181
|
+
));
|
|
182
|
+
AlertDescription.displayName = "AlertDescription";
|
|
183
|
+
|
|
184
|
+
// src/components/ui/messages.tsx
|
|
185
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
186
|
+
var getMessageVariant = (type) => {
|
|
187
|
+
switch (type) {
|
|
188
|
+
case "error":
|
|
189
|
+
return "destructive";
|
|
190
|
+
case "success":
|
|
191
|
+
return "success";
|
|
192
|
+
case "info":
|
|
193
|
+
return "info";
|
|
194
|
+
case "11184809":
|
|
195
|
+
return "warning";
|
|
196
|
+
default:
|
|
197
|
+
return "default";
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
var Messages = React3.forwardRef(
|
|
201
|
+
({ flow, className, ...props }, ref) => {
|
|
202
|
+
if (!flow?.ui) return null;
|
|
203
|
+
const allMessages = [];
|
|
204
|
+
if (flow.ui.messages) {
|
|
205
|
+
allMessages.push(...flow.ui.messages);
|
|
206
|
+
}
|
|
207
|
+
if (flow.ui.nodes) {
|
|
208
|
+
flow.ui.nodes.forEach((node) => {
|
|
209
|
+
if (node.messages) {
|
|
210
|
+
allMessages.push(...node.messages);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
if (allMessages.length === 0) return null;
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
ref,
|
|
219
|
+
className: cn("w-full max-w-md mx-auto space-y-2 mb-4", className),
|
|
220
|
+
...props,
|
|
221
|
+
children: allMessages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Alert, { variant: getMessageVariant(message.type), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AlertDescription, { children: message.text }) }, message.id))
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
Messages.displayName = "Messages";
|
|
227
|
+
|
|
228
|
+
// src/form/types.ts
|
|
229
|
+
function isUiNodeInputAttributes(attributes) {
|
|
230
|
+
return attributes && typeof attributes === "object" && "name" in attributes && "type" in attributes;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// src/form/components/HiddenInput.tsx
|
|
234
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
235
|
+
function HiddenInput({ node }) {
|
|
236
|
+
if (!isUiNodeInputAttributes(node.attributes)) {
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
240
|
+
"input",
|
|
241
|
+
{
|
|
242
|
+
name: node.attributes.name,
|
|
243
|
+
type: "hidden",
|
|
244
|
+
value: node.attributes.value || "",
|
|
245
|
+
readOnly: true
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// src/components/ui/button.tsx
|
|
251
|
+
var React4 = require("react");
|
|
252
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
253
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
254
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
255
|
+
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
125
256
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
126
257
|
{
|
|
127
258
|
variants: {
|
|
@@ -154,7 +285,7 @@ function Button({
|
|
|
154
285
|
...props
|
|
155
286
|
}) {
|
|
156
287
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
157
|
-
return /* @__PURE__ */ (0,
|
|
288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
158
289
|
Comp,
|
|
159
290
|
{
|
|
160
291
|
"data-slot": "button",
|
|
@@ -164,11 +295,78 @@ function Button({
|
|
|
164
295
|
);
|
|
165
296
|
}
|
|
166
297
|
|
|
298
|
+
// src/form/components/SubmitButton.tsx
|
|
299
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
300
|
+
function SubmitButton({
|
|
301
|
+
node,
|
|
302
|
+
variant = "default",
|
|
303
|
+
className = "w-full"
|
|
304
|
+
}) {
|
|
305
|
+
if (!isUiNodeInputAttributes(node.attributes)) {
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
309
|
+
Button,
|
|
310
|
+
{
|
|
311
|
+
type: "submit",
|
|
312
|
+
name: node.attributes.name,
|
|
313
|
+
value: node.attributes.value || "",
|
|
314
|
+
variant,
|
|
315
|
+
className,
|
|
316
|
+
disabled: node.attributes.disabled,
|
|
317
|
+
children: node.meta.label?.text || node.attributes.value || "Submit"
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// src/form/components/Divider.tsx
|
|
323
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
324
|
+
function Divider({ withText = false }) {
|
|
325
|
+
if (withText) {
|
|
326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative my-6", children: [
|
|
327
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w-full border-t border-border" }) }),
|
|
328
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative flex justify-center text-xs uppercase", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "bg-background px-3 text-muted-foreground font-medium", children: "Or continue with" }) })
|
|
329
|
+
] });
|
|
330
|
+
}
|
|
331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "border-t border-border my-6" });
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// src/form/components/OidcGroup.tsx
|
|
335
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
336
|
+
function OidcGroup({
|
|
337
|
+
nodes,
|
|
338
|
+
flowAction,
|
|
339
|
+
flowMethod,
|
|
340
|
+
csrfToken,
|
|
341
|
+
groupIndex,
|
|
342
|
+
groupName
|
|
343
|
+
}) {
|
|
344
|
+
const submitButtons = nodes.filter(
|
|
345
|
+
(node) => isUiNodeInputAttributes(node.attributes) && node.attributes.type === "submit"
|
|
346
|
+
);
|
|
347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
|
|
348
|
+
groupIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Divider, { withText: true }),
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "space-y-3", children: submitButtons.map((node, btnIndex) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
350
|
+
"form",
|
|
351
|
+
{
|
|
352
|
+
action: flowAction,
|
|
353
|
+
method: flowMethod,
|
|
354
|
+
className: "w-full",
|
|
355
|
+
children: [
|
|
356
|
+
csrfToken && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(HiddenInput, { node: csrfToken }),
|
|
357
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SubmitButton, { node, variant: "outline" })
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
`${groupName}-${btnIndex}`
|
|
361
|
+
)) })
|
|
362
|
+
] });
|
|
363
|
+
}
|
|
364
|
+
|
|
167
365
|
// src/components/ui/input.tsx
|
|
168
|
-
var
|
|
169
|
-
var
|
|
366
|
+
var React5 = require("react");
|
|
367
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
170
368
|
function Input({ className, type, ...props }) {
|
|
171
|
-
return /* @__PURE__ */ (0,
|
|
369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
172
370
|
"input",
|
|
173
371
|
{
|
|
174
372
|
type,
|
|
@@ -185,14 +383,14 @@ function Input({ className, type, ...props }) {
|
|
|
185
383
|
}
|
|
186
384
|
|
|
187
385
|
// src/components/ui/label.tsx
|
|
188
|
-
var
|
|
386
|
+
var React6 = require("react");
|
|
189
387
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
|
|
190
|
-
var
|
|
388
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
191
389
|
function Label({
|
|
192
390
|
className,
|
|
193
391
|
...props
|
|
194
392
|
}) {
|
|
195
|
-
return /* @__PURE__ */ (0,
|
|
393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
196
394
|
LabelPrimitive.Root,
|
|
197
395
|
{
|
|
198
396
|
"data-slot": "label",
|
|
@@ -205,109 +403,393 @@ function Label({
|
|
|
205
403
|
);
|
|
206
404
|
}
|
|
207
405
|
|
|
208
|
-
// src/components/
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
406
|
+
// src/form/components/FormInput.tsx
|
|
407
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
408
|
+
function FormInput({ node }) {
|
|
409
|
+
if (!isUiNodeInputAttributes(node.attributes)) {
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "space-y-2", children: [
|
|
413
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Label, { htmlFor: node.attributes.name, children: [
|
|
414
|
+
node.meta.label?.text,
|
|
415
|
+
node.attributes.required && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
416
|
+
] }),
|
|
417
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
418
|
+
Input,
|
|
419
|
+
{
|
|
420
|
+
id: node.attributes.name,
|
|
421
|
+
name: node.attributes.name,
|
|
422
|
+
type: node.attributes.type,
|
|
423
|
+
defaultValue: node.attributes.value || "",
|
|
424
|
+
required: node.attributes.required,
|
|
425
|
+
disabled: node.attributes.disabled,
|
|
426
|
+
autoComplete: node.attributes.autocomplete,
|
|
427
|
+
placeholder: `Enter your ${node.meta.label?.text?.toLowerCase() || node.attributes.name}`
|
|
225
428
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
429
|
+
)
|
|
430
|
+
] });
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// src/form/utils.ts
|
|
434
|
+
var TYPE_ORDER = {
|
|
435
|
+
hidden: 0,
|
|
436
|
+
text: 1,
|
|
437
|
+
email: 1,
|
|
438
|
+
password: 1,
|
|
439
|
+
checkbox: 1,
|
|
440
|
+
submit: 2
|
|
441
|
+
};
|
|
442
|
+
function sortNodes(nodes) {
|
|
443
|
+
return [...nodes].sort((a, b) => {
|
|
444
|
+
const aIsInput = isUiNodeInputAttributes(a.attributes);
|
|
445
|
+
const bIsInput = isUiNodeInputAttributes(b.attributes);
|
|
446
|
+
if (!aIsInput && !bIsInput) return 0;
|
|
447
|
+
if (!aIsInput) return 1;
|
|
448
|
+
if (!bIsInput) return -1;
|
|
449
|
+
const aAttrs = a.attributes;
|
|
450
|
+
const bAttrs = b.attributes;
|
|
451
|
+
const aOrder = TYPE_ORDER[aAttrs.type] ?? 1;
|
|
452
|
+
const bOrder = TYPE_ORDER[bAttrs.type] ?? 1;
|
|
453
|
+
return aOrder - bOrder;
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
function findSubmitButton(nodes) {
|
|
457
|
+
return nodes.find(
|
|
458
|
+
(node) => isUiNodeInputAttributes(node.attributes) && node.attributes.type === "submit"
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
function findAnchorNode(nodes) {
|
|
462
|
+
return nodes.find((node) => node.type === "a");
|
|
463
|
+
}
|
|
464
|
+
function filterInputNodes(nodes) {
|
|
465
|
+
return nodes.filter(
|
|
466
|
+
(node) => isUiNodeInputAttributes(node.attributes) && node.attributes.type !== "submit" && node.attributes.type !== "hidden"
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
function findCsrfToken(nodes) {
|
|
470
|
+
return nodes.find(
|
|
471
|
+
(node) => isUiNodeInputAttributes(node.attributes) && node.attributes.name === "csrf_token"
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
function groupNodesByGroup(nodes) {
|
|
475
|
+
return nodes.reduce((groups, node) => {
|
|
476
|
+
const group = node.group || "default";
|
|
477
|
+
if (!groups[group]) {
|
|
478
|
+
groups[group] = [];
|
|
229
479
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
{
|
|
235
|
-
ref,
|
|
236
|
-
role: "alert",
|
|
237
|
-
className: cn(alertVariants({ variant }), className),
|
|
238
|
-
...props
|
|
239
|
-
}
|
|
240
|
-
));
|
|
241
|
-
Alert.displayName = "Alert";
|
|
242
|
-
var AlertTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
243
|
-
"h5",
|
|
244
|
-
{
|
|
245
|
-
ref,
|
|
246
|
-
className: cn("mb-1 font-medium leading-none tracking-tight", className),
|
|
247
|
-
...props
|
|
248
|
-
}
|
|
249
|
-
));
|
|
250
|
-
AlertTitle.displayName = "AlertTitle";
|
|
251
|
-
var AlertDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
252
|
-
"div",
|
|
253
|
-
{
|
|
254
|
-
ref,
|
|
255
|
-
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
256
|
-
...props
|
|
257
|
-
}
|
|
258
|
-
));
|
|
259
|
-
AlertDescription.displayName = "AlertDescription";
|
|
480
|
+
groups[group].push(node);
|
|
481
|
+
return groups;
|
|
482
|
+
}, {});
|
|
483
|
+
}
|
|
260
484
|
|
|
261
|
-
// src/
|
|
262
|
-
var
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
485
|
+
// src/form/login.tsx
|
|
486
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
487
|
+
function LoginForm({ flow, Header, register_url }) {
|
|
488
|
+
const nodesByGroup = groupNodesByGroup(flow.ui.nodes);
|
|
489
|
+
const csrfToken = findCsrfToken(flow.ui.nodes);
|
|
490
|
+
const oidcNodes = nodesByGroup.oidc || [];
|
|
491
|
+
const defaultNodes = nodesByGroup.default || [];
|
|
492
|
+
const passwordNodes = nodesByGroup.password || [];
|
|
493
|
+
const identifierNodes = filterInputNodes(sortNodes(defaultNodes));
|
|
494
|
+
const passwordInputNodes = filterInputNodes(sortNodes(passwordNodes));
|
|
495
|
+
const submitButton = findSubmitButton(sortNodes(passwordNodes));
|
|
496
|
+
const registerHref = register_url && flow.return_to ? `${register_url}?return_to=${encodeURIComponent(flow.return_to)}` : register_url;
|
|
497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
498
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Messages, { flow }),
|
|
499
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Card, { className: "w-full max-w-md mx-auto", children: [
|
|
500
|
+
Header && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CardTitle, { className: "text-center pb-1", children: Header }) }),
|
|
501
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(CardContent, { className: "space-y-6", children: [
|
|
502
|
+
oidcNodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
503
|
+
OidcGroup,
|
|
504
|
+
{
|
|
505
|
+
nodes: sortNodes(oidcNodes),
|
|
506
|
+
flowAction: flow.ui.action,
|
|
507
|
+
flowMethod: flow.ui.method,
|
|
508
|
+
csrfToken,
|
|
509
|
+
groupIndex: 0,
|
|
510
|
+
groupName: "oidc"
|
|
511
|
+
}
|
|
512
|
+
),
|
|
513
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
514
|
+
oidcNodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Divider, { withText: true }),
|
|
515
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("form", { action: flow.ui.action, method: flow.ui.method, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-4", children: [
|
|
516
|
+
csrfToken && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(HiddenInput, { node: csrfToken }),
|
|
517
|
+
identifierNodes.map((node, idx) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FormInput, { node }, idx)),
|
|
518
|
+
passwordInputNodes.map((node, idx) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FormInput, { node }, idx)),
|
|
519
|
+
submitButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SubmitButton, { node: submitButton })
|
|
520
|
+
] }) }),
|
|
521
|
+
register_url && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-4 text-center text-sm", children: [
|
|
522
|
+
"Don't have an account?",
|
|
523
|
+
" ",
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
525
|
+
"a",
|
|
526
|
+
{
|
|
527
|
+
href: registerHref,
|
|
528
|
+
className: "text-primary underline-offset-4 hover:underline",
|
|
529
|
+
children: "Go to Register"
|
|
530
|
+
}
|
|
531
|
+
)
|
|
532
|
+
] })
|
|
533
|
+
] })
|
|
534
|
+
] })
|
|
535
|
+
] })
|
|
536
|
+
] });
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// src/form/registration.tsx
|
|
540
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
541
|
+
function RegistrationForm({
|
|
542
|
+
flow,
|
|
543
|
+
Header,
|
|
544
|
+
login_url
|
|
545
|
+
}) {
|
|
546
|
+
const nodesByGroup = groupNodesByGroup(flow.ui.nodes);
|
|
547
|
+
const csrfToken = findCsrfToken(flow.ui.nodes);
|
|
548
|
+
const oidcNodes = nodesByGroup.oidc || [];
|
|
549
|
+
const defaultNodes = nodesByGroup.default || [];
|
|
550
|
+
const profileNodes = nodesByGroup.profile || [];
|
|
551
|
+
const passwordNodes = nodesByGroup.password || [];
|
|
552
|
+
const inputNodes = filterInputNodes(
|
|
553
|
+
sortNodes([...defaultNodes, ...passwordNodes])
|
|
554
|
+
);
|
|
555
|
+
const hiddenNodes = [...defaultNodes, ...passwordNodes].filter(
|
|
556
|
+
(node) => isUiNodeInputAttributes(node.attributes) && node.attributes.type === "hidden" && node.attributes.name !== "csrf_token"
|
|
557
|
+
);
|
|
558
|
+
const submitButton = findSubmitButton(sortNodes(passwordNodes)) || findSubmitButton(sortNodes(profileNodes));
|
|
559
|
+
const loginHref = login_url && flow.return_to ? `${login_url}?return_to=${encodeURIComponent(flow.return_to)}` : login_url;
|
|
560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
561
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Messages, { flow }),
|
|
562
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Card, { className: "w-full max-w-md mx-auto", children: [
|
|
563
|
+
Header && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CardTitle, { className: "text-center pb-1", children: Header }) }),
|
|
564
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(CardContent, { className: "space-y-6", children: [
|
|
565
|
+
oidcNodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
566
|
+
OidcGroup,
|
|
567
|
+
{
|
|
568
|
+
nodes: sortNodes(oidcNodes),
|
|
569
|
+
flowAction: flow.ui.action,
|
|
570
|
+
flowMethod: flow.ui.method,
|
|
571
|
+
csrfToken,
|
|
572
|
+
groupIndex: 0,
|
|
573
|
+
groupName: "oidc"
|
|
574
|
+
}
|
|
575
|
+
),
|
|
576
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
577
|
+
oidcNodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Divider, { withText: true }),
|
|
578
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("form", { action: flow.ui.action, method: flow.ui.method, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-4", children: [
|
|
579
|
+
csrfToken && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(HiddenInput, { node: csrfToken }),
|
|
580
|
+
hiddenNodes.map((node, idx) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(HiddenInput, { node }, `hidden-${idx}`)),
|
|
581
|
+
inputNodes.map((node, idx) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormInput, { node }, idx)),
|
|
582
|
+
submitButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SubmitButton, { node: submitButton })
|
|
583
|
+
] }) }),
|
|
584
|
+
login_url && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "mt-4 text-center text-sm", children: [
|
|
585
|
+
"Already have an account?",
|
|
586
|
+
" ",
|
|
587
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
588
|
+
"a",
|
|
589
|
+
{
|
|
590
|
+
href: loginHref,
|
|
591
|
+
className: "text-primary underline-offset-4 hover:underline",
|
|
592
|
+
children: "Go to Login"
|
|
593
|
+
}
|
|
594
|
+
)
|
|
595
|
+
] })
|
|
596
|
+
] })
|
|
597
|
+
] })
|
|
598
|
+
] })
|
|
599
|
+
] });
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
// src/form/verification.tsx
|
|
603
|
+
var React8 = __toESM(require("react"), 1);
|
|
604
|
+
|
|
605
|
+
// src/form/components/PinInput.tsx
|
|
606
|
+
var React7 = __toESM(require("react"), 1);
|
|
607
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
608
|
+
function PinInput({
|
|
609
|
+
node,
|
|
610
|
+
length = 6,
|
|
611
|
+
initialValue = ""
|
|
612
|
+
}) {
|
|
613
|
+
if (!isUiNodeInputAttributes(node.attributes)) {
|
|
614
|
+
return null;
|
|
275
615
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
616
|
+
const [pins, setPins] = React7.useState(() => {
|
|
617
|
+
if (initialValue) {
|
|
618
|
+
const sanitized = initialValue.replace(/[^0-9]/g, "").slice(0, length);
|
|
619
|
+
const pinArray = Array(length).fill("");
|
|
620
|
+
for (let i = 0; i < sanitized.length; i++) {
|
|
621
|
+
pinArray[i] = sanitized[i];
|
|
622
|
+
}
|
|
623
|
+
return pinArray;
|
|
283
624
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
625
|
+
return Array(length).fill("");
|
|
626
|
+
});
|
|
627
|
+
const inputRefs = React7.useRef([]);
|
|
628
|
+
const handleChange = (index, value) => {
|
|
629
|
+
const sanitizedValue = value.replace(/[^0-9]/g, "").slice(0, 1);
|
|
630
|
+
const newPins = [...pins];
|
|
631
|
+
newPins[index] = sanitizedValue;
|
|
632
|
+
setPins(newPins);
|
|
633
|
+
if (sanitizedValue && index < length - 1) {
|
|
634
|
+
inputRefs.current[index + 1]?.focus();
|
|
290
635
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
636
|
+
};
|
|
637
|
+
const handleKeyDown = (index, e) => {
|
|
638
|
+
if (e.key === "Backspace" && !pins[index] && index > 0) {
|
|
639
|
+
inputRefs.current[index - 1]?.focus();
|
|
640
|
+
}
|
|
641
|
+
if (e.key === "ArrowLeft" && index > 0) {
|
|
642
|
+
inputRefs.current[index - 1]?.focus();
|
|
643
|
+
}
|
|
644
|
+
if (e.key === "ArrowRight" && index < length - 1) {
|
|
645
|
+
inputRefs.current[index + 1]?.focus();
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
const handlePaste = (e) => {
|
|
649
|
+
e.preventDefault();
|
|
650
|
+
const pastedData = e.clipboardData.getData("text").replace(/[^0-9]/g, "");
|
|
651
|
+
const newPins = [...pins];
|
|
652
|
+
for (let i = 0; i < Math.min(pastedData.length, length); i++) {
|
|
653
|
+
newPins[i] = pastedData[i];
|
|
654
|
+
}
|
|
655
|
+
setPins(newPins);
|
|
656
|
+
const nextEmptyIndex = newPins.findIndex((pin) => !pin);
|
|
657
|
+
const focusIndex = nextEmptyIndex === -1 ? length - 1 : nextEmptyIndex;
|
|
658
|
+
inputRefs.current[focusIndex]?.focus();
|
|
659
|
+
};
|
|
660
|
+
const combinedValue = pins.join("");
|
|
661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-2 mb-6", children: [
|
|
662
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex gap-2 justify-center", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
663
|
+
"input",
|
|
294
664
|
{
|
|
295
|
-
ref,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
665
|
+
ref: (el) => inputRefs.current[index] = el,
|
|
666
|
+
type: "text",
|
|
667
|
+
inputMode: "numeric",
|
|
668
|
+
maxLength: 1,
|
|
669
|
+
value: pins[index],
|
|
670
|
+
onChange: (e) => handleChange(index, e.target.value),
|
|
671
|
+
onKeyDown: (e) => handleKeyDown(index, e),
|
|
672
|
+
onPaste: index === 0 ? handlePaste : void 0,
|
|
673
|
+
disabled: isUiNodeInputAttributes(node.attributes) ? node.attributes.disabled : false,
|
|
674
|
+
className: cn(
|
|
675
|
+
"w-10 h-12 text-center text-lg font-semibold rounded-md border-2",
|
|
676
|
+
"border-input bg-background shadow-sm transition-all duration-200 outline-none",
|
|
677
|
+
"hover:border-ring/60",
|
|
678
|
+
"focus:border-ring focus:ring-4 focus:ring-ring/20 focus:scale-105",
|
|
679
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
680
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
681
|
+
pins[index] && "border-primary bg-primary/5"
|
|
682
|
+
),
|
|
683
|
+
"aria-label": `Digit ${index + 1}`
|
|
684
|
+
},
|
|
685
|
+
index
|
|
686
|
+
)) }),
|
|
687
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
688
|
+
"input",
|
|
689
|
+
{
|
|
690
|
+
type: "hidden",
|
|
691
|
+
id: node.attributes.name,
|
|
692
|
+
name: node.attributes.name,
|
|
693
|
+
value: combinedValue,
|
|
694
|
+
required: node.attributes.required
|
|
299
695
|
}
|
|
300
|
-
)
|
|
696
|
+
)
|
|
697
|
+
] });
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// src/form/components/AnchorButton.tsx
|
|
701
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
702
|
+
function AnchorButton({
|
|
703
|
+
node,
|
|
704
|
+
variant = "default",
|
|
705
|
+
className = "w-full"
|
|
706
|
+
}) {
|
|
707
|
+
if (node.type !== "a" || !("href" in node.attributes)) {
|
|
708
|
+
return null;
|
|
301
709
|
}
|
|
302
|
-
|
|
303
|
-
|
|
710
|
+
const href = node.attributes.href;
|
|
711
|
+
const title = node.attributes.title;
|
|
712
|
+
const label = node.meta?.label;
|
|
713
|
+
const buttonText = (typeof title === "object" && title !== null && "text" in title ? title.text : typeof title === "string" ? title : null) || (label && typeof label === "object" && "text" in label ? label.text : null) || "Continue";
|
|
714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { variant, className, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { href, children: buttonText }) });
|
|
715
|
+
}
|
|
304
716
|
|
|
305
|
-
// src/form/
|
|
306
|
-
var
|
|
307
|
-
function
|
|
717
|
+
// src/form/verification.tsx
|
|
718
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
719
|
+
function VerificationForm({
|
|
720
|
+
flow,
|
|
721
|
+
Header,
|
|
722
|
+
autoRedirect = true
|
|
723
|
+
}) {
|
|
724
|
+
const nodesByGroup = groupNodesByGroup(flow.ui.nodes);
|
|
725
|
+
const csrfToken = findCsrfToken(flow.ui.nodes);
|
|
726
|
+
const codeNodes = nodesByGroup.code || [];
|
|
727
|
+
const inputNodes = filterInputNodes(sortNodes(codeNodes));
|
|
728
|
+
const submitButton = findSubmitButton(sortNodes(codeNodes));
|
|
729
|
+
const anchorNode = findAnchorNode(sortNodes(codeNodes));
|
|
730
|
+
React8.useEffect(() => {
|
|
731
|
+
if (autoRedirect && anchorNode && anchorNode.type === "a" && "href" in anchorNode.attributes) {
|
|
732
|
+
const href = anchorNode.attributes.href;
|
|
733
|
+
if (href && typeof window !== "undefined") {
|
|
734
|
+
window.location.href = href;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}, [autoRedirect, anchorNode]);
|
|
738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
739
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Messages, { flow }),
|
|
740
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Card, { className: "w-full max-w-md mx-auto", children: [
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CardTitle, { className: "text-center pb-1", children: Header || "Verification Code" }) }),
|
|
742
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CardContent, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("form", { action: flow.ui.action, method: flow.ui.method, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-4", children: [
|
|
743
|
+
csrfToken && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HiddenInput, { node: csrfToken }),
|
|
744
|
+
inputNodes.map((node, idx) => {
|
|
745
|
+
const isCodeInput = node.attributes.node_type === "input" && "name" in node.attributes && node.attributes.name === "code";
|
|
746
|
+
const initialValue = isCodeInput && "value" in node.attributes ? String(node.attributes.value || "") : "";
|
|
747
|
+
return isCodeInput ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
748
|
+
PinInput,
|
|
749
|
+
{
|
|
750
|
+
node,
|
|
751
|
+
length: 6,
|
|
752
|
+
initialValue
|
|
753
|
+
},
|
|
754
|
+
idx
|
|
755
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormInput, { node }, idx);
|
|
756
|
+
}),
|
|
757
|
+
submitButton && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SubmitButton, { node: submitButton }),
|
|
758
|
+
!submitButton && anchorNode && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AnchorButton, { node: anchorNode })
|
|
759
|
+
] }) }) })
|
|
760
|
+
] })
|
|
761
|
+
] });
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// src/form/recovery.tsx
|
|
765
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
766
|
+
function RecoveryForm({ flow, Header }) {
|
|
767
|
+
const nodesByGroup = groupNodesByGroup(flow.ui.nodes);
|
|
768
|
+
const csrfToken = findCsrfToken(flow.ui.nodes);
|
|
769
|
+
const codeNodes = nodesByGroup.code || [];
|
|
770
|
+
const linkNodes = nodesByGroup.link || [];
|
|
771
|
+
const activeNodes = codeNodes.length > 0 ? codeNodes : linkNodes;
|
|
772
|
+
const inputNodes = filterInputNodes(sortNodes(activeNodes));
|
|
773
|
+
const submitButton = findSubmitButton(sortNodes(activeNodes));
|
|
774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
775
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Messages, { flow }),
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Card, { className: "w-full max-w-md mx-auto", children: [
|
|
777
|
+
Header && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CardTitle, { className: "text-center pb-1", children: Header }) }),
|
|
778
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CardContent, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("form", { action: flow.ui.action, method: flow.ui.method, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "space-y-4", children: [
|
|
779
|
+
csrfToken && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(HiddenInput, { node: csrfToken }),
|
|
780
|
+
inputNodes.map((node, idx) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormInput, { node }, idx)),
|
|
781
|
+
submitButton && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SubmitButton, { node: submitButton })
|
|
782
|
+
] }) }) })
|
|
783
|
+
] })
|
|
784
|
+
] });
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
// src/form/settings.tsx
|
|
788
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
789
|
+
function isUiNodeInputAttributes2(attributes) {
|
|
308
790
|
return attributes && typeof attributes === "object" && "name" in attributes && "type" in attributes;
|
|
309
791
|
}
|
|
310
|
-
function
|
|
792
|
+
function SettingsForm({ flow }) {
|
|
311
793
|
const nodesByGroup = flow.ui.nodes.reduce((groups, node) => {
|
|
312
794
|
const group = node.group || "default";
|
|
313
795
|
if (!groups[group]) {
|
|
@@ -316,150 +798,128 @@ function CustomFlowForm({ flow, Header }) {
|
|
|
316
798
|
groups[group].push(node);
|
|
317
799
|
return groups;
|
|
318
800
|
}, {});
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
const csrfToken = regularNodes.find(
|
|
322
|
-
(node) => isUiNodeInputAttributes(node.attributes) && node.attributes.name === "csrf_token"
|
|
801
|
+
const csrfToken = flow.ui.nodes.find(
|
|
802
|
+
(node) => isUiNodeInputAttributes2(node.attributes) && node.attributes.name === "csrf_token"
|
|
323
803
|
);
|
|
324
|
-
const
|
|
325
|
-
(
|
|
804
|
+
const settingsGroups = Object.entries(nodesByGroup).filter(
|
|
805
|
+
([group]) => group !== "default" && group !== "oidc"
|
|
326
806
|
);
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
807
|
+
const groupTitles = {
|
|
808
|
+
profile: "Profile",
|
|
809
|
+
password: "Password",
|
|
810
|
+
totp: "Authenticator App",
|
|
811
|
+
webauthn: "Security Keys",
|
|
812
|
+
lookup_secret: "Backup Recovery Codes",
|
|
813
|
+
passkey: "Passkeys"
|
|
814
|
+
};
|
|
815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-6", children: [
|
|
816
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Messages, { flow }),
|
|
817
|
+
settingsGroups.map(([groupName, nodes]) => {
|
|
818
|
+
const submitButton = nodes.find(
|
|
819
|
+
(node) => isUiNodeInputAttributes2(node.attributes) && node.attributes.type === "submit"
|
|
820
|
+
);
|
|
821
|
+
const inputNodes = nodes.filter(
|
|
822
|
+
(node) => isUiNodeInputAttributes2(node.attributes) && node.attributes.type !== "submit" && node.attributes.type !== "hidden"
|
|
823
|
+
);
|
|
824
|
+
const imageNodes = nodes.filter((node) => node.type === "img");
|
|
825
|
+
const textNodes = nodes.filter((node) => node.type === "text");
|
|
826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Card, { className: "w-full max-w-2xl mx-auto", children: [
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CardTitle, { children: groupTitles[groupName] || groupName }) }),
|
|
828
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CardContent, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("form", { action: flow.ui.action, method: flow.ui.method, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-4", children: [
|
|
829
|
+
csrfToken && isUiNodeInputAttributes2(csrfToken.attributes) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
830
|
+
"input",
|
|
831
|
+
{
|
|
832
|
+
name: csrfToken.attributes.name,
|
|
833
|
+
type: "hidden",
|
|
834
|
+
value: csrfToken.attributes.value || "",
|
|
835
|
+
readOnly: true
|
|
836
|
+
}
|
|
837
|
+
),
|
|
838
|
+
imageNodes.map((node, index) => {
|
|
839
|
+
if (node.type === "img" && "src" in node.attributes) {
|
|
840
|
+
const imgAttrs = node.attributes;
|
|
841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
842
|
+
"div",
|
|
337
843
|
{
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
"
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
),
|
|
351
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
352
|
-
Button,
|
|
353
|
-
{
|
|
354
|
-
type: "submit",
|
|
355
|
-
name: node.attributes.name,
|
|
356
|
-
value: node.attributes.value || "",
|
|
357
|
-
variant: "outline",
|
|
358
|
-
className: "w-full",
|
|
359
|
-
children: node.meta.label?.text || node.attributes.value || "Sign in"
|
|
360
|
-
}
|
|
361
|
-
)
|
|
362
|
-
]
|
|
844
|
+
className: "flex justify-center",
|
|
845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
846
|
+
"img",
|
|
847
|
+
{
|
|
848
|
+
src: imgAttrs.src,
|
|
849
|
+
alt: node.meta.label?.text || "QR Code",
|
|
850
|
+
width: imgAttrs.width,
|
|
851
|
+
height: imgAttrs.height,
|
|
852
|
+
className: "border rounded-lg"
|
|
853
|
+
}
|
|
854
|
+
)
|
|
363
855
|
},
|
|
364
|
-
`
|
|
856
|
+
`img-${index}`
|
|
365
857
|
);
|
|
366
858
|
}
|
|
367
859
|
return null;
|
|
368
860
|
}),
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
"
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
value: node.attributes.value || "",
|
|
389
|
-
readOnly: true
|
|
390
|
-
},
|
|
391
|
-
node.attributes.name
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
if (isSubmitButton) {
|
|
395
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
396
|
-
Button,
|
|
861
|
+
textNodes.map((node, index) => {
|
|
862
|
+
if (node.type === "text" && "text" in node.attributes) {
|
|
863
|
+
const textContent = typeof node.attributes.text === "string" ? node.attributes.text : node.attributes.text?.text || "";
|
|
864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-2", children: [
|
|
865
|
+
node.meta.label?.text && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Label, { className: "text-sm text-muted-foreground", children: node.meta.label.text }),
|
|
866
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "p-3 bg-muted rounded-md font-mono text-sm break-all", children: textContent })
|
|
867
|
+
] }, `text-${index}`);
|
|
868
|
+
}
|
|
869
|
+
return null;
|
|
870
|
+
}),
|
|
871
|
+
inputNodes.map((node) => {
|
|
872
|
+
if (isUiNodeInputAttributes2(node.attributes)) {
|
|
873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-2", children: [
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Label, { htmlFor: node.attributes.name, children: [
|
|
875
|
+
node.meta.label?.text,
|
|
876
|
+
node.attributes.required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
877
|
+
] }),
|
|
878
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
879
|
+
Input,
|
|
397
880
|
{
|
|
398
|
-
|
|
881
|
+
id: node.attributes.name,
|
|
399
882
|
name: node.attributes.name,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
"password",
|
|
410
|
-
"code",
|
|
411
|
-
"webauthn",
|
|
412
|
-
"passkey",
|
|
413
|
-
"totp",
|
|
414
|
-
"lookup_secret",
|
|
415
|
-
"profile"
|
|
416
|
-
].includes(node.group)) {
|
|
417
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
418
|
-
"div",
|
|
419
|
-
{
|
|
420
|
-
className: "space-y-2 mb-4",
|
|
421
|
-
children: [
|
|
422
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Label, { htmlFor: node.attributes.name, children: [
|
|
423
|
-
node.meta.label?.text,
|
|
424
|
-
node.attributes.required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
425
|
-
] }),
|
|
426
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
427
|
-
Input,
|
|
428
|
-
{
|
|
429
|
-
id: node.attributes.name,
|
|
430
|
-
name: node.attributes.name,
|
|
431
|
-
type: node.attributes.type,
|
|
432
|
-
defaultValue: node.attributes.value || "",
|
|
433
|
-
required: node.attributes.required,
|
|
434
|
-
placeholder: `Enter your ${node.meta.label?.text?.toLowerCase() || node.attributes.name}`
|
|
435
|
-
}
|
|
436
|
-
)
|
|
437
|
-
]
|
|
438
|
-
},
|
|
439
|
-
node.meta.label?.id || node.attributes.name
|
|
440
|
-
);
|
|
441
|
-
}
|
|
883
|
+
type: node.attributes.type,
|
|
884
|
+
defaultValue: node.attributes.value || "",
|
|
885
|
+
required: node.attributes.required,
|
|
886
|
+
disabled: node.attributes.disabled,
|
|
887
|
+
autoComplete: node.attributes.autocomplete,
|
|
888
|
+
placeholder: `Enter ${node.meta.label?.text?.toLowerCase() || node.attributes.name}`
|
|
889
|
+
}
|
|
890
|
+
)
|
|
891
|
+
] }, node.attributes.name);
|
|
442
892
|
}
|
|
443
893
|
return null;
|
|
444
894
|
}),
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
895
|
+
submitButton && isUiNodeInputAttributes2(submitButton.attributes) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
896
|
+
Button,
|
|
897
|
+
{
|
|
898
|
+
type: "submit",
|
|
899
|
+
name: submitButton.attributes.name,
|
|
900
|
+
value: submitButton.attributes.value || "",
|
|
901
|
+
className: "w-full",
|
|
902
|
+
disabled: submitButton.attributes.disabled,
|
|
903
|
+
children: submitButton.meta.label?.text || submitButton.attributes.value || "Save"
|
|
904
|
+
}
|
|
905
|
+
)
|
|
906
|
+
] }) }) })
|
|
907
|
+
] }, groupName);
|
|
908
|
+
})
|
|
449
909
|
] });
|
|
450
910
|
}
|
|
451
911
|
|
|
452
912
|
// src/tenant-switcher/index.tsx
|
|
453
|
-
var
|
|
913
|
+
var React10 = __toESM(require("react"), 1);
|
|
454
914
|
|
|
455
915
|
// src/components/ui/select.tsx
|
|
456
|
-
var
|
|
916
|
+
var React9 = __toESM(require("react"), 1);
|
|
457
917
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
458
918
|
var import_lucide_react = require("lucide-react");
|
|
459
|
-
var
|
|
919
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
460
920
|
var Select = SelectPrimitive.Root;
|
|
461
921
|
var SelectValue = SelectPrimitive.Value;
|
|
462
|
-
var SelectTrigger =
|
|
922
|
+
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
463
923
|
SelectPrimitive.Trigger,
|
|
464
924
|
{
|
|
465
925
|
ref,
|
|
@@ -470,12 +930,12 @@ var SelectTrigger = React7.forwardRef(({ className, children, ...props }, ref) =
|
|
|
470
930
|
...props,
|
|
471
931
|
children: [
|
|
472
932
|
children,
|
|
473
|
-
/* @__PURE__ */ (0,
|
|
933
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
474
934
|
]
|
|
475
935
|
}
|
|
476
936
|
));
|
|
477
937
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
478
|
-
var SelectScrollUpButton =
|
|
938
|
+
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
479
939
|
SelectPrimitive.ScrollUpButton,
|
|
480
940
|
{
|
|
481
941
|
ref,
|
|
@@ -484,11 +944,11 @@ var SelectScrollUpButton = React7.forwardRef(({ className, ...props }, ref) => /
|
|
|
484
944
|
className
|
|
485
945
|
),
|
|
486
946
|
...props,
|
|
487
|
-
children: /* @__PURE__ */ (0,
|
|
947
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react.ChevronUp, { className: "h-4 w-4" })
|
|
488
948
|
}
|
|
489
949
|
));
|
|
490
950
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
491
|
-
var SelectScrollDownButton =
|
|
951
|
+
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
492
952
|
SelectPrimitive.ScrollDownButton,
|
|
493
953
|
{
|
|
494
954
|
ref,
|
|
@@ -497,11 +957,11 @@ var SelectScrollDownButton = React7.forwardRef(({ className, ...props }, ref) =>
|
|
|
497
957
|
className
|
|
498
958
|
),
|
|
499
959
|
...props,
|
|
500
|
-
children: /* @__PURE__ */ (0,
|
|
960
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react.ChevronDown, { className: "h-4 w-4" })
|
|
501
961
|
}
|
|
502
962
|
));
|
|
503
963
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
504
|
-
var SelectContent =
|
|
964
|
+
var SelectContent = React9.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
505
965
|
SelectPrimitive.Content,
|
|
506
966
|
{
|
|
507
967
|
ref,
|
|
@@ -513,8 +973,8 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
|
|
|
513
973
|
position,
|
|
514
974
|
...props,
|
|
515
975
|
children: [
|
|
516
|
-
/* @__PURE__ */ (0,
|
|
517
|
-
/* @__PURE__ */ (0,
|
|
976
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectScrollUpButton, {}),
|
|
977
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
518
978
|
SelectPrimitive.Viewport,
|
|
519
979
|
{
|
|
520
980
|
className: cn(
|
|
@@ -524,12 +984,12 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
|
|
|
524
984
|
children
|
|
525
985
|
}
|
|
526
986
|
),
|
|
527
|
-
/* @__PURE__ */ (0,
|
|
987
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectScrollDownButton, {})
|
|
528
988
|
]
|
|
529
989
|
}
|
|
530
990
|
) }));
|
|
531
991
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
532
|
-
var SelectLabel =
|
|
992
|
+
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
533
993
|
SelectPrimitive.Label,
|
|
534
994
|
{
|
|
535
995
|
ref,
|
|
@@ -538,7 +998,7 @@ var SelectLabel = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
538
998
|
}
|
|
539
999
|
));
|
|
540
1000
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
541
|
-
var SelectItem =
|
|
1001
|
+
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
542
1002
|
SelectPrimitive.Item,
|
|
543
1003
|
{
|
|
544
1004
|
ref,
|
|
@@ -548,13 +1008,13 @@ var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
548
1008
|
),
|
|
549
1009
|
...props,
|
|
550
1010
|
children: [
|
|
551
|
-
/* @__PURE__ */ (0,
|
|
552
|
-
/* @__PURE__ */ (0,
|
|
1011
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react.Check, { className: "h-4 w-4" }) }) }),
|
|
1012
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectPrimitive.ItemText, { children })
|
|
553
1013
|
]
|
|
554
1014
|
}
|
|
555
1015
|
));
|
|
556
1016
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
557
|
-
var SelectSeparator =
|
|
1017
|
+
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
558
1018
|
SelectPrimitive.Separator,
|
|
559
1019
|
{
|
|
560
1020
|
ref,
|
|
@@ -565,7 +1025,7 @@ var SelectSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
565
1025
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
566
1026
|
|
|
567
1027
|
// src/tenant-switcher/index.tsx
|
|
568
|
-
var
|
|
1028
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
569
1029
|
function SwitchActiveTenant({
|
|
570
1030
|
tenants,
|
|
571
1031
|
currentTenantId,
|
|
@@ -574,7 +1034,7 @@ function SwitchActiveTenant({
|
|
|
574
1034
|
className,
|
|
575
1035
|
onTenantChange
|
|
576
1036
|
}) {
|
|
577
|
-
const [isLoading, setIsLoading] =
|
|
1037
|
+
const [isLoading, setIsLoading] = React10.useState(false);
|
|
578
1038
|
const handleTenantChange = async (tenantId) => {
|
|
579
1039
|
if (tenantId === currentTenantId) return;
|
|
580
1040
|
setIsLoading(true);
|
|
@@ -592,24 +1052,24 @@ function SwitchActiveTenant({
|
|
|
592
1052
|
}
|
|
593
1053
|
};
|
|
594
1054
|
const currentTenant = tenants.find((tenant) => tenant.id === currentTenantId);
|
|
595
|
-
return /* @__PURE__ */ (0,
|
|
1055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
596
1056
|
Select,
|
|
597
1057
|
{
|
|
598
1058
|
value: currentTenantId,
|
|
599
1059
|
onValueChange: handleTenantChange,
|
|
600
1060
|
disabled: isLoading,
|
|
601
1061
|
children: [
|
|
602
|
-
/* @__PURE__ */ (0,
|
|
603
|
-
/* @__PURE__ */ (0,
|
|
1062
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectTrigger, { className: cn("max-w-64", className), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectValue, { placeholder, children: currentTenant ? currentTenant.name : placeholder }) }),
|
|
1063
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectContent, { children: tenants.map((tenant) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectItem, { value: tenant.id, children: tenant.name }, tenant.id)) })
|
|
604
1064
|
]
|
|
605
1065
|
}
|
|
606
1066
|
);
|
|
607
1067
|
}
|
|
608
1068
|
|
|
609
1069
|
// src/pricing-table/index.tsx
|
|
610
|
-
var
|
|
1070
|
+
var React11 = __toESM(require("react"), 1);
|
|
611
1071
|
var import_lucide_react2 = require("lucide-react");
|
|
612
|
-
var
|
|
1072
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
613
1073
|
var getCurrencySymbol = (currency) => {
|
|
614
1074
|
const symbols = {
|
|
615
1075
|
USD: "$",
|
|
@@ -650,7 +1110,7 @@ function PricingCard({
|
|
|
650
1110
|
}) {
|
|
651
1111
|
const ui = product.ui || {};
|
|
652
1112
|
const isHighlighted = ui.highlighted;
|
|
653
|
-
return /* @__PURE__ */ (0,
|
|
1113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
654
1114
|
"div",
|
|
655
1115
|
{
|
|
656
1116
|
className: cn(
|
|
@@ -658,11 +1118,11 @@ function PricingCard({
|
|
|
658
1118
|
isHighlighted ? "relative" : ""
|
|
659
1119
|
),
|
|
660
1120
|
children: [
|
|
661
|
-
/* @__PURE__ */ (0,
|
|
662
|
-
ui.badge === "Most Popular" && /* @__PURE__ */ (0,
|
|
1121
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-4 flex-shrink-0 relative", children: ui.badge && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute top-0 left-1/2 transform -translate-x-1/2 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "bg-primary text-primary-foreground px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1 whitespace-nowrap shadow-md", children: [
|
|
1122
|
+
ui.badge === "Most Popular" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react2.Star, { className: "w-3 h-3" }),
|
|
663
1123
|
ui.badge
|
|
664
1124
|
] }) }) }),
|
|
665
|
-
/* @__PURE__ */ (0,
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
666
1126
|
Card,
|
|
667
1127
|
{
|
|
668
1128
|
className: cn(
|
|
@@ -671,36 +1131,36 @@ function PricingCard({
|
|
|
671
1131
|
isSelected && "ring-2 ring-primary"
|
|
672
1132
|
),
|
|
673
1133
|
children: [
|
|
674
|
-
/* @__PURE__ */ (0,
|
|
675
|
-
/* @__PURE__ */ (0,
|
|
676
|
-
ui.tagline && /* @__PURE__ */ (0,
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(CardHeader, { className: "text-center", children: [
|
|
1135
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardTitle, { className: "text-xl font-bold", children: ui.display_name || product.name }),
|
|
1136
|
+
ui.tagline && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardDescription, { className: "text-base", children: ui.tagline })
|
|
677
1137
|
] }),
|
|
678
|
-
/* @__PURE__ */ (0,
|
|
679
|
-
/* @__PURE__ */ (0,
|
|
680
|
-
/* @__PURE__ */ (0,
|
|
681
|
-
/* @__PURE__ */ (0,
|
|
1138
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(CardContent, { className: "flex-1 space-y-6", children: [
|
|
1139
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "text-center", children: [
|
|
1140
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "text-3xl font-bold", children: formatPrice(displayedPrice) }),
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "text-sm text-muted-foreground", children: formatBillingPeriod(displayedPrice) })
|
|
682
1142
|
] }),
|
|
683
|
-
(ui.features && ui.features.length > 0 || displayedPrice.ui?.features?.length > 0 || displayedPrice.ui?.limits?.length > 0) && /* @__PURE__ */ (0,
|
|
684
|
-
ui.features && ui.features.length > 0 && /* @__PURE__ */ (0,
|
|
685
|
-
/* @__PURE__ */ (0,
|
|
686
|
-
/* @__PURE__ */ (0,
|
|
687
|
-
/* @__PURE__ */ (0,
|
|
688
|
-
/* @__PURE__ */ (0,
|
|
1143
|
+
(ui.features && ui.features.length > 0 || displayedPrice.ui?.features?.length > 0 || displayedPrice.ui?.limits?.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-4", children: [
|
|
1144
|
+
ui.features && ui.features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-2", children: [
|
|
1145
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Features" }),
|
|
1146
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "space-y-2", children: ui.features.map((feature, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: "flex items-start gap-2", children: [
|
|
1147
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react2.Check, { className: "w-4 h-4 text-green-500 mt-0.5 flex-shrink-0" }),
|
|
1148
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm", children: feature })
|
|
689
1149
|
] }, index)) })
|
|
690
1150
|
] }),
|
|
691
|
-
displayedPrice.ui?.features && displayedPrice.ui.features.length > 0 && /* @__PURE__ */ (0,
|
|
692
|
-
/* @__PURE__ */ (0,
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
694
|
-
(feature, index) => /* @__PURE__ */ (0,
|
|
695
|
-
/* @__PURE__ */ (0,
|
|
696
|
-
/* @__PURE__ */ (0,
|
|
1151
|
+
displayedPrice.ui?.features && displayedPrice.ui.features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-2", children: [
|
|
1152
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "This Plan" }),
|
|
1153
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "space-y-2", children: displayedPrice.ui.features.map(
|
|
1154
|
+
(feature, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: "flex items-start gap-2", children: [
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react2.Check, { className: "w-4 h-4 text-blue-500 mt-0.5 flex-shrink-0" }),
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm", children: feature })
|
|
697
1157
|
] }, index)
|
|
698
1158
|
) })
|
|
699
1159
|
] }),
|
|
700
|
-
displayedPrice.ui?.limits && displayedPrice.ui.limits.length > 0 && /* @__PURE__ */ (0,
|
|
701
|
-
/* @__PURE__ */ (0,
|
|
702
|
-
/* @__PURE__ */ (0,
|
|
703
|
-
(limit, index) => /* @__PURE__ */ (0,
|
|
1160
|
+
displayedPrice.ui?.limits && displayedPrice.ui.limits.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-2", children: [
|
|
1161
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Usage Limits" }),
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "space-y-1", children: displayedPrice.ui.limits.map(
|
|
1163
|
+
(limit, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
704
1164
|
"li",
|
|
705
1165
|
{
|
|
706
1166
|
className: "text-sm text-muted-foreground",
|
|
@@ -712,7 +1172,7 @@ function PricingCard({
|
|
|
712
1172
|
] })
|
|
713
1173
|
] })
|
|
714
1174
|
] }),
|
|
715
|
-
/* @__PURE__ */ (0,
|
|
1175
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
716
1176
|
Button,
|
|
717
1177
|
{
|
|
718
1178
|
className: "w-full",
|
|
@@ -739,24 +1199,24 @@ function PricingTable({
|
|
|
739
1199
|
showPricingToggle = false,
|
|
740
1200
|
defaultInterval = "month"
|
|
741
1201
|
}) {
|
|
742
|
-
const [selectedInterval, setSelectedInterval] =
|
|
743
|
-
const [carouselIndex, setCarouselIndex] =
|
|
744
|
-
const sortedProducts =
|
|
1202
|
+
const [selectedInterval, setSelectedInterval] = React11.useState(defaultInterval);
|
|
1203
|
+
const [carouselIndex, setCarouselIndex] = React11.useState(0);
|
|
1204
|
+
const sortedProducts = React11.useMemo(
|
|
745
1205
|
() => [...products].sort(
|
|
746
1206
|
(a, b) => (a.ui?.sort_order ?? 999) - (b.ui?.sort_order ?? 999)
|
|
747
1207
|
),
|
|
748
1208
|
[products]
|
|
749
1209
|
);
|
|
750
|
-
const hasMultipleIntervals =
|
|
1210
|
+
const hasMultipleIntervals = React11.useMemo(
|
|
751
1211
|
() => products.some(
|
|
752
1212
|
(p) => new Set(p.prices.map((price) => price.interval)).size > 1
|
|
753
1213
|
),
|
|
754
1214
|
[products]
|
|
755
1215
|
);
|
|
756
|
-
const getDisplayedPrice = (product) => product.prices.find((
|
|
1216
|
+
const getDisplayedPrice = (product) => product.prices.find((price) => price.interval === selectedInterval) || product.prices[0];
|
|
757
1217
|
const renderCard = (product) => {
|
|
758
1218
|
const displayedPrice = getDisplayedPrice(product);
|
|
759
|
-
return /* @__PURE__ */ (0,
|
|
1219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
760
1220
|
PricingCard,
|
|
761
1221
|
{
|
|
762
1222
|
product,
|
|
@@ -766,8 +1226,8 @@ function PricingTable({
|
|
|
766
1226
|
}
|
|
767
1227
|
);
|
|
768
1228
|
};
|
|
769
|
-
const desktopCarousel = /* @__PURE__ */ (0,
|
|
770
|
-
/* @__PURE__ */ (0,
|
|
1229
|
+
const desktopCarousel = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative max-w-7xl mx-auto", children: [
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
771
1231
|
Button,
|
|
772
1232
|
{
|
|
773
1233
|
variant: "ghost",
|
|
@@ -775,15 +1235,15 @@ function PricingTable({
|
|
|
775
1235
|
className: "absolute left-0 top-1/2 transform -translate-y-1/2 -translate-x-4 z-10 bg-white shadow-lg border hover:bg-gray-50 disabled:opacity-50",
|
|
776
1236
|
onClick: () => setCarouselIndex(Math.max(0, carouselIndex - 1)),
|
|
777
1237
|
disabled: carouselIndex === 0,
|
|
778
|
-
children: /* @__PURE__ */ (0,
|
|
1238
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react2.ChevronLeft, { className: "w-4 h-4" })
|
|
779
1239
|
}
|
|
780
1240
|
),
|
|
781
|
-
/* @__PURE__ */ (0,
|
|
1241
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
782
1242
|
"div",
|
|
783
1243
|
{
|
|
784
1244
|
className: "overflow-hidden mx-auto",
|
|
785
1245
|
style: { width: `${3 * CARD_WIDTH + 2 * GAP}px` },
|
|
786
|
-
children: /* @__PURE__ */ (0,
|
|
1246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
787
1247
|
"div",
|
|
788
1248
|
{
|
|
789
1249
|
className: "flex items-stretch transition-transform duration-300 ease-in-out",
|
|
@@ -791,7 +1251,7 @@ function PricingTable({
|
|
|
791
1251
|
transform: `translateX(-${carouselIndex * (CARD_WIDTH + GAP)}px)`,
|
|
792
1252
|
gap: `${GAP}px`
|
|
793
1253
|
},
|
|
794
|
-
children: sortedProducts.map((p) => /* @__PURE__ */ (0,
|
|
1254
|
+
children: sortedProducts.map((p) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
795
1255
|
"div",
|
|
796
1256
|
{
|
|
797
1257
|
style: { width: `${CARD_WIDTH}px` },
|
|
@@ -804,7 +1264,7 @@ function PricingTable({
|
|
|
804
1264
|
)
|
|
805
1265
|
}
|
|
806
1266
|
),
|
|
807
|
-
/* @__PURE__ */ (0,
|
|
1267
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
808
1268
|
Button,
|
|
809
1269
|
{
|
|
810
1270
|
variant: "ghost",
|
|
@@ -814,12 +1274,12 @@ function PricingTable({
|
|
|
814
1274
|
Math.min(sortedProducts.length - 3, carouselIndex + 1)
|
|
815
1275
|
),
|
|
816
1276
|
disabled: carouselIndex >= sortedProducts.length - 3,
|
|
817
|
-
children: /* @__PURE__ */ (0,
|
|
1277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react2.ChevronRight, { className: "w-4 h-4" })
|
|
818
1278
|
}
|
|
819
1279
|
),
|
|
820
|
-
/* @__PURE__ */ (0,
|
|
1280
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-center mt-6 space-x-2", children: Array.from(
|
|
821
1281
|
{ length: Math.max(1, sortedProducts.length - 2) },
|
|
822
|
-
(_, i) => /* @__PURE__ */ (0,
|
|
1282
|
+
(_, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
823
1283
|
"button",
|
|
824
1284
|
{
|
|
825
1285
|
onClick: () => setCarouselIndex(i),
|
|
@@ -833,12 +1293,12 @@ function PricingTable({
|
|
|
833
1293
|
)
|
|
834
1294
|
) })
|
|
835
1295
|
] });
|
|
836
|
-
const staticLayout = /* @__PURE__ */ (0,
|
|
1296
|
+
const staticLayout = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
837
1297
|
"div",
|
|
838
1298
|
{
|
|
839
1299
|
className: "flex flex-row items-stretch justify-center",
|
|
840
1300
|
style: { gap: `${GAP}px` },
|
|
841
|
-
children: sortedProducts.map((p) => /* @__PURE__ */ (0,
|
|
1301
|
+
children: sortedProducts.map((p) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
842
1302
|
"div",
|
|
843
1303
|
{
|
|
844
1304
|
style: { width: `${CARD_WIDTH}px` },
|
|
@@ -849,9 +1309,9 @@ function PricingTable({
|
|
|
849
1309
|
))
|
|
850
1310
|
}
|
|
851
1311
|
);
|
|
852
|
-
return /* @__PURE__ */ (0,
|
|
853
|
-
showPricingToggle && hasMultipleIntervals && /* @__PURE__ */ (0,
|
|
854
|
-
/* @__PURE__ */ (0,
|
|
1312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("w-full", className), children: [
|
|
1313
|
+
showPricingToggle && hasMultipleIntervals && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-center mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex bg-gray-100 p-1 rounded-lg", children: [
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
855
1315
|
Button,
|
|
856
1316
|
{
|
|
857
1317
|
variant: selectedInterval === "month" ? "default" : "ghost",
|
|
@@ -861,7 +1321,7 @@ function PricingTable({
|
|
|
861
1321
|
children: "Monthly"
|
|
862
1322
|
}
|
|
863
1323
|
),
|
|
864
|
-
/* @__PURE__ */ (0,
|
|
1324
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
865
1325
|
Button,
|
|
866
1326
|
{
|
|
867
1327
|
variant: selectedInterval === "year" ? "default" : "ghost",
|
|
@@ -872,20 +1332,20 @@ function PricingTable({
|
|
|
872
1332
|
}
|
|
873
1333
|
)
|
|
874
1334
|
] }) }),
|
|
875
|
-
/* @__PURE__ */ (0,
|
|
876
|
-
/* @__PURE__ */ (0,
|
|
1335
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "lg:hidden relative", children: [
|
|
1336
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
877
1337
|
"div",
|
|
878
1338
|
{
|
|
879
1339
|
className: "overflow-hidden mx-auto",
|
|
880
1340
|
style: { width: `${CARD_WIDTH}px` },
|
|
881
|
-
children: /* @__PURE__ */ (0,
|
|
1341
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
882
1342
|
"div",
|
|
883
1343
|
{
|
|
884
1344
|
className: "flex transition-transform duration-300 ease-in-out items-stretch",
|
|
885
1345
|
style: {
|
|
886
1346
|
transform: `translateX(-${carouselIndex * CARD_WIDTH}px)`
|
|
887
1347
|
},
|
|
888
|
-
children: sortedProducts.map((product) => /* @__PURE__ */ (0,
|
|
1348
|
+
children: sortedProducts.map((product) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
889
1349
|
"div",
|
|
890
1350
|
{
|
|
891
1351
|
className: "flex-shrink-0",
|
|
@@ -898,8 +1358,8 @@ function PricingTable({
|
|
|
898
1358
|
)
|
|
899
1359
|
}
|
|
900
1360
|
),
|
|
901
|
-
sortedProducts.length > 1 && /* @__PURE__ */ (0,
|
|
902
|
-
/* @__PURE__ */ (0,
|
|
1361
|
+
sortedProducts.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1362
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
903
1363
|
Button,
|
|
904
1364
|
{
|
|
905
1365
|
variant: "ghost",
|
|
@@ -907,10 +1367,10 @@ function PricingTable({
|
|
|
907
1367
|
className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-2 z-10 bg-white shadow-lg border hover:bg-gray-50 disabled:opacity-50",
|
|
908
1368
|
onClick: () => setCarouselIndex((prev) => Math.max(0, prev - 1)),
|
|
909
1369
|
disabled: carouselIndex === 0,
|
|
910
|
-
children: /* @__PURE__ */ (0,
|
|
1370
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react2.ChevronLeft, { className: "w-5 h-5" })
|
|
911
1371
|
}
|
|
912
1372
|
),
|
|
913
|
-
/* @__PURE__ */ (0,
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
914
1374
|
Button,
|
|
915
1375
|
{
|
|
916
1376
|
variant: "ghost",
|
|
@@ -920,10 +1380,10 @@ function PricingTable({
|
|
|
920
1380
|
(prev) => Math.min(sortedProducts.length - 1, prev + 1)
|
|
921
1381
|
),
|
|
922
1382
|
disabled: carouselIndex >= sortedProducts.length - 1,
|
|
923
|
-
children: /* @__PURE__ */ (0,
|
|
1383
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react2.ChevronRight, { className: "w-5 h-5" })
|
|
924
1384
|
}
|
|
925
1385
|
),
|
|
926
|
-
/* @__PURE__ */ (0,
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-center mt-6 space-x-2", children: Array.from({ length: sortedProducts.length }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
927
1387
|
"button",
|
|
928
1388
|
{
|
|
929
1389
|
onClick: () => setCarouselIndex(i),
|
|
@@ -937,20 +1397,20 @@ function PricingTable({
|
|
|
937
1397
|
)) })
|
|
938
1398
|
] })
|
|
939
1399
|
] }),
|
|
940
|
-
/* @__PURE__ */ (0,
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "hidden lg:block", children: sortedProducts.length <= 3 ? staticLayout : desktopCarousel })
|
|
941
1401
|
] });
|
|
942
1402
|
}
|
|
943
1403
|
|
|
944
1404
|
// src/tenant-creator/index.tsx
|
|
945
1405
|
var import_react = require("react");
|
|
946
|
-
var
|
|
1406
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
947
1407
|
function TenantCreator({
|
|
948
1408
|
config = {},
|
|
949
1409
|
formActions = {},
|
|
950
1410
|
className
|
|
951
1411
|
}) {
|
|
952
1412
|
const [mode, setMode] = (0, import_react.useState)(
|
|
953
|
-
config.defaultMode || "create"
|
|
1413
|
+
!!config.joinForm?.token?.defaultValue === true ? "join" : config.defaultMode || "create"
|
|
954
1414
|
);
|
|
955
1415
|
const [isLoading, setIsLoading] = (0, import_react.useState)(false);
|
|
956
1416
|
const [organizationName, setOrganizationName] = (0, import_react.useState)(
|
|
@@ -962,39 +1422,44 @@ function TenantCreator({
|
|
|
962
1422
|
const [token, setToken] = (0, import_react.useState)(
|
|
963
1423
|
config.joinForm?.token?.defaultValue || ""
|
|
964
1424
|
);
|
|
1425
|
+
(0, import_react.useEffect)(() => {
|
|
1426
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
1427
|
+
const inviteToken = urlParams.get("invite_token");
|
|
1428
|
+
if (inviteToken) {
|
|
1429
|
+
setToken(inviteToken);
|
|
1430
|
+
setMode("join");
|
|
1431
|
+
}
|
|
1432
|
+
}, []);
|
|
965
1433
|
const handleCreateSubmit = async (e) => {
|
|
966
1434
|
e.preventDefault();
|
|
967
|
-
if (!formActions.
|
|
1435
|
+
if (!formActions.createOrganizationAction) return;
|
|
968
1436
|
setIsLoading(true);
|
|
969
1437
|
try {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
billingEmail
|
|
973
|
-
});
|
|
1438
|
+
const formData = new FormData(e.target);
|
|
1439
|
+
await formActions.createOrganizationAction(formData);
|
|
974
1440
|
} finally {
|
|
975
1441
|
setIsLoading(false);
|
|
976
1442
|
}
|
|
977
1443
|
};
|
|
978
1444
|
const handleJoinSubmit = async (e) => {
|
|
979
1445
|
e.preventDefault();
|
|
980
|
-
if (!formActions.
|
|
1446
|
+
if (!formActions.joinOrganizationAction) return;
|
|
981
1447
|
setIsLoading(true);
|
|
982
1448
|
try {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
});
|
|
1449
|
+
const formData = new FormData(e.target);
|
|
1450
|
+
await formActions.joinOrganizationAction(formData);
|
|
986
1451
|
} finally {
|
|
987
1452
|
setIsLoading(false);
|
|
988
1453
|
}
|
|
989
1454
|
};
|
|
990
|
-
return /* @__PURE__ */ (0,
|
|
991
|
-
/* @__PURE__ */ (0,
|
|
992
|
-
/* @__PURE__ */ (0,
|
|
993
|
-
/* @__PURE__ */ (0,
|
|
1455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Card, { className: cn("w-full max-w-md mx-auto", className), children: [
|
|
1456
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(CardHeader, { children: [
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardTitle, { children: "Organization Setup" }),
|
|
1458
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardDescription, { children: "Choose how you want to get started with your organization." })
|
|
994
1459
|
] }),
|
|
995
|
-
/* @__PURE__ */ (0,
|
|
996
|
-
/* @__PURE__ */ (0,
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
1460
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(CardContent, { className: "space-y-6", children: [
|
|
1461
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "grid grid-cols-2 rounded-lg bg-muted p-1", children: [
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
998
1463
|
"label",
|
|
999
1464
|
{
|
|
1000
1465
|
className: cn(
|
|
@@ -1003,7 +1468,7 @@ function TenantCreator({
|
|
|
1003
1468
|
isLoading && "pointer-events-none opacity-50"
|
|
1004
1469
|
),
|
|
1005
1470
|
children: [
|
|
1006
|
-
/* @__PURE__ */ (0,
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1007
1472
|
"input",
|
|
1008
1473
|
{
|
|
1009
1474
|
type: "radio",
|
|
@@ -1019,7 +1484,7 @@ function TenantCreator({
|
|
|
1019
1484
|
]
|
|
1020
1485
|
}
|
|
1021
1486
|
),
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1023
1488
|
"label",
|
|
1024
1489
|
{
|
|
1025
1490
|
className: cn(
|
|
@@ -1028,7 +1493,7 @@ function TenantCreator({
|
|
|
1028
1493
|
isLoading && "pointer-events-none opacity-50"
|
|
1029
1494
|
),
|
|
1030
1495
|
children: [
|
|
1031
|
-
/* @__PURE__ */ (0,
|
|
1496
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1032
1497
|
"input",
|
|
1033
1498
|
{
|
|
1034
1499
|
type: "radio",
|
|
@@ -1045,13 +1510,14 @@ function TenantCreator({
|
|
|
1045
1510
|
}
|
|
1046
1511
|
)
|
|
1047
1512
|
] }),
|
|
1048
|
-
mode === "create" && /* @__PURE__ */ (0,
|
|
1049
|
-
/* @__PURE__ */ (0,
|
|
1050
|
-
/* @__PURE__ */ (0,
|
|
1051
|
-
/* @__PURE__ */ (0,
|
|
1513
|
+
mode === "create" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("form", { onSubmit: handleCreateSubmit, className: "space-y-4", children: [
|
|
1514
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-2", children: [
|
|
1515
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Label, { htmlFor: "organizationName", children: config.createForm?.organizationName?.label || "Organization Name" }),
|
|
1516
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1052
1517
|
Input,
|
|
1053
1518
|
{
|
|
1054
1519
|
id: "organizationName",
|
|
1520
|
+
name: "organizationName",
|
|
1055
1521
|
type: "text",
|
|
1056
1522
|
placeholder: config.createForm?.organizationName?.placeholder || "Enter organization name",
|
|
1057
1523
|
value: organizationName,
|
|
@@ -1061,12 +1527,13 @@ function TenantCreator({
|
|
|
1061
1527
|
}
|
|
1062
1528
|
)
|
|
1063
1529
|
] }),
|
|
1064
|
-
/* @__PURE__ */ (0,
|
|
1065
|
-
/* @__PURE__ */ (0,
|
|
1066
|
-
/* @__PURE__ */ (0,
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-2", children: [
|
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Label, { htmlFor: "billingEmail", children: config.createForm?.billingEmail?.label || "Billing Email" }),
|
|
1532
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1067
1533
|
Input,
|
|
1068
1534
|
{
|
|
1069
1535
|
id: "billingEmail",
|
|
1536
|
+
name: "billingEmail",
|
|
1070
1537
|
type: "email",
|
|
1071
1538
|
placeholder: config.createForm?.billingEmail?.placeholder || "Enter billing email",
|
|
1072
1539
|
value: billingEmail,
|
|
@@ -1076,15 +1543,16 @@ function TenantCreator({
|
|
|
1076
1543
|
}
|
|
1077
1544
|
)
|
|
1078
1545
|
] }),
|
|
1079
|
-
/* @__PURE__ */ (0,
|
|
1546
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Creating..." : "Create Organization" })
|
|
1080
1547
|
] }),
|
|
1081
|
-
mode === "join" && /* @__PURE__ */ (0,
|
|
1082
|
-
/* @__PURE__ */ (0,
|
|
1083
|
-
/* @__PURE__ */ (0,
|
|
1084
|
-
/* @__PURE__ */ (0,
|
|
1548
|
+
mode === "join" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("form", { onSubmit: handleJoinSubmit, className: "space-y-4", children: [
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-2", children: [
|
|
1550
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Label, { htmlFor: "token", children: config.joinForm?.token?.label || "Invitation Token" }),
|
|
1551
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1085
1552
|
Input,
|
|
1086
1553
|
{
|
|
1087
1554
|
id: "token",
|
|
1555
|
+
name: "token",
|
|
1088
1556
|
type: "text",
|
|
1089
1557
|
placeholder: config.joinForm?.token?.placeholder || "Enter invitation token",
|
|
1090
1558
|
value: token,
|
|
@@ -1094,15 +1562,26 @@ function TenantCreator({
|
|
|
1094
1562
|
}
|
|
1095
1563
|
)
|
|
1096
1564
|
] }),
|
|
1097
|
-
/* @__PURE__ */ (0,
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Joining..." : "Join Organization" })
|
|
1098
1566
|
] })
|
|
1099
1567
|
] })
|
|
1100
1568
|
] });
|
|
1101
1569
|
}
|
|
1102
1570
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1103
1571
|
0 && (module.exports = {
|
|
1104
|
-
|
|
1572
|
+
LoginForm,
|
|
1105
1573
|
PricingTable,
|
|
1574
|
+
RecoveryForm,
|
|
1575
|
+
RegistrationForm,
|
|
1576
|
+
SettingsForm,
|
|
1106
1577
|
SwitchActiveTenant,
|
|
1107
|
-
TenantCreator
|
|
1578
|
+
TenantCreator,
|
|
1579
|
+
VerificationForm,
|
|
1580
|
+
filterInputNodes,
|
|
1581
|
+
findAnchorNode,
|
|
1582
|
+
findCsrfToken,
|
|
1583
|
+
findSubmitButton,
|
|
1584
|
+
groupNodesByGroup,
|
|
1585
|
+
isUiNodeInputAttributes,
|
|
1586
|
+
sortNodes
|
|
1108
1587
|
});
|