@diegopluna/narvi 0.2.0 → 0.3.1
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 +3 -1
- 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 +195 -56
- package/dist/components/settings-row/SettingsRow.svelte.d.ts +45 -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 +25 -15
- 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 +43 -18
- 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 +10 -0
- package/dist/components/sidebar/depth.js +16 -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 +17 -8
- package/dist/vite.js +38 -0
- package/package.json +6 -2
- package/skills/building-ui/SKILL.md +169 -19
- package/skills/building-ui/references/components.md +39 -35
- package/skills/markdown/SKILL.md +1 -1
- package/skills/setup/SKILL.md +17 -11
- package/skills/styling/SKILL.md +58 -9
- package/skills/theming/SKILL.md +95 -2
package/dist/preset.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ type AccentTokens = {
|
|
|
25
25
|
* own colour, which it takes from the stone.
|
|
26
26
|
*/
|
|
27
27
|
export declare const accents: ReadonlyArray<Option<AccentId> & {
|
|
28
|
-
tokens?: AccentTokens;
|
|
28
|
+
tokens?: AccentTokens | undefined;
|
|
29
29
|
}>;
|
|
30
30
|
export type StoneId = 'warm' | 'cool' | 'graphite';
|
|
31
31
|
type StoneTokens = {
|
|
@@ -56,15 +56,15 @@ type RadiusScale = {
|
|
|
56
56
|
};
|
|
57
57
|
/** A frame is always its inner radius plus its padding: `frame` = `card` + 5. */
|
|
58
58
|
export declare const radii: ReadonlyArray<Option<RadiusId> & {
|
|
59
|
-
scale?: RadiusScale;
|
|
59
|
+
scale?: RadiusScale | undefined;
|
|
60
60
|
}>;
|
|
61
61
|
type Face<Id extends string> = Option<Id> & {
|
|
62
62
|
/** The CSS font-family stack. */
|
|
63
63
|
stack: string;
|
|
64
64
|
/** The Fontsource package that serves it, if any. */
|
|
65
|
-
package?: string;
|
|
65
|
+
package?: string | undefined;
|
|
66
66
|
/** What to import from that package. */
|
|
67
|
-
imports?: string[];
|
|
67
|
+
imports?: string[] | undefined;
|
|
68
68
|
};
|
|
69
69
|
export type BodyId = 'geist' | 'inter' | 'plex' | 'system';
|
|
70
70
|
export type DisplayId = 'cormorant' | 'fraunces' | 'instrument' | 'sans';
|
|
@@ -78,7 +78,7 @@ export declare const motions: ReadonlyArray<Option<MotionId> & {
|
|
|
78
78
|
fast: number;
|
|
79
79
|
base: number;
|
|
80
80
|
slow: number;
|
|
81
|
-
};
|
|
81
|
+
} | undefined;
|
|
82
82
|
}>;
|
|
83
83
|
export type SchemeId = 'dark' | 'light' | 'system';
|
|
84
84
|
export declare const schemes: ReadonlyArray<Option<SchemeId>>;
|
package/dist/preset.js
CHANGED
|
@@ -104,8 +104,8 @@ export const stones = [
|
|
|
104
104
|
text: ['#1a1814', '#f0ece7'],
|
|
105
105
|
textMuted: ['#63605b', '#b8b4af'],
|
|
106
106
|
textSubtle: ['#686460', '#a6a39e'],
|
|
107
|
-
borderControl: ['#
|
|
108
|
-
borderControlHover: ['#
|
|
107
|
+
borderControl: ['#918d89', '#6f6c68'],
|
|
108
|
+
borderControlHover: ['#87837f', '#817d79']
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
{
|
|
@@ -119,8 +119,8 @@ export const stones = [
|
|
|
119
119
|
text: ['#16181c', '#eaedf2'],
|
|
120
120
|
textMuted: ['#5e6065', '#adb0b5'],
|
|
121
121
|
textSubtle: ['#616468', '#9da0a5'],
|
|
122
|
-
borderControl: ['#
|
|
123
|
-
borderControlHover: ['#
|
|
122
|
+
borderControl: ['#8b8d92', '#67696e'],
|
|
123
|
+
borderControlHover: ['#818489', '#76797e']
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
{
|
|
@@ -134,8 +134,8 @@ export const stones = [
|
|
|
134
134
|
text: ['#181818', '#ededed'],
|
|
135
135
|
textMuted: ['#606060', '#a9a9a9'],
|
|
136
136
|
textSubtle: ['#656565', '#999999'],
|
|
137
|
-
borderControl: ['#
|
|
138
|
-
borderControlHover: ['#
|
|
137
|
+
borderControl: ['#8d8d8d', '#656565'],
|
|
138
|
+
borderControlHover: ['#848484', '#747474']
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
];
|
package/dist/tokens.stylex.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export declare const colors: stylex.VarGroup<Readonly<{
|
|
|
62
62
|
*/
|
|
63
63
|
export declare const space: stylex.VarGroup<Readonly<{
|
|
64
64
|
x1: string;
|
|
65
|
+
x1_5: string;
|
|
65
66
|
x2: string;
|
|
66
67
|
x3: string;
|
|
67
68
|
x4: string;
|
|
@@ -95,6 +96,7 @@ export declare const font: stylex.VarGroup<Readonly<{
|
|
|
95
96
|
sizeBody: string;
|
|
96
97
|
sizeReading: string;
|
|
97
98
|
sizeTitle: string;
|
|
99
|
+
sizeFigure: string;
|
|
98
100
|
weightRegular: string;
|
|
99
101
|
weightMedium: string;
|
|
100
102
|
weightSemibold: string;
|
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,19 +7,15 @@ 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
|
|
14
14
|
* `utilities` (so a class such as `hidden sm:inline-flex` overrides a
|
|
15
|
-
* component).
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* ```css
|
|
19
|
-
* @layer theme, base, narvi, components, utilities;
|
|
20
|
-
* ```
|
|
15
|
+
* component). Every stylesheet that names one of these layers starts with the
|
|
16
|
+
* order (`TAILWIND_ORDER`), so it holds whichever the browser reads first.
|
|
21
17
|
*/
|
|
22
|
-
tailwind?: boolean;
|
|
18
|
+
tailwind?: boolean | undefined;
|
|
23
19
|
};
|
|
24
20
|
/**
|
|
25
21
|
* The oldest browsers with `light-dark()`, which Narvi's colours are written in. The plugin
|
|
@@ -30,6 +26,19 @@ export declare const CSS_TARGET: string[];
|
|
|
30
26
|
export declare const NARVI_LAYER = "narvi";
|
|
31
27
|
/** The layer inside it that holds `@diegopluna/narvi/base.css`, below every component. */
|
|
32
28
|
export declare const BASE_LAYER = "narvi.base";
|
|
29
|
+
/**
|
|
30
|
+
* The order of Narvi's layer among Tailwind's, as the first rule of a stylesheet. With
|
|
31
|
+
* `narvi({ tailwind: true })` the plugin writes it at the top of each one that names a layer.
|
|
32
|
+
*/
|
|
33
|
+
export declare const TAILWIND_ORDER = "@layer theme, base, narvi.base, components, utilities;";
|
|
34
|
+
/**
|
|
35
|
+
* Puts Tailwind's layer order, with Narvi's in it, at the top of a stylesheet that names one of
|
|
36
|
+
* those layers. The browser orders layers as it first meets their names, and the first stylesheet
|
|
37
|
+
* on the page need not be the app's: a component's own stylesheet, such as the one that sizes
|
|
38
|
+
* icons, can load first. Naming `narvi` there before Tailwind's layers put Narvi below `base`,
|
|
39
|
+
* where Preflight's reset undid it. Returns `undefined` when the stylesheet is left as it is.
|
|
40
|
+
*/
|
|
41
|
+
export declare function orderLayers(code: string, id: string): string | undefined;
|
|
33
42
|
/**
|
|
34
43
|
* Vite plugin that compiles Narvi's styles (and any StyleX you write yourself).
|
|
35
44
|
*
|
package/dist/vite.js
CHANGED
|
@@ -11,6 +11,31 @@ export const CSS_TARGET = ['chrome123', 'edge123', 'firefox120', 'safari17.5'];
|
|
|
11
11
|
export const NARVI_LAYER = 'narvi';
|
|
12
12
|
/** The layer inside it that holds `@diegopluna/narvi/base.css`, below every component. */
|
|
13
13
|
export const BASE_LAYER = `${NARVI_LAYER}.base`;
|
|
14
|
+
/**
|
|
15
|
+
* The order of Narvi's layer among Tailwind's, as the first rule of a stylesheet. With
|
|
16
|
+
* `narvi({ tailwind: true })` the plugin writes it at the top of each one that names a layer.
|
|
17
|
+
*/
|
|
18
|
+
export const TAILWIND_ORDER = `@layer theme, base, ${BASE_LAYER}, components, utilities;`;
|
|
19
|
+
// A stylesheet Vite compiles, including a Svelte component's (`?svelte&type=style&lang.css`),
|
|
20
|
+
// and not one imported as a URL or as text.
|
|
21
|
+
const CSS_RE = /\.(?:css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
|
|
22
|
+
const NOT_CSS_RE = /[?&](?:raw|url|worker|sharedworker)\b/;
|
|
23
|
+
// A rule or a statement that names Narvi's layer or one of Tailwind's.
|
|
24
|
+
const NAMES_LAYER_RE = /@layer\s+(?:narvi|theme|base|components|utilities)\b/;
|
|
25
|
+
/**
|
|
26
|
+
* Puts Tailwind's layer order, with Narvi's in it, at the top of a stylesheet that names one of
|
|
27
|
+
* those layers. The browser orders layers as it first meets their names, and the first stylesheet
|
|
28
|
+
* on the page need not be the app's: a component's own stylesheet, such as the one that sizes
|
|
29
|
+
* icons, can load first. Naming `narvi` there before Tailwind's layers put Narvi below `base`,
|
|
30
|
+
* where Preflight's reset undid it. Returns `undefined` when the stylesheet is left as it is.
|
|
31
|
+
*/
|
|
32
|
+
export function orderLayers(code, id) {
|
|
33
|
+
if (!CSS_RE.test(id) || NOT_CSS_RE.test(id) || !NAMES_LAYER_RE.test(code))
|
|
34
|
+
return undefined;
|
|
35
|
+
// `@charset` must stay first; the order may come before any `@import`
|
|
36
|
+
const charset = /^@charset\s+"[^"]*";\s*/.exec(code)?.[0] ?? '';
|
|
37
|
+
return `${charset}${TAILWIND_ORDER}\n${code.slice(charset.length)}`;
|
|
38
|
+
}
|
|
14
39
|
/**
|
|
15
40
|
* Vite plugin that compiles Narvi's styles (and any StyleX you write yourself).
|
|
16
41
|
*
|
|
@@ -55,6 +80,8 @@ export function narvi({ tailwind = false, ...options } = {}) {
|
|
|
55
80
|
const configureServer = plugin.configureServer;
|
|
56
81
|
const config = plugin.config;
|
|
57
82
|
const configResolved = plugin.configResolved;
|
|
83
|
+
// StyleX's hook is a plain function, not an object with a `handler`
|
|
84
|
+
const transform = plugin.transform;
|
|
58
85
|
const self = {
|
|
59
86
|
...plugin,
|
|
60
87
|
// Vite lowers the CSS it bundles for its default targets, which are older than
|
|
@@ -72,6 +99,17 @@ export function narvi({ tailwind = false, ...options } = {}) {
|
|
|
72
99
|
assertAfterSvelte(config.plugins, self);
|
|
73
100
|
return configResolved?.call(this, config);
|
|
74
101
|
},
|
|
102
|
+
// StyleX compiles scripts. With Tailwind, a stylesheet that names a layer (one of Narvi's
|
|
103
|
+
// components', the app's, Tailwind's own output) is given the order first. Vite hands it
|
|
104
|
+
// here after compiling it, and before turning it into a module or a bundle.
|
|
105
|
+
transform(code, id, options) {
|
|
106
|
+
if (tailwind) {
|
|
107
|
+
const ordered = orderLayers(code, id);
|
|
108
|
+
if (ordered !== undefined)
|
|
109
|
+
return { code: ordered, map: null };
|
|
110
|
+
}
|
|
111
|
+
return transform?.call(this, code, id, options);
|
|
112
|
+
},
|
|
75
113
|
// The StyleX plugin defaults to `enforce: 'pre'`, which would hand it raw
|
|
76
114
|
// `.svelte` source. Dropping `enforce` lets the Svelte compiler go first.
|
|
77
115
|
enforce: undefined,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegopluna/narvi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
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.1
|
|
15
|
+
library_version: '0.3.1'
|
|
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,95 @@ 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
|
+
- The row makes the control's id. Where the app needs a fixed one (search, a deep link, a
|
|
223
|
+
test), pass `controlId="settings-branch-prefix"`: the label's `for` names it and `children`
|
|
224
|
+
receives it as `id`. Don't keep a row of your own for that.
|
|
225
|
+
- Attributes such as `id`, `tabindex` and `data-*` go on the row's element (and on the group's
|
|
226
|
+
`<section>`), so search can scroll to one and focus it. Set `highlighted` for a moment as it
|
|
227
|
+
lands to light it.
|
|
228
|
+
- A `SettingsGroup` draws its lines between any children, so rows of the app's own go in it too;
|
|
229
|
+
give them their own padding (`SettingsRow` is inset 16px on the card).
|
|
148
230
|
|
|
149
231
|
### Layout with Stack and Grid
|
|
150
232
|
|
|
151
233
|
`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,
|
|
234
|
+
Their gaps are steps on the 4px scale: `gap={4}` is 16px, and the steps are 0, 1, 1.5 (6px), 2,
|
|
235
|
+
3, 4, 5, 6, 8, 10, 12 and 16. Every layout prop takes a value, or values by breakpoint (`sm` 640px, `md` 768px,
|
|
154
236
|
`lg` 1024px, `xl` 1280px, mobile first):
|
|
155
237
|
|
|
156
238
|
```svelte
|
|
@@ -170,24 +252,57 @@ flex or grid style of your own. For anything they can't express, see the `stylin
|
|
|
170
252
|
|
|
171
253
|
### Text
|
|
172
254
|
|
|
173
|
-
Use `Heading` (`level` 1–6 for the outline,
|
|
174
|
-
`Text` (`variant` is what the text is: `
|
|
175
|
-
|
|
176
|
-
|
|
255
|
+
Use `Heading` (`level` 1–6 for the outline, `size` from `sm` to `4xl` for the look, and
|
|
256
|
+
`truncate` for a name that may run long) and `Text` (`variant` is what the text is: `figure`
|
|
257
|
+
for a number that is the point of its place, `title`, `reading`, `label`, `body`, `meta`,
|
|
258
|
+
`caption`, `micro` or `lead`, each one size, weight and line height; `tone` default, muted,
|
|
259
|
+
subtle, accent, danger or success; `weight`; `face="display"` for the serif; `truncate` for one
|
|
260
|
+
line, `lines={2}` for several). Use `Code` and `Kbd` inline, and
|
|
177
261
|
`Link` for links inside text. `Button href` gives a link that looks like a button, and
|
|
178
262
|
`Card href` makes the whole card a link.
|
|
179
263
|
|
|
180
264
|
### Feedback
|
|
181
265
|
|
|
182
266
|
- Toasts: mount one `<Toaster />` near the root, then call `toast('Copied the link')` from
|
|
183
|
-
anywhere
|
|
267
|
+
anywhere; `toast.info`, `.success`, `.warning`, `.error` and `.loading` set the tone.
|
|
268
|
+
- A toast can take an `action` (`{ label: 'Undo', onclick(event) }`), which closes it unless
|
|
269
|
+
it calls `event.preventDefault()`.
|
|
270
|
+
- Give work a key of your own with `id`: another toast with that id replaces it where it
|
|
271
|
+
stands. `toast.loading('Cloning…', { id: 'clone' })`, then `toast.success('Cloned', { id:
|
|
272
|
+
'clone' })`. `toast.dismiss(id)` closes it.
|
|
273
|
+
- `onAutoClose` is called when its time runs out, `onDismiss` when the person or
|
|
274
|
+
`toast.dismiss` closes it. Neither is called when its action closes it, so an Undo that has
|
|
275
|
+
to be forgotten later forgets in both:
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
toast(`Removed ${theme.name}`, {
|
|
279
|
+
action: { label: 'Undo', onclick: () => restore(theme) },
|
|
280
|
+
onAutoClose: () => forget(theme),
|
|
281
|
+
onDismiss: () => forget(theme)
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
- Errors and work under way stay until dismissed, and every toast has a Dismiss button.
|
|
184
286
|
- `Tooltip.Root` must sit inside a `Tooltip.Provider`. Mount one near the root. Give an icon
|
|
185
287
|
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
|
|
288
|
+
- Use `Notice` for a note in place (`tone`: neutral, info, success, warning, danger; `raised`
|
|
289
|
+
over a busy background, such as an image behind the composer),
|
|
187
290
|
`EmptyState` for an empty place, `Skeleton`, `Spinner` or `Progress` while loading, and
|
|
188
291
|
`StatusIndicator` (`status`: idle, working, waiting, done, failed, stopped, connecting) for where
|
|
189
292
|
a run stands.
|
|
190
293
|
|
|
294
|
+
### Lists, badges and folds
|
|
295
|
+
|
|
296
|
+
- Rows on one card with a line between each: `List.Root` (a `ul`, or `as="div"`) holding
|
|
297
|
+
`List.Item`s, or rows of your own. Don't redraw the card and its lines.
|
|
298
|
+
- `Badge` shows its tone as a dot; `plain` hides the dot and colours the words in the tone.
|
|
299
|
+
- `Collapsible.Trigger` takes `chevron="start"` to put the chevron before its label, as in a tree.
|
|
300
|
+
- `Tabs` and `SegmentedControl` options take an `icon` (a component, sized to fit) and a
|
|
301
|
+
`title` that names a short label in full, as a tooltip and the item's description.
|
|
302
|
+
- A `Button` that is loading hides its label under the spinner; `loadingLabel="Connecting…"`
|
|
303
|
+
says what it is doing beside the spinner instead. `variant="link"` sits in a sentence, at its
|
|
304
|
+
size, with no padding.
|
|
305
|
+
|
|
191
306
|
### App and chat screens
|
|
192
307
|
|
|
193
308
|
`AppShell` is the window: its bar across the top, a rail, and one sheet that holds the sidebar,
|
|
@@ -199,6 +314,28 @@ itself. `Sidebar` and `Rail` fill it; each also stands on its own: a `Sidebar` i
|
|
|
199
314
|
[component catalogue](references/components.md) for their anatomy before building one of these
|
|
200
315
|
screens. Render a reply's text with `<Markdown value={text} streaming={!done} />` inside `Message.Content`; the `markdown` skill covers it.
|
|
201
316
|
|
|
317
|
+
Parts of the shell that are easy to redraw by hand, and shouldn't be:
|
|
318
|
+
|
|
319
|
+
- **Search in the bar:** `SearchButton` (`label="Search or jump to…"`, `shortcut={['⌘', 'K']}`)
|
|
320
|
+
looks like a field and opens your palette with `onclick`. It is a well with no edge. Put it in
|
|
321
|
+
`AppShell.Bar`'s `center` snippet. Listen for the shortcut yourself.
|
|
322
|
+
- **A workspace switcher:** `Sidebar.Switcher` is a row with the workspace's mark (`leading`),
|
|
323
|
+
its name and a selector glyph. Put it in a `Menu.Trigger`'s `child` and spread the props:
|
|
324
|
+
`{#snippet child({ props })}<Sidebar.Switcher {...props}>…</Sidebar.Switcher>{/snippet}`.
|
|
325
|
+
- **Rows in folders** are set in by their text, not their box. A folder's chevron comes first,
|
|
326
|
+
on the edge of the rows' icons; give its mark as `leading` and it follows the chevron. Its
|
|
327
|
+
rows line up on their own, their titles under the folder's name, with a mark or without.
|
|
328
|
+
Don't pad rows or folders yourself.
|
|
329
|
+
- **The open row** (`current`) is a flat fill; its title keeps its weight. Don't bold it
|
|
330
|
+
yourself: a heavier title is wider, so it cuts off at a different point as the person moves.
|
|
331
|
+
- **A listbox of results** from Sidebar rows: `<Sidebar.Item as="div" role="option" aria-selected>`
|
|
332
|
+
inside your `role="listbox"`, so no list item stands between the box and its options.
|
|
333
|
+
- **TabStrip** tabs narrow to an ellipsis before the strip scrolls. With a `leading` icon, a
|
|
334
|
+
tab's close button takes the icon's place, so no room is kept at its end.
|
|
335
|
+
- **A Sheet** focuses itself as it opens (`focusOnOpen="sheet"`), so a Rail or a list in it
|
|
336
|
+
shows no focus ring until the keys move in. Pass `focusOnOpen="first"` for a sheet that
|
|
337
|
+
holds a form.
|
|
338
|
+
|
|
202
339
|
## Conventions
|
|
203
340
|
|
|
204
341
|
- **Colour is for state.** `accent` (blue by default) marks focus, selection, progress and
|
|
@@ -209,6 +346,10 @@ screens. Render a reply's text with `<Markdown value={text} streaming={!done} />
|
|
|
209
346
|
`danger` is the solid a confirming dialog asks for, `danger-outline` its quieter form, and
|
|
210
347
|
`ghost-danger` an icon that deletes. `warning-outline` and `success-outline` say the same of
|
|
211
348
|
their own. Sizes run `micro`, `xs`, `sm`, `md`, `lg`; `shape="pill"` rounds the ends.
|
|
349
|
+
- **Icons take their control's size.** A Lucide icon in a `Button` needs no `size`: it is 12px
|
|
350
|
+
at `micro`, 14 at `xs` and `sm`, 16 at `md` and 18 at `lg`, and 16 in a menu or command item
|
|
351
|
+
and in a Select option. The rule overrides the icon's own `size`; to change one, give the icon
|
|
352
|
+
a class or a style, or set `--narvi-icon-size` on the button.
|
|
212
353
|
- **One short label.** Don't join details with a dot ("Queued · sends later"). Put the rest in
|
|
213
354
|
an element of its own, or a tooltip.
|
|
214
355
|
- **What waits on the person goes over the composer.** Put an `Approval`, a `Questionnaire` or
|
|
@@ -227,6 +368,15 @@ screens. Render a reply's text with `<Markdown value={text} streaming={!done} />
|
|
|
227
368
|
- **HIGH: an icon-only Button without `aria-label`.** `iconOnly` makes it square, but it has
|
|
228
369
|
no accessible name until you give it one.
|
|
229
370
|
- **MEDIUM: a raw `<label>` beside an Input.** It misses Field's description and error wiring.
|
|
371
|
+
- **HIGH: `Dialog.Content size="lg"` written for 44rem.** Since the sizes gained `lg` 36rem,
|
|
372
|
+
`xl` 44 and `2xl` 56, the old `lg` is `xl`.
|
|
373
|
+
- **MEDIUM: an Input's icon positioned by hand.** Pass it as the Input's `icon` snippet; it is
|
|
374
|
+
sized to the field and the text starts after it.
|
|
375
|
+
- **MEDIUM: a toast's `onDismiss` alone for "Undo, or else forget".** A toast that runs out of
|
|
376
|
+
time calls `onAutoClose`, not `onDismiss`, so the forgetting never happens. Pass both.
|
|
377
|
+
- **MEDIUM: a SettingsRow's `<label for>` on a group.** A `SegmentedControl` or a set of radios
|
|
378
|
+
has no one element for the label to name. Set `labelFor={false}` and pass `labelId` as
|
|
379
|
+
`aria-labelledby`.
|
|
230
380
|
- **MEDIUM: wrapping a Checkbox, Switch or SegmentedControl in `Field`.** They don't read Field's
|
|
231
381
|
context, so the label names nothing. Use children or `aria-label`, as above.
|
|
232
382
|
- **MEDIUM: a flex `<div>` with margins between children.** Use Stack or Grid. Their gaps follow
|