@astralform/ui 0.0.0-stage → 0.3.7-next.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.
- package/DESIGN.md +243 -0
- package/LICENSE +21 -0
- package/README.md +128 -2
- package/dist/components/Alert.d.ts +7 -0
- package/dist/components/Alert.js +40 -0
- package/dist/components/Alert.js.map +1 -0
- package/dist/components/AvatarEditor.d.ts +13 -0
- package/dist/components/AvatarEditor.js +44 -0
- package/dist/components/AvatarEditor.js.map +1 -0
- package/dist/components/Badge.d.ts +16 -0
- package/dist/components/Badge.js +38 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Button.d.ts +8 -0
- package/dist/components/Button.js +21 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Card.d.ts +10 -0
- package/dist/components/Card.js +22 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/CompactResourceRow.d.ts +34 -0
- package/dist/components/CompactResourceRow.js +11 -0
- package/dist/components/CompactResourceRow.js.map +1 -0
- package/dist/components/ConfirmDialog.d.ts +12 -0
- package/dist/components/ConfirmDialog.js +7 -0
- package/dist/components/ConfirmDialog.js.map +1 -0
- package/dist/components/CookieConsent.d.ts +1 -0
- package/dist/components/CookieConsent.js +42 -0
- package/dist/components/CookieConsent.js.map +1 -0
- package/dist/components/DataTable.d.ts +53 -0
- package/dist/components/DataTable.js +79 -0
- package/dist/components/DataTable.js.map +1 -0
- package/dist/components/DevTools.d.ts +6 -0
- package/dist/components/DevTools.js +59 -0
- package/dist/components/DevTools.js.map +1 -0
- package/dist/components/EmptyState.d.ts +11 -0
- package/dist/components/EmptyState.js +6 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/ImageCropModal.d.ts +18 -0
- package/dist/components/ImageCropModal.js +67 -0
- package/dist/components/ImageCropModal.js.map +1 -0
- package/dist/components/InlineBanner.d.ts +20 -0
- package/dist/components/InlineBanner.js +53 -0
- package/dist/components/InlineBanner.js.map +1 -0
- package/dist/components/Input.d.ts +8 -0
- package/dist/components/Input.js +10 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/InventoryCard.d.ts +20 -0
- package/dist/components/InventoryCard.js +22 -0
- package/dist/components/InventoryCard.js.map +1 -0
- package/dist/components/LoadingSpinner.d.ts +26 -0
- package/dist/components/LoadingSpinner.js +32 -0
- package/dist/components/LoadingSpinner.js.map +1 -0
- package/dist/components/Modal.d.ts +10 -0
- package/dist/components/Modal.js +38 -0
- package/dist/components/Modal.js.map +1 -0
- package/dist/components/PageHeader.d.ts +11 -0
- package/dist/components/PageHeader.js +5 -0
- package/dist/components/PageHeader.js.map +1 -0
- package/dist/components/PreviewModal.d.ts +24 -0
- package/dist/components/PreviewModal.js +69 -0
- package/dist/components/PreviewModal.js.map +1 -0
- package/dist/components/ProgressBar.d.ts +8 -0
- package/dist/components/ProgressBar.js +12 -0
- package/dist/components/ProgressBar.js.map +1 -0
- package/dist/components/ProviderIcon.d.ts +7 -0
- package/dist/components/ProviderIcon.js +34 -0
- package/dist/components/ProviderIcon.js.map +1 -0
- package/dist/components/ResizeHandle.d.ts +56 -0
- package/dist/components/ResizeHandle.js +166 -0
- package/dist/components/ResizeHandle.js.map +1 -0
- package/dist/components/SegmentedProgressBar.d.ts +9 -0
- package/dist/components/SegmentedProgressBar.js +23 -0
- package/dist/components/SegmentedProgressBar.js.map +1 -0
- package/dist/components/Select.d.ts +13 -0
- package/dist/components/Select.js +14 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/SpotlightButton.d.ts +10 -0
- package/dist/components/SpotlightButton.js +51 -0
- package/dist/components/SpotlightButton.js.map +1 -0
- package/dist/components/StatCard.d.ts +9 -0
- package/dist/components/StatCard.js +8 -0
- package/dist/components/StatCard.js.map +1 -0
- package/dist/components/StatusBadge.d.ts +4 -0
- package/dist/components/StatusBadge.js +10 -0
- package/dist/components/StatusBadge.js.map +1 -0
- package/dist/components/TabNav.d.ts +39 -0
- package/dist/components/TabNav.js +25 -0
- package/dist/components/TabNav.js.map +1 -0
- package/dist/components/TableShell.d.ts +21 -0
- package/dist/components/TableShell.js +19 -0
- package/dist/components/TableShell.js.map +1 -0
- package/dist/components/Textarea.d.ts +7 -0
- package/dist/components/Textarea.js +10 -0
- package/dist/components/Textarea.js.map +1 -0
- package/dist/components/Toggle.d.ts +16 -0
- package/dist/components/Toggle.js +25 -0
- package/dist/components/Toggle.js.map +1 -0
- package/dist/components/Toolbar.d.ts +34 -0
- package/dist/components/Toolbar.js +30 -0
- package/dist/components/Toolbar.js.map +1 -0
- package/dist/components/TypeToConfirmModal.d.ts +15 -0
- package/dist/components/TypeToConfirmModal.js +14 -0
- package/dist/components/TypeToConfirmModal.js.map +1 -0
- package/dist/components/UnsavedChangesModal.d.ts +7 -0
- package/dist/components/UnsavedChangesModal.js +7 -0
- package/dist/components/UnsavedChangesModal.js.map +1 -0
- package/dist/components/UsageCard.d.ts +11 -0
- package/dist/components/UsageCard.js +9 -0
- package/dist/components/UsageCard.js.map +1 -0
- package/dist/components/avatar.d.ts +79 -0
- package/dist/components/avatar.js +88 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge-config.d.ts +16 -0
- package/dist/components/badge-config.js +48 -0
- package/dist/components/badge-config.js.map +1 -0
- package/dist/components/glowing-effect.d.ts +14 -0
- package/dist/components/glowing-effect.js +108 -0
- package/dist/components/glowing-effect.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cookies.d.ts +36 -0
- package/dist/lib/cookies.js +78 -0
- package/dist/lib/cookies.js.map +1 -0
- package/dist/lib/environment.d.ts +24 -0
- package/dist/lib/environment.js +52 -0
- package/dist/lib/environment.js.map +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.js +8 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/types.d.ts +12 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/package.json +89 -4
- package/src/styles/base.css +779 -0
- package/src/styles/fonts.css +25 -0
- package/src/styles/theme-default.css +164 -0
- package/src/styles/theme-default.generated.css +79 -0
- package/src/styles/tokens/_foundations.css +28 -0
- package/src/styles/tokens/_semantics.css +72 -0
- package/themes/chat.DESIGN.md +197 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { type ComponentType } from "react";
|
|
2
|
+
export declare function getHashColor(str: string): string;
|
|
3
|
+
export declare function getInitials(name?: string | null, email?: string): string;
|
|
4
|
+
export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
5
|
+
interface FallbackContext {
|
|
6
|
+
name?: string | null;
|
|
7
|
+
email?: string;
|
|
8
|
+
size: AvatarSize;
|
|
9
|
+
rounded: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AvatarFallbackProvider {
|
|
12
|
+
render(ctx: FallbackContext): React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const initialsFallback: AvatarFallbackProvider;
|
|
15
|
+
export declare function iconFallback(Icon: ComponentType<{
|
|
16
|
+
size: number;
|
|
17
|
+
weight?: any;
|
|
18
|
+
className?: string;
|
|
19
|
+
}>, variant?: "default" | "accent"): AvatarFallbackProvider;
|
|
20
|
+
export declare const SIZE_CONFIG: {
|
|
21
|
+
readonly xs: {
|
|
22
|
+
readonly container: "h-4 w-4";
|
|
23
|
+
readonly text: "text-[8px]";
|
|
24
|
+
readonly icon: 8;
|
|
25
|
+
};
|
|
26
|
+
readonly sm: {
|
|
27
|
+
readonly container: "h-7 w-7";
|
|
28
|
+
readonly text: "text-xs";
|
|
29
|
+
readonly icon: 14;
|
|
30
|
+
};
|
|
31
|
+
readonly md: {
|
|
32
|
+
readonly container: "h-8 w-8";
|
|
33
|
+
readonly text: "text-sm";
|
|
34
|
+
readonly icon: 16;
|
|
35
|
+
};
|
|
36
|
+
readonly lg: {
|
|
37
|
+
readonly container: "h-12 w-12";
|
|
38
|
+
readonly text: "text-base";
|
|
39
|
+
readonly icon: 24;
|
|
40
|
+
};
|
|
41
|
+
readonly xl: {
|
|
42
|
+
readonly container: "h-16 w-16";
|
|
43
|
+
readonly text: "text-xl";
|
|
44
|
+
readonly icon: 28;
|
|
45
|
+
};
|
|
46
|
+
readonly "2xl": {
|
|
47
|
+
readonly container: "h-20 w-20";
|
|
48
|
+
readonly text: "text-2xl";
|
|
49
|
+
readonly icon: 32;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export type BadgePosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
53
|
+
export declare const BADGE_POSITIONS: Record<BadgePosition, string>;
|
|
54
|
+
export interface AvatarRollConfig {
|
|
55
|
+
onRoll: () => void;
|
|
56
|
+
isRolling?: boolean;
|
|
57
|
+
position?: BadgePosition;
|
|
58
|
+
icon?: ComponentType<{
|
|
59
|
+
size: number;
|
|
60
|
+
className?: string;
|
|
61
|
+
weight?: string;
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
export interface AvatarProps {
|
|
65
|
+
name?: string | null;
|
|
66
|
+
email?: string;
|
|
67
|
+
src?: string | null;
|
|
68
|
+
size?: AvatarSize;
|
|
69
|
+
rounded?: string;
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
className?: string;
|
|
72
|
+
fallback?: AvatarFallbackProvider;
|
|
73
|
+
/** Visual-only "editable" pencil badge (the editor sub-path drives real edits). */
|
|
74
|
+
showEditBadge?: boolean;
|
|
75
|
+
editBadgePosition?: BadgePosition;
|
|
76
|
+
roll?: AvatarRollConfig;
|
|
77
|
+
}
|
|
78
|
+
export declare function Avatar({ name, email, src, size, rounded, disabled, className, fallback, showEditBadge, editBadgePosition, roll, }: AvatarProps): React.JSX.Element;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { DiceFiveIcon, PencilSimpleIcon } from "@phosphor-icons/react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
// =============================================================================
|
|
7
|
+
// Hash-color utilities (exported for external use)
|
|
8
|
+
// =============================================================================
|
|
9
|
+
const AVATAR_COLORS = [
|
|
10
|
+
"#7c3aed", // violet-600
|
|
11
|
+
"#2563eb", // blue-600
|
|
12
|
+
"#059669", // emerald-600
|
|
13
|
+
"#d97706", // amber-600
|
|
14
|
+
"#e11d48", // rose-600
|
|
15
|
+
"#0891b2", // cyan-600
|
|
16
|
+
"#db2777", // pink-600
|
|
17
|
+
"#4f46e5", // indigo-600
|
|
18
|
+
];
|
|
19
|
+
function hashString(str) {
|
|
20
|
+
let hash = 0;
|
|
21
|
+
for (let i = 0; i < str.length; i++) {
|
|
22
|
+
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
|
23
|
+
}
|
|
24
|
+
return hash;
|
|
25
|
+
}
|
|
26
|
+
export function getHashColor(str) {
|
|
27
|
+
return AVATAR_COLORS[Math.abs(hashString(str)) % AVATAR_COLORS.length];
|
|
28
|
+
}
|
|
29
|
+
export function getInitials(name, email) {
|
|
30
|
+
if (name) {
|
|
31
|
+
const parts = name.trim().split(" ");
|
|
32
|
+
if (parts.length >= 2) {
|
|
33
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
34
|
+
}
|
|
35
|
+
return name.slice(0, 2).toUpperCase();
|
|
36
|
+
}
|
|
37
|
+
if (email)
|
|
38
|
+
return email.slice(0, 2).toUpperCase();
|
|
39
|
+
return "?";
|
|
40
|
+
}
|
|
41
|
+
export const initialsFallback = {
|
|
42
|
+
render({ name, email, size, rounded }) {
|
|
43
|
+
const initials = getInitials(name, email);
|
|
44
|
+
const bgColor = getHashColor(name || email || "");
|
|
45
|
+
const cfg = SIZE_CONFIG[size];
|
|
46
|
+
return (_jsx("div", { className: cn("h-full w-full flex items-center justify-center font-semibold text-white", cfg.text, rounded), style: { backgroundColor: bgColor }, children: initials }));
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
export function iconFallback(
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
|
+
Icon, variant = "default") {
|
|
52
|
+
return {
|
|
53
|
+
render({ size, rounded }) {
|
|
54
|
+
const cfg = SIZE_CONFIG[size];
|
|
55
|
+
return (_jsx("div", { className: cn("h-full w-full flex items-center justify-center", variant === "accent"
|
|
56
|
+
? "bg-accent-surface/50 border border-accent-subtle/50"
|
|
57
|
+
: "bg-surface-tertiary", rounded), children: _jsx(Icon, { size: cfg.icon, weight: "duotone", className: variant === "accent" ? "text-accent" : "text-text-tertiary" }) }));
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// =============================================================================
|
|
62
|
+
// Size configuration (exported for the editor sub-path)
|
|
63
|
+
// =============================================================================
|
|
64
|
+
export const SIZE_CONFIG = {
|
|
65
|
+
xs: { container: "h-4 w-4", text: "text-[8px]", icon: 8 },
|
|
66
|
+
sm: { container: "h-7 w-7", text: "text-xs", icon: 14 },
|
|
67
|
+
md: { container: "h-8 w-8", text: "text-sm", icon: 16 },
|
|
68
|
+
lg: { container: "h-12 w-12", text: "text-base", icon: 24 },
|
|
69
|
+
xl: { container: "h-16 w-16", text: "text-xl", icon: 28 },
|
|
70
|
+
"2xl": { container: "h-20 w-20", text: "text-2xl", icon: 32 },
|
|
71
|
+
};
|
|
72
|
+
export const BADGE_POSITIONS = {
|
|
73
|
+
"top-left": "-top-1 -left-1",
|
|
74
|
+
"top-right": "-top-1 -right-1",
|
|
75
|
+
"bottom-left": "-bottom-1 -left-1",
|
|
76
|
+
"bottom-right": "-bottom-1 -right-1",
|
|
77
|
+
};
|
|
78
|
+
export function Avatar({ name, email, src, size = "md", rounded = "rounded-full", disabled, className, fallback = initialsFallback, showEditBadge, editBadgePosition = "bottom-right", roll, }) {
|
|
79
|
+
const [imgError, setImgError] = useState(false);
|
|
80
|
+
const sizeConfig = SIZE_CONFIG[size];
|
|
81
|
+
React.useEffect(() => {
|
|
82
|
+
setImgError(false);
|
|
83
|
+
}, [src]);
|
|
84
|
+
const RollIcon = roll?.icon || DiceFiveIcon;
|
|
85
|
+
const rollPosition = roll?.position || "bottom-right";
|
|
86
|
+
return (_jsxs("div", { className: cn("relative group shrink-0", sizeConfig.container, disabled && "opacity-50", className), children: [_jsx("div", { className: cn("h-full w-full overflow-hidden", rounded), children: src && !imgError ? (_jsx("img", { src: src, alt: name || email || "Avatar", className: cn("h-full w-full object-cover", rounded), onError: () => setImgError(true) })) : (fallback.render({ name, email, size, rounded })) }), showEditBadge && (_jsx("div", { className: cn("absolute z-10 flex items-center justify-center", "rounded-full bg-white border-2 border-surface-secondary h-6 w-6", BADGE_POSITIONS[editBadgePosition]), children: _jsx(PencilSimpleIcon, { size: 12, weight: "bold", className: "text-black" }) })), roll && (_jsx("button", { type: "button", onClick: roll.onRoll, disabled: roll.isRolling, className: cn("absolute z-10 flex items-center justify-center", "rounded-full bg-white border-2 border-surface-secondary h-6 w-6", "hover:bg-zinc-200 transition-colors cursor-pointer disabled:opacity-50", BADGE_POSITIONS[rollPosition]), title: "Randomize avatar", children: _jsx(RollIcon, { size: 12, weight: "bold", className: cn("text-black", roll.isRolling && "animate-spin") }) }))] }));
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../src/components/avatar.tsx"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,gFAAgF;AAChF,mDAAmD;AACnD,gFAAgF;AAEhF,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,aAA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AE,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,GAC7D,GACK,CACV,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Icon as PhosphorIcon } from "@phosphor-icons/react";
|
|
2
|
+
export declare const BadgeCategory: {
|
|
3
|
+
readonly System: "system";
|
|
4
|
+
readonly Capsule: "capsule";
|
|
5
|
+
readonly Shell: "shell";
|
|
6
|
+
readonly Scripts: "scripts";
|
|
7
|
+
readonly Refs: "refs";
|
|
8
|
+
readonly Network: "network";
|
|
9
|
+
};
|
|
10
|
+
export type BadgeCategoryType = (typeof BadgeCategory)[keyof typeof BadgeCategory];
|
|
11
|
+
export type BadgeVariant = "default" | "secondary" | "success" | "warning" | "danger" | "info" | "outline" | "accent";
|
|
12
|
+
export declare const BADGE_CATEGORY_CONFIG: Record<BadgeCategoryType, {
|
|
13
|
+
icon: PhosphorIcon;
|
|
14
|
+
variant: BadgeVariant;
|
|
15
|
+
label: string;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Desktop, Terminal, Code, BookOpen, Globe, GearSix, } from "@phosphor-icons/react";
|
|
2
|
+
/* ------------------------------------------------------------------ */
|
|
3
|
+
/* Badge category enum — consumers import this for type-safe usage */
|
|
4
|
+
/* ------------------------------------------------------------------ */
|
|
5
|
+
export const BadgeCategory = {
|
|
6
|
+
System: "system",
|
|
7
|
+
Capsule: "capsule",
|
|
8
|
+
Shell: "shell",
|
|
9
|
+
Scripts: "scripts",
|
|
10
|
+
Refs: "refs",
|
|
11
|
+
Network: "network",
|
|
12
|
+
};
|
|
13
|
+
/* ------------------------------------------------------------------ */
|
|
14
|
+
/* Category → icon + variant mapping (single source of truth) */
|
|
15
|
+
/* ------------------------------------------------------------------ */
|
|
16
|
+
export const BADGE_CATEGORY_CONFIG = {
|
|
17
|
+
[BadgeCategory.System]: {
|
|
18
|
+
icon: GearSix,
|
|
19
|
+
variant: "secondary",
|
|
20
|
+
label: "System",
|
|
21
|
+
},
|
|
22
|
+
[BadgeCategory.Capsule]: {
|
|
23
|
+
icon: Desktop,
|
|
24
|
+
variant: "secondary",
|
|
25
|
+
label: "Capsule",
|
|
26
|
+
},
|
|
27
|
+
[BadgeCategory.Shell]: {
|
|
28
|
+
icon: Terminal,
|
|
29
|
+
variant: "secondary",
|
|
30
|
+
label: "Shell",
|
|
31
|
+
},
|
|
32
|
+
[BadgeCategory.Scripts]: {
|
|
33
|
+
icon: Code,
|
|
34
|
+
variant: "secondary",
|
|
35
|
+
label: "Scripts",
|
|
36
|
+
},
|
|
37
|
+
[BadgeCategory.Refs]: {
|
|
38
|
+
icon: BookOpen,
|
|
39
|
+
variant: "secondary",
|
|
40
|
+
label: "Refs",
|
|
41
|
+
},
|
|
42
|
+
[BadgeCategory.Network]: {
|
|
43
|
+
icon: Globe,
|
|
44
|
+
variant: "secondary",
|
|
45
|
+
label: "Network",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=badge-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge-config.js","sourceRoot":"","sources":["../../src/components/badge-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,GAER,MAAM,uBAAuB,CAAC;AAE/B,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AAExE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACV,CAAC;AAmBX,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AAExE,MAAM,CAAC,MAAM,qBAAqB,GAG9B;IACF,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;QACtB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,QAAQ;KAChB;IACD,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;QACvB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,SAAS;KACjB;IACD,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;QACrB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,OAAO;KACf;IACD,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;QACvB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,SAAS;KACjB;IACD,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,MAAM;KACd;IACD,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;QACvB,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,SAAS;KACjB;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface GlowingEffectProps {
|
|
2
|
+
blur?: number;
|
|
3
|
+
inactiveZone?: number;
|
|
4
|
+
proximity?: number;
|
|
5
|
+
spread?: number;
|
|
6
|
+
variant?: "default" | "white";
|
|
7
|
+
glow?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
movementDuration?: number;
|
|
11
|
+
borderWidth?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const GlowingEffect: import("react").MemoExoticComponent<({ blur, inactiveZone, proximity, spread, variant, glow, className, movementDuration, borderWidth, disabled, }: GlowingEffectProps) => import("react").JSX.Element>;
|
|
14
|
+
export { GlowingEffect };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useCallback, useEffect, useRef } from "react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
import { animate } from "motion/react";
|
|
5
|
+
function setCSSVar(el, name, value) {
|
|
6
|
+
el.style.setProperty(name, value);
|
|
7
|
+
}
|
|
8
|
+
function getCSSVar(el, name) {
|
|
9
|
+
return el.style.getPropertyValue(name);
|
|
10
|
+
}
|
|
11
|
+
const GlowingEffect = memo(({ blur = 0, inactiveZone = 0.7, proximity = 0, spread = 20, variant = "default", glow = false, className, movementDuration = 2, borderWidth = 1, disabled = true, }) => {
|
|
12
|
+
const containerRef = useRef(null);
|
|
13
|
+
const lastPosition = useRef({ x: 0, y: 0 });
|
|
14
|
+
const animationFrameRef = useRef(0);
|
|
15
|
+
const prefersReducedMotion = useRef(typeof window !== "undefined" &&
|
|
16
|
+
window.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
17
|
+
const handleMove = useCallback((e) => {
|
|
18
|
+
if (!containerRef.current || prefersReducedMotion.current)
|
|
19
|
+
return;
|
|
20
|
+
if (animationFrameRef.current) {
|
|
21
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
22
|
+
}
|
|
23
|
+
animationFrameRef.current = requestAnimationFrame(() => {
|
|
24
|
+
const element = containerRef.current;
|
|
25
|
+
if (!element)
|
|
26
|
+
return;
|
|
27
|
+
const { left, top, width, height } = element.getBoundingClientRect();
|
|
28
|
+
const mouseX = e?.x ?? lastPosition.current.x;
|
|
29
|
+
const mouseY = e?.y ?? lastPosition.current.y;
|
|
30
|
+
if (e) {
|
|
31
|
+
lastPosition.current = { x: mouseX, y: mouseY };
|
|
32
|
+
}
|
|
33
|
+
const center = [left + width * 0.5, top + height * 0.5];
|
|
34
|
+
const distanceFromCenter = Math.hypot(mouseX - center[0], mouseY - center[1]);
|
|
35
|
+
const inactiveRadius = 0.5 * Math.min(width, height) * inactiveZone;
|
|
36
|
+
if (distanceFromCenter < inactiveRadius) {
|
|
37
|
+
setCSSVar(element, "--active", "0");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const isActive = mouseX > left - proximity &&
|
|
41
|
+
mouseX < left + width + proximity &&
|
|
42
|
+
mouseY > top - proximity &&
|
|
43
|
+
mouseY < top + height + proximity;
|
|
44
|
+
setCSSVar(element, "--active", isActive ? "1" : "0");
|
|
45
|
+
if (!isActive)
|
|
46
|
+
return;
|
|
47
|
+
const currentAngle = parseFloat(getCSSVar(element, "--start")) || 0;
|
|
48
|
+
const targetAngle = (180 * Math.atan2(mouseY - center[1], mouseX - center[0])) /
|
|
49
|
+
Math.PI +
|
|
50
|
+
90;
|
|
51
|
+
const angleDiff = ((targetAngle - currentAngle + 180) % 360) - 180;
|
|
52
|
+
const newAngle = currentAngle + angleDiff;
|
|
53
|
+
animate(currentAngle, newAngle, {
|
|
54
|
+
duration: movementDuration,
|
|
55
|
+
ease: [0.16, 1, 0.3, 1],
|
|
56
|
+
onUpdate: (value) => {
|
|
57
|
+
setCSSVar(element, "--start", String(value));
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}, [inactiveZone, proximity, movementDuration]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (disabled)
|
|
64
|
+
return;
|
|
65
|
+
const handleScroll = () => handleMove();
|
|
66
|
+
const handlePointerMove = (e) => handleMove(e);
|
|
67
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
68
|
+
document.body.addEventListener("pointermove", handlePointerMove, {
|
|
69
|
+
passive: true,
|
|
70
|
+
});
|
|
71
|
+
return () => {
|
|
72
|
+
if (animationFrameRef.current) {
|
|
73
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
74
|
+
}
|
|
75
|
+
window.removeEventListener("scroll", handleScroll);
|
|
76
|
+
document.body.removeEventListener("pointermove", handlePointerMove);
|
|
77
|
+
};
|
|
78
|
+
}, [handleMove, disabled]);
|
|
79
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity", glow && "opacity-100", variant === "white" && "border-white", disabled && "!block") }), _jsx("div", { ref: containerRef, style: {
|
|
80
|
+
"--blur": `${blur}px`,
|
|
81
|
+
"--spread": spread,
|
|
82
|
+
"--start": "0",
|
|
83
|
+
"--active": "0",
|
|
84
|
+
"--glowingeffect-border-width": `${borderWidth}px`,
|
|
85
|
+
"--repeating-conic-gradient-times": "5",
|
|
86
|
+
"--gradient": variant === "white"
|
|
87
|
+
? `repeating-conic-gradient(
|
|
88
|
+
from 236.84deg at 50% 50%,
|
|
89
|
+
var(--black),
|
|
90
|
+
var(--black) calc(25% / var(--repeating-conic-gradient-times))
|
|
91
|
+
)`
|
|
92
|
+
: `radial-gradient(circle, #dd7bbb 10%, #dd7bbb00 20%),
|
|
93
|
+
radial-gradient(circle at 40% 40%, #d79f1e 5%, #d79f1e00 15%),
|
|
94
|
+
radial-gradient(circle at 60% 60%, #5a922c 10%, #5a922c00 20%),
|
|
95
|
+
radial-gradient(circle at 40% 60%, #4c7894 10%, #4c789400 20%),
|
|
96
|
+
repeating-conic-gradient(
|
|
97
|
+
from 236.84deg at 50% 50%,
|
|
98
|
+
#dd7bbb 0%,
|
|
99
|
+
#d79f1e calc(25% / var(--repeating-conic-gradient-times)),
|
|
100
|
+
#5a922c calc(50% / var(--repeating-conic-gradient-times)),
|
|
101
|
+
#4c7894 calc(75% / var(--repeating-conic-gradient-times)),
|
|
102
|
+
#dd7bbb calc(100% / var(--repeating-conic-gradient-times))
|
|
103
|
+
)`,
|
|
104
|
+
}, className: cn("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity", glow && "opacity-100", blur > 0 && "blur-[var(--blur)] ", className, disabled && "!hidden"), children: _jsx("div", { className: cn("glow", "rounded-[inherit]", 'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]', "after:[border:var(--glowingeffect-border-width)_solid_transparent]", "after:[background:var(--gradient)] after:[background-attachment:fixed]", "after:opacity-[var(--active)] after:transition-opacity after:duration-300", "after:[mask-clip:padding-box,border-box]", "after:[mask-composite:intersect]", "after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]") }) })] }));
|
|
105
|
+
});
|
|
106
|
+
GlowingEffect.displayName = "GlowingEffect";
|
|
107
|
+
export { GlowingEffect };
|
|
108
|
+
//# sourceMappingURL=glowing-effect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glowing-effect.js","sourceRoot":"","sources":["../../src/components/glowing-effect.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,SAAS,SAAS,CAAC,EAAe,EAAE,IAAY,EAAE,KAAa;IAC7D,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,EAAe,EAAE,IAAY;IAC9C,OAAO,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAeD,MAAM,aAAa,GAAG,IAAI,CACxB,CAAC,EACC,IAAI,GAAG,CAAC,EACR,YAAY,GAAG,GAAG,EAClB,SAAS,GAAG,CAAC,EACb,MAAM,GAAG,EAAE,EACX,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,gBAAgB,GAAG,CAAC,EACpB,WAAW,GAAG,CAAC,EACf,QAAQ,GAAG,IAAI,GACI,EAAE,EAAE;IACvB,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE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ACjB,KAAK,EACH;oBACE,QAAQ,EAAE,GAAG,IAAI,IAAI;oBACrB,UAAU,EAAE,MAAM;oBAClB,SAAS,EAAE,GAAG;oBACd,UAAU,EAAE,GAAG;oBACf,8BAA8B,EAAE,GAAG,WAAW,IAAI;oBAClD,kCAAkC,EAAE,GAAG;oBACvC,YAAY,EACV,OAAO,KAAK,OAAO;wBACjB,CAAC,CAAC;;;;kBAIF;wBACA,CAAC,CAAC;;;;;;;;;;;kBAWF;iBACkB,EAE1B,SAAS,EAAE,EAAE,CACX,uFAAuF,EACvF,IAAI,IAAI,aAAa,EACrB,IAAI,GAAG,CAAC,IAAI,qBAAqB,EACjC,SAAS,EACT,QAAQ,IAAI,SAAS,CACtB,YAED,cACE,SAAS,EAAE,EAAE,CACX,MAAM,EACN,mBAAmB,EACnB,oHAAoH,EACpH,oEAAoE,EACpE,wEAAwE,EACxE,2EAA2E,EAC3E,0CAA0C,EAC1C,kCAAkC,EAClC,qKAAqK,CACtK,GACD,GACE,IACL,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { Button } from "./components/Button";
|
|
2
|
+
export { Input } from "./components/Input";
|
|
3
|
+
export { Textarea } from "./components/Textarea";
|
|
4
|
+
export { Toggle } from "./components/Toggle";
|
|
5
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, } from "./components/Card";
|
|
6
|
+
export { Modal } from "./components/Modal";
|
|
7
|
+
export { Badge } from "./components/Badge";
|
|
8
|
+
export { BadgeCategory, BADGE_CATEGORY_CONFIG, } from "./components/badge-config";
|
|
9
|
+
export type { BadgeCategoryType } from "./components/badge-config";
|
|
10
|
+
export { Select } from "./components/Select";
|
|
11
|
+
export { Alert } from "./components/Alert";
|
|
12
|
+
export { InlineBanner } from "./components/InlineBanner";
|
|
13
|
+
export type { InlineBannerProps } from "./components/InlineBanner";
|
|
14
|
+
export { PageHeader } from "./components/PageHeader";
|
|
15
|
+
export { StatCard } from "./components/StatCard";
|
|
16
|
+
export { LoadingSpinner, InlineSpinner, PageSpinner, } from "./components/LoadingSpinner";
|
|
17
|
+
export { ProviderIcon } from "./components/ProviderIcon";
|
|
18
|
+
export { EmptyState } from "./components/EmptyState";
|
|
19
|
+
export { InventoryCard } from "./components/InventoryCard";
|
|
20
|
+
export { CompactResourceRow } from "./components/CompactResourceRow";
|
|
21
|
+
export { ConfirmDialog } from "./components/ConfirmDialog";
|
|
22
|
+
export { StatusBadge } from "./components/StatusBadge";
|
|
23
|
+
export { PreviewModal, MarkdownContent } from "./components/PreviewModal";
|
|
24
|
+
export { GlowingEffect } from "./components/glowing-effect";
|
|
25
|
+
export { Avatar, getHashColor, getInitials, initialsFallback, iconFallback, } from "./components/avatar";
|
|
26
|
+
export type { AvatarFallbackProvider } from "./components/avatar";
|
|
27
|
+
export { TypeToConfirmModal } from "./components/TypeToConfirmModal";
|
|
28
|
+
export { UnsavedChangesModal } from "./components/UnsavedChangesModal";
|
|
29
|
+
export { TabNav } from "./components/TabNav";
|
|
30
|
+
export { ProgressBar } from "./components/ProgressBar";
|
|
31
|
+
export { SegmentedProgressBar } from "./components/SegmentedProgressBar";
|
|
32
|
+
export { UsageCard } from "./components/UsageCard";
|
|
33
|
+
export { TableShell, TablePagination } from "./components/TableShell";
|
|
34
|
+
export { Toolbar, ToolbarSearch, ToolbarSelect, ToolbarButton, } from "./components/Toolbar";
|
|
35
|
+
export { SpotlightButton } from "./components/SpotlightButton";
|
|
36
|
+
export { CookieConsent } from "./components/CookieConsent";
|
|
37
|
+
export { DevTools } from "./components/DevTools";
|
|
38
|
+
export { ResizeHandle } from "./components/ResizeHandle";
|
|
39
|
+
export type { ResizeHandleProps } from "./components/ResizeHandle";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export { Button } from "./components/Button";
|
|
2
|
+
export { Input } from "./components/Input";
|
|
3
|
+
export { Textarea } from "./components/Textarea";
|
|
4
|
+
export { Toggle } from "./components/Toggle";
|
|
5
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, } from "./components/Card";
|
|
6
|
+
export { Modal } from "./components/Modal";
|
|
7
|
+
export { Badge } from "./components/Badge";
|
|
8
|
+
export { BadgeCategory, BADGE_CATEGORY_CONFIG, } from "./components/badge-config";
|
|
9
|
+
export { Select } from "./components/Select";
|
|
10
|
+
export { Alert } from "./components/Alert";
|
|
11
|
+
export { InlineBanner } from "./components/InlineBanner";
|
|
12
|
+
export { PageHeader } from "./components/PageHeader";
|
|
13
|
+
export { StatCard } from "./components/StatCard";
|
|
14
|
+
// DataTable lives at the "@astralform/ui/data-table" sub-path — it pulls the
|
|
15
|
+
// optional @tanstack/react-table peer, so it stays out of the main barrel to keep
|
|
16
|
+
// the core import peer-clean for consumers that don't use tables.
|
|
17
|
+
export { LoadingSpinner, InlineSpinner, PageSpinner, } from "./components/LoadingSpinner";
|
|
18
|
+
export { ProviderIcon } from "./components/ProviderIcon";
|
|
19
|
+
export { EmptyState } from "./components/EmptyState";
|
|
20
|
+
export { InventoryCard } from "./components/InventoryCard";
|
|
21
|
+
export { CompactResourceRow } from "./components/CompactResourceRow";
|
|
22
|
+
export { ConfirmDialog } from "./components/ConfirmDialog";
|
|
23
|
+
export { StatusBadge } from "./components/StatusBadge";
|
|
24
|
+
export { PreviewModal, MarkdownContent } from "./components/PreviewModal";
|
|
25
|
+
// ImageCropModal + the editable Avatar live at "@astralform/ui/avatar-editor"
|
|
26
|
+
// (they pull react-easy-crop + sonner) — kept out of the core barrel so
|
|
27
|
+
// display-only consumers don't carry those deps.
|
|
28
|
+
export { GlowingEffect } from "./components/glowing-effect";
|
|
29
|
+
export { Avatar, getHashColor, getInitials, initialsFallback, iconFallback, } from "./components/avatar";
|
|
30
|
+
export { TypeToConfirmModal } from "./components/TypeToConfirmModal";
|
|
31
|
+
export { UnsavedChangesModal } from "./components/UnsavedChangesModal";
|
|
32
|
+
export { TabNav } from "./components/TabNav";
|
|
33
|
+
export { ProgressBar } from "./components/ProgressBar";
|
|
34
|
+
export { SegmentedProgressBar } from "./components/SegmentedProgressBar";
|
|
35
|
+
export { UsageCard } from "./components/UsageCard";
|
|
36
|
+
export { TableShell, TablePagination } from "./components/TableShell";
|
|
37
|
+
export { Toolbar, ToolbarSearch, ToolbarSelect, ToolbarButton, } from "./components/Toolbar";
|
|
38
|
+
export { SpotlightButton } from "./components/SpotlightButton";
|
|
39
|
+
export { CookieConsent } from "./components/CookieConsent";
|
|
40
|
+
export { DevTools } from "./components/DevTools";
|
|
41
|
+
export { ResizeHandle } from "./components/ResizeHandle";
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,aAAa,EACb,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,UAA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AE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie consent management for GDPR compliance
|
|
3
|
+
*/
|
|
4
|
+
export type ConsentStatus = "pending" | "accepted" | "rejected";
|
|
5
|
+
/**
|
|
6
|
+
* Check if dev mode ignores saved consent (for testing)
|
|
7
|
+
*/
|
|
8
|
+
export declare function isDevIgnoreConsentEnabled(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Toggle dev ignore consent mode
|
|
11
|
+
*/
|
|
12
|
+
export declare function setDevIgnoreConsent(enabled: boolean): void;
|
|
13
|
+
/**
|
|
14
|
+
* Get current consent status
|
|
15
|
+
*/
|
|
16
|
+
export declare function getConsentStatus(): ConsentStatus;
|
|
17
|
+
/**
|
|
18
|
+
* Check if user has made a consent choice
|
|
19
|
+
*/
|
|
20
|
+
export declare function hasConsentChoice(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Accept cookies
|
|
23
|
+
*/
|
|
24
|
+
export declare function acceptCookies(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Reject non-essential cookies
|
|
27
|
+
*/
|
|
28
|
+
export declare function rejectCookies(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Reset consent (for testing)
|
|
31
|
+
*/
|
|
32
|
+
export declare function resetConsent(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Check if analytics/tracking is allowed
|
|
35
|
+
*/
|
|
36
|
+
export declare function isAnalyticsAllowed(): boolean;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie consent management for GDPR compliance
|
|
3
|
+
*/
|
|
4
|
+
const CONSENT_KEY = "astralform_cookie_consent";
|
|
5
|
+
const DEV_IGNORE_KEY = "astralform_dev_ignore_consent";
|
|
6
|
+
/**
|
|
7
|
+
* Check if dev mode ignores saved consent (for testing)
|
|
8
|
+
*/
|
|
9
|
+
export function isDevIgnoreConsentEnabled() {
|
|
10
|
+
return localStorage.getItem(DEV_IGNORE_KEY) === "true";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Toggle dev ignore consent mode
|
|
14
|
+
*/
|
|
15
|
+
export function setDevIgnoreConsent(enabled) {
|
|
16
|
+
if (enabled) {
|
|
17
|
+
localStorage.setItem(DEV_IGNORE_KEY, "true");
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
localStorage.removeItem(DEV_IGNORE_KEY);
|
|
21
|
+
}
|
|
22
|
+
window.dispatchEvent(new CustomEvent("consentSettingsChange", {
|
|
23
|
+
detail: { devIgnore: enabled },
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get current consent status
|
|
28
|
+
*/
|
|
29
|
+
export function getConsentStatus() {
|
|
30
|
+
// In dev mode with ignore enabled, always show as pending
|
|
31
|
+
if (isDevIgnoreConsentEnabled()) {
|
|
32
|
+
return "pending";
|
|
33
|
+
}
|
|
34
|
+
const stored = localStorage.getItem(CONSENT_KEY);
|
|
35
|
+
if (stored === "accepted")
|
|
36
|
+
return "accepted";
|
|
37
|
+
if (stored === "rejected")
|
|
38
|
+
return "rejected";
|
|
39
|
+
return "pending";
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Check if user has made a consent choice
|
|
43
|
+
*/
|
|
44
|
+
export function hasConsentChoice() {
|
|
45
|
+
if (isDevIgnoreConsentEnabled()) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const stored = localStorage.getItem(CONSENT_KEY);
|
|
49
|
+
return stored === "accepted" || stored === "rejected";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Accept cookies
|
|
53
|
+
*/
|
|
54
|
+
export function acceptCookies() {
|
|
55
|
+
localStorage.setItem(CONSENT_KEY, "accepted");
|
|
56
|
+
window.dispatchEvent(new CustomEvent("consentChange", { detail: "accepted" }));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Reject non-essential cookies
|
|
60
|
+
*/
|
|
61
|
+
export function rejectCookies() {
|
|
62
|
+
localStorage.setItem(CONSENT_KEY, "rejected");
|
|
63
|
+
window.dispatchEvent(new CustomEvent("consentChange", { detail: "rejected" }));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Reset consent (for testing)
|
|
67
|
+
*/
|
|
68
|
+
export function resetConsent() {
|
|
69
|
+
localStorage.removeItem(CONSENT_KEY);
|
|
70
|
+
window.dispatchEvent(new CustomEvent("consentChange", { detail: "pending" }));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Check if analytics/tracking is allowed
|
|
74
|
+
*/
|
|
75
|
+
export function isAnalyticsAllowed() {
|
|
76
|
+
return getConsentStatus() === "accepted";
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=cookies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../src/lib/cookies.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,GAAG,2BAA2B,CAAC;AAChD,MAAM,cAAc,GAAG,+BAA+B,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,MAAM,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,IAAI,OAAO,EAAE,CAAC;QACZ,YAAY,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,YAAY,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,CAAC,aAAa,C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ACrC,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,gBAAgB,EAAE,KAAK,UAAU,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment detection for feature flags
|
|
3
|
+
* - "local": localhost development (direct login allowed)
|
|
4
|
+
* - "production": production site (waitlist/invite required)
|
|
5
|
+
*/
|
|
6
|
+
export type Environment = "local" | "production";
|
|
7
|
+
/**
|
|
8
|
+
* Get the actual environment based on hostname
|
|
9
|
+
*/
|
|
10
|
+
export declare function getActualEnvironment(): Environment;
|
|
11
|
+
/**
|
|
12
|
+
* Check if production preview mode is enabled (dev only)
|
|
13
|
+
*/
|
|
14
|
+
export declare function isPreviewModeEnabled(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Toggle production preview mode (dev only)
|
|
17
|
+
*/
|
|
18
|
+
export declare function setPreviewMode(enabled: boolean): void;
|
|
19
|
+
/**
|
|
20
|
+
* Get the effective environment (respects preview mode)
|
|
21
|
+
*/
|
|
22
|
+
export declare function getEnvironment(): Environment;
|
|
23
|
+
export declare function isLocalEnvironment(): boolean;
|
|
24
|
+
export declare function isProductionEnvironment(): boolean;
|