@diegopluna/narvi 0.2.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/dist/color.d.ts +1 -1
- package/dist/components/activity/ActivityContent.svelte +2 -2
- 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 +9 -9
- package/dist/components/activity/ActivityStep.svelte.d.ts +9 -9
- package/dist/components/activity/ActivityThought.svelte +3 -3
- package/dist/components/activity/ActivityThought.svelte.d.ts +3 -3
- package/dist/components/activity/ActivityTrigger.svelte +5 -5
- 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 +5 -5
- package/dist/components/app-shell/AppShellBar.svelte.d.ts +5 -5
- package/dist/components/app-shell/AppShellHeader.svelte +3 -3
- package/dist/components/app-shell/AppShellHeader.svelte.d.ts +3 -3
- package/dist/components/app-shell/AppShellMain.svelte +2 -2
- package/dist/components/app-shell/AppShellMain.svelte.d.ts +2 -2
- package/dist/components/app-shell/AppShellPanel.svelte +6 -6
- package/dist/components/app-shell/AppShellPanel.svelte.d.ts +6 -6
- package/dist/components/app-shell/AppShellPanes.svelte +2 -2
- package/dist/components/app-shell/AppShellPanes.svelte.d.ts +2 -2
- package/dist/components/app-shell/AppShellRail.svelte +2 -2
- package/dist/components/app-shell/AppShellRail.svelte.d.ts +2 -2
- package/dist/components/app-shell/AppShellRoot.svelte +8 -8
- package/dist/components/app-shell/AppShellRoot.svelte.d.ts +8 -8
- package/dist/components/app-shell/AppShellSheet.svelte +4 -4
- package/dist/components/app-shell/AppShellSheet.svelte.d.ts +4 -4
- package/dist/components/app-shell/AppShellSidebar.svelte +3 -3
- package/dist/components/app-shell/AppShellSidebar.svelte.d.ts +3 -3
- package/dist/components/app-shell/AppShellToggle.svelte +5 -4
- package/dist/components/app-shell/AppShellToggle.svelte.d.ts +4 -4
- package/dist/components/approval/Approval.svelte +11 -11
- package/dist/components/approval/Approval.svelte.d.ts +11 -11
- package/dist/components/avatar/AvatarFallback.svelte +3 -2
- 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 +5 -5
- package/dist/components/avatar/AvatarRoot.svelte.d.ts +5 -5
- package/dist/components/badge/Badge.svelte +21 -6
- package/dist/components/badge/Badge.svelte.d.ts +8 -5
- package/dist/components/button/Button.svelte +54 -23
- package/dist/components/button/Button.svelte.d.ts +24 -18
- package/dist/components/card/Card.svelte +6 -6
- package/dist/components/card/Card.svelte.d.ts +6 -6
- package/dist/components/change-stats/ChangeStats.svelte +4 -4
- package/dist/components/change-stats/ChangeStats.svelte.d.ts +4 -4
- package/dist/components/changes-summary/ChangesSummary.svelte +6 -6
- package/dist/components/changes-summary/ChangesSummary.svelte.d.ts +6 -6
- package/dist/components/checkbox/Checkbox.svelte +19 -8
- package/dist/components/checkbox/Checkbox.svelte.d.ts +9 -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 +2 -2
- 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 +17 -8
- 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 +14 -11
- 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/composer/ComposerAttachButton.svelte +4 -4
- package/dist/components/composer/ComposerAttachButton.svelte.d.ts +4 -4
- package/dist/components/composer/ComposerAttachment.svelte +2 -2
- 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 +9 -9
- package/dist/components/composer/ComposerModelPicker.svelte.d.ts +9 -9
- package/dist/components/composer/ComposerRoot.svelte +18 -25
- package/dist/components/composer/ComposerRoot.svelte.d.ts +15 -15
- package/dist/components/composer/ComposerSubmit.svelte +6 -5
- package/dist/components/composer/ComposerSubmit.svelte.d.ts +4 -4
- package/dist/components/composer/ComposerTextarea.svelte +3 -3
- package/dist/components/composer/ComposerTextarea.svelte.d.ts +3 -3
- package/dist/components/composer/ComposerToggle.svelte +4 -4
- 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 +4 -4
- package/dist/components/composer/ComposerTray.svelte.d.ts +4 -4
- package/dist/components/conversation/ConversationContent.svelte +4 -4
- package/dist/components/conversation/ConversationContent.svelte.d.ts +4 -4
- package/dist/components/conversation/ConversationEmpty.svelte +5 -5
- 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 +4 -4
- package/dist/components/conversation/ConversationScrollButton.svelte.d.ts +4 -4
- package/dist/components/dialog/ConfirmDialog.svelte +46 -15
- 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 +6 -0
- package/dist/components/dialog/styles.js +6 -1
- package/dist/components/divider/Divider.svelte +3 -3
- package/dist/components/divider/Divider.svelte.d.ts +3 -3
- package/dist/components/empty-state/EmptyState.svelte +10 -5
- package/dist/components/empty-state/EmptyState.svelte.d.ts +5 -4
- package/dist/components/field/Field.svelte +88 -27
- 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 +6 -6
- package/dist/components/frame/Frame.svelte.d.ts +6 -6
- package/dist/components/grid/Grid.svelte +17 -6
- package/dist/components/grid/Grid.svelte.d.ts +6 -6
- package/dist/components/heading/Heading.svelte +29 -6
- 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 +2 -2
- package/dist/components/kbd/Kbd.svelte.d.ts +2 -2
- package/dist/components/link/Link.svelte +6 -6
- package/dist/components/link/Link.svelte.d.ts +6 -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 +16 -16
- package/dist/components/markdown/Markdown.svelte.d.ts +16 -16
- package/dist/components/markdown/MarkdownBlock.svelte +2 -2
- package/dist/components/markdown/MarkdownBlock.svelte.d.ts +2 -2
- package/dist/components/markdown/MarkdownBlocks.svelte +4 -4
- package/dist/components/markdown/MarkdownBlocks.svelte.d.ts +4 -4
- package/dist/components/markdown/MarkdownCode.svelte +1 -1
- package/dist/components/markdown/MarkdownCode.svelte.d.ts +1 -1
- package/dist/components/markdown/MarkdownFile.svelte +6 -4
- package/dist/components/markdown/MarkdownFile.svelte.d.ts +2 -2
- package/dist/components/markdown/MarkdownFootnotes.svelte +2 -1
- package/dist/components/markdown/MarkdownLink.svelte +1 -1
- package/dist/components/markdown/MarkdownLink.svelte.d.ts +1 -1
- package/dist/components/markdown/MarkdownTable.svelte +4 -11
- package/dist/components/markdown/MarkdownTable.svelte.d.ts +1 -1
- package/dist/components/markdown/styles.d.ts +0 -8
- package/dist/components/markdown/styles.js +0 -8
- 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 +23 -8
- 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 +6 -5
- package/dist/components/menu/index.js +9 -8
- package/dist/components/message/MessageAction.svelte +7 -7
- package/dist/components/message/MessageAction.svelte.d.ts +7 -7
- package/dist/components/message/MessageActions.svelte +4 -4
- package/dist/components/message/MessageActions.svelte.d.ts +4 -4
- package/dist/components/message/MessageContent.svelte +3 -3
- package/dist/components/message/MessageContent.svelte.d.ts +3 -3
- package/dist/components/message/MessageCopy.svelte +14 -17
- package/dist/components/message/MessageCopy.svelte.d.ts +7 -7
- package/dist/components/message/MessageHeader.svelte +3 -3
- package/dist/components/message/MessageHeader.svelte.d.ts +3 -3
- package/dist/components/message/MessagePending.svelte +2 -2
- 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 +3 -3
- package/dist/components/message/MessageTime.svelte.d.ts +3 -3
- package/dist/components/notice/Notice.svelte +45 -9
- package/dist/components/notice/Notice.svelte.d.ts +13 -8
- package/dist/components/plan/Plan.svelte +7 -14
- 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 +3 -3
- package/dist/components/progress/Progress.svelte.d.ts +3 -3
- package/dist/components/questionnaire/Questionnaire.svelte +17 -11
- package/dist/components/questionnaire/Questionnaire.svelte.d.ts +11 -11
- package/dist/components/queued-message/QueuedMessage.svelte +10 -10
- package/dist/components/queued-message/QueuedMessage.svelte.d.ts +10 -10
- package/dist/components/rail/RailItem.svelte +15 -22
- package/dist/components/rail/RailItem.svelte.d.ts +9 -9
- package/dist/components/rail/RailRoot.svelte +2 -2
- package/dist/components/rail/RailRoot.svelte.d.ts +2 -2
- package/dist/components/reasoning/ReasoningContent.svelte +2 -2
- 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 +3 -3
- package/dist/components/reasoning/ReasoningTrigger.svelte.d.ts +3 -3
- package/dist/components/resize-handle/ResizeHandle.svelte +10 -10
- 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 +71 -24
- package/dist/components/segmented/SegmentedControl.svelte.d.ts +14 -5
- package/dist/components/select/Select.svelte +39 -14
- package/dist/components/select/Select.svelte.d.ts +21 -13
- package/dist/components/separator/Separator.svelte +3 -3
- 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 +184 -56
- 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 +3 -3
- package/dist/components/shimmer/Shimmer.svelte.d.ts +3 -3
- package/dist/components/sidebar/SidebarContent.svelte +3 -3
- package/dist/components/sidebar/SidebarContent.svelte.d.ts +3 -3
- package/dist/components/sidebar/SidebarFolder.svelte +13 -8
- package/dist/components/sidebar/SidebarFolder.svelte.d.ts +5 -5
- package/dist/components/sidebar/SidebarFooter.svelte +2 -2
- package/dist/components/sidebar/SidebarFooter.svelte.d.ts +2 -2
- package/dist/components/sidebar/SidebarGroup.svelte +6 -6
- package/dist/components/sidebar/SidebarGroup.svelte.d.ts +6 -6
- package/dist/components/sidebar/SidebarHeader.svelte +3 -3
- package/dist/components/sidebar/SidebarHeader.svelte.d.ts +3 -3
- package/dist/components/sidebar/SidebarItem.svelte +39 -14
- package/dist/components/sidebar/SidebarItem.svelte.d.ts +15 -10
- package/dist/components/sidebar/SidebarRoot.svelte +4 -4
- package/dist/components/sidebar/SidebarRoot.svelte.d.ts +4 -4
- 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 +3 -1
- package/dist/components/sidebar/index.js +2 -1
- package/dist/components/skeleton/Skeleton.svelte +5 -5
- package/dist/components/skeleton/Skeleton.svelte.d.ts +5 -5
- package/dist/components/slider/Slider.svelte +13 -13
- package/dist/components/slider/Slider.svelte.d.ts +13 -13
- package/dist/components/spinner/Spinner.svelte +4 -3
- 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 +5 -4
- package/dist/components/status-indicator/StatusIndicator.svelte.d.ts +4 -4
- package/dist/components/suggestions/SuggestionsItem.svelte +3 -3
- 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 +18 -7
- package/dist/components/switch/Switch.svelte.d.ts +8 -6
- package/dist/components/tab-strip/TabStrip.svelte +106 -25
- package/dist/components/tab-strip/TabStrip.svelte.d.ts +9 -9
- package/dist/components/tabs/Tabs.svelte +72 -26
- package/dist/components/tabs/Tabs.svelte.d.ts +13 -7
- package/dist/components/text/Text.svelte +35 -11
- package/dist/components/text/Text.svelte.d.ts +12 -10
- 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 +34 -27
- 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 +2 -2
- 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 +4 -4
- package/dist/components/tool/ToolSection.svelte.d.ts +4 -4
- package/dist/components/tool/ToolTrigger.svelte +4 -4
- package/dist/components/tool/ToolTrigger.svelte.d.ts +4 -4
- package/dist/components/tooltip/TooltipContent.svelte +9 -6
- 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 +4 -4
- package/dist/components/work-fold/WorkFold.svelte.d.ts +4 -4
- package/dist/index.d.ts +15 -5
- package/dist/index.js +8 -1
- package/dist/internal/Chevron.svelte +1 -1
- package/dist/internal/Chevron.svelte.d.ts +1 -1
- package/dist/internal/Code.svelte +6 -1
- 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 +4 -2
- package/dist/internal/Glyph.svelte.d.ts +3 -2
- package/dist/internal/Tile.svelte +5 -5
- 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/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 +3 -1
- package/dist/internal/layer.js +7 -2
- 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 +4 -0
- package/dist/internal/markers.stylex.js +2 -0
- package/dist/internal/responsive.d.ts +1 -1
- package/dist/internal/roving.d.ts +1 -1
- package/dist/internal/sx.d.ts +4 -4
- package/dist/internal/tooltip-trigger.d.ts +9 -0
- package/dist/internal/tooltip-trigger.js +19 -0
- package/dist/markdown/ast.d.ts +6 -6
- package/dist/markdown/blocks.d.ts +6 -5
- package/dist/markdown/file-paths.d.ts +3 -3
- package/dist/markdown/files.d.ts +2 -2
- package/dist/markdown/highlight.d.ts +2 -2
- package/dist/markdown/html.d.ts +3 -12
- package/dist/markdown/images.d.ts +1 -1
- package/dist/markdown/inlines.d.ts +2 -2
- package/dist/markdown/parse.d.ts +3 -3
- package/dist/markdown/plugin.d.ts +21 -20
- package/dist/markdown/sanitize.d.ts +1 -1
- package/dist/markers.stylex.d.ts +13 -0
- package/dist/markers.stylex.js +11 -0
- package/dist/preset.d.ts +5 -5
- package/dist/preset.js +6 -6
- package/dist/tokens.stylex.d.ts +2 -0
- package/dist/tokens.stylex.js +10 -4
- package/dist/typography.d.ts +7 -0
- package/dist/typography.js +8 -0
- package/dist/visually-hidden.d.ts +18 -0
- package/dist/visually-hidden.js +21 -0
- package/dist/vite.d.ts +2 -2
- package/package.json +6 -2
- package/skills/building-ui/SKILL.md +162 -19
- package/skills/building-ui/references/components.md +39 -35
- package/skills/markdown/SKILL.md +1 -1
- package/skills/setup/SKILL.md +9 -1
- package/skills/styling/SKILL.md +58 -9
- package/skills/theming/SKILL.md +95 -2
package/dist/tokens.stylex.js
CHANGED
|
@@ -31,12 +31,14 @@ export const colors = stylex.defineVars({
|
|
|
31
31
|
// A well: code, a track, a tray
|
|
32
32
|
fillSunken: 'light-dark(rgb(22 24 28 / 0.04), rgb(0 0 0 / 0.26))',
|
|
33
33
|
// Borders. `border` divides and outlines quietly; `borderStrong` outlines a button or a
|
|
34
|
-
// dialog. `borderControl` is the boundary of an input and
|
|
35
|
-
//
|
|
34
|
+
// dialog. `borderControl` is the boundary of an input and an off switch's track: no darker
|
|
35
|
+
// than it must be, 3:1 against the plain surface a control rests on where that is hardest
|
|
36
|
+
// (the page by day, what is raised by night). On a hovered row it is about 2.7:1 by day
|
|
37
|
+
// and 2.5:1 by night; a control is not set in a row that hovers.
|
|
36
38
|
border: 'light-dark(rgb(22 24 28 / 0.1), rgb(255 255 255 / 0.09))',
|
|
37
39
|
borderStrong: 'light-dark(rgb(22 24 28 / 0.2), rgb(255 255 255 / 0.16))',
|
|
38
|
-
borderControl: 'light-dark(#
|
|
39
|
-
borderControlHover: 'light-dark(#
|
|
40
|
+
borderControl: 'light-dark(#8b8d92, #67696e)',
|
|
41
|
+
borderControlHover: 'light-dark(#818489, #76797e)',
|
|
40
42
|
// The one shadow: the drop under what floats over the page (a menu, a dialog, a drawer).
|
|
41
43
|
// Nothing that rests on the page casts one.
|
|
42
44
|
shadow: 'light-dark(rgb(22 24 28 / 0.16), rgb(0 0 0 / 0.5))',
|
|
@@ -91,6 +93,8 @@ export const colors = stylex.defineVars({
|
|
|
91
93
|
*/
|
|
92
94
|
export const space = stylex.defineVars({
|
|
93
95
|
x1: '0.25rem',
|
|
96
|
+
// 6px: between an icon and its words, or two close items
|
|
97
|
+
x1_5: '0.375rem',
|
|
94
98
|
x2: '0.5rem',
|
|
95
99
|
x3: '0.75rem',
|
|
96
100
|
x4: '1rem',
|
|
@@ -140,6 +144,8 @@ export const font = stylex.defineVars({
|
|
|
140
144
|
sizeReading: '1rem',
|
|
141
145
|
// A title in the text's own face: a dialog's, a section's
|
|
142
146
|
sizeTitle: '1.0625rem',
|
|
147
|
+
// A number that is the point of its place: a total, a usage figure, a count on a card
|
|
148
|
+
sizeFigure: '1.75rem',
|
|
143
149
|
weightRegular: '400',
|
|
144
150
|
weightMedium: '500',
|
|
145
151
|
weightSemibold: '600',
|
package/dist/typography.d.ts
CHANGED
|
@@ -39,6 +39,13 @@ export declare const typography: Readonly<{
|
|
|
39
39
|
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
40
40
|
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", 1.45>;
|
|
41
41
|
}>;
|
|
42
|
+
readonly figure: Readonly<{
|
|
43
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
44
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
45
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", 1.1>;
|
|
46
|
+
readonly letterSpacing: stylex.StyleXClassNameFor<"letterSpacing", "-0.01em">;
|
|
47
|
+
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
48
|
+
}>;
|
|
42
49
|
readonly micro: Readonly<{
|
|
43
50
|
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
44
51
|
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
package/dist/typography.js
CHANGED
|
@@ -46,6 +46,14 @@ export const typography = stylex.create({
|
|
|
46
46
|
fontWeight: font.weightRegular,
|
|
47
47
|
lineHeight: 1.45
|
|
48
48
|
},
|
|
49
|
+
// A number that is the point of its place: a total, a usage figure. Its digits line up.
|
|
50
|
+
figure: {
|
|
51
|
+
fontSize: font.sizeFigure,
|
|
52
|
+
fontWeight: font.weightSemibold,
|
|
53
|
+
lineHeight: 1.1,
|
|
54
|
+
letterSpacing: '-0.01em',
|
|
55
|
+
fontVariantNumeric: 'tabular-nums'
|
|
56
|
+
},
|
|
49
57
|
// A counter or a status inside tight chrome
|
|
50
58
|
micro: {
|
|
51
59
|
fontSize: font.sizeMicro,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden from sight and kept for assistive technology: a label a screen reader needs and the
|
|
3
|
+
* screen does not, or a live status that is only heard.
|
|
4
|
+
*
|
|
5
|
+
* <span {...stylex.attrs(visuallyHidden)}>Copied</span>
|
|
6
|
+
*/
|
|
7
|
+
import * as stylex from '@stylexjs/stylex';
|
|
8
|
+
export declare const visuallyHidden: Readonly<{
|
|
9
|
+
readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
|
|
10
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1px">;
|
|
11
|
+
readonly height: stylex.StyleXClassNameFor<"height", "1px">;
|
|
12
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", "-1px">;
|
|
13
|
+
readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
|
|
14
|
+
readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
|
|
15
|
+
readonly clipPath: stylex.StyleXClassNameFor<"clipPath", "inset(50%)">;
|
|
16
|
+
readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
|
|
17
|
+
readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden from sight and kept for assistive technology: a label a screen reader needs and the
|
|
3
|
+
* screen does not, or a live status that is only heard.
|
|
4
|
+
*
|
|
5
|
+
* <span {...stylex.attrs(visuallyHidden)}>Copied</span>
|
|
6
|
+
*/
|
|
7
|
+
import * as stylex from '@stylexjs/stylex';
|
|
8
|
+
const styles = stylex.create({
|
|
9
|
+
visuallyHidden: {
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
width: '1px',
|
|
12
|
+
height: '1px',
|
|
13
|
+
margin: '-1px',
|
|
14
|
+
padding: 0,
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
clipPath: 'inset(50%)',
|
|
17
|
+
whiteSpace: 'nowrap',
|
|
18
|
+
borderWidth: 0
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export const visuallyHidden = styles.visuallyHidden;
|
package/dist/vite.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type NarviOptions = StylexOptions & {
|
|
|
7
7
|
* pre-bundling. Narvi is always on the list. (StyleX reads this option, but its
|
|
8
8
|
* types leave it out.)
|
|
9
9
|
*/
|
|
10
|
-
externalPackages?: ReadonlyArray<string
|
|
10
|
+
externalPackages?: ReadonlyArray<string> | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* For apps that use Tailwind CSS 4. Places Narvi's layer after Tailwind's
|
|
13
13
|
* `base` (so Preflight does not undo Narvi) and before its `components` and
|
|
@@ -19,7 +19,7 @@ export type NarviOptions = StylexOptions & {
|
|
|
19
19
|
* @layer theme, base, narvi, components, utilities;
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
tailwind?: boolean;
|
|
22
|
+
tailwind?: boolean | undefined;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* The oldest browsers with `light-dark()`, which Narvi's colours are written in. The plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegopluna/narvi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"packageManager": "pnpm@12.18.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
"types": "./dist/media.stylex.d.ts",
|
|
50
50
|
"default": "./dist/media.stylex.js"
|
|
51
51
|
},
|
|
52
|
+
"./markers.stylex.js": {
|
|
53
|
+
"types": "./dist/markers.stylex.d.ts",
|
|
54
|
+
"default": "./dist/markers.stylex.js"
|
|
55
|
+
},
|
|
52
56
|
"./markdown": {
|
|
53
57
|
"types": "./dist/markdown/index.d.ts",
|
|
54
58
|
"default": "./dist/markdown/index.js"
|
|
@@ -91,7 +95,7 @@
|
|
|
91
95
|
"scripts": {
|
|
92
96
|
"dev": "vite dev",
|
|
93
97
|
"build": "pnpm run build:lib && pnpm run build:docs",
|
|
94
|
-
"build:lib": "node scripts/base-css.js && svelte-kit sync && svelte-package && node scripts/check-types.js && publint",
|
|
98
|
+
"build:lib": "node scripts/base-css.js && svelte-kit sync && svelte-package && node scripts/check-types.js && tsc -p scripts/exact && publint",
|
|
95
99
|
"build:docs": "vite build",
|
|
96
100
|
"preview": "vite preview",
|
|
97
101
|
"prepare": "svelte-kit sync || echo ''",
|
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
Grid, and Narvi's conventions for colour, labels and copy.
|
|
13
13
|
type: core
|
|
14
14
|
library: '@diegopluna/narvi'
|
|
15
|
-
library_version: '0.
|
|
15
|
+
library_version: '0.3.0'
|
|
16
16
|
requires:
|
|
17
17
|
- setup
|
|
18
18
|
sources:
|
|
@@ -25,6 +25,13 @@ sources:
|
|
|
25
25
|
- src/routes/components/chat/anatomy.svelte.txt
|
|
26
26
|
- src/routes/components/app-shell/anatomy.svelte.txt
|
|
27
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
|
|
28
35
|
---
|
|
29
36
|
|
|
30
37
|
# Build interfaces with Narvi
|
|
@@ -109,9 +116,20 @@ gets the ARIA attributes, the handlers and the ref:
|
|
|
109
116
|
The same `child` pattern applies to `Menu.Trigger`, `Popover.Trigger`, `Tooltip.Trigger`,
|
|
110
117
|
`HoverCard.Trigger`, `Sheet.Trigger` and `Collapsible.Trigger`.
|
|
111
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
|
+
|
|
112
128
|
For a yes/no confirmation, use `ConfirmDialog`. It takes a `title` that asks the question and a
|
|
113
129
|
`confirmLabel` that names the action. If `onconfirm` returns a promise, the dialog waits for it
|
|
114
|
-
and shows the error when it rejects.
|
|
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.
|
|
115
133
|
|
|
116
134
|
### Forms
|
|
117
135
|
|
|
@@ -126,31 +144,92 @@ wiring for them.
|
|
|
126
144
|
</Field>
|
|
127
145
|
```
|
|
128
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
|
+
|
|
129
160
|
The other controls don't read Field, so label them directly:
|
|
130
161
|
|
|
131
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.
|
|
132
165
|
- `SegmentedControl`, `ToggleGroup.Root` and `Slider` need an `aria-label` (or
|
|
133
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.
|
|
134
170
|
|
|
135
|
-
For a settings page, put
|
|
136
|
-
|
|
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 }`:
|
|
137
174
|
|
|
138
175
|
```svelte
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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>
|
|
144
213
|
```
|
|
145
214
|
|
|
146
|
-
|
|
147
|
-
|
|
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).
|
|
148
227
|
|
|
149
228
|
### Layout with Stack and Grid
|
|
150
229
|
|
|
151
230
|
`Stack` lays children out in a column (the default) or a row. `Grid` lays them out in columns.
|
|
152
|
-
Their gaps are steps on the 4px scale: `gap={4}` is 16px, and the steps are 0, 1,
|
|
153
|
-
10, 12 and 16. Every layout prop takes a value, or values by breakpoint (`sm` 640px, `md` 768px,
|
|
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,
|
|
154
233
|
`lg` 1024px, `xl` 1280px, mobile first):
|
|
155
234
|
|
|
156
235
|
```svelte
|
|
@@ -170,24 +249,57 @@ flex or grid style of your own. For anything they can't express, see the `stylin
|
|
|
170
249
|
|
|
171
250
|
### Text
|
|
172
251
|
|
|
173
|
-
Use `Heading` (`level` 1–6 for the outline,
|
|
174
|
-
`Text` (`variant` is what the text is: `
|
|
175
|
-
|
|
176
|
-
|
|
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
|
|
177
258
|
`Link` for links inside text. `Button href` gives a link that looks like a button, and
|
|
178
259
|
`Card href` makes the whole card a link.
|
|
179
260
|
|
|
180
261
|
### Feedback
|
|
181
262
|
|
|
182
263
|
- Toasts: mount one `<Toaster />` near the root, then call `toast('Copied the link')` from
|
|
183
|
-
anywhere
|
|
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.
|
|
184
283
|
- `Tooltip.Root` must sit inside a `Tooltip.Provider`. Mount one near the root. Give an icon
|
|
185
284
|
button an `aria-label` too, because the tooltip shows a name but doesn't supply one.
|
|
186
|
-
- Use `Notice` for a note in place (`tone`: neutral, info, success, warning, danger
|
|
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),
|
|
187
287
|
`EmptyState` for an empty place, `Skeleton`, `Spinner` or `Progress` while loading, and
|
|
188
288
|
`StatusIndicator` (`status`: idle, working, waiting, done, failed, stopped, connecting) for where
|
|
189
289
|
a run stands.
|
|
190
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
|
+
|
|
191
303
|
### App and chat screens
|
|
192
304
|
|
|
193
305
|
`AppShell` is the window: its bar across the top, a rail, and one sheet that holds the sidebar,
|
|
@@ -199,6 +311,24 @@ itself. `Sidebar` and `Rail` fill it; each also stands on its own: a `Sidebar` i
|
|
|
199
311
|
[component catalogue](references/components.md) for their anatomy before building one of these
|
|
200
312
|
screens. Render a reply's text with `<Markdown value={text} streaming={!done} />` inside `Message.Content`; the `markdown` skill covers it.
|
|
201
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
|
+
|
|
202
332
|
## Conventions
|
|
203
333
|
|
|
204
334
|
- **Colour is for state.** `accent` (blue by default) marks focus, selection, progress and
|
|
@@ -209,6 +339,10 @@ screens. Render a reply's text with `<Markdown value={text} streaming={!done} />
|
|
|
209
339
|
`danger` is the solid a confirming dialog asks for, `danger-outline` its quieter form, and
|
|
210
340
|
`ghost-danger` an icon that deletes. `warning-outline` and `success-outline` say the same of
|
|
211
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.
|
|
212
346
|
- **One short label.** Don't join details with a dot ("Queued · sends later"). Put the rest in
|
|
213
347
|
an element of its own, or a tooltip.
|
|
214
348
|
- **What waits on the person goes over the composer.** Put an `Approval`, a `Questionnaire` or
|
|
@@ -227,6 +361,15 @@ screens. Render a reply's text with `<Markdown value={text} streaming={!done} />
|
|
|
227
361
|
- **HIGH: an icon-only Button without `aria-label`.** `iconOnly` makes it square, but it has
|
|
228
362
|
no accessible name until you give it one.
|
|
229
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`.
|
|
230
373
|
- **MEDIUM: wrapping a Checkbox, Switch or SegmentedControl in `Field`.** They don't read Field's
|
|
231
374
|
context, so the label names nothing. Use children or `aria-label`, as above.
|
|
232
375
|
- **MEDIUM: a flex `<div>` with margins between children.** Use Stack or Grid. Their gaps follow
|
|
@@ -7,21 +7,22 @@ component: import the namespace (`Dialog`) and use `Dialog.Root`. Docs and live
|
|
|
7
7
|
|
|
8
8
|
## Layout and text
|
|
9
9
|
|
|
10
|
-
| Component
|
|
11
|
-
|
|
|
12
|
-
| `Stack`
|
|
13
|
-
| `Grid`
|
|
14
|
-
| `Card`
|
|
15
|
-
| `Frame`
|
|
16
|
-
| `Separator`
|
|
17
|
-
| `Heading`
|
|
18
|
-
| `Text`
|
|
19
|
-
| `Link`
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
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` |
|
|
25
26
|
|
|
26
27
|
## Controls and forms
|
|
27
28
|
|
|
@@ -31,31 +32,34 @@ component: import the namespace (`Dialog`) and use `Dialog.Root`. Docs and live
|
|
|
31
32
|
| `Field` | Label, help text and error around one control | `field` |
|
|
32
33
|
| `Input` | One line of text | `input` |
|
|
33
34
|
| `Textarea` | Several lines of text | `textarea` |
|
|
34
|
-
| `Select` | One choice from a short list (`options: { value, label, group? }[]`)
|
|
35
|
+
| `Select` | One choice from a short list (`options: { value, label, icon?, group? }[]`, `align`) | `select` |
|
|
35
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` |
|
|
36
38
|
| `Switch` | A setting that takes effect at once | `switch` |
|
|
37
|
-
| `SegmentedControl` | One of a few options, all visible (`options: { value, label }[]`)
|
|
39
|
+
| `SegmentedControl` | One of a few options, all visible (`options: { value, label, title? }[]`) | `segmented-control` |
|
|
38
40
|
| `Slider` | A value or a range along a track | `slider` |
|
|
39
41
|
| `Toggle` | A button that stays pressed | `toggle` |
|
|
40
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` |
|
|
41
44
|
| `SettingsRow` | One setting: what it is, beside its control | `settings-row` |
|
|
42
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` |
|
|
43
47
|
| `TabStrip` | Tabs for what is open in a pane: closable, addable, scrolling (`tabs`, `bind:value`, `onclose`, `onadd`). The panel is yours | `tab-strip` |
|
|
44
48
|
|
|
45
49
|
## Overlays (bits-ui; use `child` snippets on triggers)
|
|
46
50
|
|
|
47
|
-
| Component
|
|
48
|
-
|
|
|
49
|
-
| `Dialog.Root`, `.Trigger`, `.Content` (`size`, `side`), `.Header`, `.Title`, `.Description`, `.Body`, `.Footer`, `.Close`
|
|
50
|
-
| `ConfirmDialog`
|
|
51
|
-
| `Sheet.Root`, `.Trigger`, `.Content` (`side`), `.Header`, `.Title`, `.Description`, `.Body`, `.Footer`, `.Close`
|
|
52
|
-
| `Popover.Root`, `.Trigger`, `.Content`, `.Close`
|
|
53
|
-
| `HoverCard.Root`, `.Trigger`, `.Content`
|
|
54
|
-
| `Menu.Root`, `.Trigger`, `.Content`, `.Item`, `.CheckboxItem`, `.RadioGroup`, `.RadioItem`, `.Group`, `.Label`, `.Separator`, `.Sub`
|
|
55
|
-
| `ContextMenu.Root`, `.Trigger`, `.Content`, filled with `Menu` items
|
|
56
|
-
| `Command.Dialog`, `.Root`, `.Input`, `.List`, `.Group`, `.Item`, `.Empty`, `.Separator`, `.Footer`
|
|
57
|
-
| `Tooltip.Provider`, `.Root`, `.Trigger`, `.Content` (`shortcut`)
|
|
58
|
-
| `Collapsible.Root`, `.Trigger`, `.Content`
|
|
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` |
|
|
59
63
|
|
|
60
64
|
## Feedback and status
|
|
61
65
|
|
|
@@ -76,12 +80,12 @@ component: import the namespace (`Dialog`) and use `Dialog.Root`. Docs and live
|
|
|
76
80
|
|
|
77
81
|
## App shell
|
|
78
82
|
|
|
79
|
-
| Component
|
|
80
|
-
|
|
|
81
|
-
| `AppShell.Root` (`bind:sidebarOpen`, `windowInset`), `.Bar` (`center`, `end` snippets), `.Rail`, `.Panes`, `.Sheet` (`flush`), `.Sidebar`, `.Main`, `.Header` (`drag`), `.Panel` (`bind:width`), `.Toggle` (`when`)
|
|
82
|
-
| `Sidebar.Root` (`label`), `.Header` (`drag`), `.Content` (`label`), `.Group`, `.Folder` (`bind:open`, `leading`, `trailing` snippets), `.Item` (`current`, `leading`, `trailing`, `meta`, `actions` snippets), `.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` |
|
|
83
|
-
| `Rail.Root` (`label`), `.Item` (`label`, `href`, `current`, `badge`, `badgeTone`, `shortcut`), `.Separator`, `.Spacer`
|
|
84
|
-
| `ResizeHandle`
|
|
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 |
|
|
85
89
|
|
|
86
90
|
`AppShell.Bar`, `AppShell.Rail` and `AppShell.Sheet` are direct children of `AppShell.Root`; the
|
|
87
91
|
sidebar, the page and the panel go inside the sheet. The bar is where macOS's traffic lights sit
|
package/skills/markdown/SKILL.md
CHANGED
package/skills/setup/SKILL.md
CHANGED
|
@@ -11,13 +11,15 @@ metadata:
|
|
|
11
11
|
4 when the app uses it.
|
|
12
12
|
type: lifecycle
|
|
13
13
|
library: '@diegopluna/narvi'
|
|
14
|
-
library_version: '0.
|
|
14
|
+
library_version: '0.3.0'
|
|
15
15
|
sources:
|
|
16
16
|
- src/lib/vite.ts
|
|
17
17
|
- src/lib/base.css
|
|
18
18
|
- src/lib/components/dev-styles/DevStyles.svelte
|
|
19
19
|
- src/routes/docs/installation/+page.svelte
|
|
20
20
|
- src/routes/docs/styling/+page.svelte
|
|
21
|
+
- src/lib/internal/loose.ts
|
|
22
|
+
- scripts/exact/consumer.ts
|
|
21
23
|
---
|
|
22
24
|
|
|
23
25
|
# Set up Narvi
|
|
@@ -121,6 +123,12 @@ system faces. To load them, install `@fontsource/cormorant-garamond` (or the
|
|
|
121
123
|
`@fontsource-variable/` build) and `@fontsource/geist-mono` and import them in the root layout.
|
|
122
124
|
Narvi lists both naming styles, so neither needs a theme override.
|
|
123
125
|
|
|
126
|
+
## TypeScript
|
|
127
|
+
|
|
128
|
+
Narvi's types work with `exactOptionalPropertyTypes`. Every optional prop takes `undefined`, so
|
|
129
|
+
`<Notice detail={maybe}>` and `<Tooltip.Content side={maybe}>` type-check as they are, with no
|
|
130
|
+
need to spread a prop only when it is set. That holds for the parts Narvi takes from bits-ui too.
|
|
131
|
+
|
|
124
132
|
## With Tailwind CSS 4
|
|
125
133
|
|
|
126
134
|
Out of the box, Narvi's layer comes after Tailwind's, so a utility such as `hidden` on a Button
|