@witchcraft/nuxt-auth 0.1.7 → 0.1.8
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/dist/module.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
3
|
+
:class="twMerge(`
|
|
4
|
+
flex-1
|
|
5
|
+
flex
|
|
6
|
+
flex-col
|
|
7
|
+
items-stretch
|
|
8
|
+
justify-center
|
|
9
|
+
gap-2
|
|
10
|
+
`, $attrs?.class)"
|
|
11
11
|
>
|
|
12
12
|
<template
|
|
13
13
|
v-for="provider in enabledProviders"
|
|
@@ -19,40 +19,44 @@
|
|
|
19
19
|
v-if="provider"
|
|
20
20
|
:id="'login-provider-' + provider"
|
|
21
21
|
type="button"
|
|
22
|
-
class="p-2
|
|
22
|
+
class="text-l p-2 px-4 [&_label]:justify-start [&_label]:gap-4"
|
|
23
23
|
:style="styles[provider]"
|
|
24
24
|
:key="provider"
|
|
25
25
|
@click="login(provider, loginOptions)"
|
|
26
26
|
>
|
|
27
27
|
<WIcon
|
|
28
28
|
v-if="styles[provider]?.logo"
|
|
29
|
-
class="
|
|
29
|
+
class="text-xl"
|
|
30
30
|
>
|
|
31
31
|
<component
|
|
32
32
|
:is="styles[provider]?.logo"
|
|
33
33
|
/>
|
|
34
34
|
</WIcon>
|
|
35
|
-
|
|
35
|
+
<div>
|
|
36
|
+
Sign in / Register with {{ styles[provider]?.name ?? provider }}
|
|
37
|
+
</div>
|
|
36
38
|
</WButton>
|
|
37
39
|
</template>
|
|
38
40
|
<slot
|
|
39
41
|
name="extra"
|
|
40
|
-
class="
|
|
41
|
-
|
|
42
|
+
icon-class="text-xl"
|
|
43
|
+
class="text-l p-2 px-4 [&_label]:justify-start [&_label]:gap-4"
|
|
42
44
|
/>
|
|
43
45
|
</div>
|
|
44
46
|
</template>
|
|
45
47
|
|
|
46
48
|
<script setup>
|
|
47
49
|
import { useInjectedDarkMode } from "@witchcraft/ui/composables/useInjectedDarkMode";
|
|
50
|
+
import { twMerge } from "@witchcraft/ui/utils/twMerge";
|
|
48
51
|
import defu from "defu";
|
|
49
52
|
import { useRuntimeConfig } from "#app";
|
|
50
|
-
import { computed } from "#imports";
|
|
53
|
+
import { computed, useAttrs } from "#imports";
|
|
51
54
|
import { useAuth } from "../composables/useAuth.js";
|
|
52
55
|
import { providerStyles as baseProviderStyles } from "../core/providerStyles.js";
|
|
53
56
|
const rc = useRuntimeConfig();
|
|
54
57
|
const config = rc.public.auth;
|
|
55
58
|
const enabledProviders = config.enabledProviders;
|
|
59
|
+
const $attrs = useAttrs();
|
|
56
60
|
const { darkMode: isDark } = useInjectedDarkMode();
|
|
57
61
|
const props = defineProps({
|
|
58
62
|
providerStyles: { type: Object, required: false, default: () => ({}) },
|