@imfusion/web-ui 0.10.1-dev.2.gb6347f49 → 0.10.1-dev.34.gb01a818e

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/README.md +4 -2
  3. package/THIRD_PARTY_NOTICES.md +110 -0
  4. package/dist/code-NTcddiYk.js +139 -0
  5. package/dist/components/account-card/account-card.d.ts +9 -26
  6. package/dist/components/app-shell/app-shell.d.ts +21 -11
  7. package/dist/components/callout/callout.d.ts +1 -1
  8. package/dist/components/chip/chip.d.ts +1 -1
  9. package/dist/components/color-scheme-toggle/color-scheme-preference.d.ts +3 -0
  10. package/dist/components/color-scheme-toggle/color-scheme-toggle.d.ts +17 -0
  11. package/dist/components/color-scheme-toggle/color-scheme-toggle.meta.d.ts +2 -0
  12. package/dist/components/color-scheme-toggle/index.d.ts +2 -0
  13. package/dist/components/dialog/dialog.d.ts +148 -0
  14. package/dist/components/dialog/dialog.meta.d.ts +2 -0
  15. package/dist/components/dialog/index.d.ts +2 -0
  16. package/dist/components/drawer/drawer.d.ts +1 -1
  17. package/dist/components/scroll-area/index.d.ts +2 -0
  18. package/dist/components/scroll-area/scroll-area.d.ts +49 -0
  19. package/dist/components/scroll-area/scroll-area.meta.d.ts +2 -0
  20. package/dist/components/skeleton/skeleton.d.ts +17 -2
  21. package/dist/components/toggle/toggle.d.ts +8 -2
  22. package/dist/components/toggle-group/toggle-group-size.d.ts +3 -0
  23. package/dist/components/toggle-group/toggle-group.d.ts +7 -3
  24. package/dist/index.d.ts +4 -0
  25. package/dist/index.js +2336 -1898
  26. package/dist/integrations/code-highlight.js +2 -2
  27. package/dist/integrations/frame-selection.js +1 -1
  28. package/dist/integrations/image-display-options.js +123 -113
  29. package/dist/{rolldown-runtime-Dy4uBu1J.js → resolve-state-props-DQf9WiGv.js} +12 -1
  30. package/dist/scroll-area-z9Lf9uIk.js +89 -0
  31. package/dist/slider-Bf274cMe.js +106 -0
  32. package/dist/style.css +1 -1
  33. package/dist/{tabs-DRyqtS04.js → tabs-CU46aGud.js} +106 -88
  34. package/docs/user-guide/UsagePatterns.mdx +4 -0
  35. package/package.json +2 -2
  36. package/src/docgen/doc.gen.json +1261 -47
  37. package/src/llms/llms.gen.txt +18 -1
  38. package/src/llms/skills/imf-web-ui-audit/SKILL.md +15 -10
  39. package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +3 -1
  40. package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +2 -3
  41. package/src/llms/skills/imf-web-ui-conventions/topics/components.md +4 -1
  42. package/src/llms/skills/imf-web-ui-conventions/topics/data.md +24 -5
  43. package/src/llms/skills/imf-web-ui-conventions/topics/git.md +5 -2
  44. package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +3 -0
  45. package/src/llms/skills/imf-web-ui-conventions/topics/project-structure.md +11 -0
  46. package/src/llms/skills/imf-web-ui-conventions/topics/react.md +6 -4
  47. package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +3 -1
  48. package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +2 -2
  49. package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +2 -0
  50. package/src/llms/skills/imf-web-ui-ux/SKILL.md +2 -1
  51. package/src/llms/tokens.gen.json +1 -1
  52. package/dist/code-BYkr5k55.js +0 -134
  53. package/dist/slider-Cqpreglu.js +0 -116
package/CHANGELOG.md CHANGED
@@ -1,5 +1,136 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ### Highlights
6
+
7
+ #### Paper Mono is the mono font
8
+
9
+ [Paper Mono](https://paper.design/mono) replaces CoFo Sans Mono as the default `--imf-ui-font-family-mono`. It is licensed
10
+ under the SIL Open Font License, ships with the package, and covers every weight from 100 to 800, where CoFo had
11
+ only Regular. Mono text sets a little wider than before, so check tight labels in your layouts.
12
+
13
+ Mono text follows three weights: 600 for titles; 500 for control labels, buttons, tabs, and table headers; 400 for eyebrows,
14
+ metadata, values, and code. `Select`, `Slider`, and `Meter` labels, the `AppShell` nav item label, the `Popover` and
15
+ `Tooltip` triggers, the `Popover` close button, and the `Toast` close and action buttons move to 500. The `Typo` and
16
+ `Popover` eyebrows move to 400, and so does `Code`, which inherited the surrounding weight before: inline code in `Typo.P`
17
+ rendered at 300.
18
+
19
+ [`CodeHighlight`](src/integrations/code-highlight/code-highlight.mdx) uses the weights as well: keywords, JSX and HTML tags,
20
+ and Markdown headings at 600, functions and types at 500, comments at 300. The
21
+ [Weights](src/integrations/code-highlight/code-highlight.stories.tsx#Weights) story shows every tier in one snippet. A weight
22
+ never changes the character width, so columns stay aligned. CoFo Sans Mono still ships, so setting
23
+ `--imf-ui-font-family-mono` back to it restores the previous face; weights of 600 and up then render as synthesized bold.
24
+
25
+ ![Paper Mono in a highlighted TSX snippet, light](docs/assets/changelog/0.11.0-paper-mono-light.webp)
26
+ ![Paper Mono in a highlighted TSX snippet, dark](docs/assets/changelog/0.11.0-paper-mono-dark.webp)
27
+
28
+ ### Breaking
29
+
30
+ - **Breaking:** `AppShell.Main`, the AppShell aside drawer, and `Drawer.Content` scroll in a `ScrollArea` and pad their
31
+ content inside it ([WEBSDK-247](https://imfusion.atlassian.net/browse/WEBSDK-247)). — Nikolaus Brunner <brunner@imfusion.com>
32
+ - `AppShell.Main` stays the scrolling element and pads with `--imf-ui-appshell-padding`; a `padding` set on it adds to
33
+ that.
34
+ - `Drawer.Content` pads with `--imf-ui-drawer-content-padding`; a `padding`, `gap`, or grid set on it applies outside the
35
+ padded layer and does not reach the children.
36
+ - The aside drawer pads its content inside the scroll area; a `padding` on `AppShell.Aside` in drawer mode adds to it.
37
+ - **Breaking:** The AppShell navbar drawer opens from the inline start instead of the inline end. — Nikolaus Brunner <brunner@imfusion.com>
38
+ - Consumer CSS that places something against the navbar drawer's right edge moves to its left edge.
39
+ - **Breaking:** The AppShell navbar drawer renders its own close on the logo row. Remove the close `AppShell.Burger` your navbar's first section renders, or the drawer shows two closes. — Nikolaus Brunner <brunner@imfusion.com>
40
+ - **Breaking:** `AppShell.Navbar` renders its own logo row and account foot, and stacks its children as nav items with its own spacing. [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
41
+ - Pass the brand as `logo` and the account card as `account`, and drop the `AppShell.Section`s that held them. Omit `logo` to use the default ImFusion logo; `logo={null}` leaves the row empty.
42
+ - **Breaking:** The current `AppShell.NavItem` has no background surface; its label is underlined and the other items are dimmed. [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
43
+ - Consumer CSS that styled the item's background or `--navitem-current` moves to `--imf-ui-appshell-navitem-dim` and the underline properties.
44
+ - **Breaking:** `--imf-ui-appshell-padding` runs from 1.25rem to 3rem at `2.75cqi`, and `--imf-ui-appshell-navbar-width` adds one gutter. [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
45
+ - Pages that tuned their padding against the old values re-check them. Set either property on `AppShell.Root` to restore the old numbers.
46
+ - **Breaking:** The aside pads with `--imf-ui-appshell-padding` on every side instead of `--imf-ui-size-6` above and below. — Nikolaus Brunner <brunner@imfusion.com>
47
+ - Set `--imf-ui-appshell-aside-padding: var(--imf-ui-size-6) var(--imf-ui-appshell-padding)` to restore the old block padding.
48
+ - **Breaking:** `AccountCard` is a compact row: the avatar in a lead column, the text beside it, and the organization and role stacked under the subtitle without a rule. `AccountCard.Avatar` defaults to `size="sm"`. [Account card](src/components/account-card/account-card.mdx) — Nikolaus Brunner <brunner@imfusion.com>
49
+ - Pass `size="md"` to keep the larger avatar. Consumer CSS that styled the large title or the foot rule re-checks against the row.
50
+ - **Breaking:** `AccountCard` is no longer a link, and `AccountCard.Link` and `AccountCard.Group` are removed. [Account card](src/components/account-card/account-card.mdx) — Nikolaus Brunner <brunner@imfusion.com>
51
+ - Move the Link's children straight into `AccountCard.Root`. Wire account navigation to a button in `AccountCard.Action` or a nav item instead of the row.
52
+ - An account switcher built on `AccountCard.Group` has no replacement yet; keep the old version until one ships.
53
+ - **Breaking:** An `AccountCard` in the `AppShell.Navbar` foot lines up with the nav items and no longer takes the 8px inset. — Nikolaus Brunner <brunner@imfusion.com>
54
+ - Pass the card as `account`; a card kept in a Section keeps its own padding.
55
+
56
+ ### Added
57
+
58
+ - [`ColorSchemeToggle`](src/components/color-scheme-toggle/color-scheme-toggle.mdx) lets the user pick Light, System, or
59
+ Dark. It stores the choice through `useColorScheme` and needs no props; `label`, `lightLabel`, `systemLabel`, and
60
+ `darkLabel` replace the English text — Nikolaus Brunner <brunner@imfusion.com>
61
+ - [`ToggleGroup`](src/components/toggle-group/toggle-group.mdx) and `Toggle` take a `size` of `sm` or `md`. A small group
62
+ has no inset or gap, a 1px border, and 1.5rem toggles; a toggle takes its group's size unless it sets its own
63
+ — Nikolaus Brunner <brunner@imfusion.com>
64
+ - `Skeleton.Suspense` takes a `fallback` of bones, a `label`, and the content. It is a Suspense boundary whose fallback is a
65
+ busy `Skeleton.Root`; when the content mounts after the fallback showed, it fades in, and content that was
66
+ ready at mount appears without a fade. Use it for data loaded through Suspense, and `Skeleton.Root` for data loaded with
67
+ `useQuery` — Nikolaus Brunner <brunner@imfusion.com>
68
+ - `ScrollArea` is a scrolling region with a slim primary-colored thumb that floats over the content and shows while the
69
+ area is hovered or scrolled, and a fade at each edge with more content behind it. `ScrollArea.Auto` wraps children with
70
+ the scrollbars for `orientation` (`vertical`, `horizontal`, `both`, or `none`); the parts compose by hand for anything else
71
+ ([WEBSDK-247](https://imfusion.atlassian.net/browse/WEBSDK-247)) — Nikolaus Brunner <brunner@imfusion.com>
72
+ - `Dialog` is a modal window over a dimmed page, adapted from Base UI with all its parts. `Dialog.Header` takes a
73
+ `variant` (`main`, `support`, `minor`, or `primary` with light text); `Dialog.Title` renders as `Typo.H2` and
74
+ `Dialog.Description` as `Typo.P`. `Dialog.Body` scrolls in a `ScrollArea` while header and footer stay in view.
75
+ `Dialog.Popup` comes in `sm`, `md`, `lg`, and `full`, and stops at 40rem high (`--imf-ui-dialog-max-height`) except in
76
+ `full`. `Dialog.Status` adds a tinted status column like `Card.Status`, on top of the width the size sets.
77
+ `Dialog.Simple` builds the whole dialog from props, and `Dialog.Inline` opens it from a term inside running text
78
+ ([WEBSDK-247](https://imfusion.atlassian.net/browse/WEBSDK-247)) — Nikolaus Brunner <brunner@imfusion.com>
79
+ - Storybook — Nikolaus Brunner <brunner@imfusion.com>
80
+ - The token drawer offers Paper Mono as a mono font.
81
+ - Docs links open a single story when they name its export after the stories file:
82
+ `[Inline](src/components/code/code.stories.tsx#Inline)`.
83
+ - `withBreakHints` is exported. It inserts a break before each `@` and after each `.` in an email's string children, so the address wraps at its seams. [Account card](src/components/account-card/account-card.mdx) — Nikolaus Brunner <brunner@imfusion.com>
84
+ - `--imf-ui-accountcard-lead` and `--imf-ui-accountcard-padding-inline` set an `AccountCard`'s avatar column and inline padding, so a container can line it up with its own rows. [Account card](src/components/account-card/account-card.mdx) — Nikolaus Brunner <brunner@imfusion.com>
85
+ - `AppShell.Navbar` takes `logo` and `account`; the logo defaults to the ImFusion logo and lines up with the baseline of Main's first heading. [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
86
+ - `--imf-ui-appshell-heading-*`, `--imf-ui-appshell-navitem-dim`, `--imf-ui-appshell-navitem-underline-thickness`, and `--imf-ui-appshell-navitem-underline-offset` tune the logo row's strut and the NavItem underline. [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
87
+ - `AppShell.Aside` shows a close button in its drawer below `lg`, labelled by `closeLabel` (`Close panel` by default). [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
88
+ - `AppShell.Burger` with no props opens and closes the navbar drawer, so the header needs no state wiring. [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
89
+
90
+ ### Changed
91
+
92
+ - AppShell — Nikolaus Brunner <brunner@imfusion.com>
93
+ - The navbar rail, `AppShell.Main`, and the aside share `--imf-ui-appshell-padding` as their inline gutter, so their text lines up with no consumer CSS. [Docs](src/components/app-shell/app-shell.mdx)
94
+ - `--imf-ui-appshell-navbar-padding` defaults to `--imf-ui-appshell-padding`, and `--imf-ui-appshell-aside-padding` defaults to `--imf-ui-appshell-padding`. Both stay overridable.
95
+ - Agent skills — Nikolaus Brunner <brunner@imfusion.com>
96
+ - `imf-web-ui-audit` checks that `@imfusion/web-ui` is installed before it dispatches, and asks whether to install first,
97
+ since token, version, and type checks need the installed package. Its investigators search with whatever read-only
98
+ file search the host offers.
99
+ - The `imf-web-ui-conventions` audit checklist lists the "Derive types, don't copy them" and "Loading states" sections
100
+ under their current topic headings.
101
+ - `imf-web-ui-conventions` has query factories own a numeric `staleTime` chosen by how fast other people change the data.
102
+ Loaders call `queryClient.query(options)` without an override, and `"static"` no longer appears in factories or
103
+ `defaultOptions`, where it blocked invalidation refetches.
104
+ - `imf-web-ui-conventions` puts a route's own views, forms, hooks, and tests in a `-<file-name>/` folder beside the route
105
+ file, and reserves `partials/` for parts that more than one route uses.
106
+ - `imf-web-ui-conventions` lifts a value into a custom property on the component's root only when it repeats within that
107
+ stylesheet or a state or variant changes several descendants. A value that only recurs across files stays a literal in
108
+ each, and a shared component owns it when those files show one design element.
109
+ - `imf-web-ui-conventions` exempts TanStack options factories (`queryOptions`, `mutationOptions`) from the explicit return
110
+ type on exported functions, since spelling it out loses the typed query key.
111
+ - `imf-web-ui-conventions` keeps the Git hooks in `.vite-hooks/` and installs the Vite+ dispatcher with `vp config` from
112
+ `git:config`.
113
+ - `imf-web-ui-conventions` names the Skeleton part for each way data loads, and says a layout that reads suspending data
114
+ needs its own boundary. `imf-web-ui-ux` points to that rule from its loading state.
115
+ - CI and verification — Nikolaus Brunner <brunner@imfusion.com>
116
+ - The Git hooks live in `.vite-hooks/` and run through the Vite+ hook dispatcher, which `npm run git:config` installs.
117
+ Existing clones and worktrees rerun `npm run git:config`; until then their hooks do not run.
118
+ - The main column, header, and footer snap when the aside docks or undocks — Nikolaus Brunner <brunner@imfusion.com>
119
+ - Components ([WEBSDK-247](https://imfusion.atlassian.net/browse/WEBSDK-247)) — Nikolaus Brunner <brunner@imfusion.com>
120
+ - The AppShell navbar drawer, `Code`, and `ImageDisplayOptions` scroll in a `ScrollArea`, with its overlay thumb and edge
121
+ fades.
122
+ - Removed default padding from `Popover.Trigger` such that it keeps a neutral style.
123
+ - A ghost `Button` or `IconButton` hovers by fading its label or glyph, with no fill or edge, on main and oncolor surfaces alike, instead of inverting to a solid fill. `Dialog.Close` and the `AppShell.Aside` drawer close follow. [Button](src/components/button/button.mdx) — Nikolaus Brunner <brunner@imfusion.com>
124
+
125
+ ### Fixed
126
+
127
+ - `Chip` stays on one line within its container's width and ends in an ellipsis when the label doesn't fit. [Chip](src/components/chip/chip.mdx) — Nikolaus Brunner <brunner@imfusion.com>
128
+ - Only the navbar drawer's own close shows while it is open; the header burger steps back until the drawer closes — Nikolaus Brunner <brunner@imfusion.com>
129
+ - `Skeleton.Root` fades only its own content in when loading ends; the rest of the page stays still, and no `AbortError` reaches the console — Nikolaus Brunner <brunner@imfusion.com>
130
+ - `AppShell`'s docked aside no longer leaves `AppShell.Main` up to 13px under it at 1024px: Main ends where the aside begins at every docked width — Nikolaus Brunner <brunner@imfusion.com>
131
+
132
+ ---
133
+
3
134
  ## `0.10.0` &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2026.10.15
4
135
 
5
136
  ### Highlights
@@ -234,6 +365,37 @@ AppShell sections draw no dividers. Delete overrides of the border properties, w
234
365
  - --imf-ui-appshell-border-width: var(--imf-ui-border-size-2);
235
366
  ```
236
367
 
368
+ Navbar sections pad themselves with `--imf-ui-appshell-navbar-padding`, and that rule outranks a single class. Delete your
369
+ own section padding, and set the variable when the gutter needs to change:
370
+
371
+ ```diff
372
+ - .navSection { padding: 0 var(--imf-ui-appshell-padding); }
373
+ + .root { --imf-ui-appshell-navbar-padding: var(--imf-ui-size-5); }
374
+ ```
375
+
376
+ Nav links widen past the gutter only as `AppShell.NavItem`. Replace hand-built navbar links, and pass a router link through
377
+ `render`:
378
+
379
+ ```diff
380
+ - <MyNavLink to="/products" icon={Box} label="Products" />
381
+ + <AppShell.NavItem render={<Link to="/products" />} icon={<Icon glyph={Box} />}>Products</AppShell.NavItem>
382
+ ```
383
+
384
+ Above `lg` the aside docks whether or not `open` is set. Render no aside when there is nothing to show, not an empty one:
385
+
386
+ ```diff
387
+ - <AppShell.Aside>{selected ? <Details /> : <div />}</AppShell.Aside>
388
+ + {selected ? <AppShell.Aside><Details /></AppShell.Aside> : null}
389
+ ```
390
+
391
+ The navbar's first row and Main's offset read the header height while an `AppShell.Header` is rendered, even when CSS hides
392
+ it. Render the header conditionally instead of hiding it or setting the height to `0`:
393
+
394
+ ```diff
395
+ - <AppShell.Header className={styles.hiddenOnDesktop}>…</AppShell.Header>
396
+ + {isDesktop ? null : <AppShell.Header>…</AppShell.Header>}
397
+ ```
398
+
237
399
  ### Breaking
238
400
 
239
401
  - **Breaking:** The library supports Safari 17.5, Chrome 123, and Firefox 120 or newer. — Nikolaus Brunner <brunner@imfusion.com>
@@ -241,6 +403,11 @@ AppShell sections draw no dividers. Delete overrides of the border properties, w
241
403
  - The JavaScript build targets the same versions.
242
404
  - **Breaking:** AppShell sections draw no dividers, and the `--imf-ui-appshell-border-color`, `--imf-ui-appshell-border-width`, and `--imf-ui-appshell-border-style` properties are removed. ([WEBSDK-243](https://imfusion.atlassian.net/browse/WEBSDK-243)) — Nikolaus Brunner <brunner@imfusion.com>
243
405
  - **Breaking:** `AppShell.Main` is the scroll container and the document does not scroll; window scroll listeners, scroll restoration, and `scrollTo` target `AppShell.Main`. ([WEBSDK-243](https://imfusion.atlassian.net/browse/WEBSDK-243)) — Nikolaus Brunner <brunner@imfusion.com>
406
+ - **Breaking:** AppShell owns its navbar and aside layout. ([WEBSDK-243](https://imfusion.atlassian.net/browse/WEBSDK-243)) — Nikolaus Brunner <brunner@imfusion.com>
407
+ - Navbar sections pad themselves with `--imf-ui-appshell-navbar-padding` through a rule that outranks a single class.
408
+ - Only `AppShell.NavItem` widens past the navbar gutter.
409
+ - Above `lg` the aside docks whether or not `open` is set.
410
+ - The navbar's first row and Main's offset read the header height whenever an `AppShell.Header` is rendered.
244
411
 
245
412
  ### Added
246
413
 
package/README.md CHANGED
@@ -65,8 +65,10 @@ npm install
65
65
  npm run git:config
66
66
  ```
67
67
 
68
- `git:config` sets the tracked hooks path, enables rebase pulls, and requires fast-forward merges. Every checkout and worktree
69
- needs its own `node_modules`; the hooks stop with "run npm ci" without one.
68
+ The hooks are tracked in `.vite-hooks/`. `git:config` installs the Vite+ hook dispatcher into the git-ignored
69
+ `.vite-hooks/_/` and points the hooks path at it, enables rebase pulls, and requires fast-forward merges. Every checkout and
70
+ worktree needs its own `node_modules` and dispatcher, so run `npm ci` and `npm run git:config` in each; without the
71
+ dispatcher the hooks do not run at all.
70
72
 
71
73
  The pre-commit hook runs `vp staged` against the staged state: it lints and format-checks the repository, checks that every
72
74
  generated `*.gen.*` file matches its sources (`npm run verify:generated`), and runs the pinned-dependency, Knip, type-check,
@@ -66,3 +66,113 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66
66
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67
67
  SOFTWARE.
68
68
  ```
69
+
70
+ ## Paper Mono
71
+
72
+ - Project: [Paper Mono](https://github.com/paper-design/paper-mono)
73
+ - License: [SIL Open Font License 1.1](https://github.com/paper-design/paper-mono/blob/v1.000/LICENSE.txt)
74
+
75
+ The Paper Mono font shipped with `@imfusion/web-ui` is unmodified.
76
+
77
+ The following license text applies only to Paper Mono and is reproduced verbatim:
78
+
79
+ ```text
80
+ Paper Mono
81
+ Copyright (c) 2025 Lost Coast Labs, Inc. (Paper Design)
82
+
83
+ Based on Geist Mono
84
+ Copyright (c) 2023 Vercel, in collaboration with basement.studio
85
+
86
+ -----------------------------------------------------------
87
+
88
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
89
+ This license is copied below, and is also available with a FAQ at:
90
+ http://scripts.sil.org/OFL
91
+
92
+ -----------------------------------------------------------
93
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
94
+ -----------------------------------------------------------
95
+
96
+ PREAMBLE
97
+ The goals of the Open Font License (OFL) are to stimulate worldwide
98
+ development of collaborative font projects, to support the font creation
99
+ efforts of academic and linguistic communities, and to provide a free and
100
+ open framework in which fonts may be shared and improved in partnership
101
+ with others.
102
+
103
+ The OFL allows the licensed fonts to be used, studied, modified and
104
+ redistributed freely as long as they are not sold by themselves. The
105
+ fonts, including any derivative works, can be bundled, embedded,
106
+ redistributed and/or sold with any software provided that any reserved
107
+ names are not used by derivative works. The fonts and derivatives,
108
+ however, cannot be released under any other type of license. The
109
+ requirement for fonts to remain under this license does not apply
110
+ to any document created using the fonts or their derivatives.
111
+
112
+ DEFINITIONS
113
+ "Font Software" refers to the set of files released by the Copyright
114
+ Holder(s) under this license and clearly marked as such. This may
115
+ include source files, build scripts and documentation.
116
+
117
+ "Reserved Font Name" refers to any names specified as such after the
118
+ copyright statement(s).
119
+
120
+ "Original Version" refers to the collection of Font Software components as
121
+ distributed by the Copyright Holder(s).
122
+
123
+ "Modified Version" refers to any derivative made by adding to, deleting,
124
+ or substituting -- in part or in whole -- any of the components of the
125
+ Original Version, by changing formats or by porting the Font Software to a
126
+ new environment.
127
+
128
+ "Author" refers to any designer, engineer, programmer, technical
129
+ writer or other person who contributed to the Font Software.
130
+
131
+ PERMISSION AND CONDITIONS
132
+ Permission is hereby granted, free of charge, to any person obtaining
133
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
134
+ redistribute, and sell modified and unmodified copies of the Font
135
+ Software, subject to the following conditions:
136
+
137
+ 1) Neither the Font Software nor any of its individual components,
138
+ in Original or Modified Versions, may be sold by itself.
139
+
140
+ 2) Original or Modified Versions of the Font Software may be bundled,
141
+ redistributed and/or sold with any software, provided that each copy
142
+ contains the above copyright notice and this license. These can be
143
+ included either as stand-alone text files, human-readable headers or
144
+ in the appropriate machine-readable metadata fields within text or
145
+ binary files as long as those fields can be easily viewed by the user.
146
+
147
+ 3) No Modified Version of the Font Software may use the Reserved Font
148
+ Name(s) unless explicit written permission is granted by the corresponding
149
+ Copyright Holder. This restriction only applies to the primary font name as
150
+ presented to the users.
151
+
152
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
153
+ Software shall not be used to promote, endorse or advertise any
154
+ Modified Version, except to acknowledge the contribution(s) of the
155
+ Copyright Holder(s) and the Author(s) or with their explicit written
156
+ permission.
157
+
158
+ 5) The Font Software, modified or unmodified, in part or in whole,
159
+ must be distributed entirely under this license, and must not be
160
+ distributed under any other license. The requirement for fonts to
161
+ remain under this license does not apply to any document created
162
+ using the Font Software.
163
+
164
+ TERMINATION
165
+ This license becomes null and void if any of the above conditions are
166
+ not met.
167
+
168
+ DISCLAIMER
169
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
170
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
171
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
172
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
173
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
174
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
175
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
176
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
177
+ OTHER DEALINGS IN THE FONT SOFTWARE.
178
+ ```
@@ -0,0 +1,139 @@
1
+ import { r as e } from "./resolve-state-props-DQf9WiGv.js";
2
+ import { Xo as t, ja as n, pM as r } from "./icons-BsK_o-Cb.js";
3
+ import { t as i } from "./meta-V_KyLeGn.js";
4
+ import { a, i as o, n as s, o as c, s as l } from "./scroll-area-z9Lf9uIk.js";
5
+ import { cx as u } from "class-variance-authority";
6
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ import { useCallback as m, useEffect as h, useRef as g, useState as _ } from "react";
8
+ import { mergeProps as v } from "@base-ui/react/merge-props";
9
+ import { useRender as y } from "@base-ui/react/use-render";
10
+ //#region src/hooks/use-clipboard.ts
11
+ function b({ timeout: e = 1500 } = {}) {
12
+ let [t, n] = _(!1), r = g(void 0);
13
+ return h(() => () => clearTimeout(r.current), []), {
14
+ copied: t,
15
+ copy: m((t) => {
16
+ navigator.clipboard.writeText(t).then(() => {
17
+ n(!0), clearTimeout(r.current), r.current = setTimeout(() => n(!1), e);
18
+ });
19
+ }, [e])
20
+ };
21
+ }
22
+ var x = {
23
+ block: "imf-ui-code-module-block",
24
+ copy: "imf-ui-code-module-copy",
25
+ inline: "imf-ui-code-module-inline",
26
+ inlineCopy: "imf-ui-code-module-inlineCopy",
27
+ inlineLink: "imf-ui-code-module-inlineLink",
28
+ language: "imf-ui-code-module-language",
29
+ pre: "imf-ui-code-module-pre",
30
+ separator: "imf-ui-code-module-separator"
31
+ }, S = /* @__PURE__ */ e({
32
+ Block: () => T,
33
+ Inline: () => C,
34
+ InlineLink: () => w
35
+ });
36
+ function C({ copyable: e = !1, children: i, render: a, ...o }) {
37
+ let { copied: s, copy: c } = b(), l = g(null), u = s ? n : t;
38
+ return y({
39
+ defaultTagName: "code",
40
+ render: a,
41
+ props: {
42
+ ...v(o, {
43
+ className: x.inline,
44
+ children: /* @__PURE__ */ p(d, { children: [
45
+ /* @__PURE__ */ f("span", {
46
+ ref: l,
47
+ children: i
48
+ }),
49
+ e && /* @__PURE__ */ f("span", { className: x.separator }),
50
+ e && /* @__PURE__ */ f("button", {
51
+ type: "button",
52
+ className: x.inlineCopy,
53
+ "data-copied": s || void 0,
54
+ "aria-label": s ? "Copied" : "Copy",
55
+ onClick: () => c(l.current?.textContent ?? ""),
56
+ children: /* @__PURE__ */ f(r, {
57
+ glyph: u,
58
+ size: 12,
59
+ strokeWidth: 2,
60
+ "aria-hidden": !0
61
+ })
62
+ })
63
+ ] })
64
+ }),
65
+ "data-imf-ui-component": "Code.Inline"
66
+ }
67
+ });
68
+ }
69
+ C.displayName = "Code.Inline";
70
+ function w({ kind: e = "external", ...t }) {
71
+ let n = e === "external" ? {
72
+ target: "_blank",
73
+ rel: "noreferrer"
74
+ } : {};
75
+ return y({
76
+ defaultTagName: "a",
77
+ render: t.render,
78
+ props: {
79
+ ...v(n, t, {
80
+ className: u(x.inline, x.inlineLink, t.className),
81
+ children: t.children
82
+ }),
83
+ "data-imf-ui-component": "Code.InlineLink",
84
+ "data-kind": e
85
+ }
86
+ });
87
+ }
88
+ w.displayName = "Code.InlineLink";
89
+ function T({ className: e, language: i, hideCopy: d = !1, children: m, ...h }) {
90
+ let { copied: _, copy: v } = b(), y = g(null), S = _ ? n : t;
91
+ return /* @__PURE__ */ p("div", {
92
+ "data-imf-ui-component": "Code.Block",
93
+ className: u(x.block, e),
94
+ children: [
95
+ i != null && /* @__PURE__ */ f("span", {
96
+ className: x.language,
97
+ children: i
98
+ }),
99
+ !d && /* @__PURE__ */ f("button", {
100
+ type: "button",
101
+ className: x.copy,
102
+ "data-copied": _ || void 0,
103
+ "aria-label": _ ? "Copied" : "Copy",
104
+ onClick: () => v(y.current?.textContent ?? ""),
105
+ children: /* @__PURE__ */ f(r, {
106
+ glyph: S,
107
+ size: 12,
108
+ strokeWidth: 2,
109
+ "aria-hidden": !0
110
+ })
111
+ }),
112
+ /* @__PURE__ */ p(o, { children: [/* @__PURE__ */ f(l, { children: /* @__PURE__ */ f(s, { children: /* @__PURE__ */ f("pre", {
113
+ ...h,
114
+ className: x.pre,
115
+ children: /* @__PURE__ */ f("code", {
116
+ ref: y,
117
+ children: m
118
+ })
119
+ }) }) }), /* @__PURE__ */ f(a, {
120
+ orientation: "horizontal",
121
+ children: /* @__PURE__ */ f(c, {})
122
+ })] })
123
+ ]
124
+ });
125
+ }
126
+ T.displayName = "Code.Block";
127
+ //#endregion
128
+ //#region src/components/code/code.meta.ts
129
+ var E = {
130
+ name: "Code",
131
+ category: i.display,
132
+ status: "stable",
133
+ namespace: !0,
134
+ description: "Displays source code inline or in a block, with optional language labels and copying. Also called a code snippet or code block.",
135
+ origin: "native",
136
+ internalDependencies: ["ScrollArea"]
137
+ };
138
+ //#endregion
139
+ export { S as a, w as i, T as n, b as o, C as r, E as t };
@@ -1,4 +1,3 @@
1
- import { useRender } from '@base-ui/react/use-render';
2
1
  import { VariantProps } from 'class-variance-authority';
3
2
  import * as AvatarParts from '../avatar/avatar';
4
3
  declare const root: (props?: ({
@@ -6,8 +5,9 @@ declare const root: (props?: ({
6
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
6
  type RootProps = React.ComponentProps<"div"> & VariantProps<typeof root>;
8
7
  /**
9
- * AccountCard.Root — the signed-in person's card: `AccountCard.Link` and, in its top row, `AccountCard.Action`. The
10
- * action sits beside the link, not inside it, since a link cannot contain a button.
8
+ * AccountCard.Root — the signed-in person's row, holding `AccountCard.Avatar`, `AccountCard.Title`, `AccountCard.Subtitle`,
9
+ * `AccountCard.Description`, `AccountCard.Role`, and, at its top right, `AccountCard.Action`. The row itself is not
10
+ * interactive; the action's buttons are.
11
11
  */
12
12
  declare function Root({
13
13
  /** Explicit saturated-surface context; this is never inferred from an ancestor. */
@@ -15,15 +15,6 @@ context, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
15
15
  declare namespace Root {
16
16
  var displayName: string;
17
17
  }
18
- /**
19
- * AccountCard.Link — the link to the account, holding `AccountCard.Avatar`, `AccountCard.Title`,
20
- * `AccountCard.Subtitle`, `AccountCard.Description`, and `AccountCard.Role`. Pass a router link through `render`. Its
21
- * accessible name is its text; the avatar stays decorative.
22
- */
23
- declare function Link({ render, ...props }: useRender.ComponentProps<"a">): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
24
- declare namespace Link {
25
- var displayName: string;
26
- }
27
18
  type AvatarProps = React.ComponentProps<"span"> & {
28
19
  /** The person's photo. Until it loads, and when it fails, the initials or the person glyph show instead. */
29
20
  src?: string;
@@ -39,8 +30,8 @@ declare namespace Avatar {
39
30
  var displayName: string;
40
31
  }
41
32
  /**
42
- * AccountCard.Title — the account's name, or the email's local part until a name exists. Set large; text wraps before
43
- * an `@` and after a dot.
33
+ * AccountCard.Title — the account's name, or the email's local part until a name exists. Text wraps before an `@` and
34
+ * after a dot.
44
35
  */
45
36
  declare function Title({ children, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
46
37
  declare namespace Title {
@@ -54,30 +45,22 @@ declare function Subtitle({ children, ...props }: React.ComponentProps<"span">):
54
45
  declare namespace Subtitle {
55
46
  var displayName: string;
56
47
  }
57
- /** AccountCard.Description — the organization, under a rule at the foot of the card. */
48
+ /** AccountCard.Description — the organization, set apart below the subtitle. */
58
49
  declare function Description(props: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
59
50
  declare namespace Description {
60
51
  var displayName: string;
61
52
  }
62
- /** AccountCard.Role — a mono uppercase label beside the description, such as the person's role. */
53
+ /** AccountCard.Role — a mono uppercase label under the description, such as the person's role. */
63
54
  declare function Role(props: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
64
55
  declare namespace Role {
65
56
  var displayName: string;
66
57
  }
67
58
  /**
68
- * AccountCard.Action — a slot in the card's top row, beside the link, such as a ghost icon `Button` that logs out. The
59
+ * AccountCard.Action — the card's top-right slot for ghost `IconButton`s, such as one that logs out. The
69
60
  * button carries its own `aria-label` and its own `context`.
70
61
  */
71
62
  declare function Action(props: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
72
63
  declare namespace Action {
73
64
  var displayName: string;
74
65
  }
75
- /**
76
- * AccountCard.Group — a list of cards, such as accounts to switch between. Inside it a link with `aria-current="page"`
77
- * shows as current; a standalone card is always the signed-in account and shows no current state.
78
- */
79
- declare function Group(props: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
80
- declare namespace Group {
81
- var displayName: string;
82
- }
83
- export { Root, Link, Avatar, Title, Subtitle, Description, Role, Action, Group };
66
+ export { Root, Avatar, Title, Subtitle, Description, Role, Action };
@@ -18,12 +18,19 @@ type DrawerProps = {
18
18
  /** Called when the drawer asks to open or close: scrim, swipe, or Escape. */
19
19
  onOpenChange?: (open: boolean) => void;
20
20
  };
21
- type NavbarProps = React.ComponentProps<"nav"> & VariantProps<typeof navbarSurface> & DrawerProps;
21
+ type NavbarProps = React.ComponentProps<"nav"> & VariantProps<typeof navbarSurface> & DrawerProps & {
22
+ /** The brand at the top of the rail. Defaults to the ImFusion logo; `null` leaves the row empty. */
23
+ logo?: React.ReactNode;
24
+ /** The signed-in account at the foot of the rail, usually an `AccountCard`. Without it the foot is omitted. */
25
+ account?: React.ReactNode;
26
+ };
22
27
  /**
23
- * `variant="branded"` paints the primary color; children opt into on-color themselves. Below `md` the navbar opens as a
24
- * drawer from the inline end.
28
+ * The navbar owns its frame: `logo` on top, the children (nav items) in the middle, `account` at the foot. Without a
29
+ * Header the logo's bottom edge sits on the baseline of Main's first heading. `variant="branded"` paints the primary
30
+ * color; children opt into on-color themselves. Below `md` the navbar opens as a drawer from the inline start, with its
31
+ * close on the logo row.
25
32
  */
26
- declare function Navbar({ variant, open, onOpenChange, ...props }: NavbarProps): import("react/jsx-runtime").JSX.Element;
33
+ declare function Navbar({ variant, open, onOpenChange, logo, account, children, ...props }: NavbarProps): import("react/jsx-runtime").JSX.Element;
27
34
  declare namespace Navbar {
28
35
  var displayName: string;
29
36
  }
@@ -34,9 +41,11 @@ type AsideProps = React.ComponentProps<"aside"> & DrawerProps & {
34
41
  onWidthChange?: (width: number) => void;
35
42
  /** Accessible name of the drag handle. */
36
43
  resizeLabel?: string;
44
+ /** Accessible name of the close button shown while the aside is a drawer. */
45
+ closeLabel?: string;
37
46
  };
38
47
  /** Below `lg` the aside opens as a drawer: from the bottom on phones, from the inline end on tablets. */
39
- declare function Aside({ open, onOpenChange, resizable, onWidthChange, resizeLabel, children, ...props }: AsideProps): import("react/jsx-runtime").JSX.Element;
48
+ declare function Aside({ open, onOpenChange, resizable, onWidthChange, resizeLabel, closeLabel, children, ...props }: AsideProps): import("react/jsx-runtime").JSX.Element;
40
49
  declare namespace Aside {
41
50
  var displayName: string;
42
51
  }
@@ -44,7 +53,7 @@ declare function Footer(props: React.ComponentProps<"footer">): import("react/js
44
53
  declare namespace Footer {
45
54
  var displayName: string;
46
55
  }
47
- declare function Main(props: React.ComponentProps<"main">): import("react/jsx-runtime").JSX.Element;
56
+ declare function Main({ children, ...props }: React.ComponentProps<"main">): import("react/jsx-runtime").JSX.Element;
48
57
  declare namespace Main {
49
58
  var displayName: string;
50
59
  }
@@ -57,16 +66,17 @@ declare namespace Section {
57
66
  var displayName: string;
58
67
  }
59
68
  type BurgerProps = React.ComponentProps<typeof ButtonPrimitive> & {
60
- /** Whether the navigation it controls is open; draws the cross and sets `aria-expanded`. */
69
+ /** Draws the cross and sets `aria-expanded`. Defaults to whether the navbar drawer is open. */
61
70
  opened?: boolean;
62
71
  /** Accessible name. Defaults to "Open navigation" or "Close navigation" from `opened`. */
63
72
  label?: string;
64
73
  };
65
74
  /**
66
- * AppShell.Burger — the header's menu toggle: three sheared bands that cross when `opened`. Takes its color from the
67
- * surface and hides from `md` up, where the navbar is docked.
75
+ * AppShell.Burger — the menu toggle: three sheared bands that cross while the navbar drawer is open. With no props it
76
+ * opens and closes that drawer. Takes its color from the surface and hides from `md` up, where the navbar is docked, and
77
+ * steps back while the drawer is open, so the drawer's own close is the only one shown.
68
78
  */
69
- declare function Burger({ opened, label, className, ...props }: BurgerProps): import("react/jsx-runtime").JSX.Element;
79
+ declare function Burger({ opened, label, className, onClick, ...props }: BurgerProps): import("react/jsx-runtime").JSX.Element;
70
80
  declare namespace Burger {
71
81
  var displayName: string;
72
82
  }
@@ -78,7 +88,7 @@ type NavItemProps = useRender.ComponentProps<"a"> & {
78
88
  };
79
89
  /**
80
90
  * AppShell.NavItem — a navbar link: icon, mono label, and an optional description. Takes its color from the navbar;
81
- * `aria-current="page"` marks the current page. Pass a router link through `render`.
91
+ * `aria-current="page"` underlines the label. Pass a router link through `render`.
82
92
  */
83
93
  declare function NavItem({ icon, description, children, render, ...props }: NavItemProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
84
94
  declare namespace NavItem {
@@ -22,7 +22,7 @@ declare function Icon({ children, ...props }: React.ComponentProps<"span">): imp
22
22
  declare namespace Icon {
23
23
  var displayName: string;
24
24
  }
25
- /** Callout.Title — an optional short heading, set in the semi-mono UPPERCASE technical voice. */
25
+ /** Callout.Title — an optional short heading, set in the mono UPPERCASE technical voice. */
26
26
  declare function Title(props: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
27
27
  declare namespace Title {
28
28
  var displayName: string;
@@ -7,5 +7,5 @@ type Props = React.ComponentProps<"span"> & VariantProps<typeof chip> & {
7
7
  * Chip — compact inline label for status or category.
8
8
  * Not based on any upstream component.
9
9
  */
10
- export declare function Chip({ variant, appearance, inline, ...props }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export declare function Chip({ variant, appearance, inline, children, ...props }: Props): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -0,0 +1,3 @@
1
+ import { ColorSchemePreference } from '../../types/theme';
2
+ /** Narrows a `ToggleGroup` value entry to a scheme preference. */
3
+ export declare function isColorSchemePreference(value: unknown): value is ColorSchemePreference;