@refraction-ui/react 0.3.7 → 0.4.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 ADDED
@@ -0,0 +1,44 @@
1
+ # @refraction-ui/react
2
+
3
+ All Refraction UI React components in one package — headless, accessible, zero-dependency.
4
+
5
+ ```bash
6
+ npm install @refraction-ui/react
7
+ ```
8
+
9
+ ```tsx
10
+ import { Button, Card, Dialog, ThemeProvider } from '@refraction-ui/react'
11
+ ```
12
+
13
+ ## Default theme stylesheet
14
+
15
+ Refraction components are headless: they read CSS custom properties for color, typography, layout, and motion. To get a complete working theme out of the box (the Linear/Vercel-inspired "Refraction" palette), import the bundled stylesheet once at your app entry point:
16
+
17
+ ```ts
18
+ import '@refraction-ui/react/styles.css'
19
+ ```
20
+
21
+ The stylesheet is **opt-in**. If you already define your own tokens (or use `@refraction-ui/tailwind-config`'s preset), don't import it — every component will continue to work with your tokens.
22
+
23
+ ### Overriding tokens
24
+
25
+ Redeclare any variable after the import:
26
+
27
+ ```css
28
+ :root {
29
+ --primary: 280 70% 50%;
30
+ --radius: 0.5rem;
31
+ }
32
+ ```
33
+
34
+ ### Dark mode
35
+
36
+ Dark tokens activate automatically when `.dark` is applied to the root element (the default `ThemeProvider` mode), or when `[data-theme="dark"]` is set (the `attribute: 'data-theme'` mode). Either configuration works without extra setup.
37
+
38
+ ## Smaller bundles
39
+
40
+ Install individual packages for smaller bundles:
41
+
42
+ ```bash
43
+ npm install @refraction-ui/react-button
44
+ ```