@rogieking/figui3 8.9.19 → 8.9.21

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.
@@ -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. Opens the fill picker. `alpha` default true |
53
- | `propskit-gradient` | `#propskit-gradient` | `fig-input-gradient` | Default `edit="picker"`. `mode="handle\|tip"` for inline edit |
52
+ | `propskit-color` | `#propskit-color` | `fig-fill-picker` + `fig-swatch` | Solid swatch, same size as gradient. Clicking the field opens the picker anchored to the host. 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 anchored to the host. 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 anchored to the host. 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` |
@@ -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 swatch opens the color picker. There is no hex/opacity text field.
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="Fill" value="#0D99FF" alpha="true"></propskit-color>
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 swatch to open the fill picker.
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 swatch 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.
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
@@ -1369,6 +1369,10 @@ input[type="color"] {
1369
1369
  outline-offset: var(--figma-focus-outline-offset);
1370
1370
  }
1371
1371
 
1372
+ :is(fig-swatch, fig-chit):focus-within:not(:focus) & {
1373
+ outline: 0;
1374
+ }
1375
+
1372
1376
  &::-webkit-color-swatch-wrapper {
1373
1377
  padding: 0;
1374
1378
  border: 0;
@@ -1514,6 +1518,16 @@ input[type="color"] {
1514
1518
  &[size="large"]::before {
1515
1519
  border-radius: calc(var(--border-radius) - var(--padding));
1516
1520
  }
1521
+ &:focus,
1522
+ &:active {
1523
+ outline: var(--figma-focus-outline);
1524
+ outline-offset: var(--figma-focus-outline-offset);
1525
+ }
1526
+
1527
+ &:focus-within:not(:focus) {
1528
+ outline: 0;
1529
+ }
1530
+
1517
1531
  input[type="color"] {
1518
1532
  background: none;
1519
1533
  width: var(--width);
@@ -1522,6 +1536,11 @@ input[type="color"] {
1522
1536
  place-self: center;
1523
1537
  box-sizing: border-box;
1524
1538
  opacity: 0;
1539
+
1540
+ &:focus,
1541
+ &:focus-visible {
1542
+ outline: 0;
1543
+ }
1525
1544
  }
1526
1545
 
1527
1546
  /* Gradient/Image types - inset thumbnail with hidden input */
@@ -3849,16 +3868,6 @@ fig-input-fill {
3849
3868
  background-color: var(--figma-color-bg-secondary);
3850
3869
  border-radius: var(--radius-medium);
3851
3870
  box-shadow: none !important;
3852
- &:focus,
3853
- &:focus-within,
3854
- &.has-popup-open {
3855
- outline: var(--figma-focus-outline) !important;
3856
- outline-offset: var(--figma-focus-outline-offset) !important;
3857
- }
3858
- &:hover {
3859
- outline: 1px solid var(--figma-color-border);
3860
- outline-offset: -1px !important;
3861
- }
3862
3871
 
3863
3872
  & > .input-combo > :is(fig-swatch, fig-chit):not(:only-child),
3864
3873
  & > .input-combo > :is(fig-swatch, fig-chit):not(:only-child) input,
@@ -3927,6 +3936,20 @@ fig-input-fill {
3927
3936
  }
3928
3937
  }
3929
3938
 
3939
+ fig-input-color,
3940
+ fig-input-gradient {
3941
+ &:focus,
3942
+ &:focus-within,
3943
+ &.has-popup-open {
3944
+ outline: var(--figma-focus-outline) !important;
3945
+ outline-offset: var(--figma-focus-outline-offset) !important;
3946
+ }
3947
+ &:hover {
3948
+ outline: 1px solid var(--figma-color-border);
3949
+ outline-offset: -1px !important;
3950
+ }
3951
+ }
3952
+
3930
3953
  fig-input-color,
3931
3954
  fig-input-fill,
3932
3955
  fig-input-text,
@@ -3935,6 +3958,13 @@ fig-input-number {
3935
3958
  }
3936
3959
 
3937
3960
  fig-input-fill {
3961
+ outline: none !important;
3962
+
3963
+ &:is(:hover, :focus, :focus-visible, :focus-within),
3964
+ &.has-popup-open {
3965
+ outline: none !important;
3966
+ }
3967
+
3938
3968
  & > [slot^="mode-"] {
3939
3969
  display: none;
3940
3970
  }