Skip to content

Commit c69fc7f

Browse files
committed
main 🧊 add use bluetooth, add tailwind for demos
1 parent 272eaf0 commit c69fc7f

File tree

24 files changed

+467
-272
lines changed

24 files changed

+467
-272
lines changed

‎.prettierrc.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { prettier } from '@siberiacancode/prettier';
22

33
/** @type {import('prettier').Config} */
4-
export default prettier;
4+
export default { ...prettier, plugins: ['prettier-plugin-tailwindcss'] };

‎docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default async () => {
3434
vite: {
3535
resolve: {
3636
alias: {
37+
'@/docs': fileURLToPath(new URL('../../docs', import.meta.url)),
3738
'@': fileURLToPath(new URL('../../src', import.meta.url))
3839
}
3940
}

‎docs/.vitepress/theme/global.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import 'tailwindcss';
2+
13
:root {
24
--vp-c-bg: #ffffff;
35

‎docs/functions/hooks/[name].paths.mts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { codeToHtml } from 'shiki'
1+
import { codeToHtml } from 'shiki';
22

33
import { getHookFile, getHooks, matchJsdoc, parseHookJsdoc } from '../../src/utils';
44

@@ -30,7 +30,7 @@ export default {
3030
acc += usage.description;
3131
}
3232
return acc;
33-
}, '')
33+
}, '');
3434

3535
const usage = await codeToHtml(usages, {
3636
lang: 'typescript',
@@ -41,7 +41,6 @@ export default {
4141
defaultColor: false
4242
});
4343

44-
4544
const example = await codeToHtml(`import { ${hook} } from '@siberiacancode/reactuse';`, {
4645
lang: 'typescript',
4746
themes: {
@@ -77,4 +76,3 @@ export default {
7776
return params.filter(Boolean);
7877
}
7978
};
80-

‎docs/src/utils/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export * from './hooks';
22
export * from './isDefaultType';
33
export * from './matchJsdoc';
44
export * from './parseHookJsdoc';
5+
export * from './utils';

‎docs/src/utils/utils/cn.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { ClassValue } from 'clsx';
2+
3+
import { clsx } from 'clsx';
4+
import { twMerge } from 'tailwind-merge';
5+
6+
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));

‎docs/src/utils/utils/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './cn';

‎package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,28 @@
7575
"@siberiacancode/eslint": "^2.8.0",
7676
"@siberiacancode/prettier": "^1.2.0",
7777
"@siberiacancode/vitest": "^1.2.4",
78+
"@tailwindcss/postcss": "^4.0.4",
7879
"@testing-library/dom": "^10.4.0",
7980
"@testing-library/react": "^16.2.0",
8081
"@types/doctrine": "^0.0.9",
8182
"@types/node": "^22.13.1",
8283
"@types/react": "^18.3.12",
8384
"@types/react-dom": "^18.3.2",
8485
"@types/web-bluetooth": "^0.0.20",
86+
"clsx": "^2.1.1",
8587
"comment-parser": "^1.4.1",
8688
"core-js": "^3.40.0",
8789
"doctrine": "^3.0.0",
8890
"husky": "^9.1.7",
8991
"lint-staged": "^15.4.3",
9092
"markdown-table": "^3.0.4",
93+
"postcss": "^8.5.1",
94+
"prettier-plugin-tailwindcss": "^0.6.11",
9195
"react": "^18.3.1",
9296
"react-dom": "^18.3.1",
9397
"shx": "^0.3.4",
98+
"tailwind-merge": "^3.0.1",
99+
"tailwindcss": "^4.0.4",
94100
"typescript": "^5.7.3",
95101
"vite": "^6.0.11",
96102
"vitepress": "^1.6.3"

‎postcss.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
plugins: {
3+
'@tailwindcss/postcss': {}
4+
}
5+
};

‎src/hooks/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ export * from './useWindowEvent/useWindowEvent';
110110
export * from './useWindowFocus/useWindowFocus';
111111
export * from './useWindowScroll/useWindowScroll';
112112
export * from './useWindowSize/useWindowSize';
113-
export * from './useWizard/useWizard';
113+
export * from './useWizard/useWizard';

0 commit comments

Comments
 (0)