@liquid-noise/core 0.1.0 → 0.1.46

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/CONCEPT.md CHANGED
@@ -1,5 +1,113 @@
1
1
  # Liquid Design Framework — Concept & Technical Documentation
2
2
 
3
+ > **Live showcase:** [framework.plate.ninja](https://framework.plate.ninja)
4
+
5
+ ---
6
+
7
+ ## Integration — How to use in your app
8
+
9
+ ### 1. Install
10
+
11
+ ```bash
12
+ npm install @liquid-noise/core
13
+ ```
14
+
15
+ Requires React 18 or 19.
16
+
17
+ ### 2. Import framework CSS (required)
18
+
19
+ Import once in your app entry (e.g. `main.tsx` or `index.tsx`):
20
+
21
+ ```tsx
22
+ import "@liquid-noise/core/styles/framework.css";
23
+ ```
24
+
25
+ This loads `--fw-font-xs/s/m/l/xl`, `--fw-avatar-size`, `--fw-space-*`, `--fw-size-*`, `--fw-ease`, `--fw-transition-*`, etc. Without this import, noise and size will not apply correctly.
26
+
27
+ ### 3. Wrap app with providers + FrameworkSizeSync
28
+
29
+ ```tsx
30
+ import {
31
+ NoiseProvider,
32
+ SizeProvider,
33
+ FrameworkSizeSync,
34
+ RotaryKnob,
35
+ useNoise,
36
+ useSize,
37
+ } from "@liquid-noise/core";
38
+
39
+ function AppContent() {
40
+ const { noise, setNoise } = useNoise();
41
+ const { size, setSize } = useSize();
42
+
43
+ return (
44
+ <>
45
+ <FrameworkSizeSync />
46
+ <header>
47
+ <RotaryKnob label="Noise" value={noise} onChange={setNoise} />
48
+ <RotaryKnob label="Size" value={size} onChange={setSize} />
49
+ </header>
50
+ <main>{/* Your content */}</main>
51
+ </>
52
+ );
53
+ }
54
+
55
+ function App() {
56
+ return (
57
+ <NoiseProvider initialValue={5}>
58
+ <SizeProvider initialValue={5}>
59
+ <AppContent />
60
+ </SizeProvider>
61
+ </NoiseProvider>
62
+ );
63
+ }
64
+ ```
65
+
66
+ - **NoiseProvider** / **SizeProvider** — Required. Accept `initialValue` and optional `onSave` (e.g. persistence).
67
+ - **FrameworkSizeSync** — Required. Must be inside SizeProvider. Updates `--fw-font-*` and `--fw-avatar-size` on `:root` when size changes.
68
+ - **RotaryKnob** — Optional. You can use any controls; just pass `value` and `onChange` from `useNoise()` / `useSize()`.
69
+
70
+ ### 4. Use in your components
71
+
72
+ **Size (scale):** Use `getFontSize()` and `getAvatarSize()` with `size` from `useSize()`:
73
+
74
+ ```tsx
75
+ const { size } = useSize();
76
+ const fontSize = getFontSize("s", size);
77
+ const avatarPx = getAvatarSize(size);
78
+
79
+ <span style={{ fontSize: `${fontSize}px` }}>Name</span>
80
+ <div style={{ width: avatarPx, height: avatarPx }} />
81
+ ```
82
+
83
+ Or use CSS variables (updated by FrameworkSizeSync):
84
+
85
+ ```css
86
+ .my-label { font-size: var(--fw-font-s); }
87
+ .my-avatar { width: var(--fw-avatar-size); height: var(--fw-avatar-size); }
88
+ ```
89
+
90
+ **Noise (visibility):** Use `useNoise()` and `useDeferredUnmount()` to show/hide elements:
91
+
92
+ ```tsx
93
+ const { noise } = useNoise();
94
+ const { mounted, visible } = useDeferredUnmount(noise >= 4);
95
+
96
+ if (!mounted) return null;
97
+ return <div style={{ opacity: visible ? 1 : 0, transition: "..." }}>...</div>;
98
+ ```
99
+
100
+ **Team Avatar (ready-to-use widget):** See [Team Avatar — Full Guide](#team-avatar---full-guide) below.
101
+
102
+ ### Checklist
103
+
104
+ | Step | Required |
105
+ |------|----------|
106
+ | `import "@liquid-noise/core/styles/framework.css"` | Yes |
107
+ | Wrap with `NoiseProvider` and `SizeProvider` | Yes |
108
+ | Render `FrameworkSizeSync` inside `SizeProvider` | Yes |
109
+ | Use `TeamAvatar` or `getFontSize`/`getAvatarSize`/`useNoise()` in components | For widgets to work |
110
+
3
111
  ---
4
112
 
5
113
  ## 1. What is Liquid?
@@ -30,7 +138,7 @@ Users adjust these via knobs in the header. Widgets update in real time in the D
30
138
  | 4 | + Tag |
31
139
  | 7 | + Assignee, description preview |
32
140
 
33
- ### Example: Team Avatar (implemented)
141
+ ### Example: Team Avatar
34
142
 
35
143
  | Noise | Visible |
36
144
  |-------|---------|
@@ -39,6 +147,19 @@ Users adjust these via knobs in the header. Widgets update in real time in the D
39
147
  | 4–6 | Avatar + name |
40
148
  | 7–10 | Avatar + name + role |
41
149
 
150
+ **Note:** Noise controls *what* appears. Size controls *how big* (avatar diameter via `getAvatarSize(size)`, font sizes via `getFontSize()`).
151
+
152
+ ### Example: Action Button
153
+
154
+ | Noise | Visible |
155
+ |-------|---------|
156
+ | 0–1 | Icon only |
157
+ | 2–3 | Icon + label |
158
+ | 4–6 | Icon + label + counter |
159
+ | 7–10 | Icon + label + counter + caption |
160
+
161
+ Size scales font, padding, and icon proportionally.
162
+
42
163
  ### Implementation
43
164
 
44
165
  - **`useNoise()`** — Hook returning `{ noise, setNoise }`
@@ -75,12 +196,23 @@ Three layers:
75
196
 
76
197
  | Semantic | Tier 0 (0–2) | Tier 1 (3–4) | Tier 2 (5–7) | Tier 3 (8–10) |
77
198
  |----------|--------------|--------------|--------------|---------------|
78
- | xs | 10px | 12px | 14px | 16px |
79
- | s | 12px | 14px | 16px | 18px |
199
+ | xs | 10px | 12px | 14px | 14px |
200
+ | s | 12px | 14px | 16px | 16px |
80
201
  | m | 14px | 16px | 18px | 20px |
81
202
  | l | 16px | 18px | 20px | 24px |
82
203
  | xl | 18px | 20px | 24px | 28px |
83
204
 
205
+ ### Avatar Size
206
+
207
+ `getAvatarSize(size)` returns diameter in px per size tier:
208
+
209
+ | Tier | Diameter |
210
+ |------|----------|
211
+ | 0 (0–2) | 20px |
212
+ | 1 (3–4) | 24px |
213
+ | 2 (5–7) | 28px |
214
+ | 3 (8–10) | 36px |
215
+
84
216
  ### Usage in Components
85
217
 
86
218
  ```tsx
@@ -111,20 +243,186 @@ function MyWidget() {
111
243
 
112
244
  Use `var(--fw-font-s)` in CSS when the component is inside the size context.
113
245
 
246
+ ### Spacing Scale
247
+
248
+ Global spacing variables for margin, padding, gap:
249
+
250
+ - `--fw-space-0` … `--fw-space-96` — Scale: 0, 2, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96 (px)
251
+ - Use `var(--fw-space-8)` for padding, `var(--fw-space-16)` for gaps, etc.
252
+
253
+ ### Element Sizes
254
+
255
+ For avatars, icons, cards, modals — width/height/min-width/min-height:
256
+
257
+ - `--fw-size-24` … `--fw-size-256` — Scale: 24, 32, 40, 48 … 256 (px), step 8
258
+
259
+ ### Typography Emphasis Levels
260
+
261
+ Semantic font weights from light to bold:
262
+
263
+ | Token | Variable | Value | Use |
264
+ |-------|----------|-------|-----|
265
+ | tertiary | `--fw-weight-tertiary` | 300 | Captions, hints |
266
+ | secondary | `--fw-weight-secondary` | 400 | Secondary text |
267
+ | main | `--fw-weight-main` | 500 | Body, default emphasis |
268
+ | highlight | `--fw-weight-highlight` | 600 | Emphasized text |
269
+ | title | `--fw-weight-title` | 700 | Headings |
270
+
271
+ Utility classes: `.fw-weight-tertiary`, `.fw-weight-secondary`, `.fw-weight-main`, `.fw-weight-highlight`, `.fw-weight-title`
272
+
273
+ ### Base Font Sizes (Fixed)
274
+
275
+ For labels, captions, or when semantic sizes don't fit: `--fw-font-base-8`, `--fw-font-base-10`, … `--fw-font-base-28` (8, 10, 12, 14, 16, 18, 20, 24, 28 px).
276
+
277
+ ### Theme Colors (optional)
278
+
279
+ For light/dark theming: `--fw-color-black`, `--fw-color-white`, `--fw-color-blue`. Define in your app and use for backgrounds, text, accents. See **Pantone** showcase page for hex values and usage.
280
+
281
+ ---
282
+
283
+ ## 4. Transitions
284
+
285
+ All transitions use a **single global easing**: `--fw-ease` (CSS) / `FW_EASE` (TS). Use preset variables instead of repeating duration/ease:
286
+
287
+ | Variable | Use |
288
+ |----------|-----|
289
+ | `--fw-ease` | Global easing curve |
290
+ | `--fw-duration-fast` | 0.15s |
291
+ | `--fw-duration-normal` | 0.25s |
292
+ | `--fw-duration-slow` | 0.35s |
293
+ | `--fw-transition-appear` | opacity, max-width, max-height, grid-template-rows |
294
+ | `--fw-transition-size` | width, height, font-size |
295
+ | `--fw-transition-opacity` | opacity only |
296
+ | `--fw-transition-opacity-font` | opacity + font-size |
297
+
298
+ TS exports: `FW_EASE`, `FW_TRANSITION_APPEAR`, `FW_TRANSITION_SIZE`, `FW_TRANSITION_OPACITY`
299
+
114
300
  ---
115
301
 
116
- ## 4. Global Easing
302
+ ## 5. Team Avatar — Full Guide
303
+
304
+ `TeamAvatar` is a ready-to-use widget that shows a team member with adaptive density based on noise and size.
305
+
306
+ ### Setup (required before using TeamAvatar)
307
+
308
+ 1. Import framework CSS in your app entry:
309
+
310
+ ```tsx
311
+ import "@liquid-noise/core/styles/framework.css";
312
+ ```
313
+
314
+ 2. Wrap your app with providers:
315
+
316
+ ```tsx
317
+ import {
318
+ NoiseProvider,
319
+ SizeProvider,
320
+ FrameworkSizeSync,
321
+ } from "@liquid-noise/core";
322
+
323
+ function App() {
324
+ return (
325
+ <NoiseProvider initialValue={5}>
326
+ <SizeProvider initialValue={5}>
327
+ <FrameworkSizeSync />
328
+ <YourContent />
329
+ </SizeProvider>
330
+ </NoiseProvider>
331
+ );
332
+ }
333
+ ```
334
+
335
+ 3. Import and use the component:
336
+
337
+ ```tsx
338
+ import { TeamAvatar } from "@liquid-noise/core";
339
+
340
+ <TeamAvatar letter="K" name="Karen" role="Designer" />
341
+ ```
342
+
343
+ ### Props
344
+
345
+ | Prop | Type | Required | Description |
346
+ |------|------|----------|-------------|
347
+ | `letter` | `string` | Yes | First letter shown in avatar (when no image) |
348
+ | `name` | `string` | No | Display name. Visible at noise ≥ 4 |
349
+ | `role` | `string` | No | Role or label. Visible at noise ≥ 7 |
350
+ | `imageUrl` | `string` | No | Photo URL. Overrides letter |
351
+ | `background` | `string` | No | Custom gradient/color when no image. Default: purple gradient |
352
+ | `className` | `string` | No | Extra CSS class for the root |
117
353
 
118
- All transitions in Liquid elements use a **single global easing**: `--fw-ease` (CSS) / `FW_EASE` (TS). Any change — noise, size, appear, collapse — uses this curve. Do not add custom easing for framework elements.
354
+ ### Noise tiers
355
+
356
+ | Noise | Visible |
357
+ |-------|---------|
358
+ | 0–1 | Placeholder (dashed circle) |
359
+ | 2–3 | Avatar only |
360
+ | 4–6 | Avatar + name |
361
+ | 7–10 | Avatar + name + role |
362
+
363
+ ### Examples
364
+
365
+ **Basic:**
366
+
367
+ ```tsx
368
+ <TeamAvatar letter="K" name="Karen" role="Designer" />
369
+ ```
370
+
371
+ **With photo:**
372
+
373
+ ```tsx
374
+ <TeamAvatar
375
+ letter="M"
376
+ name="Mike"
377
+ role="Developer"
378
+ imageUrl="https://example.com/avatar.jpg"
379
+ />
380
+ ```
381
+
382
+ **Custom background:**
383
+
384
+ ```tsx
385
+ <TeamAvatar
386
+ letter="A"
387
+ name="Alex"
388
+ background="linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"
389
+ />
390
+ ```
391
+
392
+ **Data from API/state:**
393
+
394
+ ```tsx
395
+ {members.map((m) => (
396
+ <TeamAvatar
397
+ key={m.id}
398
+ letter={m.name[0]}
399
+ name={m.name}
400
+ role={m.role}
401
+ imageUrl={m.avatarUrl}
402
+ />
403
+ ))}
404
+ ```
405
+
406
+ ### Theme variables (optional)
407
+
408
+ The widget uses `--text`, `--text-tertiary`, `--border` with fallbacks. Define these in your app for consistent theming:
409
+
410
+ ```css
411
+ :root {
412
+ --text: #111111;
413
+ --text-tertiary: #999999;
414
+ --border: #e5e5e5;
415
+ }
416
+ ```
119
417
 
120
418
  ---
121
419
 
122
- ## 5. File Structure
420
+ ## 6. File Structure
123
421
 
124
422
  ```
125
423
  liquid-noise-framework/
126
424
  ├── src/
127
- │ ├── index.ts # Barrel export
425
+ │ ├── index.ts # Barrel export (providers, hooks, components, tokens)
128
426
  │ ├── providers/
129
427
  │ │ ├── NoiseProvider.tsx # NoiseProvider, useNoise
130
428
  │ │ ├── SizeProvider.tsx # SizeProvider, useSize
@@ -133,31 +431,51 @@ liquid-noise-framework/
133
431
  │ │ └── useDeferredUnmount.ts
134
432
  │ ├── components/
135
433
  │ │ ├── NoiseGate.tsx
136
- │ │ └── RotaryKnob.tsx
434
+ │ │ ├── RotaryKnob.tsx
435
+ │ │ └── TeamAvatar.tsx
137
436
  │ ├── tokens/
138
- │ │ ├── transitions.ts
139
- │ │ └── typography.ts
437
+ │ │ ├── transitions.ts # FW_EASE, FW_TRANSITION_*
438
+ │ │ └── typography.ts # getFontSize, getAvatarSize, BASE_FONT_SIZES
140
439
  │ └── styles/
141
- │ ├── framework.css
440
+ │ ├── framework.css # Aggregates all framework CSS
142
441
  │ ├── transitions.css
143
- └── typography.css
442
+ ├── typography.css
443
+ │ ├── spacing.css
444
+ │ ├── element-sizes.css
445
+ │ └── avatar.css
446
+ ├── showcase/ # Live demo app (Vite + React)
144
447
  ├── MANIFEST.md
145
- └── CONCEPT.md
448
+ ├── CONCEPT.md
449
+ └── PUBLISH.md
146
450
  ```
147
451
 
148
452
  ---
149
453
 
150
- ## 6. Creating a New Widget
454
+ ## 7. Creating a New Widget
151
455
 
152
456
  1. **Noise tiers** — Decide at which noise levels each element appears
153
457
  2. **Semantic sizes** — Assign xs/s/m/l/xl to text and labels
154
- 3. **Avatar/icon scale** — Use `getAvatarSize(size)` if the widget has avatars or icons
155
- 4. **Transitions** — Add CSS transitions for opacity, font-size, width, height when values change
458
+ 3. **Emphasis** — Use `--fw-weight-tertiary` `--fw-weight-title` for font weights
459
+ 4. **Spacing** — Use `var(--fw-space-X)` for margin, padding, gap (0, 2, 4, 8 … 96)
460
+ 5. **Element sizes** — Use `var(--fw-size-X)` for avatars, icons, cards (24–256px)
461
+ 6. **Avatar/icon scale** — Use `getAvatarSize(size)` or `var(--fw-avatar-size)` when size knob affects avatar
462
+ 7. **Transitions** — Use `var(--fw-transition-size)`, `var(--fw-transition-opacity)`, etc.
156
463
 
157
464
  ---
158
465
 
159
- ## 7. Widget Registry (Current)
466
+ ## 8. Widget Registry (Current)
467
+
468
+ | Widget | Export | Noise tiers | Size tokens |
469
+ |--------|--------|-------------|-------------|
470
+ | **TeamAvatar** | `import { TeamAvatar } from "@liquid-noise/core"` | 0–1 hidden, 2–3 avatar, 4–6 +name, 7+ +role | `getAvatarSize(size)`, name (s), role (xs) |
471
+ | Action button | (build in app) | 0–1 icon, 2–3 +label, 4–6 +counter, 7+ +caption | `getFontSize(s)`, padding, icon scale |
472
+
473
+ ## 9. Showcase
474
+
475
+ The live showcase ([framework.plate.ninja](https://framework.plate.ninja)) documents all tokens. Pages:
160
476
 
161
- | Widget | Noise tiers | Size tokens |
162
- |--------|-------------|-------------|
163
- | Team avatar | 0–1 hidden, 2–3 avatar, 4–6 +name, 7+ +role | Avatar, name (s), role (xs), label (xs) |
477
+ - **Pantone** Theme colors (`--fw-color-black`, `--fw-color-white`, `--fw-color-blue`) for light/dark themes, with usage descriptions and copy-to-clipboard
478
+ - **Elements** — Team Avatar and Action Button with live preview and 4×4 noise×size matrix
479
+ - **Sizes** Semantic fonts, spacing, element sizes, transitions, `--fw-avatar-size`
480
+ - **Typography** — Semantic sizes, emphasis, base font sizes, line height
481
+ - **Documentation** — Design tokens overview, API reference, Quick Start
package/LICENSE ADDED
@@ -0,0 +1,189 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor grants to You a perpetual, worldwide,
68
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license
69
+ to reproduce, prepare Derivative Works of, publicly display, publicly
70
+ perform, sublicense, and distribute the Work and such Derivative Works
71
+ in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor grants to You a perpetual, worldwide,
75
+ non-exclusive, no-charge, royalty-free, irrevocable (except as
76
+ stated in this section) patent license to make, have made, use,
77
+ offer to sell, sell, import, and otherwise transfer the Work, where
78
+ such license applies only to those patent claims licensable by such
79
+ Contributor that are necessarily infringed by their Contribution(s)
80
+ alone or by combination of their Contribution(s) with the Work to
81
+ which such Contribution(s) was submitted. If You institute patent
82
+ litigation against any entity (including a cross-claim or counterclaim
83
+ in a lawsuit) alleging that the Work or a Contribution incorporated
84
+ within the Work constitutes direct or contributory patent infringement,
85
+ then any patent licenses granted to You under this License for that
86
+ Work shall terminate as of the date such litigation is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the
89
+ Work or Derivative Works thereof in any medium, with or without
90
+ modifications, and in Source or Object form, provided that You
91
+ meet the following conditions:
92
+
93
+ (a) You must give any other recipients of the Work or
94
+ Derivative Works a copy of this License; and
95
+
96
+ (b) You must cause any modified files to carry prominent notices
97
+ stating that You changed the files; and
98
+
99
+ (c) You must retain, in the Source form of any Derivative Works
100
+ that You distribute, all copyright, patent, trademark, and
101
+ attribution notices from the Source form of the Work,
102
+ excluding those notices that do not pertain to any part of
103
+ the Derivative Works; and
104
+
105
+ (d) If the Work includes a "NOTICE" text file as part of its
106
+ distribution, then any Derivative Works that You distribute must
107
+ include a readable copy of the attribution notices contained
108
+ within such NOTICE file, excluding those notices that do not
109
+ pertain to any part of the Derivative Works, in at least one
110
+ of the following places: within a NOTICE text file distributed
111
+ as part of the Derivative Works; within the Source form or
112
+ documentation, if provided along with the Derivative Works; or,
113
+ within a display generated by the Derivative Works, if and
114
+ wherever such third-party notices normally appear. The contents
115
+ of the NOTICE file are for informational purposes only and
116
+ do not modify the License. You may add Your own attribution
117
+ notices within Derivative Works that You distribute, alongside
118
+ or as an addendum to the NOTICE text from the Work, provided
119
+ that such additional attribution notices cannot be construed
120
+ as modifying the License.
121
+
122
+ You may add Your own copyright statement to Your modifications and
123
+ may provide additional or different license terms and conditions
124
+ for use, reproduction, or distribution of Your modifications, or
125
+ for any such Derivative Works as a whole, provided Your use,
126
+ reproduction, and distribution of the Work otherwise complies
127
+ with the conditions stated in this License.
128
+
129
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
130
+ any Contribution intentionally submitted for inclusion in the Work
131
+ by You to the Licensor shall be under the terms and conditions of
132
+ this License, without any additional terms or conditions.
133
+ Notwithstanding the above, nothing herein shall supersede or modify
134
+ the terms of any separate license agreement you may have executed
135
+ with Licensor regarding such Contributions.
136
+
137
+ 6. Trademarks. This License does not grant permission to use the trade
138
+ names, trademarks, service marks, or product names of the Licensor,
139
+ except as required for reasonable and customary use in describing the
140
+ origin of the Work and reproducing the content of the NOTICE file.
141
+
142
+ 7. Disclaimer of Warranty. Unless required by applicable law or
143
+ agreed to in writing, Licensor provides the Work (and each
144
+ Contributor provides its Contributions) on an "AS IS" BASIS,
145
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
146
+ implied, including, without limitation, any warranties or conditions
147
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
148
+ PARTICULAR PURPOSE. You are solely responsible for determining the
149
+ appropriateness of using or redistributing the Work and assume any
150
+ risks associated with Your exercise of permissions under this License.
151
+
152
+ 8. Limitation of Liability. In no event and under no legal theory,
153
+ whether in tort (including negligence), contract, or otherwise,
154
+ unless required by applicable law (such as deliberate and grossly
155
+ negligent acts) or agreed to in writing, shall any Contributor be
156
+ liable to You for damages, including any direct, indirect, special,
157
+ incidental, or consequential damages of any character arising as a
158
+ result of this License or out of the use or inability to use the
159
+ Work (including but not limited to damages for loss of goodwill,
160
+ work stoppage, computer failure or malfunction, or any and all
161
+ other commercial damages or losses), even if such Contributor
162
+ has been advised of the possibility of such damages.
163
+
164
+ 9. Accepting Warranty or Additional Liability. While redistributing
165
+ the Work or Derivative Works thereof, You may choose to offer,
166
+ and charge a fee for, acceptance of support, warranty, indemnity,
167
+ or other liability obligations and/or rights consistent with this
168
+ License. However, in accepting such obligations, You may act only
169
+ on Your own behalf and on Your sole responsibility, not on behalf
170
+ of any other Contributor, and only if You agree to indemnify,
171
+ defend, and hold each Contributor harmless for any liability
172
+ incurred by, or claims asserted against, such Contributor by reason
173
+ of your accepting any such warranty or additional liability.
174
+
175
+ END OF TERMS AND CONDITIONS
176
+
177
+ Copyright 2026 Plate
178
+
179
+ Licensed under the Apache License, Version 2.0 (the "License");
180
+ you may not use this file except in compliance with the License.
181
+ You may obtain a copy of the License at
182
+
183
+ http://www.apache.org/licenses/LICENSE-2.0
184
+
185
+ Unless required by applicable law or agreed to in writing, software
186
+ distributed under the License is distributed on an "AS IS" BASIS,
187
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
188
+ See the License for the specific language governing permissions and
189
+ limitations under the License.
package/MANIFEST.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Liquid Design Framework — Manifest
2
2
 
3
+ > **Live showcase:** [framework.plate.ninja](https://framework.plate.ninja)
4
+ >
3
5
  > See also: [CONCEPT.md](./CONCEPT.md) — full concept and technical documentation
4
6
 
5
7
  ---
@@ -30,6 +32,14 @@ Each widget defines its own noise tiers. Elements appear or disappear in the DOM
30
32
 
31
33
  Size uses a semantic typography system: base values (8, 10, 12… px), semantic tokens (xs, s, m, l, xl), and a mapping table per knob range.
32
34
 
35
+ ### Design Tokens
36
+
37
+ - **Spacing** — `--fw-space-0` … `--fw-space-96` for margin, padding, gap (0, 2, 4, 8 … 96 px)
38
+ - **Element sizes** — `--fw-size-24` … `--fw-size-256` for avatars, icons, cards (24–256px, step 8)
39
+ - **Emphasis** — `--fw-weight-tertiary` … `--fw-weight-title` (300 … 700)
40
+ - **Transitions** — `--fw-ease`, `--fw-duration-*`, `--fw-transition-*` (single global easing)
41
+ - **Theme colors** — `--fw-color-black`, `--fw-color-white`, `--fw-color-blue` (light/dark variants; see Pantone showcase)
42
+
33
43
  ---
34
44
 
35
45
  ## Principles
@@ -37,12 +47,12 @@ Size uses a semantic typography system: base values (8, 10, 12… px), semantic
37
47
  1. **Single global easing** — All transitions use `--fw-ease` / `FW_EASE`. Every change in framework elements uses this curve.
38
48
  2. **Widgets respond in-place** — No separate "compact" or "detail" views. The same DOM morphs.
39
49
  3. **Gradual implementation** — One widget at a time. Each widget is noise- and size-aware.
40
- 4. **Semantic tokens** — Components assign semantic sizes (e.g. name = S, role = XS). Actual px values come from the framework.
50
+ 4. **Semantic tokens** — Components assign semantic sizes, emphasis, spacing (`var(--fw-space-X)`), element sizes (`var(--fw-size-X)`). Actual values come from the framework.
41
51
  5. **User control** — The user, not the system, decides how much information to see and at what scale.
42
52
 
43
53
  ---
44
54
 
45
55
  ## Status
46
56
 
47
- - **v0** — Noise + size infrastructure. First widget: team avatar (noise tiers + size token).
57
+ - **v0.1.x** — Noise + size infrastructure. Exported widgets: **TeamAvatar** (`import { TeamAvatar } from "@liquid-noise/core"`). In-app widgets: action button. Showcase: Pantone (theme colors), Elements, Sizes, Typography, Documentation.
48
58
  - **Next** — Tasks, projects, and other widgets.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @liquid-noise/core
2
+
3
+ Liquid Design Framework — noise and size knobs for adaptive UI. Every widget responds to two global controls: **Noise** (what appears) and **Size** (how big).
4
+
5
+ **Live showcase:** [framework.plate.ninja](https://framework.plate.ninja)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @liquid-noise/core
11
+ ```
12
+
13
+ Requires React 18 or 19.
14
+
15
+ ## Quick Setup
16
+
17
+ 1. **Import CSS** (required):
18
+
19
+ ```tsx
20
+ import "@liquid-noise/core/styles/framework.css";
21
+ ```
22
+
23
+ 2. **Wrap with providers and FrameworkSizeSync:**
24
+
25
+ ```tsx
26
+ import {
27
+ NoiseProvider,
28
+ SizeProvider,
29
+ FrameworkSizeSync,
30
+ RotaryKnob,
31
+ useNoise,
32
+ useSize,
33
+ } from "@liquid-noise/core";
34
+
35
+ function App() {
36
+ return (
37
+ <NoiseProvider initialValue={5}>
38
+ <SizeProvider initialValue={5}>
39
+ <FrameworkSizeSync />
40
+ <HeaderWithKnobs />
41
+ <main>{/* Your content */}</main>
42
+ </SizeProvider>
43
+ </NoiseProvider>
44
+ );
45
+ }
46
+ ```
47
+
48
+ 3. **Use components:** `TeamAvatar` (ready-to-use), or low-level: `getFontSize("s", size)`, `getAvatarSize(size)`, `useNoise()`, `useDeferredUnmount()`.
49
+
50
+ ### Team Avatar (widget)
51
+
52
+ ```tsx
53
+ import { TeamAvatar } from "@liquid-noise/core";
54
+
55
+ <TeamAvatar letter="K" name="Karen" role="Designer" />
56
+ ```
57
+
58
+ Props: `letter` (required), `name`, `role`, `imageUrl`, `background`, `className`. Reacts to noise (0–1 placeholder → 2–3 avatar → 4–6 +name → 7+ +role) and size. See `CONCEPT.md` § Team Avatar for full guide.
59
+
60
+ ## Docs
61
+
62
+ Full documentation is in **CONCEPT.md** (shipped with the package): typography tokens, spacing, transitions, theme colors, widget patterns. Live showcase: [framework.plate.ninja](https://framework.plate.ninja) — Pantone, Elements, Sizes, Typography, API reference.
package/dist/index.d.ts CHANGED
@@ -67,6 +67,31 @@ declare function RotaryKnob({ label, defaultValue, value: controlledValue, onCha
67
67
  onChange?: (v: number) => void;
68
68
  }): react_jsx_runtime.JSX.Element;
69
69
 
70
+ type TeamAvatarProps = {
71
+ /** First letter shown in avatar when no image. */
72
+ letter: string;
73
+ /** Display name. Appears at noise ≥ 4. */
74
+ name?: string;
75
+ /** Role or label. Appears at noise ≥ 7. */
76
+ role?: string;
77
+ /** Optional image URL. Overrides letter. */
78
+ imageUrl?: string;
79
+ /** Custom background when no image. Default: purple gradient. */
80
+ background?: string;
81
+ /** Extra CSS class for the root. */
82
+ className?: string;
83
+ };
84
+ /**
85
+ * Team Avatar widget. Reacts to noise and size from framework context.
86
+ *
87
+ * Noise tiers:
88
+ * - 0–1: Hidden (placeholder circle)
89
+ * - 2–3: Avatar only
90
+ * - 4–6: Avatar + name
91
+ * - 7+: Avatar + name + role
92
+ */
93
+ declare function TeamAvatar({ letter, name, role, imageUrl, background, className, }: TeamAvatarProps): react_jsx_runtime.JSX.Element;
94
+
70
95
  /**
71
96
  * Liquid Framework — Global easing and transition values for inline styles.
72
97
  * Must match styles/transitions.css.
@@ -83,6 +108,7 @@ declare const FW_DURATION_NORMAL = "0.25s";
83
108
  declare const FW_DURATION_SLOW = "0.35s";
84
109
  declare const FW_TRANSITION_APPEAR = "opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1), grid-template-rows 0.25s cubic-bezier(0.16, 1, 0.3, 1)";
85
110
  declare const FW_TRANSITION_SIZE = "width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1), font-size 0.25s cubic-bezier(0.16, 1, 0.3, 1)";
111
+ declare const FW_TRANSITION_OPACITY = "opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1)";
86
112
  /** Duration in ms for JS timers (matches FW_DURATION_NORMAL). */
87
113
  declare const FW_DURATION_NORMAL_MS = 250;
88
114
 
@@ -99,4 +125,4 @@ declare function getFontSize(semantic: SemanticSize, sizeKnob: number): number;
99
125
  /** Get avatar diameter (px) at the current knob value. */
100
126
  declare function getAvatarSize(sizeKnob: number): number;
101
127
 
102
- export { BASE_FONT_SIZES, FW_DURATION_FAST, FW_DURATION_NORMAL, FW_DURATION_NORMAL_MS, FW_DURATION_SLOW, FW_EASE, FW_EASE_OUT, FW_TRANSITION_APPEAR, FW_TRANSITION_SIZE, FrameworkSizeSync, NoiseGate, NoiseProvider, RotaryKnob, type SemanticSize, SizeProvider, getAvatarSize, getFontSize, useDeferredUnmount, useNoise, useSize };
128
+ export { BASE_FONT_SIZES, FW_DURATION_FAST, FW_DURATION_NORMAL, FW_DURATION_NORMAL_MS, FW_DURATION_SLOW, FW_EASE, FW_EASE_OUT, FW_TRANSITION_APPEAR, FW_TRANSITION_OPACITY, FW_TRANSITION_SIZE, FrameworkSizeSync, NoiseGate, NoiseProvider, RotaryKnob, type SemanticSize, SizeProvider, TeamAvatar, type TeamAvatarProps, getAvatarSize, getFontSize, useDeferredUnmount, useNoise, useSize };
package/dist/index.js CHANGED
@@ -82,8 +82,8 @@ function useSize() {
82
82
  // src/tokens/typography.ts
83
83
  var BASE_FONT_SIZES = [8, 10, 12, 14, 16, 18, 20, 24, 28];
84
84
  var SIZE_TABLE = {
85
- xs: [10, 12, 14, 16],
86
- s: [12, 14, 16, 18],
85
+ xs: [10, 12, 14, 14],
86
+ s: [12, 14, 16, 16],
87
87
  m: [14, 16, 18, 20],
88
88
  l: [16, 18, 20, 24],
89
89
  xl: [18, 20, 24, 28]
@@ -124,6 +124,7 @@ var FW_DURATION_NORMAL = "0.25s";
124
124
  var FW_DURATION_SLOW = "0.35s";
125
125
  var FW_TRANSITION_APPEAR = `opacity ${FW_DURATION_NORMAL} ${FW_EASE}, max-width ${FW_DURATION_NORMAL} ${FW_EASE}, max-height ${FW_DURATION_NORMAL} ${FW_EASE}, grid-template-rows ${FW_DURATION_NORMAL} ${FW_EASE}`;
126
126
  var FW_TRANSITION_SIZE = `width ${FW_DURATION_NORMAL} ${FW_EASE}, height ${FW_DURATION_NORMAL} ${FW_EASE}, font-size ${FW_DURATION_NORMAL} ${FW_EASE}`;
127
+ var FW_TRANSITION_OPACITY = `opacity ${FW_DURATION_NORMAL} ${FW_EASE}`;
127
128
  var FW_DURATION_NORMAL_MS = 250;
128
129
 
129
130
  // src/hooks/useDeferredUnmount.ts
@@ -343,7 +344,90 @@ function RotaryKnob({
343
344
  }
344
345
  );
345
346
  }
347
+ var NOISE_AVATAR = 2;
348
+ var NOISE_NAME = 4;
349
+ var NOISE_ROLE = 7;
350
+ function TeamAvatar({
351
+ letter,
352
+ name,
353
+ role,
354
+ imageUrl,
355
+ background = "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
356
+ className = ""
357
+ }) {
358
+ const { noise } = useNoise();
359
+ const { size } = useSize();
360
+ const { mounted: showAvatar } = useDeferredUnmount(noise >= NOISE_AVATAR);
361
+ const { mounted: showName, visible: nameVisible } = useDeferredUnmount(
362
+ noise >= NOISE_NAME && Boolean(name)
363
+ );
364
+ const { mounted: showRole, visible: roleVisible } = useDeferredUnmount(
365
+ noise >= NOISE_ROLE && Boolean(role)
366
+ );
367
+ const avatarPx = getAvatarSize(size);
368
+ const letterPx = getFontSize("xs", size);
369
+ const namePx = getFontSize("s", size);
370
+ const rolePx = getFontSize("xs", size);
371
+ if (!showAvatar) {
372
+ return /* @__PURE__ */ jsx(
373
+ "div",
374
+ {
375
+ className: `ln-avatar ln-avatar--hidden ${className}`.trim(),
376
+ style: {
377
+ width: avatarPx,
378
+ height: avatarPx,
379
+ borderRadius: "50%",
380
+ border: "2px dashed var(--border, #e5e5e5)"
381
+ },
382
+ children: "\u2014"
383
+ }
384
+ );
385
+ }
386
+ return /* @__PURE__ */ jsxs("div", { className: `ln-avatar ${className}`.trim(), children: [
387
+ /* @__PURE__ */ jsx(
388
+ "div",
389
+ {
390
+ className: "ln-avatar__circle",
391
+ style: {
392
+ width: avatarPx,
393
+ height: avatarPx,
394
+ fontSize: letterPx,
395
+ background: imageUrl ? void 0 : background,
396
+ backgroundImage: imageUrl ? `url(${imageUrl})` : void 0,
397
+ backgroundSize: imageUrl ? "cover" : void 0
398
+ },
399
+ children: !imageUrl && letter.slice(0, 1).toUpperCase()
400
+ }
401
+ ),
402
+ (showName || showRole) && /* @__PURE__ */ jsxs("div", { className: "ln-avatar__text", children: [
403
+ showName && name && /* @__PURE__ */ jsx(
404
+ "div",
405
+ {
406
+ className: "ln-avatar__name",
407
+ style: {
408
+ fontSize: namePx,
409
+ opacity: nameVisible ? 1 : 0,
410
+ transition: FW_TRANSITION_OPACITY
411
+ },
412
+ children: name
413
+ }
414
+ ),
415
+ showRole && role && /* @__PURE__ */ jsx(
416
+ "div",
417
+ {
418
+ className: "ln-avatar__role",
419
+ style: {
420
+ fontSize: rolePx,
421
+ opacity: roleVisible ? 1 : 0,
422
+ transition: FW_TRANSITION_OPACITY
423
+ },
424
+ children: role
425
+ }
426
+ )
427
+ ] })
428
+ ] });
429
+ }
346
430
 
347
- export { BASE_FONT_SIZES, FW_DURATION_FAST, FW_DURATION_NORMAL, FW_DURATION_NORMAL_MS, FW_DURATION_SLOW, FW_EASE, FW_EASE_OUT, FW_TRANSITION_APPEAR, FW_TRANSITION_SIZE, FrameworkSizeSync, NoiseGate, NoiseProvider, RotaryKnob, SizeProvider, getAvatarSize, getFontSize, useDeferredUnmount, useNoise, useSize };
431
+ export { BASE_FONT_SIZES, FW_DURATION_FAST, FW_DURATION_NORMAL, FW_DURATION_NORMAL_MS, FW_DURATION_SLOW, FW_EASE, FW_EASE_OUT, FW_TRANSITION_APPEAR, FW_TRANSITION_OPACITY, FW_TRANSITION_SIZE, FrameworkSizeSync, NoiseGate, NoiseProvider, RotaryKnob, SizeProvider, TeamAvatar, getAvatarSize, getFontSize, useDeferredUnmount, useNoise, useSize };
348
432
  //# sourceMappingURL=index.js.map
349
433
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/providers/NoiseProvider.tsx","../src/providers/SizeProvider.tsx","../src/tokens/typography.ts","../src/providers/FrameworkSizeSync.tsx","../src/tokens/transitions.ts","../src/hooks/useDeferredUnmount.ts","../src/components/NoiseGate.tsx","../src/components/RotaryKnob.tsx"],"names":["createContext","DEBOUNCE_MS","useState","useRef","useEffect","useCallback","jsx","useContext"],"mappings":";;;;AAeA,IAAM,YAAA,GAAe,cAAwC,IAAI,CAAA;AAEjE,IAAM,WAAA,GAAc,GAAA;AAEb,SAAS,aAAA,CAAc;AAAA,EAC5B,QAAA;AAAA,EACA,YAAA,GAAe,CAAA;AAAA,EACf;AACF,CAAA,EAIG;AACD,EAAA,MAAM,C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IAAA,CAAK,EAAA,GAAM,GAAG,CAAA,IAAK,SAAA,GAAY,CAAA,GAAI,CAAA,CAAA;AAAA,kBAEjE,EAAA,EACE,MAAA,GACA,IAAA,CAAK,GAAA,CAAA,CAAM,QAAA,GAAW,EAAA,IAAM,IAAA,CAAK,EAAA,GAAM,GAAG,CAAA,IAAK,SAAA,GAAY,CAAA,GAAI,CAAA,CAAA;AAAA,kBAEjE,MAAA,EAAO,MAAA;AAAA,kBACP,WAAA,EAAa,GAAA;AAAA,kBACb,aAAA,EAAc;AAAA;AAAA,eAChB;AAAA,8BAGAA,GAAAA,CAAC,QAAA,EAAA,EAAO,EAAA,EAAI,MAAA,EAAQ,IAAI,MAAA,EAAQ,CAAA,EAAG,GAAA,EAAK,IAAA,EAAK,MAAA,EAAO;AAAA;AAAA;AAAA,SACtD;AAAA,wBAEAA,GAAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAO;AAAA,cACL,QAAA,EAAU,SAAA;AAAA,cACV,UAAA,EAAY,GAAA;AAAA,cACZ,KAAA,EAAO,MAAA;AAAA,cACP,aAAA,EAAe,WAAA;AAAA,cACf,aAAA,EAAe,QAAA;AAAA,cACf,UAAA,EAAY;AAAA,aACd;AAAA,YAEC,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"index.js","sourcesContent":["import {\n createContext,\n useContext,\n useState,\n useEffect,\n useRef,\n useCallback,\n type ReactNode,\n} from \"react\";\n\nexport type NoiseContextValue = {\n noise: number;\n setNoise: (v: number) => void;\n};\n\nconst NoiseContext = createContext<NoiseContextValue | null>(null);\n\nconst DEBOUNCE_MS = 500;\n\nexport function NoiseProvider({\n children,\n initialValue = 0,\n onSave,\n}: {\n children: ReactNode;\n initialValue?: number;\n onSave?: (value: number) => void;\n}) {\n const [noise, setNoiseRaw] = useState(initialValue);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Sync when initialValue changes (e.g. after loading from DB)\n useEffect(() => {\n setNoiseRaw(initialValue);\n }, [initialValue]);\n\n // Debounced save via callback\n const setNoise = useCallback(\n (v: number) => {\n setNoiseRaw(v);\n\n if (!onSave) return;\n\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => {\n onSave(v);\n timerRef.current = null;\n }, DEBOUNCE_MS);\n },\n [onSave],\n );\n\n useEffect(() => {\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n };\n }, []);\n\n return (\n <NoiseContext.Provider value={{ noise, setNoise }}>\n {children}\n </NoiseContext.Provider>\n );\n}\n\nexport function useNoise(): NoiseContextValue {\n const ctx = useContext(NoiseContext);\n if (!ctx) {\n throw new Error(\"useNoise must be used within NoiseProvider\");\n }\n return ctx;\n}\n","import {\n createContext,\n useContext,\n useState,\n useEffect,\n useRef,\n useCallback,\n type ReactNode,\n} from \"react\";\n\nexport type SizeContextValue = {\n size: number;\n setSize: (v: number) => void;\n};\n\nconst SizeContext = createContext<SizeContextValue | null>(null);\n\nconst DEBOUNCE_MS = 500;\n\nexport function SizeProvider({\n children,\n initialValue = 5,\n onSave,\n}: {\n children: ReactNode;\n initialValue?: number;\n onSave?: (value: number) => void;\n}) {\n const [size, setSizeRaw] = useState(initialValue);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Sync when initialValue changes (e.g. after loading from DB)\n useEffect(() => {\n setSizeRaw(initialValue);\n }, [initialValue]);\n\n // Debounced save via callback\n const setSize = useCallback(\n (v: number) => {\n setSizeRaw(v);\n\n if (!onSave) return;\n\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => {\n onSave(v);\n timerRef.current = null;\n }, DEBOUNCE_MS);\n },\n [onSave],\n );\n\n useEffect(() => {\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n };\n }, []);\n\n return (\n <SizeContext.Provider value={{ size, setSize }}>\n {children}\n </SizeContext.Provider>\n );\n}\n\nexport function useSize(): SizeContextValue {\n const ctx = useContext(SizeContext);\n if (!ctx) {\n throw new Error(\"useSize must be used within SizeProvider\");\n }\n return ctx;\n}\n","/**\n * Liquid Framework typography scale.\n * Base values (px) and semantic sizes with mapping rules per size-knob range.\n */\n\n/** Base font sizes in px — fixed scale. */\nexport const BASE_FONT_SIZES = [8, 10, 12, 14, 16, 18, 20, 24, 28] as const;\n\n/** Semantic size tokens for component usage. */\nexport type SemanticSize = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n\n/**\n * Size-knob ranges: 0-2, 3-4, 5-7, 8-10.\n * Each semantic size maps to a base value per range.\n * XS: 1-2 → 10, 3-4 → 12, 5-7 → 14, 8-10 → 16 (per user spec)\n */\nconst SIZE_TABLE: Record<SemanticSize, [number, number, number, number]> = {\n xs: [10, 12, 14, 16],\n s: [12, 14, 16, 18],\n m: [14, 16, 18, 20],\n l: [16, 18, 20, 24],\n xl: [18, 20, 24, 28],\n};\n\n/** Avatar size scale (px) per size-knob range. */\nconst AVATAR_SIZE_TABLE: [number, number, number, number] = [20, 24, 28, 36];\n\nfunction sizeToTier(size: number): 0 | 1 | 2 | 3 {\n if (size <= 2) return 0;\n if (size <= 4) return 1;\n if (size <= 7) return 2;\n return 3;\n}\n\n/** Get font size (px) for a semantic size at the current knob value. */\nexport function getFontSize(semantic: SemanticSize, sizeKnob: number): number {\n return SIZE_TABLE[semantic][sizeToTier(sizeKnob)];\n}\n\n/** Get avatar diameter (px) at the current knob value. */\nexport function getAvatarSize(sizeKnob: number): number {\n return AVATAR_SIZE_TABLE[sizeToTier(sizeKnob)];\n}\n","import { useEffect } from \"react\";\nimport { useSize } from \"./SizeProvider\";\nimport { getFontSize, getAvatarSize } from \"../tokens/typography\";\nimport type { SemanticSize } from \"../tokens/typography\";\n\n/** Syncs size-knob value to CSS custom properties on :root. */\nexport function FrameworkSizeSync() {\n const { size } = useSize();\n\n useEffect(() => {\n const root = document.documentElement;\n const semanticSizes: SemanticSize[] = [\"xs\", \"s\", \"m\", \"l\", \"xl\"];\n semanticSizes.forEach((s) => {\n root.style.setProperty(`--fw-font-${s}`, `${getFontSize(s, size)}px`);\n });\n root.style.setProperty(`--fw-avatar-size`, `${getAvatarSize(size)}px`);\n }, [size]);\n\n return null;\n}\n","/**\n * Liquid Framework — Global easing and transition values for inline styles.\n * Must match styles/transitions.css.\n *\n * FW_EASE is the single easing used for ALL framework transitions.\n * Any change in Liquid elements must use this.\n */\n\n/** Global easing — used by every transition in the framework */\nexport const FW_EASE = \"cubic-bezier(0.16, 1, 0.3, 1)\";\n\n/** @deprecated Use FW_EASE */\nexport const FW_EASE_OUT = FW_EASE;\n\nexport const FW_DURATION_FAST = \"0.15s\";\nexport const FW_DURATION_NORMAL = \"0.25s\";\nexport const FW_DURATION_SLOW = \"0.35s\";\n\nexport const FW_TRANSITION_APPEAR = `opacity ${FW_DURATION_NORMAL} ${FW_EASE}, max-width ${FW_DURATION_NORMAL} ${FW_EASE}, max-height ${FW_DURATION_NORMAL} ${FW_EASE}, grid-template-rows ${FW_DURATION_NORMAL} ${FW_EASE}`;\nexport const FW_TRANSITION_SIZE = `width ${FW_DURATION_NORMAL} ${FW_EASE}, height ${FW_DURATION_NORMAL} ${FW_EASE}, font-size ${FW_DURATION_NORMAL} ${FW_EASE}`;\n\n/** Duration in ms for JS timers (matches FW_DURATION_NORMAL). */\nexport const FW_DURATION_NORMAL_MS = 250;\n","import { useState, useEffect, useRef } from \"react\";\nimport { FW_DURATION_NORMAL_MS } from \"../tokens/transitions\";\n\n/**\n * Liquid Framework — deferred unmount hook.\n *\n * Keeps a component mounted for the duration of the exit transition,\n * then unmounts it so it takes zero layout space.\n *\n * Usage:\n * const { mounted, visible } = useDeferredUnmount(showName);\n * // mounted = true while element should exist in DOM (including exit animation)\n * // visible = true when element should be fully shown (drives CSS values)\n *\n * {mounted && (\n * <div style={{ opacity: visible ? 1 : 0, transition: FW_TRANSITION_APPEAR }}>\n * ...\n * </div>\n * )}\n *\n * Flow:\n * show=true → mounted=true, visible=true (element mounts, CSS transitions in)\n * show=false → mounted=true, visible=false (CSS transitions out)\n * → after duration → mounted=false (element unmounts, zero layout)\n */\nexport function useDeferredUnmount(\n show: boolean,\n durationMs: number = FW_DURATION_NORMAL_MS,\n): { mounted: boolean; visible: boolean } {\n const [mounted, setMounted] = useState(show);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (show) {\n // Cancel any pending unmount\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n setMounted(true);\n } else {\n // Delay unmount so exit transition can play\n timerRef.current = setTimeout(() => {\n setMounted(false);\n timerRef.current = null;\n }, durationMs);\n }\n\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n }, [show, durationMs]);\n\n return { mounted, visible: show };\n}\n","import type { ReactNode } from \"react\";\nimport { FW_TRANSITION_APPEAR } from \"../tokens/transitions\";\nimport { useDeferredUnmount } from \"../hooks/useDeferredUnmount\";\nimport { useNoise } from \"../providers/NoiseProvider\";\n\ntype NoiseGateProps = {\n min: number;\n children: ReactNode;\n};\n\n/** Renders children when noise >= min. Animates in/out, then fully unmounts. */\nexport function NoiseGate({ min, children }: NoiseGateProps) {\n const { noise } = useNoise();\n const { mounted, visible } = useDeferredUnmount(noise >= min);\n\n if (!mounted) return null;\n\n return (\n <div\n style={{\n opacity: visible ? 1 : 0,\n transition: FW_TRANSITION_APPEAR,\n pointerEvents: visible ? \"auto\" : \"none\",\n }}\n >\n {children}\n </div>\n );\n}\n","import { useCallback, useRef, useState, useEffect } from \"react\";\n\nconst MIN_ANGLE = -135;\nconst MAX_ANGLE = 135;\nconst STEPS = 10;\nconst KNOB_SIZE = 28;\n\nfunction valueToAngle(value: number): number {\n return MIN_ANGLE + (value / STEPS) * (MAX_ANGLE - MIN_ANGLE);\n}\n\nfunction angleToValue(angle: number): number {\n const raw = ((angle - MIN_ANGLE) / (MAX_ANGLE - MIN_ANGLE)) * STEPS;\n return Math.round(Math.max(0, Math.min(STEPS, raw)));\n}\n\nfunction getAngleFromEvent(\n e: MouseEvent | TouchEvent,\n rect: DOMRect,\n): number {\n const clientX = \"touches\" in e ? e.touches[0].clientX : e.clientX;\n const clientY = \"touches\" in e ? e.touches[0].clientY : e.clientY;\n const cx = rect.left + rect.width / 2;\n const cy = rect.top + rect.height / 2;\n const rad = Math.atan2(clientX - cx, cy - clientY);\n const deg = rad * (180 / Math.PI);\n return Math.max(MIN_ANGLE, Math.min(MAX_ANGLE, deg));\n}\n\nexport function RotaryKnob({\n label,\n defaultValue = 0,\n value: controlledValue,\n onChange,\n}: {\n label: string;\n defaultValue?: number;\n value?: number;\n onChange?: (v: number) => void;\n}) {\n const [internalValue, setInternalValue] = useState(defaultValue);\n const value =\n controlledValue !== undefined ? controlledValue : internalValue;\n const knobRef = useRef<SVGSVGElement>(null);\n const dragging = useRef(false);\n\n const updateRef = useRef((v: number) => {\n if (onChange) onChange(v);\n else setInternalValue(v);\n });\n updateRef.current = (v: number) => {\n if (onChange) onChange(v);\n else setInternalValue(v);\n };\n\n const handleStart = useCallback((e: React.MouseEvent | React.TouchEvent) => {\n e.preventDefault();\n dragging.current = true;\n const rect = knobRef.current!.getBoundingClientRect();\n const native = e.nativeEvent as MouseEvent | TouchEvent;\n const angle = getAngleFromEvent(native, rect);\n updateRef.current(angleToValue(angle));\n }, []);\n\n useEffect(() => {\n const onMove = (e: MouseEvent | TouchEvent) => {\n if (!dragging.current || !knobRef.current) return;\n const rect = knobRef.current.getBoundingClientRect();\n const angle = getAngleFromEvent(e, rect);\n updateRef.current(angleToValue(angle));\n };\n\n const onUp = () => {\n dragging.current = false;\n };\n\n window.addEventListener(\"mousemove\", onMove);\n window.addEventListener(\"mouseup\", onUp);\n window.addEventListener(\"touchmove\", onMove);\n window.addEventListener(\"touchend\", onUp);\n\n return () => {\n window.removeEventListener(\"mousemove\", onMove);\n window.removeEventListener(\"mouseup\", onUp);\n window.removeEventListener(\"touchmove\", onMove);\n window.removeEventListener(\"touchend\", onUp);\n };\n }, []);\n\n const rotation = valueToAngle(value);\n\n // Generate tick marks\n const ticks = Array.from({ length: STEPS + 1 }, (_, i) => {\n const angle = valueToAngle(i);\n const rad = ((angle - 90) * Math.PI) / 180;\n const outer = KNOB_SIZE / 2 + 5;\n const inner = KNOB_SIZE / 2 + 2;\n return {\n x1: Math.cos(rad) * inner,\n y1: Math.sin(rad) * inner,\n x2: Math.cos(rad) * outer,\n y2: Math.sin(rad) * outer,\n major: i === 0 || i === 5 || i === 10,\n };\n });\n\n const svgSize = KNOB_SIZE + 14;\n const center = svgSize / 2;\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 1,\n userSelect: \"none\",\n WebkitUserSelect: \"none\",\n }}\n >\n <svg\n ref={knobRef}\n width={svgSize}\n height={svgSize}\n viewBox={`0 0 ${svgSize} ${svgSize}`}\n style={{ cursor: \"grab\", touchAction: \"none\" }}\n onMouseDown={handleStart}\n onTouchStart={handleStart}\n >\n {/* Tick marks */}\n {ticks.map((t, i) => (\n <line\n key={i}\n x1={center + t.x1}\n y1={center + t.y1}\n x2={center + t.x2}\n y2={center + t.y2}\n stroke={i <= value ? \"#111\" : \"#ccc\"}\n strokeWidth={t.major ? 1.5 : 0.75}\n strokeLinecap=\"round\"\n />\n ))}\n\n {/* Knob body */}\n <circle\n cx={center}\n cy={center}\n r={KNOB_SIZE / 2}\n fill=\"#fff\"\n stroke=\"#ddd\"\n strokeWidth={1}\n />\n\n {/* Inner subtle ring */}\n <circle\n cx={center}\n cy={center}\n r={KNOB_SIZE / 2 - 3}\n fill=\"none\"\n stroke=\"#eee\"\n strokeWidth={0.5}\n />\n\n {/* Indicator line */}\n <line\n x1={center}\n y1={center}\n x2={\n center +\n Math.cos(((rotation - 90) * Math.PI) / 180) * (KNOB_SIZE / 2 - 4)\n }\n y2={\n center +\n Math.sin(((rotation - 90) * Math.PI) / 180) * (KNOB_SIZE / 2 - 4)\n }\n stroke=\"#111\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n />\n\n {/* Center dot */}\n <circle cx={center} cy={center} r={1.5} fill=\"#111\" />\n </svg>\n\n <span\n style={{\n fontSize: \"0.55rem\",\n fontWeight: 500,\n color: \"#999\",\n textTransform: \"uppercase\",\n letterSpacing: \"0.06em\",\n lineHeight: 1,\n }}\n >\n {label}\n </span>\n </div>\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/providers/NoiseProvider.tsx","../src/providers/SizeProvider.tsx","../src/tokens/typography.ts","../src/providers/FrameworkSizeSync.tsx","../src/tokens/transitions.ts","../src/hooks/useDeferredUnmount.ts","../src/components/NoiseGate.tsx","../src/components/RotaryKnob.tsx","../src/components/TeamAvatar.tsx"],"names":["createContext","DEBOUNCE_MS","useState","useRef","useEffect","useCallback","jsx","useContext","jsxs"],"mappings":";;;;AAeA,IAAM,YAAA,GAAe,cAAwC,IAAI,CAAA;AAEjE,IAAM,WAAA,GAAc,GAAA;AAEb,SAAS,aAAA,CAAc;AAAA,EAC5B,QAAA;AAAA,EACA,YAAA,GAAe,CAAA;AAAA,EACf;AACF,CAAA,EAIG;AACD,EAAA,MAAM,CAAC,KAAA,EAAO,WAAW,CAAA,GAAI,SAAS,YAAY,CAAA;AAClD,EAAA,MAAM,QAAA,GAAW,OAA6C,IAAI,CAAA;AAGlE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,WAAA,CAAY,YAAY,CAAA;AAAA,EAC1B,CAAA,EAAG,CAAC,YAAY,CAAC,CAAA;AAGjB,EAAA,MAAM,QAAA,GAAW,WAAA;AAAA,IACf,CAAC,CAAA,KAAc;AACb,MAAA,WAAA,CAAY,CAAC,CAAA;AAEb,MAAA,IAAI,CAAC,MAAA,EAAQ;AAEb,MAAA,IAAI,QAAA,CAAS,OAAA,EAAS,YAAA,CAAa,QAAA,CAAS,OAAO,CAAA;AACnD,MAAA,QAAA,CAAS,OAAA,GAAU,WAAW,MAAM;AAClC,QAAA,MAAA,CAAO,CAAC,CA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,MAAA,QAAA,IAAY,wBACXF,GAAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAU,iBAAA;AAAA,UACV,KAAA,EAAO;AAAA,YACL,QAAA,EAAU,MAAA;AAAA,YACV,OAAA,EAAS,cAAc,CAAA,GAAI,CAAA;AAAA,YAC3B,UAAA,EAAY;AAAA,WACd;AAAA,UAEC,QAAA,EAAA;AAAA;AAAA,OACH;AAAA,MAED,QAAA,IAAY,wBACXA,GAAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAU,iBAAA;AAAA,UACV,KAAA,EAAO;AAAA,YACL,QAAA,EAAU,MAAA;AAAA,YACV,OAAA,EAAS,cAAc,CAAA,GAAI,CAAA;AAAA,YAC3B,UAAA,EAAY;AAAA,WACd;AAAA,UAEC,QAAA,EAAA;AAAA;AAAA;AACH,KAAA,EAEJ;AAAA,GAAA,EAEJ,CAAA;AAEJ","file":"index.js","sourcesContent":["import {\n createContext,\n useContext,\n useState,\n useEffect,\n useRef,\n useCallback,\n type ReactNode,\n} from \"react\";\n\nexport type NoiseContextValue = {\n noise: number;\n setNoise: (v: number) => void;\n};\n\nconst NoiseContext = createContext<NoiseContextValue | null>(null);\n\nconst DEBOUNCE_MS = 500;\n\nexport function NoiseProvider({\n children,\n initialValue = 0,\n onSave,\n}: {\n children: ReactNode;\n initialValue?: number;\n onSave?: (value: number) => void;\n}) {\n const [noise, setNoiseRaw] = useState(initialValue);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Sync when initialValue changes (e.g. after loading from DB)\n useEffect(() => {\n setNoiseRaw(initialValue);\n }, [initialValue]);\n\n // Debounced save via callback\n const setNoise = useCallback(\n (v: number) => {\n setNoiseRaw(v);\n\n if (!onSave) return;\n\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => {\n onSave(v);\n timerRef.current = null;\n }, DEBOUNCE_MS);\n },\n [onSave],\n );\n\n useEffect(() => {\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n };\n }, []);\n\n return (\n <NoiseContext.Provider value={{ noise, setNoise }}>\n {children}\n </NoiseContext.Provider>\n );\n}\n\nexport function useNoise(): NoiseContextValue {\n const ctx = useContext(NoiseContext);\n if (!ctx) {\n throw new Error(\"useNoise must be used within NoiseProvider\");\n }\n return ctx;\n}\n","import {\n createContext,\n useContext,\n useState,\n useEffect,\n useRef,\n useCallback,\n type ReactNode,\n} from \"react\";\n\nexport type SizeContextValue = {\n size: number;\n setSize: (v: number) => void;\n};\n\nconst SizeContext = createContext<SizeContextValue | null>(null);\n\nconst DEBOUNCE_MS = 500;\n\nexport function SizeProvider({\n children,\n initialValue = 5,\n onSave,\n}: {\n children: ReactNode;\n initialValue?: number;\n onSave?: (value: number) => void;\n}) {\n const [size, setSizeRaw] = useState(initialValue);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Sync when initialValue changes (e.g. after loading from DB)\n useEffect(() => {\n setSizeRaw(initialValue);\n }, [initialValue]);\n\n // Debounced save via callback\n const setSize = useCallback(\n (v: number) => {\n setSizeRaw(v);\n\n if (!onSave) return;\n\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => {\n onSave(v);\n timerRef.current = null;\n }, DEBOUNCE_MS);\n },\n [onSave],\n );\n\n useEffect(() => {\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n };\n }, []);\n\n return (\n <SizeContext.Provider value={{ size, setSize }}>\n {children}\n </SizeContext.Provider>\n );\n}\n\nexport function useSize(): SizeContextValue {\n const ctx = useContext(SizeContext);\n if (!ctx) {\n throw new Error(\"useSize must be used within SizeProvider\");\n }\n return ctx;\n}\n","/**\n * Liquid Framework typography scale.\n * Base values (px) and semantic sizes with mapping rules per size-knob range.\n */\n\n/** Base font sizes in px — fixed scale. */\nexport const BASE_FONT_SIZES = [8, 10, 12, 14, 16, 18, 20, 24, 28] as const;\n\n/** Semantic size tokens for component usage. */\nexport type SemanticSize = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n\n/**\n * Size-knob ranges: 0-2, 3-4, 5-7, 8-10.\n * Each semantic size maps to a base value per range.\n * XS: 1-2 → 10, 3-4 → 12, 5-7 → 14, 8-10 → 14 (stays 14 in tier 3)\n */\nconst SIZE_TABLE: Record<SemanticSize, [number, number, number, number]> = {\n xs: [10, 12, 14, 14],\n s: [12, 14, 16, 16],\n m: [14, 16, 18, 20],\n l: [16, 18, 20, 24],\n xl: [18, 20, 24, 28],\n};\n\n/** Avatar size scale (px) per size-knob range. */\nconst AVATAR_SIZE_TABLE: [number, number, number, number] = [20, 24, 28, 36];\n\nfunction sizeToTier(size: number): 0 | 1 | 2 | 3 {\n if (size <= 2) return 0;\n if (size <= 4) return 1;\n if (size <= 7) return 2;\n return 3;\n}\n\n/** Get font size (px) for a semantic size at the current knob value. */\nexport function getFontSize(semantic: SemanticSize, sizeKnob: number): number {\n return SIZE_TABLE[semantic][sizeToTier(sizeKnob)];\n}\n\n/** Get avatar diameter (px) at the current knob value. */\nexport function getAvatarSize(sizeKnob: number): number {\n return AVATAR_SIZE_TABLE[sizeToTier(sizeKnob)];\n}\n","import { useEffect } from \"react\";\nimport { useSize } from \"./SizeProvider\";\nimport { getFontSize, getAvatarSize } from \"../tokens/typography\";\nimport type { SemanticSize } from \"../tokens/typography\";\n\n/** Syncs size-knob value to CSS custom properties on :root. */\nexport function FrameworkSizeSync() {\n const { size } = useSize();\n\n useEffect(() => {\n const root = document.documentElement;\n const semanticSizes: SemanticSize[] = [\"xs\", \"s\", \"m\", \"l\", \"xl\"];\n semanticSizes.forEach((s) => {\n root.style.setProperty(`--fw-font-${s}`, `${getFontSize(s, size)}px`);\n });\n root.style.setProperty(`--fw-avatar-size`, `${getAvatarSize(size)}px`);\n }, [size]);\n\n return null;\n}\n","/**\n * Liquid Framework — Global easing and transition values for inline styles.\n * Must match styles/transitions.css.\n *\n * FW_EASE is the single easing used for ALL framework transitions.\n * Any change in Liquid elements must use this.\n */\n\n/** Global easing — used by every transition in the framework */\nexport const FW_EASE = \"cubic-bezier(0.16, 1, 0.3, 1)\";\n\n/** @deprecated Use FW_EASE */\nexport const FW_EASE_OUT = FW_EASE;\n\nexport const FW_DURATION_FAST = \"0.15s\";\nexport const FW_DURATION_NORMAL = \"0.25s\";\nexport const FW_DURATION_SLOW = \"0.35s\";\n\nexport const FW_TRANSITION_APPEAR = `opacity ${FW_DURATION_NORMAL} ${FW_EASE}, max-width ${FW_DURATION_NORMAL} ${FW_EASE}, max-height ${FW_DURATION_NORMAL} ${FW_EASE}, grid-template-rows ${FW_DURATION_NORMAL} ${FW_EASE}`;\nexport const FW_TRANSITION_SIZE = `width ${FW_DURATION_NORMAL} ${FW_EASE}, height ${FW_DURATION_NORMAL} ${FW_EASE}, font-size ${FW_DURATION_NORMAL} ${FW_EASE}`;\nexport const FW_TRANSITION_OPACITY = `opacity ${FW_DURATION_NORMAL} ${FW_EASE}`;\n\n/** Duration in ms for JS timers (matches FW_DURATION_NORMAL). */\nexport const FW_DURATION_NORMAL_MS = 250;\n","import { useState, useEffect, useRef } from \"react\";\nimport { FW_DURATION_NORMAL_MS } from \"../tokens/transitions\";\n\n/**\n * Liquid Framework — deferred unmount hook.\n *\n * Keeps a component mounted for the duration of the exit transition,\n * then unmounts it so it takes zero layout space.\n *\n * Usage:\n * const { mounted, visible } = useDeferredUnmount(showName);\n * // mounted = true while element should exist in DOM (including exit animation)\n * // visible = true when element should be fully shown (drives CSS values)\n *\n * {mounted && (\n * <div style={{ opacity: visible ? 1 : 0, transition: FW_TRANSITION_APPEAR }}>\n * ...\n * </div>\n * )}\n *\n * Flow:\n * show=true → mounted=true, visible=true (element mounts, CSS transitions in)\n * show=false → mounted=true, visible=false (CSS transitions out)\n * → after duration → mounted=false (element unmounts, zero layout)\n */\nexport function useDeferredUnmount(\n show: boolean,\n durationMs: number = FW_DURATION_NORMAL_MS,\n): { mounted: boolean; visible: boolean } {\n const [mounted, setMounted] = useState(show);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (show) {\n // Cancel any pending unmount\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n setMounted(true);\n } else {\n // Delay unmount so exit transition can play\n timerRef.current = setTimeout(() => {\n setMounted(false);\n timerRef.current = null;\n }, durationMs);\n }\n\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n }, [show, durationMs]);\n\n return { mounted, visible: show };\n}\n","import type { ReactNode } from \"react\";\nimport { FW_TRANSITION_APPEAR } from \"../tokens/transitions\";\nimport { useDeferredUnmount } from \"../hooks/useDeferredUnmount\";\nimport { useNoise } from \"../providers/NoiseProvider\";\n\ntype NoiseGateProps = {\n min: number;\n children: ReactNode;\n};\n\n/** Renders children when noise >= min. Animates in/out, then fully unmounts. */\nexport function NoiseGate({ min, children }: NoiseGateProps) {\n const { noise } = useNoise();\n const { mounted, visible } = useDeferredUnmount(noise >= min);\n\n if (!mounted) return null;\n\n return (\n <div\n style={{\n opacity: visible ? 1 : 0,\n transition: FW_TRANSITION_APPEAR,\n pointerEvents: visible ? \"auto\" : \"none\",\n }}\n >\n {children}\n </div>\n );\n}\n","import { useCallback, useRef, useState, useEffect } from \"react\";\n\nconst MIN_ANGLE = -135;\nconst MAX_ANGLE = 135;\nconst STEPS = 10;\nconst KNOB_SIZE = 28;\n\nfunction valueToAngle(value: number): number {\n return MIN_ANGLE + (value / STEPS) * (MAX_ANGLE - MIN_ANGLE);\n}\n\nfunction angleToValue(angle: number): number {\n const raw = ((angle - MIN_ANGLE) / (MAX_ANGLE - MIN_ANGLE)) * STEPS;\n return Math.round(Math.max(0, Math.min(STEPS, raw)));\n}\n\nfunction getAngleFromEvent(\n e: MouseEvent | TouchEvent,\n rect: DOMRect,\n): number {\n const clientX = \"touches\" in e ? e.touches[0].clientX : e.clientX;\n const clientY = \"touches\" in e ? e.touches[0].clientY : e.clientY;\n const cx = rect.left + rect.width / 2;\n const cy = rect.top + rect.height / 2;\n const rad = Math.atan2(clientX - cx, cy - clientY);\n const deg = rad * (180 / Math.PI);\n return Math.max(MIN_ANGLE, Math.min(MAX_ANGLE, deg));\n}\n\nexport function RotaryKnob({\n label,\n defaultValue = 0,\n value: controlledValue,\n onChange,\n}: {\n label: string;\n defaultValue?: number;\n value?: number;\n onChange?: (v: number) => void;\n}) {\n const [internalValue, setInternalValue] = useState(defaultValue);\n const value =\n controlledValue !== undefined ? controlledValue : internalValue;\n const knobRef = useRef<SVGSVGElement>(null);\n const dragging = useRef(false);\n\n const updateRef = useRef((v: number) => {\n if (onChange) onChange(v);\n else setInternalValue(v);\n });\n updateRef.current = (v: number) => {\n if (onChange) onChange(v);\n else setInternalValue(v);\n };\n\n const handleStart = useCallback((e: React.MouseEvent | React.TouchEvent) => {\n e.preventDefault();\n dragging.current = true;\n const rect = knobRef.current!.getBoundingClientRect();\n const native = e.nativeEvent as MouseEvent | TouchEvent;\n const angle = getAngleFromEvent(native, rect);\n updateRef.current(angleToValue(angle));\n }, []);\n\n useEffect(() => {\n const onMove = (e: MouseEvent | TouchEvent) => {\n if (!dragging.current || !knobRef.current) return;\n const rect = knobRef.current.getBoundingClientRect();\n const angle = getAngleFromEvent(e, rect);\n updateRef.current(angleToValue(angle));\n };\n\n const onUp = () => {\n dragging.current = false;\n };\n\n window.addEventListener(\"mousemove\", onMove);\n window.addEventListener(\"mouseup\", onUp);\n window.addEventListener(\"touchmove\", onMove);\n window.addEventListener(\"touchend\", onUp);\n\n return () => {\n window.removeEventListener(\"mousemove\", onMove);\n window.removeEventListener(\"mouseup\", onUp);\n window.removeEventListener(\"touchmove\", onMove);\n window.removeEventListener(\"touchend\", onUp);\n };\n }, []);\n\n const rotation = valueToAngle(value);\n\n // Generate tick marks\n const ticks = Array.from({ length: STEPS + 1 }, (_, i) => {\n const angle = valueToAngle(i);\n const rad = ((angle - 90) * Math.PI) / 180;\n const outer = KNOB_SIZE / 2 + 5;\n const inner = KNOB_SIZE / 2 + 2;\n return {\n x1: Math.cos(rad) * inner,\n y1: Math.sin(rad) * inner,\n x2: Math.cos(rad) * outer,\n y2: Math.sin(rad) * outer,\n major: i === 0 || i === 5 || i === 10,\n };\n });\n\n const svgSize = KNOB_SIZE + 14;\n const center = svgSize / 2;\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 1,\n userSelect: \"none\",\n WebkitUserSelect: \"none\",\n }}\n >\n <svg\n ref={knobRef}\n width={svgSize}\n height={svgSize}\n viewBox={`0 0 ${svgSize} ${svgSize}`}\n style={{ cursor: \"grab\", touchAction: \"none\" }}\n onMouseDown={handleStart}\n onTouchStart={handleStart}\n >\n {/* Tick marks */}\n {ticks.map((t, i) => (\n <line\n key={i}\n x1={center + t.x1}\n y1={center + t.y1}\n x2={center + t.x2}\n y2={center + t.y2}\n stroke={i <= value ? \"#111\" : \"#ccc\"}\n strokeWidth={t.major ? 1.5 : 0.75}\n strokeLinecap=\"round\"\n />\n ))}\n\n {/* Knob body */}\n <circle\n cx={center}\n cy={center}\n r={KNOB_SIZE / 2}\n fill=\"#fff\"\n stroke=\"#ddd\"\n strokeWidth={1}\n />\n\n {/* Inner subtle ring */}\n <circle\n cx={center}\n cy={center}\n r={KNOB_SIZE / 2 - 3}\n fill=\"none\"\n stroke=\"#eee\"\n strokeWidth={0.5}\n />\n\n {/* Indicator line */}\n <line\n x1={center}\n y1={center}\n x2={\n center +\n Math.cos(((rotation - 90) * Math.PI) / 180) * (KNOB_SIZE / 2 - 4)\n }\n y2={\n center +\n Math.sin(((rotation - 90) * Math.PI) / 180) * (KNOB_SIZE / 2 - 4)\n }\n stroke=\"#111\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n />\n\n {/* Center dot */}\n <circle cx={center} cy={center} r={1.5} fill=\"#111\" />\n </svg>\n\n <span\n style={{\n fontSize: \"0.55rem\",\n fontWeight: 500,\n color: \"#999\",\n textTransform: \"uppercase\",\n letterSpacing: \"0.06em\",\n lineHeight: 1,\n }}\n >\n {label}\n </span>\n </div>\n );\n}\n","import { useNoise } from \"../providers/NoiseProvider\";\nimport { useSize } from \"../providers/SizeProvider\";\nimport { useDeferredUnmount } from \"../hooks/useDeferredUnmount\";\nimport { getFontSize, getAvatarSize } from \"../tokens/typography\";\nimport { FW_TRANSITION_OPACITY } from \"../tokens/transitions\";\n\nexport type TeamAvatarProps = {\n /** First letter shown in avatar when no image. */\n letter: string;\n /** Display name. Appears at noise ≥ 4. */\n name?: string;\n /** Role or label. Appears at noise ≥ 7. */\n role?: string;\n /** Optional image URL. Overrides letter. */\n imageUrl?: string;\n /** Custom background when no image. Default: purple gradient. */\n background?: string;\n /** Extra CSS class for the root. */\n className?: string;\n};\n\nconst NOISE_AVATAR = 2;\nconst NOISE_NAME = 4;\nconst NOISE_ROLE = 7;\n\n/**\n * Team Avatar widget. Reacts to noise and size from framework context.\n *\n * Noise tiers:\n * - 0–1: Hidden (placeholder circle)\n * - 2–3: Avatar only\n * - 4–6: Avatar + name\n * - 7+: Avatar + name + role\n */\nexport function TeamAvatar({\n letter,\n name,\n role,\n imageUrl,\n background = \"linear-gradient(135deg, #667eea 0%, #764ba2 100%)\",\n className = \"\",\n}: TeamAvatarProps) {\n const { noise } = useNoise();\n const { size } = useSize();\n const { mounted: showAvatar } = useDeferredUnmount(noise >= NOISE_AVATAR);\n const { mounted: showName, visible: nameVisible } = useDeferredUnmount(\n noise >= NOISE_NAME && Boolean(name)\n );\n const { mounted: showRole, visible: roleVisible } = useDeferredUnmount(\n noise >= NOISE_ROLE && Boolean(role)\n );\n\n const avatarPx = getAvatarSize(size);\n const letterPx = getFontSize(\"xs\", size);\n const namePx = getFontSize(\"s\", size);\n const rolePx = getFontSize(\"xs\", size);\n\n if (!showAvatar) {\n return (\n <div\n className={`ln-avatar ln-avatar--hidden ${className}`.trim()}\n style={{\n width: avatarPx,\n height: avatarPx,\n borderRadius: \"50%\",\n border: \"2px dashed var(--border, #e5e5e5)\",\n }}\n >\n —\n </div>\n );\n }\n\n return (\n <div className={`ln-avatar ${className}`.trim()}>\n <div\n className=\"ln-avatar__circle\"\n style={{\n width: avatarPx,\n height: avatarPx,\n fontSize: letterPx,\n background: imageUrl ? undefined : background,\n backgroundImage: imageUrl ? `url(${imageUrl})` : undefined,\n backgroundSize: imageUrl ? \"cover\" : undefined,\n }}\n >\n {!imageUrl && letter.slice(0, 1).toUpperCase()}\n </div>\n {(showName || showRole) && (\n <div className=\"ln-avatar__text\">\n {showName && name && (\n <div\n className=\"ln-avatar__name\"\n style={{\n fontSize: namePx,\n opacity: nameVisible ? 1 : 0,\n transition: FW_TRANSITION_OPACITY,\n }}\n >\n {name}\n </div>\n )}\n {showRole && role && (\n <div\n className=\"ln-avatar__role\"\n style={{\n fontSize: rolePx,\n opacity: roleVisible ? 1 : 0,\n transition: FW_TRANSITION_OPACITY,\n }}\n >\n {role}\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n"]}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Team Avatar widget styles.
3
+ * Imported via framework.css.
4
+ */
5
+
6
+ .ln-avatar {
7
+ display: flex;
8
+ align-items: center;
9
+ gap: var(--fw-space-8);
10
+ }
11
+
12
+ .ln-avatar__circle {
13
+ border-radius: 50%;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ line-height: var(--fw-line-single);
18
+ font-weight: var(--fw-weight-highlight);
19
+ color: #fff;
20
+ flex-shrink: 0;
21
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
22
+ transition: var(--fw-transition-size);
23
+ }
24
+
25
+ .ln-avatar__text {
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: var(--fw-space-2);
29
+ min-width: 0;
30
+ overflow: hidden;
31
+ }
32
+
33
+ .ln-avatar__name {
34
+ line-height: var(--fw-line-single);
35
+ font-weight: var(--fw-weight-highlight);
36
+ color: var(--text, #111);
37
+ white-space: nowrap;
38
+ text-overflow: ellipsis;
39
+ overflow: hidden;
40
+ }
41
+
42
+ .ln-avatar__role {
43
+ line-height: var(--fw-line-single);
44
+ font-weight: var(--fw-weight-tertiary);
45
+ color: var(--text-tertiary, #999);
46
+ white-space: nowrap;
47
+ text-overflow: ellipsis;
48
+ overflow: hidden;
49
+ }
50
+
51
+ .ln-avatar--hidden {
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ color: var(--text-tertiary, #999);
56
+ font-size: var(--fw-font-xs);
57
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Liquid Framework — Element size scale.
3
+ * Use for avatars, icons, cards, modals — width/height/min-width/min-height.
4
+ */
5
+
6
+ :root {
7
+ /* Element sizes (px): 24 … 256, step 8 */
8
+ --fw-size-24: 24px;
9
+ --fw-size-32: 32px;
10
+ --fw-size-40: 40px;
11
+ --fw-size-48: 48px;
12
+ --fw-size-56: 56px;
13
+ --fw-size-64: 64px;
14
+ --fw-size-72: 72px;
15
+ --fw-size-80: 80px;
16
+ --fw-size-88: 88px;
17
+ --fw-size-96: 96px;
18
+ --fw-size-104: 104px;
19
+ --fw-size-112: 112px;
20
+ --fw-size-120: 120px;
21
+ --fw-size-128: 128px;
22
+ --fw-size-136: 136px;
23
+ --fw-size-144: 144px;
24
+ --fw-size-152: 152px;
25
+ --fw-size-160: 160px;
26
+ --fw-size-168: 168px;
27
+ --fw-size-176: 176px;
28
+ --fw-size-184: 184px;
29
+ --fw-size-192: 192px;
30
+ --fw-size-200: 200px;
31
+ --fw-size-208: 208px;
32
+ --fw-size-216: 216px;
33
+ --fw-size-224: 224px;
34
+ --fw-size-232: 232px;
35
+ --fw-size-240: 240px;
36
+ --fw-size-248: 248px;
37
+ --fw-size-256: 256px;
38
+ }
@@ -4,3 +4,6 @@
4
4
 
5
5
  @import "./transitions.css";
6
6
  @import "./typography.css";
7
+ @import "./spacing.css";
8
+ @import "./element-sizes.css";
9
+ @import "./avatar.css";
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Liquid Framework — Global spacing scale.
3
+ * Use for margin, padding, gap, and layout indents.
4
+ */
5
+
6
+ :root {
7
+ /* Spacing scale (px): 0, 2, 4, 8 … 96 */
8
+ --fw-space-0: 0;
9
+ --fw-space-2: 2px;
10
+ --fw-space-4: 4px;
11
+ --fw-space-8: 8px;
12
+ --fw-space-12: 12px;
13
+ --fw-space-16: 16px;
14
+ --fw-space-20: 20px;
15
+ --fw-space-24: 24px;
16
+ --fw-space-28: 28px;
17
+ --fw-space-32: 32px;
18
+ --fw-space-36: 36px;
19
+ --fw-space-40: 40px;
20
+ --fw-space-44: 44px;
21
+ --fw-space-48: 48px;
22
+ --fw-space-52: 52px;
23
+ --fw-space-56: 56px;
24
+ --fw-space-60: 60px;
25
+ --fw-space-64: 64px;
26
+ --fw-space-68: 68px;
27
+ --fw-space-72: 72px;
28
+ --fw-space-76: 76px;
29
+ --fw-space-80: 80px;
30
+ --fw-space-84: 84px;
31
+ --fw-space-88: 88px;
32
+ --fw-space-92: 92px;
33
+ --fw-space-96: 96px;
34
+ }
@@ -25,4 +25,7 @@
25
25
  --fw-transition-size: width var(--fw-duration-normal) var(--fw-ease),
26
26
  height var(--fw-duration-normal) var(--fw-ease),
27
27
  font-size var(--fw-duration-normal) var(--fw-ease);
28
+ --fw-transition-opacity: opacity var(--fw-duration-normal) var(--fw-ease);
29
+ --fw-transition-opacity-font: opacity var(--fw-duration-normal) var(--fw-ease),
30
+ font-size var(--fw-duration-normal) var(--fw-ease);
28
31
  }
@@ -23,4 +23,21 @@
23
23
  --fw-font-xl: 18px;
24
24
 
25
25
  --fw-avatar-size: 28px;
26
+
27
+ /* Line height — single-line (compact) vs multi-line. */
28
+ --fw-line-single: 1;
29
+
30
+ /* Typography emphasis levels — tertiary (light) to title (bold). */
31
+ --fw-weight-tertiary: 300;
32
+ --fw-weight-secondary: 400;
33
+ --fw-weight-main: 500;
34
+ --fw-weight-highlight: 600;
35
+ --fw-weight-title: 700;
26
36
  }
37
+
38
+ /* Emphasis utility classes */
39
+ .fw-weight-tertiary { font-weight: var(--fw-weight-tertiary); }
40
+ .fw-weight-secondary { font-weight: var(--fw-weight-secondary); }
41
+ .fw-weight-main { font-weight: var(--fw-weight-main); }
42
+ .fw-weight-highlight { font-weight: var(--fw-weight-highlight); }
43
+ .fw-weight-title { font-weight: var(--fw-weight-title); }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@liquid-noise/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.46",
4
4
  "description": "Liquid Design Framework — noise and size controls for adaptive UI",
5
+ "homepage": "https://framework.plate.ninja",
5
6
  "type": "module",
6
7
  "main": "./dist/index.js",
7
8
  "module": "./dist/index.js",
@@ -12,12 +13,24 @@
12
13
  "import": "./dist/index.js",
13
14
  "default": "./dist/index.js"
14
15
  },
16
+ "./styles/framework.css": "./dist/styles/framework.css",
15
17
  "./styles/*": "./dist/styles/*"
16
18
  },
17
19
  "files": [
18
20
  "dist",
21
+ "README.md",
19
22
  "MANIFEST.md",
20
- "CONCEPT.md"
23
+ "CONCEPT.md",
24
+ "LICENSE"
25
+ ],
26
+ "license": "Apache-2.0",
27
+ "keywords": [
28
+ "react",
29
+ "design-system",
30
+ "ui",
31
+ "adaptive",
32
+ "noise",
33
+ "liquid-design"
21
34
  ],
22
35
  "publishConfig": {
23
36
  "access": "public"
@@ -27,10 +40,13 @@
27
40
  },
28
41
  "scripts": {
29
42
  "build": "tsup",
30
- "prepublishOnly": "npm run build"
43
+ "build:showcase": "npm run build && cd showcase && npm install && npm run build",
44
+ "prepublishOnly": "npm run build",
45
+ "prepare": "husky"
31
46
  },
32
47
  "devDependencies": {
33
48
  "@types/react": "^19.0.0",
49
+ "husky": "^9.1.7",
34
50
  "tsup": "^8.3.5",
35
51
  "typescript": "~5.6.2"
36
52
  }