Skip to content

Commit 741b30a

Browse files
committed
chore: run format
1 parent 37b8330 commit 741b30a

File tree

20 files changed

+134
-76
lines changed

20 files changed

+134
-76
lines changed

examples/nuxt-app/README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Ory Nuxt Example
22

3-
This example demonstrates how to integrate Ory authentication flows with a Nuxt 4 application using `@ory/nuxt` and `@ory/elements-vue`.
3+
This example demonstrates how to integrate Ory authentication flows with a Nuxt
4+
4 application using `@ory/nuxt` and `@ory/elements-vue`.
45

56
## Project Structure
67

@@ -109,13 +110,15 @@ body {
109110
}
110111
```
111112

112-
The `@import` imports the default Ory theme styles, while `@source` tells Tailwind to scan the Ory elements package for class names used in components.
113+
The `@import` imports the default Ory theme styles, while `@source` tells
114+
Tailwind to scan the Ory elements package for class names used in components.
113115

114116
## Using Ory Components
115117

116118
### Auth Pages
117119

118-
Import the flow component and use the corresponding composable (e.g., `pages/login.vue`):
120+
Import the flow component and use the corresponding composable (e.g.,
121+
`pages/login.vue`):
119122

120123
```vue
121124
<script setup lang="ts">
@@ -135,6 +138,7 @@ const flow = await useOryLoginFlow()
135138
```
136139

137140
Available components:
141+
138142
- `Login` - Login flow with `useOryLoginFlow()`
139143
- `Registration` - Registration flow with `useOryRegistrationFlow()`
140144
- `Recovery` - Account recovery with `useOryRecoveryFlow()`
@@ -151,9 +155,7 @@ const { data: session } = await useAsyncOrySession()
151155
</script>
152156
153157
<template>
154-
<div v-if="session">
155-
Welcome back! Session ID: {{ session.id }}
156-
</div>
158+
<div v-if="session">Welcome back! Session ID: {{ session.id }}</div>
157159
<div v-else>
158160
<NuxtLink to="/login">Login</NuxtLink>
159161
</div>
@@ -176,15 +178,15 @@ This redirects unauthenticated users to the login page.
176178

177179
## Available Composables
178180

179-
| Composable | Description |
180-
|------------|-------------|
181-
| `useOryConfig()` | Access Ory project configuration |
182-
| `useOryLoginFlow()` | Initialize or retrieve login flow |
181+
| Composable | Description |
182+
| -------------------------- | ---------------------------------------- |
183+
| `useOryConfig()` | Access Ory project configuration |
184+
| `useOryLoginFlow()` | Initialize or retrieve login flow |
183185
| `useOryRegistrationFlow()` | Initialize or retrieve registration flow |
184-
| `useOryRecoveryFlow()` | Initialize or retrieve recovery flow |
186+
| `useOryRecoveryFlow()` | Initialize or retrieve recovery flow |
185187
| `useOryVerificationFlow()` | Initialize or retrieve verification flow |
186-
| `useOrySettingsFlow()` | Initialize or retrieve settings flow |
187-
| `useAsyncOrySession()` | Get current session (async) |
188+
| `useOrySettingsFlow()` | Initialize or retrieve settings flow |
189+
| `useAsyncOrySession()` | Get current session (async) |
188190

189191
## Running the Example
190192

@@ -204,11 +206,14 @@ npm run dev --workspace=nuxt-app
204206

205207
The app will be available at http://localhost:3000.
206208

207-
> **Note:** The `prepare:types` script runs `nuxt prepare` to generate TypeScript declarations for better IDE support. This is optional as `nuxt dev` and `nuxt build` run it automatically.
209+
> **Note:** The `prepare:types` script runs `nuxt prepare` to generate
210+
> TypeScript declarations for better IDE support. This is optional as `nuxt dev`
211+
> and `nuxt build` run it automatically.
208212
209213
## Internationalization (i18n)
210214

211-
The example uses English (`en`) locale by default. To change the locale, update `nuxt.config.ts`:
215+
The example uses English (`en`) locale by default. To change the locale, update
216+
`nuxt.config.ts`:
212217

213218
```typescript
214219
ory: {

nx.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
"default": {
55
"runner": "nx/tasks-runners/default",
66
"options": {
7-
"cacheableOperations": ["build", "dev", "preview", "build-storybook", "test", "lint", "typecheck"]
7+
"cacheableOperations": [
8+
"build",
9+
"dev",
10+
"preview",
11+
"build-storybook",
12+
"test",
13+
"lint",
14+
"typecheck"
15+
]
816
}
917
}
1018
},

packages/elements-vue/.storybook/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ const config: StorybookConfig = {
3535
...(Array.isArray(config.resolve.alias) ? config.resolve.alias : []),
3636
{
3737
find: "$snapshots",
38-
replacement: path.resolve(__dirname, "../../elements-react/.stub-responses"),
38+
replacement: path.resolve(
39+
__dirname,
40+
"../../elements-react/.stub-responses",
41+
),
3942
},
4043
{
4144
find: "@ory/elements-vue",

packages/elements-vue/project.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
"executor": "@nx/eslint:lint",
4242
"outputs": ["{options.outputFile}"],
4343
"options": {
44-
"lintFilePatterns": ["packages/elements-vue/**/*.ts", "packages/elements-vue/**/*.vue"]
44+
"lintFilePatterns": [
45+
"packages/elements-vue/**/*.ts",
46+
"packages/elements-vue/**/*.vue"
47+
]
4548
}
4649
},
4750
"typecheck": {

packages/elements-vue/src/components/form/OryForm.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ watch(
8383
<template>
8484
<template v-if="!hasMethods">
8585
<component :is="components.Message.Root">
86-
<component
87-
:is="components.Message.Content"
88-
:message="noMethodsMessage"
89-
/>
86+
<component :is="components.Message.Content" :message="noMethodsMessage" />
9087
</component>
9188
</template>
9289
<component

packages/elements-vue/src/components/form/OryMessages.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ const props = withDefaults(
2626
2727
const components = useComponents()
2828
29-
const filteredMessages = computed(() =>
30-
props.messages?.filter((m) => !props.hiddenMessageIds.includes(m.id)) ?? [],
29+
const filteredMessages = computed(
30+
() =>
31+
props.messages?.filter((m) => !props.hiddenMessageIds.includes(m.id)) ?? [],
3132
)
3233
</script>
3334

3435
<template>
35-
<component
36-
:is="components.Message.Root"
37-
v-if="filteredMessages.length > 0"
38-
>
36+
<component :is="components.Message.Root" v-if="filteredMessages.length > 0">
3937
<component
4038
:is="components.Message.Content"
4139
v-for="message in filteredMessages"

packages/elements-vue/src/composables/useSlotContent.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import { computed, Comment, Text, type Slots } from "vue"
99
export function useHasSlotContent(slots: Slots) {
1010
return computed(() => {
1111
const slotContent = slots.default?.()
12-
if (!slotContent || !Array.isArray(slotContent) || slotContent.length === 0) {
12+
if (
13+
!slotContent ||
14+
!Array.isArray(slotContent) ||
15+
slotContent.length === 0
16+
) {
1317
return false
1418
}
1519
return slotContent.some((vnode) => {

packages/elements-vue/src/theme/default/components/card/DefaultCardFooter.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ const footerContent = computed(() => {
200200
const hasRealSlotContent = useHasSlotContent(slots)
201201
202202
const hasFooterContent = computed(
203-
() => showLogoutButton.value || showChooseMethod.value || showGoBackLink.value || footerContent.value,
203+
() =>
204+
showLogoutButton.value ||
205+
showChooseMethod.value ||
206+
showGoBackLink.value ||
207+
footerContent.value,
204208
)
205209
206210
const logoutHref = computed(() => logoutUrl.value || fallbackUrl.value)

packages/elements-vue/src/theme/default/components/card/DefaultCardHeader.vue

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,57 @@ const headerText = computed(() => {
2525
const ui = flow.ui
2626
2727
if (flowType.value === FlowType.Login) {
28-
return useCardHeaderText(ui, {
29-
flowType: FlowType.Login as const,
30-
flow: {
31-
refresh: "refresh" in flow ? flow.refresh : false,
32-
requested_aal: "requested_aal" in flow ? flow.requested_aal : undefined,
28+
return useCardHeaderText(
29+
ui,
30+
{
31+
flowType: FlowType.Login as const,
32+
flow: {
33+
refresh: "refresh" in flow ? flow.refresh : false,
34+
requested_aal:
35+
"requested_aal" in flow ? flow.requested_aal : undefined,
36+
},
37+
formState: formState.value,
3338
},
34-
formState: formState.value,
35-
}, t)
39+
t,
40+
)
3641
}
3742
3843
if (flowType.value === FlowType.Registration) {
39-
return useCardHeaderText(ui, {
40-
flowType: FlowType.Registration as const,
41-
formState: formState.value,
42-
}, t)
44+
return useCardHeaderText(
45+
ui,
46+
{
47+
flowType: FlowType.Registration as const,
48+
formState: formState.value,
49+
},
50+
t,
51+
)
4352
}
4453
4554
if (flowType.value === FlowType.OAuth2Consent && isConsentFlow(flow)) {
46-
return useCardHeaderText(ui, {
47-
flowType: FlowType.OAuth2Consent as const,
48-
flow: {
49-
consent_request: flow.consent_request,
50-
session: flow.session,
55+
return useCardHeaderText(
56+
ui,
57+
{
58+
flowType: FlowType.OAuth2Consent as const,
59+
flow: {
60+
consent_request: flow.consent_request,
61+
session: flow.session,
62+
},
5163
},
52-
}, t)
64+
t,
65+
)
5366
}
5467
55-
return useCardHeaderText(ui, {
56-
flowType: flowType.value as
57-
| FlowType.Recovery
58-
| FlowType.Verification
59-
| FlowType.Settings
60-
| FlowType.Error,
61-
}, t)
68+
return useCardHeaderText(
69+
ui,
70+
{
71+
flowType: flowType.value as
72+
| FlowType.Recovery
73+
| FlowType.Verification
74+
| FlowType.Settings
75+
| FlowType.Error,
76+
},
77+
t,
78+
)
6279
})
6380
6481
const hasRealSlotContent = useHasSlotContent(slots)

packages/elements-vue/src/theme/default/components/form/DefaultConsentCheckbox.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ const scopeDescription = computed(() => {
4545
return translation === key ? "" : translation
4646
})
4747
48-
const iconName = computed((): IconName => ScopeIcons[scopeValue.value] ?? "personal")
48+
const iconName = computed(
49+
(): IconName => ScopeIcons[scopeValue.value] ?? "personal",
50+
)
4951
5052
function handleChange() {
5153
isChecked.value = !isChecked.value
@@ -62,9 +64,7 @@ function handleChange() {
6264
<Icon :name="iconName" :size="16" />
6365
</span>
6466
<span class="inline-flex max-w-full min-w-1 flex-1 flex-col leading-normal">
65-
<span
66-
class="break-words text-interface-foreground-default-primary"
67-
>
67+
<span class="break-words text-interface-foreground-default-primary">
6868
{{ scopeTitle }}
6969
</span>
7070
<span

0 commit comments

Comments
 (0)