@ory/elements-react 1.0.0-next.32 → 1.0.0-next.33
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 +15 -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 +330 -267
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +318 -255
- package/dist/theme/default/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1554,9 +1554,33 @@ function DefaultImage({ attributes }) {
|
|
|
1554
1554
|
// src/theme/default/components/form/input.tsx
|
|
1555
1555
|
var import_client_fetch9 = require("@ory/client-fetch");
|
|
1556
1556
|
var import_elements_react9 = require("@ory/elements-react");
|
|
1557
|
+
var import_react5 = require("react");
|
|
1557
1558
|
var import_react_hook_form5 = require("react-hook-form");
|
|
1558
1559
|
var import_react_intl9 = require("react-intl");
|
|
1560
|
+
|
|
1561
|
+
// src/theme/default/assets/icons/eye-off.svg
|
|
1562
|
+
var React24 = __toESM(require("react"));
|
|
1559
1563
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1564
|
+
var SvgEyeOff = (props) => {
|
|
1565
|
+
var _a, _b;
|
|
1566
|
+
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" }) });
|
|
1567
|
+
};
|
|
1568
|
+
var eye_off_default = SvgEyeOff;
|
|
1569
|
+
|
|
1570
|
+
// src/theme/default/assets/icons/eye.svg
|
|
1571
|
+
var React25 = __toESM(require("react"));
|
|
1572
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1573
|
+
var SvgEye = (props) => {
|
|
1574
|
+
var _a, _b;
|
|
1575
|
+
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: [
|
|
1576
|
+
/* @__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" }),
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { stroke: "#64748B", d: "M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6" })
|
|
1578
|
+
] }) });
|
|
1579
|
+
};
|
|
1580
|
+
var eye_default = SvgEye;
|
|
1581
|
+
|
|
1582
|
+
// src/theme/default/components/form/input.tsx
|
|
1583
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1560
1584
|
var DefaultInput = ({
|
|
1561
1585
|
node,
|
|
1562
1586
|
attributes,
|
|
@@ -1574,6 +1598,7 @@ var DefaultInput = ({
|
|
|
1574
1598
|
} = attributes;
|
|
1575
1599
|
const intl = (0, import_react_intl9.useIntl)();
|
|
1576
1600
|
const { flowType } = (0, import_elements_react9.useOryFlow)();
|
|
1601
|
+
const inputRef = (0, import_react5.useRef)(null);
|
|
1577
1602
|
const formattedLabel = label ? intl.formatMessage(
|
|
1578
1603
|
{
|
|
1579
1604
|
id: "input.placeholder",
|
|
@@ -1583,36 +1608,86 @@ var DefaultInput = ({
|
|
|
1583
1608
|
placeholder: (0, import_elements_react9.uiTextToFormattedMessage)(label, intl)
|
|
1584
1609
|
}
|
|
1585
1610
|
) : "";
|
|
1586
|
-
|
|
1587
|
-
|
|
1611
|
+
if (rest.type === "hidden") {
|
|
1612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1613
|
+
"input",
|
|
1614
|
+
{
|
|
1615
|
+
...rest,
|
|
1616
|
+
onClick,
|
|
1617
|
+
maxLength: maxlength,
|
|
1618
|
+
autoComplete: autocomplete,
|
|
1619
|
+
placeholder: formattedLabel,
|
|
1620
|
+
"data-testid": `ory/form/node/input/${name}`,
|
|
1621
|
+
...register(name, { value })
|
|
1622
|
+
}
|
|
1623
|
+
);
|
|
1624
|
+
}
|
|
1625
|
+
const { ref, ...restRegister } = register(name, { value });
|
|
1626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
1627
|
+
"div",
|
|
1588
1628
|
{
|
|
1589
|
-
...rest,
|
|
1590
|
-
onClick,
|
|
1591
|
-
maxLength: maxlength,
|
|
1592
|
-
autoComplete: autocomplete,
|
|
1593
|
-
placeholder: formattedLabel,
|
|
1594
|
-
"data-testid": `ory/form/node/input/${name}`,
|
|
1595
1629
|
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]",
|
|
1630
|
+
"relative flex justify-stretch",
|
|
1602
1631
|
// 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
1632
|
flowType === import_client_fetch9.FlowType.Settings && "max-w-[488px]"
|
|
1604
1633
|
),
|
|
1605
|
-
|
|
1634
|
+
children: [
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1636
|
+
"input",
|
|
1637
|
+
{
|
|
1638
|
+
...rest,
|
|
1639
|
+
onClick,
|
|
1640
|
+
maxLength: maxlength,
|
|
1641
|
+
autoComplete: autocomplete,
|
|
1642
|
+
placeholder: formattedLabel,
|
|
1643
|
+
"data-testid": `ory/form/node/input/${name}`,
|
|
1644
|
+
className: cn(
|
|
1645
|
+
"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",
|
|
1646
|
+
"bg-input-background-default border-input-border-default text-input-foreground-primary",
|
|
1647
|
+
"disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled",
|
|
1648
|
+
"focus:border-input-border-focus focus-visible:border-input-border-focus",
|
|
1649
|
+
"hover:bg-input-background-hover hover:border-input-border-hover",
|
|
1650
|
+
"px-4 py-[13px]"
|
|
1651
|
+
),
|
|
1652
|
+
ref: (e) => {
|
|
1653
|
+
inputRef.current = e;
|
|
1654
|
+
ref(e);
|
|
1655
|
+
},
|
|
1656
|
+
...restRegister
|
|
1657
|
+
}
|
|
1658
|
+
),
|
|
1659
|
+
rest.type === "password" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PasswordToggle, { inputRef })
|
|
1660
|
+
]
|
|
1606
1661
|
}
|
|
1607
1662
|
);
|
|
1608
1663
|
};
|
|
1664
|
+
function PasswordToggle({
|
|
1665
|
+
inputRef
|
|
1666
|
+
}) {
|
|
1667
|
+
const [shown, setShown] = (0, import_react5.useState)(false);
|
|
1668
|
+
const handleClick = () => {
|
|
1669
|
+
setShown(!shown);
|
|
1670
|
+
if (inputRef.current) {
|
|
1671
|
+
inputRef.current.type = shown ? "password" : "text";
|
|
1672
|
+
}
|
|
1673
|
+
};
|
|
1674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1675
|
+
"button",
|
|
1676
|
+
{
|
|
1677
|
+
onClick: handleClick,
|
|
1678
|
+
className: "absolute right-0 h-full w-12 flex items-center justify-center",
|
|
1679
|
+
type: "button",
|
|
1680
|
+
children: shown ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(eye_off_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(eye_default, {})
|
|
1681
|
+
}
|
|
1682
|
+
);
|
|
1683
|
+
}
|
|
1609
1684
|
|
|
1610
1685
|
// src/theme/default/components/form/label.tsx
|
|
1611
1686
|
var import_client_fetch10 = require("@ory/client-fetch");
|
|
1612
1687
|
var import_elements_react10 = require("@ory/elements-react");
|
|
1613
1688
|
var import_react_hook_form6 = require("react-hook-form");
|
|
1614
1689
|
var import_react_intl10 = require("react-intl");
|
|
1615
|
-
var
|
|
1690
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1616
1691
|
function findResendNode(nodes) {
|
|
1617
1692
|
return nodes.find(
|
|
1618
1693
|
(n) => "name" in n.attributes && (n.attributes.name === "email" && n.attributes.type === "submit" || n.attributes.name === "resend")
|
|
@@ -1637,9 +1712,9 @@ function DefaultLabel({
|
|
|
1637
1712
|
}
|
|
1638
1713
|
};
|
|
1639
1714
|
const fieldError = formState.errors[attributes.name];
|
|
1640
|
-
return /* @__PURE__ */ (0,
|
|
1641
|
-
label && /* @__PURE__ */ (0,
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1 antialiased", children: [
|
|
1716
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "inline-flex justify-between", children: [
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1643
1718
|
"label",
|
|
1644
1719
|
{
|
|
1645
1720
|
...(0, import_elements_react10.messageTestId)(label),
|
|
@@ -1651,7 +1726,7 @@ function DefaultLabel({
|
|
|
1651
1726
|
}
|
|
1652
1727
|
),
|
|
1653
1728
|
isPassword && config.project.recovery_enabled && flowType === import_client_fetch10.FlowType.Login && // TODO: make it possible to override with a custom component
|
|
1654
|
-
/* @__PURE__ */ (0,
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1655
1730
|
"a",
|
|
1656
1731
|
{
|
|
1657
1732
|
href: initFlowUrl(config.sdk.url, "recovery", flow),
|
|
@@ -1662,7 +1737,7 @@ function DefaultLabel({
|
|
|
1662
1737
|
})
|
|
1663
1738
|
}
|
|
1664
1739
|
),
|
|
1665
|
-
(resendNode == null ? void 0 : resendNode.attributes.node_type) === "input" && /* @__PURE__ */ (0,
|
|
1740
|
+
(resendNode == null ? void 0 : resendNode.attributes.node_type) === "input" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1666
1741
|
"button",
|
|
1667
1742
|
{
|
|
1668
1743
|
type: "submit",
|
|
@@ -1675,21 +1750,21 @@ function DefaultLabel({
|
|
|
1675
1750
|
)
|
|
1676
1751
|
] }),
|
|
1677
1752
|
children,
|
|
1678
|
-
node.messages.map((message) => /* @__PURE__ */ (0,
|
|
1679
|
-
fieldError && (0, import_client_fetch10.instanceOfUiText)(fieldError) && /* @__PURE__ */ (0,
|
|
1753
|
+
node.messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Message.Content, { message }, message.id)),
|
|
1754
|
+
fieldError && (0, import_client_fetch10.instanceOfUiText)(fieldError) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Message.Content, { message: fieldError })
|
|
1680
1755
|
] });
|
|
1681
1756
|
}
|
|
1682
1757
|
|
|
1683
1758
|
// src/theme/default/components/form/link-button.tsx
|
|
1684
1759
|
var import_client_fetch11 = require("@ory/client-fetch");
|
|
1685
1760
|
var import_elements_react11 = require("@ory/elements-react");
|
|
1686
|
-
var
|
|
1761
|
+
var import_react6 = require("react");
|
|
1687
1762
|
var import_react_intl11 = require("react-intl");
|
|
1688
|
-
var
|
|
1689
|
-
var DefaultLinkButton = (0,
|
|
1763
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1764
|
+
var DefaultLinkButton = (0, import_react6.forwardRef)(({ attributes, node }, ref) => {
|
|
1690
1765
|
const intl = (0, import_react_intl11.useIntl)();
|
|
1691
1766
|
const label = (0, import_client_fetch11.getNodeLabel)(node);
|
|
1692
|
-
return /* @__PURE__ */ (0,
|
|
1767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
1693
1768
|
"a",
|
|
1694
1769
|
{
|
|
1695
1770
|
...attributes,
|
|
@@ -1710,9 +1785,9 @@ var import_react_hook_form7 = require("react-hook-form");
|
|
|
1710
1785
|
|
|
1711
1786
|
// src/theme/default/components/form/shadcn/otp-input.tsx
|
|
1712
1787
|
var import_input_otp = require("input-otp");
|
|
1713
|
-
var
|
|
1714
|
-
var
|
|
1715
|
-
var InputOTP =
|
|
1788
|
+
var React26 = __toESM(require("react"));
|
|
1789
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1790
|
+
var InputOTP = React26.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
1716
1791
|
import_input_otp.OTPInput,
|
|
1717
1792
|
{
|
|
1718
1793
|
ref,
|
|
@@ -1725,12 +1800,12 @@ var InputOTP = React24.forwardRef(({ className, containerClassName, ...props },
|
|
|
1725
1800
|
}
|
|
1726
1801
|
));
|
|
1727
1802
|
InputOTP.displayName = "InputOTP";
|
|
1728
|
-
var InputOTPGroup =
|
|
1803
|
+
var InputOTPGroup = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
1729
1804
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1730
|
-
var InputOTPSlot =
|
|
1731
|
-
const inputOTPContext =
|
|
1805
|
+
var InputOTPSlot = React26.forwardRef(({ index, className, ...props }, ref) => {
|
|
1806
|
+
const inputOTPContext = React26.useContext(import_input_otp.OTPInputContext);
|
|
1732
1807
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
1733
|
-
return /* @__PURE__ */ (0,
|
|
1808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
1734
1809
|
"div",
|
|
1735
1810
|
{
|
|
1736
1811
|
ref,
|
|
@@ -1742,8 +1817,8 @@ var InputOTPSlot = React24.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
1742
1817
|
),
|
|
1743
1818
|
...props,
|
|
1744
1819
|
children: [
|
|
1745
|
-
/* @__PURE__ */ (0,
|
|
1746
|
-
hasFakeCaret && /* @__PURE__ */ (0,
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "inline-block size-4", children: char }),
|
|
1821
|
+
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
1822
|
]
|
|
1748
1823
|
}
|
|
1749
1824
|
);
|
|
@@ -1753,7 +1828,7 @@ InputOTPSlot.displayName = "InputOTPSlot";
|
|
|
1753
1828
|
// src/theme/default/components/form/pin-code-input.tsx
|
|
1754
1829
|
var import_elements_react12 = require("@ory/elements-react");
|
|
1755
1830
|
var import_client_fetch12 = require("@ory/client-fetch");
|
|
1756
|
-
var
|
|
1831
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1757
1832
|
var DefaultPinCodeInput = ({ attributes }) => {
|
|
1758
1833
|
const { setValue, watch } = (0, import_react_hook_form7.useFormContext)();
|
|
1759
1834
|
const { maxlength, name } = attributes;
|
|
@@ -1763,14 +1838,14 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1763
1838
|
setValue(name, v);
|
|
1764
1839
|
};
|
|
1765
1840
|
const value = watch(name);
|
|
1766
|
-
return /* @__PURE__ */ (0,
|
|
1841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1767
1842
|
InputOTP,
|
|
1768
1843
|
{
|
|
1769
1844
|
maxLength: maxlength != null ? maxlength : 6,
|
|
1770
1845
|
onChange: handleInputChange,
|
|
1771
1846
|
name,
|
|
1772
1847
|
value,
|
|
1773
|
-
children: /* @__PURE__ */ (0,
|
|
1848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1774
1849
|
InputOTPGroup,
|
|
1775
1850
|
{
|
|
1776
1851
|
className: cn(
|
|
@@ -1778,7 +1853,7 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1778
1853
|
// 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
1854
|
flowType === import_client_fetch12.FlowType.Settings && "max-w-[488px]"
|
|
1780
1855
|
),
|
|
1781
|
-
children: [...Array(elements)].map((_, index) => /* @__PURE__ */ (0,
|
|
1856
|
+
children: [...Array(elements)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InputOTPSlot, { index }, index))
|
|
1782
1857
|
}
|
|
1783
1858
|
)
|
|
1784
1859
|
}
|
|
@@ -1786,13 +1861,13 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
1786
1861
|
};
|
|
1787
1862
|
|
|
1788
1863
|
// src/theme/default/components/form/section.tsx
|
|
1789
|
-
var
|
|
1864
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
1790
1865
|
var DefaultFormSection = ({
|
|
1791
1866
|
children,
|
|
1792
1867
|
nodes: _nodes,
|
|
1793
1868
|
...rest
|
|
1794
1869
|
}) => {
|
|
1795
|
-
return /* @__PURE__ */ (0,
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
1796
1871
|
"form",
|
|
1797
1872
|
{
|
|
1798
1873
|
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 +1881,10 @@ var DefaultFormSectionContent = ({
|
|
|
1806
1881
|
description,
|
|
1807
1882
|
children
|
|
1808
1883
|
}) => {
|
|
1809
|
-
return /* @__PURE__ */ (0,
|
|
1810
|
-
/* @__PURE__ */ (0,
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1884
|
+
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: [
|
|
1885
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h3", { className: "font-medium text-interface-foreground-default-primary", children: title }),
|
|
1887
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-interface-foreground-default-secondary", children: description })
|
|
1813
1888
|
] }),
|
|
1814
1889
|
children
|
|
1815
1890
|
] });
|
|
@@ -1818,14 +1893,14 @@ var DefaultFormSectionFooter = ({
|
|
|
1818
1893
|
children,
|
|
1819
1894
|
text
|
|
1820
1895
|
}) => {
|
|
1821
|
-
return /* @__PURE__ */ (0,
|
|
1896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
1822
1897
|
"div",
|
|
1823
1898
|
{
|
|
1824
1899
|
className: cn(
|
|
1825
1900
|
"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
1901
|
),
|
|
1827
1902
|
children: [
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: text }),
|
|
1829
1904
|
children
|
|
1830
1905
|
]
|
|
1831
1906
|
}
|
|
@@ -1835,31 +1910,31 @@ var DefaultFormSectionFooter = ({
|
|
|
1835
1910
|
// src/theme/default/components/form/text.tsx
|
|
1836
1911
|
var import_elements_react13 = require("@ory/elements-react");
|
|
1837
1912
|
var import_react_intl12 = require("react-intl");
|
|
1838
|
-
var
|
|
1913
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1839
1914
|
function DefaultText({ node, attributes }) {
|
|
1840
1915
|
var _a;
|
|
1841
1916
|
const intl = (0, import_react_intl12.useIntl)();
|
|
1842
1917
|
const lookup = (_a = attributes.text.context) == null ? void 0 : _a.secrets;
|
|
1843
1918
|
if (lookup) {
|
|
1844
|
-
return /* @__PURE__ */ (0,
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1846
|
-
lookup.map((text, index) => /* @__PURE__ */ (0,
|
|
1919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
1920
|
+
/* @__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) : "" }),
|
|
1921
|
+
lookup.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
1847
1922
|
"pre",
|
|
1848
1923
|
{
|
|
1849
1924
|
"data-testid": `ory/form/node/text/lookup_secret_codes/text`,
|
|
1850
|
-
children: /* @__PURE__ */ (0,
|
|
1925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("code", { children: text ? (0, import_elements_react13.uiTextToFormattedMessage)(text, intl) : "" })
|
|
1851
1926
|
},
|
|
1852
1927
|
index
|
|
1853
1928
|
))
|
|
1854
1929
|
] });
|
|
1855
1930
|
}
|
|
1856
|
-
return /* @__PURE__ */ (0,
|
|
1931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
1857
1932
|
"p",
|
|
1858
1933
|
{
|
|
1859
1934
|
"data-testid": `ory/form/node/text/${attributes.id}/label`,
|
|
1860
1935
|
id: attributes.id,
|
|
1861
1936
|
children: [
|
|
1862
|
-
node.meta.label ? /* @__PURE__ */ (0,
|
|
1937
|
+
node.meta.label ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("label", { children: (0, import_elements_react13.uiTextToFormattedMessage)(node.meta.label, intl) }) : null,
|
|
1863
1938
|
attributes.text ? (0, import_elements_react13.uiTextToFormattedMessage)(attributes.text, intl) : ""
|
|
1864
1939
|
]
|
|
1865
1940
|
}
|
|
@@ -1871,7 +1946,7 @@ var import_elements_react15 = require("@ory/elements-react");
|
|
|
1871
1946
|
|
|
1872
1947
|
// src/theme/default/components/ui/user-menu.tsx
|
|
1873
1948
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
1874
|
-
var
|
|
1949
|
+
var import_react9 = require("react");
|
|
1875
1950
|
var import_elements_react14 = require("@ory/elements-react");
|
|
1876
1951
|
|
|
1877
1952
|
// src/util/client.ts
|
|
@@ -1889,22 +1964,22 @@ function frontendClient(sdkUrl, opts = {}) {
|
|
|
1889
1964
|
}
|
|
1890
1965
|
|
|
1891
1966
|
// src/theme/default/assets/icons/logout.svg
|
|
1892
|
-
var
|
|
1893
|
-
var
|
|
1967
|
+
var React27 = __toESM(require("react"));
|
|
1968
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
1894
1969
|
var SvgLogout = (props) => {
|
|
1895
1970
|
var _a, _b;
|
|
1896
|
-
return /* @__PURE__ */ (0,
|
|
1971
|
+
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
1972
|
};
|
|
1898
1973
|
var logout_default = SvgLogout;
|
|
1899
1974
|
|
|
1900
1975
|
// src/theme/default/assets/icons/settings.svg
|
|
1901
|
-
var
|
|
1902
|
-
var
|
|
1976
|
+
var React28 = __toESM(require("react"));
|
|
1977
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
1903
1978
|
var SvgSettings = (props) => {
|
|
1904
1979
|
var _a, _b;
|
|
1905
|
-
return /* @__PURE__ */ (0,
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
1980
|
+
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: [
|
|
1981
|
+
/* @__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" }),
|
|
1982
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("path", { d: "M6 8a2 2 0 1 0 4 0 2 2 0 0 0-4 0" })
|
|
1908
1983
|
] }) });
|
|
1909
1984
|
};
|
|
1910
1985
|
var settings_default = SvgSettings;
|
|
@@ -1949,12 +2024,12 @@ var getUserInitials = (session) => {
|
|
|
1949
2024
|
};
|
|
1950
2025
|
|
|
1951
2026
|
// src/theme/default/components/ui/dropdown-menu.tsx
|
|
1952
|
-
var
|
|
2027
|
+
var import_react7 = require("react");
|
|
1953
2028
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1954
|
-
var
|
|
2029
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
1955
2030
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1956
2031
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1957
|
-
var DropdownMenuContent = (0,
|
|
2032
|
+
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
2033
|
DropdownMenuPrimitive.Content,
|
|
1959
2034
|
{
|
|
1960
2035
|
ref,
|
|
@@ -1969,7 +2044,7 @@ var DropdownMenuContent = (0, import_react6.forwardRef)(({ className, sideOffset
|
|
|
1969
2044
|
}
|
|
1970
2045
|
) }));
|
|
1971
2046
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1972
|
-
var DropdownMenuItem = (0,
|
|
2047
|
+
var DropdownMenuItem = (0, import_react7.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1973
2048
|
DropdownMenuPrimitive.Item,
|
|
1974
2049
|
{
|
|
1975
2050
|
ref,
|
|
@@ -1987,7 +2062,7 @@ var DropdownMenuItem = (0, import_react6.forwardRef)(({ className, inset, ...pro
|
|
|
1987
2062
|
}
|
|
1988
2063
|
));
|
|
1989
2064
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1990
|
-
var DropdownMenuLabel = (0,
|
|
2065
|
+
var DropdownMenuLabel = (0, import_react7.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1991
2066
|
DropdownMenuPrimitive.Label,
|
|
1992
2067
|
{
|
|
1993
2068
|
ref,
|
|
@@ -2002,35 +2077,35 @@ var DropdownMenuLabel = (0, import_react6.forwardRef)(({ className, inset, ...pr
|
|
|
2002
2077
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2003
2078
|
|
|
2004
2079
|
// src/theme/default/components/ui/user-avater.tsx
|
|
2005
|
-
var
|
|
2080
|
+
var import_react8 = require("react");
|
|
2006
2081
|
|
|
2007
2082
|
// src/theme/default/assets/icons/user.svg
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
2083
|
+
var React29 = __toESM(require("react"));
|
|
2084
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2010
2085
|
var SvgUser = (props) => {
|
|
2011
2086
|
var _a, _b;
|
|
2012
|
-
return /* @__PURE__ */ (0,
|
|
2087
|
+
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
2088
|
};
|
|
2014
2089
|
var user_default = SvgUser;
|
|
2015
2090
|
|
|
2016
2091
|
// src/theme/default/components/ui/user-avater.tsx
|
|
2017
|
-
var
|
|
2018
|
-
var UserAvatar = (0,
|
|
2092
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2093
|
+
var UserAvatar = (0, import_react8.forwardRef)(
|
|
2019
2094
|
({ initials, ...rest }, ref) => {
|
|
2020
|
-
return /* @__PURE__ */ (0,
|
|
2095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2021
2096
|
"button",
|
|
2022
2097
|
{
|
|
2023
2098
|
ref,
|
|
2024
2099
|
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
2100
|
...rest,
|
|
2026
|
-
children: /* @__PURE__ */ (0,
|
|
2101
|
+
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
2102
|
"img",
|
|
2028
2103
|
{
|
|
2029
2104
|
src: initials.avatar,
|
|
2030
2105
|
alt: initials.primary,
|
|
2031
2106
|
className: "w-full object-contain"
|
|
2032
2107
|
}
|
|
2033
|
-
) : /* @__PURE__ */ (0,
|
|
2108
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2034
2109
|
user_default,
|
|
2035
2110
|
{
|
|
2036
2111
|
size: 24,
|
|
@@ -2044,34 +2119,34 @@ var UserAvatar = (0, import_react7.forwardRef)(
|
|
|
2044
2119
|
UserAvatar.displayName = "UserAvatar";
|
|
2045
2120
|
|
|
2046
2121
|
// src/theme/default/components/ui/user-menu.tsx
|
|
2047
|
-
var
|
|
2122
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2048
2123
|
var UserMenu = ({ session }) => {
|
|
2049
2124
|
const { config } = (0, import_elements_react14.useOryFlow)();
|
|
2050
2125
|
const initials = getUserInitials(session);
|
|
2051
|
-
const [logoutFlow, setLogoutFlow] = (0,
|
|
2052
|
-
const fetchLogoutFlow = (0,
|
|
2126
|
+
const [logoutFlow, setLogoutFlow] = (0, import_react9.useState)();
|
|
2127
|
+
const fetchLogoutFlow = (0, import_react9.useCallback)(async () => {
|
|
2053
2128
|
const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow();
|
|
2054
2129
|
setLogoutFlow(flow);
|
|
2055
2130
|
}, [config.sdk.url]);
|
|
2056
|
-
(0,
|
|
2131
|
+
(0, import_react9.useEffect)(() => {
|
|
2057
2132
|
void fetchLogoutFlow();
|
|
2058
2133
|
}, [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,
|
|
2134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenu, { children: [
|
|
2135
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(UserAvatar, { initials }) }),
|
|
2136
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuContent, { children: [
|
|
2137
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_react_dropdown_menu.DropdownMenuLabel, { className: "flex gap-3 px-5 py-4.5", children: [
|
|
2138
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(UserAvatar, { disabled: true, initials }),
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col justify-center text-sm leading-tight", children: [
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-interface-foreground-default-primary leading-tight font-medium", children: initials.primary }),
|
|
2141
|
+
initials.secondary && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-interface-foreground-default-tertiary leading-tight", children: initials.secondary })
|
|
2067
2142
|
] })
|
|
2068
2143
|
] }),
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2070
|
-
/* @__PURE__ */ (0,
|
|
2144
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("a", { href: "/settings", children: [
|
|
2145
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(settings_default, { size: 16 }),
|
|
2071
2146
|
" User settings"
|
|
2072
2147
|
] }) }),
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
2148
|
+
/* @__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: [
|
|
2149
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(logout_default, { size: 16 }),
|
|
2075
2150
|
" Logout"
|
|
2076
2151
|
] }) })
|
|
2077
2152
|
] })
|
|
@@ -2080,42 +2155,42 @@ var UserMenu = ({ session }) => {
|
|
|
2080
2155
|
|
|
2081
2156
|
// src/theme/default/components/generic/page-header.tsx
|
|
2082
2157
|
var import_client2 = require("@ory/elements-react/client");
|
|
2083
|
-
var
|
|
2158
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2084
2159
|
var DefaultPageHeader = (_props) => {
|
|
2085
2160
|
const { Card } = (0, import_elements_react15.useComponents)();
|
|
2086
2161
|
const { session } = (0, import_client2.useSession)();
|
|
2087
|
-
return /* @__PURE__ */ (0,
|
|
2088
|
-
/* @__PURE__ */ (0,
|
|
2089
|
-
/* @__PURE__ */ (0,
|
|
2162
|
+
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: [
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "relative h-10 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Card.Logo, {}) }),
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(UserMenu, { session })
|
|
2090
2165
|
] }) }) });
|
|
2091
2166
|
};
|
|
2092
2167
|
|
|
2093
2168
|
// src/theme/default/components/settings/settings-oidc.tsx
|
|
2094
|
-
var
|
|
2169
|
+
var import_react10 = require("react");
|
|
2095
2170
|
var import_react_hook_form8 = require("react-hook-form");
|
|
2096
2171
|
var import_usehooks_ts2 = require("usehooks-ts");
|
|
2097
2172
|
|
|
2098
2173
|
// src/theme/default/assets/icons/trash.svg
|
|
2099
|
-
var
|
|
2100
|
-
var
|
|
2174
|
+
var React30 = __toESM(require("react"));
|
|
2175
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2101
2176
|
var SvgTrash = (props) => {
|
|
2102
2177
|
var _a, _b;
|
|
2103
|
-
return /* @__PURE__ */ (0,
|
|
2178
|
+
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
2179
|
};
|
|
2105
2180
|
var trash_default = SvgTrash;
|
|
2106
2181
|
|
|
2107
2182
|
// src/theme/default/components/settings/settings-oidc.tsx
|
|
2108
|
-
var
|
|
2183
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2109
2184
|
function DefaultSettingsOidc({
|
|
2110
2185
|
linkButtons,
|
|
2111
2186
|
unlinkButtons
|
|
2112
2187
|
}) {
|
|
2113
2188
|
const hasLinkButtons = linkButtons.length > 0;
|
|
2114
2189
|
const hasUnlinkButtons = unlinkButtons.length > 0;
|
|
2115
|
-
return /* @__PURE__ */ (0,
|
|
2116
|
-
hasLinkButtons && /* @__PURE__ */ (0,
|
|
2190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2191
|
+
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
2192
|
const attrs = button.attributes;
|
|
2118
|
-
return /* @__PURE__ */ (0,
|
|
2193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2119
2194
|
DefaultButtonSocial,
|
|
2120
2195
|
{
|
|
2121
2196
|
showLabel: true,
|
|
@@ -2126,12 +2201,12 @@ function DefaultSettingsOidc({
|
|
|
2126
2201
|
attrs.value
|
|
2127
2202
|
);
|
|
2128
2203
|
}) }),
|
|
2129
|
-
hasUnlinkButtons && hasLinkButtons ? /* @__PURE__ */ (0,
|
|
2204
|
+
hasUnlinkButtons && hasLinkButtons ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DefaultHorizontalDivider, {}) : null,
|
|
2130
2205
|
unlinkButtons.map((button) => {
|
|
2131
2206
|
if (button.attributes.node_type !== "input") {
|
|
2132
2207
|
return null;
|
|
2133
2208
|
}
|
|
2134
|
-
return /* @__PURE__ */ (0,
|
|
2209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(UnlinkRow, { button }, button.attributes.value);
|
|
2135
2210
|
})
|
|
2136
2211
|
] });
|
|
2137
2212
|
}
|
|
@@ -2148,17 +2223,17 @@ function UnlinkRow({ button }) {
|
|
|
2148
2223
|
button.onClick();
|
|
2149
2224
|
setClicked(true);
|
|
2150
2225
|
};
|
|
2151
|
-
(0,
|
|
2226
|
+
(0, import_react10.useEffect)(() => {
|
|
2152
2227
|
if (!isSubmitting) {
|
|
2153
2228
|
setClicked(false);
|
|
2154
2229
|
}
|
|
2155
2230
|
}, [isSubmitting, setClicked]);
|
|
2156
|
-
return /* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2158
|
-
Logo ? /* @__PURE__ */ (0,
|
|
2159
|
-
/* @__PURE__ */ (0,
|
|
2231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex justify-between", children: [
|
|
2232
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex items-center gap-6", children: [
|
|
2233
|
+
Logo ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Logo, { size: 32 }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(provider_logos_default.generic, { size: 32 }),
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary", children: provider })
|
|
2160
2235
|
] }),
|
|
2161
|
-
/* @__PURE__ */ (0,
|
|
2236
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2162
2237
|
"button",
|
|
2163
2238
|
{
|
|
2164
2239
|
...attrs,
|
|
@@ -2167,7 +2242,7 @@ function UnlinkRow({ button }) {
|
|
|
2167
2242
|
disabled: isSubmitting,
|
|
2168
2243
|
className: "relative",
|
|
2169
2244
|
title: `Unlink ${provider}`,
|
|
2170
|
-
children: clicked ? /* @__PURE__ */ (0,
|
|
2245
|
+
children: clicked ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2171
2246
|
trash_default,
|
|
2172
2247
|
{
|
|
2173
2248
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2182,7 +2257,7 @@ function UnlinkRow({ button }) {
|
|
|
2182
2257
|
// src/theme/default/components/settings/settings-passkey.tsx
|
|
2183
2258
|
var import_elements_react16 = require("@ory/elements-react");
|
|
2184
2259
|
var import_react_hook_form9 = require("react-hook-form");
|
|
2185
|
-
var
|
|
2260
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2186
2261
|
function DefaultSettingsPasskey({
|
|
2187
2262
|
triggerButton,
|
|
2188
2263
|
removeButtons
|
|
@@ -2192,8 +2267,8 @@ function DefaultSettingsPasskey({
|
|
|
2192
2267
|
} = (0, import_react_hook_form9.useFormContext)();
|
|
2193
2268
|
const { Node: Node2 } = (0, import_elements_react16.useComponents)();
|
|
2194
2269
|
const hasRemoveButtons = removeButtons.length > 0;
|
|
2195
|
-
return /* @__PURE__ */ (0,
|
|
2196
|
-
/* @__PURE__ */ (0,
|
|
2270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex max-w-[60%] items-end gap-3", children: triggerButton && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2197
2272
|
Node2.Button,
|
|
2198
2273
|
{
|
|
2199
2274
|
node: triggerButton,
|
|
@@ -2201,38 +2276,38 @@ function DefaultSettingsPasskey({
|
|
|
2201
2276
|
onClick: triggerButton.onClick
|
|
2202
2277
|
}
|
|
2203
2278
|
) }),
|
|
2204
|
-
hasRemoveButtons ? /* @__PURE__ */ (0,
|
|
2205
|
-
/* @__PURE__ */ (0,
|
|
2206
|
-
/* @__PURE__ */ (0,
|
|
2279
|
+
hasRemoveButtons ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2280
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DefaultHorizontalDivider, {}),
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex flex-col gap-2", children: removeButtons.map((node, i) => {
|
|
2207
2282
|
var _a, _b;
|
|
2208
2283
|
const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
|
|
2209
2284
|
const addedAt = "added_at" in context ? context.added_at : null;
|
|
2210
2285
|
const displayName = "display_name" in context ? context.display_name : null;
|
|
2211
2286
|
const keyId = "value" in node.attributes ? node.attributes.value : null;
|
|
2212
|
-
return /* @__PURE__ */ (0,
|
|
2287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
2213
2288
|
"div",
|
|
2214
2289
|
{
|
|
2215
2290
|
className: "flex justify-between gap-6 md:items-center",
|
|
2216
2291
|
children: [
|
|
2217
|
-
/* @__PURE__ */ (0,
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
2292
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-2 items-center flex-1 truncate", children: [
|
|
2293
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2219
2294
|
passkey_default,
|
|
2220
2295
|
{
|
|
2221
2296
|
size: 32,
|
|
2222
2297
|
className: "text-interface-foreground-default-primary"
|
|
2223
2298
|
}
|
|
2224
2299
|
),
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2227
|
-
/* @__PURE__ */ (0,
|
|
2228
|
-
/* @__PURE__ */ (0,
|
|
2300
|
+
/* @__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: [
|
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-1 flex-col truncate", children: [
|
|
2302
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary truncate", children: displayName }),
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block truncate", children: keyId })
|
|
2229
2304
|
] }),
|
|
2230
|
-
addedAt && /* @__PURE__ */ (0,
|
|
2305
|
+
addedAt && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
|
|
2231
2306
|
dateStyle: "long"
|
|
2232
2307
|
}).format(new Date(addedAt)) })
|
|
2233
2308
|
] })
|
|
2234
2309
|
] }),
|
|
2235
|
-
/* @__PURE__ */ (0,
|
|
2310
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2236
2311
|
"button",
|
|
2237
2312
|
{
|
|
2238
2313
|
...node.attributes,
|
|
@@ -2240,7 +2315,7 @@ function DefaultSettingsPasskey({
|
|
|
2240
2315
|
onClick: node.onClick,
|
|
2241
2316
|
disabled: isSubmitting,
|
|
2242
2317
|
className: "relative",
|
|
2243
|
-
children: isSubmitting ? /* @__PURE__ */ (0,
|
|
2318
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2244
2319
|
trash_default,
|
|
2245
2320
|
{
|
|
2246
2321
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2259,38 +2334,26 @@ function DefaultSettingsPasskey({
|
|
|
2259
2334
|
}
|
|
2260
2335
|
|
|
2261
2336
|
// src/theme/default/assets/icons/download.svg
|
|
2262
|
-
var
|
|
2263
|
-
var
|
|
2337
|
+
var React31 = __toESM(require("react"));
|
|
2338
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2264
2339
|
var SvgDownload = (props) => {
|
|
2265
2340
|
var _a, _b;
|
|
2266
|
-
return /* @__PURE__ */ (0,
|
|
2341
|
+
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
2342
|
};
|
|
2268
2343
|
var download_default = SvgDownload;
|
|
2269
2344
|
|
|
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
2345
|
// src/theme/default/assets/icons/refresh.svg
|
|
2283
|
-
var
|
|
2284
|
-
var
|
|
2346
|
+
var React32 = __toESM(require("react"));
|
|
2347
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2285
2348
|
var SvgRefresh = (props) => {
|
|
2286
2349
|
var _a, _b;
|
|
2287
|
-
return /* @__PURE__ */ (0,
|
|
2350
|
+
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
2351
|
};
|
|
2289
2352
|
var refresh_default = SvgRefresh;
|
|
2290
2353
|
|
|
2291
2354
|
// src/theme/default/components/settings/settings-recovery-codes.tsx
|
|
2292
2355
|
var import_react_hook_form10 = require("react-hook-form");
|
|
2293
|
-
var
|
|
2356
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2294
2357
|
function DefaultSettingsRecoveryCodes({
|
|
2295
2358
|
codes,
|
|
2296
2359
|
regnerateButton,
|
|
@@ -2312,12 +2375,12 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2312
2375
|
element.click();
|
|
2313
2376
|
};
|
|
2314
2377
|
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,
|
|
2378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2379
|
+
codes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DefaultHorizontalDivider, {}),
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex gap-4 justify-between", children: [
|
|
2381
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-interface-foreground-default-tertiary", children: revealButton && "Reveal recovery codes" }),
|
|
2382
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex gap-2", children: [
|
|
2383
|
+
regnerateButton && codes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2321
2384
|
"button",
|
|
2322
2385
|
{
|
|
2323
2386
|
...regnerateButton.attributes,
|
|
@@ -2326,7 +2389,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2326
2389
|
onClick: onRegenerate,
|
|
2327
2390
|
disabled: isSubmitting,
|
|
2328
2391
|
"data-loading": isSubmitting,
|
|
2329
|
-
children: /* @__PURE__ */ (0,
|
|
2392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2330
2393
|
refresh_default,
|
|
2331
2394
|
{
|
|
2332
2395
|
size: 24,
|
|
@@ -2335,7 +2398,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2335
2398
|
)
|
|
2336
2399
|
}
|
|
2337
2400
|
),
|
|
2338
|
-
revealButton && /* @__PURE__ */ (0,
|
|
2401
|
+
revealButton && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2339
2402
|
"button",
|
|
2340
2403
|
{
|
|
2341
2404
|
...revealButton.attributes,
|
|
@@ -2343,7 +2406,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2343
2406
|
className: "ml-auto",
|
|
2344
2407
|
onClick: onReveal,
|
|
2345
2408
|
title: "Reveal recovery codes",
|
|
2346
|
-
children: /* @__PURE__ */ (0,
|
|
2409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2347
2410
|
eye_default,
|
|
2348
2411
|
{
|
|
2349
2412
|
size: 24,
|
|
@@ -2352,7 +2415,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2352
2415
|
)
|
|
2353
2416
|
}
|
|
2354
2417
|
) }),
|
|
2355
|
-
hasCodes && /* @__PURE__ */ (0,
|
|
2418
|
+
hasCodes && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2356
2419
|
"button",
|
|
2357
2420
|
{
|
|
2358
2421
|
onClick: onDownload,
|
|
@@ -2360,7 +2423,7 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2360
2423
|
className: "ml-auto",
|
|
2361
2424
|
"data-testid": "ory/screen/settings/group/recovery_code/download",
|
|
2362
2425
|
title: "Download recovery codes",
|
|
2363
|
-
children: /* @__PURE__ */ (0,
|
|
2426
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2364
2427
|
download_default,
|
|
2365
2428
|
{
|
|
2366
2429
|
size: 24,
|
|
@@ -2371,12 +2434,12 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2371
2434
|
)
|
|
2372
2435
|
] })
|
|
2373
2436
|
] }),
|
|
2374
|
-
hasCodes ? /* @__PURE__ */ (0,
|
|
2437
|
+
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
2438
|
"div",
|
|
2376
2439
|
{
|
|
2377
2440
|
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
2441
|
"data-testid": "ory/screen/settings/group/recovery_code/codes",
|
|
2379
|
-
children: codes.map((code) => /* @__PURE__ */ (0,
|
|
2442
|
+
children: codes.map((code) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { children: code }, code))
|
|
2380
2443
|
}
|
|
2381
2444
|
) }) : null
|
|
2382
2445
|
] });
|
|
@@ -2386,17 +2449,17 @@ function DefaultSettingsRecoveryCodes({
|
|
|
2386
2449
|
var import_elements_react17 = require("@ory/elements-react");
|
|
2387
2450
|
|
|
2388
2451
|
// src/theme/default/assets/icons/qrcode.svg
|
|
2389
|
-
var
|
|
2390
|
-
var
|
|
2452
|
+
var React33 = __toESM(require("react"));
|
|
2453
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2391
2454
|
var SvgQrcode = (props) => {
|
|
2392
2455
|
var _a, _b;
|
|
2393
|
-
return /* @__PURE__ */ (0,
|
|
2456
|
+
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
2457
|
};
|
|
2395
2458
|
var qrcode_default = SvgQrcode;
|
|
2396
2459
|
|
|
2397
2460
|
// src/theme/default/components/settings/settings-totp.tsx
|
|
2398
2461
|
var import_react_hook_form11 = require("react-hook-form");
|
|
2399
|
-
var
|
|
2462
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2400
2463
|
function DefaultSettingsTotp({
|
|
2401
2464
|
totpImage,
|
|
2402
2465
|
totpInput,
|
|
@@ -2416,19 +2479,19 @@ function DefaultSettingsTotp({
|
|
|
2416
2479
|
node_type: _ignoredNodeType,
|
|
2417
2480
|
...buttonAttrs
|
|
2418
2481
|
} = totpUnlink.attributes;
|
|
2419
|
-
return /* @__PURE__ */ (0,
|
|
2420
|
-
/* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
|
|
2483
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "col-span-full", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Card.Divider, {}) }),
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "col-span-full flex items-center gap-6", children: [
|
|
2485
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "aspect-square size-8 ", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(qrcode_default, { size: 32 }) }),
|
|
2486
|
+
/* @__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" }) }),
|
|
2487
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2425
2488
|
"button",
|
|
2426
2489
|
{
|
|
2427
2490
|
type: type === "button" ? "button" : "submit",
|
|
2428
2491
|
...buttonAttrs,
|
|
2429
2492
|
onClick: onUnlink,
|
|
2430
2493
|
disabled: isSubmitting,
|
|
2431
|
-
children: isSubmitting ? /* @__PURE__ */ (0,
|
|
2494
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2432
2495
|
trash_default,
|
|
2433
2496
|
{
|
|
2434
2497
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2441,9 +2504,9 @@ function DefaultSettingsTotp({
|
|
|
2441
2504
|
] });
|
|
2442
2505
|
}
|
|
2443
2506
|
if (totpImage && totpSecret && totpInput) {
|
|
2444
|
-
return /* @__PURE__ */ (0,
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "col-span-full", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DefaultHorizontalDivider, {}) }),
|
|
2509
|
+
/* @__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)(
|
|
2447
2510
|
Node2.Image,
|
|
2448
2511
|
{
|
|
2449
2512
|
node: totpImage,
|
|
@@ -2452,13 +2515,13 @@ function DefaultSettingsTotp({
|
|
|
2452
2515
|
}
|
|
2453
2516
|
}
|
|
2454
2517
|
) }) }) }),
|
|
2455
|
-
/* @__PURE__ */ (0,
|
|
2456
|
-
/* @__PURE__ */ (0,
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2457
2520
|
Node2.Label,
|
|
2458
2521
|
{
|
|
2459
2522
|
node: totpSecret,
|
|
2460
2523
|
attributes: totpSecret.attributes,
|
|
2461
|
-
children: /* @__PURE__ */ (0,
|
|
2524
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2462
2525
|
Node2.Input,
|
|
2463
2526
|
{
|
|
2464
2527
|
node: totpSecret,
|
|
@@ -2473,12 +2536,12 @@ function DefaultSettingsTotp({
|
|
|
2473
2536
|
)
|
|
2474
2537
|
}
|
|
2475
2538
|
),
|
|
2476
|
-
/* @__PURE__ */ (0,
|
|
2539
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2477
2540
|
Node2.Label,
|
|
2478
2541
|
{
|
|
2479
2542
|
attributes: totpInput.attributes,
|
|
2480
2543
|
node: totpInput,
|
|
2481
|
-
children: /* @__PURE__ */ (0,
|
|
2544
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2482
2545
|
Node2.CodeInput,
|
|
2483
2546
|
{
|
|
2484
2547
|
node: totpInput,
|
|
@@ -2496,17 +2559,17 @@ function DefaultSettingsTotp({
|
|
|
2496
2559
|
var import_elements_react18 = require("@ory/elements-react");
|
|
2497
2560
|
|
|
2498
2561
|
// src/theme/default/assets/icons/key.svg
|
|
2499
|
-
var
|
|
2500
|
-
var
|
|
2562
|
+
var React34 = __toESM(require("react"));
|
|
2563
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2501
2564
|
var SvgKey = (props) => {
|
|
2502
2565
|
var _a, _b;
|
|
2503
|
-
return /* @__PURE__ */ (0,
|
|
2566
|
+
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
2567
|
};
|
|
2505
2568
|
var key_default = SvgKey;
|
|
2506
2569
|
|
|
2507
2570
|
// src/theme/default/components/settings/settings-webauthn.tsx
|
|
2508
2571
|
var import_react_hook_form12 = require("react-hook-form");
|
|
2509
|
-
var
|
|
2572
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
2510
2573
|
function DefaultSettingsWebauthn({
|
|
2511
2574
|
nameInput,
|
|
2512
2575
|
triggerButton,
|
|
@@ -2517,14 +2580,14 @@ function DefaultSettingsWebauthn({
|
|
|
2517
2580
|
} = (0, import_react_hook_form12.useFormContext)();
|
|
2518
2581
|
const { Node: Node2, Card } = (0, import_elements_react18.useComponents)();
|
|
2519
2582
|
const hasRemoveButtons = removeButtons.length > 0;
|
|
2520
|
-
return /* @__PURE__ */ (0,
|
|
2521
|
-
/* @__PURE__ */ (0,
|
|
2522
|
-
/* @__PURE__ */ (0,
|
|
2583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2584
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex md:max-w-96 sm:items-end gap-3 flex-col sm:flex-row", children: [
|
|
2585
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2523
2586
|
Node2.Label,
|
|
2524
2587
|
{
|
|
2525
2588
|
node: nameInput,
|
|
2526
2589
|
attributes: nameInput.attributes,
|
|
2527
|
-
children: /* @__PURE__ */ (0,
|
|
2590
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2528
2591
|
Node2.Input,
|
|
2529
2592
|
{
|
|
2530
2593
|
node: nameInput,
|
|
@@ -2533,7 +2596,7 @@ function DefaultSettingsWebauthn({
|
|
|
2533
2596
|
)
|
|
2534
2597
|
}
|
|
2535
2598
|
) }),
|
|
2536
|
-
triggerButton ? /* @__PURE__ */ (0,
|
|
2599
|
+
triggerButton ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2537
2600
|
Node2.Button,
|
|
2538
2601
|
{
|
|
2539
2602
|
node: triggerButton,
|
|
@@ -2542,38 +2605,38 @@ function DefaultSettingsWebauthn({
|
|
|
2542
2605
|
}
|
|
2543
2606
|
) : null
|
|
2544
2607
|
] }),
|
|
2545
|
-
hasRemoveButtons ? /* @__PURE__ */ (0,
|
|
2546
|
-
/* @__PURE__ */ (0,
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2608
|
+
hasRemoveButtons ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
2609
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card.Divider, {}),
|
|
2610
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex flex-col gap-4", children: removeButtons.map((node, i) => {
|
|
2548
2611
|
var _a, _b;
|
|
2549
2612
|
const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
|
|
2550
2613
|
const addedAt = "added_at" in context ? context.added_at : null;
|
|
2551
2614
|
const displayName = "display_name" in context ? context.display_name : null;
|
|
2552
2615
|
const keyId = "value" in node.attributes ? node.attributes.value : null;
|
|
2553
|
-
return /* @__PURE__ */ (0,
|
|
2616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
2554
2617
|
"div",
|
|
2555
2618
|
{
|
|
2556
2619
|
className: "flex justify-between gap-6 md:items-center",
|
|
2557
2620
|
children: [
|
|
2558
|
-
/* @__PURE__ */ (0,
|
|
2559
|
-
/* @__PURE__ */ (0,
|
|
2621
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex gap-2 items-center flex-1 truncate", children: [
|
|
2622
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2560
2623
|
key_default,
|
|
2561
2624
|
{
|
|
2562
2625
|
size: 32,
|
|
2563
2626
|
className: "text-interface-foreground-default-primary"
|
|
2564
2627
|
}
|
|
2565
2628
|
),
|
|
2566
|
-
/* @__PURE__ */ (0,
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2568
|
-
/* @__PURE__ */ (0,
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2629
|
+
/* @__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: [
|
|
2630
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-1 flex-col truncate", children: [
|
|
2631
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary truncate", children: displayName }),
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block truncate", children: keyId })
|
|
2570
2633
|
] }),
|
|
2571
|
-
addedAt && /* @__PURE__ */ (0,
|
|
2634
|
+
addedAt && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
|
|
2572
2635
|
dateStyle: "long"
|
|
2573
2636
|
}).format(new Date(addedAt)) })
|
|
2574
2637
|
] })
|
|
2575
2638
|
] }),
|
|
2576
|
-
/* @__PURE__ */ (0,
|
|
2639
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2577
2640
|
"button",
|
|
2578
2641
|
{
|
|
2579
2642
|
...node.attributes,
|
|
@@ -2581,7 +2644,7 @@ function DefaultSettingsWebauthn({
|
|
|
2581
2644
|
onClick: node.onClick,
|
|
2582
2645
|
disabled: isSubmitting,
|
|
2583
2646
|
className: "relative",
|
|
2584
|
-
children: isSubmitting ? /* @__PURE__ */ (0,
|
|
2647
|
+
children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Spinner, { className: "relative" }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2585
2648
|
trash_default,
|
|
2586
2649
|
{
|
|
2587
2650
|
className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
|
|
@@ -2600,38 +2663,38 @@ function DefaultSettingsWebauthn({
|
|
|
2600
2663
|
}
|
|
2601
2664
|
|
|
2602
2665
|
// src/theme/default/components/card/auth-method-list-container.tsx
|
|
2603
|
-
var
|
|
2666
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2604
2667
|
function DefaultAuthMethodListContainer({
|
|
2605
2668
|
children
|
|
2606
2669
|
}) {
|
|
2607
|
-
return /* @__PURE__ */ (0,
|
|
2670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "grid grid-cols-1 gap-2", children });
|
|
2608
2671
|
}
|
|
2609
2672
|
|
|
2610
2673
|
// src/theme/default/components/form/captcha.tsx
|
|
2611
2674
|
var import_client_fetch30 = require("@ory/client-fetch");
|
|
2612
2675
|
var import_react_turnstile = require("@marsidev/react-turnstile");
|
|
2613
|
-
var
|
|
2676
|
+
var import_react14 = require("react");
|
|
2614
2677
|
var import_react_hook_form25 = require("react-hook-form");
|
|
2615
2678
|
|
|
2616
2679
|
// src/context/flow-context.tsx
|
|
2617
|
-
var
|
|
2680
|
+
var import_react12 = require("react");
|
|
2618
2681
|
|
|
2619
2682
|
// src/context/form-state.ts
|
|
2620
2683
|
var import_client_fetch15 = require("@ory/client-fetch");
|
|
2621
|
-
var
|
|
2684
|
+
var import_react11 = require("react");
|
|
2622
2685
|
|
|
2623
2686
|
// src/components/card/card-two-step.utils.ts
|
|
2624
2687
|
var import_client_fetch14 = require("@ory/client-fetch");
|
|
2625
2688
|
|
|
2626
2689
|
// src/context/flow-context.tsx
|
|
2627
|
-
var
|
|
2628
|
-
var OryFlowContext = (0,
|
|
2690
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
2691
|
+
var OryFlowContext = (0, import_react12.createContext)(null);
|
|
2629
2692
|
|
|
2630
2693
|
// src/context/intl-context.tsx
|
|
2631
2694
|
var import_react_intl20 = require("react-intl");
|
|
2632
2695
|
|
|
2633
2696
|
// src/components/card/header.tsx
|
|
2634
|
-
var
|
|
2697
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
2635
2698
|
|
|
2636
2699
|
// src/components/form/form-provider.tsx
|
|
2637
2700
|
var import_client_fetch18 = require("@ory/client-fetch");
|
|
@@ -2644,16 +2707,16 @@ var import_client_fetch16 = require("@ory/client-fetch");
|
|
|
2644
2707
|
var import_client_fetch17 = require("@ory/client-fetch");
|
|
2645
2708
|
|
|
2646
2709
|
// src/components/form/form-provider.tsx
|
|
2647
|
-
var
|
|
2710
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
2648
2711
|
|
|
2649
2712
|
// src/components/card/card.tsx
|
|
2650
|
-
var
|
|
2713
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
2651
2714
|
|
|
2652
2715
|
// src/components/card/footer.tsx
|
|
2653
|
-
var
|
|
2716
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
2654
2717
|
|
|
2655
2718
|
// src/components/card/content.tsx
|
|
2656
|
-
var
|
|
2719
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
2657
2720
|
|
|
2658
2721
|
// src/components/card/card-two-step.tsx
|
|
2659
2722
|
var import_client_fetch27 = require("@ory/client-fetch");
|
|
@@ -2684,34 +2747,34 @@ var import_client_fetch22 = require("@ory/client-fetch");
|
|
|
2684
2747
|
var import_client_fetch23 = require("@ory/client-fetch");
|
|
2685
2748
|
|
|
2686
2749
|
// src/components/form/form.tsx
|
|
2687
|
-
var
|
|
2750
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
2688
2751
|
|
|
2689
2752
|
// src/components/form/messages.tsx
|
|
2690
|
-
var
|
|
2753
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
2691
2754
|
|
|
2692
2755
|
// src/components/form/nodes/node.tsx
|
|
2693
2756
|
var import_client_fetch26 = require("@ory/client-fetch");
|
|
2694
|
-
var
|
|
2757
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
2695
2758
|
|
|
2696
2759
|
// src/components/form/social.tsx
|
|
2697
2760
|
var import_react_hook_form16 = require("react-hook-form");
|
|
2698
|
-
var
|
|
2761
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
2699
2762
|
|
|
2700
2763
|
// src/components/card/card-two-step.tsx
|
|
2701
|
-
var
|
|
2764
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
2702
2765
|
|
|
2703
2766
|
// src/components/form/groups.tsx
|
|
2704
|
-
var
|
|
2767
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
2705
2768
|
|
|
2706
2769
|
// src/components/form/section.tsx
|
|
2707
2770
|
var import_react_hook_form18 = require("react-hook-form");
|
|
2708
|
-
var
|
|
2771
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
2709
2772
|
|
|
2710
2773
|
// src/components/generic/divider.tsx
|
|
2711
|
-
var
|
|
2774
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
2712
2775
|
|
|
2713
2776
|
// src/components/generic/page-header.tsx
|
|
2714
|
-
var
|
|
2777
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
2715
2778
|
|
|
2716
2779
|
// src/components/settings/settings-card.tsx
|
|
2717
2780
|
var import_client_fetch28 = require("@ory/client-fetch");
|
|
@@ -2720,42 +2783,42 @@ var import_react_intl19 = require("react-intl");
|
|
|
2720
2783
|
// src/components/settings/oidc-settings.tsx
|
|
2721
2784
|
var import_react_intl14 = require("react-intl");
|
|
2722
2785
|
var import_react_hook_form19 = require("react-hook-form");
|
|
2723
|
-
var
|
|
2786
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
2724
2787
|
|
|
2725
2788
|
// src/components/settings/passkey-settings.tsx
|
|
2726
2789
|
var import_react_hook_form20 = require("react-hook-form");
|
|
2727
2790
|
var import_react_intl15 = require("react-intl");
|
|
2728
|
-
var
|
|
2791
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
2729
2792
|
|
|
2730
2793
|
// src/components/settings/recovery-codes-settings.tsx
|
|
2731
2794
|
var import_react_intl16 = require("react-intl");
|
|
2732
2795
|
var import_react_hook_form21 = require("react-hook-form");
|
|
2733
|
-
var
|
|
2796
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
2734
2797
|
|
|
2735
2798
|
// src/components/settings/totp-settings.tsx
|
|
2736
2799
|
var import_react_hook_form22 = require("react-hook-form");
|
|
2737
2800
|
var import_react_intl17 = require("react-intl");
|
|
2738
|
-
var
|
|
2801
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
2739
2802
|
|
|
2740
2803
|
// src/components/settings/webauthn-settings.tsx
|
|
2741
2804
|
var import_react_hook_form23 = require("react-hook-form");
|
|
2742
2805
|
var import_react_intl18 = require("react-intl");
|
|
2743
|
-
var
|
|
2806
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
2744
2807
|
|
|
2745
2808
|
// src/components/settings/settings-card.tsx
|
|
2746
|
-
var
|
|
2809
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
2747
2810
|
|
|
2748
2811
|
// src/context/intl-context.tsx
|
|
2749
|
-
var
|
|
2812
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
2750
2813
|
|
|
2751
2814
|
// src/context/provider.tsx
|
|
2752
|
-
var
|
|
2815
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
2753
2816
|
|
|
2754
2817
|
// src/components/form/nodes/input.tsx
|
|
2755
2818
|
var import_client_fetch29 = require("@ory/client-fetch");
|
|
2756
|
-
var
|
|
2819
|
+
var import_react13 = require("react");
|
|
2757
2820
|
var import_react_hook_form24 = require("react-hook-form");
|
|
2758
|
-
var
|
|
2821
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
2759
2822
|
var NodeInput = ({
|
|
2760
2823
|
node,
|
|
2761
2824
|
attributes
|
|
@@ -2779,8 +2842,8 @@ var NodeInput = ({
|
|
|
2779
2842
|
setValue(attrs.name, attrs.value);
|
|
2780
2843
|
}
|
|
2781
2844
|
};
|
|
2782
|
-
const hasRun = (0,
|
|
2783
|
-
(0,
|
|
2845
|
+
const hasRun = (0, import_react13.useRef)(false);
|
|
2846
|
+
(0, import_react13.useEffect)(
|
|
2784
2847
|
() => {
|
|
2785
2848
|
setFormValue();
|
|
2786
2849
|
if (!hasRun.current && onloadTrigger) {
|
|
@@ -2809,30 +2872,30 @@ var NodeInput = ({
|
|
|
2809
2872
|
if (isResendNode || isScreenSelectionNode) {
|
|
2810
2873
|
return null;
|
|
2811
2874
|
}
|
|
2812
|
-
return /* @__PURE__ */ (0,
|
|
2875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
2813
2876
|
Node2.Label,
|
|
2814
2877
|
{
|
|
2815
2878
|
attributes: { ...attrs, label: void 0 },
|
|
2816
2879
|
node: { ...node, meta: { ...node.meta, label: void 0 } },
|
|
2817
|
-
children: /* @__PURE__ */ (0,
|
|
2880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Node2.Button, { attributes: attrs, node, onClick: handleClick })
|
|
2818
2881
|
}
|
|
2819
2882
|
);
|
|
2820
2883
|
case import_client_fetch29.UiNodeInputAttributesTypeEnum.DatetimeLocal:
|
|
2821
2884
|
throw new Error("Not implemented");
|
|
2822
2885
|
case import_client_fetch29.UiNodeInputAttributesTypeEnum.Checkbox:
|
|
2823
|
-
return /* @__PURE__ */ (0,
|
|
2886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
2824
2887
|
Node2.Label,
|
|
2825
2888
|
{
|
|
2826
2889
|
attributes: { ...attrs, label: void 0 },
|
|
2827
2890
|
node: { ...node, meta: { ...node.meta, label: void 0 } },
|
|
2828
|
-
children: /* @__PURE__ */ (0,
|
|
2891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Node2.Checkbox, { attributes: attrs, node, onClick: handleClick })
|
|
2829
2892
|
}
|
|
2830
2893
|
);
|
|
2831
2894
|
case import_client_fetch29.UiNodeInputAttributesTypeEnum.Hidden:
|
|
2832
|
-
return /* @__PURE__ */ (0,
|
|
2895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Node2.Input, { attributes: attrs, node, onClick: handleClick });
|
|
2833
2896
|
default:
|
|
2834
2897
|
if (isPinCodeInput) {
|
|
2835
|
-
return /* @__PURE__ */ (0,
|
|
2898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Node2.Label, { attributes: attrs, node, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
2836
2899
|
Node2.CodeInput,
|
|
2837
2900
|
{
|
|
2838
2901
|
attributes: attrs,
|
|
@@ -2841,25 +2904,25 @@ var NodeInput = ({
|
|
|
2841
2904
|
}
|
|
2842
2905
|
) });
|
|
2843
2906
|
}
|
|
2844
|
-
return /* @__PURE__ */ (0,
|
|
2907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Node2.Label, { attributes: attrs, node, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Node2.Input, { attributes: attrs, node, onClick: handleClick }) });
|
|
2845
2908
|
}
|
|
2846
2909
|
};
|
|
2847
2910
|
|
|
2848
2911
|
// src/theme/default/components/form/captcha.tsx
|
|
2849
|
-
var
|
|
2912
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
2850
2913
|
var DefaultCaptcha = ({ node }) => {
|
|
2851
2914
|
const { setValue } = (0, import_react_hook_form25.useFormContext)();
|
|
2852
|
-
const ref = (0,
|
|
2915
|
+
const ref = (0, import_react14.useRef)();
|
|
2853
2916
|
const nodes = [];
|
|
2854
2917
|
if ((0, import_client_fetch30.isUiNodeInputAttributes)(node.attributes)) {
|
|
2855
2918
|
if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
|
|
2856
|
-
nodes.push(/* @__PURE__ */ (0,
|
|
2919
|
+
nodes.push(/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(NodeInput, { node, attributes: node.attributes }, 1));
|
|
2857
2920
|
}
|
|
2858
2921
|
}
|
|
2859
2922
|
if ((0, import_client_fetch30.isUiNodeInputAttributes)(node.attributes) && node.attributes.name === "captcha_turnstile_options") {
|
|
2860
2923
|
const options = JSON.parse(node.attributes.value);
|
|
2861
2924
|
nodes.push(
|
|
2862
|
-
/* @__PURE__ */ (0,
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
2863
2926
|
import_react_turnstile.Turnstile,
|
|
2864
2927
|
{
|
|
2865
2928
|
ref,
|
|
@@ -2936,18 +2999,18 @@ function getOryComponents(overrides) {
|
|
|
2936
2999
|
}
|
|
2937
3000
|
|
|
2938
3001
|
// src/theme/default/flows/error.tsx
|
|
2939
|
-
var
|
|
3002
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
2940
3003
|
function Error2({
|
|
2941
3004
|
error,
|
|
2942
3005
|
children
|
|
2943
3006
|
}) {
|
|
2944
|
-
return /* @__PURE__ */ (0,
|
|
3007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { "data-testid": "ory/screen/error/raw", children: JSON.stringify(error) || children });
|
|
2945
3008
|
}
|
|
2946
3009
|
|
|
2947
3010
|
// src/theme/default/flows/login.tsx
|
|
2948
3011
|
var import_client_fetch31 = require("@ory/client-fetch");
|
|
2949
3012
|
var import_elements_react19 = require("@ory/elements-react");
|
|
2950
|
-
var
|
|
3013
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
2951
3014
|
function Login({
|
|
2952
3015
|
flow,
|
|
2953
3016
|
config,
|
|
@@ -2955,14 +3018,14 @@ function Login({
|
|
|
2955
3018
|
components: flowOverrideComponents
|
|
2956
3019
|
}) {
|
|
2957
3020
|
const components = getOryComponents(flowOverrideComponents);
|
|
2958
|
-
return /* @__PURE__ */ (0,
|
|
3021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
2959
3022
|
import_elements_react19.OryProvider,
|
|
2960
3023
|
{
|
|
2961
3024
|
config,
|
|
2962
3025
|
flow,
|
|
2963
3026
|
flowType: import_client_fetch31.FlowType.Login,
|
|
2964
3027
|
components,
|
|
2965
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
3028
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_elements_react19.OryTwoStepCard, {})
|
|
2966
3029
|
}
|
|
2967
3030
|
);
|
|
2968
3031
|
}
|
|
@@ -2970,7 +3033,7 @@ function Login({
|
|
|
2970
3033
|
// src/theme/default/flows/recovery.tsx
|
|
2971
3034
|
var import_client_fetch32 = require("@ory/client-fetch");
|
|
2972
3035
|
var import_elements_react20 = require("@ory/elements-react");
|
|
2973
|
-
var
|
|
3036
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
2974
3037
|
function Recovery({
|
|
2975
3038
|
flow,
|
|
2976
3039
|
config,
|
|
@@ -2978,14 +3041,14 @@ function Recovery({
|
|
|
2978
3041
|
components: flowOverrideComponents
|
|
2979
3042
|
}) {
|
|
2980
3043
|
const components = getOryComponents(flowOverrideComponents);
|
|
2981
|
-
return /* @__PURE__ */ (0,
|
|
3044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
2982
3045
|
import_elements_react20.OryProvider,
|
|
2983
3046
|
{
|
|
2984
3047
|
config,
|
|
2985
3048
|
flow,
|
|
2986
3049
|
flowType: import_client_fetch32.FlowType.Recovery,
|
|
2987
3050
|
components,
|
|
2988
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
3051
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_elements_react20.OryTwoStepCard, {})
|
|
2989
3052
|
}
|
|
2990
3053
|
);
|
|
2991
3054
|
}
|
|
@@ -2993,7 +3056,7 @@ function Recovery({
|
|
|
2993
3056
|
// src/theme/default/flows/registration.tsx
|
|
2994
3057
|
var import_client_fetch33 = require("@ory/client-fetch");
|
|
2995
3058
|
var import_elements_react21 = require("@ory/elements-react");
|
|
2996
|
-
var
|
|
3059
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
2997
3060
|
function Registration({
|
|
2998
3061
|
flow,
|
|
2999
3062
|
children,
|
|
@@ -3001,14 +3064,14 @@ function Registration({
|
|
|
3001
3064
|
config
|
|
3002
3065
|
}) {
|
|
3003
3066
|
const components = getOryComponents(flowOverrideComponents);
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
3067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
3005
3068
|
import_elements_react21.OryProvider,
|
|
3006
3069
|
{
|
|
3007
3070
|
config,
|
|
3008
3071
|
flow,
|
|
3009
3072
|
flowType: import_client_fetch33.FlowType.Registration,
|
|
3010
3073
|
components,
|
|
3011
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
3074
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_elements_react21.OryTwoStepCard, {})
|
|
3012
3075
|
}
|
|
3013
3076
|
);
|
|
3014
3077
|
}
|
|
@@ -3016,7 +3079,7 @@ function Registration({
|
|
|
3016
3079
|
// src/theme/default/flows/settings.tsx
|
|
3017
3080
|
var import_client_fetch34 = require("@ory/client-fetch");
|
|
3018
3081
|
var import_elements_react22 = require("@ory/elements-react");
|
|
3019
|
-
var
|
|
3082
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
3020
3083
|
function Settings({
|
|
3021
3084
|
flow,
|
|
3022
3085
|
config,
|
|
@@ -3024,16 +3087,16 @@ function Settings({
|
|
|
3024
3087
|
components: flowOverrideComponents
|
|
3025
3088
|
}) {
|
|
3026
3089
|
const components = getOryComponents(flowOverrideComponents);
|
|
3027
|
-
return /* @__PURE__ */ (0,
|
|
3090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
3028
3091
|
import_elements_react22.OryProvider,
|
|
3029
3092
|
{
|
|
3030
3093
|
config,
|
|
3031
3094
|
flow,
|
|
3032
3095
|
flowType: import_client_fetch34.FlowType.Settings,
|
|
3033
3096
|
components,
|
|
3034
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
3035
|
-
/* @__PURE__ */ (0,
|
|
3036
|
-
/* @__PURE__ */ (0,
|
|
3097
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_elements_react22.HeadlessPageHeader, {}),
|
|
3099
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_elements_react22.OrySettingsCard, {})
|
|
3037
3100
|
] })
|
|
3038
3101
|
}
|
|
3039
3102
|
);
|
|
@@ -3042,7 +3105,7 @@ function Settings({
|
|
|
3042
3105
|
// src/theme/default/flows/verification.tsx
|
|
3043
3106
|
var import_client_fetch35 = require("@ory/client-fetch");
|
|
3044
3107
|
var import_elements_react23 = require("@ory/elements-react");
|
|
3045
|
-
var
|
|
3108
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
3046
3109
|
function Verification({
|
|
3047
3110
|
flow,
|
|
3048
3111
|
config,
|
|
@@ -3050,14 +3113,14 @@ function Verification({
|
|
|
3050
3113
|
components: flowOverrideComponents
|
|
3051
3114
|
}) {
|
|
3052
3115
|
const components = getOryComponents(flowOverrideComponents);
|
|
3053
|
-
return /* @__PURE__ */ (0,
|
|
3116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
3054
3117
|
import_elements_react23.OryProvider,
|
|
3055
3118
|
{
|
|
3056
3119
|
config,
|
|
3057
3120
|
flow,
|
|
3058
3121
|
flowType: import_client_fetch35.FlowType.Verification,
|
|
3059
3122
|
components,
|
|
3060
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
3123
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_elements_react23.OryTwoStepCard, {})
|
|
3061
3124
|
}
|
|
3062
3125
|
);
|
|
3063
3126
|
}
|