@rogieking/figui3 6.28.1 → 6.29.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/README.md +35 -2
- package/components.css +3 -0
- package/dist/components.css +1 -1
- package/dist/fig-editor.css +1 -1
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +6 -6
- package/dist/fig.css +1 -1
- package/fig-lab.css +81 -0
- package/fig-lab.js +291 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,6 +90,7 @@ Minimal example:
|
|
|
90
90
|
| [Slider](#slider) | `<fig-slider>` | Range, hue, opacity, delta, stepper |
|
|
91
91
|
| [Propskit Slider](#propskit-slider) | `<propskit-slider>` | Labeled field + slider combo |
|
|
92
92
|
| [Propskit Color](#propskit-color) | `<propskit-color>` | Full-surface labeled color control |
|
|
93
|
+
| [Propskit Gradient](#propskit-gradient) | `<propskit-gradient>` | Full-surface labeled gradient control |
|
|
93
94
|
| [Propskit Number](#propskit-number) | `<propskit-number>` | Full-surface labeled number control |
|
|
94
95
|
| [Propskit Select](#propskit-select) | `<propskit-select>` | Full-surface labeled select control |
|
|
95
96
|
| [Propskit Switch](#propskit-switch) | `<propskit-switch>` | Full-surface labeled switch control |
|
|
@@ -346,6 +347,38 @@ Right-click and choose **Reset**, or call `resetToDefault()`, to restore `defaul
|
|
|
346
347
|
|
|
347
348
|
---
|
|
348
349
|
|
|
350
|
+
#### Propskit Gradient
|
|
351
|
+
|
|
352
|
+
`<propskit-gradient>`
|
|
353
|
+
|
|
354
|
+
Composes a `<fig-field>` and `<fig-input-gradient>` into a full-surface property control. The gradient is inline-editable by default.
|
|
355
|
+
|
|
356
|
+
| Attribute | Type | Default | Description |
|
|
357
|
+
|---|---|---|---|
|
|
358
|
+
| `label` | string | `"Label"` | Field label text; use an empty value to hide it |
|
|
359
|
+
| `value` | JSON string | default gradient | Canonical `{ "type": "gradient", "gradient": { ... } }` data |
|
|
360
|
+
| `default` | JSON string | initial `value` | Right-click and group reset target |
|
|
361
|
+
| `edit` | boolean/string | `true` | `true`, `false`, or `"picker"` |
|
|
362
|
+
| `mode` | string | `"handle"` | `"handle"` or `"tip"` stop presentation |
|
|
363
|
+
| `disabled` | boolean | `false` | Disabled state |
|
|
364
|
+
| `size` | string | `"large"` | Control layout size |
|
|
365
|
+
|
|
366
|
+
**Events:** `input`, `change` — bubbling, composed events with `{ type: "gradient", gradient }` in `event.detail`.
|
|
367
|
+
|
|
368
|
+
**Methods and state:** `defaultValue`, `isDefault`, and `resetToDefault()`. JSON defaults use structural equality, so object key order does not affect dirty state.
|
|
369
|
+
|
|
370
|
+
The first stop receives focus when the field is focused. 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.
|
|
371
|
+
|
|
372
|
+
```html
|
|
373
|
+
<propskit-gradient
|
|
374
|
+
label="Fill"
|
|
375
|
+
value='{"type":"gradient","gradient":{"type":"linear","angle":90,"interpolationSpace":"srgb","hueInterpolation":"shorter","stops":[{"position":0,"color":"#0D99FF","opacity":100},{"position":100,"color":"#9747FF","opacity":100}]}}'
|
|
376
|
+
default='{"type":"gradient","gradient":{"type":"linear","angle":90,"interpolationSpace":"srgb","hueInterpolation":"shorter","stops":[{"position":0,"color":"#0D99FF","opacity":100},{"position":100,"color":"#9747FF","opacity":100}]}}'
|
|
377
|
+
></propskit-gradient>
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
349
382
|
#### Propskit Switch
|
|
350
383
|
|
|
351
384
|
`<propskit-switch>`
|
|
@@ -671,8 +704,8 @@ Supported interpolation spaces: `srgb`, `srgb-linear`, `display-p3`, `oklab`, `o
|
|
|
671
704
|
|
|
672
705
|
| Event | Detail |
|
|
673
706
|
|---|---|
|
|
674
|
-
| `input` | `{ type, gradient
|
|
675
|
-
| `change` | `{ type, gradient
|
|
707
|
+
| `input` | `{ type, gradient }` |
|
|
708
|
+
| `change` | `{ type, gradient }` |
|
|
676
709
|
|
|
677
710
|
```html
|
|
678
711
|
<fig-input-gradient
|