@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.
Files changed (410) hide show
  1. package/README.md +3 -1
  2. package/dist/color.d.ts +1 -1
  3. package/dist/components/activity/ActivityContent.svelte +2 -2
  4. package/dist/components/activity/ActivityContent.svelte.d.ts +2 -2
  5. package/dist/components/activity/ActivityRoot.svelte +5 -5
  6. package/dist/components/activity/ActivityRoot.svelte.d.ts +5 -5
  7. package/dist/components/activity/ActivityStep.svelte +9 -9
  8. package/dist/components/activity/ActivityStep.svelte.d.ts +9 -9
  9. package/dist/components/activity/ActivityThought.svelte +3 -3
  10. package/dist/components/activity/ActivityThought.svelte.d.ts +3 -3
  11. package/dist/components/activity/ActivityTrigger.svelte +5 -5
  12. package/dist/components/activity/ActivityTrigger.svelte.d.ts +5 -5
  13. package/dist/components/announcer/Announcer.svelte +5 -18
  14. package/dist/components/announcer/Announcer.svelte.d.ts +3 -3
  15. package/dist/components/app-shell/AppShellBar.svelte +5 -5
  16. package/dist/components/app-shell/AppShellBar.svelte.d.ts +5 -5
  17. package/dist/components/app-shell/AppShellHeader.svelte +3 -3
  18. package/dist/components/app-shell/AppShellHeader.svelte.d.ts +3 -3
  19. package/dist/components/app-shell/AppShellMain.svelte +2 -2
  20. package/dist/components/app-shell/AppShellMain.svelte.d.ts +2 -2
  21. package/dist/components/app-shell/AppShellPanel.svelte +6 -6
  22. package/dist/components/app-shell/AppShellPanel.svelte.d.ts +6 -6
  23. package/dist/components/app-shell/AppShellPanes.svelte +2 -2
  24. package/dist/components/app-shell/AppShellPanes.svelte.d.ts +2 -2
  25. package/dist/components/app-shell/AppShellRail.svelte +2 -2
  26. package/dist/components/app-shell/AppShellRail.svelte.d.ts +2 -2
  27. package/dist/components/app-shell/AppShellRoot.svelte +8 -8
  28. package/dist/components/app-shell/AppShellRoot.svelte.d.ts +8 -8
  29. package/dist/components/app-shell/AppShellSheet.svelte +4 -4
  30. package/dist/components/app-shell/AppShellSheet.svelte.d.ts +4 -4
  31. package/dist/components/app-shell/AppShellSidebar.svelte +3 -3
  32. package/dist/components/app-shell/AppShellSidebar.svelte.d.ts +3 -3
  33. package/dist/components/app-shell/AppShellToggle.svelte +5 -4
  34. package/dist/components/app-shell/AppShellToggle.svelte.d.ts +4 -4
  35. package/dist/components/approval/Approval.svelte +11 -11
  36. package/dist/components/approval/Approval.svelte.d.ts +11 -11
  37. package/dist/components/avatar/AvatarFallback.svelte +3 -2
  38. package/dist/components/avatar/AvatarFallback.svelte.d.ts +2 -2
  39. package/dist/components/avatar/AvatarImage.svelte +3 -3
  40. package/dist/components/avatar/AvatarImage.svelte.d.ts +3 -3
  41. package/dist/components/avatar/AvatarRoot.svelte +5 -5
  42. package/dist/components/avatar/AvatarRoot.svelte.d.ts +5 -5
  43. package/dist/components/badge/Badge.svelte +21 -6
  44. package/dist/components/badge/Badge.svelte.d.ts +8 -5
  45. package/dist/components/button/Button.svelte +54 -23
  46. package/dist/components/button/Button.svelte.d.ts +24 -18
  47. package/dist/components/card/Card.svelte +6 -6
  48. package/dist/components/card/Card.svelte.d.ts +6 -6
  49. package/dist/components/change-stats/ChangeStats.svelte +4 -4
  50. package/dist/components/change-stats/ChangeStats.svelte.d.ts +4 -4
  51. package/dist/components/changes-summary/ChangesSummary.svelte +6 -6
  52. package/dist/components/changes-summary/ChangesSummary.svelte.d.ts +6 -6
  53. package/dist/components/checkbox/Checkbox.svelte +19 -8
  54. package/dist/components/checkbox/Checkbox.svelte.d.ts +9 -7
  55. package/dist/components/choice-cards/ChoiceCards.svelte +145 -0
  56. package/dist/components/choice-cards/ChoiceCards.svelte.d.ts +29 -0
  57. package/dist/components/code/Code.svelte +2 -2
  58. package/dist/components/code/Code.svelte.d.ts +2 -2
  59. package/dist/components/collapsible/CollapsibleContent.svelte +8 -8
  60. package/dist/components/collapsible/CollapsibleContent.svelte.d.ts +10 -5
  61. package/dist/components/collapsible/CollapsibleRoot.svelte +8 -5
  62. package/dist/components/collapsible/CollapsibleRoot.svelte.d.ts +10 -5
  63. package/dist/components/collapsible/CollapsibleTrigger.svelte +17 -8
  64. package/dist/components/collapsible/CollapsibleTrigger.svelte.d.ts +20 -7
  65. package/dist/components/command/CommandDialog.svelte +3 -3
  66. package/dist/components/command/CommandDialog.svelte.d.ts +3 -3
  67. package/dist/components/command/CommandEmpty.svelte +8 -5
  68. package/dist/components/command/CommandEmpty.svelte.d.ts +10 -5
  69. package/dist/components/command/CommandFooter.svelte +2 -2
  70. package/dist/components/command/CommandFooter.svelte.d.ts +2 -2
  71. package/dist/components/command/CommandGroup.svelte +9 -6
  72. package/dist/components/command/CommandGroup.svelte.d.ts +12 -6
  73. package/dist/components/command/CommandInput.svelte +4 -1
  74. package/dist/components/command/CommandInput.svelte.d.ts +7 -4
  75. package/dist/components/command/CommandItem.svelte +14 -11
  76. package/dist/components/command/CommandItem.svelte.d.ts +18 -8
  77. package/dist/components/command/CommandList.svelte +7 -4
  78. package/dist/components/command/CommandList.svelte.d.ts +9 -5
  79. package/dist/components/command/CommandRoot.svelte +8 -5
  80. package/dist/components/command/CommandRoot.svelte.d.ts +10 -5
  81. package/dist/components/command/index.d.ts +3 -2
  82. package/dist/components/command/index.js +3 -2
  83. package/dist/components/composer/ComposerAttachButton.svelte +4 -4
  84. package/dist/components/composer/ComposerAttachButton.svelte.d.ts +4 -4
  85. package/dist/components/composer/ComposerAttachment.svelte +2 -2
  86. package/dist/components/composer/ComposerAttachment.svelte.d.ts +2 -2
  87. package/dist/components/composer/ComposerAttachments.svelte +3 -3
  88. package/dist/components/composer/ComposerAttachments.svelte.d.ts +3 -3
  89. package/dist/components/composer/ComposerModelPicker.svelte +9 -9
  90. package/dist/components/composer/ComposerModelPicker.svelte.d.ts +9 -9
  91. package/dist/components/composer/ComposerRoot.svelte +18 -25
  92. package/dist/components/composer/ComposerRoot.svelte.d.ts +15 -15
  93. package/dist/components/composer/ComposerSubmit.svelte +6 -5
  94. package/dist/components/composer/ComposerSubmit.svelte.d.ts +4 -4
  95. package/dist/components/composer/ComposerTextarea.svelte +3 -3
  96. package/dist/components/composer/ComposerTextarea.svelte.d.ts +3 -3
  97. package/dist/components/composer/ComposerToggle.svelte +4 -4
  98. package/dist/components/composer/ComposerToggle.svelte.d.ts +4 -4
  99. package/dist/components/composer/ComposerToolbar.svelte +2 -2
  100. package/dist/components/composer/ComposerToolbar.svelte.d.ts +2 -2
  101. package/dist/components/composer/ComposerTray.svelte +4 -4
  102. package/dist/components/composer/ComposerTray.svelte.d.ts +4 -4
  103. package/dist/components/conversation/ConversationContent.svelte +4 -4
  104. package/dist/components/conversation/ConversationContent.svelte.d.ts +4 -4
  105. package/dist/components/conversation/ConversationEmpty.svelte +5 -5
  106. package/dist/components/conversation/ConversationEmpty.svelte.d.ts +5 -5
  107. package/dist/components/conversation/ConversationRoot.svelte +4 -4
  108. package/dist/components/conversation/ConversationRoot.svelte.d.ts +4 -4
  109. package/dist/components/conversation/ConversationScrollButton.svelte +4 -4
  110. package/dist/components/conversation/ConversationScrollButton.svelte.d.ts +4 -4
  111. package/dist/components/dialog/ConfirmDialog.svelte +46 -15
  112. package/dist/components/dialog/ConfirmDialog.svelte.d.ts +14 -9
  113. package/dist/components/dialog/DialogBody.svelte +12 -4
  114. package/dist/components/dialog/DialogBody.svelte.d.ts +5 -3
  115. package/dist/components/dialog/DialogContent.svelte +16 -11
  116. package/dist/components/dialog/DialogContent.svelte.d.ts +21 -9
  117. package/dist/components/dialog/DialogDescription.svelte +7 -4
  118. package/dist/components/dialog/DialogDescription.svelte.d.ts +9 -5
  119. package/dist/components/dialog/DialogFooter.svelte +2 -2
  120. package/dist/components/dialog/DialogFooter.svelte.d.ts +2 -2
  121. package/dist/components/dialog/DialogHeader.svelte +2 -2
  122. package/dist/components/dialog/DialogHeader.svelte.d.ts +2 -2
  123. package/dist/components/dialog/DialogTitle.svelte +7 -4
  124. package/dist/components/dialog/DialogTitle.svelte.d.ts +9 -5
  125. package/dist/components/dialog/index.d.ts +5 -4
  126. package/dist/components/dialog/index.js +4 -3
  127. package/dist/components/dialog/styles.d.ts +6 -0
  128. package/dist/components/dialog/styles.js +6 -1
  129. package/dist/components/divider/Divider.svelte +3 -3
  130. package/dist/components/divider/Divider.svelte.d.ts +3 -3
  131. package/dist/components/empty-state/EmptyState.svelte +10 -5
  132. package/dist/components/empty-state/EmptyState.svelte.d.ts +5 -4
  133. package/dist/components/field/Field.svelte +88 -27
  134. package/dist/components/field/Field.svelte.d.ts +24 -11
  135. package/dist/components/field/context.d.ts +6 -3
  136. package/dist/components/frame/Frame.svelte +6 -6
  137. package/dist/components/frame/Frame.svelte.d.ts +6 -6
  138. package/dist/components/grid/Grid.svelte +17 -6
  139. package/dist/components/grid/Grid.svelte.d.ts +6 -6
  140. package/dist/components/heading/Heading.svelte +29 -6
  141. package/dist/components/heading/Heading.svelte.d.ts +6 -4
  142. package/dist/components/hover-card/HoverCardContent.svelte +7 -4
  143. package/dist/components/hover-card/HoverCardContent.svelte.d.ts +9 -5
  144. package/dist/components/hover-card/HoverCardRoot.svelte +2 -1
  145. package/dist/components/hover-card/HoverCardRoot.svelte.d.ts +3 -2
  146. package/dist/components/hover-card/index.d.ts +2 -1
  147. package/dist/components/hover-card/index.js +2 -1
  148. package/dist/components/input/Input.svelte +63 -17
  149. package/dist/components/input/Input.svelte.d.ts +12 -5
  150. package/dist/components/kbd/Kbd.svelte +2 -2
  151. package/dist/components/kbd/Kbd.svelte.d.ts +2 -2
  152. package/dist/components/link/Link.svelte +6 -6
  153. package/dist/components/link/Link.svelte.d.ts +6 -6
  154. package/dist/components/list/ListItem.svelte +41 -0
  155. package/dist/components/list/ListItem.svelte.d.ts +10 -0
  156. package/dist/components/list/ListRoot.svelte +69 -0
  157. package/dist/components/list/ListRoot.svelte.d.ts +28 -0
  158. package/dist/components/list/context.d.ts +5 -0
  159. package/dist/components/list/context.js +8 -0
  160. package/dist/components/list/index.d.ts +5 -0
  161. package/dist/components/list/index.js +3 -0
  162. package/dist/components/markdown/Markdown.svelte +16 -16
  163. package/dist/components/markdown/Markdown.svelte.d.ts +16 -16
  164. package/dist/components/markdown/MarkdownBlock.svelte +2 -2
  165. package/dist/components/markdown/MarkdownBlock.svelte.d.ts +2 -2
  166. package/dist/components/markdown/MarkdownBlocks.svelte +4 -4
  167. package/dist/components/markdown/MarkdownBlocks.svelte.d.ts +4 -4
  168. package/dist/components/markdown/MarkdownCode.svelte +1 -1
  169. package/dist/components/markdown/MarkdownCode.svelte.d.ts +1 -1
  170. package/dist/components/markdown/MarkdownFile.svelte +6 -4
  171. package/dist/components/markdown/MarkdownFile.svelte.d.ts +2 -2
  172. package/dist/components/markdown/MarkdownFootnotes.svelte +2 -1
  173. package/dist/components/markdown/MarkdownLink.svelte +1 -1
  174. package/dist/components/markdown/MarkdownLink.svelte.d.ts +1 -1
  175. package/dist/components/markdown/MarkdownTable.svelte +4 -11
  176. package/dist/components/markdown/MarkdownTable.svelte.d.ts +1 -1
  177. package/dist/components/markdown/styles.d.ts +0 -8
  178. package/dist/components/markdown/styles.js +0 -8
  179. package/dist/components/menu/ContextMenuContent.svelte +8 -5
  180. package/dist/components/menu/ContextMenuContent.svelte.d.ts +10 -5
  181. package/dist/components/menu/ContextMenuTrigger.svelte +8 -5
  182. package/dist/components/menu/ContextMenuTrigger.svelte.d.ts +10 -5
  183. package/dist/components/menu/MenuCheckboxItem.svelte +8 -5
  184. package/dist/components/menu/MenuCheckboxItem.svelte.d.ts +11 -6
  185. package/dist/components/menu/MenuContent.svelte +7 -4
  186. package/dist/components/menu/MenuContent.svelte.d.ts +9 -5
  187. package/dist/components/menu/MenuItem.svelte +14 -11
  188. package/dist/components/menu/MenuItem.svelte.d.ts +18 -8
  189. package/dist/components/menu/MenuLabel.svelte +7 -4
  190. package/dist/components/menu/MenuLabel.svelte.d.ts +9 -5
  191. package/dist/components/menu/MenuRadioItem.svelte +23 -8
  192. package/dist/components/menu/MenuRadioItem.svelte.d.ts +20 -6
  193. package/dist/components/menu/MenuSeparator.svelte +6 -3
  194. package/dist/components/menu/MenuSeparator.svelte.d.ts +7 -4
  195. package/dist/components/menu/MenuSubContent.svelte +7 -4
  196. package/dist/components/menu/MenuSubContent.svelte.d.ts +9 -5
  197. package/dist/components/menu/MenuSubTrigger.svelte +9 -6
  198. package/dist/components/menu/MenuSubTrigger.svelte.d.ts +11 -6
  199. package/dist/components/menu/context-menu.d.ts +3 -1
  200. package/dist/components/menu/context-menu.js +2 -1
  201. package/dist/components/menu/index.d.ts +6 -5
  202. package/dist/components/menu/index.js +9 -8
  203. package/dist/components/message/MessageAction.svelte +7 -7
  204. package/dist/components/message/MessageAction.svelte.d.ts +7 -7
  205. package/dist/components/message/MessageActions.svelte +4 -4
  206. package/dist/components/message/MessageActions.svelte.d.ts +4 -4
  207. package/dist/components/message/MessageContent.svelte +3 -3
  208. package/dist/components/message/MessageContent.svelte.d.ts +3 -3
  209. package/dist/components/message/MessageCopy.svelte +14 -17
  210. package/dist/components/message/MessageCopy.svelte.d.ts +7 -7
  211. package/dist/components/message/MessageHeader.svelte +3 -3
  212. package/dist/components/message/MessageHeader.svelte.d.ts +3 -3
  213. package/dist/components/message/MessagePending.svelte +2 -2
  214. package/dist/components/message/MessagePending.svelte.d.ts +2 -2
  215. package/dist/components/message/MessageRoot.svelte +5 -5
  216. package/dist/components/message/MessageRoot.svelte.d.ts +5 -5
  217. package/dist/components/message/MessageTime.svelte +3 -3
  218. package/dist/components/message/MessageTime.svelte.d.ts +3 -3
  219. package/dist/components/notice/Notice.svelte +45 -9
  220. package/dist/components/notice/Notice.svelte.d.ts +13 -8
  221. package/dist/components/plan/Plan.svelte +7 -14
  222. package/dist/components/plan/Plan.svelte.d.ts +5 -5
  223. package/dist/components/popover/PopoverContent.svelte +7 -4
  224. package/dist/components/popover/PopoverContent.svelte.d.ts +9 -5
  225. package/dist/components/popover/index.d.ts +4 -3
  226. package/dist/components/popover/index.js +4 -3
  227. package/dist/components/progress/Progress.svelte +3 -3
  228. package/dist/components/progress/Progress.svelte.d.ts +3 -3
  229. package/dist/components/questionnaire/Questionnaire.svelte +17 -11
  230. package/dist/components/questionnaire/Questionnaire.svelte.d.ts +11 -11
  231. package/dist/components/queued-message/QueuedMessage.svelte +10 -10
  232. package/dist/components/queued-message/QueuedMessage.svelte.d.ts +10 -10
  233. package/dist/components/rail/RailItem.svelte +15 -22
  234. package/dist/components/rail/RailItem.svelte.d.ts +9 -9
  235. package/dist/components/rail/RailRoot.svelte +2 -2
  236. package/dist/components/rail/RailRoot.svelte.d.ts +2 -2
  237. package/dist/components/reasoning/ReasoningContent.svelte +2 -2
  238. package/dist/components/reasoning/ReasoningContent.svelte.d.ts +2 -2
  239. package/dist/components/reasoning/ReasoningRoot.svelte +6 -6
  240. package/dist/components/reasoning/ReasoningRoot.svelte.d.ts +6 -6
  241. package/dist/components/reasoning/ReasoningTrigger.svelte +3 -3
  242. package/dist/components/reasoning/ReasoningTrigger.svelte.d.ts +3 -3
  243. package/dist/components/resize-handle/ResizeHandle.svelte +10 -10
  244. package/dist/components/resize-handle/ResizeHandle.svelte.d.ts +10 -10
  245. package/dist/components/reveal/Reveal.svelte +16 -10
  246. package/dist/components/reveal/Reveal.svelte.d.ts +4 -4
  247. package/dist/components/reveal/revealed.js +13 -9
  248. package/dist/components/rolling-text/RollingText.svelte +3 -3
  249. package/dist/components/rolling-text/RollingText.svelte.d.ts +3 -3
  250. package/dist/components/search-button/SearchButton.svelte +92 -0
  251. package/dist/components/search-button/SearchButton.svelte.d.ts +13 -0
  252. package/dist/components/segmented/SegmentedControl.svelte +71 -24
  253. package/dist/components/segmented/SegmentedControl.svelte.d.ts +14 -5
  254. package/dist/components/select/Select.svelte +39 -14
  255. package/dist/components/select/Select.svelte.d.ts +21 -13
  256. package/dist/components/separator/Separator.svelte +3 -3
  257. package/dist/components/separator/Separator.svelte.d.ts +3 -3
  258. package/dist/components/settings-group/SettingsGroup.svelte +118 -0
  259. package/dist/components/settings-group/SettingsGroup.svelte.d.ts +19 -0
  260. package/dist/components/settings-group/context.d.ts +7 -0
  261. package/dist/components/settings-group/context.js +9 -0
  262. package/dist/components/settings-row/SettingsRow.svelte +195 -56
  263. package/dist/components/settings-row/SettingsRow.svelte.d.ts +45 -14
  264. package/dist/components/sheet/SheetContent.svelte +31 -11
  265. package/dist/components/sheet/SheetContent.svelte.d.ts +33 -9
  266. package/dist/components/sheet/index.d.ts +5 -4
  267. package/dist/components/sheet/index.js +4 -3
  268. package/dist/components/sheet/styles.d.ts +6 -0
  269. package/dist/components/sheet/styles.js +2 -0
  270. package/dist/components/shimmer/Shimmer.svelte +3 -3
  271. package/dist/components/shimmer/Shimmer.svelte.d.ts +3 -3
  272. package/dist/components/sidebar/SidebarContent.svelte +3 -3
  273. package/dist/components/sidebar/SidebarContent.svelte.d.ts +3 -3
  274. package/dist/components/sidebar/SidebarFolder.svelte +25 -15
  275. package/dist/components/sidebar/SidebarFolder.svelte.d.ts +5 -5
  276. package/dist/components/sidebar/SidebarFooter.svelte +2 -2
  277. package/dist/components/sidebar/SidebarFooter.svelte.d.ts +2 -2
  278. package/dist/components/sidebar/SidebarGroup.svelte +6 -6
  279. package/dist/components/sidebar/SidebarGroup.svelte.d.ts +6 -6
  280. package/dist/components/sidebar/SidebarHeader.svelte +3 -3
  281. package/dist/components/sidebar/SidebarHeader.svelte.d.ts +3 -3
  282. package/dist/components/sidebar/SidebarItem.svelte +43 -18
  283. package/dist/components/sidebar/SidebarItem.svelte.d.ts +15 -10
  284. package/dist/components/sidebar/SidebarRoot.svelte +4 -4
  285. package/dist/components/sidebar/SidebarRoot.svelte.d.ts +4 -4
  286. package/dist/components/sidebar/SidebarSwitcher.svelte +28 -0
  287. package/dist/components/sidebar/SidebarSwitcher.svelte.d.ts +11 -0
  288. package/dist/components/sidebar/depth.d.ts +10 -0
  289. package/dist/components/sidebar/depth.js +16 -0
  290. package/dist/components/sidebar/index.d.ts +3 -1
  291. package/dist/components/sidebar/index.js +2 -1
  292. package/dist/components/skeleton/Skeleton.svelte +5 -5
  293. package/dist/components/skeleton/Skeleton.svelte.d.ts +5 -5
  294. package/dist/components/slider/Slider.svelte +13 -13
  295. package/dist/components/slider/Slider.svelte.d.ts +13 -13
  296. package/dist/components/spinner/Spinner.svelte +4 -3
  297. package/dist/components/spinner/Spinner.svelte.d.ts +3 -3
  298. package/dist/components/stack/Stack.svelte +19 -8
  299. package/dist/components/stack/Stack.svelte.d.ts +8 -8
  300. package/dist/components/status-indicator/StatusIndicator.svelte +5 -4
  301. package/dist/components/status-indicator/StatusIndicator.svelte.d.ts +4 -4
  302. package/dist/components/suggestions/SuggestionsItem.svelte +3 -3
  303. package/dist/components/suggestions/SuggestionsItem.svelte.d.ts +3 -3
  304. package/dist/components/suggestions/SuggestionsRoot.svelte +5 -5
  305. package/dist/components/suggestions/SuggestionsRoot.svelte.d.ts +5 -5
  306. package/dist/components/switch/Switch.svelte +18 -7
  307. package/dist/components/switch/Switch.svelte.d.ts +8 -6
  308. package/dist/components/tab-strip/TabStrip.svelte +106 -25
  309. package/dist/components/tab-strip/TabStrip.svelte.d.ts +9 -9
  310. package/dist/components/tabs/Tabs.svelte +72 -26
  311. package/dist/components/tabs/Tabs.svelte.d.ts +13 -7
  312. package/dist/components/text/Text.svelte +35 -11
  313. package/dist/components/text/Text.svelte.d.ts +12 -10
  314. package/dist/components/textarea/Textarea.svelte +5 -5
  315. package/dist/components/textarea/Textarea.svelte.d.ts +5 -5
  316. package/dist/components/theme/Theme.svelte +4 -4
  317. package/dist/components/theme/Theme.svelte.d.ts +4 -4
  318. package/dist/components/toast/Toaster.svelte +34 -27
  319. package/dist/components/toast/Toaster.svelte.d.ts +2 -2
  320. package/dist/components/toast/toasts.svelte.d.ts +52 -15
  321. package/dist/components/toast/toasts.svelte.js +45 -20
  322. package/dist/components/toggle/Toggle.svelte +11 -8
  323. package/dist/components/toggle/Toggle.svelte.d.ts +15 -7
  324. package/dist/components/toggle-group/ToggleGroupItem.svelte +9 -6
  325. package/dist/components/toggle-group/ToggleGroupItem.svelte.d.ts +12 -6
  326. package/dist/components/toggle-group/ToggleGroupRoot.svelte +17 -14
  327. package/dist/components/toggle-group/ToggleGroupRoot.svelte.d.ts +13 -12
  328. package/dist/components/tool/ToolContent.svelte +2 -2
  329. package/dist/components/tool/ToolContent.svelte.d.ts +2 -2
  330. package/dist/components/tool/ToolInput.svelte +3 -3
  331. package/dist/components/tool/ToolInput.svelte.d.ts +3 -3
  332. package/dist/components/tool/ToolOutput.svelte +4 -4
  333. package/dist/components/tool/ToolOutput.svelte.d.ts +4 -4
  334. package/dist/components/tool/ToolRoot.svelte +7 -7
  335. package/dist/components/tool/ToolRoot.svelte.d.ts +7 -7
  336. package/dist/components/tool/ToolSection.svelte +4 -4
  337. package/dist/components/tool/ToolSection.svelte.d.ts +4 -4
  338. package/dist/components/tool/ToolTrigger.svelte +4 -4
  339. package/dist/components/tool/ToolTrigger.svelte.d.ts +4 -4
  340. package/dist/components/tooltip/TooltipContent.svelte +9 -6
  341. package/dist/components/tooltip/TooltipContent.svelte.d.ts +12 -6
  342. package/dist/components/tooltip/TooltipRoot.svelte +7 -4
  343. package/dist/components/tooltip/TooltipRoot.svelte.d.ts +8 -4
  344. package/dist/components/tooltip/TooltipTrigger.svelte +2 -1
  345. package/dist/components/tooltip/TooltipTrigger.svelte.d.ts +3 -2
  346. package/dist/components/tooltip/index.d.ts +2 -1
  347. package/dist/components/tooltip/index.js +2 -1
  348. package/dist/components/work-fold/WorkFold.svelte +4 -4
  349. package/dist/components/work-fold/WorkFold.svelte.d.ts +4 -4
  350. package/dist/index.d.ts +15 -5
  351. package/dist/index.js +8 -1
  352. package/dist/internal/Chevron.svelte +1 -1
  353. package/dist/internal/Chevron.svelte.d.ts +1 -1
  354. package/dist/internal/Code.svelte +6 -1
  355. package/dist/internal/Code.svelte.d.ts +3 -3
  356. package/dist/internal/Collapse.svelte +4 -4
  357. package/dist/internal/Collapse.svelte.d.ts +4 -4
  358. package/dist/internal/Glyph.svelte +4 -2
  359. package/dist/internal/Glyph.svelte.d.ts +3 -2
  360. package/dist/internal/Tile.svelte +5 -5
  361. package/dist/internal/Tile.svelte.d.ts +5 -5
  362. package/dist/internal/complete.d.ts +8 -0
  363. package/dist/internal/complete.js +1 -0
  364. package/dist/internal/icon.d.ts +9 -0
  365. package/dist/internal/icon.js +1 -0
  366. package/dist/internal/icons.css +14 -0
  367. package/dist/internal/json.d.ts +1 -1
  368. package/dist/internal/layer.d.ts +3 -1
  369. package/dist/internal/layer.js +7 -2
  370. package/dist/internal/layout.d.ts +1 -1
  371. package/dist/internal/layout.js +6 -0
  372. package/dist/internal/loose.d.ts +22 -0
  373. package/dist/internal/loose.js +4 -0
  374. package/dist/internal/markers.stylex.d.ts +4 -0
  375. package/dist/internal/markers.stylex.js +2 -0
  376. package/dist/internal/responsive.d.ts +1 -1
  377. package/dist/internal/roving.d.ts +1 -1
  378. package/dist/internal/sx.d.ts +4 -4
  379. package/dist/internal/tooltip-trigger.d.ts +9 -0
  380. package/dist/internal/tooltip-trigger.js +19 -0
  381. package/dist/markdown/ast.d.ts +6 -6
  382. package/dist/markdown/blocks.d.ts +6 -5
  383. package/dist/markdown/file-paths.d.ts +3 -3
  384. package/dist/markdown/files.d.ts +2 -2
  385. package/dist/markdown/highlight.d.ts +2 -2
  386. package/dist/markdown/html.d.ts +3 -12
  387. package/dist/markdown/images.d.ts +1 -1
  388. package/dist/markdown/inlines.d.ts +2 -2
  389. package/dist/markdown/parse.d.ts +3 -3
  390. package/dist/markdown/plugin.d.ts +21 -20
  391. package/dist/markdown/sanitize.d.ts +1 -1
  392. package/dist/markers.stylex.d.ts +13 -0
  393. package/dist/markers.stylex.js +11 -0
  394. package/dist/preset.d.ts +5 -5
  395. package/dist/preset.js +6 -6
  396. package/dist/tokens.stylex.d.ts +2 -0
  397. package/dist/tokens.stylex.js +10 -4
  398. package/dist/typography.d.ts +7 -0
  399. package/dist/typography.js +8 -0
  400. package/dist/visually-hidden.d.ts +18 -0
  401. package/dist/visually-hidden.js +21 -0
  402. package/dist/vite.d.ts +17 -8
  403. package/dist/vite.js +38 -0
  404. package/package.json +6 -2
  405. package/skills/building-ui/SKILL.md +169 -19
  406. package/skills/building-ui/references/components.md +39 -35
  407. package/skills/markdown/SKILL.md +1 -1
  408. package/skills/setup/SKILL.md +17 -11
  409. package/skills/styling/SKILL.md +58 -9
  410. 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: ['#87837f', '#817d79'],
108
- borderControlHover: ['#77746f', '#8f8b87']
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: ['#818489', '#76797e'],
123
- borderControlHover: ['#727579', '#86898d']
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: ['#848484', '#747474'],
138
- borderControlHover: ['#747474', '#828282']
137
+ borderControl: ['#8d8d8d', '#656565'],
138
+ borderControlHover: ['#848484', '#747474']
139
139
  }
140
140
  }
141
141
  ];
@@ -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;
@@ -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 holds 3:1 against its surface,
35
- // down to the hardest one it can stand on: a hovered row of the page.
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(#818489, #76797e)',
39
- borderControlHover: 'light-dark(#727579, #86898d)',
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',
@@ -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>;
@@ -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). Also add this line to the top of your stylesheet, before
16
- * `@import "tailwindcss"`:
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.2.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.0'
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 each control in a `SettingsRow` (`label`, `description`). Its
136
- `children` snippet receives `{ id, describedBy }` for the control:
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
- <SettingsRow label="Project name">
140
- {#snippet children({ id, describedBy })}
141
- <Input {id} aria-describedby={describedBy} bind:value={name} />
142
- {/snippet}
143
- </SettingsRow>
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
- A control that is a group rather than a single element, such as `SegmentedControl`, still needs
147
- its own `aria-label` inside a SettingsRow.
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, 2, 3, 4, 5, 6, 8,
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, and `size` from `sm` to `4xl` for the look) and
174
- `Text` (`variant` is what the text is: `title`, `reading`, `label`, `body`, `meta`, `caption`,
175
- `micro` or `lead`, each one size, weight and line height; `tone` default, muted, subtle, accent,
176
- danger or success; `weight`; `face="display"` for the serif; `truncate`). Use `Code` and `Kbd` inline, and
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. A toast can take an `action` (`{ label: 'Undo', onclick }`).
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