@affinda/react 0.0.11 → 0.0.12

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.
Files changed (2) hide show
  1. package/README.md +56 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -5,11 +5,65 @@ React components for Affinda UI - built on web components with Stencil.
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @affinda/react
8
+ npm install @affinda/react @affinda/css
9
9
  # or
10
- pnpm add @affinda/react
10
+ pnpm add @affinda/react @affinda/css
11
11
  ```
12
12
 
13
+ ## Quick Start
14
+
15
+ ### 1. Import Styles and Initialize Components
16
+
17
+ ```tsx
18
+ // In your main.tsx or index.tsx
19
+ import '@affinda/css'; // Loads reset, fonts, tokens, base styles
20
+ import { defineCustomElements } from '@affinda/wc/loader';
21
+
22
+ // Initialize web components
23
+ defineCustomElements();
24
+ ```
25
+
26
+ ### 2. Use Components
27
+
28
+ ```tsx
29
+ import { Button, Navbar, Card } from '@affinda/react';
30
+
31
+ function App() {
32
+ return (
33
+ <div>
34
+ <Navbar>
35
+ <Button variant="primary">Get Started</Button>
36
+ </Navbar>
37
+ </div>
38
+ );
39
+ }
40
+ ```
41
+
42
+ ### 3. Load NeuSans Font (Recommended)
43
+
44
+ Affinda components use the **NeuSans** font family. To get the authentic Affinda look:
45
+
46
+ 1. Obtain NeuSans font files (contact Affinda or your design team)
47
+ 2. Add @font-face declarations in your global CSS:
48
+
49
+ ```css
50
+ @font-face {
51
+ font-family: 'NeuSans';
52
+ font-style: normal;
53
+ font-weight: 500; /* Book weight for headings */
54
+ src: url('/fonts/NeuSans-Book.woff2') format('woff2');
55
+ }
56
+
57
+ @font-face {
58
+ font-family: 'NeuSans';
59
+ font-style: normal;
60
+ font-weight: 400; /* Regular weight */
61
+ src: url('/fonts/NeuSans-Regular.woff2') format('woff2');
62
+ }
63
+ ```
64
+
65
+ **Don't have NeuSans?** The components will gracefully fall back to Inter and system fonts.
66
+
13
67
  ## Usage
14
68
 
15
69
  ### Import Components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@affinda/react",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": ["dist", "README.md"],
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@affinda/icons": "^0.0.3",
16
- "@affinda/wc": "^0.0.5",
16
+ "@affinda/wc": "^0.0.6",
17
17
  "@stencil/react-output-target": "^1.2.0"
18
18
  },
19
19
  "scripts": {