@rogieking/figui3 8.9.18 → 8.9.20
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-editor/SKILL.md +4 -5
- package/.cursor/skills/fig-lab/SKILL.md +4 -3
- package/.cursor/skills/figui3/SKILL.md +1 -1
- package/.cursor/skills/propkit/SKILL.md +1 -1
- package/README.md +26 -4
- package/components.css +26 -12
- package/dist/components.css +1 -1
- package/dist/fig-editor.css +1 -1
- package/dist/fig-editor.js +3 -3
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +2 -2
- package/dist/fig.css +1 -1
- package/dist/fig.js +4 -4
- package/fig-editor.css +4 -2
- package/fig-editor.js +139 -13
- package/fig-lab.css +23 -6
- package/fig-lab.js +494 -2
- package/fig.js +126 -12
- package/package.json +1 -1
|
@@ -128,7 +128,7 @@ Full fill editor. Core `fig-input-color` / `fig-input-fill` auto-open it when re
|
|
|
128
128
|
</fig-fill-picker>
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
Playground: `#fill-picker` — `all-modes`, `solid`, `gradient`, `image`, `video`, `webcam
|
|
131
|
+
Playground: `#fill-picker` — `all-modes`, `solid`, `gradient`, `image`, `video`, `webcam`, `shader` (custom `slot="mode-shader"`).
|
|
132
132
|
|
|
133
133
|
| Attr | Notes |
|
|
134
134
|
|---|---|
|
|
@@ -161,13 +161,12 @@ Do not use `picker` or `picker-anchor` on `fig-input-color`. Forward picker chro
|
|
|
161
161
|
### Custom modes (vanilla)
|
|
162
162
|
|
|
163
163
|
```html
|
|
164
|
-
<fig-fill
|
|
165
|
-
<fig-swatch></fig-swatch>
|
|
164
|
+
<fig-input-fill mode="solid,tokens" value='{"type":"tokens"}'>
|
|
166
165
|
<div slot="mode-tokens" label="Tokens">Token UI</div>
|
|
167
|
-
</fig-fill
|
|
166
|
+
</fig-input-fill>
|
|
168
167
|
```
|
|
169
168
|
|
|
170
|
-
Child `slot="mode-<name>"` plus `<name>` in `mode`. Custom content must dispatch `input` / `change` with `detail` so the picker stores mode data.
|
|
169
|
+
Child `slot="mode-<name>"` plus `<name>` in `mode`. `fig-input-fill` forwards those slots to the inner picker and uses image-style chrome (type label + opacity). Custom content must dispatch `input` / `change` with `detail` so the picker stores mode data.
|
|
171
170
|
|
|
172
171
|
### Custom modes (React)
|
|
173
172
|
|
|
@@ -49,8 +49,9 @@ Shared:
|
|
|
49
49
|
| Tag | Playground | Inner control | Notes |
|
|
50
50
|
|---|---|---|---|
|
|
51
51
|
| `propskit-switch` | `#propskit-switch` | `fig-switch` | `checked`, `default` boolean |
|
|
52
|
-
| `propskit-color` | `#propskit-color` | `fig-fill-picker` + `fig-swatch` | Solid swatch, same size as gradient.
|
|
53
|
-
| `propskit-
|
|
52
|
+
| `propskit-color` | `#propskit-color` | `fig-fill-picker` + `fig-swatch` | Solid swatch, same size as gradient. Clicking the field opens the picker. Focus ring on the field, not the swatch. `alpha` default true |
|
|
53
|
+
| `propskit-fill` | `#propskit-fill` | `fig-fill-picker` + `fig-swatch` | Same chrome as color. Clicking the field opens the picker. Focus ring on the field, not the swatch. Full fill JSON (`solid` / `gradient` / `image` / `video` / `webcam` / custom). Forwards `mode-*` slots |
|
|
54
|
+
| `propskit-gradient` | `#propskit-gradient` | `fig-input-gradient` | Default `edit="picker"`. Clicking the field opens the picker. Focus ring on the field, not the gradient. `mode="handle\|tip"` for inline edit |
|
|
54
55
|
| `propskit-select` | `#propskit-select` | `fig-select` | `options` or slotted `fig-select-options` |
|
|
55
56
|
| `propskit-text` | `#propskit-text` | `fig-input-text` | `type`, `readonly` |
|
|
56
57
|
| `propskit-number` | `#propskit-number` | `fig-input-number` | `min`, `max`, `step`, `precision`, `units`, `steppers` |
|
|
@@ -142,7 +143,7 @@ These are layout shells. Wire behavior yourself.
|
|
|
142
143
|
| Labeled exact number | `propskit-number` |
|
|
143
144
|
| Labeled text | `propskit-text` |
|
|
144
145
|
| Labeled discrete list | `propskit-select` (not `fig-dropdown`) |
|
|
145
|
-
| Labeled color / gradient | `propskit-color` / `propskit-gradient` |
|
|
146
|
+
| Labeled color / fill / gradient | `propskit-color` / `propskit-fill` / `propskit-gradient` |
|
|
146
147
|
| X/Y | `propskit-position` |
|
|
147
148
|
| Spatial on a canvas | `fig-canvas-control` |
|
|
148
149
|
| Angle | `fig-input-angle` |
|
|
@@ -138,7 +138,7 @@ Playground hashes: `/figui3#{id}`. Full attrs: [reference.md](reference.md).
|
|
|
138
138
|
| Tag | Playground | Notes |
|
|
139
139
|
|---|---|---|
|
|
140
140
|
| `fig-input-color` | (propkit `#color`) | Solid color. `text`, `alpha`. Auto-detects `fig-fill-picker` |
|
|
141
|
-
| `fig-input-fill` | `#fill-input` | Solid/gradient/image/video/webcam JSON `value`. Same `webcam` / `video.poster` shape as the picker. `webcam-mode`, `default-video`, `picker-*` forwarded if picker registered |
|
|
141
|
+
| `fig-input-fill` | `#fill-input` | Solid/gradient/image/video/webcam/custom JSON `value`. Custom `mode-*` slots forward to the inner picker and use image-style chrome. Same `webcam` / `video.poster` shape as the picker. `webcam-mode`, `default-video`, `picker-*` forwarded if picker registered |
|
|
142
142
|
| `fig-input-palette` | (propkit `#palette`) | Multi-color. `fixed`, `open` |
|
|
143
143
|
| `fig-input-gradient` | (propkit `#gradient`) | Stops. `edit`, `mode="handle\|tip"` |
|
|
144
144
|
| `fig-swatch` | `#swatch` | `size`, `selected`, `alpha` |
|
|
@@ -69,7 +69,7 @@ On `fig-*` and `<dialog is="fig-...">`, use `class` not `className`.
|
|
|
69
69
|
| Larger / rich list | `fig-select` (editor) | `propskit-select` |
|
|
70
70
|
| Native select only | `fig-dropdown` | — |
|
|
71
71
|
| Color | `fig-input-color` `text="true"` | `propskit-color` (fill-picker swatch) |
|
|
72
|
-
| Fill | `fig-input-fill` |
|
|
72
|
+
| Fill | `fig-input-fill` | `propskit-fill` (fill-picker swatch) |
|
|
73
73
|
| Gradient | `fig-input-gradient` | `propskit-gradient` |
|
|
74
74
|
| Image | `fig-image` `upload` | — |
|
|
75
75
|
| Easing | `fig-easing-curve` | — |
|
package/README.md
CHANGED
|
@@ -105,6 +105,7 @@ Minimal example:
|
|
|
105
105
|
| [Slider](#slider) | `<fig-slider>` | Range, hue, opacity, delta, stepper |
|
|
106
106
|
| [Propskit Slider](#propskit-slider) | `<propskit-slider>` | Labeled field + slider combo |
|
|
107
107
|
| [Propskit Color](#propskit-color) | `<propskit-color>` | Full-surface labeled color control |
|
|
108
|
+
| [Propskit Fill](#propskit-fill) | `<propskit-fill>` | Full-surface labeled fill control |
|
|
108
109
|
| [Propskit Gradient](#propskit-gradient) | `<propskit-gradient>` | Full-surface labeled gradient control |
|
|
109
110
|
| [Propskit Number](#propskit-number) | `<propskit-number>` | Full-surface labeled number control |
|
|
110
111
|
| [Propskit Position](#propskit-position) | `<propskit-position>` | Compact X/Y control |
|
|
@@ -392,7 +393,7 @@ Right-click and choose **Reset**, or call `resetToDefault()`, to restore `defaul
|
|
|
392
393
|
|
|
393
394
|
`<propskit-color>`
|
|
394
395
|
|
|
395
|
-
Composes a `<fig-field>` and a solid `fig-fill-picker` swatch into a full-surface property control. Clicking the
|
|
396
|
+
Composes a `<fig-field>` and a solid `fig-fill-picker` swatch into a full-surface property control. Clicking the field opens the color picker. There is no hex/opacity text field.
|
|
396
397
|
|
|
397
398
|
**Attributes:** `label`, `value`, `default`, `alpha`, `disabled`, `size`
|
|
398
399
|
|
|
@@ -401,7 +402,28 @@ Composes a `<fig-field>` and a solid `fig-fill-picker` swatch into a full-surfac
|
|
|
401
402
|
Right-click and choose **Reset**, or call `resetToDefault()`, to restore `default` or the initial color.
|
|
402
403
|
|
|
403
404
|
```html
|
|
404
|
-
<propskit-color label="
|
|
405
|
+
<propskit-color label="Background" value="#0D99FF" alpha="true"></propskit-color>
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
#### Propskit Fill
|
|
411
|
+
|
|
412
|
+
`<propskit-fill>`
|
|
413
|
+
|
|
414
|
+
Composes a `<fig-field>` and a `fig-fill-picker` swatch into a full-surface property control, same chrome as `propskit-color`. Clicking the field opens the fill picker for solid, gradient, image, video, webcam, and custom modes. There is no hex/opacity text field.
|
|
415
|
+
|
|
416
|
+
**Attributes:** `label`, `value` (fill JSON), `default`, `mode`, `alpha`, `webcam-mode`, `default-video`, `disabled`, `size`
|
|
417
|
+
|
|
418
|
+
**Events:** `input`, `change` — fill object in `event.detail` (`{ type, ... }`).
|
|
419
|
+
|
|
420
|
+
Right-click and choose **Reset**, or call `resetToDefault()`, to restore `default` or the initial fill. Slot `mode-*` children onto the host to add custom picker tabs.
|
|
421
|
+
|
|
422
|
+
```html
|
|
423
|
+
<propskit-fill
|
|
424
|
+
label="Fill"
|
|
425
|
+
value='{"type":"solid","color":"#0D99FF","alpha":1}'
|
|
426
|
+
></propskit-fill>
|
|
405
427
|
```
|
|
406
428
|
|
|
407
429
|
---
|
|
@@ -410,7 +432,7 @@ Right-click and choose **Reset**, or call `resetToDefault()`, to restore `defaul
|
|
|
410
432
|
|
|
411
433
|
`<propskit-gradient>`
|
|
412
434
|
|
|
413
|
-
Composes a `<fig-field>` and `<fig-input-gradient>` into a full-surface property control. Defaults to `edit="picker"` — click the
|
|
435
|
+
Composes a `<fig-field>` and `<fig-input-gradient>` into a full-surface property control. Defaults to `edit="picker"` — click the field to open the fill picker.
|
|
414
436
|
|
|
415
437
|
| Attribute | Type | Default | Description |
|
|
416
438
|
|---|---|---|---|
|
|
@@ -426,7 +448,7 @@ Composes a `<fig-field>` and `<fig-input-gradient>` into a full-surface property
|
|
|
426
448
|
|
|
427
449
|
**Methods and state:** `defaultValue`, `isDefault`, and `resetToDefault()`. JSON defaults use structural equality, so object key order does not affect dirty state.
|
|
428
450
|
|
|
429
|
-
Click the
|
|
451
|
+
Click the field to open the fill picker. With `edit="true"`, the first stop receives focus; Arrow keys move the selected stop, Shift+Arrow moves by 5%, Tab cycles stops, and Delete/Backspace removes a stop while preserving the two-stop minimum.
|
|
430
452
|
|
|
431
453
|
```html
|
|
432
454
|
<propskit-gradient
|
package/components.css
CHANGED
|
@@ -436,7 +436,7 @@
|
|
|
436
436
|
0px 10px 16px 0px light-dark(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.35)),
|
|
437
437
|
0px 2px 5px 0px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.35)),
|
|
438
438
|
inset 0px 0.5px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.08)),
|
|
439
|
-
inset 0px 0.75px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.
|
|
439
|
+
inset 0px 0.75px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.1));
|
|
440
440
|
|
|
441
441
|
--fig-popover-shadow:
|
|
442
442
|
drop-shadow(0px 1px 1.5px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)))
|
|
@@ -3166,7 +3166,6 @@ dialog[is="fig-popup"] {
|
|
|
3166
3166
|
position: sticky;
|
|
3167
3167
|
top: 0;
|
|
3168
3168
|
z-index: 2;
|
|
3169
|
-
background: var(--fig-popup-bg-color, var(--figma-color-bg));
|
|
3170
3169
|
}
|
|
3171
3170
|
|
|
3172
3171
|
&:has(> fig-header) {
|
|
@@ -3850,16 +3849,6 @@ fig-input-fill {
|
|
|
3850
3849
|
background-color: var(--figma-color-bg-secondary);
|
|
3851
3850
|
border-radius: var(--radius-medium);
|
|
3852
3851
|
box-shadow: none !important;
|
|
3853
|
-
&:focus,
|
|
3854
|
-
&:focus-within,
|
|
3855
|
-
&.has-popup-open {
|
|
3856
|
-
outline: var(--figma-focus-outline) !important;
|
|
3857
|
-
outline-offset: var(--figma-focus-outline-offset) !important;
|
|
3858
|
-
}
|
|
3859
|
-
&:hover {
|
|
3860
|
-
outline: 1px solid var(--figma-color-border);
|
|
3861
|
-
outline-offset: -1px !important;
|
|
3862
|
-
}
|
|
3863
3852
|
|
|
3864
3853
|
& > .input-combo > :is(fig-swatch, fig-chit):not(:only-child),
|
|
3865
3854
|
& > .input-combo > :is(fig-swatch, fig-chit):not(:only-child) input,
|
|
@@ -3928,6 +3917,20 @@ fig-input-fill {
|
|
|
3928
3917
|
}
|
|
3929
3918
|
}
|
|
3930
3919
|
|
|
3920
|
+
fig-input-color,
|
|
3921
|
+
fig-input-gradient {
|
|
3922
|
+
&:focus,
|
|
3923
|
+
&:focus-within,
|
|
3924
|
+
&.has-popup-open {
|
|
3925
|
+
outline: var(--figma-focus-outline) !important;
|
|
3926
|
+
outline-offset: var(--figma-focus-outline-offset) !important;
|
|
3927
|
+
}
|
|
3928
|
+
&:hover {
|
|
3929
|
+
outline: 1px solid var(--figma-color-border);
|
|
3930
|
+
outline-offset: -1px !important;
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3931
3934
|
fig-input-color,
|
|
3932
3935
|
fig-input-fill,
|
|
3933
3936
|
fig-input-text,
|
|
@@ -3936,6 +3939,17 @@ fig-input-number {
|
|
|
3936
3939
|
}
|
|
3937
3940
|
|
|
3938
3941
|
fig-input-fill {
|
|
3942
|
+
outline: none !important;
|
|
3943
|
+
|
|
3944
|
+
&:is(:hover, :focus, :focus-visible, :focus-within),
|
|
3945
|
+
&.has-popup-open {
|
|
3946
|
+
outline: none !important;
|
|
3947
|
+
}
|
|
3948
|
+
|
|
3949
|
+
& > [slot^="mode-"] {
|
|
3950
|
+
display: none;
|
|
3951
|
+
}
|
|
3952
|
+
|
|
3939
3953
|
& > .input-combo > fig-fill-picker {
|
|
3940
3954
|
display: contents;
|
|
3941
3955
|
}
|