@rogieking/figui3 8.9.15 → 8.9.17

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.
@@ -136,20 +136,24 @@ Playground: `#fill-picker` — `all-modes`, `solid`, `gradient`, `image`, `video
136
136
  | `alpha` | `"true"` default; hide alpha with `"false"` |
137
137
  | `mode` | Lock modes: `solid`, `gradient`, `image`, `video`, `webcam`, comma-separated, plus custom names |
138
138
  | `disabled` | Presence |
139
+ | `webcam-mode` | `live` (default) or `snapshot`. Webcam tab starts the camera. Capture writes a still and switches to Image |
140
+ | `default-video` | Sample clip URL when Video has no file |
139
141
 
140
- Events: `input` / `change` with fill payload in `detail`.
142
+ Events: `input` / `change` with fill payload in `detail`. `webcamstream` with `{ stream, deviceId }`. Live camera is `webcamStream` / `releaseWebcam()`, never JSON.
141
143
 
142
144
  Value shapes:
143
145
 
144
146
  ```txt
145
147
  solid { type, colorSpace, color, alpha, hsv }
146
148
  gradient { type, colorSpace, gradient, css }
147
- image { type, colorSpace, image }
148
- video { type, colorSpace, video }
149
- webcam { type, colorSpace, image: { url: snapshot, scaleMode, scale } }
149
+ image { type, colorSpace, image: { url, scaleMode, scale } } // scaleMode includes tile
150
+ video { type, colorSpace, video: { url, poster, scaleMode, scale, opacity } } // fill | fit | crop
151
+ webcam { type, colorSpace, webcam: { live, snapshot, deviceId, scaleMode, scale, opacity } }
150
152
  custom { type: <modeName>, ...payload }
151
153
  ```
152
154
 
155
+ Legacy `{ type: "webcam", image: { url } }` still parses as `webcam.snapshot` for one release. `fig-input-fill` uses the same `webcam` / `video.poster` shapes.
156
+
153
157
  `fig-input-color` expects solid data (`detail.color`, optional `detail.alpha`). Keep legacy `value` / `hex` / `rgba` on color input events.
154
158
 
155
159
  Do not use `picker` or `picker-anchor` on `fig-input-color`. Forward picker chrome with `picker-*` (e.g. `picker-dialog-position`).
@@ -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 JSON `value`. `picker-*` forwarded if picker registered |
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 |
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` |
@@ -154,7 +154,7 @@ Playground hashes: `/figui3#{id}`. Full attrs: [reference.md](reference.md).
154
154
  | `fig-header` / `fig-footer` / `fig-content` | (containers) | Header: `borderless`, `compact`. Footer: `sticky` |
155
155
  | `fig-tabs` / `fig-tab` | `#tabs` | Roving tabs. `content="#id"` for panels |
156
156
  | `fig-segmented-control` / `fig-segment` | `#segmented-control` | Radio-group pattern |
157
- | `fig-chooser` / `fig-choice` | (containers) | Listbox selection |
157
+ | `fig-chooser` / `fig-choice` | `#chooser` | Listbox. Omit `value` to select first; `value=""` means none. |
158
158
  | `fig-separator` / `fig-menu-separator` | `#separator` | Optional `label`, `sticky`, `borderless` |
159
159
  | `fig-menu` / `fig-menu-item` | `#menu` | `fig-menu-trigger`, `trigger="contextmenu"`, `position`, `offset`. Item also works in `fig-popup` (sticky separators, nested row menus). |
160
160
  | `fig-icon` | `#icon` | Token mask (`name`, `size="small"`, `color`) |
package/README.md CHANGED
@@ -939,7 +939,7 @@ Supported interpolation spaces: `srgb`, `srgb-linear`, `display-p3`, `oklab`, `o
939
939
 
940
940
  `<fig-input-fill>` — [demo](https://rog.ie/figui3/#fill-input)
941
941
 
942
- A comprehensive fill input supporting solid, gradient, image, and video fills. Without the optional picker, it renders a passive preview.
942
+ A comprehensive fill input supporting solid, gradient, image, video, and webcam fills. Without the optional picker, it renders a passive preview.
943
943
 
944
944
  | Attribute | Type | Default | Description |
945
945
  |---|---|---|---|
@@ -947,16 +947,21 @@ A comprehensive fill input supporting solid, gradient, image, and video fills. W
947
947
  | `disabled` | boolean | `false` | Disabled state |
948
948
  | `mode` | string | — | Lock to a fill mode |
949
949
  | `alpha` | boolean | `true` | Show alpha controls |
950
+ | `webcam-mode` | string | `live` | Forwarded to the picker: `live` or `snapshot` |
951
+ | `default-video` | string | — | Forwarded sample clip URL when Video has no file |
950
952
  | `picker-*` | string | — | Forwarded to `<fig-fill-picker>` when the optional picker is registered |
951
953
 
952
954
  Add `aria-label` to name the generated picker, hex field, and opacity field as one fill control group.
953
955
 
956
+ Solid `alpha` is 0–1 (canonical). `opacity` 0–100 is also emitted for compatibility. Gradient values include `css`. Webcam JSON is `{ type, webcam }` — never a live `MediaStream`. Read `webcamStream` or listen for `webcamstream`. Video swatches use `video.poster`, not the mp4 URL.
957
+
954
958
  **Events:**
955
959
 
956
960
  | Event | Detail |
957
961
  |---|---|
958
- | `input` | `{ type, color?, gradient?, image?, video?, css }` |
959
- | `change` | `{ type, color?, gradient?, image?, video?, css }` |
962
+ | `input` | `{ type, color?, gradient?, image?, video?, webcam?, css }` |
963
+ | `change` | `{ type, color?, gradient?, image?, video?, webcam?, css }` |
964
+ | `webcamstream` | `{ stream, deviceId }` |
960
965
 
961
966
  ```html
962
967
  <fig-input-fill value='{"type":"solid","color":"#FF5733","opacity":100}'></fig-input-fill>
@@ -976,13 +981,18 @@ Optional full fill picker dialog supporting solid, gradient, image, video, and w
976
981
  | `disabled` | boolean | `false` | Disabled state |
977
982
  | `alpha` | boolean | `true` | Show alpha controls |
978
983
  | `mode` | string | — | Lock to mode: `"solid"`, `"gradient"`, `"image"`, `"video"`, `"webcam"` |
984
+ | `webcam-mode` | string | `live` | `live` keeps the camera after close; Capture always writes an image still |
985
+ | `default-video` | string | — | Sample clip URL when Video is selected with no file |
986
+
987
+ Webcam JSON is `{ type: "webcam", webcam: { live, snapshot, deviceId, scaleMode, scale, opacity } }`. The live `MediaStream` is `webcamStream` / `webcamstream`, not `value`. Closing the dialog does not stop a live camera; call `releaseWebcam()` or disconnect the element. Capture in `live` mode only updates `webcam.snapshot`. Video JSON includes `poster`; the swatch paints that, never `url(file.mp4)`.
979
988
 
980
989
  **Events:**
981
990
 
982
991
  | Event | Detail |
983
992
  |---|---|
984
- | `input` | `{ type, gradient?, color?, css }` |
985
- | `change` | `{ type, gradient?, color?, css }` |
993
+ | `input` | `{ type, gradient?, color?, image?, video?, webcam?, css }` |
994
+ | `change` | `{ type, gradient?, color?, image?, video?, webcam?, css }` |
995
+ | `webcamstream` | `{ stream, deviceId }` |
986
996
 
987
997
  ```html
988
998
  <fig-fill-picker value='{"type":"solid","color":"#FF5733"}'>
@@ -1053,7 +1063,7 @@ When app code rebuilds a chooser by setting `fig-chooser.innerHTML`, the chooser
1053
1063
 
1054
1064
  | Attribute | Type | Default | Description |
1055
1065
  |---|---|---|---|
1056
- | `value` | string | — | Selected choice value |
1066
+ | `value` | string | — | Selected choice value. Omit to select the first choice; `value=""` means none. |
1057
1067
  | `choice-element` | string | `"fig-choice"` | CSS selector for child choices |
1058
1068
  | `layout` | string | `"vertical"` | `"vertical"`, `"horizontal"`, `"grid"` |
1059
1069
  | `columns` | number | `2` | Grid column count when `layout="grid"` |
package/components.css CHANGED
@@ -5312,7 +5312,9 @@ fig-choice {
5312
5312
  content: "";
5313
5313
  position: absolute;
5314
5314
  inset: 0;
5315
- border-radius: var(--fig-choice-border-radius);
5315
+ border-radius: calc(
5316
+ var(--fig-choice-border-radius) + var(--fig-choice-selection-ring-width)
5317
+ );
5316
5318
  pointer-events: none;
5317
5319
  z-index: 1;
5318
5320
  box-shadow: inset 0 0 0 calc(var(--fig-choice-selection-ring-width)*2) var(--figma-color-bg);