@imfusion/web-ui 0.11.1-dev.95.g94cb131e → 0.11.1-dev.97.gf5c0e587

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
@@ -10,6 +10,14 @@
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 morphs the
14
+ logo, sliding the name into its initial as the plate closes behind it. Inside the AppShell rail the navbar folds it while
15
+ the rail is closed, centered on the icons.
16
+ [Compact](src/components/logo/product/product.stories.tsx#Compact), [Morph](src/components/logo/product/product.stories.tsx#Morph),
17
+ [RailProductLogo](src/components/app-shell/app-shell.stories.tsx#RailProductLogo)
18
+ ([WEBSDK-307](https://imfusion.atlassian.net/browse/WEBSDK-307)) — Nikolaus Brunner <brunner@imfusion.com>
19
+ - `AppShell.Navbar` takes `mark`, a compact form for a custom logo that cannot fold, shown while the rail is closed.
20
+ Without one, such a logo fades out of the closed rail instead of being cut. — Nikolaus Brunner <brunner@imfusion.com>
13
21
  - `AppShell.Navbar` takes `collapse` to put the navbar away. With `"hidden"` it waits behind the page, and a panel toggle in
14
22
  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
23
  the current page. Opening recedes the page to an inset card and slides the navbar in; a tap on the page, Escape, or a
@@ -55,6 +55,12 @@ type NavbarProps = React.ComponentProps<"nav"> & VariantProps<typeof navbarSurfa
55
55
  * shell's toggle; `rail` leaves its icon rail. Opening a collapsing navbar recedes the page in front of it.
56
56
  */
57
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;
58
64
  /** Accessible name of the shell's toggle while the navbar is closed. */
59
65
  openLabel?: string;
60
66
  /** Accessible name of the shell's toggle while the navbar is open, and of the page cover that closes it. */
@@ -66,7 +72,7 @@ type NavbarProps = React.ComponentProps<"nav"> & VariantProps<typeof navbarSurfa
66
72
  * color; children opt into on-color themselves. Below `md` the navbar opens as a drawer from the inline start, with its
67
73
  * close on the logo row.
68
74
  */
69
- declare function Navbar({ variant, open, defaultOpen, onOpenChange, logo, account, collapse, openLabel, closeLabel, children, id, ...props }: NavbarProps): import("react/jsx-runtime").JSX.Element | null;
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;
70
76
  declare namespace Navbar {
71
77
  var displayName: string;
72
78
  }
@@ -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,39 @@ 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
+ /**
34
+ * Where the rest of each wordmark starts: it slides in behind this edge as the logo folds, so whatever shows of it keeps
35
+ * the wordmark's spacing to the initial.
36
+ */
37
+ export declare const productInitialEdges: {
38
+ labels: number;
39
+ suite: number;
40
+ sdk: number;
41
+ };
42
+ /** The rest of each wordmark after its initial; it rides the plate's end into the initial as the logo folds. */
43
+ export declare const productWordRests: {
44
+ labels: string;
45
+ suite: string;
46
+ sdk: string;
47
+ };
@@ -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 morphs the logo: the name slides
10
+ * into its initial as the plate closes behind it. Inside the 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 {};