@rogieking/figui3 6.28.1 → 6.29.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/README.md +39 -5
- 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 +114 -14
- package/fig-lab.js +288 -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 |
|
|
@@ -304,7 +305,8 @@ For `type="range"`, omitting `value` follows native range behavior and starts at
|
|
|
304
305
|
|
|
305
306
|
Composes a `<fig-field>` and `<fig-input-number>` into a full-surface property control. Number attributes are forwarded to the inner input.
|
|
306
307
|
|
|
307
|
-
PropsKit controls
|
|
308
|
+
PropsKit controls use the compact default layout when `size` is omitted. Set
|
|
309
|
+
`size="large"` for the 40px row layout.
|
|
308
310
|
|
|
309
311
|
All PropsKit inputs expose `defaultValue`, `isDefault`, and `resetToDefault()`. A
|
|
310
312
|
`propskit-group` uses this shared contract to track its `dirty` state and reset
|
|
@@ -314,7 +316,7 @@ each nested input to its own current `default`.
|
|
|
314
316
|
|---|---|---|---|
|
|
315
317
|
| `label` | string | `"Label"` | Field label text; use an empty value to hide it |
|
|
316
318
|
| `direction` | string | `"horizontal"` | Field layout direction |
|
|
317
|
-
| `size` | string | `"large"`
|
|
319
|
+
| `size` | string | default | Set to `"large"` for the expanded layout |
|
|
318
320
|
| `default` | number/string | initial `value` | Right-click reset target |
|
|
319
321
|
| *number attrs* | — | — | All `<fig-input-number>` attributes are forwarded |
|
|
320
322
|
|
|
@@ -346,6 +348,38 @@ Right-click and choose **Reset**, or call `resetToDefault()`, to restore `defaul
|
|
|
346
348
|
|
|
347
349
|
---
|
|
348
350
|
|
|
351
|
+
#### Propskit Gradient
|
|
352
|
+
|
|
353
|
+
`<propskit-gradient>`
|
|
354
|
+
|
|
355
|
+
Composes a `<fig-field>` and `<fig-input-gradient>` into a full-surface property control. The gradient is inline-editable by default.
|
|
356
|
+
|
|
357
|
+
| Attribute | Type | Default | Description |
|
|
358
|
+
|---|---|---|---|
|
|
359
|
+
| `label` | string | `"Label"` | Field label text; use an empty value to hide it |
|
|
360
|
+
| `value` | JSON string | default gradient | Canonical `{ "type": "gradient", "gradient": { ... } }` data |
|
|
361
|
+
| `default` | JSON string | initial `value` | Right-click and group reset target |
|
|
362
|
+
| `edit` | boolean/string | `true` | `true`, `false`, or `"picker"` |
|
|
363
|
+
| `mode` | string | `"handle"` | `"handle"` or `"tip"` stop presentation |
|
|
364
|
+
| `disabled` | boolean | `false` | Disabled state |
|
|
365
|
+
| `size` | string | default | Set to `"large"` for the expanded layout |
|
|
366
|
+
|
|
367
|
+
**Events:** `input`, `change` — bubbling, composed events with `{ type: "gradient", gradient }` in `event.detail`.
|
|
368
|
+
|
|
369
|
+
**Methods and state:** `defaultValue`, `isDefault`, and `resetToDefault()`. JSON defaults use structural equality, so object key order does not affect dirty state.
|
|
370
|
+
|
|
371
|
+
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.
|
|
372
|
+
|
|
373
|
+
```html
|
|
374
|
+
<propskit-gradient
|
|
375
|
+
label="Fill"
|
|
376
|
+
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}]}}'
|
|
377
|
+
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}]}}'
|
|
378
|
+
></propskit-gradient>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
349
383
|
#### Propskit Switch
|
|
350
384
|
|
|
351
385
|
`<propskit-switch>`
|
|
@@ -410,7 +444,7 @@ Wraps a `<fig-field>` and `<fig-slider>` into a single labeled control. All slid
|
|
|
410
444
|
|---|---|---|---|
|
|
411
445
|
| `label` | string | — | Field label text |
|
|
412
446
|
| `direction` | string | `"column"` | Layout direction |
|
|
413
|
-
| `size` | string | `"large"`
|
|
447
|
+
| `size` | string | default | Set to `"large"` for the expanded layout |
|
|
414
448
|
| `default` | number/string | initial `value` | Double-click and right-click reset target |
|
|
415
449
|
| *slider attrs* | — | — | All `<fig-slider>` attributes except host-only PropsKit attributes are forwarded |
|
|
416
450
|
|
|
@@ -671,8 +705,8 @@ Supported interpolation spaces: `srgb`, `srgb-linear`, `display-p3`, `oklab`, `o
|
|
|
671
705
|
|
|
672
706
|
| Event | Detail |
|
|
673
707
|
|---|---|
|
|
674
|
-
| `input` | `{ type, gradient
|
|
675
|
-
| `change` | `{ type, gradient
|
|
708
|
+
| `input` | `{ type, gradient }` |
|
|
709
|
+
| `change` | `{ type, gradient }` |
|
|
676
710
|
|
|
677
711
|
```html
|
|
678
712
|
<fig-input-gradient
|