Skip to content

Commit 8d23f67

Browse files
committed
Merge branch 'master' into fix/various
2 parents 2a94cc1 + 3f20bc3 commit 8d23f67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2145
-476
lines changed

docs/platform-configuration/supertokens-core/ip-allow-deny.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ This ensures that only your backend can query the SuperTokens core - increasing
2222
:::caution no-title
2323
This page is only relevant if you are self hosting SuperTokens.
2424

25-
For managed service, please navigate to [your dashboard](https://supertokens.com/dashboard) and go to the edit configuration section to set this value.
25+
The option is not available if you are using the managed version of SuperTokens due to security reasons.
26+
In this case, you have to configure the filtering mechanism in your backend server.
2627
:::
2728

2829

docs/references/cdi/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"label": "CDI Reference",
2+
"label": "Core Driver Interface",
33
"customProps": { "isMainCategory": true },
44
"position": 5
55
}

docs/references/fdi/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"label": "FDI Reference",
2+
"label": "Frontend Driver Interface",
33
"customProps": { "isMainCategory": true },
44
"position": 4
55
}

docusaurus.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ const config: Config = {
6868
colorMode: {
6969
defaultMode: "dark",
7070
disableSwitch: true,
71+
respectPrefersColorScheme: true,
7172
},
7273
image: "https://supertokens.com/static/assets/home-meta.png",
7374
navbar: {
7475
title: "SuperTokens",
7576
logo: {
7677
alt: "SuperTokens Logo",
7778
src: "img/logoWithNameLight.svg",
79+
srcDark: "img/logoWithNameLight.svg",
7880
href: "/",
7981
target: "_blank",
8082
},

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"docusaurus-plugin-sass": "^0.2.5",
4949
"dotenv": "^16.4.5",
5050
"js-cookie": "^3.0.5",
51+
"lucide-react": "^0.534.0",
5152
"motion": "^11.13.1",
5253
"prism-react-renderer": "^2.3.0",
5354
"react": "^18.0.0",

src/components/ColorModeToggle.scss

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
.color-mode-toggle {
2+
position: relative;
3+
display: inline-flex;
4+
align-items: center;
5+
justify-content: center;
6+
width: 2.5rem;
7+
height: 2.5rem;
8+
border-radius: var(--radius-3);
9+
background-color: transparent;
10+
color: var(--gray-11);
11+
transition: all 0.2s ease;
12+
13+
&[data-state="on"] {
14+
.color-mode-toggle__light-icon {
15+
opacity: 0;
16+
transform: scale(0) rotate(90deg);
17+
}
18+
19+
.color-mode-toggle__dark-icon {
20+
opacity: 1;
21+
transform: scale(1) rotate(0);
22+
}
23+
}
24+
25+
&[data-state="off"] {
26+
.color-mode-toggle__light-icon {
27+
opacity: 1;
28+
transform: scale(1) rotate(0);
29+
}
30+
31+
.color-mode-toggle__dark-icon {
32+
opacity: 0;
33+
transform: scale(0) rotate(90deg);
34+
}
35+
}
36+
37+
&:hover {
38+
background-color: var(--gray-a4);
39+
color: var(--gray-12);
40+
}
41+
42+
&:focus-visible {
43+
outline: none;
44+
box-shadow: 0 0 0 2px var(--color-mode-toggle-focus-ring);
45+
}
46+
47+
&:disabled {
48+
pointer-events: none;
49+
opacity: 0.5;
50+
cursor: not-allowed;
51+
}
52+
53+
&__icon {
54+
position: absolute;
55+
width: 1.2rem;
56+
height: 1.2rem;
57+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
58+
}
59+
}
60+
61+
@media (max-width: 768px) {
62+
.color-mode-toggle {
63+
width: 2.25rem;
64+
height: 2.25rem;
65+
66+
&__icon {
67+
width: 1.1rem;
68+
height: 1.1rem;
69+
}
70+
}
71+
}
72+
73+
// High contrast mode support
74+
// @media (prefers-contrast: high) {
75+
// .color-mode-toggle {
76+
// border-width: 2px;
77+
//
78+
// &:focus-visible {
79+
// box-shadow: 0 0 0 3px var(--color-mode-toggle-focus-ring);
80+
// }
81+
// }
82+
// }
83+
84+
// @media (prefers-reduced-motion: reduce) {
85+
// .color-mode-toggle__icon {
86+
// transition-duration: 0.1s;
87+
// transition-timing-function: ease;
88+
// }
89+
// }
90+

src/components/ColorModeToggle.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as React from "react";
2+
import { Moon, Sun } from "lucide-react";
3+
import { useTheme } from "../lib/themeStore";
4+
import * as TogglePrimitive from "@radix-ui/react-toggle";
5+
6+
import "./ColorModeToggle.scss";
7+
8+
export function ColorModeToggle() {
9+
const { theme, setTheme } = useTheme();
10+
11+
return (
12+
<TogglePrimitive.Root
13+
pressed={theme === "dark"}
14+
onPressedChange={(pressed) => setTheme(pressed ? "dark" : "light")}
15+
className="color-mode-toggle"
16+
aria-label="Toggle theme"
17+
title={`Current: ${theme}`}
18+
>
19+
<Sun className={`color-mode-toggle__icon color-mode-toggle__light-icon `} />
20+
<Moon className={`color-mode-toggle__icon color-mode-toggle__dark-icon `} />
21+
</TogglePrimitive.Root>
22+
);
23+
}

src/components/MenuItemIcon.tsx

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
import React from "react";
2+
import useBaseUrl from "@docusaurus/useBaseUrl";
3+
import {
4+
Book,
5+
Zap,
6+
HousePlus,
7+
ShieldUser,
8+
Braces,
9+
Key,
10+
LayoutDashboard,
11+
Shield,
12+
CircleUserRound,
13+
UserPlus,
14+
FileTerminal,
15+
FileCode,
16+
HardDrive,
17+
NotebookTabs,
18+
Users,
19+
ArrowRight,
20+
Settings,
21+
Server,
22+
WandSparkles,
23+
FileUser,
24+
Smartphone,
25+
Share2,
26+
Building,
27+
RectangleEllipsis,
28+
Bot,
29+
Fingerprint,
30+
ShieldCheck,
31+
Clock,
32+
UserCheck,
33+
Puzzle,
34+
Workflow,
35+
Monitor,
36+
Bug,
37+
Palette,
38+
Cpu,
39+
Hash,
40+
History,
41+
Play,
42+
MailCheck,
43+
} from "lucide-react";
44+
45+
import VercelLogo from "/img/logos/vercel.svg";
46+
import SupabaseLogo from "/img/logos/supabase.svg";
47+
import HasuraLogo from "/img/logos/hasura.svg";
48+
import NextjsLogo from "/img/logos/nextjs.svg";
49+
import NestjsLogo from "/img/logos/nestjs.svg";
50+
import NetlifyLogo from "/img/logos/netlify.svg";
51+
import AwsLambdaLogo from "/img/logos/aws-lambda.svg";
52+
import GraphqlLogo from "/img/logos/graphql.svg";
53+
import CdiLogo from "/img/logos/cdi.svg";
54+
import FdiLogo from "/img/logos/fdi.svg";
55+
56+
const categoryIcons = {
57+
// Main categories
58+
References: Book,
59+
Quickstart: Zap,
60+
Authentication: Key,
61+
"Additional Verification": Shield,
62+
"Post Authentication": Users,
63+
Migration: ArrowRight,
64+
"Platform Configuration": Settings,
65+
Deployment: Server,
66+
67+
// Authentication methods
68+
"Email Password": RectangleEllipsis,
69+
Passwordless: WandSparkles,
70+
"Social Login": CircleUserRound,
71+
"Enterprise Login": Building,
72+
"Unified Login": Share2,
73+
"Machine to Machine": Bot,
74+
Passkeys: Fingerprint,
75+
76+
// Quickstart integrations
77+
Integrations: Puzzle,
78+
// "AWS Lambda": AwsLambdaLogo,
79+
// NextJS: NextjsLogo,
80+
// GraphQL: GraphqlLogo,
81+
// Hasura: HasuraLogo,
82+
// NestJS: NestjsLogo,
83+
// Netlify: NetlifyLogo,
84+
// Supabase: SupabaseLogo,
85+
// Vercel: VercelLogo,
86+
87+
// References and SDK sections
88+
"Frontend SDKs": Monitor,
89+
"Backend SDKs": Server,
90+
"User Interface": Palette,
91+
"Frontend Driver Interface": FileCode,
92+
"Core Driver Interface": FileTerminal,
93+
"Testing and Debugging": Bug,
94+
"SuperTokens Core": Cpu,
95+
96+
// Authentication reference subcategories
97+
"Email/Password": RectangleEllipsis,
98+
ThirdParty: Share2,
99+
WebAuthn: Fingerprint,
100+
OAuth: Key,
101+
MFA: ShieldCheck,
102+
Session: Clock,
103+
TOTP: Hash,
104+
OTP: Smartphone,
105+
SAML: Building,
106+
107+
// CDI/FDI
108+
"Email Verification": MailCheck,
109+
"Account Linking": FileUser,
110+
"Bulk Import": UserPlus,
111+
Core: Cpu,
112+
Dashboard: LayoutDashboard,
113+
"User Metadata": Braces,
114+
"User Roles": ShieldUser,
115+
Multitenancy: HousePlus,
116+
117+
// Quickstart guides and workflows
118+
"Quickstart Guides": Zap,
119+
"Advanced Workflows": Workflow,
120+
"Legacy Method": History,
121+
"Legacy method": History,
122+
"Using prebuilt UI": Palette,
123+
"Step 1: Account Creation": UserCheck,
124+
"5. Checking Sessions in API Routes": Shield,
125+
"Checking Sessions in API Routes": Shield,
126+
127+
// Main quickstart menu items
128+
"/docs/quickstart/backend-setup": HardDrive,
129+
"/docs/quickstart/frontend-setup": Monitor,
130+
"/docs/quickstart/introduction": Book,
131+
"/docs/quickstart/next-steps": NotebookTabs,
132+
"/docs/quickstart/example-applications": Play,
133+
};
134+
135+
// Brand logo mappings for integration platforms
136+
const brandLogos: { [key: string]: string } = {};
137+
138+
type MenuItemIconProps =
139+
| {
140+
label: string;
141+
className?: string;
142+
}
143+
| {
144+
href: string;
145+
className?: string;
146+
};
147+
148+
export function MenuItemIcon(props: MenuItemIconProps) {
149+
const IconComponent = "label" in props ? categoryIcons[props.label] : categoryIcons[props.href];
150+
151+
if (!IconComponent) {
152+
return null;
153+
}
154+
155+
return <IconComponent className={props.className} size={16} />;
156+
}
157+
158+
export default MenuItemIcon;

src/components/ScrollOffsetFix.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { useEffect } from 'react';
2+
import { initScrollOffset } from '../lib/scrollOffset';
3+
4+
export function ScrollOffsetFix() {
5+
useEffect(() => {
6+
initScrollOffset();
7+
}, []);
8+
9+
return null; // This component doesn't render anything
10+
}
11+
12+
export default ScrollOffsetFix;

0 commit comments

Comments
 (0)