@devfellowship/components 0.1.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.
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/providers/index.ts
21
+ var providers_exports = {};
22
+ __export(providers_exports, {
23
+ AuthProvider: () => AuthProvider,
24
+ FeatureFlagProvider: () => FeatureFlagProvider,
25
+ useAuth: () => useAuth,
26
+ useFeatureFlag: () => useFeatureFlag,
27
+ useFeatureFlags: () => useFeatureFlags,
28
+ useSession: () => useSession
29
+ });
30
+ module.exports = __toCommonJS(providers_exports);
31
+
32
+ // src/hooks/use-auth.tsx
33
+ var import_react = require("react");
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var AuthContext = (0, import_react.createContext)(void 0);
36
+ var AuthProvider = ({
37
+ children,
38
+ supabase,
39
+ profilesTable = "profiles"
40
+ }) => {
41
+ const [user, setUser] = (0, import_react.useState)(null);
42
+ const [session, setSession] = (0, import_react.useState)(null);
43
+ const [profile, setProfile] = (0, import_react.useState)(null);
44
+ const [profileLoading, setProfileLoading] = (0, import_react.useState)(false);
45
+ const [authLoading, setAuthLoading] = (0, import_react.useState)(true);
46
+ const userRef = (0, import_react.useRef)(null);
47
+ const isLoading = authLoading || profileLoading;
48
+ (0, import_react.useEffect)(() => {
49
+ userRef.current = user;
50
+ }, [user]);
51
+ const fetchProfile = (0, import_react.useCallback)(
52
+ async (userId) => {
53
+ try {
54
+ const { data, error } = await supabase.from(profilesTable).select("*").eq("id", userId).single();
55
+ if (error) throw error;
56
+ setProfile(data);
57
+ } catch {
58
+ setProfile(null);
59
+ }
60
+ },
61
+ [supabase, profilesTable]
62
+ );
63
+ const refreshProfile = (0, import_react.useCallback)(async () => {
64
+ if (userRef.current) {
65
+ await fetchProfile(userRef.current.id);
66
+ }
67
+ }, [fetchProfile]);
68
+ (0, import_react.useEffect)(() => {
69
+ supabase.auth.getSession().then(({ data: { session: s } }) => {
70
+ setSession(s);
71
+ setUser(s?.user ?? null);
72
+ setAuthLoading(false);
73
+ });
74
+ const { data: { subscription } } = supabase.auth.onAuthStateChange(
75
+ (_event, s) => {
76
+ setSession(s);
77
+ setUser(s?.user ?? null);
78
+ }
79
+ );
80
+ return () => subscription.unsubscribe();
81
+ }, [supabase]);
82
+ (0, import_react.useEffect)(() => {
83
+ if (user) {
84
+ setProfileLoading(true);
85
+ fetchProfile(user.id).finally(() => setProfileLoading(false));
86
+ } else {
87
+ setProfile(null);
88
+ }
89
+ }, [user?.id, fetchProfile]);
90
+ const login = (0, import_react.useCallback)(
91
+ async (email, password) => {
92
+ const { error } = await supabase.auth.signInWithPassword({ email, password });
93
+ return { error };
94
+ },
95
+ [supabase]
96
+ );
97
+ const signup = (0, import_react.useCallback)(
98
+ async (email, password) => {
99
+ const { error } = await supabase.auth.signUp({ email, password });
100
+ return { error };
101
+ },
102
+ [supabase]
103
+ );
104
+ const logout = (0, import_react.useCallback)(async () => {
105
+ await supabase.auth.signOut();
106
+ }, [supabase]);
107
+ const value = (0, import_react.useMemo)(
108
+ () => ({
109
+ user,
110
+ session,
111
+ profile,
112
+ isLoading,
113
+ login,
114
+ signup,
115
+ logout,
116
+ refreshProfile
117
+ }),
118
+ [user, session, profile, isLoading, login, signup, logout, refreshProfile]
119
+ );
120
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AuthContext.Provider, { value, children });
121
+ };
122
+ var useAuth = () => {
123
+ const ctx = (0, import_react.useContext)(AuthContext);
124
+ if (!ctx) throw new Error("useAuth must be used within an AuthProvider");
125
+ return ctx;
126
+ };
127
+ var useSession = () => {
128
+ const { session } = useAuth();
129
+ return session;
130
+ };
131
+
132
+ // src/providers/feature-flag-provider.tsx
133
+ var import_react2 = require("react");
134
+ var import_jsx_runtime2 = require("react/jsx-runtime");
135
+ var FeatureFlagContext = (0, import_react2.createContext)({
136
+ flags: {},
137
+ isEnabled: () => false
138
+ });
139
+ var FeatureFlagProvider = ({
140
+ children,
141
+ flags
142
+ }) => {
143
+ const value = (0, import_react2.useMemo)(
144
+ () => ({
145
+ flags,
146
+ isEnabled: (flag) => Boolean(flags[flag])
147
+ }),
148
+ [flags]
149
+ );
150
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FeatureFlagContext.Provider, { value, children });
151
+ };
152
+ var useFeatureFlag = (flag) => {
153
+ const { isEnabled } = (0, import_react2.useContext)(FeatureFlagContext);
154
+ return isEnabled(flag);
155
+ };
156
+ var useFeatureFlags = () => {
157
+ const { flags } = (0, import_react2.useContext)(FeatureFlagContext);
158
+ return flags;
159
+ };
160
+ // Annotate the CommonJS export names for ESM import in node:
161
+ 0 && (module.exports = {
162
+ AuthProvider,
163
+ FeatureFlagProvider,
164
+ useAuth,
165
+ useFeatureFlag,
166
+ useFeatureFlags,
167
+ useSession
168
+ });
@@ -0,0 +1,15 @@
1
+ export { A as AuthContextType, a as AuthProvider, b as AuthProviderProps, U as UserProfile, u as useAuth, c as useSession } from './use-auth-DdapDv2H.cjs';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ReactNode } from 'react';
4
+ import '@supabase/supabase-js';
5
+
6
+ type FeatureFlags = Record<string, boolean>;
7
+ interface FeatureFlagProviderProps {
8
+ children: ReactNode;
9
+ flags: FeatureFlags;
10
+ }
11
+ declare const FeatureFlagProvider: ({ children, flags, }: FeatureFlagProviderProps) => react_jsx_runtime.JSX.Element;
12
+ declare const useFeatureFlag: (flag: string) => boolean;
13
+ declare const useFeatureFlags: () => FeatureFlags;
14
+
15
+ export { FeatureFlagProvider, type FeatureFlagProviderProps, type FeatureFlags, useFeatureFlag, useFeatureFlags };
@@ -0,0 +1,15 @@
1
+ export { A as AuthContextType, a as AuthProvider, b as AuthProviderProps, U as UserProfile, u as useAuth, c as useSession } from './use-auth-DdapDv2H.js';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ReactNode } from 'react';
4
+ import '@supabase/supabase-js';
5
+
6
+ type FeatureFlags = Record<string, boolean>;
7
+ interface FeatureFlagProviderProps {
8
+ children: ReactNode;
9
+ flags: FeatureFlags;
10
+ }
11
+ declare const FeatureFlagProvider: ({ children, flags, }: FeatureFlagProviderProps) => react_jsx_runtime.JSX.Element;
12
+ declare const useFeatureFlag: (flag: string) => boolean;
13
+ declare const useFeatureFlags: () => FeatureFlags;
14
+
15
+ export { FeatureFlagProvider, type FeatureFlagProviderProps, type FeatureFlags, useFeatureFlag, useFeatureFlags };
@@ -0,0 +1,148 @@
1
+ // src/hooks/use-auth.tsx
2
+ import {
3
+ createContext,
4
+ useContext,
5
+ useState,
6
+ useEffect,
7
+ useCallback,
8
+ useMemo,
9
+ useRef
10
+ } from "react";
11
+ import { jsx } from "react/jsx-runtime";
12
+ var AuthContext = createContext(void 0);
13
+ var AuthProvider = ({
14
+ children,
15
+ supabase,
16
+ profilesTable = "profiles"
17
+ }) => {
18
+ const [user, setUser] = useState(null);
19
+ const [session, setSession] = useState(null);
20
+ const [profile, setProfile] = useState(null);
21
+ const [profileLoading, setProfileLoading] = useState(false);
22
+ const [authLoading, setAuthLoading] = useState(true);
23
+ const userRef = useRef(null);
24
+ const isLoading = authLoading || profileLoading;
25
+ useEffect(() => {
26
+ userRef.current = user;
27
+ }, [user]);
28
+ const fetchProfile = useCallback(
29
+ async (userId) => {
30
+ try {
31
+ const { data, error } = await supabase.from(profilesTable).select("*").eq("id", userId).single();
32
+ if (error) throw error;
33
+ setProfile(data);
34
+ } catch {
35
+ setProfile(null);
36
+ }
37
+ },
38
+ [supabase, profilesTable]
39
+ );
40
+ const refreshProfile = useCallback(async () => {
41
+ if (userRef.current) {
42
+ await fetchProfile(userRef.current.id);
43
+ }
44
+ }, [fetchProfile]);
45
+ useEffect(() => {
46
+ supabase.auth.getSession().then(({ data: { session: s } }) => {
47
+ setSession(s);
48
+ setUser(s?.user ?? null);
49
+ setAuthLoading(false);
50
+ });
51
+ const { data: { subscription } } = supabase.auth.onAuthStateChange(
52
+ (_event, s) => {
53
+ setSession(s);
54
+ setUser(s?.user ?? null);
55
+ }
56
+ );
57
+ return () => subscription.unsubscribe();
58
+ }, [supabase]);
59
+ useEffect(() => {
60
+ if (user) {
61
+ setProfileLoading(true);
62
+ fetchProfile(user.id).finally(() => setProfileLoading(false));
63
+ } else {
64
+ setProfile(null);
65
+ }
66
+ }, [user?.id, fetchProfile]);
67
+ const login = useCallback(
68
+ async (email, password) => {
69
+ const { error } = await supabase.auth.signInWithPassword({ email, password });
70
+ return { error };
71
+ },
72
+ [supabase]
73
+ );
74
+ const signup = useCallback(
75
+ async (email, password) => {
76
+ const { error } = await supabase.auth.signUp({ email, password });
77
+ return { error };
78
+ },
79
+ [supabase]
80
+ );
81
+ const logout = useCallback(async () => {
82
+ await supabase.auth.signOut();
83
+ }, [supabase]);
84
+ const value = useMemo(
85
+ () => ({
86
+ user,
87
+ session,
88
+ profile,
89
+ isLoading,
90
+ login,
91
+ signup,
92
+ logout,
93
+ refreshProfile
94
+ }),
95
+ [user, session, profile, isLoading, login, signup, logout, refreshProfile]
96
+ );
97
+ return /* @__PURE__ */ jsx(AuthContext.Provider, { value, children });
98
+ };
99
+ var useAuth = () => {
100
+ const ctx = useContext(AuthContext);
101
+ if (!ctx) throw new Error("useAuth must be used within an AuthProvider");
102
+ return ctx;
103
+ };
104
+ var useSession = () => {
105
+ const { session } = useAuth();
106
+ return session;
107
+ };
108
+
109
+ // src/providers/feature-flag-provider.tsx
110
+ import {
111
+ createContext as createContext2,
112
+ useContext as useContext2,
113
+ useMemo as useMemo2
114
+ } from "react";
115
+ import { jsx as jsx2 } from "react/jsx-runtime";
116
+ var FeatureFlagContext = createContext2({
117
+ flags: {},
118
+ isEnabled: () => false
119
+ });
120
+ var FeatureFlagProvider = ({
121
+ children,
122
+ flags
123
+ }) => {
124
+ const value = useMemo2(
125
+ () => ({
126
+ flags,
127
+ isEnabled: (flag) => Boolean(flags[flag])
128
+ }),
129
+ [flags]
130
+ );
131
+ return /* @__PURE__ */ jsx2(FeatureFlagContext.Provider, { value, children });
132
+ };
133
+ var useFeatureFlag = (flag) => {
134
+ const { isEnabled } = useContext2(FeatureFlagContext);
135
+ return isEnabled(flag);
136
+ };
137
+ var useFeatureFlags = () => {
138
+ const { flags } = useContext2(FeatureFlagContext);
139
+ return flags;
140
+ };
141
+ export {
142
+ AuthProvider,
143
+ FeatureFlagProvider,
144
+ useAuth,
145
+ useFeatureFlag,
146
+ useFeatureFlags,
147
+ useSession
148
+ };
@@ -0,0 +1,84 @@
1
+ /*
2
+ * @dfl/components — Tailwind v4 Preset
3
+ *
4
+ * Import this file AFTER @dfl/components/styles (theme.css) to get
5
+ * Tailwind v4 utility classes mapped to DFL design tokens.
6
+ *
7
+ * Consumer app CSS:
8
+ * @import '@dfl/components/styles'; ← design tokens
9
+ * @import '@dfl/components/tailwind'; ← this file
10
+ *
11
+ * Or combined if you only need utilities:
12
+ * @import 'tailwindcss';
13
+ * @import '@dfl/components/tailwind';
14
+ */
15
+
16
+ @import 'tailwindcss';
17
+
18
+ @theme inline {
19
+ /* ─── Colours ──────────────────────────────────────────────────────────── */
20
+ --color-background: var(--background);
21
+ --color-foreground: var(--foreground);
22
+
23
+ --color-card: var(--card);
24
+ --color-card-foreground: var(--card-foreground);
25
+
26
+ --color-popover: var(--popover);
27
+ --color-popover-foreground: var(--popover-foreground);
28
+
29
+ --color-primary: var(--primary);
30
+ --color-primary-foreground: var(--primary-foreground);
31
+
32
+ --color-secondary: var(--secondary);
33
+ --color-secondary-foreground: var(--secondary-foreground);
34
+
35
+ --color-muted: var(--muted);
36
+ --color-muted-foreground: var(--muted-foreground);
37
+
38
+ --color-accent: var(--accent);
39
+ --color-accent-foreground: var(--accent-foreground);
40
+
41
+ --color-destructive: var(--destructive);
42
+ --color-destructive-foreground: var(--destructive-foreground);
43
+
44
+ --color-border: var(--border);
45
+ --color-input: var(--input);
46
+ --color-ring: var(--ring);
47
+
48
+ /* Brand shortcuts */
49
+ --color-brand: var(--brand-orange);
50
+ --color-brand-accent: var(--brand-accent);
51
+ --color-brand-dark: var(--brand-dark);
52
+
53
+ /* Sidebar */
54
+ --color-sidebar: var(--sidebar-background);
55
+ --color-sidebar-foreground: var(--sidebar-foreground);
56
+ --color-sidebar-primary: var(--sidebar-primary);
57
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
58
+ --color-sidebar-accent: var(--sidebar-accent);
59
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
60
+ --color-sidebar-border: var(--sidebar-border);
61
+ --color-sidebar-ring: var(--sidebar-ring);
62
+
63
+ /* Charts */
64
+ --color-chart-1: var(--chart-1);
65
+ --color-chart-2: var(--chart-2);
66
+ --color-chart-3: var(--chart-3);
67
+ --color-chart-4: var(--chart-4);
68
+ --color-chart-5: var(--chart-5);
69
+
70
+ /* ─── Border radius ────────────────────────────────────────────────────── */
71
+ --radius-sm: var(--radius-sm);
72
+ --radius-md: var(--radius-md);
73
+ --radius-lg: var(--radius-lg);
74
+ --radius-xl: var(--radius-xl);
75
+ --radius-full: var(--radius-full);
76
+
77
+ /* ─── Fonts ────────────────────────────────────────────────────────────── */
78
+ --font-sans: var(--font-sans);
79
+ --font-condensed: var(--font-condensed);
80
+ --font-mono: var(--font-mono);
81
+ }
82
+
83
+ /* Dark mode variant — class-based */
84
+ @variant dark (&:is(.dark *));
@@ -0,0 +1,185 @@
1
+ /*
2
+ * @dfl/components — Design Tokens
3
+ *
4
+ * DFL Brand palette, ported from João's design system.
5
+ * Colors in oklch for wide-gamut display support.
6
+ * Light + dark mode via CSS custom properties.
7
+ *
8
+ * Usage in consumer app:
9
+ * @import '@dfl/components/styles';
10
+ *
11
+ * Override any variable in your own CSS to customise the theme.
12
+ */
13
+
14
+ @import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
15
+
16
+ :root {
17
+ /* ─── Brand colours ────────────────────────────────────────────────────── */
18
+ --brand-orange: oklch(0.75 0.18 55); /* #F39325 DFL orange */
19
+ --brand-dark: oklch(0.09 0.025 273); /* #030213 DFL dark */
20
+ --brand-accent: var(--brand-orange);
21
+
22
+ /* ─── Semantic surface / text ──────────────────────────────────────────── */
23
+ --background: oklch(1 0 0);
24
+ --foreground: oklch(0.09 0.025 273);
25
+
26
+ --card: oklch(1 0 0);
27
+ --card-foreground: oklch(0.09 0.025 273);
28
+
29
+ --popover: oklch(1 0 0);
30
+ --popover-foreground: oklch(0.09 0.025 273);
31
+
32
+ --primary: oklch(0.75 0.18 55); /* brand orange */
33
+ --primary-foreground: oklch(1 0 0);
34
+
35
+ --secondary: oklch(0.96 0.005 240);
36
+ --secondary-foreground: oklch(0.09 0.025 273);
37
+
38
+ --muted: oklch(0.96 0.005 240);
39
+ --muted-foreground: oklch(0.55 0.015 240);
40
+
41
+ --accent: oklch(0.75 0.18 55);
42
+ --accent-foreground: oklch(1 0 0);
43
+
44
+ --destructive: oklch(0.63 0.22 27);
45
+ --destructive-foreground: oklch(1 0 0);
46
+
47
+ --border: oklch(0.91 0.005 240);
48
+ --input: oklch(0.91 0.005 240);
49
+ --ring: oklch(0.75 0.18 55);
50
+
51
+ /* ─── Radius ───────────────────────────────────────────────────────────── */
52
+ --radius: 0.5rem;
53
+ --radius-sm: calc(var(--radius) - 0.125rem);
54
+ --radius-md: var(--radius);
55
+ --radius-lg: calc(var(--radius) + 0.25rem);
56
+ --radius-xl: calc(var(--radius) + 0.5rem);
57
+ --radius-full: 9999px;
58
+
59
+ /* ─── Sidebar ──────────────────────────────────────────────────────────── */
60
+ --sidebar-background: oklch(0.985 0 0);
61
+ --sidebar-foreground: oklch(0.35 0.015 240);
62
+ --sidebar-primary: oklch(0.75 0.18 55);
63
+ --sidebar-primary-foreground: oklch(1 0 0);
64
+ --sidebar-accent: oklch(0.93 0.005 240);
65
+ --sidebar-accent-foreground: oklch(0.09 0.025 273);
66
+ --sidebar-border: oklch(0.88 0.005 240);
67
+ --sidebar-ring: oklch(0.75 0.18 55);
68
+
69
+ /* ─── Fonts ────────────────────────────────────────────────────────────── */
70
+ --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
71
+ --font-condensed: 'Barlow Condensed', ui-sans-serif, sans-serif;
72
+ --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
73
+
74
+ /* ─── Spacing scale ────────────────────────────────────────────────────── */
75
+ --spacing-xs: 0.25rem;
76
+ --spacing-sm: 0.5rem;
77
+ --spacing-md: 1rem;
78
+ --spacing-lg: 1.5rem;
79
+ --spacing-xl: 2rem;
80
+ --spacing-2xl: 3rem;
81
+
82
+ /* ─── Chart colours ────────────────────────────────────────────────────── */
83
+ --chart-1: oklch(0.75 0.18 55);
84
+ --chart-2: oklch(0.65 0.15 190);
85
+ --chart-3: oklch(0.60 0.13 265);
86
+ --chart-4: oklch(0.80 0.12 140);
87
+ --chart-5: oklch(0.70 0.15 330);
88
+ }
89
+
90
+ /* ─── Dark mode ──────────────────────────────────────────────────────────── */
91
+ .dark {
92
+ --background: oklch(0.09 0.025 273); /* #030213 */
93
+ --foreground: oklch(0.97 0.004 240);
94
+
95
+ --card: oklch(0.12 0.025 273);
96
+ --card-foreground: oklch(0.97 0.004 240);
97
+
98
+ --popover: oklch(0.12 0.025 273);
99
+ --popover-foreground: oklch(0.97 0.004 240);
100
+
101
+ --primary: oklch(0.75 0.18 55);
102
+ --primary-foreground: oklch(1 0 0);
103
+
104
+ --secondary: oklch(0.18 0.025 273);
105
+ --secondary-foreground: oklch(0.97 0.004 240);
106
+
107
+ --muted: oklch(0.18 0.025 273);
108
+ --muted-foreground: oklch(0.65 0.015 240);
109
+
110
+ --accent: oklch(0.75 0.18 55);
111
+ --accent-foreground: oklch(1 0 0);
112
+
113
+ --destructive: oklch(0.55 0.22 27);
114
+ --destructive-foreground: oklch(1 0 0);
115
+
116
+ --border: oklch(0.22 0.025 273);
117
+ --input: oklch(0.22 0.025 273);
118
+ --ring: oklch(0.75 0.18 55);
119
+
120
+ --sidebar-background: oklch(0.07 0.025 273);
121
+ --sidebar-foreground: oklch(0.87 0.01 240);
122
+ --sidebar-primary: oklch(0.75 0.18 55);
123
+ --sidebar-primary-foreground: oklch(1 0 0);
124
+ --sidebar-accent: oklch(0.15 0.025 273);
125
+ --sidebar-accent-foreground: oklch(0.87 0.01 240);
126
+ --sidebar-border: oklch(0.20 0.025 273);
127
+ --sidebar-ring: oklch(0.75 0.18 55);
128
+
129
+ --chart-1: oklch(0.75 0.18 55);
130
+ --chart-2: oklch(0.65 0.15 190);
131
+ --chart-3: oklch(0.70 0.13 265);
132
+ --chart-4: oklch(0.80 0.12 140);
133
+ --chart-5: oklch(0.70 0.15 330);
134
+ }
135
+
136
+ /* ─── Base resets ────────────────────────────────────────────────────────── */
137
+ *, *::before, *::after {
138
+ border-color: var(--border);
139
+ box-sizing: border-box;
140
+ }
141
+
142
+ html {
143
+ font-family: var(--font-sans);
144
+ -webkit-font-smoothing: antialiased;
145
+ -moz-osx-font-smoothing: grayscale;
146
+ }
147
+
148
+ body {
149
+ background-color: var(--background);
150
+ color: var(--foreground);
151
+ line-height: 1.5;
152
+ }
153
+
154
+ /* ─── Custom theme (Alto Contraste) ─────────────────────────────────────── */
155
+ .custom-theme {
156
+ --background: oklch(0.98 0 0);
157
+ --foreground: oklch(0 0 0);
158
+
159
+ --card: oklch(0.95 0 0);
160
+ --card-foreground: oklch(0 0 0);
161
+
162
+ --popover: oklch(0.95 0 0);
163
+ --popover-foreground: oklch(0 0 0);
164
+
165
+ --primary: oklch(0.35 0.22 250); /* deep blue */
166
+ --primary-foreground: oklch(1 0 0);
167
+
168
+ --secondary: oklch(0.85 0 0);
169
+ --secondary-foreground: oklch(0 0 0);
170
+
171
+ --muted: oklch(0.90 0 0);
172
+ --muted-foreground: oklch(0.30 0 0);
173
+
174
+ --accent: oklch(0.35 0.22 250);
175
+ --accent-foreground: oklch(1 0 0);
176
+
177
+ --destructive: oklch(0.50 0.25 25);
178
+ --destructive-foreground: oklch(1 0 0);
179
+
180
+ --border: oklch(0.60 0 0);
181
+ --input: oklch(0.60 0 0);
182
+ --ring: oklch(0.35 0.22 250);
183
+
184
+ --brand-accent: oklch(0.35 0.22 250);
185
+ }
@@ -0,0 +1,39 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default, { ReactNode } from 'react';
3
+ import { User, Session, SupabaseClient } from '@supabase/supabase-js';
4
+
5
+ interface UserProfile {
6
+ id: string;
7
+ name: string;
8
+ email: string;
9
+ avatar_url: string | null;
10
+ created_at: string;
11
+ updated_at: string;
12
+ onboarding_completed_at: string | null;
13
+ }
14
+ interface AuthContextType {
15
+ user: User | null;
16
+ session: Session | null;
17
+ profile: UserProfile | null;
18
+ isLoading: boolean;
19
+ login: (email: string, password: string) => Promise<{
20
+ error: Error | null;
21
+ }>;
22
+ signup: (email: string, password: string) => Promise<{
23
+ error: Error | null;
24
+ }>;
25
+ logout: () => Promise<void>;
26
+ refreshProfile: () => Promise<void>;
27
+ }
28
+ declare const AuthContext: React__default.Context<AuthContextType | undefined>;
29
+ interface AuthProviderProps {
30
+ children: ReactNode;
31
+ supabase: SupabaseClient;
32
+ /** Optional: table name for profiles. Defaults to 'profiles'. */
33
+ profilesTable?: string;
34
+ }
35
+ declare const AuthProvider: ({ children, supabase, profilesTable, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
36
+ declare const useAuth: () => AuthContextType;
37
+ declare const useSession: () => Session | null;
38
+
39
+ export { type AuthContextType as A, type UserProfile as U, AuthProvider as a, type AuthProviderProps as b, useSession as c, AuthContext as d, useAuth as u };
@@ -0,0 +1,39 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default, { ReactNode } from 'react';
3
+ import { User, Session, SupabaseClient } from '@supabase/supabase-js';
4
+
5
+ interface UserProfile {
6
+ id: string;
7
+ name: string;
8
+ email: string;
9
+ avatar_url: string | null;
10
+ created_at: string;
11
+ updated_at: string;
12
+ onboarding_completed_at: string | null;
13
+ }
14
+ interface AuthContextType {
15
+ user: User | null;
16
+ session: Session | null;
17
+ profile: UserProfile | null;
18
+ isLoading: boolean;
19
+ login: (email: string, password: string) => Promise<{
20
+ error: Error | null;
21
+ }>;
22
+ signup: (email: string, password: string) => Promise<{
23
+ error: Error | null;
24
+ }>;
25
+ logout: () => Promise<void>;
26
+ refreshProfile: () => Promise<void>;
27
+ }
28
+ declare const AuthContext: React__default.Context<AuthContextType | undefined>;
29
+ interface AuthProviderProps {
30
+ children: ReactNode;
31
+ supabase: SupabaseClient;
32
+ /** Optional: table name for profiles. Defaults to 'profiles'. */
33
+ profilesTable?: string;
34
+ }
35
+ declare const AuthProvider: ({ children, supabase, profilesTable, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
36
+ declare const useAuth: () => AuthContextType;
37
+ declare const useSession: () => Session | null;
38
+
39
+ export { type AuthContextType as A, type UserProfile as U, AuthProvider as a, type AuthProviderProps as b, useSession as c, AuthContext as d, useAuth as u };