@fuf-stack/pixels 0.41.2 → 0.41.4
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/Progress/index.cjs +3 -2
- package/dist/Progress/index.cjs.map +1 -1
- package/dist/Progress/index.js +2 -1
- package/dist/ProgressCircular/index.cjs +3 -2
- package/dist/ProgressCircular/index.cjs.map +1 -1
- package/dist/ProgressCircular/index.d.cts +2 -2
- package/dist/ProgressCircular/index.d.ts +2 -2
- package/dist/ProgressCircular/index.js +2 -1
- package/dist/{ProgressCircular-U4kPZ1T1.d.cts → ProgressCircular-DdDYbP2p.d.cts} +35 -0
- package/dist/{ProgressCircular-U4kPZ1T1.d.ts → ProgressCircular-DdDYbP2p.d.ts} +35 -0
- package/dist/{chunk-USOEZROT.js → chunk-B3XKBNXD.js} +15 -4
- package/dist/chunk-B3XKBNXD.js.map +1 -0
- package/dist/{chunk-GJQTAEHH.js → chunk-GK225P72.js} +19 -5
- package/dist/chunk-GK225P72.js.map +1 -0
- package/dist/{chunk-WCRVH4DS.cjs → chunk-JS2PJ6SL.cjs} +19 -5
- package/dist/chunk-JS2PJ6SL.cjs.map +1 -0
- package/dist/{chunk-RV7YPQXI.js → chunk-OGK2OQXX.js} +7 -3
- package/dist/chunk-OGK2OQXX.js.map +1 -0
- package/dist/{chunk-MWNBYTRN.cjs → chunk-OLI32URU.cjs} +13 -2
- package/dist/chunk-OLI32URU.cjs.map +1 -0
- package/dist/{chunk-VGXW3PSF.cjs → chunk-PK723NKO.cjs} +8 -4
- package/dist/chunk-PK723NKO.cjs.map +1 -0
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +8 -1
- package/dist/hooks/index.d.ts +8 -1
- package/dist/hooks/index.js +3 -1
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -3
- package/package.json +3 -3
- package/dist/chunk-GJQTAEHH.js.map +0 -1
- package/dist/chunk-MWNBYTRN.cjs.map +0 -1
- package/dist/chunk-RV7YPQXI.js.map +0 -1
- package/dist/chunk-USOEZROT.js.map +0 -1
- package/dist/chunk-VGXW3PSF.cjs.map +0 -1
- package/dist/chunk-WCRVH4DS.cjs.map +0 -1
package/dist/Progress/index.cjs
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkPK723NKOcjs = require('../chunk-PK723NKO.cjs');
|
|
6
|
+
require('../chunk-OLI32URU.cjs');
|
|
6
7
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
exports.Progress =
|
|
12
|
+
exports.Progress = _chunkPK723NKOcjs.Progress_default; exports.default = _chunkPK723NKOcjs.Progress_default2; exports.progressVariants = _chunkPK723NKOcjs.progressVariants;
|
|
12
13
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/Progress/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACF,4KAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/Progress/index.cjs"}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/Progress/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACF,4KAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/Progress/index.cjs"}
|
package/dist/Progress/index.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkJS2PJ6SLcjs = require('../chunk-JS2PJ6SL.cjs');
|
|
6
|
+
require('../chunk-OLI32URU.cjs');
|
|
6
7
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
exports.ProgressCircular =
|
|
12
|
+
exports.ProgressCircular = _chunkJS2PJ6SLcjs.ProgressCircular_default; exports.default = _chunkJS2PJ6SLcjs.ProgressCircular_default2; exports.progressCircularVariants = _chunkJS2PJ6SLcjs.progressCircularVariants;
|
|
12
13
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/ProgressCircular/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACF,oNAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/ProgressCircular/index.cjs"}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/ProgressCircular/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACF,oNAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/ProgressCircular/index.cjs"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProgressCircular } from '../ProgressCircular-
|
|
2
|
-
export { a as ProgressCircularProps, p as progressCircularVariants } from '../ProgressCircular-
|
|
1
|
+
import { P as ProgressCircular } from '../ProgressCircular-DdDYbP2p.cjs';
|
|
2
|
+
export { a as ProgressCircularProps, p as progressCircularVariants } from '../ProgressCircular-DdDYbP2p.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import 'tailwind-variants/dist/config.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProgressCircular } from '../ProgressCircular-
|
|
2
|
-
export { a as ProgressCircularProps, p as progressCircularVariants } from '../ProgressCircular-
|
|
1
|
+
import { P as ProgressCircular } from '../ProgressCircular-DdDYbP2p.js';
|
|
2
|
+
export { a as ProgressCircularProps, p as progressCircularVariants } from '../ProgressCircular-DdDYbP2p.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import 'tailwind-variants/dist/config.js';
|
|
@@ -2,7 +2,8 @@ import {
|
|
|
2
2
|
ProgressCircular_default,
|
|
3
3
|
ProgressCircular_default2,
|
|
4
4
|
progressCircularVariants
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-GK225P72.js";
|
|
6
|
+
import "../chunk-B3XKBNXD.js";
|
|
6
7
|
import "../chunk-J7N2552D.js";
|
|
7
8
|
export {
|
|
8
9
|
ProgressCircular_default as ProgressCircular,
|
|
@@ -33,6 +33,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
33
33
|
svg: string;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
+
isFinished: {
|
|
37
|
+
true: {
|
|
38
|
+
svg: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
36
41
|
size: {
|
|
37
42
|
xs: {
|
|
38
43
|
svg: string;
|
|
@@ -92,6 +97,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
92
97
|
svg: string;
|
|
93
98
|
};
|
|
94
99
|
};
|
|
100
|
+
isFinished: {
|
|
101
|
+
true: {
|
|
102
|
+
svg: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
95
105
|
size: {
|
|
96
106
|
xs: {
|
|
97
107
|
svg: string;
|
|
@@ -143,6 +153,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
143
153
|
svg: string;
|
|
144
154
|
};
|
|
145
155
|
};
|
|
156
|
+
isFinished: {
|
|
157
|
+
true: {
|
|
158
|
+
svg: string;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
146
161
|
size: {
|
|
147
162
|
xs: {
|
|
148
163
|
svg: string;
|
|
@@ -194,6 +209,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
194
209
|
svg: string;
|
|
195
210
|
};
|
|
196
211
|
};
|
|
212
|
+
isFinished: {
|
|
213
|
+
true: {
|
|
214
|
+
svg: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
197
217
|
size: {
|
|
198
218
|
xs: {
|
|
199
219
|
svg: string;
|
|
@@ -253,6 +273,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
253
273
|
svg: string;
|
|
254
274
|
};
|
|
255
275
|
};
|
|
276
|
+
isFinished: {
|
|
277
|
+
true: {
|
|
278
|
+
svg: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
256
281
|
size: {
|
|
257
282
|
xs: {
|
|
258
283
|
svg: string;
|
|
@@ -312,6 +337,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
312
337
|
svg: string;
|
|
313
338
|
};
|
|
314
339
|
};
|
|
340
|
+
isFinished: {
|
|
341
|
+
true: {
|
|
342
|
+
svg: string;
|
|
343
|
+
};
|
|
344
|
+
};
|
|
315
345
|
size: {
|
|
316
346
|
xs: {
|
|
317
347
|
svg: string;
|
|
@@ -363,6 +393,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
363
393
|
svg: string;
|
|
364
394
|
};
|
|
365
395
|
};
|
|
396
|
+
isFinished: {
|
|
397
|
+
true: {
|
|
398
|
+
svg: string;
|
|
399
|
+
};
|
|
400
|
+
};
|
|
366
401
|
size: {
|
|
367
402
|
xs: {
|
|
368
403
|
svg: string;
|
|
@@ -33,6 +33,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
33
33
|
svg: string;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
+
isFinished: {
|
|
37
|
+
true: {
|
|
38
|
+
svg: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
36
41
|
size: {
|
|
37
42
|
xs: {
|
|
38
43
|
svg: string;
|
|
@@ -92,6 +97,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
92
97
|
svg: string;
|
|
93
98
|
};
|
|
94
99
|
};
|
|
100
|
+
isFinished: {
|
|
101
|
+
true: {
|
|
102
|
+
svg: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
95
105
|
size: {
|
|
96
106
|
xs: {
|
|
97
107
|
svg: string;
|
|
@@ -143,6 +153,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
143
153
|
svg: string;
|
|
144
154
|
};
|
|
145
155
|
};
|
|
156
|
+
isFinished: {
|
|
157
|
+
true: {
|
|
158
|
+
svg: string;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
146
161
|
size: {
|
|
147
162
|
xs: {
|
|
148
163
|
svg: string;
|
|
@@ -194,6 +209,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
194
209
|
svg: string;
|
|
195
210
|
};
|
|
196
211
|
};
|
|
212
|
+
isFinished: {
|
|
213
|
+
true: {
|
|
214
|
+
svg: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
197
217
|
size: {
|
|
198
218
|
xs: {
|
|
199
219
|
svg: string;
|
|
@@ -253,6 +273,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
253
273
|
svg: string;
|
|
254
274
|
};
|
|
255
275
|
};
|
|
276
|
+
isFinished: {
|
|
277
|
+
true: {
|
|
278
|
+
svg: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
256
281
|
size: {
|
|
257
282
|
xs: {
|
|
258
283
|
svg: string;
|
|
@@ -312,6 +337,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
312
337
|
svg: string;
|
|
313
338
|
};
|
|
314
339
|
};
|
|
340
|
+
isFinished: {
|
|
341
|
+
true: {
|
|
342
|
+
svg: string;
|
|
343
|
+
};
|
|
344
|
+
};
|
|
315
345
|
size: {
|
|
316
346
|
xs: {
|
|
317
347
|
svg: string;
|
|
@@ -363,6 +393,11 @@ declare const progressCircularVariants: tailwind_variants.TVReturnType<{
|
|
|
363
393
|
svg: string;
|
|
364
394
|
};
|
|
365
395
|
};
|
|
396
|
+
isFinished: {
|
|
397
|
+
true: {
|
|
398
|
+
svg: string;
|
|
399
|
+
};
|
|
400
|
+
};
|
|
366
401
|
size: {
|
|
367
402
|
xs: {
|
|
368
403
|
svg: string;
|
|
@@ -17,8 +17,18 @@ var useDebounce = (value, delay) => {
|
|
|
17
17
|
return debouncedValue;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
// src/hooks/useIsInitialRenderCycle.ts
|
|
21
|
+
import { useEffect as useEffect2, useRef } from "react";
|
|
22
|
+
var useIsInitialRenderCycle = () => {
|
|
23
|
+
const isInitialRender = useRef(true);
|
|
24
|
+
useEffect2(() => {
|
|
25
|
+
isInitialRender.current = false;
|
|
26
|
+
}, []);
|
|
27
|
+
return isInitialRender.current;
|
|
28
|
+
};
|
|
29
|
+
|
|
20
30
|
// src/hooks/useLocalStorage.ts
|
|
21
|
-
import { useEffect as
|
|
31
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
22
32
|
var useLocalStorage = (key, initialValue) => {
|
|
23
33
|
const readValue = () => {
|
|
24
34
|
if (typeof window === "undefined") {
|
|
@@ -48,10 +58,10 @@ var useLocalStorage = (key, initialValue) => {
|
|
|
48
58
|
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
49
59
|
}
|
|
50
60
|
};
|
|
51
|
-
|
|
61
|
+
useEffect3(() => {
|
|
52
62
|
setStoredValue(readValue());
|
|
53
63
|
}, []);
|
|
54
|
-
|
|
64
|
+
useEffect3(() => {
|
|
55
65
|
const handleStorageChange = () => {
|
|
56
66
|
setStoredValue(readValue());
|
|
57
67
|
};
|
|
@@ -67,6 +77,7 @@ var useLocalStorage = (key, initialValue) => {
|
|
|
67
77
|
|
|
68
78
|
export {
|
|
69
79
|
useDebounce,
|
|
80
|
+
useIsInitialRenderCycle,
|
|
70
81
|
useLocalStorage
|
|
71
82
|
};
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-B3XKBNXD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useIsInitialRenderCycle.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 { useEffect, useRef } from 'react';\n\n/**\n * A hook that returns true on initial render and false afterward.\n *\n * @returns {boolean} - True on initial render, false afterward\n */\nexport const useIsInitialRenderCycle = (): boolean => {\n // Use ref to avoid re-renders\n const isInitialRender = useRef(true);\n\n // Update ref after first render\n useEffect(() => {\n // Set to false after component mounts\n isInitialRender.current = false;\n\n // No cleanup needed for this effect\n }, []);\n\n return isInitialRender.current;\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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AAG,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","useEffect","useState"]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useIsInitialRenderCycle
|
|
3
|
+
} from "./chunk-B3XKBNXD.js";
|
|
1
4
|
import {
|
|
2
5
|
__spreadValues
|
|
3
6
|
} from "./chunk-J7N2552D.js";
|
|
@@ -36,6 +39,11 @@ var progressCircularVariants = tv({
|
|
|
36
39
|
svg: "text-danger"
|
|
37
40
|
}
|
|
38
41
|
},
|
|
42
|
+
isFinished: {
|
|
43
|
+
true: {
|
|
44
|
+
svg: "text-success"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
39
47
|
size: {
|
|
40
48
|
xs: {
|
|
41
49
|
svg: "h-10 w-10",
|
|
@@ -71,14 +79,21 @@ var ProgressCircular = ({
|
|
|
71
79
|
size = "md",
|
|
72
80
|
color = "info"
|
|
73
81
|
}) => {
|
|
74
|
-
const
|
|
82
|
+
const isInitialRenderCycle = useIsInitialRenderCycle();
|
|
83
|
+
const isFinished = !hasError && percent >= 100;
|
|
84
|
+
const variants = progressCircularVariants({
|
|
85
|
+
color,
|
|
86
|
+
hasError,
|
|
87
|
+
isFinished,
|
|
88
|
+
size
|
|
89
|
+
});
|
|
75
90
|
const classNames = variantsToClassNames(variants, className, "base");
|
|
76
91
|
let value = format(percent);
|
|
77
92
|
let progressColor = color;
|
|
78
93
|
if (hasError) {
|
|
79
94
|
progressColor = "danger";
|
|
80
95
|
value = /* @__PURE__ */ jsx(FaTimes, { className: "text-danger" });
|
|
81
|
-
} else if (
|
|
96
|
+
} else if (isFinished) {
|
|
82
97
|
progressColor = "success";
|
|
83
98
|
value = /* @__PURE__ */ jsx(FaCheck, { className: "text-success" });
|
|
84
99
|
}
|
|
@@ -91,8 +106,7 @@ var ProgressCircular = ({
|
|
|
91
106
|
"aria-label": ariaLabel,
|
|
92
107
|
classNames,
|
|
93
108
|
color: heroUiColor,
|
|
94
|
-
disableAnimation,
|
|
95
|
-
formatOptions: void 0,
|
|
109
|
+
disableAnimation: isInitialRenderCycle || disableAnimation,
|
|
96
110
|
showValueLabel: true,
|
|
97
111
|
strokeWidth: 2,
|
|
98
112
|
value: percent || 0,
|
|
@@ -110,4 +124,4 @@ export {
|
|
|
110
124
|
ProgressCircular_default,
|
|
111
125
|
ProgressCircular_default2
|
|
112
126
|
};
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
127
|
+
//# sourceMappingURL=chunk-GK225P72.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ProgressCircular/ProgressCircular.tsx","../src/ProgressCircular/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { CircularProgressProps as HeroCircularProgressProps } from '@heroui/progress';\nimport type { ReactNode } from 'react';\n\nimport { FaCheck, FaTimes } from 'react-icons/fa';\n\nimport { CircularProgress as HeroCircularProgress } from '@heroui/progress';\nimport { circularProgress as heroCircularProgressVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useIsInitialRenderCycle } from '../hooks';\n\nexport const progressCircularVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the circle (finished part)\n indicator: '',\n // label next to the svgWrapper\n label: '',\n // wrapper for the circle\n svg: '',\n // wrapper around progress svg and value span\n svgWrapper: '',\n // track of the circle (not finished part)\n track: 'stroke-default-50',\n // outer span next to the svg\n value: '',\n },\n variants: {\n color: {\n info: {\n svg: 'text-info',\n },\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n ...heroCircularProgressVariants.variants.color,\n },\n hasError: {\n true: {\n svg: 'text-danger',\n },\n },\n isFinished: {\n true: {\n svg: 'text-success',\n },\n },\n size: {\n xs: {\n svg: 'h-10 w-10',\n value: 'text-xs',\n },\n sm: {\n svg: 'h-12 w-12',\n value: 'text-sm',\n },\n md: {\n svg: 'h-16 w-16',\n value: 'text-md',\n },\n lg: {\n svg: 'h-20 w-20',\n value: 'text-lg',\n },\n xl: {\n svg: 'h-24 w-24',\n value: 'text-xl',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof progressCircularVariants>;\ntype ClassName = TVClassName<typeof progressCircularVariants>;\n\nexport interface ProgressCircularProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color options */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** formats the display value of the progress in the center */\n format?: (percent?: number) => ReactNode;\n /** enables error version */\n hasError?: boolean;\n /** percentage / progress of the circular progress bar */\n percent: number;\n /** size options */\n size?: VariantProps['size'];\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * ProgressCircular component based on [HeroUI CircularProgress](https://www.heroui.com/docs/components/circular-progress)\n */\nconst ProgressCircular = ({\n ariaLabel = 'progress',\n className = undefined,\n format = defaultFormat,\n hasError = false,\n percent,\n disableAnimation = false,\n size = 'md',\n color = 'info',\n}: ProgressCircularProps) => {\n // used to disable animation on initial render cycle\n const isInitialRenderCycle = useIsInitialRenderCycle();\n\n const isFinished = !hasError && percent >= 100;\n const variants = progressCircularVariants({\n color,\n hasError,\n isFinished,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // format value\n let value = format(percent);\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (hasError) {\n progressColor = 'danger';\n value = <FaTimes className=\"text-danger\" />;\n } else if (isFinished) {\n progressColor = 'success';\n value = <FaCheck className=\"text-success\" />;\n }\n\n // pass only HeroUI colors as props\n const heroUiColor = Object.keys(\n heroCircularProgressVariants.variants.color,\n ).includes(color)\n ? (progressColor as HeroCircularProgressProps['color'])\n : undefined;\n\n return (\n <HeroCircularProgress\n aria-label={ariaLabel}\n classNames={classNames}\n color={heroUiColor}\n disableAnimation={isInitialRenderCycle || disableAnimation}\n showValueLabel\n strokeWidth={2}\n // we do not use spinner animation when no percent provided\n value={percent || 0}\n valueLabel={value}\n />\n );\n};\n\nexport default ProgressCircular;\n","import ProgressCircular, { progressCircularVariants } from './ProgressCircular';\n\nexport type { ProgressCircularProps } from './ProgressCircular';\n\nexport { ProgressCircular, progressCircularVariants };\n\nexport default ProgressCircular;\n"],"mappings":";;;;;;;;AAIA,SAAS,SAAS,eAAe;AAEjC,SAAS,oBAAoB,4BAA4B;AACzD,SAAS,oBAAoB,oCAAoC;AAEjE,SAAS,IAAI,4BAA4B;AAyH7B;AArHL,IAAM,2BAA2B,GAAG;AAAA,EACzC,OAAO;AAAA;AAAA,IAEL,MAAM;AAAA;AAAA,IAEN,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA;AAAA,IAEP,KAAK;AAAA;AAAA,IAEL,YAAY;AAAA;AAAA,IAEZ,OAAO;AAAA;AAAA,IAEP,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,MACL,MAAM;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,OAEG,6BAA6B,SAAS;AAAA,IAE3C,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,QACF,KAAK;AAAA,QACL,OAAO;AAAA,MACT;AAAA,MACA,I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;;;ACxJf,IAAOA,4BAAQ;","names":["ProgressCircular_default"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkOLI32URUcjs = require('./chunk-OLI32URU.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunkD4TLDLEXcjs = require('./chunk-D4TLDLEX.cjs');
|
|
4
7
|
|
|
5
8
|
// src/ProgressCircular/ProgressCircular.tsx
|
|
@@ -36,6 +39,11 @@ var progressCircularVariants = _pixelutils.tv.call(void 0, {
|
|
|
36
39
|
svg: "text-danger"
|
|
37
40
|
}
|
|
38
41
|
},
|
|
42
|
+
isFinished: {
|
|
43
|
+
true: {
|
|
44
|
+
svg: "text-success"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
39
47
|
size: {
|
|
40
48
|
xs: {
|
|
41
49
|
svg: "h-10 w-10",
|
|
@@ -71,14 +79,21 @@ var ProgressCircular = ({
|
|
|
71
79
|
size = "md",
|
|
72
80
|
color = "info"
|
|
73
81
|
}) => {
|
|
74
|
-
const
|
|
82
|
+
const isInitialRenderCycle = _chunkOLI32URUcjs.useIsInitialRenderCycle.call(void 0, );
|
|
83
|
+
const isFinished = !hasError && percent >= 100;
|
|
84
|
+
const variants = progressCircularVariants({
|
|
85
|
+
color,
|
|
86
|
+
hasError,
|
|
87
|
+
isFinished,
|
|
88
|
+
size
|
|
89
|
+
});
|
|
75
90
|
const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
|
|
76
91
|
let value = format(percent);
|
|
77
92
|
let progressColor = color;
|
|
78
93
|
if (hasError) {
|
|
79
94
|
progressColor = "danger";
|
|
80
95
|
value = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa.FaTimes, { className: "text-danger" });
|
|
81
|
-
} else if (
|
|
96
|
+
} else if (isFinished) {
|
|
82
97
|
progressColor = "success";
|
|
83
98
|
value = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa.FaCheck, { className: "text-success" });
|
|
84
99
|
}
|
|
@@ -91,8 +106,7 @@ var ProgressCircular = ({
|
|
|
91
106
|
"aria-label": ariaLabel,
|
|
92
107
|
classNames,
|
|
93
108
|
color: heroUiColor,
|
|
94
|
-
disableAnimation,
|
|
95
|
-
formatOptions: void 0,
|
|
109
|
+
disableAnimation: isInitialRenderCycle || disableAnimation,
|
|
96
110
|
showValueLabel: true,
|
|
97
111
|
strokeWidth: 2,
|
|
98
112
|
value: percent || 0,
|
|
@@ -110,4 +124,4 @@ var ProgressCircular_default2 = ProgressCircular_default;
|
|
|
110
124
|
|
|
111
125
|
|
|
112
126
|
exports.progressCircularVariants = progressCircularVariants; exports.ProgressCircular_default = ProgressCircular_default; exports.ProgressCircular_default2 = ProgressCircular_default2;
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
127
|
+
//# sourceMappingURL=chunk-JS2PJ6SL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-JS2PJ6SL.cjs","../src/ProgressCircular/ProgressCircular.tsx","../src/ProgressCircular/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACHA,oCAAiC;AAEjC,4CAAyD;AACzD,sCAAiE;AAEjE,oDAAyC;AAyH7B,+CAAA;AArHL,IAAM,yBAAA,EAA2B,4BAAA;AAAG,EACzC,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,SAAA,EAAW,EAAA;AAAA;AAAA,IAEX,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,GAAA,EAAK,EAAA;AAAA;AAAA,IAEL,UAAA,EAAY,EAAA;AAAA;AAAA,IAEZ,KAAA,EAAO,mBAAA;AAAA;AAAA,IAEP,KAAA,EAAO;AAAA,EACT,CAAA;AAAA,EACA,QAAA,EAAU;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AACX,EAAA;AAG2B,EAAA;AACI,IAAA;AAG3B,EAAA;AAGF,EAAA;AAAC,IAAA;AAAA,IAAA;AACa,MAAA;AACZ,MAAA;AACO,MAAA;AACW,MAAA;AACJ,MAAA;AACD,MAAA;AAEK,MAAA;AACN,MAAA;AAAA,IAAA;AACd,EAAA;AAEJ;AAEe;ADzCuB;AACA;AEhHvB;AFkHuB;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-JS2PJ6SL.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { CircularProgressProps as HeroCircularProgressProps } from '@heroui/progress';\nimport type { ReactNode } from 'react';\n\nimport { FaCheck, FaTimes } from 'react-icons/fa';\n\nimport { CircularProgress as HeroCircularProgress } from '@heroui/progress';\nimport { circularProgress as heroCircularProgressVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useIsInitialRenderCycle } from '../hooks';\n\nexport const progressCircularVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the circle (finished part)\n indicator: '',\n // label next to the svgWrapper\n label: '',\n // wrapper for the circle\n svg: '',\n // wrapper around progress svg and value span\n svgWrapper: '',\n // track of the circle (not finished part)\n track: 'stroke-default-50',\n // outer span next to the svg\n value: '',\n },\n variants: {\n color: {\n info: {\n svg: 'text-info',\n },\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n ...heroCircularProgressVariants.variants.color,\n },\n hasError: {\n true: {\n svg: 'text-danger',\n },\n },\n isFinished: {\n true: {\n svg: 'text-success',\n },\n },\n size: {\n xs: {\n svg: 'h-10 w-10',\n value: 'text-xs',\n },\n sm: {\n svg: 'h-12 w-12',\n value: 'text-sm',\n },\n md: {\n svg: 'h-16 w-16',\n value: 'text-md',\n },\n lg: {\n svg: 'h-20 w-20',\n value: 'text-lg',\n },\n xl: {\n svg: 'h-24 w-24',\n value: 'text-xl',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof progressCircularVariants>;\ntype ClassName = TVClassName<typeof progressCircularVariants>;\n\nexport interface ProgressCircularProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color options */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** formats the display value of the progress in the center */\n format?: (percent?: number) => ReactNode;\n /** enables error version */\n hasError?: boolean;\n /** percentage / progress of the circular progress bar */\n percent: number;\n /** size options */\n size?: VariantProps['size'];\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * ProgressCircular component based on [HeroUI CircularProgress](https://www.heroui.com/docs/components/circular-progress)\n */\nconst ProgressCircular = ({\n ariaLabel = 'progress',\n className = undefined,\n format = defaultFormat,\n hasError = false,\n percent,\n disableAnimation = false,\n size = 'md',\n color = 'info',\n}: ProgressCircularProps) => {\n // used to disable animation on initial render cycle\n const isInitialRenderCycle = useIsInitialRenderCycle();\n\n const isFinished = !hasError && percent >= 100;\n const variants = progressCircularVariants({\n color,\n hasError,\n isFinished,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // format value\n let value = format(percent);\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (hasError) {\n progressColor = 'danger';\n value = <FaTimes className=\"text-danger\" />;\n } else if (isFinished) {\n progressColor = 'success';\n value = <FaCheck className=\"text-success\" />;\n }\n\n // pass only HeroUI colors as props\n const heroUiColor = Object.keys(\n heroCircularProgressVariants.variants.color,\n ).includes(color)\n ? (progressColor as HeroCircularProgressProps['color'])\n : undefined;\n\n return (\n <HeroCircularProgress\n aria-label={ariaLabel}\n classNames={classNames}\n color={heroUiColor}\n disableAnimation={isInitialRenderCycle || disableAnimation}\n showValueLabel\n strokeWidth={2}\n // we do not use spinner animation when no percent provided\n value={percent || 0}\n valueLabel={value}\n />\n );\n};\n\nexport default ProgressCircular;\n","import ProgressCircular, { progressCircularVariants } from './ProgressCircular';\n\nexport type { ProgressCircularProps } from './ProgressCircular';\n\nexport { ProgressCircular, progressCircularVariants };\n\nexport default ProgressCircular;\n"]}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useIsInitialRenderCycle
|
|
3
|
+
} from "./chunk-B3XKBNXD.js";
|
|
4
|
+
|
|
1
5
|
// src/Progress/Progress.tsx
|
|
2
6
|
import { Progress as HeroProgress } from "@heroui/progress";
|
|
3
7
|
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
@@ -58,6 +62,7 @@ var Progress = ({
|
|
|
58
62
|
size = "md",
|
|
59
63
|
testId = void 0
|
|
60
64
|
}) => {
|
|
65
|
+
const isInitialRenderCycle = useIsInitialRenderCycle();
|
|
61
66
|
let progressColor = color;
|
|
62
67
|
if (percent >= 100) {
|
|
63
68
|
progressColor = "success";
|
|
@@ -71,8 +76,7 @@ var Progress = ({
|
|
|
71
76
|
"aria-label": ariaLabel,
|
|
72
77
|
classNames,
|
|
73
78
|
"data-testid": testId,
|
|
74
|
-
disableAnimation,
|
|
75
|
-
formatOptions: void 0,
|
|
79
|
+
disableAnimation: isInitialRenderCycle || disableAnimation,
|
|
76
80
|
isIndeterminate: indeterminate,
|
|
77
81
|
label,
|
|
78
82
|
showValueLabel,
|
|
@@ -92,4 +96,4 @@ export {
|
|
|
92
96
|
Progress_default,
|
|
93
97
|
Progress_default2
|
|
94
98
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-OGK2OQXX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Progress/Progress.tsx","../src/Progress/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Progress as HeroProgress } from '@heroui/progress';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useIsInitialRenderCycle } from '../hooks';\n\n// progress styling variants\nexport const progressVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the progress (finished part)\n indicator: '',\n // label at the top left of the progress bar\n label: '',\n // wrapper around progress label and label span\n labelWrapper: '',\n // track of the progress (not finished part)\n track: '',\n // span around the progress value\n value: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n color: {\n danger: {\n indicator: 'bg-danger',\n },\n default: {\n indicator: 'bg-default-400',\n },\n info: {\n indicator: 'bg-info',\n },\n primary: {\n indicator: 'bg-primary',\n },\n secondary: {\n indicator: 'bg-secondary',\n },\n success: {\n indicator: 'bg-success',\n },\n warning: {\n indicator: 'bg-warning',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof progressVariants>;\ntype ClassName = TVClassName<typeof progressVariants>;\n\nexport interface ProgressProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color of the progress bar */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** function to format the progress value */\n format?: (percent: number) => ReactNode;\n /** shows indeterminate progress animation */\n indeterminate?: boolean;\n /** label of the progress bar */\n label?: ReactNode;\n /** percentage / progress of the progress bar */\n percent: number;\n /** whether to show the value label */\n showValueLabel?: boolean;\n /** size of the progress bar */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)\n */\nconst Progress = ({\n ariaLabel = 'progress',\n className = undefined,\n color = 'info',\n disableAnimation = false,\n format = defaultFormat,\n indeterminate = false,\n label = undefined,\n percent,\n showValueLabel = false,\n size = 'md',\n testId = undefined,\n}: ProgressProps) => {\n // used to disable animation on initial render cycle\n const isInitialRenderCycle = useIsInitialRenderCycle();\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (percent >= 100) {\n progressColor = 'success';\n }\n\n const variants = progressVariants({ color: progressColor });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const value = format(percent);\n\n return (\n <HeroProgress\n aria-label={ariaLabel}\n classNames={classNames}\n data-testid={testId}\n disableAnimation={isInitialRenderCycle || disableAnimation}\n isIndeterminate={indeterminate}\n label={label}\n showValueLabel={showValueLabel}\n size={size}\n value={percent || 0}\n valueLabel={!!percent && value}\n />\n );\n};\n\nexport default Progress;\n","import Progress, { progressVariants } from './Progress';\n\nexport type { ProgressProps } from './Progress';\n\nexport { Progress, progressVariants };\n\nexport default Progress;\n"],"mappings":";;;;;AAGA,SAAS,YAAY,oBAAoB;AAEzC,SAAS,IAAI,4BAA4B;AA8GrC;AAzGG,IAAM,mBAAmB,GAAG;AAAA,EACjC,OAAO;AAAA;AAAA,IAEL,MAAM;AAAA;AAAA,IAEN,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA;AAAA,IAEP,cAAc;AAAA;AAAA,IAEd,OAAO;AAAA;AAAA,IAEP,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA;AAAA,IAER,OAAO;AAAA,MACL,QAAQ;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,WAAW;AAAA,QACT,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF,CAAC;AA+BD,IAAM,gBAAgB,CAAC,UAAU,MAAM,GAAG,OAAO;AAKjD,IAAM,WAAW,CAAC;AAAA,EAChB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AAAA,EACA,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,SAAS;AACX,MAAqB;AAEnB,QAAM,uBAAuB,wBAAwB;AAGrD,MAAI,gBAAuC;AAC3C,MAAI,WAAW,KAAK;AAClB,oBAAgB;AAAA,EAClB;AAEA,QAAM,WAAW,iBAAiB,EAAE,OAAO,cAAc,CAAC;AAC1D,QAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;AAEnE,QAAM,QAAQ,OAAO,OAAO;AAE5B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ;AAAA,MACA,eAAa;AAAA,MACb,kBAAkB,wBAAwB;AAAA,MAC1C,iBAAiB;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,WAAW;AAAA,MAClB,YAAY,CAAC,CAAC,WAAW;AAAA;AAAA,EAC3B;AAEJ;AAEA,IAAO,mBAAQ;;;AC5Hf,IAAOA,oBAAQ;","names":["Progress_default"]}
|
|
@@ -17,6 +17,16 @@ var useDebounce = (value, delay) => {
|
|
|
17
17
|
return debouncedValue;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
// src/hooks/useIsInitialRenderCycle.ts
|
|
21
|
+
|
|
22
|
+
var useIsInitialRenderCycle = () => {
|
|
23
|
+
const isInitialRender = _react.useRef.call(void 0, true);
|
|
24
|
+
_react.useEffect.call(void 0, () => {
|
|
25
|
+
isInitialRender.current = false;
|
|
26
|
+
}, []);
|
|
27
|
+
return isInitialRender.current;
|
|
28
|
+
};
|
|
29
|
+
|
|
20
30
|
// src/hooks/useLocalStorage.ts
|
|
21
31
|
|
|
22
32
|
var useLocalStorage = (key, initialValue) => {
|
|
@@ -68,5 +78,6 @@ var useLocalStorage = (key, initialValue) => {
|
|
|
68
78
|
|
|
69
79
|
|
|
70
80
|
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
|
|
82
|
+
exports.useDebounce = useDebounce; exports.useIsInitialRenderCycle = useIsInitialRenderCycle; exports.useLocalStorage = useLocalStorage;
|
|
83
|
+
//# sourceMappingURL=chunk-OLI32URU.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-OLI32URU.cjs","../src/hooks/useDebounce.ts","../src/hooks/useIsInitialRenderCycle.ts","../src/hooks/useLocalStorage.ts"],"names":["useEffect","useState"],"mappings":"AAAA;ACEA,8BAAoC;AAE7B,IAAM,YAAA,EAAc,CAAQ,KAAA,EAAc,KAAA,EAAA,GAAkB;AAEjE,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,EAAA,EAAI,6BAAA,KAAc,CAAA;AAC1D,EAAA,8BAAA;AAAA,IACE,CAAA,EAAA,GAAM;AAEJ,MAAA,MAAM,QAAA,EAAU,UAAA,CAAW,CAAA,EAAA,GAAM;AAC/B,QAAA,iBAAA,CAAkB,KAAK,CAAA;AAAA,MACzB,CAAA,EAAG,KAAK,CAAA;AAIR,MAAA,OAAO,CAAA,EAAA,GAAM;AACX,QAAA,YAAA,CAAa,OAAO,CAAA;AAAA,MACtB,CAAA;AAAA,IACF,CAAA;AAAA,IACA,CAAC,KAAA,EAAO,KAAK;AAAA;AAAA,EACf,CAAA;AACA,EAAA,OAAO,cAAA;AACT,CAAA;ADLA;AACA;AEjBA;AAOO,IAAM,wBAAA,EAA0B,CAAA,EAAA,GAAe;AAEpD,EAAA,MAAM,gBAAA,EAAkB,2BAAA,IAAW,CAAA;AAGnC,EAAAA,8BAAAA,CAAU,EAAA,GAAM;AAEd,IAAA,eAAA,CAAgB,QAAA,EAAU,KAAA;AAAA,EAG5B,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,OAAO,eAAA,CAAgB,OAAA;AACzB,CAAA;AFMA;AACA;AGzBA;AAEO,IAAM,gBAAA,EAAkB,CAC7B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IAAA,CAAK,CAAA,qCAAA,EAAmC,GAAG,CAAA,OAAA,CAAA,EAAM,KAAK,CAAA;AAAA,IAChE;AAAA,EACF,CAAA;AAEA,EAAAD,8BAAAA,CAAU,EAAA,GAAM;AACd,IAAA,cAAA,CAAe,SAAA,CAAU,CAAC,CAAA;AAAA,EAE5B,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAAA,8BAAAA,CAAU,EAAA,GAAM;AACd,IAAA,MAAM,oBAAA,EAAsB,CAAA,EAAA,GAAM;AAChC,MAAA,cAAA,CAAe,SAAA,CAAU,CAAC,CAAA;AAAA,IAC5B,CAAA;AAGA,IAAA,MAAA,CAAO,gBAAA,CAAiB,SAAA,EAAW,mBAAmB,CAAA;AAGtD,IAAA,MAAA,CAAO,gBAAA,CAAiB,eAAA,EAAiB,mBAAmB,CAAA;AAE5D,IAAA,OAAO,CAAA,EAAA,GAAM;AACX,MAAA,MAAA,CAAO,mBAAA,CAAoB,SAAA,EAAW,mBAAmB,CAAA;AACzD,MAAA,MAAA,CAAO,mBAAA,CAAoB,eAAA,EAAiB,mBAAmB,CAAA;AAAA,IACjE,CAAA;AAAA,EAEF,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,OAAO,CAAC,WAAA,EAAa,QAAQ,CAAA;AAC/B,CAAA;AHNA;AACA;AACE;AACA;AACA;AACF,wIAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-OLI32URU.cjs","sourcesContent":[null,"/* 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 { useEffect, useRef } from 'react';\n\n/**\n * A hook that returns true on initial render and false afterward.\n *\n * @returns {boolean} - True on initial render, false afterward\n */\nexport const useIsInitialRenderCycle = (): boolean => {\n // Use ref to avoid re-renders\n const isInitialRender = useRef(true);\n\n // Update ref after first render\n useEffect(() => {\n // Set to false after component mounts\n isInitialRender.current = false;\n\n // No cleanup needed for this effect\n }, []);\n\n return isInitialRender.current;\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"]}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkOLI32URUcjs = require('./chunk-OLI32URU.cjs');
|
|
4
|
+
|
|
5
|
+
// src/Progress/Progress.tsx
|
|
2
6
|
var _progress = require('@heroui/progress');
|
|
3
7
|
var _pixelutils = require('@fuf-stack/pixel-utils');
|
|
4
8
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -58,6 +62,7 @@ var Progress = ({
|
|
|
58
62
|
size = "md",
|
|
59
63
|
testId = void 0
|
|
60
64
|
}) => {
|
|
65
|
+
const isInitialRenderCycle = _chunkOLI32URUcjs.useIsInitialRenderCycle.call(void 0, );
|
|
61
66
|
let progressColor = color;
|
|
62
67
|
if (percent >= 100) {
|
|
63
68
|
progressColor = "success";
|
|
@@ -71,8 +76,7 @@ var Progress = ({
|
|
|
71
76
|
"aria-label": ariaLabel,
|
|
72
77
|
classNames,
|
|
73
78
|
"data-testid": testId,
|
|
74
|
-
disableAnimation,
|
|
75
|
-
formatOptions: void 0,
|
|
79
|
+
disableAnimation: isInitialRenderCycle || disableAnimation,
|
|
76
80
|
isIndeterminate: indeterminate,
|
|
77
81
|
label,
|
|
78
82
|
showValueLabel,
|
|
@@ -92,4 +96,4 @@ var Progress_default2 = Progress_default;
|
|
|
92
96
|
|
|
93
97
|
|
|
94
98
|
exports.progressVariants = progressVariants; exports.Progress_default = Progress_default; exports.Progress_default2 = Progress_default2;
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-PK723NKO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-PK723NKO.cjs","../src/Progress/Progress.tsx","../src/Progress/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACDA,4CAAyC;AAEzC,oDAAyC;AA8GrC,+CAAA;AAzGG,IAAM,iBAAA,EAAmB,4BAAA;AAAG,EACjC,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,SAAA,EAAW,EAAA;AAAA;AAAA,IAEX,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,YAAA,EAAc,EAAA;AAAA;AAAA,IAEd,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,KAAA,EAAO;AAAA,EACT,CAAA;AAAA,EACA,QAAA,EAAU;AAAA;AAAA,IAER,KAAA,EAAO;AAAA,MACL,MAAA,EAAQ;AAAA,QACN,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,SAAA,EAAW;AAAA,QACT,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF,CAAC,CAAA;AA+BD,IAAM,cAAA,EAAgB,CAAC,QAAA,EAAU,CAAA,EAAA,GAAM,CAAA,EAAA;AAKrB;AACJ,EAAA;AACA,EAAA;AACJ,EAAA;AACW,EAAA;AACV,EAAA;AACO,EAAA;AACR,EAAA;AACR,EAAA;AACiB,EAAA;AACV,EAAA;AACE,EAAA;AACU;AAEU,EAAA;AAGc,EAAA;AACvB,EAAA;AACF,IAAA;AAClB,EAAA;AAEoC,EAAA;AACjB,EAAA;AAES,EAAA;AAG1B,EAAA;AAAC,IAAA;AAAA,IAAA;AACa,MAAA;AACZ,MAAA;AACa,MAAA;AACK,MAAA;AACD,MAAA;AACjB,MAAA;AACA,MAAA;AACA,MAAA;AACkB,MAAA;AACO,MAAA;AAAA,IAAA;AAC3B,EAAA;AAEJ;AAEe;ADzCuB;AACA;AEpFvB;AFsFuB;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-PK723NKO.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Progress as HeroProgress } from '@heroui/progress';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useIsInitialRenderCycle } from '../hooks';\n\n// progress styling variants\nexport const progressVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the progress (finished part)\n indicator: '',\n // label at the top left of the progress bar\n label: '',\n // wrapper around progress label and label span\n labelWrapper: '',\n // track of the progress (not finished part)\n track: '',\n // span around the progress value\n value: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n color: {\n danger: {\n indicator: 'bg-danger',\n },\n default: {\n indicator: 'bg-default-400',\n },\n info: {\n indicator: 'bg-info',\n },\n primary: {\n indicator: 'bg-primary',\n },\n secondary: {\n indicator: 'bg-secondary',\n },\n success: {\n indicator: 'bg-success',\n },\n warning: {\n indicator: 'bg-warning',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof progressVariants>;\ntype ClassName = TVClassName<typeof progressVariants>;\n\nexport interface ProgressProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color of the progress bar */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** function to format the progress value */\n format?: (percent: number) => ReactNode;\n /** shows indeterminate progress animation */\n indeterminate?: boolean;\n /** label of the progress bar */\n label?: ReactNode;\n /** percentage / progress of the progress bar */\n percent: number;\n /** whether to show the value label */\n showValueLabel?: boolean;\n /** size of the progress bar */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)\n */\nconst Progress = ({\n ariaLabel = 'progress',\n className = undefined,\n color = 'info',\n disableAnimation = false,\n format = defaultFormat,\n indeterminate = false,\n label = undefined,\n percent,\n showValueLabel = false,\n size = 'md',\n testId = undefined,\n}: ProgressProps) => {\n // used to disable animation on initial render cycle\n const isInitialRenderCycle = useIsInitialRenderCycle();\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (percent >= 100) {\n progressColor = 'success';\n }\n\n const variants = progressVariants({ color: progressColor });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const value = format(percent);\n\n return (\n <HeroProgress\n aria-label={ariaLabel}\n classNames={classNames}\n data-testid={testId}\n disableAnimation={isInitialRenderCycle || disableAnimation}\n isIndeterminate={indeterminate}\n label={label}\n showValueLabel={showValueLabel}\n size={size}\n value={percent || 0}\n valueLabel={!!percent && value}\n />\n );\n};\n\nexport default Progress;\n","import Progress, { progressVariants } from './Progress';\n\nexport type { ProgressProps } from './Progress';\n\nexport { Progress, progressVariants };\n\nexport default Progress;\n"]}
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
var _chunkOLI32URUcjs = require('../chunk-OLI32URU.cjs');
|
|
5
6
|
require('../chunk-D4TLDLEX.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
exports.useDebounce = _chunkOLI32URUcjs.useDebounce; exports.useIsInitialRenderCycle = _chunkOLI32URUcjs.useIsInitialRenderCycle; exports.useLocalStorage = _chunkOLI32URUcjs.useLocalStorage;
|
|
10
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/hooks/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/hooks/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/hooks/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACF,8LAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/hooks/index.cjs"}
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -2,6 +2,13 @@ import { Dispatch, SetStateAction } from 'react';
|
|
|
2
2
|
|
|
3
3
|
declare const useDebounce: <Value>(value: Value, delay: number) => Value;
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A hook that returns true on initial render and false afterward.
|
|
7
|
+
*
|
|
8
|
+
* @returns {boolean} - True on initial render, false afterward
|
|
9
|
+
*/
|
|
10
|
+
declare const useIsInitialRenderCycle: () => boolean;
|
|
11
|
+
|
|
5
12
|
declare const useLocalStorage: <T>(key: string, initialValue: T | (() => T)) => [T, Dispatch<SetStateAction<T>>];
|
|
6
13
|
|
|
7
|
-
export { useDebounce, useLocalStorage };
|
|
14
|
+
export { useDebounce, useIsInitialRenderCycle, useLocalStorage };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import { Dispatch, SetStateAction } from 'react';
|
|
|
2
2
|
|
|
3
3
|
declare const useDebounce: <Value>(value: Value, delay: number) => Value;
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A hook that returns true on initial render and false afterward.
|
|
7
|
+
*
|
|
8
|
+
* @returns {boolean} - True on initial render, false afterward
|
|
9
|
+
*/
|
|
10
|
+
declare const useIsInitialRenderCycle: () => boolean;
|
|
11
|
+
|
|
5
12
|
declare const useLocalStorage: <T>(key: string, initialValue: T | (() => T)) => [T, Dispatch<SetStateAction<T>>];
|
|
6
13
|
|
|
7
|
-
export { useDebounce, useLocalStorage };
|
|
14
|
+
export { useDebounce, useIsInitialRenderCycle, useLocalStorage };
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDebounce,
|
|
3
|
+
useIsInitialRenderCycle,
|
|
3
4
|
useLocalStorage
|
|
4
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-B3XKBNXD.js";
|
|
5
6
|
import "../chunk-J7N2552D.js";
|
|
6
7
|
export {
|
|
7
8
|
useDebounce,
|
|
9
|
+
useIsInitialRenderCycle,
|
|
8
10
|
useLocalStorage
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkPK723NKOcjs = require('./chunk-PK723NKO.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkJS2PJ6SLcjs = require('./chunk-JS2PJ6SL.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -26,7 +26,8 @@ var _chunk25AJSW5Ecjs = require('./chunk-25AJSW5E.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
var _chunkOLI32URUcjs = require('./chunk-OLI32URU.cjs');
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
var _chunkY3RSI2KVcjs = require('./chunk-Y3RSI2KV.cjs');
|
|
@@ -129,5 +130,6 @@ require('./chunk-D4TLDLEX.cjs');
|
|
|
129
130
|
|
|
130
131
|
|
|
131
132
|
|
|
132
|
-
|
|
133
|
+
|
|
134
|
+
exports.Accordion = _chunk2P5WWVQ6cjs.Accordion_default; exports.Alert = _chunkYVPRFCWIcjs.Alert_default; exports.Avatar = _chunk77J7NZYBcjs.Avatar_default; exports.AvatarGroup = _chunkLIZGYO24cjs.AvatarGroup_default; exports.Badge = _chunkJSANDW3Wcjs.Badge_default; exports.Breadcrumb = _chunkZZOEFQWQcjs.Breadcrumb_default; exports.Button = _chunkFLPLJTACcjs.Button_default; exports.ButtonGroup = _chunkY3RSI2KVcjs.ButtonGroup_default; exports.Card = _chunkMHZAWSFJcjs.Card_default; exports.Drawer = _chunk7RVUB6I5cjs.Drawer_default; exports.Json = _chunkJ63YGHTGcjs.Json_default; exports.Label = _chunkPLJWIGRScjs.Label_default; exports.Menu = _chunkXHOAZB2Zcjs.Menu_default; exports.Modal = _chunkPEUUQMJScjs.Modal_default; exports.Popover = _chunkEAX5J2I2cjs.Popover_default; exports.Progress = _chunkPK723NKOcjs.Progress_default; exports.ProgressCircular = _chunkJS2PJ6SLcjs.ProgressCircular_default; exports.Table = _chunkAJCAIA6Hcjs.Table_default; exports.Tabs = _chunkJUHSESWBcjs.Tabs_default; exports.Toast = _chunkGXIDQFQ6cjs.Toast; exports.ToastProvider = _chunkGXIDQFQ6cjs.ToastProvider_default; exports.Tooltip = _chunk25AJSW5Ecjs.Tooltip_default; exports.accordionVariants = _chunk2P5WWVQ6cjs.accordionVariants; exports.addToast = _chunkGXIDQFQ6cjs.addToast; exports.alertVariants = _chunkYVPRFCWIcjs.alertVariants; exports.breadcrumbVariants = _chunkZZOEFQWQcjs.breadcrumbVariants; exports.buttonVariants = _chunkFLPLJTACcjs.buttonVariants; exports.cardVariants = _chunkMHZAWSFJcjs.cardVariants; exports.drawerBackdrops = _chunk7RVUB6I5cjs.drawerBackdrops; exports.drawerPlacements = _chunk7RVUB6I5cjs.drawerPlacements; exports.drawerRadii = _chunk7RVUB6I5cjs.drawerRadii; exports.drawerSizes = _chunk7RVUB6I5cjs.drawerSizes; exports.drawerVariants = _chunk7RVUB6I5cjs.drawerVariants; exports.labelVariants = _chunkPLJWIGRScjs.labelVariants; exports.modalVariants = _chunkPEUUQMJScjs.modalVariants; exports.progressCircularVariants = _chunkJS2PJ6SLcjs.progressCircularVariants; exports.progressVariants = _chunkPK723NKOcjs.progressVariants; exports.tableVariants = _chunkAJCAIA6Hcjs.tableVariants; exports.tabsVariants = _chunkJUHSESWBcjs.tabsVariants; exports.toastVariants = _chunkGXIDQFQ6cjs.toastVariants; exports.useDebounce = _chunkOLI32URUcjs.useDebounce; exports.useIsInitialRenderCycle = _chunkOLI32URUcjs.useIsInitialRenderCycle; exports.useLocalStorage = _chunkOLI32URUcjs.useLocalStorage;
|
|
133
135
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,g3EAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/index.cjs"}
|
package/dist/index.d.cts
CHANGED
|
@@ -13,14 +13,14 @@ export { L as Label, a as LabelProps, l as labelVariants } from './Label-Bp9WZiD
|
|
|
13
13
|
export { M as Menu, b as MenuItem, a as MenuProps, c as MenuSection } from './Menu-DYi8oagz.cjs';
|
|
14
14
|
export { M as Modal, a as ModalProps, m as modalVariants } from './Modal-DI5ZdS_3.cjs';
|
|
15
15
|
export { _ as Popover, P as PopoverProps } from './Popover-DajWpbPN.cjs';
|
|
16
|
-
export { P as ProgressCircular, a as ProgressCircularProps, p as progressCircularVariants } from './ProgressCircular-
|
|
16
|
+
export { P as ProgressCircular, a as ProgressCircularProps, p as progressCircularVariants } from './ProgressCircular-DdDYbP2p.cjs';
|
|
17
17
|
export { P as Progress, a as ProgressProps, p as progressVariants } from './Progress-7yXUVioO.cjs';
|
|
18
18
|
export { T as Table, c as TableColumnProps, a as TableProps, b as TableRowProps, V as VariantProps, t as tableVariants } from './Table-D19f5nrd.cjs';
|
|
19
19
|
export { b as TabProps, T as Tabs, a as TabsProps, t as tabsVariants } from './Tabs-xUYwXMX9.cjs';
|
|
20
20
|
export { Toast } from '@heroui/toast';
|
|
21
21
|
export { A as AddToastVariantProps, b as ToastProps, T as ToastProvider, c as ToastProviderProps, a as addToast, t as toastVariants } from './ToastProvider-CL1v-bkE.cjs';
|
|
22
22
|
export { T as Tooltip, b as TooltipPlacement, a as TooltipProps } from './Tooltip-Bu71AKvn.cjs';
|
|
23
|
-
export { useDebounce, useLocalStorage } from './hooks/index.cjs';
|
|
23
|
+
export { useDebounce, useIsInitialRenderCycle, useLocalStorage } from './hooks/index.cjs';
|
|
24
24
|
export { ButtonGroupProps } from '@heroui/button';
|
|
25
25
|
import 'react/jsx-runtime';
|
|
26
26
|
import 'tailwind-variants';
|
package/dist/index.d.ts
CHANGED
|
@@ -13,14 +13,14 @@ export { L as Label, a as LabelProps, l as labelVariants } from './Label-Bp9WZiD
|
|
|
13
13
|
export { M as Menu, b as MenuItem, a as MenuProps, c as MenuSection } from './Menu-DYi8oagz.js';
|
|
14
14
|
export { M as Modal, a as ModalProps, m as modalVariants } from './Modal-DI5ZdS_3.js';
|
|
15
15
|
export { _ as Popover, P as PopoverProps } from './Popover-DcZ3qt-u.js';
|
|
16
|
-
export { P as ProgressCircular, a as ProgressCircularProps, p as progressCircularVariants } from './ProgressCircular-
|
|
16
|
+
export { P as ProgressCircular, a as ProgressCircularProps, p as progressCircularVariants } from './ProgressCircular-DdDYbP2p.js';
|
|
17
17
|
export { P as Progress, a as ProgressProps, p as progressVariants } from './Progress-7yXUVioO.js';
|
|
18
18
|
export { T as Table, c as TableColumnProps, a as TableProps, b as TableRowProps, V as VariantProps, t as tableVariants } from './Table-D19f5nrd.js';
|
|
19
19
|
export { b as TabProps, T as Tabs, a as TabsProps, t as tabsVariants } from './Tabs-xUYwXMX9.js';
|
|
20
20
|
export { Toast } from '@heroui/toast';
|
|
21
21
|
export { A as AddToastVariantProps, b as ToastProps, T as ToastProvider, c as ToastProviderProps, a as addToast, t as toastVariants } from './ToastProvider-CL1v-bkE.js';
|
|
22
22
|
export { T as Tooltip, b as TooltipPlacement, a as TooltipProps } from './Tooltip-Bu71AKvn.js';
|
|
23
|
-
export { useDebounce, useLocalStorage } from './hooks/index.js';
|
|
23
|
+
export { useDebounce, useIsInitialRenderCycle, useLocalStorage } from './hooks/index.js';
|
|
24
24
|
export { ButtonGroupProps } from '@heroui/button';
|
|
25
25
|
import 'react/jsx-runtime';
|
|
26
26
|
import 'tailwind-variants';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Progress_default,
|
|
3
3
|
progressVariants
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OGK2OQXX.js";
|
|
5
5
|
import {
|
|
6
6
|
ProgressCircular_default,
|
|
7
7
|
progressCircularVariants
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GK225P72.js";
|
|
9
9
|
import {
|
|
10
10
|
Table_default,
|
|
11
11
|
tableVariants
|
|
@@ -25,8 +25,9 @@ import {
|
|
|
25
25
|
} from "./chunk-YXWPOEX6.js";
|
|
26
26
|
import {
|
|
27
27
|
useDebounce,
|
|
28
|
+
useIsInitialRenderCycle,
|
|
28
29
|
useLocalStorage
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-B3XKBNXD.js";
|
|
30
31
|
import {
|
|
31
32
|
ButtonGroup_default
|
|
32
33
|
} from "./chunk-FNQ7VO32.js";
|
|
@@ -128,6 +129,7 @@ export {
|
|
|
128
129
|
tabsVariants,
|
|
129
130
|
toastVariants,
|
|
130
131
|
useDebounce,
|
|
132
|
+
useIsInitialRenderCycle,
|
|
131
133
|
useLocalStorage
|
|
132
134
|
};
|
|
133
135
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fuf-stack/pixels",
|
|
3
3
|
"description": "fuf core react component library",
|
|
4
4
|
"author": "Hannes Tiede",
|
|
5
|
-
"version": "0.41.
|
|
5
|
+
"version": "0.41.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
8
8
|
"module": "./dist/index.js",
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"@heroui/tabs": "2.2.14",
|
|
181
181
|
"@heroui/toast": "2.0.7",
|
|
182
182
|
"@heroui/tooltip": "2.2.14",
|
|
183
|
-
"framer-motion": "12.7.
|
|
183
|
+
"framer-motion": "12.7.4",
|
|
184
184
|
"next-themes": "0.4.6",
|
|
185
185
|
"react-icons": "5.5.0",
|
|
186
186
|
"@fuf-stack/pixel-utils": "0.5.3"
|
|
@@ -193,8 +193,8 @@
|
|
|
193
193
|
"react": "19.0.0",
|
|
194
194
|
"react-dom": "19.0.0",
|
|
195
195
|
"@repo/storybook-config": "0.0.1",
|
|
196
|
-
"@repo/tsup-config": "0.0.1",
|
|
197
196
|
"@repo/tailwind-config": "0.0.1",
|
|
197
|
+
"@repo/tsup-config": "0.0.1",
|
|
198
198
|
"@repo/vite-config": "0.0.1"
|
|
199
199
|
},
|
|
200
200
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ProgressCircular/ProgressCircular.tsx","../src/ProgressCircular/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { CircularProgressProps as HeroCircularProgressProps } from '@heroui/progress';\nimport type { ReactNode } from 'react';\n\nimport { FaCheck, FaTimes } from 'react-icons/fa';\n\nimport { CircularProgress as HeroCircularProgress } from '@heroui/progress';\nimport { circularProgress as heroCircularProgressVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const progressCircularVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the circle (finished part)\n indicator: '',\n // label next to the svgWrapper\n label: '',\n // wrapper for the circle\n svg: '',\n // wrapper around progress svg and value span\n svgWrapper: '',\n // track of the circle (not finished part)\n track: 'stroke-default-50',\n // outer span next to the svg\n value: '',\n },\n variants: {\n color: {\n info: {\n svg: 'text-info',\n },\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n ...heroCircularProgressVariants.variants.color,\n },\n hasError: {\n true: {\n svg: 'text-danger',\n },\n },\n size: {\n xs: {\n svg: 'h-10 w-10',\n value: 'text-xs',\n },\n sm: {\n svg: 'h-12 w-12',\n value: 'text-sm',\n },\n md: {\n svg: 'h-16 w-16',\n value: 'text-md',\n },\n lg: {\n svg: 'h-20 w-20',\n value: 'text-lg',\n },\n xl: {\n svg: 'h-24 w-24',\n value: 'text-xl',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof progressCircularVariants>;\ntype ClassName = TVClassName<typeof progressCircularVariants>;\n\nexport interface ProgressCircularProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color options */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** formats the display value of the progress in the center */\n format?: (percent?: number) => ReactNode;\n /** enables error version */\n hasError?: boolean;\n /** percentage / progress of the circular progress bar */\n percent: number;\n /** size options */\n size?: VariantProps['size'];\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * ProgressCircular component based on [HeroUI CircularProgress](https://www.heroui.com/docs/components/circular-progress)\n */\nconst ProgressCircular = ({\n ariaLabel = 'progress',\n className = undefined,\n format = defaultFormat,\n hasError = false,\n percent,\n disableAnimation = false,\n size = 'md',\n color = 'info',\n}: ProgressCircularProps) => {\n const variants = progressCircularVariants({ color, hasError, size });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // format value\n let value = format(percent);\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (hasError) {\n progressColor = 'danger';\n value = <FaTimes className=\"text-danger\" />;\n } else if (percent >= 100) {\n progressColor = 'success';\n value = <FaCheck className=\"text-success\" />;\n }\n\n // pass only HeroUI colors as props\n const heroUiColor = Object.keys(\n heroCircularProgressVariants.variants.color,\n ).includes(color)\n ? (progressColor as HeroCircularProgressProps['color'])\n : undefined;\n\n return (\n <HeroCircularProgress\n aria-label={ariaLabel}\n classNames={classNames}\n color={heroUiColor}\n disableAnimation={disableAnimation}\n formatOptions={undefined}\n showValueLabel\n strokeWidth={2}\n // we do not use spinner animation when no percent provided\n value={percent || 0}\n valueLabel={value}\n />\n );\n};\n\nexport default ProgressCircular;\n","import ProgressCircular, { progressCircularVariants } from './ProgressCircular';\n\nexport type { ProgressCircularProps } from './ProgressCircular';\n\nexport { ProgressCircular, progressCircularVariants };\n\nexport default ProgressCircular;\n"],"mappings":";;;;;AAIA,SAAS,SAAS,eAAe;AAEjC,SAAS,oBAAoB,4BAA4B;AACzD,SAAS,oBAAoB,oCAAoC;AAEjE,SAAS,IAAI,4BAA4B;AAyG7B;AAvGL,IAAM,2BAA2B,GAAG;AAAA,EACzC,OAAO;AAAA;AAAA,IAEL,MAAM;AAAA;AAAA,IAEN,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA;AAAA,IAEP,KAAK;AAAA;AAAA,IAEL,YAAY;AAAA;AAAA,IAEZ,OAAO;AAAA;AAAA,IAEP,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,MACL,MAAM;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,OAEG,6BAA6B,SAAS;AAAA,IAE3C,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,QACF,KAAK;AAAA,QACL,OAAO;AAAA,MACT;AAAA,MACA,IAAI;AAAA,QACF,KAAK;AAAA,QACL,OAAO;AAAA,MACT;AAAA,MACA,IAAI;AAAA,QACF,KAAK;AAAA,QACL,OAAO;AAAA,MACT;AAAA,MACA,IAAI;AAAA,QACF,KAAK;AAAA,QACL,OAAO;AAAA,MACT;AAAA,MACA,IAAI;AAAA,QACF,KAAK;AAAA,QACL,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAyBD,IAAM,gBAAgB,CAAC,UAAU,MAAM,GAAG,OAAO;AAKjD,IAAM,mBAAmB,CAAC;AAAA,EACxB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX;AAAA,EACA,mBAAmB;AAAA,EACnB,OAAO;AAAA,EACP,QAAQ;AACV,MAA6B;AAC3B,QAAM,WAAW,yBAAyB,EAAE,OAAO,UAAU,KAAK,CAAC;AACnE,QAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;AAGnE,MAAI,QAAQ,OAAO,OAAO;AAG1B,MAAI,gBAAuC;AAC3C,MAAI,UAAU;AACZ,oBAAgB;AAChB,YAAQ,oBAAC,WAAQ,WAAU,eAAc;AAAA,EAC3C,WAAW,WAAW,KAAK;AACzB,oBAAgB;AAChB,YAAQ,oBAAC,WAAQ,WAAU,gBAAe;AAAA,EAC5C;AAGA,QAAM,cAAc,OAAO;AAAA,IACzB,6BAA6B,SAAS;AAAA,EACxC,EAAE,SAAS,KAAK,IACX,gBACD;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,eAAe;AAAA,MACf,gBAAc;AAAA,MACd,aAAa;AAAA,MAEb,OAAO,WAAW;AAAA,MAClB,YAAY;AAAA;AAAA,EACd;AAEJ;AAEA,IAAO,2BAAQ;;;ACzIf,IAAOA,4BAAQ;","names":["ProgressCircular_default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-MWNBYTRN.cjs","../src/hooks/useDebounce.ts","../src/hooks/useLocalStorage.ts"],"names":["useState","useEffect"],"mappings":"AAAA;ACEA,8BAAoC;AAE7B,IAAM,YAAA,EAAc,CAAQ,KAAA,EAAc,KAAA,EAAA,GAAkB;AAEjE,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,EAAA,EAAI,6BAAA,KAAc,CAAA;AAC1D,EAAA,8BAAA;AAAA,IACE,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ACA;AACF,6EAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-MWNBYTRN.cjs","sourcesContent":[null,"/* 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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Progress/Progress.tsx","../src/Progress/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Progress as HeroProgress } from '@heroui/progress';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// progress styling variants\nexport const progressVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the progress (finished part)\n indicator: '',\n // label at the top left of the progress bar\n label: '',\n // wrapper around progress label and label span\n labelWrapper: '',\n // track of the progress (not finished part)\n track: '',\n // span around the progress value\n value: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n color: {\n danger: {\n indicator: 'bg-danger',\n },\n default: {\n indicator: 'bg-default-400',\n },\n info: {\n indicator: 'bg-info',\n },\n primary: {\n indicator: 'bg-primary',\n },\n secondary: {\n indicator: 'bg-secondary',\n },\n success: {\n indicator: 'bg-success',\n },\n warning: {\n indicator: 'bg-warning',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof progressVariants>;\ntype ClassName = TVClassName<typeof progressVariants>;\n\nexport interface ProgressProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color of the progress bar */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** function to format the progress value */\n format?: (percent: number) => ReactNode;\n /** shows indeterminate progress animation */\n indeterminate?: boolean;\n /** label of the progress bar */\n label?: ReactNode;\n /** percentage / progress of the progress bar */\n percent: number;\n /** whether to show the value label */\n showValueLabel?: boolean;\n /** size of the progress bar */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)\n */\nconst Progress = ({\n ariaLabel = 'progress',\n className = undefined,\n color = 'info',\n disableAnimation = false,\n format = defaultFormat,\n indeterminate = false,\n label = undefined,\n percent,\n showValueLabel = false,\n size = 'md',\n testId = undefined,\n}: ProgressProps) => {\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (percent >= 100) {\n progressColor = 'success';\n }\n\n const variants = progressVariants({ color: progressColor });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const value = format(percent);\n\n return (\n <HeroProgress\n aria-label={ariaLabel}\n classNames={classNames}\n data-testid={testId}\n disableAnimation={disableAnimation}\n formatOptions={undefined}\n isIndeterminate={indeterminate}\n label={label}\n showValueLabel={showValueLabel}\n size={size}\n value={percent || 0}\n valueLabel={!!percent && value}\n />\n );\n};\n\nexport default Progress;\n","import Progress, { progressVariants } from './Progress';\n\nexport type { ProgressProps } from './Progress';\n\nexport { Progress, progressVariants };\n\nexport default Progress;\n"],"mappings":";AAGA,SAAS,YAAY,oBAAoB;AAEzC,SAAS,IAAI,4BAA4B;AAyGrC;AAtGG,IAAM,mBAAmB,GAAG;AAAA,EACjC,OAAO;AAAA;AAAA,IAEL,MAAM;AAAA;AAAA,IAEN,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA;AAAA,IAE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["Progress_default"]}
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-VGXW3PSF.cjs","../src/Progress/Progress.tsx","../src/Progress/index.ts"],"names":[],"mappings":"AAAA;ACGA,4CAAyC;AAEzC,oDAAyC;AAyGrC,+CAAA;AAtGG,IAAM,iBAAA,EAAmB,4BAAA;AAAG,EACjC,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,SAAA,EAAW,EAAA;AAAA;AAAA,IAEX,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,YAAA,EAAc,EAAA;AAAA;AAAA,IAEd,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,KAAA,EAAO;AAAA,EACT,CAAA;AAAA,EACA,QAAA,EAAU;AAAA;AAAA,IAER,KAAA,EAAO;AAAA,MACL,MAAA,EAAQ;AAAA,QACN,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,SAAA,EAAW;AAAA,QACT,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF,CAAC,CAAA;AA+BD,IAAM,cAAA,EAAgB,CAAC,QAAA,EAAU,CAAA,EAAA,GAAM,CAAA,EAAA;AAKrB;AACJ,EAAA;AACA,EAAA;AACJ,EAAA;AACW,EAAA;AACV,EAAA;AACO,EAAA;AACR,EAAA;AACR,EAAA;AACiB,EAAA;AACV,EAAA;AACE,EAAA;AACU;AAEwB,EAAA;AACvB,EAAA;AACF,IAAA;AAClB,EAAA;AAEoC,EAAA;AACjB,EAAA;AAES,EAAA;AAG1B,EAAA;AAAC,IAAA;AAAA,IAAA;AACa,MAAA;AACZ,MAAA;AACa,MAAA;AACb,MAAA;AACe,MAAA;AACE,MAAA;AACjB,MAAA;AACA,MAAA;AACA,MAAA;AACkB,MAAA;AACO,MAAA;AAAA,IAAA;AAC3B,EAAA;AAEJ;AAEe;ADzCuB;AACA;AEhFvB;AFkFuB;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-VGXW3PSF.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Progress as HeroProgress } from '@heroui/progress';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// progress styling variants\nexport const progressVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the progress (finished part)\n indicator: '',\n // label at the top left of the progress bar\n label: '',\n // wrapper around progress label and label span\n labelWrapper: '',\n // track of the progress (not finished part)\n track: '',\n // span around the progress value\n value: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n color: {\n danger: {\n indicator: 'bg-danger',\n },\n default: {\n indicator: 'bg-default-400',\n },\n info: {\n indicator: 'bg-info',\n },\n primary: {\n indicator: 'bg-primary',\n },\n secondary: {\n indicator: 'bg-secondary',\n },\n success: {\n indicator: 'bg-success',\n },\n warning: {\n indicator: 'bg-warning',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof progressVariants>;\ntype ClassName = TVClassName<typeof progressVariants>;\n\nexport interface ProgressProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color of the progress bar */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** function to format the progress value */\n format?: (percent: number) => ReactNode;\n /** shows indeterminate progress animation */\n indeterminate?: boolean;\n /** label of the progress bar */\n label?: ReactNode;\n /** percentage / progress of the progress bar */\n percent: number;\n /** whether to show the value label */\n showValueLabel?: boolean;\n /** size of the progress bar */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)\n */\nconst Progress = ({\n ariaLabel = 'progress',\n className = undefined,\n color = 'info',\n disableAnimation = false,\n format = defaultFormat,\n indeterminate = false,\n label = undefined,\n percent,\n showValueLabel = false,\n size = 'md',\n testId = undefined,\n}: ProgressProps) => {\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (percent >= 100) {\n progressColor = 'success';\n }\n\n const variants = progressVariants({ color: progressColor });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const value = format(percent);\n\n return (\n <HeroProgress\n aria-label={ariaLabel}\n classNames={classNames}\n data-testid={testId}\n disableAnimation={disableAnimation}\n formatOptions={undefined}\n isIndeterminate={indeterminate}\n label={label}\n showValueLabel={showValueLabel}\n size={size}\n value={percent || 0}\n valueLabel={!!percent && value}\n />\n );\n};\n\nexport default Progress;\n","import Progress, { progressVariants } from './Progress';\n\nexport type { ProgressProps } from './Progress';\n\nexport { Progress, progressVariants };\n\nexport default Progress;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-WCRVH4DS.cjs","../src/ProgressCircular/ProgressCircular.tsx","../src/ProgressCircular/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACAA,oCAAiC;AAEjC,4CAAyD;AACzD,sCAAiE;AAEjE,oDAAyC;AAyG7B,+CAAA;AAvGL,IAAM,yBAAA,EAA2B,4BAAA;AAAG,EACzC,KAAA,EAAO;AAAA;AAAA,IAEL,IAAA,EAAM,EAAA;AAAA;AAAA,IAEN,SAAA,EAAW,EAAA;AAAA;AAAA,IAEX,KAAA,EAAO,EAAA;AAAA;AAAA,IAEP,GAAA,EAAK,EAAA;AAAA;AAAA,IAEL,UAAA,EAAY,EAAA;AAAA;AAAA,IAEZ,KAAA,EAAO,mBAAA;AAAA;AAAA,IAEP,KAAA,EAAO;AAAA,EACT,CAAA;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,8CAAA;AAAA,MACL,IAAA,EAAM;AAAA,QACJ,GAAA,EAAK;AAAA,MACP;AAAA,IAAA,CAAA,EAEG,uBAAA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els/packages/pixels/dist/chunk-WCRVH4DS.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { CircularProgressProps as HeroCircularProgressProps } from '@heroui/progress';\nimport type { ReactNode } from 'react';\n\nimport { FaCheck, FaTimes } from 'react-icons/fa';\n\nimport { CircularProgress as HeroCircularProgress } from '@heroui/progress';\nimport { circularProgress as heroCircularProgressVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const progressCircularVariants = tv({\n slots: {\n // wrapper around the whole component\n base: '',\n // indicator of the circle (finished part)\n indicator: '',\n // label next to the svgWrapper\n label: '',\n // wrapper for the circle\n svg: '',\n // wrapper around progress svg and value span\n svgWrapper: '',\n // track of the circle (not finished part)\n track: 'stroke-default-50',\n // outer span next to the svg\n value: '',\n },\n variants: {\n color: {\n info: {\n svg: 'text-info',\n },\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/progress.ts\n ...heroCircularProgressVariants.variants.color,\n },\n hasError: {\n true: {\n svg: 'text-danger',\n },\n },\n size: {\n xs: {\n svg: 'h-10 w-10',\n value: 'text-xs',\n },\n sm: {\n svg: 'h-12 w-12',\n value: 'text-sm',\n },\n md: {\n svg: 'h-16 w-16',\n value: 'text-md',\n },\n lg: {\n svg: 'h-20 w-20',\n value: 'text-lg',\n },\n xl: {\n svg: 'h-24 w-24',\n value: 'text-xl',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof progressCircularVariants>;\ntype ClassName = TVClassName<typeof progressCircularVariants>;\n\nexport interface ProgressCircularProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** color options */\n color?: VariantProps['color'];\n /** disables all animations */\n disableAnimation?: boolean;\n /** formats the display value of the progress in the center */\n format?: (percent?: number) => ReactNode;\n /** enables error version */\n hasError?: boolean;\n /** percentage / progress of the circular progress bar */\n percent: number;\n /** size options */\n size?: VariantProps['size'];\n}\n\n/** formats percent with percent sign */\nconst defaultFormat = (percent = 0) => `${percent}%`;\n\n/**\n * ProgressCircular component based on [HeroUI CircularProgress](https://www.heroui.com/docs/components/circular-progress)\n */\nconst ProgressCircular = ({\n ariaLabel = 'progress',\n className = undefined,\n format = defaultFormat,\n hasError = false,\n percent,\n disableAnimation = false,\n size = 'md',\n color = 'info',\n}: ProgressCircularProps) => {\n const variants = progressCircularVariants({ color, hasError, size });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // format value\n let value = format(percent);\n\n // handle special states\n let progressColor: VariantProps['color'] = color;\n if (hasError) {\n progressColor = 'danger';\n value = <FaTimes className=\"text-danger\" />;\n } else if (percent >= 100) {\n progressColor = 'success';\n value = <FaCheck className=\"text-success\" />;\n }\n\n // pass only HeroUI colors as props\n const heroUiColor = Object.keys(\n heroCircularProgressVariants.variants.color,\n ).includes(color)\n ? (progressColor as HeroCircularProgressProps['color'])\n : undefined;\n\n return (\n <HeroCircularProgress\n aria-label={ariaLabel}\n classNames={classNames}\n color={heroUiColor}\n disableAnimation={disableAnimation}\n formatOptions={undefined}\n showValueLabel\n strokeWidth={2}\n // we do not use spinner animation when no percent provided\n value={percent || 0}\n valueLabel={value}\n />\n );\n};\n\nexport default ProgressCircular;\n","import ProgressCircular, { progressCircularVariants } from './ProgressCircular';\n\nexport type { ProgressCircularProps } from './ProgressCircular';\n\nexport { ProgressCircular, progressCircularVariants };\n\nexport default ProgressCircular;\n"]}
|