Skip to content

Commit 3a428e9

Browse files
committed
feat: only use new-york style
1 parent 9544348 commit 3a428e9

File tree

212 files changed

+436
-6259
lines changed

Some content is hidden

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

212 files changed

+436
-6259
lines changed

apps/docs/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ next-env.d.ts
3030

3131
# local registry
3232
public/local
33-
registry/default.local.json
3433
registry/new-york.local.json

apps/docs/app/docs/[[...slug]]/page.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,17 @@ function Footer({ url }: { url: string }) {
164164

165165
function TableOfContentFooter() {
166166
return (
167-
<div className="bg-card dark:bg-fd-muted border-border/50 dark:border-border/0 text-fd-foreground/80 group relative mt-12 flex flex-col gap-2 rounded-lg border p-6 text-sm">
167+
<div className="bg-card dark:bg-fd-muted border-border/70 dark:border-border/0 text-fd-foreground/80 group relative mt-12 flex flex-col gap-2 rounded-lg border p-6 text-sm">
168168
<div className="text-balance text-base font-semibold leading-tight group-hover:underline">
169169
Want to work with us?
170170
</div>
171-
<div className="text-muted-foreground">Mention us to your team.</div>
172-
<div className="text-muted-foreground">We help companies ship world-class UI/UX.</div>
173-
<button
174-
data-slot="button"
175-
className="[&amp;_svg]:pointer-events-none [&amp;_svg:not([class*='size-'])]:size-4 [&amp;_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 has-[&gt;svg]:px-2.5 mt-2 inline-flex h-8 w-fit shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-3 text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50">
171+
<div className="">Mention us to your team.</div>
172+
<div className="text-muted-foreground pb-2">We help companies ship world-class UI/UX.</div>
173+
<Button
174+
size="sm"
175+
className="from-primary to-primary/75 group-hover:to-primary/80 w-fit bg-transparent bg-gradient-to-br">
176176
Learn more
177-
</button>
177+
</Button>
178178
<Link href="/docs/hire-us" className="absolute inset-0">
179179
<span className="sr-only">Learn more about Founded Labs</span>
180180
</Link>

apps/docs/app/layout.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import './global.css';
22

33
import { CookiesProvider } from '@docs/components/cookies-provider';
44
import { SafeAreaProvider } from '@docs/components/safe-area-provider';
5-
import { StyleProvider } from '@docs/lib/style-provider';
65
import { cn } from '@docs/lib/utils';
76
import { Analytics } from '@vercel/analytics/next';
87
import { SearchLink } from 'fumadocs-ui/components/dialog/search';
@@ -38,12 +37,10 @@ export default function Layout({ children }: React.PropsWithChildren) {
3837
<body className="flex min-h-svh flex-col">
3938
<CookiesProvider>
4039
<SafeAreaProvider>
41-
<StyleProvider>
42-
<RootProvider search={SEARCH_OPTIONS}>
43-
{children}
44-
<Analytics />
45-
</RootProvider>
46-
</StyleProvider>
40+
<RootProvider search={SEARCH_OPTIONS}>
41+
{children}
42+
<Analytics />
43+
</RootProvider>
4744
</SafeAreaProvider>
4845
</CookiesProvider>
4946
</body>

apps/docs/components/auth-block-tabs.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
'use client';
22

3-
import { useReactiveGetCookie } from 'cookies-next/client';
3+
import {
4+
AuthIntegrationSelect,
5+
useAuthIntegration,
6+
} from '@docs/components/auth-integration-select';
7+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@docs/components/ui/tabs';
48
import * as React from 'react';
5-
import { Tabs, TabsContent, TabsList, TabsTrigger } from './ui/tabs';
6-
import { AuthIntegrationSelect } from './auth-integration-select';
79

810
export function AuthBlockTabs({ children }: React.PropsWithChildren) {
911
return (
@@ -17,7 +19,7 @@ export function AuthBlockTabs({ children }: React.PropsWithChildren) {
1719
Manual
1820
</TabsTrigger>
1921
</TabsList>
20-
<AuthIntegrationSelect />
22+
<AuthIntegrationSelect className="mt-px" />
2123
</div>
2224
{children}
2325
</Tabs>
@@ -31,8 +33,7 @@ type ContentProps = {
3133
};
3234

3335
export function AuthBlockTabsCliContent({ children, integration: integrationProp }: ContentProps) {
34-
const getCookie = useReactiveGetCookie();
35-
const integration = getCookie('auth-integration') ?? 'none';
36+
const [integration] = useAuthIntegration();
3637

3738
if (integration !== integrationProp) {
3839
return null;
@@ -44,8 +45,7 @@ export function AuthBlockTabsManualContent({
4445
children,
4546
integration: integrationProp,
4647
}: ContentProps) {
47-
const getCookie = useReactiveGetCookie();
48-
const integration = getCookie('auth-integration') ?? 'none';
48+
const [integration] = useAuthIntegration();
4949

5050
if (integration !== integrationProp) {
5151
return null;

apps/docs/components/auth-integration-select.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { type SelectProps } from '@radix-ui/react-select';
3+
import type { SelectProps } from '@radix-ui/react-select';
44
import * as React from 'react';
55
import {
66
Select,
@@ -10,7 +10,7 @@ import {
1010
SelectValue,
1111
} from '@docs/components/ui/select';
1212
import { useReactiveGetCookie, useReactiveSetCookie } from 'cookies-next/client';
13-
import { Button } from './ui/button';
13+
import { Button } from '@docs/components/ui/button';
1414

1515
const INTEGRATIONS = [
1616
{ name: 'none', label: 'None' },
@@ -19,23 +19,20 @@ const INTEGRATIONS = [
1919

2020
type Integration = (typeof INTEGRATIONS)[number]['name'];
2121

22-
export function AuthIntegrationSelect(props: SelectProps) {
22+
export function AuthIntegrationSelect({
23+
className,
24+
...props
25+
}: SelectProps & { className?: string }) {
2326
const [isClient, setIsClient] = React.useState(false);
24-
const getCookie = useReactiveGetCookie();
25-
const setCookie = useReactiveSetCookie();
26-
const integration = getCookie('auth-integration') ?? 'none';
27+
const [integration, onIntegrationChange] = useAuthIntegration();
2728

2829
React.useEffect(() => {
2930
setIsClient(true);
3031
}, []);
3132

32-
function onIntegrationChange(value: Integration) {
33-
setCookie('auth-integration', value);
34-
}
35-
3633
return (
3734
<Select {...props} defaultValue="none" value={integration} onValueChange={onIntegrationChange}>
38-
<Button asChild variant="outline">
35+
<Button asChild variant="outline" size="sm" className={className}>
3936
<SelectTrigger className="dark:bg-muted dark:hover:bg-muted/80 dark:border-muted-foreground/15 w-fit">
4037
<span className="text-muted-foreground flex-1 pr-1">Integration:</span>
4138
{!isClient ? (
@@ -62,6 +59,17 @@ export function AuthIntegrationSelect(props: SelectProps) {
6259
);
6360
}
6461

62+
export function useAuthIntegration() {
63+
const getCookie = useReactiveGetCookie();
64+
const setCookie = useReactiveSetCookie();
65+
const integration = getCookie('user.auth-integration') ?? 'none';
66+
function onIntegrationChange(value: Integration) {
67+
setCookie('user.auth-integration', value);
68+
}
69+
70+
return [integration, onIntegrationChange] as const;
71+
}
72+
6573
function preventDefault(e: Event) {
6674
e.preventDefault();
6775
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
'use client';
2+
3+
import { Button } from '@docs/components/ui/button';
4+
import {
5+
Select,
6+
SelectContent,
7+
SelectItem,
8+
SelectTrigger,
9+
SelectValue,
10+
} from '@docs/components/ui/select';
11+
import { type SelectProps } from '@radix-ui/react-select';
12+
import { useReactiveGetCookie, useReactiveSetCookie } from 'cookies-next/client';
13+
import * as React from 'react';
14+
15+
const PLATFORMS = [
16+
{ name: 'web', label: 'Web' },
17+
{ name: 'native', label: 'Native' },
18+
] as const;
19+
20+
type Platform = (typeof PLATFORMS)[number]['name'];
21+
22+
export function PlatformSelect(props: SelectProps) {
23+
const [isClient, setIsClient] = React.useState(false);
24+
const [platform, onPlatformChange] = usePlatform();
25+
26+
React.useEffect(() => {
27+
setIsClient(true);
28+
}, []);
29+
30+
return (
31+
<Select {...props} defaultValue="web" value={platform} onValueChange={onPlatformChange}>
32+
<Button asChild variant="outline" size="sm">
33+
<SelectTrigger className="dark:bg-muted dark:hover:bg-muted/80 dark:border-muted-foreground/15 w-fit">
34+
<span className="text-muted-foreground flex-1 pr-1">Platform:</span>
35+
{!isClient ? (
36+
<span className="opacity-50">
37+
{
38+
PLATFORMS.find((platform) =>
39+
platform.name === props.value ? props.value : props.defaultValue
40+
)?.label
41+
}
42+
</span>
43+
) : (
44+
<SelectValue placeholder="Select platform" />
45+
)}
46+
</SelectTrigger>
47+
</Button>
48+
<SelectContent onCloseAutoFocus={preventDefault} className="dark:bg-neutral-900">
49+
{PLATFORMS.map((platform) => (
50+
<SelectItem key={platform.name} value={platform.name} className="text-xs">
51+
{platform.label}
52+
</SelectItem>
53+
))}
54+
</SelectContent>
55+
</Select>
56+
);
57+
}
58+
59+
export function usePlatform() {
60+
const getCookie = useReactiveGetCookie();
61+
const setCookie = useReactiveSetCookie();
62+
const platform = getCookie('user.platform') ?? 'web';
63+
function onPlatformChange(value: Platform) {
64+
setCookie('user.platform', value);
65+
}
66+
return [platform, onPlatformChange] as const;
67+
}
68+
69+
function preventDefault(e: Event) {
70+
e.preventDefault();
71+
}

0 commit comments

Comments
 (0)