@arolariu/components 0.0.37 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +7 -0
- package/dist/cjs/components/ui/background-beams.cjs +1 -11
- package/dist/cjs/components/ui/background-beams.cjs.map +1 -1
- package/dist/cjs/components/ui/chart.cjs.map +1 -1
- package/dist/cjs/components/ui/drawer.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdrawer.cjs +627 -0
- package/dist/cjs/components/ui/dropdrawer.cjs.map +1 -0
- package/dist/cjs/components/ui/highlight-text.cjs.map +1 -1
- package/dist/cjs/components/ui/pagination.cjs.map +1 -1
- package/dist/cjs/hooks/use-mobile.cjs.map +1 -1
- package/dist/cjs/index.cjs +35 -1
- package/dist/cjs/index.css +2194 -79
- package/dist/esm/components/ui/background-beams.js +1 -1
- package/dist/esm/components/ui/background-beams.js.map +1 -1
- package/dist/esm/components/ui/chart.js.map +1 -1
- package/dist/esm/components/ui/drawer.js.map +1 -1
- package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
- package/dist/esm/components/ui/dropdrawer.js +563 -0
- package/dist/esm/components/ui/dropdrawer.js.map +1 -0
- package/dist/esm/components/ui/highlight-text.js.map +1 -1
- package/dist/esm/components/ui/pagination.js.map +1 -1
- package/dist/esm/hooks/use-mobile.js.map +1 -1
- package/dist/esm/index.css +2194 -79
- package/dist/esm/index.js +13 -1
- package/dist/index.css +2194 -79
- package/dist/index.js +13 -1
- package/dist/types/components/ui/background-beams.d.ts +1 -1
- package/dist/types/components/ui/dropdrawer.d.ts +23 -0
- package/dist/types/hooks/use-mobile.d.ts +23 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +75 -62
- package/readme.md +2 -1
- package/src/components/ui/background-beams.tsx +3 -3
- package/src/components/ui/drawer.tsx +4 -4
- package/src/components/ui/dropdown-menu.tsx +9 -9
- package/src/components/ui/dropdrawer.tsx +973 -0
- package/src/hooks/use-mobile.tsx +37 -12
- package/src/index.ts +15 -0
- package/tsconfig.json +50 -50
package/src/hooks/use-mobile.tsx
CHANGED
|
@@ -1,19 +1,44 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
const MOBILE_BREAKPOINT = 768
|
|
3
|
+
const MOBILE_BREAKPOINT = 768;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A custom React hook that detects whether the current device is a mobile device
|
|
7
|
+
* based on the screen width.
|
|
8
|
+
*
|
|
9
|
+
* This hook uses a media query to check if the viewport width is less than the defined
|
|
10
|
+
* mobile breakpoint (768px). It updates the state when the window size changes.
|
|
11
|
+
*
|
|
12
|
+
* @returns {boolean} Returns true if the viewport width is less than the mobile breakpoint,
|
|
13
|
+
* false otherwise.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* function MyComponent() {
|
|
18
|
+
* const isMobile = useIsMobile();
|
|
19
|
+
*
|
|
20
|
+
* return (
|
|
21
|
+
* <div>
|
|
22
|
+
* {isMobile ? 'Mobile View' : 'Desktop View'}
|
|
23
|
+
* </div>
|
|
24
|
+
* );
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function useIsMobile(): boolean {
|
|
29
|
+
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(
|
|
30
|
+
undefined,
|
|
31
|
+
);
|
|
7
32
|
|
|
8
33
|
React.useEffect(() => {
|
|
9
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
|
34
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
10
35
|
const onChange = () => {
|
|
11
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
12
|
-
}
|
|
13
|
-
mql.addEventListener("change", onChange)
|
|
14
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
15
|
-
return () => mql.removeEventListener("change", onChange)
|
|
16
|
-
}, [])
|
|
36
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
37
|
+
};
|
|
38
|
+
mql.addEventListener("change", onChange);
|
|
39
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
40
|
+
return () => mql.removeEventListener("change", onChange);
|
|
41
|
+
}, []);
|
|
17
42
|
|
|
18
|
-
return !!isMobile
|
|
43
|
+
return !!isMobile;
|
|
19
44
|
}
|
package/src/index.ts
CHANGED
|
@@ -383,3 +383,18 @@ export { DotBackground } from "./components/ui/dot-background";
|
|
|
383
383
|
|
|
384
384
|
// Aceternity UI exports:
|
|
385
385
|
export { BackgroundBeams } from "./components/ui/background-beams";
|
|
386
|
+
|
|
387
|
+
// Jia Wei Ng export (https://github.com/jiaweing/DropDrawer):
|
|
388
|
+
export {
|
|
389
|
+
DropDrawer,
|
|
390
|
+
DropDrawerContent,
|
|
391
|
+
DropDrawerFooter,
|
|
392
|
+
DropDrawerGroup,
|
|
393
|
+
DropDrawerItem,
|
|
394
|
+
DropDrawerLabel,
|
|
395
|
+
DropDrawerSeparator,
|
|
396
|
+
DropDrawerSub,
|
|
397
|
+
DropDrawerSubContent,
|
|
398
|
+
DropDrawerSubTrigger,
|
|
399
|
+
DropDrawerTrigger,
|
|
400
|
+
} from "./components/ui/dropdrawer";
|
package/tsconfig.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ES2020",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"moduleResolution": "bundler",
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"jsx": "react-jsx",
|
|
13
|
-
"strict": true,
|
|
14
|
-
"noImplicitAny": true,
|
|
15
|
-
"noImplicitThis": true,
|
|
16
|
-
"noUnusedLocals": true,
|
|
17
|
-
"noErrorTruncation": true,
|
|
18
|
-
"noImplicitOverride": true,
|
|
19
|
-
"noImplicitReturns": true,
|
|
20
|
-
"noUnusedParameters": false,
|
|
21
|
-
"noFallthroughCasesInSwitch": true,
|
|
22
|
-
"useUnknownInCatchVariables": true,
|
|
23
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
24
|
-
"allowUnreachableCode": false,
|
|
25
|
-
"allowImportingTsExtensions": false,
|
|
26
|
-
"allowArbitraryExtensions": true,
|
|
27
|
-
"diagnostics": true,
|
|
28
|
-
"extendedDiagnostics": true,
|
|
29
|
-
"pretty": true,
|
|
30
|
-
"resolvePackageJsonExports": true,
|
|
31
|
-
"resolvePackageJsonImports": true,
|
|
32
|
-
"removeComments": false,
|
|
33
|
-
"allowUnusedLabels": false,
|
|
34
|
-
"declaration": true,
|
|
35
|
-
"sourceMap": true,
|
|
36
|
-
"declarationDir": "dist/types",
|
|
37
|
-
"emitDeclarationOnly": true,
|
|
38
|
-
"outDir": "dist",
|
|
39
|
-
"rootDir": "src",
|
|
40
|
-
"baseUrl": ".",
|
|
41
|
-
"paths": {
|
|
42
|
-
"@/*": ["./src/*"]
|
|
43
|
-
},
|
|
44
|
-
"types": ["@types/node", "@types/react", "@types/react-dom"],
|
|
45
|
-
"esModuleInterop": true,
|
|
46
|
-
"allowSyntheticDefaultImports": true
|
|
47
|
-
},
|
|
48
|
-
"include": ["src"],
|
|
49
|
-
"exclude": ["node_modules", "dist", "**/*.{test,stories}.{ts,tsx}"]
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"moduleResolution": "bundler",
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"jsx": "react-jsx",
|
|
13
|
+
"strict": true,
|
|
14
|
+
"noImplicitAny": true,
|
|
15
|
+
"noImplicitThis": true,
|
|
16
|
+
"noUnusedLocals": true,
|
|
17
|
+
"noErrorTruncation": true,
|
|
18
|
+
"noImplicitOverride": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noUnusedParameters": false,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"useUnknownInCatchVariables": true,
|
|
23
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
24
|
+
"allowUnreachableCode": false,
|
|
25
|
+
"allowImportingTsExtensions": false,
|
|
26
|
+
"allowArbitraryExtensions": true,
|
|
27
|
+
"diagnostics": true,
|
|
28
|
+
"extendedDiagnostics": true,
|
|
29
|
+
"pretty": true,
|
|
30
|
+
"resolvePackageJsonExports": true,
|
|
31
|
+
"resolvePackageJsonImports": true,
|
|
32
|
+
"removeComments": false,
|
|
33
|
+
"allowUnusedLabels": false,
|
|
34
|
+
"declaration": true,
|
|
35
|
+
"sourceMap": true,
|
|
36
|
+
"declarationDir": "dist/types",
|
|
37
|
+
"emitDeclarationOnly": true,
|
|
38
|
+
"outDir": "dist",
|
|
39
|
+
"rootDir": "src",
|
|
40
|
+
"baseUrl": ".",
|
|
41
|
+
"paths": {
|
|
42
|
+
"@/*": ["./src/*"]
|
|
43
|
+
},
|
|
44
|
+
"types": ["@types/node", "@types/react", "@types/react-dom"],
|
|
45
|
+
"esModuleInterop": true,
|
|
46
|
+
"allowSyntheticDefaultImports": true
|
|
47
|
+
},
|
|
48
|
+
"include": ["src"],
|
|
49
|
+
"exclude": ["node_modules", "dist", "**/*.{test,stories}.{ts,tsx}"]
|
|
50
|
+
}
|