@f0rbit/ui 0.1.2
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 +149 -0
- package/dist/components.css +1054 -0
- package/dist/index.d.ts +217 -0
- package/dist/index.js +1137 -0
- package/dist/index.jsx +752 -0
- package/dist/reset.css +93 -0
- package/dist/server.js +794 -0
- package/dist/server.jsx +752 -0
- package/dist/styles.css +1582 -0
- package/dist/tokens.css +121 -0
- package/dist/utilities.css +298 -0
- package/package.json +84 -0
- package/src/components/Badge.tsx +38 -0
- package/src/components/Button.tsx +55 -0
- package/src/components/Card.tsx +82 -0
- package/src/components/Checkbox.tsx +50 -0
- package/src/components/Chevron.tsx +36 -0
- package/src/components/Clamp.tsx +51 -0
- package/src/components/Collapsible.tsx +39 -0
- package/src/components/Dropdown.tsx +114 -0
- package/src/components/Empty.tsx +22 -0
- package/src/components/FormField.tsx +33 -0
- package/src/components/Input.tsx +35 -0
- package/src/components/Modal.tsx +106 -0
- package/src/components/Spinner.tsx +31 -0
- package/src/components/Stat.tsx +18 -0
- package/src/components/Status.tsx +43 -0
- package/src/components/Stepper.tsx +139 -0
- package/src/components/Tabs.tsx +120 -0
- package/src/components/Timeline.tsx +66 -0
- package/src/components/Toggle.tsx +29 -0
- package/src/index.tsx +65 -0
- package/src/styles/components.css +1054 -0
- package/src/styles/reset.css +93 -0
- package/src/styles/tokens.css +121 -0
- package/src/styles/utilities.css +298 -0
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# @f0rbit/ui
|
|
2
|
+
|
|
3
|
+
A minimal, composable UI component library for SolidJS.
|
|
4
|
+
|
|
5
|
+
## Philosophy
|
|
6
|
+
|
|
7
|
+
This library is built on a few core principles:
|
|
8
|
+
|
|
9
|
+
- **Minimalism over features** - Ship only what's needed. No bloated dependencies, no unnecessary abstractions.
|
|
10
|
+
- **CSS-first styling** - Components are styled via CSS classes and custom properties, not runtime style objects. This enables layered customization through CSS cascade.
|
|
11
|
+
- **Composable architecture** - Components like `Card`, `Modal`, and `Dropdown` are built from smaller primitives (`CardHeader`, `CardTitle`, `ModalBody`, etc.) that can be mixed and matched.
|
|
12
|
+
- **Semantic markup** - Components render sensible HTML elements with proper accessibility attributes (ARIA labels, keyboard handling).
|
|
13
|
+
- **Zero runtime styling dependencies** - Styles ship as plain CSS. No CSS-in-JS, no build-time extraction magic.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bun add @f0rbit/ui solid-js
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Import components and styles:
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Button, Card, CardHeader, CardTitle, CardContent } from "@f0rbit/ui";
|
|
27
|
+
import "@f0rbit/ui/styles";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use in your SolidJS app:
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
function App() {
|
|
34
|
+
return (
|
|
35
|
+
<Card>
|
|
36
|
+
<CardHeader>
|
|
37
|
+
<CardTitle>Hello World</CardTitle>
|
|
38
|
+
</CardHeader>
|
|
39
|
+
<CardContent>
|
|
40
|
+
<Button variant="primary">Click me</Button>
|
|
41
|
+
</CardContent>
|
|
42
|
+
</Card>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### CSS Imports
|
|
48
|
+
|
|
49
|
+
Import all styles at once:
|
|
50
|
+
|
|
51
|
+
```css
|
|
52
|
+
@import "@f0rbit/ui/styles";
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or import layers individually for finer control:
|
|
56
|
+
|
|
57
|
+
```css
|
|
58
|
+
@import "@f0rbit/ui/styles/tokens"; /* Design tokens (colors, spacing, typography) */
|
|
59
|
+
@import "@f0rbit/ui/styles/reset"; /* CSS reset */
|
|
60
|
+
@import "@f0rbit/ui/styles/utilities"; /* Layout utilities (.stack, .row, .grid, etc.) */
|
|
61
|
+
@import "@f0rbit/ui/styles/components"; /* Component styles */
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Customization
|
|
65
|
+
|
|
66
|
+
Override design tokens via CSS custom properties:
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
:root {
|
|
70
|
+
--accent: oklch(60% 0.15 250);
|
|
71
|
+
--radius: 0.5rem;
|
|
72
|
+
--space-md: 1rem;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Dark mode is automatic via `prefers-color-scheme: dark`.
|
|
77
|
+
|
|
78
|
+
## Components
|
|
79
|
+
|
|
80
|
+
| Component | Description |
|
|
81
|
+
|-----------|-------------|
|
|
82
|
+
| `Button` | Primary, secondary, ghost, and danger variants with size options |
|
|
83
|
+
| `Badge` | Status indicators with semantic variants (success, error, warning, info) |
|
|
84
|
+
| `Card` | Container with optional header, content, footer, and interactive state |
|
|
85
|
+
| `Input`, `Textarea`, `Select` | Form inputs with error states |
|
|
86
|
+
| `Modal` | Dialog overlay with header, body, footer composition |
|
|
87
|
+
| `Dropdown` | Menu trigger with items and keyboard support |
|
|
88
|
+
| `Status` | Dot indicator with state labels (active, inactive, error, pending) |
|
|
89
|
+
| `Stat` | Value + label display for metrics |
|
|
90
|
+
| `Spinner` | Loading indicator in three sizes |
|
|
91
|
+
| `Chevron` | Directional icon with rotation states |
|
|
92
|
+
| `Empty` | Empty state placeholder with icon, title, description |
|
|
93
|
+
| `Clamp` | Text truncation with expand/collapse toggle |
|
|
94
|
+
| `Collapsible` | Expandable content sections |
|
|
95
|
+
| `Stepper` | Multi-step progress indicator (horizontal/vertical) |
|
|
96
|
+
|
|
97
|
+
## Project Structure
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
src/
|
|
101
|
+
├── components/ # SolidJS components (.tsx)
|
|
102
|
+
│ ├── Button.tsx
|
|
103
|
+
│ ├── Card.tsx
|
|
104
|
+
│ ├── Modal.tsx
|
|
105
|
+
│ └── ...
|
|
106
|
+
├── styles/ # CSS source files
|
|
107
|
+
│ ├── tokens.css # Design tokens (colors, spacing, typography)
|
|
108
|
+
│ ├── reset.css # Modern CSS reset
|
|
109
|
+
│ ├── utilities.css # Layout primitives (.stack, .row, .grid)
|
|
110
|
+
│ └── components.css# Component-specific styles
|
|
111
|
+
└── index.tsx # Public exports
|
|
112
|
+
|
|
113
|
+
docs/ # Astro + Starlight documentation site
|
|
114
|
+
scripts/
|
|
115
|
+
├── build-css.js # Concatenates CSS with layer ordering
|
|
116
|
+
└── generate-llm-docs.js # Generates LLM-friendly documentation
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Development
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Install dependencies
|
|
123
|
+
bun install
|
|
124
|
+
|
|
125
|
+
# Build library
|
|
126
|
+
bun run build
|
|
127
|
+
|
|
128
|
+
# Watch mode
|
|
129
|
+
bun run dev
|
|
130
|
+
|
|
131
|
+
# Run documentation site
|
|
132
|
+
bun run docs
|
|
133
|
+
|
|
134
|
+
# Type check
|
|
135
|
+
bun run typecheck
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Coding Style
|
|
139
|
+
|
|
140
|
+
- **TypeScript strict mode** - All components are fully typed with exported prop interfaces
|
|
141
|
+
- **SolidJS patterns** - Uses `splitProps()` for prop separation, `createSignal()` for local state
|
|
142
|
+
- **CSS Layers** - Styles organized into `@layer reset, tokens, components, utilities` for predictable cascade
|
|
143
|
+
- **OKLCH colors** - Modern color space with automatic dark mode support
|
|
144
|
+
- **Semantic class names** - `.btn`, `.card`, `.modal` etc. with BEM-lite modifiers (`.btn-primary`, `.card-interactive`)
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
MIT
|
|
149
|
+
|