@tinybigui/react 0.1.0-rc.1
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/LICENSE +21 -0
- package/README.md +378 -0
- package/dist/index.cjs +3374 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1836 -0
- package/dist/index.d.ts +1836 -0
- package/dist/index.js +3329 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +213 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.cts +2 -0
- package/dist/styles.d.ts +2 -0
- package/package.json +118 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 buildinclicks
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
# @tinybigui/react
|
|
2
|
+
|
|
3
|
+
> Material Design 3 React components
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@tinybigui/react)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://bundlephobia.com/package/@tinybigui/react)
|
|
8
|
+
|
|
9
|
+
A modern, accessible React component library implementing Google's Material Design 3 design system. Built with TypeScript, styled with Tailwind CSS v4, and optimized for performance.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## โ ๏ธ Status
|
|
14
|
+
|
|
15
|
+
> **๐ง Work in Progress**
|
|
16
|
+
>
|
|
17
|
+
> This package is currently in active development (Phase 0) and is **not yet published to npm**.
|
|
18
|
+
>
|
|
19
|
+
> Follow our [GitHub repository](https://github.com/buildinclicks/tinybigui) for updates!
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## โจ Features
|
|
24
|
+
|
|
25
|
+
- ๐จ **Material Design 3** - Full implementation of MD3 design system
|
|
26
|
+
- ๐ **Dark Mode** - Automatic theme switching based on system preferences
|
|
27
|
+
- โฟ **Accessible** - WCAG 2.1 AA compliant, keyboard navigation, screen reader support
|
|
28
|
+
- ๐ฏ **TypeScript** - 100% TypeScript with comprehensive type definitions
|
|
29
|
+
- ๐ฆ **Tree-shakable** - Import only what you need, optimized bundle size
|
|
30
|
+
- ๐จ **Customizable** - Easy theming with CSS variables and Tailwind classes
|
|
31
|
+
- ๐ **Modern React** - Built for React 18+ with hooks and concurrent features
|
|
32
|
+
- ๐ฑ **Responsive** - Mobile-first, works on all screen sizes
|
|
33
|
+
- ๐งช **Well Tested** - Comprehensive unit and integration tests
|
|
34
|
+
- ๐ **Documented** - Full API documentation with examples
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## ๐ฆ Installation
|
|
39
|
+
|
|
40
|
+
> **Coming Soon!** This package will be available once we reach Phase 1b.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @tinybigui/react
|
|
44
|
+
# or
|
|
45
|
+
pnpm add @tinybigui/react
|
|
46
|
+
# or
|
|
47
|
+
yarn add @tinybigui/react
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Peer Dependencies
|
|
51
|
+
|
|
52
|
+
This library requires React 18 or higher:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"react": "^18.0.0",
|
|
57
|
+
"react-dom": "^18.0.0"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## ๐ Quick Start
|
|
64
|
+
|
|
65
|
+
### 1. Import the CSS
|
|
66
|
+
|
|
67
|
+
Import the styles in your app's entry point:
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
// main.tsx or App.tsx
|
|
71
|
+
import "@tinybigui/react/styles.css";
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. Use Components
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { Button, TextField, Card } from "@tinybigui/react";
|
|
78
|
+
|
|
79
|
+
function App() {
|
|
80
|
+
return (
|
|
81
|
+
<div>
|
|
82
|
+
<Card>
|
|
83
|
+
<h1>Welcome to TinyBigUI</h1>
|
|
84
|
+
<TextField label="Email" type="email" />
|
|
85
|
+
<Button variant="filled" color="primary">
|
|
86
|
+
Sign Up
|
|
87
|
+
</Button>
|
|
88
|
+
</Card>
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 3. Customize Theme (Optional)
|
|
95
|
+
|
|
96
|
+
Override CSS variables to customize the theme:
|
|
97
|
+
|
|
98
|
+
```css
|
|
99
|
+
:root {
|
|
100
|
+
--md-sys-color-primary: #your-color;
|
|
101
|
+
--md-sys-color-on-primary: #your-text-color;
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## ๐ Components
|
|
108
|
+
|
|
109
|
+
### Phase 1a: Core Buttons (In Progress)
|
|
110
|
+
|
|
111
|
+
| Component | Status | Description |
|
|
112
|
+
| ---------------------- | ------ | ----------------------------- |
|
|
113
|
+
| `Button` | ๐ง | Standard button with variants |
|
|
114
|
+
| `IconButton` | ๐ง | Button with icon only |
|
|
115
|
+
| `FloatingActionButton` | ๐ง | FAB for primary actions |
|
|
116
|
+
|
|
117
|
+
### Phase 1b: Form Components (Planned)
|
|
118
|
+
|
|
119
|
+
| Component | Status | Description |
|
|
120
|
+
| ----------- | ------ | --------------------- |
|
|
121
|
+
| `TextField` | ๐ | Text input with label |
|
|
122
|
+
| `Select` | ๐ | Dropdown selection |
|
|
123
|
+
| `Checkbox` | ๐ | Checkbox input |
|
|
124
|
+
| `Radio` | ๐ | Radio button input |
|
|
125
|
+
| `Switch` | ๐ | Toggle switch |
|
|
126
|
+
|
|
127
|
+
### Phase 2: Layout & Navigation (Planned)
|
|
128
|
+
|
|
129
|
+
| Component | Status | Description |
|
|
130
|
+
| --------- | ------ | ------------------------ |
|
|
131
|
+
| `Card` | ๐ | Container with elevation |
|
|
132
|
+
| `Dialog` | ๐ | Modal dialog |
|
|
133
|
+
| `Drawer` | ๐ | Side navigation drawer |
|
|
134
|
+
| `Tabs` | ๐ | Tabbed navigation |
|
|
135
|
+
|
|
136
|
+
### Phase 3: Data Display (Planned)
|
|
137
|
+
|
|
138
|
+
| Component | Status | Description |
|
|
139
|
+
| --------- | ------ | ---------------------- |
|
|
140
|
+
| `Table` | ๐ | Data table |
|
|
141
|
+
| `List` | ๐ | List with items |
|
|
142
|
+
| `Chip` | ๐ | Compact information |
|
|
143
|
+
| `Badge` | ๐ | Notification badge |
|
|
144
|
+
| `Tooltip` | ๐ | Contextual information |
|
|
145
|
+
|
|
146
|
+
**Legend:**
|
|
147
|
+
|
|
148
|
+
- โ
Complete
|
|
149
|
+
- ๐ง In Progress
|
|
150
|
+
- ๐ Planned
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## ๐จ Variants & Customization
|
|
155
|
+
|
|
156
|
+
### Button Variants
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
<Button variant="filled">Filled</Button>
|
|
160
|
+
<Button variant="outlined">Outlined</Button>
|
|
161
|
+
<Button variant="text">Text</Button>
|
|
162
|
+
<Button variant="elevated">Elevated</Button>
|
|
163
|
+
<Button variant="tonal">Tonal</Button>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Color Schemes
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
<Button color="primary">Primary</Button>
|
|
170
|
+
<Button color="secondary">Secondary</Button>
|
|
171
|
+
<Button color="tertiary">Tertiary</Button>
|
|
172
|
+
<Button color="error">Error</Button>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Sizes
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
<Button size="small">Small</Button>
|
|
179
|
+
<Button size="medium">Medium</Button>
|
|
180
|
+
<Button size="large">Large</Button>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## โฟ Accessibility
|
|
186
|
+
|
|
187
|
+
All components are built with accessibility in mind:
|
|
188
|
+
|
|
189
|
+
- โ
**Keyboard Navigation** - Full keyboard support (Tab, Enter, Space, Arrow keys)
|
|
190
|
+
- โ
**Screen Readers** - Proper ARIA labels and roles
|
|
191
|
+
- โ
**Focus Management** - Clear focus indicators and logical focus order
|
|
192
|
+
- โ
**Color Contrast** - WCAG 2.1 AA compliant contrast ratios
|
|
193
|
+
- โ
**Reduced Motion** - Respects `prefers-reduced-motion`
|
|
194
|
+
- โ
**Semantic HTML** - Uses proper HTML elements
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## ๐ Dark Mode
|
|
199
|
+
|
|
200
|
+
Dark mode is enabled automatically based on system preferences:
|
|
201
|
+
|
|
202
|
+
```css
|
|
203
|
+
/* Automatically switches based on system preference */
|
|
204
|
+
@media (prefers-color-scheme: dark) {
|
|
205
|
+
/* Dark theme applied */
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Manual Control:**
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
// Force dark mode
|
|
213
|
+
document.documentElement.setAttribute("data-theme", "dark");
|
|
214
|
+
|
|
215
|
+
// Force light mode
|
|
216
|
+
document.documentElement.setAttribute("data-theme", "light");
|
|
217
|
+
|
|
218
|
+
// Use system preference
|
|
219
|
+
document.documentElement.removeAttribute("data-theme");
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## ๐ฏ TypeScript Support
|
|
225
|
+
|
|
226
|
+
Full TypeScript support with comprehensive type definitions:
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
import type { ButtonProps, ButtonVariant } from "@tinybigui/react";
|
|
230
|
+
|
|
231
|
+
const MyButton: React.FC<ButtonProps> = (props) => {
|
|
232
|
+
return <Button {...props} />;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// Type-safe variants
|
|
236
|
+
const variant: ButtonVariant = "filled"; // โ
|
|
237
|
+
const invalid: ButtonVariant = "invalid"; // โ Type error
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## ๐ฆ Tree Shaking
|
|
243
|
+
|
|
244
|
+
Only import what you need - unused components are automatically removed:
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
// Only Button code is included in your bundle
|
|
248
|
+
import { Button } from "@tinybigui/react";
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Bundle impact:**
|
|
252
|
+
|
|
253
|
+
- Base styles: ~5KB (gzipped)
|
|
254
|
+
- Button component: ~3KB (gzipped)
|
|
255
|
+
- Each additional component: ~2-4KB (gzipped)
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## ๐ Using with Frameworks
|
|
260
|
+
|
|
261
|
+
### Next.js
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
// app/layout.tsx
|
|
265
|
+
import "@tinybigui/react/styles.css";
|
|
266
|
+
|
|
267
|
+
export default function RootLayout({ children }) {
|
|
268
|
+
return (
|
|
269
|
+
<html lang="en">
|
|
270
|
+
<body>{children}</body>
|
|
271
|
+
</html>
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Vite
|
|
277
|
+
|
|
278
|
+
```tsx
|
|
279
|
+
// main.tsx
|
|
280
|
+
import "@tinybigui/react/styles.css";
|
|
281
|
+
import { createRoot } from "react-dom/client";
|
|
282
|
+
import App from "./App";
|
|
283
|
+
|
|
284
|
+
createRoot(document.getElementById("root")!).render(<App />);
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Remix
|
|
288
|
+
|
|
289
|
+
```tsx
|
|
290
|
+
// app/root.tsx
|
|
291
|
+
import styles from "@tinybigui/react/styles.css";
|
|
292
|
+
|
|
293
|
+
export const links = () => [{ rel: "stylesheet", href: styles }];
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## ๐ ๏ธ Customization
|
|
299
|
+
|
|
300
|
+
### CSS Variables
|
|
301
|
+
|
|
302
|
+
All components use CSS custom properties for easy theming:
|
|
303
|
+
|
|
304
|
+
```css
|
|
305
|
+
:root {
|
|
306
|
+
/* Colors */
|
|
307
|
+
--md-sys-color-primary: #6750a4;
|
|
308
|
+
--md-sys-color-on-primary: #ffffff;
|
|
309
|
+
|
|
310
|
+
/* Typography */
|
|
311
|
+
--md-sys-typescale-body-medium-font-size: 14px;
|
|
312
|
+
|
|
313
|
+
/* Shape */
|
|
314
|
+
--md-sys-shape-corner-medium: 12px;
|
|
315
|
+
|
|
316
|
+
/* Elevation */
|
|
317
|
+
--md-sys-elevation-2: 0 1px 3px rgba(0, 0, 0, 0.12);
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Tailwind Classes
|
|
322
|
+
|
|
323
|
+
Components work seamlessly with Tailwind utilities:
|
|
324
|
+
|
|
325
|
+
```tsx
|
|
326
|
+
<Button className="mt-4 w-full">Custom Styles</Button>
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## ๐ Documentation
|
|
332
|
+
|
|
333
|
+
- **GitHub Repository**: [github.com/buildinclicks/tinybigui](https://github.com/buildinclicks/tinybigui)
|
|
334
|
+
- **Documentation Site**: Coming soon at [tinybigui.dev](https://tinybigui.dev)
|
|
335
|
+
- **Storybook**: Coming soon (interactive component playground)
|
|
336
|
+
- **API Reference**: Coming soon
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## ๐ค Contributing
|
|
341
|
+
|
|
342
|
+
We welcome contributions! See our [Contributing Guide](https://github.com/buildinclicks/tinybigui#contributing) for details.
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## ๐ License
|
|
347
|
+
|
|
348
|
+
MIT ยฉ [buildinclicks](https://github.com/buildinclicks)
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## ๐ Related Packages
|
|
353
|
+
|
|
354
|
+
- [`@tinybigui/tokens`](https://www.npmjs.com/package/@tinybigui/tokens) - Design tokens (CSS variables)
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## ๐ Credits
|
|
359
|
+
|
|
360
|
+
Built with:
|
|
361
|
+
|
|
362
|
+
- [React](https://react.dev/) - UI library
|
|
363
|
+
- [TypeScript](https://www.typescriptlang.org/) - Type safety
|
|
364
|
+
- [Tailwind CSS](https://tailwindcss.com/) - Styling
|
|
365
|
+
- [Material Design 3](https://m3.material.io/) - Design system
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
<div align="center">
|
|
370
|
+
<p>
|
|
371
|
+
<strong>Made with โค๏ธ by <a href="https://github.com/buildinclicks">buildinclicks</a></strong>
|
|
372
|
+
</p>
|
|
373
|
+
<p>
|
|
374
|
+
<a href="https://github.com/buildinclicks/tinybigui">GitHub</a> โข
|
|
375
|
+
<a href="https://github.com/buildinclicks/tinybigui/issues">Report Bug</a> โข
|
|
376
|
+
<a href="https://github.com/buildinclicks/tinybigui/discussions">Request Feature</a>
|
|
377
|
+
</p>
|
|
378
|
+
</div>
|