@ory/elements-react 1.0.0-next.32 → 1.0.0-next.34
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 +25 -0
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -4
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.css +9 -0
- package/dist/theme/default/index.css.map +1 -1
- package/dist/theme/default/index.js +320 -544
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +323 -594
- package/dist/theme/default/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -154,13 +154,6 @@ var ComponentContext = (0, import_react.createContext)({
|
|
|
154
154
|
nodeSorter: () => 0,
|
|
155
155
|
groupSorter: () => 0
|
|
156
156
|
});
|
|
157
|
-
function useComponents() {
|
|
158
|
-
const ctx = (0, import_react.useContext)(ComponentContext);
|
|
159
|
-
if (!ctx) {
|
|
160
|
-
throw new Error("useComponents must be used within a ComponentProvider");
|
|
161
|
-
}
|
|
162
|
-
return ctx.components;
|
|
163
|
-
}
|
|
164
157
|
var defaultGroupOrder = [
|
|
165
158
|
import_client_fetch.UiNodeGroupEnum.Default,
|
|
166
159
|
import_client_fetch.UiNodeGroupEnum.Profile,
|
|
@@ -174,54 +167,6 @@ var defaultGroupOrder = [
|
|
|
174
167
|
];
|
|
175
168
|
|
|
176
169
|
// src/util/ui/index.ts
|
|
177
|
-
function triggerToWindowCall(trigger) {
|
|
178
|
-
if (!trigger) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
const fn = triggerToFunction(trigger);
|
|
182
|
-
if (fn) {
|
|
183
|
-
fn();
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
let i = 0;
|
|
187
|
-
const ms = 100;
|
|
188
|
-
const interval = setInterval(() => {
|
|
189
|
-
i++;
|
|
190
|
-
if (i > 100) {
|
|
191
|
-
clearInterval(interval);
|
|
192
|
-
throw new Error(
|
|
193
|
-
"Unable to load Ory's WebAuthn script. Is it being blocked or otherwise failing to load? If you are running an old version of Ory Elements, please upgrade. For more information, please check your browser's developer console."
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
const fn2 = triggerToFunction(trigger);
|
|
197
|
-
if (fn2) {
|
|
198
|
-
clearInterval(interval);
|
|
199
|
-
return fn2();
|
|
200
|
-
}
|
|
201
|
-
}, ms);
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
function triggerToFunction(trigger) {
|
|
205
|
-
if (typeof window === "undefined") {
|
|
206
|
-
console.debug(
|
|
207
|
-
"The Ory SDK is missing a required function: window is undefined."
|
|
208
|
-
);
|
|
209
|
-
return void 0;
|
|
210
|
-
}
|
|
211
|
-
const typedWindow = window;
|
|
212
|
-
if (!(trigger in typedWindow) || !typedWindow[trigger]) {
|
|
213
|
-
console.debug(`The Ory SDK is missing a required function: ${trigger}.`);
|
|
214
|
-
return void 0;
|
|
215
|
-
}
|
|
216
|
-
const triggerFn = typedWindow[trigger];
|
|
217
|
-
if (typeof triggerFn !== "function") {
|
|
218
|
-
console.debug(
|
|
219
|
-
`The Ory SDK is missing a required function: ${trigger}. It is not a function.`
|
|
220
|
-
);
|
|
221
|
-
return void 0;
|
|
222
|
-
}
|
|
223
|
-
return triggerFn;
|
|
224
|
-
}
|
|
225
170
|
function nodesToAuthMethodGroups(nodes, excludeAuthMethods = []) {
|
|
226
171
|
var _a;
|
|
227
172
|
const groups = {};
|
|
@@ -1554,9 +1499,33 @@ function DefaultImage({ attributes }) {
|
|
|
1554
1499
|
// src/theme/default/components/form/input.tsx
|
|
1555
1500
|
var import_client_fetch9 = require("@ory/client-fetch");
|
|
1556
1501
|
var import_elements_react9 = require("@ory/elements-react");
|
|
1502
|
+
var import_react5 = require("react");
|
|
1557
1503
|
var import_react_hook_form5 = require("react-hook-form");
|
|
1558
1504
|
var import_react_intl9 = require("react-intl");
|
|
1505
|
+
|
|
1506
|
+
// src/theme/default/assets/icons/eye-off.svg
|
|
1507
|
+
var React24 = __toESM(require("react"));
|
|
1559
1508
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1509
|
+
var SvgEyeOff = (props) => {
|
|
1510
|
+
var _a, _b;
|
|
1511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.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_runtime42.jsx)("path", { stroke: "#000", strokeLinecap: "round", strokeLinejoin: "round", d: "M10.585 10.587a2 2 0 0 0 2.829 2.828m3.267 3.258A8.7 8.7 0 0 1 12 18q-5.4 0-9-6 1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6-1 1.665-2.138 2.87M3 3l18 18" }) });
|
|
1512
|
+
};
|
|
1513
|
+
var eye_off_default = SvgEyeOff;
|
|
1514
|
+
|
|
1515
|
+
// src/theme/default/assets/icons/eye.svg
|
|
1516
|
+
var React25 = __toESM(require("react"));
|
|
1517
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1518
|
+
var SvgEye = (props) => {
|
|
1519
|
+
var _a, _b;
|
|
1520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.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_runtime43.jsxs)("g", { strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1521
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { stroke: "currentColor", d: "M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0" }),
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { stroke: "#64748B", d: "M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6" })
|
|
1523
|
+
] }) });
|
|
1524
|
+
};
|
|
1525
|
+
var eye_default = SvgEye;
|
|
1526
|
+
|
|
1527
|
+
// src/theme/default/components/form/input.tsx
|
|
1528
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1560
1529
|
var DefaultInput = ({
|
|
1561
1530
|
node,
|
|
1562
1531
|
attributes,
|
|
@@ -1574,6 +1543,7 @@ var DefaultInput = ({
|
|
|
1574
1543
|
} = attributes;
|
|
1575
1544
|
const intl = (0, import_react_intl9.useIntl)();
|
|
1576
1545
|
const { flowType } = (0, import_elements_react9.useOryFlow)();
|
|
1546
|
+
const inputRef = (0, import_react5.useRef)(null);
|
|
1577
1547
|
const formattedLabel = label ? intl.formatMessage(
|
|
1578
1548
|
{
|
|
1579
1549
|
id: "input.placeholder",
|
|
@@ -1583,36 +1553,86 @@ var DefaultInput = ({
|
|
|
1583
1553
|
placeholder: (0, import_elements_react9.uiTextToFormattedMessage)(label, intl)
|
|
1584
1554
|
}
|
|
1585
1555
|
) : "";
|
|
1586
|
-
|
|
1587
|
-
|
|
1556
|
+
if (rest.type === "hidden") {
|
|
1557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1558
|
+
"input",
|
|
1559
|
+
{
|
|
1560
|
+
...rest,
|
|
1561
|
+
onClick,
|
|
1562
|
+
maxLength: maxlength,
|
|
1563
|
+
autoComplete: autocomplete,
|
|
1564
|
+
placeholder: formattedLabel,
|
|
1565
|
+
"data-testid": `ory/form/node/input/${name}`,
|
|
1566
|
+
...register(name, { value })
|
|
1567
|
+
}
|
|
1568
|
+
);
|
|
1569
|
+
}
|
|
1570
|
+
const { ref, ...restRegister } = register(name, { value });
|
|
1571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
1572
|
+
"div",
|
|
1588
1573
|
{
|
|
1589
|
-
...rest,
|
|
1590
|
-
onClick,
|
|
1591
|
-
maxLength: maxlength,
|
|
1592
|
-
autoComplete: autocomplete,
|
|
1593
|
-
placeholder: formattedLabel,
|
|
1594
|
-
"data-testid": `ory/form/node/input/${name}`,
|
|
1595
1574
|
className: cn(
|
|
1596
|
-
"
|
|
1597
|
-
"bg-input-background-default border-input-border-default text-input-foreground-primary",
|
|
1598
|
-
"disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled",
|
|
1599
|
-
"focus:border-input-border-focus focus-visible:border-input-border-focus",
|
|
1600
|
-
"hover:bg-input-background-hover hover:border-input-border-hover",
|
|
1601
|
-
"px-4 py-[13px]",
|
|
1575
|
+
"relative flex justify-stretch",
|
|
1602
1576
|
// The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
|
|
1603
1577
|
flowType === import_client_fetch9.FlowType.Settings && "max-w-[488px]"
|
|
1604
1578
|
),
|
|
1605
|
-
|
|
1579
|
+
children: [
|
|
1580
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1581
|
+
"input",
|
|
1582
|
+
{
|
|
1583
|
+
...rest,
|
|
1584
|
+
onClick,
|
|
1585
|
+
maxLength: maxlength,
|
|
1586
|
+
autoComplete: autocomplete,
|
|
1587
|
+
placeholder: formattedLabel,
|
|
1588
|
+
"data-testid": `ory/form/node/input/${name}`,
|
|
1589
|
+
className: cn(
|
|
1590
|
+
"antialiased rounded-forms border leading-tight transition-colors placeholder:h-[20px] placeholder:text-input-foreground-tertiary focus-visible:outline-none focus:ring-0 w-full",
|
|
1591
|
+
"bg-input-background-default border-input-border-default text-input-foreground-primary",
|
|
1592
|
+
"disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled",
|
|
1593
|
+
"focus:border-input-border-focus focus-visible:border-input-border-focus",
|
|
1594
|
+
"hover:bg-input-background-hover hover:border-input-border-hover",
|
|
1595
|
+
"px-4 py-[13px]"
|
|
1596
|
+
),
|
|
1597
|
+
ref: (e) => {
|
|
1598
|
+
inputRef.current = e;
|
|
1599
|
+
ref(e);
|
|
1600
|
+
},
|
|
1601
|
+
...restRegister
|
|
1602
|
+
}
|
|
1603
|
+
),
|
|
1604
|
+
rest.type === "password" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PasswordToggle, { inputRef })
|
|
1605
|
+
]
|
|
1606
1606
|
}
|
|
1607
1607
|
);
|
|
1608
1608
|
};
|
|
1609
|
+
function PasswordToggle({
|
|
1610
|
+
inputRef
|
|
1611
|
+
}) {
|
|
1612
|
+
const [shown, setShown] = (0, import_react5.useState)(false);
|
|
1613
|
+
const handleClick = () => {
|
|
1614
|
+
setShown(!shown);
|
|
1615
|
+
if (inputRef.current) {
|
|
1616
|
+
inputRef.current.type = shown ? "password" : "text";
|
|
1617
|
+
}
|
|
1618
|
+
};
|
|
1619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1620
|
+
"button",
|
|
1621
|
+
{
|
|
1622
|
+
onClick: handleClick,
|
|
1623
|
+
className: "absolute right-0 h-full w-12 flex items-center justify-center",
|
|
1624
|
+
type: "button",
|
|
1625
|
+
children: shown ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(eye_off_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(eye_default, {})
|
|
1626
|
+
}
|
|
1627
|
+
);
|
|
1628
|
+
}
|
|
1609
1629
|
|
|
1610
1630
|
// src/theme/default/components/form/label.tsx
|
|
1611
1631
|
var import_client_fetch10 = require("@ory/client-fetch");
|
|
1612
1632
|
var import_elements_react10 = require("@ory/elements-react");
|
|
1613
1633
|
var import_react_hook_form6 = require("react-hook-form");
|
|
1614
1634
|
var import_react_intl10 = require("react-intl");
|
|
1615
|
-
var
|
|
1635
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1616
1636
|
function findResendNode(nodes) {
|
|
1617
1637
|
return nodes.find(
|
|
1618
1638
|
(n) => "name" in n.attributes && (n.attributes.name === "email" && n.attributes.type === "submit" || n.attributes.name === "resend")
|
|
@@ -1637,9 +1657,9 @@ function DefaultLabel({
|
|
|
1637
1657
|
}
|
|
1638
1658
|
};
|
|
1639
1659
|
const fieldError = formState.errors[attributes.name];
|
|
1640
|
-
return /* @__PURE__ */ (0,
|
|
1641
|
-
label && /* @__PURE__ */ (0,
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1 antialiased", children: [
|
|
1661
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "inline-flex justify-between", children: [
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1643
1663
|
"label",
|
|
1644
1664
|
{
|
|
1645
1665
|
...(0, import_elements_react10.messageTestId)(label),
|
|
@@ -1651,7 +1671,7 @@ function DefaultLabel({
|
|
|
1651
1671
|
}
|
|
1652
1672
|
),
|
|
1653
1673
|
isPassword && config.project.recovery_enabled && flowType === import_client_fetch10.FlowType.Login && // TODO: make it possible to override with a custom component
|
|
1654
|
-
/* @__PURE__ */ (0,
|
|
1674
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1655
1675
|
"a",
|
|
1656
1676
|
{
|
|
1657
1677
|
href: initFlowUrl(config.sdk.url, "recovery", flow),
|
|
@@ -1662,7 +1682,7 @@ function DefaultLabel({
|
|
|
1662
1682
|
})
|
|
1663
1683
|
}
|
|
1664
1684
|
),
|
|
1665
|
-
(resendNode == null ? void 0 : resendNode.attributes.node_type) === "input" && /* @__PURE__ */ (0,
|
|
1685
|
+
(resendNode == null ? void 0 : resendNode.attributes.node_type) === "input" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1666
1686
|
"button",
|
|
1667
1687
|
{
|
|
1668
1688
|
type: "submit",
|
|
@@ -1675,21 +1695,21 @@ function DefaultLabel({
|
|
|
1675
1695
|
)
|
|
1676
1696
|
] }),
|
|
1677
1697
|
children,
|
|
1678
|
-
node.messages.map((message) => /* @__PURE__ */ (0,
|
|
1679
|
-
fieldError && (0, import_client_fetch10.instanceOfUiText)(fieldError) && /* @__PURE__ */ (0,
|
|
1698
|
+
node.messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Message.Content, { message }, message.id)),
|
|
1699
|
+
fieldError && (0, import_client_fetch10.instanceOfUiText)(fieldError) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Message.Content, { message: fieldError })
|
|
1680
1700
|
] });
|
|
1681
1701
|
}
|
|
1682
1702
|
|
|
1683
1703
|
// src/theme/default/components/form/link-button.tsx
|
|
1684
1704
|
var import_client_fetch11 = require("@ory/client-fetch");
|
|
1685
1705
|
var import_elements_react11 = require("@ory/elements-react");
|
|
1686
|
-
var
|
|
1706
|
+
var import_react6 = require("react");
|
|
1687
1707
|
var import_react_intl11 = require("react-intl");
|
|
1688
|
-
var
|
|
1689
|
-
var DefaultLinkButton = (0,
|
|
1708
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1709
|
+
var DefaultLinkButton = (0, import_react6.forwardRef)(({ attributes, node }, ref) => {
|
|
1690
1710
|
const intl = (0, import_react_intl11.useIntl)();
|
|
1691
1711
|
const label = (0, import_client_fetch11.getNodeLabel)(node);
|
|
1692
|
-
return /* @__PURE__ */ (0,
|
|
1712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
1693
1713
|
"a",
|
|
1694
1714
|
{
|
|
1695
1715
|
...attributes,
|
|
@@ -1710,9 +1730,9 @@ var import_react_hook_form7 = require("react-hook-form");
|
|
|
1710
1730
|
|
|
1711
1731
|
// src/theme/default/components/form/shadcn/otp-input.tsx
|
|
1712
1732
|
var import_input_otp = require("input-otp");
|
|
1713
|
-
var
|
|
1714
|
-
var
|
|
1715
|
-
var InputOTP =
|
|
1733
|
+
var React26 = __toESM(require("react"));
|
|
1734
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1735
|
+
var InputOTP = React26.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
1716
1736
|
import_input_otp.OTPInput,
|
|
1717
1737
|
{
|
|
1718
1738
|
ref,
|
|
@@ -1725,12 +1745,12 @@ var InputOTP = React24.forwardRef(({ className, containerClassName, ...props },
|
|
|
1725
1745
|
}
|
|
1726
1746
|
));
|
|
1727
1747
|
InputOTP.displayName = "InputOTP";
|
|
1728
|
-
var InputOTPGroup =
|
|
1748
|
+
var InputOTPGroup = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
1729
1749
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1730
|
-
var InputOTPSlot =
|
|
1731
|
-
const inputOTPContext =
|
|
1750
|
+
var InputOTPSlot = React26.forwardRef(({ index, className, ...props }, ref) => {
|
|
1751
|
+
const inputOTPContext = React26.useContext(import_input_otp.OTPInputContext);
|
|
1732
1752
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
1733
|
-
return /* @__PURE__ */ (0,
|
|
1753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
1734
1754
|
"div",
|
|
1735
1755
|
{
|
|
1736
1756
|
ref,
|
|
@@ -1742,8 +1762,8 @@ var InputOTPSlot = React24.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
1742
1762
|
),
|
|
1743
1763
|
...props,
|
|
1744
1764
|
children: [
|
|
1745
|
-
/* @__PURE__ */ (0,
|
|
1746
|
-
hasFakeCaret && /* @__PURE__ */ (0,
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "inline-block size-4", children: char }),
|
|
1766
|
+
hasFakeCaret && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "h-4 w-px animate-caret-blink bg-interface-background-brand-primary duration-700" }) })
|
|
1747
1767
|
]
|
|
1748
1768
|
}
|
|
1749
1769
|
);
|
|
@@ -1753,7 +1773,7 @@ InputOTPSlot.displayName = "InputOTPSlot";
|
|
|
1753
1773
|
// src/theme/default/components/form/pin-code-input.tsx
|
|
1754
1774
|
var import_elements_react12 = require("@ory/elements-react");
|
|
1755
1775
|
var import_client_fetch12 = require("@ory/client-fetch");
|
|
1756
|
-
var
|
|
1776
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1757
1777
|
var DefaultPinCodeInput = ({ attributes }) => {
|
|
1758
1778
|
const { setValue, watch } = (0, import_react_hook_form7.useFormContext)();
|
|
1759
1779
|
const { maxlength, name } = attributes;
|
|
@@ -1763,14 +1783,14 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1763
1783
|
setValue(name, v);
|
|
1764
1784
|
};
|
|
1765
1785
|
const value = watch(name);
|
|
1766
|
-
return /* @__PURE__ */ (0,
|
|
1786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1767
1787
|
InputOTP,
|
|
1768
1788
|
{
|
|
1769
1789
|
maxLength: maxlength != null ? maxlength : 6,
|
|
1770
1790
|
onChange: handleInputChange,
|
|
1771
1791
|
name,
|
|
1772
1792
|
value,
|
|
1773
|
-
children: /* @__PURE__ */ (0,
|
|
1793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1774
1794
|
InputOTPGroup,
|
|
1775
1795
|
{
|
|
1776
1796
|
className: cn(
|
|
@@ -1778,7 +1798,7 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1778
1798
|
// The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
|
|
1779
1799
|
flowType === import_client_fetch12.FlowType.Settings && "max-w-[488px]"
|
|
1780
1800
|
),
|
|
1781
|
-
children: [...Array(elements)].map((_, index) => /* @__PURE__ */ (0,
|
|
1801
|
+
children: [...Array(elements)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InputOTPSlot, { index }, index))
|
|
1782
1802
|
}
|
|
1783
1803
|
)
|
|
1784
1804
|
}
|
|
@@ -1786,13 +1806,13 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1786
1806
|
};
|
|
1787
1807
|
|
|
1788
1808
|
// src/theme/default/components/form/section.tsx
|
|
1789
|
-
var
|
|
1809
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
1790
1810
|
var DefaultFormSection = ({
|
|
1791
1811
|
children,
|
|
1792
1812
|
nodes: _nodes,
|
|
1793
1813
|
...rest
|
|
1794
1814
|
}) => {
|
|
1795
|
-
return /* @__PURE__ */ (0,
|
|
1815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
1796
1816
|
"form",
|
|
1797
1817
|
{
|
|
1798
1818
|
className: "flex w-full max-w-screen-sm flex-col md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] px-4",
|
|
@@ -1806,10 +1826,10 @@ var DefaultFormSectionContent = ({
|
|
|
1806
1826
|
description,
|
|
1807
1827
|
children
|
|
1808
1828
|
}) => {
|
|
1809
|
-
return /* @__PURE__ */ (0,
|
|
1810
|
-
/* @__PURE__ */ (0,
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.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: [
|
|
1830
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
1831
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h3", { className: "font-medium text-interface-foreground-default-primary", children: title }),
|
|
1832
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-interface-foreground-default-secondary", children: description })
|
|
1813
1833
|
] }),
|
|
1814
1834
|
children
|
|
1815
1835
|
] });
|
|
@@ -1818,14 +1838,14 @@ var DefaultFormSectionFooter = ({
|
|
|
1818
1838
|
children,
|
|
1819
1839
|
text
|
|
1820
1840
|
}) => {
|
|
1821
|
-
return /* @__PURE__ */ (0,
|
|
1841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
1822
1842
|
"div",
|
|
1823
1843
|
{
|
|
1824
1844
|
className: cn(
|
|
1825
1845
|
"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"
|
|
1826
1846
|
),
|
|
1827
1847
|
children: [
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: text }),
|
|
1829
1849
|
children
|
|
1830
1850
|
]
|
|
1831
1851
|
}
|
|
@@ -1835,31 +1855,31 @@ var DefaultFormSectionFooter = ({
|
|
|
1835
1855
|
// src/theme/default/components/form/text.tsx
|
|
1836
1856
|
var import_elements_react13 = require("@ory/elements-react");
|
|
1837
1857
|
var import_react_intl12 = require("react-intl");
|
|
1838
|
-
var
|
|
1858
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1839
1859
|
function DefaultText({ node, attributes }) {
|
|
1840
1860
|
var _a;
|
|
1841
1861
|
const intl = (0, import_react_intl12.useIntl)();
|
|
1842
1862
|
const lookup = (_a = attributes.text.context) == null ? void 0 : _a.secrets;
|
|
1843
1863
|
if (lookup) {
|
|
1844
|
-
return /* @__PURE__ */ (0,
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1846
|
-
lookup.map((text, index) => /* @__PURE__ */ (0,
|
|
1864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
1865
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { "data-testid": `ory/form/node/text/${attributes.id}/label`, children: node.meta.label ? (0, import_elements_react13.uiTextToFormattedMessage)(node.meta.label, intl) : "" }),
|
|
1866
|
+
lookup.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
1847
1867
|
"pre",
|
|
1848
1868
|
{
|
|
1849
1869
|
"data-testid": `ory/form/node/text/lookup_secret_codes/text`,
|
|
1850
|
-
children: /* @__PURE__ */ (0,
|
|
1870
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("code", { children: text ? (0, import_elements_react13.uiTextToFormattedMessage)(text, intl) : "" })
|
|
1851
1871
|
},
|
|
1852
1872
|
index
|
|
1853
1873
|
))
|
|
1854
1874
|
] });
|
|
1855
1875
|
}
|
|
1856
|
-
return /* @__PURE__ */ (0,
|
|
1876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
1857
1877
|
"p",
|
|
1858
1878
|
{
|
|
1859
1879
|
"data-testid": `ory/form/node/text/${attributes.id}/label`,
|
|
1860
1880
|
id: attributes.id,
|
|
1861
1881
|
children: [
|
|
1862
|
-
node.meta.label ? /* @__PURE__ */ (0,
|
|
1882
|
+
node.meta.label ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("label", { children: (0, import_elements_react13.uiTextToFormattedMessage)(node.meta.label, intl) }) : null,
|
|
1863
1883
|
attributes.text ? (0, import_elements_react13.uiTextToFormattedMessage)(attributes.text, intl) : ""
|
|
1864
1884
|
]
|
|
1865
1885
|
}
|
|
@@ -1871,7 +1891,7 @@ var import_elements_react15 = require("@ory/elements-react");
|
|
|
1871
1891
|
|
|
1872
1892
|
// src/theme/default/components/ui/user-menu.tsx
|
|
1873
1893
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
1874
|
-
var
|
|
1894
|
+
var import_react9 = require("react");
|
|
1875
1895
|
var import_elements_react14 = require("@ory/elements-react");
|
|
1876
1896
|
|
|
1877
1897
|
// src/util/client.ts
|
|
@@ -1889,22 +1909,22 @@ function frontendClient(sdkUrl, opts = {}) {
|
|
|
1889
1909
|
}
|
|
1890
1910
|
|
|
1891
1911
|
// src/theme/default/assets/icons/logout.svg
|
|
1892
|
-
var
|
|
1893
|
-
var
|
|
1912
|
+
var React27 = __toESM(require("react"));
|
|
1913
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
1894
1914
|
var SvgLogout = (props) => {
|
|
1895
1915
|
var _a, _b;
|
|
1896
|
-
return /* @__PURE__ */ (0,
|
|
1916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.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_runtime51.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" }) });
|
|
1897
1917
|
};
|
|
1898
1918
|
var logout_default = SvgLogout;
|
|
1899
1919
|
|
|
1900
1920
|
// src/theme/default/assets/icons/settings.svg
|
|
1901
|
-
var
|
|
1902
|
-
var
|
|
1921
|
+
var React28 = __toESM(require("react"));
|
|
1922
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
1903
1923
|
var SvgSettings = (props) => {
|
|
1904
1924
|
var _a, _b;
|
|
1905
|
-
return /* @__PURE__ */ (0,
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
1925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.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_runtime52.jsxs)("g", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1926
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.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" }),
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("path", { d: "M6 8a2 2 0 1 0 4 0 2 2 0 0 0-4 0" })
|
|
1908
1928
|
] }) });
|
|
1909
1929
|
};
|
|
1910
1930
|
var settings_default = SvgSettings;
|
|
@@ -1949,12 +1969,12 @@ var getUserInitials = (session) => {
|
|
|
1949
1969
|
};
|
|
1950
1970
|
|
|
1951
1971
|
// src/theme/default/components/ui/dropdown-menu.tsx
|
|
1952
|
-
var
|
|
1972
|
+
var import_react7 = require("react");
|
|
1953
1973
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1954
|
-
var
|
|
1974
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
1955
1975
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1956
1976
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1957
|
-
var DropdownMenuContent = (0,
|
|
1977
|
+
var DropdownMenuContent = (0, import_react7.forwardRef)(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1958
1978
|
DropdownMenuPrimitive.Content,
|
|
1959
1979
|
{
|
|
1960
1980
|
ref,
|
|
@@ -1969,7 +1989,7 @@ var DropdownMenuContent = (0, import_react6.forwardRef)(({ className, sideOffset
|
|
|
1969
1989
|
}
|
|
1970
1990
|
) }));
|
|
1971
1991
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1972
|
-
var DropdownMenuItem = (0,
|
|
1992
|
+
var DropdownMenuItem = (0, import_react7.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1973
1993
|
DropdownMenuPrimitive.Item,
|
|
1974
1994
|
{
|
|
1975
1995
|
ref,
|
|
@@ -1987,7 +2007,7 @@ var DropdownMenuItem = (0, import_react6.forwardRef)(({ className, inset, ...pro
|
|
|
1987
2007
|
}
|
|
1988
2008
|
));
|
|
1989
2009
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1990
|
-
var DropdownMenuLabel = (0,
|
|
2010
|
+
var DropdownMenuLabel = (0, import_react7.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1991
2011
|
DropdownMenuPrimitive.Label,
|
|
1992
2012
|
{
|
|
1993
2013
|
ref,
|
|
@@ -2002,35 +2022,35 @@ var DropdownMenuLabel = (0, import_react6.forwardRef)(({ className, inset, ...pr
|
|
|
2002
2022
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2003
2023
|
|
|
2004
2024
|
// src/theme/default/components/ui/user-avater.tsx
|
|
2005
|
-
var
|
|
2025
|
+
var import_react8 = require("react");
|
|
2006
2026
|
|
|
2007
2027
|
// src/theme/default/assets/icons/user.svg
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
2028
|
+
var React29 = __toESM(require("react"));
|
|
2029
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2010
2030
|
var SvgUser = (props) => {
|
|
2011
2031
|
var _a, _b;
|
|
2012
|
-
return /* @__PURE__ */ (0,
|
|
2032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.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_runtime54.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" }) });
|
|
2013
2033
|
};
|
|
2014
2034
|
var user_default = SvgUser;
|
|
2015
2035
|
|
|
2016
2036
|
// src/theme/default/components/ui/user-avater.tsx
|
|
2017
|
-
var
|
|
2018
|
-
var UserAvatar = (0,
|
|
2037
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2038
|
+
var UserAvatar = (0, import_react8.forwardRef)(
|
|
2019
2039
|
({ initials, ...rest }, ref) => {
|
|
2020
|
-
return /* @__PURE__ */ (0,
|
|
2040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2021
2041
|
"button",
|
|
2022
2042
|
{
|
|
2023
2043
|
ref,
|
|
2024
2044
|
className: "relative flex size-10 items-center justify-center overflow-hidden rounded-[999px] bg-button-primary-background-default hover:bg-button-primary-background-hover",
|
|
2025
2045
|
...rest,
|
|
2026
|
-
children: /* @__PURE__ */ (0,
|
|
2046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "relative flex size-full items-center justify-center", children: initials.avatar ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2027
2047
|
"img",
|
|
2028
2048
|
{
|
|
2029
2049
|
src: initials.avatar,
|
|
2030
2050
|
alt: initials.primary,
|
|
2031
2051
|
className: "w-full object-contain"
|
|
2032
2052
|
}
|
|
2033
|
-
) : /* @__PURE__ */ (0,
|
|
2053
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2034
2054
|
user_default,
|
|
2035
2055
|
{
|
|
2036
2056
|
size: 24,
|
|
@@ -2044,34 +2064,34 @@ var UserAvatar = (0, import_react7.forwardRef)(
|
|
|
2044
2064
|
UserAvatar.displayName = "UserAvatar";
|
|
2045
2065
|
|
|
2046
2066
|
// src/theme/default/components/ui/user-menu.tsx
|
|
2047
|
-
var
|
|
2067
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2048
2068
|
var UserMenu = ({ session }) => {
|
|
2049
2069
|
const { config } = (0, import_elements_react14.useOryFlow)();
|
|
2050
2070
|
const initials = getUserInitials(session);
|
|
2051
|
-
const [logoutFlow, setLogoutFlow] = (0,
|
|
2052
|
-
const fetchLogoutFlow = (0,
|
|
2071
|
+
const [logoutFlow, setLogoutFlow] = (0, import_react9.useState)();
|
|
2072
|
+
const fetchLogoutFlow = (0, import_react9.useCallback)(async () => {
|
|
2053
2073
|
const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow();
|
|
2054
2074
|
setLogoutFlow(flow);
|
|
2055
2075
|
}, [config.sdk.url]);
|
|
2056
|
-
(0,
|
|
2076
|
+
(0, import_react9.useEffect)(() => {
|
|
2057
2077
|
void fetchLogoutFlow();
|
|
2058
2078
|
}, [fetchLogoutFlow]);
|
|
2059
|
-
return /* @__PURE__ */ (0,
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2062
|
-
/* @__PURE__ */ (0,
|
|
2063
|
-
/* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2065
|
-
/* @__PURE__ */ (0,
|
|
2066
|
-
initials.secondary && /* @__PURE__ */ (0,
|
|
2079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenu, { children: [
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(UserAvatar, { initials }) }),
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuContent, { children: [
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_react_dropdown_menu.DropdownMenuLabel, { className: "flex gap-3 px-5 py-4.5", children: [
|
|
2083
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(UserAvatar, { disabled: true, initials }),
|
|
2084
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col justify-center text-sm leading-tight", children: [
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-interface-foreground-default-primary leading-tight font-medium", children: initials.primary }),
|
|
2086
|
+
initials.secondary && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-interface-foreground-default-tertiary leading-tight", children: initials.secondary })
|
|
2067
2087
|
] })
|
|
2068
2088
|
] }),
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2070
|
-
/* @__PURE__ */ (0,
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("a", { href: "/settings", children: [
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(settings_default, { size: 16 }),
|
|
2071
2091
|
" User settings"
|
|
2072
2092
|
] }) }),
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuItem, { asChild: true, disabled: !(logoutFlow == null ? void 0 : logoutFlow.logout_url), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("a", { href: logoutFlow == null ? void 0 : logoutFlow.logout_url, children: [
|
|
2094
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(logout_default, { size: 16 }),
|
|
2075
2095
|
" Logout"
|
|
2076
2096
|
] }) })
|
|
2077
2097
|
] })
|
|
@@ -2080,42 +2100,42 @@ var UserMenu = ({ session }) => {
|
|
|
2080
2100
|
|
|
2081
2101
|
// src/theme/default/components/generic/page-header.tsx
|
|
2082
2102
|
var import_client2 = require("@ory/elements-react/client");
|
|
2083
|
-
var
|
|
2103
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2084
2104
|
var DefaultPageHeader = (_props) => {
|
|
2085
2105
|
const { Card } = (0, import_elements_react15.useComponents)();
|
|
2086
2106
|
const { session } = (0, import_client2.useSession)();
|
|
2087
|
-
return /* @__PURE__ */ (0,
|
|
2088
|
-
/* @__PURE__ */ (0,
|
|
2089
|
-
/* @__PURE__ */ (0,
|
|
2107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.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_runtime57.jsx)("div", { className: "flex flex-col gap-12", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex max-h-10 flex-1 justify-between gap-2", children: [
|
|
2108
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "relative h-10 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Card.Logo, {}) }),
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(UserMenu, { session })
|
|
2090
2110
|
] }) }) });
|
|
2091
2111
|
};
|
|
2092
2112
|
|
|
2093
2113
|
// src/theme/default/components/settings/settings-oidc.tsx
|
|
2094
|
-
var
|
|
2114
|
+
var import_react10 = require("react");
|
|
2095
2115
|
var import_react_hook_form8 = require("react-hook-form");
|
|
2096
2116
|
var import_usehooks_ts2 = require("usehooks-ts");
|
|
2097
2117
|
|
|
2098
2118
|
// src/theme/default/assets/icons/trash.svg
|
|
2099
|
-
var
|
|
2100
|
-
var
|
|
2119
|
+
var React30 = __toESM(require("react"));
|
|
2120
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2101
2121
|
var SvgTrash = (props) => {
|
|
2102
2122
|
var _a, _b;
|
|
2103
|
-
return /* @__PURE__ */ (0,
|
|
2123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.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_runtime58.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" }) });
|
|
2104
2124
|
};
|
|
2105
2125
|
var trash_default = SvgTrash;
|
|
2106
2126
|
|
|
2107
2127
|
// src/theme/default/components/settings/settings-oidc.tsx
|
|
2108
|
-
var
|
|
2128
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2109
2129
|
function DefaultSettingsOidc({
|
|
2110
2130
|
linkButtons,
|
|
2111
2131
|
unlinkButtons
|
|
2112
2132
|
}) {
|
|
2113
2133
|
const hasLinkButtons = linkButtons.length > 0;
|
|
2114
2134
|
const hasUnlinkButtons = unlinkButtons.length > 0;
|
|
2115
|
-
return /* @__PURE__ */ (0,
|
|
2116
|
-
hasLinkButtons && /* @__PURE__ */ (0,
|
|
2135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2136
|
+
hasLinkButtons && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "grid items-start gap-3 grid-cols-1 sm:grid-cols-2 md:grid-cols-3", children: linkButtons.map((button) => {
|
|
2117
2137
|
const attrs = button.attributes;
|
|
2118
|
-
return /* @__PURE__ */ (0,
|
|
2138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2119
2139
|
DefaultButtonSocial,
|
|
2120
2140
|
{
|
|
2121
2141
|
showLabel: true,
|
|
@@ -2126,12 +2146,12 @@ function DefaultSettingsOidc({
|
|
|
2126
2146
|
attrs.value
|
|
2127
2147
|
);
|
|
2128
2148
|
}) }),
|
|
2129
|
-
hasUnlinkButtons && hasLinkButtons ? /* @__PURE__ */ (0,
|
|
2149
|
+
hasUnlinkButtons && hasLinkButtons ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DefaultHorizontalDivider, {}) : null,
|
|
2130
2150
|
unlinkButtons.map((button) => {
|
|
2131
2151
|
if (button.attributes.node_type !== "input") {
|
|
2132
2152
|
return null;
|
|
2133
2153
|
}
|
|
2134
|
-
return /* @__PURE__ */ (0,
|
|
2154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(UnlinkRow, { button }, button.attributes.value);
|
|
2135
2155
|
})
|
|
2136
2156
|
] });
|
|
2137
2157
|
}
|
|
@@ -2148,17 +2168,17 @@ function UnlinkRow({ button }) {
|
|
|
2148
2168
|
button.onClick();
|
|
2149
2169
|
setClicked(true);
|
|
2150
2170
|
};
|
|
2151
|
-
(0,
|
|
2171
|
+
(0, import_react10.useEffect)(() => {
|
|
2152
2172
|
if (!isSubmitting) {
|
|
2153
2173
|
setClicked(false);
|
|
2154
2174
|
}
|
|
2155
2175
|
}, [isSubmitting, setClicked]);
|
|
2156
|
-
return /* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2158
|
-
Logo ? /* @__PURE__ */ (0,
|
|
2159
|
-
/* @__PURE__ */ (0,
|
|
2176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex justify-between", children: [
|
|
2177
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex items-center gap-6", children: [
|
|
2178
|
+
Logo ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Logo, { size: 32 }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(provider_logos_default.generic, { size: 32 }),
|
|
2179
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary", children: provider })
|
|
2160
2180
|
] }),
|
|
2161
|
-
/* @__PURE__ */ (0,
|
|
2181
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2162
2182
|
"button",
|
|
2163
2183
|
{
|
|
2164
2184
|
...attrs,
|
|
@@ -2167,7 +2187,7 @@ function UnlinkRow({ button }) {
|
|
|
2167
2187
|
disabled: isSubmitting,
|
|
2168
2188
|
className: "relative",
|
|
2169
2189
|
title: `Unlink ${provider}`,
|
|
2170
|
-
children: clicked ? /* @__PURE__ */ (0,
|
|
2190
|
+
children: clicked ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2171
2191
|
trash_default,
|
|
2172
2192
|
{
|
|
2173
2193
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2182,7 +2202,7 @@ function UnlinkRow({ button }) {
|
|
|
2182
2202
|
// src/theme/default/components/settings/settings-passkey.tsx
|
|
2183
2203
|
var import_elements_react16 = require("@ory/elements-react");
|
|
2184
2204
|
var import_react_hook_form9 = require("react-hook-form");
|
|
2185
|
-
var
|
|
2205
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2186
2206
|
function DefaultSettingsPasskey({
|
|
2187
2207
|
triggerButton,
|
|
2188
2208
|
removeButtons
|
|
@@ -2190,49 +2210,49 @@ function DefaultSettingsPasskey({
|
|
|
2190
2210
|
const {
|
|
2191
2211
|
formState: { isSubmitting }
|
|
2192
2212
|
} = (0, import_react_hook_form9.useFormContext)();
|
|
2193
|
-
const { Node
|
|
2213
|
+
const { Node } = (0, import_elements_react16.useComponents)();
|
|
2194
2214
|
const hasRemoveButtons = removeButtons.length > 0;
|
|
2195
|
-
return /* @__PURE__ */ (0,
|
|
2196
|
-
/* @__PURE__ */ (0,
|
|
2197
|
-
|
|
2215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2216
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex max-w-[60%] items-end gap-3", children: triggerButton && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2217
|
+
Node.Button,
|
|
2198
2218
|
{
|
|
2199
2219
|
node: triggerButton,
|
|
2200
2220
|
attributes: triggerButton.attributes,
|
|
2201
2221
|
onClick: triggerButton.onClick
|
|
2202
2222
|
}
|
|
2203
2223
|
) }),
|
|
2204
|
-
hasRemoveButtons ? /* @__PURE__ */ (0,
|
|
2205
|
-
/* @__PURE__ */ (0,
|
|
2206
|
-
/* @__PURE__ */ (0,
|
|
2224
|
+
hasRemoveButtons ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DefaultHorizontalDivider, {}),
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex flex-col gap-2", children: removeButtons.map((node, i) => {
|
|
2207
2227
|
var _a, _b;
|
|
2208
2228
|
const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
|
|
2209
2229
|
const addedAt = "added_at" in context ? context.added_at : null;
|
|
2210
2230
|
const displayName = "display_name" in context ? context.display_name : null;
|
|
2211
2231
|
const keyId = "value" in node.attributes ? node.attributes.value : null;
|
|
2212
|
-
return /* @__PURE__ */ (0,
|
|
2232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
2213
2233
|
"div",
|
|
2214
2234
|
{
|
|
2215
2235
|
className: "flex justify-between gap-6 md:items-center",
|
|
2216
2236
|
children: [
|
|
2217
|
-
/* @__PURE__ */ (0,
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
2237
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-2 items-center flex-1 truncate", children: [
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2219
2239
|
passkey_default,
|
|
2220
2240
|
{
|
|
2221
2241
|
size: 32,
|
|
2222
2242
|
className: "text-interface-foreground-default-primary"
|
|
2223
2243
|
}
|
|
2224
2244
|
),
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2227
|
-
/* @__PURE__ */ (0,
|
|
2228
|
-
/* @__PURE__ */ (0,
|
|
2245
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4 truncate", children: [
|
|
2246
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-1 flex-col truncate", children: [
|
|
2247
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary truncate", children: displayName }),
|
|
2248
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block truncate", children: keyId })
|
|
2229
2249
|
] }),
|
|
2230
|
-
addedAt && /* @__PURE__ */ (0,
|
|
2250
|
+
addedAt && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
|
|
2231
2251
|
dateStyle: "long"
|
|
2232
2252
|
}).format(new Date(addedAt)) })
|
|
2233
2253
|
] })
|
|
2234
2254
|
] }),
|
|
2235
|
-
/* @__PURE__ */ (0,
|
|
2255
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2236
2256
|
"button",
|
|
2237
2257
|
{
|
|
2238
2258
|
...node.attributes,
|
|
@@ -2240,7 +2260,7 @@ function DefaultSettingsPasskey({
|
|
|
2240
2260
|
onClick: node.onClick,
|
|
2241
2261
|
disabled: isSubmitting,
|
|
2242
2262
|
className: "relative",
|
|
2243
|
-
children: isSubmitting ? /* @__PURE__ */ (0,
|
|
2263
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2244
2264
|
trash_default,
|
|
2245
2265
|
{
|
|
2246
2266
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2259,38 +2279,26 @@ function DefaultSettingsPasskey({
|
|
|
2259
2279
|
}
|
|
2260
2280
|
|
|
2261
2281
|
// src/theme/default/assets/icons/download.svg
|
|
2262
|
-
var
|
|
2263
|
-
var
|
|
2282
|
+
var React31 = __toESM(require("react"));
|
|
2283
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2264
2284
|
var SvgDownload = (props) => {
|
|
2265
2285
|
var _a, _b;
|
|
2266
|
-
return /* @__PURE__ */ (0,
|
|
2286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.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_runtime61.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" }) });
|
|
2267
2287
|
};
|
|
2268
2288
|
var download_default = SvgDownload;
|
|
2269
2289
|
|
|
2270
|
-
// src/theme/default/assets/icons/eye.svg
|
|
2271
|
-
var React30 = __toESM(require("react"));
|
|
2272
|
-
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2273
|
-
var SvgEye = (props) => {
|
|
2274
|
-
var _a, _b;
|
|
2275
|
-
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.jsxs)("g", { strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2276
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("path", { stroke: "currentColor", d: "M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0" }),
|
|
2277
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("path", { stroke: "#64748B", d: "M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6" })
|
|
2278
|
-
] }) });
|
|
2279
|
-
};
|
|
2280
|
-
var eye_default = SvgEye;
|
|
2281
|
-
|
|
2282
2290
|
// src/theme/default/assets/icons/refresh.svg
|
|
2283
|
-
var
|
|
2284
|
-
var
|
|
2291
|
+
var React32 = __toESM(require("react"));
|
|
2292
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2285
2293
|
var SvgRefresh = (props) => {
|
|
2286
2294
|
var _a, _b;
|
|
2287
|
-
return /* @__PURE__ */ (0,
|
|
2295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.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_runtime62.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" }) });
|
|
2288
2296
|
};
|
|
2289
2297
|
var refresh_default = SvgRefresh;
|
|
2290
2298
|
|
|
2291
2299
|
// src/theme/default/components/settings/settings-recovery-codes.tsx
|
|
2292
2300
|
var import_react_hook_form10 = require("react-hook-form");
|
|
2293
|
-
var
|
|
2301
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2294
2302
|
function DefaultSettingsRecoveryCodes({
|
|
2295
2303
|
codes,
|
|
2296
2304
|
regnerateButton,
|
|
@@ -2312,12 +2320,12 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2312
2320
|
element.click();
|
|
2313
2321
|
};
|
|
2314
2322
|
const hasCodes = codes.length >= 1;
|
|
2315
|
-
return /* @__PURE__ */ (0,
|
|
2316
|
-
codes.length > 0 && /* @__PURE__ */ (0,
|
|
2317
|
-
/* @__PURE__ */ (0,
|
|
2318
|
-
/* @__PURE__ */ (0,
|
|
2319
|
-
/* @__PURE__ */ (0,
|
|
2320
|
-
regnerateButton && codes.length > 0 && /* @__PURE__ */ (0,
|
|
2323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2324
|
+
codes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DefaultHorizontalDivider, {}),
|
|
2325
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex gap-4 justify-between", children: [
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-interface-foreground-default-tertiary", children: revealButton && "Reveal recovery codes" }),
|
|
2327
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex gap-2", children: [
|
|
2328
|
+
regnerateButton && codes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2321
2329
|
"button",
|
|
2322
2330
|
{
|
|
2323
2331
|
...regnerateButton.attributes,
|
|
@@ -2326,7 +2334,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2326
2334
|
onClick: onRegenerate,
|
|
2327
2335
|
disabled: isSubmitting,
|
|
2328
2336
|
"data-loading": isSubmitting,
|
|
2329
|
-
children: /* @__PURE__ */ (0,
|
|
2337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2330
2338
|
refresh_default,
|
|
2331
2339
|
{
|
|
2332
2340
|
size: 24,
|
|
@@ -2335,7 +2343,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2335
2343
|
)
|
|
2336
2344
|
}
|
|
2337
2345
|
),
|
|
2338
|
-
revealButton && /* @__PURE__ */ (0,
|
|
2346
|
+
revealButton && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2339
2347
|
"button",
|
|
2340
2348
|
{
|
|
2341
2349
|
...revealButton.attributes,
|
|
@@ -2343,7 +2351,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2343
2351
|
className: "ml-auto",
|
|
2344
2352
|
onClick: onReveal,
|
|
2345
2353
|
title: "Reveal recovery codes",
|
|
2346
|
-
children: /* @__PURE__ */ (0,
|
|
2354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2347
2355
|
eye_default,
|
|
2348
2356
|
{
|
|
2349
2357
|
size: 24,
|
|
@@ -2352,7 +2360,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2352
2360
|
)
|
|
2353
2361
|
}
|
|
2354
2362
|
) }),
|
|
2355
|
-
hasCodes && /* @__PURE__ */ (0,
|
|
2363
|
+
hasCodes && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2356
2364
|
"button",
|
|
2357
2365
|
{
|
|
2358
2366
|
onClick: onDownload,
|
|
@@ -2360,7 +2368,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2360
2368
|
className: "ml-auto",
|
|
2361
2369
|
"data-testid": "ory/screen/settings/group/recovery_code/download",
|
|
2362
2370
|
title: "Download recovery codes",
|
|
2363
|
-
children: /* @__PURE__ */ (0,
|
|
2371
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2364
2372
|
download_default,
|
|
2365
2373
|
{
|
|
2366
2374
|
size: 24,
|
|
@@ -2371,12 +2379,12 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2371
2379
|
)
|
|
2372
2380
|
] })
|
|
2373
2381
|
] }),
|
|
2374
|
-
hasCodes ? /* @__PURE__ */ (0,
|
|
2382
|
+
hasCodes ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "rounded-general p-6 bg-interface-background-default-secondary border-interface-border-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2375
2383
|
"div",
|
|
2376
2384
|
{
|
|
2377
2385
|
className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 flex-wrap gap-4 text-sm text-interface-foreground-default-primary",
|
|
2378
2386
|
"data-testid": "ory/screen/settings/group/recovery_code/codes",
|
|
2379
|
-
children: codes.map((code) => /* @__PURE__ */ (0,
|
|
2387
|
+
children: codes.map((code) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { children: code }, code))
|
|
2380
2388
|
}
|
|
2381
2389
|
) }) : null
|
|
2382
2390
|
] });
|
|
@@ -2386,17 +2394,17 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2386
2394
|
var import_elements_react17 = require("@ory/elements-react");
|
|
2387
2395
|
|
|
2388
2396
|
// src/theme/default/assets/icons/qrcode.svg
|
|
2389
|
-
var
|
|
2390
|
-
var
|
|
2397
|
+
var React33 = __toESM(require("react"));
|
|
2398
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2391
2399
|
var SvgQrcode = (props) => {
|
|
2392
2400
|
var _a, _b;
|
|
2393
|
-
return /* @__PURE__ */ (0,
|
|
2401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.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_runtime64.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" }) });
|
|
2394
2402
|
};
|
|
2395
2403
|
var qrcode_default = SvgQrcode;
|
|
2396
2404
|
|
|
2397
2405
|
// src/theme/default/components/settings/settings-totp.tsx
|
|
2398
2406
|
var import_react_hook_form11 = require("react-hook-form");
|
|
2399
|
-
var
|
|
2407
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2400
2408
|
function DefaultSettingsTotp({
|
|
2401
2409
|
totpImage,
|
|
2402
2410
|
totpInput,
|
|
@@ -2404,7 +2412,7 @@ function DefaultSettingsTotp({
|
|
|
2404
2412
|
totpUnlink,
|
|
2405
2413
|
onUnlink
|
|
2406
2414
|
}) {
|
|
2407
|
-
const { Node
|
|
2415
|
+
const { Node, Card } = (0, import_elements_react17.useComponents)();
|
|
2408
2416
|
const {
|
|
2409
2417
|
formState: { isSubmitting }
|
|
2410
2418
|
} = (0, import_react_hook_form11.useFormContext)();
|
|
@@ -2416,19 +2424,19 @@ function DefaultSettingsTotp({
|
|
|
2416
2424
|
node_type: _ignoredNodeType,
|
|
2417
2425
|
...buttonAttrs
|
|
2418
2426
|
} = totpUnlink.attributes;
|
|
2419
|
-
return /* @__PURE__ */ (0,
|
|
2420
|
-
/* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
|
|
2428
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "col-span-full", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Card.Divider, {}) }),
|
|
2429
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "col-span-full flex items-center gap-6", children: [
|
|
2430
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "aspect-square size-8 ", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(qrcode_default, { size: 32 }) }),
|
|
2431
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mr-auto flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-primary", children: "Authenticator app" }) }),
|
|
2432
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2425
2433
|
"button",
|
|
2426
2434
|
{
|
|
2427
2435
|
type: type === "button" ? "button" : "submit",
|
|
2428
2436
|
...buttonAttrs,
|
|
2429
2437
|
onClick: onUnlink,
|
|
2430
2438
|
disabled: isSubmitting,
|
|
2431
|
-
children: isSubmitting ? /* @__PURE__ */ (0,
|
|
2439
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2432
2440
|
trash_default,
|
|
2433
2441
|
{
|
|
2434
2442
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2441,10 +2449,10 @@ function DefaultSettingsTotp({
|
|
|
2441
2449
|
] });
|
|
2442
2450
|
}
|
|
2443
2451
|
if (totpImage && totpSecret && totpInput) {
|
|
2444
|
-
return /* @__PURE__ */ (0,
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2447
|
-
|
|
2452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
|
|
2453
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "col-span-full", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DefaultHorizontalDivider, {}) }),
|
|
2454
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex justify-center rounded-cards bg-interface-background-default-secondary p-8", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "aspect-square h-44 rounded bg-[white]", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "-m-3 antialiased mix-blend-multiply", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2455
|
+
Node.Image,
|
|
2448
2456
|
{
|
|
2449
2457
|
node: totpImage,
|
|
2450
2458
|
attributes: {
|
|
@@ -2452,14 +2460,14 @@ function DefaultSettingsTotp({
|
|
|
2452
2460
|
}
|
|
2453
2461
|
}
|
|
2454
2462
|
) }) }) }),
|
|
2455
|
-
/* @__PURE__ */ (0,
|
|
2456
|
-
/* @__PURE__ */ (0,
|
|
2457
|
-
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2465
|
+
Node.Label,
|
|
2458
2466
|
{
|
|
2459
2467
|
node: totpSecret,
|
|
2460
2468
|
attributes: totpSecret.attributes,
|
|
2461
|
-
children: /* @__PURE__ */ (0,
|
|
2462
|
-
|
|
2469
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2470
|
+
Node.Input,
|
|
2463
2471
|
{
|
|
2464
2472
|
node: totpSecret,
|
|
2465
2473
|
attributes: {
|
|
@@ -2473,13 +2481,13 @@ function DefaultSettingsTotp({
|
|
|
2473
2481
|
)
|
|
2474
2482
|
}
|
|
2475
2483
|
),
|
|
2476
|
-
/* @__PURE__ */ (0,
|
|
2477
|
-
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2485
|
+
Node.Label,
|
|
2478
2486
|
{
|
|
2479
2487
|
attributes: totpInput.attributes,
|
|
2480
2488
|
node: totpInput,
|
|
2481
|
-
children: /* @__PURE__ */ (0,
|
|
2482
|
-
|
|
2489
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2490
|
+
Node.CodeInput,
|
|
2483
2491
|
{
|
|
2484
2492
|
node: totpInput,
|
|
2485
2493
|
attributes: totpInput.attributes
|
|
@@ -2496,17 +2504,17 @@ function DefaultSettingsTotp({
|
|
|
2496
2504
|
var import_elements_react18 = require("@ory/elements-react");
|
|
2497
2505
|
|
|
2498
2506
|
// src/theme/default/assets/icons/key.svg
|
|
2499
|
-
var
|
|
2500
|
-
var
|
|
2507
|
+
var React34 = __toESM(require("react"));
|
|
2508
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2501
2509
|
var SvgKey = (props) => {
|
|
2502
2510
|
var _a, _b;
|
|
2503
|
-
return /* @__PURE__ */ (0,
|
|
2511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.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_runtime66.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" }) });
|
|
2504
2512
|
};
|
|
2505
2513
|
var key_default = SvgKey;
|
|
2506
2514
|
|
|
2507
2515
|
// src/theme/default/components/settings/settings-webauthn.tsx
|
|
2508
2516
|
var import_react_hook_form12 = require("react-hook-form");
|
|
2509
|
-
var
|
|
2517
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
2510
2518
|
function DefaultSettingsWebauthn({
|
|
2511
2519
|
nameInput,
|
|
2512
2520
|
triggerButton,
|
|
@@ -2515,17 +2523,17 @@ function DefaultSettingsWebauthn({
|
|
|
2515
2523
|
const {
|
|
2516
2524
|
formState: { isSubmitting }
|
|
2517
2525
|
} = (0, import_react_hook_form12.useFormContext)();
|
|
2518
|
-
const { Node
|
|
2526
|
+
const { Node, Card } = (0, import_elements_react18.useComponents)();
|
|
2519
2527
|
const hasRemoveButtons = removeButtons.length > 0;
|
|
2520
|
-
return /* @__PURE__ */ (0,
|
|
2521
|
-
/* @__PURE__ */ (0,
|
|
2522
|
-
/* @__PURE__ */ (0,
|
|
2523
|
-
|
|
2528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex md:max-w-96 sm:items-end gap-3 flex-col sm:flex-row", children: [
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2531
|
+
Node.Label,
|
|
2524
2532
|
{
|
|
2525
2533
|
node: nameInput,
|
|
2526
2534
|
attributes: nameInput.attributes,
|
|
2527
|
-
children: /* @__PURE__ */ (0,
|
|
2528
|
-
|
|
2535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2536
|
+
Node.Input,
|
|
2529
2537
|
{
|
|
2530
2538
|
node: nameInput,
|
|
2531
2539
|
attributes: nameInput.attributes
|
|
@@ -2533,8 +2541,8 @@ function DefaultSettingsWebauthn({
|
|
|
2533
2541
|
)
|
|
2534
2542
|
}
|
|
2535
2543
|
) }),
|
|
2536
|
-
triggerButton ? /* @__PURE__ */ (0,
|
|
2537
|
-
|
|
2544
|
+
triggerButton ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2545
|
+
Node.Button,
|
|
2538
2546
|
{
|
|
2539
2547
|
node: triggerButton,
|
|
2540
2548
|
attributes: triggerButton.attributes,
|
|
@@ -2542,38 +2550,38 @@ function DefaultSettingsWebauthn({
|
|
|
2542
2550
|
}
|
|
2543
2551
|
) : null
|
|
2544
2552
|
] }),
|
|
2545
|
-
hasRemoveButtons ? /* @__PURE__ */ (0,
|
|
2546
|
-
/* @__PURE__ */ (0,
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2553
|
+
hasRemoveButtons ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2554
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card.Divider, {}),
|
|
2555
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex flex-col gap-4", children: removeButtons.map((node, i) => {
|
|
2548
2556
|
var _a, _b;
|
|
2549
2557
|
const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
|
|
2550
2558
|
const addedAt = "added_at" in context ? context.added_at : null;
|
|
2551
2559
|
const displayName = "display_name" in context ? context.display_name : null;
|
|
2552
2560
|
const keyId = "value" in node.attributes ? node.attributes.value : null;
|
|
2553
|
-
return /* @__PURE__ */ (0,
|
|
2561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
2554
2562
|
"div",
|
|
2555
2563
|
{
|
|
2556
2564
|
className: "flex justify-between gap-6 md:items-center",
|
|
2557
2565
|
children: [
|
|
2558
|
-
/* @__PURE__ */ (0,
|
|
2559
|
-
/* @__PURE__ */ (0,
|
|
2566
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex gap-2 items-center flex-1 truncate", children: [
|
|
2567
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2560
2568
|
key_default,
|
|
2561
2569
|
{
|
|
2562
2570
|
size: 32,
|
|
2563
2571
|
className: "text-interface-foreground-default-primary"
|
|
2564
2572
|
}
|
|
2565
2573
|
),
|
|
2566
|
-
/* @__PURE__ */ (0,
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2568
|
-
/* @__PURE__ */ (0,
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2574
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4 truncate", children: [
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-1 flex-col truncate", children: [
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary truncate", children: displayName }),
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block truncate", children: keyId })
|
|
2570
2578
|
] }),
|
|
2571
|
-
addedAt && /* @__PURE__ */ (0,
|
|
2579
|
+
addedAt && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
|
|
2572
2580
|
dateStyle: "long"
|
|
2573
2581
|
}).format(new Date(addedAt)) })
|
|
2574
2582
|
] })
|
|
2575
2583
|
] }),
|
|
2576
|
-
/* @__PURE__ */ (0,
|
|
2584
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2577
2585
|
"button",
|
|
2578
2586
|
{
|
|
2579
2587
|
...node.attributes,
|
|
@@ -2581,7 +2589,7 @@ function DefaultSettingsWebauthn({
|
|
|
2581
2589
|
onClick: node.onClick,
|
|
2582
2590
|
disabled: isSubmitting,
|
|
2583
2591
|
className: "relative",
|
|
2584
|
-
children: isSubmitting ? /* @__PURE__ */ (0,
|
|
2592
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2585
2593
|
trash_default,
|
|
2586
2594
|
{
|
|
2587
2595
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2600,266 +2608,34 @@ function DefaultSettingsWebauthn({
|
|
|
2600
2608
|
}
|
|
2601
2609
|
|
|
2602
2610
|
// src/theme/default/components/card/auth-method-list-container.tsx
|
|
2603
|
-
var
|
|
2611
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2604
2612
|
function DefaultAuthMethodListContainer({
|
|
2605
2613
|
children
|
|
2606
2614
|
}) {
|
|
2607
|
-
return /* @__PURE__ */ (0,
|
|
2615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "grid grid-cols-1 gap-2", children });
|
|
2608
2616
|
}
|
|
2609
2617
|
|
|
2610
2618
|
// src/theme/default/components/form/captcha.tsx
|
|
2611
|
-
var
|
|
2619
|
+
var import_client_fetch14 = require("@ory/client-fetch");
|
|
2612
2620
|
var import_react_turnstile = require("@marsidev/react-turnstile");
|
|
2613
|
-
var import_react13 = require("react");
|
|
2614
|
-
var import_react_hook_form25 = require("react-hook-form");
|
|
2615
|
-
|
|
2616
|
-
// src/context/flow-context.tsx
|
|
2617
2621
|
var import_react11 = require("react");
|
|
2618
|
-
|
|
2619
|
-
// src/context/form-state.ts
|
|
2620
|
-
var import_client_fetch15 = require("@ory/client-fetch");
|
|
2621
|
-
var import_react10 = require("react");
|
|
2622
|
-
|
|
2623
|
-
// src/components/card/card-two-step.utils.ts
|
|
2624
|
-
var import_client_fetch14 = require("@ory/client-fetch");
|
|
2625
|
-
|
|
2626
|
-
// src/context/flow-context.tsx
|
|
2627
|
-
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2628
|
-
var OryFlowContext = (0, import_react11.createContext)(null);
|
|
2629
|
-
|
|
2630
|
-
// src/context/intl-context.tsx
|
|
2631
|
-
var import_react_intl20 = require("react-intl");
|
|
2632
|
-
|
|
2633
|
-
// src/components/card/header.tsx
|
|
2634
|
-
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
2635
|
-
|
|
2636
|
-
// src/components/form/form-provider.tsx
|
|
2637
|
-
var import_client_fetch18 = require("@ory/client-fetch");
|
|
2638
2622
|
var import_react_hook_form13 = require("react-hook-form");
|
|
2639
|
-
|
|
2640
|
-
// src/components/form/form-helpers.ts
|
|
2641
|
-
var import_client_fetch16 = require("@ory/client-fetch");
|
|
2642
|
-
|
|
2643
|
-
// src/components/form/form-resolver.ts
|
|
2644
|
-
var import_client_fetch17 = require("@ory/client-fetch");
|
|
2645
|
-
|
|
2646
|
-
// src/components/form/form-provider.tsx
|
|
2647
|
-
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
2648
|
-
|
|
2649
|
-
// src/components/card/card.tsx
|
|
2650
|
-
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
2651
|
-
|
|
2652
|
-
// src/components/card/footer.tsx
|
|
2653
|
-
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
2654
|
-
|
|
2655
|
-
// src/components/card/content.tsx
|
|
2656
|
-
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
2657
|
-
|
|
2658
|
-
// src/components/card/card-two-step.tsx
|
|
2659
|
-
var import_client_fetch27 = require("@ory/client-fetch");
|
|
2660
|
-
var import_react_hook_form17 = require("react-hook-form");
|
|
2661
|
-
|
|
2662
|
-
// src/components/form/form.tsx
|
|
2663
|
-
var import_client_fetch25 = require("@ory/client-fetch");
|
|
2664
|
-
var import_react_hook_form15 = require("react-hook-form");
|
|
2665
|
-
var import_react_intl13 = require("react-intl");
|
|
2666
|
-
|
|
2667
|
-
// src/components/form/useOryFormSubmit.ts
|
|
2668
|
-
var import_client_fetch24 = require("@ory/client-fetch");
|
|
2669
|
-
var import_react_hook_form14 = require("react-hook-form");
|
|
2670
|
-
|
|
2671
|
-
// src/util/onSubmitLogin.ts
|
|
2672
|
-
var import_client_fetch19 = require("@ory/client-fetch");
|
|
2673
|
-
|
|
2674
|
-
// src/util/onSubmitRecovery.ts
|
|
2675
|
-
var import_client_fetch20 = require("@ory/client-fetch");
|
|
2676
|
-
|
|
2677
|
-
// src/util/onSubmitRegistration.ts
|
|
2678
|
-
var import_client_fetch21 = require("@ory/client-fetch");
|
|
2679
|
-
|
|
2680
|
-
// src/util/onSubmitSettings.ts
|
|
2681
|
-
var import_client_fetch22 = require("@ory/client-fetch");
|
|
2682
|
-
|
|
2683
|
-
// src/util/onSubmitVerification.ts
|
|
2684
|
-
var import_client_fetch23 = require("@ory/client-fetch");
|
|
2685
|
-
|
|
2686
|
-
// src/components/form/form.tsx
|
|
2687
|
-
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
2688
|
-
|
|
2689
|
-
// src/components/form/messages.tsx
|
|
2690
|
-
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
2691
|
-
|
|
2692
|
-
// src/components/form/nodes/node.tsx
|
|
2693
|
-
var import_client_fetch26 = require("@ory/client-fetch");
|
|
2694
|
-
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
2695
|
-
|
|
2696
|
-
// src/components/form/social.tsx
|
|
2697
|
-
var import_react_hook_form16 = require("react-hook-form");
|
|
2698
|
-
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
2699
|
-
|
|
2700
|
-
// src/components/card/card-two-step.tsx
|
|
2701
|
-
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
2702
|
-
|
|
2703
|
-
// src/components/form/groups.tsx
|
|
2704
|
-
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
2705
|
-
|
|
2706
|
-
// src/components/form/section.tsx
|
|
2707
|
-
var import_react_hook_form18 = require("react-hook-form");
|
|
2708
|
-
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
2709
|
-
|
|
2710
|
-
// src/components/generic/divider.tsx
|
|
2711
|
-
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
2712
|
-
|
|
2713
|
-
// src/components/generic/page-header.tsx
|
|
2714
|
-
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
2715
|
-
|
|
2716
|
-
// src/components/settings/settings-card.tsx
|
|
2717
|
-
var import_client_fetch28 = require("@ory/client-fetch");
|
|
2718
|
-
var import_react_intl19 = require("react-intl");
|
|
2719
|
-
|
|
2720
|
-
// src/components/settings/oidc-settings.tsx
|
|
2721
|
-
var import_react_intl14 = require("react-intl");
|
|
2722
|
-
var import_react_hook_form19 = require("react-hook-form");
|
|
2723
|
-
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
2724
|
-
|
|
2725
|
-
// src/components/settings/passkey-settings.tsx
|
|
2726
|
-
var import_react_hook_form20 = require("react-hook-form");
|
|
2727
|
-
var import_react_intl15 = require("react-intl");
|
|
2728
|
-
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
2729
|
-
|
|
2730
|
-
// src/components/settings/recovery-codes-settings.tsx
|
|
2731
|
-
var import_react_intl16 = require("react-intl");
|
|
2732
|
-
var import_react_hook_form21 = require("react-hook-form");
|
|
2733
|
-
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
2734
|
-
|
|
2735
|
-
// src/components/settings/totp-settings.tsx
|
|
2736
|
-
var import_react_hook_form22 = require("react-hook-form");
|
|
2737
|
-
var import_react_intl17 = require("react-intl");
|
|
2738
|
-
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
2739
|
-
|
|
2740
|
-
// src/components/settings/webauthn-settings.tsx
|
|
2741
|
-
var import_react_hook_form23 = require("react-hook-form");
|
|
2742
|
-
var import_react_intl18 = require("react-intl");
|
|
2743
|
-
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
2744
|
-
|
|
2745
|
-
// src/components/settings/settings-card.tsx
|
|
2746
|
-
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
2747
|
-
|
|
2748
|
-
// src/context/intl-context.tsx
|
|
2749
|
-
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
2750
|
-
|
|
2751
|
-
// src/context/provider.tsx
|
|
2752
|
-
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
2753
|
-
|
|
2754
|
-
// src/components/form/nodes/input.tsx
|
|
2755
|
-
var import_client_fetch29 = require("@ory/client-fetch");
|
|
2756
|
-
var import_react12 = require("react");
|
|
2757
|
-
var import_react_hook_form24 = require("react-hook-form");
|
|
2758
|
-
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
2759
|
-
var NodeInput = ({
|
|
2760
|
-
node,
|
|
2761
|
-
attributes
|
|
2762
|
-
}) => {
|
|
2763
|
-
var _a;
|
|
2764
|
-
const { Node: Node2 } = useComponents();
|
|
2765
|
-
const { setValue } = (0, import_react_hook_form24.useFormContext)();
|
|
2766
|
-
const {
|
|
2767
|
-
onloadTrigger,
|
|
2768
|
-
onclickTrigger,
|
|
2769
|
-
// These properties do not exist on input fields so we remove them (as we already have handled them).
|
|
2770
|
-
onclick: _ignoredOnclick,
|
|
2771
|
-
onload: _ignoredOnload,
|
|
2772
|
-
//
|
|
2773
|
-
...attrs
|
|
2774
|
-
} = attributes;
|
|
2775
|
-
const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
|
|
2776
|
-
const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
|
|
2777
|
-
const setFormValue = () => {
|
|
2778
|
-
if (attrs.value && !(isResendNode || isScreenSelectionNode)) {
|
|
2779
|
-
setValue(attrs.name, attrs.value);
|
|
2780
|
-
}
|
|
2781
|
-
};
|
|
2782
|
-
const hasRun = (0, import_react12.useRef)(false);
|
|
2783
|
-
(0, import_react12.useEffect)(
|
|
2784
|
-
() => {
|
|
2785
|
-
setFormValue();
|
|
2786
|
-
if (!hasRun.current && onloadTrigger) {
|
|
2787
|
-
hasRun.current = true;
|
|
2788
|
-
triggerToWindowCall(onloadTrigger);
|
|
2789
|
-
}
|
|
2790
|
-
},
|
|
2791
|
-
// TODO(jonas): make sure onloadTrigger is stable
|
|
2792
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- ignore onloadTrigger for now, until we make sure this is stable
|
|
2793
|
-
[]
|
|
2794
|
-
);
|
|
2795
|
-
const handleClick = () => {
|
|
2796
|
-
setFormValue();
|
|
2797
|
-
if (onclickTrigger) {
|
|
2798
|
-
triggerToWindowCall(onclickTrigger);
|
|
2799
|
-
}
|
|
2800
|
-
};
|
|
2801
|
-
const isSocial = (attrs.name === "provider" || attrs.name === "link") && node.group === "oidc";
|
|
2802
|
-
const isPinCodeInput = attrs.name === "code" && node.group === "code" || attrs.name === "totp_code" && node.group === "totp";
|
|
2803
|
-
switch (attributes.type) {
|
|
2804
|
-
case import_client_fetch29.UiNodeInputAttributesTypeEnum.Submit:
|
|
2805
|
-
case import_client_fetch29.UiNodeInputAttributesTypeEnum.Button:
|
|
2806
|
-
if (isSocial) {
|
|
2807
|
-
return null;
|
|
2808
|
-
}
|
|
2809
|
-
if (isResendNode || isScreenSelectionNode) {
|
|
2810
|
-
return null;
|
|
2811
|
-
}
|
|
2812
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
2813
|
-
Node2.Label,
|
|
2814
|
-
{
|
|
2815
|
-
attributes: { ...attrs, label: void 0 },
|
|
2816
|
-
node: { ...node, meta: { ...node.meta, label: void 0 } },
|
|
2817
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Node2.Button, { attributes: attrs, node, onClick: handleClick })
|
|
2818
|
-
}
|
|
2819
|
-
);
|
|
2820
|
-
case import_client_fetch29.UiNodeInputAttributesTypeEnum.DatetimeLocal:
|
|
2821
|
-
throw new Error("Not implemented");
|
|
2822
|
-
case import_client_fetch29.UiNodeInputAttributesTypeEnum.Checkbox:
|
|
2823
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
2824
|
-
Node2.Label,
|
|
2825
|
-
{
|
|
2826
|
-
attributes: { ...attrs, label: void 0 },
|
|
2827
|
-
node: { ...node, meta: { ...node.meta, label: void 0 } },
|
|
2828
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Node2.Checkbox, { attributes: attrs, node, onClick: handleClick })
|
|
2829
|
-
}
|
|
2830
|
-
);
|
|
2831
|
-
case import_client_fetch29.UiNodeInputAttributesTypeEnum.Hidden:
|
|
2832
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Node2.Input, { attributes: attrs, node, onClick: handleClick });
|
|
2833
|
-
default:
|
|
2834
|
-
if (isPinCodeInput) {
|
|
2835
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Node2.Label, { attributes: attrs, node, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
2836
|
-
Node2.CodeInput,
|
|
2837
|
-
{
|
|
2838
|
-
attributes: attrs,
|
|
2839
|
-
node,
|
|
2840
|
-
onClick: handleClick
|
|
2841
|
-
}
|
|
2842
|
-
) });
|
|
2843
|
-
}
|
|
2844
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Node2.Label, { attributes: attrs, node, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Node2.Input, { attributes: attrs, node, onClick: handleClick }) });
|
|
2845
|
-
}
|
|
2846
|
-
};
|
|
2847
|
-
|
|
2848
|
-
// src/theme/default/components/form/captcha.tsx
|
|
2849
|
-
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
2623
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
2850
2624
|
var DefaultCaptcha = ({ node }) => {
|
|
2851
|
-
const { setValue } = (0,
|
|
2852
|
-
const ref = (0,
|
|
2625
|
+
const { setValue } = (0, import_react_hook_form13.useFormContext)();
|
|
2626
|
+
const ref = (0, import_react11.useRef)();
|
|
2853
2627
|
const nodes = [];
|
|
2854
|
-
if ((0,
|
|
2628
|
+
if ((0, import_client_fetch14.isUiNodeInputAttributes)(node.attributes)) {
|
|
2855
2629
|
if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
|
|
2856
|
-
nodes.push(
|
|
2630
|
+
nodes.push(
|
|
2631
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DefaultInput, { node, attributes: node.attributes }, 1)
|
|
2632
|
+
);
|
|
2857
2633
|
}
|
|
2858
2634
|
}
|
|
2859
|
-
if ((0,
|
|
2635
|
+
if ((0, import_client_fetch14.isUiNodeInputAttributes)(node.attributes) && node.attributes.name === "captcha_turnstile_options") {
|
|
2860
2636
|
const options = JSON.parse(node.attributes.value);
|
|
2861
2637
|
nodes.push(
|
|
2862
|
-
/* @__PURE__ */ (0,
|
|
2638
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
2863
2639
|
import_react_turnstile.Turnstile,
|
|
2864
2640
|
{
|
|
2865
2641
|
ref,
|
|
@@ -2936,18 +2712,18 @@ function getOryComponents(overrides) {
|
|
|
2936
2712
|
}
|
|
2937
2713
|
|
|
2938
2714
|
// src/theme/default/flows/error.tsx
|
|
2939
|
-
var
|
|
2715
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
2940
2716
|
function Error2({
|
|
2941
2717
|
error,
|
|
2942
2718
|
children
|
|
2943
2719
|
}) {
|
|
2944
|
-
return /* @__PURE__ */ (0,
|
|
2720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": "ory/screen/error/raw", children: JSON.stringify(error) || children });
|
|
2945
2721
|
}
|
|
2946
2722
|
|
|
2947
2723
|
// src/theme/default/flows/login.tsx
|
|
2948
|
-
var
|
|
2724
|
+
var import_client_fetch15 = require("@ory/client-fetch");
|
|
2949
2725
|
var import_elements_react19 = require("@ory/elements-react");
|
|
2950
|
-
var
|
|
2726
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
2951
2727
|
function Login({
|
|
2952
2728
|
flow,
|
|
2953
2729
|
config,
|
|
@@ -2955,22 +2731,22 @@ function Login({
|
|
|
2955
2731
|
components: flowOverrideComponents
|
|
2956
2732
|
}) {
|
|
2957
2733
|
const components = getOryComponents(flowOverrideComponents);
|
|
2958
|
-
return /* @__PURE__ */ (0,
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
2959
2735
|
import_elements_react19.OryProvider,
|
|
2960
2736
|
{
|
|
2961
2737
|
config,
|
|
2962
2738
|
flow,
|
|
2963
|
-
flowType:
|
|
2739
|
+
flowType: import_client_fetch15.FlowType.Login,
|
|
2964
2740
|
components,
|
|
2965
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
2741
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_elements_react19.OryTwoStepCard, {})
|
|
2966
2742
|
}
|
|
2967
2743
|
);
|
|
2968
2744
|
}
|
|
2969
2745
|
|
|
2970
2746
|
// src/theme/default/flows/recovery.tsx
|
|
2971
|
-
var
|
|
2747
|
+
var import_client_fetch16 = require("@ory/client-fetch");
|
|
2972
2748
|
var import_elements_react20 = require("@ory/elements-react");
|
|
2973
|
-
var
|
|
2749
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
2974
2750
|
function Recovery({
|
|
2975
2751
|
flow,
|
|
2976
2752
|
config,
|
|
@@ -2978,22 +2754,22 @@ function Recovery({
|
|
|
2978
2754
|
components: flowOverrideComponents
|
|
2979
2755
|
}) {
|
|
2980
2756
|
const components = getOryComponents(flowOverrideComponents);
|
|
2981
|
-
return /* @__PURE__ */ (0,
|
|
2757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
2982
2758
|
import_elements_react20.OryProvider,
|
|
2983
2759
|
{
|
|
2984
2760
|
config,
|
|
2985
2761
|
flow,
|
|
2986
|
-
flowType:
|
|
2762
|
+
flowType: import_client_fetch16.FlowType.Recovery,
|
|
2987
2763
|
components,
|
|
2988
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
2764
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_elements_react20.OryTwoStepCard, {})
|
|
2989
2765
|
}
|
|
2990
2766
|
);
|
|
2991
2767
|
}
|
|
2992
2768
|
|
|
2993
2769
|
// src/theme/default/flows/registration.tsx
|
|
2994
|
-
var
|
|
2770
|
+
var import_client_fetch17 = require("@ory/client-fetch");
|
|
2995
2771
|
var import_elements_react21 = require("@ory/elements-react");
|
|
2996
|
-
var
|
|
2772
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
2997
2773
|
function Registration({
|
|
2998
2774
|
flow,
|
|
2999
2775
|
children,
|
|
@@ -3001,22 +2777,22 @@ function Registration({
|
|
|
3001
2777
|
config
|
|
3002
2778
|
}) {
|
|
3003
2779
|
const components = getOryComponents(flowOverrideComponents);
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
2780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3005
2781
|
import_elements_react21.OryProvider,
|
|
3006
2782
|
{
|
|
3007
2783
|
config,
|
|
3008
2784
|
flow,
|
|
3009
|
-
flowType:
|
|
2785
|
+
flowType: import_client_fetch17.FlowType.Registration,
|
|
3010
2786
|
components,
|
|
3011
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
2787
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_elements_react21.OryTwoStepCard, {})
|
|
3012
2788
|
}
|
|
3013
2789
|
);
|
|
3014
2790
|
}
|
|
3015
2791
|
|
|
3016
2792
|
// src/theme/default/flows/settings.tsx
|
|
3017
|
-
var
|
|
2793
|
+
var import_client_fetch18 = require("@ory/client-fetch");
|
|
3018
2794
|
var import_elements_react22 = require("@ory/elements-react");
|
|
3019
|
-
var
|
|
2795
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3020
2796
|
function Settings({
|
|
3021
2797
|
flow,
|
|
3022
2798
|
config,
|
|
@@ -3024,25 +2800,25 @@ function Settings({
|
|
|
3024
2800
|
components: flowOverrideComponents
|
|
3025
2801
|
}) {
|
|
3026
2802
|
const components = getOryComponents(flowOverrideComponents);
|
|
3027
|
-
return /* @__PURE__ */ (0,
|
|
2803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3028
2804
|
import_elements_react22.OryProvider,
|
|
3029
2805
|
{
|
|
3030
2806
|
config,
|
|
3031
2807
|
flow,
|
|
3032
|
-
flowType:
|
|
2808
|
+
flowType: import_client_fetch18.FlowType.Settings,
|
|
3033
2809
|
components,
|
|
3034
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
3035
|
-
/* @__PURE__ */ (0,
|
|
3036
|
-
/* @__PURE__ */ (0,
|
|
2810
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
2811
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_elements_react22.HeadlessPageHeader, {}),
|
|
2812
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_elements_react22.OrySettingsCard, {})
|
|
3037
2813
|
] })
|
|
3038
2814
|
}
|
|
3039
2815
|
);
|
|
3040
2816
|
}
|
|
3041
2817
|
|
|
3042
2818
|
// src/theme/default/flows/verification.tsx
|
|
3043
|
-
var
|
|
2819
|
+
var import_client_fetch19 = require("@ory/client-fetch");
|
|
3044
2820
|
var import_elements_react23 = require("@ory/elements-react");
|
|
3045
|
-
var
|
|
2821
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3046
2822
|
function Verification({
|
|
3047
2823
|
flow,
|
|
3048
2824
|
config,
|
|
@@ -3050,14 +2826,14 @@ function Verification({
|
|
|
3050
2826
|
components: flowOverrideComponents
|
|
3051
2827
|
}) {
|
|
3052
2828
|
const components = getOryComponents(flowOverrideComponents);
|
|
3053
|
-
return /* @__PURE__ */ (0,
|
|
2829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3054
2830
|
import_elements_react23.OryProvider,
|
|
3055
2831
|
{
|
|
3056
2832
|
config,
|
|
3057
2833
|
flow,
|
|
3058
|
-
flowType:
|
|
2834
|
+
flowType: import_client_fetch19.FlowType.Verification,
|
|
3059
2835
|
components,
|
|
3060
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
2836
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_elements_react23.OryTwoStepCard, {})
|
|
3061
2837
|
}
|
|
3062
2838
|
);
|
|
3063
2839
|
}
|