Skip to content

Commit d0090be

Browse files
authored
Merge pull request #437 from tungulin/feature/new-docs
[feat]: new docs
2 parents 3ddebb2 + e485c21 commit d0090be

152 files changed

Lines changed: 14960 additions & 6688 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.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,8 @@ generated
222222
# Reactuse
223223

224224
**/registry.json
225+
226+
227+
# Docgen. Generated content
228+
packages/docs/content/docs/hooks/
229+
.source

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
**/dist
22
**/node_modules
33
**/cache
4-
**/pnpm-lock.yaml
4+
**/pnpm-lock.yaml
5+
**/.next

.prettierrc.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { prettier } from "@siberiacancode/prettier";
1+
import { prettier } from '@siberiacancode/prettier';
22

3-
export default { ...prettier, plugins: ["prettier-plugin-tailwindcss"] };
3+
export default { ...prettier, plugins: ['prettier-plugin-tailwindcss'] };

packages/cli/src/registry/utils/extractDependencies.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ export const extractDependencies = (content: string) => {
44
const packages = new Set<string>();
55

66
const hookMatches = Array.from(
7-
content.matchAll(
8-
/import\s+\{([^}]+)\}\s+from\s+['"]((?:@\/hooks)|(?:[^'"]*use[^'"]*))['"]/g
9-
)
7+
content.matchAll(/import\s+\{([^}]+)\}\s+from\s+['"]((?:@\/hooks)|(?:[^'"]*use[^'"]*))['"]/g)
108
);
119
for (const match of hookMatches) {
1210
const imports = match[1].split(',').map((item) => item.trim());

packages/core/eslint.config.mjs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
import { eslint } from "@siberiacancode/eslint";
1+
import { eslint } from '@siberiacancode/eslint';
22

33
export default eslint(
44
{
55
typescript: true,
66
javascript: true,
77
react: true,
88
jsx: true,
9-
vue: true,
9+
vue: true
1010
},
1111
{
12-
name: "siberiacancode/core/md",
13-
files: ["*.md"],
12+
name: 'siberiacancode/core/md',
13+
files: ['*.md'],
1414
rules: {
15-
"react-refresh/only-export-components": "warn",
16-
},
15+
'react-refresh/only-export-components': 'warn'
16+
}
1717
},
1818
{
19-
name: "siberiacancode/core/ignores",
20-
ignores: ["**/bundle/**/*.js"],
19+
name: 'siberiacancode/core/ignores',
20+
ignores: ['**/bundle/**/*.js']
2121
},
2222
{
23-
name: "siberiacancode/core/hooks",
24-
files: ["**/{hooks,helpers}/**/*.{ts,tsx}"],
23+
name: 'siberiacancode/core/hooks',
24+
files: ['**/{hooks,helpers}/**/*.{ts,tsx}'],
2525
rules: {
26-
"react-dom/no-flush-sync": "warn",
27-
"jsdoc/no-defaults": "off",
28-
"react-hooks/rules-of-hooks": "warn",
29-
"react/no-use-context": "off",
30-
"react/no-context-provider": "off",
31-
},
26+
'react-dom/no-flush-sync': 'warn',
27+
'jsdoc/no-defaults': 'off',
28+
'react-hooks/rules-of-hooks': 'warn',
29+
'react/no-use-context': 'off',
30+
'react/no-context-provider': 'off'
31+
}
3232
},
3333
{
34-
name: "siberiacancode/core/tests",
35-
files: ["**/*.test.ts"],
34+
name: 'siberiacancode/core/tests',
35+
files: ['**/*.test.ts'],
3636
rules: {
37-
"react/no-create-ref": "off",
38-
},
37+
'react/no-create-ref': 'off'
38+
}
3939
},
4040
{
41-
name: "siberiacancode/core/demo",
42-
files: ["**/*.demo.tsx"],
41+
name: 'siberiacancode/core/demo',
42+
files: ['**/*.demo.tsx'],
4343
rules: {
44-
"no-alert": "off",
45-
},
44+
'no-alert': 'off'
45+
}
4646
}
4747
);

packages/core/src/bundle/hooks/useDropZone/useDropZone.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const useDropZone = (...params) => {
6464
const dataTypes = options.dataTypes;
6565
const getFiles = (event) => {
6666
if (!event.dataTransfer) return null;
67-
const list = Array.from(event.dataTransfer.files);
67+
const list = [...event.dataTransfer.files];
6868
if (options.multiple) return list;
6969
if (!list.length) return null;
7070
return [list[0]];
@@ -77,7 +77,7 @@ export const useDropZone = (...params) => {
7777
return types.every((type) => dataTypes.some((dataType) => type.includes(dataType)));
7878
};
7979
const checkValidity = (items) => {
80-
const types = Array.from(items).map((item) => item.type);
80+
const types = Array.from(items, (item) => item.type);
8181
const dataTypesValid = checkDataTypes(types);
8282
const multipleFilesValid = options.multiple || items.length <= 1;
8383
return dataTypesValid && multipleFilesValid;

packages/core/src/hooks/useClickOutside/useClickOutside.demo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cn } from '@siberiacancode/docs/utils';
1+
import { cn } from '../../../../docs/lib/utils';
22
import { useClickOutside, useCounter } from '@siberiacancode/reactuse';
33

44
const Demo = () => {

packages/core/src/hooks/useControllableState/useControllableState.demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ const Demo = () => {
5656
</Collapse>
5757

5858
<div className='mt-4 flex flex-wrap gap-1'>
59-
<button type='button' onClick={controlledCollapse.toggle}>
59+
<button type='button' onClick={() => controlledCollapse.toggle()}>
6060
{controlledCollapse.opened ? 'Close' : 'Open'}
6161
</button>
6262

63-
<button type='button' onClick={controlledCollapse.toggle}>
63+
<button type='button' onClick={() => controlledCollapse.toggle()}>
6464
Toggle
6565
</button>
6666
</div>

packages/core/src/hooks/useDropZone/useDropZone.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const useDropZone = ((...params: any[]) => {
125125

126126
const getFiles = (event: DragEvent) => {
127127
if (!event.dataTransfer) return null;
128-
const list = Array.from(event.dataTransfer.files);
128+
const list = [...event.dataTransfer.files];
129129
if (options.multiple) return list;
130130
if (!list.length) return null;
131131
return [list[0]];
@@ -141,7 +141,7 @@ export const useDropZone = ((...params: any[]) => {
141141
};
142142

143143
const checkValidity = (items: DataTransferItemList) => {
144-
const types = Array.from(items).map((item) => item.type);
144+
const types = Array.from(items, (item) => item.type);
145145
const dataTypesValid = checkDataTypes(types);
146146
const multipleFilesValid = options.multiple || items.length <= 1;
147147

packages/core/src/hooks/useIdle/useIdle.demo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cn } from '@siberiacancode/docs/utils';
1+
import { cn } from '../../../../docs/lib/utils';
22
import { useIdle } from '@siberiacancode/reactuse';
33

44
const Demo = () => {

0 commit comments

Comments
 (0)