@diegopluna/narvi 0.1.0 → 0.2.0
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/README.md +102 -41
- package/dist/base.css +2 -2
- package/dist/color.d.ts +1 -1
- package/dist/color.js +1 -1
- package/dist/components/activity/ActivityContent.svelte +3 -15
- package/dist/components/activity/ActivityStep.svelte +12 -12
- package/dist/components/activity/ActivityThought.svelte +4 -4
- package/dist/components/activity/ActivityTrigger.svelte +3 -3
- package/dist/components/app-shell/AppShellBar.svelte +89 -0
- package/dist/components/app-shell/AppShellBar.svelte.d.ts +20 -0
- package/dist/components/app-shell/AppShellHeader.svelte +17 -16
- package/dist/components/app-shell/AppShellHeader.svelte.d.ts +2 -2
- package/dist/components/app-shell/AppShellMain.svelte +4 -20
- package/dist/components/app-shell/AppShellPanel.svelte +21 -19
- package/dist/components/app-shell/AppShellPanes.svelte +58 -0
- package/dist/components/app-shell/AppShellPanes.svelte.d.ts +11 -0
- package/dist/components/app-shell/AppShellRail.svelte +85 -0
- package/dist/components/app-shell/AppShellRail.svelte.d.ts +11 -0
- package/dist/components/app-shell/AppShellRoot.svelte +50 -24
- package/dist/components/app-shell/AppShellRoot.svelte.d.ts +8 -6
- package/dist/components/app-shell/AppShellSheet.svelte +95 -0
- package/dist/components/app-shell/AppShellSheet.svelte.d.ts +17 -0
- package/dist/components/app-shell/AppShellSidebar.svelte +37 -61
- package/dist/components/app-shell/AppShellSidebar.svelte.d.ts +1 -5
- package/dist/components/app-shell/AppShellToggle.svelte +62 -23
- package/dist/components/app-shell/AppShellToggle.svelte.d.ts +2 -0
- package/dist/components/app-shell/context.d.ts +6 -0
- package/dist/components/app-shell/index.d.ts +9 -1
- package/dist/components/app-shell/index.js +5 -1
- package/dist/components/approval/Approval.svelte +91 -19
- package/dist/components/approval/Approval.svelte.d.ts +7 -0
- package/dist/components/avatar/AvatarFallback.svelte +1 -2
- package/dist/components/avatar/AvatarRoot.svelte +2 -2
- package/dist/components/badge/Badge.svelte +5 -5
- package/dist/components/button/Button.svelte +219 -40
- package/dist/components/button/Button.svelte.d.ts +38 -2
- package/dist/components/card/Card.svelte +15 -26
- package/dist/components/change-stats/ChangeStats.svelte +1 -2
- package/dist/components/changes-summary/ChangesSummary.svelte +14 -15
- package/dist/components/checkbox/Checkbox.svelte +18 -15
- package/dist/components/checkbox/Checkbox.svelte.d.ts +5 -0
- package/dist/components/code/Code.svelte +1 -2
- package/dist/components/collapsible/CollapsibleTrigger.svelte +2 -2
- package/dist/components/command/CommandItem.svelte +1 -1
- package/dist/components/command/styles.d.ts +3 -2
- package/dist/components/command/styles.js +13 -10
- package/dist/components/composer/ComposerAttachButton.svelte +1 -1
- package/dist/components/composer/ComposerAttachment.svelte +9 -12
- package/dist/components/composer/ComposerModelPicker.svelte +18 -20
- package/dist/components/composer/ComposerRoot.svelte +8 -7
- package/dist/components/composer/ComposerSubmit.svelte +8 -15
- package/dist/components/composer/ComposerTextarea.svelte +1 -1
- package/dist/components/composer/ComposerToggle.svelte +9 -11
- package/dist/components/composer/ComposerTray.svelte +78 -0
- package/dist/components/composer/ComposerTray.svelte.d.ts +15 -0
- package/dist/components/composer/index.d.ts +3 -1
- package/dist/components/composer/index.js +3 -2
- package/dist/components/conversation/ConversationContent.svelte +3 -2
- package/dist/components/conversation/ConversationEmpty.svelte +1 -1
- package/dist/components/conversation/ConversationScrollButton.svelte +3 -3
- package/dist/components/dialog/ConfirmDialog.svelte +1 -1
- package/dist/components/dialog/styles.d.ts +2 -3
- package/dist/components/dialog/styles.js +5 -6
- package/dist/components/divider/Divider.svelte +3 -3
- package/dist/components/empty-state/EmptyState.svelte +4 -5
- package/dist/components/field/Field.svelte +4 -4
- package/dist/components/frame/Frame.svelte +6 -7
- package/dist/components/frame/Frame.svelte.d.ts +1 -1
- package/dist/components/heading/Heading.svelte +2 -2
- package/dist/components/kbd/Kbd.svelte +12 -7
- package/dist/components/link/Link.svelte +7 -3
- package/dist/components/link/Link.svelte.d.ts +4 -1
- package/dist/components/markdown/Markdown.svelte +714 -0
- package/dist/components/markdown/Markdown.svelte.d.ts +80 -0
- package/dist/components/markdown/MarkdownBlock.svelte +231 -0
- package/dist/components/markdown/MarkdownBlock.svelte.d.ts +11 -0
- package/dist/components/markdown/MarkdownBlocks.svelte +115 -0
- package/dist/components/markdown/MarkdownBlocks.svelte.d.ts +15 -0
- package/dist/components/markdown/MarkdownCode.svelte +583 -0
- package/dist/components/markdown/MarkdownCode.svelte.d.ts +23 -0
- package/dist/components/markdown/MarkdownDiagram.svelte +310 -0
- package/dist/components/markdown/MarkdownDiagram.svelte.d.ts +6 -0
- package/dist/components/markdown/MarkdownFile.svelte +134 -0
- package/dist/components/markdown/MarkdownFile.svelte.d.ts +19 -0
- package/dist/components/markdown/MarkdownFootnotes.svelte +61 -0
- package/dist/components/markdown/MarkdownFootnotes.svelte.d.ts +8 -0
- package/dist/components/markdown/MarkdownFresh.svelte +69 -0
- package/dist/components/markdown/MarkdownFresh.svelte.d.ts +6 -0
- package/dist/components/markdown/MarkdownHtml.svelte +72 -0
- package/dist/components/markdown/MarkdownHtml.svelte.d.ts +7 -0
- package/dist/components/markdown/MarkdownImage.svelte +150 -0
- package/dist/components/markdown/MarkdownImage.svelte.d.ts +8 -0
- package/dist/components/markdown/MarkdownInlines.svelte +225 -0
- package/dist/components/markdown/MarkdownInlines.svelte.d.ts +7 -0
- package/dist/components/markdown/MarkdownLink.svelte +120 -0
- package/dist/components/markdown/MarkdownLink.svelte.d.ts +25 -0
- package/dist/components/markdown/MarkdownMath.svelte +138 -0
- package/dist/components/markdown/MarkdownMath.svelte.d.ts +7 -0
- package/dist/components/markdown/MarkdownTable.svelte +265 -0
- package/dist/components/markdown/MarkdownTable.svelte.d.ts +17 -0
- package/dist/components/markdown/caret.d.ts +14 -0
- package/dist/components/markdown/caret.js +67 -0
- package/dist/components/markdown/context.d.ts +93 -0
- package/dist/components/markdown/context.js +128 -0
- package/dist/components/markdown/copy.d.ts +13 -0
- package/dist/components/markdown/copy.js +74 -0
- package/dist/components/markdown/hidden.d.ts +12 -0
- package/dist/components/markdown/hidden.js +31 -0
- package/dist/components/markdown/kept.d.ts +32 -0
- package/dist/components/markdown/kept.js +71 -0
- package/dist/components/markdown/labels.d.ts +46 -0
- package/dist/components/markdown/labels.js +35 -0
- package/dist/components/markdown/save.d.ts +11 -0
- package/dist/components/markdown/save.js +58 -0
- package/dist/components/markdown/scrollable.d.ts +24 -0
- package/dist/components/markdown/scrollable.js +152 -0
- package/dist/components/markdown/static.d.ts +37 -0
- package/dist/components/markdown/static.js +233 -0
- package/dist/components/markdown/styles.d.ts +328 -0
- package/dist/components/markdown/styles.js +302 -0
- package/dist/components/menu/MenuRadioItem.svelte +3 -3
- package/dist/components/menu/index.d.ts +23 -0
- package/dist/components/menu/index.js +3 -1
- package/dist/components/message/MessageAction.svelte +22 -2
- package/dist/components/message/MessageAction.svelte.d.ts +9 -0
- package/dist/components/message/MessageContent.svelte +2 -3
- package/dist/components/message/MessageCopy.svelte +62 -3
- package/dist/components/message/MessageCopy.svelte.d.ts +17 -1
- package/dist/components/message/MessageHeader.svelte +3 -3
- package/dist/components/message/MessagePending.svelte +1 -1
- package/dist/components/message/MessageTime.svelte +1 -1
- package/dist/components/notice/Notice.svelte +14 -10
- package/dist/components/plan/Plan.svelte +22 -17
- package/dist/components/progress/Progress.svelte +31 -33
- package/dist/components/questionnaire/Questionnaire.svelte +19 -22
- package/dist/components/queued-message/QueuedMessage.svelte +14 -7
- package/dist/components/rail/RailItem.svelte +37 -34
- package/dist/components/rail/RailItem.svelte.d.ts +3 -1
- package/dist/components/rail/RailRoot.svelte +18 -4
- package/dist/components/rail/RailRoot.svelte.d.ts +1 -1
- package/dist/components/rail/RailSeparator.svelte +17 -0
- package/dist/components/rail/RailSeparator.svelte.d.ts +18 -0
- package/dist/components/rail/index.d.ts +2 -1
- package/dist/components/rail/index.js +2 -1
- package/dist/components/reasoning/ReasoningContent.svelte +4 -8
- package/dist/components/reasoning/ReasoningTrigger.svelte +2 -2
- package/dist/components/resize-handle/ResizeHandle.svelte +2 -3
- package/dist/components/segmented/SegmentedControl.svelte +7 -8
- package/dist/components/select/Select.svelte +1 -1
- package/dist/components/separator/Separator.svelte +1 -1
- package/dist/components/settings-row/SettingsRow.svelte +5 -5
- package/dist/components/shimmer/Shimmer.svelte +34 -21
- package/dist/components/sidebar/SidebarContent.svelte +1 -1
- package/dist/components/sidebar/SidebarFolder.svelte +142 -0
- package/dist/components/sidebar/SidebarFolder.svelte.d.ts +19 -0
- package/dist/components/sidebar/SidebarFooter.svelte +1 -1
- package/dist/components/sidebar/SidebarGroup.svelte +36 -32
- package/dist/components/sidebar/SidebarGroup.svelte.d.ts +3 -3
- package/dist/components/sidebar/SidebarHeader.svelte +12 -6
- package/dist/components/sidebar/SidebarHeader.svelte.d.ts +4 -1
- package/dist/components/sidebar/SidebarItem.svelte +26 -32
- package/dist/components/sidebar/SidebarRoot.svelte +62 -0
- package/dist/components/sidebar/SidebarRoot.svelte.d.ts +14 -0
- package/dist/components/sidebar/index.d.ts +5 -1
- package/dist/components/sidebar/index.js +3 -1
- package/dist/components/skeleton/Skeleton.svelte +26 -15
- package/dist/components/slider/Slider.svelte +11 -10
- package/dist/components/spinner/Spinner.svelte +4 -11
- package/dist/components/status-indicator/StatusIndicator.svelte +1 -1
- package/dist/components/suggestions/SuggestionsItem.svelte +5 -5
- package/dist/components/switch/Switch.svelte +9 -14
- package/dist/components/tab-strip/TabStrip.svelte +340 -0
- package/dist/components/tab-strip/TabStrip.svelte.d.ts +31 -0
- package/dist/components/tabs/Tabs.svelte +13 -9
- package/dist/components/tabs/Tabs.svelte.d.ts +4 -0
- package/dist/components/text/Text.svelte +31 -23
- package/dist/components/text/Text.svelte.d.ts +8 -4
- package/dist/components/toast/Toaster.svelte +5 -5
- package/dist/components/tool/ToolContent.svelte +3 -8
- package/dist/components/tool/ToolSection.svelte +4 -5
- package/dist/components/tool/ToolTrigger.svelte +10 -9
- package/dist/components/tooltip/TooltipContent.svelte +3 -3
- package/dist/components/work-fold/WorkFold.svelte +5 -9
- package/dist/index.d.ts +16 -8
- package/dist/index.js +17 -10
- package/dist/internal/Code.svelte +3 -4
- package/dist/internal/Glyph.svelte +16 -0
- package/dist/internal/Glyph.svelte.d.ts +6 -0
- package/dist/internal/Tile.svelte +17 -37
- package/dist/internal/control.d.ts +4 -4
- package/dist/internal/control.js +20 -17
- package/dist/internal/layer.d.ts +3 -5
- package/dist/internal/layer.js +10 -12
- package/dist/internal/markers.stylex.d.ts +8 -0
- package/dist/internal/markers.stylex.js +4 -0
- package/dist/internal/plugin-order.d.ts +8 -0
- package/dist/internal/plugin-order.js +16 -0
- package/dist/internal/roving.js +5 -2
- package/dist/internal/shared.d.ts +8 -1
- package/dist/internal/shared.js +21 -5
- package/dist/internal/sx.d.ts +1 -1
- package/dist/internal/toggle.d.ts +1 -2
- package/dist/internal/toggle.js +8 -12
- package/dist/internal/visible.d.ts +32 -0
- package/dist/internal/visible.js +44 -0
- package/dist/markdown/ast.d.ts +209 -0
- package/dist/markdown/ast.js +10 -0
- package/dist/markdown/blocks.d.ts +177 -0
- package/dist/markdown/blocks.js +1489 -0
- package/dist/markdown/code-info.d.ts +10 -0
- package/dist/markdown/code-info.js +16 -0
- package/dist/markdown/common.d.ts +25 -0
- package/dist/markdown/common.js +107 -0
- package/dist/markdown/diagrams.d.ts +2 -0
- package/dist/markdown/diagrams.js +18 -0
- package/dist/markdown/file-paths.d.ts +29 -0
- package/dist/markdown/file-paths.js +80 -0
- package/dist/markdown/files.d.ts +16 -0
- package/dist/markdown/files.js +133 -0
- package/dist/markdown/highlight.d.ts +30 -0
- package/dist/markdown/highlight.js +127 -0
- package/dist/markdown/html.d.ts +23 -0
- package/dist/markdown/html.js +289 -0
- package/dist/markdown/images.d.ts +15 -0
- package/dist/markdown/images.js +45 -0
- package/dist/markdown/index.d.ts +12 -0
- package/dist/markdown/index.js +5 -0
- package/dist/markdown/inlines.d.ts +48 -0
- package/dist/markdown/inlines.js +1714 -0
- package/dist/markdown/math.d.ts +2 -0
- package/dist/markdown/math.js +22 -0
- package/dist/markdown/parse.d.ts +81 -0
- package/dist/markdown/parse.js +204 -0
- package/dist/markdown/plugin.d.ts +178 -0
- package/dist/markdown/plugin.js +160 -0
- package/dist/markdown/sanitize.d.ts +78 -0
- package/dist/markdown/sanitize.js +522 -0
- package/dist/markdown/share.d.ts +12 -0
- package/dist/markdown/share.js +59 -0
- package/dist/markdown/table.d.ts +13 -0
- package/dist/markdown/table.js +60 -0
- package/dist/preset.d.ts +40 -16
- package/dist/preset.js +169 -51
- package/dist/tokens.stylex.d.ts +55 -37
- package/dist/tokens.stylex.js +107 -62
- package/dist/typography.d.ts +48 -0
- package/dist/typography.js +55 -0
- package/dist/vite.d.ts +7 -1
- package/dist/vite.js +27 -2
- package/package.json +53 -6
- package/skills/building-ui/SKILL.md +242 -0
- package/skills/building-ui/references/components.md +207 -0
- package/skills/markdown/SKILL.md +452 -0
- package/skills/markdown/references/plugins.md +103 -0
- package/skills/setup/SKILL.md +191 -0
- package/skills/styling/SKILL.md +269 -0
- package/skills/theming/SKILL.md +184 -0
- package/dist/internal/loop.d.ts +0 -35
- package/dist/internal/loop.js +0 -72
package/README.md
CHANGED
|
@@ -1,49 +1,108 @@
|
|
|
1
1
|
# Narvi
|
|
2
2
|
|
|
3
|
-
A component library for Svelte 5, styled with [StyleX](https://stylexjs.com).
|
|
4
|
-
|
|
3
|
+
A component library for Svelte 5, styled with [StyleX](https://stylexjs.com). Beside buttons and
|
|
4
|
+
dialogs it has the parts an app for AI agents is made of: a window's shell, a conversation, a
|
|
5
|
+
composer, and a timeline of what an agent did. Styles are compiled to atomic CSS at build time, so
|
|
6
|
+
no styling code runs in the browser.
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
Docs, live examples and every component: **[narvi.dpeter.dev](https://narvi.dpeter.dev)**.
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
- the docs site, in `src/routes` and `src/docs`, a prerendered SvelteKit app that uses the library
|
|
10
|
+
## Use it in an app
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Narvi works in a SvelteKit app, or a plain Vite app with the Svelte plugin. It needs Svelte 5.20 or
|
|
13
|
+
later, Vite 6 or later, and browsers with `light-dark()` (Chrome 123, Safari 17.5, Firefox 120).
|
|
14
|
+
It is below 1.0, so pin the version you build against.
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
1. Install it.
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
pnpm add @diegopluna/narvi
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2. Add the plugin after `sveltekit()`, or after `svelte()` in a plain Vite app.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
// vite.config.ts
|
|
26
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
27
|
+
import { narvi } from '@diegopluna/narvi/vite';
|
|
28
|
+
import { defineConfig } from 'vite';
|
|
29
|
+
|
|
30
|
+
export default defineConfig({
|
|
31
|
+
plugins: [sveltekit(), narvi()]
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
3. Start your stylesheet with Narvi's base, and set the page's typeface on the root.
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
/* src/app.css */
|
|
39
|
+
@import '@diegopluna/narvi/base.css';
|
|
40
|
+
|
|
41
|
+
:root {
|
|
42
|
+
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
4. Import that stylesheet once, at the root of the app, and mount `DevStyles` beside it: in
|
|
47
|
+
`src/routes/+layout.svelte`, or in `src/App.svelte` in a plain Vite app.
|
|
48
|
+
|
|
49
|
+
```svelte
|
|
50
|
+
<script lang="ts">
|
|
51
|
+
import '../app.css';
|
|
52
|
+
import { DevStyles } from '@diegopluna/narvi';
|
|
53
|
+
|
|
54
|
+
let { children } = $props();
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<DevStyles />
|
|
58
|
+
|
|
59
|
+
{@render children()}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Then import components by name:
|
|
63
|
+
|
|
64
|
+
```svelte
|
|
65
|
+
<script lang="ts">
|
|
66
|
+
import { Button } from '@diegopluna/narvi';
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<Button variant="primary">Speak, friend</Button>
|
|
16
70
|
```
|
|
17
71
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
| `pnpm lint` | Prettier and ESLint |
|
|
22
|
-
| `pnpm test` | Component tests, in headless Chromium |
|
|
23
|
-
| `pnpm build:lib` | Packages the library into `dist` and lints the package |
|
|
24
|
-
| `pnpm build:docs` | Builds the static docs site into `build` |
|
|
25
|
-
| `pnpm build` | Both of the above |
|
|
72
|
+
The button should be a flat, rounded solid, not the browser's grey. If it is not, or it is while
|
|
73
|
+
you develop and not once built, [Installation](https://narvi.dpeter.dev/docs/installation) lists
|
|
74
|
+
each cause beside its fix. The same page covers typefaces, styles of your own, Tailwind and themes.
|
|
26
75
|
|
|
27
|
-
|
|
76
|
+
A coding agent can load the same instructions from the package:
|
|
77
|
+
`npx @tanstack/intent load @diegopluna/narvi#setup`.
|
|
28
78
|
|
|
29
|
-
##
|
|
79
|
+
## Work on Narvi
|
|
30
80
|
|
|
31
|
-
|
|
81
|
+
This repository holds the library, in `src/lib`, packaged with `svelte-package`, and the docs site,
|
|
82
|
+
in `src/routes` and `src/docs`, a prerendered SvelteKit app that uses the library.
|
|
32
83
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
import { sveltekit } from '@sveltejs/kit/vite';
|
|
36
|
-
import { narvi } from '@diegopluna/narvi/vite';
|
|
37
|
-
import { defineConfig } from 'vite';
|
|
84
|
+
You need Node 24, which is what CI runs, and pnpm at the version in `package.json`
|
|
85
|
+
(`corepack enable` picks it up).
|
|
38
86
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
87
|
+
```sh
|
|
88
|
+
pnpm install
|
|
89
|
+
pnpm exec playwright install chromium-headless-shell # once, for the tests
|
|
90
|
+
pnpm dev # the docs, at http://localhost:5173
|
|
42
91
|
```
|
|
43
92
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
93
|
+
| Command | What it does |
|
|
94
|
+
| -------------------- | ------------------------------------------------------------------------ |
|
|
95
|
+
| `pnpm check` | Type-checks the library and the docs |
|
|
96
|
+
| `pnpm lint` | Prettier, ESLint, and Narvi's own design rules |
|
|
97
|
+
| `pnpm test` | Component tests, in headless Chromium |
|
|
98
|
+
| `pnpm test:browsers` | The Markdown tests in Firefox and WebKit (`playwright install` them too) |
|
|
99
|
+
| `pnpm build:lib` | Packages the library into `dist` and lints the package |
|
|
100
|
+
| `pnpm build:docs` | Builds the static docs site into `build` |
|
|
101
|
+
| `pnpm build` | Both of the above |
|
|
102
|
+
|
|
103
|
+
Before a pull request, run `pnpm check`, `pnpm lint` and `pnpm test`, then `pnpm build` if the
|
|
104
|
+
change touches the package or the docs. CI runs the same steps. `AGENTS.md` holds the rules a
|
|
105
|
+
component and a design decision are held to.
|
|
47
106
|
|
|
48
107
|
## Release
|
|
49
108
|
|
|
@@ -55,9 +114,9 @@ publish succeeds, so a failed run can be run again.
|
|
|
55
114
|
## How it is put together
|
|
56
115
|
|
|
57
116
|
- **Tokens** live in `src/lib/tokens.stylex.ts`. Colours hold a light and a dark value in one
|
|
58
|
-
`light-dark()` declaration, so the theme follows `color-scheme`. The palette is
|
|
59
|
-
|
|
60
|
-
|
|
117
|
+
`light-dark()` declaration, so the theme follows `color-scheme`. The default palette is a grey
|
|
118
|
+
with a trace of blue, a dark grey by night and white on grey by day, and one blue accent that
|
|
119
|
+
is kept for state: focus, selection and progress. A preset (`src/lib/preset.ts`) swaps both.
|
|
61
120
|
- **Conditions** live in `src/lib/media.stylex.ts`: `media.hover`, `media.motion`, `media.forcedColors`
|
|
62
121
|
and the rest, and the breakpoints `sm` to `xl`, as `defineConsts` constants that any file can import.
|
|
63
122
|
- **The base stylesheet**, `src/lib/base.css`, holds what belongs on the document: `color-scheme`, the
|
|
@@ -70,17 +129,18 @@ publish succeeds, so a failed run can be run again.
|
|
|
70
129
|
`<script module>` block and applied with the `attrs` helper from `src/lib/internal/sx.ts`, which
|
|
71
130
|
also merges the consumer's `sx` and `class`. Interface text inherits the page's font; only large
|
|
72
131
|
headings bring their own, a serif.
|
|
73
|
-
- **Edges are shadows.** Hairlines
|
|
132
|
+
- **Edges are shadows.** Hairlines are drawn with `box-shadow`, so
|
|
74
133
|
`src/lib/internal/shared.ts` adds a transparent outline that becomes the edge in forced-colours
|
|
75
|
-
mode. Control boundaries (`colors.
|
|
134
|
+
mode. Control boundaries (`colors.borderControl`) hold 3:1 against their surface.
|
|
76
135
|
- **The Vite plugin** in `src/lib/vite.ts` is a preset over `@stylexjs/unplugin`. It puts every
|
|
77
136
|
style in one cascade layer, `narvi`, so unlayered CSS beats it, and declares `narvi.base` first
|
|
78
137
|
inside it, so `base.css` stays below the components whichever stylesheet loads first. `narvi({ tailwind: true })`
|
|
79
|
-
orders that layer between Tailwind's `base` and its `components` and `utilities`.
|
|
138
|
+
orders that layer between Tailwind's `base` and its `components` and `utilities`. It also says so
|
|
139
|
+
when it is listed before the Svelte plugin, and targets browsers that have `light-dark()`, so
|
|
140
|
+
Vite does not rewrite it in the app's own stylesheet.
|
|
80
141
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
movement behind `prefers-reduced-motion: no-preference`.
|
|
142
|
+
Hover styles sit behind `@media (hover: hover) and (pointer: fine)` and movement behind
|
|
143
|
+
`prefers-reduced-motion: no-preference`.
|
|
84
144
|
|
|
85
145
|
### Adding a component
|
|
86
146
|
|
|
@@ -93,7 +153,8 @@ movement behind `prefers-reduced-motion: no-preference`.
|
|
|
93
153
|
Readers can press Edit to change the example and see it re-render as they type: the
|
|
94
154
|
compiler and editor (`src/docs/live/`) load only then. Examples that define their own
|
|
95
155
|
StyleX styles stay read-only, because StyleX compiles at build time.
|
|
96
|
-
4. Add the page to `src/docs/nav.ts
|
|
156
|
+
4. Add the page to `src/docs/nav.ts`, with its sentence, what it exports and where its source is,
|
|
157
|
+
and a test in `src/tests`.
|
|
97
158
|
|
|
98
159
|
Two StyleX rules to keep in mind: values inside `stylex.create` must be known at build time, so a
|
|
99
160
|
media query comes from `media.stylex.js` (or is written in the same file), and tokens and media
|
package/dist/base.css
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
/* Narvi's colours take their light or dark half from this. */
|
|
22
22
|
color-scheme: light dark;
|
|
23
23
|
/* The page, on the root rather than the body, so overscroll shows it too */
|
|
24
|
-
background-color: light-dark(#
|
|
25
|
-
color: light-dark(#
|
|
24
|
+
background-color: light-dark(#f3f4f5, #151618); /* colors.bg */
|
|
25
|
+
color: light-dark(#16181c, #eaedf2); /* colors.text */
|
|
26
26
|
/* Narvi's interface text inherits the page's face: set your own on the root */
|
|
27
27
|
font-family:
|
|
28
28
|
system-ui,
|
package/dist/color.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type ResolveColorOptions = {
|
|
|
23
23
|
* ```ts
|
|
24
24
|
* import { colors } from '@diegopluna/narvi/tokens.stylex.js';
|
|
25
25
|
*
|
|
26
|
-
* context.fillStyle = resolveColor(colors.
|
|
26
|
+
* context.fillStyle = resolveColor(colors.accent);
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare function resolveColor(color: string, options?: ResolveColorOptions): string;
|
package/dist/color.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
5
|
import Collapse from '../../internal/Collapse.svelte';
|
|
6
6
|
import type { Sx } from '../../internal/sx.js';
|
|
7
|
-
import { colors } from '../../tokens.stylex.js';
|
|
8
7
|
import { getActivityContext } from './context.js';
|
|
9
8
|
|
|
10
9
|
export type ActivityContentProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
@@ -14,23 +13,12 @@
|
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
const styles = stylex.create({
|
|
17
|
-
// The steps hang from a rail that runs down through the middle of their tiles
|
|
18
16
|
steps: {
|
|
19
|
-
position: 'relative',
|
|
20
17
|
display: 'flex',
|
|
21
18
|
flexDirection: 'column',
|
|
22
|
-
gap: '0.
|
|
23
|
-
paddingTop: '0.
|
|
24
|
-
paddingBottom: '0.25rem'
|
|
25
|
-
'::before': {
|
|
26
|
-
content: '""',
|
|
27
|
-
position: 'absolute',
|
|
28
|
-
top: 0,
|
|
29
|
-
bottom: '0.875rem',
|
|
30
|
-
insetInlineStart: 'calc(0.75rem - 0.5px)',
|
|
31
|
-
width: '1px',
|
|
32
|
-
backgroundImage: `linear-gradient(to bottom, ${colors.lineStrong}, ${colors.line})`
|
|
33
|
-
}
|
|
19
|
+
gap: '0.5rem',
|
|
20
|
+
paddingTop: '0.5rem',
|
|
21
|
+
paddingBottom: '0.25rem'
|
|
34
22
|
}
|
|
35
23
|
});
|
|
36
24
|
</script>
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
const LABELS = { failed: 'Failed', declined: 'Declined', blocked: 'Blocked' };
|
|
37
37
|
|
|
38
38
|
const styles = stylex.create({
|
|
39
|
-
// The
|
|
39
|
+
// The icon sits in a column as wide as the row's own icon above
|
|
40
40
|
step: {
|
|
41
41
|
display: 'grid',
|
|
42
|
-
gridTemplateColumns: '
|
|
42
|
+
gridTemplateColumns: '1rem minmax(0, 1fr)',
|
|
43
43
|
columnGap: '0.625rem',
|
|
44
44
|
rowGap: '0.375rem',
|
|
45
45
|
minWidth: 0
|
|
@@ -58,8 +58,9 @@
|
|
|
58
58
|
textOverflow: 'ellipsis',
|
|
59
59
|
whiteSpace: 'nowrap',
|
|
60
60
|
color: colors.textSubtle,
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
// A `<code>`, in the text's own face
|
|
62
|
+
fontFamily: 'inherit',
|
|
63
|
+
fontSize: font.sizeCaption
|
|
63
64
|
},
|
|
64
65
|
// The file of a path, the program of a command: the part to read first
|
|
65
66
|
main: { color: colors.text },
|
|
@@ -67,10 +68,10 @@
|
|
|
67
68
|
flexShrink: 0,
|
|
68
69
|
paddingBlock: '0.0625rem',
|
|
69
70
|
paddingInline: '0.375rem',
|
|
70
|
-
borderRadius: radius.
|
|
71
|
+
borderRadius: radius.panel,
|
|
71
72
|
backgroundColor: colors.dangerSoft,
|
|
72
|
-
color: colors.
|
|
73
|
-
fontSize:
|
|
73
|
+
color: colors.dangerText,
|
|
74
|
+
fontSize: font.sizeMicro,
|
|
74
75
|
fontWeight: font.weightMedium
|
|
75
76
|
},
|
|
76
77
|
body: {
|
|
@@ -80,19 +81,18 @@
|
|
|
80
81
|
gap: '0.375rem',
|
|
81
82
|
minWidth: 0
|
|
82
83
|
},
|
|
83
|
-
reason: { margin: 0, color: colors.textMuted, fontSize: font.
|
|
84
|
+
reason: { margin: 0, color: colors.textMuted, fontSize: font.sizeMeta },
|
|
84
85
|
output: {
|
|
85
86
|
margin: 0,
|
|
86
87
|
maxHeight: '10rem',
|
|
87
88
|
overflow: 'auto',
|
|
88
89
|
paddingBlock: '0.5rem',
|
|
89
90
|
paddingInline: '0.625rem',
|
|
90
|
-
borderRadius: radius.
|
|
91
|
-
backgroundColor: colors.
|
|
92
|
-
boxShadow: `inset 0 0 0 1px ${colors.line}`,
|
|
91
|
+
borderRadius: radius.control,
|
|
92
|
+
backgroundColor: colors.fillSunken,
|
|
93
93
|
color: colors.textMuted,
|
|
94
94
|
fontFamily: font.mono,
|
|
95
|
-
fontSize: font.
|
|
95
|
+
fontSize: font.sizeCaption,
|
|
96
96
|
lineHeight: font.leadingNormal,
|
|
97
97
|
whiteSpace: 'pre-wrap',
|
|
98
98
|
overflowWrap: 'anywhere',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- The agent's thinking between steps,
|
|
1
|
+
<!-- The agent's thinking between steps, in line with the steps, set apart in italics. -->
|
|
2
2
|
<script lang="ts" module>
|
|
3
3
|
import * as stylex from '@stylexjs/stylex';
|
|
4
4
|
import Tile from '../../internal/Tile.svelte';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
const styles = stylex.create({
|
|
17
17
|
thought: {
|
|
18
18
|
display: 'grid',
|
|
19
|
-
gridTemplateColumns: '
|
|
19
|
+
gridTemplateColumns: '1rem minmax(0, 1fr)',
|
|
20
20
|
columnGap: '0.625rem',
|
|
21
21
|
minWidth: 0
|
|
22
22
|
},
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
body: { display: 'flex', flexDirection: 'column', gap: '0.125rem', minWidth: 0 },
|
|
25
25
|
label: {
|
|
26
26
|
color: colors.textSubtle,
|
|
27
|
-
fontSize: font.
|
|
27
|
+
fontSize: font.sizeCaption,
|
|
28
28
|
fontWeight: font.weightMedium,
|
|
29
29
|
lineHeight: '1.25rem'
|
|
30
30
|
},
|
|
31
31
|
text: {
|
|
32
32
|
margin: 0,
|
|
33
33
|
color: colors.textMuted,
|
|
34
|
-
fontSize: font.
|
|
34
|
+
fontSize: font.sizeMeta,
|
|
35
35
|
fontStyle: 'italic',
|
|
36
36
|
lineHeight: font.leadingNormal
|
|
37
37
|
}
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
margin: 0,
|
|
37
37
|
padding: 0,
|
|
38
38
|
borderWidth: 0,
|
|
39
|
-
borderRadius: radius.
|
|
39
|
+
borderRadius: radius.chip,
|
|
40
40
|
backgroundColor: 'transparent',
|
|
41
41
|
color: { default: colors.textMuted, ':hover': { default: null, [media.hover]: colors.text } },
|
|
42
42
|
fontFamily: 'inherit',
|
|
43
|
-
fontSize: font.
|
|
43
|
+
fontSize: font.sizeBody,
|
|
44
44
|
lineHeight: font.leadingSnug,
|
|
45
45
|
textAlign: 'start',
|
|
46
46
|
cursor: 'pointer',
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
<span {...stylex.attrs(styles.text)}>
|
|
96
96
|
<RollingText {text} shimmer={activity.active} />
|
|
97
97
|
{#if activity.failures > 0}
|
|
98
|
-
<span {...stylex.attrs(styles.failed)}
|
|
98
|
+
<span {...stylex.attrs(styles.failed)}>{failedLabel(activity.failures)}</span>
|
|
99
99
|
{/if}
|
|
100
100
|
</span>
|
|
101
101
|
<span {...stylex.attrs(styles.chevron)}><Chevron open={activity.open} size={12} /></span>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
The window's own bar, across its full width, above the rail and the sheet.
|
|
3
|
+
|
|
4
|
+
It is where macOS's traffic lights sit in a window with a hidden title bar, so
|
|
5
|
+
nothing under it has to be as wide as they are: the rail can be as narrow as its
|
|
6
|
+
tiles. Teams, Slack and VS Code clear the lights the same way.
|
|
7
|
+
-->
|
|
8
|
+
<script lang="ts" module>
|
|
9
|
+
import * as stylex from '@stylexjs/stylex';
|
|
10
|
+
import type { Snippet } from 'svelte';
|
|
11
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
12
|
+
import { shared } from '../../internal/shared.js';
|
|
13
|
+
import { attrs, type Sx } from '../../internal/sx.js';
|
|
14
|
+
import { useAppShell } from './context.js';
|
|
15
|
+
|
|
16
|
+
export type AppShellBarProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
17
|
+
/**
|
|
18
|
+
* Whether the bar drags the window, in Electron with a hidden title bar.
|
|
19
|
+
* Narvi's controls opt out on their own, so they still take clicks.
|
|
20
|
+
*/
|
|
21
|
+
drag?: boolean;
|
|
22
|
+
/** What sits in the middle of the window, whatever is on either side: a search field. */
|
|
23
|
+
center?: Snippet;
|
|
24
|
+
/** What sits at the end: a panel's toggle, the person's avatar, window buttons. */
|
|
25
|
+
end?: Snippet;
|
|
26
|
+
sx?: Sx;
|
|
27
|
+
/** What sits at the start, after the traffic lights: AppShell.Toggle, back and forward. */
|
|
28
|
+
children?: Snippet;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const styles = stylex.create({
|
|
32
|
+
// Three columns, the outer two equal, so the middle one is centred on the window
|
|
33
|
+
bar: {
|
|
34
|
+
gridArea: 'bar',
|
|
35
|
+
display: 'grid',
|
|
36
|
+
gridTemplateColumns: 'minmax(0, 1fr) auto minmax(0, 1fr)',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
columnGap: '0.5rem',
|
|
39
|
+
minWidth: 0,
|
|
40
|
+
height: '2.75rem',
|
|
41
|
+
// Back over the shell's gutter, to the window's edges
|
|
42
|
+
marginTop: '-0.375rem',
|
|
43
|
+
marginInline: '-0.375rem',
|
|
44
|
+
paddingInlineEnd: '0.75rem',
|
|
45
|
+
// Clear of the traffic lights. With none, a 28px control here is centred over the rail's tiles.
|
|
46
|
+
paddingInlineStart: 'calc(0.75rem + var(--narvi-window-inset, 0px))'
|
|
47
|
+
},
|
|
48
|
+
// Spelled out side by side: a longhand outranks the `margin` shorthand
|
|
49
|
+
narrow: { marginTop: 0, marginInline: 0 },
|
|
50
|
+
start: { display: 'flex', alignItems: 'center', gap: '0.125rem', minWidth: 0 },
|
|
51
|
+
center: { display: 'flex', justifyContent: 'center', minWidth: 0 },
|
|
52
|
+
end: {
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'flex-end',
|
|
56
|
+
gap: '0.25rem',
|
|
57
|
+
minWidth: 0
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<script lang="ts">
|
|
63
|
+
let {
|
|
64
|
+
drag = true,
|
|
65
|
+
center,
|
|
66
|
+
end,
|
|
67
|
+
sx,
|
|
68
|
+
class: className,
|
|
69
|
+
children,
|
|
70
|
+
...rest
|
|
71
|
+
}: AppShellBarProps = $props();
|
|
72
|
+
|
|
73
|
+
const shell = useAppShell('Bar');
|
|
74
|
+
|
|
75
|
+
$effect(() => {
|
|
76
|
+
shell.setBar(true);
|
|
77
|
+
return () => shell.setBar(false);
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<header
|
|
82
|
+
data-slot="app-shell-bar"
|
|
83
|
+
{...rest}
|
|
84
|
+
{...attrs([styles.bar, shell.narrow && styles.narrow, drag && shared.dragRegion, sx], className)}
|
|
85
|
+
>
|
|
86
|
+
<div {...stylex.attrs(styles.start)}>{@render children?.()}</div>
|
|
87
|
+
<div {...stylex.attrs(styles.center)}>{@render center?.()}</div>
|
|
88
|
+
<div {...stylex.attrs(styles.end)}>{@render end?.()}</div>
|
|
89
|
+
</header>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { type Sx } from '../../internal/sx.js';
|
|
4
|
+
export type AppShellBarProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the bar drags the window, in Electron with a hidden title bar.
|
|
7
|
+
* Narvi's controls opt out on their own, so they still take clicks.
|
|
8
|
+
*/
|
|
9
|
+
drag?: boolean;
|
|
10
|
+
/** What sits in the middle of the window, whatever is on either side: a search field. */
|
|
11
|
+
center?: Snippet;
|
|
12
|
+
/** What sits at the end: a panel's toggle, the person's avatar, window buttons. */
|
|
13
|
+
end?: Snippet;
|
|
14
|
+
sx?: Sx;
|
|
15
|
+
/** What sits at the start, after the traffic lights: AppShell.Toggle, back and forward. */
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
};
|
|
18
|
+
declare const AppShellBar: import("svelte").Component<AppShellBarProps, {}, "">;
|
|
19
|
+
type AppShellBar = ReturnType<typeof AppShellBar>;
|
|
20
|
+
export default AppShellBar;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
The head of a column of the sheet: the page's title and its actions, or a
|
|
3
|
+
panel's tabs. Every column's head is the same height, so they sit on one line.
|
|
4
|
+
-->
|
|
1
5
|
<script lang="ts" module>
|
|
2
6
|
import * as stylex from '@stylexjs/stylex';
|
|
3
7
|
import type { Snippet } from 'svelte';
|
|
4
8
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
9
|
import { shared } from '../../internal/shared.js';
|
|
6
10
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
7
|
-
import { colors, font
|
|
8
|
-
import { media } from '../../media.stylex.js';
|
|
11
|
+
import { colors, font } from '../../tokens.stylex.js';
|
|
9
12
|
|
|
10
13
|
export type AppShellHeaderProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
11
14
|
/**
|
|
12
|
-
* Whether
|
|
13
|
-
*
|
|
15
|
+
* Whether it drags the window, in Electron. Off by default: AppShell.Bar is the
|
|
16
|
+
* window's drag region. Turn it on in a shell that has no bar.
|
|
14
17
|
*/
|
|
15
18
|
drag?: boolean;
|
|
16
19
|
sx?: Sx;
|
|
@@ -19,29 +22,27 @@
|
|
|
19
22
|
|
|
20
23
|
const styles = stylex.create({
|
|
21
24
|
header: {
|
|
25
|
+
boxSizing: 'border-box',
|
|
22
26
|
display: 'flex',
|
|
23
27
|
alignItems: 'center',
|
|
24
28
|
gap: '0.5rem',
|
|
25
29
|
flexShrink: 0,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
paddingInlineStart:
|
|
31
|
-
|
|
30
|
+
minWidth: 0,
|
|
31
|
+
height: '3rem',
|
|
32
|
+
// The same edge as Sidebar.Header, and as a Conversation's column under it. In a shell
|
|
33
|
+
// with no bar, clear of the traffic lights while the sidebar is away.
|
|
34
|
+
paddingInlineStart: 'max(1rem, calc(var(--narvi-inset-page, 0px) + 0.5rem))',
|
|
35
|
+
paddingInlineEnd: '0.625rem',
|
|
32
36
|
borderBottomWidth: '1px',
|
|
33
37
|
borderBottomStyle: 'solid',
|
|
34
|
-
borderBottomColor: colors.
|
|
35
|
-
fontSize: font.
|
|
36
|
-
transitionProperty: { default: 'none', [media.motion]: 'padding-inline-start' },
|
|
37
|
-
transitionDuration: motion.slow,
|
|
38
|
-
transitionTimingFunction: motion.easeInOut
|
|
38
|
+
borderBottomColor: colors.border,
|
|
39
|
+
fontSize: font.sizeBody
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
</script>
|
|
42
43
|
|
|
43
44
|
<script lang="ts">
|
|
44
|
-
let { drag =
|
|
45
|
+
let { drag = false, sx, class: className, children, ...rest }: AppShellHeaderProps = $props();
|
|
45
46
|
</script>
|
|
46
47
|
|
|
47
48
|
<header
|
|
@@ -3,8 +3,8 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
3
3
|
import { type Sx } from '../../internal/sx.js';
|
|
4
4
|
export type AppShellHeaderProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
5
5
|
/**
|
|
6
|
-
* Whether
|
|
7
|
-
*
|
|
6
|
+
* Whether it drags the window, in Electron. Off by default: AppShell.Bar is the
|
|
7
|
+
* window's drag region. Turn it on in a shell that has no bar.
|
|
8
8
|
*/
|
|
9
9
|
drag?: boolean;
|
|
10
10
|
sx?: Sx;
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
import * as stylex from '@stylexjs/stylex';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
-
import { shared } from '../../internal/shared.js';
|
|
6
5
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
7
|
-
import { colors, radius } from '../../tokens.stylex.js';
|
|
8
|
-
import { useAppShell } from './context.js';
|
|
9
6
|
|
|
10
7
|
export type AppShellMainProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
11
8
|
sx?: Sx;
|
|
@@ -14,36 +11,23 @@
|
|
|
14
11
|
};
|
|
15
12
|
|
|
16
13
|
const styles = stylex.create({
|
|
17
|
-
// The page
|
|
14
|
+
// The page: the column of the sheet that takes whatever room the others leave
|
|
18
15
|
main: {
|
|
19
16
|
position: 'relative',
|
|
20
17
|
display: 'flex',
|
|
21
18
|
flexDirection: 'column',
|
|
22
19
|
flexGrow: 1,
|
|
23
20
|
minWidth: 0,
|
|
24
|
-
|
|
25
|
-
marginInlineEnd: '0.375rem',
|
|
26
|
-
overflow: 'clip',
|
|
27
|
-
borderRadius: radius.frame,
|
|
28
|
-
backgroundColor: colors.bgRaised,
|
|
29
|
-
boxShadow: `inset 0 0 0 1px ${colors.line}, 0 1px 2px ${colors.shade}`,
|
|
21
|
+
minHeight: 0,
|
|
30
22
|
outlineStyle: 'none'
|
|
31
|
-
}
|
|
32
|
-
narrow: { margin: 0, borderRadius: 0, boxShadow: 'none' }
|
|
23
|
+
}
|
|
33
24
|
});
|
|
34
25
|
</script>
|
|
35
26
|
|
|
36
27
|
<script lang="ts">
|
|
37
28
|
let { sx, class: className, children, ...rest }: AppShellMainProps = $props();
|
|
38
|
-
|
|
39
|
-
const shell = useAppShell('Main');
|
|
40
29
|
</script>
|
|
41
30
|
|
|
42
|
-
<main
|
|
43
|
-
tabindex="-1"
|
|
44
|
-
data-slot="app-shell-main"
|
|
45
|
-
{...rest}
|
|
46
|
-
{...attrs([styles.main, shared.edged, shell.narrow && styles.narrow, sx], className)}
|
|
47
|
-
>
|
|
31
|
+
<main tabindex="-1" data-slot="app-shell-main" {...rest} {...attrs([styles.main, sx], className)}>
|
|
48
32
|
{@render children?.()}
|
|
49
33
|
</main>
|