@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
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
import Glyph from '../../internal/Glyph.svelte';
|
|
13
13
|
import Button from '../button/Button.svelte';
|
|
14
14
|
import Spinner from '../spinner/Spinner.svelte';
|
|
15
|
-
import {
|
|
15
|
+
import { finish, toasts, type ToastEnd, type ToastEntry } from './toasts.svelte.js';
|
|
16
16
|
|
|
17
17
|
export type ToasterProps = {
|
|
18
18
|
/** Distance from the top of the window, to clear an app's own header. */
|
|
19
|
-
offset?: string;
|
|
19
|
+
offset?: string | undefined;
|
|
20
20
|
/** Accessible name of the region. */
|
|
21
|
-
label?: string;
|
|
21
|
+
label?: string | undefined;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const styles = stylex.create({
|
|
@@ -77,7 +77,9 @@
|
|
|
77
77
|
borderRadius: '9999px',
|
|
78
78
|
backgroundColor: colors.accent
|
|
79
79
|
},
|
|
80
|
+
info: { color: colors.accent },
|
|
80
81
|
success: { color: colors.success },
|
|
82
|
+
warning: { color: colors.warning },
|
|
81
83
|
error: { color: colors.danger },
|
|
82
84
|
muted: { color: colors.textMuted },
|
|
83
85
|
text: {
|
|
@@ -105,7 +107,8 @@
|
|
|
105
107
|
let region = $state<HTMLElement | null>(null);
|
|
106
108
|
let held = $state(false);
|
|
107
109
|
let hidden = $state(false);
|
|
108
|
-
// Toasts on their way out, kept a moment so they can fade
|
|
110
|
+
// Toasts on their way out, by revision, kept a moment so they can fade. A toast replaced
|
|
111
|
+
// while it fades comes back at once.
|
|
109
112
|
let leaving = $state<number[]>([]);
|
|
110
113
|
|
|
111
114
|
$effect(() => {
|
|
@@ -115,12 +118,13 @@
|
|
|
115
118
|
return () => document.removeEventListener('visibilitychange', visibility);
|
|
116
119
|
});
|
|
117
120
|
|
|
118
|
-
function close(entry: ToastEntry) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
function close(entry: ToastEntry, how: ToastEnd) {
|
|
122
|
+
const { id, revision } = entry;
|
|
123
|
+
if (leaving.includes(revision)) return;
|
|
124
|
+
leaving = [...leaving, revision];
|
|
121
125
|
setTimeout(() => {
|
|
122
|
-
|
|
123
|
-
leaving = leaving.filter((
|
|
126
|
+
finish(id, how, revision);
|
|
127
|
+
leaving = leaving.filter((each) => each !== revision);
|
|
124
128
|
}, 140);
|
|
125
129
|
}
|
|
126
130
|
|
|
@@ -132,7 +136,7 @@
|
|
|
132
136
|
const run = () => {
|
|
133
137
|
if (!Number.isFinite(remaining)) return;
|
|
134
138
|
started = performance.now();
|
|
135
|
-
timer = setTimeout(() => close(entry), remaining);
|
|
139
|
+
timer = setTimeout(() => close(entry, 'auto'), remaining);
|
|
136
140
|
};
|
|
137
141
|
const pause = () => {
|
|
138
142
|
if (timer === undefined) return;
|
|
@@ -163,10 +167,10 @@
|
|
|
163
167
|
<div
|
|
164
168
|
role={entry.tone === 'error' ? 'alert' : 'status'}
|
|
165
169
|
data-tone={entry.tone}
|
|
166
|
-
{...stylex.attrs(styles.toast, leaving.includes(entry.
|
|
170
|
+
{...stylex.attrs(styles.toast, leaving.includes(entry.revision) && styles.leaving)}
|
|
167
171
|
{@attach () => {
|
|
168
172
|
// Restarts when the toast changes, as a loading toast turns into a result
|
|
169
|
-
void entry.
|
|
173
|
+
void entry.revision;
|
|
170
174
|
if (!held && !hidden) clock.run();
|
|
171
175
|
return () => clock.pause();
|
|
172
176
|
}}
|
|
@@ -174,7 +178,9 @@
|
|
|
174
178
|
<span
|
|
175
179
|
{...stylex.attrs(
|
|
176
180
|
styles.icon,
|
|
181
|
+
entry.tone === 'info' && styles.info,
|
|
177
182
|
entry.tone === 'success' && styles.success,
|
|
183
|
+
entry.tone === 'warning' && styles.warning,
|
|
178
184
|
entry.tone === 'error' && styles.error,
|
|
179
185
|
(entry.tone === 'default' || entry.tone === 'loading') && styles.muted
|
|
180
186
|
)}
|
|
@@ -183,8 +189,10 @@
|
|
|
183
189
|
<Spinner size={14} label={null} />
|
|
184
190
|
{:else if entry.tone === 'success'}
|
|
185
191
|
<Glyph name="check" stroke={1.75} />
|
|
186
|
-
{:else if entry.tone === 'error'}
|
|
192
|
+
{:else if entry.tone === 'error' || entry.tone === 'warning'}
|
|
187
193
|
<Glyph name="alert" />
|
|
194
|
+
{:else if entry.tone === 'info'}
|
|
195
|
+
<Glyph name="info" />
|
|
188
196
|
{:else}
|
|
189
197
|
<span {...stylex.attrs(styles.dot)}></span>
|
|
190
198
|
{/if}
|
|
@@ -200,25 +208,24 @@
|
|
|
200
208
|
<Button
|
|
201
209
|
size="sm"
|
|
202
210
|
variant="secondary"
|
|
203
|
-
onclick={() => {
|
|
204
|
-
entry.action?.onclick();
|
|
205
|
-
close(entry);
|
|
211
|
+
onclick={(event) => {
|
|
212
|
+
entry.action?.onclick(event);
|
|
213
|
+
if (!event.defaultPrevented) close(entry, 'action');
|
|
206
214
|
}}
|
|
207
215
|
>
|
|
208
216
|
{entry.action.label}
|
|
209
217
|
</Button>
|
|
210
218
|
{/if}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
{/if}
|
|
219
|
+
<!-- Every toast can be put away, a lasting one most of all; work under way goes on -->
|
|
220
|
+
<Button
|
|
221
|
+
size="sm"
|
|
222
|
+
variant="ghost"
|
|
223
|
+
iconOnly
|
|
224
|
+
aria-label="Dismiss"
|
|
225
|
+
onclick={() => close(entry, 'dismiss')}
|
|
226
|
+
>
|
|
227
|
+
<Glyph name="close" size={14} />
|
|
228
|
+
</Button>
|
|
222
229
|
</span>
|
|
223
230
|
</div>
|
|
224
231
|
{/each}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type ToasterProps = {
|
|
2
2
|
/** Distance from the top of the window, to clear an app's own header. */
|
|
3
|
-
offset?: string;
|
|
3
|
+
offset?: string | undefined;
|
|
4
4
|
/** Accessible name of the region. */
|
|
5
|
-
label?: string;
|
|
5
|
+
label?: string | undefined;
|
|
6
6
|
};
|
|
7
7
|
declare const Toaster: import("svelte").Component<ToasterProps, {}, "">;
|
|
8
8
|
type Toaster = ReturnType<typeof Toaster>;
|
|
@@ -2,52 +2,89 @@
|
|
|
2
2
|
* Toasts: short notes about something that happened away from where the person
|
|
3
3
|
* is looking. Call `toast()` from anywhere; one <Toaster /> shows them.
|
|
4
4
|
*/
|
|
5
|
-
export type ToastTone = 'default' | 'success' | 'error' | 'loading';
|
|
5
|
+
export type ToastTone = 'default' | 'info' | 'success' | 'warning' | 'error' | 'loading';
|
|
6
|
+
/** A toast's id: the one `toast()` returns, or one of your own given as `id`. */
|
|
7
|
+
export type ToastId = string | number;
|
|
6
8
|
export type ToastAction = {
|
|
7
9
|
label: string;
|
|
8
|
-
|
|
10
|
+
/** Closes the toast after it runs, unless it calls `event.preventDefault()`. */
|
|
11
|
+
onclick: (event: MouseEvent) => void;
|
|
9
12
|
};
|
|
10
13
|
export type ToastOptions = {
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Your own key for the toast. Showing another toast with the same id replaces this one
|
|
16
|
+
* where it stands, so one note can follow a piece of work: cloning, then cloned.
|
|
17
|
+
*/
|
|
18
|
+
id?: ToastId | undefined;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
tone?: ToastTone | undefined;
|
|
13
21
|
/** A button in the toast, such as Undo or Retry. */
|
|
14
|
-
action?: ToastAction;
|
|
22
|
+
action?: ToastAction | undefined;
|
|
15
23
|
/** Milliseconds before it goes. `null` keeps it until dismissed. */
|
|
16
|
-
duration?: number | null;
|
|
24
|
+
duration?: number | null | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Called when the person closes it, or `toast.dismiss` does. Not when its action closes
|
|
27
|
+
* it, which is an answer of its own, nor when another toast with its id replaces it.
|
|
28
|
+
*/
|
|
29
|
+
onDismiss?: ((id: ToastId) => void) | undefined;
|
|
30
|
+
/** Called when it goes by itself, as its time runs out. */
|
|
31
|
+
onAutoClose?: ((id: ToastId) => void) | undefined;
|
|
17
32
|
};
|
|
18
|
-
|
|
19
|
-
|
|
33
|
+
/** How a toast went: closed by the person or by code, by its own clock, or by its action. */
|
|
34
|
+
export type ToastEnd = 'dismiss' | 'auto' | 'action';
|
|
35
|
+
export type ToastEntry = {
|
|
36
|
+
id: ToastId;
|
|
20
37
|
title: string;
|
|
38
|
+
tone: ToastTone;
|
|
39
|
+
description?: string | undefined;
|
|
40
|
+
action?: ToastAction | undefined;
|
|
21
41
|
duration: number | null;
|
|
42
|
+
onDismiss?: ((id: ToastId) => void) | undefined;
|
|
43
|
+
onAutoClose?: ((id: ToastId) => void) | undefined;
|
|
44
|
+
/** Changes each time the toast is replaced or updated, so its clock starts again. */
|
|
45
|
+
revision: number;
|
|
22
46
|
};
|
|
23
47
|
declare class Toasts {
|
|
24
48
|
list: ToastEntry[];
|
|
25
49
|
}
|
|
26
50
|
export declare const toasts: Toasts;
|
|
27
|
-
declare function show(title: string, options?: ToastOptions):
|
|
28
|
-
declare function update(id:
|
|
29
|
-
title?: string;
|
|
51
|
+
declare function show(title: string, options?: ToastOptions): ToastId;
|
|
52
|
+
declare function update(id: ToastId, patch: ToastOptions & {
|
|
53
|
+
title?: string | undefined;
|
|
30
54
|
}): void;
|
|
31
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Takes a toast away and says so to whoever showed it. The Toaster calls it as a toast
|
|
57
|
+
* leaves; `revision` is the one it closed, so a toast replaced meanwhile stays.
|
|
58
|
+
*/
|
|
59
|
+
export declare function finish(id: ToastId, how: ToastEnd, revision?: number): void;
|
|
60
|
+
/** Closes one toast, or every toast when given no id. Each one's `onDismiss` is called. */
|
|
61
|
+
declare function dismiss(id?: ToastId): void;
|
|
32
62
|
type Message<T> = string | ((value: T) => string);
|
|
63
|
+
type ToneOptions = Omit<ToastOptions, 'tone'>;
|
|
33
64
|
/**
|
|
34
65
|
* Shows a toast and returns its id.
|
|
35
66
|
*
|
|
36
67
|
* ```ts
|
|
37
68
|
* toast('Copied');
|
|
38
69
|
* toast.error("Couldn't push the branch", { description: reason, action: { label: 'Retry', onclick: push } });
|
|
70
|
+
* toast.loading('Cloning narvi…', { id: 'clone' });
|
|
71
|
+
* toast.success('Cloned narvi', { id: 'clone' }); // replaces the one above
|
|
39
72
|
* toast.promise(save(), { loading: 'Saving…', success: 'Saved', error: (e) => `Couldn't save: ${e}` });
|
|
40
73
|
* ```
|
|
41
74
|
*/
|
|
42
75
|
export declare const toast: typeof show & {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
76
|
+
info: (title: string, options?: ToneOptions) => ToastId;
|
|
77
|
+
success: (title: string, options?: ToneOptions) => ToastId;
|
|
78
|
+
warning: (title: string, options?: ToneOptions) => ToastId;
|
|
79
|
+
error: (title: string, options?: ToneOptions) => ToastId;
|
|
80
|
+
loading: (title: string, options?: ToneOptions) => ToastId;
|
|
46
81
|
/** One toast that says the work is under way, then how it went. */
|
|
47
82
|
promise<T>(promise: Promise<T>, messages: {
|
|
48
83
|
loading: string;
|
|
49
84
|
success: Message<T>;
|
|
50
85
|
error: Message<unknown>;
|
|
86
|
+
/** Your own key, as for `toast()`. */
|
|
87
|
+
id?: ToastId | undefined;
|
|
51
88
|
}): Promise<T>;
|
|
52
89
|
update: typeof update;
|
|
53
90
|
dismiss: typeof dismiss;
|
|
@@ -4,42 +4,63 @@
|
|
|
4
4
|
*/
|
|
5
5
|
const DURATION = 5000;
|
|
6
6
|
let next = 1;
|
|
7
|
+
let revisions = 1;
|
|
7
8
|
class Toasts {
|
|
8
9
|
list = $state([]);
|
|
9
10
|
}
|
|
10
11
|
export const toasts = new Toasts();
|
|
11
|
-
|
|
12
|
+
// Errors and work in progress stay until they are dealt with
|
|
13
|
+
const lasting = (tone) => tone === 'error' || tone === 'loading';
|
|
14
|
+
function entryFrom(id, title, options) {
|
|
12
15
|
const tone = options.tone ?? 'default';
|
|
13
|
-
|
|
14
|
-
id
|
|
16
|
+
return {
|
|
17
|
+
id,
|
|
15
18
|
title,
|
|
16
|
-
...options,
|
|
17
19
|
tone,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
description: options.description,
|
|
21
|
+
action: options.action,
|
|
22
|
+
duration: options.duration !== undefined ? options.duration : lasting(tone) ? null : DURATION,
|
|
23
|
+
onDismiss: options.onDismiss,
|
|
24
|
+
onAutoClose: options.onAutoClose,
|
|
25
|
+
revision: revisions++
|
|
24
26
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
}
|
|
28
|
+
function show(title, options = {}) {
|
|
29
|
+
const id = options.id ?? next++;
|
|
30
|
+
const entry = entryFrom(id, title, options);
|
|
31
|
+
const at = toasts.list.findIndex((existing) => existing.id === id);
|
|
32
|
+
toasts.list = at === -1 ? [...toasts.list, entry] : toasts.list.with(at, entry);
|
|
33
|
+
return id;
|
|
27
34
|
}
|
|
28
35
|
function update(id, patch) {
|
|
29
36
|
toasts.list = toasts.list.map((entry) => {
|
|
30
37
|
if (entry.id !== id)
|
|
31
38
|
return entry;
|
|
32
39
|
const tone = patch.tone ?? entry.tone;
|
|
33
|
-
const duration = patch.duration !== undefined
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
? null
|
|
37
|
-
: DURATION;
|
|
38
|
-
return { ...entry, ...patch, tone, duration };
|
|
40
|
+
const duration = patch.duration !== undefined ? patch.duration : lasting(tone) ? null : DURATION;
|
|
41
|
+
const defined = Object.fromEntries(Object.entries(patch).filter(([, value]) => value !== undefined));
|
|
42
|
+
return { ...entry, ...defined, id, tone, duration, revision: revisions++ };
|
|
39
43
|
});
|
|
40
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Takes a toast away and says so to whoever showed it. The Toaster calls it as a toast
|
|
47
|
+
* leaves; `revision` is the one it closed, so a toast replaced meanwhile stays.
|
|
48
|
+
*/
|
|
49
|
+
export function finish(id, how, revision) {
|
|
50
|
+
const entry = toasts.list.find((existing) => existing.id === id);
|
|
51
|
+
if (!entry || (revision !== undefined && entry.revision !== revision))
|
|
52
|
+
return;
|
|
53
|
+
toasts.list = toasts.list.filter((existing) => existing !== entry);
|
|
54
|
+
if (how === 'dismiss')
|
|
55
|
+
entry.onDismiss?.(id);
|
|
56
|
+
else if (how === 'auto')
|
|
57
|
+
entry.onAutoClose?.(id);
|
|
58
|
+
}
|
|
59
|
+
/** Closes one toast, or every toast when given no id. Each one's `onDismiss` is called. */
|
|
41
60
|
function dismiss(id) {
|
|
42
|
-
|
|
61
|
+
const ids = id === undefined ? toasts.list.map((entry) => entry.id) : [id];
|
|
62
|
+
for (const each of ids)
|
|
63
|
+
finish(each, 'dismiss');
|
|
43
64
|
}
|
|
44
65
|
/**
|
|
45
66
|
* Shows a toast and returns its id.
|
|
@@ -47,16 +68,20 @@ function dismiss(id) {
|
|
|
47
68
|
* ```ts
|
|
48
69
|
* toast('Copied');
|
|
49
70
|
* toast.error("Couldn't push the branch", { description: reason, action: { label: 'Retry', onclick: push } });
|
|
71
|
+
* toast.loading('Cloning narvi…', { id: 'clone' });
|
|
72
|
+
* toast.success('Cloned narvi', { id: 'clone' }); // replaces the one above
|
|
50
73
|
* toast.promise(save(), { loading: 'Saving…', success: 'Saved', error: (e) => `Couldn't save: ${e}` });
|
|
51
74
|
* ```
|
|
52
75
|
*/
|
|
53
76
|
export const toast = Object.assign(show, {
|
|
77
|
+
info: (title, options) => show(title, { ...options, tone: 'info' }),
|
|
54
78
|
success: (title, options) => show(title, { ...options, tone: 'success' }),
|
|
79
|
+
warning: (title, options) => show(title, { ...options, tone: 'warning' }),
|
|
55
80
|
error: (title, options) => show(title, { ...options, tone: 'error' }),
|
|
56
81
|
loading: (title, options) => show(title, { ...options, tone: 'loading' }),
|
|
57
82
|
/** One toast that says the work is under way, then how it went. */
|
|
58
83
|
promise(promise, messages) {
|
|
59
|
-
const id = show(messages.loading, { tone: 'loading' });
|
|
84
|
+
const id = show(messages.loading, { tone: 'loading', id: messages.id });
|
|
60
85
|
const say = (message, value) => typeof message === 'function' ? message(value) : message;
|
|
61
86
|
promise.then((value) => update(id, { title: say(messages.success, value), tone: 'success' }), (error) => update(id, { title: say(messages.error, error), tone: 'error' }));
|
|
62
87
|
return promise;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { Loose } from '../../internal/loose.js';
|
|
2
3
|
import { Toggle } from 'bits-ui';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
5
6
|
import { toggle, type ToggleSize } from '../../internal/toggle.js';
|
|
6
7
|
|
|
7
|
-
export type ToggleProps =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
export type ToggleProps = Loose<
|
|
9
|
+
Omit<Toggle.RootProps, 'children' | 'child'> & {
|
|
10
|
+
size?: ToggleSize | undefined;
|
|
11
|
+
/** Square, for a single icon. Give it an `aria-label`. */
|
|
12
|
+
iconOnly?: boolean | undefined;
|
|
13
|
+
sx?: Sx | undefined;
|
|
14
|
+
/** An icon, a short label, or both. */
|
|
15
|
+
children?: Snippet | undefined;
|
|
16
|
+
}
|
|
17
|
+
>;
|
|
15
18
|
</script>
|
|
16
19
|
|
|
17
20
|
<script lang="ts">
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
+
import type { Loose } from '../../internal/loose.js';
|
|
1
2
|
import { Toggle } from 'bits-ui';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
import { type Sx } from '../../internal/sx.js';
|
|
4
5
|
import { type ToggleSize } from '../../internal/toggle.js';
|
|
5
|
-
export type ToggleProps = Omit<Toggle.RootProps, 'children' | 'child'> & {
|
|
6
|
-
size?: ToggleSize;
|
|
6
|
+
export type ToggleProps = Loose<Omit<Toggle.RootProps, 'children' | 'child'> & {
|
|
7
|
+
size?: ToggleSize | undefined;
|
|
7
8
|
/** Square, for a single icon. Give it an `aria-label`. */
|
|
8
|
-
iconOnly?: boolean;
|
|
9
|
-
sx?: Sx;
|
|
9
|
+
iconOnly?: boolean | undefined;
|
|
10
|
+
sx?: Sx | undefined;
|
|
10
11
|
/** An icon, a short label, or both. */
|
|
11
|
-
children?: Snippet;
|
|
12
|
-
}
|
|
13
|
-
declare const Toggle: import("svelte").Component<
|
|
12
|
+
children?: Snippet | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
declare const Toggle: import("svelte").Component<Loose<Omit<Toggle.RootProps, "children" | "child"> & {
|
|
15
|
+
size?: ToggleSize | undefined;
|
|
16
|
+
/** Square, for a single icon. Give it an `aria-label`. */
|
|
17
|
+
iconOnly?: boolean | undefined;
|
|
18
|
+
sx?: Sx | undefined;
|
|
19
|
+
/** An icon, a short label, or both. */
|
|
20
|
+
children?: Snippet | undefined;
|
|
21
|
+
}>, {}, "ref" | "pressed">;
|
|
14
22
|
type Toggle = ReturnType<typeof Toggle>;
|
|
15
23
|
export default Toggle;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { Loose } from '../../internal/loose.js';
|
|
2
3
|
import { ToggleGroup } from 'bits-ui';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
5
6
|
import { toggle } from '../../internal/toggle.js';
|
|
6
7
|
import { getToggleGroupContext } from './context.js';
|
|
7
8
|
|
|
8
|
-
export type ToggleGroupItemProps =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export type ToggleGroupItemProps = Loose<
|
|
10
|
+
Omit<ToggleGroup.ItemProps, 'children' | 'child'> & {
|
|
11
|
+
/** Square, for a single icon. Give it an `aria-label`. */
|
|
12
|
+
iconOnly?: boolean | undefined;
|
|
13
|
+
sx?: Sx | undefined;
|
|
14
|
+
children?: Snippet | undefined;
|
|
15
|
+
}
|
|
16
|
+
>;
|
|
14
17
|
</script>
|
|
15
18
|
|
|
16
19
|
<script lang="ts">
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import type { Loose } from '../../internal/loose.js';
|
|
1
2
|
import { ToggleGroup } from 'bits-ui';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
import { type Sx } from '../../internal/sx.js';
|
|
4
|
-
export type ToggleGroupItemProps = Omit<ToggleGroup.ItemProps, 'children' | 'child'> & {
|
|
5
|
+
export type ToggleGroupItemProps = Loose<Omit<ToggleGroup.ItemProps, 'children' | 'child'> & {
|
|
5
6
|
/** Square, for a single icon. Give it an `aria-label`. */
|
|
6
|
-
iconOnly?: boolean;
|
|
7
|
-
sx?: Sx;
|
|
8
|
-
children?: Snippet;
|
|
9
|
-
}
|
|
10
|
-
declare const ToggleGroupItem: import("svelte").Component<
|
|
7
|
+
iconOnly?: boolean | undefined;
|
|
8
|
+
sx?: Sx | undefined;
|
|
9
|
+
children?: Snippet | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
declare const ToggleGroupItem: import("svelte").Component<Loose<Omit<ToggleGroup.ItemProps, "children" | "child"> & {
|
|
12
|
+
/** Square, for a single icon. Give it an `aria-label`. */
|
|
13
|
+
iconOnly?: boolean | undefined;
|
|
14
|
+
sx?: Sx | undefined;
|
|
15
|
+
children?: Snippet | undefined;
|
|
16
|
+
}>, {}, "ref">;
|
|
11
17
|
type ToggleGroupItem = ReturnType<typeof ToggleGroupItem>;
|
|
12
18
|
export default ToggleGroupItem;
|
|
@@ -2,26 +2,29 @@
|
|
|
2
2
|
import { ToggleGroup } from 'bits-ui';
|
|
3
3
|
import * as stylex from '@stylexjs/stylex';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
|
+
import type { Loose } from '../../internal/loose.js';
|
|
5
6
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
6
7
|
import type { ToggleSize } from '../../internal/toggle.js';
|
|
7
8
|
import { setToggleGroupContext } from './context.js';
|
|
8
9
|
|
|
9
10
|
type Base = {
|
|
10
|
-
disabled?: boolean;
|
|
11
|
+
disabled?: boolean | undefined;
|
|
11
12
|
/** Whether the arrow keys wrap from the last item to the first. */
|
|
12
|
-
loop?: boolean;
|
|
13
|
-
orientation?: 'horizontal' | 'vertical';
|
|
13
|
+
loop?: boolean | undefined;
|
|
14
|
+
orientation?: 'horizontal' | 'vertical' | undefined;
|
|
14
15
|
/** The size of every item. */
|
|
15
|
-
size?: ToggleSize;
|
|
16
|
-
sx?: Sx;
|
|
17
|
-
ref?: HTMLElement | null;
|
|
16
|
+
size?: ToggleSize | undefined;
|
|
17
|
+
sx?: Sx | undefined;
|
|
18
|
+
ref?: HTMLElement | null | undefined;
|
|
18
19
|
/** ToggleGroup.Item buttons. */
|
|
19
|
-
children?: Snippet;
|
|
20
|
+
children?: Snippet | undefined;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
type Html =
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
type Html = Loose<
|
|
24
|
+
Omit<
|
|
25
|
+
ToggleGroup.RootProps,
|
|
26
|
+
'type' | 'value' | 'onValueChange' | 'children' | 'child' | keyof Base
|
|
27
|
+
>
|
|
25
28
|
>;
|
|
26
29
|
|
|
27
30
|
export type ToggleGroupRootProps = Html &
|
|
@@ -31,15 +34,15 @@
|
|
|
31
34
|
/** One item at most is pressed; pressing it again lets it go. */
|
|
32
35
|
type: 'single';
|
|
33
36
|
/** The pressed item's value, or `''` when none is. Bindable. */
|
|
34
|
-
value?: string;
|
|
35
|
-
onValueChange?: (value: string) => void;
|
|
37
|
+
value?: string | undefined;
|
|
38
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
36
39
|
}
|
|
37
40
|
| {
|
|
38
41
|
/** Any number of items may be pressed. */
|
|
39
42
|
type: 'multiple';
|
|
40
43
|
/** The pressed items' values. Bindable. */
|
|
41
|
-
value?: string[];
|
|
42
|
-
onValueChange?: (value: string[]) => void;
|
|
44
|
+
value?: string[] | undefined;
|
|
45
|
+
onValueChange?: ((value: string[]) => void) | undefined;
|
|
43
46
|
}
|
|
44
47
|
);
|
|
45
48
|
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { ToggleGroup } from 'bits-ui';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { Loose } from '../../internal/loose.js';
|
|
3
4
|
import { type Sx } from '../../internal/sx.js';
|
|
4
5
|
import type { ToggleSize } from '../../internal/toggle.js';
|
|
5
6
|
type Base = {
|
|
6
|
-
disabled?: boolean;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
7
8
|
/** Whether the arrow keys wrap from the last item to the first. */
|
|
8
|
-
loop?: boolean;
|
|
9
|
-
orientation?: 'horizontal' | 'vertical';
|
|
9
|
+
loop?: boolean | undefined;
|
|
10
|
+
orientation?: 'horizontal' | 'vertical' | undefined;
|
|
10
11
|
/** The size of every item. */
|
|
11
|
-
size?: ToggleSize;
|
|
12
|
-
sx?: Sx;
|
|
13
|
-
ref?: HTMLElement | null;
|
|
12
|
+
size?: ToggleSize | undefined;
|
|
13
|
+
sx?: Sx | undefined;
|
|
14
|
+
ref?: HTMLElement | null | undefined;
|
|
14
15
|
/** ToggleGroup.Item buttons. */
|
|
15
|
-
children?: Snippet;
|
|
16
|
+
children?: Snippet | undefined;
|
|
16
17
|
};
|
|
17
|
-
type Html = Omit<ToggleGroup.RootProps, 'type' | 'value' | 'onValueChange' | 'children' | 'child' | keyof Base
|
|
18
|
+
type Html = Loose<Omit<ToggleGroup.RootProps, 'type' | 'value' | 'onValueChange' | 'children' | 'child' | keyof Base>>;
|
|
18
19
|
export type ToggleGroupRootProps = Html & Base & ({
|
|
19
20
|
/** One item at most is pressed; pressing it again lets it go. */
|
|
20
21
|
type: 'single';
|
|
21
22
|
/** The pressed item's value, or `''` when none is. Bindable. */
|
|
22
|
-
value?: string;
|
|
23
|
-
onValueChange?: (value: string) => void;
|
|
23
|
+
value?: string | undefined;
|
|
24
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
24
25
|
} | {
|
|
25
26
|
/** Any number of items may be pressed. */
|
|
26
27
|
type: 'multiple';
|
|
27
28
|
/** The pressed items' values. Bindable. */
|
|
28
|
-
value?: string[];
|
|
29
|
-
onValueChange?: (value: string[]) => void;
|
|
29
|
+
value?: string[] | undefined;
|
|
30
|
+
onValueChange?: ((value: string[]) => void) | undefined;
|
|
30
31
|
});
|
|
31
32
|
declare const ToggleGroupRoot: import("svelte").Component<ToggleGroupRootProps, {}, "value" | "ref">;
|
|
32
33
|
type ToggleGroupRoot = ReturnType<typeof ToggleGroupRoot>;
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
import { getToolContext } from './context.js';
|
|
8
8
|
|
|
9
9
|
export type ToolContentProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
10
|
-
sx?: Sx;
|
|
10
|
+
sx?: Sx | undefined;
|
|
11
11
|
/** A Tool.Input and a Tool.Output, or anything else the tool produced. */
|
|
12
|
-
children?: Snippet;
|
|
12
|
+
children?: Snippet | undefined;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const styles = stylex.create({
|
|
@@ -2,9 +2,9 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
import type { Sx } from '../../internal/sx.js';
|
|
4
4
|
export type ToolContentProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
5
|
-
sx?: Sx;
|
|
5
|
+
sx?: Sx | undefined;
|
|
6
6
|
/** A Tool.Input and a Tool.Output, or anything else the tool produced. */
|
|
7
|
-
children?: Snippet;
|
|
7
|
+
children?: Snippet | undefined;
|
|
8
8
|
};
|
|
9
9
|
declare const ToolContent: import("svelte").Component<ToolContentProps, {}, "">;
|
|
10
10
|
type ToolContent = ReturnType<typeof ToolContent>;
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
export type ToolInputProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
8
8
|
/** The arguments the model passed. Shown as indented JSON unless already a string. */
|
|
9
9
|
value?: unknown;
|
|
10
|
-
label?: string;
|
|
11
|
-
sx?: Sx;
|
|
10
|
+
label?: string | undefined;
|
|
11
|
+
sx?: Sx | undefined;
|
|
12
12
|
/** Your own rendering of the arguments, in place of the JSON. */
|
|
13
|
-
children?: Snippet;
|
|
13
|
+
children?: Snippet | undefined;
|
|
14
14
|
};
|
|
15
15
|
</script>
|
|
16
16
|
|
|
@@ -4,10 +4,10 @@ import type { Sx } from '../../internal/sx.js';
|
|
|
4
4
|
export type ToolInputProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
5
5
|
/** The arguments the model passed. Shown as indented JSON unless already a string. */
|
|
6
6
|
value?: unknown;
|
|
7
|
-
label?: string;
|
|
8
|
-
sx?: Sx;
|
|
7
|
+
label?: string | undefined;
|
|
8
|
+
sx?: Sx | undefined;
|
|
9
9
|
/** Your own rendering of the arguments, in place of the JSON. */
|
|
10
|
-
children?: Snippet;
|
|
10
|
+
children?: Snippet | undefined;
|
|
11
11
|
};
|
|
12
12
|
declare const ToolInput: import("svelte").Component<ToolInputProps, {}, "">;
|
|
13
13
|
type ToolInput = ReturnType<typeof ToolInput>;
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
/** What the tool returned. Shown as indented JSON unless already a string. */
|
|
10
10
|
value?: unknown;
|
|
11
11
|
/** Why the tool failed. Shown in place of the value, in red. */
|
|
12
|
-
error?: string;
|
|
13
|
-
label?: string;
|
|
14
|
-
sx?: Sx;
|
|
12
|
+
error?: string | undefined;
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
sx?: Sx | undefined;
|
|
15
15
|
/** Your own rendering of the result, in place of the JSON. */
|
|
16
|
-
children?: Snippet;
|
|
16
|
+
children?: Snippet | undefined;
|
|
17
17
|
};
|
|
18
18
|
</script>
|
|
19
19
|
|