@rogieking/figui3 8.9.30 → 8.9.32
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/.cursor/skills/fig-lab/SKILL.md +5 -1
- package/.cursor/skills/fig-lab/reference.md +20 -0
- package/README.md +51 -7
- package/components.css +15 -0
- package/dist/components.css +1 -1
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +2 -2
- package/dist/fig.css +1 -1
- package/dist/fig.js +5 -5
- package/fig-lab.css +537 -78
- package/fig-lab.js +1149 -12
- package/fig.js +104 -16
- package/package.json +1 -1
|
@@ -40,11 +40,13 @@ Full-surface `fig-field` wrappers. Prefer these over hand-rolled label+control r
|
|
|
40
40
|
|
|
41
41
|
Shared:
|
|
42
42
|
|
|
43
|
-
- `label`, `direction` (`horizontal` default for most), `size` (`""` | `large`), `disabled`
|
|
43
|
+
- `label`, `direction` (`horizontal` default for most), `size` (`""` | `small`; `large` remains an alias for the default), `disabled`
|
|
44
|
+
- `variant="minimal"` — removes vertical row padding and reveals the field background on hover
|
|
44
45
|
- `default` — reset target (may differ from initial `value`)
|
|
45
46
|
- Right-click **Reset** menu; `resetToDefault()`
|
|
46
47
|
- `propskit-slider` also double-click resets
|
|
47
48
|
- Forward remaining attrs to the inner control
|
|
49
|
+
- Rows are large by default; `propskit-group size="small"` applies compact sizing to children without an authored size
|
|
48
50
|
|
|
49
51
|
| Tag | Playground | Inner control | Notes |
|
|
50
52
|
|---|---|---|---|
|
|
@@ -56,6 +58,7 @@ Shared:
|
|
|
56
58
|
| `propskit-text` | `#propskit-text` | `fig-input-text` | `type`, `readonly` |
|
|
57
59
|
| `propskit-number` | `#propskit-number` | `fig-input-number` | `min`, `max`, `step`, `precision`, `units`, `steppers` |
|
|
58
60
|
| `propskit-slider` | `#propskit-slider` | `fig-slider` | `type` range/hue/delta/stepper/opacity; `elastic` default true |
|
|
61
|
+
| `propskit-wheel` | `#propskit-wheel` | SVG wheel + `fig-input-number` | Generic numeric wheel with optional arbitrary `units`. Defaults: `value="0"`, no units, `label="Value"`, `step="1"`, `precision="0"`. Time aliases normalize to `s` / `ms` and default to `step="0.1"` / `precision="2"` for seconds or `step="100"` / `precision="0"` for milliseconds. Resisted handle drag + edge stretch + spring return (`elastic` default true). Optional `min`/`max` (omit = unbounded). No `fig-field` |
|
|
59
62
|
| `propskit-position` | `#propskit-position` | two numbers | `x`, `y`, `units="percent"` |
|
|
60
63
|
| `propskit-color-point` | `#propskit-color-point` | color + position | JSON `value`; `collapsible`, `open` |
|
|
61
64
|
| `propskit-point-radius` | `#propskit-point-radius` | position + radius | JSON `value` |
|
|
@@ -140,6 +143,7 @@ These are layout shells. Wire behavior yourself.
|
|
|
140
143
|
|---|---|
|
|
141
144
|
| Labeled boolean | `propskit-switch` |
|
|
142
145
|
| Labeled continuous number | `propskit-slider` |
|
|
146
|
+
| Scrubbable number or time | `propskit-wheel` |
|
|
143
147
|
| Labeled exact number | `propskit-number` |
|
|
144
148
|
| Labeled text | `propskit-text` |
|
|
145
149
|
| Labeled discrete list | `propskit-select` (not `fig-dropdown`) |
|
|
@@ -10,6 +10,15 @@ Playground: `/propskit/lab#{id}`. Rules: `playground/src/lib/attributeRules.ts`.
|
|
|
10
10
|
- Slider: double-click also resets
|
|
11
11
|
- Equality helpers treat booleans and JSON objects
|
|
12
12
|
|
|
13
|
+
## Propskit variants
|
|
14
|
+
|
|
15
|
+
`variant="minimal"` is available on switch, color, fill, gradient, select, text, number, slider, position, and wheel controls. It removes vertical host padding, keeps the inner field transparent at rest, and restores the secondary field background on hover.
|
|
16
|
+
|
|
17
|
+
PropsKit rows are large by default; explicit `size="large"` remains supported.
|
|
18
|
+
`propskit-group size="small"` applies `size="small"` to nested controls that do
|
|
19
|
+
not define their own size and removes generated sizes when the group returns to
|
|
20
|
+
the default size.
|
|
21
|
+
|
|
13
22
|
## `propskit-select`
|
|
14
23
|
|
|
15
24
|
Observed: `label`, `direction`, `aria-label`, `options`, `value`.
|
|
@@ -24,6 +33,17 @@ Playground attrs: `type` (`range`, `hue`, `delta`, `stepper`, `opacity`), `color
|
|
|
24
33
|
|
|
25
34
|
Inner `fig-slider` still needs `min` / `max` / `step` / `value` as forwarded attrs.
|
|
26
35
|
|
|
36
|
+
## `propskit-wheel`
|
|
37
|
+
|
|
38
|
+
Observed: `label`, `units` (optional arbitrary string; `seconds`, `s`, `milliseconds`, and `ms` time aliases), `value`, `default`, `step`, `precision`, `min`, `max`, `elastic` (default true), `size`, `disabled`, `variant`.
|
|
39
|
+
|
|
40
|
+
No `fig-field` / `fig-slider`. Host + `.propskit-wheel-surface` + SVG tick wheel + `fig-input-number`. Omitted `label` → `"Value"`; authored `label` (including blank) is used as-is. Value defaults to `0`; units are omitted by default and arbitrary values such as `px` pass through unchanged. Generic/no-unit defaults are `step="1"` and `precision="0"`. Full time unit names normalize to `s` / `ms`; seconds default to `step="0.1"` and `precision="2"`, while milliseconds default to `step="100"` and `precision="0"`. `precision` only controls the inner number's displayed decimals; scrubbing moves by `step` on every `input`, or `10× step` while Shift is held. Omitted `min`/`max` are unbounded. Wheel is a `spinbutton`; arrows step, Shift+arrow is 10×. Home/End jump to min/max when set. During horizontal scrubbing, the center handle follows the pointer with resisted movement (8px maximum by default), while the whole control stretches when the pointer passes an edge; both spring back on release unless `elastic="false"`. An unfocused number field also starts scrubbing after 4px of pointer travel; clicking without dragging focuses it for text editing.
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<propskit-wheel label="Duration" value="1.5" units="seconds"></propskit-wheel>
|
|
44
|
+
<propskit-wheel label="Delay" value="240" units="ms"></propskit-wheel>
|
|
45
|
+
```
|
|
46
|
+
|
|
27
47
|
## Point JSON shapes
|
|
28
48
|
|
|
29
49
|
```json
|
package/README.md
CHANGED
|
@@ -104,6 +104,7 @@ Minimal example:
|
|
|
104
104
|
| [Switch](#switch) | `<fig-switch>` | Toggle switch |
|
|
105
105
|
| [Slider](#slider) | `<fig-slider>` | Range, hue, opacity, delta, stepper |
|
|
106
106
|
| [Propskit Slider](#propskit-slider) | `<propskit-slider>` | Labeled field + slider combo |
|
|
107
|
+
| [Propskit Wheel](#propskit-wheel) | `<propskit-wheel>` | Generic numeric scrubber with tick wheel |
|
|
107
108
|
| [Propskit Color](#propskit-color) | `<propskit-color>` | Full-surface labeled color control |
|
|
108
109
|
| [Propskit Fill](#propskit-fill) | `<propskit-fill>` | Full-surface labeled fill control |
|
|
109
110
|
| [Propskit Gradient](#propskit-gradient) | `<propskit-gradient>` | Full-surface labeled gradient control |
|
|
@@ -355,6 +356,8 @@ Author options in `<fig-select-options>`, or pass `options`. Use `label` on `<fi
|
|
|
355
356
|
|
|
356
357
|
For `type="range"`, omitting `value` follows native range behavior and starts at the midpoint of `min` and `max`. Arrow keys move by `step`; hold Shift to move by a larger step.
|
|
357
358
|
|
|
359
|
+
Full-surface `propskit-*` controls support `variant="minimal"`. The minimal variant removes vertical row padding and keeps the field background transparent until hover. It is available on switch, color, fill, gradient, select, text, number, slider, position, and wheel controls.
|
|
360
|
+
|
|
358
361
|
---
|
|
359
362
|
|
|
360
363
|
#### Propskit Number
|
|
@@ -363,18 +366,21 @@ For `type="range"`, omitting `value` follows native range behavior and starts at
|
|
|
363
366
|
|
|
364
367
|
Composes a `<fig-field>` and `<fig-input-number>` into a full-surface property control. Number attributes are forwarded to the inner input.
|
|
365
368
|
|
|
366
|
-
PropsKit controls use the
|
|
367
|
-
`size="
|
|
369
|
+
PropsKit controls use the 40px large layout when `size` is omitted. Set
|
|
370
|
+
`size="small"` for the compact 32px row layout. Explicit `size="large"`
|
|
371
|
+
remains supported as an alias for the default layout.
|
|
368
372
|
|
|
369
373
|
All PropsKit inputs expose `defaultValue`, `isDefault`, and `resetToDefault()`. A
|
|
370
374
|
`propskit-group` uses this shared contract to track its `dirty` state and reset
|
|
371
|
-
each nested input to its own current `default`.
|
|
375
|
+
each nested input to its own current `default`. Set `size="small"` on a
|
|
376
|
+
`propskit-group` to apply the compact layout to nested controls that do not
|
|
377
|
+
define their own size.
|
|
372
378
|
|
|
373
379
|
| Attribute | Type | Default | Description |
|
|
374
380
|
|---|---|---|---|
|
|
375
381
|
| `label` | string | `"Label"` | Field label text; use an empty value to hide it |
|
|
376
382
|
| `direction` | string | `"horizontal"` | Field layout direction |
|
|
377
|
-
| `size` | string | default | Set to `"
|
|
383
|
+
| `size` | string | default | Set to `"small"` for the compact layout |
|
|
378
384
|
| `default` | number/string | initial `value` | Right-click reset target |
|
|
379
385
|
| `disabled` | boolean | `false` | Disable interaction |
|
|
380
386
|
| *number attrs* | — | — | All `<fig-input-number>` attributes are forwarded |
|
|
@@ -442,7 +448,7 @@ Composes a `<fig-field>` and `<fig-input-gradient>` into a full-surface property
|
|
|
442
448
|
| `edit` | boolean/string | `"picker"` | `true` (inline stops), `false`, or `"picker"` |
|
|
443
449
|
| `mode` | string | `"handle"` | `"handle"` or `"tip"` stop presentation |
|
|
444
450
|
| `disabled` | boolean | `false` | Disabled state |
|
|
445
|
-
| `size` | string | default | Set to `"
|
|
451
|
+
| `size` | string | default | Set to `"small"` for the compact layout |
|
|
446
452
|
|
|
447
453
|
**Events:** `input`, `change` — bubbling, composed events with `{ type: "gradient", gradient }` in `event.detail`.
|
|
448
454
|
|
|
@@ -534,7 +540,7 @@ Wraps a `<fig-field>` and `<fig-slider>` into a single labeled control. All slid
|
|
|
534
540
|
|---|---|---|---|
|
|
535
541
|
| `label` | string | — | Field label text |
|
|
536
542
|
| `direction` | string | `"column"` | Layout direction |
|
|
537
|
-
| `size` | string | default | Set to `"
|
|
543
|
+
| `size` | string | default | Set to `"small"` for the compact layout |
|
|
538
544
|
| `default` | number/string | initial `value` | Double-click and right-click reset target |
|
|
539
545
|
| `disabled` | boolean | `false` | Disable interaction |
|
|
540
546
|
| *slider attrs* | — | — | All `<fig-slider>` attributes except host-only PropsKit attributes are forwarded |
|
|
@@ -551,6 +557,38 @@ Double-click or right-click and choose **Reset** to restore `default`, falling b
|
|
|
551
557
|
|
|
552
558
|
---
|
|
553
559
|
|
|
560
|
+
#### Propskit Wheel
|
|
561
|
+
|
|
562
|
+
`<propskit-wheel>`
|
|
563
|
+
|
|
564
|
+
A generic numeric scrubber with optional arbitrary units. The host is the row chrome; an inner `.propskit-wheel-surface` holds a projected SVG tick wheel and a `fig-input-number`. There is no `fig-field` or `fig-slider`.
|
|
565
|
+
|
|
566
|
+
Omitted `label` renders `"Value"`. If `label` is set, including `label=""`, that exact value is used. Units are omitted by default and arbitrary values such as `px` pass through unchanged. Time aliases receive time-focused defaults.
|
|
567
|
+
|
|
568
|
+
| Attribute | Type | Default | Description |
|
|
569
|
+
|---|---|---|---|
|
|
570
|
+
| `label` | string | `"Value"` when omitted | Authored values (including blank) are used as-is |
|
|
571
|
+
| `units` | string | — | Optional arbitrary units. `seconds` / `milliseconds` normalize to `s` / `ms` |
|
|
572
|
+
| `value` | number | `0` | Numeric value in `units`. Unbounded unless `min`/`max` are set |
|
|
573
|
+
| `min` | number | — | Inclusive lower bound. Omit for no minimum |
|
|
574
|
+
| `max` | number | — | Inclusive upper bound. Omit for no maximum |
|
|
575
|
+
| `step` | number | `1`; `0.1` (`s`) / `100` (`ms`) | Drag, keyboard, and mouse wheel increment |
|
|
576
|
+
| `precision` | number | `0`; `2` (`s`) / `0` (`ms`) | Displayed decimal places on the inner number |
|
|
577
|
+
| `elastic` | boolean/string | `true` | Resisted handle movement, edge stretch, and spring return while scrubbing; set `"false"` to disable |
|
|
578
|
+
| `size` | string | default | Set to `"small"` for the compact layout |
|
|
579
|
+
| `default` | number/string | initial `value` | Right-click reset target |
|
|
580
|
+
| `disabled` | boolean | `false` | Disable wheel and number |
|
|
581
|
+
| `variant` | string | — | `"minimal"` removes vertical padding |
|
|
582
|
+
|
|
583
|
+
**Events:** `input` while dragging or typing; `change` on commit. Dragging moves by `step` on every `input`; hold Shift to scrub at `10× step`. `precision` only formats the displayed number. Arrow keys on the focused wheel move by `step`; Shift+arrow moves by `10× step`.
|
|
584
|
+
|
|
585
|
+
```html
|
|
586
|
+
<propskit-wheel label="Duration" value="1.5" default="0" units="seconds"></propskit-wheel>
|
|
587
|
+
<propskit-wheel label="Delay" value="240" default="0" min="0" max="1000" units="ms"></propskit-wheel>
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
554
592
|
#### Propskit Position
|
|
555
593
|
|
|
556
594
|
`<propskit-position>`
|
|
@@ -564,7 +602,7 @@ A compact X/Y field with optional percentage units.
|
|
|
564
602
|
| `default` | JSON string | initial `{ x, y }` | Right-click and group reset target |
|
|
565
603
|
| `label` | string | `"Position"` | Field label; empty values use the semantic default |
|
|
566
604
|
| `units` | string | — | `"percent"` shows `%`; omit for no units |
|
|
567
|
-
| `size` | string | default | Set to `"
|
|
605
|
+
| `size` | string | default | Set to `"small"` for the compact row |
|
|
568
606
|
| `disabled` | boolean | `false` | Disable both number inputs |
|
|
569
607
|
|
|
570
608
|
**Properties and methods:** `x`, `y`, and `value` expose the current coordinates; `defaultValue` returns the normalized reset object; `isDefault` compares both coordinates; `resetToDefault()` restores both values.
|
|
@@ -1093,6 +1131,8 @@ When app code rebuilds a chooser by setting `fig-chooser.innerHTML`, the chooser
|
|
|
1093
1131
|
| `drag` | boolean | `false` | Enable drag-to-scroll |
|
|
1094
1132
|
| `overflow` | string | — | Overflow behavior |
|
|
1095
1133
|
| `loop` | boolean | `false` | Loop keyboard navigation |
|
|
1134
|
+
| `auto-scroll` | boolean | `true` | Automatically center the selection after selection, layout, resize, or media changes. Set to `"false"` to disable. |
|
|
1135
|
+
| `scroll-behavior` | string | `"smooth"` | Selection and overflow-button scrolling behavior: `"smooth"` or `"auto"`. The CSS `scroll-behavior` property can also override it. |
|
|
1096
1136
|
|
|
1097
1137
|
**fig-choice attributes:**
|
|
1098
1138
|
|
|
@@ -1104,6 +1144,10 @@ When app code rebuilds a chooser by setting `fig-chooser.innerHTML`, the chooser
|
|
|
1104
1144
|
|
|
1105
1145
|
**Events (on fig-chooser):** `input`, `change` — detail is the selected value string.
|
|
1106
1146
|
|
|
1147
|
+
Selection follows the native `<select>` pattern: set `chooser.value` with a choice value, or set `chooser.selectedChoice` with a choice element. Neither programmatic selection nor scrolling emits events.
|
|
1148
|
+
|
|
1149
|
+
When `auto-scroll="false"`, reveal the current selection explicitly with `chooser.scrollSelectionIntoView(options?)`. It accepts native-style `ScrollIntoViewOptions` (`behavior`, `block`, and `inline`) and centers by default.
|
|
1150
|
+
|
|
1107
1151
|
```html
|
|
1108
1152
|
<fig-chooser value="opt1">
|
|
1109
1153
|
<fig-choice value="opt1">Option 1</fig-choice>
|
package/components.css
CHANGED
|
@@ -5017,9 +5017,18 @@ fig-chooser {
|
|
|
5017
5017
|
overflow: hidden auto;
|
|
5018
5018
|
padding: 0;
|
|
5019
5019
|
margin: 0 var(--fig-chooser-inline-margin);
|
|
5020
|
+
scroll-behavior: smooth;
|
|
5020
5021
|
scrollbar-width: none;
|
|
5021
5022
|
width: calc(100% - var(--fig-chooser-inline-margin) * 2);
|
|
5022
5023
|
|
|
5024
|
+
&[scroll-behavior="auto"] {
|
|
5025
|
+
scroll-behavior: auto;
|
|
5026
|
+
}
|
|
5027
|
+
|
|
5028
|
+
&[scroll-behavior="smooth"] {
|
|
5029
|
+
scroll-behavior: smooth;
|
|
5030
|
+
}
|
|
5031
|
+
|
|
5023
5032
|
fig-field > &{
|
|
5024
5033
|
--fig-chooser-inline-margin:0;
|
|
5025
5034
|
}
|
|
@@ -5184,6 +5193,12 @@ fig-chooser {
|
|
|
5184
5193
|
}
|
|
5185
5194
|
}
|
|
5186
5195
|
|
|
5196
|
+
@media (prefers-reduced-motion: reduce) {
|
|
5197
|
+
fig-chooser:not([scroll-behavior="smooth"]) {
|
|
5198
|
+
scroll-behavior: auto;
|
|
5199
|
+
}
|
|
5200
|
+
}
|
|
5201
|
+
|
|
5187
5202
|
fig-card {
|
|
5188
5203
|
--fig-card-label-line-clamp: 1;
|
|
5189
5204
|
--fig-card-media-radius: var(--radius-medium);
|