@imfusion/web-ui 0.11.1-dev.88.gafff02ef → 0.11.1-dev.96.g0ff5ca96
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 +15 -0
- package/dist/components/app-shell/app-shell-context.d.ts +25 -0
- package/dist/components/app-shell/app-shell.d.ts +18 -2
- package/dist/components/app-shell/index.d.ts +1 -0
- package/dist/components/app-shell/use-app-shell-navbar.d.ts +11 -0
- package/dist/components/logo/product/compact-context.d.ts +8 -0
- package/dist/components/logo/product/marks.d.ts +27 -0
- package/dist/components/logo/product/product.d.ts +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2920 -2653
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/docgen/doc.gen.json +28 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,21 @@
|
|
|
10
10
|
|
|
11
11
|
### Added
|
|
12
12
|
|
|
13
|
+
- `ProductLogo` takes `compact` to fold into a square mark with the product's initial in place; changing it animates the
|
|
14
|
+
fold. Inside the AppShell rail the navbar folds it while the rail is closed, centered on the icons.
|
|
15
|
+
[Compact](src/components/logo/product/product.stories.tsx#Compact),
|
|
16
|
+
[RailProductLogo](src/components/app-shell/app-shell.stories.tsx#RailProductLogo)
|
|
17
|
+
([WEBSDK-307](https://imfusion.atlassian.net/browse/WEBSDK-307)) — Nikolaus Brunner <brunner@imfusion.com>
|
|
18
|
+
- `AppShell.Navbar` takes `mark`, a compact form for a custom logo that cannot fold, shown while the rail is closed.
|
|
19
|
+
Without one, such a logo fades out of the closed rail instead of being cut. — Nikolaus Brunner <brunner@imfusion.com>
|
|
20
|
+
- `AppShell.Navbar` takes `collapse` to put the navbar away. With `"hidden"` it waits behind the page, and a panel toggle in
|
|
21
|
+
a 4rem column at the start opens it; with `"rail"` that column shows its icons, each named in a tooltip, with a mark under
|
|
22
|
+
the current page. Opening recedes the page to an inset card and slides the navbar in; a tap on the page, Escape, or a
|
|
23
|
+
followed link closes it, and focus returns to the toggle. Below md both open full screen. `openLabel` and `closeLabel`
|
|
24
|
+
name the toggle, and `--imf-ui-appshell-recede-open` and `--imf-ui-appshell-recede-close` set the motion.
|
|
25
|
+
`useAppShellNavbar()` reads and sets the navbar's open state from app code. The default, `collapse="none"`, is unchanged.
|
|
26
|
+
[Hidden](src/components/app-shell/app-shell.stories.tsx#Hidden), [Rail](src/components/app-shell/app-shell.stories.tsx#Rail)
|
|
27
|
+
([WEBSDK-307](https://imfusion.atlassian.net/browse/WEBSDK-307)) — Nikolaus Brunner <brunner@imfusion.com>
|
|
13
28
|
- `RichLink` takes `size="sm"` for dense lists: 6px block padding, a 32px tile, and a closer gap between glyph and text. The default `md` is unchanged.
|
|
14
29
|
[RichLink](src/components/rich-link/rich-link.mdx) — Nikolaus Brunner <brunner@imfusion.com>
|
|
15
30
|
- `Code.Inline` takes `concealable` to hide its content behind an eye button, hidden by default. `concealed` and
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** What a closed navbar leaves on screen from `md` up: docked (`none`), only its toggle (`hidden`), or its icon rail. */
|
|
2
|
+
export type Collapse = "none" | "hidden" | "rail";
|
|
3
|
+
type Disclosure = {
|
|
4
|
+
id: string;
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange: (open: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
export type NavbarSection = Disclosure & {
|
|
9
|
+
variant: "default" | "branded";
|
|
10
|
+
logo: React.ReactNode;
|
|
11
|
+
collapse: Collapse;
|
|
12
|
+
openLabel: string;
|
|
13
|
+
closeLabel: string;
|
|
14
|
+
};
|
|
15
|
+
export type Sections = {
|
|
16
|
+
navbar?: NavbarSection;
|
|
17
|
+
};
|
|
18
|
+
export declare const ShellContext: import('react').Context<HTMLDivElement | null>;
|
|
19
|
+
export declare const BackstageContext: import('react').Context<HTMLDivElement | null>;
|
|
20
|
+
export declare const SectionsContext: import('react').Context<{
|
|
21
|
+
sections: Sections;
|
|
22
|
+
setSections: React.Dispatch<React.SetStateAction<Sections>>;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const InClosingNavbarContext: import('react').Context<boolean>;
|
|
25
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { Collapse } from './app-shell-context';
|
|
3
4
|
declare const navbarSurface: (props?: ({
|
|
4
5
|
variant?: "default" | "branded" | null | undefined;
|
|
5
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -49,6 +50,21 @@ type NavbarProps = React.ComponentProps<"nav"> & VariantProps<typeof navbarSurfa
|
|
|
49
50
|
logo?: React.ReactNode;
|
|
50
51
|
/** The signed-in account at the foot of the rail, usually an `AccountCard`. Without it the foot is omitted. */
|
|
51
52
|
account?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* What a closed navbar leaves on screen from `md` up. `none` docks it and never closes; `hidden` leaves only the
|
|
55
|
+
* shell's toggle; `rail` leaves its icon rail. Opening a collapsing navbar recedes the page in front of it.
|
|
56
|
+
*/
|
|
57
|
+
collapse?: Collapse;
|
|
58
|
+
/**
|
|
59
|
+
* The logo's compact form, shown in place of `logo` while the rail is closed. A `ProductLogo` folds into its compact
|
|
60
|
+
* form by itself and needs none; the default logo brings the ImFusion glyph; any other logo without a mark fades
|
|
61
|
+
* out of the closed rail.
|
|
62
|
+
*/
|
|
63
|
+
mark?: React.ReactNode;
|
|
64
|
+
/** Accessible name of the shell's toggle while the navbar is closed. */
|
|
65
|
+
openLabel?: string;
|
|
66
|
+
/** Accessible name of the shell's toggle while the navbar is open, and of the page cover that closes it. */
|
|
67
|
+
closeLabel?: string;
|
|
52
68
|
};
|
|
53
69
|
/**
|
|
54
70
|
* The navbar owns its frame: `logo` on top, the children (nav items) in the middle, `account` at the foot. Without a
|
|
@@ -56,7 +72,7 @@ type NavbarProps = React.ComponentProps<"nav"> & VariantProps<typeof navbarSurfa
|
|
|
56
72
|
* color; children opt into on-color themselves. Below `md` the navbar opens as a drawer from the inline start, with its
|
|
57
73
|
* close on the logo row.
|
|
58
74
|
*/
|
|
59
|
-
declare function Navbar({ variant, open, defaultOpen, onOpenChange, logo, account, children, id, ...props }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
declare function Navbar({ variant, open, defaultOpen, onOpenChange, logo, account, mark, collapse, openLabel, closeLabel, children, id, ...props }: NavbarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
60
76
|
declare namespace Navbar {
|
|
61
77
|
var displayName: string;
|
|
62
78
|
}
|
|
@@ -102,7 +118,7 @@ type NavItemProps = useRender.ComponentProps<"a"> & {
|
|
|
102
118
|
* `aria-current="page"` underlines the label. Pass a router link through `render`. Followed inside the navbar drawer,
|
|
103
119
|
* it closes the drawer.
|
|
104
120
|
*/
|
|
105
|
-
declare function NavItem({ icon, description, children, render, onClick, ...props }: NavItemProps): import(
|
|
121
|
+
declare function NavItem({ icon, description, children, render, onClick, ...props }: NavItemProps): import("react/jsx-runtime").JSX.Element;
|
|
106
122
|
declare namespace NavItem {
|
|
107
123
|
var displayName: string;
|
|
108
124
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Collapse } from './app-shell-context';
|
|
2
|
+
/**
|
|
3
|
+
* Reads and drives the AppShell navbar from anywhere inside `AppShell.Root`, such as opening it to point at something.
|
|
4
|
+
* `setOpen` goes through the navbar's `onOpenChange`, so it works for a controlled navbar too. A docked navbar
|
|
5
|
+
* (`collapse="none"`) only opens below `md`, where it is a drawer.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useAppShellNavbar(): {
|
|
8
|
+
open: boolean;
|
|
9
|
+
setOpen: (open: boolean) => void;
|
|
10
|
+
collapse: Collapse;
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lets a container fold the product logos inside it, such as the AppShell rail. `claim` tells the container that a logo
|
|
3
|
+
* folds itself, so it does not have to hide or swap it.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CompactLogoContext: import('react').Context<{
|
|
6
|
+
compact: boolean;
|
|
7
|
+
claim: () => void;
|
|
8
|
+
} | null>;
|
|
@@ -9,3 +9,30 @@ export declare const productWords: {
|
|
|
9
9
|
suite: string;
|
|
10
10
|
sdk: string;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* The plate in three pieces that fold the full logo into its compact square: the start with its chamfer, a middle that
|
|
14
|
+
* shrinks, and the end with its chamfer, which slides in by 506.82 units (`product.module.css`). The pieces overlap so no seam shows.
|
|
15
|
+
*/
|
|
16
|
+
export declare const productFoldPieces: {
|
|
17
|
+
start: string;
|
|
18
|
+
middle: {
|
|
19
|
+
x: number;
|
|
20
|
+
width: number;
|
|
21
|
+
};
|
|
22
|
+
end: string;
|
|
23
|
+
};
|
|
24
|
+
/** The compact square: the plate's chamfers on a square, for the cut-out compact form. */
|
|
25
|
+
export declare const productCompactViewBox = "0 0 335.39 335.39";
|
|
26
|
+
export declare const productCompactPlate = "M335.39,99.26L236.13,0L0,0L0,236.13L99.26,335.39L335.39,335.39Z";
|
|
27
|
+
/** Each product's initial, where its wordmark has it; the compact form keeps only this glyph. */
|
|
28
|
+
export declare const productInitials: {
|
|
29
|
+
labels: string;
|
|
30
|
+
suite: string;
|
|
31
|
+
sdk: string;
|
|
32
|
+
};
|
|
33
|
+
/** The rest of each wordmark after its initial; it fades out as the logo folds. */
|
|
34
|
+
export declare const productWordRests: {
|
|
35
|
+
labels: string;
|
|
36
|
+
suite: string;
|
|
37
|
+
sdk: string;
|
|
38
|
+
};
|
|
@@ -5,6 +5,11 @@ type Props = Omit<React.ComponentProps<typeof Logo>, "src" | "alt" | "variant">
|
|
|
5
5
|
product: keyof typeof productWords;
|
|
6
6
|
/** Cut the product name out of the plate so the background shows through. */
|
|
7
7
|
cutout?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Fold to the square mark with the product's initial, for tight spaces. Changing it animates the fold. Inside the
|
|
10
|
+
* AppShell rail the navbar sets it while the rail is closed.
|
|
11
|
+
*/
|
|
12
|
+
compact?: boolean;
|
|
8
13
|
/** Override the accessible label. Defaults to the product name, e.g. "ImFusion SDK". */
|
|
9
14
|
alt?: string;
|
|
10
15
|
variant?: Exclude<LogoVariant, "minor">;
|
|
@@ -13,5 +18,5 @@ type Props = Omit<React.ComponentProps<typeof Logo>, "src" | "alt" | "variant">
|
|
|
13
18
|
* An ImFusion product logo (Labels, Suite, SDK) — the generic {@link Logo} primitive pre-wired
|
|
14
19
|
* with the product plate. The name is filled to contrast with the plate unless `cutout` is set.
|
|
15
20
|
*/
|
|
16
|
-
export declare function ProductLogo({ product, cutout, alt, variant, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function ProductLogo({ product, cutout, compact, alt, variant, size, height, style, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
22
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { Switch, switchMeta } from './components/switch';
|
|
|
19
19
|
export { Textarea, textareaMeta } from './components/textarea';
|
|
20
20
|
export { Toggle, toggleMeta } from './components/toggle';
|
|
21
21
|
export { ToggleGroup, toggleGroupMeta } from './components/toggle-group';
|
|
22
|
-
export { AppShell, appShellMeta } from './components/app-shell';
|
|
22
|
+
export { AppShell, appShellMeta, useAppShellNavbar } from './components/app-shell';
|
|
23
23
|
export { Card, cardMeta } from './components/card';
|
|
24
24
|
export { Dialog, dialogMeta } from './components/dialog';
|
|
25
25
|
export { Drawer, drawerMeta } from './components/drawer';
|