@fuf-stack/pixels 0.5.8 → 0.6.0
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/dist/Avatar/index.cjs +9 -0
- package/dist/Avatar/index.cjs.map +1 -0
- package/dist/Avatar/index.d.cts +8 -0
- package/dist/Avatar/index.d.ts +8 -0
- package/dist/Avatar/index.js +9 -0
- package/dist/Avatar/index.js.map +1 -0
- package/dist/Avatar-Bl6oBjgb.d.cts +19 -0
- package/dist/Avatar-Bl6oBjgb.d.ts +19 -0
- package/dist/chunk-64K2TRGL.cjs +7 -0
- package/dist/chunk-64K2TRGL.cjs.map +1 -0
- package/dist/chunk-MM5H2WFG.js +7 -0
- package/dist/chunk-MM5H2WFG.js.map +1 -0
- package/dist/chunk-MWNBYTRN.cjs +72 -0
- package/dist/chunk-MWNBYTRN.cjs.map +1 -0
- package/dist/chunk-SFGC6YVH.js +36 -0
- package/dist/chunk-SFGC6YVH.js.map +1 -0
- package/dist/chunk-USOEZROT.js +72 -0
- package/dist/chunk-USOEZROT.js.map +1 -0
- package/dist/chunk-XGHRKDIM.cjs +36 -0
- package/dist/chunk-XGHRKDIM.cjs.map +1 -0
- package/dist/hooks/index.cjs +9 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +7 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.cjs +28 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -7
- package/dist/index.d.ts +4 -7
- package/dist/index.js +18 -74
- package/dist/index.js.map +1 -1
- package/dist/theme/index.cjs +7 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +7 -0
- package/dist/theme/index.js.map +1 -0
- package/package.json +20 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkXGHRKDIMcjs = require('../chunk-XGHRKDIM.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.Avatar = _chunkXGHRKDIMcjs.Avatar_default; exports.default = _chunkXGHRKDIMcjs.Avatar_default2;
|
|
9
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface AvatarProps {
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
7
|
+
/** CSS class name */
|
|
8
|
+
className?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
fallback?: React.ReactNode;
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
src: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Avatar component based on [NextUI Avatar](https://nextui.org/docs/components/avatar)
|
|
16
|
+
*/
|
|
17
|
+
declare const Avatar: ({ bordered, rounded, className, disabled, fallback, size, src, }: AvatarProps) => react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { Avatar as A, type AvatarProps as a };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface AvatarProps {
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
7
|
+
/** CSS class name */
|
|
8
|
+
className?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
fallback?: React.ReactNode;
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
src: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Avatar component based on [NextUI Avatar](https://nextui.org/docs/components/avatar)
|
|
16
|
+
*/
|
|
17
|
+
declare const Avatar: ({ bordered, rounded, className, disabled, fallback, size, src, }: AvatarProps) => react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { Avatar as A, type AvatarProps as a };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/index.ts"],"names":[],"mappings":";AACA,SAAS,cAAc","sourcesContent":["/* eslint-disable import/prefer-default-export */\nexport { nextui } from '@nextui-org/theme';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/index.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nexport { nextui } from '@nextui-org/theme';\n"],"mappings":";AACA,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/hooks/useDebounce.ts
|
|
2
|
+
var _react = require('react');
|
|
3
|
+
var useDebounce = (value, delay) => {
|
|
4
|
+
const [debouncedValue, setDebouncedValue] = _react.useState.call(void 0, value);
|
|
5
|
+
_react.useEffect.call(void 0,
|
|
6
|
+
() => {
|
|
7
|
+
const handler = setTimeout(() => {
|
|
8
|
+
setDebouncedValue(value);
|
|
9
|
+
}, delay);
|
|
10
|
+
return () => {
|
|
11
|
+
clearTimeout(handler);
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
[value, delay]
|
|
15
|
+
// Only re-call effect if value or delay changes
|
|
16
|
+
);
|
|
17
|
+
return debouncedValue;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/hooks/useLocalStorage.ts
|
|
21
|
+
|
|
22
|
+
var useLocalStorage = (key, initialValue) => {
|
|
23
|
+
const readValue = () => {
|
|
24
|
+
if (typeof window === "undefined") {
|
|
25
|
+
return initialValue;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const item = window.localStorage.getItem(key);
|
|
29
|
+
return item ? JSON.parse(item) : initialValue;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
32
|
+
return initialValue;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const [storedValue, setStoredValue] = _react.useState.call(void 0, readValue);
|
|
36
|
+
const setValue = (value) => {
|
|
37
|
+
if (typeof window === "undefined") {
|
|
38
|
+
console.warn(
|
|
39
|
+
`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
44
|
+
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
45
|
+
setStoredValue(newValue);
|
|
46
|
+
window.dispatchEvent(new Event("local-storage"));
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
_react.useEffect.call(void 0, () => {
|
|
52
|
+
setStoredValue(readValue());
|
|
53
|
+
}, []);
|
|
54
|
+
_react.useEffect.call(void 0, () => {
|
|
55
|
+
const handleStorageChange = () => {
|
|
56
|
+
setStoredValue(readValue());
|
|
57
|
+
};
|
|
58
|
+
window.addEventListener("storage", handleStorageChange);
|
|
59
|
+
window.addEventListener("local-storage", handleStorageChange);
|
|
60
|
+
return () => {
|
|
61
|
+
window.removeEventListener("storage", handleStorageChange);
|
|
62
|
+
window.removeEventListener("local-storage", handleStorageChange);
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
65
|
+
return [storedValue, setValue];
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
exports.useDebounce = useDebounce; exports.useLocalStorage = useLocalStorage;
|
|
72
|
+
//# sourceMappingURL=chunk-MWNBYTRN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useLocalStorage.ts"],"names":["useEffect","useState"],"mappings":";AAEA,SAAS,WAAW,gBAAgB;AAE7B,IAAM,cAAc,CAAQ,OAAc,UAAkB;AAEjE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,KAAK;AAC1D;AAAA,IACE,MAAM;AAEJ,YAAM,UAAU,WAAW,MAAM;AAC/B,0BAAkB,KAAK;AAAA,MACzB,GAAG,KAAK;AAIR,aAAO,MAAM;AACX,qBAAa,OAAO;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,OAAO,KAAK;AAAA;AAAA,EACf;AACA,SAAO;AACT;;;ACnBA,SAAS,aAAAA,YAAW,YAAAC,iBAAgB;AAE7B,IAAM,kBAAkB,CAC7B,KACA,iBACqC;AAGrC,QAAM,YAAY,MAAM;AAEtB,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO;AAAA,IACT;AAEA,QAAI;AACF,YAAM,OAAO,OAAO,aAAa,QAAQ,GAAG;AAC5C,aAAO,OAAO,KAAK,MAAM,IAAI,IAAI;AAAA,IACnC,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AAIA,QAAM,CAAC,aAAa,cAAc,IAAIA,UAAY,SAAS;AAI3D,QAAM,WAAwC,CAAC,UAAU;AAEvD,QAAI,OAAO,WAAW,aAAa;AACjC,cAAQ;AAAA,QACN,wCAAmC,GAAG;AAAA,MACxC;AAAA,IACF;AAEA,QAAI;AAEF,YAAM,WAAW,iBAAiB,WAAW,MAAM,WAAW,IAAI;AAGlE,aAAO,aAAa,QAAQ,KAAK,KAAK,UAAU,QAAQ,CAAC;AAGzD,qBAAe,QAAQ;AAGvB,aAAO,cAAc,IAAI,MAAM,eAAe,CAAC;AAAA,IACjD,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAAA,IAChE;AAAA,EACF;AAEA,EAAAD,WAAU,MAAM;AACd,mBAAe,UAAU,CAAC;AAAA,EAE5B,GAAG,CAAC,CAAC;AAEL,EAAAA,WAAU,MAAM;AACd,UAAM,sBAAsB,MAAM;AAChC,qBAAe,UAAU,CAAC;AAAA,IAC5B;AAGA,WAAO,iBAAiB,WAAW,mBAAmB;AAGtD,WAAO,iBAAiB,iBAAiB,mBAAmB;AAE5D,WAAO,MAAM;AACX,aAAO,oBAAoB,WAAW,mBAAmB;AACzD,aAAO,oBAAoB,iBAAiB,mBAAmB;AAAA,IACjE;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,SAAO,CAAC,aAAa,QAAQ;AAC/B","sourcesContent":["/* eslint-disable import/prefer-default-export */\n\nimport { useEffect, useState } from 'react';\n\nexport const useDebounce = <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nexport const useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/Avatar/Avatar.tsx
|
|
2
|
+
import { Avatar as NextAvatar } from "@nextui-org/avatar";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var Avatar = ({
|
|
5
|
+
bordered = false,
|
|
6
|
+
rounded = "full",
|
|
7
|
+
className = "",
|
|
8
|
+
disabled = false,
|
|
9
|
+
fallback = void 0,
|
|
10
|
+
size = "md",
|
|
11
|
+
src
|
|
12
|
+
}) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
NextAvatar,
|
|
15
|
+
{
|
|
16
|
+
className,
|
|
17
|
+
fallback,
|
|
18
|
+
isBordered: bordered,
|
|
19
|
+
isDisabled: disabled,
|
|
20
|
+
radius: rounded,
|
|
21
|
+
showFallback: !!fallback,
|
|
22
|
+
size,
|
|
23
|
+
src
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
var Avatar_default = Avatar;
|
|
28
|
+
|
|
29
|
+
// src/Avatar/index.ts
|
|
30
|
+
var Avatar_default2 = Avatar_default;
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
Avatar_default,
|
|
34
|
+
Avatar_default2
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-SFGC6YVH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Avatar/Avatar.tsx","../src/Avatar/index.ts"],"sourcesContent":["import type React from 'react';\n\nimport { Avatar as NextAvatar } from '@nextui-org/avatar';\n\nexport interface AvatarProps {\n /* Display a border ring around the Avatar */\n bordered?: boolean;\n /* Roundness of the border around the Avatar */\n rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full';\n /** CSS class name */\n className?: string;\n /* Disables the Avatar */\n disabled?: boolean;\n /* Fallback content to display if the image fails to load or is not provided */\n fallback?: React.ReactNode;\n /* Size of the Avatar */\n size?: 'sm' | 'md' | 'lg';\n /* Image source */\n src: string;\n}\n\n/**\n * Avatar component based on [NextUI Avatar](https://nextui.org/docs/components/avatar)\n */\nconst Avatar = ({\n bordered = false,\n rounded = 'full',\n className = '',\n disabled = false,\n fallback = undefined,\n size = 'md',\n src,\n}: AvatarProps) => {\n return (\n <NextAvatar\n className={className}\n fallback={fallback}\n isBordered={bordered}\n isDisabled={disabled}\n radius={rounded}\n showFallback={!!fallback}\n size={size}\n src={src}\n />\n );\n};\n\nexport default Avatar;\n","import Avatar from './Avatar';\n\nexport type { AvatarProps } from './Avatar';\n\nexport { Avatar };\n\nexport default Avatar;\n"],"mappings":";AAEA,SAAS,UAAU,kBAAkB;AAgCjC;AAVJ,IAAM,SAAS,CAAC;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP;AACF,MAAmB;AACjB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,cAAc,CAAC,CAAC;AAAA,MAChB;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,iBAAQ;;;ACzCf,IAAOA,kBAAQ;","names":["Avatar_default"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// src/hooks/useDebounce.ts
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
var useDebounce = (value, delay) => {
|
|
4
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
5
|
+
useEffect(
|
|
6
|
+
() => {
|
|
7
|
+
const handler = setTimeout(() => {
|
|
8
|
+
setDebouncedValue(value);
|
|
9
|
+
}, delay);
|
|
10
|
+
return () => {
|
|
11
|
+
clearTimeout(handler);
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
[value, delay]
|
|
15
|
+
// Only re-call effect if value or delay changes
|
|
16
|
+
);
|
|
17
|
+
return debouncedValue;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/hooks/useLocalStorage.ts
|
|
21
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
22
|
+
var useLocalStorage = (key, initialValue) => {
|
|
23
|
+
const readValue = () => {
|
|
24
|
+
if (typeof window === "undefined") {
|
|
25
|
+
return initialValue;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const item = window.localStorage.getItem(key);
|
|
29
|
+
return item ? JSON.parse(item) : initialValue;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
32
|
+
return initialValue;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const [storedValue, setStoredValue] = useState2(readValue);
|
|
36
|
+
const setValue = (value) => {
|
|
37
|
+
if (typeof window === "undefined") {
|
|
38
|
+
console.warn(
|
|
39
|
+
`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
44
|
+
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
45
|
+
setStoredValue(newValue);
|
|
46
|
+
window.dispatchEvent(new Event("local-storage"));
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
useEffect2(() => {
|
|
52
|
+
setStoredValue(readValue());
|
|
53
|
+
}, []);
|
|
54
|
+
useEffect2(() => {
|
|
55
|
+
const handleStorageChange = () => {
|
|
56
|
+
setStoredValue(readValue());
|
|
57
|
+
};
|
|
58
|
+
window.addEventListener("storage", handleStorageChange);
|
|
59
|
+
window.addEventListener("local-storage", handleStorageChange);
|
|
60
|
+
return () => {
|
|
61
|
+
window.removeEventListener("storage", handleStorageChange);
|
|
62
|
+
window.removeEventListener("local-storage", handleStorageChange);
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
65
|
+
return [storedValue, setValue];
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
useDebounce,
|
|
70
|
+
useLocalStorage
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=chunk-USOEZROT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useLocalStorage.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\n\nimport { useEffect, useState } from 'react';\n\nexport const useDebounce = <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","/* eslint-disable import/prefer-default-export */\n\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nexport const useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n"],"mappings":";AAEA,SAAS,WAAW,gBAAgB;AAE7B,IAAM,cAAc,CAAQ,OAAc,UAAkB;AAEjE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,KAAK;AAC1D;AAAA,IACE,MAAM;AAEJ,YAAM,UAAU,WAAW,MAAM;AAC/B,0BAAkB,KAAK;AAAA,MACzB,GAAG,KAAK;AAIR,aAAO,MAAM;AACX,qBAAa,OAAO;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,OAAO,KAAK;AAAA;AAAA,EACf;AACA,SAAO;AACT;;;ACnBA,SAAS,aAAAA,YAAW,YAAAC,iBAAgB;AAE7B,IAAM,kBAAkB,CAC7B,KACA,iBACqC;AAGrC,QAAM,YAAY,MAAM;AAEtB,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO;AAAA,IACT;AAEA,QAAI;AACF,YAAM,OAAO,OAAO,aAAa,QAAQ,GAAG;AAC5C,aAAO,OAAO,KAAK,MAAM,IAAI,IAAI;AAAA,IACnC,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AAIA,QAAM,CAAC,aAAa,cAAc,IAAIA,UAAY,SAAS;AAI3D,QAAM,WAAwC,CAAC,UAAU;AAEvD,QAAI,OAAO,WAAW,aAAa;AACjC,cAAQ;AAAA,QACN,wCAAmC,GAAG;AAAA,MACxC;AAAA,IACF;AAEA,QAAI;AAEF,YAAM,WAAW,iBAAiB,WAAW,MAAM,WAAW,IAAI;AAGlE,aAAO,aAAa,QAAQ,KAAK,KAAK,UAAU,QAAQ,CAAC;AAGzD,qBAAe,QAAQ;AAGvB,aAAO,cAAc,IAAI,MAAM,eAAe,CAAC;AAAA,IACjD,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAAA,IAChE;AAAA,EACF;AAEA,EAAAD,WAAU,MAAM;AACd,mBAAe,UAAU,CAAC;AAAA,EAE5B,GAAG,CAAC,CAAC;AAEL,EAAAA,WAAU,MAAM;AACd,UAAM,sBAAsB,MAAM;AAChC,qBAAe,UAAU,CAAC;AAAA,IAC5B;AAGA,WAAO,iBAAiB,WAAW,mBAAmB;AAGtD,WAAO,iBAAiB,iBAAiB,mBAAmB;AAE5D,WAAO,MAAM;AACX,aAAO,oBAAoB,WAAW,mBAAmB;AACzD,aAAO,oBAAoB,iBAAiB,mBAAmB;AAAA,IACjE;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,SAAO,CAAC,aAAa,QAAQ;AAC/B;","names":["useEffect","useState"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/Avatar/Avatar.tsx
|
|
2
|
+
var _avatar = require('@nextui-org/avatar');
|
|
3
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
4
|
+
var Avatar = ({
|
|
5
|
+
bordered = false,
|
|
6
|
+
rounded = "full",
|
|
7
|
+
className = "",
|
|
8
|
+
disabled = false,
|
|
9
|
+
fallback = void 0,
|
|
10
|
+
size = "md",
|
|
11
|
+
src
|
|
12
|
+
}) => {
|
|
13
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
14
|
+
_avatar.Avatar,
|
|
15
|
+
{
|
|
16
|
+
className,
|
|
17
|
+
fallback,
|
|
18
|
+
isBordered: bordered,
|
|
19
|
+
isDisabled: disabled,
|
|
20
|
+
radius: rounded,
|
|
21
|
+
showFallback: !!fallback,
|
|
22
|
+
size,
|
|
23
|
+
src
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
var Avatar_default = Avatar;
|
|
28
|
+
|
|
29
|
+
// src/Avatar/index.ts
|
|
30
|
+
var Avatar_default2 = Avatar_default;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
exports.Avatar_default = Avatar_default; exports.Avatar_default2 = Avatar_default2;
|
|
36
|
+
//# sourceMappingURL=chunk-XGHRKDIM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Avatar/Avatar.tsx","../src/Avatar/index.ts"],"names":["Avatar_default"],"mappings":";AAEA,SAAS,UAAU,kBAAkB;AAgCjC;AAVJ,IAAM,SAAS,CAAC;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP;AACF,MAAmB;AACjB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,cAAc,CAAC,CAAC;AAAA,MAChB;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,iBAAQ;;;ACzCf,IAAOA,kBAAQ","sourcesContent":["import type React from 'react';\n\nimport { Avatar as NextAvatar } from '@nextui-org/avatar';\n\nexport interface AvatarProps {\n /* Display a border ring around the Avatar */\n bordered?: boolean;\n /* Roundness of the border around the Avatar */\n rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full';\n /** CSS class name */\n className?: string;\n /* Disables the Avatar */\n disabled?: boolean;\n /* Fallback content to display if the image fails to load or is not provided */\n fallback?: React.ReactNode;\n /* Size of the Avatar */\n size?: 'sm' | 'md' | 'lg';\n /* Image source */\n src: string;\n}\n\n/**\n * Avatar component based on [NextUI Avatar](https://nextui.org/docs/components/avatar)\n */\nconst Avatar = ({\n bordered = false,\n rounded = 'full',\n className = '',\n disabled = false,\n fallback = undefined,\n size = 'md',\n src,\n}: AvatarProps) => {\n return (\n <NextAvatar\n className={className}\n fallback={fallback}\n isBordered={bordered}\n isDisabled={disabled}\n radius={rounded}\n showFallback={!!fallback}\n size={size}\n src={src}\n />\n );\n};\n\nexport default Avatar;\n","import Avatar from './Avatar';\n\nexport type { AvatarProps } from './Avatar';\n\nexport { Avatar };\n\nexport default Avatar;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkMWNBYTRNcjs = require('../chunk-MWNBYTRN.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.useDebounce = _chunkMWNBYTRNcjs.useDebounce; exports.useLocalStorage = _chunkMWNBYTRNcjs.useLocalStorage;
|
|
9
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const useDebounce: <Value>(value: Value, delay: number) => Value;
|
|
4
|
+
|
|
5
|
+
declare const useLocalStorage: <T>(key: string, initialValue: T | (() => T)) => [T, Dispatch<SetStateAction<T>>];
|
|
6
|
+
|
|
7
|
+
export { useDebounce, useLocalStorage };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const useDebounce: <Value>(value: Value, delay: number) => Value;
|
|
4
|
+
|
|
5
|
+
declare const useLocalStorage: <T>(key: string, initialValue: T | (() => T)) => [T, Dispatch<SetStateAction<T>>];
|
|
6
|
+
|
|
7
|
+
export { useDebounce, useLocalStorage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
var _chunkBSBPQXNGcjs = require('./chunk-BSBPQXNG.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkMWNBYTRNcjs = require('./chunk-MWNBYTRN.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunk64K2TRGLcjs = require('./chunk-64K2TRGL.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkXGHRKDIMcjs = require('./chunk-XGHRKDIM.cjs');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
4
18
|
var _chunkGIM2W4JHcjs = require('./chunk-GIM2W4JH.cjs');
|
|
5
19
|
|
|
6
20
|
|
|
@@ -25,89 +39,19 @@ var _chunkB35F4645cjs = require('./chunk-B35F4645.cjs');
|
|
|
25
39
|
|
|
26
40
|
|
|
27
41
|
|
|
28
|
-
var _chunkBSBPQXNGcjs = require('./chunk-BSBPQXNG.cjs');
|
|
29
42
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// Only re-call effect if value or delay changes
|
|
45
|
-
);
|
|
46
|
-
return debouncedValue;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
// src/hooks/useLocalStorage.ts
|
|
50
|
-
|
|
51
|
-
var useLocalStorage = (key, initialValue) => {
|
|
52
|
-
const readValue = () => {
|
|
53
|
-
if (typeof window === "undefined") {
|
|
54
|
-
return initialValue;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
const item = window.localStorage.getItem(key);
|
|
58
|
-
return item ? JSON.parse(item) : initialValue;
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
61
|
-
return initialValue;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const [storedValue, setStoredValue] = _react.useState.call(void 0, readValue);
|
|
65
|
-
const setValue = (value) => {
|
|
66
|
-
if (typeof window === "undefined") {
|
|
67
|
-
console.warn(
|
|
68
|
-
`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
73
|
-
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
74
|
-
setStoredValue(newValue);
|
|
75
|
-
window.dispatchEvent(new Event("local-storage"));
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
_react.useEffect.call(void 0, () => {
|
|
81
|
-
setStoredValue(readValue());
|
|
82
|
-
}, []);
|
|
83
|
-
_react.useEffect.call(void 0, () => {
|
|
84
|
-
const handleStorageChange = () => {
|
|
85
|
-
setStoredValue(readValue());
|
|
86
|
-
};
|
|
87
|
-
window.addEventListener("storage", handleStorageChange);
|
|
88
|
-
window.addEventListener("local-storage", handleStorageChange);
|
|
89
|
-
return () => {
|
|
90
|
-
window.removeEventListener("storage", handleStorageChange);
|
|
91
|
-
window.removeEventListener("local-storage", handleStorageChange);
|
|
92
|
-
};
|
|
93
|
-
}, []);
|
|
94
|
-
return [storedValue, setValue];
|
|
95
|
-
};
|
|
96
|
-
var useLocalStorage_default = useLocalStorage;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
exports.Button = _chunkND4VZZVUcjs.Button_default; exports.Card = _chunkGIM2W4JHcjs.Card_default; exports.Json = _chunkM7IVIJEAcjs.Json_default; exports.Label = _chunkBMKGS5PKcjs.Label_default; exports.Menu = _chunkHHTTNYDCcjs.Menu_default; exports.Modal = _chunkX2MUU2ZIcjs.Modal_default; exports.Popover = _chunkB35F4645cjs.Popover_default; exports.Tooltip = _chunkBSBPQXNGcjs.Tooltip_default; exports.buttonVariants = _chunkND4VZZVUcjs.buttonVariants; exports.cardVariants = _chunkGIM2W4JHcjs.cardVariants; exports.modalVariants = _chunkX2MUU2ZIcjs.modalVariants; exports.tooltipPlacementOptions = _chunkBSBPQXNGcjs.tooltipPlacementOptions; exports.useDebounce = useDebounce_default; exports.useLocalStorage = useLocalStorage_default;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
exports.Avatar = _chunkXGHRKDIMcjs.Avatar_default; exports.Button = _chunkND4VZZVUcjs.Button_default; exports.Card = _chunkGIM2W4JHcjs.Card_default; exports.Json = _chunkM7IVIJEAcjs.Json_default; exports.Label = _chunkBMKGS5PKcjs.Label_default; exports.Menu = _chunkHHTTNYDCcjs.Menu_default; exports.Modal = _chunkX2MUU2ZIcjs.Modal_default; exports.Popover = _chunkB35F4645cjs.Popover_default; exports.Tooltip = _chunkBSBPQXNGcjs.Tooltip_default; exports.buttonVariants = _chunkND4VZZVUcjs.buttonVariants; exports.cardVariants = _chunkGIM2W4JHcjs.cardVariants; exports.modalVariants = _chunkX2MUU2ZIcjs.modalVariants; exports.nextui = _chunk64K2TRGLcjs.nextui; exports.tooltipPlacementOptions = _chunkBSBPQXNGcjs.tooltipPlacementOptions; exports.useDebounce = _chunkMWNBYTRNcjs.useDebounce; exports.useLocalStorage = _chunkMWNBYTRNcjs.useLocalStorage;
|
|
113
57
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export { A as Avatar, a as AvatarProps } from './Avatar-Bl6oBjgb.cjs';
|
|
2
2
|
export { B as Button, a as ButtonProps, b as buttonVariants } from './Button-DS4qK4Lf.cjs';
|
|
3
3
|
export { C as Card, a as CardProps, c as cardVariants } from './Card-D5kspciY.cjs';
|
|
4
4
|
export { J as Json, a as JsonProps } from './Json-ClGDcbcp.cjs';
|
|
@@ -7,15 +7,12 @@ export { M as Menu, b as MenuItem, a as MenuProps, c as MenuSection } from './Me
|
|
|
7
7
|
export { M as Modal, a as ModalProps, m as modalVariants } from './Modal-Ck13vTaf.cjs';
|
|
8
8
|
export { _ as Popover, P as PopoverProps } from './Popover-DbTTk7_N.cjs';
|
|
9
9
|
export { T as Tooltip, a as TooltipProps, t as tooltipPlacementOptions } from './Tooltip-D4znH2L3.cjs';
|
|
10
|
+
export { useDebounce, useLocalStorage } from './hooks/index.cjs';
|
|
11
|
+
export { nextui } from '@nextui-org/theme';
|
|
10
12
|
import 'react/jsx-runtime';
|
|
13
|
+
import 'react';
|
|
11
14
|
import 'tailwind-variants';
|
|
12
15
|
import 'tailwind-variants/dist/config.js';
|
|
13
16
|
import '@nextui-org/button';
|
|
14
17
|
import '@nextui-org/chip';
|
|
15
18
|
import '@nextui-org/popover';
|
|
16
|
-
|
|
17
|
-
declare const _default: <Value>(value: Value, delay: number) => Value;
|
|
18
|
-
|
|
19
|
-
declare const useLocalStorage: <T>(key: string, initialValue: T | (() => T)) => [T, Dispatch<SetStateAction<T>>];
|
|
20
|
-
|
|
21
|
-
export { _default as useDebounce, useLocalStorage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export { A as Avatar, a as AvatarProps } from './Avatar-Bl6oBjgb.js';
|
|
2
2
|
export { B as Button, a as ButtonProps, b as buttonVariants } from './Button-DS4qK4Lf.js';
|
|
3
3
|
export { C as Card, a as CardProps, c as cardVariants } from './Card-D5kspciY.js';
|
|
4
4
|
export { J as Json, a as JsonProps } from './Json-ClGDcbcp.js';
|
|
@@ -7,15 +7,12 @@ export { M as Menu, b as MenuItem, a as MenuProps, c as MenuSection } from './Me
|
|
|
7
7
|
export { M as Modal, a as ModalProps, m as modalVariants } from './Modal-Ck13vTaf.js';
|
|
8
8
|
export { _ as Popover, P as PopoverProps } from './Popover-DbTTk7_N.js';
|
|
9
9
|
export { T as Tooltip, a as TooltipProps, t as tooltipPlacementOptions } from './Tooltip-D4znH2L3.js';
|
|
10
|
+
export { useDebounce, useLocalStorage } from './hooks/index.js';
|
|
11
|
+
export { nextui } from '@nextui-org/theme';
|
|
10
12
|
import 'react/jsx-runtime';
|
|
13
|
+
import 'react';
|
|
11
14
|
import 'tailwind-variants';
|
|
12
15
|
import 'tailwind-variants/dist/config.js';
|
|
13
16
|
import '@nextui-org/button';
|
|
14
17
|
import '@nextui-org/chip';
|
|
15
18
|
import '@nextui-org/popover';
|
|
16
|
-
|
|
17
|
-
declare const _default: <Value>(value: Value, delay: number) => Value;
|
|
18
|
-
|
|
19
|
-
declare const useLocalStorage: <T>(key: string, initialValue: T | (() => T)) => [T, Dispatch<SetStateAction<T>>];
|
|
20
|
-
|
|
21
|
-
export { _default as useDebounce, useLocalStorage };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip_default,
|
|
3
|
+
tooltipPlacementOptions
|
|
4
|
+
} from "./chunk-236GX7PP.js";
|
|
5
|
+
import {
|
|
6
|
+
useDebounce,
|
|
7
|
+
useLocalStorage
|
|
8
|
+
} from "./chunk-USOEZROT.js";
|
|
9
|
+
import {
|
|
10
|
+
nextui
|
|
11
|
+
} from "./chunk-MM5H2WFG.js";
|
|
12
|
+
import {
|
|
13
|
+
Avatar_default
|
|
14
|
+
} from "./chunk-SFGC6YVH.js";
|
|
1
15
|
import {
|
|
2
16
|
Card_default,
|
|
3
17
|
cardVariants
|
|
@@ -22,79 +36,8 @@ import {
|
|
|
22
36
|
import {
|
|
23
37
|
Popover_default
|
|
24
38
|
} from "./chunk-6G5VTF6K.js";
|
|
25
|
-
import {
|
|
26
|
-
Tooltip_default,
|
|
27
|
-
tooltipPlacementOptions
|
|
28
|
-
} from "./chunk-236GX7PP.js";
|
|
29
|
-
|
|
30
|
-
// src/hooks/useDebounce.ts
|
|
31
|
-
import { useEffect, useState } from "react";
|
|
32
|
-
var useDebounce_default = (value, delay) => {
|
|
33
|
-
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
34
|
-
useEffect(
|
|
35
|
-
() => {
|
|
36
|
-
const handler = setTimeout(() => {
|
|
37
|
-
setDebouncedValue(value);
|
|
38
|
-
}, delay);
|
|
39
|
-
return () => {
|
|
40
|
-
clearTimeout(handler);
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
[value, delay]
|
|
44
|
-
// Only re-call effect if value or delay changes
|
|
45
|
-
);
|
|
46
|
-
return debouncedValue;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
// src/hooks/useLocalStorage.ts
|
|
50
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
51
|
-
var useLocalStorage = (key, initialValue) => {
|
|
52
|
-
const readValue = () => {
|
|
53
|
-
if (typeof window === "undefined") {
|
|
54
|
-
return initialValue;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
const item = window.localStorage.getItem(key);
|
|
58
|
-
return item ? JSON.parse(item) : initialValue;
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
61
|
-
return initialValue;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const [storedValue, setStoredValue] = useState2(readValue);
|
|
65
|
-
const setValue = (value) => {
|
|
66
|
-
if (typeof window === "undefined") {
|
|
67
|
-
console.warn(
|
|
68
|
-
`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
73
|
-
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
74
|
-
setStoredValue(newValue);
|
|
75
|
-
window.dispatchEvent(new Event("local-storage"));
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
useEffect2(() => {
|
|
81
|
-
setStoredValue(readValue());
|
|
82
|
-
}, []);
|
|
83
|
-
useEffect2(() => {
|
|
84
|
-
const handleStorageChange = () => {
|
|
85
|
-
setStoredValue(readValue());
|
|
86
|
-
};
|
|
87
|
-
window.addEventListener("storage", handleStorageChange);
|
|
88
|
-
window.addEventListener("local-storage", handleStorageChange);
|
|
89
|
-
return () => {
|
|
90
|
-
window.removeEventListener("storage", handleStorageChange);
|
|
91
|
-
window.removeEventListener("local-storage", handleStorageChange);
|
|
92
|
-
};
|
|
93
|
-
}, []);
|
|
94
|
-
return [storedValue, setValue];
|
|
95
|
-
};
|
|
96
|
-
var useLocalStorage_default = useLocalStorage;
|
|
97
39
|
export {
|
|
40
|
+
Avatar_default as Avatar,
|
|
98
41
|
Button_default as Button,
|
|
99
42
|
Card_default as Card,
|
|
100
43
|
Json_default as Json,
|
|
@@ -106,8 +49,9 @@ export {
|
|
|
106
49
|
buttonVariants,
|
|
107
50
|
cardVariants,
|
|
108
51
|
modalVariants,
|
|
52
|
+
nextui,
|
|
109
53
|
tooltipPlacementOptions,
|
|
110
|
-
|
|
111
|
-
|
|
54
|
+
useDebounce,
|
|
55
|
+
useLocalStorage
|
|
112
56
|
};
|
|
113
57
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { nextui } from '@nextui-org/theme';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { nextui } from '@nextui-org/theme';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fuf-stack/pixels",
|
|
3
3
|
"description": "fuf react component library",
|
|
4
4
|
"author": "Hannes Tiede",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.6.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"module": "./dist/index.cjs",
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"require": "./dist/index.cjs",
|
|
15
15
|
"types": "./dist/index.d.ts"
|
|
16
16
|
},
|
|
17
|
+
"./Avatar": {
|
|
18
|
+
"import": "./dist/Avatar/index.js",
|
|
19
|
+
"require": "./dist/Avatar/index.cjs",
|
|
20
|
+
"types": "./dist/Avatar/index.d.ts"
|
|
21
|
+
},
|
|
17
22
|
"./Button": {
|
|
18
23
|
"import": "./dist/Button/index.js",
|
|
19
24
|
"require": "./dist/Button/index.cjs",
|
|
@@ -24,6 +29,11 @@
|
|
|
24
29
|
"require": "./dist/Card/index.cjs",
|
|
25
30
|
"types": "./dist/Card/index.d.ts"
|
|
26
31
|
},
|
|
32
|
+
"./hooks": {
|
|
33
|
+
"import": "./dist/hooks/index.js",
|
|
34
|
+
"require": "./dist/hooks/index.cjs",
|
|
35
|
+
"types": "./dist/hooks/index.d.ts"
|
|
36
|
+
},
|
|
27
37
|
"./Json": {
|
|
28
38
|
"import": "./dist/Json/index.js",
|
|
29
39
|
"require": "./dist/Json/index.cjs",
|
|
@@ -49,6 +59,11 @@
|
|
|
49
59
|
"require": "./dist/Popover/index.cjs",
|
|
50
60
|
"types": "./dist/Popover/index.d.ts"
|
|
51
61
|
},
|
|
62
|
+
"./theme": {
|
|
63
|
+
"import": "./dist/theme/index.js",
|
|
64
|
+
"require": "./dist/theme/index.cjs",
|
|
65
|
+
"types": "./dist/theme/index.d.ts"
|
|
66
|
+
},
|
|
52
67
|
"./Tooltip": {
|
|
53
68
|
"import": "./dist/Tooltip/index.js",
|
|
54
69
|
"require": "./dist/Tooltip/index.cjs",
|
|
@@ -80,6 +95,7 @@
|
|
|
80
95
|
"react-dom": ">=18"
|
|
81
96
|
},
|
|
82
97
|
"dependencies": {
|
|
98
|
+
"@nextui-org/avatar": "2.0.27",
|
|
83
99
|
"@nextui-org/button": "2.0.31",
|
|
84
100
|
"@nextui-org/card": "2.0.28",
|
|
85
101
|
"@nextui-org/chip": "2.0.28",
|
|
@@ -98,14 +114,14 @@
|
|
|
98
114
|
},
|
|
99
115
|
"devDependencies": {
|
|
100
116
|
"@types/debug": "4.1.12",
|
|
101
|
-
"@types/react": "18.3.
|
|
117
|
+
"@types/react": "18.3.3",
|
|
102
118
|
"@types/react-dom": "18.3.0",
|
|
103
119
|
"react": "18.3.1",
|
|
104
120
|
"react-dom": "18.3.1",
|
|
105
121
|
"@repo/storybook-config": "0.0.1",
|
|
106
122
|
"@repo/tailwind-config": "0.0.1",
|
|
107
|
-
"@repo/
|
|
108
|
-
"@repo/
|
|
123
|
+
"@repo/vite-config": "0.0.1",
|
|
124
|
+
"@repo/tsup-config": "0.0.1"
|
|
109
125
|
},
|
|
110
126
|
"scripts": {
|
|
111
127
|
"build": "tsup --config node_modules/@repo/tsup-config/config.ts",
|