@strands.gg/accui 2.8.0 → 2.9.0

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.
Files changed (70) hide show
  1. package/dist/index.d.ts +3 -17
  2. package/dist/nuxt/module.d.ts +4 -5
  3. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.d.ts +20 -0
  4. package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts +65 -0
  5. package/dist/nuxt/runtime/middleware/auth.d.ts +6 -0
  6. package/dist/nuxt/runtime/middleware/auth.global.d.ts +2 -0
  7. package/dist/nuxt/runtime/middleware/guest.d.ts +6 -0
  8. package/dist/nuxt/runtime/plugin.client.d.ts +2 -0
  9. package/dist/nuxt/runtime/plugin.server.d.ts +2 -0
  10. package/dist/nuxt/runtime/plugins/auth-interceptor.client.d.ts +2 -0
  11. package/dist/nuxt/types.d.ts +45 -0
  12. package/dist/nuxt.d.ts +3 -1
  13. package/dist/shared/defaults.d.ts +2 -0
  14. package/dist/types/composables.d.ts +96 -0
  15. package/dist/types/index.d.ts +210 -260
  16. package/dist/utils/colors.d.ts +10 -0
  17. package/dist/utils/index.d.ts +2 -0
  18. package/dist/utils/slots.d.ts +1 -0
  19. package/dist/utils/validation.d.ts +12 -0
  20. package/dist/vue/components/StrandsNav/index.d.ts +8 -0
  21. package/dist/vue/components/StrandsNav/types.d.ts +12 -0
  22. package/dist/vue/components/icons/index.d.ts +2 -0
  23. package/dist/vue/components/index.d.ts +27 -0
  24. package/dist/vue/composables/useAuthenticatedFetch.d.ts +20 -0
  25. package/dist/vue/composables/useDarkMode.d.ts +48 -0
  26. package/dist/vue/composables/useFloatingPosition.d.ts +22 -0
  27. package/dist/vue/composables/useModalStack.d.ts +86 -0
  28. package/dist/vue/composables/useOAuthProviders.d.ts +73 -0
  29. package/dist/vue/composables/useStrandsAuth.d.ts +2 -0
  30. package/dist/vue/composables/useStrandsConfig.d.ts +5 -0
  31. package/dist/vue/composables/useStrandsMfa.d.ts +36 -0
  32. package/dist/vue/composables/useTheme.d.ts +18 -0
  33. package/dist/vue/index.d.ts +16 -0
  34. package/dist/vue/plugins/StrandsUIPlugin.d.ts +20 -0
  35. package/dist/vue/ui/UiButton/index.d.ts +13 -0
  36. package/dist/vue/ui/index.d.ts +54 -0
  37. package/dist/vue/utils/contrast.d.ts +75 -0
  38. package/dist/vue/utils/debounce.d.ts +12 -0
  39. package/dist/vue/utils/fontPreloader.d.ts +11 -0
  40. package/dist/vue/utils/iconProps.d.ts +9 -0
  41. package/dist/vue/utils/lazyComponents.d.ts +4 -0
  42. package/dist/vue/utils/levels.d.ts +27 -0
  43. package/dist/vue/utils/modalStack.d.ts +31 -0
  44. package/dist/vue/utils/performanceInit.d.ts +40 -0
  45. package/dist/vue/utils/requestCache.d.ts +49 -0
  46. package/dist/vue/utils/sounds.d.ts +57 -0
  47. package/package.json +2 -3
  48. package/dist/accui.css +0 -1
  49. package/dist/index.cjs.js +0 -1
  50. package/dist/index.es.js +0 -40821
  51. package/dist/nuxt/module.cjs.js +0 -1
  52. package/dist/nuxt/module.es.js +0 -193
  53. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.cjs.js +0 -1
  54. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.es.js +0 -134
  55. package/dist/nuxt/runtime/composables/useStrandsAuth.cjs.js +0 -1
  56. package/dist/nuxt/runtime/composables/useStrandsAuth.es.js +0 -56
  57. package/dist/nuxt/runtime/middleware/auth.global.cjs.js +0 -1
  58. package/dist/nuxt/runtime/middleware/auth.global.es.js +0 -54
  59. package/dist/nuxt/runtime/plugin.client.cjs.js +0 -1
  60. package/dist/nuxt/runtime/plugin.client.es.js +0 -26
  61. package/dist/nuxt/runtime/plugin.server.cjs.js +0 -1
  62. package/dist/nuxt/runtime/plugin.server.es.js +0 -17
  63. package/dist/nuxt/runtime/plugins/auth-interceptor.client.cjs.js +0 -1
  64. package/dist/nuxt/runtime/plugins/auth-interceptor.client.es.js +0 -77
  65. package/dist/nuxt.cjs.js +0 -1
  66. package/dist/nuxt.es.js +0 -11
  67. package/dist/useStrandsAuth-Ca9Zqmfy.cjs.js +0 -1
  68. package/dist/useStrandsAuth-jI_X_wiK.es.js +0 -916
  69. package/dist/useStrandsConfig-CLSzvTvE.cjs.js +0 -1
  70. package/dist/useStrandsConfig-XmPqJn_B.es.js +0 -241
@@ -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,2 @@
1
+ import type { UseStrandsAuthReturn } from '../../types';
2
+ export declare function useStrandsAuth(): UseStrandsAuthReturn;
@@ -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,9 @@
1
+ /**
2
+ * Standard props for icon components
3
+ */
4
+ export declare const iconProps: {
5
+ size: {
6
+ type: (StringConstructor | NumberConstructor)[];
7
+ default: number;
8
+ };
9
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Lazy loading configuration for heavy components
3
+ */
4
+ export declare const preloadCriticalComponents: () => 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;
@@ -0,0 +1,31 @@
1
+ export interface ModalInstance {
2
+ id: symbol;
3
+ closeModal: () => void;
4
+ closeOnEscape: boolean;
5
+ zIndex: number;
6
+ component?: string;
7
+ priority?: 'low' | 'normal' | 'high' | 'critical';
8
+ }
9
+ export interface ModalStackState {
10
+ modals: ModalInstance[];
11
+ topModal: ModalInstance | null;
12
+ hasModals: boolean;
13
+ highestZIndex: number;
14
+ }
15
+ declare class ModalStack {
16
+ private stack;
17
+ private escapeHandlerRegistered;
18
+ private baseZIndex;
19
+ private subscribers;
20
+ private handleEscape;
21
+ private calculateZIndex;
22
+ private notifySubscribers;
23
+ add(modal: Omit<ModalInstance, 'zIndex'>): ModalInstance;
24
+ remove(modalId: symbol): void;
25
+ subscribe(callback: (state: ModalStackState) => void): () => void;
26
+ get length(): number;
27
+ get state(): ModalStackState;
28
+ cleanup(): void;
29
+ }
30
+ export declare const modalStack: ModalStack;
31
+ export {};
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Performance initialization utility
3
+ * Optimizes loading and runtime performance
4
+ */
5
+ /**
6
+ * Initialize all performance optimizations
7
+ */
8
+ export declare function initializePerformanceOptimizations(): void;
9
+ /**
10
+ * Optimize runtime performance
11
+ */
12
+ export declare function optimizeRuntimePerformance(): void;
13
+ /**
14
+ * Cleanup performance optimizations
15
+ */
16
+ export declare function cleanupPerformanceOptimizations(): void;
17
+ /**
18
+ * Get performance metrics
19
+ */
20
+ export declare function getPerformanceMetrics(): {
21
+ domContentLoaded?: undefined;
22
+ loadComplete?: undefined;
23
+ dns?: undefined;
24
+ tcp?: undefined;
25
+ ttfb?: undefined;
26
+ domInteractive?: undefined;
27
+ memoryUsage?: undefined;
28
+ } | {
29
+ domContentLoaded: number;
30
+ loadComplete: number;
31
+ dns: number;
32
+ tcp: number;
33
+ ttfb: number;
34
+ domInteractive: number;
35
+ memoryUsage: {
36
+ used: any;
37
+ total: any;
38
+ limit: any;
39
+ };
40
+ };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Request deduplication and caching utility
3
+ * Prevents duplicate API calls and provides simple caching
4
+ */
5
+ declare class RequestCache {
6
+ private cache;
7
+ private readonly DEFAULT_TTL;
8
+ /**
9
+ * Memoized fetch - prevents duplicate requests and caches results
10
+ */
11
+ fetch<T>(key: string, fetcher: () => Promise<T>, ttl?: number): Promise<T>;
12
+ /**
13
+ * Clear all cached entries
14
+ */
15
+ clear(): void;
16
+ /**
17
+ * Remove a specific cache entry
18
+ */
19
+ invalidate(key: string): void;
20
+ /**
21
+ * Clean expired cache entries
22
+ */
23
+ private cleanExpired;
24
+ /**
25
+ * Get cache statistics (for debugging)
26
+ */
27
+ getStats(): {
28
+ size: number;
29
+ entries: string[];
30
+ };
31
+ }
32
+ export declare const requestCache: RequestCache;
33
+ /**
34
+ * Composable for request deduplication
35
+ */
36
+ export declare function useRequestCache(): {
37
+ fetch: <T>(key: string, fetcher: () => Promise<T>, ttl?: number) => Promise<T>;
38
+ clear: () => void;
39
+ invalidate: (key: string) => void;
40
+ getStats: () => {
41
+ size: number;
42
+ entries: string[];
43
+ };
44
+ };
45
+ /**
46
+ * Generate cache key from URL and options
47
+ */
48
+ export declare function getCacheKey(url: string, options?: RequestInit): string;
49
+ export {};