@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/CHANGELOG.md +10 -0
- package/dist/components/image/image.d.ts +50 -0
- package/dist/components/image/image.meta.d.ts +2 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2519 -2374
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/docgen/doc.gen.json +142 -0
- package/src/llms/llms.gen.txt +5 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
|
|
7
|
+
- `Image` is a new picture box over native `<picture>` and `<img>`, with an AVIF and a WebP source and a fallback `<img>`.
|
|
8
|
+
`width` and `height` are required and reserve the box before the image loads. It loads lazily and decodes asynchronously;
|
|
9
|
+
`priority` loads it eagerly with high fetch priority. A soft pulse shows while it loads and a glyph when it fails.
|
|
10
|
+
`radius`, `fit`, `border`, `borderWidth` and `aspectRatio` shape the box. [Image](src/components/image/image.mdx)
|
|
11
|
+
([WEBSDK-250](https://imfusion.atlassian.net/browse/WEBSDK-250)) — Nikolaus Brunner <brunner@imfusion.com>
|
|
7
12
|
- `Dialog.Alert` composes a confirmation from props like `Dialog.Simple`, on Base UI's Alert Dialog: screen readers announce
|
|
8
13
|
it as an `alertdialog`, it is always modal, and a click on the overlay leaves it open. `actions` is required, the header has
|
|
9
14
|
no close button, and `status` takes any variant. It replaces a `Dialog.Simple` or a hand-composed `Dialog.Root` that asks
|
|
@@ -100,6 +105,11 @@
|
|
|
100
105
|
- `imf-web-ui-conventions` exempts React components from the explicit return type on exported functions.
|
|
101
106
|
- The `imf-web-ui-conventions` `npm-project` topic sets `engines.node` to Web UI's own range, and `imf-web-ui-audit`
|
|
102
107
|
reports an app whose range admits a Node outside it.
|
|
108
|
+
- The `imf-web-ui-conventions` `assets` topic points to `Image` for content images.
|
|
109
|
+
- `web-ui-dev-new-component` adds a review step before handover: conventions and plan checklist against the code, a token
|
|
110
|
+
showcase entry, the docs audit, and an `implementation-reviewer` pass.
|
|
111
|
+
- `web-ui-dev-new-component` and the design-system doc require rendering every published drafts-canvas board and looking
|
|
112
|
+
at it, by the session that owns the work, using a local copy of the board.
|
|
103
113
|
- The `project-structure` topic keeps a route's only view, such as a form, in the route file and moves views to the `-`
|
|
104
114
|
folder only when the page composes several. `imf-web-ui-audit` reports by views, not line counts.
|
|
105
115
|
- The `imf-web-ui-conventions` `assets` topic encodes photographs as AVIF and WebP at 800 and 1600px and renders them
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const root: (props?: ({
|
|
3
|
+
radius?: "none" | "round" | "sm" | "md" | "lg" | null | undefined;
|
|
4
|
+
fit?: "contain" | "cover" | null | undefined;
|
|
5
|
+
border?: "none" | "single" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
type Props = Omit<React.ComponentProps<"img">, "width" | "height" | "alt" | "className" | "style" | "src" | "srcSet" | "sizes" | "loading" | "decoding"> & VariantProps<typeof root> & {
|
|
8
|
+
/** Address of the fallback `<img>`. */
|
|
9
|
+
src: string;
|
|
10
|
+
/** Width candidates of the fallback `<img>`. */
|
|
11
|
+
srcSet?: string;
|
|
12
|
+
/** Slot width the browser plans for, shared by both `<source>` elements and the `<img>`. */
|
|
13
|
+
sizes?: string;
|
|
14
|
+
/** `lazy` defers the request until the image nears the viewport. */
|
|
15
|
+
loading?: "lazy" | "eager";
|
|
16
|
+
/** `async` decodes off the main thread. */
|
|
17
|
+
decoding?: "async" | "sync" | "auto";
|
|
18
|
+
/** Describes the image. Pass `""` to mark it decorative. */
|
|
19
|
+
alt: string;
|
|
20
|
+
/** Intrinsic width in pixels. Together with `height` it reserves the box before the image loads. */
|
|
21
|
+
width: number;
|
|
22
|
+
/** Intrinsic height in pixels. */
|
|
23
|
+
height: number;
|
|
24
|
+
/** AVIF candidates for the `<picture>`, offered before WebP. */
|
|
25
|
+
avifSrcSet?: string;
|
|
26
|
+
/** WebP candidates for the `<picture>`, offered after AVIF. */
|
|
27
|
+
webpSrcSet?: string;
|
|
28
|
+
/** Hairline width in `border-size` steps. Applies with `border="single"`. */
|
|
29
|
+
borderWidth?: 1 | 2 | 3;
|
|
30
|
+
/** Width divided by height of the box. Defaults to `width / height`; the picture crops or letterboxes per `fit`. */
|
|
31
|
+
aspectRatio?: number;
|
|
32
|
+
/** Loads the image eagerly with high fetch priority. Set it on the page's largest image only. */
|
|
33
|
+
priority?: boolean;
|
|
34
|
+
/** Sizing and layout hook on the box around the picture. */
|
|
35
|
+
className?: string;
|
|
36
|
+
/** Sizing and layout hook on the box around the picture. */
|
|
37
|
+
style?: React.CSSProperties;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Image — a picture box with one `<source>` per format (AVIF, then WebP) and an `<img>` fallback. The browser picks the
|
|
41
|
+
* format and size. The box reserves `width` by `height` before the image arrives, pulses while it loads, and shows a
|
|
42
|
+
* glyph when it fails. Also called a photo, thumbnail or media.
|
|
43
|
+
*
|
|
44
|
+
* `ref` and every prop not named here reach the `<img>`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function Image({ alt, width, height, avifSrcSet, webpSrcSet, priority, loading, decoding, radius, fit, border, borderWidth, aspectRatio, className, style, ref, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare namespace Image {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export { Chip, chipMeta } from './components/chip';
|
|
|
36
36
|
export { Code, codeMeta } from './components/code';
|
|
37
37
|
export { Collapsible, collapsibleMeta } from './components/collapsible';
|
|
38
38
|
export { Icon, iconMeta } from './components/icon';
|
|
39
|
+
export { Image, imageMeta } from './components/image';
|
|
39
40
|
export { Kbd, kbdMeta } from './components/kbd';
|
|
40
41
|
export { Logo, logoMeta } from './components/logo';
|
|
41
42
|
export { Meter, meterMeta } from './components/meter';
|