@ory/elements-react 1.0.0-next.16 → 1.0.0-next.18

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/api-report/elements-react-client.api.json +144 -16
  3. package/api-report/elements-react-client.api.md +19 -8
  4. package/api-report/elements-react-theme.api.json +197 -0
  5. package/api-report/elements-react-theme.api.md +17 -2
  6. package/api-report/elements-react.api.json +7 -3
  7. package/api-report/elements-react.api.md +4 -2
  8. package/api-report/temp/elements-react-client.api.md +33 -0
  9. package/api-report/temp/elements-react-theme.api.md +149 -0
  10. package/api-report/temp/elements-react.api.md +423 -0
  11. package/dist/client/config.d.mts +21 -0
  12. package/dist/client/config.d.ts +21 -0
  13. package/dist/client/config.js +77 -0
  14. package/dist/client/config.js.map +1 -0
  15. package/dist/client/config.mjs +51 -0
  16. package/dist/client/config.mjs.map +1 -0
  17. package/dist/client/frontendClient.d.mts +3 -1
  18. package/dist/client/frontendClient.d.ts +3 -1
  19. package/dist/client/frontendClient.js +14 -2
  20. package/dist/client/frontendClient.js.map +1 -1
  21. package/dist/client/frontendClient.mjs +14 -2
  22. package/dist/client/frontendClient.mjs.map +1 -1
  23. package/dist/client/index.d.mts +3 -1
  24. package/dist/client/index.d.ts +3 -1
  25. package/dist/client/index.js +4 -0
  26. package/dist/client/index.js.map +1 -1
  27. package/dist/client/index.mjs +5 -0
  28. package/dist/client/index.mjs.map +1 -1
  29. package/dist/client/session-provider.d.mts +62 -0
  30. package/dist/client/session-provider.d.ts +62 -0
  31. package/dist/client/session-provider.js +96 -0
  32. package/dist/client/session-provider.js.map +1 -0
  33. package/dist/client/session-provider.mjs +71 -0
  34. package/dist/client/session-provider.mjs.map +1 -0
  35. package/dist/client/useSession.d.mts +22 -31
  36. package/dist/client/useSession.d.ts +22 -31
  37. package/dist/client/useSession.js +7 -49
  38. package/dist/client/useSession.js.map +1 -1
  39. package/dist/client/useSession.mjs +8 -49
  40. package/dist/client/useSession.mjs.map +1 -1
  41. package/dist/index.d.mts +5 -4
  42. package/dist/index.d.ts +5 -4
  43. package/dist/index.js +148 -62
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +151 -65
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/theme/default/index.css +358 -251
  48. package/dist/theme/default/index.css.map +1 -1
  49. package/dist/theme/default/index.d.mts +14 -3
  50. package/dist/theme/default/index.d.ts +14 -3
  51. package/dist/theme/default/index.js +932 -837
  52. package/dist/theme/default/index.js.map +1 -1
  53. package/dist/theme/default/index.mjs +815 -715
  54. package/dist/theme/default/index.mjs.map +1 -1
  55. package/jest.config.ts +7 -1
  56. package/package.json +2 -1
  57. package/postcss.config.ts +1 -0
  58. package/tailwind.config.ts +14 -13
  59. package/tsconfig.json +4 -3
  60. package/variables-processed.json +385 -187
  61. package/.eslintrc.js +0 -63
@@ -0,0 +1,149 @@
1
+ ## API Report File for "@ory/elements-react"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { ComponentPropsWithoutRef } from 'react';
8
+ import { ComponentType } from 'react';
9
+ import { ConfigurationParameters } from '@ory/client-fetch';
10
+ import { DetailedHTMLProps } from 'react';
11
+ import { ElementType } from 'react';
12
+ import { FlowError } from '@ory/client-fetch';
13
+ import { FormEventHandler } from 'react';
14
+ import { HTMLAttributes } from 'react';
15
+ import { LoginFlow } from '@ory/client-fetch';
16
+ import { MouseEventHandler } from 'react';
17
+ import { PropsWithChildren } from 'react';
18
+ import * as react from 'react';
19
+ import * as react_jsx_runtime from 'react/jsx-runtime';
20
+ import { RecoveryFlow } from '@ory/client-fetch';
21
+ import { RegistrationFlow } from '@ory/client-fetch';
22
+ import { SettingsFlow } from '@ory/client-fetch';
23
+ import { UiNode } from '@ory/client-fetch';
24
+ import { UiNodeAnchorAttributes } from '@ory/client-fetch';
25
+ import { UiNodeImageAttributes } from '@ory/client-fetch';
26
+ import { UiNodeInputAttributes } from '@ory/client-fetch';
27
+ import { UiNodeTextAttributes } from '@ory/client-fetch';
28
+ import { UiText } from '@ory/client-fetch';
29
+ import { VariantProps } from 'class-variance-authority';
30
+ import { VerificationFlow } from '@ory/client-fetch';
31
+
32
+ // Warning: (ae-forgotten-export) The symbol "DefaultSocialButtonProps" needs to be exported by the entry point index.d.ts
33
+ //
34
+ // @public (undocumented)
35
+ export function DefaultButtonSocial({ attributes, node, onClick, showLabel: _showLabel, logos: providedLogos, }: DefaultSocialButtonProps): react_jsx_runtime.JSX.Element;
36
+
37
+ // @public (undocumented)
38
+ export namespace DefaultButtonSocial {
39
+ var // (undocumented)
40
+ WithLogos: (logos: Record<string, ElementType>) => (props: DefaultSocialButtonProps) => react_jsx_runtime.JSX.Element;
41
+ }
42
+
43
+ // Warning: (ae-forgotten-export) The symbol "OryCardRootProps" needs to be exported by the entry point index.d.ts
44
+ //
45
+ // @public (undocumented)
46
+ export function DefaultCard({ children }: OryCardRootProps): react_jsx_runtime.JSX.Element;
47
+
48
+ // Warning: (ae-forgotten-export) The symbol "OryCardContentProps" needs to be exported by the entry point index.d.ts
49
+ //
50
+ // @public (undocumented)
51
+ export function DefaultCardContent({ children }: OryCardContentProps): react.ReactNode;
52
+
53
+ // @public (undocumented)
54
+ export function DefaultCardFooter(): react_jsx_runtime.JSX.Element | null;
55
+
56
+ // @public (undocumented)
57
+ export function DefaultCardHeader(): react_jsx_runtime.JSX.Element;
58
+
59
+ // @public (undocumented)
60
+ export function DefaultCardLayout({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
61
+
62
+ // @public (undocumented)
63
+ export function DefaultCardLogo(): react_jsx_runtime.JSX.Element;
64
+
65
+ // @public (undocumented)
66
+ export function DefaultCurrentIdentifierButton(): react_jsx_runtime.JSX.Element | null;
67
+
68
+ // Warning: (ae-forgotten-export) The symbol "OryFormRootProps" needs to be exported by the entry point index.d.ts
69
+ //
70
+ // @public (undocumented)
71
+ export function DefaultFormContainer({ children, onSubmit, action, method, }: PropsWithChildren<OryFormRootProps>): react_jsx_runtime.JSX.Element;
72
+
73
+ // Warning: (ae-forgotten-export) The symbol "OryMessageContentProps" needs to be exported by the entry point index.d.ts
74
+ //
75
+ // @public (undocumented)
76
+ export function DefaultMessage({ message }: OryMessageContentProps): react_jsx_runtime.JSX.Element;
77
+
78
+ // @public (undocumented)
79
+ export function DefaultMessageContainer({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element | null;
80
+
81
+ // @public (undocumented)
82
+ function Error_2({ error, children, }: PropsWithChildren<ErrorFlowContextProps>): react_jsx_runtime.JSX.Element;
83
+ export { Error_2 as Error }
84
+
85
+ // @public (undocumented)
86
+ export type ErrorFlowContextProps = {
87
+ error: FlowError;
88
+ components?: OryFlowComponentOverrides;
89
+ config: OryClientConfiguration;
90
+ };
91
+
92
+ // Warning: (ae-forgotten-export) The symbol "OryFlowComponents" needs to be exported by the entry point index.d.ts
93
+ //
94
+ // @public (undocumented)
95
+ export function getOryComponents(overrides?: OryFlowComponentOverrides): OryFlowComponents;
96
+
97
+ // @public (undocumented)
98
+ export function Login({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren<LoginFlowContextProps>): react_jsx_runtime.JSX.Element;
99
+
100
+ // @public (undocumented)
101
+ export type LoginFlowContextProps = {
102
+ flow: LoginFlow;
103
+ components?: OryFlowComponentOverrides;
104
+ config: OryClientConfiguration;
105
+ };
106
+
107
+ // @public (undocumented)
108
+ export function Recovery({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren<RecoveryFlowContextProps>): react_jsx_runtime.JSX.Element;
109
+
110
+ // @public (undocumented)
111
+ export type RecoveryFlowContextProps = {
112
+ flow: RecoveryFlow;
113
+ components?: OryFlowComponentOverrides;
114
+ config: OryClientConfiguration;
115
+ };
116
+
117
+ // Warning: (ae-forgotten-export) The symbol "RegistrationFlowContextProps" needs to be exported by the entry point index.d.ts
118
+ //
119
+ // @public (undocumented)
120
+ export function Registration({ flow, children, components: flowOverrideComponents, config, }: PropsWithChildren<RegistrationFlowContextProps>): react_jsx_runtime.JSX.Element;
121
+
122
+ // @public (undocumented)
123
+ export function Settings({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren<SettingsFlowContextProps>): react_jsx_runtime.JSX.Element;
124
+
125
+ // @public (undocumented)
126
+ export type SettingsFlowContextProps = {
127
+ flow: SettingsFlow;
128
+ components?: OryFlowComponentOverrides;
129
+ config: OryClientConfiguration;
130
+ };
131
+
132
+ // @public (undocumented)
133
+ export function Verification({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren<VerificationFlowContextProps>): react_jsx_runtime.JSX.Element;
134
+
135
+ // @public (undocumented)
136
+ export type VerificationFlowContextProps = {
137
+ flow: VerificationFlow;
138
+ components?: OryFlowComponentOverrides;
139
+ config: OryClientConfiguration;
140
+ };
141
+
142
+ // Warnings were encountered during analysis:
143
+ //
144
+ // dist/theme/default/index.d.ts:38:5 - (ae-forgotten-export) The symbol "OryFlowComponentOverrides" needs to be exported by the entry point index.d.ts
145
+ // dist/theme/default/index.d.ts:39:5 - (ae-forgotten-export) The symbol "OryClientConfiguration" needs to be exported by the entry point index.d.ts
146
+
147
+ // (No @packageDocumentation comment for this package)
148
+
149
+ ```
@@ -0,0 +1,423 @@
1
+ ## API Report File for "@ory/elements-react"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import * as class_variance_authority_types from 'class-variance-authority/types';
8
+ import { ComponentPropsWithoutRef } from 'react';
9
+ import { ComponentType } from 'react';
10
+ import { ConfigurationParameters } from '@ory/client-fetch';
11
+ import { DetailedHTMLProps } from 'react';
12
+ import { Dispatch } from 'react';
13
+ import { FlowError } from '@ory/client-fetch';
14
+ import { FlowType } from '@ory/client-fetch';
15
+ import { FormEventHandler } from 'react';
16
+ import { HTMLAttributes } from 'react';
17
+ import { IntlShape } from 'react-intl';
18
+ import { LoginFlow } from '@ory/client-fetch';
19
+ import { MouseEventHandler } from 'react';
20
+ import { OnRedirectHandler } from '@ory/client-fetch';
21
+ import { PropsWithChildren } from 'react';
22
+ import * as react_jsx_runtime from 'react/jsx-runtime';
23
+ import { RecoveryFlow } from '@ory/client-fetch';
24
+ import { RegistrationFlow } from '@ory/client-fetch';
25
+ import { SettingsFlow } from '@ory/client-fetch';
26
+ import { UiNode } from '@ory/client-fetch';
27
+ import { UiNodeAnchorAttributes } from '@ory/client-fetch';
28
+ import { UiNodeGroupEnum } from '@ory/client-fetch';
29
+ import { UiNodeImageAttributes } from '@ory/client-fetch';
30
+ import { UiNodeInputAttributes } from '@ory/client-fetch';
31
+ import { UiNodeTextAttributes } from '@ory/client-fetch';
32
+ import { UiText } from '@ory/client-fetch';
33
+ import { UpdateLoginFlowBody } from '@ory/client-fetch';
34
+ import { UpdateRecoveryFlowBody } from '@ory/client-fetch';
35
+ import { UpdateRegistrationFlowBody } from '@ory/client-fetch';
36
+ import { UpdateSettingsFlowBody } from '@ory/client-fetch';
37
+ import { UpdateVerificationFlowBody } from '@ory/client-fetch';
38
+ import { VariantProps } from 'class-variance-authority';
39
+ import { VerificationFlow } from '@ory/client-fetch';
40
+
41
+ // Warning: (ae-forgotten-export) The symbol "OryFlow" needs to be exported by the entry point index.d.ts
42
+ //
43
+ // @public
44
+ export type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
45
+
46
+ // @public
47
+ export type FlowContainerSetter = Dispatch<OryFlowContainer>;
48
+
49
+ // @public
50
+ export type FlowContextValue = OryFlowContainer & {
51
+ setFlowContainer: FlowContainerSetter;
52
+ formState: FormState;
53
+ dispatchFormState: Dispatch<FormStateAction>;
54
+ };
55
+
56
+ // @public (undocumented)
57
+ export type FormState = {
58
+ current: "provide_identifier";
59
+ } | {
60
+ current: "select_method";
61
+ } | {
62
+ current: "method_active";
63
+ method: UiNodeGroupEnum;
64
+ } | {
65
+ current: "success_screen";
66
+ } | {
67
+ current: "settings";
68
+ };
69
+
70
+ // @public (undocumented)
71
+ export type FormStateAction = {
72
+ type: "action_flow_update";
73
+ flow: OryFlowContainer;
74
+ } | {
75
+ type: "action_select_method";
76
+ method: UiNodeGroupEnum;
77
+ };
78
+
79
+ // @public
80
+ export type FormValues = Record<string, string | boolean | number | undefined>;
81
+
82
+ // @public (undocumented)
83
+ export const HeadlessPageHeader: () => react_jsx_runtime.JSX.Element;
84
+
85
+ // Warning: (ae-forgotten-export) The symbol "IntlContextProps" needs to be exported by the entry point index.d.ts
86
+ //
87
+ // @public (undocumented)
88
+ export type IntlConfig = IntlContextProps;
89
+
90
+ // @public
91
+ export type LoginFlowContainer = OryFlow<FlowType.Login, LoginFlow>;
92
+
93
+ // @public
94
+ export function messageTestId(message: UiText): {
95
+ "data-testid": string;
96
+ };
97
+
98
+ // @public
99
+ export type OnSubmitHandlerProps<T extends UpdateLoginFlowBody | UpdateRegistrationFlowBody | UpdateVerificationFlowBody | UpdateRecoveryFlowBody | UpdateSettingsFlowBody> = {
100
+ setFlowContainer: (flowContainer: OryFlowContainer) => void;
101
+ body: T;
102
+ onRedirect: OnRedirectHandler;
103
+ };
104
+
105
+ // @public
106
+ export function OryCard({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
107
+
108
+ // @public
109
+ export type OryCardAuthMethodListItemProps = {
110
+ onClick: () => void;
111
+ group: string;
112
+ };
113
+
114
+ // @public
115
+ export function OryCardContent({ children }: OryCardContentProps): react_jsx_runtime.JSX.Element;
116
+
117
+ // @public
118
+ export type OryCardContentProps = PropsWithChildren;
119
+
120
+ // @public
121
+ export type OryCardDividerProps = Record<string, never>;
122
+
123
+ // @public (undocumented)
124
+ export function OryCardFooter(): react_jsx_runtime.JSX.Element;
125
+
126
+ // @public (undocumented)
127
+ export type OryCardFooterProps = Record<string, never>;
128
+
129
+ // @public (undocumented)
130
+ export function OryCardHeader(): react_jsx_runtime.JSX.Element;
131
+
132
+ // @public (undocumented)
133
+ export type OryCardHeaderProps = Record<string, never>;
134
+
135
+ // @public (undocumented)
136
+ export type OryCardLogoProps = Record<string, never>;
137
+
138
+ // @public (undocumented)
139
+ export type OryCardProps = PropsWithChildren;
140
+
141
+ // @public (undocumented)
142
+ export function OryCardValidationMessages({ ...props }: OryMessageRootProps): react_jsx_runtime.JSX.Element | null;
143
+
144
+ // @public (undocumented)
145
+ export type OryClientConfiguration = {
146
+ name: string;
147
+ logoUrl?: string;
148
+ stylesheet?: string;
149
+ favicon?: string;
150
+ sdk: {
151
+ url: string;
152
+ options?: Partial<ConfigurationParameters>;
153
+ };
154
+ project: {
155
+ registration_enabled: boolean;
156
+ verification_enabled: boolean;
157
+ recovery_enabled: boolean;
158
+ recovery_ui_url: string;
159
+ registration_ui_url: string;
160
+ verification_ui_url: string;
161
+ login_ui_url: string;
162
+ };
163
+ intl?: IntlConfig;
164
+ };
165
+
166
+ // Warning: (ae-forgotten-export) The symbol "DeepPartialTwoLevels" needs to be exported by the entry point index.d.ts
167
+ //
168
+ // @public (undocumented)
169
+ export type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
170
+
171
+ // @public
172
+ export type OryFlowComponents = {
173
+ Node: {
174
+ Button: ComponentType<OryNodeButtonProps>;
175
+ OidcButton: ComponentType<OryNodeOidcButtonProps>;
176
+ Anchor: ComponentType<OryNodeAnchorProps>;
177
+ Input: ComponentType<OryNodeInputProps>;
178
+ CodeInput: ComponentType<OryNodeInputProps>;
179
+ Image: ComponentType<OryNodeImageProps>;
180
+ Label: ComponentType<OryNodeLabelProps>;
181
+ Checkbox: ComponentType<OryNodeInputProps>;
182
+ Text: ComponentType<OryNodeTextProps>;
183
+ };
184
+ Card: {
185
+ Root: ComponentType<OryCardProps>;
186
+ Footer: ComponentType<OryCardFooterProps>;
187
+ Header: ComponentType<OryCardProps>;
188
+ Content: ComponentType<OryCardContentProps>;
189
+ Logo: ComponentType<OryCardLogoProps>;
190
+ Divider: ComponentType<OryCardDividerProps>;
191
+ AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>;
192
+ SettingsSection: ComponentType<OryFormSectionProps>;
193
+ SettingsSectionContent: ComponentType<OryFormSectionContentProps>;
194
+ SettingsSectionFooter: ComponentType<OryFormSectionFooterProps>;
195
+ };
196
+ Form: {
197
+ Root: ComponentType<OryFormRootProps>;
198
+ OidcRoot: ComponentType<OryFormOidcRootProps>;
199
+ Group: ComponentType<OryFormGroupProps>;
200
+ OidcSettings: ComponentType<OrySettingsOidcProps>;
201
+ WebauthnSettings: ComponentType<OrySettingsWebauthnProps>;
202
+ PasskeySettings: ComponentType<OrySettingsPasskeyProps>;
203
+ TotpSettings: ComponentType<OrySettingsTotpProps>;
204
+ RecoveryCodesSettings: ComponentType<OrySettingsRecoveryCodesProps>;
205
+ };
206
+ Message: {
207
+ Root: ComponentType<OryMessageRootProps>;
208
+ Content: ComponentType<OryMessageContentProps>;
209
+ };
210
+ Page: {
211
+ Header: ComponentType<OryPageHeaderProps>;
212
+ };
213
+ };
214
+
215
+ // @public
216
+ export type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
217
+
218
+ // @public (undocumented)
219
+ export function OryForm({ children, onAfterSubmit }: OryFormProps): string | react_jsx_runtime.JSX.Element;
220
+
221
+ // @public
222
+ export function OryFormGroupDivider(): react_jsx_runtime.JSX.Element | null;
223
+
224
+ // @public (undocumented)
225
+ export type OryFormGroupProps = PropsWithChildren;
226
+
227
+ // @public (undocumented)
228
+ export function OryFormGroups({ children, groups }: OryFormGroupsProps): react_jsx_runtime.JSX.Element;
229
+
230
+ // @public (undocumented)
231
+ export type OryFormGroupsProps = PropsWithChildren<{
232
+ groups: UiNodeGroupEnum[];
233
+ }>;
234
+
235
+ // @public (undocumented)
236
+ export function OryFormOidcButtons({ children, hideDivider, }: OryFormOidcButtonsProps): react_jsx_runtime.JSX.Element | null;
237
+
238
+ // @public (undocumented)
239
+ export type OryFormOidcButtonsProps = PropsWithChildren<{
240
+ hideDivider?: boolean;
241
+ }>;
242
+
243
+ // @public (undocumented)
244
+ export type OryFormOidcRootProps = PropsWithChildren<{
245
+ nodes: UiNode[];
246
+ }>;
247
+
248
+ // @public (undocumented)
249
+ export type OryFormProps = PropsWithChildren<{
250
+ onAfterSubmit?: (method: string | number | boolean | undefined) => void;
251
+ }>;
252
+
253
+ // @public (undocumented)
254
+ export type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
255
+ onSubmit: FormEventHandler<HTMLFormElement>;
256
+ };
257
+
258
+ // @public (undocumented)
259
+ export function OryFormSection({ children, nodes }: OryFormSectionProps): react_jsx_runtime.JSX.Element;
260
+
261
+ // @public (undocumented)
262
+ export type OryFormSectionContentProps = PropsWithChildren<{
263
+ title?: string;
264
+ description?: string;
265
+ }>;
266
+
267
+ // @public (undocumented)
268
+ export type OryFormSectionFooterProps = PropsWithChildren<{
269
+ text?: string;
270
+ }>;
271
+
272
+ // @public (undocumented)
273
+ export type OryFormSectionProps = PropsWithChildren<{
274
+ nodes?: UiNode[];
275
+ }>;
276
+
277
+ // @public (undocumented)
278
+ export function OryFormSocialButtonsForm(): react_jsx_runtime.JSX.Element | null;
279
+
280
+ // Warning: (ae-forgotten-export) The symbol "LocaleMap" needs to be exported by the entry point index.d.ts
281
+ //
282
+ // @public (undocumented)
283
+ export const OryLocales: LocaleMap;
284
+
285
+ // @public (undocumented)
286
+ export type OryMessageContentProps = {
287
+ message: UiText;
288
+ };
289
+
290
+ // @public (undocumented)
291
+ export type OryMessageRootProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
292
+
293
+ // @public (undocumented)
294
+ export type OryNodeAnchorProps = {
295
+ attributes: UiNodeAnchorAttributes;
296
+ node: UiNode;
297
+ } & Omit<ComponentPropsWithoutRef<"a">, "children">;
298
+
299
+ // Warning: (ae-forgotten-export) The symbol "ButtonVariants" needs to be exported by the entry point index.d.ts
300
+ //
301
+ // @public (undocumented)
302
+ export type OryNodeButtonProps = {
303
+ attributes: UiNodeInputAttributes;
304
+ node: UiNode;
305
+ } & Omit<ComponentPropsWithoutRef<"button">, "children"> & ButtonVariants;
306
+
307
+ // @public (undocumented)
308
+ export type OryNodeImageProps = {
309
+ attributes: UiNodeImageAttributes;
310
+ node: UiNode;
311
+ };
312
+
313
+ // @public (undocumented)
314
+ export type OryNodeInputProps = {
315
+ attributes: UiNodeInputAttributes;
316
+ node: UiNode;
317
+ onClick?: MouseEventHandler;
318
+ };
319
+
320
+ // @public (undocumented)
321
+ export type OryNodeLabelProps = {
322
+ attributes: UiNodeInputAttributes;
323
+ node: UiNode;
324
+ } & ComponentPropsWithoutRef<"label">;
325
+
326
+ // @public (undocumented)
327
+ export type OryNodeOidcButtonProps = {
328
+ node: UiNode;
329
+ attributes: UiNodeInputAttributes;
330
+ onClick?: () => void;
331
+ };
332
+
333
+ // @public (undocumented)
334
+ export type OryNodeTextProps = {
335
+ attributes: UiNodeTextAttributes;
336
+ node: UiNode;
337
+ };
338
+
339
+ // @public (undocumented)
340
+ export type OryPageHeaderProps = Record<never, never>;
341
+
342
+ // @public (undocumented)
343
+ export function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
344
+
345
+ // @public (undocumented)
346
+ export type OryProviderProps = {
347
+ components: OryFlowComponents;
348
+ } & OryFlowContainer & PropsWithChildren;
349
+
350
+ // @public (undocumented)
351
+ export function OrySettingsCard(): react_jsx_runtime.JSX.Element;
352
+
353
+ // @public (undocumented)
354
+ export type OrySettingsOidcProps = {
355
+ linkButtons: UiNode[];
356
+ unlinkButtons: UiNode[];
357
+ };
358
+
359
+ // @public (undocumented)
360
+ export type OrySettingsPasskeyProps = {
361
+ triggerButton: UiNode & {
362
+ onClick: () => void;
363
+ };
364
+ removeButtons: UiNode[];
365
+ };
366
+
367
+ // @public (undocumented)
368
+ export type OrySettingsRecoveryCodesProps = {
369
+ codes: string[];
370
+ regnerateButton?: UiNode;
371
+ revealButton?: UiNode;
372
+ };
373
+
374
+ // @public (undocumented)
375
+ export type OrySettingsTotpProps = {
376
+ totpImage: UiNode;
377
+ totpSecret: UiNode;
378
+ totpInput: UiNode;
379
+ } | {
380
+ totpUnlink: UiNode;
381
+ };
382
+
383
+ // @public (undocumented)
384
+ export type OrySettingsWebauthnProps = {
385
+ nameInput: UiNode;
386
+ triggerButton: UiNode & {
387
+ onClick: () => void;
388
+ };
389
+ removeButtons: UiNode[];
390
+ };
391
+
392
+ // @public (undocumented)
393
+ export function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
394
+
395
+ // @public
396
+ export type RecoveryFlowContainer = OryFlow<FlowType.Recovery, RecoveryFlow>;
397
+
398
+ // @public
399
+ export type RegistrationFlowContainer = OryFlow<FlowType.Registration, RegistrationFlow>;
400
+
401
+ // @public
402
+ export type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
403
+
404
+ // @public
405
+ export const uiTextToFormattedMessage: ({ id, context, text }: Omit<UiText, "type">, intl: IntlShape) => string;
406
+
407
+ // @public (undocumented)
408
+ export function useComponents(): OryFlowComponents;
409
+
410
+ // @public (undocumented)
411
+ export function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
412
+ flowType: string;
413
+ }) => number;
414
+
415
+ // @public
416
+ export function useOryFlow(): FlowContextValue;
417
+
418
+ // @public
419
+ export type VerificationFlowContainer = OryFlow<FlowType.Verification, VerificationFlow>;
420
+
421
+ // (No @packageDocumentation comment for this package)
422
+
423
+ ```
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This function returns the base URL of the Ory SDK as set by environment variables `NEXT_PUBLIC_ORY_SDK_URL` or `ORY_SDK_URL`.
3
+ */
4
+ declare function orySdkUrl(): string;
5
+ /**
6
+ * This function returns whether the current environment is a production environment.
7
+ */
8
+ declare function isProduction(): boolean;
9
+ /**
10
+ * This function returns the Ory SDK URL. If the environment is not production, it tries to guess the SDK URL based on the environment variables, assuming
11
+ * that Ory APIs are proxied through the same domain as the application.
12
+ *
13
+ * Currently, this is only tested for Vercel deployments.
14
+ *
15
+ * @param options - Options for guessing the SDK URL.
16
+ */
17
+ declare function guessPotentiallyProxiedOrySdkUrl(options?: {
18
+ knownProxiedUrl?: string;
19
+ }): string;
20
+
21
+ export { guessPotentiallyProxiedOrySdkUrl, isProduction, orySdkUrl };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This function returns the base URL of the Ory SDK as set by environment variables `NEXT_PUBLIC_ORY_SDK_URL` or `ORY_SDK_URL`.
3
+ */
4
+ declare function orySdkUrl(): string;
5
+ /**
6
+ * This function returns whether the current environment is a production environment.
7
+ */
8
+ declare function isProduction(): boolean;
9
+ /**
10
+ * This function returns the Ory SDK URL. If the environment is not production, it tries to guess the SDK URL based on the environment variables, assuming
11
+ * that Ory APIs are proxied through the same domain as the application.
12
+ *
13
+ * Currently, this is only tested for Vercel deployments.
14
+ *
15
+ * @param options - Options for guessing the SDK URL.
16
+ */
17
+ declare function guessPotentiallyProxiedOrySdkUrl(options?: {
18
+ knownProxiedUrl?: string;
19
+ }): string;
20
+
21
+ export { guessPotentiallyProxiedOrySdkUrl, isProduction, orySdkUrl };
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var config_exports = {};
20
+ __export(config_exports, {
21
+ guessPotentiallyProxiedOrySdkUrl: () => guessPotentiallyProxiedOrySdkUrl,
22
+ isProduction: () => isProduction,
23
+ orySdkUrl: () => orySdkUrl
24
+ });
25
+ module.exports = __toCommonJS(config_exports);
26
+ function orySdkUrl() {
27
+ let baseUrl;
28
+ if (process.env.NEXT_PUBLIC_ORY_SDK_URL) {
29
+ baseUrl = process.env.NEXT_PUBLIC_ORY_SDK_URL;
30
+ }
31
+ if (process.env.ORY_SDK_URL) {
32
+ baseUrl = process.env._ORY_SDK_URL;
33
+ }
34
+ if (!baseUrl) {
35
+ throw new Error(
36
+ "You need to set environment variable `NEXT_PUBLIC_ORY_SDK_URL` or if you don't use Next.js `ORY_SDK_URL` to your Ory Network SDK URL."
37
+ );
38
+ }
39
+ return baseUrl.replace(/\/$/, "");
40
+ }
41
+ function isProduction() {
42
+ var _a, _b;
43
+ return ["production", "prod"].indexOf(
44
+ (_b = (_a = process.env.VERCEL_ENV) != null ? _a : process.env.NODE_ENV) != null ? _b : ""
45
+ ) > -1;
46
+ }
47
+ function guessPotentiallyProxiedOrySdkUrl(options) {
48
+ if (isProduction()) {
49
+ return orySdkUrl();
50
+ }
51
+ if (process.env.VERCEL_ENV) {
52
+ if (!isProduction() && process.env.VERCEL_URL) {
53
+ return `https://${process.env.VERCEL_URL}`.replace(/\/$/, "");
54
+ }
55
+ if (process.env.__NEXT_PRIVATE_ORIGIN) {
56
+ return process.env.__NEXT_PRIVATE_ORIGIN.replace(/\/$/, "");
57
+ }
58
+ }
59
+ if (typeof window !== "undefined") {
60
+ return window.location.origin;
61
+ }
62
+ if (options == null ? void 0 : options.knownProxiedUrl) {
63
+ return options.knownProxiedUrl;
64
+ }
65
+ const final = orySdkUrl();
66
+ console.warn(
67
+ `Unable to determine a suitable SDK URL for setting up the Next.js integration of Ory Elements. Will proceed using default Ory SDK URL "${final}". This is likely not what you want for local development and your authentication and login may not work.`
68
+ );
69
+ return final;
70
+ }
71
+ // Annotate the CommonJS export names for ESM import in node:
72
+ 0 && (module.exports = {
73
+ guessPotentiallyProxiedOrySdkUrl,
74
+ isProduction,
75
+ orySdkUrl
76
+ });
77
+ //# sourceMappingURL=config.js.map