@imfusion/web-ui 0.11.1-dev.44.gad806324 → 0.11.1-dev.47.g23180a23

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/CHANGELOG.md CHANGED
@@ -74,7 +74,11 @@
74
74
  - `imf-web-ui-conventions` exempts React components from the explicit return type on exported functions.
75
75
  - The `project-structure` topic keeps a route's only view, such as a form, in the route file and moves views to the `-`
76
76
  folder only when the page composes several. `imf-web-ui-audit` reports by views, not line counts.
77
- - The `imf-web-ui-conventions` audit checklist names the assets box "Photographs: WebP", like its topic heading.
77
+ - The `imf-web-ui-conventions` `assets` topic encodes photographs as AVIF and WebP at 800 and 1600px and renders them
78
+ through `<picture>` with `srcSet` and `sizes`. Every `<img>` has `width` and `height`, below-the-fold images load
79
+ lazily, and only the largest paint gets `fetchpriority="high"`.
80
+ - The `imf-web-ui-conventions` `components` topic names the landmarks `AppShell` renders and asks for one `Typo.H1` per
81
+ page, `Button` for actions, and `Link` for destinations.
78
82
  - `web-ui-dev-new-component`, `web-ui-dev-update-component`, and `web-ui-dev-design-component` draft on the shared
79
83
  Web UI Component Drafts canvas: a block per component on its Storybook group's page, one row per fidelity rung.
80
84
  - `web-ui-dev-new-component` and `web-ui-dev-update-component` wait for the user to approve the design on the canvas
@@ -87,7 +91,10 @@
87
91
  - The `imf-web-ui-conventions` `styling` topic shows a container setting a custom property that its child reads with
88
92
  its own default as the fallback.
89
93
  - `web-ui-dev-release` syncs the Claude Design system once npm serves the stable version.
94
+ - `web-ui-dev-record-clip` records every clip in light and dark, and release highlights list both files of each pair.
90
95
  - Documentation — Nikolaus Brunner <brunner@imfusion.com>
96
+ - The Changelog page's screenshot carousel shows one file of each `-light`/`-dark` pair, the one for the page's color
97
+ scheme, and switches with the Storybook toolbar.
91
98
  - `docs/design-system.md` describes the Web UI Component Drafts canvas, and `AGENTS.md` links it. A shipped component
92
99
  keeps its block under an "Implemented" note that names its story.
93
100
  - `docs/conventions.md` shows how a component declares its default as a custom-property fallback that a container
@@ -119,6 +126,7 @@
119
126
  - `npm run dev` starts Storybook on the next free port again while another checkout's Storybook runs. — Nikolaus Brunner
120
127
  <brunner@imfusion.com>
121
128
  - A Storybook sidebar row's status icon stays in place on hover. — Nikolaus Brunner <brunner@imfusion.com>
129
+ - `npm run ci:status` lists queued and running builds beside finished ones. — Nikolaus Brunner <brunner@imfusion.com>
122
130
  - Components — Nikolaus Brunner <brunner@imfusion.com>
123
131
  - A `Drawer.Close` or `Popover.Close` rendered as another component, such as a `Button`, keeps that component's styles.
124
132
  - A `Popover.Trigger` rendered as another component keeps that component's styles, so `render={<Button />}` looks like a Button.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imfusion/web-ui",
3
- "version": "0.11.1-dev.44.gad806324",
3
+ "version": "0.11.1-dev.47.g23180a23",
4
4
  "description": "The official Web UI component library for ImFusion web apps",
5
5
  "author": "ImFusion GmbH",
6
6
  "homepage": "https://imfusion.com",
@@ -46,6 +46,7 @@ sections one to one — change a topic's sections and this file follows in the s
46
46
  - [ ] Grouping
47
47
  - [ ] One file or a folder
48
48
  - [ ] Colocation
49
+ - [ ] Semantic elements
49
50
 
50
51
  ## TypeScript & code style — `typescript`
51
52
 
@@ -127,7 +128,8 @@ sections one to one — change a topic's sections and this file follows in the s
127
128
  ## Assets — `assets`
128
129
 
129
130
  - [ ] Importing
130
- - [ ] Photographs: WebP
131
+ - [ ] Photographs: AVIF and WebP
132
+ - [ ] Loading
131
133
  - [ ] Other formats
132
134
  - [ ] Scope
133
135
 
@@ -8,15 +8,35 @@ consumed by document metadata or manifests, with a build step that serves the fi
8
8
  For the library's favicon set and social sharing image, read `BrandAssets.mdx` through the packaged user-guide route in
9
9
  `imf-web-ui`.
10
10
 
11
- ## Photographs: WebP
11
+ ## Photographs: AVIF and WebP
12
12
 
13
- Convert photographs to WebP before adding them:
13
+ Encode photographs as AVIF and WebP at 800 and 1600px wide. A source narrower than a width skips it, and `srcSet` lists only
14
+ the widths that exist:
14
15
 
15
16
  ```sh
16
- magick source.png -resize 2000x -quality 80 -define webp:method=6 src/assets/name.webp
17
+ for w in 800 1600; do
18
+ magick source.png -resize "${w}x>" -quality 55 src/assets/name-$w.avif
19
+ magick source.png -resize "${w}x>" -quality 80 -define webp:method=6 src/assets/name-$w.webp
20
+ done
17
21
  ```
18
22
 
19
- Keep the long edge at 2000px or less. WebP is supported by the browser floor.
23
+ Render them through `<picture>`: an AVIF `<source>`, then a WebP `<source>`, each with `srcSet` and `sizes`, then an `<img>`
24
+ fallback. The browser takes the first format it supports at the width that fits. Both formats are supported by the browser
25
+ floor.
26
+
27
+ ```tsx
28
+ <picture>
29
+ <source type="image/avif" srcSet={`${name800Avif} 800w, ${name1600Avif} 1600w`} sizes="(max-width: 40rem) 100vw, 40rem" />
30
+ <source type="image/webp" srcSet={`${name800Webp} 800w, ${name1600Webp} 1600w`} sizes="(max-width: 40rem) 100vw, 40rem" />
31
+ <img src={name800Webp} width={800} height={400} alt="…" />
32
+ </picture>
33
+ ```
34
+
35
+ ## Loading
36
+
37
+ Every `<img>` carries `width` and `height` in the source's aspect ratio, so the browser reserves its space before it loads.
38
+ An image below the fold gets `loading="lazy"` and `decoding="async"`. The one image that is the page's largest paint gets
39
+ `fetchpriority="high"` and loads eagerly.
20
40
 
21
41
  ## Other formats
22
42
 
@@ -53,3 +53,13 @@ Keep a component's stylesheet, tests, and local types beside the component. A co
53
53
  be a layout or dumb component instead.
54
54
 
55
55
  A route-local component keeps its stylesheet and tests in the route's `-` folder beside it.
56
+
57
+ ## Semantic elements
58
+
59
+ Inside `AppShell`, the shell's parts render the landmarks: `AppShell.Header` a `<header>`, `AppShell.Navbar` a `<nav>`,
60
+ `AppShell.Aside` an `<aside>`, `AppShell.Main` the page's one `<main>`, and `AppShell.Footer` a `<footer>`. A page puts its
61
+ content inside those parts.
62
+
63
+ Custom markup uses the element for its meaning: `<section>` and `<article>` for content groups, `<time dateTime>` for a date,
64
+ `Button` for an action, and the router's `Link` for a destination. A page has one `Typo.H1`, and heading levels descend
65
+ without skipping.