Skip to content

Commit df9d0e1

Browse files
jonas-jonasory-bot
authored andcommitted
fix(elements)!: fully document and streamline component naming
GitOrigin-RevId: 3cfd54446934c3070bae704ccc5c5c4560b83017
1 parent e5dd4c4 commit df9d0e1

File tree

103 files changed

+3455
-1556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3455
-1556
lines changed

eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ const config = tseslint.config([
8080
},
8181

8282
rules: {
83-
"tsdoc/syntax": "warn",
83+
// TODO: https://github.com/microsoft/tsdoc/issues/374 (and specifically https://github.com/microsoft/tsdoc/issues/374#issuecomment-2336536959)
84+
"tsdoc/syntax": "off",
8485
"formatjs/no-offset": "error",
8586
"@typescript-eslint/no-floating-promises": "error",
8687
// The legacy elements is written with lots of any types
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
// Copyright © 2024 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { DefaultCardLayout } from "@ory/elements-react/theme"
54
import "@ory/elements-react/theme/styles.css"
5+
import { PropsWithChildren } from "react"
66

7-
export default DefaultCardLayout
7+
export default function DefaultCardLayout({ children }: PropsWithChildren) {
8+
return (
9+
<main className="p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen">
10+
{children}
11+
</main>
12+
)
13+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright © 2024 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33
"use client"
4-
import { DefaultCardLayout, Login } from "@ory/elements-react/theme"
5-
import { useLoginFlow } from "@ory/nextjs/pages"
4+
import { Login } from "@ory/elements-react/theme"
65
import "@ory/elements-react/theme/styles.css"
6+
import { useLoginFlow } from "@ory/nextjs/pages"
77

88
import config from "@/ory.config"
99

@@ -15,14 +15,14 @@ export default function LoginPage() {
1515
}
1616

1717
return (
18-
<DefaultCardLayout>
18+
<main className="p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen">
1919
<Login
2020
flow={flow}
2121
config={config}
2222
components={{
2323
Card: {},
2424
}}
2525
/>
26-
</DefaultCardLayout>
26+
</main>
2727
)
2828
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright © 2024 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33
"use client"
4-
import { DefaultCardLayout, Recovery } from "@ory/elements-react/theme"
5-
import { useRecoveryFlow } from "@ory/nextjs/pages"
4+
import { Recovery } from "@ory/elements-react/theme"
65
import "@ory/elements-react/theme/styles.css"
6+
import { useRecoveryFlow } from "@ory/nextjs/pages"
77

88
import config from "@/ory.config"
99

@@ -15,14 +15,14 @@ export default function RecoveryPage() {
1515
}
1616

1717
return (
18-
<DefaultCardLayout>
18+
<main className="p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen">
1919
<Recovery
2020
flow={flow}
2121
config={config}
2222
components={{
2323
Card: {},
2424
}}
2525
/>
26-
</DefaultCardLayout>
26+
</main>
2727
)
2828
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright © 2024 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33
"use client"
4-
import { DefaultCardLayout, Registration } from "@ory/elements-react/theme"
5-
import { useRegistrationFlow } from "@ory/nextjs/pages"
4+
import { Registration } from "@ory/elements-react/theme"
65
import "@ory/elements-react/theme/styles.css"
6+
import { useRegistrationFlow } from "@ory/nextjs/pages"
77

88
import config from "@/ory.config"
99

@@ -15,14 +15,14 @@ export default function RegistrationPage() {
1515
}
1616

1717
return (
18-
<DefaultCardLayout>
18+
<main className="p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen">
1919
<Registration
2020
flow={flow}
2121
config={config}
2222
components={{
2323
Card: {},
2424
}}
2525
/>
26-
</DefaultCardLayout>
26+
</main>
2727
)
2828
}

examples/nextjs-pages-router/pages/auth/verification.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright © 2024 Ory Corp
22
// SPDX-License-Identifier: Apache-2.0
33
"use client"
4-
import { DefaultCardLayout, Verification } from "@ory/elements-react/theme"
4+
import { Verification } from "@ory/elements-react/theme"
55
import "@ory/elements-react/theme/styles.css"
66
import { useVerificationFlow } from "@ory/nextjs/pages"
77

@@ -15,14 +15,14 @@ export default function VerificationPage() {
1515
}
1616

1717
return (
18-
<DefaultCardLayout>
18+
<main className="p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen">
1919
<Verification
2020
flow={flow}
2121
config={config}
2222
components={{
2323
Card: {},
2424
}}
2525
/>
26-
</DefaultCardLayout>
26+
</main>
2727
)
2828
}

0 commit comments

Comments
 (0)