@n3wth/ui 0.4.0 β 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/README.md +79 -27
- package/dist/atoms/Button/Button.d.ts +9 -1
- package/dist/atoms/Button/Button.d.ts.map +1 -1
- package/dist/atoms/Button/index.d.ts +1 -1
- package/dist/atoms/Button/index.d.ts.map +1 -1
- package/dist/atoms/Shape/Shape.d.ts +28 -2
- package/dist/atoms/Shape/Shape.d.ts.map +1 -1
- package/dist/atoms/Shape/index.d.ts +1 -1
- package/dist/atoms/Shape/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +3 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.d.ts +53 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useReducedMotion.d.ts +41 -0
- package/dist/hooks/useReducedMotion.d.ts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2057 -5054
- package/dist/index.js.map +1 -0
- package/dist/molecules/NavLink/NavLink.d.ts.map +1 -1
- package/dist/organisms/Nav/Nav.d.ts +2 -1
- package/dist/organisms/Nav/Nav.d.ts.map +1 -1
- package/dist/r/button.json +15 -0
- package/dist/r/card.json +12 -0
- package/dist/r/hero.json +12 -0
- package/dist/r/registry.json +38 -0
- package/dist/styles.css +342 -4
- package/package.json +3 -2
- package/public/r/button.json +15 -0
- package/public/r/card.json +12 -0
- package/public/r/hero.json +12 -0
- package/public/r/registry.json +38 -0
- package/tailwind.preset.js +32 -0
package/README.md
CHANGED
|
@@ -1,56 +1,108 @@
|
|
|
1
|
-
# n3wth/ui
|
|
1
|
+
# n3wth/ui π οΈ
|
|
2
2
|
|
|
3
|
-
Atomic design system. Flat, minimal, iOS-inspired.
|
|
3
|
+
Atomic design system for n3wth projects. Flat, minimal, iOS-inspired.
|
|
4
|
+
No shadows, no glowsβjust clean glassmorphism and precision typography.
|
|
4
5
|
|
|
5
|
-
**[
|
|
6
|
+
**[Live Demo](https://ui.newth.ai)** / **[npm package](https://www.npmjs.com/package/@n3wth/ui)** / **[Registry](https://github.com/n3wth/ui/blob/main/registry.json)**
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## π€ AI-Native Integration
|
|
11
|
+
|
|
12
|
+
This library is optimized for AI-driven development (**v0**, **Cursor**, **Google AI Studio**, **Claude Code**).
|
|
13
|
+
|
|
14
|
+
- **v0 / Shadcn**: Point v0 to this repo or use the [registry.json](./registry.json).
|
|
15
|
+
- **Google AI Studio**: Use the [native system instructions](./google-ai-studio-instructions.json).
|
|
16
|
+
- **Cursor**: Automated context via [.cursorrules](./.cursorrules).
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## π¦ Install
|
|
8
21
|
|
|
9
22
|
```bash
|
|
10
23
|
npm install @n3wth/ui
|
|
11
24
|
```
|
|
12
25
|
|
|
26
|
+
### Quick Start
|
|
27
|
+
|
|
13
28
|
```tsx
|
|
14
|
-
import { Button, Card,
|
|
29
|
+
import { Button, Card, Hero, Section } from '@n3wth/ui'
|
|
15
30
|
import '@n3wth/ui/styles'
|
|
31
|
+
|
|
32
|
+
export default function App() {
|
|
33
|
+
return (
|
|
34
|
+
<Section>
|
|
35
|
+
<Hero title="Hello World" subtitle="iOS-inspired design system" />
|
|
36
|
+
<Card>
|
|
37
|
+
<Button variant="accent">Click Me</Button>
|
|
38
|
+
</Card>
|
|
39
|
+
</Section>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
16
42
|
```
|
|
17
43
|
|
|
18
|
-
|
|
44
|
+
---
|
|
19
45
|
|
|
20
|
-
|
|
46
|
+
## π¨ Design Tokens
|
|
21
47
|
|
|
22
|
-
|
|
48
|
+
Built on **Tailwind CSS 4**.
|
|
23
49
|
|
|
24
|
-
|
|
50
|
+
| Token | Description |
|
|
51
|
+
| :--- | :--- |
|
|
52
|
+
| **Typography** | `font-display` (Mona Sans), `font-sans` (Geist Sans) |
|
|
53
|
+
| **Glass** | `.glass-card`, `.glass-pill`, `.glass-nav` |
|
|
54
|
+
| **Colors** | Semantic tokens: `bg`, `bg-secondary`, `sage`, `coral`, `gold`, `mint` |
|
|
55
|
+
| **Spacing** | iOS-standard safe areas: `safe-top`, `safe-bottom` |
|
|
25
56
|
|
|
26
|
-
|
|
57
|
+
---
|
|
27
58
|
|
|
28
|
-
|
|
59
|
+
## π§© Components
|
|
29
60
|
|
|
30
|
-
|
|
61
|
+
| Category | Components |
|
|
62
|
+
| :--- | :--- |
|
|
63
|
+
| **Atoms** | `Button`, `Badge`, `Input`, `Icon`, `AnimatedText`, `NoiseOverlay`, `ScrollIndicator` |
|
|
64
|
+
| **Molecules** | `Card`, `CommandBox`, `ThemeToggle`, `MobileDrawer`, `NavLink`, `CompositeShape` |
|
|
65
|
+
| **Organisms** | `Nav`, `Hero`, `Section`, `Footer` |
|
|
31
66
|
|
|
32
|
-
|
|
67
|
+
---
|
|
33
68
|
|
|
34
|
-
|
|
69
|
+
## πͺ Hooks
|
|
35
70
|
|
|
36
|
-
|
|
71
|
+
- `useTheme` β Dark/light mode with system persistence.
|
|
72
|
+
- `useMediaQuery` β Clean responsive breakpoint handling.
|
|
73
|
+
- `useKeyboardShortcuts` β Global keyboard event management.
|
|
74
|
+
- `useScrollReveal` β Entry animations for atomic elements.
|
|
75
|
+
- `useReducedMotion` β Respects user accessibility preferences.
|
|
37
76
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## π οΈ Development
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Clone and install
|
|
83
|
+
git clone https://github.com/n3wth/ui
|
|
84
|
+
npm install
|
|
85
|
+
|
|
86
|
+
# Run the showcase/demo
|
|
87
|
+
npm run demo
|
|
88
|
+
|
|
89
|
+
# Build for production
|
|
90
|
+
npm run build
|
|
91
|
+
|
|
92
|
+
# Update AI Registry
|
|
93
|
+
npm run registry:build
|
|
44
94
|
```
|
|
45
95
|
|
|
46
|
-
|
|
96
|
+
### Releasing
|
|
97
|
+
|
|
98
|
+
We use a semantic patch/minor/major flow that automatically updates AI registry artifacts:
|
|
47
99
|
|
|
48
100
|
```bash
|
|
49
|
-
npm run
|
|
50
|
-
npm run demo # Demo at localhost:5173
|
|
51
|
-
npm run build # Build to dist/
|
|
101
|
+
npm run release:patch
|
|
52
102
|
```
|
|
53
103
|
|
|
54
|
-
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## π License
|
|
55
107
|
|
|
56
|
-
MIT
|
|
108
|
+
MIT Β© [Oliver Newth](https://newth.ai)
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
2
3
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
4
|
variant?: 'primary' | 'secondary' | 'ghost' | 'glass';
|
|
4
|
-
|
|
5
|
+
/** Size of the button. Can be a single value or responsive object */
|
|
6
|
+
size?: ButtonSize | {
|
|
7
|
+
base?: ButtonSize;
|
|
8
|
+
md?: ButtonSize;
|
|
9
|
+
lg?: ButtonSize;
|
|
10
|
+
};
|
|
5
11
|
children: ReactNode;
|
|
6
12
|
isLoading?: boolean;
|
|
7
13
|
leftIcon?: ReactNode;
|
|
8
14
|
rightIcon?: ReactNode;
|
|
9
15
|
asChild?: boolean;
|
|
16
|
+
/** Ensures minimum 44px touch target for accessibility (WCAG 2.5.5) */
|
|
17
|
+
touchTarget?: boolean;
|
|
10
18
|
}
|
|
11
19
|
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
12
20
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/atoms/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAA;AAGd,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,CAAA;IACrD,IAAI,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/atoms/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAA;AAGd,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE3C,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,CAAA;IACrD,qEAAqE;IACrE,IAAI,CAAC,EAAE,UAAU,GAAG;QAAE,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,EAAE,CAAC,EAAE,UAAU,CAAC;QAAC,EAAE,CAAC,EAAE,UAAU,CAAA;KAAE,CAAA;IAC3E,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,uEAAuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,eAAO,MAAM,MAAM,2GA6HlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import { PatternType } from './patterns';
|
|
2
2
|
export type ShapeType = 'circle' | 'square' | 'triangle' | 'diamond' | 'hexagon' | 'semicircle' | 'arc' | 'pill' | 'star';
|
|
3
|
+
export type ResponsiveSize = {
|
|
4
|
+
base?: number | {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
sm?: number | {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
md?: number | {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
lg?: number | {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
3
21
|
export interface ShapeProps {
|
|
4
22
|
type: ShapeType;
|
|
23
|
+
/**
|
|
24
|
+
* Size of the shape. Can be:
|
|
25
|
+
* - A number (same width/height)
|
|
26
|
+
* - An object { width, height }
|
|
27
|
+
* - A responsive object { base, sm, md, lg }
|
|
28
|
+
*/
|
|
5
29
|
size?: number | {
|
|
6
30
|
width: number;
|
|
7
31
|
height: number;
|
|
8
|
-
};
|
|
32
|
+
} | ResponsiveSize;
|
|
9
33
|
color?: string;
|
|
10
34
|
pattern?: PatternType;
|
|
11
35
|
patternColors?: string[];
|
|
@@ -15,6 +39,8 @@ export interface ShapeProps {
|
|
|
15
39
|
opacity?: number;
|
|
16
40
|
className?: string;
|
|
17
41
|
style?: React.CSSProperties;
|
|
42
|
+
/** Disable animations when user prefers reduced motion (handled via CSS) */
|
|
43
|
+
'aria-hidden'?: boolean;
|
|
18
44
|
}
|
|
19
|
-
export declare function Shape({ type, size, color, pattern, patternColors, patternScale, patternAngle, rotation, opacity, className, style, }: ShapeProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function Shape({ type, size, color, pattern, patternColors, patternScale, patternAngle, rotation, opacity, className, style, 'aria-hidden': ariaHidden, }: ShapeProps): import("react/jsx-runtime").JSX.Element;
|
|
20
46
|
//# sourceMappingURL=Shape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shape.d.ts","sourceRoot":"","sources":["../../../src/atoms/Shape/Shape.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,WAAW,EAAE,MAAM,YAAY,CAAA;AAEzD,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,SAAS,GACT,SAAS,GACT,YAAY,GACZ,KAAK,GACL,MAAM,GACN,MAAM,CAAA;AAEV,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"Shape.d.ts","sourceRoot":"","sources":["../../../src/atoms/Shape/Shape.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,WAAW,EAAE,MAAM,YAAY,CAAA;AAEzD,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,SAAS,GACT,SAAS,GACT,YAAY,GACZ,KAAK,GACL,MAAM,GACN,MAAM,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACjD,EAAE,CAAC,EAAE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OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/Shape/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACpE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ export { useTheme } from './useTheme';
|
|
|
2
2
|
export type { Theme, UseThemeOptions, UseThemeReturn } from './useTheme';
|
|
3
3
|
export { useKeyboardShortcuts, getModifierKey, formatShortcut, } from './useKeyboardShortcuts';
|
|
4
4
|
export type { KeyboardShortcut, UseKeyboardShortcutsOptions } from './useKeyboardShortcuts';
|
|
5
|
-
export { useReducedMotion } from './useReducedMotion';
|
|
6
|
-
export { useMediaQuery, useIsMobile, useIsTablet, useIsDesktop, } from './useMediaQuery';
|
|
5
|
+
export { useReducedMotion, useMotionConfig, usePrefersHighContrast } from './useReducedMotion';
|
|
6
|
+
export { useMediaQuery, useIsMobile, useIsTablet, useIsDesktop, useIsLargeDesktop, useBreakpoint, useIsTouchDevice, useIsPortrait, useIsLandscape, BREAKPOINTS, } from './useMediaQuery';
|
|
7
|
+
export type { Breakpoint } from './useMediaQuery';
|
|
7
8
|
export { useCountUp } from './useCountUp';
|
|
8
9
|
export type { UseCountUpOptions, UseCountUpReturn } from './useCountUp';
|
|
9
10
|
export { useScrollReveal } from './useScrollReveal';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,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AE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,YAAY,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,5 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Standard breakpoints matching Tailwind CSS defaults
|
|
3
|
+
* sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px
|
|
4
|
+
*/
|
|
5
|
+
export declare const BREAKPOINTS: {
|
|
6
|
+
readonly sm: 640;
|
|
7
|
+
readonly md: 768;
|
|
8
|
+
readonly lg: 1024;
|
|
9
|
+
readonly xl: 1280;
|
|
10
|
+
readonly '2xl': 1536;
|
|
11
|
+
};
|
|
12
|
+
export type Breakpoint = keyof typeof BREAKPOINTS;
|
|
13
|
+
/**
|
|
14
|
+
* Hook for responsive media queries with SSR safety
|
|
15
|
+
* Returns false during SSR to prevent hydration mismatches
|
|
16
|
+
*
|
|
17
|
+
* @param query - CSS media query string
|
|
18
|
+
* @param defaultValue - Initial value for SSR (defaults to false)
|
|
19
|
+
* @returns boolean indicating if the query matches
|
|
20
|
+
*/
|
|
21
|
+
export declare function useMediaQuery(query: string, defaultValue?: boolean): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Returns true when viewport is mobile width (< 768px)
|
|
24
|
+
* Mobile-first default: returns true initially for SSR
|
|
25
|
+
*/
|
|
2
26
|
export declare function useIsMobile(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Returns true when viewport is tablet width (768px - 1023px)
|
|
29
|
+
*/
|
|
3
30
|
export declare function useIsTablet(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Returns true when viewport is desktop width (>= 1024px)
|
|
33
|
+
*/
|
|
4
34
|
export declare function useIsDesktop(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Returns true when viewport is large desktop width (>= 1280px)
|
|
37
|
+
*/
|
|
38
|
+
export declare function useIsLargeDesktop(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the current breakpoint name
|
|
41
|
+
* Useful for conditional rendering based on screen size
|
|
42
|
+
*/
|
|
43
|
+
export declare function useBreakpoint(): Breakpoint | 'xs';
|
|
44
|
+
/**
|
|
45
|
+
* Returns true when user prefers touch interaction
|
|
46
|
+
* Useful for adapting UI interactions
|
|
47
|
+
*/
|
|
48
|
+
export declare function useIsTouchDevice(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Returns true when viewport is in portrait orientation
|
|
51
|
+
*/
|
|
52
|
+
export declare function useIsPortrait(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Returns true when viewport is in landscape orientation
|
|
55
|
+
*/
|
|
56
|
+
export declare function useIsLandscape(): boolean;
|
|
5
57
|
//# sourceMappingURL=useMediaQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../src/hooks/useMediaQuery.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../src/hooks/useMediaQuery.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;CAMd,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,WAAW,CAAA;AAEjD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,OAAO,CA8B1E;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,UAAU,GAAG,IAAI,CAejD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC"}
|
|
@@ -1,2 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to detect user's motion preference with SSR safety
|
|
3
|
+
* Returns true if user prefers reduced motion
|
|
4
|
+
*
|
|
5
|
+
* Note: For animations, consider using this to:
|
|
6
|
+
* - Disable or reduce animation duration
|
|
7
|
+
* - Use fade instead of transform animations
|
|
8
|
+
* - Skip parallax and auto-playing animations
|
|
9
|
+
*/
|
|
1
10
|
export declare function useReducedMotion(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Returns animation configuration based on reduced motion preference
|
|
13
|
+
* Provides sensible defaults that can be spread into animation props
|
|
14
|
+
*/
|
|
15
|
+
export declare function useMotionConfig(): {
|
|
16
|
+
/** Whether reduced motion is preferred */
|
|
17
|
+
isReduced: boolean;
|
|
18
|
+
/** Suggested animation duration in ms */
|
|
19
|
+
duration: number;
|
|
20
|
+
/** Suggested animation duration as CSS value */
|
|
21
|
+
durationCss: string;
|
|
22
|
+
/** Suggested easing function */
|
|
23
|
+
easing: string;
|
|
24
|
+
/** Whether to disable transform animations */
|
|
25
|
+
disableTransform: boolean;
|
|
26
|
+
/** Whether to disable parallax effects */
|
|
27
|
+
disableParallax: boolean;
|
|
28
|
+
/** Whether to disable auto-playing animations */
|
|
29
|
+
disableAutoPlay: boolean;
|
|
30
|
+
/** Suggested transition config for Framer Motion / GSAP */
|
|
31
|
+
transition: {
|
|
32
|
+
duration: number;
|
|
33
|
+
ease?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
duration: number;
|
|
36
|
+
ease: number[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Returns true if user prefers high contrast
|
|
41
|
+
*/
|
|
42
|
+
export declare function usePrefersHighContrast(): boolean;
|
|
2
43
|
//# sourceMappingURL=useReducedMotion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReducedMotion.d.ts","sourceRoot":"","sources":["../../src/hooks/useReducedMotion.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"useReducedMotion.d.ts","sourceRoot":"","sources":["../../src/hooks/useReducedMotion.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CA8B1C;AAED;;;GAGG;AACH,wBAAgB,eAAe;IAKzB,0CAA0C;;IAG1C,yCAAyC;;IAGzC,gDAAgD;;IAGhD,gCAAgC;;IAGhC,8CAA8C;;IAG9C,0CAA0C;;IAG1C,iDAAiD;;IAGjD,2DAA2D;;;;;;;;EAOhE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CA2BhD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './tokens';
|
|
2
2
|
export { cn } from './utils/cn';
|
|
3
3
|
export { Button } from './atoms/Button';
|
|
4
|
-
export type { ButtonProps } from './atoms/Button';
|
|
4
|
+
export type { ButtonProps, ButtonSize } from './atoms/Button';
|
|
5
5
|
export { Badge } from './atoms/Badge';
|
|
6
6
|
export type { BadgeProps } from './atoms/Badge';
|
|
7
7
|
export { Input } from './atoms/Input';
|
|
@@ -21,7 +21,7 @@ export type { CodeBlockProps } from './atoms/CodeBlock';
|
|
|
21
21
|
export { Skeleton, CardSkeleton } from './atoms/Skeleton';
|
|
22
22
|
export type { SkeletonProps, CardSkeletonProps } from './atoms/Skeleton';
|
|
23
23
|
export { Shape } from './atoms/Shape';
|
|
24
|
-
export type { ShapeProps, ShapeType, PatternType } from './atoms/Shape';
|
|
24
|
+
export type { ShapeProps, ShapeType, PatternType, ResponsiveSize } from './atoms/Shape';
|
|
25
25
|
export { Character } from './atoms/Character';
|
|
26
26
|
export type { CharacterProps, Expression, Accessory } from './atoms/Character';
|
|
27
27
|
export { SpeechBubble } from './atoms/SpeechBubble';
|
|
@@ -54,8 +54,9 @@ export { useTheme } from './hooks/useTheme';
|
|
|
54
54
|
export type { Theme, UseThemeOptions, UseThemeReturn } from './hooks/useTheme';
|
|
55
55
|
export { useKeyboardShortcuts, getModifierKey, formatShortcut, } from './hooks/useKeyboardShortcuts';
|
|
56
56
|
export type { KeyboardShortcut, UseKeyboardShortcutsOptions } from './hooks/useKeyboardShortcuts';
|
|
57
|
-
export { useReducedMotion } from './hooks/useReducedMotion';
|
|
58
|
-
export { useMediaQuery, useIsMobile, useIsTablet, useIsDesktop, } from './hooks/useMediaQuery';
|
|
57
|
+
export { useReducedMotion, useMotionConfig, usePrefersHighContrast } from './hooks/useReducedMotion';
|
|
58
|
+
export { useMediaQuery, useIsMobile, useIsTablet, useIsDesktop, useIsLargeDesktop, useBreakpoint, useIsTouchDevice, useIsPortrait, useIsLandscape, BREAKPOINTS, } from './hooks/useMediaQuery';
|
|
59
|
+
export type { Breakpoint } from './hooks/useMediaQuery';
|
|
59
60
|
export { useCountUp } from './hooks/useCountUp';
|
|
60
61
|
export type { UseCountUpOptions, UseCountUpReturn } from './hooks/useCountUp';
|
|
61
62
|
export { useScrollReveal } from './hooks/useScrollReveal';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAA;AAGxB,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAG/B,OAAO,EAAE,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