@alivecss/aliveui 1.0.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 +317 -0
- package/dist/cli.js +3811 -0
- package/dist/index.d.mts +42 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +3757 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3717 -0
- package/dist/index.mjs.map +1 -0
- package/dist/runtime.d.mts +27 -0
- package/dist/runtime.d.ts +27 -0
- package/dist/runtime.js +236 -0
- package/dist/runtime.js.map +1 -0
- package/dist/runtime.mjs +205 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/vite.d.mts +43 -0
- package/dist/vite.d.ts +43 -0
- package/dist/vite.js +3872 -0
- package/dist/vite.js.map +1 -0
- package/dist/vite.mjs +3855 -0
- package/dist/vite.mjs.map +1 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# AliveUI
|
|
2
|
+
|
|
3
|
+
**Motion-first CSS framework. Every surface has depth. Every interaction is alive.**
|
|
4
|
+
|
|
5
|
+
Modern interfaces are visually structured but temporally dead. AliveUI treats motion, depth, and interaction feedback as first-class primitives — encoded directly into the utility system, not bolted on as an afterthought.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @pratikshadake/aliveui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Two ways to use it
|
|
18
|
+
|
|
19
|
+
### 1. PostCSS Plugin
|
|
20
|
+
|
|
21
|
+
Add to `postcss.config.js`:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
module.exports = {
|
|
25
|
+
plugins: {
|
|
26
|
+
'@pratikshadake/aliveui': {
|
|
27
|
+
content: ['./src/**/*.{html,js,jsx,ts,tsx,vue,svelte}'],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
In your CSS entry file:
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
@aliveui base;
|
|
37
|
+
@aliveui utilities;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. CLI
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Create config
|
|
44
|
+
npx @pratikshadake/aliveui init
|
|
45
|
+
|
|
46
|
+
# Build once
|
|
47
|
+
npx @pratikshadake/aliveui build
|
|
48
|
+
|
|
49
|
+
# Watch mode
|
|
50
|
+
npx @pratikshadake/aliveui watch
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Config file (`aliveui.config.js`):
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
/** @type {import('@pratikshadake/aliveui').AliveUIConfig} */
|
|
57
|
+
module.exports = {
|
|
58
|
+
content: ['./src/**/*.{html,js,jsx,ts,tsx}'],
|
|
59
|
+
output: './public/alive.css',
|
|
60
|
+
theme: {
|
|
61
|
+
// optional overrides
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Core Concepts
|
|
69
|
+
|
|
70
|
+
### Depth
|
|
71
|
+
|
|
72
|
+
Every surface belongs to one of three depth levels. Depth is not just visual — it controls motion behavior.
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<!-- d1: base surface — color transitions only -->
|
|
76
|
+
<div class="d1 bg-white p-6 rounded-xl">...</div>
|
|
77
|
+
|
|
78
|
+
<!-- d2: elevated interactive — elevation + scale on hover -->
|
|
79
|
+
<div class="d2 bg-white p-6 rounded-xl">...</div>
|
|
80
|
+
|
|
81
|
+
<!-- d3: floating layer — strong shadow, entrance animations -->
|
|
82
|
+
<div class="d3 bg-white p-6 rounded-xl">...</div>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The depth context propagates through the DOM via CSS custom properties. Every child utility that involves color or opacity will automatically transition with the correct duration and easing — no `transition-colors duration-200` needed.
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<!-- bg-blue-500 inside d2 transitions automatically -->
|
|
89
|
+
<div class="d2 rounded-xl p-4">
|
|
90
|
+
<button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg">
|
|
91
|
+
Automatically animated
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Motion Tokens
|
|
97
|
+
|
|
98
|
+
Three durations. Three easing curves. No arbitrary values.
|
|
99
|
+
|
|
100
|
+
| Token | Value |
|
|
101
|
+
|-------|-------|
|
|
102
|
+
| `--alive-duration-fast` | 120ms |
|
|
103
|
+
| `--alive-duration-normal` | 200ms |
|
|
104
|
+
| `--alive-duration-slow` | 320ms |
|
|
105
|
+
| `--alive-ease-standard` | `cubic-bezier(0.2, 0, 0, 1)` |
|
|
106
|
+
| `--alive-ease-emphasized` | `cubic-bezier(0.05, 0.7, 0.1, 1)` |
|
|
107
|
+
| `--alive-ease-exit` | `cubic-bezier(0.3, 0, 0.8, 0.15)` |
|
|
108
|
+
|
|
109
|
+
Override on any element:
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<div class="d2 motion-fast">Fast elevation</div>
|
|
113
|
+
<div class="d2 ease-emphasized">Emphasized hover</div>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Entrance Animations
|
|
117
|
+
|
|
118
|
+
```html
|
|
119
|
+
<div class="alive-enter">Fades up on load</div>
|
|
120
|
+
<div class="alive-enter-fade">Fades in on load</div>
|
|
121
|
+
<div class="alive-enter-scale">Scales in on load</div>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Staggered entrance using CSS custom properties:
|
|
125
|
+
|
|
126
|
+
```html
|
|
127
|
+
<ul>
|
|
128
|
+
<li class="alive-enter" style="--alive-index: 0">First</li>
|
|
129
|
+
<li class="alive-enter" style="--alive-index: 1">Second</li>
|
|
130
|
+
<li class="alive-enter" style="--alive-index: 2">Third</li>
|
|
131
|
+
</ul>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Utilities
|
|
137
|
+
|
|
138
|
+
AliveUI ships a full utility set. Class names are intentionally compatible with Tailwind conventions where they overlap.
|
|
139
|
+
|
|
140
|
+
### Depth & Motion
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
d1 d2 d3
|
|
144
|
+
motion-fast motion-normal motion-slow motion-none
|
|
145
|
+
ease-standard ease-emphasized ease-exit
|
|
146
|
+
alive-enter alive-enter-fade alive-enter-scale
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Layout
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
flex inline-flex grid block hidden contents
|
|
153
|
+
flex-row flex-col flex-wrap flex-nowrap
|
|
154
|
+
flex-1 flex-auto flex-none
|
|
155
|
+
items-start items-center items-end items-stretch
|
|
156
|
+
justify-start justify-center justify-end justify-between
|
|
157
|
+
grid-cols-{1-12} grid-rows-{1-6}
|
|
158
|
+
col-span-{n} row-span-{n}
|
|
159
|
+
gap-{size} gap-x-{size} gap-y-{size}
|
|
160
|
+
relative absolute fixed sticky
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Spacing
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
p-{size} px-{size} py-{size} pt-{size} pr-{size} pb-{size} pl-{size}
|
|
167
|
+
m-{size} mx-{size} my-{size} mt-{size} mr-{size} mb-{size} ml-{size}
|
|
168
|
+
top-{size} right-{size} bottom-{size} left-{size} inset-{size}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Size scale: `0 0.5 1 1.5 2 2.5 3 4 5 6 8 10 12 16 20 24 32 40 48 64 96 ...`
|
|
172
|
+
|
|
173
|
+
### Colors
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
bg-{color}-{shade} text-{color}-{shade} border-{color}-{shade}
|
|
177
|
+
ring-{color}-{shade} fill-{color}-{shade} stroke-{color}-{shade}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Colors: `slate gray zinc neutral stone red orange amber yellow lime green emerald teal cyan sky blue indigo violet purple fuchsia pink rose`
|
|
181
|
+
|
|
182
|
+
Shades: `50 100 200 300 400 500 600 700 800 900 950`
|
|
183
|
+
|
|
184
|
+
All color utilities that live inside a depth context (`d1`, `d2`, `d3`) automatically transition with the correct motion timing.
|
|
185
|
+
|
|
186
|
+
### Typography
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
text-{xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl}
|
|
190
|
+
font-{thin|extralight|light|normal|medium|semibold|bold|extrabold|black}
|
|
191
|
+
font-{sans|serif|mono}
|
|
192
|
+
leading-{tight|snug|normal|relaxed|loose}
|
|
193
|
+
tracking-{tighter|tight|normal|wide|wider|widest}
|
|
194
|
+
text-left text-center text-right text-justify
|
|
195
|
+
uppercase lowercase capitalize
|
|
196
|
+
underline line-through no-underline
|
|
197
|
+
truncate whitespace-nowrap
|
|
198
|
+
italic
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Sizing
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
w-{size} w-full w-screen w-auto w-min w-max w-fit
|
|
205
|
+
w-1/2 w-1/3 w-2/3 w-1/4 w-3/4
|
|
206
|
+
h-{size} h-full h-screen h-auto
|
|
207
|
+
min-w-{size} max-w-{size|xs|sm|md|lg|xl|2xl|...}
|
|
208
|
+
min-h-{size} max-h-{size}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Effects
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
opacity-{0|5|10|20|25|30|40|50|60|70|75|80|90|95|100}
|
|
215
|
+
shadow-{sm|DEFAULT|md|lg|xl|2xl|none}
|
|
216
|
+
rounded-{none|sm|DEFAULT|md|lg|xl|2xl|3xl|full}
|
|
217
|
+
border border-{0|2|4|8} border-{t|r|b|l}
|
|
218
|
+
ring ring-{1|2|4}
|
|
219
|
+
blur-{sm|DEFAULT|md|lg|xl}
|
|
220
|
+
backdrop-blur-{sm|DEFAULT|md|lg|xl}
|
|
221
|
+
scale-{0|50|75|90|95|100|105|110|125|150}
|
|
222
|
+
z-{0|10|20|30|40|50}
|
|
223
|
+
overflow-{hidden|auto|scroll|visible}
|
|
224
|
+
cursor-{pointer|default|not-allowed|wait|text|grab}
|
|
225
|
+
select-{none|text|all}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Variants
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
hover: focus: focus-visible: active: disabled:
|
|
232
|
+
dark: md: lg: xl: 2xl:
|
|
233
|
+
first: last: odd: even:
|
|
234
|
+
group-hover: (requires class="group" on parent)
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Components
|
|
240
|
+
|
|
241
|
+
AliveUI ships three primitive components — thin semantic wrappers for common patterns.
|
|
242
|
+
|
|
243
|
+
```html
|
|
244
|
+
<!-- Card -->
|
|
245
|
+
<div class="alive-card d2">
|
|
246
|
+
Content here
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<!-- Button variants -->
|
|
250
|
+
<button class="alive-button alive-button-primary">Primary</button>
|
|
251
|
+
<button class="alive-button alive-button-secondary">Secondary</button>
|
|
252
|
+
<button class="alive-button alive-button-ghost">Ghost</button>
|
|
253
|
+
|
|
254
|
+
<!-- Button sizes -->
|
|
255
|
+
<button class="alive-button alive-button-primary alive-button-sm">Small</button>
|
|
256
|
+
<button class="alive-button alive-button-primary alive-button-lg">Large</button>
|
|
257
|
+
|
|
258
|
+
<!-- Stack layout -->
|
|
259
|
+
<div class="alive-stack alive-stack-v gap-4">
|
|
260
|
+
<div>Item one</div>
|
|
261
|
+
<div>Item two</div>
|
|
262
|
+
</div>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Configuration
|
|
268
|
+
|
|
269
|
+
```js
|
|
270
|
+
/** @type {import('@pratikshadake/aliveui').AliveUIConfig} */
|
|
271
|
+
module.exports = {
|
|
272
|
+
content: ['./src/**/*.{html,jsx,tsx}'],
|
|
273
|
+
output: './public/alive.css',
|
|
274
|
+
theme: {
|
|
275
|
+
// Add custom colors
|
|
276
|
+
colors: {
|
|
277
|
+
brand: '#6366f1',
|
|
278
|
+
},
|
|
279
|
+
// Add custom spacing
|
|
280
|
+
spacing: {
|
|
281
|
+
'18': '4.5rem',
|
|
282
|
+
'88': '22rem',
|
|
283
|
+
},
|
|
284
|
+
// Dark mode strategy: 'media' (default) or 'class'
|
|
285
|
+
darkMode: 'class',
|
|
286
|
+
},
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Design Rules
|
|
293
|
+
|
|
294
|
+
These are not conventions. They are the system.
|
|
295
|
+
|
|
296
|
+
**One primary animated element per view.** AliveUI's motion model is calm, not spectacular.
|
|
297
|
+
|
|
298
|
+
**No arbitrary durations.** Use `motion-fast` (120ms), `motion-normal` (200ms), or `motion-slow` (320ms).
|
|
299
|
+
|
|
300
|
+
**No infinite loops.** No parallax. No scroll-triggered chaos.
|
|
301
|
+
|
|
302
|
+
**Depth determines motion behavior.** `d1` does color shifts. `d2` does elevation. `d3` does entrances.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## What AliveUI is NOT
|
|
307
|
+
|
|
308
|
+
- Not a Tailwind clone — though class names are intentionally familiar
|
|
309
|
+
- Not an animation playground — motion is a structural primitive, not decoration
|
|
310
|
+
- Not a component library — three primitives, composable with utilities
|
|
311
|
+
- Not opinionated about your color palette — use any colors via config
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## License
|
|
316
|
+
|
|
317
|
+
MIT
|