@rogieking/figui3 9.3.0 → 9.4.1
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 +3 -3
- package/.cursor/skills/fig-lab/components.md +22 -2
- package/.cursor/skills/fig-lab/reference.md +22 -2
- package/.cursor/skills/figui3/SKILL.md +2 -2
- package/.cursor/skills/figui3/components.md +29 -0
- package/.cursor/skills/figui3/react.md +4 -1
- package/.cursor/skills/figui3/reference.md +10 -0
- package/CHANGELOG.md +3966 -0
- package/README.md +93 -0
- package/components.css +252 -15
- package/dist/components.css +1 -1
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +5 -5
- package/fig-lab.css +115 -0
- package/fig-lab.js +447 -5
- package/fig.js +613 -23
- package/package.json +2 -4
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
name: fig-lab
|
|
3
3
|
description: >-
|
|
4
4
|
Guides FigUI3 experimental Lab components: fig-canvas-control,
|
|
5
|
-
fig-input-wheel, fig-reorder, and AI composer components,
|
|
6
|
-
APIs are unstable.
|
|
5
|
+
fig-input-audio, fig-input-wheel, fig-reorder, and AI composer components,
|
|
6
|
+
including React JSX usage. APIs are unstable.
|
|
7
7
|
user-invocable: false
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -22,4 +22,4 @@ import "@rogieking/figui3/fig-lab.css";
|
|
|
22
22
|
import "@rogieking/figui3/fig-lab.js";
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Use Lab for
|
|
25
|
+
Use Lab for audio and wheel inputs, canvas handles, reorder behavior, and AI composition surfaces. Keep Lab out of `fig.js`.
|
|
@@ -5,6 +5,26 @@ Experimental. APIs may change. React contract: [../figui3/react.md](../figui3/re
|
|
|
5
5
|
|
|
6
6
|
Handlers below assume `onInput` / `onChange` from the React contract.
|
|
7
7
|
|
|
8
|
+
## Inputs
|
|
9
|
+
|
|
10
|
+
### `fig-input-audio`
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
<fig-input-audio
|
|
14
|
+
accepts="audio/*"
|
|
15
|
+
label="Upload audio"
|
|
16
|
+
full
|
|
17
|
+
onInput={onInput}
|
|
18
|
+
onChange={onChange}
|
|
19
|
+
/>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- Single-file waveform preview; no playback or seeking.
|
|
23
|
+
- Attrs: `url`, `filename`, `label`, `accepts`, `variant`, `disabled`, `full`.
|
|
24
|
+
- Props: `files`, `value`. Method: `clear()`.
|
|
25
|
+
- `input` and `change` bubble with `{ files }`; clear adds `{ cleared: true }`.
|
|
26
|
+
- URL previews require CORS access.
|
|
27
|
+
|
|
8
28
|
## Spatial
|
|
9
29
|
|
|
10
30
|
### `fig-canvas-control`
|
|
@@ -62,8 +82,8 @@ useEffect(() => {
|
|
|
62
82
|
}, [onReorder]);
|
|
63
83
|
```
|
|
64
84
|
|
|
65
|
-
- `display: contents`. Reorders **direct children**. `axis` `vertical` | `horizontal`. Omit `handle` to drag whole rows; set it when rows contain sliders/handles.
|
|
66
|
-
- Event `reorder`: `{ oldIndex, newIndex, item }
|
|
85
|
+
- `display: contents`. Reorders **direct children**. `axis` `vertical` | `horizontal`. `items` selector limits which children reorder (e.g. `items=".row"` to skip headers); `refresh()` re-syncs. Omit `handle` to drag whole rows; set it when rows contain sliders/handles.
|
|
86
|
+
- Event `reorder`: `{ oldIndex, newIndex, item }` (indices among matching items). Nested drag is ignored for sliders, handles, and canvas controls.
|
|
67
87
|
|
|
68
88
|
## AI composer
|
|
69
89
|
|
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
React recipes: [components.md](components.md).
|
|
4
4
|
|
|
5
|
+
## `fig-input-audio`
|
|
6
|
+
|
|
7
|
+
Single-audio upload with a responsive, preview-only waveform.
|
|
8
|
+
|
|
9
|
+
- Attrs: `url`, `filename`, `label` (default `Upload audio`), `accepts` (default `audio/*`), `variant`, `disabled`, `full`
|
|
10
|
+
- Props: `files`, `value`
|
|
11
|
+
- Method: `clear()`
|
|
12
|
+
- Events: `input` and `change`, bubbling and composed, with `{ files }` and optional `cleared`
|
|
13
|
+
- Clicking the waveform replaces the file; the minus action removes it
|
|
14
|
+
- URL decoding requires CORS; fetch and decode failures fall back quietly
|
|
15
|
+
- CSS: `--fig-input-audio-waveform-stroke-width` controls bar thickness (default `2px`)
|
|
16
|
+
- Not supported: multiple files, playback, or seeking
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<fig-input-audio></fig-input-audio>
|
|
20
|
+
<fig-input-audio url="https://example.com/audio.wav" filename="audio.wav" full></fig-input-audio>
|
|
21
|
+
```
|
|
22
|
+
|
|
5
23
|
## `fig-input-wheel`
|
|
6
24
|
|
|
7
25
|
Standalone interactive SVG tick + handle scrubber in the lab bundle.
|
|
@@ -37,9 +55,11 @@ Types: `point`, `color`, `point-radius`, `point-radius-angle`, `point-point`.
|
|
|
37
55
|
|
|
38
56
|
## `fig-reorder`
|
|
39
57
|
|
|
40
|
-
Observed: `axis`, `handle`, `disabled`.
|
|
58
|
+
Observed: `axis`, `handle`, `items`, `disabled`.
|
|
59
|
+
|
|
60
|
+
`items`: CSS selector for which direct children are reorderable (default: all). Non-matching children stay in place and get `role="none"` unless they have a role. Class/attribute changes on children re-sync automatically; call `refresh()` to force it.
|
|
41
61
|
|
|
42
|
-
Event `reorder`: `{ oldIndex, newIndex, item }`.
|
|
62
|
+
Event `reorder`: `{ oldIndex, newIndex, item }`. Indices count matching items, not DOM positions.
|
|
43
63
|
|
|
44
64
|
Nested drag is ignored for sliders, handles, and canvas controls so inner gestures still work. If a row is still stolen, set `handle` to a drag-affordance selector.
|
|
45
65
|
|
|
@@ -3,8 +3,8 @@ name: figui3
|
|
|
3
3
|
description: >-
|
|
4
4
|
Guides FigUI3 core (`fig.js` / `fig.css`) web components for Figma-style plugin UIs,
|
|
5
5
|
including React JSX usage. Use when adding, using, or debugging fig-* elements from
|
|
6
|
-
the core bundle—buttons, fields, overlays, menus, sliders, color/fill inputs,
|
|
7
|
-
dialogs, popups, toasts. Not for fig-select or fig-fill-picker (fig-editor),
|
|
6
|
+
the core bundle—buttons, fields, overlays, menus, toolbelts, sliders, color/fill inputs,
|
|
7
|
+
media, dialogs, popups, toasts. Not for fig-select or fig-fill-picker (fig-editor),
|
|
8
8
|
user-invocable: false
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -341,6 +341,8 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
|
|
|
341
341
|
```
|
|
342
342
|
|
|
343
343
|
- Attrs: `name`, `collapsible`, `open`, `compact`
|
|
344
|
+
- Group `compact` is propagated to the direct `fig-header`.
|
|
345
|
+
- In a collapsible group, the `h3` is the keyboard-accessible toggle and the chevron is clickable. For custom headers, place independent actions beside the `h3`, not inside it.
|
|
344
346
|
|
|
345
347
|
### `fig-header`
|
|
346
348
|
|
|
@@ -368,6 +370,33 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
|
|
|
368
370
|
<fig-content>Body</fig-content>
|
|
369
371
|
```
|
|
370
372
|
|
|
373
|
+
### `fig-toolbelt` / `fig-toolbelt-group` / `fig-toolbelt-item`
|
|
374
|
+
|
|
375
|
+
```tsx
|
|
376
|
+
<fig-toolbelt
|
|
377
|
+
layout="horizontal"
|
|
378
|
+
overflow="buttons"
|
|
379
|
+
value={tool}
|
|
380
|
+
aria-label="Design tools"
|
|
381
|
+
onChange={onChange}
|
|
382
|
+
>
|
|
383
|
+
<fig-toolbelt-group aria-label="Transform tools">
|
|
384
|
+
<fig-toolbelt-item value="move" selected={tool === "move" || undefined}>
|
|
385
|
+
Move
|
|
386
|
+
</fig-toolbelt-item>
|
|
387
|
+
<fig-toolbelt-item value="frame">Frame</fig-toolbelt-item>
|
|
388
|
+
</fig-toolbelt-group>
|
|
389
|
+
</fig-toolbelt>
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
- Toolbelt attrs: `value`, `disabled`, `layout="horizontal|vertical"`, `overflow="buttons|scrollbar"`
|
|
393
|
+
- Group: wraps related items; adjacent groups receive direction-aware separators
|
|
394
|
+
- Item attrs: `value`, `selected`, `disabled`
|
|
395
|
+
- ArrowLeft/ArrowRight move focus horizontally; ArrowUp/ArrowDown move focus vertically; Enter/Space selects
|
|
396
|
+
- Items stay in light DOM; the internal `part="viewport"` owns scrolling and overflow fades
|
|
397
|
+
- Overflow buttons are generated outside the viewport for `overflow="buttons"`
|
|
398
|
+
- Events: `input` / `change` → `currentTarget.value`
|
|
399
|
+
|
|
371
400
|
### `fig-tabs` / `fig-tab` / `fig-tab-content`
|
|
372
401
|
|
|
373
402
|
```tsx
|
|
@@ -110,6 +110,9 @@ type FigTag =
|
|
|
110
110
|
| "fig-tab"
|
|
111
111
|
| "fig-tab-content"
|
|
112
112
|
| "fig-tabs"
|
|
113
|
+
| "fig-toolbelt"
|
|
114
|
+
| "fig-toolbelt-group"
|
|
115
|
+
| "fig-toolbelt-item"
|
|
113
116
|
| "fig-tooltip"
|
|
114
117
|
| "fig-truncate"
|
|
115
118
|
| "fig-video"
|
|
@@ -240,7 +243,7 @@ React owns child nodes. Components slot; they do not relocate children.
|
|
|
240
243
|
|
|
241
244
|
- `fig-menu` items; trigger gets `slot="trigger"`
|
|
242
245
|
- `fig-select-options slot="panel"`
|
|
243
|
-
- `fig-tabs` / `fig-chooser` children
|
|
246
|
+
- `fig-tabs` / `fig-toolbelt` / `fig-chooser` children
|
|
244
247
|
- media `slot="overlay"`
|
|
245
248
|
- fill custom `slot="mode-*"`
|
|
246
249
|
|
|
@@ -70,6 +70,16 @@ Public API: `README.md`. React recipes: [components.md](components.md).
|
|
|
70
70
|
- `direction="horizontal|vertical"`
|
|
71
71
|
- `label` or a child `<label>`
|
|
72
72
|
|
|
73
|
+
## `fig-toolbelt`
|
|
74
|
+
|
|
75
|
+
- Attrs: `value`, `disabled`, `layout="horizontal|vertical"`, `overflow="buttons|scrollbar"`; role `toolbar`
|
|
76
|
+
- Direct `fig-toolbelt-item` or `fig-toolbelt-group` children; groups wrap related items and use role `group`
|
|
77
|
+
- Items: `value`, `selected`, `disabled`; role `button`, `aria-pressed`
|
|
78
|
+
- ArrowLeft/ArrowRight navigate horizontal layouts; ArrowUp/ArrowDown navigate vertical layouts; Home/End move roving focus; Enter/Space select
|
|
79
|
+
- Events: bubbling `input` and `change` with the selected value
|
|
80
|
+
- `overflow="scrollbar"` is the default and uses buttonless scrolling with the scrollbar hidden; `overflow="buttons"` adds direction-aware paging controls
|
|
81
|
+
- Internal `part="viewport"` owns scrolling and fades; authored items remain direct light-DOM children
|
|
82
|
+
|
|
73
83
|
## `.fig-overflow-fade`
|
|
74
84
|
|
|
75
85
|
- Apply the class to a vertical scroll container and constrain its height; add `fig-overflow-fade-horizontal` for horizontal scrolling.
|