@imfusion/web-ui 0.11.1-dev.59.g5c2572e2 → 0.11.1-dev.62.gfcd31b6e

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imfusion/web-ui",
3
- "version": "0.11.1-dev.59.g5c2572e2",
3
+ "version": "0.11.1-dev.62.gfcd31b6e",
4
4
  "description": "The official Web UI component library for ImFusion web apps",
5
5
  "author": "ImFusion GmbH",
6
6
  "homepage": "https://imfusion.com",
@@ -6666,6 +6666,148 @@
6666
6666
  },
6667
6667
  "subComponents": []
6668
6668
  },
6669
+ "image": {
6670
+ "root": {
6671
+ "name": "Image",
6672
+ "description": "Image — a picture box with one `<source>` per format (AVIF, then WebP) and an `<img>` fallback. The browser picks the\nformat and size. The box reserves `width` by `height` before the image arrives, pulses while it loads, and shows a\nglyph when it fails. Also called a photo, thumbnail or media.\n\n`ref` and every prop not named here reach the `<img>`.",
6673
+ "props": [
6674
+ {
6675
+ "name": "alt",
6676
+ "required": true,
6677
+ "type": "string",
6678
+ "defaultValue": null,
6679
+ "description": "Describes the image. Pass `\"\"` to mark it decorative."
6680
+ },
6681
+ {
6682
+ "name": "aspectRatio",
6683
+ "required": false,
6684
+ "type": "number",
6685
+ "defaultValue": null,
6686
+ "description": "Width divided by height of the box. Defaults to `width / height`; the picture crops or letterboxes per `fit`."
6687
+ },
6688
+ {
6689
+ "name": "avifSrcSet",
6690
+ "required": false,
6691
+ "type": "string",
6692
+ "defaultValue": null,
6693
+ "description": "AVIF candidates for the `<picture>`, offered before WebP."
6694
+ },
6695
+ {
6696
+ "name": "border",
6697
+ "required": false,
6698
+ "type": "\"none\" | \"single\" | null",
6699
+ "defaultValue": "none",
6700
+ "description": ""
6701
+ },
6702
+ {
6703
+ "name": "borderWidth",
6704
+ "required": false,
6705
+ "type": "1 | 2 | 3",
6706
+ "defaultValue": "1",
6707
+ "description": "Hairline width in `border-size` steps. Applies with `border=\"single\"`."
6708
+ },
6709
+ {
6710
+ "name": "className",
6711
+ "required": false,
6712
+ "type": "string",
6713
+ "defaultValue": null,
6714
+ "description": "Sizing and layout hook on the box around the picture."
6715
+ },
6716
+ {
6717
+ "name": "decoding",
6718
+ "required": false,
6719
+ "type": "\"auto\" | \"async\" | \"sync\"",
6720
+ "defaultValue": "async",
6721
+ "description": "`async` decodes off the main thread."
6722
+ },
6723
+ {
6724
+ "name": "fit",
6725
+ "required": false,
6726
+ "type": "\"cover\" | \"contain\" | null",
6727
+ "defaultValue": "cover",
6728
+ "description": ""
6729
+ },
6730
+ {
6731
+ "name": "height",
6732
+ "required": true,
6733
+ "type": "number",
6734
+ "defaultValue": null,
6735
+ "description": "Intrinsic height in pixels."
6736
+ },
6737
+ {
6738
+ "name": "loading",
6739
+ "required": false,
6740
+ "type": "\"lazy\" | \"eager\"",
6741
+ "defaultValue": "lazy",
6742
+ "description": "`lazy` defers the request until the image nears the viewport."
6743
+ },
6744
+ {
6745
+ "name": "priority",
6746
+ "required": false,
6747
+ "type": "boolean",
6748
+ "defaultValue": "false",
6749
+ "description": "Loads the image eagerly with high fetch priority. Set it on the page's largest image only."
6750
+ },
6751
+ {
6752
+ "name": "radius",
6753
+ "required": false,
6754
+ "type": "\"none\" | \"sm\" | \"md\" | \"lg\" | \"round\" | null",
6755
+ "defaultValue": "none",
6756
+ "description": ""
6757
+ },
6758
+ {
6759
+ "name": "ref",
6760
+ "required": false,
6761
+ "type": "Ref<HTMLImageElement>",
6762
+ "defaultValue": null,
6763
+ "description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}"
6764
+ },
6765
+ {
6766
+ "name": "sizes",
6767
+ "required": false,
6768
+ "type": "string",
6769
+ "defaultValue": null,
6770
+ "description": "Slot width the browser plans for, shared by both `<source>` elements and the `<img>`."
6771
+ },
6772
+ {
6773
+ "name": "src",
6774
+ "required": true,
6775
+ "type": "string",
6776
+ "defaultValue": null,
6777
+ "description": "Address of the fallback `<img>`."
6778
+ },
6779
+ {
6780
+ "name": "srcSet",
6781
+ "required": false,
6782
+ "type": "string",
6783
+ "defaultValue": null,
6784
+ "description": "Width candidates of the fallback `<img>`."
6785
+ },
6786
+ {
6787
+ "name": "style",
6788
+ "required": false,
6789
+ "type": "CSSProperties",
6790
+ "defaultValue": null,
6791
+ "description": "Sizing and layout hook on the box around the picture."
6792
+ },
6793
+ {
6794
+ "name": "webpSrcSet",
6795
+ "required": false,
6796
+ "type": "string",
6797
+ "defaultValue": null,
6798
+ "description": "WebP candidates for the `<picture>`, offered after AVIF."
6799
+ },
6800
+ {
6801
+ "name": "width",
6802
+ "required": true,
6803
+ "type": "number",
6804
+ "defaultValue": null,
6805
+ "description": "Intrinsic width in pixels. Together with `height` it reserves the box before the image loads."
6806
+ }
6807
+ ]
6808
+ },
6809
+ "subComponents": []
6810
+ },
6669
6811
  "input": {
6670
6812
  "root": {
6671
6813
  "name": "Input",
@@ -140,6 +140,11 @@ Renders a Web UI icon with an optional semantic foreground color. The default in
140
140
  Square button that shows a single icon and no visible text, with its accessible name from `label`. Also called an icon-only or toolbar button. Use Button with `startIcon` or `endIcon` when a text label is visible.
141
141
  - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .icon-button (jq: jq '.icon-button' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
142
142
 
143
+ ## Image
144
+ - category: Display, status: experimental
145
+ Picture with AVIF and WebP sources, reserved space, lazy loading, and a fallback while it loads or when it fails. Also called a photo, thumbnail or media. Use Avatar for a person and Card.Image for a card's edge-to-edge slot.
146
+ - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .image (jq: jq '.image' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
147
+
143
148
  ## ImageDisplayOptions
144
149
  - category: Inputs, status: experimental
145
150
  Panel and toolbar controls for an image dataset's display options, including window, level, gamma, and invert settings.
@@ -32,6 +32,10 @@ floor.
32
32
  </picture>
33
33
  ```
34
34
 
35
+ `Image` from `@imfusion/web-ui` renders this `<picture>` from `avifSrcSet`, `webpSrcSet`, `srcSet`, `sizes`, `width`,
36
+ `height` and `alt`. It adds lazy loading and async decoding, a pulse while the image loads and a glyph when it fails. Use it
37
+ for content images instead of writing the `<picture>` by hand.
38
+
35
39
  ## Loading
36
40
 
37
41
  Every `<img>` carries `width` and `height` in the source's aspect ratio, so the browser reserves its space before it loads.