@arolariu/components 0.1.0 → 0.1.2
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/EXAMPLES.md +1035 -1035
- package/LICENSE.md +21 -21
- package/changelog.md +9 -0
- package/dist/components/ui/bubble-background.js.map +1 -1
- package/dist/components/ui/chart.d.ts +25 -11
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +14 -11
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/dropdrawer.js +1 -1
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/typewriter.d.ts +18 -0
- package/dist/components/ui/typewriter.d.ts.map +1 -0
- package/dist/components/ui/typewriter.js +128 -0
- package/dist/components/ui/typewriter.js.map +1 -0
- package/dist/hooks/{use-mobile.d.ts → useIsMobile.d.ts} +1 -1
- package/dist/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/hooks/useIsMobile.js +19 -0
- package/dist/hooks/useIsMobile.js.map +1 -0
- package/dist/hooks/useWindowSize.d.ts +30 -0
- package/dist/hooks/useWindowSize.d.ts.map +1 -0
- package/dist/hooks/useWindowSize.js +28 -0
- package/dist/hooks/useWindowSize.js.map +1 -0
- package/dist/index.css +67 -25
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/lib/utils.js.map +1 -1
- package/package.json +52 -42
- package/src/components/ui/bubble-background.tsx +189 -189
- package/src/components/ui/chart.tsx +67 -35
- package/src/components/ui/dropdrawer.tsx +973 -973
- package/src/components/ui/sidebar.tsx +1 -1
- package/src/components/ui/typewriter.tsx +188 -0
- package/src/hooks/{use-mobile.tsx → useIsMobile.tsx} +45 -44
- package/src/hooks/useWindowSize.tsx +72 -0
- package/src/index.ts +408 -400
- package/src/lib/utils.ts +10 -10
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-mobile.js +0 -18
- package/dist/hooks/use-mobile.js.map +0 -1
package/src/lib/utils.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { clsx, type ClassValue } from "clsx";
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Helper function that merges tailwindcss
|
|
6
|
-
* class names in the given input array.
|
|
7
|
-
*/
|
|
8
|
-
export function cn(...inputs: ClassValue[]) {
|
|
9
|
-
return twMerge(clsx(inputs));
|
|
10
|
-
}
|
|
1
|
+
import { clsx, type ClassValue } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Helper function that merges tailwindcss
|
|
6
|
+
* class names in the given input array.
|
|
7
|
+
*/
|
|
8
|
+
export function cn(...inputs: ClassValue[]) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAgBrC"}
|
package/dist/hooks/use-mobile.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
const MOBILE_BREAKPOINT = 768;
|
|
3
|
-
function useIsMobile() {
|
|
4
|
-
const [isMobile, setIsMobile] = useState(void 0);
|
|
5
|
-
useEffect(()=>{
|
|
6
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
7
|
-
const onChange = ()=>{
|
|
8
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9
|
-
};
|
|
10
|
-
mql.addEventListener("change", onChange);
|
|
11
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
-
return ()=>mql.removeEventListener("change", onChange);
|
|
13
|
-
}, []);
|
|
14
|
-
return !!isMobile;
|
|
15
|
-
}
|
|
16
|
-
export { useIsMobile };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=use-mobile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks\\use-mobile.js","sources":["webpack://@arolariu/components/./src/hooks/use-mobile.tsx"],"sourcesContent":["import * as React from \"react\";\r\n\r\nconst MOBILE_BREAKPOINT = 768;\r\n\r\n/**\r\n * A custom React hook that detects whether the current device is a mobile device\r\n * based on the screen width.\r\n *\r\n * This hook uses a media query to check if the viewport width is less than the defined\r\n * mobile breakpoint (768px). It updates the state when the window size changes.\r\n *\r\n * @returns {boolean} Returns true if the viewport width is less than the mobile breakpoint,\r\n * false otherwise.\r\n *\r\n * @example\r\n * ```tsx\r\n * function MyComponent() {\r\n * const isMobile = useIsMobile();\r\n *\r\n * return (\r\n * <div>\r\n * {isMobile ? 'Mobile View' : 'Desktop View'}\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useIsMobile(): boolean {\r\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\r\n undefined,\r\n );\r\n\r\n React.useEffect(() => {\r\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\r\n const onChange = () => {\r\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\r\n };\r\n mql.addEventListener(\"change\", onChange);\r\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\r\n return () => mql.removeEventListener(\"change\", onChange);\r\n }, []);\r\n\r\n return !!isMobile;\r\n}\r\n"],"names":["MOBILE_BREAKPOINT","useIsMobile","isMobile","setIsMobile","React","undefined","mql","window","onChange"],"mappings":";AAEA,MAAMA,oBAAoB;AAyBnB,SAASC;IACd,MAAM,CAACC,UAAUC,YAAY,GAAGC,SAC9BC;IAGFD,UAAgB;QACd,MAAME,MAAMC,OAAO,UAAU,CAAC,CAAC,YAAY,EAAEP,oBAAoB,EAAE,GAAG,CAAC;QACvE,MAAMQ,WAAW;YACfL,YAAYI,OAAO,UAAU,GAAGP;QAClC;QACAM,IAAI,gBAAgB,CAAC,UAAUE;QAC/BL,YAAYI,OAAO,UAAU,GAAGP;QAChC,OAAO,IAAMM,IAAI,mBAAmB,CAAC,UAAUE;IACjD,GAAG,EAAE;IAEL,OAAO,CAAC,CAACN;AACX"}
|