@diegopluna/narvi 0.1.0 → 0.3.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 +2 -2
- package/dist/color.js +1 -1
- package/dist/components/activity/ActivityContent.svelte +5 -17
- package/dist/components/activity/ActivityContent.svelte.d.ts +2 -2
- package/dist/components/activity/ActivityRoot.svelte +5 -5
- package/dist/components/activity/ActivityRoot.svelte.d.ts +5 -5
- package/dist/components/activity/ActivityStep.svelte +21 -21
- package/dist/components/activity/ActivityStep.svelte.d.ts +9 -9
- package/dist/components/activity/ActivityThought.svelte +7 -7
- package/dist/components/activity/ActivityThought.svelte.d.ts +3 -3
- package/dist/components/activity/ActivityTrigger.svelte +8 -8
- package/dist/components/activity/ActivityTrigger.svelte.d.ts +5 -5
- package/dist/components/announcer/Announcer.svelte +5 -18
- package/dist/components/announcer/Announcer.svelte.d.ts +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 +20 -19
- package/dist/components/app-shell/AppShellHeader.svelte.d.ts +5 -5
- package/dist/components/app-shell/AppShellMain.svelte +6 -22
- package/dist/components/app-shell/AppShellMain.svelte.d.ts +2 -2
- package/dist/components/app-shell/AppShellPanel.svelte +27 -25
- package/dist/components/app-shell/AppShellPanel.svelte.d.ts +6 -6
- 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 +58 -32
- package/dist/components/app-shell/AppShellRoot.svelte.d.ts +16 -14
- 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 +40 -64
- package/dist/components/app-shell/AppShellSidebar.svelte.d.ts +4 -8
- package/dist/components/app-shell/AppShellToggle.svelte +66 -26
- package/dist/components/app-shell/AppShellToggle.svelte.d.ts +5 -3
- 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 +101 -29
- package/dist/components/approval/Approval.svelte.d.ts +17 -10
- package/dist/components/avatar/AvatarFallback.svelte +4 -4
- package/dist/components/avatar/AvatarFallback.svelte.d.ts +2 -2
- package/dist/components/avatar/AvatarImage.svelte +3 -3
- package/dist/components/avatar/AvatarImage.svelte.d.ts +3 -3
- package/dist/components/avatar/AvatarRoot.svelte +7 -7
- package/dist/components/avatar/AvatarRoot.svelte.d.ts +5 -5
- package/dist/components/badge/Badge.svelte +26 -11
- package/dist/components/badge/Badge.svelte.d.ts +8 -5
- package/dist/components/button/Button.svelte +263 -53
- package/dist/components/button/Button.svelte.d.ts +53 -11
- package/dist/components/card/Card.svelte +21 -32
- package/dist/components/card/Card.svelte.d.ts +6 -6
- package/dist/components/change-stats/ChangeStats.svelte +5 -6
- package/dist/components/change-stats/ChangeStats.svelte.d.ts +4 -4
- package/dist/components/changes-summary/ChangesSummary.svelte +20 -21
- package/dist/components/changes-summary/ChangesSummary.svelte.d.ts +6 -6
- package/dist/components/checkbox/Checkbox.svelte +37 -23
- package/dist/components/checkbox/Checkbox.svelte.d.ts +14 -7
- package/dist/components/choice-cards/ChoiceCards.svelte +145 -0
- package/dist/components/choice-cards/ChoiceCards.svelte.d.ts +29 -0
- package/dist/components/code/Code.svelte +3 -4
- package/dist/components/code/Code.svelte.d.ts +2 -2
- package/dist/components/collapsible/CollapsibleContent.svelte +8 -8
- package/dist/components/collapsible/CollapsibleContent.svelte.d.ts +10 -5
- package/dist/components/collapsible/CollapsibleRoot.svelte +8 -5
- package/dist/components/collapsible/CollapsibleRoot.svelte.d.ts +10 -5
- package/dist/components/collapsible/CollapsibleTrigger.svelte +19 -10
- package/dist/components/collapsible/CollapsibleTrigger.svelte.d.ts +20 -7
- package/dist/components/command/CommandDialog.svelte +3 -3
- package/dist/components/command/CommandDialog.svelte.d.ts +3 -3
- package/dist/components/command/CommandEmpty.svelte +8 -5
- package/dist/components/command/CommandEmpty.svelte.d.ts +10 -5
- package/dist/components/command/CommandFooter.svelte +2 -2
- package/dist/components/command/CommandFooter.svelte.d.ts +2 -2
- package/dist/components/command/CommandGroup.svelte +9 -6
- package/dist/components/command/CommandGroup.svelte.d.ts +12 -6
- package/dist/components/command/CommandInput.svelte +4 -1
- package/dist/components/command/CommandInput.svelte.d.ts +7 -4
- package/dist/components/command/CommandItem.svelte +15 -12
- package/dist/components/command/CommandItem.svelte.d.ts +18 -8
- package/dist/components/command/CommandList.svelte +7 -4
- package/dist/components/command/CommandList.svelte.d.ts +9 -5
- package/dist/components/command/CommandRoot.svelte +8 -5
- package/dist/components/command/CommandRoot.svelte.d.ts +10 -5
- package/dist/components/command/index.d.ts +3 -2
- package/dist/components/command/index.js +3 -2
- package/dist/components/command/styles.d.ts +3 -2
- package/dist/components/command/styles.js +13 -10
- package/dist/components/composer/ComposerAttachButton.svelte +5 -5
- package/dist/components/composer/ComposerAttachButton.svelte.d.ts +4 -4
- package/dist/components/composer/ComposerAttachment.svelte +11 -14
- package/dist/components/composer/ComposerAttachment.svelte.d.ts +2 -2
- package/dist/components/composer/ComposerAttachments.svelte +3 -3
- package/dist/components/composer/ComposerAttachments.svelte.d.ts +3 -3
- package/dist/components/composer/ComposerModelPicker.svelte +27 -29
- package/dist/components/composer/ComposerModelPicker.svelte.d.ts +9 -9
- package/dist/components/composer/ComposerRoot.svelte +26 -32
- package/dist/components/composer/ComposerRoot.svelte.d.ts +15 -15
- package/dist/components/composer/ComposerSubmit.svelte +14 -20
- package/dist/components/composer/ComposerSubmit.svelte.d.ts +4 -4
- package/dist/components/composer/ComposerTextarea.svelte +4 -4
- package/dist/components/composer/ComposerTextarea.svelte.d.ts +3 -3
- package/dist/components/composer/ComposerToggle.svelte +13 -15
- package/dist/components/composer/ComposerToggle.svelte.d.ts +4 -4
- package/dist/components/composer/ComposerToolbar.svelte +2 -2
- package/dist/components/composer/ComposerToolbar.svelte.d.ts +2 -2
- 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 +7 -6
- package/dist/components/conversation/ConversationContent.svelte.d.ts +4 -4
- package/dist/components/conversation/ConversationEmpty.svelte +6 -6
- package/dist/components/conversation/ConversationEmpty.svelte.d.ts +5 -5
- package/dist/components/conversation/ConversationRoot.svelte +4 -4
- package/dist/components/conversation/ConversationRoot.svelte.d.ts +4 -4
- package/dist/components/conversation/ConversationScrollButton.svelte +7 -7
- package/dist/components/conversation/ConversationScrollButton.svelte.d.ts +4 -4
- package/dist/components/dialog/ConfirmDialog.svelte +47 -16
- package/dist/components/dialog/ConfirmDialog.svelte.d.ts +14 -9
- package/dist/components/dialog/DialogBody.svelte +12 -4
- package/dist/components/dialog/DialogBody.svelte.d.ts +5 -3
- package/dist/components/dialog/DialogContent.svelte +16 -11
- package/dist/components/dialog/DialogContent.svelte.d.ts +21 -9
- package/dist/components/dialog/DialogDescription.svelte +7 -4
- package/dist/components/dialog/DialogDescription.svelte.d.ts +9 -5
- package/dist/components/dialog/DialogFooter.svelte +2 -2
- package/dist/components/dialog/DialogFooter.svelte.d.ts +2 -2
- package/dist/components/dialog/DialogHeader.svelte +2 -2
- package/dist/components/dialog/DialogHeader.svelte.d.ts +2 -2
- package/dist/components/dialog/DialogTitle.svelte +7 -4
- package/dist/components/dialog/DialogTitle.svelte.d.ts +9 -5
- package/dist/components/dialog/index.d.ts +5 -4
- package/dist/components/dialog/index.js +4 -3
- package/dist/components/dialog/styles.d.ts +8 -3
- package/dist/components/dialog/styles.js +11 -7
- package/dist/components/divider/Divider.svelte +6 -6
- package/dist/components/divider/Divider.svelte.d.ts +3 -3
- package/dist/components/empty-state/EmptyState.svelte +14 -10
- package/dist/components/empty-state/EmptyState.svelte.d.ts +5 -4
- package/dist/components/field/Field.svelte +92 -31
- package/dist/components/field/Field.svelte.d.ts +24 -11
- package/dist/components/field/context.d.ts +6 -3
- package/dist/components/frame/Frame.svelte +12 -13
- package/dist/components/frame/Frame.svelte.d.ts +7 -7
- package/dist/components/grid/Grid.svelte +17 -6
- package/dist/components/grid/Grid.svelte.d.ts +6 -6
- package/dist/components/heading/Heading.svelte +31 -8
- package/dist/components/heading/Heading.svelte.d.ts +6 -4
- package/dist/components/hover-card/HoverCardContent.svelte +7 -4
- package/dist/components/hover-card/HoverCardContent.svelte.d.ts +9 -5
- package/dist/components/hover-card/HoverCardRoot.svelte +2 -1
- package/dist/components/hover-card/HoverCardRoot.svelte.d.ts +3 -2
- package/dist/components/hover-card/index.d.ts +2 -1
- package/dist/components/hover-card/index.js +2 -1
- package/dist/components/input/Input.svelte +63 -17
- package/dist/components/input/Input.svelte.d.ts +12 -5
- package/dist/components/kbd/Kbd.svelte +14 -9
- package/dist/components/kbd/Kbd.svelte.d.ts +2 -2
- package/dist/components/link/Link.svelte +12 -8
- package/dist/components/link/Link.svelte.d.ts +9 -6
- package/dist/components/list/ListItem.svelte +41 -0
- package/dist/components/list/ListItem.svelte.d.ts +10 -0
- package/dist/components/list/ListRoot.svelte +69 -0
- package/dist/components/list/ListRoot.svelte.d.ts +28 -0
- package/dist/components/list/context.d.ts +5 -0
- package/dist/components/list/context.js +8 -0
- package/dist/components/list/index.d.ts +5 -0
- package/dist/components/list/index.js +3 -0
- 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 +136 -0
- package/dist/components/markdown/MarkdownFile.svelte.d.ts +19 -0
- package/dist/components/markdown/MarkdownFootnotes.svelte +62 -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 +258 -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 +320 -0
- package/dist/components/markdown/styles.js +294 -0
- package/dist/components/menu/ContextMenuContent.svelte +8 -5
- package/dist/components/menu/ContextMenuContent.svelte.d.ts +10 -5
- package/dist/components/menu/ContextMenuTrigger.svelte +8 -5
- package/dist/components/menu/ContextMenuTrigger.svelte.d.ts +10 -5
- package/dist/components/menu/MenuCheckboxItem.svelte +8 -5
- package/dist/components/menu/MenuCheckboxItem.svelte.d.ts +11 -6
- package/dist/components/menu/MenuContent.svelte +7 -4
- package/dist/components/menu/MenuContent.svelte.d.ts +9 -5
- package/dist/components/menu/MenuItem.svelte +14 -11
- package/dist/components/menu/MenuItem.svelte.d.ts +18 -8
- package/dist/components/menu/MenuLabel.svelte +7 -4
- package/dist/components/menu/MenuLabel.svelte.d.ts +9 -5
- package/dist/components/menu/MenuRadioItem.svelte +26 -11
- package/dist/components/menu/MenuRadioItem.svelte.d.ts +20 -6
- package/dist/components/menu/MenuSeparator.svelte +6 -3
- package/dist/components/menu/MenuSeparator.svelte.d.ts +7 -4
- package/dist/components/menu/MenuSubContent.svelte +7 -4
- package/dist/components/menu/MenuSubContent.svelte.d.ts +9 -5
- package/dist/components/menu/MenuSubTrigger.svelte +9 -6
- package/dist/components/menu/MenuSubTrigger.svelte.d.ts +11 -6
- package/dist/components/menu/context-menu.d.ts +3 -1
- package/dist/components/menu/context-menu.js +2 -1
- package/dist/components/menu/index.d.ts +24 -0
- package/dist/components/menu/index.js +9 -6
- package/dist/components/message/MessageAction.svelte +26 -6
- package/dist/components/message/MessageAction.svelte.d.ts +13 -4
- package/dist/components/message/MessageActions.svelte +4 -4
- package/dist/components/message/MessageActions.svelte.d.ts +4 -4
- package/dist/components/message/MessageContent.svelte +5 -6
- package/dist/components/message/MessageContent.svelte.d.ts +3 -3
- package/dist/components/message/MessageCopy.svelte +74 -18
- package/dist/components/message/MessageCopy.svelte.d.ts +22 -6
- package/dist/components/message/MessageHeader.svelte +6 -6
- package/dist/components/message/MessageHeader.svelte.d.ts +3 -3
- package/dist/components/message/MessagePending.svelte +3 -3
- package/dist/components/message/MessagePending.svelte.d.ts +2 -2
- package/dist/components/message/MessageRoot.svelte +5 -5
- package/dist/components/message/MessageRoot.svelte.d.ts +5 -5
- package/dist/components/message/MessageTime.svelte +4 -4
- package/dist/components/message/MessageTime.svelte.d.ts +3 -3
- package/dist/components/notice/Notice.svelte +59 -19
- package/dist/components/notice/Notice.svelte.d.ts +13 -8
- package/dist/components/plan/Plan.svelte +28 -30
- package/dist/components/plan/Plan.svelte.d.ts +5 -5
- package/dist/components/popover/PopoverContent.svelte +7 -4
- package/dist/components/popover/PopoverContent.svelte.d.ts +9 -5
- package/dist/components/popover/index.d.ts +4 -3
- package/dist/components/popover/index.js +4 -3
- package/dist/components/progress/Progress.svelte +34 -36
- package/dist/components/progress/Progress.svelte.d.ts +3 -3
- package/dist/components/questionnaire/Questionnaire.svelte +36 -33
- package/dist/components/questionnaire/Questionnaire.svelte.d.ts +11 -11
- package/dist/components/queued-message/QueuedMessage.svelte +24 -17
- package/dist/components/queued-message/QueuedMessage.svelte.d.ts +10 -10
- package/dist/components/rail/RailItem.svelte +49 -53
- package/dist/components/rail/RailItem.svelte.d.ts +11 -9
- package/dist/components/rail/RailRoot.svelte +20 -6
- package/dist/components/rail/RailRoot.svelte.d.ts +3 -3
- 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 +6 -10
- package/dist/components/reasoning/ReasoningContent.svelte.d.ts +2 -2
- package/dist/components/reasoning/ReasoningRoot.svelte +6 -6
- package/dist/components/reasoning/ReasoningRoot.svelte.d.ts +6 -6
- package/dist/components/reasoning/ReasoningTrigger.svelte +5 -5
- package/dist/components/reasoning/ReasoningTrigger.svelte.d.ts +3 -3
- package/dist/components/resize-handle/ResizeHandle.svelte +12 -13
- package/dist/components/resize-handle/ResizeHandle.svelte.d.ts +10 -10
- package/dist/components/reveal/Reveal.svelte +16 -10
- package/dist/components/reveal/Reveal.svelte.d.ts +4 -4
- package/dist/components/reveal/revealed.js +13 -9
- package/dist/components/rolling-text/RollingText.svelte +3 -3
- package/dist/components/rolling-text/RollingText.svelte.d.ts +3 -3
- package/dist/components/search-button/SearchButton.svelte +92 -0
- package/dist/components/search-button/SearchButton.svelte.d.ts +13 -0
- package/dist/components/segmented/SegmentedControl.svelte +78 -32
- package/dist/components/segmented/SegmentedControl.svelte.d.ts +14 -5
- package/dist/components/select/Select.svelte +40 -15
- package/dist/components/select/Select.svelte.d.ts +21 -13
- package/dist/components/separator/Separator.svelte +4 -4
- package/dist/components/separator/Separator.svelte.d.ts +3 -3
- package/dist/components/settings-group/SettingsGroup.svelte +118 -0
- package/dist/components/settings-group/SettingsGroup.svelte.d.ts +19 -0
- package/dist/components/settings-group/context.d.ts +7 -0
- package/dist/components/settings-group/context.js +9 -0
- package/dist/components/settings-row/SettingsRow.svelte +185 -57
- package/dist/components/settings-row/SettingsRow.svelte.d.ts +39 -14
- package/dist/components/sheet/SheetContent.svelte +31 -11
- package/dist/components/sheet/SheetContent.svelte.d.ts +33 -9
- package/dist/components/sheet/index.d.ts +5 -4
- package/dist/components/sheet/index.js +4 -3
- package/dist/components/sheet/styles.d.ts +6 -0
- package/dist/components/sheet/styles.js +2 -0
- package/dist/components/shimmer/Shimmer.svelte +37 -24
- package/dist/components/shimmer/Shimmer.svelte.d.ts +3 -3
- package/dist/components/sidebar/SidebarContent.svelte +4 -4
- package/dist/components/sidebar/SidebarContent.svelte.d.ts +3 -3
- package/dist/components/sidebar/SidebarFolder.svelte +147 -0
- package/dist/components/sidebar/SidebarFolder.svelte.d.ts +19 -0
- package/dist/components/sidebar/SidebarFooter.svelte +3 -3
- package/dist/components/sidebar/SidebarFooter.svelte.d.ts +2 -2
- package/dist/components/sidebar/SidebarGroup.svelte +41 -37
- package/dist/components/sidebar/SidebarGroup.svelte.d.ts +8 -8
- package/dist/components/sidebar/SidebarHeader.svelte +15 -9
- package/dist/components/sidebar/SidebarHeader.svelte.d.ts +7 -4
- package/dist/components/sidebar/SidebarItem.svelte +64 -45
- package/dist/components/sidebar/SidebarItem.svelte.d.ts +15 -10
- package/dist/components/sidebar/SidebarRoot.svelte +62 -0
- package/dist/components/sidebar/SidebarRoot.svelte.d.ts +14 -0
- package/dist/components/sidebar/SidebarSwitcher.svelte +28 -0
- package/dist/components/sidebar/SidebarSwitcher.svelte.d.ts +11 -0
- package/dist/components/sidebar/depth.d.ts +8 -0
- package/dist/components/sidebar/depth.js +14 -0
- package/dist/components/sidebar/index.d.ts +7 -1
- package/dist/components/sidebar/index.js +4 -1
- package/dist/components/skeleton/Skeleton.svelte +31 -20
- package/dist/components/skeleton/Skeleton.svelte.d.ts +5 -5
- package/dist/components/slider/Slider.svelte +24 -23
- package/dist/components/slider/Slider.svelte.d.ts +13 -13
- package/dist/components/spinner/Spinner.svelte +8 -14
- package/dist/components/spinner/Spinner.svelte.d.ts +3 -3
- package/dist/components/stack/Stack.svelte +19 -8
- package/dist/components/stack/Stack.svelte.d.ts +8 -8
- package/dist/components/status-indicator/StatusIndicator.svelte +6 -5
- package/dist/components/status-indicator/StatusIndicator.svelte.d.ts +4 -4
- package/dist/components/suggestions/SuggestionsItem.svelte +8 -8
- package/dist/components/suggestions/SuggestionsItem.svelte.d.ts +3 -3
- package/dist/components/suggestions/SuggestionsRoot.svelte +5 -5
- package/dist/components/suggestions/SuggestionsRoot.svelte.d.ts +5 -5
- package/dist/components/switch/Switch.svelte +27 -21
- package/dist/components/switch/Switch.svelte.d.ts +8 -6
- package/dist/components/tab-strip/TabStrip.svelte +421 -0
- package/dist/components/tab-strip/TabStrip.svelte.d.ts +31 -0
- package/dist/components/tabs/Tabs.svelte +83 -33
- package/dist/components/tabs/Tabs.svelte.d.ts +15 -5
- package/dist/components/text/Text.svelte +63 -31
- package/dist/components/text/Text.svelte.d.ts +18 -12
- package/dist/components/textarea/Textarea.svelte +5 -5
- package/dist/components/textarea/Textarea.svelte.d.ts +5 -5
- package/dist/components/theme/Theme.svelte +4 -4
- package/dist/components/theme/Theme.svelte.d.ts +4 -4
- package/dist/components/toast/Toaster.svelte +39 -32
- package/dist/components/toast/Toaster.svelte.d.ts +2 -2
- package/dist/components/toast/toasts.svelte.d.ts +52 -15
- package/dist/components/toast/toasts.svelte.js +45 -20
- package/dist/components/toggle/Toggle.svelte +11 -8
- package/dist/components/toggle/Toggle.svelte.d.ts +15 -7
- package/dist/components/toggle-group/ToggleGroupItem.svelte +9 -6
- package/dist/components/toggle-group/ToggleGroupItem.svelte.d.ts +12 -6
- package/dist/components/toggle-group/ToggleGroupRoot.svelte +17 -14
- package/dist/components/toggle-group/ToggleGroupRoot.svelte.d.ts +13 -12
- package/dist/components/tool/ToolContent.svelte +5 -10
- package/dist/components/tool/ToolContent.svelte.d.ts +2 -2
- package/dist/components/tool/ToolInput.svelte +3 -3
- package/dist/components/tool/ToolInput.svelte.d.ts +3 -3
- package/dist/components/tool/ToolOutput.svelte +4 -4
- package/dist/components/tool/ToolOutput.svelte.d.ts +4 -4
- package/dist/components/tool/ToolRoot.svelte +7 -7
- package/dist/components/tool/ToolRoot.svelte.d.ts +7 -7
- package/dist/components/tool/ToolSection.svelte +8 -9
- package/dist/components/tool/ToolSection.svelte.d.ts +4 -4
- package/dist/components/tool/ToolTrigger.svelte +14 -13
- package/dist/components/tool/ToolTrigger.svelte.d.ts +4 -4
- package/dist/components/tooltip/TooltipContent.svelte +12 -9
- package/dist/components/tooltip/TooltipContent.svelte.d.ts +12 -6
- package/dist/components/tooltip/TooltipRoot.svelte +7 -4
- package/dist/components/tooltip/TooltipRoot.svelte.d.ts +8 -4
- package/dist/components/tooltip/TooltipTrigger.svelte +2 -1
- package/dist/components/tooltip/TooltipTrigger.svelte.d.ts +3 -2
- package/dist/components/tooltip/index.d.ts +2 -1
- package/dist/components/tooltip/index.js +2 -1
- package/dist/components/work-fold/WorkFold.svelte +9 -13
- package/dist/components/work-fold/WorkFold.svelte.d.ts +4 -4
- package/dist/index.d.ts +30 -12
- package/dist/index.js +24 -10
- package/dist/internal/Chevron.svelte +1 -1
- package/dist/internal/Chevron.svelte.d.ts +1 -1
- package/dist/internal/Code.svelte +9 -5
- package/dist/internal/Code.svelte.d.ts +3 -3
- package/dist/internal/Collapse.svelte +4 -4
- package/dist/internal/Collapse.svelte.d.ts +4 -4
- package/dist/internal/Glyph.svelte +19 -1
- package/dist/internal/Glyph.svelte.d.ts +9 -2
- package/dist/internal/Tile.svelte +22 -42
- package/dist/internal/Tile.svelte.d.ts +5 -5
- package/dist/internal/complete.d.ts +8 -0
- package/dist/internal/complete.js +1 -0
- package/dist/internal/control.d.ts +4 -4
- package/dist/internal/control.js +20 -17
- package/dist/internal/icon.d.ts +9 -0
- package/dist/internal/icon.js +1 -0
- package/dist/internal/icons.css +14 -0
- package/dist/internal/json.d.ts +1 -1
- package/dist/internal/layer.d.ts +6 -6
- package/dist/internal/layer.js +17 -14
- package/dist/internal/layout.d.ts +1 -1
- package/dist/internal/layout.js +6 -0
- package/dist/internal/loose.d.ts +22 -0
- package/dist/internal/loose.js +4 -0
- package/dist/internal/markers.stylex.d.ts +12 -0
- package/dist/internal/markers.stylex.js +6 -0
- package/dist/internal/plugin-order.d.ts +8 -0
- package/dist/internal/plugin-order.js +16 -0
- package/dist/internal/responsive.d.ts +1 -1
- package/dist/internal/roving.d.ts +1 -1
- 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 +5 -5
- package/dist/internal/toggle.d.ts +1 -2
- package/dist/internal/toggle.js +8 -12
- package/dist/internal/tooltip-trigger.d.ts +9 -0
- package/dist/internal/tooltip-trigger.js +19 -0
- 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 +178 -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 +14 -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 +179 -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/markers.stylex.d.ts +13 -0
- package/dist/markers.stylex.js +11 -0
- package/dist/preset.d.ts +44 -20
- package/dist/preset.js +169 -51
- package/dist/tokens.stylex.d.ts +57 -37
- package/dist/tokens.stylex.js +113 -62
- package/dist/typography.d.ts +55 -0
- package/dist/typography.js +63 -0
- package/dist/visually-hidden.d.ts +18 -0
- package/dist/visually-hidden.js +21 -0
- package/dist/vite.d.ts +9 -3
- package/dist/vite.js +27 -2
- package/package.json +57 -6
- package/skills/building-ui/SKILL.md +385 -0
- package/skills/building-ui/references/components.md +211 -0
- package/skills/markdown/SKILL.md +452 -0
- package/skills/markdown/references/plugins.md +103 -0
- package/skills/setup/SKILL.md +199 -0
- package/skills/styling/SKILL.md +318 -0
- package/skills/theming/SKILL.md +277 -0
- package/dist/internal/loop.d.ts +0 -35
- package/dist/internal/loop.js +0 -72
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: building-ui
|
|
3
|
+
description: >
|
|
4
|
+
Use when building pages, forms, dialogs, menus, app shells or AI chat screens with
|
|
5
|
+
@diegopluna/narvi components: choosing a component, composing compound parts such as
|
|
6
|
+
Dialog.Root, rendering a Button as a trigger, laying out with Stack and Grid, and following
|
|
7
|
+
Narvi's colour, label and copy conventions.
|
|
8
|
+
metadata:
|
|
9
|
+
purpose: >
|
|
10
|
+
Build interfaces from Narvi's components and compound parts instead of hand-written markup
|
|
11
|
+
and CSS, with correct composition of bits-ui based popups, responsive layout through Stack and
|
|
12
|
+
Grid, and Narvi's conventions for colour, labels and copy.
|
|
13
|
+
type: core
|
|
14
|
+
library: '@diegopluna/narvi'
|
|
15
|
+
library_version: '0.3.0'
|
|
16
|
+
requires:
|
|
17
|
+
- setup
|
|
18
|
+
sources:
|
|
19
|
+
- src/lib/index.ts
|
|
20
|
+
- src/lib/components/stack/Stack.svelte
|
|
21
|
+
- src/lib/components/grid/Grid.svelte
|
|
22
|
+
- src/lib/components/dialog/index.ts
|
|
23
|
+
- src/lib/components/tooltip/index.ts
|
|
24
|
+
- src/routes/components/dialog/Basic.svelte
|
|
25
|
+
- src/routes/components/chat/anatomy.svelte.txt
|
|
26
|
+
- src/routes/components/app-shell/anatomy.svelte.txt
|
|
27
|
+
- src/lib/components/app-shell/index.ts
|
|
28
|
+
- src/lib/components/toast/toasts.svelte.ts
|
|
29
|
+
- src/lib/components/dialog/ConfirmDialog.svelte
|
|
30
|
+
- src/lib/components/notice/Notice.svelte
|
|
31
|
+
- src/lib/components/field/Field.svelte
|
|
32
|
+
- src/lib/components/list/ListRoot.svelte
|
|
33
|
+
- src/lib/components/choice-cards/ChoiceCards.svelte
|
|
34
|
+
- src/lib/components/dialog/DialogContent.svelte
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# Build interfaces with Narvi
|
|
38
|
+
|
|
39
|
+
This assumes Narvi is installed (see the `setup` skill). Reach for a Narvi component before
|
|
40
|
+
writing markup and CSS of your own. To find the right one, read the
|
|
41
|
+
[component catalogue](references/components.md) when you're not sure which component fits the
|
|
42
|
+
job, or which parts a compound component has. In an app, the file is
|
|
43
|
+
`node_modules/@diegopluna/narvi/skills/building-ui/references/components.md`.
|
|
44
|
+
|
|
45
|
+
Each component's props are typed. The authoritative list is the component's `.svelte.d.ts` in
|
|
46
|
+
`node_modules/@diegopluna/narvi/dist/components/<name>/`, and the docs page with live examples is
|
|
47
|
+
`https://narvi.dpeter.dev/components/<slug>`.
|
|
48
|
+
|
|
49
|
+
## Setup
|
|
50
|
+
|
|
51
|
+
Everything except tokens and media conditions is imported from the package root:
|
|
52
|
+
|
|
53
|
+
```svelte
|
|
54
|
+
<script lang="ts">
|
|
55
|
+
import { Button, Card, Heading, Stack, Text } from '@diegopluna/narvi';
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<Card>
|
|
59
|
+
<Stack gap={3}>
|
|
60
|
+
<Heading level={2} size="lg">The West-gate</Heading>
|
|
61
|
+
<Text tone="muted">Speak, friend, and enter.</Text>
|
|
62
|
+
<Stack direction="row" gap={2} justify="end">
|
|
63
|
+
<Button variant="ghost">Later</Button>
|
|
64
|
+
<Button variant="primary">Enter</Button>
|
|
65
|
+
</Stack>
|
|
66
|
+
</Stack>
|
|
67
|
+
</Card>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Core patterns
|
|
71
|
+
|
|
72
|
+
### Compound components
|
|
73
|
+
|
|
74
|
+
Components with parts are namespaces: `Dialog.Root`, `Dialog.Content`, `Menu.Item`. Import the
|
|
75
|
+
namespace (`import { Dialog } from '@diegopluna/narvi'`) and nest the parts as the catalogue lists
|
|
76
|
+
them. The Root holds the state, and most of them take `bind:open` or `bind:value`.
|
|
77
|
+
|
|
78
|
+
### Render a Narvi Button as a trigger
|
|
79
|
+
|
|
80
|
+
Popups are built on bits-ui. A `Trigger` or `Close` renders its own `<button>` unless you give it a
|
|
81
|
+
`child` snippet. To use a Narvi Button, spread the `props` the snippet receives onto it, so it
|
|
82
|
+
gets the ARIA attributes, the handlers and the ref:
|
|
83
|
+
|
|
84
|
+
```svelte
|
|
85
|
+
<script lang="ts">
|
|
86
|
+
import { Button, Dialog, Field, Input } from '@diegopluna/narvi';
|
|
87
|
+
|
|
88
|
+
let open = $state(false);
|
|
89
|
+
let name = $state('narvi');
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<Dialog.Root bind:open>
|
|
93
|
+
<Dialog.Trigger>
|
|
94
|
+
{#snippet child({ props })}<Button {...props}>Rename project</Button>{/snippet}
|
|
95
|
+
</Dialog.Trigger>
|
|
96
|
+
<Dialog.Content size="sm">
|
|
97
|
+
<Dialog.Header>
|
|
98
|
+
<Dialog.Title>Rename project</Dialog.Title>
|
|
99
|
+
<Dialog.Description>The name shows in the sidebar and in shared links.</Dialog.Description>
|
|
100
|
+
</Dialog.Header>
|
|
101
|
+
<Dialog.Body>
|
|
102
|
+
<Field label="Name">
|
|
103
|
+
<Input bind:value={name} />
|
|
104
|
+
</Field>
|
|
105
|
+
</Dialog.Body>
|
|
106
|
+
<Dialog.Footer>
|
|
107
|
+
<Dialog.Close>
|
|
108
|
+
{#snippet child({ props })}<Button {...props} variant="ghost">Cancel</Button>{/snippet}
|
|
109
|
+
</Dialog.Close>
|
|
110
|
+
<Button variant="primary" onclick={() => (open = false)}>Rename</Button>
|
|
111
|
+
</Dialog.Footer>
|
|
112
|
+
</Dialog.Content>
|
|
113
|
+
</Dialog.Root>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The same `child` pattern applies to `Menu.Trigger`, `Popover.Trigger`, `Tooltip.Trigger`,
|
|
117
|
+
`HoverCard.Trigger`, `Sheet.Trigger` and `Collapsible.Trigger`.
|
|
118
|
+
|
|
119
|
+
`Dialog.Content` takes `size`: `sm` 24rem, `md` 32 (the default), `lg` 36, `xl` 44 and `2xl` 56.
|
|
120
|
+
A `Sheet.Content` along an edge takes the same names, from 20rem; from `lg` up, a dialog and a
|
|
121
|
+
sheet of one size are as wide. `Dialog.Body` takes a bindable `ref`, the element that scrolls.
|
|
122
|
+
A Select, Menu or Popover opened inside a dialog or a sheet opens over it.
|
|
123
|
+
|
|
124
|
+
A menu that picks one of several uses `Menu.RadioGroup` and `Menu.RadioItem`. Picking an item
|
|
125
|
+
closes the menu, as a select does (`closeOnSelect={false}` keeps it open), and an item takes
|
|
126
|
+
an `icon` snippet and a `shortcut`, as `Menu.Item` does.
|
|
127
|
+
|
|
128
|
+
For a yes/no confirmation, use `ConfirmDialog`. It takes a `title` that asks the question and a
|
|
129
|
+
`confirmLabel` that names the action. If `onconfirm` returns a promise, the dialog waits for it
|
|
130
|
+
and shows the error when it rejects. Say what will be lost with `warning` (a string), not a
|
|
131
|
+
`Notice` of your own in its children: the warning is read with the description as it opens.
|
|
132
|
+
Children that render nothing (an `{#if}` that is false) leave no empty body.
|
|
133
|
+
|
|
134
|
+
### Forms
|
|
135
|
+
|
|
136
|
+
Wrap a text control (`Input`, `Textarea` or `Select`) in `Field`. Those three read Field's
|
|
137
|
+
context, so it gives them a label, help text (`description`) and an error message (`error`), and
|
|
138
|
+
wires up `id`, `aria-describedby` and `aria-invalid`. Don't hand-write a `<label>` or the ARIA
|
|
139
|
+
wiring for them.
|
|
140
|
+
|
|
141
|
+
```svelte
|
|
142
|
+
<Field label="Email" description="We only write when a run needs you." error={emailError}>
|
|
143
|
+
<Input type="email" bind:value={email} />
|
|
144
|
+
</Field>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- `description` takes a snippet for help with markup in it:
|
|
148
|
+
`{#snippet help()}Run <Code>gh auth login</Code> first.{/snippet}`, then `description={help}`.
|
|
149
|
+
- The error is announced as it appears.
|
|
150
|
+
- `hideLabel` keeps the label for assistive technology and off the screen, for a search field
|
|
151
|
+
whose magnifier says what it is. Don't give such an Input an `aria-label` of your own.
|
|
152
|
+
- `group` makes the Field a fieldset named by its legend, for several controls under one label
|
|
153
|
+
(radios, a start and an end). The help and the error describe the group; its controls take
|
|
154
|
+
no id from it.
|
|
155
|
+
- `Input` takes an `icon` snippet at its start, sized to the field:
|
|
156
|
+
`<Input>{#snippet icon()}<Search />{/snippet}</Input>`. Don't position an icon by hand.
|
|
157
|
+
- For one choice among a few that each need a line of detail, use `ChoiceCards`
|
|
158
|
+
(`options: { value, label, detail?, icon?, disabled? }[]`, `bind:value`, `aria-label`).
|
|
159
|
+
|
|
160
|
+
The other controls don't read Field, so label them directly:
|
|
161
|
+
|
|
162
|
+
- `Checkbox` and `Switch` take their label as children: `<Switch bind:checked>Night shift</Switch>`.
|
|
163
|
+
To act on a change, `onCheckedChange={(checked) => save(checked)}` gets the new value; the
|
|
164
|
+
native `onchange` gets the event. `Select`'s `onchange` gets the new value.
|
|
165
|
+
- `SegmentedControl`, `ToggleGroup.Root` and `Slider` need an `aria-label` (or
|
|
166
|
+
`aria-labelledby`), for example `<SegmentedControl aria-label="Theme" … />`.
|
|
167
|
+
A `SegmentedControl` option with a short label can carry a `title` that names it in full
|
|
168
|
+
(`{ value: '7d', label: '7d', title: 'Last 7 days' }`): a tooltip, and the radio's
|
|
169
|
+
description. Don't put a `Tooltip` around the control for that.
|
|
170
|
+
|
|
171
|
+
For a settings page, put the rows in a `SettingsGroup` (`title`, an `action` snippet at the end
|
|
172
|
+
of the heading), which lays them on one card with a line between each, and each control in a
|
|
173
|
+
`SettingsRow`. Its `children` snippet receives `{ id, labelId, describedBy }`:
|
|
174
|
+
|
|
175
|
+
```svelte
|
|
176
|
+
<script lang="ts">
|
|
177
|
+
import { Button, Select, SettingsGroup, SettingsRow, Switch } from '@diegopluna/narvi';
|
|
178
|
+
import ShieldCheck from '@lucide/svelte/icons/shield-check';
|
|
179
|
+
|
|
180
|
+
let access = $state('ask');
|
|
181
|
+
let sounds = $state(false);
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<SettingsGroup title="General">
|
|
185
|
+
{#snippet action()}<Button size="sm" variant="ghost">Reset</Button>{/snippet}
|
|
186
|
+
<SettingsRow
|
|
187
|
+
id="access"
|
|
188
|
+
tabindex={-1}
|
|
189
|
+
label="Access"
|
|
190
|
+
description="What agents may do without asking."
|
|
191
|
+
about="Agents ask before they run a command, unless this says otherwise."
|
|
192
|
+
>
|
|
193
|
+
{#snippet children({ id, describedBy })}
|
|
194
|
+
<Select
|
|
195
|
+
{id}
|
|
196
|
+
aria-describedby={describedBy}
|
|
197
|
+
size="sm"
|
|
198
|
+
align="end"
|
|
199
|
+
bind:value={access}
|
|
200
|
+
options={[
|
|
201
|
+
{ value: 'ask', label: 'Ask first', icon: ShieldCheck },
|
|
202
|
+
{ value: 'full', label: 'Full access' }
|
|
203
|
+
]}
|
|
204
|
+
/>
|
|
205
|
+
{/snippet}
|
|
206
|
+
</SettingsRow>
|
|
207
|
+
<SettingsRow label="Sounds" description="A chime when a reply is ready.">
|
|
208
|
+
{#snippet children({ id, describedBy })}
|
|
209
|
+
<Switch {id} aria-describedby={describedBy} bind:checked={sounds} />
|
|
210
|
+
{/snippet}
|
|
211
|
+
</SettingsRow>
|
|
212
|
+
</SettingsGroup>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
- `description` (a string or a snippet) is always visible: what the setting says now, or what
|
|
216
|
+
it does in a line. `about` is the longer explanation, behind an info mark beside the label.
|
|
217
|
+
- `stacked` puts the control under the label at full width (a Textarea, a list); `footer` is a
|
|
218
|
+
snippet under the row; `error` and `warning` are notes under it, linked by `describedBy`.
|
|
219
|
+
- The row's label is a `<label for>` the control. For a group (`SegmentedControl`, radios,
|
|
220
|
+
several buttons) or a control that labels itself (a `Switch` with children), set
|
|
221
|
+
`labelFor={false}` and pass `labelId` to the control's `aria-labelledby`.
|
|
222
|
+
- Attributes such as `id`, `tabindex` and `data-*` go on the row's element (and on the group's
|
|
223
|
+
`<section>`), so search can scroll to one and focus it. Set `highlighted` for a moment as it
|
|
224
|
+
lands to light it.
|
|
225
|
+
- A `SettingsGroup` draws its lines between any children, so rows of the app's own go in it too;
|
|
226
|
+
give them their own padding (`SettingsRow` is inset 16px on the card).
|
|
227
|
+
|
|
228
|
+
### Layout with Stack and Grid
|
|
229
|
+
|
|
230
|
+
`Stack` lays children out in a column (the default) or a row. `Grid` lays them out in columns.
|
|
231
|
+
Their gaps are steps on the 4px scale: `gap={4}` is 16px, and the steps are 0, 1, 1.5 (6px), 2,
|
|
232
|
+
3, 4, 5, 6, 8, 10, 12 and 16. Every layout prop takes a value, or values by breakpoint (`sm` 640px, `md` 768px,
|
|
233
|
+
`lg` 1024px, `xl` 1280px, mobile first):
|
|
234
|
+
|
|
235
|
+
```svelte
|
|
236
|
+
<Stack direction={{ default: 'column', md: 'row' }} gap={{ default: 3, md: 6 }} align="start">
|
|
237
|
+
<Grid columns={{ default: 1, sm: 2, lg: 3 }} gap={4} as="ul">
|
|
238
|
+
<li>…</li>
|
|
239
|
+
</Grid>
|
|
240
|
+
</Stack>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
- Stack: `direction`, `gap`, `align` (`start | center | end | stretch | baseline`), `justify`
|
|
244
|
+
(`start | center | end | between`), `wrap`, and `as` for the element.
|
|
245
|
+
- Grid: `columns` (1–12, or a template string such as `'200px 1fr'`), `gap`, `align` and `as`.
|
|
246
|
+
|
|
247
|
+
Each value compiles to a static class, and nothing is styled at runtime. Use these instead of a
|
|
248
|
+
flex or grid style of your own. For anything they can't express, see the `styling` skill.
|
|
249
|
+
|
|
250
|
+
### Text
|
|
251
|
+
|
|
252
|
+
Use `Heading` (`level` 1–6 for the outline, `size` from `sm` to `4xl` for the look, and
|
|
253
|
+
`truncate` for a name that may run long) and `Text` (`variant` is what the text is: `figure`
|
|
254
|
+
for a number that is the point of its place, `title`, `reading`, `label`, `body`, `meta`,
|
|
255
|
+
`caption`, `micro` or `lead`, each one size, weight and line height; `tone` default, muted,
|
|
256
|
+
subtle, accent, danger or success; `weight`; `face="display"` for the serif; `truncate` for one
|
|
257
|
+
line, `lines={2}` for several). Use `Code` and `Kbd` inline, and
|
|
258
|
+
`Link` for links inside text. `Button href` gives a link that looks like a button, and
|
|
259
|
+
`Card href` makes the whole card a link.
|
|
260
|
+
|
|
261
|
+
### Feedback
|
|
262
|
+
|
|
263
|
+
- Toasts: mount one `<Toaster />` near the root, then call `toast('Copied the link')` from
|
|
264
|
+
anywhere; `toast.info`, `.success`, `.warning`, `.error` and `.loading` set the tone.
|
|
265
|
+
- A toast can take an `action` (`{ label: 'Undo', onclick(event) }`), which closes it unless
|
|
266
|
+
it calls `event.preventDefault()`.
|
|
267
|
+
- Give work a key of your own with `id`: another toast with that id replaces it where it
|
|
268
|
+
stands. `toast.loading('Cloning…', { id: 'clone' })`, then `toast.success('Cloned', { id:
|
|
269
|
+
'clone' })`. `toast.dismiss(id)` closes it.
|
|
270
|
+
- `onAutoClose` is called when its time runs out, `onDismiss` when the person or
|
|
271
|
+
`toast.dismiss` closes it. Neither is called when its action closes it, so an Undo that has
|
|
272
|
+
to be forgotten later forgets in both:
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
toast(`Removed ${theme.name}`, {
|
|
276
|
+
action: { label: 'Undo', onclick: () => restore(theme) },
|
|
277
|
+
onAutoClose: () => forget(theme),
|
|
278
|
+
onDismiss: () => forget(theme)
|
|
279
|
+
});
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
- Errors and work under way stay until dismissed, and every toast has a Dismiss button.
|
|
283
|
+
- `Tooltip.Root` must sit inside a `Tooltip.Provider`. Mount one near the root. Give an icon
|
|
284
|
+
button an `aria-label` too, because the tooltip shows a name but doesn't supply one.
|
|
285
|
+
- Use `Notice` for a note in place (`tone`: neutral, info, success, warning, danger; `raised`
|
|
286
|
+
over a busy background, such as an image behind the composer),
|
|
287
|
+
`EmptyState` for an empty place, `Skeleton`, `Spinner` or `Progress` while loading, and
|
|
288
|
+
`StatusIndicator` (`status`: idle, working, waiting, done, failed, stopped, connecting) for where
|
|
289
|
+
a run stands.
|
|
290
|
+
|
|
291
|
+
### Lists, badges and folds
|
|
292
|
+
|
|
293
|
+
- Rows on one card with a line between each: `List.Root` (a `ul`, or `as="div"`) holding
|
|
294
|
+
`List.Item`s, or rows of your own. Don't redraw the card and its lines.
|
|
295
|
+
- `Badge` shows its tone as a dot; `plain` hides the dot and colours the words in the tone.
|
|
296
|
+
- `Collapsible.Trigger` takes `chevron="start"` to put the chevron before its label, as in a tree.
|
|
297
|
+
- `Tabs` and `SegmentedControl` options take an `icon` (a component, sized to fit) and a
|
|
298
|
+
`title` that names a short label in full, as a tooltip and the item's description.
|
|
299
|
+
- A `Button` that is loading hides its label under the spinner; `loadingLabel="Connecting…"`
|
|
300
|
+
says what it is doing beside the spinner instead. `variant="link"` sits in a sentence, at its
|
|
301
|
+
size, with no padding.
|
|
302
|
+
|
|
303
|
+
### App and chat screens
|
|
304
|
+
|
|
305
|
+
`AppShell` is the window: its bar across the top, a rail, and one sheet that holds the sidebar,
|
|
306
|
+
the page and a side panel; or, with no bar and a `flush` sheet, two columns of the window
|
|
307
|
+
itself. `Sidebar` and `Rail` fill it; each also stands on its own: a `Sidebar` in a
|
|
308
|
+
`Sidebar.Root`, a `Rail.Root` beside any page. Chat screens nest `Message` parts inside
|
|
309
|
+
`Conversation.Content`, with `Reasoning` and `Tool` inside a reply, and `Composer` below. Agent work uses `Activity`, `WorkFold`, `Plan`,
|
|
310
|
+
`Approval`, `Questionnaire`, `QueuedMessage` and `ChangesSummary`. Read the
|
|
311
|
+
[component catalogue](references/components.md) for their anatomy before building one of these
|
|
312
|
+
screens. Render a reply's text with `<Markdown value={text} streaming={!done} />` inside `Message.Content`; the `markdown` skill covers it.
|
|
313
|
+
|
|
314
|
+
Parts of the shell that are easy to redraw by hand, and shouldn't be:
|
|
315
|
+
|
|
316
|
+
- **Search in the bar:** `SearchButton` (`label="Search or jump to…"`, `shortcut={['⌘', 'K']}`)
|
|
317
|
+
looks like a field and opens your palette with `onclick`. It is a well with no edge. Put it in
|
|
318
|
+
`AppShell.Bar`'s `center` snippet. Listen for the shortcut yourself.
|
|
319
|
+
- **A workspace switcher:** `Sidebar.Switcher` is a row with the workspace's mark (`leading`),
|
|
320
|
+
its name and a selector glyph. Put it in a `Menu.Trigger`'s `child` and spread the props:
|
|
321
|
+
`{#snippet child({ props })}<Sidebar.Switcher {...props}>…</Sidebar.Switcher>{/snippet}`.
|
|
322
|
+
- **Rows in folders** are set in by their text, not their box: give a folder's mark as its
|
|
323
|
+
`leading` and its rows line up on their own. Don't pad rows or folders yourself.
|
|
324
|
+
- **A listbox of results** from Sidebar rows: `<Sidebar.Item as="div" role="option" aria-selected>`
|
|
325
|
+
inside your `role="listbox"`, so no list item stands between the box and its options.
|
|
326
|
+
- **TabStrip** tabs narrow to an ellipsis before the strip scrolls. With a `leading` icon, a
|
|
327
|
+
tab's close button takes the icon's place, so no room is kept at its end.
|
|
328
|
+
- **A Sheet** focuses itself as it opens (`focusOnOpen="sheet"`), so a Rail or a list in it
|
|
329
|
+
shows no focus ring until the keys move in. Pass `focusOnOpen="first"` for a sheet that
|
|
330
|
+
holds a form.
|
|
331
|
+
|
|
332
|
+
## Conventions
|
|
333
|
+
|
|
334
|
+
- **Colour is for state.** `accent` (blue by default) marks focus, selection, progress and
|
|
335
|
+
something live. For status, use a component's `tone` or `status` prop (success, warning,
|
|
336
|
+
danger). Don't tint headings, icons or decoration with the accent.
|
|
337
|
+
- **The primary button is the only bright solid.** Keep one `variant="primary"` per view. Use
|
|
338
|
+
`secondary`, `soft`, `ghost`, `bare` or `link` for the rest. For what cannot be undone:
|
|
339
|
+
`danger` is the solid a confirming dialog asks for, `danger-outline` its quieter form, and
|
|
340
|
+
`ghost-danger` an icon that deletes. `warning-outline` and `success-outline` say the same of
|
|
341
|
+
their own. Sizes run `micro`, `xs`, `sm`, `md`, `lg`; `shape="pill"` rounds the ends.
|
|
342
|
+
- **Icons take their control's size.** A Lucide icon in a `Button` needs no `size`: it is 12px
|
|
343
|
+
at `micro`, 14 at `xs` and `sm`, 16 at `md` and 18 at `lg`, and 16 in a menu or command item
|
|
344
|
+
and in a Select option. The rule overrides the icon's own `size`; to change one, give the icon
|
|
345
|
+
a class or a style, or set `--narvi-icon-size` on the button.
|
|
346
|
+
- **One short label.** Don't join details with a dot ("Queued · sends later"). Put the rest in
|
|
347
|
+
an element of its own, or a tooltip.
|
|
348
|
+
- **What waits on the person goes over the composer.** Put an `Approval`, a `Questionnaire` or
|
|
349
|
+
`QueuedMessage`s in `Composer.Tray`'s `pending`, not up the conversation.
|
|
350
|
+
- **Labels are sentence case.** Small labels and eyebrows are never uppercase or mono.
|
|
351
|
+
- **Buttons name their action**: "Rename", "Delete thread", never "OK" or "Submit". A
|
|
352
|
+
confirmation's cancel button can name the way out: "Keep it".
|
|
353
|
+
- **Edges are quiet.** Prefer `Card`, `Frame` and `Separator` to hand-drawn borders.
|
|
354
|
+
|
|
355
|
+
## Common mistakes
|
|
356
|
+
|
|
357
|
+
- **HIGH: `Tooltip.Root` without a `Tooltip.Provider`.** bits-ui reads the provider from
|
|
358
|
+
context and throws when there isn't one.
|
|
359
|
+
- **HIGH: nesting a Button inside a Trigger without `child`.** `<Dialog.Trigger><Button/></Dialog.Trigger>`
|
|
360
|
+
renders a button inside a button: invalid HTML, with two focus stops. Use the `child` snippet.
|
|
361
|
+
- **HIGH: an icon-only Button without `aria-label`.** `iconOnly` makes it square, but it has
|
|
362
|
+
no accessible name until you give it one.
|
|
363
|
+
- **MEDIUM: a raw `<label>` beside an Input.** It misses Field's description and error wiring.
|
|
364
|
+
- **HIGH: `Dialog.Content size="lg"` written for 44rem.** Since the sizes gained `lg` 36rem,
|
|
365
|
+
`xl` 44 and `2xl` 56, the old `lg` is `xl`.
|
|
366
|
+
- **MEDIUM: an Input's icon positioned by hand.** Pass it as the Input's `icon` snippet; it is
|
|
367
|
+
sized to the field and the text starts after it.
|
|
368
|
+
- **MEDIUM: a toast's `onDismiss` alone for "Undo, or else forget".** A toast that runs out of
|
|
369
|
+
time calls `onAutoClose`, not `onDismiss`, so the forgetting never happens. Pass both.
|
|
370
|
+
- **MEDIUM: a SettingsRow's `<label for>` on a group.** A `SegmentedControl` or a set of radios
|
|
371
|
+
has no one element for the label to name. Set `labelFor={false}` and pass `labelId` as
|
|
372
|
+
`aria-labelledby`.
|
|
373
|
+
- **MEDIUM: wrapping a Checkbox, Switch or SegmentedControl in `Field`.** They don't read Field's
|
|
374
|
+
context, so the label names nothing. Use children or `aria-label`, as above.
|
|
375
|
+
- **MEDIUM: a flex `<div>` with margins between children.** Use Stack or Grid. Their gaps follow
|
|
376
|
+
the spacing scale and change by breakpoint without media queries.
|
|
377
|
+
- **MEDIUM: styling inside a `<Theme>` and expecting popups to follow.** They render at the end
|
|
378
|
+
of the body. See the `theming` skill.
|
|
379
|
+
|
|
380
|
+
## Completion
|
|
381
|
+
|
|
382
|
+
The screen uses Narvi components for its controls, layout and text, and has no hand-written
|
|
383
|
+
layout CSS. Popups open from their triggers and close with Escape, returning focus to the
|
|
384
|
+
trigger. Every control has a visible or ARIA label, and the screen reads correctly in light and
|
|
385
|
+
dark.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Narvi component catalogue
|
|
2
|
+
|
|
3
|
+
Everything here is imported from `@diegopluna/narvi`. A name with dots is a part of a compound
|
|
4
|
+
component: import the namespace (`Dialog`) and use `Dialog.Root`. Docs and live examples are at
|
|
5
|
+
`https://narvi.dpeter.dev/components/<slug>`, and the full props are in
|
|
6
|
+
`node_modules/@diegopluna/narvi/dist/components/<folder>/*.svelte.d.ts`.
|
|
7
|
+
|
|
8
|
+
## Layout and text
|
|
9
|
+
|
|
10
|
+
| Component | Use it for | Docs slug |
|
|
11
|
+
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
|
|
12
|
+
| `Stack` | Children in a column or a row, with even gaps, by breakpoint | `stack` |
|
|
13
|
+
| `Grid` | Children in columns (a count or a template), by breakpoint | `grid` |
|
|
14
|
+
| `Card` | A surface that groups related content; `href` makes the whole card a link | `card` |
|
|
15
|
+
| `Frame` | A tray around an inset panel, with an optional title: Narvi's signature container | `frame` |
|
|
16
|
+
| `Separator` | A thin line between groups | `separator` |
|
|
17
|
+
| `Heading` | A title: `level` for the outline, `size` for the look | `heading` |
|
|
18
|
+
| `Text` | Text in a role (`variant`: `title`, `reading`, `label`, `body`, `meta`, `caption`, `micro`, `lead`), in the page's face or the display serif | `text` |
|
|
19
|
+
| `Link` | A link inside running text | `link` |
|
|
20
|
+
| `List.Root`, `.Item` | Rows on one card, with a line between each | `list` |
|
|
21
|
+
| `Code` | A short piece of code inside text | `code` |
|
|
22
|
+
| `Markdown` | Markdown, streamed or finished: an AI reply, a README (see the `markdown` skill) | `markdown` |
|
|
23
|
+
| `Kbd` | A key cap, for shortcuts. Inside a `Button` it takes the button's ink | `kbd` |
|
|
24
|
+
| `Reveal` | Eases part of a scrolled page into place. For marketing pages, not apps | `reveal` |
|
|
25
|
+
| `Theme` | Sets the scheme or a custom theme for part of the page (see `theming`) | `theme` |
|
|
26
|
+
|
|
27
|
+
## Controls and forms
|
|
28
|
+
|
|
29
|
+
| Component | Use it for | Docs slug |
|
|
30
|
+
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- |
|
|
31
|
+
| `Button` | An action; `href` makes it a link; `variant` (12, from `primary` to `success-outline`), `size` (`micro` to `lg`), `shape`, `loading`, `iconOnly` | `button` |
|
|
32
|
+
| `Field` | Label, help text and error around one control | `field` |
|
|
33
|
+
| `Input` | One line of text | `input` |
|
|
34
|
+
| `Textarea` | Several lines of text | `textarea` |
|
|
35
|
+
| `Select` | One choice from a short list (`options: { value, label, icon?, group? }[]`, `align`) | `select` |
|
|
36
|
+
| `Checkbox` | An option on or off, or several from a list | `checkbox` |
|
|
37
|
+
| `ChoiceCards` | One choice among a few, each a card with a title and a line of detail | `choice-cards` |
|
|
38
|
+
| `Switch` | A setting that takes effect at once | `switch` |
|
|
39
|
+
| `SegmentedControl` | One of a few options, all visible (`options: { value, label, title? }[]`) | `segmented-control` |
|
|
40
|
+
| `Slider` | A value or a range along a track | `slider` |
|
|
41
|
+
| `Toggle` | A button that stays pressed | `toggle` |
|
|
42
|
+
| `ToggleGroup.Root`, `.Item` | Toggles that belong together: one pressed, or any number | `toggle-group` |
|
|
43
|
+
| `SettingsGroup` | A titled group of settings: a heading, an action, the rows on one card | `settings-group` |
|
|
44
|
+
| `SettingsRow` | One setting: what it is, beside its control | `settings-row` |
|
|
45
|
+
| `Tabs` | Views that share one place (`items: TabItem[]`) | `tabs` |
|
|
46
|
+
| `SearchButton` | Looks like a search field and opens search (`label`, `shortcut`): for a window's bar | `search-button` |
|
|
47
|
+
| `TabStrip` | Tabs for what is open in a pane: closable, addable, scrolling (`tabs`, `bind:value`, `onclose`, `onadd`). The panel is yours | `tab-strip` |
|
|
48
|
+
|
|
49
|
+
## Overlays (bits-ui; use `child` snippets on triggers)
|
|
50
|
+
|
|
51
|
+
| Component | Use it for | Docs slug |
|
|
52
|
+
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------- |
|
|
53
|
+
| `Dialog.Root`, `.Trigger`, `.Content` (`size`, `side`), `.Header`, `.Title`, `.Description`, `.Body`, `.Footer`, `.Close` | A focused task over the page | `dialog` |
|
|
54
|
+
| `ConfirmDialog` | A confirmation for an action that matters | `dialog` |
|
|
55
|
+
| `Sheet.Root`, `.Trigger`, `.Content` (`side`, `size`, `focusOnOpen`), `.Header`, `.Title`, `.Description`, `.Body`, `.Footer`, `.Close` | A panel that slides in from an edge | `sheet` |
|
|
56
|
+
| `Popover.Root`, `.Trigger`, `.Content`, `.Close` | Content anchored to the control that opened it | `popover` |
|
|
57
|
+
| `HoverCard.Root`, `.Trigger`, `.Content` | A preview while the pointer rests on a link or chip | `hover-card` |
|
|
58
|
+
| `Menu.Root`, `.Trigger`, `.Content`, `.Item`, `.CheckboxItem`, `.RadioGroup`, `.RadioItem`, `.Group`, `.Label`, `.Separator`, `.Sub` | Actions and choices from a button | `menu` |
|
|
59
|
+
| `ContextMenu.Root`, `.Trigger`, `.Content`, filled with `Menu` items | The same, from a right-click | `menu` |
|
|
60
|
+
| `Command.Dialog`, `.Root`, `.Input`, `.List`, `.Group`, `.Item`, `.Empty`, `.Separator`, `.Footer` | A search field over everything the app can do (⌘K) | `command` |
|
|
61
|
+
| `Tooltip.Provider`, `.Root`, `.Trigger`, `.Content` (`shortcut`) | A control's name and its keys. Needs the Provider | `tooltip` |
|
|
62
|
+
| `Collapsible.Root`, `.Trigger`, `.Content` | A region the person can fold away | `collapsible` |
|
|
63
|
+
|
|
64
|
+
## Feedback and status
|
|
65
|
+
|
|
66
|
+
| Component | Use it for | Docs slug |
|
|
67
|
+
| ------------------------------------ | ---------------------------------------------------------------------------------------------- | ------------------ |
|
|
68
|
+
| `Toaster`, `toast()` | Short notes about something that happened; one Toaster at the root | `toast` |
|
|
69
|
+
| `Notice` | A note in place: what is happening or went wrong, and what to do | `notice` |
|
|
70
|
+
| `EmptyState` | An empty place: what it is for and how to fill it (`title`, `description`, `media`, `actions`) | `empty-state` |
|
|
71
|
+
| `Badge` | A status, category or count (`tone`) | `badge` |
|
|
72
|
+
| `StatusIndicator` | Where a run, thread or machine stands, by shape and colour | `status-indicator` |
|
|
73
|
+
| `Progress` | How far along a task is | `progress` |
|
|
74
|
+
| `Spinner` | Something in progress | `spinner` |
|
|
75
|
+
| `Skeleton` | A stand-in for content on its way | `skeleton` |
|
|
76
|
+
| `Shimmer` | Text that says work is under way | `shimmer` |
|
|
77
|
+
| `RollingText` | A phrase that rolls to its next value ("Reading…", "Running…") | none |
|
|
78
|
+
| `Announcer` | Says a short message to screen readers without showing anything | `announcer` |
|
|
79
|
+
| `Avatar.Root`, `.Image`, `.Fallback` | A person: a picture, or initials | `avatar` |
|
|
80
|
+
|
|
81
|
+
## App shell
|
|
82
|
+
|
|
83
|
+
| Component | Use it for | Docs slug |
|
|
84
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------- |
|
|
85
|
+
| `AppShell.Root` (`bind:sidebarOpen`, `windowInset`), `.Bar` (`center`, `end` snippets), `.Rail`, `.Panes`, `.Sheet` (`flush`), `.Sidebar`, `.Main`, `.Header` (`drag`), `.Panel` (`bind:width`), `.Toggle` (`when`) | The window: its bar, a rail, and one sheet for the sidebar, the page and a side panel | `app-shell` |
|
|
86
|
+
| `Sidebar.Root` (`label`), `.Header` (`drag`), `.Content` (`label`), `.Group`, `.Folder` (`bind:open`, `leading`, `trailing` snippets), `.Item` (`current`, `as`, `leading`, `trailing`, `meta`, `actions` snippets), `.Switcher` (`leading`), `.Footer` | A column of rows, in groups and folders. `Root` is for one on its own; in an app shell the same parts go in `AppShell.Sidebar` | `sidebar` |
|
|
87
|
+
| `Rail.Root` (`label`), `.Item` (`label`, `href`, `current`, `badge`, `badgeTone`, `shortcut`), `.Separator`, `.Spacer` | A narrow strip of places to go: workspaces, settings. On its own beside a page, or in `AppShell.Rail` | `rail` |
|
|
88
|
+
| `ResizeHandle` | A draggable edge between two areas | none |
|
|
89
|
+
|
|
90
|
+
`AppShell.Bar`, `AppShell.Rail` and `AppShell.Sheet` are direct children of `AppShell.Root`; the
|
|
91
|
+
sidebar, the page and the panel go inside the sheet. The bar is where macOS's traffic lights sit
|
|
92
|
+
in a desktop window with a hidden title bar: set `windowInset` on the root to the room they take
|
|
93
|
+
(about `5.25rem` since macOS 26, `4.5rem` before, `0px` in full screen and off macOS).
|
|
94
|
+
|
|
95
|
+
```svelte
|
|
96
|
+
<AppShell.Root bind:sidebarOpen windowInset="5.25rem">
|
|
97
|
+
<AppShell.Bar>
|
|
98
|
+
<AppShell.Toggle />
|
|
99
|
+
{#snippet center()}…{/snippet}
|
|
100
|
+
{#snippet end()}…{/snippet}
|
|
101
|
+
</AppShell.Bar>
|
|
102
|
+
<AppShell.Rail>
|
|
103
|
+
<Rail.Root label="Workspaces">
|
|
104
|
+
<Rail.Item label="Forge" current>F</Rail.Item>
|
|
105
|
+
</Rail.Root>
|
|
106
|
+
</AppShell.Rail>
|
|
107
|
+
<AppShell.Sheet>
|
|
108
|
+
<AppShell.Sidebar label="Threads">
|
|
109
|
+
<Sidebar.Header>…</Sidebar.Header>
|
|
110
|
+
<Sidebar.Content label="Threads">
|
|
111
|
+
<Sidebar.Group label="Projects">
|
|
112
|
+
<Sidebar.Folder label="narvi">
|
|
113
|
+
<Sidebar.Item current onclick={open}>Fix the flaky Avatar test</Sidebar.Item>
|
|
114
|
+
</Sidebar.Folder>
|
|
115
|
+
</Sidebar.Group>
|
|
116
|
+
</Sidebar.Content>
|
|
117
|
+
</AppShell.Sidebar>
|
|
118
|
+
<AppShell.Main>
|
|
119
|
+
<AppShell.Header>…</AppShell.Header>
|
|
120
|
+
…
|
|
121
|
+
</AppShell.Main>
|
|
122
|
+
<AppShell.Panel label="Changes" bind:width={panelWidth}>…</AppShell.Panel>
|
|
123
|
+
</AppShell.Sheet>
|
|
124
|
+
</AppShell.Root>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
For panes, put several `AppShell.Sheet`s in an `AppShell.Panes` in place of the one sheet: each
|
|
128
|
+
is a pane of its own, with a `TabStrip` in its `AppShell.Header` for what is open in it.
|
|
129
|
+
|
|
130
|
+
The bar and the rail are optional. For a shell that is two columns of the window, with no bar,
|
|
131
|
+
make the sheet `flush`. The heads of the columns are then the window's: give them `drag`, put a
|
|
132
|
+
toggle in the sidebar's head and one with `when="closed"` in the page's header, which shows only
|
|
133
|
+
while the sidebar is away. `windowInset` then clears the traffic lights in whichever head is
|
|
134
|
+
first. Don't use a rail without a bar in a window that has traffic lights: they are wider than it.
|
|
135
|
+
|
|
136
|
+
```svelte
|
|
137
|
+
<AppShell.Root bind:sidebarOpen windowInset="5.25rem">
|
|
138
|
+
<AppShell.Sheet flush>
|
|
139
|
+
<AppShell.Sidebar label="Sessions">
|
|
140
|
+
<Sidebar.Header drag><AppShell.Toggle /></Sidebar.Header>
|
|
141
|
+
<Sidebar.Content label="Sessions">…</Sidebar.Content>
|
|
142
|
+
</AppShell.Sidebar>
|
|
143
|
+
<AppShell.Main>
|
|
144
|
+
<AppShell.Header drag><AppShell.Toggle when="closed" />…</AppShell.Header>
|
|
145
|
+
…
|
|
146
|
+
</AppShell.Main>
|
|
147
|
+
</AppShell.Sheet>
|
|
148
|
+
</AppShell.Root>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## AI chat
|
|
152
|
+
|
|
153
|
+
| Component | Use it for | Docs slug |
|
|
154
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | -------------- |
|
|
155
|
+
| `Conversation.Root`, `.Content`, `.ScrollButton`, `.Empty` | The scrolling log; keeps the newest in view while it streams | `conversation` |
|
|
156
|
+
| `Message.Root` (`from`, `streaming`), `.Header`, `.Pending`, `.Content`, `.Actions`, `.Action`, `.Copy` | One turn, from the person or the model | `message` |
|
|
157
|
+
| `Reasoning.Root` (`streaming`), `.Trigger`, `.Content` | The model's thinking, folded once done | `reasoning` |
|
|
158
|
+
| `Tool.Root` (`name`, `state`), `.Trigger`, `.Content`, `.Input`, `.Output` | A tool call: what it asked, how it went, what came back | `tool` |
|
|
159
|
+
| `Composer.Tray` (`pending` snippet), `.Root` (`bind:value`, `status`, `onsubmit`, `onstop`), `.Textarea`, `.Toolbar`, `.Attachments`, `.AttachButton`, `.Toggle`, `.ModelPicker`, `.Submit` | Where the person writes to the model | `composer` |
|
|
160
|
+
| `Suggestions.Root`, `.Item` | Prompts to start from | `suggestions` |
|
|
161
|
+
|
|
162
|
+
```svelte
|
|
163
|
+
<Conversation.Root>
|
|
164
|
+
<Conversation.Content>
|
|
165
|
+
<Message.Root from="user"><Message.Content>…</Message.Content></Message.Root>
|
|
166
|
+
<Message.Root from="assistant" streaming>
|
|
167
|
+
<Message.Content>
|
|
168
|
+
<Reasoning.Root streaming>
|
|
169
|
+
<Reasoning.Trigger />
|
|
170
|
+
<Reasoning.Content>…</Reasoning.Content>
|
|
171
|
+
</Reasoning.Root>
|
|
172
|
+
<Tool.Root name="search_docs" state="running">
|
|
173
|
+
<Tool.Trigger />
|
|
174
|
+
<Tool.Content><Tool.Input value={input} /><Tool.Output value={output} /></Tool.Content>
|
|
175
|
+
</Tool.Root>
|
|
176
|
+
</Message.Content>
|
|
177
|
+
<Message.Actions><Message.Copy value={text} /></Message.Actions>
|
|
178
|
+
</Message.Root>
|
|
179
|
+
</Conversation.Content>
|
|
180
|
+
<Conversation.ScrollButton />
|
|
181
|
+
</Conversation.Root>
|
|
182
|
+
|
|
183
|
+
<Composer.Root bind:value {status} onsubmit={send} onstop={stop}>
|
|
184
|
+
<Composer.Textarea placeholder="Ask anything" />
|
|
185
|
+
<Composer.Toolbar><Composer.Submit /></Composer.Toolbar>
|
|
186
|
+
</Composer.Root>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Agent timeline
|
|
190
|
+
|
|
191
|
+
Docs slug: `agent-timeline`.
|
|
192
|
+
|
|
193
|
+
| Component | Use it for |
|
|
194
|
+
| ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
195
|
+
| `Activity.Root`, `.Trigger`, `.Content`, `.Step`, `.Thought` | A stretch of work: says what the agent is doing, then what it did |
|
|
196
|
+
| `WorkFold` | Folds a finished turn's work behind "Worked for 2m 5s" |
|
|
197
|
+
| `Plan` (`steps: { label, status }[]`) | What the agent means to do, ticked off as it goes |
|
|
198
|
+
| `Approval` | The agent asks before acting; folds into the decision once answered. A choice's `shortcut` (`mod+enter`, `mod+backspace`, `enter`, `escape`) shows on its button and makes it |
|
|
199
|
+
| `Questionnaire` | Questions one at a time, with keys 1–9 to pick and ⌘Enter to send |
|
|
200
|
+
| `QueuedMessage` | A message sent while the agent was still working, waiting its turn |
|
|
201
|
+
| `ChangesSummary` (`ChangedFile[]`), `ChangeStats` (`additions`, `deletions`) | What a turn changed, and +12 −3 counts |
|
|
202
|
+
| `Divider` (`label`) | A labelled break in a timeline: a new day, "Context compacted" |
|
|
203
|
+
|
|
204
|
+
## Utilities
|
|
205
|
+
|
|
206
|
+
- `sx()`, `classes()` and the `Sx` type: see the `styling` skill.
|
|
207
|
+
- `resolveColor()` and `resolveRgba()`: see the `theming` skill.
|
|
208
|
+
- `whileVisible`: an attachment that runs an animation that never ends only while it can be seen, with `animationPlayState: play.whileVisible` from the tokens. Step the animation itself.
|
|
209
|
+
Shimmer, Skeleton and Progress run on it. Spinner does not: it is a CSS animation of `rotate`,
|
|
210
|
+
one turn in 600ms, so it stays smooth.
|
|
211
|
+
- `DevStyles`: see the `setup` skill.
|