@ory/elements-react 0.0.0-pr.8e964fc1
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/CHANGELOG.md +404 -0
- package/DEVELOPMENT.md +79 -0
- package/LICENSE +201 -0
- package/README.md +254 -0
- package/dist/client/config.d.mts +21 -0
- package/dist/client/config.d.ts +21 -0
- package/dist/client/config.js +77 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/config.mjs +51 -0
- package/dist/client/config.mjs.map +1 -0
- package/dist/client/frontendClient.d.mts +7 -0
- package/dist/client/frontendClient.d.ts +7 -0
- package/dist/client/frontendClient.js +52 -0
- package/dist/client/frontendClient.js.map +1 -0
- package/dist/client/frontendClient.mjs +31 -0
- package/dist/client/frontendClient.mjs.map +1 -0
- package/dist/client/index.d.mts +5 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +33 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/index.mjs +10 -0
- package/dist/client/index.mjs.map +1 -0
- package/dist/client/session-provider.d.mts +62 -0
- package/dist/client/session-provider.d.ts +62 -0
- package/dist/client/session-provider.js +96 -0
- package/dist/client/session-provider.js.map +1 -0
- package/dist/client/session-provider.mjs +71 -0
- package/dist/client/session-provider.mjs.map +1 -0
- package/dist/client/useSession.d.mts +32 -0
- package/dist/client/useSession.d.ts +32 -0
- package/dist/client/useSession.js +37 -0
- package/dist/client/useSession.js.map +1 -0
- package/dist/client/useSession.mjs +13 -0
- package/dist/client/useSession.mjs.map +1 -0
- package/dist/index.d.mts +585 -0
- package/dist/index.d.ts +585 -0
- package/dist/index.js +3741 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3719 -0
- package/dist/index.mjs.map +1 -0
- package/dist/theme/default/index.css +1510 -0
- package/dist/theme/default/index.css.map +1 -0
- package/dist/theme/default/index.d.mts +78 -0
- package/dist/theme/default/index.d.ts +78 -0
- package/dist/theme/default/index.js +2576 -0
- package/dist/theme/default/index.js.map +1 -0
- package/dist/theme/default/index.mjs +2571 -0
- package/dist/theme/default/index.mjs.map +1 -0
- package/dist/theme/default/tailwind/defaults.d.mts +737 -0
- package/dist/theme/default/tailwind/defaults.d.ts +737 -0
- package/dist/theme/default/tailwind/defaults.js +219 -0
- package/dist/theme/default/tailwind/defaults.js.map +1 -0
- package/dist/theme/default/tailwind/defaults.mjs +196 -0
- package/dist/theme/default/tailwind/defaults.mjs.map +1 -0
- package/package.json +90 -0
- package/tailwind/defaults.ts +34 -0
- package/tailwind/generated/README.md +2 -0
- package/tailwind/generated/default-variables.css +216 -0
- package/tailwind/generated/variables-processed.json +161 -0
- package/tsconfig.json +35 -0
- package/tsconfig.runtime.json +4 -0
|
@@ -0,0 +1,2576 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/theme/default/index.ts
|
|
32
|
+
var default_exports = {};
|
|
33
|
+
__export(default_exports, {
|
|
34
|
+
DefaultButtonSocial: () => DefaultButtonSocial,
|
|
35
|
+
DefaultCard: () => DefaultCard,
|
|
36
|
+
DefaultCardContent: () => DefaultCardContent,
|
|
37
|
+
DefaultCardFooter: () => DefaultCardFooter,
|
|
38
|
+
DefaultCardHeader: () => DefaultCardHeader,
|
|
39
|
+
DefaultCardLayout: () => DefaultCardLayout,
|
|
40
|
+
DefaultCardLogo: () => DefaultCardLogo,
|
|
41
|
+
DefaultCurrentIdentifierButton: () => DefaultCurrentIdentifierButton,
|
|
42
|
+
DefaultFormContainer: () => DefaultFormContainer,
|
|
43
|
+
DefaultMessage: () => DefaultMessage,
|
|
44
|
+
DefaultMessageContainer: () => DefaultMessageContainer,
|
|
45
|
+
Error: () => Error2,
|
|
46
|
+
Login: () => Login,
|
|
47
|
+
Recovery: () => Recovery,
|
|
48
|
+
Registration: () => Registration,
|
|
49
|
+
Settings: () => Settings,
|
|
50
|
+
Verification: () => Verification,
|
|
51
|
+
getOryComponents: () => getOryComponents
|
|
52
|
+
});
|
|
53
|
+
module.exports = __toCommonJS(default_exports);
|
|
54
|
+
|
|
55
|
+
// src/theme/default/assets/ory-badge-horizontal.svg
|
|
56
|
+
var React = __toESM(require("react"));
|
|
57
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
58
|
+
var SvgOryBadgeHorizontal = (props) => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#0F172A", d: "M18.007 8h-1.71l2.007-3.996L16.296 0h1.711l1.145 2.301L20.327 0H22z" }),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#0F172A", fillRule: "evenodd", d: "M12.902 4.86a2.47 2.47 0 0 0 1.796-2.365v-.038C14.687 1.097 13.592 0 12.245 0H9.037v1.44l1.208 1.985H9.04V8h1.51V4.949h.633L13.04 8h1.775zm-.876-1.431h.223c.52 0 .943-.427.943-.953a.95.95 0 0 0-.943-.952h-1.39zM4 0a4 4 0 1 0-.001 7.999A4 4 0 0 0 4 0M1.524 4a2.476 2.476 0 1 0 4.952 0 2.476 2.476 0 0 0-4.952 0", clipRule: "evenodd" })
|
|
63
|
+
] });
|
|
64
|
+
};
|
|
65
|
+
var ory_badge_horizontal_default = SvgOryBadgeHorizontal;
|
|
66
|
+
|
|
67
|
+
// src/theme/default/assets/ory-badge-vertical.svg
|
|
68
|
+
var React2 = __toESM(require("react"));
|
|
69
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
70
|
+
var SvgOryBadgeVertical = (props) => {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: "#0F172A", d: "M8 3.993v1.71L4.004 3.697 0 5.704V3.993l2.301-1.145L0 1.673V0z" }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: "#0F172A", fillRule: "evenodd", d: "M4.86 9.099a2.47 2.47 0 0 0-2.365-1.797h-.038C1.097 7.313 0 8.408 0 9.755v3.208h1.44l1.985-1.208v1.204H8v-1.51H4.949v-.633L8 8.96V7.185zm-1.431.875v-.223a.95.95 0 0 0-.953-.943.95.95 0 0 0-.952.943v1.39zM0 18a4 4 0 1 0 8 0 4 4 0 0 0-8 0m4 2.476a2.476 2.476 0 1 0 0-4.952 2.476 2.476 0 0 0 0 4.952", clipRule: "evenodd" })
|
|
75
|
+
] });
|
|
76
|
+
};
|
|
77
|
+
var ory_badge_vertical_default = SvgOryBadgeVertical;
|
|
78
|
+
|
|
79
|
+
// src/theme/default/components/card/badge.tsx
|
|
80
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
81
|
+
function Badge() {
|
|
82
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "absolute bg-ory-background-default p-2 font-bold max-sm:bottom-0 max-sm:left-8 max-sm:translate-y-full max-sm:rounded-b-branding sm:right-0 sm:top-8 sm:translate-x-full sm:rounded-r-branding border-ory-border-default border max-sm:py-[7px] sm:pl-[7px]", children: [
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ory_badge_horizontal_default, { width: 22, height: 8, className: "sm:hidden" }),
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ory_badge_vertical_default, { width: 8, height: 22, className: "max-sm:hidden" })
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/theme/default/components/card/content.tsx
|
|
89
|
+
function DefaultCardContent({ children }) {
|
|
90
|
+
return children;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/theme/default/components/card/footer.tsx
|
|
94
|
+
var import_client_fetch = require("@ory/client-fetch");
|
|
95
|
+
var import_elements_react = require("@ory/elements-react");
|
|
96
|
+
var import_react_hook_form = require("react-hook-form");
|
|
97
|
+
var import_react_intl = require("react-intl");
|
|
98
|
+
|
|
99
|
+
// src/theme/default/utils/url.ts
|
|
100
|
+
function restartFlowUrl(flow, fallback) {
|
|
101
|
+
return flow.request_url || appendReturnTo(fallback, flow.return_to);
|
|
102
|
+
}
|
|
103
|
+
function initFlowUrl(sdkUrl, flowType, flow) {
|
|
104
|
+
const result = `${sdkUrl}/self-service/${flowType}/browser`;
|
|
105
|
+
const qs = new URLSearchParams();
|
|
106
|
+
if (flow.oauth2_login_challenge) {
|
|
107
|
+
qs.set("login_challenge", flow.oauth2_login_challenge);
|
|
108
|
+
}
|
|
109
|
+
if (flow.return_to) {
|
|
110
|
+
qs.set("return_to", flow.return_to);
|
|
111
|
+
} else if (typeof window !== "undefined") {
|
|
112
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
113
|
+
if (searchParams.has("return_to")) {
|
|
114
|
+
qs.set("return_to", searchParams.get("return_to") || "");
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (qs.toString().length === 0) {
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
return result + "?" + qs.toString();
|
|
121
|
+
}
|
|
122
|
+
function appendReturnTo(url, returnTo) {
|
|
123
|
+
if (!returnTo) {
|
|
124
|
+
return url;
|
|
125
|
+
}
|
|
126
|
+
const urlObj = new URL(url);
|
|
127
|
+
urlObj.searchParams.set("return_to", returnTo);
|
|
128
|
+
return urlObj.toString();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// src/theme/default/components/card/footer.tsx
|
|
132
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
133
|
+
function DefaultCardFooter() {
|
|
134
|
+
const { flowType } = (0, import_elements_react.useOryFlow)();
|
|
135
|
+
switch (flowType) {
|
|
136
|
+
case import_client_fetch.FlowType.Login:
|
|
137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LoginCardFooter, {});
|
|
138
|
+
case import_client_fetch.FlowType.Registration:
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RegistrationCardFooter, {});
|
|
140
|
+
case import_client_fetch.FlowType.Recovery:
|
|
141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RecoveryCardFooter, {});
|
|
142
|
+
case import_client_fetch.FlowType.Verification:
|
|
143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VerificationCardFooter, {});
|
|
144
|
+
default:
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function LoginCardFooter() {
|
|
149
|
+
const { config, formState, flow } = (0, import_elements_react.useOryFlow)();
|
|
150
|
+
const intl = (0, import_react_intl.useIntl)();
|
|
151
|
+
if (!config.project.registration_enabled || formState.current !== "provide_identifier") {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
|
|
155
|
+
intl.formatMessage({
|
|
156
|
+
id: "login.registration-label",
|
|
157
|
+
defaultMessage: "No account?"
|
|
158
|
+
}),
|
|
159
|
+
" ",
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
161
|
+
"a",
|
|
162
|
+
{
|
|
163
|
+
className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
|
|
164
|
+
href: initFlowUrl(config.sdk.url, "registration", flow),
|
|
165
|
+
"data-testid": "ory/screen/registration/action/login",
|
|
166
|
+
children: intl.formatMessage({
|
|
167
|
+
id: "login.registration-button",
|
|
168
|
+
defaultMessage: "Sign up"
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
] });
|
|
173
|
+
}
|
|
174
|
+
function findScreenSelectionButton(nodes) {
|
|
175
|
+
return nodes.find(
|
|
176
|
+
(node) => node.attributes.node_type === "input" && node.attributes.type === "submit" && node.attributes.name === "screen"
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
function RegistrationCardFooter() {
|
|
180
|
+
const intl = (0, import_react_intl.useIntl)();
|
|
181
|
+
const { config, flow, formState } = (0, import_elements_react.useOryFlow)();
|
|
182
|
+
const { setValue } = (0, import_react_hook_form.useFormContext)();
|
|
183
|
+
if (formState.current === "select_method") {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const screenSelectionNode = findScreenSelectionButton(flow.ui.nodes);
|
|
187
|
+
function handleScreenSelection() {
|
|
188
|
+
setValue("method", "profile");
|
|
189
|
+
if (screenSelectionNode) {
|
|
190
|
+
setValue("screen", "credential-selection");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-normal leading-normal antialiased", children: formState.current === "method_active" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: screenSelectionNode && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
194
|
+
"button",
|
|
195
|
+
{
|
|
196
|
+
className: "font-medium text-button-link-brand-brand hover:text-button-link-brand-brand-hover",
|
|
197
|
+
type: "submit",
|
|
198
|
+
onClick: handleScreenSelection,
|
|
199
|
+
children: intl.formatMessage({
|
|
200
|
+
id: "card.footer.select-another-method",
|
|
201
|
+
defaultMessage: "Select another method"
|
|
202
|
+
})
|
|
203
|
+
}
|
|
204
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
205
|
+
intl.formatMessage({
|
|
206
|
+
id: "registration.login-label",
|
|
207
|
+
defaultMessage: "Already have an account?"
|
|
208
|
+
}),
|
|
209
|
+
" ",
|
|
210
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
211
|
+
"a",
|
|
212
|
+
{
|
|
213
|
+
className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
|
|
214
|
+
href: initFlowUrl(config.sdk.url, "login", flow),
|
|
215
|
+
"data-testid": "ory/screen/registration/action/login",
|
|
216
|
+
children: intl.formatMessage({
|
|
217
|
+
id: "registration.login-button",
|
|
218
|
+
defaultMessage: "Sign in"
|
|
219
|
+
})
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
] }) });
|
|
223
|
+
}
|
|
224
|
+
function RecoveryCardFooter() {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
function VerificationCardFooter() {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// src/theme/default/components/card/header.tsx
|
|
232
|
+
var import_elements_react3 = require("@ory/elements-react");
|
|
233
|
+
|
|
234
|
+
// src/theme/default/utils/constructCardHeader.ts
|
|
235
|
+
var import_client_fetch2 = require("@ory/client-fetch");
|
|
236
|
+
var import_react_intl2 = require("react-intl");
|
|
237
|
+
function joinWithCommaOr(list, orText = "or") {
|
|
238
|
+
if (list.length === 0) {
|
|
239
|
+
return ".";
|
|
240
|
+
} else if (list.length === 1) {
|
|
241
|
+
return list[0];
|
|
242
|
+
} else {
|
|
243
|
+
const last = list.pop();
|
|
244
|
+
return `${list.join(", ")} ${orText} ${last}`;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function useCardHeaderText(container, opts) {
|
|
248
|
+
var _a, _b;
|
|
249
|
+
const nodes = container.nodes;
|
|
250
|
+
const intl = (0, import_react_intl2.useIntl)();
|
|
251
|
+
switch (opts.flowType) {
|
|
252
|
+
case import_client_fetch2.FlowType.Recovery:
|
|
253
|
+
if (nodes.find(
|
|
254
|
+
(node) => "name" in node.attributes && node.attributes.name === "code"
|
|
255
|
+
)) {
|
|
256
|
+
return {
|
|
257
|
+
title: intl.formatMessage({
|
|
258
|
+
id: "recovery.title"
|
|
259
|
+
}),
|
|
260
|
+
description: intl.formatMessage({
|
|
261
|
+
id: "identities.messages.1060003"
|
|
262
|
+
})
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
title: intl.formatMessage({
|
|
267
|
+
id: "recovery.title"
|
|
268
|
+
}),
|
|
269
|
+
description: intl.formatMessage({
|
|
270
|
+
id: "recovery.subtitle"
|
|
271
|
+
})
|
|
272
|
+
};
|
|
273
|
+
case import_client_fetch2.FlowType.Settings:
|
|
274
|
+
return {
|
|
275
|
+
title: intl.formatMessage({
|
|
276
|
+
id: "settings.title"
|
|
277
|
+
}),
|
|
278
|
+
description: intl.formatMessage({
|
|
279
|
+
id: "settings.subtitle"
|
|
280
|
+
})
|
|
281
|
+
};
|
|
282
|
+
case import_client_fetch2.FlowType.Verification:
|
|
283
|
+
if (nodes.find(
|
|
284
|
+
(node) => "name" in node.attributes && node.attributes.name === "code"
|
|
285
|
+
)) {
|
|
286
|
+
return {
|
|
287
|
+
title: intl.formatMessage({
|
|
288
|
+
id: "verification.title"
|
|
289
|
+
}),
|
|
290
|
+
description: intl.formatMessage({
|
|
291
|
+
id: "identities.messages.1080003"
|
|
292
|
+
})
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
title: intl.formatMessage({
|
|
297
|
+
id: "verification.title"
|
|
298
|
+
}),
|
|
299
|
+
description: intl.formatMessage({
|
|
300
|
+
id: "verification.subtitle"
|
|
301
|
+
})
|
|
302
|
+
};
|
|
303
|
+
case import_client_fetch2.FlowType.Login: {
|
|
304
|
+
const accountLinkingMessage = (_a = container.messages) == null ? void 0 : _a.find(
|
|
305
|
+
(m) => m.id === 1010016
|
|
306
|
+
);
|
|
307
|
+
if (accountLinkingMessage) {
|
|
308
|
+
return {
|
|
309
|
+
title: intl.formatMessage({
|
|
310
|
+
id: "account-linking.title"
|
|
311
|
+
}),
|
|
312
|
+
description: intl.formatMessage(
|
|
313
|
+
{
|
|
314
|
+
id: "identities.messages.1010016"
|
|
315
|
+
},
|
|
316
|
+
accountLinkingMessage.context
|
|
317
|
+
)
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const parts = [];
|
|
323
|
+
if (nodes.find((node) => node.group === "password")) {
|
|
324
|
+
switch (opts.flowType) {
|
|
325
|
+
case import_client_fetch2.FlowType.Registration:
|
|
326
|
+
parts.push(
|
|
327
|
+
intl.formatMessage(
|
|
328
|
+
{ id: "card.header.parts.password.registration" },
|
|
329
|
+
// TODO: make this generic for other labels
|
|
330
|
+
{ identifierLabel: "email" }
|
|
331
|
+
)
|
|
332
|
+
);
|
|
333
|
+
break;
|
|
334
|
+
default:
|
|
335
|
+
parts.push(
|
|
336
|
+
intl.formatMessage(
|
|
337
|
+
{ id: "card.header.parts.password.login" },
|
|
338
|
+
// TODO: make this generic for other labels
|
|
339
|
+
{ identifierLabel: "email" }
|
|
340
|
+
)
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (nodes.find((node) => node.group === "oidc")) {
|
|
345
|
+
parts.push(
|
|
346
|
+
intl.formatMessage({
|
|
347
|
+
id: "card.header.parts.oidc"
|
|
348
|
+
})
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
if (nodes.find((node) => node.group === "code")) {
|
|
352
|
+
parts.push(intl.formatMessage({ id: "card.header.parts.code" }));
|
|
353
|
+
}
|
|
354
|
+
if (nodes.find((node) => node.group === "passkey")) {
|
|
355
|
+
parts.push(intl.formatMessage({ id: "card.header.parts.passkey" }));
|
|
356
|
+
}
|
|
357
|
+
if (nodes.find((node) => node.group === "webauthn")) {
|
|
358
|
+
parts.push(intl.formatMessage({ id: "card.header.parts.webauthn" }));
|
|
359
|
+
}
|
|
360
|
+
if (nodes.find((node) => node.group === "identifier_first")) {
|
|
361
|
+
const identifier = nodes.find(
|
|
362
|
+
(node) => (0, import_client_fetch2.isUiNodeInputAttributes)(node.attributes) && node.attributes.name.startsWith("identifier") && node.attributes.type !== "hidden"
|
|
363
|
+
);
|
|
364
|
+
if (identifier) {
|
|
365
|
+
parts.push(
|
|
366
|
+
intl.formatMessage(
|
|
367
|
+
{
|
|
368
|
+
id: "card.header.parts.identifier-first"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
identifierLabel: (_b = identifier.meta.label) == null ? void 0 : _b.text
|
|
372
|
+
}
|
|
373
|
+
)
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
switch (opts.flowType) {
|
|
378
|
+
case import_client_fetch2.FlowType.Login:
|
|
379
|
+
if (opts.flow.refresh) {
|
|
380
|
+
return {
|
|
381
|
+
title: intl.formatMessage({
|
|
382
|
+
id: "login.title-refresh"
|
|
383
|
+
}),
|
|
384
|
+
description: intl.formatMessage(
|
|
385
|
+
{
|
|
386
|
+
id: "login.subtitle-refresh"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
parts: joinWithCommaOr(parts)
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
return {
|
|
395
|
+
title: intl.formatMessage({
|
|
396
|
+
id: "login.title"
|
|
397
|
+
}),
|
|
398
|
+
description: parts.length > 0 ? intl.formatMessage(
|
|
399
|
+
{
|
|
400
|
+
id: "login.subtitle"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
parts: joinWithCommaOr(
|
|
404
|
+
parts,
|
|
405
|
+
intl.formatMessage({ id: "misc.or" })
|
|
406
|
+
)
|
|
407
|
+
}
|
|
408
|
+
) : ""
|
|
409
|
+
};
|
|
410
|
+
case import_client_fetch2.FlowType.Registration:
|
|
411
|
+
return {
|
|
412
|
+
title: intl.formatMessage({
|
|
413
|
+
id: "registration.title"
|
|
414
|
+
}),
|
|
415
|
+
description: parts.length > 0 ? intl.formatMessage(
|
|
416
|
+
{
|
|
417
|
+
id: "registration.subtitle"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
parts: joinWithCommaOr(
|
|
421
|
+
parts,
|
|
422
|
+
intl.formatMessage({ id: "misc.or" })
|
|
423
|
+
)
|
|
424
|
+
}
|
|
425
|
+
) : ""
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
return {
|
|
429
|
+
title: "Error",
|
|
430
|
+
description: "An error occurred"
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// src/theme/default/components/card/current-identifier-button.tsx
|
|
435
|
+
var import_client_fetch3 = require("@ory/client-fetch");
|
|
436
|
+
var import_elements_react2 = require("@ory/elements-react");
|
|
437
|
+
|
|
438
|
+
// src/theme/default/assets/icons/arrow-left.svg
|
|
439
|
+
var React3 = __toESM(require("react"));
|
|
440
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
441
|
+
var SvgArrowLeft = (props) => {
|
|
442
|
+
var _a, _b;
|
|
443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 25", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12.325h14m-14 0 6 6m-6-6 6-6" }) });
|
|
444
|
+
};
|
|
445
|
+
var arrow_left_default = SvgArrowLeft;
|
|
446
|
+
|
|
447
|
+
// src/theme/default/utils/attributes.ts
|
|
448
|
+
function omit(obj, keys) {
|
|
449
|
+
const ret = { ...obj };
|
|
450
|
+
for (const key of keys) {
|
|
451
|
+
delete ret[key];
|
|
452
|
+
}
|
|
453
|
+
return ret;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// src/theme/default/components/card/current-identifier-button.tsx
|
|
457
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
458
|
+
function DefaultCurrentIdentifierButton() {
|
|
459
|
+
const { flow, flowType, config, formState } = (0, import_elements_react2.useOryFlow)();
|
|
460
|
+
const ui = flow.ui;
|
|
461
|
+
if (formState.current === "provide_identifier") {
|
|
462
|
+
return null;
|
|
463
|
+
}
|
|
464
|
+
const nodeBackButton = getBackButtonNode(flowType, ui.nodes);
|
|
465
|
+
if ((nodeBackButton == null ? void 0 : nodeBackButton.attributes.node_type) !== "input" || !nodeBackButton.attributes.value) {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
const initFlowUrl2 = restartFlowUrl(
|
|
469
|
+
flow,
|
|
470
|
+
`${config.sdk.url}/self-service/${flowType}/browser`
|
|
471
|
+
);
|
|
472
|
+
const attributes = omit(nodeBackButton.attributes, [
|
|
473
|
+
"autocomplete",
|
|
474
|
+
"node_type",
|
|
475
|
+
"maxlength"
|
|
476
|
+
]);
|
|
477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
478
|
+
"a",
|
|
479
|
+
{
|
|
480
|
+
className: "group inline-flex max-w-full cursor-pointer items-center gap-1 self-start rounded-identifier border px-[11px] py-[5px] transition-colors border-button-identifier-border-border-default bg-button-identifier-background-default hover:border-button-identifier-border-border-hover hover:bg-button-identifier-background-hover",
|
|
481
|
+
...attributes,
|
|
482
|
+
href: initFlowUrl2,
|
|
483
|
+
title: `Adjust ${nodeBackButton == null ? void 0 : nodeBackButton.attributes.value}`,
|
|
484
|
+
"data-testid": "ory/screen/login/action/restart",
|
|
485
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "inline-flex min-h-5 items-center gap-2 overflow-hidden text-ellipsis", children: [
|
|
486
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
487
|
+
arrow_left_default,
|
|
488
|
+
{
|
|
489
|
+
size: 16,
|
|
490
|
+
stroke: "1",
|
|
491
|
+
className: "shrink-0 text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover"
|
|
492
|
+
}
|
|
493
|
+
),
|
|
494
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "overflow-hidden text-ellipsis text-nowrap text-sm font-medium text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover", children: nodeBackButton == null ? void 0 : nodeBackButton.attributes.value })
|
|
495
|
+
] })
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
function getBackButtonNode(flowType, nodes) {
|
|
500
|
+
let nodeBackButton;
|
|
501
|
+
switch (flowType) {
|
|
502
|
+
case import_client_fetch3.FlowType.Login:
|
|
503
|
+
nodeBackButton = nodes.find(
|
|
504
|
+
(node) => "name" in node.attributes && node.attributes.name === "identifier" && ["default", "identifier_first"].includes(node.group)
|
|
505
|
+
);
|
|
506
|
+
break;
|
|
507
|
+
case import_client_fetch3.FlowType.Registration:
|
|
508
|
+
nodeBackButton = guessRegistrationBackButton(nodes);
|
|
509
|
+
break;
|
|
510
|
+
case import_client_fetch3.FlowType.Recovery:
|
|
511
|
+
case import_client_fetch3.FlowType.Verification:
|
|
512
|
+
nodeBackButton = nodes.find(
|
|
513
|
+
(n) => "name" in n.attributes && n.attributes.name === "email"
|
|
514
|
+
);
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
517
|
+
return nodeBackButton;
|
|
518
|
+
}
|
|
519
|
+
var backButtonCandiates = [
|
|
520
|
+
"traits.email",
|
|
521
|
+
"traits.username",
|
|
522
|
+
"traits.phone_number"
|
|
523
|
+
];
|
|
524
|
+
function guessRegistrationBackButton(uiNodes) {
|
|
525
|
+
return uiNodes.find(
|
|
526
|
+
(node) => "name" in node.attributes && backButtonCandiates.includes(node.attributes.name) && node.group === "default"
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
// src/theme/default/components/card/header.tsx
|
|
531
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
532
|
+
function InnerCardHeader({ title, text }) {
|
|
533
|
+
const { Card } = (0, import_elements_react3.useComponents)();
|
|
534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { className: "flex flex-col gap-8 antialiased", children: [
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Card.Logo, {}),
|
|
536
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
537
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { className: "text-lg font-semibold leading-normal text-interface-foreground-default-primary", children: title }),
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "leading-normal text-interface-foreground-default-secondary", children: text }),
|
|
539
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DefaultCurrentIdentifierButton, {})
|
|
540
|
+
] })
|
|
541
|
+
] });
|
|
542
|
+
}
|
|
543
|
+
function DefaultCardHeader() {
|
|
544
|
+
const context = (0, import_elements_react3.useOryFlow)();
|
|
545
|
+
const { title, description } = useCardHeaderText(context.flow.ui, context);
|
|
546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InnerCardHeader, { title, text: description });
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// src/theme/default/components/card/logo.tsx
|
|
550
|
+
var import_elements_react4 = require("@ory/elements-react");
|
|
551
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
552
|
+
function DefaultCardLogo() {
|
|
553
|
+
const flow = (0, import_elements_react4.useOryFlow)();
|
|
554
|
+
if (flow.config.logoUrl) {
|
|
555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: flow.config.logoUrl, width: 100, height: 36, alt: "Logo" });
|
|
556
|
+
}
|
|
557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: flow.config.name });
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// src/theme/default/components/card/layout.tsx
|
|
561
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
562
|
+
function DefaultCardLayout({ children }) {
|
|
563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("main", { className: "p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen", children });
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// src/theme/default/components/card/index.tsx
|
|
567
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
568
|
+
function DefaultCard({ children }) {
|
|
569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-1 sm:items-center justify-center font-sans items-start w-full sm:w-[480px] sm:max-w-[480px]", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative grid grid-cols-1 gap-8 sm:rounded-cards sm:border border-form-border-default bg-form-background-default px-8 py-12 sm:px-12 sm:py-14 border-b w-full", children: [
|
|
570
|
+
children,
|
|
571
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Badge, {})
|
|
572
|
+
] }) });
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// src/theme/default/utils/cn.ts
|
|
576
|
+
var import_clsx = require("clsx");
|
|
577
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
578
|
+
function cn(...inputs) {
|
|
579
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// src/theme/default/components/form/index.tsx
|
|
583
|
+
var import_react_intl4 = require("react-intl");
|
|
584
|
+
var import_elements_react6 = require("@ory/elements-react");
|
|
585
|
+
var import_client_fetch4 = require("@ory/client-fetch");
|
|
586
|
+
|
|
587
|
+
// src/theme/default/components/form/social.tsx
|
|
588
|
+
var import_elements_react5 = require("@ory/elements-react");
|
|
589
|
+
|
|
590
|
+
// src/theme/default/provider-logos/apple.svg
|
|
591
|
+
var React4 = __toESM(require("react"));
|
|
592
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
593
|
+
var SvgApple = (props) => {
|
|
594
|
+
var _a, _b;
|
|
595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { fill: "#283544", d: "M27.734 11.55c-.134.078-3.317 1.724-3.317 5.374.15 4.162 4.017 5.621 4.083 5.621-.066.078-.584 1.988-2.116 3.991C25.167 28.261 23.817 30 21.767 30c-1.95 0-2.65-1.15-4.9-1.15-2.416 0-3.1 1.15-4.95 1.15-2.05 0-3.5-1.832-4.782-3.541-1.667-2.236-3.083-5.746-3.133-9.116-.034-1.786.334-3.54 1.266-5.032 1.317-2.081 3.667-3.494 6.233-3.54 1.966-.063 3.716 1.257 4.916 1.257 1.15 0 3.3-1.258 5.733-1.258 1.05.001 3.85.296 5.584 2.78M16.25 8.414c-.35-1.631.616-3.262 1.516-4.302C18.917 2.854 20.734 2 22.3 2c.1 1.63-.534 3.23-1.666 4.395-1.017 1.258-2.767 2.205-4.383 2.019" }) });
|
|
596
|
+
};
|
|
597
|
+
var apple_default = SvgApple;
|
|
598
|
+
|
|
599
|
+
// src/theme/default/provider-logos/auth0.svg
|
|
600
|
+
var React5 = __toESM(require("react"));
|
|
601
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
602
|
+
var SvgAuth0 = (props) => {
|
|
603
|
+
var _a, _b;
|
|
604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { fill: "#eb5424", d: "M49.012 51.774 42.514 32l17.008-12.22h-21.02L32.005 0h21.032l6.506 19.78c3.767 11.468-.118 24.52-10.53 31.993zm-34.023 0L31.998 64l17.015-12.226-17.008-12.22zm-10.516-32c-3.976 12.1.64 24.917 10.5 32.007v-.007L21.482 32 4.474 19.774l21.025.007L31.998 0H10.972z" }) });
|
|
605
|
+
};
|
|
606
|
+
var auth0_default = SvgAuth0;
|
|
607
|
+
|
|
608
|
+
// src/theme/default/provider-logos/discord.svg
|
|
609
|
+
var React6 = __toESM(require("react"));
|
|
610
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
611
|
+
var SvgDiscord = (props) => {
|
|
612
|
+
var _a, _b;
|
|
613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M2 11.6c0-3.36 0-5.04.654-6.324a6 6 0 0 1 2.622-2.622C6.56 2 8.24 2 11.6 2h8.8c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C30 6.56 30 8.24 30 11.6v8.8c0 3.36 0 5.04-.654 6.324a6 6 0 0 1-2.622 2.622C25.44 30 23.76 30 20.4 30h-8.8c-3.36 0-5.04 0-6.324-.654a6 6 0 0 1-2.622-2.622C2 25.44 2 23.76 2 20.4z" }),
|
|
615
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fill: "#5865F2", d: "M23.636 9.34A18.8 18.8 0 0 0 19.097 8c-.195.332-.424.779-.581 1.134a17.7 17.7 0 0 0-5.03 0A12 12 0 0 0 12.897 8a18.7 18.7 0 0 0-4.542 1.343c-2.872 4.078-3.65 8.055-3.262 11.975a18.6 18.6 0 0 0 5.567 2.68c.448-.58.848-1.195 1.192-1.844a12 12 0 0 1-1.877-.859 9 9 0 0 0 .46-.342c3.62 1.59 7.553 1.59 11.13 0q.225.178.46.342c-.595.337-1.225.626-1.88.86q.516.974 1.191 1.845a18.6 18.6 0 0 0 5.57-2.682c.457-4.544-.78-8.484-3.27-11.978m-11.29 9.567c-1.087 0-1.978-.953-1.978-2.113s.872-2.116 1.977-2.116c1.106 0 1.997.953 1.978 2.116.002 1.16-.872 2.113-1.978 2.113m7.308 0c-1.086 0-1.977-.953-1.977-2.113s.872-2.116 1.977-2.116c1.106 0 1.997.953 1.978 2.116 0 1.16-.872 2.113-1.978 2.113" })
|
|
616
|
+
] });
|
|
617
|
+
};
|
|
618
|
+
var discord_default = SvgDiscord;
|
|
619
|
+
|
|
620
|
+
// src/theme/default/provider-logos/facebook.svg
|
|
621
|
+
var React7 = __toESM(require("react"));
|
|
622
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
623
|
+
var SvgFacebook = (props) => {
|
|
624
|
+
var _a, _b;
|
|
625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
626
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: 16, cy: 16, r: 14, fill: "url(#facebook_svg__a)" }),
|
|
627
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { fill: "#fff", d: "m21.214 20.282.622-3.952h-3.89v-2.563c0-1.081.542-2.136 2.284-2.136H22V8.267S20.395 8 18.86 8c-3.205 0-5.298 1.893-5.298 5.318v3.012H10v3.952h3.562v9.552q1.073.165 2.191.166 1.12 0 2.192-.166v-9.552z" }),
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("linearGradient", { id: "facebook_svg__a", x1: 16, x2: 16, y1: 2, y2: 29.917, gradientUnits: "userSpaceOnUse", children: [
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { stopColor: "#18ACFE" }),
|
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: 1, stopColor: "#0163E0" })
|
|
631
|
+
] }) })
|
|
632
|
+
] });
|
|
633
|
+
};
|
|
634
|
+
var facebook_default = SvgFacebook;
|
|
635
|
+
|
|
636
|
+
// src/theme/default/provider-logos/generic.svg
|
|
637
|
+
var React8 = __toESM(require("react"));
|
|
638
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
639
|
+
var SvgGeneric = (props) => {
|
|
640
|
+
var _a, _b;
|
|
641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, className: "generic_svg__icon generic_svg__icon-tabler generic_svg__icon-tabler-brand-oauth", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
642
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z" }),
|
|
643
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M2 12a10 10 0 1 0 20 0 10 10 0 1 0-20 0" }),
|
|
644
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M12.556 6c.65 0 1.235.373 1.508.947l2.839 7.848a1.646 1.646 0 0 1-1.01 2.108 1.673 1.673 0 0 1-2.068-.851L13.365 15h-2.73l-.398.905A1.67 1.67 0 0 1 8.26 16.95l-.153-.047a1.647 1.647 0 0 1-1.056-1.956l2.824-7.852a1.66 1.66 0 0 1 1.409-1.087z" })
|
|
645
|
+
] });
|
|
646
|
+
};
|
|
647
|
+
var generic_default = SvgGeneric;
|
|
648
|
+
|
|
649
|
+
// src/theme/default/provider-logos/github.svg
|
|
650
|
+
var React9 = __toESM(require("react"));
|
|
651
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
652
|
+
var SvgGithub = (props) => {
|
|
653
|
+
var _a, _b;
|
|
654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.5 11.5 0 0 1 12 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12" }) });
|
|
655
|
+
};
|
|
656
|
+
var github_default = SvgGithub;
|
|
657
|
+
|
|
658
|
+
// src/theme/default/provider-logos/gitlab.svg
|
|
659
|
+
var React10 = __toESM(require("react"));
|
|
660
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
661
|
+
var SvgGitlab = (props) => {
|
|
662
|
+
var _a, _b;
|
|
663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
664
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { fill: "#E24329", d: "m22.708 10.691-.031-.072-3.015-7.167a.74.74 0 0 0-.31-.34.87.87 0 0 0-.923.045.73.73 0 0 0-.268.37L16.125 9.2H7.881L5.845 3.527a.72.72 0 0 0-.268-.371.87.87 0 0 0-.923-.045.74.74 0 0 0-.31.34l-3.021 7.164-.03.072a4.67 4.67 0 0 0-.153 3.23c.335 1.063 1.04 1.998 2.01 2.664l.01.007.028.018 4.594 3.132 2.272 1.567 1.384.952c.162.112.36.172.563.172s.401-.06.563-.172l1.384-.952 2.273-1.567 4.62-3.151.012-.009c.968-.666 1.671-1.6 2.006-2.661a4.67 4.67 0 0 0-.15-3.226" }),
|
|
665
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { fill: "#FC6D26", d: "m22.708 10.691-.031-.072a10.7 10.7 0 0 0-4.055 1.66L12 16.839l4.218 2.904 4.621-3.152.012-.008c.969-.666 1.674-1.601 2.008-2.664a4.67 4.67 0 0 0-.15-3.228" }),
|
|
666
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { fill: "#FCA326", d: "m7.781 19.743 2.273 1.566 1.384.952c.162.112.36.172.563.172s.401-.06.563-.172l1.384-.952 2.273-1.566S14.255 18.389 12 16.839c-2.255 1.55-4.219 2.904-4.219 2.904" }),
|
|
667
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { fill: "#FC6D26", d: "M5.376 12.279a10.7 10.7 0 0 0-4.053-1.664l-.03.072a4.67 4.67 0 0 0-.153 3.23c.335 1.063 1.04 1.998 2.01 2.664l.01.007.028.018 4.594 3.132L12 16.836z" })
|
|
668
|
+
] });
|
|
669
|
+
};
|
|
670
|
+
var gitlab_default = SvgGitlab;
|
|
671
|
+
|
|
672
|
+
// src/theme/default/provider-logos/google.svg
|
|
673
|
+
var React11 = __toESM(require("react"));
|
|
674
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
675
|
+
var SvgGoogle = (props) => {
|
|
676
|
+
var _a, _b;
|
|
677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
678
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#4285F4", d: "M30.001 16.31c0-1.15-.095-1.99-.301-2.861H16.287v5.195h7.873c-.159 1.291-1.016 3.236-2.92 4.542l-.027.174 4.24 3.22.294.029c2.699-2.443 4.254-6.036 4.254-10.298" }),
|
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#34A853", d: "M16.286 30c3.857 0 7.095-1.244 9.46-3.391l-4.507-3.423c-1.207.825-2.826 1.4-4.953 1.4A8.58 8.58 0 0 1 8.16 18.77l-.167.014-4.41 3.344-.058.157C5.874 26.858 10.7 30 16.286 30" }),
|
|
680
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#FBBC05", d: "M8.16 18.769a8.5 8.5 0 0 1-.476-2.77c0-.964.174-1.897.46-2.768l-.008-.185-4.465-3.399-.146.068A13.8 13.8 0 0 0 2.001 16c0 2.256.556 4.387 1.524 6.284z" }),
|
|
681
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#EB4335", d: "M16.286 7.413c2.683 0 4.492 1.136 5.524 2.085l4.032-3.858C23.366 3.384 20.143 2 16.286 2 10.7 2 5.874 5.142 3.524 9.715l4.62 3.516c1.158-3.375 4.365-5.818 8.142-5.818" })
|
|
682
|
+
] });
|
|
683
|
+
};
|
|
684
|
+
var google_default = SvgGoogle;
|
|
685
|
+
|
|
686
|
+
// src/theme/default/provider-logos/linkedin.svg
|
|
687
|
+
var React12 = __toESM(require("react"));
|
|
688
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
689
|
+
var SvgLinkedin = (props) => {
|
|
690
|
+
var _a, _b;
|
|
691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
692
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { width: 28, height: 28, x: 2, y: 2, fill: "#1275B1", rx: 14 }),
|
|
693
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { fill: "#fff", d: "M12.619 9.692c0 .935-.81 1.692-1.81 1.692C9.81 11.384 9 10.627 9 9.692S9.81 8 10.81 8c.999 0 1.809.758 1.809 1.692M9.247 12.628h3.093V22H9.247zM17.32 12.628h-3.093V22h3.093v-4.795c0-1.107.378-2.22 1.886-2.22 1.705 0 1.695 1.45 1.687 2.572-.01 1.467.014 2.965.014 4.443H24v-4.946c-.026-3.159-.85-4.614-3.557-4.614-1.608 0-2.604.73-3.123 1.39z" })
|
|
694
|
+
] });
|
|
695
|
+
};
|
|
696
|
+
var linkedin_default = SvgLinkedin;
|
|
697
|
+
|
|
698
|
+
// src/theme/default/provider-logos/microsoft.svg
|
|
699
|
+
var React13 = __toESM(require("react"));
|
|
700
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
701
|
+
var SvgMicrosoft = (props) => {
|
|
702
|
+
var _a, _b;
|
|
703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 23 23", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
704
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { fill: "#F35325", d: "M1 1h10v10H1z" }),
|
|
705
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { fill: "#81BC06", d: "M12 1h10v10H12z" }),
|
|
706
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { fill: "#05A6F0", d: "M1 12h10v10H1z" }),
|
|
707
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { fill: "#FFBA08", d: "M12 12h10v10H12z" })
|
|
708
|
+
] });
|
|
709
|
+
};
|
|
710
|
+
var microsoft_default = SvgMicrosoft;
|
|
711
|
+
|
|
712
|
+
// src/theme/default/provider-logos/slack.svg
|
|
713
|
+
var React14 = __toESM(require("react"));
|
|
714
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
715
|
+
var SvgSlack = (props) => {
|
|
716
|
+
var _a, _b;
|
|
717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { fill: "#2EB67D", d: "M26.5 15a2.5 2.5 0 1 0-2.5-2.5V15zm-7 0a2.5 2.5 0 0 0 2.5-2.5v-7a2.5 2.5 0 0 0-5 0v7a2.5 2.5 0 0 0 2.5 2.5" }),
|
|
719
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { fill: "#E01E5A", d: "M5.5 17A2.5 2.5 0 1 0 8 19.5V17zm7 0a2.5 2.5 0 0 0-2.5 2.5v7a2.5 2.5 0 0 0 5 0v-7a2.5 2.5 0 0 0-2.5-2.5" }),
|
|
720
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { fill: "#ECB22E", d: "M17 26.5a2.5 2.5 0 1 0 2.5-2.5H17zm0-7a2.5 2.5 0 0 0 2.5 2.5h7a2.5 2.5 0 0 0 0-5h-7a2.5 2.5 0 0 0-2.5 2.5" }),
|
|
721
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { fill: "#36C5F0", d: "M15 5.5A2.5 2.5 0 1 0 12.5 8H15zm0 7a2.5 2.5 0 0 0-2.5-2.5h-7a2.5 2.5 0 0 0 0 5h7a2.5 2.5 0 0 0 2.5-2.5" })
|
|
722
|
+
] });
|
|
723
|
+
};
|
|
724
|
+
var slack_default = SvgSlack;
|
|
725
|
+
|
|
726
|
+
// src/theme/default/provider-logos/spotify.svg
|
|
727
|
+
var React15 = __toESM(require("react"));
|
|
728
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
729
|
+
var SvgSpotify = (props) => {
|
|
730
|
+
var _a, _b;
|
|
731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
732
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: 16, cy: 16, r: 14, fill: "#1ED760" }),
|
|
733
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { fill: "#fff", d: "M22.364 21.623c-.239.38-.75.486-1.148.258-3.141-1.822-7.08-2.232-11.736-1.23-.446.091-.893-.167-.988-.592a.786.786 0 0 1 .621-.94c5.087-1.11 9.456-.639 12.964 1.41a.77.77 0 0 1 .287 1.094m1.627-3.461c-.303.47-.941.607-1.435.334-3.588-2.11-9.058-2.718-13.299-1.488-.558.152-1.132-.137-1.292-.653-.16-.531.144-1.078.702-1.23 4.848-1.396 10.875-.728 15.005 1.686.462.273.622.88.319 1.35m.143-3.613c-4.305-2.43-11.4-2.657-15.515-1.473-.654.197-1.355-.152-1.563-.79-.207-.622.176-1.29.83-1.487 4.72-1.366 12.565-1.093 17.508 1.7.59.334.781 1.063.43 1.625-.334.576-1.1.774-1.69.425" })
|
|
734
|
+
] });
|
|
735
|
+
};
|
|
736
|
+
var spotify_default = SvgSpotify;
|
|
737
|
+
|
|
738
|
+
// src/theme/default/provider-logos/yandex.svg
|
|
739
|
+
var React16 = __toESM(require("react"));
|
|
740
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
741
|
+
var SvgYandex = (props) => {
|
|
742
|
+
var _a, _b;
|
|
743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
|
|
744
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: 16, cy: 16, r: 14, fill: "#fff" }),
|
|
745
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { fill: "#FC3F1D", d: "M21 25h-3.143V9.435h-1.402c-2.572 0-3.922 1.294-3.922 3.211 0 2.175.935 3.185 2.857 4.48l1.584 1.063L12.403 25H9l4.104-6.086c-2.363-1.684-3.688-3.316-3.688-6.087C9.416 9.357 11.83 7 16.429 7H21z" })
|
|
746
|
+
] });
|
|
747
|
+
};
|
|
748
|
+
var yandex_default = SvgYandex;
|
|
749
|
+
|
|
750
|
+
// src/theme/default/provider-logos/x.svg
|
|
751
|
+
var React17 = __toESM(require("react"));
|
|
752
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
753
|
+
var SvgX = (props) => {
|
|
754
|
+
var _a, _b;
|
|
755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { fill: "#0F172A", d: "M24.122 3h4.292L18.99 13.73 30 28.285h-8.64l-6.764-8.845-7.744 8.845H2.56l9.983-11.476L2 3h8.854l6.112 8.08zM22.62 25.766h2.379L9.604 5.426H7.048z" }) });
|
|
756
|
+
};
|
|
757
|
+
var x_default = SvgX;
|
|
758
|
+
|
|
759
|
+
// src/theme/default/provider-logos/index.ts
|
|
760
|
+
var logos = {
|
|
761
|
+
apple: apple_default,
|
|
762
|
+
auth0: auth0_default,
|
|
763
|
+
discord: discord_default,
|
|
764
|
+
facebook: facebook_default,
|
|
765
|
+
generic: generic_default,
|
|
766
|
+
github: github_default,
|
|
767
|
+
gitlab: gitlab_default,
|
|
768
|
+
google: google_default,
|
|
769
|
+
linkedin: linkedin_default,
|
|
770
|
+
microsoft: microsoft_default,
|
|
771
|
+
slack: slack_default,
|
|
772
|
+
spotify: spotify_default,
|
|
773
|
+
yandex: yandex_default,
|
|
774
|
+
x: x_default
|
|
775
|
+
};
|
|
776
|
+
var provider_logos_default = logos;
|
|
777
|
+
|
|
778
|
+
// src/theme/default/components/form/social.tsx
|
|
779
|
+
var import_react_intl3 = require("react-intl");
|
|
780
|
+
var import_react = require("react");
|
|
781
|
+
var import_react_hook_form2 = require("react-hook-form");
|
|
782
|
+
|
|
783
|
+
// src/theme/default/components/form/spinner.tsx
|
|
784
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
785
|
+
function Spinner({ className }) {
|
|
786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
787
|
+
"svg",
|
|
788
|
+
{
|
|
789
|
+
"aria-hidden": "true",
|
|
790
|
+
role: "status",
|
|
791
|
+
className: cn(
|
|
792
|
+
"absolute pointer-events-none inset-0 m-auto size-8 animate-spin",
|
|
793
|
+
className
|
|
794
|
+
),
|
|
795
|
+
viewBox: "0 0 34 34",
|
|
796
|
+
fill: "none",
|
|
797
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
798
|
+
children: [
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("g", { clipPath: "url(#clip0_2572_1748)", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
800
|
+
"path",
|
|
801
|
+
{
|
|
802
|
+
d: "M23.364 10.6362C22.1053 9.37751 20.5016 8.52034 18.7558 8.17307C17.01 7.82581 15.2004 8.00404 13.5559 8.68523C11.9113 9.36641 10.5057 10.52 9.51678 12C8.52784 13.4801 8 15.2201 8 17.0001C8 18.7802 8.52784 20.5202 9.51678 22.0003C10.5057 23.4803 11.9113 24.6339 13.5559 25.3151C15.2004 25.9962 17.01 26.1745 18.7558 25.8272C20.5016 25.4799 22.1053 24.6228 23.364 23.3641",
|
|
803
|
+
stroke: "currentColor",
|
|
804
|
+
strokeLinecap: "round",
|
|
805
|
+
strokeLinejoin: "round"
|
|
806
|
+
}
|
|
807
|
+
) }),
|
|
808
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("clipPath", { id: "clip0_2572_1748", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
809
|
+
"rect",
|
|
810
|
+
{
|
|
811
|
+
width: "24",
|
|
812
|
+
height: "24",
|
|
813
|
+
fill: "currentColor",
|
|
814
|
+
transform: "translate(17 0.029541) rotate(45)"
|
|
815
|
+
}
|
|
816
|
+
) }) })
|
|
817
|
+
]
|
|
818
|
+
}
|
|
819
|
+
);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// src/theme/default/components/form/social.tsx
|
|
823
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
824
|
+
function extractProvider(context) {
|
|
825
|
+
if (context && typeof context === "object" && "provider" in context && typeof context.provider === "string") {
|
|
826
|
+
return context.provider;
|
|
827
|
+
}
|
|
828
|
+
return void 0;
|
|
829
|
+
}
|
|
830
|
+
function DefaultButtonSocial({
|
|
831
|
+
attributes,
|
|
832
|
+
node,
|
|
833
|
+
onClick,
|
|
834
|
+
showLabel: _showLabel,
|
|
835
|
+
logos: providedLogos
|
|
836
|
+
}) {
|
|
837
|
+
var _a, _b, _c;
|
|
838
|
+
const logos2 = { ...provider_logos_default, ...providedLogos };
|
|
839
|
+
const {
|
|
840
|
+
node_type: _ignoredNodeType,
|
|
841
|
+
type: _ignoredType,
|
|
842
|
+
name: _ignoredName,
|
|
843
|
+
...props
|
|
844
|
+
} = attributes;
|
|
845
|
+
const {
|
|
846
|
+
flow: { ui }
|
|
847
|
+
} = (0, import_elements_react5.useOryFlow)();
|
|
848
|
+
const [clicked, setClicked] = (0, import_react.useState)(false);
|
|
849
|
+
const intl = (0, import_react_intl3.useIntl)();
|
|
850
|
+
const {
|
|
851
|
+
formState: { isSubmitting }
|
|
852
|
+
} = (0, import_react_hook_form2.useFormContext)();
|
|
853
|
+
const oidcNodeCount = (_a = ui.nodes.filter((node2) => node2.group === "oidc").length) != null ? _a : 0;
|
|
854
|
+
const Logo = logos2[attributes.value.split("-")[0]];
|
|
855
|
+
const showLabel = _showLabel != null ? _showLabel : oidcNodeCount % 3 !== 0 && oidcNodeCount % 4 !== 0;
|
|
856
|
+
const provider = (_c = extractProvider((_b = node.meta.label) == null ? void 0 : _b.context)) != null ? _c : "";
|
|
857
|
+
const localOnClick = () => {
|
|
858
|
+
setClicked(true);
|
|
859
|
+
onClick == null ? void 0 : onClick();
|
|
860
|
+
};
|
|
861
|
+
(0, import_react.useEffect)(() => {
|
|
862
|
+
if (!isSubmitting) {
|
|
863
|
+
setClicked(false);
|
|
864
|
+
}
|
|
865
|
+
}, [isSubmitting]);
|
|
866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
867
|
+
"button",
|
|
868
|
+
{
|
|
869
|
+
className: "gap-3 border border-button-social-border-default bg-button-social-background-default hover:bg-button-social-background-hover transition-colors rounded-buttons flex items-center justify-center px-4 py-[13px] loading:bg-button-social-background-disabled loading:border-button-social-border-disabled loading:text-button-social-foreground-disabled hover:text-button-social-foreground-hover",
|
|
870
|
+
value: attributes.value,
|
|
871
|
+
type: "submit",
|
|
872
|
+
name: "provider",
|
|
873
|
+
"data-testid": `ory/form/node/input/${attributes.name}`,
|
|
874
|
+
...props,
|
|
875
|
+
onClick: localOnClick,
|
|
876
|
+
"data-loading": clicked,
|
|
877
|
+
disabled: isSubmitting,
|
|
878
|
+
children: [
|
|
879
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "size-5 relative", children: !clicked ? Logo ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Logo, { size: 20 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "flex aspect-square items-center justify-center rounded-[999px] border text-xs", children: provider.slice(0, 2) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Spinner, { className: "size-5" }) }),
|
|
880
|
+
showLabel && node.meta.label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "grow text-left font-medium leading-none text-button-social-foreground-default", children: (0, import_elements_react5.uiTextToFormattedMessage)(node.meta.label, intl) }) : null
|
|
881
|
+
]
|
|
882
|
+
}
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
DefaultButtonSocial.WithLogos = (logos2) => (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DefaultButtonSocial, { ...props, logos: logos2 });
|
|
886
|
+
function DefaultSocialButtonContainer({
|
|
887
|
+
children,
|
|
888
|
+
nodes
|
|
889
|
+
}) {
|
|
890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
891
|
+
"div",
|
|
892
|
+
{
|
|
893
|
+
className: cn("grid gap-3", {
|
|
894
|
+
// needed because tailwind is not compiling dynamic classes
|
|
895
|
+
"grid-cols-1": nodes.length % 4 <= 2,
|
|
896
|
+
"grid-cols-3": nodes.length % 3 === 0,
|
|
897
|
+
"grid-cols-4": nodes.length > 1 && nodes.length % 4 === 0
|
|
898
|
+
}),
|
|
899
|
+
children
|
|
900
|
+
}
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// src/theme/default/components/form/index.tsx
|
|
905
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
906
|
+
function DefaultFormContainer({
|
|
907
|
+
children,
|
|
908
|
+
onSubmit,
|
|
909
|
+
action,
|
|
910
|
+
method
|
|
911
|
+
}) {
|
|
912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
913
|
+
"form",
|
|
914
|
+
{
|
|
915
|
+
onSubmit,
|
|
916
|
+
noValidate: true,
|
|
917
|
+
action,
|
|
918
|
+
method,
|
|
919
|
+
className: "grid gap-8",
|
|
920
|
+
children
|
|
921
|
+
}
|
|
922
|
+
);
|
|
923
|
+
}
|
|
924
|
+
function DefaultMessageContainer({ children }) {
|
|
925
|
+
const { flowType } = (0, import_elements_react6.useOryFlow)();
|
|
926
|
+
if (!children || Array.isArray(children) && children.length === 0) {
|
|
927
|
+
return null;
|
|
928
|
+
}
|
|
929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
930
|
+
"section",
|
|
931
|
+
{
|
|
932
|
+
className: cn(
|
|
933
|
+
flowType === import_client_fetch4.FlowType.Settings ? "text-center" : "text-left"
|
|
934
|
+
),
|
|
935
|
+
children
|
|
936
|
+
}
|
|
937
|
+
);
|
|
938
|
+
}
|
|
939
|
+
function DefaultMessage({ message }) {
|
|
940
|
+
const intl = (0, import_react_intl4.useIntl)();
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
942
|
+
"span",
|
|
943
|
+
{
|
|
944
|
+
className: cn(
|
|
945
|
+
"leading-normal",
|
|
946
|
+
message.type === "error" && "text-interface-foreground-validation-danger",
|
|
947
|
+
message.type === "info" && "text-interface-foreground-default-secondary",
|
|
948
|
+
message.type === "success" && "text-interface-foreground-validation-success"
|
|
949
|
+
),
|
|
950
|
+
...(0, import_elements_react6.messageTestId)(message),
|
|
951
|
+
children: (0, import_elements_react6.uiTextToFormattedMessage)(message, intl)
|
|
952
|
+
}
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// src/theme/default/components/card/auth-method-list-item.tsx
|
|
957
|
+
var import_react_intl5 = require("react-intl");
|
|
958
|
+
|
|
959
|
+
// src/theme/default/assets/icons/code.svg
|
|
960
|
+
var React18 = __toESM(require("react"));
|
|
961
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
962
|
+
var SvgCode = (props) => {
|
|
963
|
+
var _a, _b;
|
|
964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 15 13", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M6.333 10.666h-4A1.333 1.333 0 0 1 1 9.333V2.666m0 0a1.333 1.333 0 0 1 1.333-1.333h9.334A1.333 1.333 0 0 1 13 2.666m-12 0 6 4 6-4m0 0v4M12.333 12l1.334-1.334-1.334-1.333m-2 0L9 10.666 10.333 12" }) });
|
|
965
|
+
};
|
|
966
|
+
var code_default = SvgCode;
|
|
967
|
+
|
|
968
|
+
// src/theme/default/assets/icons/passkey.svg
|
|
969
|
+
var React19 = __toESM(require("react"));
|
|
970
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
971
|
+
var SvgPasskey = (props) => {
|
|
972
|
+
var _a, _b;
|
|
973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 13 14", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M10.602 3.667c.603 1 .86 2.171.733 3.333v.667a4 4 0 0 0 .533 2M3.335 6.333a2.667 2.667 0 0 1 5.333 0V7c0 1.442.468 2.846 1.334 4m-4-4.667v1.334A9.33 9.33 0 0 0 7.668 13M3.335 9a12 12 0 0 0 1.2 4m-3.267-1.333A14.7 14.7 0 0 1 .668 7v-.667a5.333 5.333 0 0 1 8-4.633" }) });
|
|
974
|
+
};
|
|
975
|
+
var passkey_default = SvgPasskey;
|
|
976
|
+
|
|
977
|
+
// src/theme/default/assets/icons/password.svg
|
|
978
|
+
var React20 = __toESM(require("react"));
|
|
979
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
980
|
+
var SvgPassword = (props) => {
|
|
981
|
+
var _a, _b;
|
|
982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 14 4", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M7 .667v2.667m-1.333-.667 2.666-1.333m-2.666 0 2.666 1.333m-6-2v2.667M1 2.667l2.667-1.333M1 1.334l2.667 1.333m8-2v2.667m-1.334-.667L13 1.334m-2.667 0L13 2.667" }) });
|
|
983
|
+
};
|
|
984
|
+
var password_default = SvgPassword;
|
|
985
|
+
|
|
986
|
+
// src/theme/default/assets/icons/webauthn.svg
|
|
987
|
+
var React21 = __toESM(require("react"));
|
|
988
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
989
|
+
var SvgWebauthn = (props) => {
|
|
990
|
+
var _a, _b;
|
|
991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 14 14", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5h.007m1.03-3.438 2.401 2.401a1.92 1.92 0 0 1 0 2.713l-1.762 1.762a1.92 1.92 0 0 1-2.713 0l-.2-.2-4.372 4.371a1.33 1.33 0 0 1-.826.386L2.448 13h-.781a.667.667 0 0 1-.662-.589L1 12.333v-.781c0-.313.11-.616.311-.856l.08-.087.276-.276H3V9h1.333V7.667l1.43-1.43-.201-.2a1.92 1.92 0 0 1 0-2.713l1.762-1.762a1.92 1.92 0 0 1 2.713 0" }) });
|
|
992
|
+
};
|
|
993
|
+
var webauthn_default = SvgWebauthn;
|
|
994
|
+
|
|
995
|
+
// src/theme/default/utils/form.ts
|
|
996
|
+
function isGroupImmediateSubmit(group) {
|
|
997
|
+
return group === "code";
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
// src/theme/default/components/card/auth-method-list-item.tsx
|
|
1001
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1002
|
+
var iconsMap = {
|
|
1003
|
+
code: code_default,
|
|
1004
|
+
passkey: passkey_default,
|
|
1005
|
+
password: password_default,
|
|
1006
|
+
webauthn: webauthn_default,
|
|
1007
|
+
...provider_logos_default
|
|
1008
|
+
};
|
|
1009
|
+
function DefaultAuthMethodListItem({
|
|
1010
|
+
onClick,
|
|
1011
|
+
group
|
|
1012
|
+
}) {
|
|
1013
|
+
const intl = (0, import_react_intl5.useIntl)();
|
|
1014
|
+
const Icon = iconsMap[group] || null;
|
|
1015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1016
|
+
"button",
|
|
1017
|
+
{
|
|
1018
|
+
className: "flex cursor-pointer gap-3 text-left items-start w-full rounded-buttons p-2 hover:bg-interface-background-default-primary-hover",
|
|
1019
|
+
onClick,
|
|
1020
|
+
type: isGroupImmediateSubmit(group) ? "submit" : "button",
|
|
1021
|
+
"data-testid": `ory/form/auth-picker/${group}`,
|
|
1022
|
+
children: [
|
|
1023
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "mt-1", children: Icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { size: 16, className: "text-interface-foreground-brand-primary" }) }),
|
|
1024
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "flex-1 leading-normal inline-flex flex-col", children: [
|
|
1025
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-interface-foreground-default-primary", children: intl.formatMessage({ id: `two-step.${group}.title` }) }),
|
|
1026
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-interface-foreground-default-secondary", children: intl.formatMessage({
|
|
1027
|
+
id: `two-step.${group}.description`
|
|
1028
|
+
}) })
|
|
1029
|
+
] })
|
|
1030
|
+
]
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// src/theme/default/components/form/button.tsx
|
|
1036
|
+
var import_client_fetch5 = require("@ory/client-fetch");
|
|
1037
|
+
var import_elements_react7 = require("@ory/elements-react");
|
|
1038
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
1039
|
+
var import_react_hook_form3 = require("react-hook-form");
|
|
1040
|
+
var import_react_intl6 = require("react-intl");
|
|
1041
|
+
var import_react2 = require("react");
|
|
1042
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1043
|
+
var buttonStyles = (0, import_class_variance_authority.cva)(
|
|
1044
|
+
[
|
|
1045
|
+
"relative flex justify-center gap-3 overflow-hidden rounded-buttons leading-none ring-1 ring-inset font-medium",
|
|
1046
|
+
"disabled:cursor-not-allowed loading:cursor-wait loading:before:pointer-events-none",
|
|
1047
|
+
"transition-colors duration-100 ease-linear",
|
|
1048
|
+
"p-4 max-w-[488px]"
|
|
1049
|
+
],
|
|
1050
|
+
{
|
|
1051
|
+
variants: {
|
|
1052
|
+
intent: {
|
|
1053
|
+
primary: [
|
|
1054
|
+
"bg-button-primary-background-default text-button-primary-foreground-default ring-button-primary-border-default",
|
|
1055
|
+
"hover:bg-button-primary-background-hover hover:text-button-primary-foreground-hover hover:ring-button-primary-border-hover",
|
|
1056
|
+
"disabled:bg-button-primary-background-disabled disabled:text-button-primary-foreground-disabled disabled:ring-button-primary-border-disabled",
|
|
1057
|
+
"loading:bg-button-primary-background-default loading:text-button-primary-foreground-default loading:ring-button-primary-border-default",
|
|
1058
|
+
"loading:before:absolute loading:before:inset-0 loading:before:bg-button-primary-background-default loading:before:opacity-80 loading:before:content-['']",
|
|
1059
|
+
"disabled:bg-button-primary-background-disabled disabled:text-button-primary-foreground-disabled disabled:ring-button-primary-border-disabled"
|
|
1060
|
+
],
|
|
1061
|
+
secondary: [
|
|
1062
|
+
"bg-button-secondary-background-default text-button-secondary-foreground-default ring-button-secondary-border-default",
|
|
1063
|
+
"hover:bg-button-secondary-background-hover hover:text-button-secondary-foreground-hover hover:ring-button-secondary-border-hover",
|
|
1064
|
+
"disabled:bg-button-secondary-background-disabled disabled:text-button-secondary-foreground-disabled disabled:ring-button-secondary-border-disabled",
|
|
1065
|
+
"loading:bg-button-secondary-background-default loading:text-button-secondary-foreground-default loading:ring-button-secondary-border-default",
|
|
1066
|
+
"loading:before:absolute loading:before:inset-0 loading:before:bg-button-secondary-background-default loading:before:opacity-80 loading:before:content-['']"
|
|
1067
|
+
]
|
|
1068
|
+
},
|
|
1069
|
+
defaultVariants: {
|
|
1070
|
+
intent: "primary"
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
);
|
|
1075
|
+
var DefaultButton = ({
|
|
1076
|
+
attributes,
|
|
1077
|
+
node,
|
|
1078
|
+
onClick
|
|
1079
|
+
}) => {
|
|
1080
|
+
var _a;
|
|
1081
|
+
const {
|
|
1082
|
+
type,
|
|
1083
|
+
name,
|
|
1084
|
+
value,
|
|
1085
|
+
// Button does not support these attributes, so we skip them
|
|
1086
|
+
autocomplete: _ignoredAutocomplete,
|
|
1087
|
+
label: _ignoredLabel,
|
|
1088
|
+
node_type: _ignoredNodeType,
|
|
1089
|
+
// End of skipped attributes
|
|
1090
|
+
...rest
|
|
1091
|
+
} = attributes;
|
|
1092
|
+
const [clicked, setClicked] = (0, import_react2.useState)(false);
|
|
1093
|
+
const intl = (0, import_react_intl6.useIntl)();
|
|
1094
|
+
const label = (0, import_client_fetch5.getNodeLabel)(node);
|
|
1095
|
+
const {
|
|
1096
|
+
formState: { isSubmitting },
|
|
1097
|
+
setValue
|
|
1098
|
+
} = (0, import_react_hook_form3.useFormContext)();
|
|
1099
|
+
(0, import_react2.useEffect)(() => {
|
|
1100
|
+
if (!isSubmitting) {
|
|
1101
|
+
setClicked(false);
|
|
1102
|
+
}
|
|
1103
|
+
}, [isSubmitting]);
|
|
1104
|
+
const isPrimary = attributes.name === "method" || attributes.name.includes("passkey") || attributes.name.includes("webauthn") || attributes.name.includes("lookup_secret");
|
|
1105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1106
|
+
"button",
|
|
1107
|
+
{
|
|
1108
|
+
...rest,
|
|
1109
|
+
value,
|
|
1110
|
+
name,
|
|
1111
|
+
type: type === "button" ? "button" : "submit",
|
|
1112
|
+
onClick: (e) => {
|
|
1113
|
+
onClick == null ? void 0 : onClick(e);
|
|
1114
|
+
setClicked(true);
|
|
1115
|
+
if (type !== "button") {
|
|
1116
|
+
setValue(name, value);
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
className: buttonStyles({
|
|
1120
|
+
intent: isPrimary ? "primary" : "secondary"
|
|
1121
|
+
}),
|
|
1122
|
+
disabled: (_a = rest.disabled) != null ? _a : isSubmitting,
|
|
1123
|
+
"data-loading": clicked,
|
|
1124
|
+
children: [
|
|
1125
|
+
clicked ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Spinner, {}) : null,
|
|
1126
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: (0, import_elements_react7.uiTextToFormattedMessage)(label, intl) }) : ""
|
|
1127
|
+
]
|
|
1128
|
+
}
|
|
1129
|
+
);
|
|
1130
|
+
};
|
|
1131
|
+
DefaultButton.displayName = "DefaultButton";
|
|
1132
|
+
|
|
1133
|
+
// src/theme/default/components/form/checkbox.tsx
|
|
1134
|
+
var import_client_fetch6 = require("@ory/client-fetch");
|
|
1135
|
+
var import_elements_react8 = require("@ory/elements-react");
|
|
1136
|
+
var import_react_hook_form4 = require("react-hook-form");
|
|
1137
|
+
var import_react_intl8 = require("react-intl");
|
|
1138
|
+
|
|
1139
|
+
// src/theme/default/components/ui/checkbox-label.tsx
|
|
1140
|
+
var import_react_intl7 = require("react-intl");
|
|
1141
|
+
|
|
1142
|
+
// src/util/i18n/index.ts
|
|
1143
|
+
var uiTextToFormattedMessage4 = ({ id, context = {}, text }, intl) => {
|
|
1144
|
+
const contextInjectedMessage = Object.entries(context).reduce(
|
|
1145
|
+
(accumulator, [key, value]) => {
|
|
1146
|
+
if (Array.isArray(value)) {
|
|
1147
|
+
return {
|
|
1148
|
+
...accumulator,
|
|
1149
|
+
[key]: value,
|
|
1150
|
+
[key + "_list"]: intl.formatList(value)
|
|
1151
|
+
};
|
|
1152
|
+
} else if (key.endsWith("_unix")) {
|
|
1153
|
+
if (typeof value === "number") {
|
|
1154
|
+
return {
|
|
1155
|
+
...accumulator,
|
|
1156
|
+
[key]: intl.formatDate(new Date(value * 1e3)),
|
|
1157
|
+
[key + "_since"]: intl.formatDateTimeRange(
|
|
1158
|
+
new Date(value),
|
|
1159
|
+
/* @__PURE__ */ new Date()
|
|
1160
|
+
),
|
|
1161
|
+
[key + "_since_minutes"]: Math.ceil(
|
|
1162
|
+
(value - (/* @__PURE__ */ new Date()).getTime() / 1e3) / 60
|
|
1163
|
+
).toFixed(0),
|
|
1164
|
+
[key + "_until"]: intl.formatDateTimeRange(
|
|
1165
|
+
/* @__PURE__ */ new Date(),
|
|
1166
|
+
new Date(value)
|
|
1167
|
+
),
|
|
1168
|
+
[key + "_until_minutes"]: Math.ceil(
|
|
1169
|
+
((/* @__PURE__ */ new Date()).getTime() / 1e3 - value) / 60
|
|
1170
|
+
).toFixed(0)
|
|
1171
|
+
};
|
|
1172
|
+
}
|
|
1173
|
+
} else if (key === "property") {
|
|
1174
|
+
return {
|
|
1175
|
+
...accumulator,
|
|
1176
|
+
[key]: intl.formatMessage({
|
|
1177
|
+
id: `property.${value}`,
|
|
1178
|
+
defaultMessage: value
|
|
1179
|
+
})
|
|
1180
|
+
};
|
|
1181
|
+
}
|
|
1182
|
+
return {
|
|
1183
|
+
...accumulator,
|
|
1184
|
+
[key]: value
|
|
1185
|
+
};
|
|
1186
|
+
},
|
|
1187
|
+
{}
|
|
1188
|
+
);
|
|
1189
|
+
return intl.formatMessage(
|
|
1190
|
+
{
|
|
1191
|
+
id: `identities.messages.${id}`,
|
|
1192
|
+
defaultMessage: text
|
|
1193
|
+
},
|
|
1194
|
+
contextInjectedMessage
|
|
1195
|
+
);
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
// src/theme/default/components/ui/checkbox-label.tsx
|
|
1199
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1200
|
+
var linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
|
|
1201
|
+
function computeLabelElements(labelText) {
|
|
1202
|
+
const elements = [];
|
|
1203
|
+
let lastIndex = 0;
|
|
1204
|
+
for (const match of labelText.matchAll(linkRegex)) {
|
|
1205
|
+
const linkText = match[1];
|
|
1206
|
+
const url = match[2];
|
|
1207
|
+
const matchStart = match.index;
|
|
1208
|
+
if (typeof matchStart === "undefined") {
|
|
1209
|
+
continue;
|
|
1210
|
+
}
|
|
1211
|
+
if (matchStart > lastIndex) {
|
|
1212
|
+
elements.push(labelText.slice(lastIndex, matchStart));
|
|
1213
|
+
}
|
|
1214
|
+
elements.push(
|
|
1215
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1216
|
+
"a",
|
|
1217
|
+
{
|
|
1218
|
+
href: url,
|
|
1219
|
+
target: "_blank",
|
|
1220
|
+
rel: "noopener noreferrer",
|
|
1221
|
+
className: "text-button-link-brand-brand hover:text-button-link-brand-brand-hover underline",
|
|
1222
|
+
children: linkText
|
|
1223
|
+
},
|
|
1224
|
+
matchStart
|
|
1225
|
+
)
|
|
1226
|
+
);
|
|
1227
|
+
lastIndex = matchStart + match[0].length;
|
|
1228
|
+
}
|
|
1229
|
+
if (lastIndex < labelText.length) {
|
|
1230
|
+
elements.push(labelText.slice(lastIndex));
|
|
1231
|
+
}
|
|
1232
|
+
return elements;
|
|
1233
|
+
}
|
|
1234
|
+
function CheckboxLabel({ label }) {
|
|
1235
|
+
const intl = (0, import_react_intl7.useIntl)();
|
|
1236
|
+
if (!label) {
|
|
1237
|
+
return null;
|
|
1238
|
+
}
|
|
1239
|
+
const labelText = uiTextToFormattedMessage4(label, intl);
|
|
1240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: computeLabelElements(labelText) });
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
// src/theme/default/components/form/checkbox.tsx
|
|
1244
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1245
|
+
function CheckboxSVG() {
|
|
1246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1247
|
+
"svg",
|
|
1248
|
+
{
|
|
1249
|
+
className: "absolute hidden size-4 peer-checked:block fill-checkbox-foreground-checked",
|
|
1250
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1251
|
+
width: "16",
|
|
1252
|
+
height: "16",
|
|
1253
|
+
viewBox: "0 0 16 16",
|
|
1254
|
+
fill: "none",
|
|
1255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1256
|
+
"path",
|
|
1257
|
+
{
|
|
1258
|
+
fillRule: "evenodd",
|
|
1259
|
+
clipRule: "evenodd",
|
|
1260
|
+
d: "M11.6464 5.14645C11.8417 4.95118 12.1583 4.95118 12.3536 5.14645C12.5338 5.32669 12.5477 5.6103 12.3951 5.80645L12.3536 5.85355L7.35355 10.8536C7.17331 11.0338 6.8897 11.0477 6.69355 10.8951L6.64645 10.8536L4.14645 8.35355C3.95118 8.15829 3.95118 7.84171 4.14645 7.64645C4.32669 7.4662 4.6103 7.45234 4.80645 7.60485L4.85355 7.64645L7 9.7925L11.6464 5.14645Z"
|
|
1261
|
+
}
|
|
1262
|
+
)
|
|
1263
|
+
}
|
|
1264
|
+
);
|
|
1265
|
+
}
|
|
1266
|
+
var DefaultCheckbox = ({
|
|
1267
|
+
attributes: initialAttributes,
|
|
1268
|
+
node
|
|
1269
|
+
}) => {
|
|
1270
|
+
const {
|
|
1271
|
+
value,
|
|
1272
|
+
name,
|
|
1273
|
+
// Button does not support these attributes, so we skip them
|
|
1274
|
+
autocomplete: _autocomplete,
|
|
1275
|
+
onclick: _onclick,
|
|
1276
|
+
maxlength: _max,
|
|
1277
|
+
// End of skipped attributes
|
|
1278
|
+
...attributes
|
|
1279
|
+
} = initialAttributes;
|
|
1280
|
+
const intl = (0, import_react_intl8.useIntl)();
|
|
1281
|
+
const label = (0, import_client_fetch6.getNodeLabel)(node);
|
|
1282
|
+
const { register } = (0, import_react_hook_form4.useForm)();
|
|
1283
|
+
const hasError = node.messages.some((m) => m.type === "error");
|
|
1284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "flex items-start gap-3 self-stretch antialiased", children: [
|
|
1285
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "flex h-5 items-center", children: [
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1287
|
+
"input",
|
|
1288
|
+
{
|
|
1289
|
+
...attributes,
|
|
1290
|
+
value: 1,
|
|
1291
|
+
defaultChecked: Boolean(value),
|
|
1292
|
+
type: "checkbox",
|
|
1293
|
+
className: cn(
|
|
1294
|
+
"peer size-4 border appearance-none rounded-forms bg-checkbox-background-default border-checkbox-border-checkbox-border-default checked:bg-checkbox-background-checked checked:border-checkbox-border-checkbox-border-checked",
|
|
1295
|
+
hasError && "border-interface-border-validation-danger"
|
|
1296
|
+
),
|
|
1297
|
+
...register(name, { value })
|
|
1298
|
+
}
|
|
1299
|
+
),
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CheckboxSVG, {})
|
|
1301
|
+
] }),
|
|
1302
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "flex flex-col", children: [
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "font-normal leading-tight text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CheckboxLabel, { label }) }),
|
|
1304
|
+
node.messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1305
|
+
"span",
|
|
1306
|
+
{
|
|
1307
|
+
className: cn(
|
|
1308
|
+
"mt-1",
|
|
1309
|
+
message.type === "error" ? "text-interface-foreground-validation-danger" : "text-interface-foreground-default-secondary"
|
|
1310
|
+
),
|
|
1311
|
+
...(0, import_elements_react8.messageTestId)(message),
|
|
1312
|
+
children: (0, import_elements_react8.uiTextToFormattedMessage)(message, intl)
|
|
1313
|
+
},
|
|
1314
|
+
message.id
|
|
1315
|
+
))
|
|
1316
|
+
] })
|
|
1317
|
+
] });
|
|
1318
|
+
};
|
|
1319
|
+
|
|
1320
|
+
// src/theme/default/components/form/group-container.tsx
|
|
1321
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1322
|
+
function DefaultGroupContainer({ children }) {
|
|
1323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "grid grid-cols-1 gap-8", children });
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
// src/theme/default/components/form/horizontal-divider.tsx
|
|
1327
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1328
|
+
function DefaultHorizontalDivider() {
|
|
1329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("hr", { className: "border-interface-border-default-primary" });
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
// src/theme/default/components/form/image.tsx
|
|
1333
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1334
|
+
function DefaultImage({ attributes }) {
|
|
1335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("figure", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { ...attributes }) });
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
// src/theme/default/components/form/input.tsx
|
|
1339
|
+
var import_client_fetch7 = require("@ory/client-fetch");
|
|
1340
|
+
var import_elements_react9 = require("@ory/elements-react");
|
|
1341
|
+
var import_react_hook_form5 = require("react-hook-form");
|
|
1342
|
+
var import_react_intl9 = require("react-intl");
|
|
1343
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1344
|
+
var DefaultInput = ({
|
|
1345
|
+
node,
|
|
1346
|
+
attributes,
|
|
1347
|
+
onClick
|
|
1348
|
+
}) => {
|
|
1349
|
+
const label = (0, import_client_fetch7.getNodeLabel)(node);
|
|
1350
|
+
const { register } = (0, import_react_hook_form5.useFormContext)();
|
|
1351
|
+
const {
|
|
1352
|
+
value,
|
|
1353
|
+
autocomplete,
|
|
1354
|
+
name,
|
|
1355
|
+
maxlength,
|
|
1356
|
+
node_type: _,
|
|
1357
|
+
...rest
|
|
1358
|
+
} = attributes;
|
|
1359
|
+
const intl = (0, import_react_intl9.useIntl)();
|
|
1360
|
+
const { flowType } = (0, import_elements_react9.useOryFlow)();
|
|
1361
|
+
const formattedLabel = label ? intl.formatMessage(
|
|
1362
|
+
{
|
|
1363
|
+
id: "input.placeholder",
|
|
1364
|
+
defaultMessage: "Enter your {placeholder}"
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
placeholder: (0, import_elements_react9.uiTextToFormattedMessage)(label, intl)
|
|
1368
|
+
}
|
|
1369
|
+
) : "";
|
|
1370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1371
|
+
"input",
|
|
1372
|
+
{
|
|
1373
|
+
...rest,
|
|
1374
|
+
onClick,
|
|
1375
|
+
maxLength: maxlength,
|
|
1376
|
+
autoComplete: autocomplete,
|
|
1377
|
+
placeholder: formattedLabel,
|
|
1378
|
+
"data-testid": `ory/form/node/input/${name}`,
|
|
1379
|
+
className: cn(
|
|
1380
|
+
"antialiased rounded-forms border leading-tight transition-colors placeholder:h-[20px] placeholder:text-input-foreground-tertiary focus-visible:outline-none focus:ring-0",
|
|
1381
|
+
"bg-input-background-default border-input-border-default text-input-foreground-primary",
|
|
1382
|
+
"disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled",
|
|
1383
|
+
"focus:border-input-border-focus focus-visible:border-input-border-focus",
|
|
1384
|
+
"hover:bg-input-background-hover hover:border-input-border-hover",
|
|
1385
|
+
"px-4 py-[13px]",
|
|
1386
|
+
// The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
|
|
1387
|
+
flowType === import_client_fetch7.FlowType.Settings && "max-w-[488px]"
|
|
1388
|
+
),
|
|
1389
|
+
...register(name, { value })
|
|
1390
|
+
}
|
|
1391
|
+
);
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
// src/theme/default/components/form/label.tsx
|
|
1395
|
+
var import_client_fetch8 = require("@ory/client-fetch");
|
|
1396
|
+
var import_elements_react10 = require("@ory/elements-react");
|
|
1397
|
+
var import_react_hook_form6 = require("react-hook-form");
|
|
1398
|
+
var import_react_intl10 = require("react-intl");
|
|
1399
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1400
|
+
function findResendNode(nodes) {
|
|
1401
|
+
return nodes.find(
|
|
1402
|
+
(n) => "name" in n.attributes && (n.attributes.name === "email" && n.attributes.type === "submit" || n.attributes.name === "resend")
|
|
1403
|
+
);
|
|
1404
|
+
}
|
|
1405
|
+
function DefaultLabel({
|
|
1406
|
+
node,
|
|
1407
|
+
children,
|
|
1408
|
+
attributes,
|
|
1409
|
+
...rest
|
|
1410
|
+
}) {
|
|
1411
|
+
const intl = (0, import_react_intl10.useIntl)();
|
|
1412
|
+
const label = (0, import_client_fetch8.getNodeLabel)(node);
|
|
1413
|
+
const { Message } = (0, import_elements_react10.useComponents)();
|
|
1414
|
+
const { config, flowType, flow } = (0, import_elements_react10.useOryFlow)();
|
|
1415
|
+
const { setValue, formState } = (0, import_react_hook_form6.useFormContext)();
|
|
1416
|
+
const isPassword = attributes.type === "password";
|
|
1417
|
+
const resendNode = findResendNode(flow.ui.nodes);
|
|
1418
|
+
const handleResend = () => {
|
|
1419
|
+
if ((resendNode == null ? void 0 : resendNode.attributes) && "name" in resendNode.attributes) {
|
|
1420
|
+
setValue(resendNode.attributes.name, resendNode.attributes.value);
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
const fieldError = formState.errors[attributes.name];
|
|
1424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-1 antialiased", children: [
|
|
1425
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "inline-flex justify-between", children: [
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1427
|
+
"label",
|
|
1428
|
+
{
|
|
1429
|
+
...(0, import_elements_react10.messageTestId)(label),
|
|
1430
|
+
className: "leading-normal text-input-foreground-primary",
|
|
1431
|
+
htmlFor: attributes.name,
|
|
1432
|
+
"data-testid": `ory/form/node/input/label/${attributes.name}`,
|
|
1433
|
+
...rest,
|
|
1434
|
+
children: (0, import_elements_react10.uiTextToFormattedMessage)(label, intl)
|
|
1435
|
+
}
|
|
1436
|
+
),
|
|
1437
|
+
isPassword && config.project.recovery_enabled && flowType === import_client_fetch8.FlowType.Login && // TODO: make it possible to override with a custom component
|
|
1438
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1439
|
+
"a",
|
|
1440
|
+
{
|
|
1441
|
+
href: initFlowUrl(config.sdk.url, "recovery", flow),
|
|
1442
|
+
className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
|
|
1443
|
+
children: intl.formatMessage({
|
|
1444
|
+
id: "forms.label.forgot-password",
|
|
1445
|
+
defaultMessage: "Forgot password?"
|
|
1446
|
+
})
|
|
1447
|
+
}
|
|
1448
|
+
),
|
|
1449
|
+
(resendNode == null ? void 0 : resendNode.attributes.node_type) === "input" && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1450
|
+
"button",
|
|
1451
|
+
{
|
|
1452
|
+
type: "submit",
|
|
1453
|
+
name: resendNode.attributes.name,
|
|
1454
|
+
value: resendNode.attributes.value,
|
|
1455
|
+
onClick: handleResend,
|
|
1456
|
+
className: "cursor-pointer text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
|
|
1457
|
+
children: intl.formatMessage({ id: "identities.messages.1070008" })
|
|
1458
|
+
}
|
|
1459
|
+
)
|
|
1460
|
+
] }),
|
|
1461
|
+
children,
|
|
1462
|
+
node.messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Message.Content, { message }, message.id)),
|
|
1463
|
+
fieldError && (0, import_client_fetch8.instanceOfUiText)(fieldError) && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Message.Content, { message: fieldError })
|
|
1464
|
+
] });
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
// src/theme/default/components/form/link-button.tsx
|
|
1468
|
+
var import_client_fetch9 = require("@ory/client-fetch");
|
|
1469
|
+
var import_elements_react11 = require("@ory/elements-react");
|
|
1470
|
+
var import_react3 = require("react");
|
|
1471
|
+
var import_react_intl11 = require("react-intl");
|
|
1472
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1473
|
+
var DefaultLinkButton = (0, import_react3.forwardRef)(({ attributes, node }, ref) => {
|
|
1474
|
+
const intl = (0, import_react_intl11.useIntl)();
|
|
1475
|
+
const label = (0, import_client_fetch9.getNodeLabel)(node);
|
|
1476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1477
|
+
"a",
|
|
1478
|
+
{
|
|
1479
|
+
...attributes,
|
|
1480
|
+
ref,
|
|
1481
|
+
title: label ? (0, import_elements_react11.uiTextToFormattedMessage)(label, intl) : "",
|
|
1482
|
+
"data-testid": `ory/form/node/link/${attributes.id}`,
|
|
1483
|
+
className: cn(
|
|
1484
|
+
"antialiased rounded cursor-pointer text-center border gap-3 leading-none bg-button-primary-background-default hover:bg-button-primary-background-hover transition-colors text-button-primary-foreground-default hover:text-button-primary-foreground-hover p-4 font-medium"
|
|
1485
|
+
),
|
|
1486
|
+
children: label ? (0, import_elements_react11.uiTextToFormattedMessage)(label, intl) : ""
|
|
1487
|
+
}
|
|
1488
|
+
);
|
|
1489
|
+
});
|
|
1490
|
+
DefaultLinkButton.displayName = "DefaultLinkButton";
|
|
1491
|
+
|
|
1492
|
+
// src/theme/default/components/form/pin-code-input.tsx
|
|
1493
|
+
var import_react_hook_form7 = require("react-hook-form");
|
|
1494
|
+
|
|
1495
|
+
// src/theme/default/components/form/shadcn/otp-input.tsx
|
|
1496
|
+
var import_input_otp = require("input-otp");
|
|
1497
|
+
var React22 = __toESM(require("react"));
|
|
1498
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1499
|
+
var InputOTP = React22.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1500
|
+
import_input_otp.OTPInput,
|
|
1501
|
+
{
|
|
1502
|
+
ref,
|
|
1503
|
+
containerClassName: cn(
|
|
1504
|
+
"flex items-center gap-2 has-[:disabled]:opacity-50",
|
|
1505
|
+
containerClassName
|
|
1506
|
+
),
|
|
1507
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
1508
|
+
...props
|
|
1509
|
+
}
|
|
1510
|
+
));
|
|
1511
|
+
InputOTP.displayName = "InputOTP";
|
|
1512
|
+
var InputOTPGroup = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
1513
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1514
|
+
var InputOTPSlot = React22.forwardRef(({ index, className, ...props }, ref) => {
|
|
1515
|
+
const inputOTPContext = React22.useContext(import_input_otp.OTPInputContext);
|
|
1516
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
1517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
1518
|
+
"div",
|
|
1519
|
+
{
|
|
1520
|
+
ref,
|
|
1521
|
+
className: cn(
|
|
1522
|
+
"rounded-forms border border-solid bg-input-background-default py-[15px] text-center focus-visible:outline-none w-full",
|
|
1523
|
+
"relative flex items-center justify-center transition-all leading-none",
|
|
1524
|
+
isActive ? "border-input-border-focus" : "border-input-border-default",
|
|
1525
|
+
className
|
|
1526
|
+
),
|
|
1527
|
+
...props,
|
|
1528
|
+
children: [
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "inline-block size-4", children: char }),
|
|
1530
|
+
hasFakeCaret && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-4 w-px animate-caret-blink bg-interface-background-brand-primary duration-700" }) })
|
|
1531
|
+
]
|
|
1532
|
+
}
|
|
1533
|
+
);
|
|
1534
|
+
});
|
|
1535
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
1536
|
+
|
|
1537
|
+
// src/theme/default/components/form/pin-code-input.tsx
|
|
1538
|
+
var import_elements_react12 = require("@ory/elements-react");
|
|
1539
|
+
var import_client_fetch10 = require("@ory/client-fetch");
|
|
1540
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1541
|
+
var DefaultPinCodeInput = ({ attributes }) => {
|
|
1542
|
+
const { setValue, watch } = (0, import_react_hook_form7.useFormContext)();
|
|
1543
|
+
const { maxlength, name } = attributes;
|
|
1544
|
+
const elements = maxlength != null ? maxlength : 6;
|
|
1545
|
+
const { flowType } = (0, import_elements_react12.useOryFlow)();
|
|
1546
|
+
const handleInputChange = (v) => {
|
|
1547
|
+
setValue(name, v);
|
|
1548
|
+
};
|
|
1549
|
+
const value = watch(name);
|
|
1550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1551
|
+
InputOTP,
|
|
1552
|
+
{
|
|
1553
|
+
maxLength: maxlength != null ? maxlength : 6,
|
|
1554
|
+
onChange: handleInputChange,
|
|
1555
|
+
name,
|
|
1556
|
+
value,
|
|
1557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1558
|
+
InputOTPGroup,
|
|
1559
|
+
{
|
|
1560
|
+
className: cn(
|
|
1561
|
+
"w-full flex gap-2 justify-stretch",
|
|
1562
|
+
// The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
|
|
1563
|
+
flowType === import_client_fetch10.FlowType.Settings && "max-w-[488px]"
|
|
1564
|
+
),
|
|
1565
|
+
children: [...Array(elements)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(InputOTPSlot, { index }, index))
|
|
1566
|
+
}
|
|
1567
|
+
)
|
|
1568
|
+
}
|
|
1569
|
+
);
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1572
|
+
// src/theme/default/components/form/section.tsx
|
|
1573
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1574
|
+
var DefaultFormSection = ({
|
|
1575
|
+
children,
|
|
1576
|
+
nodes: _nodes,
|
|
1577
|
+
...rest
|
|
1578
|
+
}) => {
|
|
1579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1580
|
+
"form",
|
|
1581
|
+
{
|
|
1582
|
+
className: "flex w-full max-w-screen-sm flex-col md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] px-4",
|
|
1583
|
+
...rest,
|
|
1584
|
+
children
|
|
1585
|
+
}
|
|
1586
|
+
);
|
|
1587
|
+
};
|
|
1588
|
+
var DefaultFormSectionContent = ({
|
|
1589
|
+
title,
|
|
1590
|
+
description,
|
|
1591
|
+
children
|
|
1592
|
+
}) => {
|
|
1593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-8 rounded-t-cards border border-b-0 border-interface-border-default-primary bg-interface-background-default-primary px-6 py-8", children: [
|
|
1594
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h3", { className: "font-medium text-interface-foreground-default-primary", children: title }),
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-interface-foreground-default-secondary", children: description })
|
|
1597
|
+
] }),
|
|
1598
|
+
children
|
|
1599
|
+
] });
|
|
1600
|
+
};
|
|
1601
|
+
var DefaultFormSectionFooter = ({
|
|
1602
|
+
children,
|
|
1603
|
+
text
|
|
1604
|
+
}) => {
|
|
1605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
1606
|
+
"div",
|
|
1607
|
+
{
|
|
1608
|
+
className: cn(
|
|
1609
|
+
"flex min-h-[72px] items-center justify-between gap-2 rounded-b-cards border border-interface-border-default-primary bg-interface-background-default-secondary px-6 py-4 text-interface-foreground-default-tertiary"
|
|
1610
|
+
),
|
|
1611
|
+
children: [
|
|
1612
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: text }),
|
|
1613
|
+
children
|
|
1614
|
+
]
|
|
1615
|
+
}
|
|
1616
|
+
);
|
|
1617
|
+
};
|
|
1618
|
+
|
|
1619
|
+
// src/theme/default/components/form/text.tsx
|
|
1620
|
+
var import_elements_react13 = require("@ory/elements-react");
|
|
1621
|
+
var import_react_intl12 = require("react-intl");
|
|
1622
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1623
|
+
function DefaultText({ node, attributes }) {
|
|
1624
|
+
var _a;
|
|
1625
|
+
const intl = (0, import_react_intl12.useIntl)();
|
|
1626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
1627
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { "data-testid": `ory/form/node/text/${attributes.id}/label`, children: node.meta.label ? (0, import_elements_react13.uiTextToFormattedMessage)(node.meta.label, intl) : "" }),
|
|
1628
|
+
(_a = attributes.text.context.secrets) == null ? void 0 : _a.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1629
|
+
"pre",
|
|
1630
|
+
{
|
|
1631
|
+
"data-testid": `ory/form/node/text/lookup_secret_codes/text`,
|
|
1632
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("code", { children: text ? (0, import_elements_react13.uiTextToFormattedMessage)(text, intl) : "" })
|
|
1633
|
+
},
|
|
1634
|
+
index
|
|
1635
|
+
))
|
|
1636
|
+
] });
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
// src/theme/default/components/generic/page-header.tsx
|
|
1640
|
+
var import_elements_react15 = require("@ory/elements-react");
|
|
1641
|
+
|
|
1642
|
+
// src/theme/default/components/ui/user-menu.tsx
|
|
1643
|
+
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
1644
|
+
var import_react6 = require("react");
|
|
1645
|
+
var import_elements_react14 = require("@ory/elements-react");
|
|
1646
|
+
|
|
1647
|
+
// src/util/client.ts
|
|
1648
|
+
var import_client_fetch11 = require("@ory/client-fetch");
|
|
1649
|
+
function frontendClient(sdkUrl, opts = {}) {
|
|
1650
|
+
const config = new import_client_fetch11.Configuration({
|
|
1651
|
+
...opts,
|
|
1652
|
+
basePath: sdkUrl,
|
|
1653
|
+
headers: {
|
|
1654
|
+
Accept: "application/json",
|
|
1655
|
+
...opts.headers
|
|
1656
|
+
}
|
|
1657
|
+
});
|
|
1658
|
+
return new import_client_fetch11.FrontendApi(config);
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
// src/theme/default/assets/icons/logout.svg
|
|
1662
|
+
var React23 = __toESM(require("react"));
|
|
1663
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1664
|
+
var SvgLogout = (props) => {
|
|
1665
|
+
var _a, _b;
|
|
1666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.333 5.334V4A1.333 1.333 0 0 0 8 2.667H3.333A1.333 1.333 0 0 0 2 4v8a1.333 1.333 0 0 0 1.333 1.334H8A1.333 1.333 0 0 0 9.333 12v-1.333M4.667 8H14m0 0-2-2m2 2-2 2" }) });
|
|
1667
|
+
};
|
|
1668
|
+
var logout_default = SvgLogout;
|
|
1669
|
+
|
|
1670
|
+
// src/theme/default/assets/icons/settings.svg
|
|
1671
|
+
var React24 = __toESM(require("react"));
|
|
1672
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1673
|
+
var SvgSettings = (props) => {
|
|
1674
|
+
var _a, _b;
|
|
1675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("g", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M6.883 2.878c.284-1.17 1.95-1.17 2.234 0a1.15 1.15 0 0 0 1.715.71c1.029-.626 2.207.551 1.58 1.58a1.148 1.148 0 0 0 .71 1.715c1.17.284 1.17 1.95 0 2.234a1.15 1.15 0 0 0-.71 1.715c.626 1.029-.551 2.207-1.58 1.58a1.148 1.148 0 0 0-1.715.71c-.284 1.17-1.95 1.17-2.234 0a1.15 1.15 0 0 0-1.715-.71c-1.029.626-2.207-.551-1.58-1.58a1.15 1.15 0 0 0-.71-1.715c-1.17-.284-1.17-1.95 0-2.234a1.15 1.15 0 0 0 .71-1.715c-.626-1.029.551-2.207 1.58-1.58.667.405 1.531.047 1.715-.71" }),
|
|
1677
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M6 8a2 2 0 1 0 4 0 2 2 0 0 0-4 0" })
|
|
1678
|
+
] }) });
|
|
1679
|
+
};
|
|
1680
|
+
var settings_default = SvgSettings;
|
|
1681
|
+
|
|
1682
|
+
// src/theme/default/utils/user.ts
|
|
1683
|
+
function isTraitsIndexable(traits) {
|
|
1684
|
+
return typeof traits === "object" && traits !== null;
|
|
1685
|
+
}
|
|
1686
|
+
var getUserInitials = (session) => {
|
|
1687
|
+
var _a, _b;
|
|
1688
|
+
const avatar = "";
|
|
1689
|
+
let primary = "";
|
|
1690
|
+
let secondary = "";
|
|
1691
|
+
if (!((_a = session == null ? void 0 : session.identity) == null ? void 0 : _a.traits) || !isTraitsIndexable(session.identity.traits)) {
|
|
1692
|
+
return {
|
|
1693
|
+
primary,
|
|
1694
|
+
secondary,
|
|
1695
|
+
avatar
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1698
|
+
const traits = (_b = session.identity) == null ? void 0 : _b.traits;
|
|
1699
|
+
if (traits.email && typeof traits.email === "string") {
|
|
1700
|
+
secondary = traits.email;
|
|
1701
|
+
}
|
|
1702
|
+
if (traits.name) {
|
|
1703
|
+
if (typeof traits.name === "string") {
|
|
1704
|
+
primary = traits.name;
|
|
1705
|
+
}
|
|
1706
|
+
if (typeof traits.name === "object" && traits.name && traits.name.first && traits.name.last) {
|
|
1707
|
+
primary = traits.name.first + " " + traits.name.last;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
if (primary === "") {
|
|
1711
|
+
primary = secondary;
|
|
1712
|
+
secondary = "";
|
|
1713
|
+
}
|
|
1714
|
+
return {
|
|
1715
|
+
primary,
|
|
1716
|
+
secondary,
|
|
1717
|
+
avatar
|
|
1718
|
+
};
|
|
1719
|
+
};
|
|
1720
|
+
|
|
1721
|
+
// src/theme/default/components/ui/dropdown-menu.tsx
|
|
1722
|
+
var import_react4 = require("react");
|
|
1723
|
+
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1724
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1725
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1726
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1727
|
+
var DropdownMenuContent = (0, import_react4.forwardRef)(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1728
|
+
DropdownMenuPrimitive.Content,
|
|
1729
|
+
{
|
|
1730
|
+
ref,
|
|
1731
|
+
sideOffset,
|
|
1732
|
+
align: "end",
|
|
1733
|
+
className: cn(
|
|
1734
|
+
"z-50 min-w-[19rem] overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1735
|
+
"border border-interface-border-default-primary bg-interface-background-default-primary rounded-cards",
|
|
1736
|
+
className
|
|
1737
|
+
),
|
|
1738
|
+
...props
|
|
1739
|
+
}
|
|
1740
|
+
) }));
|
|
1741
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1742
|
+
var DropdownMenuItem = (0, import_react4.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1743
|
+
DropdownMenuPrimitive.Item,
|
|
1744
|
+
{
|
|
1745
|
+
ref,
|
|
1746
|
+
className: cn(
|
|
1747
|
+
"relative flex cursor-pointer select-none items-center outline-none transition-colors data-[disabled]:pointer-events-none",
|
|
1748
|
+
"px-8 py-3 lg:py-4.5 text-sm gap-6",
|
|
1749
|
+
"first:border-0 border-t border-button-secondary-border-default hover:border-button-social-border-hover",
|
|
1750
|
+
"text-button-secondary-foreground-default bg-button-secondary-background-default",
|
|
1751
|
+
"hover:text-button-secondary-foreground-hover hover:bg-button-secondary-background-hover",
|
|
1752
|
+
"data-[disabled]:text-button-secondary-foreground-disabled data-[disabled]:bg-button-secondary-background-disabled",
|
|
1753
|
+
inset && "pl-8",
|
|
1754
|
+
className
|
|
1755
|
+
),
|
|
1756
|
+
...props
|
|
1757
|
+
}
|
|
1758
|
+
));
|
|
1759
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1760
|
+
var DropdownMenuLabel = (0, import_react4.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1761
|
+
DropdownMenuPrimitive.Label,
|
|
1762
|
+
{
|
|
1763
|
+
ref,
|
|
1764
|
+
className: cn(
|
|
1765
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
1766
|
+
inset && "pl-8",
|
|
1767
|
+
className
|
|
1768
|
+
),
|
|
1769
|
+
...props
|
|
1770
|
+
}
|
|
1771
|
+
));
|
|
1772
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1773
|
+
|
|
1774
|
+
// src/theme/default/components/ui/user-avater.tsx
|
|
1775
|
+
var import_react5 = require("react");
|
|
1776
|
+
|
|
1777
|
+
// src/theme/default/assets/icons/user.svg
|
|
1778
|
+
var React25 = __toESM(require("react"));
|
|
1779
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
1780
|
+
var SvgUser = (props) => {
|
|
1781
|
+
var _a, _b;
|
|
1782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2M8 7a4 4 0 1 0 8 0 4 4 0 0 0-8 0" }) });
|
|
1783
|
+
};
|
|
1784
|
+
var user_default = SvgUser;
|
|
1785
|
+
|
|
1786
|
+
// src/theme/default/components/ui/user-avater.tsx
|
|
1787
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1788
|
+
var UserAvatar = (0, import_react5.forwardRef)(
|
|
1789
|
+
({ initials, ...rest }, ref) => {
|
|
1790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
1791
|
+
"button",
|
|
1792
|
+
{
|
|
1793
|
+
ref,
|
|
1794
|
+
className: "relative flex size-10 items-center justify-center overflow-hidden rounded-[999px] bg-button-primary-background-default hover:bg-button-primary-background-hover",
|
|
1795
|
+
...rest,
|
|
1796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative flex size-full items-center justify-center", children: initials.avatar ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
1797
|
+
"img",
|
|
1798
|
+
{
|
|
1799
|
+
src: initials.avatar,
|
|
1800
|
+
alt: initials.primary,
|
|
1801
|
+
className: "w-full object-contain"
|
|
1802
|
+
}
|
|
1803
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
1804
|
+
user_default,
|
|
1805
|
+
{
|
|
1806
|
+
size: 24,
|
|
1807
|
+
className: "text-button-primary-foreground-default"
|
|
1808
|
+
}
|
|
1809
|
+
) })
|
|
1810
|
+
}
|
|
1811
|
+
);
|
|
1812
|
+
}
|
|
1813
|
+
);
|
|
1814
|
+
UserAvatar.displayName = "UserAvatar";
|
|
1815
|
+
|
|
1816
|
+
// src/theme/default/components/ui/user-menu.tsx
|
|
1817
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
1818
|
+
var UserMenu = ({ session }) => {
|
|
1819
|
+
const { config } = (0, import_elements_react14.useOryFlow)();
|
|
1820
|
+
const initials = getUserInitials(session);
|
|
1821
|
+
const [logoutFlow, setLogoutFlow] = (0, import_react6.useState)();
|
|
1822
|
+
const fetchLogoutFlow = (0, import_react6.useCallback)(async () => {
|
|
1823
|
+
const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow();
|
|
1824
|
+
setLogoutFlow(flow);
|
|
1825
|
+
}, [config.sdk.url]);
|
|
1826
|
+
(0, import_react6.useEffect)(() => {
|
|
1827
|
+
void fetchLogoutFlow();
|
|
1828
|
+
}, [fetchLogoutFlow]);
|
|
1829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(DropdownMenu, { children: [
|
|
1830
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(UserAvatar, { initials }) }),
|
|
1831
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(DropdownMenuContent, { children: [
|
|
1832
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_react_dropdown_menu.DropdownMenuLabel, { className: "flex gap-3 px-5 py-4.5", children: [
|
|
1833
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(UserAvatar, { disabled: true, initials }),
|
|
1834
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col justify-center text-sm leading-tight", children: [
|
|
1835
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-interface-foreground-default-primary leading-tight font-medium", children: initials.primary }),
|
|
1836
|
+
initials.secondary && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-interface-foreground-default-tertiary leading-tight", children: initials.secondary })
|
|
1837
|
+
] })
|
|
1838
|
+
] }),
|
|
1839
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("a", { href: "/settings", children: [
|
|
1840
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(settings_default, { size: 16 }),
|
|
1841
|
+
" User settings"
|
|
1842
|
+
] }) }),
|
|
1843
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DropdownMenuItem, { asChild: true, disabled: !(logoutFlow == null ? void 0 : logoutFlow.logout_url), children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("a", { href: logoutFlow == null ? void 0 : logoutFlow.logout_url, children: [
|
|
1844
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(logout_default, { size: 16 }),
|
|
1845
|
+
" Logout"
|
|
1846
|
+
] }) })
|
|
1847
|
+
] })
|
|
1848
|
+
] });
|
|
1849
|
+
};
|
|
1850
|
+
|
|
1851
|
+
// src/theme/default/components/generic/page-header.tsx
|
|
1852
|
+
var import_client2 = require("@ory/elements-react/client");
|
|
1853
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
1854
|
+
var DefaultPageHeader = (_props) => {
|
|
1855
|
+
const { Card } = (0, import_elements_react15.useComponents)();
|
|
1856
|
+
const { session } = (0, import_client2.useSession)();
|
|
1857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mt-16 flex max-w-screen-sm w-full md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] flex-col gap-3 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex flex-col gap-12", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex max-h-10 flex-1 justify-between gap-2", children: [
|
|
1858
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "relative h-10 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Card.Logo, {}) }),
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(UserMenu, { session })
|
|
1860
|
+
] }) }) });
|
|
1861
|
+
};
|
|
1862
|
+
|
|
1863
|
+
// src/theme/default/components/settings/settings-oidc.tsx
|
|
1864
|
+
var import_react7 = require("react");
|
|
1865
|
+
var import_react_hook_form8 = require("react-hook-form");
|
|
1866
|
+
|
|
1867
|
+
// src/theme/default/assets/icons/trash.svg
|
|
1868
|
+
var React26 = __toESM(require("react"));
|
|
1869
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
1870
|
+
var SvgTrash = (props) => {
|
|
1871
|
+
var _a, _b;
|
|
1872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M4 7h16m-10 4v6m4-6v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3" }) });
|
|
1873
|
+
};
|
|
1874
|
+
var trash_default = SvgTrash;
|
|
1875
|
+
|
|
1876
|
+
// src/theme/default/components/settings/settings-oidc.tsx
|
|
1877
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
1878
|
+
function DefaultSettingsOidc({
|
|
1879
|
+
linkButtons,
|
|
1880
|
+
unlinkButtons
|
|
1881
|
+
}) {
|
|
1882
|
+
const hasLinkButtons = linkButtons.length > 0;
|
|
1883
|
+
const hasUnlinkButtons = unlinkButtons.length > 0;
|
|
1884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
1885
|
+
hasLinkButtons && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "grid items-start gap-3 grid-cols-1 sm:grid-cols-2 md:grid-cols-3", children: linkButtons.map((button) => {
|
|
1886
|
+
const attrs = button.attributes;
|
|
1887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
1888
|
+
DefaultButtonSocial,
|
|
1889
|
+
{
|
|
1890
|
+
showLabel: true,
|
|
1891
|
+
node: button,
|
|
1892
|
+
attributes: attrs,
|
|
1893
|
+
onClick: button.onClick
|
|
1894
|
+
},
|
|
1895
|
+
attrs.value
|
|
1896
|
+
);
|
|
1897
|
+
}) }),
|
|
1898
|
+
hasUnlinkButtons && hasLinkButtons ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DefaultHorizontalDivider, {}) : null,
|
|
1899
|
+
unlinkButtons.map((button) => {
|
|
1900
|
+
if (button.attributes.node_type !== "input") {
|
|
1901
|
+
return null;
|
|
1902
|
+
}
|
|
1903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(UnlinkRow, { button }, button.attributes.value);
|
|
1904
|
+
})
|
|
1905
|
+
] });
|
|
1906
|
+
}
|
|
1907
|
+
function UnlinkRow({ button }) {
|
|
1908
|
+
var _a, _b;
|
|
1909
|
+
const [clicked, setClicked] = (0, import_react7.useState)(false);
|
|
1910
|
+
const {
|
|
1911
|
+
formState: { isSubmitting }
|
|
1912
|
+
} = (0, import_react_hook_form8.useFormContext)();
|
|
1913
|
+
const attrs = button.attributes;
|
|
1914
|
+
const provider = (_b = extractProvider((_a = button.meta.label) == null ? void 0 : _a.context)) != null ? _b : "";
|
|
1915
|
+
const Logo = attrs.value in provider_logos_default ? provider_logos_default[attrs.value] : provider_logos_default.generic;
|
|
1916
|
+
const localOnClick = () => {
|
|
1917
|
+
button.onClick();
|
|
1918
|
+
setTimeout(() => {
|
|
1919
|
+
setClicked(true);
|
|
1920
|
+
}, 100);
|
|
1921
|
+
};
|
|
1922
|
+
(0, import_react7.useEffect)(() => {
|
|
1923
|
+
if (!isSubmitting) {
|
|
1924
|
+
setClicked(false);
|
|
1925
|
+
}
|
|
1926
|
+
}, [isSubmitting]);
|
|
1927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex justify-between", children: [
|
|
1928
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-6", children: [
|
|
1929
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Logo, { size: 32 }),
|
|
1930
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary", children: provider })
|
|
1931
|
+
] }),
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
1933
|
+
"button",
|
|
1934
|
+
{
|
|
1935
|
+
...attrs,
|
|
1936
|
+
type: "submit",
|
|
1937
|
+
onClick: localOnClick,
|
|
1938
|
+
disabled: isSubmitting,
|
|
1939
|
+
className: "relative",
|
|
1940
|
+
title: `Unlink ${provider}`,
|
|
1941
|
+
children: clicked ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
1942
|
+
trash_default,
|
|
1943
|
+
{
|
|
1944
|
+
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
1945
|
+
size: 24
|
|
1946
|
+
}
|
|
1947
|
+
)
|
|
1948
|
+
}
|
|
1949
|
+
)
|
|
1950
|
+
] }, attrs.value);
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
// src/theme/default/components/settings/settings-passkey.tsx
|
|
1954
|
+
var import_elements_react16 = require("@ory/elements-react");
|
|
1955
|
+
var import_react_hook_form9 = require("react-hook-form");
|
|
1956
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
1957
|
+
function DefaultSettingsPasskey({
|
|
1958
|
+
triggerButton,
|
|
1959
|
+
removeButtons
|
|
1960
|
+
}) {
|
|
1961
|
+
const {
|
|
1962
|
+
formState: { isSubmitting }
|
|
1963
|
+
} = (0, import_react_hook_form9.useFormContext)();
|
|
1964
|
+
const { Node } = (0, import_elements_react16.useComponents)();
|
|
1965
|
+
const hasRemoveButtons = removeButtons.length > 0;
|
|
1966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex max-w-[60%] items-end gap-3", children: triggerButton && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
1968
|
+
Node.Button,
|
|
1969
|
+
{
|
|
1970
|
+
node: triggerButton,
|
|
1971
|
+
attributes: triggerButton.attributes,
|
|
1972
|
+
onClick: triggerButton.onClick
|
|
1973
|
+
}
|
|
1974
|
+
) }),
|
|
1975
|
+
hasRemoveButtons ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DefaultHorizontalDivider, {}),
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex flex-col gap-2", children: removeButtons.map((node, i) => {
|
|
1978
|
+
var _a, _b;
|
|
1979
|
+
const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
|
|
1980
|
+
const addedAt = "added_at" in context ? context.added_at : null;
|
|
1981
|
+
const displayName = "display_name" in context ? context.display_name : null;
|
|
1982
|
+
const keyId = "value" in node.attributes ? node.attributes.value : null;
|
|
1983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
1984
|
+
"div",
|
|
1985
|
+
{
|
|
1986
|
+
className: "flex justify-between gap-6 md:items-center",
|
|
1987
|
+
children: [
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex gap-2 items-center flex-1", children: [
|
|
1989
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
1990
|
+
passkey_default,
|
|
1991
|
+
{
|
|
1992
|
+
size: 32,
|
|
1993
|
+
className: "text-interface-foreground-default-primary"
|
|
1994
|
+
}
|
|
1995
|
+
),
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4", children: [
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-1 flex-col", children: [
|
|
1998
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary", children: displayName }),
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block", children: keyId })
|
|
2000
|
+
] }),
|
|
2001
|
+
addedAt && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
|
|
2002
|
+
dateStyle: "long"
|
|
2003
|
+
}).format(new Date(addedAt)) })
|
|
2004
|
+
] })
|
|
2005
|
+
] }),
|
|
2006
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2007
|
+
"button",
|
|
2008
|
+
{
|
|
2009
|
+
...node.attributes,
|
|
2010
|
+
type: "submit",
|
|
2011
|
+
onClick: node.onClick,
|
|
2012
|
+
disabled: isSubmitting,
|
|
2013
|
+
className: "relative",
|
|
2014
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2015
|
+
trash_default,
|
|
2016
|
+
{
|
|
2017
|
+
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
2018
|
+
size: 24
|
|
2019
|
+
}
|
|
2020
|
+
)
|
|
2021
|
+
}
|
|
2022
|
+
)
|
|
2023
|
+
]
|
|
2024
|
+
},
|
|
2025
|
+
`passkey-remove-button-${i}`
|
|
2026
|
+
);
|
|
2027
|
+
}) })
|
|
2028
|
+
] }) : null
|
|
2029
|
+
] });
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
// src/theme/default/assets/icons/download.svg
|
|
2033
|
+
var React27 = __toESM(require("react"));
|
|
2034
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2035
|
+
var SvgDownload = (props) => {
|
|
2036
|
+
var _a, _b;
|
|
2037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5m0 0 5-5m-5 5V4" }) });
|
|
2038
|
+
};
|
|
2039
|
+
var download_default = SvgDownload;
|
|
2040
|
+
|
|
2041
|
+
// src/theme/default/assets/icons/eye.svg
|
|
2042
|
+
var React28 = __toESM(require("react"));
|
|
2043
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2044
|
+
var SvgEye = (props) => {
|
|
2045
|
+
var _a, _b;
|
|
2046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("g", { strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2047
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { stroke: "currentColor", d: "M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0" }),
|
|
2048
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { stroke: "#64748B", d: "M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6" })
|
|
2049
|
+
] }) });
|
|
2050
|
+
};
|
|
2051
|
+
var eye_default = SvgEye;
|
|
2052
|
+
|
|
2053
|
+
// src/theme/default/assets/icons/refresh.svg
|
|
2054
|
+
var React29 = __toESM(require("react"));
|
|
2055
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2056
|
+
var SvgRefresh = (props) => {
|
|
2057
|
+
var _a, _b;
|
|
2058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" }) });
|
|
2059
|
+
};
|
|
2060
|
+
var refresh_default = SvgRefresh;
|
|
2061
|
+
|
|
2062
|
+
// src/theme/default/components/settings/settings-recovery-codes.tsx
|
|
2063
|
+
var import_react_hook_form10 = require("react-hook-form");
|
|
2064
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2065
|
+
function DefaultSettingsRecoveryCodes({
|
|
2066
|
+
codes,
|
|
2067
|
+
regnerateButton,
|
|
2068
|
+
revealButton,
|
|
2069
|
+
onRegenerate,
|
|
2070
|
+
onReveal
|
|
2071
|
+
}) {
|
|
2072
|
+
const {
|
|
2073
|
+
formState: { isSubmitting }
|
|
2074
|
+
} = (0, import_react_hook_form10.useFormContext)();
|
|
2075
|
+
const onDownload = () => {
|
|
2076
|
+
const element = document.createElement("a");
|
|
2077
|
+
const file = new Blob([codes.join("\n")], {
|
|
2078
|
+
type: "text/plain"
|
|
2079
|
+
});
|
|
2080
|
+
element.href = URL.createObjectURL(file);
|
|
2081
|
+
element.download = "recovery-codes.txt";
|
|
2082
|
+
document.body.appendChild(element);
|
|
2083
|
+
element.click();
|
|
2084
|
+
};
|
|
2085
|
+
const hasCodes = codes.length >= 1;
|
|
2086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2087
|
+
codes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DefaultHorizontalDivider, {}),
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex gap-4 justify-between", children: [
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-interface-foreground-default-tertiary", children: revealButton && "Reveal recovery codes" }),
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex gap-2", children: [
|
|
2091
|
+
regnerateButton && codes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2092
|
+
"button",
|
|
2093
|
+
{
|
|
2094
|
+
...regnerateButton.attributes,
|
|
2095
|
+
type: "submit",
|
|
2096
|
+
className: "ml-auto",
|
|
2097
|
+
onClick: onRegenerate,
|
|
2098
|
+
disabled: isSubmitting,
|
|
2099
|
+
"data-loading": isSubmitting,
|
|
2100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2101
|
+
refresh_default,
|
|
2102
|
+
{
|
|
2103
|
+
size: 24,
|
|
2104
|
+
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover"
|
|
2105
|
+
}
|
|
2106
|
+
)
|
|
2107
|
+
}
|
|
2108
|
+
),
|
|
2109
|
+
revealButton && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2110
|
+
"button",
|
|
2111
|
+
{
|
|
2112
|
+
...revealButton.attributes,
|
|
2113
|
+
type: "submit",
|
|
2114
|
+
className: "ml-auto",
|
|
2115
|
+
onClick: onReveal,
|
|
2116
|
+
title: "Reveal recovery codes",
|
|
2117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2118
|
+
eye_default,
|
|
2119
|
+
{
|
|
2120
|
+
size: 24,
|
|
2121
|
+
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover"
|
|
2122
|
+
}
|
|
2123
|
+
)
|
|
2124
|
+
}
|
|
2125
|
+
) }),
|
|
2126
|
+
hasCodes && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2127
|
+
"button",
|
|
2128
|
+
{
|
|
2129
|
+
onClick: onDownload,
|
|
2130
|
+
type: "button",
|
|
2131
|
+
className: "ml-auto",
|
|
2132
|
+
"data-testid": "ory/screen/settings/group/recovery_code/download",
|
|
2133
|
+
title: "Download recovery codes",
|
|
2134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2135
|
+
download_default,
|
|
2136
|
+
{
|
|
2137
|
+
size: 24,
|
|
2138
|
+
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover"
|
|
2139
|
+
}
|
|
2140
|
+
)
|
|
2141
|
+
}
|
|
2142
|
+
)
|
|
2143
|
+
] })
|
|
2144
|
+
] }),
|
|
2145
|
+
hasCodes ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "rounded-general p-6 bg-interface-background-default-secondary border-interface-border-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2146
|
+
"div",
|
|
2147
|
+
{
|
|
2148
|
+
className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 flex-wrap gap-4 text-sm text-interface-foreground-default-primary",
|
|
2149
|
+
"data-testid": "ory/screen/settings/group/recovery_code/codes",
|
|
2150
|
+
children: codes.map((code) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { children: code }, code))
|
|
2151
|
+
}
|
|
2152
|
+
) }) : null
|
|
2153
|
+
] });
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
// src/theme/default/components/settings/settings-totp.tsx
|
|
2157
|
+
var import_elements_react17 = require("@ory/elements-react");
|
|
2158
|
+
|
|
2159
|
+
// src/theme/default/assets/icons/qrcode.svg
|
|
2160
|
+
var React30 = __toESM(require("react"));
|
|
2161
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2162
|
+
var SvgQrcode = (props) => {
|
|
2163
|
+
var _a, _b;
|
|
2164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.333 22.667v.013m0-13.346v.013m13.333-.013v.013m0 9.32h-4v4m8-4v.013m-8 7.987h4m0-4h4v4m-21.333-20a1.333 1.333 0 0 1 1.333-1.333H12a1.333 1.333 0 0 1 1.333 1.333V12A1.334 1.334 0 0 1 12 13.334H6.666A1.334 1.334 0 0 1 5.333 12zm13.333 0A1.333 1.333 0 0 1 20 5.334h5.333a1.333 1.333 0 0 1 1.333 1.333V12a1.333 1.333 0 0 1-1.333 1.334H20A1.333 1.333 0 0 1 18.666 12zM5.333 20a1.333 1.333 0 0 1 1.333-1.333H12A1.333 1.333 0 0 1 13.333 20v5.334A1.333 1.333 0 0 1 12 26.667H6.666a1.333 1.333 0 0 1-1.333-1.334z" }) });
|
|
2165
|
+
};
|
|
2166
|
+
var qrcode_default = SvgQrcode;
|
|
2167
|
+
|
|
2168
|
+
// src/theme/default/components/settings/settings-totp.tsx
|
|
2169
|
+
var import_react_hook_form11 = require("react-hook-form");
|
|
2170
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2171
|
+
function DefaultSettingsTotp({
|
|
2172
|
+
totpImage,
|
|
2173
|
+
totpInput,
|
|
2174
|
+
totpSecret,
|
|
2175
|
+
totpUnlink,
|
|
2176
|
+
onUnlink
|
|
2177
|
+
}) {
|
|
2178
|
+
const { Node, Card } = (0, import_elements_react17.useComponents)();
|
|
2179
|
+
const {
|
|
2180
|
+
formState: { isSubmitting }
|
|
2181
|
+
} = (0, import_react_hook_form11.useFormContext)();
|
|
2182
|
+
if (totpUnlink) {
|
|
2183
|
+
const {
|
|
2184
|
+
type,
|
|
2185
|
+
autocomplete: _ignoredAutocomplete,
|
|
2186
|
+
label: _ignoredLabel,
|
|
2187
|
+
node_type: _ignoredNodeType,
|
|
2188
|
+
...buttonAttrs
|
|
2189
|
+
} = totpUnlink.attributes;
|
|
2190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
|
|
2191
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "col-span-full", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Card.Divider, {}) }),
|
|
2192
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "col-span-full flex items-center gap-6", children: [
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "aspect-square size-8 ", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(qrcode_default, { size: 32 }) }),
|
|
2194
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "mr-auto flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-primary", children: "Authenticator app" }) }),
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2196
|
+
"button",
|
|
2197
|
+
{
|
|
2198
|
+
type: type === "button" ? "button" : "submit",
|
|
2199
|
+
...buttonAttrs,
|
|
2200
|
+
onClick: onUnlink,
|
|
2201
|
+
disabled: isSubmitting,
|
|
2202
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2203
|
+
trash_default,
|
|
2204
|
+
{
|
|
2205
|
+
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
2206
|
+
size: 24
|
|
2207
|
+
}
|
|
2208
|
+
)
|
|
2209
|
+
}
|
|
2210
|
+
)
|
|
2211
|
+
] })
|
|
2212
|
+
] });
|
|
2213
|
+
}
|
|
2214
|
+
if (totpImage && totpSecret && totpInput) {
|
|
2215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
|
|
2216
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "col-span-full", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DefaultHorizontalDivider, {}) }),
|
|
2217
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex justify-center rounded-cards bg-interface-background-default-secondary p-8", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "aspect-square h-44 rounded bg-[white]", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "-m-3 antialiased mix-blend-multiply", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2218
|
+
Node.Image,
|
|
2219
|
+
{
|
|
2220
|
+
node: totpImage,
|
|
2221
|
+
attributes: {
|
|
2222
|
+
...totpImage.attributes
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
) }) }) }),
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
2227
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2228
|
+
Node.Label,
|
|
2229
|
+
{
|
|
2230
|
+
node: totpSecret,
|
|
2231
|
+
attributes: totpSecret.attributes,
|
|
2232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2233
|
+
Node.Input,
|
|
2234
|
+
{
|
|
2235
|
+
node: totpSecret,
|
|
2236
|
+
attributes: {
|
|
2237
|
+
disabled: true,
|
|
2238
|
+
name: "totp_secret_key",
|
|
2239
|
+
node_type: "input",
|
|
2240
|
+
type: "text",
|
|
2241
|
+
value: totpSecret.attributes.text.text
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
)
|
|
2245
|
+
}
|
|
2246
|
+
),
|
|
2247
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2248
|
+
Node.Label,
|
|
2249
|
+
{
|
|
2250
|
+
attributes: totpInput.attributes,
|
|
2251
|
+
node: totpInput,
|
|
2252
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2253
|
+
Node.CodeInput,
|
|
2254
|
+
{
|
|
2255
|
+
node: totpInput,
|
|
2256
|
+
attributes: totpInput.attributes
|
|
2257
|
+
}
|
|
2258
|
+
)
|
|
2259
|
+
}
|
|
2260
|
+
)
|
|
2261
|
+
] })
|
|
2262
|
+
] });
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
// src/theme/default/components/settings/settings-webauthn.tsx
|
|
2267
|
+
var import_elements_react18 = require("@ory/elements-react");
|
|
2268
|
+
|
|
2269
|
+
// src/theme/default/assets/icons/key.svg
|
|
2270
|
+
var React31 = __toESM(require("react"));
|
|
2271
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2272
|
+
var SvgKey = (props) => {
|
|
2273
|
+
var _a, _b;
|
|
2274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h.013m2.06-6.876 4.803 4.803a3.836 3.836 0 0 1 0 5.425l-3.524 3.524a3.835 3.835 0 0 1-5.425 0l-.402-.401-8.744 8.744a2.67 2.67 0 0 1-1.652.77L6.896 28H5.333a1.334 1.334 0 0 1-1.324-1.177L4 26.667v-1.563c0-.626.22-1.232.623-1.712l.158-.173.552-.552H8V20h2.667v-2.667l2.858-2.858-.401-.402a3.835 3.835 0 0 1 0-5.425l3.524-3.524a3.835 3.835 0 0 1 5.425 0" }) });
|
|
2275
|
+
};
|
|
2276
|
+
var key_default = SvgKey;
|
|
2277
|
+
|
|
2278
|
+
// src/theme/default/components/settings/settings-webauthn.tsx
|
|
2279
|
+
var import_react_hook_form12 = require("react-hook-form");
|
|
2280
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2281
|
+
function DefaultSettingsWebauthn({
|
|
2282
|
+
nameInput,
|
|
2283
|
+
triggerButton,
|
|
2284
|
+
removeButtons
|
|
2285
|
+
}) {
|
|
2286
|
+
const {
|
|
2287
|
+
formState: { isSubmitting }
|
|
2288
|
+
} = (0, import_react_hook_form12.useFormContext)();
|
|
2289
|
+
const { Node, Card } = (0, import_elements_react18.useComponents)();
|
|
2290
|
+
const hasRemoveButtons = removeButtons.length > 0;
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2292
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex md:max-w-96 sm:items-end gap-3 flex-col sm:flex-row", children: [
|
|
2293
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2294
|
+
Node.Label,
|
|
2295
|
+
{
|
|
2296
|
+
node: nameInput,
|
|
2297
|
+
attributes: nameInput.attributes,
|
|
2298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2299
|
+
Node.Input,
|
|
2300
|
+
{
|
|
2301
|
+
node: nameInput,
|
|
2302
|
+
attributes: nameInput.attributes
|
|
2303
|
+
}
|
|
2304
|
+
)
|
|
2305
|
+
}
|
|
2306
|
+
) }),
|
|
2307
|
+
triggerButton ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2308
|
+
Node.Button,
|
|
2309
|
+
{
|
|
2310
|
+
node: triggerButton,
|
|
2311
|
+
attributes: triggerButton.attributes,
|
|
2312
|
+
onClick: triggerButton.onClick
|
|
2313
|
+
}
|
|
2314
|
+
) : null
|
|
2315
|
+
] }),
|
|
2316
|
+
hasRemoveButtons ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Card.Divider, {}),
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex flex-col gap-4", children: removeButtons.map((node, i) => {
|
|
2319
|
+
var _a, _b;
|
|
2320
|
+
const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
|
|
2321
|
+
const addedAt = "added_at" in context ? context.added_at : null;
|
|
2322
|
+
const displayName = "display_name" in context ? context.display_name : null;
|
|
2323
|
+
const keyId = "value" in node.attributes ? node.attributes.value : null;
|
|
2324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
2325
|
+
"div",
|
|
2326
|
+
{
|
|
2327
|
+
className: "flex justify-between gap-6 md:items-center",
|
|
2328
|
+
children: [
|
|
2329
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex gap-2 items-center flex-1", children: [
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2331
|
+
key_default,
|
|
2332
|
+
{
|
|
2333
|
+
size: 32,
|
|
2334
|
+
className: "text-interface-foreground-default-primary"
|
|
2335
|
+
}
|
|
2336
|
+
),
|
|
2337
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4", children: [
|
|
2338
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-1 flex-col", children: [
|
|
2339
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary", children: displayName }),
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block", children: keyId })
|
|
2341
|
+
] }),
|
|
2342
|
+
addedAt && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
|
|
2343
|
+
dateStyle: "long"
|
|
2344
|
+
}).format(new Date(addedAt)) })
|
|
2345
|
+
] })
|
|
2346
|
+
] }),
|
|
2347
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2348
|
+
"button",
|
|
2349
|
+
{
|
|
2350
|
+
...node.attributes,
|
|
2351
|
+
type: "submit",
|
|
2352
|
+
onClick: node.onClick,
|
|
2353
|
+
disabled: isSubmitting,
|
|
2354
|
+
className: "relative",
|
|
2355
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2356
|
+
trash_default,
|
|
2357
|
+
{
|
|
2358
|
+
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
2359
|
+
size: 24
|
|
2360
|
+
}
|
|
2361
|
+
)
|
|
2362
|
+
}
|
|
2363
|
+
)
|
|
2364
|
+
]
|
|
2365
|
+
},
|
|
2366
|
+
`webauthn-remove-button-${i}`
|
|
2367
|
+
);
|
|
2368
|
+
}) })
|
|
2369
|
+
] }) : null
|
|
2370
|
+
] });
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
// src/theme/default/components/card/auth-method-list-container.tsx
|
|
2374
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2375
|
+
function DefaultAuthMethodListContainer({
|
|
2376
|
+
children
|
|
2377
|
+
}) {
|
|
2378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "grid grid-cols-1 gap-2", children });
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
// src/theme/default/components/default-components.tsx
|
|
2382
|
+
function getOryComponents(overrides) {
|
|
2383
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha;
|
|
2384
|
+
return {
|
|
2385
|
+
Card: {
|
|
2386
|
+
Root: (_b = (_a = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _a.Root) != null ? _b : DefaultCard,
|
|
2387
|
+
Footer: (_d = (_c = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _c.Footer) != null ? _d : DefaultCardFooter,
|
|
2388
|
+
Header: (_f = (_e = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _e.Header) != null ? _f : DefaultCardHeader,
|
|
2389
|
+
Content: (_h = (_g = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _g.Content) != null ? _h : DefaultCardContent,
|
|
2390
|
+
Logo: (_j = (_i = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _i.Logo) != null ? _j : DefaultCardLogo,
|
|
2391
|
+
Divider: (_l = (_k = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _k.Divider) != null ? _l : DefaultHorizontalDivider,
|
|
2392
|
+
AuthMethodListContainer: (_n = (_m = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _m.AuthMethodListContainer) != null ? _n : DefaultAuthMethodListContainer,
|
|
2393
|
+
AuthMethodListItem: (_p = (_o = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _o.AuthMethodListItem) != null ? _p : DefaultAuthMethodListItem,
|
|
2394
|
+
SettingsSection: (_r = (_q = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _q.SettingsSection) != null ? _r : DefaultFormSection,
|
|
2395
|
+
SettingsSectionContent: (_t = (_s = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _s.SettingsSectionContent) != null ? _t : DefaultFormSectionContent,
|
|
2396
|
+
SettingsSectionFooter: (_v = (_u = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _u.SettingsSectionFooter) != null ? _v : DefaultFormSectionFooter
|
|
2397
|
+
},
|
|
2398
|
+
Node: {
|
|
2399
|
+
Button: (_x = (_w = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _w.Button) != null ? _x : DefaultButton,
|
|
2400
|
+
OidcButton: (_z = (_y = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _y.OidcButton) != null ? _z : DefaultButtonSocial,
|
|
2401
|
+
Input: (_B = (_A = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _A.Input) != null ? _B : DefaultInput,
|
|
2402
|
+
CodeInput: (_D = (_C = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _C.CodeInput) != null ? _D : DefaultPinCodeInput,
|
|
2403
|
+
Image: (_F = (_E = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _E.Image) != null ? _F : DefaultImage,
|
|
2404
|
+
Label: (_H = (_G = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _G.Label) != null ? _H : DefaultLabel,
|
|
2405
|
+
Checkbox: (_J = (_I = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _I.Checkbox) != null ? _J : DefaultCheckbox,
|
|
2406
|
+
Text: (_L = (_K = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _K.Text) != null ? _L : DefaultText,
|
|
2407
|
+
Anchor: (_N = (_M = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _M.Anchor) != null ? _N : DefaultLinkButton
|
|
2408
|
+
},
|
|
2409
|
+
Form: {
|
|
2410
|
+
Root: (_P = (_O = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _O.Root) != null ? _P : DefaultFormContainer,
|
|
2411
|
+
Group: (_R = (_Q = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _Q.Group) != null ? _R : DefaultGroupContainer,
|
|
2412
|
+
OidcRoot: (_T = (_S = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _S.OidcRoot) != null ? _T : DefaultSocialButtonContainer,
|
|
2413
|
+
RecoveryCodesSettings: (_V = (_U = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _U.RecoveryCodesSettings) != null ? _V : DefaultSettingsRecoveryCodes,
|
|
2414
|
+
TotpSettings: (_X = (_W = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _W.TotpSettings) != null ? _X : DefaultSettingsTotp,
|
|
2415
|
+
OidcSettings: (_Z = (_Y = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _Y.OidcSettings) != null ? _Z : DefaultSettingsOidc,
|
|
2416
|
+
WebauthnSettings: (_$ = (__ = overrides == null ? void 0 : overrides.Form) == null ? void 0 : __.WebauthnSettings) != null ? _$ : DefaultSettingsWebauthn,
|
|
2417
|
+
PasskeySettings: (_ba = (_aa = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _aa.PasskeySettings) != null ? _ba : DefaultSettingsPasskey
|
|
2418
|
+
},
|
|
2419
|
+
Message: {
|
|
2420
|
+
Root: (_da = (_ca = overrides == null ? void 0 : overrides.Message) == null ? void 0 : _ca.Root) != null ? _da : DefaultMessageContainer,
|
|
2421
|
+
Content: (_fa = (_ea = overrides == null ? void 0 : overrides.Message) == null ? void 0 : _ea.Content) != null ? _fa : DefaultMessage
|
|
2422
|
+
},
|
|
2423
|
+
Page: {
|
|
2424
|
+
Header: (_ha = (_ga = overrides == null ? void 0 : overrides.Page) == null ? void 0 : _ga.Header) != null ? _ha : DefaultPageHeader
|
|
2425
|
+
}
|
|
2426
|
+
};
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
// src/theme/default/flows/error.tsx
|
|
2430
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2431
|
+
function Error2({
|
|
2432
|
+
error,
|
|
2433
|
+
children
|
|
2434
|
+
}) {
|
|
2435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { "data-testid": "ory/screen/error/raw", children: JSON.stringify(error) || children });
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
// src/theme/default/flows/login.tsx
|
|
2439
|
+
var import_client_fetch12 = require("@ory/client-fetch");
|
|
2440
|
+
var import_elements_react19 = require("@ory/elements-react");
|
|
2441
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2442
|
+
function Login({
|
|
2443
|
+
flow,
|
|
2444
|
+
config,
|
|
2445
|
+
children,
|
|
2446
|
+
components: flowOverrideComponents
|
|
2447
|
+
}) {
|
|
2448
|
+
const components = getOryComponents(flowOverrideComponents);
|
|
2449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2450
|
+
import_elements_react19.OryProvider,
|
|
2451
|
+
{
|
|
2452
|
+
config,
|
|
2453
|
+
flow,
|
|
2454
|
+
flowType: import_client_fetch12.FlowType.Login,
|
|
2455
|
+
components,
|
|
2456
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_elements_react19.OryTwoStepCard, {})
|
|
2457
|
+
}
|
|
2458
|
+
);
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
// src/theme/default/flows/recovery.tsx
|
|
2462
|
+
var import_client_fetch13 = require("@ory/client-fetch");
|
|
2463
|
+
var import_elements_react20 = require("@ory/elements-react");
|
|
2464
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
2465
|
+
function Recovery({
|
|
2466
|
+
flow,
|
|
2467
|
+
config,
|
|
2468
|
+
children,
|
|
2469
|
+
components: flowOverrideComponents
|
|
2470
|
+
}) {
|
|
2471
|
+
const components = getOryComponents(flowOverrideComponents);
|
|
2472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2473
|
+
import_elements_react20.OryProvider,
|
|
2474
|
+
{
|
|
2475
|
+
config,
|
|
2476
|
+
flow,
|
|
2477
|
+
flowType: import_client_fetch13.FlowType.Recovery,
|
|
2478
|
+
components,
|
|
2479
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_elements_react20.OryTwoStepCard, {})
|
|
2480
|
+
}
|
|
2481
|
+
);
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
// src/theme/default/flows/registration.tsx
|
|
2485
|
+
var import_client_fetch14 = require("@ory/client-fetch");
|
|
2486
|
+
var import_elements_react21 = require("@ory/elements-react");
|
|
2487
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2488
|
+
function Registration({
|
|
2489
|
+
flow,
|
|
2490
|
+
children,
|
|
2491
|
+
components: flowOverrideComponents,
|
|
2492
|
+
config
|
|
2493
|
+
}) {
|
|
2494
|
+
const components = getOryComponents(flowOverrideComponents);
|
|
2495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2496
|
+
import_elements_react21.OryProvider,
|
|
2497
|
+
{
|
|
2498
|
+
config,
|
|
2499
|
+
flow,
|
|
2500
|
+
flowType: import_client_fetch14.FlowType.Registration,
|
|
2501
|
+
components,
|
|
2502
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_elements_react21.OryTwoStepCard, {})
|
|
2503
|
+
}
|
|
2504
|
+
);
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
// src/theme/default/flows/settings.tsx
|
|
2508
|
+
var import_client_fetch15 = require("@ory/client-fetch");
|
|
2509
|
+
var import_elements_react22 = require("@ory/elements-react");
|
|
2510
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
2511
|
+
function Settings({
|
|
2512
|
+
flow,
|
|
2513
|
+
config,
|
|
2514
|
+
children,
|
|
2515
|
+
components: flowOverrideComponents
|
|
2516
|
+
}) {
|
|
2517
|
+
const components = getOryComponents(flowOverrideComponents);
|
|
2518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
2519
|
+
import_elements_react22.OryProvider,
|
|
2520
|
+
{
|
|
2521
|
+
config,
|
|
2522
|
+
flow,
|
|
2523
|
+
flowType: import_client_fetch15.FlowType.Settings,
|
|
2524
|
+
components,
|
|
2525
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
2526
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_elements_react22.HeadlessPageHeader, {}),
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_elements_react22.OrySettingsCard, {})
|
|
2528
|
+
] })
|
|
2529
|
+
}
|
|
2530
|
+
);
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
// src/theme/default/flows/verification.tsx
|
|
2534
|
+
var import_client_fetch16 = require("@ory/client-fetch");
|
|
2535
|
+
var import_elements_react23 = require("@ory/elements-react");
|
|
2536
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
2537
|
+
function Verification({
|
|
2538
|
+
flow,
|
|
2539
|
+
config,
|
|
2540
|
+
children,
|
|
2541
|
+
components: flowOverrideComponents
|
|
2542
|
+
}) {
|
|
2543
|
+
const components = getOryComponents(flowOverrideComponents);
|
|
2544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2545
|
+
import_elements_react23.OryProvider,
|
|
2546
|
+
{
|
|
2547
|
+
config,
|
|
2548
|
+
flow,
|
|
2549
|
+
flowType: import_client_fetch16.FlowType.Verification,
|
|
2550
|
+
components,
|
|
2551
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_elements_react23.OryTwoStepCard, {})
|
|
2552
|
+
}
|
|
2553
|
+
);
|
|
2554
|
+
}
|
|
2555
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2556
|
+
0 && (module.exports = {
|
|
2557
|
+
DefaultButtonSocial,
|
|
2558
|
+
DefaultCard,
|
|
2559
|
+
DefaultCardContent,
|
|
2560
|
+
DefaultCardFooter,
|
|
2561
|
+
DefaultCardHeader,
|
|
2562
|
+
DefaultCardLayout,
|
|
2563
|
+
DefaultCardLogo,
|
|
2564
|
+
DefaultCurrentIdentifierButton,
|
|
2565
|
+
DefaultFormContainer,
|
|
2566
|
+
DefaultMessage,
|
|
2567
|
+
DefaultMessageContainer,
|
|
2568
|
+
Error,
|
|
2569
|
+
Login,
|
|
2570
|
+
Recovery,
|
|
2571
|
+
Registration,
|
|
2572
|
+
Settings,
|
|
2573
|
+
Verification,
|
|
2574
|
+
getOryComponents
|
|
2575
|
+
});
|
|
2576
|
+
//# sourceMappingURL=index.js.map
|