@ory/elements-react 0.0.0-pr.5cdcf132 → 0.0.0-pr.6ecad3e0

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.
@@ -268,6 +268,7 @@ function frontendClient(sdkUrl, opts = {}) {
268
268
  const config = new import_client_fetch6.Configuration({
269
269
  ...opts,
270
270
  basePath: sdkUrl,
271
+ credentials: "include",
271
272
  headers: {
272
273
  Accept: "application/json",
273
274
  ...opts.headers
@@ -2887,6 +2888,19 @@ function LoginCardFooter() {
2887
2888
  `${config.sdk.url}/self-service/${flowType}/browser`
2888
2889
  );
2889
2890
  }
2891
+ if (authMethods.length > 1 && formState.current === "method_active") {
2892
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2893
+ "a",
2894
+ {
2895
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
2896
+ href: "",
2897
+ "data-testid": "ory/screen/login/mfa/action/selectMethod",
2898
+ children: intl.formatMessage({
2899
+ id: "login.2fa.method.go-back"
2900
+ })
2901
+ }
2902
+ ) });
2903
+ }
2890
2904
  if (flow.refresh || flow.requested_aal === "aal2") {
2891
2905
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
2892
2906
  intl.formatMessage({
@@ -2929,17 +2943,6 @@ function LoginCardFooter() {
2929
2943
  }
2930
2944
  )
2931
2945
  ] }),
2932
- authMethods.length > 1 && formState.current === "method_active" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2933
- "a",
2934
- {
2935
- className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
2936
- href: "",
2937
- "data-testid": "ory/screen/login/mfa/action/selectMethod",
2938
- children: intl.formatMessage({
2939
- id: "login.2fa.method.go-back"
2940
- })
2941
- }
2942
- ) }),
2943
2946
  authMethods.length === 1 && authMethods[0] === "code" && formState.current === "method_active" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2944
2947
  "a",
2945
2948
  {
@@ -3303,6 +3306,9 @@ var SvgArrowLeft = (props) => {
3303
3306
  };
3304
3307
  var arrow_left_default = SvgArrowLeft;
3305
3308
 
3309
+ // src/theme/default/components/card/current-identifier-button.tsx
3310
+ var import_react_hook_form13 = require("react-hook-form");
3311
+
3306
3312
  // src/theme/default/utils/attributes.ts
3307
3313
  function omit(obj, keys) {
3308
3314
  const ret = { ...obj };
@@ -3312,13 +3318,37 @@ function omit(obj, keys) {
3312
3318
  return ret;
3313
3319
  }
3314
3320
 
3321
+ // src/util/omitAttributes.ts
3322
+ function omitInputAttributes({
3323
+ ...attrs
3324
+ }) {
3325
+ return omit(attrs, [
3326
+ "autocomplete",
3327
+ "label",
3328
+ "node_type",
3329
+ "maxlength",
3330
+ "onclick",
3331
+ "onclickTrigger",
3332
+ "onload",
3333
+ "onloadTrigger"
3334
+ ]);
3335
+ }
3336
+
3315
3337
  // src/theme/default/components/card/current-identifier-button.tsx
3316
- var import_react_hook_form13 = require("react-hook-form");
3338
+ var import_react7 = require("react");
3317
3339
  var import_jsx_runtime36 = require("react/jsx-runtime");
3318
3340
  function DefaultCurrentIdentifierButton() {
3341
+ var _a;
3319
3342
  const { flow, flowType, config, formState } = (0, import_elements_react4.useOryFlow)();
3320
- const { setValue } = (0, import_react_hook_form13.useFormContext)();
3343
+ const { setValue, getValues, watch } = (0, import_react_hook_form13.useFormContext)();
3344
+ const [turnstileResponse, setTurnstileResponse] = (0, import_react7.useState)();
3321
3345
  const ui = flow.ui;
3346
+ const captchaVerificationValue = (_a = watch("transient_payload")) == null ? void 0 : _a.captcha_turnstile_response;
3347
+ (0, import_react7.useEffect)(() => {
3348
+ if (captchaVerificationValue) {
3349
+ setTurnstileResponse(captchaVerificationValue);
3350
+ }
3351
+ }, [captchaVerificationValue]);
3322
3352
  if (formState.current === "provide_identifier") {
3323
3353
  return null;
3324
3354
  }
@@ -3333,11 +3363,6 @@ function DefaultCurrentIdentifierButton() {
3333
3363
  flow,
3334
3364
  `${config.sdk.url}/self-service/${flowType}/browser`
3335
3365
  );
3336
- const attributes = omit(nodeBackButton, [
3337
- "autocomplete",
3338
- "node_type",
3339
- "maxlength"
3340
- ]);
3341
3366
  const screenSelectionNode = findScreenSelectionButton(flow.ui.nodes);
3342
3367
  if (screenSelectionNode) {
3343
3368
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("form", { action: flow.ui.action, method: flow.ui.method, children: [
@@ -3348,12 +3373,16 @@ function DefaultCurrentIdentifierButton() {
3348
3373
  return false;
3349
3374
  }).map((n) => {
3350
3375
  const attrs = n.attributes;
3376
+ let value = getValues(attrs.name) || attrs.value;
3377
+ if (attrs.name === "transient_payload.captcha_turnstile_response" && turnstileResponse) {
3378
+ value = turnstileResponse;
3379
+ }
3351
3380
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3352
3381
  "input",
3353
3382
  {
3354
3383
  type: "hidden",
3355
3384
  name: attrs.name,
3356
- value: attrs.value
3385
+ value
3357
3386
  },
3358
3387
  attrs.name
3359
3388
  );
@@ -3362,7 +3391,7 @@ function DefaultCurrentIdentifierButton() {
3362
3391
  "button",
3363
3392
  {
3364
3393
  className: "group inline-flex max-w-full cursor-pointer items-center gap-1 self-start rounded-identifier border px-[11px] py-[5px] transition-colors border-button-identifier-border-border-default bg-button-identifier-background-default hover:border-button-identifier-border-border-hover hover:bg-button-identifier-background-hover",
3365
- ...attributes,
3394
+ ...omitInputAttributes(nodeBackButton),
3366
3395
  type: "submit",
3367
3396
  onClick: () => {
3368
3397
  setValue(
@@ -3394,7 +3423,7 @@ function DefaultCurrentIdentifierButton() {
3394
3423
  "a",
3395
3424
  {
3396
3425
  className: "group inline-flex max-w-full cursor-pointer items-center gap-1 self-start rounded-identifier border px-[11px] py-[5px] transition-colors border-button-identifier-border-border-default bg-button-identifier-background-default hover:border-button-identifier-border-border-hover hover:bg-button-identifier-background-hover",
3397
- ...attributes,
3426
+ ...omitInputAttributes(nodeBackButton),
3398
3427
  href: initFlowUrl2,
3399
3428
  title: `Adjust ${nodeBackButton == null ? void 0 : nodeBackButton.value}`,
3400
3429
  "data-testid": `ory/screen/${flowType}/action/restart`,
@@ -3485,11 +3514,23 @@ function DefaultCardHeader() {
3485
3514
  var import_elements_react6 = require("@ory/elements-react");
3486
3515
  var import_jsx_runtime38 = require("react/jsx-runtime");
3487
3516
  function DefaultCardLogo() {
3517
+ var _a;
3488
3518
  const flow = (0, import_elements_react6.useOryFlow)();
3519
+ if (flow.config.project.logo_light_url) {
3520
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3521
+ "img",
3522
+ {
3523
+ src: flow.config.project.logo_light_url,
3524
+ width: 100,
3525
+ height: 36,
3526
+ alt: "Logo"
3527
+ }
3528
+ );
3529
+ }
3489
3530
  if (flow.config.logoUrl) {
3490
3531
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { src: flow.config.logoUrl, width: 100, height: 36, alt: "Logo" });
3491
3532
  }
3492
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: flow.config.name });
3533
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: (_a = flow.config.project.name) != null ? _a : flow.config.name });
3493
3534
  }
3494
3535
 
3495
3536
  // src/theme/default/components/card/layout.tsx
@@ -3521,7 +3562,7 @@ var import_client_fetch31 = require("@ory/client-fetch");
3521
3562
 
3522
3563
  // src/theme/default/components/form/social.tsx
3523
3564
  var import_elements_react7 = require("@ory/elements-react");
3524
- var import_react7 = require("react");
3565
+ var import_react8 = require("react");
3525
3566
  var import_react_hook_form14 = require("react-hook-form");
3526
3567
  var import_react_intl12 = require("react-intl");
3527
3568
  var import_usehooks_ts = require("usehooks-ts");
@@ -3741,24 +3782,6 @@ function Spinner({ className }) {
3741
3782
 
3742
3783
  // src/theme/default/components/form/social.tsx
3743
3784
  var import_client_fetch30 = require("@ory/client-fetch");
3744
-
3745
- // src/util/omitAttributes.ts
3746
- function omitInputAttributes({
3747
- ...attrs
3748
- }) {
3749
- return omit(attrs, [
3750
- "autocomplete",
3751
- "label",
3752
- "node_type",
3753
- "maxlength",
3754
- "onclick",
3755
- "onclickTrigger",
3756
- "onload",
3757
- "onloadTrigger"
3758
- ]);
3759
- }
3760
-
3761
- // src/theme/default/components/form/social.tsx
3762
3785
  var import_jsx_runtime55 = require("react/jsx-runtime");
3763
3786
  function extractProvider(context) {
3764
3787
  if (context && typeof context === "object" && "provider" in context && typeof context.provider === "string") {
@@ -3794,7 +3817,7 @@ function DefaultButtonSocial({
3794
3817
  onClick == null ? void 0 : onClick();
3795
3818
  setClicked(true);
3796
3819
  };
3797
- (0, import_react7.useEffect)(() => {
3820
+ (0, import_react8.useEffect)(() => {
3798
3821
  if (!isSubmitting) {
3799
3822
  setClicked(false);
3800
3823
  }
@@ -4033,7 +4056,7 @@ var import_elements_react9 = require("@ory/elements-react");
4033
4056
  var import_class_variance_authority = require("class-variance-authority");
4034
4057
  var import_react_hook_form15 = require("react-hook-form");
4035
4058
  var import_react_intl15 = require("react-intl");
4036
- var import_react8 = require("react");
4059
+ var import_react9 = require("react");
4037
4060
  var import_jsx_runtime65 = require("react/jsx-runtime");
4038
4061
  var buttonStyles = (0, import_class_variance_authority.cva)(
4039
4062
  [
@@ -4074,14 +4097,14 @@ var DefaultButton = ({
4074
4097
  }) => {
4075
4098
  var _a;
4076
4099
  const { type, name, value, ...rest } = attributes;
4077
- const [clicked, setClicked] = (0, import_react8.useState)(false);
4100
+ const [clicked, setClicked] = (0, import_react9.useState)(false);
4078
4101
  const intl = (0, import_react_intl15.useIntl)();
4079
4102
  const label = (0, import_client_fetch32.getNodeLabel)(node);
4080
4103
  const {
4081
4104
  formState: { isSubmitting },
4082
4105
  setValue
4083
4106
  } = (0, import_react_hook_form15.useFormContext)();
4084
- (0, import_react8.useEffect)(() => {
4107
+ (0, import_react9.useEffect)(() => {
4085
4108
  if (!isSubmitting) {
4086
4109
  setClicked(false);
4087
4110
  }
@@ -4239,10 +4262,10 @@ var import_elements_react11 = require("@ory/elements-react");
4239
4262
  var import_client_fetch34 = require("@ory/client-fetch");
4240
4263
 
4241
4264
  // src/util/childCounter.ts
4242
- var import_react9 = require("react");
4265
+ var import_react10 = require("react");
4243
4266
  function countRenderableChildren(children) {
4244
- return import_react9.Children.toArray(children).filter((c) => {
4245
- if ((0, import_react9.isValidElement)(c)) {
4267
+ return import_react10.Children.toArray(children).filter((c) => {
4268
+ if ((0, import_react10.isValidElement)(c)) {
4246
4269
  return true;
4247
4270
  }
4248
4271
  return false;
@@ -4291,7 +4314,7 @@ function DefaultImage({ attributes, node }) {
4291
4314
  // src/theme/default/components/form/input.tsx
4292
4315
  var import_client_fetch35 = require("@ory/client-fetch");
4293
4316
  var import_elements_react12 = require("@ory/elements-react");
4294
- var import_react10 = require("react");
4317
+ var import_react11 = require("react");
4295
4318
  var import_react_hook_form17 = require("react-hook-form");
4296
4319
  var import_react_intl18 = require("react-intl");
4297
4320
 
@@ -4336,7 +4359,7 @@ var DefaultInput = ({
4336
4359
  const { value, autocomplete, name, maxlength, ...rest } = attributes;
4337
4360
  const intl = (0, import_react_intl18.useIntl)();
4338
4361
  const { flowType } = (0, import_elements_react12.useOryFlow)();
4339
- const inputRef = (0, import_react10.useRef)(null);
4362
+ const inputRef = (0, import_react11.useRef)(null);
4340
4363
  const formattedLabel = label ? intl.formatMessage(
4341
4364
  {
4342
4365
  id: "input.placeholder",
@@ -4350,7 +4373,7 @@ var DefaultInput = ({
4350
4373
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
4351
4374
  "input",
4352
4375
  {
4353
- ...rest,
4376
+ ...omitInputAttributes(rest),
4354
4377
  onClick,
4355
4378
  maxLength: maxlength,
4356
4379
  autoComplete: autocomplete,
@@ -4395,7 +4418,7 @@ var DefaultInput = ({
4395
4418
  function PasswordToggle({
4396
4419
  inputRef
4397
4420
  }) {
4398
- const [shown, setShown] = (0, import_react10.useState)(false);
4421
+ const [shown, setShown] = (0, import_react11.useState)(false);
4399
4422
  const handleClick = () => {
4400
4423
  setShown(!shown);
4401
4424
  if (inputRef.current) {
@@ -4490,10 +4513,10 @@ function DefaultLabel({
4490
4513
  // src/theme/default/components/form/link-button.tsx
4491
4514
  var import_client_fetch37 = require("@ory/client-fetch");
4492
4515
  var import_elements_react14 = require("@ory/elements-react");
4493
- var import_react11 = require("react");
4516
+ var import_react12 = require("react");
4494
4517
  var import_react_intl20 = require("react-intl");
4495
4518
  var import_jsx_runtime75 = require("react/jsx-runtime");
4496
- var DefaultLinkButton = (0, import_react11.forwardRef)(({ attributes, node }, ref) => {
4519
+ var DefaultLinkButton = (0, import_react12.forwardRef)(({ attributes, node }, ref) => {
4497
4520
  const intl = (0, import_react_intl20.useIntl)();
4498
4521
  const label = (0, import_client_fetch37.getNodeLabel)(node);
4499
4522
  return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
@@ -4741,12 +4764,12 @@ var getUserInitials = (session) => {
4741
4764
  };
4742
4765
 
4743
4766
  // src/theme/default/components/ui/dropdown-menu.tsx
4744
- var import_react12 = require("react");
4767
+ var import_react13 = require("react");
4745
4768
  var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
4746
4769
  var import_jsx_runtime82 = require("react/jsx-runtime");
4747
4770
  var DropdownMenu = DropdownMenuPrimitive.Root;
4748
4771
  var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
4749
- var DropdownMenuContent = (0, import_react12.forwardRef)(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
4772
+ var DropdownMenuContent = (0, import_react13.forwardRef)(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
4750
4773
  DropdownMenuPrimitive.Content,
4751
4774
  {
4752
4775
  ref,
@@ -4761,7 +4784,7 @@ var DropdownMenuContent = (0, import_react12.forwardRef)(({ className, sideOffse
4761
4784
  }
4762
4785
  ) }));
4763
4786
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
4764
- var DropdownMenuItem = (0, import_react12.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
4787
+ var DropdownMenuItem = (0, import_react13.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
4765
4788
  DropdownMenuPrimitive.Item,
4766
4789
  {
4767
4790
  ref,
@@ -4779,7 +4802,7 @@ var DropdownMenuItem = (0, import_react12.forwardRef)(({ className, inset, ...pr
4779
4802
  }
4780
4803
  ));
4781
4804
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
4782
- var DropdownMenuLabel = (0, import_react12.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
4805
+ var DropdownMenuLabel = (0, import_react13.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
4783
4806
  DropdownMenuPrimitive.Label,
4784
4807
  {
4785
4808
  ref,
@@ -4794,7 +4817,7 @@ var DropdownMenuLabel = (0, import_react12.forwardRef)(({ className, inset, ...p
4794
4817
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
4795
4818
 
4796
4819
  // src/theme/default/components/ui/user-avater.tsx
4797
- var import_react13 = require("react");
4820
+ var import_react14 = require("react");
4798
4821
 
4799
4822
  // src/theme/default/assets/icons/user.svg
4800
4823
  var React28 = __toESM(require("react"));
@@ -4807,7 +4830,7 @@ var user_default = SvgUser;
4807
4830
 
4808
4831
  // src/theme/default/components/ui/user-avater.tsx
4809
4832
  var import_jsx_runtime84 = require("react/jsx-runtime");
4810
- var UserAvatar = (0, import_react13.forwardRef)(
4833
+ var UserAvatar = (0, import_react14.forwardRef)(
4811
4834
  ({ initials, ...rest }, ref) => {
4812
4835
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
4813
4836
  "button",
@@ -4899,7 +4922,7 @@ var DefaultPageHeader = (_props) => {
4899
4922
  };
4900
4923
 
4901
4924
  // src/theme/default/components/settings/settings-oidc.tsx
4902
- var import_react14 = require("react");
4925
+ var import_react15 = require("react");
4903
4926
  var import_react_hook_form20 = require("react-hook-form");
4904
4927
  var import_usehooks_ts2 = require("usehooks-ts");
4905
4928
 
@@ -4956,7 +4979,7 @@ function UnlinkRow({ button }) {
4956
4979
  button.onClick();
4957
4980
  setClicked(true);
4958
4981
  };
4959
- (0, import_react14.useEffect)(() => {
4982
+ (0, import_react15.useEffect)(() => {
4960
4983
  if (!isSubmitting) {
4961
4984
  setClicked(false);
4962
4985
  }
@@ -5405,48 +5428,53 @@ function DefaultAuthMethodListContainer({
5405
5428
  // src/theme/default/components/form/captcha.tsx
5406
5429
  var import_client_fetch39 = require("@ory/client-fetch");
5407
5430
  var import_react_turnstile = require("@marsidev/react-turnstile");
5408
- var import_react15 = require("react");
5431
+ var import_react16 = require("react");
5409
5432
  var import_react_hook_form25 = require("react-hook-form");
5410
5433
  var import_jsx_runtime98 = require("react/jsx-runtime");
5411
5434
  var DefaultCaptcha = ({ node }) => {
5412
- const { setValue } = (0, import_react_hook_form25.useFormContext)();
5413
- const ref = (0, import_react15.useRef)();
5414
- const nodes = [];
5415
- if ((0, import_client_fetch39.isUiNodeInputAttributes)(node.attributes)) {
5416
- if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
5417
- nodes.push(
5418
- /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(DefaultInput, { node, attributes: node.attributes }, 1)
5419
- );
5435
+ const { setValue, formState } = (0, import_react_hook_form25.useFormContext)();
5436
+ const ref = (0, import_react16.useRef)();
5437
+ const prevSubmitCount = (0, import_react16.useRef)(formState.submitCount);
5438
+ (0, import_react16.useEffect)(() => {
5439
+ if (formState.submitCount > prevSubmitCount.current && formState.isSubmitSuccessful) {
5440
+ prevSubmitCount.current = formState.submitCount;
5441
+ setTimeout(() => {
5442
+ if (ref.current) {
5443
+ ref.current.reset();
5444
+ }
5445
+ }, 100);
5420
5446
  }
5447
+ }, [formState.submitCount, formState.isSubmitSuccessful]);
5448
+ if (!(0, import_client_fetch39.isUiNodeInputAttributes)(node.attributes)) {
5449
+ return null;
5421
5450
  }
5422
- if ((0, import_client_fetch39.isUiNodeInputAttributes)(node.attributes) && node.attributes.name === "captcha_turnstile_options") {
5451
+ if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
5452
+ return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(DefaultInput, { node, attributes: node.attributes }, 1);
5453
+ } else if (node.attributes.name === "captcha_turnstile_options") {
5423
5454
  const options = JSON.parse(node.attributes.value);
5424
- nodes.push(
5425
- /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
5426
- import_react_turnstile.Turnstile,
5427
- {
5428
- ref,
5429
- siteKey: options.sitekey,
5430
- options: {
5431
- action: options.action,
5432
- size: "flexible",
5433
- theme: options.theme,
5434
- responseField: false,
5435
- responseFieldName: options.response_field_name
5436
- },
5437
- onExpire: () => {
5438
- var _a;
5439
- return (_a = ref.current) == null ? void 0 : _a.reset();
5440
- },
5441
- onSuccess: (token) => {
5442
- setValue(options.response_field_name, token);
5443
- }
5455
+ return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
5456
+ import_react_turnstile.Turnstile,
5457
+ {
5458
+ ref,
5459
+ siteKey: options.sitekey,
5460
+ options: {
5461
+ action: options.action,
5462
+ size: "flexible",
5463
+ theme: options.theme,
5464
+ responseField: false,
5465
+ responseFieldName: options.response_field_name
5444
5466
  },
5445
- 2
5446
- )
5467
+ onExpire: () => {
5468
+ var _a;
5469
+ return (_a = ref.current) == null ? void 0 : _a.reset();
5470
+ },
5471
+ onSuccess: (token) => {
5472
+ setValue(options.response_field_name, token);
5473
+ }
5474
+ }
5447
5475
  );
5448
5476
  }
5449
- return nodes;
5477
+ return null;
5450
5478
  };
5451
5479
 
5452
5480
  // src/theme/default/assets/icons/personal.svg
@@ -5576,7 +5604,7 @@ function getOryComponents(overrides) {
5576
5604
 
5577
5605
  // src/theme/default/flows/error.tsx
5578
5606
  var import_client_fetch40 = require("@ory/client-fetch");
5579
- var import_react16 = require("react");
5607
+ var import_react17 = require("react");
5580
5608
  var import_react_intl24 = require("react-intl");
5581
5609
  var import_jsx_runtime103 = require("react/jsx-runtime");
5582
5610
  function isOAuth2Error(error) {
@@ -5587,7 +5615,7 @@ var errorDescriptions = {
5587
5615
  5: "The server encountered an error and could not complete your request"
5588
5616
  };
5589
5617
  function useStandardize(error) {
5590
- return (0, import_react16.useMemo)(() => {
5618
+ return (0, import_react17.useMemo)(() => {
5591
5619
  var _a;
5592
5620
  if (isOAuth2Error(error)) {
5593
5621
  return {
@@ -5718,10 +5746,22 @@ function GoBackButton({ config }) {
5718
5746
  return null;
5719
5747
  }
5720
5748
  function ErrorLogo({ config }) {
5749
+ var _a;
5750
+ if (config.project.logo_light_url) {
5751
+ return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
5752
+ "img",
5753
+ {
5754
+ src: config.project.logo_light_url,
5755
+ width: 100,
5756
+ height: 36,
5757
+ alt: "Logo"
5758
+ }
5759
+ );
5760
+ }
5721
5761
  if (config.logoUrl) {
5722
5762
  return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("img", { src: config.logoUrl, width: 100, height: 36, alt: "Logo" });
5723
5763
  }
5724
- return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: config.name });
5764
+ return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: (_a = config.project.name) != null ? _a : config.name });
5725
5765
  }
5726
5766
 
5727
5767
  // src/theme/default/flows/login.tsx