or3-provider-basic-auth 0.0.6 → 0.0.7
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 +1 -1
- package/dist/runtime/components/BasicAuthUserMenu.client.vue +26 -9
- package/dist/runtime/components/SidebarAuthButtonBasic.client.vue +2 -2
- package/dist/runtime/lib/auth-ui-popover.d.ts +14 -0
- package/dist/runtime/lib/auth-ui-popover.js +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<UPopover
|
|
3
3
|
v-model:open="isOpen"
|
|
4
4
|
portal
|
|
5
|
-
:content="
|
|
6
|
-
:ui="{ content: 'z-[
|
|
5
|
+
:content="popoverContent"
|
|
6
|
+
:ui="{ content: 'z-[280] max-w-[240px] p-0 border-none bg-transparent shadow-none' }"
|
|
7
7
|
>
|
|
8
8
|
<UButton
|
|
9
9
|
v-bind="triggerButtonProps"
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
>
|
|
13
13
|
<template #default>
|
|
14
14
|
<span class="flex flex-col items-center gap-1 w-full">
|
|
15
|
-
<UIcon name="
|
|
16
|
-
<span class="text-[7px] uppercase tracking-wider whitespace-nowrap">
|
|
15
|
+
<UIcon name="lucide:user" class="h-[18px] w-[18px]" />
|
|
16
|
+
<span class="sidebar-rail-caption text-[7px] uppercase tracking-wider whitespace-nowrap">
|
|
17
17
|
Account
|
|
18
18
|
</span>
|
|
19
19
|
</span>
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
|
|
23
23
|
<template #content>
|
|
24
24
|
<div
|
|
25
|
-
class="w-[220px] rounded-[var(--md-border-radius)] border-[length:var(--md-border-width)] border-[color:var(--md-border-color)] bg-[var(--md-surface)] overflow-hidden theme-shadow"
|
|
25
|
+
class="basic-auth-account-menu w-[220px] rounded-[var(--md-border-radius)] border-[length:var(--md-border-width)] border-[color:var(--md-border-color)] bg-[var(--md-surface)] overflow-hidden theme-shadow"
|
|
26
26
|
>
|
|
27
27
|
<!-- User identity section -->
|
|
28
28
|
<div class="px-4 pt-4 pb-3">
|
|
29
29
|
<div class="flex items-center gap-3">
|
|
30
30
|
<div class="flex items-center justify-center w-8 h-8 rounded-full bg-[var(--md-success)]/15 text-[var(--md-success)] shrink-0">
|
|
31
|
-
<UIcon name="
|
|
31
|
+
<UIcon name="lucide:user" class="w-4 h-4" />
|
|
32
32
|
</div>
|
|
33
33
|
<div class="min-w-0">
|
|
34
34
|
<p class="text-[10px] uppercase tracking-wider text-[var(--md-on-surface)]/50 mb-0.5">
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
class="w-full flex items-center gap-2.5 px-3 py-2 text-sm text-[var(--md-on-surface)] rounded-[var(--md-border-radius)] hover:bg-[var(--md-surface-hover)] active:bg-[var(--md-surface-active)] transition-colors text-left"
|
|
51
51
|
@click="onChangePassword"
|
|
52
52
|
>
|
|
53
|
-
<UIcon name="
|
|
53
|
+
<UIcon name="lucide:key-round" class="w-4 h-4 text-[var(--md-on-surface)]/60 shrink-0" />
|
|
54
54
|
Change Password
|
|
55
55
|
</button>
|
|
56
56
|
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
class="w-full flex items-center gap-2.5 px-3 py-2 text-sm rounded-[var(--md-border-radius)] text-[var(--md-error)] hover:bg-[var(--md-error)]/10 active:bg-[var(--md-error)]/18 transition-colors text-left disabled:opacity-50"
|
|
61
61
|
@click="onSignOut"
|
|
62
62
|
>
|
|
63
|
-
<UIcon name="
|
|
63
|
+
<UIcon name="lucide:log-out" class="w-4 h-4 shrink-0" />
|
|
64
64
|
{{ pending ? "Signing out\u2026" : "Sign Out" }}
|
|
65
65
|
</button>
|
|
66
66
|
</div>
|
|
@@ -70,7 +70,10 @@
|
|
|
70
70
|
</template>
|
|
71
71
|
|
|
72
72
|
<script setup>
|
|
73
|
-
import { ref } from "vue";
|
|
73
|
+
import { computed, inject, ref, unref } from "vue";
|
|
74
|
+
import {
|
|
75
|
+
AUTH_UI_POPOVER_CONTENT_KEY
|
|
76
|
+
} from "../lib/auth-ui-popover";
|
|
74
77
|
defineProps({
|
|
75
78
|
email: { type: String, required: false },
|
|
76
79
|
displayName: { type: String, required: false }
|
|
@@ -78,6 +81,20 @@ defineProps({
|
|
|
78
81
|
const emit = defineEmits(["signed-out", "change-password"]);
|
|
79
82
|
const isOpen = ref(false);
|
|
80
83
|
const pending = ref(false);
|
|
84
|
+
const DEFAULT_POPOVER_CONTENT = {
|
|
85
|
+
side: "right",
|
|
86
|
+
align: "end",
|
|
87
|
+
sideOffset: 10,
|
|
88
|
+
collisionPadding: 12
|
|
89
|
+
};
|
|
90
|
+
const injectedPopoverContent = inject(
|
|
91
|
+
AUTH_UI_POPOVER_CONTENT_KEY,
|
|
92
|
+
null
|
|
93
|
+
);
|
|
94
|
+
const popoverContent = computed(() => ({
|
|
95
|
+
...DEFAULT_POPOVER_CONTENT,
|
|
96
|
+
...injectedPopoverContent ? unref(injectedPopoverContent) : null
|
|
97
|
+
}));
|
|
81
98
|
const triggerButtonProps = {
|
|
82
99
|
block: true,
|
|
83
100
|
variant: "ghost",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
>
|
|
18
18
|
<template #default>
|
|
19
19
|
<span class="flex flex-col items-center gap-1 w-full">
|
|
20
|
-
<UIcon name="
|
|
21
|
-
<span class="text-[7px] uppercase tracking-wider whitespace-nowrap">
|
|
20
|
+
<UIcon name="lucide:log-in" class="h-[18px] w-[18px]" />
|
|
21
|
+
<span class="sidebar-rail-caption text-[7px] uppercase tracking-wider whitespace-nowrap">
|
|
22
22
|
Login
|
|
23
23
|
</span>
|
|
24
24
|
</span>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Floating UI content options for auth UI popovers.
|
|
3
|
+
* Hosts (e.g. mobile More menu) can inject overrides so nested menus
|
|
4
|
+
* stay on-screen instead of defaulting to rail `side: 'right'`.
|
|
5
|
+
*/
|
|
6
|
+
export interface AuthUiPopoverContent {
|
|
7
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
8
|
+
align?: 'start' | 'center' | 'end';
|
|
9
|
+
sideOffset?: number;
|
|
10
|
+
alignOffset?: number;
|
|
11
|
+
collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>;
|
|
12
|
+
}
|
|
13
|
+
/** String key so host app + provider package can share without a linked import. */
|
|
14
|
+
export declare const AUTH_UI_POPOVER_CONTENT_KEY = "or3:auth-ui-popover-content";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const AUTH_UI_POPOVER_CONTENT_KEY = "or3:auth-ui-popover-content";
|