@paul-portfolio/react 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChart.d.ts +22 -0
- package/dist/BarChart.js +21 -0
- package/dist/DonutChart.d.ts +26 -0
- package/dist/DonutChart.js +19 -0
- package/dist/FunnelChart.d.ts +26 -0
- package/dist/FunnelChart.js +24 -0
- package/dist/GaugeChart.d.ts +37 -0
- package/dist/GaugeChart.js +44 -0
- package/dist/GradientBackground.d.ts +21 -0
- package/dist/GradientBackground.js +24 -0
- package/dist/HeatmapChart.d.ts +46 -0
- package/dist/HeatmapChart.js +53 -0
- package/dist/ParetoChart.d.ts +34 -0
- package/dist/ParetoChart.js +44 -0
- package/dist/RadarChart.d.ts +35 -0
- package/dist/RadarChart.js +55 -0
- package/dist/ScatterPlot.d.ts +37 -0
- package/dist/ScatterPlot.js +22 -0
- package/dist/Sparkline.d.ts +30 -0
- package/dist/Sparkline.js +21 -0
- package/dist/Spotlight.d.ts +17 -0
- package/dist/Spotlight.js +39 -0
- package/dist/StackedLineChart.d.ts +35 -0
- package/dist/StackedLineChart.js +38 -0
- package/dist/Ticker.d.ts +27 -0
- package/dist/Ticker.js +96 -0
- package/dist/TiltCard.d.ts +17 -0
- package/dist/TiltCard.js +45 -0
- package/dist/WordCloud.d.ts +38 -0
- package/dist/WordCloud.js +36 -0
- package/dist/chartGeometry.d.ts +229 -0
- package/dist/chartGeometry.js +450 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +17 -0
- package/dist/usePrefersReducedMotion.d.ts +6 -0
- package/dist/usePrefersReducedMotion.js +22 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,5 +15,22 @@ export { Badge } from './Badge';
|
|
|
15
15
|
export { Skeleton } from './Skeleton';
|
|
16
16
|
export { Spinner } from './Spinner';
|
|
17
17
|
export { Divider } from './Divider';
|
|
18
|
+
export { Ticker } from './Ticker';
|
|
19
|
+
export { TiltCard } from './TiltCard';
|
|
20
|
+
export { GradientBackground } from './GradientBackground';
|
|
21
|
+
export { Spotlight } from './Spotlight';
|
|
22
|
+
export { Sparkline } from './Sparkline';
|
|
23
|
+
export { BarChart } from './BarChart';
|
|
24
|
+
export { DonutChart } from './DonutChart';
|
|
25
|
+
export { FunnelChart } from './FunnelChart';
|
|
26
|
+
export { ScatterPlot } from './ScatterPlot';
|
|
27
|
+
export { RadarChart } from './RadarChart';
|
|
28
|
+
export { ParetoChart } from './ParetoChart';
|
|
29
|
+
export { HeatmapChart } from './HeatmapChart';
|
|
30
|
+
export { GaugeChart } from './GaugeChart';
|
|
31
|
+
export { StackedLineChart } from './StackedLineChart';
|
|
32
|
+
export { WordCloud } from './WordCloud';
|
|
33
|
+
export * as chartGeometry from './chartGeometry';
|
|
18
34
|
export { VisuallyHidden } from './VisuallyHidden';
|
|
35
|
+
export { usePrefersReducedMotion } from './usePrefersReducedMotion';
|
|
19
36
|
export { cx } from './cx';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks `prefers-reduced-motion`. Defaults to false so the server and the
|
|
3
|
+
* first client render agree (SSR-stable), then updates once mounted. Shared by
|
|
4
|
+
* every motion-driven component so they honour the preference identically.
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePrefersReducedMotion(): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks `prefers-reduced-motion`. Defaults to false so the server and the
|
|
4
|
+
* first client render agree (SSR-stable), then updates once mounted. Shared by
|
|
5
|
+
* every motion-driven component so they honour the preference identically.
|
|
6
|
+
*/
|
|
7
|
+
export function usePrefersReducedMotion() {
|
|
8
|
+
const [reduced, setReduced] = useState(false);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (typeof window === 'undefined' ||
|
|
11
|
+
typeof window.matchMedia !== 'function') {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const query = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
15
|
+
// Microtask defer keeps the effect from setting state synchronously.
|
|
16
|
+
queueMicrotask(() => setReduced(query.matches));
|
|
17
|
+
const onChange = (e) => setReduced(e.matches);
|
|
18
|
+
query.addEventListener('change', onChange);
|
|
19
|
+
return () => query.removeEventListener('change', onChange);
|
|
20
|
+
}, []);
|
|
21
|
+
return reduced;
|
|
22
|
+
}
|