@imfusion/web-ui 0.11.1-dev.88.gafff02ef → 0.11.1-dev.95.g94cb131e
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 +8 -0
- package/dist/components/app-shell/app-shell-context.d.ts +25 -0
- package/dist/components/app-shell/app-shell.d.ts +12 -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/index.d.ts +1 -1
- package/dist/index.js +2698 -2536
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/docgen/doc.gen.json +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
### Added
|
|
12
12
|
|
|
13
|
+
- `AppShell.Navbar` takes `collapse` to put the navbar away. With `"hidden"` it waits behind the page, and a panel toggle in
|
|
14
|
+
a 4rem column at the start opens it; with `"rail"` that column shows its icons, each named in a tooltip, with a mark under
|
|
15
|
+
the current page. Opening recedes the page to an inset card and slides the navbar in; a tap on the page, Escape, or a
|
|
16
|
+
followed link closes it, and focus returns to the toggle. Below md both open full screen. `openLabel` and `closeLabel`
|
|
17
|
+
name the toggle, and `--imf-ui-appshell-recede-open` and `--imf-ui-appshell-recede-close` set the motion.
|
|
18
|
+
`useAppShellNavbar()` reads and sets the navbar's open state from app code. The default, `collapse="none"`, is unchanged.
|
|
19
|
+
[Hidden](src/components/app-shell/app-shell.stories.tsx#Hidden), [Rail](src/components/app-shell/app-shell.stories.tsx#Rail)
|
|
20
|
+
([WEBSDK-307](https://imfusion.atlassian.net/browse/WEBSDK-307)) — Nikolaus Brunner <brunner@imfusion.com>
|
|
13
21
|
- `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
22
|
[RichLink](src/components/rich-link/rich-link.mdx) — Nikolaus Brunner <brunner@imfusion.com>
|
|
15
23
|
- `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,15 @@ 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
|
+
/** Accessible name of the shell's toggle while the navbar is closed. */
|
|
59
|
+
openLabel?: string;
|
|
60
|
+
/** Accessible name of the shell's toggle while the navbar is open, and of the page cover that closes it. */
|
|
61
|
+
closeLabel?: string;
|
|
52
62
|
};
|
|
53
63
|
/**
|
|
54
64
|
* The navbar owns its frame: `logo` on top, the children (nav items) in the middle, `account` at the foot. Without a
|
|
@@ -56,7 +66,7 @@ type NavbarProps = React.ComponentProps<"nav"> & VariantProps<typeof navbarSurfa
|
|
|
56
66
|
* color; children opt into on-color themselves. Below `md` the navbar opens as a drawer from the inline start, with its
|
|
57
67
|
* close on the logo row.
|
|
58
68
|
*/
|
|
59
|
-
declare function Navbar({ variant, open, defaultOpen, onOpenChange, logo, account, children, id, ...props }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
declare function Navbar({ variant, open, defaultOpen, onOpenChange, logo, account, collapse, openLabel, closeLabel, children, id, ...props }: NavbarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
60
70
|
declare namespace Navbar {
|
|
61
71
|
var displayName: string;
|
|
62
72
|
}
|
|
@@ -102,7 +112,7 @@ type NavItemProps = useRender.ComponentProps<"a"> & {
|
|
|
102
112
|
* `aria-current="page"` underlines the label. Pass a router link through `render`. Followed inside the navbar drawer,
|
|
103
113
|
* it closes the drawer.
|
|
104
114
|
*/
|
|
105
|
-
declare function NavItem({ icon, description, children, render, onClick, ...props }: NavItemProps): import(
|
|
115
|
+
declare function NavItem({ icon, description, children, render, onClick, ...props }: NavItemProps): import("react/jsx-runtime").JSX.Element;
|
|
106
116
|
declare namespace NavItem {
|
|
107
117
|
var displayName: string;
|
|
108
118
|
}
|
|
@@ -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
|
+
};
|
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';
|