Skip to content

Commit 8fef43a

Browse files
committed
main 🧊 new demos
1 parent d37c92b commit 8fef43a

106 files changed

Lines changed: 634 additions & 535 deletions

File tree

Some content is hidden

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

‎packages/newdocs/app/(app)/(root)/page.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { LandingHero } from '@docs/components/landing-hero';
55
import { LandingHooksShowcase } from '@docs/components/landing-hooks-showcase';
66
import { siteConfig } from '@docs/lib/config';
77
import { getContributors } from '@docs/lib/contributors';
8-
import { getElementNames } from '@docs/lib/element-docs';
98
import { Button } from '@docs/ui/button';
109
import { IconBrandGithub, IconHeartFilled } from '@tabler/icons-react';
1110
import Link from 'next/link';
@@ -135,7 +134,7 @@ export const metadata: Metadata = {
135134
};
136135

137136
const HomePage = async () => {
138-
const [contributors, hooks] = await Promise.all([getContributors(), getElementNames('hooks')]);
137+
const [contributors, hooks] = await Promise.all([getContributors(), []]);
139138

140139
const allHooks = hooks.length > 0 ? hooks : featuredHooks;
141140

‎packages/newdocs/content/docs/(root)/functions.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ A quick list of available functions.
3030
- [useCounter](/functions/hooks/useCounter): Hook that manages a counter
3131
- [useCssVar](/functions/hooks/useCssVar): Hook that returns the value of a css variable
3232
- [useDebounceCallback](/functions/hooks/useDebounceCallback): Hook that creates a debounced callback
33-
- [useDebounceEffect](/functions/hooks/useDebounceEffect): Hook that runs an effect after a delay when dependencies change
33+
- [useDebounceEffect](/functions/hooks/useDebounceEffect): Hook that runs an effect after a delay when dependencies change
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"pages": []
3-
}
2+
"pages": [
3+
4+
]
5+
}
Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
11
{
2-
"pages": [
3-
"---elements---",
4-
"useActiveElement",
5-
"useAutoScroll",
6-
"useClickOutside",
2+
"pages": [
3+
4+
"---elements---",
5+
"useActiveElement","useAutoScroll","useClickOutside",
76

8-
"---async---",
9-
"useAsync",
7+
"---async---",
8+
"useAsync",
109

11-
"---lifecycle---",
12-
"useAsyncEffect",
10+
"---lifecycle---",
11+
"useAsyncEffect",
1312

14-
"---browser---",
15-
"useAudio",
16-
"useBattery",
17-
"useBluetooth",
18-
"useBreakpoints",
19-
"useBroadcastChannel",
20-
"useBrowserLocation",
21-
"useClipboard",
22-
"useCopy",
23-
"useCssVar",
13+
"---browser---",
14+
"useAudio","useBattery","useBluetooth","useBreakpoints","useBroadcastChannel","useBrowserLocation","useClipboard","useCopy","useCssVar",
2415

25-
"---utilities---",
26-
"useBatchedCallback",
27-
"useConst",
28-
"useDebounceCallback",
29-
"useDebounceEffect",
16+
"---utilities---",
17+
"useBatchedCallback","useConst","useDebounceCallback","useDebounceEffect",
3018

31-
"---state---",
32-
"useBoolean",
33-
"useControllableState",
34-
"useCookie",
35-
"useCookies",
36-
"useCounter",
19+
"---state---",
20+
"useBoolean","useControllableState","useCookie","useCookies","useCounter",
3721

38-
"---user---",
39-
"useBrowserLanguage"
40-
]
41-
}
22+
"---user---",
23+
"useBrowserLanguage"
24+
]
25+
}

‎packages/newdocs/content/functions/hooks/useActiveElement.mdx‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ lastModifiedTime: 1776957880000
1111

1212
import metadata from './useActiveElement.meta.json';
1313

14-
<FunctionBanner
15-
browserapi={metadata.browserapi}
16-
code={metadata.demo}
17-
type={metadata.type}
18-
name={metadata.name}
19-
language='tsx'
20-
/>
14+
<FunctionBanner browserapi={metadata.browserapi} code={metadata.demo} type={metadata.type} name={metadata.name} language="tsx" />
2115

2216
## Installation
2317

@@ -28,17 +22,25 @@ import metadata from './useActiveElement.meta.json';
2822
<TabsTrigger value='manual'>Manual</TabsTrigger>
2923
</TabsList>
3024
<TabsContent value='library'>
31-
```packages-install npm install @siberiacancode/reactuse ```
25+
```packages-install
26+
npm install @siberiacancode/reactuse
27+
```
3228
</TabsContent>
3329
<TabsContent value='cli'>
34-
```packages-install npx useverse@latest add useActiveElement ```
30+
```packages-install
31+
npx useverse@latest add useActiveElement
32+
```
3533
</TabsContent>
3634
<TabsContent value='manual'>
3735
<Steps>
38-
<Step>Copy and paste the following code into your project.</Step>
39-
<FunctionCode code={metadata.code} language='tsx' />
40-
<Step>Update the import paths to match your project setup.</Step>
41-
</Steps>
36+
<Step>
37+
Copy and paste the following code into your project.
38+
</Step>
39+
<FunctionCode code={metadata.code} language="tsx" />
40+
<Step>
41+
Update the import paths to match your project setup.
42+
</Step>
43+
</Steps>
4244
</TabsContent>
4345
</FunctionTabs>
4446

@@ -52,12 +54,12 @@ const { ref, value } = useActiveElement();
5254

5355
## Type Declarations
5456

55-
<FunctionCode code={metadata.typeDeclarations} language='tsx' />
57+
<FunctionCode code={metadata.typeDeclarations} language="tsx" />
5658

5759
## API
5860

5961
<FunctionApi apiParameters={metadata.apiParameters} />
6062

6163
## Contributors
6264

63-
<FunctionContributors contributors={metadata.contributors} />
65+
<FunctionContributors contributors={metadata.contributors} />

‎packages/newdocs/content/functions/hooks/useActiveElement.meta.json‎

Lines changed: 7 additions & 3 deletions
Large diffs are not rendered by default.

‎packages/newdocs/content/functions/hooks/useAsync.mdx‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ lastModifiedTime: 1754977987000
1111

1212
import metadata from './useAsync.meta.json';
1313

14-
<FunctionBanner
15-
browserapi={metadata.browserapi}
16-
code={metadata.demo}
17-
type={metadata.type}
18-
name={metadata.name}
19-
language='tsx'
20-
/>
14+
<FunctionBanner browserapi={metadata.browserapi} code={metadata.demo} type={metadata.type} name={metadata.name} language="tsx" />
2115

2216
## Installation
2317

@@ -28,15 +22,25 @@ import metadata from './useAsync.meta.json';
2822
<TabsTrigger value='manual'>Manual</TabsTrigger>
2923
</TabsList>
3024
<TabsContent value='library'>
31-
```packages-install npm install @siberiacancode/reactuse ```
25+
```packages-install
26+
npm install @siberiacancode/reactuse
27+
```
28+
</TabsContent>
29+
<TabsContent value='cli'>
30+
```packages-install
31+
npx useverse@latest add useAsync
32+
```
3233
</TabsContent>
33-
<TabsContent value='cli'>```packages-install npx useverse@latest add useAsync ```</TabsContent>
3434
<TabsContent value='manual'>
3535
<Steps>
36-
<Step>Copy and paste the following code into your project.</Step>
37-
<FunctionCode code={metadata.code} language='tsx' />
38-
<Step>Update the import paths to match your project setup.</Step>
39-
</Steps>
36+
<Step>
37+
Copy and paste the following code into your project.
38+
</Step>
39+
<FunctionCode code={metadata.code} language="tsx" />
40+
<Step>
41+
Update the import paths to match your project setup.
42+
</Step>
43+
</Steps>
4044
</TabsContent>
4145
</FunctionTabs>
4246

@@ -48,12 +52,12 @@ const { data, isLoading, isError, error } = useAsync(() => fetch('url'), [deps])
4852

4953
## Type Declarations
5054

51-
<FunctionCode code={metadata.typeDeclarations} language='tsx' />
55+
<FunctionCode code={metadata.typeDeclarations} language="tsx" />
5256

5357
## API
5458

5559
<FunctionApi apiParameters={metadata.apiParameters} />
5660

5761
## Contributors
5862

59-
<FunctionContributors contributors={metadata.contributors} />
63+
<FunctionContributors contributors={metadata.contributors} />

‎packages/newdocs/content/functions/hooks/useAsync.meta.json‎

Lines changed: 4 additions & 2 deletions
Large diffs are not rendered by default.

‎packages/newdocs/content/functions/hooks/useAsyncEffect.mdx‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ lastModifiedTime: 1758638440000
1111

1212
import metadata from './useAsyncEffect.meta.json';
1313

14-
<FunctionBanner
15-
browserapi={metadata.browserapi}
16-
code={metadata.demo}
17-
type={metadata.type}
18-
name={metadata.name}
19-
language='tsx'
20-
/>
14+
<FunctionBanner browserapi={metadata.browserapi} code={metadata.demo} type={metadata.type} name={metadata.name} language="tsx" />
2115

2216
## Installation
2317

@@ -28,34 +22,42 @@ import metadata from './useAsyncEffect.meta.json';
2822
<TabsTrigger value='manual'>Manual</TabsTrigger>
2923
</TabsList>
3024
<TabsContent value='library'>
31-
```packages-install npm install @siberiacancode/reactuse ```
25+
```packages-install
26+
npm install @siberiacancode/reactuse
27+
```
3228
</TabsContent>
3329
<TabsContent value='cli'>
34-
```packages-install npx useverse@latest add useAsyncEffect ```
30+
```packages-install
31+
npx useverse@latest add useAsyncEffect
32+
```
3533
</TabsContent>
3634
<TabsContent value='manual'>
3735
<Steps>
38-
<Step>Copy and paste the following code into your project.</Step>
39-
<FunctionCode code={metadata.code} language='tsx' />
40-
<Step>Update the import paths to match your project setup.</Step>
41-
</Steps>
36+
<Step>
37+
Copy and paste the following code into your project.
38+
</Step>
39+
<FunctionCode code={metadata.code} language="tsx" />
40+
<Step>
41+
Update the import paths to match your project setup.
42+
</Step>
43+
</Steps>
4244
</TabsContent>
4345
</FunctionTabs>
4446

4547
## Usage
4648

4749
```tsx
48-
useAsyncEffect(async () => console.log('effect runs on updates'), deps);
50+
useAsyncEffect(async () => console.log("effect runs on updates"), deps);
4951
```
5052

5153
## Type Declarations
5254

53-
<FunctionCode code={metadata.typeDeclarations} language='tsx' />
55+
<FunctionCode code={metadata.typeDeclarations} language="tsx" />
5456

5557
## API
5658

5759
<FunctionApi apiParameters={metadata.apiParameters} />
5860

5961
## Contributors
6062

61-
<FunctionContributors contributors={metadata.contributors} />
63+
<FunctionContributors contributors={metadata.contributors} />

‎packages/newdocs/content/functions/hooks/useAsyncEffect.meta.json‎

Lines changed: 7 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)