@strands.gg/accui 2.8.1 → 2.9.1
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/index.cjs.js +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.es.js +5 -5
- package/dist/nuxt/module.d.ts +4 -1
- package/dist/nuxt/runtime/composables/useAuthenticatedFetch.d.ts +20 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.cjs.js +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts +65 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.es.js +1 -1
- package/dist/nuxt/runtime/middleware/auth.d.ts +6 -0
- package/dist/nuxt/runtime/middleware/auth.global.d.ts +2 -1
- package/dist/nuxt/runtime/middleware/guest.d.ts +6 -0
- package/dist/nuxt/runtime/plugin.client.d.ts +2 -1
- package/dist/nuxt/runtime/plugin.server.d.ts +2 -1
- package/dist/nuxt/runtime/plugins/auth-interceptor.client.d.ts +2 -1
- package/dist/nuxt/types.d.ts +45 -0
- package/dist/nuxt.d.ts +4 -1
- package/dist/shared/defaults.d.ts +2 -0
- package/dist/types/composables.d.ts +96 -0
- package/dist/types/index.d.ts +242 -0
- package/dist/useStrandsAuth-Bp5aTR3h.cjs.js +1 -0
- package/dist/{useStrandsAuth-jI_X_wiK.es.js → useStrandsAuth-Xz8lnhv7.es.js} +1 -1
- package/dist/utils/colors.d.ts +10 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/slots.d.ts +1 -0
- package/dist/utils/validation.d.ts +12 -0
- package/dist/vue/components/StrandsNav/index.d.ts +8 -0
- package/dist/vue/components/StrandsNav/types.d.ts +12 -0
- package/dist/vue/components/icons/index.d.ts +2 -0
- package/dist/vue/components/index.d.ts +27 -0
- package/dist/vue/composables/useAuthenticatedFetch.d.ts +20 -0
- package/dist/vue/composables/useDarkMode.d.ts +48 -0
- package/dist/vue/composables/useFloatingPosition.d.ts +22 -0
- package/dist/vue/composables/useModalStack.d.ts +86 -0
- package/dist/vue/composables/useOAuthProviders.d.ts +73 -0
- package/dist/vue/composables/useStrandsAuth.d.ts +2 -0
- package/dist/vue/composables/useStrandsConfig.d.ts +5 -0
- package/dist/vue/composables/useStrandsMfa.d.ts +36 -0
- package/dist/vue/composables/useTheme.d.ts +18 -0
- package/dist/vue/index.d.ts +16 -0
- package/dist/vue/plugins/StrandsUIPlugin.d.ts +20 -0
- package/dist/vue/ui/UiButton/index.d.ts +13 -0
- package/dist/vue/ui/index.d.ts +54 -0
- package/dist/vue/utils/contrast.d.ts +75 -0
- package/dist/vue/utils/debounce.d.ts +12 -0
- package/dist/vue/utils/fontPreloader.d.ts +11 -0
- package/dist/vue/utils/iconProps.d.ts +9 -0
- package/dist/vue/utils/lazyComponents.d.ts +4 -0
- package/dist/vue/utils/levels.d.ts +27 -0
- package/dist/vue/utils/modalStack.d.ts +31 -0
- package/dist/vue/utils/performanceInit.d.ts +40 -0
- package/dist/vue/utils/requestCache.d.ts +49 -0
- package/dist/vue/utils/sounds.d.ts +57 -0
- package/package.json +2 -3
- package/dist/auth-interceptor.client.d.ts +0 -1
- package/dist/auth.global.d.ts +0 -1
- package/dist/module.d.ts +0 -1
- package/dist/plugin.client.d.ts +0 -1
- package/dist/plugin.server.d.ts +0 -1
- package/dist/useAuthenticatedFetch.d.ts +0 -1
- package/dist/useStrandsAuth-Ca9Zqmfy.cjs.js +0 -1
- package/dist/useStrandsAuth.d.ts +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const isValidEmail: (email: string) => boolean;
|
|
2
|
+
export declare const validatePassword: (password: string) => {
|
|
3
|
+
isValid: boolean;
|
|
4
|
+
strength: "weak" | "medium" | "strong";
|
|
5
|
+
errors: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare const isValidName: (name: string) => boolean;
|
|
8
|
+
export declare const isRequired: (value: string) => boolean;
|
|
9
|
+
export declare const passwordsMatch: (password: string, confirmation: string) => boolean;
|
|
10
|
+
export declare const getInitials: (firstName?: string, lastName?: string) => string;
|
|
11
|
+
export declare const formatDate: (date: string | Date) => string;
|
|
12
|
+
export declare const debounce: <T extends (...args: any[]) => any>(func: T, wait: number) => ((...args: Parameters<T>) => void);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import StrandsNavComponent from './StrandsNav.vue';
|
|
2
|
+
import StrandsNavItem from './StrandsNavItem.vue';
|
|
3
|
+
declare const StrandsNav: typeof StrandsNavComponent & {
|
|
4
|
+
Item: typeof StrandsNavItem;
|
|
5
|
+
};
|
|
6
|
+
export default StrandsNav;
|
|
7
|
+
export { StrandsNavItem };
|
|
8
|
+
export type { NavItem } from './types';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { default as StrandsAuth } from './StrandsAuth.vue';
|
|
2
|
+
export { default as StrandsSignIn } from './StrandsSignIn.vue';
|
|
3
|
+
export { default as StrandsSignUp } from './StrandsSignUp.vue';
|
|
4
|
+
export { default as StrandsCompleteSignUp } from './StrandsCompleteSignUp.vue';
|
|
5
|
+
export { default as StrandsUserProfile } from './StrandsUserProfile.vue';
|
|
6
|
+
export { default as StrandsPasswordReset } from './StrandsPasswordReset.vue';
|
|
7
|
+
export { default as StrandsMfaVerification } from './StrandsMfaVerification.vue';
|
|
8
|
+
export { default as StrandsSessionsModal } from './StrandsSessionsModal.vue';
|
|
9
|
+
export { default as StrandsConfirmModal } from './StrandsConfirmModal.vue';
|
|
10
|
+
export { default as SignedIn } from './SignedIn.vue';
|
|
11
|
+
export { default as StrandsLogo } from './StrandsLogo.vue';
|
|
12
|
+
export { default as StrandsSecuredFooter } from './StrandsSecuredFooter.vue';
|
|
13
|
+
export { default as StrandsConfigProvider } from './StrandsConfigProvider.vue';
|
|
14
|
+
export { default as SvgIcon } from './SvgIcon.vue';
|
|
15
|
+
export { default as StrandsUserButton } from './StrandsUserButton.vue';
|
|
16
|
+
export { default as StrandsNav, StrandsNavItem } from './StrandsNav';
|
|
17
|
+
export type { NavItem } from './StrandsNav';
|
|
18
|
+
export { default as VirtualList } from './VirtualList.vue';
|
|
19
|
+
export * from './icons';
|
|
20
|
+
export { preloadCriticalComponents } from '../utils/lazyComponents';
|
|
21
|
+
export { default as StrandsMFASetup } from './StrandsMFASetup.vue';
|
|
22
|
+
export { default as StrandsMfaModal } from './StrandsMfaModal.vue';
|
|
23
|
+
export { default as StrandsTotpSetupModal } from './StrandsTotpSetupModal.vue';
|
|
24
|
+
export { default as StrandsEmailMfaSetupModal } from './StrandsEmailMfaSetupModal.vue';
|
|
25
|
+
export { default as StrandsHardwareKeySetupModal } from './StrandsHardwareKeySetupModal.vue';
|
|
26
|
+
export { default as StrandsBackupCodesModal } from './StrandsBackupCodesModal.vue';
|
|
27
|
+
export { default as StrandsSettingsModal } from './StrandsSettingsModal.vue';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AuthenticatedFetchOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Enhanced fetch composable that automatically includes auth headers
|
|
4
|
+
* and handles token refresh for API requests (Vue version)
|
|
5
|
+
*/
|
|
6
|
+
export declare function useAuthenticatedFetch(): {
|
|
7
|
+
authenticatedFetch: (url: string | URL, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
8
|
+
get: (url: string | URL, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
9
|
+
post: (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
10
|
+
put: (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
11
|
+
delete: (url: string | URL, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
12
|
+
patch: (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
13
|
+
};
|
|
14
|
+
export declare const $authFetch: {
|
|
15
|
+
get: (url: string | URL, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
16
|
+
post: (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
17
|
+
put: (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
18
|
+
delete: (url: string | URL, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
19
|
+
patch: (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => Promise<Response>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type ThemeMode = 'light' | 'dark' | 'system';
|
|
2
|
+
/**
|
|
3
|
+
* Dark mode composable
|
|
4
|
+
*/
|
|
5
|
+
export declare function useDarkMode(): {
|
|
6
|
+
currentTheme: import("vue").ComputedRef<ThemeMode>;
|
|
7
|
+
isDark: import("vue").ComputedRef<boolean>;
|
|
8
|
+
themeLabel: import("vue").ComputedRef<"Light" | "Dark" | "System">;
|
|
9
|
+
setTheme: (theme: ThemeMode) => void;
|
|
10
|
+
toggle: () => void;
|
|
11
|
+
cycleTheme: () => void;
|
|
12
|
+
initialize: () => void;
|
|
13
|
+
themeOptions: ({
|
|
14
|
+
value: "light";
|
|
15
|
+
label: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
} | {
|
|
18
|
+
value: "dark";
|
|
19
|
+
label: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
} | {
|
|
22
|
+
value: "system";
|
|
23
|
+
label: string;
|
|
24
|
+
icon: string;
|
|
25
|
+
})[];
|
|
26
|
+
};
|
|
27
|
+
export declare function useGlobalDarkMode(): {
|
|
28
|
+
currentTheme: import("vue").ComputedRef<ThemeMode>;
|
|
29
|
+
isDark: import("vue").ComputedRef<boolean>;
|
|
30
|
+
themeLabel: import("vue").ComputedRef<"Light" | "Dark" | "System">;
|
|
31
|
+
setTheme: (theme: ThemeMode) => void;
|
|
32
|
+
toggle: () => void;
|
|
33
|
+
cycleTheme: () => void;
|
|
34
|
+
initialize: () => void;
|
|
35
|
+
themeOptions: ({
|
|
36
|
+
value: "light";
|
|
37
|
+
label: string;
|
|
38
|
+
icon: string;
|
|
39
|
+
} | {
|
|
40
|
+
value: "dark";
|
|
41
|
+
label: string;
|
|
42
|
+
icon: string;
|
|
43
|
+
} | {
|
|
44
|
+
value: "system";
|
|
45
|
+
label: string;
|
|
46
|
+
icon: string;
|
|
47
|
+
})[];
|
|
48
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export type FloatingPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
3
|
+
export interface UseFloatingPositionOptions {
|
|
4
|
+
trigger: Ref<HTMLElement | undefined>;
|
|
5
|
+
floating: Ref<HTMLElement | undefined>;
|
|
6
|
+
placement?: FloatingPlacement;
|
|
7
|
+
offset?: number;
|
|
8
|
+
flip?: boolean;
|
|
9
|
+
shift?: boolean;
|
|
10
|
+
sameWidth?: boolean;
|
|
11
|
+
autoUpdate?: boolean;
|
|
12
|
+
boundary?: 'viewport' | 'scrollParent';
|
|
13
|
+
clickOutside?: {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
handler: () => void;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function useFloatingPosition(options: UseFloatingPositionOptions): {
|
|
19
|
+
floatingStyle: Ref<Record<string, string>, Record<string, string>>;
|
|
20
|
+
updatePosition: () => void;
|
|
21
|
+
cleanup: () => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type ModalInstance } from '../utils/modalStack';
|
|
2
|
+
export interface UseModalOptions {
|
|
3
|
+
closeOnEscape?: boolean;
|
|
4
|
+
priority?: 'low' | 'normal' | 'high' | 'critical';
|
|
5
|
+
component?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function useModalStack(options?: UseModalOptions): {
|
|
8
|
+
isOpen: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
modalId: import("vue").Ref<symbol, symbol>;
|
|
10
|
+
modalInstance: import("vue").Ref<{
|
|
11
|
+
id: symbol;
|
|
12
|
+
closeModal: () => void;
|
|
13
|
+
closeOnEscape: boolean;
|
|
14
|
+
zIndex: number;
|
|
15
|
+
component?: string;
|
|
16
|
+
priority?: "low" | "normal" | "high" | "critical";
|
|
17
|
+
}, ModalInstance | {
|
|
18
|
+
id: symbol;
|
|
19
|
+
closeModal: () => void;
|
|
20
|
+
closeOnEscape: boolean;
|
|
21
|
+
zIndex: number;
|
|
22
|
+
component?: string;
|
|
23
|
+
priority?: "low" | "normal" | "high" | "critical";
|
|
24
|
+
}>;
|
|
25
|
+
openModal: (customCloseHandler?: () => void) => Promise<ModalInstance>;
|
|
26
|
+
closeModal: () => void;
|
|
27
|
+
getModalContainer: () => Element | null;
|
|
28
|
+
getModalBackdrop: () => Element | null;
|
|
29
|
+
zIndex: () => number;
|
|
30
|
+
isTopModal: () => boolean;
|
|
31
|
+
};
|
|
32
|
+
export declare function useModalTeleport(modalId: symbol): {
|
|
33
|
+
target: string;
|
|
34
|
+
isAvailable: () => boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare function useGlobalModalStack(): {
|
|
37
|
+
state: import("vue").Ref<{
|
|
38
|
+
modals: {
|
|
39
|
+
id: symbol;
|
|
40
|
+
closeModal: () => void;
|
|
41
|
+
closeOnEscape: boolean;
|
|
42
|
+
zIndex: number;
|
|
43
|
+
component?: string;
|
|
44
|
+
priority?: "low" | "normal" | "high" | "critical";
|
|
45
|
+
}[];
|
|
46
|
+
topModal: {
|
|
47
|
+
id: symbol;
|
|
48
|
+
closeModal: () => void;
|
|
49
|
+
closeOnEscape: boolean;
|
|
50
|
+
zIndex: number;
|
|
51
|
+
component?: string;
|
|
52
|
+
priority?: "low" | "normal" | "high" | "critical";
|
|
53
|
+
};
|
|
54
|
+
hasModals: boolean;
|
|
55
|
+
highestZIndex: number;
|
|
56
|
+
}, import("../utils/modalStack").ModalStackState | {
|
|
57
|
+
modals: {
|
|
58
|
+
id: symbol;
|
|
59
|
+
closeModal: () => void;
|
|
60
|
+
closeOnEscape: boolean;
|
|
61
|
+
zIndex: number;
|
|
62
|
+
component?: string;
|
|
63
|
+
priority?: "low" | "normal" | "high" | "critical";
|
|
64
|
+
}[];
|
|
65
|
+
topModal: {
|
|
66
|
+
id: symbol;
|
|
67
|
+
closeModal: () => void;
|
|
68
|
+
closeOnEscape: boolean;
|
|
69
|
+
zIndex: number;
|
|
70
|
+
component?: string;
|
|
71
|
+
priority?: "low" | "normal" | "high" | "critical";
|
|
72
|
+
};
|
|
73
|
+
hasModals: boolean;
|
|
74
|
+
highestZIndex: number;
|
|
75
|
+
}>;
|
|
76
|
+
closeAll: () => void;
|
|
77
|
+
closeTop: () => void;
|
|
78
|
+
getModalByComponent: (componentName: string) => {
|
|
79
|
+
id: symbol;
|
|
80
|
+
closeModal: () => void;
|
|
81
|
+
closeOnEscape: boolean;
|
|
82
|
+
zIndex: number;
|
|
83
|
+
component?: string;
|
|
84
|
+
priority?: "low" | "normal" | "high" | "critical";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface OAuthProvider {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
displayName?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
iconUrl?: string;
|
|
7
|
+
auth_url: string;
|
|
8
|
+
scopes: string[];
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
metadata?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface OAuthProvidersResponse {
|
|
13
|
+
providers: OAuthProvider[];
|
|
14
|
+
redirect_url: string;
|
|
15
|
+
}
|
|
16
|
+
export interface OAuthProviderDetailsResponse {
|
|
17
|
+
success: boolean;
|
|
18
|
+
data: {
|
|
19
|
+
provider: OAuthProvider;
|
|
20
|
+
authUrl: string;
|
|
21
|
+
state?: string;
|
|
22
|
+
};
|
|
23
|
+
error?: {
|
|
24
|
+
code: string;
|
|
25
|
+
message: string;
|
|
26
|
+
details?: any;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface UseOAuthProvidersOptions {
|
|
30
|
+
redirectUrl?: string;
|
|
31
|
+
scopes?: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare function useOAuthProviders(options?: UseOAuthProvidersOptions): {
|
|
34
|
+
providers: import("vue").ComputedRef<{
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
displayName?: string;
|
|
38
|
+
icon?: string;
|
|
39
|
+
iconUrl?: string;
|
|
40
|
+
auth_url: string;
|
|
41
|
+
scopes: string[];
|
|
42
|
+
enabled: boolean;
|
|
43
|
+
metadata?: Record<string, string>;
|
|
44
|
+
}[]>;
|
|
45
|
+
enabledProviders: import("vue").ComputedRef<{
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
displayName?: string;
|
|
49
|
+
icon?: string;
|
|
50
|
+
iconUrl?: string;
|
|
51
|
+
auth_url: string;
|
|
52
|
+
scopes: string[];
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
metadata?: Record<string, string>;
|
|
55
|
+
}[]>;
|
|
56
|
+
loading: import("vue").ComputedRef<boolean>;
|
|
57
|
+
error: import("vue").ComputedRef<string>;
|
|
58
|
+
fetchProviders: () => Promise<OAuthProvider[]>;
|
|
59
|
+
getProviderAuthUrl: (providerId: string, customOptions?: Partial<UseOAuthProvidersOptions>) => Promise<string>;
|
|
60
|
+
redirectToProvider: (providerId: string, customOptions?: Partial<UseOAuthProvidersOptions>) => Promise<void>;
|
|
61
|
+
getProviderById: (providerId: string) => {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
displayName?: string;
|
|
65
|
+
icon?: string;
|
|
66
|
+
iconUrl?: string;
|
|
67
|
+
auth_url: string;
|
|
68
|
+
scopes: string[];
|
|
69
|
+
enabled: boolean;
|
|
70
|
+
metadata?: Record<string, string>;
|
|
71
|
+
};
|
|
72
|
+
getProviderIcon: (provider: OAuthProvider) => string;
|
|
73
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { StrandsAuthConfig, StrandsAuthEndpoints } from '../../types';
|
|
2
|
+
import type { StrandsAuthConfig, UseStrandsConfigReturn } from '../../types';
|
|
3
|
+
export declare function provideStrandsConfig(config: StrandsAuthConfig): void;
|
|
4
|
+
export declare function useStrandsConfig(fallbackConfig?: Partial<StrandsAuthConfig>): UseStrandsConfigReturn;
|
|
5
|
+
export declare function setStrandsConfig(config: StrandsAuthConfig): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { MfaDevicesResponse, TotpSetupResponse, BackupCodesResponse } from '../../types';
|
|
2
|
+
export declare function useStrandsMfa(): {
|
|
3
|
+
mfaDevices: import("vue").ComputedRef<{
|
|
4
|
+
id: string;
|
|
5
|
+
device_type: import("../..").MfaDeviceType;
|
|
6
|
+
device_name: string;
|
|
7
|
+
is_active: boolean;
|
|
8
|
+
last_used_at?: string | Date;
|
|
9
|
+
created_at: string | Date;
|
|
10
|
+
}[]>;
|
|
11
|
+
mfaEnabled: import("vue").ComputedRef<boolean>;
|
|
12
|
+
loading: import("vue").ComputedRef<boolean>;
|
|
13
|
+
hasMfaDevices: import("vue").ComputedRef<boolean>;
|
|
14
|
+
activeMfaDevices: import("vue").ComputedRef<{
|
|
15
|
+
id: string;
|
|
16
|
+
device_type: import("../..").MfaDeviceType;
|
|
17
|
+
device_name: string;
|
|
18
|
+
is_active: boolean;
|
|
19
|
+
last_used_at?: string | Date;
|
|
20
|
+
created_at: string | Date;
|
|
21
|
+
}[]>;
|
|
22
|
+
fetchMfaDevices: () => Promise<MfaDevicesResponse>;
|
|
23
|
+
setupTotp: (deviceName: string) => Promise<TotpSetupResponse>;
|
|
24
|
+
verifyTotpSetup: (deviceId: string, totpCode: string) => Promise<void>;
|
|
25
|
+
setupEmailMfa: (deviceName: string) => Promise<{
|
|
26
|
+
device_id: string;
|
|
27
|
+
email: string;
|
|
28
|
+
}>;
|
|
29
|
+
sendEmailMfaCode: (deviceId: string) => Promise<void>;
|
|
30
|
+
verifyEmailMfaCode: (deviceId: string, code: string) => Promise<boolean>;
|
|
31
|
+
disableMfaDevice: (deviceId: string) => Promise<void>;
|
|
32
|
+
regenerateBackupCodes: (deviceId: string) => Promise<BackupCodesResponse>;
|
|
33
|
+
getDeviceTypeIcon: (deviceType: string) => string;
|
|
34
|
+
getDeviceTypeName: (deviceType: string) => string;
|
|
35
|
+
formatLastUsed: (lastUsedAt?: string | Date) => string;
|
|
36
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for theme management
|
|
4
|
+
*
|
|
5
|
+
* Checks for UiApp theme provider and returns the appropriate theme
|
|
6
|
+
* If UiApp forces a theme (not 'auto'), all components must use that theme
|
|
7
|
+
*/
|
|
8
|
+
export declare function useTheme(fallbackTheme?: 'light' | 'dark' | 'auto'): {
|
|
9
|
+
theme: ComputedRef<"light" | "dark" | "auto">;
|
|
10
|
+
isDark: ComputedRef<boolean>;
|
|
11
|
+
isLight: ComputedRef<boolean>;
|
|
12
|
+
isForced: ComputedRef<boolean>;
|
|
13
|
+
themeClass: ComputedRef<{
|
|
14
|
+
'ui-theme--light': boolean;
|
|
15
|
+
'ui-theme--dark': boolean;
|
|
16
|
+
'ui-theme--forced': boolean;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './components/index';
|
|
2
|
+
export * from './ui/index';
|
|
3
|
+
export { default as StrandsUIPlugin, injectSquircleStyles } from './plugins/StrandsUIPlugin';
|
|
4
|
+
export * from './composables/useStrandsAuth';
|
|
5
|
+
export * from './composables/useStrandsConfig';
|
|
6
|
+
export * from './composables/useOAuthProviders';
|
|
7
|
+
export * from './composables/useAuthenticatedFetch';
|
|
8
|
+
export * from './composables/useDarkMode';
|
|
9
|
+
export * from './composables/useTheme';
|
|
10
|
+
export * from './composables/useFloatingPosition';
|
|
11
|
+
export * from './composables/useModalStack';
|
|
12
|
+
export * from './utils/requestCache';
|
|
13
|
+
export * from './utils/debounce';
|
|
14
|
+
export * from './utils/fontPreloader';
|
|
15
|
+
export * from './utils/lazyComponents';
|
|
16
|
+
export * from './utils/performanceInit';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import '../../styles/base.css';
|
|
3
|
+
import StrandsUiAlert from '../ui/UiAlert.vue';
|
|
4
|
+
import StrandsUiButton from '../ui/UiButton.vue';
|
|
5
|
+
import StrandsUiCard from '../ui/UiCard.vue';
|
|
6
|
+
import StrandsUiInput from '../ui/UiInput.vue';
|
|
7
|
+
import StrandsUiLink from '../ui/UiLink.vue';
|
|
8
|
+
import StrandsUiTabs from '../ui/UiTabs.vue';
|
|
9
|
+
import StrandsUiLoader from '../ui/UiLoader.vue';
|
|
10
|
+
declare function injectSquircleStyles(): void;
|
|
11
|
+
export interface StrandsUIOptions {
|
|
12
|
+
prefix?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: {
|
|
15
|
+
install(app: App, options?: StrandsUIOptions): void;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export { StrandsUiAlert, StrandsUiButton, StrandsUiCard, StrandsUiInput, StrandsUiLink, StrandsUiTabs, StrandsUiLoader, };
|
|
19
|
+
export { injectSquircleStyles };
|
|
20
|
+
export type { ButtonVariant, ButtonSize, InputType, CardVariant, LinkVariant, AlertVariant, } from '../ui/index';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import UiButton from '../UiButton.vue';
|
|
2
|
+
import UiButtonContent from './UiButton.Content.vue';
|
|
3
|
+
import UiButtonAnchor from './UiButton.Anchor.vue';
|
|
4
|
+
import UiButtonNuxt from './UiButton.Nuxt.vue';
|
|
5
|
+
import UiButtonVue from './UiButton.Vue.vue';
|
|
6
|
+
declare const CompoundUiButton: typeof UiButton & {
|
|
7
|
+
Content: typeof UiButtonContent;
|
|
8
|
+
Anchor: typeof UiButtonAnchor;
|
|
9
|
+
Nuxt: typeof UiButtonNuxt;
|
|
10
|
+
Vue: typeof UiButtonVue;
|
|
11
|
+
};
|
|
12
|
+
export default CompoundUiButton;
|
|
13
|
+
export { UiButtonContent, UiButtonAnchor, UiButtonNuxt, UiButtonVue };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export { default as StrandsUiApp } from './UiApp.vue';
|
|
2
|
+
export { default as StrandsUiAlert } from './UiAlert.vue';
|
|
3
|
+
export { default as StrandsUiButton } from './UiButton';
|
|
4
|
+
export { default as StrandsUiCard } from './UiCard.vue';
|
|
5
|
+
export { default as StrandsUiInput } from './UiInput.vue';
|
|
6
|
+
export { default as StrandsUiLink } from './UiLink.vue';
|
|
7
|
+
export { default as StrandsUiTabs } from './UiTabs.vue';
|
|
8
|
+
export { default as StrandsUiLoader } from './UiLoader.vue';
|
|
9
|
+
export { default as StrandsUiToggle } from './UiToggle.vue';
|
|
10
|
+
export { default as StrandsUiAvatarEditor } from './UiAvatarEditor.vue';
|
|
11
|
+
export { default as StrandsUiLevelProgress } from './UiLevelProgress.vue';
|
|
12
|
+
export { default as StrandsUiModal } from './UiModal.vue';
|
|
13
|
+
export { default as StrandsUiColorPicker } from './UiColorPicker.vue';
|
|
14
|
+
export { default as StrandsUiTooltip } from './UiTooltip.vue';
|
|
15
|
+
export { default as StrandsUiDivider } from './UiDivider.vue';
|
|
16
|
+
export { default as StrandsUiTable } from './UiTable.vue';
|
|
17
|
+
export { default as StrandsUiHero } from './UiHero.vue';
|
|
18
|
+
export { default as StrandsUiThemeToggle } from './UiThemeToggle.vue';
|
|
19
|
+
export { default as StrandsUiSlider } from './UiSlider.vue';
|
|
20
|
+
export { default as StrandsUiRadioGroup } from './UiRadioGroup.vue';
|
|
21
|
+
export { default as StrandsUiCheckboxGroup } from './UiCheckboxGroup.vue';
|
|
22
|
+
export { default as StrandsUiPill } from './UiPill.vue';
|
|
23
|
+
export { default as UiApp } from './UiApp.vue';
|
|
24
|
+
export { default as UiAlert } from './UiAlert.vue';
|
|
25
|
+
export { default as UiButton } from './UiButton';
|
|
26
|
+
export { default as UiCard } from './UiCard.vue';
|
|
27
|
+
export { default as UiInput } from './UiInput.vue';
|
|
28
|
+
export { default as UiLink } from './UiLink.vue';
|
|
29
|
+
export { default as UiTabs } from './UiTabs.vue';
|
|
30
|
+
export { default as UiLoader } from './UiLoader.vue';
|
|
31
|
+
export { default as UiToggle } from './UiToggle.vue';
|
|
32
|
+
export { default as UiAvatarEditor } from './UiAvatarEditor.vue';
|
|
33
|
+
export { default as UiAvatarEditorSimple } from './UiAvatarEditor.vue';
|
|
34
|
+
export { default as UiLevelProgress } from './UiLevelProgress.vue';
|
|
35
|
+
export { default as UiModal } from './UiModal.vue';
|
|
36
|
+
export { default as UiColorPicker } from './UiColorPicker.vue';
|
|
37
|
+
export { default as UiTooltip } from './UiTooltip.vue';
|
|
38
|
+
export { default as UiDivider } from './UiDivider.vue';
|
|
39
|
+
export { default as UiTable } from './UiTable.vue';
|
|
40
|
+
export { default as UiHero } from './UiHero.vue';
|
|
41
|
+
export { default as UiThemeToggle } from './UiThemeToggle.vue';
|
|
42
|
+
export { default as UiSlider } from './UiSlider.vue';
|
|
43
|
+
export { default as UiRadioGroup } from './UiRadioGroup.vue';
|
|
44
|
+
export { default as UiCheckboxGroup } from './UiCheckboxGroup.vue';
|
|
45
|
+
export { default as UiPill } from './UiPill.vue';
|
|
46
|
+
export type ButtonVariant = 'primary' | 'ghost' | 'outline';
|
|
47
|
+
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
48
|
+
export type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
49
|
+
export type CardVariant = 'default' | 'modern' | 'minimal';
|
|
50
|
+
export type LinkVariant = 'primary' | 'ghost' | 'underline';
|
|
51
|
+
export type AlertVariant = 'success' | 'error' | 'warning' | 'info';
|
|
52
|
+
export type PillVariant = 'filled' | 'outline' | 'ghost' | 'dot' | 'dot-only';
|
|
53
|
+
export type PillSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
54
|
+
export type PillColor = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WCAG 3.0 APCA-based contrast calculation utilities
|
|
3
|
+
* Provides perceptually accurate text contrast determination for accessibility
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Convert hex color to RGB values
|
|
7
|
+
*/
|
|
8
|
+
export declare const hexToRgb: (hex: string) => {
|
|
9
|
+
r: number;
|
|
10
|
+
g: number;
|
|
11
|
+
b: number;
|
|
12
|
+
} | null;
|
|
13
|
+
/**
|
|
14
|
+
* APCA sRGB to Y (luminance) conversion - WCAG 3.0 method
|
|
15
|
+
*/
|
|
16
|
+
export declare const sRGBtoY: (r: number, g: number, b: number) => number;
|
|
17
|
+
/**
|
|
18
|
+
* APCA contrast calculation
|
|
19
|
+
* Returns contrast value between -108 and 105
|
|
20
|
+
*/
|
|
21
|
+
export declare const calcAPCA: (txtY: number, bgY: number) => number;
|
|
22
|
+
/**
|
|
23
|
+
* Get RGB color for semantic color names
|
|
24
|
+
*/
|
|
25
|
+
export declare const getSemanticRgb: (colorName: string) => {
|
|
26
|
+
r: number;
|
|
27
|
+
g: number;
|
|
28
|
+
b: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Calculate APCA contrast score between two colors
|
|
32
|
+
* @param textColor RGB object or hex string for text color
|
|
33
|
+
* @param backgroundColor RGB object or hex string for background color
|
|
34
|
+
* @returns APCA contrast score (-108 to 105)
|
|
35
|
+
*/
|
|
36
|
+
export declare const getAPCAContrast: (textColor: {
|
|
37
|
+
r: number;
|
|
38
|
+
g: number;
|
|
39
|
+
b: number;
|
|
40
|
+
} | string, backgroundColor: {
|
|
41
|
+
r: number;
|
|
42
|
+
g: number;
|
|
43
|
+
b: number;
|
|
44
|
+
} | string) => number;
|
|
45
|
+
/**
|
|
46
|
+
* Get APCA contrast threshold based on font weight and size
|
|
47
|
+
* WCAG 3.0 APCA thresholds vary based on font characteristics
|
|
48
|
+
*/
|
|
49
|
+
export declare const getAPCAThreshold: (fontWeight?: number, fontSize?: number) => number;
|
|
50
|
+
/**
|
|
51
|
+
* Determine optimal text color (black or white) for a given background
|
|
52
|
+
* Uses WCAG 3.0 APCA algorithm for accurate contrast assessment
|
|
53
|
+
* @param colorProp Color property string (e.g., 'red-500', 'blue/50')
|
|
54
|
+
* @param fontWeight Font weight (300-900, default 400)
|
|
55
|
+
* @param fontSize Font size in pixels (default 16)
|
|
56
|
+
* @returns '#000000' for black text or '#ffffff' for white text
|
|
57
|
+
*/
|
|
58
|
+
export declare const getContrastTextColor: (colorProp: string, fontWeight?: number, fontSize?: number) => string;
|
|
59
|
+
/**
|
|
60
|
+
* Check if a color combination meets WCAG 3.0 APCA standards
|
|
61
|
+
* @param textColor Text color (RGB object or hex string)
|
|
62
|
+
* @param backgroundColor Background color (RGB object or hex string)
|
|
63
|
+
* @param fontWeight Font weight (300-900, default 400)
|
|
64
|
+
* @param fontSize Font size in pixels (default 16)
|
|
65
|
+
* @returns boolean indicating if contrast is sufficient
|
|
66
|
+
*/
|
|
67
|
+
export declare const meetsAPCAStandard: (textColor: {
|
|
68
|
+
r: number;
|
|
69
|
+
g: number;
|
|
70
|
+
b: number;
|
|
71
|
+
} | string, backgroundColor: {
|
|
72
|
+
r: number;
|
|
73
|
+
g: number;
|
|
74
|
+
b: number;
|
|
75
|
+
} | string, fontWeight?: number, fontSize?: number) => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debounce utility for optimizing frequent operations
|
|
3
|
+
*/
|
|
4
|
+
export declare function debounce<T extends (...args: any[]) => void>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Debounced localStorage setter
|
|
7
|
+
*/
|
|
8
|
+
export declare const debouncedSetItem: (key: string, value: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Throttle utility for limiting function execution frequency
|
|
11
|
+
*/
|
|
12
|
+
export declare function throttle<T extends (...args: any[]) => void>(func: T, limit: number): (...args: Parameters<T>) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font preloading utility for better performance
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Preload critical fonts
|
|
6
|
+
*/
|
|
7
|
+
export declare function preloadFonts(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Optimize font loading with font-display: swap
|
|
10
|
+
*/
|
|
11
|
+
export declare function optimizeFontLoading(): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Level and XP calculation utilities for the Strands leveling system
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Calculate XP required for a specific level using the provided formula
|
|
6
|
+
*/
|
|
7
|
+
export declare const getXpForLevel: (level: number) => number;
|
|
8
|
+
/**
|
|
9
|
+
* Calculate the current level from total XP
|
|
10
|
+
*/
|
|
11
|
+
export declare const getLevelFromXp: (totalXp: number) => number;
|
|
12
|
+
/**
|
|
13
|
+
* Calculate the current level from total XP (alias for consistency)
|
|
14
|
+
*/
|
|
15
|
+
export declare const calculateLevel: (totalXp: number) => number;
|
|
16
|
+
/**
|
|
17
|
+
* Calculate XP progress percentage toward the next level
|
|
18
|
+
*/
|
|
19
|
+
export declare const calculateXpProgress: (totalXp: number) => number;
|
|
20
|
+
/**
|
|
21
|
+
* Get the current XP within the current level
|
|
22
|
+
*/
|
|
23
|
+
export declare const getCurrentLevelExp: (totalXp: number) => number;
|
|
24
|
+
/**
|
|
25
|
+
* Get the XP needed to reach the next level
|
|
26
|
+
*/
|
|
27
|
+
export declare const getExpToNextLevel: (totalXp: number) => number;
|