@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
|
@@ -105,13 +105,6 @@ var ComponentContext = createContext({
|
|
|
105
105
|
nodeSorter: () => 0,
|
|
106
106
|
groupSorter: () => 0
|
|
107
107
|
});
|
|
108
|
-
function useComponents() {
|
|
109
|
-
const ctx = useContext(ComponentContext);
|
|
110
|
-
if (!ctx) {
|
|
111
|
-
throw new Error("useComponents must be used within a ComponentProvider");
|
|
112
|
-
}
|
|
113
|
-
return ctx.components;
|
|
114
|
-
}
|
|
115
108
|
var defaultGroupOrder = [
|
|
116
109
|
UiNodeGroupEnum.Default,
|
|
117
110
|
UiNodeGroupEnum.Profile,
|
|
@@ -125,54 +118,6 @@ var defaultGroupOrder = [
|
|
|
125
118
|
];
|
|
126
119
|
|
|
127
120
|
// src/util/ui/index.ts
|
|
128
|
-
function triggerToWindowCall(trigger) {
|
|
129
|
-
if (!trigger) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const fn = triggerToFunction(trigger);
|
|
133
|
-
if (fn) {
|
|
134
|
-
fn();
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
let i = 0;
|
|
138
|
-
const ms = 100;
|
|
139
|
-
const interval = setInterval(() => {
|
|
140
|
-
i++;
|
|
141
|
-
if (i > 100) {
|
|
142
|
-
clearInterval(interval);
|
|
143
|
-
throw new Error(
|
|
144
|
-
"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."
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
const fn2 = triggerToFunction(trigger);
|
|
148
|
-
if (fn2) {
|
|
149
|
-
clearInterval(interval);
|
|
150
|
-
return fn2();
|
|
151
|
-
}
|
|
152
|
-
}, ms);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
function triggerToFunction(trigger) {
|
|
156
|
-
if (typeof window === "undefined") {
|
|
157
|
-
console.debug(
|
|
158
|
-
"The Ory SDK is missing a required function: window is undefined."
|
|
159
|
-
);
|
|
160
|
-
return void 0;
|
|
161
|
-
}
|
|
162
|
-
const typedWindow = window;
|
|
163
|
-
if (!(trigger in typedWindow) || !typedWindow[trigger]) {
|
|
164
|
-
console.debug(`The Ory SDK is missing a required function: ${trigger}.`);
|
|
165
|
-
return void 0;
|
|
166
|
-
}
|
|
167
|
-
const triggerFn = typedWindow[trigger];
|
|
168
|
-
if (typeof triggerFn !== "function") {
|
|
169
|
-
console.debug(
|
|
170
|
-
`The Ory SDK is missing a required function: ${trigger}. It is not a function.`
|
|
171
|
-
);
|
|
172
|
-
return void 0;
|
|
173
|
-
}
|
|
174
|
-
return triggerFn;
|
|
175
|
-
}
|
|
176
121
|
function nodesToAuthMethodGroups(nodes, excludeAuthMethods = []) {
|
|
177
122
|
var _a;
|
|
178
123
|
const groups = {};
|
|
@@ -352,7 +297,7 @@ function VerificationCardFooter() {
|
|
|
352
297
|
}
|
|
353
298
|
|
|
354
299
|
// src/theme/default/components/card/header.tsx
|
|
355
|
-
import { useComponents
|
|
300
|
+
import { useComponents, useOryFlow as useOryFlow3 } from "@ory/elements-react";
|
|
356
301
|
|
|
357
302
|
// src/theme/default/utils/constructCardHeader.ts
|
|
358
303
|
import {
|
|
@@ -668,7 +613,7 @@ function guessRegistrationBackButton(uiNodes) {
|
|
|
668
613
|
// src/theme/default/components/card/header.tsx
|
|
669
614
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
670
615
|
function InnerCardHeader({ title, text }) {
|
|
671
|
-
const { Card } =
|
|
616
|
+
const { Card } = useComponents();
|
|
672
617
|
return /* @__PURE__ */ jsxs6("header", { className: "flex flex-col gap-8 antialiased", children: [
|
|
673
618
|
/* @__PURE__ */ jsx8(Card.Logo, {}),
|
|
674
619
|
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-2", children: [
|
|
@@ -1523,9 +1468,33 @@ import {
|
|
|
1523
1468
|
uiTextToFormattedMessage as uiTextToFormattedMessage6,
|
|
1524
1469
|
useOryFlow as useOryFlow7
|
|
1525
1470
|
} from "@ory/elements-react";
|
|
1471
|
+
import { useRef, useState as useState2 } from "react";
|
|
1526
1472
|
import { useFormContext as useFormContext4 } from "react-hook-form";
|
|
1527
1473
|
import { useIntl as useIntl9 } from "react-intl";
|
|
1474
|
+
|
|
1475
|
+
// src/theme/default/assets/icons/eye-off.svg
|
|
1476
|
+
import * as React24 from "react";
|
|
1528
1477
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1478
|
+
var SvgEyeOff = (props) => {
|
|
1479
|
+
var _a, _b;
|
|
1480
|
+
return /* @__PURE__ */ jsx42("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__ */ jsx42("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" }) });
|
|
1481
|
+
};
|
|
1482
|
+
var eye_off_default = SvgEyeOff;
|
|
1483
|
+
|
|
1484
|
+
// src/theme/default/assets/icons/eye.svg
|
|
1485
|
+
import * as React25 from "react";
|
|
1486
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1487
|
+
var SvgEye = (props) => {
|
|
1488
|
+
var _a, _b;
|
|
1489
|
+
return /* @__PURE__ */ jsx43("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__ */ jsxs23("g", { strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1490
|
+
/* @__PURE__ */ jsx43("path", { stroke: "currentColor", d: "M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0" }),
|
|
1491
|
+
/* @__PURE__ */ jsx43("path", { stroke: "#64748B", d: "M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6" })
|
|
1492
|
+
] }) });
|
|
1493
|
+
};
|
|
1494
|
+
var eye_default = SvgEye;
|
|
1495
|
+
|
|
1496
|
+
// src/theme/default/components/form/input.tsx
|
|
1497
|
+
import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1529
1498
|
var DefaultInput = ({
|
|
1530
1499
|
node,
|
|
1531
1500
|
attributes,
|
|
@@ -1543,6 +1512,7 @@ var DefaultInput = ({
|
|
|
1543
1512
|
} = attributes;
|
|
1544
1513
|
const intl = useIntl9();
|
|
1545
1514
|
const { flowType } = useOryFlow7();
|
|
1515
|
+
const inputRef = useRef(null);
|
|
1546
1516
|
const formattedLabel = label ? intl.formatMessage(
|
|
1547
1517
|
{
|
|
1548
1518
|
id: "input.placeholder",
|
|
@@ -1552,29 +1522,79 @@ var DefaultInput = ({
|
|
|
1552
1522
|
placeholder: uiTextToFormattedMessage6(label, intl)
|
|
1553
1523
|
}
|
|
1554
1524
|
) : "";
|
|
1555
|
-
|
|
1556
|
-
|
|
1525
|
+
if (rest.type === "hidden") {
|
|
1526
|
+
return /* @__PURE__ */ jsx44(
|
|
1527
|
+
"input",
|
|
1528
|
+
{
|
|
1529
|
+
...rest,
|
|
1530
|
+
onClick,
|
|
1531
|
+
maxLength: maxlength,
|
|
1532
|
+
autoComplete: autocomplete,
|
|
1533
|
+
placeholder: formattedLabel,
|
|
1534
|
+
"data-testid": `ory/form/node/input/${name}`,
|
|
1535
|
+
...register(name, { value })
|
|
1536
|
+
}
|
|
1537
|
+
);
|
|
1538
|
+
}
|
|
1539
|
+
const { ref, ...restRegister } = register(name, { value });
|
|
1540
|
+
return /* @__PURE__ */ jsxs24(
|
|
1541
|
+
"div",
|
|
1557
1542
|
{
|
|
1558
|
-
...rest,
|
|
1559
|
-
onClick,
|
|
1560
|
-
maxLength: maxlength,
|
|
1561
|
-
autoComplete: autocomplete,
|
|
1562
|
-
placeholder: formattedLabel,
|
|
1563
|
-
"data-testid": `ory/form/node/input/${name}`,
|
|
1564
1543
|
className: cn(
|
|
1565
|
-
"
|
|
1566
|
-
"bg-input-background-default border-input-border-default text-input-foreground-primary",
|
|
1567
|
-
"disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled",
|
|
1568
|
-
"focus:border-input-border-focus focus-visible:border-input-border-focus",
|
|
1569
|
-
"hover:bg-input-background-hover hover:border-input-border-hover",
|
|
1570
|
-
"px-4 py-[13px]",
|
|
1544
|
+
"relative flex justify-stretch",
|
|
1571
1545
|
// The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
|
|
1572
1546
|
flowType === FlowType5.Settings && "max-w-[488px]"
|
|
1573
1547
|
),
|
|
1574
|
-
|
|
1548
|
+
children: [
|
|
1549
|
+
/* @__PURE__ */ jsx44(
|
|
1550
|
+
"input",
|
|
1551
|
+
{
|
|
1552
|
+
...rest,
|
|
1553
|
+
onClick,
|
|
1554
|
+
maxLength: maxlength,
|
|
1555
|
+
autoComplete: autocomplete,
|
|
1556
|
+
placeholder: formattedLabel,
|
|
1557
|
+
"data-testid": `ory/form/node/input/${name}`,
|
|
1558
|
+
className: cn(
|
|
1559
|
+
"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",
|
|
1560
|
+
"bg-input-background-default border-input-border-default text-input-foreground-primary",
|
|
1561
|
+
"disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled",
|
|
1562
|
+
"focus:border-input-border-focus focus-visible:border-input-border-focus",
|
|
1563
|
+
"hover:bg-input-background-hover hover:border-input-border-hover",
|
|
1564
|
+
"px-4 py-[13px]"
|
|
1565
|
+
),
|
|
1566
|
+
ref: (e) => {
|
|
1567
|
+
inputRef.current = e;
|
|
1568
|
+
ref(e);
|
|
1569
|
+
},
|
|
1570
|
+
...restRegister
|
|
1571
|
+
}
|
|
1572
|
+
),
|
|
1573
|
+
rest.type === "password" && /* @__PURE__ */ jsx44(PasswordToggle, { inputRef })
|
|
1574
|
+
]
|
|
1575
1575
|
}
|
|
1576
1576
|
);
|
|
1577
1577
|
};
|
|
1578
|
+
function PasswordToggle({
|
|
1579
|
+
inputRef
|
|
1580
|
+
}) {
|
|
1581
|
+
const [shown, setShown] = useState2(false);
|
|
1582
|
+
const handleClick = () => {
|
|
1583
|
+
setShown(!shown);
|
|
1584
|
+
if (inputRef.current) {
|
|
1585
|
+
inputRef.current.type = shown ? "password" : "text";
|
|
1586
|
+
}
|
|
1587
|
+
};
|
|
1588
|
+
return /* @__PURE__ */ jsx44(
|
|
1589
|
+
"button",
|
|
1590
|
+
{
|
|
1591
|
+
onClick: handleClick,
|
|
1592
|
+
className: "absolute right-0 h-full w-12 flex items-center justify-center",
|
|
1593
|
+
type: "button",
|
|
1594
|
+
children: shown ? /* @__PURE__ */ jsx44(eye_off_default, {}) : /* @__PURE__ */ jsx44(eye_default, {})
|
|
1595
|
+
}
|
|
1596
|
+
);
|
|
1597
|
+
}
|
|
1578
1598
|
|
|
1579
1599
|
// src/theme/default/components/form/label.tsx
|
|
1580
1600
|
import {
|
|
@@ -1585,12 +1605,12 @@ import {
|
|
|
1585
1605
|
import {
|
|
1586
1606
|
messageTestId as messageTestId3,
|
|
1587
1607
|
uiTextToFormattedMessage as uiTextToFormattedMessage7,
|
|
1588
|
-
useComponents as
|
|
1608
|
+
useComponents as useComponents2,
|
|
1589
1609
|
useOryFlow as useOryFlow8
|
|
1590
1610
|
} from "@ory/elements-react";
|
|
1591
1611
|
import { useFormContext as useFormContext5 } from "react-hook-form";
|
|
1592
1612
|
import { useIntl as useIntl10 } from "react-intl";
|
|
1593
|
-
import { jsx as
|
|
1613
|
+
import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1594
1614
|
function findResendNode(nodes) {
|
|
1595
1615
|
return nodes.find(
|
|
1596
1616
|
(n) => "name" in n.attributes && (n.attributes.name === "email" && n.attributes.type === "submit" || n.attributes.name === "resend")
|
|
@@ -1604,7 +1624,7 @@ function DefaultLabel({
|
|
|
1604
1624
|
}) {
|
|
1605
1625
|
const intl = useIntl10();
|
|
1606
1626
|
const label = getNodeLabel4(node);
|
|
1607
|
-
const { Message } =
|
|
1627
|
+
const { Message } = useComponents2();
|
|
1608
1628
|
const { config, flowType, flow } = useOryFlow8();
|
|
1609
1629
|
const { setValue, formState } = useFormContext5();
|
|
1610
1630
|
const isPassword = attributes.type === "password";
|
|
@@ -1615,9 +1635,9 @@ function DefaultLabel({
|
|
|
1615
1635
|
}
|
|
1616
1636
|
};
|
|
1617
1637
|
const fieldError = formState.errors[attributes.name];
|
|
1618
|
-
return /* @__PURE__ */
|
|
1619
|
-
label && /* @__PURE__ */
|
|
1620
|
-
/* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-1 antialiased", children: [
|
|
1639
|
+
label && /* @__PURE__ */ jsxs25("span", { className: "inline-flex justify-between", children: [
|
|
1640
|
+
/* @__PURE__ */ jsx45(
|
|
1621
1641
|
"label",
|
|
1622
1642
|
{
|
|
1623
1643
|
...messageTestId3(label),
|
|
@@ -1629,7 +1649,7 @@ function DefaultLabel({
|
|
|
1629
1649
|
}
|
|
1630
1650
|
),
|
|
1631
1651
|
isPassword && config.project.recovery_enabled && flowType === FlowType6.Login && // TODO: make it possible to override with a custom component
|
|
1632
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ jsx45(
|
|
1633
1653
|
"a",
|
|
1634
1654
|
{
|
|
1635
1655
|
href: initFlowUrl(config.sdk.url, "recovery", flow),
|
|
@@ -1640,7 +1660,7 @@ function DefaultLabel({
|
|
|
1640
1660
|
})
|
|
1641
1661
|
}
|
|
1642
1662
|
),
|
|
1643
|
-
(resendNode == null ? void 0 : resendNode.attributes.node_type) === "input" && /* @__PURE__ */
|
|
1663
|
+
(resendNode == null ? void 0 : resendNode.attributes.node_type) === "input" && /* @__PURE__ */ jsx45(
|
|
1644
1664
|
"button",
|
|
1645
1665
|
{
|
|
1646
1666
|
type: "submit",
|
|
@@ -1653,8 +1673,8 @@ function DefaultLabel({
|
|
|
1653
1673
|
)
|
|
1654
1674
|
] }),
|
|
1655
1675
|
children,
|
|
1656
|
-
node.messages.map((message) => /* @__PURE__ */
|
|
1657
|
-
fieldError && instanceOfUiText(fieldError) && /* @__PURE__ */
|
|
1676
|
+
node.messages.map((message) => /* @__PURE__ */ jsx45(Message.Content, { message }, message.id)),
|
|
1677
|
+
fieldError && instanceOfUiText(fieldError) && /* @__PURE__ */ jsx45(Message.Content, { message: fieldError })
|
|
1658
1678
|
] });
|
|
1659
1679
|
}
|
|
1660
1680
|
|
|
@@ -1665,11 +1685,11 @@ import {
|
|
|
1665
1685
|
} from "@ory/elements-react";
|
|
1666
1686
|
import { forwardRef } from "react";
|
|
1667
1687
|
import { useIntl as useIntl11 } from "react-intl";
|
|
1668
|
-
import { jsx as
|
|
1688
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1669
1689
|
var DefaultLinkButton = forwardRef(({ attributes, node }, ref) => {
|
|
1670
1690
|
const intl = useIntl11();
|
|
1671
1691
|
const label = getNodeLabel5(node);
|
|
1672
|
-
return /* @__PURE__ */
|
|
1692
|
+
return /* @__PURE__ */ jsx46(
|
|
1673
1693
|
"a",
|
|
1674
1694
|
{
|
|
1675
1695
|
...attributes,
|
|
@@ -1690,9 +1710,9 @@ import { useFormContext as useFormContext6 } from "react-hook-form";
|
|
|
1690
1710
|
|
|
1691
1711
|
// src/theme/default/components/form/shadcn/otp-input.tsx
|
|
1692
1712
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
1693
|
-
import * as
|
|
1694
|
-
import { jsx as
|
|
1695
|
-
var InputOTP =
|
|
1713
|
+
import * as React26 from "react";
|
|
1714
|
+
import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1715
|
+
var InputOTP = React26.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
1696
1716
|
OTPInput,
|
|
1697
1717
|
{
|
|
1698
1718
|
ref,
|
|
@@ -1705,12 +1725,12 @@ var InputOTP = React24.forwardRef(({ className, containerClassName, ...props },
|
|
|
1705
1725
|
}
|
|
1706
1726
|
));
|
|
1707
1727
|
InputOTP.displayName = "InputOTP";
|
|
1708
|
-
var InputOTPGroup =
|
|
1728
|
+
var InputOTPGroup = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
1709
1729
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1710
|
-
var InputOTPSlot =
|
|
1711
|
-
const inputOTPContext =
|
|
1730
|
+
var InputOTPSlot = React26.forwardRef(({ index, className, ...props }, ref) => {
|
|
1731
|
+
const inputOTPContext = React26.useContext(OTPInputContext);
|
|
1712
1732
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
1713
|
-
return /* @__PURE__ */
|
|
1733
|
+
return /* @__PURE__ */ jsxs26(
|
|
1714
1734
|
"div",
|
|
1715
1735
|
{
|
|
1716
1736
|
ref,
|
|
@@ -1722,8 +1742,8 @@ var InputOTPSlot = React24.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
1722
1742
|
),
|
|
1723
1743
|
...props,
|
|
1724
1744
|
children: [
|
|
1725
|
-
/* @__PURE__ */
|
|
1726
|
-
hasFakeCaret && /* @__PURE__ */
|
|
1745
|
+
/* @__PURE__ */ jsx47("span", { className: "inline-block size-4", children: char }),
|
|
1746
|
+
hasFakeCaret && /* @__PURE__ */ jsx47("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx47("div", { className: "h-4 w-px animate-caret-blink bg-interface-background-brand-primary duration-700" }) })
|
|
1727
1747
|
]
|
|
1728
1748
|
}
|
|
1729
1749
|
);
|
|
@@ -1733,7 +1753,7 @@ InputOTPSlot.displayName = "InputOTPSlot";
|
|
|
1733
1753
|
// src/theme/default/components/form/pin-code-input.tsx
|
|
1734
1754
|
import { useOryFlow as useOryFlow9 } from "@ory/elements-react";
|
|
1735
1755
|
import { FlowType as FlowType7 } from "@ory/client-fetch";
|
|
1736
|
-
import { jsx as
|
|
1756
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1737
1757
|
var DefaultPinCodeInput = ({ attributes }) => {
|
|
1738
1758
|
const { setValue, watch } = useFormContext6();
|
|
1739
1759
|
const { maxlength, name } = attributes;
|
|
@@ -1743,14 +1763,14 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1743
1763
|
setValue(name, v);
|
|
1744
1764
|
};
|
|
1745
1765
|
const value = watch(name);
|
|
1746
|
-
return /* @__PURE__ */
|
|
1766
|
+
return /* @__PURE__ */ jsx48(
|
|
1747
1767
|
InputOTP,
|
|
1748
1768
|
{
|
|
1749
1769
|
maxLength: maxlength != null ? maxlength : 6,
|
|
1750
1770
|
onChange: handleInputChange,
|
|
1751
1771
|
name,
|
|
1752
1772
|
value,
|
|
1753
|
-
children: /* @__PURE__ */
|
|
1773
|
+
children: /* @__PURE__ */ jsx48(
|
|
1754
1774
|
InputOTPGroup,
|
|
1755
1775
|
{
|
|
1756
1776
|
className: cn(
|
|
@@ -1758,7 +1778,7 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1758
1778
|
// The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
|
|
1759
1779
|
flowType === FlowType7.Settings && "max-w-[488px]"
|
|
1760
1780
|
),
|
|
1761
|
-
children: [...Array(elements)].map((_, index) => /* @__PURE__ */
|
|
1781
|
+
children: [...Array(elements)].map((_, index) => /* @__PURE__ */ jsx48(InputOTPSlot, { index }, index))
|
|
1762
1782
|
}
|
|
1763
1783
|
)
|
|
1764
1784
|
}
|
|
@@ -1766,13 +1786,13 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1766
1786
|
};
|
|
1767
1787
|
|
|
1768
1788
|
// src/theme/default/components/form/section.tsx
|
|
1769
|
-
import { jsx as
|
|
1789
|
+
import { jsx as jsx49, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1770
1790
|
var DefaultFormSection = ({
|
|
1771
1791
|
children,
|
|
1772
1792
|
nodes: _nodes,
|
|
1773
1793
|
...rest
|
|
1774
1794
|
}) => {
|
|
1775
|
-
return /* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ jsx49(
|
|
1776
1796
|
"form",
|
|
1777
1797
|
{
|
|
1778
1798
|
className: "flex w-full max-w-screen-sm flex-col md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] px-4",
|
|
@@ -1786,10 +1806,10 @@ var DefaultFormSectionContent = ({
|
|
|
1786
1806
|
description,
|
|
1787
1807
|
children
|
|
1788
1808
|
}) => {
|
|
1789
|
-
return /* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
/* @__PURE__ */
|
|
1809
|
+
return /* @__PURE__ */ jsxs27("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: [
|
|
1810
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-2", children: [
|
|
1811
|
+
/* @__PURE__ */ jsx49("h3", { className: "font-medium text-interface-foreground-default-primary", children: title }),
|
|
1812
|
+
/* @__PURE__ */ jsx49("span", { className: "text-interface-foreground-default-secondary", children: description })
|
|
1793
1813
|
] }),
|
|
1794
1814
|
children
|
|
1795
1815
|
] });
|
|
@@ -1798,14 +1818,14 @@ var DefaultFormSectionFooter = ({
|
|
|
1798
1818
|
children,
|
|
1799
1819
|
text
|
|
1800
1820
|
}) => {
|
|
1801
|
-
return /* @__PURE__ */
|
|
1821
|
+
return /* @__PURE__ */ jsxs27(
|
|
1802
1822
|
"div",
|
|
1803
1823
|
{
|
|
1804
1824
|
className: cn(
|
|
1805
1825
|
"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"
|
|
1806
1826
|
),
|
|
1807
1827
|
children: [
|
|
1808
|
-
/* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ jsx49("span", { children: text }),
|
|
1809
1829
|
children
|
|
1810
1830
|
]
|
|
1811
1831
|
}
|
|
@@ -1815,31 +1835,31 @@ var DefaultFormSectionFooter = ({
|
|
|
1815
1835
|
// src/theme/default/components/form/text.tsx
|
|
1816
1836
|
import { uiTextToFormattedMessage as uiTextToFormattedMessage9 } from "@ory/elements-react";
|
|
1817
1837
|
import { useIntl as useIntl12 } from "react-intl";
|
|
1818
|
-
import { Fragment as Fragment4, jsx as
|
|
1838
|
+
import { Fragment as Fragment4, jsx as jsx50, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1819
1839
|
function DefaultText({ node, attributes }) {
|
|
1820
1840
|
var _a;
|
|
1821
1841
|
const intl = useIntl12();
|
|
1822
1842
|
const lookup = (_a = attributes.text.context) == null ? void 0 : _a.secrets;
|
|
1823
1843
|
if (lookup) {
|
|
1824
|
-
return /* @__PURE__ */
|
|
1825
|
-
/* @__PURE__ */
|
|
1826
|
-
lookup.map((text, index) => /* @__PURE__ */
|
|
1844
|
+
return /* @__PURE__ */ jsxs28(Fragment4, { children: [
|
|
1845
|
+
/* @__PURE__ */ jsx50("p", { "data-testid": `ory/form/node/text/${attributes.id}/label`, children: node.meta.label ? uiTextToFormattedMessage9(node.meta.label, intl) : "" }),
|
|
1846
|
+
lookup.map((text, index) => /* @__PURE__ */ jsx50(
|
|
1827
1847
|
"pre",
|
|
1828
1848
|
{
|
|
1829
1849
|
"data-testid": `ory/form/node/text/lookup_secret_codes/text`,
|
|
1830
|
-
children: /* @__PURE__ */
|
|
1850
|
+
children: /* @__PURE__ */ jsx50("code", { children: text ? uiTextToFormattedMessage9(text, intl) : "" })
|
|
1831
1851
|
},
|
|
1832
1852
|
index
|
|
1833
1853
|
))
|
|
1834
1854
|
] });
|
|
1835
1855
|
}
|
|
1836
|
-
return /* @__PURE__ */
|
|
1856
|
+
return /* @__PURE__ */ jsx50(Fragment4, { children: /* @__PURE__ */ jsxs28(
|
|
1837
1857
|
"p",
|
|
1838
1858
|
{
|
|
1839
1859
|
"data-testid": `ory/form/node/text/${attributes.id}/label`,
|
|
1840
1860
|
id: attributes.id,
|
|
1841
1861
|
children: [
|
|
1842
|
-
node.meta.label ? /* @__PURE__ */
|
|
1862
|
+
node.meta.label ? /* @__PURE__ */ jsx50("label", { children: uiTextToFormattedMessage9(node.meta.label, intl) }) : null,
|
|
1843
1863
|
attributes.text ? uiTextToFormattedMessage9(attributes.text, intl) : ""
|
|
1844
1864
|
]
|
|
1845
1865
|
}
|
|
@@ -1847,11 +1867,11 @@ function DefaultText({ node, attributes }) {
|
|
|
1847
1867
|
}
|
|
1848
1868
|
|
|
1849
1869
|
// src/theme/default/components/generic/page-header.tsx
|
|
1850
|
-
import { useComponents as
|
|
1870
|
+
import { useComponents as useComponents3 } from "@ory/elements-react";
|
|
1851
1871
|
|
|
1852
1872
|
// src/theme/default/components/ui/user-menu.tsx
|
|
1853
1873
|
import { DropdownMenuLabel as DropdownMenuLabel2 } from "@radix-ui/react-dropdown-menu";
|
|
1854
|
-
import { useCallback, useEffect as useEffect3, useState as
|
|
1874
|
+
import { useCallback, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1855
1875
|
import { useOryFlow as useOryFlow10 } from "@ory/elements-react";
|
|
1856
1876
|
|
|
1857
1877
|
// src/util/client.ts
|
|
@@ -1872,22 +1892,22 @@ function frontendClient(sdkUrl, opts = {}) {
|
|
|
1872
1892
|
}
|
|
1873
1893
|
|
|
1874
1894
|
// src/theme/default/assets/icons/logout.svg
|
|
1875
|
-
import * as
|
|
1876
|
-
import { jsx as
|
|
1895
|
+
import * as React27 from "react";
|
|
1896
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
1877
1897
|
var SvgLogout = (props) => {
|
|
1878
1898
|
var _a, _b;
|
|
1879
|
-
return /* @__PURE__ */
|
|
1899
|
+
return /* @__PURE__ */ jsx51("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__ */ jsx51("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" }) });
|
|
1880
1900
|
};
|
|
1881
1901
|
var logout_default = SvgLogout;
|
|
1882
1902
|
|
|
1883
1903
|
// src/theme/default/assets/icons/settings.svg
|
|
1884
|
-
import * as
|
|
1885
|
-
import { jsx as
|
|
1904
|
+
import * as React28 from "react";
|
|
1905
|
+
import { jsx as jsx52, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1886
1906
|
var SvgSettings = (props) => {
|
|
1887
1907
|
var _a, _b;
|
|
1888
|
-
return /* @__PURE__ */
|
|
1889
|
-
/* @__PURE__ */
|
|
1890
|
-
/* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ jsx52("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__ */ jsxs29("g", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1909
|
+
/* @__PURE__ */ jsx52("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" }),
|
|
1910
|
+
/* @__PURE__ */ jsx52("path", { d: "M6 8a2 2 0 1 0 4 0 2 2 0 0 0-4 0" })
|
|
1891
1911
|
] }) });
|
|
1892
1912
|
};
|
|
1893
1913
|
var settings_default = SvgSettings;
|
|
@@ -1934,10 +1954,10 @@ var getUserInitials = (session) => {
|
|
|
1934
1954
|
// src/theme/default/components/ui/dropdown-menu.tsx
|
|
1935
1955
|
import { forwardRef as forwardRef3 } from "react";
|
|
1936
1956
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1937
|
-
import { jsx as
|
|
1957
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
1938
1958
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1939
1959
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1940
|
-
var DropdownMenuContent = forwardRef3(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */
|
|
1960
|
+
var DropdownMenuContent = forwardRef3(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */ jsx53(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx53(
|
|
1941
1961
|
DropdownMenuPrimitive.Content,
|
|
1942
1962
|
{
|
|
1943
1963
|
ref,
|
|
@@ -1952,7 +1972,7 @@ var DropdownMenuContent = forwardRef3(({ className, sideOffset = 16, ...props },
|
|
|
1952
1972
|
}
|
|
1953
1973
|
) }));
|
|
1954
1974
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1955
|
-
var DropdownMenuItem = forwardRef3(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
1975
|
+
var DropdownMenuItem = forwardRef3(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx53(
|
|
1956
1976
|
DropdownMenuPrimitive.Item,
|
|
1957
1977
|
{
|
|
1958
1978
|
ref,
|
|
@@ -1970,7 +1990,7 @@ var DropdownMenuItem = forwardRef3(({ className, inset, ...props }, ref) => /* @
|
|
|
1970
1990
|
}
|
|
1971
1991
|
));
|
|
1972
1992
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1973
|
-
var DropdownMenuLabel = forwardRef3(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
1993
|
+
var DropdownMenuLabel = forwardRef3(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx53(
|
|
1974
1994
|
DropdownMenuPrimitive.Label,
|
|
1975
1995
|
{
|
|
1976
1996
|
ref,
|
|
@@ -1988,32 +2008,32 @@ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
|
1988
2008
|
import { forwardRef as forwardRef4 } from "react";
|
|
1989
2009
|
|
|
1990
2010
|
// src/theme/default/assets/icons/user.svg
|
|
1991
|
-
import * as
|
|
1992
|
-
import { jsx as
|
|
2011
|
+
import * as React29 from "react";
|
|
2012
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
1993
2013
|
var SvgUser = (props) => {
|
|
1994
2014
|
var _a, _b;
|
|
1995
|
-
return /* @__PURE__ */
|
|
2015
|
+
return /* @__PURE__ */ jsx54("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__ */ jsx54("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" }) });
|
|
1996
2016
|
};
|
|
1997
2017
|
var user_default = SvgUser;
|
|
1998
2018
|
|
|
1999
2019
|
// src/theme/default/components/ui/user-avater.tsx
|
|
2000
|
-
import { jsx as
|
|
2020
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2001
2021
|
var UserAvatar = forwardRef4(
|
|
2002
2022
|
({ initials, ...rest }, ref) => {
|
|
2003
|
-
return /* @__PURE__ */
|
|
2023
|
+
return /* @__PURE__ */ jsx55(
|
|
2004
2024
|
"button",
|
|
2005
2025
|
{
|
|
2006
2026
|
ref,
|
|
2007
2027
|
className: "relative flex size-10 items-center justify-center overflow-hidden rounded-[999px] bg-button-primary-background-default hover:bg-button-primary-background-hover",
|
|
2008
2028
|
...rest,
|
|
2009
|
-
children: /* @__PURE__ */
|
|
2029
|
+
children: /* @__PURE__ */ jsx55("div", { className: "relative flex size-full items-center justify-center", children: initials.avatar ? /* @__PURE__ */ jsx55(
|
|
2010
2030
|
"img",
|
|
2011
2031
|
{
|
|
2012
2032
|
src: initials.avatar,
|
|
2013
2033
|
alt: initials.primary,
|
|
2014
2034
|
className: "w-full object-contain"
|
|
2015
2035
|
}
|
|
2016
|
-
) : /* @__PURE__ */
|
|
2036
|
+
) : /* @__PURE__ */ jsx55(
|
|
2017
2037
|
user_default,
|
|
2018
2038
|
{
|
|
2019
2039
|
size: 24,
|
|
@@ -2027,11 +2047,11 @@ var UserAvatar = forwardRef4(
|
|
|
2027
2047
|
UserAvatar.displayName = "UserAvatar";
|
|
2028
2048
|
|
|
2029
2049
|
// src/theme/default/components/ui/user-menu.tsx
|
|
2030
|
-
import { jsx as
|
|
2050
|
+
import { jsx as jsx56, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2031
2051
|
var UserMenu = ({ session }) => {
|
|
2032
2052
|
const { config } = useOryFlow10();
|
|
2033
2053
|
const initials = getUserInitials(session);
|
|
2034
|
-
const [logoutFlow, setLogoutFlow] =
|
|
2054
|
+
const [logoutFlow, setLogoutFlow] = useState3();
|
|
2035
2055
|
const fetchLogoutFlow = useCallback(async () => {
|
|
2036
2056
|
const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow();
|
|
2037
2057
|
setLogoutFlow(flow);
|
|
@@ -2039,22 +2059,22 @@ var UserMenu = ({ session }) => {
|
|
|
2039
2059
|
useEffect3(() => {
|
|
2040
2060
|
void fetchLogoutFlow();
|
|
2041
2061
|
}, [fetchLogoutFlow]);
|
|
2042
|
-
return /* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */
|
|
2044
|
-
/* @__PURE__ */
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
initials.secondary && /* @__PURE__ */
|
|
2062
|
+
return /* @__PURE__ */ jsxs30(DropdownMenu, { children: [
|
|
2063
|
+
/* @__PURE__ */ jsx56(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx56(UserAvatar, { initials }) }),
|
|
2064
|
+
/* @__PURE__ */ jsxs30(DropdownMenuContent, { children: [
|
|
2065
|
+
/* @__PURE__ */ jsxs30(DropdownMenuLabel2, { className: "flex gap-3 px-5 py-4.5", children: [
|
|
2066
|
+
/* @__PURE__ */ jsx56(UserAvatar, { disabled: true, initials }),
|
|
2067
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-col justify-center text-sm leading-tight", children: [
|
|
2068
|
+
/* @__PURE__ */ jsx56("div", { className: "text-interface-foreground-default-primary leading-tight font-medium", children: initials.primary }),
|
|
2069
|
+
initials.secondary && /* @__PURE__ */ jsx56("div", { className: "text-interface-foreground-default-tertiary leading-tight", children: initials.secondary })
|
|
2050
2070
|
] })
|
|
2051
2071
|
] }),
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2072
|
+
/* @__PURE__ */ jsx56(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs30("a", { href: "/settings", children: [
|
|
2073
|
+
/* @__PURE__ */ jsx56(settings_default, { size: 16 }),
|
|
2054
2074
|
" User settings"
|
|
2055
2075
|
] }) }),
|
|
2056
|
-
/* @__PURE__ */
|
|
2057
|
-
/* @__PURE__ */
|
|
2076
|
+
/* @__PURE__ */ jsx56(DropdownMenuItem, { asChild: true, disabled: !(logoutFlow == null ? void 0 : logoutFlow.logout_url), children: /* @__PURE__ */ jsxs30("a", { href: logoutFlow == null ? void 0 : logoutFlow.logout_url, children: [
|
|
2077
|
+
/* @__PURE__ */ jsx56(logout_default, { size: 16 }),
|
|
2058
2078
|
" Logout"
|
|
2059
2079
|
] }) })
|
|
2060
2080
|
] })
|
|
@@ -2063,13 +2083,13 @@ var UserMenu = ({ session }) => {
|
|
|
2063
2083
|
|
|
2064
2084
|
// src/theme/default/components/generic/page-header.tsx
|
|
2065
2085
|
import { useSession } from "@ory/elements-react/client";
|
|
2066
|
-
import { jsx as
|
|
2086
|
+
import { jsx as jsx57, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2067
2087
|
var DefaultPageHeader = (_props) => {
|
|
2068
|
-
const { Card } =
|
|
2088
|
+
const { Card } = useComponents3();
|
|
2069
2089
|
const { session } = useSession();
|
|
2070
|
-
return /* @__PURE__ */
|
|
2071
|
-
/* @__PURE__ */
|
|
2072
|
-
/* @__PURE__ */
|
|
2090
|
+
return /* @__PURE__ */ jsx57("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__ */ jsx57("div", { className: "flex flex-col gap-12", children: /* @__PURE__ */ jsxs31("div", { className: "flex max-h-10 flex-1 justify-between gap-2", children: [
|
|
2091
|
+
/* @__PURE__ */ jsx57("div", { className: "relative h-10 flex-1", children: /* @__PURE__ */ jsx57(Card.Logo, {}) }),
|
|
2092
|
+
/* @__PURE__ */ jsx57(UserMenu, { session })
|
|
2073
2093
|
] }) }) });
|
|
2074
2094
|
};
|
|
2075
2095
|
|
|
@@ -2079,26 +2099,26 @@ import { useFormContext as useFormContext7 } from "react-hook-form";
|
|
|
2079
2099
|
import { useDebounceValue as useDebounceValue2 } from "usehooks-ts";
|
|
2080
2100
|
|
|
2081
2101
|
// src/theme/default/assets/icons/trash.svg
|
|
2082
|
-
import * as
|
|
2083
|
-
import { jsx as
|
|
2102
|
+
import * as React30 from "react";
|
|
2103
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2084
2104
|
var SvgTrash = (props) => {
|
|
2085
2105
|
var _a, _b;
|
|
2086
|
-
return /* @__PURE__ */
|
|
2106
|
+
return /* @__PURE__ */ jsx58("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__ */ jsx58("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" }) });
|
|
2087
2107
|
};
|
|
2088
2108
|
var trash_default = SvgTrash;
|
|
2089
2109
|
|
|
2090
2110
|
// src/theme/default/components/settings/settings-oidc.tsx
|
|
2091
|
-
import { jsx as
|
|
2111
|
+
import { jsx as jsx59, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2092
2112
|
function DefaultSettingsOidc({
|
|
2093
2113
|
linkButtons,
|
|
2094
2114
|
unlinkButtons
|
|
2095
2115
|
}) {
|
|
2096
2116
|
const hasLinkButtons = linkButtons.length > 0;
|
|
2097
2117
|
const hasUnlinkButtons = unlinkButtons.length > 0;
|
|
2098
|
-
return /* @__PURE__ */
|
|
2099
|
-
hasLinkButtons && /* @__PURE__ */
|
|
2118
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-8", children: [
|
|
2119
|
+
hasLinkButtons && /* @__PURE__ */ jsx59("div", { className: "grid items-start gap-3 grid-cols-1 sm:grid-cols-2 md:grid-cols-3", children: linkButtons.map((button) => {
|
|
2100
2120
|
const attrs = button.attributes;
|
|
2101
|
-
return /* @__PURE__ */
|
|
2121
|
+
return /* @__PURE__ */ jsx59(
|
|
2102
2122
|
DefaultButtonSocial,
|
|
2103
2123
|
{
|
|
2104
2124
|
showLabel: true,
|
|
@@ -2109,12 +2129,12 @@ function DefaultSettingsOidc({
|
|
|
2109
2129
|
attrs.value
|
|
2110
2130
|
);
|
|
2111
2131
|
}) }),
|
|
2112
|
-
hasUnlinkButtons && hasLinkButtons ? /* @__PURE__ */
|
|
2132
|
+
hasUnlinkButtons && hasLinkButtons ? /* @__PURE__ */ jsx59(DefaultHorizontalDivider, {}) : null,
|
|
2113
2133
|
unlinkButtons.map((button) => {
|
|
2114
2134
|
if (button.attributes.node_type !== "input") {
|
|
2115
2135
|
return null;
|
|
2116
2136
|
}
|
|
2117
|
-
return /* @__PURE__ */
|
|
2137
|
+
return /* @__PURE__ */ jsx59(UnlinkRow, { button }, button.attributes.value);
|
|
2118
2138
|
})
|
|
2119
2139
|
] });
|
|
2120
2140
|
}
|
|
@@ -2136,12 +2156,12 @@ function UnlinkRow({ button }) {
|
|
|
2136
2156
|
setClicked(false);
|
|
2137
2157
|
}
|
|
2138
2158
|
}, [isSubmitting, setClicked]);
|
|
2139
|
-
return /* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
Logo ? /* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2159
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex justify-between", children: [
|
|
2160
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-6", children: [
|
|
2161
|
+
Logo ? /* @__PURE__ */ jsx59(Logo, { size: 32 }) : /* @__PURE__ */ jsx59(provider_logos_default.generic, { size: 32 }),
|
|
2162
|
+
/* @__PURE__ */ jsx59("p", { className: "text-sm font-medium text-interface-foreground-default-secondary", children: provider })
|
|
2143
2163
|
] }),
|
|
2144
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ jsx59(
|
|
2145
2165
|
"button",
|
|
2146
2166
|
{
|
|
2147
2167
|
...attrs,
|
|
@@ -2150,7 +2170,7 @@ function UnlinkRow({ button }) {
|
|
|
2150
2170
|
disabled: isSubmitting,
|
|
2151
2171
|
className: "relative",
|
|
2152
2172
|
title: `Unlink ${provider}`,
|
|
2153
|
-
children: clicked ? /* @__PURE__ */
|
|
2173
|
+
children: clicked ? /* @__PURE__ */ jsx59(Spinner, { className: "relative" }) : /* @__PURE__ */ jsx59(
|
|
2154
2174
|
trash_default,
|
|
2155
2175
|
{
|
|
2156
2176
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2163,9 +2183,9 @@ function UnlinkRow({ button }) {
|
|
|
2163
2183
|
}
|
|
2164
2184
|
|
|
2165
2185
|
// src/theme/default/components/settings/settings-passkey.tsx
|
|
2166
|
-
import { useComponents as
|
|
2186
|
+
import { useComponents as useComponents4 } from "@ory/elements-react";
|
|
2167
2187
|
import { useFormContext as useFormContext8 } from "react-hook-form";
|
|
2168
|
-
import { jsx as
|
|
2188
|
+
import { jsx as jsx60, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2169
2189
|
function DefaultSettingsPasskey({
|
|
2170
2190
|
triggerButton,
|
|
2171
2191
|
removeButtons
|
|
@@ -2173,49 +2193,49 @@ function DefaultSettingsPasskey({
|
|
|
2173
2193
|
const {
|
|
2174
2194
|
formState: { isSubmitting }
|
|
2175
2195
|
} = useFormContext8();
|
|
2176
|
-
const { Node
|
|
2196
|
+
const { Node } = useComponents4();
|
|
2177
2197
|
const hasRemoveButtons = removeButtons.length > 0;
|
|
2178
|
-
return /* @__PURE__ */
|
|
2179
|
-
/* @__PURE__ */
|
|
2180
|
-
|
|
2198
|
+
return /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-8", children: [
|
|
2199
|
+
/* @__PURE__ */ jsx60("div", { className: "flex max-w-[60%] items-end gap-3", children: triggerButton && /* @__PURE__ */ jsx60(
|
|
2200
|
+
Node.Button,
|
|
2181
2201
|
{
|
|
2182
2202
|
node: triggerButton,
|
|
2183
2203
|
attributes: triggerButton.attributes,
|
|
2184
2204
|
onClick: triggerButton.onClick
|
|
2185
2205
|
}
|
|
2186
2206
|
) }),
|
|
2187
|
-
hasRemoveButtons ? /* @__PURE__ */
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
/* @__PURE__ */
|
|
2207
|
+
hasRemoveButtons ? /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-8", children: [
|
|
2208
|
+
/* @__PURE__ */ jsx60(DefaultHorizontalDivider, {}),
|
|
2209
|
+
/* @__PURE__ */ jsx60("div", { className: "flex flex-col gap-2", children: removeButtons.map((node, i) => {
|
|
2190
2210
|
var _a, _b;
|
|
2191
2211
|
const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
|
|
2192
2212
|
const addedAt = "added_at" in context ? context.added_at : null;
|
|
2193
2213
|
const displayName = "display_name" in context ? context.display_name : null;
|
|
2194
2214
|
const keyId = "value" in node.attributes ? node.attributes.value : null;
|
|
2195
|
-
return /* @__PURE__ */
|
|
2215
|
+
return /* @__PURE__ */ jsxs33(
|
|
2196
2216
|
"div",
|
|
2197
2217
|
{
|
|
2198
2218
|
className: "flex justify-between gap-6 md:items-center",
|
|
2199
2219
|
children: [
|
|
2200
|
-
/* @__PURE__ */
|
|
2201
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex gap-2 items-center flex-1 truncate", children: [
|
|
2221
|
+
/* @__PURE__ */ jsx60(
|
|
2202
2222
|
passkey_default,
|
|
2203
2223
|
{
|
|
2204
2224
|
size: 32,
|
|
2205
2225
|
className: "text-interface-foreground-default-primary"
|
|
2206
2226
|
}
|
|
2207
2227
|
),
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4 truncate", children: [
|
|
2229
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex-1 flex-col truncate", children: [
|
|
2230
|
+
/* @__PURE__ */ jsx60("p", { className: "text-sm font-medium text-interface-foreground-default-secondary truncate", children: displayName }),
|
|
2231
|
+
/* @__PURE__ */ jsx60("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block truncate", children: keyId })
|
|
2212
2232
|
] }),
|
|
2213
|
-
addedAt && /* @__PURE__ */
|
|
2233
|
+
addedAt && /* @__PURE__ */ jsx60("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
|
|
2214
2234
|
dateStyle: "long"
|
|
2215
2235
|
}).format(new Date(addedAt)) })
|
|
2216
2236
|
] })
|
|
2217
2237
|
] }),
|
|
2218
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ jsx60(
|
|
2219
2239
|
"button",
|
|
2220
2240
|
{
|
|
2221
2241
|
...node.attributes,
|
|
@@ -2223,7 +2243,7 @@ function DefaultSettingsPasskey({
|
|
|
2223
2243
|
onClick: node.onClick,
|
|
2224
2244
|
disabled: isSubmitting,
|
|
2225
2245
|
className: "relative",
|
|
2226
|
-
children: isSubmitting ? /* @__PURE__ */
|
|
2246
|
+
children: isSubmitting ? /* @__PURE__ */ jsx60(Spinner, { className: "relative" }) : /* @__PURE__ */ jsx60(
|
|
2227
2247
|
trash_default,
|
|
2228
2248
|
{
|
|
2229
2249
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2242,38 +2262,26 @@ function DefaultSettingsPasskey({
|
|
|
2242
2262
|
}
|
|
2243
2263
|
|
|
2244
2264
|
// src/theme/default/assets/icons/download.svg
|
|
2245
|
-
import * as
|
|
2246
|
-
import { jsx as
|
|
2265
|
+
import * as React31 from "react";
|
|
2266
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
2247
2267
|
var SvgDownload = (props) => {
|
|
2248
2268
|
var _a, _b;
|
|
2249
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ jsx61("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__ */ jsx61("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" }) });
|
|
2250
2270
|
};
|
|
2251
2271
|
var download_default = SvgDownload;
|
|
2252
2272
|
|
|
2253
|
-
// src/theme/default/assets/icons/eye.svg
|
|
2254
|
-
import * as React30 from "react";
|
|
2255
|
-
import { jsx as jsx60, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2256
|
-
var SvgEye = (props) => {
|
|
2257
|
-
var _a, _b;
|
|
2258
|
-
return /* @__PURE__ */ jsx60("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__ */ jsxs32("g", { strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2259
|
-
/* @__PURE__ */ jsx60("path", { stroke: "currentColor", d: "M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0" }),
|
|
2260
|
-
/* @__PURE__ */ jsx60("path", { stroke: "#64748B", d: "M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6" })
|
|
2261
|
-
] }) });
|
|
2262
|
-
};
|
|
2263
|
-
var eye_default = SvgEye;
|
|
2264
|
-
|
|
2265
2273
|
// src/theme/default/assets/icons/refresh.svg
|
|
2266
|
-
import * as
|
|
2267
|
-
import { jsx as
|
|
2274
|
+
import * as React32 from "react";
|
|
2275
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
2268
2276
|
var SvgRefresh = (props) => {
|
|
2269
2277
|
var _a, _b;
|
|
2270
|
-
return /* @__PURE__ */
|
|
2278
|
+
return /* @__PURE__ */ jsx62("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__ */ jsx62("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" }) });
|
|
2271
2279
|
};
|
|
2272
2280
|
var refresh_default = SvgRefresh;
|
|
2273
2281
|
|
|
2274
2282
|
// src/theme/default/components/settings/settings-recovery-codes.tsx
|
|
2275
2283
|
import { useFormContext as useFormContext9 } from "react-hook-form";
|
|
2276
|
-
import { Fragment as Fragment5, jsx as
|
|
2284
|
+
import { Fragment as Fragment5, jsx as jsx63, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2277
2285
|
function DefaultSettingsRecoveryCodes({
|
|
2278
2286
|
codes,
|
|
2279
2287
|
regnerateButton,
|
|
@@ -2295,12 +2303,12 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2295
2303
|
element.click();
|
|
2296
2304
|
};
|
|
2297
2305
|
const hasCodes = codes.length >= 1;
|
|
2298
|
-
return /* @__PURE__ */
|
|
2299
|
-
codes.length > 0 && /* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
/* @__PURE__ */
|
|
2302
|
-
/* @__PURE__ */
|
|
2303
|
-
regnerateButton && codes.length > 0 && /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-8", children: [
|
|
2307
|
+
codes.length > 0 && /* @__PURE__ */ jsx63(DefaultHorizontalDivider, {}),
|
|
2308
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex gap-4 justify-between", children: [
|
|
2309
|
+
/* @__PURE__ */ jsx63("span", { className: "text-interface-foreground-default-tertiary", children: revealButton && "Reveal recovery codes" }),
|
|
2310
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex gap-2", children: [
|
|
2311
|
+
regnerateButton && codes.length > 0 && /* @__PURE__ */ jsx63(
|
|
2304
2312
|
"button",
|
|
2305
2313
|
{
|
|
2306
2314
|
...regnerateButton.attributes,
|
|
@@ -2309,7 +2317,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2309
2317
|
onClick: onRegenerate,
|
|
2310
2318
|
disabled: isSubmitting,
|
|
2311
2319
|
"data-loading": isSubmitting,
|
|
2312
|
-
children: /* @__PURE__ */
|
|
2320
|
+
children: /* @__PURE__ */ jsx63(
|
|
2313
2321
|
refresh_default,
|
|
2314
2322
|
{
|
|
2315
2323
|
size: 24,
|
|
@@ -2318,7 +2326,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2318
2326
|
)
|
|
2319
2327
|
}
|
|
2320
2328
|
),
|
|
2321
|
-
revealButton && /* @__PURE__ */
|
|
2329
|
+
revealButton && /* @__PURE__ */ jsx63(Fragment5, { children: /* @__PURE__ */ jsx63(
|
|
2322
2330
|
"button",
|
|
2323
2331
|
{
|
|
2324
2332
|
...revealButton.attributes,
|
|
@@ -2326,7 +2334,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2326
2334
|
className: "ml-auto",
|
|
2327
2335
|
onClick: onReveal,
|
|
2328
2336
|
title: "Reveal recovery codes",
|
|
2329
|
-
children: /* @__PURE__ */
|
|
2337
|
+
children: /* @__PURE__ */ jsx63(
|
|
2330
2338
|
eye_default,
|
|
2331
2339
|
{
|
|
2332
2340
|
size: 24,
|
|
@@ -2335,7 +2343,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2335
2343
|
)
|
|
2336
2344
|
}
|
|
2337
2345
|
) }),
|
|
2338
|
-
hasCodes && /* @__PURE__ */
|
|
2346
|
+
hasCodes && /* @__PURE__ */ jsx63(
|
|
2339
2347
|
"button",
|
|
2340
2348
|
{
|
|
2341
2349
|
onClick: onDownload,
|
|
@@ -2343,7 +2351,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2343
2351
|
className: "ml-auto",
|
|
2344
2352
|
"data-testid": "ory/screen/settings/group/recovery_code/download",
|
|
2345
2353
|
title: "Download recovery codes",
|
|
2346
|
-
children: /* @__PURE__ */
|
|
2354
|
+
children: /* @__PURE__ */ jsx63(
|
|
2347
2355
|
download_default,
|
|
2348
2356
|
{
|
|
2349
2357
|
size: 24,
|
|
@@ -2354,32 +2362,32 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2354
2362
|
)
|
|
2355
2363
|
] })
|
|
2356
2364
|
] }),
|
|
2357
|
-
hasCodes ? /* @__PURE__ */
|
|
2365
|
+
hasCodes ? /* @__PURE__ */ jsx63("div", { className: "rounded-general p-6 bg-interface-background-default-secondary border-interface-border-default-primary", children: /* @__PURE__ */ jsx63(
|
|
2358
2366
|
"div",
|
|
2359
2367
|
{
|
|
2360
2368
|
className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 flex-wrap gap-4 text-sm text-interface-foreground-default-primary",
|
|
2361
2369
|
"data-testid": "ory/screen/settings/group/recovery_code/codes",
|
|
2362
|
-
children: codes.map((code) => /* @__PURE__ */
|
|
2370
|
+
children: codes.map((code) => /* @__PURE__ */ jsx63("p", { children: code }, code))
|
|
2363
2371
|
}
|
|
2364
2372
|
) }) : null
|
|
2365
2373
|
] });
|
|
2366
2374
|
}
|
|
2367
2375
|
|
|
2368
2376
|
// src/theme/default/components/settings/settings-totp.tsx
|
|
2369
|
-
import { useComponents as
|
|
2377
|
+
import { useComponents as useComponents5 } from "@ory/elements-react";
|
|
2370
2378
|
|
|
2371
2379
|
// src/theme/default/assets/icons/qrcode.svg
|
|
2372
|
-
import * as
|
|
2373
|
-
import { jsx as
|
|
2380
|
+
import * as React33 from "react";
|
|
2381
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
2374
2382
|
var SvgQrcode = (props) => {
|
|
2375
2383
|
var _a, _b;
|
|
2376
|
-
return /* @__PURE__ */
|
|
2384
|
+
return /* @__PURE__ */ jsx64("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__ */ jsx64("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" }) });
|
|
2377
2385
|
};
|
|
2378
2386
|
var qrcode_default = SvgQrcode;
|
|
2379
2387
|
|
|
2380
2388
|
// src/theme/default/components/settings/settings-totp.tsx
|
|
2381
2389
|
import { useFormContext as useFormContext10 } from "react-hook-form";
|
|
2382
|
-
import { jsx as
|
|
2390
|
+
import { jsx as jsx65, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2383
2391
|
function DefaultSettingsTotp({
|
|
2384
2392
|
totpImage,
|
|
2385
2393
|
totpInput,
|
|
@@ -2387,7 +2395,7 @@ function DefaultSettingsTotp({
|
|
|
2387
2395
|
totpUnlink,
|
|
2388
2396
|
onUnlink
|
|
2389
2397
|
}) {
|
|
2390
|
-
const { Node
|
|
2398
|
+
const { Node, Card } = useComponents5();
|
|
2391
2399
|
const {
|
|
2392
2400
|
formState: { isSubmitting }
|
|
2393
2401
|
} = useFormContext10();
|
|
@@ -2399,19 +2407,19 @@ function DefaultSettingsTotp({
|
|
|
2399
2407
|
node_type: _ignoredNodeType,
|
|
2400
2408
|
...buttonAttrs
|
|
2401
2409
|
} = totpUnlink.attributes;
|
|
2402
|
-
return /* @__PURE__ */
|
|
2403
|
-
/* @__PURE__ */
|
|
2404
|
-
/* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */
|
|
2406
|
-
/* @__PURE__ */
|
|
2407
|
-
/* @__PURE__ */
|
|
2410
|
+
return /* @__PURE__ */ jsxs35("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
|
|
2411
|
+
/* @__PURE__ */ jsx65("div", { className: "col-span-full", children: /* @__PURE__ */ jsx65(Card.Divider, {}) }),
|
|
2412
|
+
/* @__PURE__ */ jsxs35("div", { className: "col-span-full flex items-center gap-6", children: [
|
|
2413
|
+
/* @__PURE__ */ jsx65("div", { className: "aspect-square size-8 ", children: /* @__PURE__ */ jsx65(qrcode_default, { size: 32 }) }),
|
|
2414
|
+
/* @__PURE__ */ jsx65("div", { className: "mr-auto flex flex-col", children: /* @__PURE__ */ jsx65("p", { className: "text-sm font-medium text-interface-foreground-default-primary", children: "Authenticator app" }) }),
|
|
2415
|
+
/* @__PURE__ */ jsx65(
|
|
2408
2416
|
"button",
|
|
2409
2417
|
{
|
|
2410
2418
|
type: type === "button" ? "button" : "submit",
|
|
2411
2419
|
...buttonAttrs,
|
|
2412
2420
|
onClick: onUnlink,
|
|
2413
2421
|
disabled: isSubmitting,
|
|
2414
|
-
children: isSubmitting ? /* @__PURE__ */
|
|
2422
|
+
children: isSubmitting ? /* @__PURE__ */ jsx65(Spinner, { className: "relative" }) : /* @__PURE__ */ jsx65(
|
|
2415
2423
|
trash_default,
|
|
2416
2424
|
{
|
|
2417
2425
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2424,10 +2432,10 @@ function DefaultSettingsTotp({
|
|
|
2424
2432
|
] });
|
|
2425
2433
|
}
|
|
2426
2434
|
if (totpImage && totpSecret && totpInput) {
|
|
2427
|
-
return /* @__PURE__ */
|
|
2428
|
-
/* @__PURE__ */
|
|
2429
|
-
/* @__PURE__ */
|
|
2430
|
-
|
|
2435
|
+
return /* @__PURE__ */ jsxs35("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
|
|
2436
|
+
/* @__PURE__ */ jsx65("div", { className: "col-span-full", children: /* @__PURE__ */ jsx65(DefaultHorizontalDivider, {}) }),
|
|
2437
|
+
/* @__PURE__ */ jsx65("div", { className: "flex justify-center rounded-cards bg-interface-background-default-secondary p-8", children: /* @__PURE__ */ jsx65("div", { className: "aspect-square h-44 rounded bg-[white]", children: /* @__PURE__ */ jsx65("div", { className: "-m-3 antialiased mix-blend-multiply", children: /* @__PURE__ */ jsx65(
|
|
2438
|
+
Node.Image,
|
|
2431
2439
|
{
|
|
2432
2440
|
node: totpImage,
|
|
2433
2441
|
attributes: {
|
|
@@ -2435,14 +2443,14 @@ function DefaultSettingsTotp({
|
|
|
2435
2443
|
}
|
|
2436
2444
|
}
|
|
2437
2445
|
) }) }) }),
|
|
2438
|
-
/* @__PURE__ */
|
|
2439
|
-
/* @__PURE__ */
|
|
2440
|
-
|
|
2446
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-6", children: [
|
|
2447
|
+
/* @__PURE__ */ jsx65(
|
|
2448
|
+
Node.Label,
|
|
2441
2449
|
{
|
|
2442
2450
|
node: totpSecret,
|
|
2443
2451
|
attributes: totpSecret.attributes,
|
|
2444
|
-
children: /* @__PURE__ */
|
|
2445
|
-
|
|
2452
|
+
children: /* @__PURE__ */ jsx65(
|
|
2453
|
+
Node.Input,
|
|
2446
2454
|
{
|
|
2447
2455
|
node: totpSecret,
|
|
2448
2456
|
attributes: {
|
|
@@ -2456,13 +2464,13 @@ function DefaultSettingsTotp({
|
|
|
2456
2464
|
)
|
|
2457
2465
|
}
|
|
2458
2466
|
),
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
|
|
2467
|
+
/* @__PURE__ */ jsx65(
|
|
2468
|
+
Node.Label,
|
|
2461
2469
|
{
|
|
2462
2470
|
attributes: totpInput.attributes,
|
|
2463
2471
|
node: totpInput,
|
|
2464
|
-
children: /* @__PURE__ */
|
|
2465
|
-
|
|
2472
|
+
children: /* @__PURE__ */ jsx65(
|
|
2473
|
+
Node.CodeInput,
|
|
2466
2474
|
{
|
|
2467
2475
|
node: totpInput,
|
|
2468
2476
|
attributes: totpInput.attributes
|
|
@@ -2476,20 +2484,20 @@ function DefaultSettingsTotp({
|
|
|
2476
2484
|
}
|
|
2477
2485
|
|
|
2478
2486
|
// src/theme/default/components/settings/settings-webauthn.tsx
|
|
2479
|
-
import { useComponents as
|
|
2487
|
+
import { useComponents as useComponents6 } from "@ory/elements-react";
|
|
2480
2488
|
|
|
2481
2489
|
// src/theme/default/assets/icons/key.svg
|
|
2482
|
-
import * as
|
|
2483
|
-
import { jsx as
|
|
2490
|
+
import * as React34 from "react";
|
|
2491
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
2484
2492
|
var SvgKey = (props) => {
|
|
2485
2493
|
var _a, _b;
|
|
2486
|
-
return /* @__PURE__ */
|
|
2494
|
+
return /* @__PURE__ */ jsx66("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__ */ jsx66("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" }) });
|
|
2487
2495
|
};
|
|
2488
2496
|
var key_default = SvgKey;
|
|
2489
2497
|
|
|
2490
2498
|
// src/theme/default/components/settings/settings-webauthn.tsx
|
|
2491
2499
|
import { useFormContext as useFormContext11 } from "react-hook-form";
|
|
2492
|
-
import { jsx as
|
|
2500
|
+
import { jsx as jsx67, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2493
2501
|
function DefaultSettingsWebauthn({
|
|
2494
2502
|
nameInput,
|
|
2495
2503
|
triggerButton,
|
|
@@ -2498,17 +2506,17 @@ function DefaultSettingsWebauthn({
|
|
|
2498
2506
|
const {
|
|
2499
2507
|
formState: { isSubmitting }
|
|
2500
2508
|
} = useFormContext11();
|
|
2501
|
-
const { Node
|
|
2509
|
+
const { Node, Card } = useComponents6();
|
|
2502
2510
|
const hasRemoveButtons = removeButtons.length > 0;
|
|
2503
|
-
return /* @__PURE__ */
|
|
2504
|
-
/* @__PURE__ */
|
|
2505
|
-
/* @__PURE__ */
|
|
2506
|
-
|
|
2511
|
+
return /* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-8", children: [
|
|
2512
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex md:max-w-96 sm:items-end gap-3 flex-col sm:flex-row", children: [
|
|
2513
|
+
/* @__PURE__ */ jsx67("div", { className: "flex-1", children: /* @__PURE__ */ jsx67(
|
|
2514
|
+
Node.Label,
|
|
2507
2515
|
{
|
|
2508
2516
|
node: nameInput,
|
|
2509
2517
|
attributes: nameInput.attributes,
|
|
2510
|
-
children: /* @__PURE__ */
|
|
2511
|
-
|
|
2518
|
+
children: /* @__PURE__ */ jsx67(
|
|
2519
|
+
Node.Input,
|
|
2512
2520
|
{
|
|
2513
2521
|
node: nameInput,
|
|
2514
2522
|
attributes: nameInput.attributes
|
|
@@ -2516,8 +2524,8 @@ function DefaultSettingsWebauthn({
|
|
|
2516
2524
|
)
|
|
2517
2525
|
}
|
|
2518
2526
|
) }),
|
|
2519
|
-
triggerButton ? /* @__PURE__ */
|
|
2520
|
-
|
|
2527
|
+
triggerButton ? /* @__PURE__ */ jsx67(
|
|
2528
|
+
Node.Button,
|
|
2521
2529
|
{
|
|
2522
2530
|
node: triggerButton,
|
|
2523
2531
|
attributes: triggerButton.attributes,
|
|
@@ -2525,38 +2533,38 @@ function DefaultSettingsWebauthn({
|
|
|
2525
2533
|
}
|
|
2526
2534
|
) : null
|
|
2527
2535
|
] }),
|
|
2528
|
-
hasRemoveButtons ? /* @__PURE__ */
|
|
2529
|
-
/* @__PURE__ */
|
|
2530
|
-
/* @__PURE__ */
|
|
2536
|
+
hasRemoveButtons ? /* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-8", children: [
|
|
2537
|
+
/* @__PURE__ */ jsx67(Card.Divider, {}),
|
|
2538
|
+
/* @__PURE__ */ jsx67("div", { className: "flex flex-col gap-4", children: removeButtons.map((node, i) => {
|
|
2531
2539
|
var _a, _b;
|
|
2532
2540
|
const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
|
|
2533
2541
|
const addedAt = "added_at" in context ? context.added_at : null;
|
|
2534
2542
|
const displayName = "display_name" in context ? context.display_name : null;
|
|
2535
2543
|
const keyId = "value" in node.attributes ? node.attributes.value : null;
|
|
2536
|
-
return /* @__PURE__ */
|
|
2544
|
+
return /* @__PURE__ */ jsxs36(
|
|
2537
2545
|
"div",
|
|
2538
2546
|
{
|
|
2539
2547
|
className: "flex justify-between gap-6 md:items-center",
|
|
2540
2548
|
children: [
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2549
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex gap-2 items-center flex-1 truncate", children: [
|
|
2550
|
+
/* @__PURE__ */ jsx67(
|
|
2543
2551
|
key_default,
|
|
2544
2552
|
{
|
|
2545
2553
|
size: 32,
|
|
2546
2554
|
className: "text-interface-foreground-default-primary"
|
|
2547
2555
|
}
|
|
2548
2556
|
),
|
|
2549
|
-
/* @__PURE__ */
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
/* @__PURE__ */
|
|
2557
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4 truncate", children: [
|
|
2558
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex-1 flex-col truncate", children: [
|
|
2559
|
+
/* @__PURE__ */ jsx67("p", { className: "text-sm font-medium text-interface-foreground-default-secondary truncate", children: displayName }),
|
|
2560
|
+
/* @__PURE__ */ jsx67("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block truncate", children: keyId })
|
|
2553
2561
|
] }),
|
|
2554
|
-
addedAt && /* @__PURE__ */
|
|
2562
|
+
addedAt && /* @__PURE__ */ jsx67("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
|
|
2555
2563
|
dateStyle: "long"
|
|
2556
2564
|
}).format(new Date(addedAt)) })
|
|
2557
2565
|
] })
|
|
2558
2566
|
] }),
|
|
2559
|
-
/* @__PURE__ */
|
|
2567
|
+
/* @__PURE__ */ jsx67(
|
|
2560
2568
|
"button",
|
|
2561
2569
|
{
|
|
2562
2570
|
...node.attributes,
|
|
@@ -2564,7 +2572,7 @@ function DefaultSettingsWebauthn({
|
|
|
2564
2572
|
onClick: node.onClick,
|
|
2565
2573
|
disabled: isSubmitting,
|
|
2566
2574
|
className: "relative",
|
|
2567
|
-
children: isSubmitting ? /* @__PURE__ */
|
|
2575
|
+
children: isSubmitting ? /* @__PURE__ */ jsx67(Spinner, { className: "relative" }) : /* @__PURE__ */ jsx67(
|
|
2568
2576
|
trash_default,
|
|
2569
2577
|
{
|
|
2570
2578
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2583,313 +2591,34 @@ function DefaultSettingsWebauthn({
|
|
|
2583
2591
|
}
|
|
2584
2592
|
|
|
2585
2593
|
// src/theme/default/components/card/auth-method-list-container.tsx
|
|
2586
|
-
import { jsx as
|
|
2594
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
2587
2595
|
function DefaultAuthMethodListContainer({
|
|
2588
2596
|
children
|
|
2589
2597
|
}) {
|
|
2590
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ jsx68("div", { className: "grid grid-cols-1 gap-2", children });
|
|
2591
2599
|
}
|
|
2592
2600
|
|
|
2593
2601
|
// src/theme/default/components/form/captcha.tsx
|
|
2594
|
-
import { isUiNodeInputAttributes as
|
|
2602
|
+
import { isUiNodeInputAttributes as isUiNodeInputAttributes3 } from "@ory/client-fetch";
|
|
2595
2603
|
import { Turnstile } from "@marsidev/react-turnstile";
|
|
2596
2604
|
import { useRef as useRef2 } from "react";
|
|
2597
|
-
import { useFormContext as useFormContext23 } from "react-hook-form";
|
|
2598
|
-
|
|
2599
|
-
// src/context/flow-context.tsx
|
|
2600
|
-
import {
|
|
2601
|
-
createContext as createContext2,
|
|
2602
|
-
useContext as useContext3,
|
|
2603
|
-
useState as useState3
|
|
2604
|
-
} from "react";
|
|
2605
|
-
|
|
2606
|
-
// src/context/form-state.ts
|
|
2607
|
-
import { FlowType as FlowType9 } from "@ory/client-fetch";
|
|
2608
|
-
import { useReducer } from "react";
|
|
2609
|
-
|
|
2610
|
-
// src/components/card/card-two-step.utils.ts
|
|
2611
|
-
import { FlowType as FlowType8, UiNodeGroupEnum as UiNodeGroupEnum3 } from "@ory/client-fetch";
|
|
2612
|
-
|
|
2613
|
-
// src/context/flow-context.tsx
|
|
2614
|
-
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
2615
|
-
var OryFlowContext = createContext2(null);
|
|
2616
|
-
|
|
2617
|
-
// src/context/intl-context.tsx
|
|
2618
|
-
import { IntlProvider as OriginalIntlProvider } from "react-intl";
|
|
2619
|
-
|
|
2620
|
-
// src/components/card/header.tsx
|
|
2621
|
-
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
2622
|
-
|
|
2623
|
-
// src/components/form/form-provider.tsx
|
|
2624
|
-
import { UiNodeGroupEnum as UiNodeGroupEnum5 } from "@ory/client-fetch";
|
|
2625
|
-
import { FormProvider, useForm as useForm2 } from "react-hook-form";
|
|
2626
|
-
|
|
2627
|
-
// src/components/form/form-helpers.ts
|
|
2628
|
-
import { isUiNodeInputAttributes as isUiNodeInputAttributes3 } from "@ory/client-fetch";
|
|
2629
|
-
|
|
2630
|
-
// src/components/form/form-resolver.ts
|
|
2631
|
-
import { isUiNodeInputAttributes as isUiNodeInputAttributes4 } from "@ory/client-fetch";
|
|
2632
|
-
|
|
2633
|
-
// src/components/form/form-provider.tsx
|
|
2634
|
-
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
2635
|
-
|
|
2636
|
-
// src/components/card/card.tsx
|
|
2637
|
-
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
2638
|
-
|
|
2639
|
-
// src/components/card/footer.tsx
|
|
2640
|
-
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
2641
|
-
|
|
2642
|
-
// src/components/card/content.tsx
|
|
2643
|
-
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
2644
|
-
|
|
2645
|
-
// src/components/card/card-two-step.tsx
|
|
2646
|
-
import { UiNodeGroupEnum as UiNodeGroupEnum7 } from "@ory/client-fetch";
|
|
2647
|
-
import { useFormContext as useFormContext15 } from "react-hook-form";
|
|
2648
|
-
|
|
2649
|
-
// src/components/form/form.tsx
|
|
2650
|
-
import {
|
|
2651
|
-
FlowType as FlowType16,
|
|
2652
|
-
isUiNodeAnchorAttributes,
|
|
2653
|
-
isUiNodeImageAttributes,
|
|
2654
|
-
isUiNodeInputAttributes as isUiNodeInputAttributes5,
|
|
2655
|
-
isUiNodeScriptAttributes
|
|
2656
|
-
} from "@ory/client-fetch";
|
|
2657
|
-
import { useFormContext as useFormContext13 } from "react-hook-form";
|
|
2658
|
-
import { useIntl as useIntl13 } from "react-intl";
|
|
2659
|
-
|
|
2660
|
-
// src/components/form/useOryFormSubmit.ts
|
|
2661
|
-
import {
|
|
2662
|
-
FlowType as FlowType15
|
|
2663
|
-
} from "@ory/client-fetch";
|
|
2664
2605
|
import { useFormContext as useFormContext12 } from "react-hook-form";
|
|
2665
|
-
|
|
2666
|
-
// src/util/onSubmitLogin.ts
|
|
2667
|
-
import {
|
|
2668
|
-
FlowType as FlowType10,
|
|
2669
|
-
handleFlowError,
|
|
2670
|
-
loginUrl
|
|
2671
|
-
} from "@ory/client-fetch";
|
|
2672
|
-
|
|
2673
|
-
// src/util/onSubmitRecovery.ts
|
|
2674
|
-
import {
|
|
2675
|
-
FlowType as FlowType11,
|
|
2676
|
-
handleContinueWith,
|
|
2677
|
-
handleFlowError as handleFlowError2,
|
|
2678
|
-
instanceOfContinueWithRecoveryUi,
|
|
2679
|
-
recoveryUrl
|
|
2680
|
-
} from "@ory/client-fetch";
|
|
2681
|
-
|
|
2682
|
-
// src/util/onSubmitRegistration.ts
|
|
2683
|
-
import {
|
|
2684
|
-
FlowType as FlowType12,
|
|
2685
|
-
handleContinueWith as handleContinueWith2,
|
|
2686
|
-
handleFlowError as handleFlowError3,
|
|
2687
|
-
registrationUrl
|
|
2688
|
-
} from "@ory/client-fetch";
|
|
2689
|
-
|
|
2690
|
-
// src/util/onSubmitSettings.ts
|
|
2691
|
-
import {
|
|
2692
|
-
FlowType as FlowType13,
|
|
2693
|
-
handleContinueWith as handleContinueWith3,
|
|
2694
|
-
handleFlowError as handleFlowError4,
|
|
2695
|
-
isResponseError,
|
|
2696
|
-
loginUrl as loginUrl2,
|
|
2697
|
-
settingsUrl
|
|
2698
|
-
} from "@ory/client-fetch";
|
|
2699
|
-
|
|
2700
|
-
// src/util/onSubmitVerification.ts
|
|
2701
|
-
import {
|
|
2702
|
-
FlowType as FlowType14,
|
|
2703
|
-
handleFlowError as handleFlowError5,
|
|
2704
|
-
verificationUrl
|
|
2705
|
-
} from "@ory/client-fetch";
|
|
2706
|
-
|
|
2707
|
-
// src/components/form/form.tsx
|
|
2708
|
-
import { Fragment as Fragment6, jsx as jsx74, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2709
|
-
|
|
2710
|
-
// src/components/form/messages.tsx
|
|
2711
|
-
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
2712
|
-
|
|
2713
|
-
// src/components/form/nodes/node.tsx
|
|
2714
|
-
import {
|
|
2715
|
-
isUiNodeAnchorAttributes as isUiNodeAnchorAttributes2,
|
|
2716
|
-
isUiNodeImageAttributes as isUiNodeImageAttributes2,
|
|
2717
|
-
isUiNodeInputAttributes as isUiNodeInputAttributes6,
|
|
2718
|
-
isUiNodeScriptAttributes as isUiNodeScriptAttributes2,
|
|
2719
|
-
isUiNodeTextAttributes,
|
|
2720
|
-
UiNodeGroupEnum as UiNodeGroupEnum6
|
|
2721
|
-
} from "@ory/client-fetch";
|
|
2722
|
-
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
2723
|
-
|
|
2724
|
-
// src/components/form/social.tsx
|
|
2725
|
-
import { useFormContext as useFormContext14 } from "react-hook-form";
|
|
2726
|
-
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
2727
|
-
|
|
2728
|
-
// src/components/card/card-two-step.tsx
|
|
2729
|
-
import { Fragment as Fragment7, jsx as jsx78, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2730
|
-
|
|
2731
|
-
// src/components/form/groups.tsx
|
|
2732
|
-
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
2733
|
-
|
|
2734
|
-
// src/components/form/section.tsx
|
|
2735
|
-
import { useFormContext as useFormContext16 } from "react-hook-form";
|
|
2736
|
-
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
2737
|
-
|
|
2738
|
-
// src/components/generic/divider.tsx
|
|
2739
|
-
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
2740
|
-
|
|
2741
|
-
// src/components/generic/page-header.tsx
|
|
2742
|
-
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
2743
|
-
|
|
2744
|
-
// src/components/settings/settings-card.tsx
|
|
2745
|
-
import { UiNodeGroupEnum as UiNodeGroupEnum8 } from "@ory/client-fetch";
|
|
2746
|
-
import { useIntl as useIntl19 } from "react-intl";
|
|
2747
|
-
|
|
2748
|
-
// src/components/settings/oidc-settings.tsx
|
|
2749
|
-
import { useIntl as useIntl14 } from "react-intl";
|
|
2750
|
-
import { useFormContext as useFormContext17 } from "react-hook-form";
|
|
2751
|
-
import { Fragment as Fragment8, jsx as jsx83, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
2752
|
-
|
|
2753
|
-
// src/components/settings/passkey-settings.tsx
|
|
2754
|
-
import { useFormContext as useFormContext18 } from "react-hook-form";
|
|
2755
|
-
import { useIntl as useIntl15 } from "react-intl";
|
|
2756
|
-
import { Fragment as Fragment9, jsx as jsx84, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
2757
|
-
|
|
2758
|
-
// src/components/settings/recovery-codes-settings.tsx
|
|
2759
|
-
import { useIntl as useIntl16 } from "react-intl";
|
|
2760
|
-
import { useFormContext as useFormContext19 } from "react-hook-form";
|
|
2761
|
-
import { Fragment as Fragment10, jsx as jsx85, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
2762
|
-
|
|
2763
|
-
// src/components/settings/totp-settings.tsx
|
|
2764
|
-
import { useFormContext as useFormContext20 } from "react-hook-form";
|
|
2765
|
-
import { useIntl as useIntl17 } from "react-intl";
|
|
2766
|
-
import { Fragment as Fragment11, jsx as jsx86, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
2767
|
-
|
|
2768
|
-
// src/components/settings/webauthn-settings.tsx
|
|
2769
|
-
import { useFormContext as useFormContext21 } from "react-hook-form";
|
|
2770
|
-
import { useIntl as useIntl18 } from "react-intl";
|
|
2771
|
-
import { Fragment as Fragment12, jsx as jsx87, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
2772
|
-
|
|
2773
|
-
// src/components/settings/settings-card.tsx
|
|
2774
|
-
import { Fragment as Fragment13, jsx as jsx88, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
2775
|
-
|
|
2776
|
-
// src/context/intl-context.tsx
|
|
2777
|
-
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
2778
|
-
|
|
2779
|
-
// src/context/provider.tsx
|
|
2780
|
-
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
2781
|
-
|
|
2782
|
-
// src/components/form/nodes/input.tsx
|
|
2783
|
-
import {
|
|
2784
|
-
UiNodeInputAttributesTypeEnum
|
|
2785
|
-
} from "@ory/client-fetch";
|
|
2786
|
-
import { useEffect as useEffect5, useRef } from "react";
|
|
2787
|
-
import { useFormContext as useFormContext22 } from "react-hook-form";
|
|
2788
|
-
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
2789
|
-
var NodeInput = ({
|
|
2790
|
-
node,
|
|
2791
|
-
attributes
|
|
2792
|
-
}) => {
|
|
2793
|
-
var _a;
|
|
2794
|
-
const { Node: Node2 } = useComponents();
|
|
2795
|
-
const { setValue } = useFormContext22();
|
|
2796
|
-
const {
|
|
2797
|
-
onloadTrigger,
|
|
2798
|
-
onclickTrigger,
|
|
2799
|
-
// These properties do not exist on input fields so we remove them (as we already have handled them).
|
|
2800
|
-
onclick: _ignoredOnclick,
|
|
2801
|
-
onload: _ignoredOnload,
|
|
2802
|
-
//
|
|
2803
|
-
...attrs
|
|
2804
|
-
} = attributes;
|
|
2805
|
-
const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
|
|
2806
|
-
const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
|
|
2807
|
-
const setFormValue = () => {
|
|
2808
|
-
if (attrs.value && !(isResendNode || isScreenSelectionNode)) {
|
|
2809
|
-
setValue(attrs.name, attrs.value);
|
|
2810
|
-
}
|
|
2811
|
-
};
|
|
2812
|
-
const hasRun = useRef(false);
|
|
2813
|
-
useEffect5(
|
|
2814
|
-
() => {
|
|
2815
|
-
setFormValue();
|
|
2816
|
-
if (!hasRun.current && onloadTrigger) {
|
|
2817
|
-
hasRun.current = true;
|
|
2818
|
-
triggerToWindowCall(onloadTrigger);
|
|
2819
|
-
}
|
|
2820
|
-
},
|
|
2821
|
-
// TODO(jonas): make sure onloadTrigger is stable
|
|
2822
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- ignore onloadTrigger for now, until we make sure this is stable
|
|
2823
|
-
[]
|
|
2824
|
-
);
|
|
2825
|
-
const handleClick = () => {
|
|
2826
|
-
setFormValue();
|
|
2827
|
-
if (onclickTrigger) {
|
|
2828
|
-
triggerToWindowCall(onclickTrigger);
|
|
2829
|
-
}
|
|
2830
|
-
};
|
|
2831
|
-
const isSocial = (attrs.name === "provider" || attrs.name === "link") && node.group === "oidc";
|
|
2832
|
-
const isPinCodeInput = attrs.name === "code" && node.group === "code" || attrs.name === "totp_code" && node.group === "totp";
|
|
2833
|
-
switch (attributes.type) {
|
|
2834
|
-
case UiNodeInputAttributesTypeEnum.Submit:
|
|
2835
|
-
case UiNodeInputAttributesTypeEnum.Button:
|
|
2836
|
-
if (isSocial) {
|
|
2837
|
-
return null;
|
|
2838
|
-
}
|
|
2839
|
-
if (isResendNode || isScreenSelectionNode) {
|
|
2840
|
-
return null;
|
|
2841
|
-
}
|
|
2842
|
-
return /* @__PURE__ */ jsx91(
|
|
2843
|
-
Node2.Label,
|
|
2844
|
-
{
|
|
2845
|
-
attributes: { ...attrs, label: void 0 },
|
|
2846
|
-
node: { ...node, meta: { ...node.meta, label: void 0 } },
|
|
2847
|
-
children: /* @__PURE__ */ jsx91(Node2.Button, { attributes: attrs, node, onClick: handleClick })
|
|
2848
|
-
}
|
|
2849
|
-
);
|
|
2850
|
-
case UiNodeInputAttributesTypeEnum.DatetimeLocal:
|
|
2851
|
-
throw new Error("Not implemented");
|
|
2852
|
-
case UiNodeInputAttributesTypeEnum.Checkbox:
|
|
2853
|
-
return /* @__PURE__ */ jsx91(
|
|
2854
|
-
Node2.Label,
|
|
2855
|
-
{
|
|
2856
|
-
attributes: { ...attrs, label: void 0 },
|
|
2857
|
-
node: { ...node, meta: { ...node.meta, label: void 0 } },
|
|
2858
|
-
children: /* @__PURE__ */ jsx91(Node2.Checkbox, { attributes: attrs, node, onClick: handleClick })
|
|
2859
|
-
}
|
|
2860
|
-
);
|
|
2861
|
-
case UiNodeInputAttributesTypeEnum.Hidden:
|
|
2862
|
-
return /* @__PURE__ */ jsx91(Node2.Input, { attributes: attrs, node, onClick: handleClick });
|
|
2863
|
-
default:
|
|
2864
|
-
if (isPinCodeInput) {
|
|
2865
|
-
return /* @__PURE__ */ jsx91(Node2.Label, { attributes: attrs, node, children: /* @__PURE__ */ jsx91(
|
|
2866
|
-
Node2.CodeInput,
|
|
2867
|
-
{
|
|
2868
|
-
attributes: attrs,
|
|
2869
|
-
node,
|
|
2870
|
-
onClick: handleClick
|
|
2871
|
-
}
|
|
2872
|
-
) });
|
|
2873
|
-
}
|
|
2874
|
-
return /* @__PURE__ */ jsx91(Node2.Label, { attributes: attrs, node, children: /* @__PURE__ */ jsx91(Node2.Input, { attributes: attrs, node, onClick: handleClick }) });
|
|
2875
|
-
}
|
|
2876
|
-
};
|
|
2877
|
-
|
|
2878
|
-
// src/theme/default/components/form/captcha.tsx
|
|
2879
|
-
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
2606
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
2880
2607
|
var DefaultCaptcha = ({ node }) => {
|
|
2881
|
-
const { setValue } =
|
|
2608
|
+
const { setValue } = useFormContext12();
|
|
2882
2609
|
const ref = useRef2();
|
|
2883
2610
|
const nodes = [];
|
|
2884
|
-
if (
|
|
2611
|
+
if (isUiNodeInputAttributes3(node.attributes)) {
|
|
2885
2612
|
if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
|
|
2886
|
-
nodes.push(
|
|
2613
|
+
nodes.push(
|
|
2614
|
+
/* @__PURE__ */ jsx69(DefaultInput, { node, attributes: node.attributes }, 1)
|
|
2615
|
+
);
|
|
2887
2616
|
}
|
|
2888
2617
|
}
|
|
2889
|
-
if (
|
|
2618
|
+
if (isUiNodeInputAttributes3(node.attributes) && node.attributes.name === "captcha_turnstile_options") {
|
|
2890
2619
|
const options = JSON.parse(node.attributes.value);
|
|
2891
2620
|
nodes.push(
|
|
2892
|
-
/* @__PURE__ */
|
|
2621
|
+
/* @__PURE__ */ jsx69(
|
|
2893
2622
|
Turnstile,
|
|
2894
2623
|
{
|
|
2895
2624
|
ref,
|
|
@@ -2966,21 +2695,21 @@ function getOryComponents(overrides) {
|
|
|
2966
2695
|
}
|
|
2967
2696
|
|
|
2968
2697
|
// src/theme/default/flows/error.tsx
|
|
2969
|
-
import { jsx as
|
|
2698
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
2970
2699
|
function Error2({
|
|
2971
2700
|
error,
|
|
2972
2701
|
children
|
|
2973
2702
|
}) {
|
|
2974
|
-
return /* @__PURE__ */
|
|
2703
|
+
return /* @__PURE__ */ jsx70("div", { "data-testid": "ory/screen/error/raw", children: JSON.stringify(error) || children });
|
|
2975
2704
|
}
|
|
2976
2705
|
|
|
2977
2706
|
// src/theme/default/flows/login.tsx
|
|
2978
|
-
import { FlowType as
|
|
2707
|
+
import { FlowType as FlowType8 } from "@ory/client-fetch";
|
|
2979
2708
|
import {
|
|
2980
2709
|
OryProvider,
|
|
2981
|
-
OryTwoStepCard
|
|
2710
|
+
OryTwoStepCard
|
|
2982
2711
|
} from "@ory/elements-react";
|
|
2983
|
-
import { jsx as
|
|
2712
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
2984
2713
|
function Login({
|
|
2985
2714
|
flow,
|
|
2986
2715
|
config,
|
|
@@ -2988,25 +2717,25 @@ function Login({
|
|
|
2988
2717
|
components: flowOverrideComponents
|
|
2989
2718
|
}) {
|
|
2990
2719
|
const components = getOryComponents(flowOverrideComponents);
|
|
2991
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ jsx71(
|
|
2992
2721
|
OryProvider,
|
|
2993
2722
|
{
|
|
2994
2723
|
config,
|
|
2995
2724
|
flow,
|
|
2996
|
-
flowType:
|
|
2725
|
+
flowType: FlowType8.Login,
|
|
2997
2726
|
components,
|
|
2998
|
-
children: children != null ? children : /* @__PURE__ */
|
|
2727
|
+
children: children != null ? children : /* @__PURE__ */ jsx71(OryTwoStepCard, {})
|
|
2999
2728
|
}
|
|
3000
2729
|
);
|
|
3001
2730
|
}
|
|
3002
2731
|
|
|
3003
2732
|
// src/theme/default/flows/recovery.tsx
|
|
3004
|
-
import { FlowType as
|
|
2733
|
+
import { FlowType as FlowType9 } from "@ory/client-fetch";
|
|
3005
2734
|
import {
|
|
3006
2735
|
OryProvider as OryProvider2,
|
|
3007
|
-
OryTwoStepCard as
|
|
2736
|
+
OryTwoStepCard as OryTwoStepCard2
|
|
3008
2737
|
} from "@ory/elements-react";
|
|
3009
|
-
import { jsx as
|
|
2738
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
3010
2739
|
function Recovery({
|
|
3011
2740
|
flow,
|
|
3012
2741
|
config,
|
|
@@ -3014,25 +2743,25 @@ function Recovery({
|
|
|
3014
2743
|
components: flowOverrideComponents
|
|
3015
2744
|
}) {
|
|
3016
2745
|
const components = getOryComponents(flowOverrideComponents);
|
|
3017
|
-
return /* @__PURE__ */
|
|
2746
|
+
return /* @__PURE__ */ jsx72(
|
|
3018
2747
|
OryProvider2,
|
|
3019
2748
|
{
|
|
3020
2749
|
config,
|
|
3021
2750
|
flow,
|
|
3022
|
-
flowType:
|
|
2751
|
+
flowType: FlowType9.Recovery,
|
|
3023
2752
|
components,
|
|
3024
|
-
children: children != null ? children : /* @__PURE__ */
|
|
2753
|
+
children: children != null ? children : /* @__PURE__ */ jsx72(OryTwoStepCard2, {})
|
|
3025
2754
|
}
|
|
3026
2755
|
);
|
|
3027
2756
|
}
|
|
3028
2757
|
|
|
3029
2758
|
// src/theme/default/flows/registration.tsx
|
|
3030
|
-
import { FlowType as
|
|
2759
|
+
import { FlowType as FlowType10 } from "@ory/client-fetch";
|
|
3031
2760
|
import {
|
|
3032
2761
|
OryProvider as OryProvider3,
|
|
3033
|
-
OryTwoStepCard as
|
|
2762
|
+
OryTwoStepCard as OryTwoStepCard3
|
|
3034
2763
|
} from "@ory/elements-react";
|
|
3035
|
-
import { jsx as
|
|
2764
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3036
2765
|
function Registration({
|
|
3037
2766
|
flow,
|
|
3038
2767
|
children,
|
|
@@ -3040,26 +2769,26 @@ function Registration({
|
|
|
3040
2769
|
config
|
|
3041
2770
|
}) {
|
|
3042
2771
|
const components = getOryComponents(flowOverrideComponents);
|
|
3043
|
-
return /* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ jsx73(
|
|
3044
2773
|
OryProvider3,
|
|
3045
2774
|
{
|
|
3046
2775
|
config,
|
|
3047
2776
|
flow,
|
|
3048
|
-
flowType:
|
|
2777
|
+
flowType: FlowType10.Registration,
|
|
3049
2778
|
components,
|
|
3050
|
-
children: children != null ? children : /* @__PURE__ */
|
|
2779
|
+
children: children != null ? children : /* @__PURE__ */ jsx73(OryTwoStepCard3, {})
|
|
3051
2780
|
}
|
|
3052
2781
|
);
|
|
3053
2782
|
}
|
|
3054
2783
|
|
|
3055
2784
|
// src/theme/default/flows/settings.tsx
|
|
3056
|
-
import { FlowType as
|
|
2785
|
+
import { FlowType as FlowType11 } from "@ory/client-fetch";
|
|
3057
2786
|
import {
|
|
3058
2787
|
HeadlessPageHeader,
|
|
3059
2788
|
OryProvider as OryProvider4,
|
|
3060
2789
|
OrySettingsCard
|
|
3061
2790
|
} from "@ory/elements-react";
|
|
3062
|
-
import { Fragment as
|
|
2791
|
+
import { Fragment as Fragment6, jsx as jsx74, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3063
2792
|
function Settings({
|
|
3064
2793
|
flow,
|
|
3065
2794
|
config,
|
|
@@ -3067,28 +2796,28 @@ function Settings({
|
|
|
3067
2796
|
components: flowOverrideComponents
|
|
3068
2797
|
}) {
|
|
3069
2798
|
const components = getOryComponents(flowOverrideComponents);
|
|
3070
|
-
return /* @__PURE__ */
|
|
2799
|
+
return /* @__PURE__ */ jsx74(
|
|
3071
2800
|
OryProvider4,
|
|
3072
2801
|
{
|
|
3073
2802
|
config,
|
|
3074
2803
|
flow,
|
|
3075
|
-
flowType:
|
|
2804
|
+
flowType: FlowType11.Settings,
|
|
3076
2805
|
components,
|
|
3077
|
-
children: children != null ? children : /* @__PURE__ */
|
|
3078
|
-
/* @__PURE__ */
|
|
3079
|
-
/* @__PURE__ */
|
|
2806
|
+
children: children != null ? children : /* @__PURE__ */ jsxs37(Fragment6, { children: [
|
|
2807
|
+
/* @__PURE__ */ jsx74(HeadlessPageHeader, {}),
|
|
2808
|
+
/* @__PURE__ */ jsx74(OrySettingsCard, {})
|
|
3080
2809
|
] })
|
|
3081
2810
|
}
|
|
3082
2811
|
);
|
|
3083
2812
|
}
|
|
3084
2813
|
|
|
3085
2814
|
// src/theme/default/flows/verification.tsx
|
|
3086
|
-
import { FlowType as
|
|
2815
|
+
import { FlowType as FlowType12 } from "@ory/client-fetch";
|
|
3087
2816
|
import {
|
|
3088
2817
|
OryProvider as OryProvider5,
|
|
3089
|
-
OryTwoStepCard as
|
|
2818
|
+
OryTwoStepCard as OryTwoStepCard4
|
|
3090
2819
|
} from "@ory/elements-react";
|
|
3091
|
-
import { jsx as
|
|
2820
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
3092
2821
|
function Verification({
|
|
3093
2822
|
flow,
|
|
3094
2823
|
config,
|
|
@@ -3096,14 +2825,14 @@ function Verification({
|
|
|
3096
2825
|
components: flowOverrideComponents
|
|
3097
2826
|
}) {
|
|
3098
2827
|
const components = getOryComponents(flowOverrideComponents);
|
|
3099
|
-
return /* @__PURE__ */
|
|
2828
|
+
return /* @__PURE__ */ jsx75(
|
|
3100
2829
|
OryProvider5,
|
|
3101
2830
|
{
|
|
3102
2831
|
config,
|
|
3103
2832
|
flow,
|
|
3104
|
-
flowType:
|
|
2833
|
+
flowType: FlowType12.Verification,
|
|
3105
2834
|
components,
|
|
3106
|
-
children: children != null ? children : /* @__PURE__ */
|
|
2835
|
+
children: children != null ? children : /* @__PURE__ */ jsx75(OryTwoStepCard4, {})
|
|
3107
2836
|
}
|
|
3108
2837
|
);
|
|
3109
2838
|
}
|