@rogieking/figui3 6.32.2 → 6.33.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 CHANGED
@@ -1339,6 +1339,7 @@ Unified media component that supports image/video modes and shared sizing/upload
1339
1339
  | `src` | string | — | Media URL |
1340
1340
  | `alt` | string | `""` | Alt text forwarded to the generated `<img>` (image mode) |
1341
1341
  | `upload` | boolean | `false` | Show upload overlay (`fig-input-file`) |
1342
+ | `loading-indicator` | boolean | `true` | Set to `"false"` to disable the delayed loading spinner for generated images |
1342
1343
  | `label` | string | `"Upload"` | Upload button label |
1343
1344
  | `size` | string | — | `small` \| `medium` \| `large` \| `auto` (token-sized square) |
1344
1345
  | `aspect-ratio` | string | — | CSS aspect-ratio (e.g. `"16 / 9"`); fills container width |
@@ -1365,6 +1366,10 @@ Use meaningful `alt` text for informative images. Use `alt=""` only when the ima
1365
1366
 
1366
1367
  Use the `caption` attribute for a plain-text caption, or a direct `<figcaption>` child for authored caption content.
1367
1368
 
1369
+ Native load lifecycle events are re-emitted from the `fig-media` host as bubbling, composed `CustomEvent`s. Image mode emits `load` and `error`. Video mode forwards `loadstart`, `progress`, `suspend`, `abort`, `error`, `emptied`, `stalled`, `loadedmetadata`, `loadeddata`, `canplay`, `canplaythrough`, `playing`, `waiting`, `seeking`, `seeked`, `durationchange`, `timeupdate`, `ratechange`, `resize`, and `volumechange`; existing `play`, `pause`, and `ended` events remain available. Event `detail` includes `src`, `media`, and `originalEvent`, plus video timing and readiness state.
1370
+
1371
+ For generated images, a spinner appears when loading exceeds 150ms and is removed on `load` or `error`. The host reflects `aria-busy="true"` while pending. Authored media or preview content does not receive an automatic spinner.
1372
+
1368
1373
  ---
1369
1374
 
1370
1375
  #### Image
@@ -1378,6 +1383,7 @@ An image display component with optional upload, aspect ratio, and object-fit co
1378
1383
  | `src` | string | — | Image URL |
1379
1384
  | `alt` | string | `""` | Alt text forwarded to the generated `<img>` |
1380
1385
  | `upload` | boolean | `false` | Show upload overlay (`fig-input-file`) |
1386
+ | `loading-indicator` | boolean | `true` | Set to `"false"` to disable the delayed loading spinner |
1381
1387
  | `label` | string | `"Upload"` | Upload button label |
1382
1388
  | `size` | string | — | `small` \| `medium` \| `large` \| `auto` (token-sized square) |
1383
1389
  | `aspect-ratio` | string | — | CSS aspect-ratio (e.g. `"16 / 9"`); fills container width |
@@ -1387,6 +1393,8 @@ An image display component with optional upload, aspect ratio, and object-fit co
1387
1393
 
1388
1394
  Use meaningful `alt` text for informative images. Use `alt=""` for decorative previews, thumbnails with visible labels, or upload placeholders.
1389
1395
 
1396
+ The generated image's native `load` and `error` events are re-emitted from `fig-image` as bubbling, composed `CustomEvent`s with `src`, `media`, and `originalEvent` in `event.detail`.
1397
+
1390
1398
  ```html
1391
1399
  <fig-image src="photo.jpg" alt="Selected image"></fig-image>
1392
1400
  <fig-image src="photo.jpg" alt="Cover image" aspect-ratio="16 / 9" fit="cover" caption="Cover image"></fig-image>
package/components.css CHANGED
@@ -1609,6 +1609,13 @@ fig-video {
1609
1609
  z-index: 0;
1610
1610
  }
1611
1611
 
1612
+ > fig-spinner[slot="overlay"][data-loading-indicator][data-generated] {
1613
+ place-self: center;
1614
+ z-index: 1;
1615
+ opacity: 1;
1616
+ pointer-events: none;
1617
+ }
1618
+
1612
1619
  &:is(:not([src]), [src=""]):is(:not([poster]), [poster=""])
1613
1620
  > fig-preview > video.fig-media-element[data-generated] {
1614
1621
  opacity: 0;
@@ -1628,7 +1635,7 @@ fig-video {
1628
1635
  z-index: 2;
1629
1636
  max-width: calc(100% - var(--spacer-4));
1630
1637
  }
1631
- &:not(:has(> fig-preview > img.fig-media-element[data-generated][src]:not([src=""]))) > fig-preview > fig-input-file:is([data-generated], [variant="overlay"]),
1638
+ &:not(:has(> fig-preview > :is(img, video).fig-media-element[data-generated][src]:not([src=""]))) > fig-preview > fig-input-file:is([data-generated], [variant="overlay"]),
1632
1639
  > fig-preview:hover > fig-input-file:is([data-generated], [variant="overlay"]),
1633
1640
  > fig-preview:focus-within > fig-input-file:is([data-generated], [variant="overlay"]) {
1634
1641
  opacity: 1;
@@ -1643,7 +1650,7 @@ fig-video {
1643
1650
  max-width: calc(100% - var(--spacer-4));
1644
1651
  }
1645
1652
 
1646
- &:not(:has(> fig-preview > img.fig-media-element[data-generated][src]:not([src=""]))) > :is([slot="overlay"], fig-input-file[variant="overlay"]),
1653
+ &:not(:has(> fig-preview > :is(img, video).fig-media-element[data-generated][src]:not([src=""]))) > :is([slot="overlay"], fig-input-file[variant="overlay"]),
1647
1654
  &:has(> fig-preview:hover) > :is([slot="overlay"], fig-input-file[variant="overlay"]),
1648
1655
  &:has(> fig-preview:focus-within) > :is([slot="overlay"], fig-input-file[variant="overlay"]),
1649
1656
  &:has(> [slot="overlay"]:is(:focus, :focus-within, :active)) > [slot="overlay"],