@rogieking/figui3 6.28.0 → 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 +15 -3
- 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/dist/fig.js +32 -32
- package/fig-lab.css +81 -0
- package/fig-lab.js +291 -0
- package/fig.js +13 -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
|
package/components.css
CHANGED
|
@@ -3843,14 +3843,14 @@ fig-input-gradient {
|
|
|
3843
3843
|
--fig-input-gradient-swatch-border-radius: var(--radius-medium);
|
|
3844
3844
|
}
|
|
3845
3845
|
|
|
3846
|
-
&[edit="false"]
|
|
3847
|
-
&[edit="picker"] {
|
|
3846
|
+
&[edit="false"] {
|
|
3848
3847
|
pointer-events: none;
|
|
3849
3848
|
--fig-input-gradient-swatch-border-radius: var(--radius-medium);
|
|
3850
|
-
|
|
3851
3849
|
}
|
|
3852
3850
|
|
|
3853
3851
|
&[edit="picker"] {
|
|
3852
|
+
--fig-input-gradient-swatch-border-radius: var(--radius-medium);
|
|
3853
|
+
|
|
3854
3854
|
& > fig-fill-picker {
|
|
3855
3855
|
display: contents;
|
|
3856
3856
|
}
|
|
@@ -3869,6 +3869,9 @@ fig-input-gradient {
|
|
|
3869
3869
|
.fig-input-gradient-track {
|
|
3870
3870
|
inset: 0;
|
|
3871
3871
|
}
|
|
3872
|
+
> fig-swatch{
|
|
3873
|
+
--size: var(--fig-input-gradient-height);
|
|
3874
|
+
}
|
|
3872
3875
|
}
|
|
3873
3876
|
|
|
3874
3877
|
.fig-input-gradient-track {
|
|
@@ -4040,6 +4043,7 @@ fig-field {
|
|
|
4040
4043
|
--fig-field-right-padding: var(--spacer-3);
|
|
4041
4044
|
--fig-field-top-padding: var(--spacer-1);
|
|
4042
4045
|
--fig-field-bottom-padding: var(--spacer-1);
|
|
4046
|
+
--fig-field-label-max-height: var(--spacer-5);
|
|
4043
4047
|
--fig-field-label-ratio: 1fr;
|
|
4044
4048
|
--fig-field-input-ratio: 2fr;
|
|
4045
4049
|
display: grid;
|
|
@@ -4120,6 +4124,14 @@ fig-field {
|
|
|
4120
4124
|
min-width: 0;
|
|
4121
4125
|
}
|
|
4122
4126
|
|
|
4127
|
+
&:not([direction="vertical"]) > label {
|
|
4128
|
+
align-self: start;
|
|
4129
|
+
align-content: center;
|
|
4130
|
+
box-sizing: border-box;
|
|
4131
|
+
height: min(100%, var(--fig-field-label-max-height));
|
|
4132
|
+
padding-block: 0;
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4123
4135
|
& > *:not(.fig-field-chevron):not(label) {
|
|
4124
4136
|
grid-area: input;
|
|
4125
4137
|
}
|