or3-provider-basic-auth 0.0.5 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "or3-provider-basic-auth",
3
3
  "configKey": "or3-provider-basic-auth",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -2,8 +2,8 @@
2
2
  <UPopover
3
3
  v-model:open="isOpen"
4
4
  portal
5
- :content="{ side: 'right', align: 'end', sideOffset: 10 }"
6
- :ui="{ content: 'z-[260] max-w-[240px] p-0 border-none bg-transparent shadow-none' }"
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="i-lucide-user-check" class="h-[18px] w-[18px]" />
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="i-lucide-user" class="w-4 h-4" />
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="i-lucide-key-round" class="w-4 h-4 text-[var(--md-on-surface)]/60 shrink-0" />
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="i-lucide-log-out" class="w-4 h-4 shrink-0" />
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="i-lucide-log-in" class="h-[18px] w-[18px]" />
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>
@@ -46,6 +46,7 @@
46
46
 
47
47
  <script setup>
48
48
  import { computed, nextTick, onMounted, ref } from "vue";
49
+ import { useRuntimeConfig } from "#imports";
49
50
  import { BASIC_AUTH_PROVIDER_ID } from "../lib/constants";
50
51
  import { silentRefreshOnce } from "../lib/silent-refresh.client";
51
52
  import BasicAuthSignInModal from "./BasicAuthSignInModal.client.vue";
@@ -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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "or3-provider-basic-auth",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Saluana/or3-provider-basic-auth.git"