@deriv-web-design/ui 0.0.1 → 0.0.3

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,77 @@
1
+ # @deriv-web-design/ui
2
+
3
+ React component library for the Deriv Web Design System. Built with TypeScript, powered by Deriv design tokens.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @deriv-web-design/ui
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ Import styles and tokens once in your app entry file (e.g. `main.tsx`):
14
+
15
+ ```js
16
+ import "@deriv-web-design/ui/styles.css";
17
+ import "@deriv-web-design/ui/tokens.css";
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```tsx
23
+ import { Button, TextField, Chip, Tag } from "@deriv-web-design/ui";
24
+
25
+ export default function App() {
26
+ return (
27
+ <div>
28
+ <Button variant="primary">Submit</Button>
29
+ <Button variant="secondary">Cancel</Button>
30
+ <Button variant="danger">Delete</Button>
31
+
32
+ <TextField label="Email" placeholder="you@example.com" />
33
+ <TextField label="Password" type="password" helperText="Min 8 characters" />
34
+
35
+ <Chip label="Active" selected />
36
+ <Tag label="New" />
37
+ </div>
38
+ );
39
+ }
40
+ ```
41
+
42
+ ## Components
43
+
44
+ | Component | Description |
45
+ | -------------- | --------------------------------------------------------- |
46
+ | `Button` | Primary, secondary, ghost, and danger variants |
47
+ | `Accordion` | Expandable/collapsible content sections |
48
+ | `Breadcrumb` | Navigation breadcrumb trail |
49
+ | `Chip` | Compact selection or filter element with selected state |
50
+ | `ChipDropdown` | Chip that opens a dropdown list for selection |
51
+ | `Link` | Styled anchor — coral, black, and white schemes |
52
+ | `Pagination` | Page navigation with previous/next and numbered pages |
53
+ | `SearchField` | Text input with built-in search icon |
54
+ | `Tag` | Fill or outline label for status and categories |
55
+ | `TextField` | Text input with label, helper text, and validation states |
56
+ | `Card` | Content card container |
57
+
58
+ ## Design Tokens
59
+
60
+ All components use Deriv semantic tokens. Tokens are included in `tokens.css` and cover:
61
+
62
+ - **Colors** — core palette (slate, coral, emerald, yellow, blue) + semantic tokens per component
63
+ - **Spacing** — 8-point scale from `--spacing-2` (2px) to `--spacing-112` (112px)
64
+ - **Typography** — Inter font, sizes `xs`–`5xl`, responsive at tablet/desktop breakpoints
65
+ - **Border Radius** — `--radius-xs` through `--radius-full`
66
+ - **Shadows** — `--shadow-xs` through `--shadow-xl`
67
+
68
+ See [`@deriv-web-design/tokens`](https://www.npmjs.com/package/@deriv-web-design/tokens) for the full token reference.
69
+
70
+ ## TypeScript
71
+
72
+ Full TypeScript definitions are included — no `@types` package needed.
73
+
74
+ ## Requirements
75
+
76
+ - React 18 or 19
77
+ - Node.js 18+