@imfusion/web-ui 0.8.0 → 0.8.1-dev.1.g11d9ffbe

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
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ### Added
6
+
7
+ - Components — Nikolaus Brunner <brunner@imfusion.com>
8
+ - `Avatar` shows a person's photo, their initials, or a person glyph, in three sizes and an on-color context.
9
+ - `AccountCard` links to the signed-in person's account with an avatar, a title, a description, and a trailing action.
10
+
11
+ ---
12
+
3
13
  ## `0.8.0` &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2026.10.01
4
14
 
5
15
  ### Highlights
@@ -0,0 +1,53 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import * as AvatarParts from '../avatar/avatar';
4
+ declare const root: (props?: ({
5
+ context?: "default" | "oncolor" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ type RootProps = useRender.ComponentProps<"a"> & VariantProps<typeof root>;
8
+ /**
9
+ * AccountCard.Root — the link to the signed-in person's account, holding `AccountCard.Avatar`, `AccountCard.Title`, and
10
+ * `AccountCard.Description`. Pass a router link through `render`. `aria-current="page"` marks it current with a tint and
11
+ * an inset rule. Its accessible name is the title and description; the avatar stays decorative.
12
+ *
13
+ * Place `AccountCard.Action` beside the root, not inside it: a link cannot contain a button.
14
+ */
15
+ declare function Root({
16
+ /** Explicit saturated-surface context; this is never inferred from an ancestor. */
17
+ context, render, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
18
+ declare namespace Root {
19
+ var displayName: string;
20
+ }
21
+ type AvatarProps = React.HTMLAttributes<HTMLSpanElement> & {
22
+ /** The person's photo. Until it loads, and when it fails, the initials or the person glyph show instead. */
23
+ src?: string;
24
+ /** The avatar size. */
25
+ size?: React.ComponentProps<typeof AvatarParts.Root>["size"];
26
+ };
27
+ /**
28
+ * AccountCard.Avatar — a decorative `Avatar` in the card's context. Its children are the initials; without them it shows
29
+ * a person glyph.
30
+ */
31
+ declare function Avatar({ src, size, children, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
32
+ declare namespace Avatar {
33
+ var displayName: string;
34
+ }
35
+ /** AccountCard.Title — the account's name, or its email until a name exists. Truncates to one line. */
36
+ declare function Title(props: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
37
+ declare namespace Title {
38
+ var displayName: string;
39
+ }
40
+ /** AccountCard.Description — a second line such as organization and role. Truncates to one line. */
41
+ declare function Description(props: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
42
+ declare namespace Description {
43
+ var displayName: string;
44
+ }
45
+ /**
46
+ * AccountCard.Action — a trailing slot beside `AccountCard.Root`, such as a ghost icon `Button` that logs out. The
47
+ * button carries its own `aria-label` and its own `context`.
48
+ */
49
+ declare function Action(props: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
50
+ declare namespace Action {
51
+ var displayName: string;
52
+ }
53
+ export { Root, Avatar, Title, Description, Action };
@@ -0,0 +1,2 @@
1
+ import { ComponentMeta } from '../../types/meta';
2
+ export declare const accountCardMeta: ComponentMeta;
@@ -0,0 +1,2 @@
1
+ export * as AccountCard from './account-card';
2
+ export { accountCardMeta } from './account-card.meta';
@@ -0,0 +1,40 @@
1
+ import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ declare const root: (props?: ({
4
+ size?: "sm" | "md" | "lg" | null | undefined;
5
+ context?: "default" | "oncolor" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ interface RootProps extends React.ComponentProps<typeof AvatarPrimitive.Root>, VariantProps<typeof root> {
8
+ }
9
+ /**
10
+ * Avatar.Root — a round badge that stands for a person. Also called a profile picture or user badge.
11
+ *
12
+ * Without `aria-label` or `aria-labelledby` it is decorative and hidden from assistive tech, for use next to a visible
13
+ * name. With a label it is announced as an image with that name.
14
+ *
15
+ * @doc https://base-ui.com/react/components/avatar
16
+ * @llm https://base-ui.com/react/components/avatar.md
17
+ */
18
+ declare function Root({ size,
19
+ /** Explicit saturated-surface context; this is never inferred from an ancestor. */
20
+ context, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
21
+ declare namespace Root {
22
+ var displayName: string;
23
+ }
24
+ /**
25
+ * Avatar.Fallback — the initials the consumer passes, one or two letters. Without children it shows a person glyph.
26
+ * It derives nothing from a name or email.
27
+ */
28
+ declare function Fallback({ children, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
29
+ declare namespace Fallback {
30
+ var displayName: string;
31
+ }
32
+ /**
33
+ * Avatar.Image — the person's photo, cropped to the circle. It shows once `src` has loaded; until then, and when it
34
+ * fails, `Avatar.Fallback` shows instead.
35
+ */
36
+ declare function Image({ alt, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
37
+ declare namespace Image {
38
+ var displayName: string;
39
+ }
40
+ export { Root, Image, Fallback };
@@ -0,0 +1,2 @@
1
+ import { ComponentMeta } from '../../types/meta';
2
+ export declare const avatarMeta: ComponentMeta;
@@ -0,0 +1,2 @@
1
+ export * as Avatar from './avatar';
2
+ export { avatarMeta } from './avatar.meta';
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ export { Prose, proseMeta } from './components/prose';
19
19
  export { Row, rowMeta } from './components/row';
20
20
  export { Separator, separatorMeta } from './components/separator';
21
21
  export { Stack, stackMeta } from './components/stack';
22
+ export { AccountCard, accountCardMeta } from './components/account-card';
23
+ export { Avatar, avatarMeta } from './components/avatar';
22
24
  export { Callout, calloutMeta } from './components/callout';
23
25
  export { Chip, chipMeta } from './components/chip';
24
26
  export { Code, codeMeta } from './components/code';