@stevederico/skateboard-ui 2.6.0 → 2.8.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/App.jsx CHANGED
@@ -5,8 +5,10 @@ import {
5
5
  Route,
6
6
  Navigate,
7
7
  useLocation,
8
+ useNavigate,
8
9
  } from 'react-router-dom';
9
10
  import { useEffect } from 'react';
11
+ import { getState } from './core/Context.jsx';
10
12
  import { ThemeProvider } from 'next-themes';
11
13
  import Layout from './layout/Layout.jsx';
12
14
  import LandingView from './views/LandingView.jsx';
@@ -24,6 +26,26 @@ import { ContextProvider } from './core/Context.jsx';
24
26
  import { Toaster } from './shadcn/ui/sonner.jsx';
25
27
  import AuthOverlay from './components/AuthOverlay.jsx';
26
28
 
29
+ /**
30
+ * Redirect component for auth routes when authOverlay mode is enabled.
31
+ *
32
+ * Dispatches SHOW_AUTH_OVERLAY on mount and redirects to the previous page
33
+ * (from location state) or /app/home as fallback.
34
+ */
35
+ function AuthRedirect() {
36
+ const { dispatch } = getState();
37
+ const navigate = useNavigate();
38
+ const location = useLocation();
39
+
40
+ useEffect(() => {
41
+ dispatch({ type: 'SHOW_AUTH_OVERLAY' });
42
+ const returnTo = location.state?.from || '/app/home';
43
+ navigate(returnTo, { replace: true });
44
+ }, [dispatch, navigate, location.state]);
45
+
46
+ return null;
47
+ }
48
+
27
49
  function App({ constants, appRoutes, defaultRoute, landingPage, overrides = {} }) {
28
50
  const location = useLocation();
29
51
 
@@ -36,11 +58,17 @@ function App({ constants, appRoutes, defaultRoute, landingPage, overrides = {} }
36
58
  const LayoutComponent = overrides.layout || Layout;
37
59
  const SettingsComponent = overrides.settings || SettingsView;
38
60
  const PaymentComponent = overrides.payment || PaymentView;
39
- const SignInComponent = overrides.signIn || SignInView;
40
- const SignUpComponent = overrides.signUp || SignUpView;
41
61
  const SignOutComponent = overrides.signOut || SignOutView;
42
62
  const NotFoundComponent = overrides.notFound || NotFound;
43
63
 
64
+ // When authOverlay is enabled, redirect /signin and /signup to show the overlay instead
65
+ const SignInComponent = constants.authOverlay
66
+ ? AuthRedirect
67
+ : (overrides.signIn || SignInView);
68
+ const SignUpComponent = constants.authOverlay
69
+ ? AuthRedirect
70
+ : (overrides.signUp || SignUpView);
71
+
44
72
  return (
45
73
  <Routes>
46
74
  <Route element={<LayoutComponent />}>
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ 2.8.0
4
+
5
+ Add content area border
6
+ Add SettingsView sign-in card
7
+
8
+ 2.7.0
9
+
10
+ Improve light mode sidebar contrast
11
+
3
12
  2.6.0
4
13
 
5
14
  Fix dark mode flash
package/layout/Layout.jsx CHANGED
@@ -47,7 +47,7 @@ export default function Layout({ children }) {
47
47
  '--header-height': '3.5rem',
48
48
  }}>
49
49
  {showSidebar && <Sidebar variant="inset" />}
50
- <SidebarInset className={constants.hideSidebarInsetRounding ? "md:peer-data-[variant=inset]:rounded-none" : ""}>
50
+ <SidebarInset className={`border border-border ${constants.hideSidebarInsetRounding ? "md:peer-data-[variant=inset]:rounded-none" : ""}`}>
51
51
  <Outlet />
52
52
  </SidebarInset>
53
53
  </SidebarProvider>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stevederico/skateboard-ui",
3
3
  "private": false,
4
- "version": "2.6.0",
4
+ "version": "2.8.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./Sidebar": {
package/styles.css CHANGED
@@ -36,7 +36,7 @@
36
36
  --chart-4: oklch(0.828 0.189 84.429);
37
37
  --chart-5: oklch(0.769 0.188 70.08);
38
38
  --radius: 0.625rem;
39
- --sidebar: oklch(0.985 0 0);
39
+ --sidebar: oklch(0.965 0 0);
40
40
  --sidebar-foreground: oklch(0.145 0 0);
41
41
  --sidebar-primary: oklch(0.205 0 0);
42
42
  --sidebar-primary-foreground: oklch(0.985 0 0);
@@ -64,8 +64,8 @@
64
64
  --accent-foreground: oklch(0.985 0 0);
65
65
  --destructive: oklch(0.396 0.141 25.723);
66
66
  --destructive-foreground: oklch(0.637 0.237 25.331);
67
- --border: oklch(0.2 0 0);
68
- --input: oklch(0.18 0 0);
67
+ --border: oklch(0.32 0 0);
68
+ --input: oklch(0.30 0 0);
69
69
  --ring: oklch(0.439 0 0);
70
70
  --chart-1: oklch(0.488 0.243 264.376);
71
71
  --chart-2: oklch(0.696 0.17 162.48);
@@ -78,7 +78,7 @@
78
78
  --sidebar-primary-foreground: oklch(0.985 0 0);
79
79
  --sidebar-accent: oklch(0.25 0 0);
80
80
  --sidebar-accent-foreground: oklch(0.985 0 0);
81
- --sidebar-border: oklch(0.27 0 0);
81
+ --sidebar-border: oklch(0.35 0 0);
82
82
  --sidebar-ring: oklch(0.439 0 0);
83
83
  }
84
84
 
@@ -101,8 +101,8 @@
101
101
  --accent-foreground: oklch(0.985 0 0);
102
102
  --destructive: oklch(0.396 0.141 25.723);
103
103
  --destructive-foreground: oklch(0.637 0.237 25.331);
104
- --border: oklch(0.2 0 0);
105
- --input: oklch(0.18 0 0);
104
+ --border: oklch(0.32 0 0);
105
+ --input: oklch(0.30 0 0);
106
106
  --ring: oklch(0.439 0 0);
107
107
  --chart-1: oklch(0.488 0.243 264.376);
108
108
  --chart-2: oklch(0.696 0.17 162.48);
@@ -115,7 +115,7 @@
115
115
  --sidebar-primary-foreground: oklch(0.985 0 0);
116
116
  --sidebar-accent: oklch(0.25 0 0);
117
117
  --sidebar-accent-foreground: oklch(0.985 0 0);
118
- --sidebar-border: oklch(0.27 0 0);
118
+ --sidebar-border: oklch(0.35 0 0);
119
119
  --sidebar-ring: oklch(0.439 0 0);
120
120
  }
121
121
  }
@@ -234,7 +234,7 @@ button[data-sidebar="rail"]::after {
234
234
 
235
235
  @layer base {
236
236
  :root {
237
- --sidebar-background: 0 0% 98%;
237
+ --sidebar-background: 0 0% 96%;
238
238
  --sidebar-foreground: 240 5.3% 26.1%;
239
239
  --sidebar-primary: 240 5.9% 10%;
240
240
  --sidebar-primary-foreground: 0 0% 98%;
@@ -251,7 +251,7 @@ button[data-sidebar="rail"]::after {
251
251
  --sidebar-primary-foreground: 0 0% 100%;
252
252
  --sidebar-accent: 240 3.7% 15.9%;
253
253
  --sidebar-accent-foreground: 240 4.8% 95.9%;
254
- --sidebar-border: 240 3.7% 15.9%;
254
+ --sidebar-border: 240 3.7% 28%;
255
255
  --sidebar-ring: 217.2 91.2% 59.8%;
256
256
  }
257
257
 
@@ -264,7 +264,7 @@ button[data-sidebar="rail"]::after {
264
264
  --sidebar-primary-foreground: 0 0% 100%;
265
265
  --sidebar-accent: 240 3.7% 15.9%;
266
266
  --sidebar-accent-foreground: 240 4.8% 95.9%;
267
- --sidebar-border: 240 3.7% 15.9%;
267
+ --sidebar-border: 240 3.7% 28%;
268
268
  --sidebar-ring: 217.2 91.2% 59.8%;
269
269
  }
270
270
  }
@@ -69,6 +69,31 @@ export default function SettingsView() {
69
69
 
70
70
  {/* Main content */}
71
71
  <div className="flex flex-col items-center p-4 gap-4">
72
+ {/* Sign In prompt (shown when not authenticated and auth is enabled) */}
73
+ {!user && constants.noLogin !== true && (
74
+ <Card className="w-full max-w-lg">
75
+ <CardHeader>
76
+ <CardTitle>Account</CardTitle>
77
+ <CardDescription>Sign in to access your account settings.</CardDescription>
78
+ <CardAction>
79
+ <Button
80
+ variant="outline"
81
+ size="sm"
82
+ onClick={() => {
83
+ if (constants.authOverlay) {
84
+ dispatch({ type: 'SHOW_AUTH_OVERLAY' });
85
+ } else {
86
+ navigate('/signin');
87
+ }
88
+ }}
89
+ >
90
+ Sign In
91
+ </Button>
92
+ </CardAction>
93
+ </CardHeader>
94
+ </Card>
95
+ )}
96
+
72
97
  {/* Account */}
73
98
  {showAuth && (
74
99
  <Card className="w-full max-w-lg">