@zakkster/lite-ui-fx 1.3.0 → 1.5.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/llms.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  # @zakkster/lite-ui-fx
2
- > Canvas-hijacked UI components with pluggable recipe system. 50 built-in recipes.
2
+ > Canvas-hijacked UI components with pluggable recipe system. 53 built-in recipes.
3
3
 
4
- VERSION 1.3.0
4
+ VERSION 1.5.0
5
5
 
6
6
  ## Install
7
7
  npm i @zakkster/lite-ui-fx
@@ -14,7 +14,7 @@ Recipe = { tick(), init?(), onHover?(), onClick?(), onToggle?(), onDrag?(), dest
14
14
  ## Import -- Controller
15
15
  import { mountUIFX, UIType } from '@zakkster/lite-ui-fx';
16
16
 
17
- ## Import -- Recipes (one ./recipes subpath, 50 total, tree-shakeable)
17
+ ## Import -- Recipes (one ./recipes subpath, 53 total, tree-shakeable)
18
18
  import { SwarmToggle, MagneticButton, SparkSlider } from '@zakkster/lite-ui-fx/recipes';
19
19
  import { PendulumToggle, HeartbeatButton, AuroraSlider } from '@zakkster/lite-ui-fx/recipes';
20
20
  import { VolumeKnob, WaterLevel, TimerCountdown } from '@zakkster/lite-ui-fx/recipes';
@@ -26,23 +26,35 @@ import { RECIPES, RECIPE_META, RECIPE_NAMES, registerRecipe, mountRecipe } from
26
26
 
27
27
  ## Mount
28
28
  const instance = mountUIFX(container, UIType.TOGGLE, SwarmToggle, { label: 'Sound' });
29
- instance.destroy(); // cleanup
29
+ instance.setValue(v); // SLIDER/KNOB/PROGRESS: v in 0..1 (fires onDrag once); CHECKBOX: setValue(null) = indeterminate
30
+ instance.setChecked(b); // TOGGLE/CHECKBOX: set checked (fires onToggle once)
31
+ instance.destroy(); // cleanup
30
32
 
31
33
  ## Options (4th arg; unknown option or recipe-hook keys throw a did-you-mean -- fail closed)
32
34
  width, height, padding=40, label // geometry + accessible label
33
35
  value // slider start, number 0..1 (default 0.5); out-of-range or non-number throws
34
36
  checked // toggle start, boolean (default false)
35
37
  disabled // native disabled attr + state.disabled for recipes to render
38
+ seed // recipe RNG seed (finite number)
39
+ colors // string[] palette override; wins over theme (array-palette recipes: IS the palette)
40
+ theme // { light, mid, dark } -> accent/dim/surface; partial or wrong-shape throws
41
+ text // visible canvas label; falls back to label, then the recipe default (label-in-name)
42
+ font // canvas font string; falls back to the recipe's historical font
43
+ knobMode // KNOB only: 'rotate' | 'vertical' pointer mapping (default 'rotate'); wrong type throws
44
+ announce // PROGRESS only: opt-in aria-live announcements at 10% steps; wrong type throws
36
45
 
37
46
  ## Element Types
38
- UIType.TOGGLE -> <input type="checkbox" role="switch"> -> state.toggled, onToggle(checked)
39
- UIType.BUTTON -> <button> -> state.active, onClick(x, y, state)
40
- UIType.SLIDER -> <input type="range"> -> state.val (0-1), onDrag(val, velocity)
47
+ UIType.TOGGLE -> <input type="checkbox" role="switch"> -> state.toggled, onToggle(checked)
48
+ UIType.BUTTON -> <button> -> state.active, onClick(x, y, state)
49
+ UIType.SLIDER -> <input type="range"> -> state.val (0-1), onDrag(val, velocity)
50
+ UIType.CHECKBOX -> <input type="checkbox"> (no role=switch) -> state.toggled + state.indeterminate, onToggle(checked)
51
+ UIType.PROGRESS -> <progress> (non-interactive) -> state.val, driven by instance.setValue
52
+ UIType.KNOB -> <input type="range"> -> state.val, arrows native + knobMode pointer map, onDrag(val, velocity)
41
53
 
42
54
  ## State Object (provided to tick every frame)
43
- { hover, active, focused, toggled, disabled, val, w, h, padding, dpr }
55
+ { hover, active, focused, toggled, indeterminate, disabled, val, w, h, padding, dpr }
44
56
 
45
- ## 50 Built-in Recipes
57
+ ## 53 Built-in Recipes
46
58
 
47
59
  ### Vol. 1 -- 10 recipes
48
60
  Toggles: SwarmToggle, LiquidToggle, NeonPulseToggle
@@ -67,6 +79,10 @@ Mood: DayNightToggle, ReactionPicker, NotificationBell
67
79
  Feedback: TypewriterField, SoundWaveBtn, UploadProgress
68
80
  Fun: ScratchReveal, TimerCountdown, PullRefresh
69
81
 
82
+ ### U4a -- 3 recipes (new element types)
83
+ Checkboxes (UIType.CHECKBOX): TickDraw, IndeterminateScan
84
+ Progress (UIType.PROGRESS): LiquidFill
85
+
70
86
  ## Writing Custom Recipes
71
87
  See UIFX-RECIPE-GUIDE.md (included in package).
72
88
 
@@ -81,4 +97,11 @@ See UIFX-RECIPE-GUIDE.md (included in package).
81
97
  - Accessibility: role=switch, aria-label, keyboard focus tracking
82
98
  - Zero-GC in all built-in recipes: const colors + globalAlpha, precomputed
83
99
  color/label LUTs, fixed preallocated particle pools, gradients built in init.
84
- Gated per recipe by the t3-frame-alloc torture tier.
100
+ Gated per recipe by the t3-frame-alloc torture tier (default AND themed mount).
101
+ - Themeable: all 53 recipes honour { colors, theme:{light,mid,dark}, text, font },
102
+ resolved once in init (zero per-frame alloc). RECIPE_META.themeable is true for
103
+ all 53; motionSafe stays false (reduced motion is a later pass). A bare mount is
104
+ byte-identical to pre-theming. Shipped palettes + APCA contrast are authored with
105
+ @zakkster/lite-hueforge (a dev-only tool, never a runtime dependency).
106
+ - U4a element types: CHECKBOX (indeterminate), PROGRESS (setValue-driven, aria-live
107
+ opt-in), KNOB (knobMode pointer map); setValue/setChecked sync native+state+hook once.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakkster/lite-ui-fx",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Canvas-hijacked UI components with a pluggable recipe system. 50 built-in recipes across toggles, buttons, sliders, knobs, loaders, checkboxes, counters, and ratings.",
5
5
  "author": "Zahary Shinikchiev <shinikchiev@yahoo.com>",
6
6
  "license": "MIT",