@diegopluna/narvi 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/dist/color.d.ts +1 -1
  2. package/dist/components/activity/ActivityContent.svelte +2 -2
  3. package/dist/components/activity/ActivityContent.svelte.d.ts +2 -2
  4. package/dist/components/activity/ActivityRoot.svelte +5 -5
  5. package/dist/components/activity/ActivityRoot.svelte.d.ts +5 -5
  6. package/dist/components/activity/ActivityStep.svelte +9 -9
  7. package/dist/components/activity/ActivityStep.svelte.d.ts +9 -9
  8. package/dist/components/activity/ActivityThought.svelte +3 -3
  9. package/dist/components/activity/ActivityThought.svelte.d.ts +3 -3
  10. package/dist/components/activity/ActivityTrigger.svelte +5 -5
  11. package/dist/components/activity/ActivityTrigger.svelte.d.ts +5 -5
  12. package/dist/components/announcer/Announcer.svelte +5 -18
  13. package/dist/components/announcer/Announcer.svelte.d.ts +3 -3
  14. package/dist/components/app-shell/AppShellBar.svelte +5 -5
  15. package/dist/components/app-shell/AppShellBar.svelte.d.ts +5 -5
  16. package/dist/components/app-shell/AppShellHeader.svelte +3 -3
  17. package/dist/components/app-shell/AppShellHeader.svelte.d.ts +3 -3
  18. package/dist/components/app-shell/AppShellMain.svelte +2 -2
  19. package/dist/components/app-shell/AppShellMain.svelte.d.ts +2 -2
  20. package/dist/components/app-shell/AppShellPanel.svelte +6 -6
  21. package/dist/components/app-shell/AppShellPanel.svelte.d.ts +6 -6
  22. package/dist/components/app-shell/AppShellPanes.svelte +2 -2
  23. package/dist/components/app-shell/AppShellPanes.svelte.d.ts +2 -2
  24. package/dist/components/app-shell/AppShellRail.svelte +2 -2
  25. package/dist/components/app-shell/AppShellRail.svelte.d.ts +2 -2
  26. package/dist/components/app-shell/AppShellRoot.svelte +8 -8
  27. package/dist/components/app-shell/AppShellRoot.svelte.d.ts +8 -8
  28. package/dist/components/app-shell/AppShellSheet.svelte +4 -4
  29. package/dist/components/app-shell/AppShellSheet.svelte.d.ts +4 -4
  30. package/dist/components/app-shell/AppShellSidebar.svelte +3 -3
  31. package/dist/components/app-shell/AppShellSidebar.svelte.d.ts +3 -3
  32. package/dist/components/app-shell/AppShellToggle.svelte +5 -4
  33. package/dist/components/app-shell/AppShellToggle.svelte.d.ts +4 -4
  34. package/dist/components/approval/Approval.svelte +11 -11
  35. package/dist/components/approval/Approval.svelte.d.ts +11 -11
  36. package/dist/components/avatar/AvatarFallback.svelte +3 -2
  37. package/dist/components/avatar/AvatarFallback.svelte.d.ts +2 -2
  38. package/dist/components/avatar/AvatarImage.svelte +3 -3
  39. package/dist/components/avatar/AvatarImage.svelte.d.ts +3 -3
  40. package/dist/components/avatar/AvatarRoot.svelte +5 -5
  41. package/dist/components/avatar/AvatarRoot.svelte.d.ts +5 -5
  42. package/dist/components/badge/Badge.svelte +21 -6
  43. package/dist/components/badge/Badge.svelte.d.ts +8 -5
  44. package/dist/components/button/Button.svelte +54 -23
  45. package/dist/components/button/Button.svelte.d.ts +24 -18
  46. package/dist/components/card/Card.svelte +6 -6
  47. package/dist/components/card/Card.svelte.d.ts +6 -6
  48. package/dist/components/change-stats/ChangeStats.svelte +4 -4
  49. package/dist/components/change-stats/ChangeStats.svelte.d.ts +4 -4
  50. package/dist/components/changes-summary/ChangesSummary.svelte +6 -6
  51. package/dist/components/changes-summary/ChangesSummary.svelte.d.ts +6 -6
  52. package/dist/components/checkbox/Checkbox.svelte +19 -8
  53. package/dist/components/checkbox/Checkbox.svelte.d.ts +9 -7
  54. package/dist/components/choice-cards/ChoiceCards.svelte +145 -0
  55. package/dist/components/choice-cards/ChoiceCards.svelte.d.ts +29 -0
  56. package/dist/components/code/Code.svelte +2 -2
  57. package/dist/components/code/Code.svelte.d.ts +2 -2
  58. package/dist/components/collapsible/CollapsibleContent.svelte +8 -8
  59. package/dist/components/collapsible/CollapsibleContent.svelte.d.ts +10 -5
  60. package/dist/components/collapsible/CollapsibleRoot.svelte +8 -5
  61. package/dist/components/collapsible/CollapsibleRoot.svelte.d.ts +10 -5
  62. package/dist/components/collapsible/CollapsibleTrigger.svelte +17 -8
  63. package/dist/components/collapsible/CollapsibleTrigger.svelte.d.ts +20 -7
  64. package/dist/components/command/CommandDialog.svelte +3 -3
  65. package/dist/components/command/CommandDialog.svelte.d.ts +3 -3
  66. package/dist/components/command/CommandEmpty.svelte +8 -5
  67. package/dist/components/command/CommandEmpty.svelte.d.ts +10 -5
  68. package/dist/components/command/CommandFooter.svelte +2 -2
  69. package/dist/components/command/CommandFooter.svelte.d.ts +2 -2
  70. package/dist/components/command/CommandGroup.svelte +9 -6
  71. package/dist/components/command/CommandGroup.svelte.d.ts +12 -6
  72. package/dist/components/command/CommandInput.svelte +4 -1
  73. package/dist/components/command/CommandInput.svelte.d.ts +7 -4
  74. package/dist/components/command/CommandItem.svelte +14 -11
  75. package/dist/components/command/CommandItem.svelte.d.ts +18 -8
  76. package/dist/components/command/CommandList.svelte +7 -4
  77. package/dist/components/command/CommandList.svelte.d.ts +9 -5
  78. package/dist/components/command/CommandRoot.svelte +8 -5
  79. package/dist/components/command/CommandRoot.svelte.d.ts +10 -5
  80. package/dist/components/command/index.d.ts +3 -2
  81. package/dist/components/command/index.js +3 -2
  82. package/dist/components/composer/ComposerAttachButton.svelte +4 -4
  83. package/dist/components/composer/ComposerAttachButton.svelte.d.ts +4 -4
  84. package/dist/components/composer/ComposerAttachment.svelte +2 -2
  85. package/dist/components/composer/ComposerAttachment.svelte.d.ts +2 -2
  86. package/dist/components/composer/ComposerAttachments.svelte +3 -3
  87. package/dist/components/composer/ComposerAttachments.svelte.d.ts +3 -3
  88. package/dist/components/composer/ComposerModelPicker.svelte +9 -9
  89. package/dist/components/composer/ComposerModelPicker.svelte.d.ts +9 -9
  90. package/dist/components/composer/ComposerRoot.svelte +18 -25
  91. package/dist/components/composer/ComposerRoot.svelte.d.ts +15 -15
  92. package/dist/components/composer/ComposerSubmit.svelte +6 -5
  93. package/dist/components/composer/ComposerSubmit.svelte.d.ts +4 -4
  94. package/dist/components/composer/ComposerTextarea.svelte +3 -3
  95. package/dist/components/composer/ComposerTextarea.svelte.d.ts +3 -3
  96. package/dist/components/composer/ComposerToggle.svelte +4 -4
  97. package/dist/components/composer/ComposerToggle.svelte.d.ts +4 -4
  98. package/dist/components/composer/ComposerToolbar.svelte +2 -2
  99. package/dist/components/composer/ComposerToolbar.svelte.d.ts +2 -2
  100. package/dist/components/composer/ComposerTray.svelte +4 -4
  101. package/dist/components/composer/ComposerTray.svelte.d.ts +4 -4
  102. package/dist/components/conversation/ConversationContent.svelte +4 -4
  103. package/dist/components/conversation/ConversationContent.svelte.d.ts +4 -4
  104. package/dist/components/conversation/ConversationEmpty.svelte +5 -5
  105. package/dist/components/conversation/ConversationEmpty.svelte.d.ts +5 -5
  106. package/dist/components/conversation/ConversationRoot.svelte +4 -4
  107. package/dist/components/conversation/ConversationRoot.svelte.d.ts +4 -4
  108. package/dist/components/conversation/ConversationScrollButton.svelte +4 -4
  109. package/dist/components/conversation/ConversationScrollButton.svelte.d.ts +4 -4
  110. package/dist/components/dialog/ConfirmDialog.svelte +46 -15
  111. package/dist/components/dialog/ConfirmDialog.svelte.d.ts +14 -9
  112. package/dist/components/dialog/DialogBody.svelte +12 -4
  113. package/dist/components/dialog/DialogBody.svelte.d.ts +5 -3
  114. package/dist/components/dialog/DialogContent.svelte +16 -11
  115. package/dist/components/dialog/DialogContent.svelte.d.ts +21 -9
  116. package/dist/components/dialog/DialogDescription.svelte +7 -4
  117. package/dist/components/dialog/DialogDescription.svelte.d.ts +9 -5
  118. package/dist/components/dialog/DialogFooter.svelte +2 -2
  119. package/dist/components/dialog/DialogFooter.svelte.d.ts +2 -2
  120. package/dist/components/dialog/DialogHeader.svelte +2 -2
  121. package/dist/components/dialog/DialogHeader.svelte.d.ts +2 -2
  122. package/dist/components/dialog/DialogTitle.svelte +7 -4
  123. package/dist/components/dialog/DialogTitle.svelte.d.ts +9 -5
  124. package/dist/components/dialog/index.d.ts +5 -4
  125. package/dist/components/dialog/index.js +4 -3
  126. package/dist/components/dialog/styles.d.ts +6 -0
  127. package/dist/components/dialog/styles.js +6 -1
  128. package/dist/components/divider/Divider.svelte +3 -3
  129. package/dist/components/divider/Divider.svelte.d.ts +3 -3
  130. package/dist/components/empty-state/EmptyState.svelte +10 -5
  131. package/dist/components/empty-state/EmptyState.svelte.d.ts +5 -4
  132. package/dist/components/field/Field.svelte +88 -27
  133. package/dist/components/field/Field.svelte.d.ts +24 -11
  134. package/dist/components/field/context.d.ts +6 -3
  135. package/dist/components/frame/Frame.svelte +6 -6
  136. package/dist/components/frame/Frame.svelte.d.ts +6 -6
  137. package/dist/components/grid/Grid.svelte +17 -6
  138. package/dist/components/grid/Grid.svelte.d.ts +6 -6
  139. package/dist/components/heading/Heading.svelte +29 -6
  140. package/dist/components/heading/Heading.svelte.d.ts +6 -4
  141. package/dist/components/hover-card/HoverCardContent.svelte +7 -4
  142. package/dist/components/hover-card/HoverCardContent.svelte.d.ts +9 -5
  143. package/dist/components/hover-card/HoverCardRoot.svelte +2 -1
  144. package/dist/components/hover-card/HoverCardRoot.svelte.d.ts +3 -2
  145. package/dist/components/hover-card/index.d.ts +2 -1
  146. package/dist/components/hover-card/index.js +2 -1
  147. package/dist/components/input/Input.svelte +63 -17
  148. package/dist/components/input/Input.svelte.d.ts +12 -5
  149. package/dist/components/kbd/Kbd.svelte +2 -2
  150. package/dist/components/kbd/Kbd.svelte.d.ts +2 -2
  151. package/dist/components/link/Link.svelte +6 -6
  152. package/dist/components/link/Link.svelte.d.ts +6 -6
  153. package/dist/components/list/ListItem.svelte +41 -0
  154. package/dist/components/list/ListItem.svelte.d.ts +10 -0
  155. package/dist/components/list/ListRoot.svelte +69 -0
  156. package/dist/components/list/ListRoot.svelte.d.ts +28 -0
  157. package/dist/components/list/context.d.ts +5 -0
  158. package/dist/components/list/context.js +8 -0
  159. package/dist/components/list/index.d.ts +5 -0
  160. package/dist/components/list/index.js +3 -0
  161. package/dist/components/markdown/Markdown.svelte +16 -16
  162. package/dist/components/markdown/Markdown.svelte.d.ts +16 -16
  163. package/dist/components/markdown/MarkdownBlock.svelte +2 -2
  164. package/dist/components/markdown/MarkdownBlock.svelte.d.ts +2 -2
  165. package/dist/components/markdown/MarkdownBlocks.svelte +4 -4
  166. package/dist/components/markdown/MarkdownBlocks.svelte.d.ts +4 -4
  167. package/dist/components/markdown/MarkdownCode.svelte +1 -1
  168. package/dist/components/markdown/MarkdownCode.svelte.d.ts +1 -1
  169. package/dist/components/markdown/MarkdownFile.svelte +6 -4
  170. package/dist/components/markdown/MarkdownFile.svelte.d.ts +2 -2
  171. package/dist/components/markdown/MarkdownFootnotes.svelte +2 -1
  172. package/dist/components/markdown/MarkdownLink.svelte +1 -1
  173. package/dist/components/markdown/MarkdownLink.svelte.d.ts +1 -1
  174. package/dist/components/markdown/MarkdownTable.svelte +4 -11
  175. package/dist/components/markdown/MarkdownTable.svelte.d.ts +1 -1
  176. package/dist/components/markdown/styles.d.ts +0 -8
  177. package/dist/components/markdown/styles.js +0 -8
  178. package/dist/components/menu/ContextMenuContent.svelte +8 -5
  179. package/dist/components/menu/ContextMenuContent.svelte.d.ts +10 -5
  180. package/dist/components/menu/ContextMenuTrigger.svelte +8 -5
  181. package/dist/components/menu/ContextMenuTrigger.svelte.d.ts +10 -5
  182. package/dist/components/menu/MenuCheckboxItem.svelte +8 -5
  183. package/dist/components/menu/MenuCheckboxItem.svelte.d.ts +11 -6
  184. package/dist/components/menu/MenuContent.svelte +7 -4
  185. package/dist/components/menu/MenuContent.svelte.d.ts +9 -5
  186. package/dist/components/menu/MenuItem.svelte +14 -11
  187. package/dist/components/menu/MenuItem.svelte.d.ts +18 -8
  188. package/dist/components/menu/MenuLabel.svelte +7 -4
  189. package/dist/components/menu/MenuLabel.svelte.d.ts +9 -5
  190. package/dist/components/menu/MenuRadioItem.svelte +23 -8
  191. package/dist/components/menu/MenuRadioItem.svelte.d.ts +20 -6
  192. package/dist/components/menu/MenuSeparator.svelte +6 -3
  193. package/dist/components/menu/MenuSeparator.svelte.d.ts +7 -4
  194. package/dist/components/menu/MenuSubContent.svelte +7 -4
  195. package/dist/components/menu/MenuSubContent.svelte.d.ts +9 -5
  196. package/dist/components/menu/MenuSubTrigger.svelte +9 -6
  197. package/dist/components/menu/MenuSubTrigger.svelte.d.ts +11 -6
  198. package/dist/components/menu/context-menu.d.ts +3 -1
  199. package/dist/components/menu/context-menu.js +2 -1
  200. package/dist/components/menu/index.d.ts +6 -5
  201. package/dist/components/menu/index.js +9 -8
  202. package/dist/components/message/MessageAction.svelte +7 -7
  203. package/dist/components/message/MessageAction.svelte.d.ts +7 -7
  204. package/dist/components/message/MessageActions.svelte +4 -4
  205. package/dist/components/message/MessageActions.svelte.d.ts +4 -4
  206. package/dist/components/message/MessageContent.svelte +3 -3
  207. package/dist/components/message/MessageContent.svelte.d.ts +3 -3
  208. package/dist/components/message/MessageCopy.svelte +14 -17
  209. package/dist/components/message/MessageCopy.svelte.d.ts +7 -7
  210. package/dist/components/message/MessageHeader.svelte +3 -3
  211. package/dist/components/message/MessageHeader.svelte.d.ts +3 -3
  212. package/dist/components/message/MessagePending.svelte +2 -2
  213. package/dist/components/message/MessagePending.svelte.d.ts +2 -2
  214. package/dist/components/message/MessageRoot.svelte +5 -5
  215. package/dist/components/message/MessageRoot.svelte.d.ts +5 -5
  216. package/dist/components/message/MessageTime.svelte +3 -3
  217. package/dist/components/message/MessageTime.svelte.d.ts +3 -3
  218. package/dist/components/notice/Notice.svelte +45 -9
  219. package/dist/components/notice/Notice.svelte.d.ts +13 -8
  220. package/dist/components/plan/Plan.svelte +7 -14
  221. package/dist/components/plan/Plan.svelte.d.ts +5 -5
  222. package/dist/components/popover/PopoverContent.svelte +7 -4
  223. package/dist/components/popover/PopoverContent.svelte.d.ts +9 -5
  224. package/dist/components/popover/index.d.ts +4 -3
  225. package/dist/components/popover/index.js +4 -3
  226. package/dist/components/progress/Progress.svelte +3 -3
  227. package/dist/components/progress/Progress.svelte.d.ts +3 -3
  228. package/dist/components/questionnaire/Questionnaire.svelte +17 -11
  229. package/dist/components/questionnaire/Questionnaire.svelte.d.ts +11 -11
  230. package/dist/components/queued-message/QueuedMessage.svelte +10 -10
  231. package/dist/components/queued-message/QueuedMessage.svelte.d.ts +10 -10
  232. package/dist/components/rail/RailItem.svelte +15 -22
  233. package/dist/components/rail/RailItem.svelte.d.ts +9 -9
  234. package/dist/components/rail/RailRoot.svelte +2 -2
  235. package/dist/components/rail/RailRoot.svelte.d.ts +2 -2
  236. package/dist/components/reasoning/ReasoningContent.svelte +2 -2
  237. package/dist/components/reasoning/ReasoningContent.svelte.d.ts +2 -2
  238. package/dist/components/reasoning/ReasoningRoot.svelte +6 -6
  239. package/dist/components/reasoning/ReasoningRoot.svelte.d.ts +6 -6
  240. package/dist/components/reasoning/ReasoningTrigger.svelte +3 -3
  241. package/dist/components/reasoning/ReasoningTrigger.svelte.d.ts +3 -3
  242. package/dist/components/resize-handle/ResizeHandle.svelte +10 -10
  243. package/dist/components/resize-handle/ResizeHandle.svelte.d.ts +10 -10
  244. package/dist/components/reveal/Reveal.svelte +16 -10
  245. package/dist/components/reveal/Reveal.svelte.d.ts +4 -4
  246. package/dist/components/reveal/revealed.js +13 -9
  247. package/dist/components/rolling-text/RollingText.svelte +3 -3
  248. package/dist/components/rolling-text/RollingText.svelte.d.ts +3 -3
  249. package/dist/components/search-button/SearchButton.svelte +92 -0
  250. package/dist/components/search-button/SearchButton.svelte.d.ts +13 -0
  251. package/dist/components/segmented/SegmentedControl.svelte +71 -24
  252. package/dist/components/segmented/SegmentedControl.svelte.d.ts +14 -5
  253. package/dist/components/select/Select.svelte +39 -14
  254. package/dist/components/select/Select.svelte.d.ts +21 -13
  255. package/dist/components/separator/Separator.svelte +3 -3
  256. package/dist/components/separator/Separator.svelte.d.ts +3 -3
  257. package/dist/components/settings-group/SettingsGroup.svelte +118 -0
  258. package/dist/components/settings-group/SettingsGroup.svelte.d.ts +19 -0
  259. package/dist/components/settings-group/context.d.ts +7 -0
  260. package/dist/components/settings-group/context.js +9 -0
  261. package/dist/components/settings-row/SettingsRow.svelte +184 -56
  262. package/dist/components/settings-row/SettingsRow.svelte.d.ts +39 -14
  263. package/dist/components/sheet/SheetContent.svelte +31 -11
  264. package/dist/components/sheet/SheetContent.svelte.d.ts +33 -9
  265. package/dist/components/sheet/index.d.ts +5 -4
  266. package/dist/components/sheet/index.js +4 -3
  267. package/dist/components/sheet/styles.d.ts +6 -0
  268. package/dist/components/sheet/styles.js +2 -0
  269. package/dist/components/shimmer/Shimmer.svelte +3 -3
  270. package/dist/components/shimmer/Shimmer.svelte.d.ts +3 -3
  271. package/dist/components/sidebar/SidebarContent.svelte +3 -3
  272. package/dist/components/sidebar/SidebarContent.svelte.d.ts +3 -3
  273. package/dist/components/sidebar/SidebarFolder.svelte +13 -8
  274. package/dist/components/sidebar/SidebarFolder.svelte.d.ts +5 -5
  275. package/dist/components/sidebar/SidebarFooter.svelte +2 -2
  276. package/dist/components/sidebar/SidebarFooter.svelte.d.ts +2 -2
  277. package/dist/components/sidebar/SidebarGroup.svelte +6 -6
  278. package/dist/components/sidebar/SidebarGroup.svelte.d.ts +6 -6
  279. package/dist/components/sidebar/SidebarHeader.svelte +3 -3
  280. package/dist/components/sidebar/SidebarHeader.svelte.d.ts +3 -3
  281. package/dist/components/sidebar/SidebarItem.svelte +39 -14
  282. package/dist/components/sidebar/SidebarItem.svelte.d.ts +15 -10
  283. package/dist/components/sidebar/SidebarRoot.svelte +4 -4
  284. package/dist/components/sidebar/SidebarRoot.svelte.d.ts +4 -4
  285. package/dist/components/sidebar/SidebarSwitcher.svelte +28 -0
  286. package/dist/components/sidebar/SidebarSwitcher.svelte.d.ts +11 -0
  287. package/dist/components/sidebar/depth.d.ts +8 -0
  288. package/dist/components/sidebar/depth.js +14 -0
  289. package/dist/components/sidebar/index.d.ts +3 -1
  290. package/dist/components/sidebar/index.js +2 -1
  291. package/dist/components/skeleton/Skeleton.svelte +5 -5
  292. package/dist/components/skeleton/Skeleton.svelte.d.ts +5 -5
  293. package/dist/components/slider/Slider.svelte +13 -13
  294. package/dist/components/slider/Slider.svelte.d.ts +13 -13
  295. package/dist/components/spinner/Spinner.svelte +4 -3
  296. package/dist/components/spinner/Spinner.svelte.d.ts +3 -3
  297. package/dist/components/stack/Stack.svelte +19 -8
  298. package/dist/components/stack/Stack.svelte.d.ts +8 -8
  299. package/dist/components/status-indicator/StatusIndicator.svelte +5 -4
  300. package/dist/components/status-indicator/StatusIndicator.svelte.d.ts +4 -4
  301. package/dist/components/suggestions/SuggestionsItem.svelte +3 -3
  302. package/dist/components/suggestions/SuggestionsItem.svelte.d.ts +3 -3
  303. package/dist/components/suggestions/SuggestionsRoot.svelte +5 -5
  304. package/dist/components/suggestions/SuggestionsRoot.svelte.d.ts +5 -5
  305. package/dist/components/switch/Switch.svelte +18 -7
  306. package/dist/components/switch/Switch.svelte.d.ts +8 -6
  307. package/dist/components/tab-strip/TabStrip.svelte +106 -25
  308. package/dist/components/tab-strip/TabStrip.svelte.d.ts +9 -9
  309. package/dist/components/tabs/Tabs.svelte +72 -26
  310. package/dist/components/tabs/Tabs.svelte.d.ts +13 -7
  311. package/dist/components/text/Text.svelte +35 -11
  312. package/dist/components/text/Text.svelte.d.ts +12 -10
  313. package/dist/components/textarea/Textarea.svelte +5 -5
  314. package/dist/components/textarea/Textarea.svelte.d.ts +5 -5
  315. package/dist/components/theme/Theme.svelte +4 -4
  316. package/dist/components/theme/Theme.svelte.d.ts +4 -4
  317. package/dist/components/toast/Toaster.svelte +34 -27
  318. package/dist/components/toast/Toaster.svelte.d.ts +2 -2
  319. package/dist/components/toast/toasts.svelte.d.ts +52 -15
  320. package/dist/components/toast/toasts.svelte.js +45 -20
  321. package/dist/components/toggle/Toggle.svelte +11 -8
  322. package/dist/components/toggle/Toggle.svelte.d.ts +15 -7
  323. package/dist/components/toggle-group/ToggleGroupItem.svelte +9 -6
  324. package/dist/components/toggle-group/ToggleGroupItem.svelte.d.ts +12 -6
  325. package/dist/components/toggle-group/ToggleGroupRoot.svelte +17 -14
  326. package/dist/components/toggle-group/ToggleGroupRoot.svelte.d.ts +13 -12
  327. package/dist/components/tool/ToolContent.svelte +2 -2
  328. package/dist/components/tool/ToolContent.svelte.d.ts +2 -2
  329. package/dist/components/tool/ToolInput.svelte +3 -3
  330. package/dist/components/tool/ToolInput.svelte.d.ts +3 -3
  331. package/dist/components/tool/ToolOutput.svelte +4 -4
  332. package/dist/components/tool/ToolOutput.svelte.d.ts +4 -4
  333. package/dist/components/tool/ToolRoot.svelte +7 -7
  334. package/dist/components/tool/ToolRoot.svelte.d.ts +7 -7
  335. package/dist/components/tool/ToolSection.svelte +4 -4
  336. package/dist/components/tool/ToolSection.svelte.d.ts +4 -4
  337. package/dist/components/tool/ToolTrigger.svelte +4 -4
  338. package/dist/components/tool/ToolTrigger.svelte.d.ts +4 -4
  339. package/dist/components/tooltip/TooltipContent.svelte +9 -6
  340. package/dist/components/tooltip/TooltipContent.svelte.d.ts +12 -6
  341. package/dist/components/tooltip/TooltipRoot.svelte +7 -4
  342. package/dist/components/tooltip/TooltipRoot.svelte.d.ts +8 -4
  343. package/dist/components/tooltip/TooltipTrigger.svelte +2 -1
  344. package/dist/components/tooltip/TooltipTrigger.svelte.d.ts +3 -2
  345. package/dist/components/tooltip/index.d.ts +2 -1
  346. package/dist/components/tooltip/index.js +2 -1
  347. package/dist/components/work-fold/WorkFold.svelte +4 -4
  348. package/dist/components/work-fold/WorkFold.svelte.d.ts +4 -4
  349. package/dist/index.d.ts +15 -5
  350. package/dist/index.js +8 -1
  351. package/dist/internal/Chevron.svelte +1 -1
  352. package/dist/internal/Chevron.svelte.d.ts +1 -1
  353. package/dist/internal/Code.svelte +6 -1
  354. package/dist/internal/Code.svelte.d.ts +3 -3
  355. package/dist/internal/Collapse.svelte +4 -4
  356. package/dist/internal/Collapse.svelte.d.ts +4 -4
  357. package/dist/internal/Glyph.svelte +4 -2
  358. package/dist/internal/Glyph.svelte.d.ts +3 -2
  359. package/dist/internal/Tile.svelte +5 -5
  360. package/dist/internal/Tile.svelte.d.ts +5 -5
  361. package/dist/internal/complete.d.ts +8 -0
  362. package/dist/internal/complete.js +1 -0
  363. package/dist/internal/icon.d.ts +9 -0
  364. package/dist/internal/icon.js +1 -0
  365. package/dist/internal/icons.css +14 -0
  366. package/dist/internal/json.d.ts +1 -1
  367. package/dist/internal/layer.d.ts +3 -1
  368. package/dist/internal/layer.js +7 -2
  369. package/dist/internal/layout.d.ts +1 -1
  370. package/dist/internal/layout.js +6 -0
  371. package/dist/internal/loose.d.ts +22 -0
  372. package/dist/internal/loose.js +4 -0
  373. package/dist/internal/markers.stylex.d.ts +4 -0
  374. package/dist/internal/markers.stylex.js +2 -0
  375. package/dist/internal/responsive.d.ts +1 -1
  376. package/dist/internal/roving.d.ts +1 -1
  377. package/dist/internal/sx.d.ts +4 -4
  378. package/dist/internal/tooltip-trigger.d.ts +9 -0
  379. package/dist/internal/tooltip-trigger.js +19 -0
  380. package/dist/markdown/ast.d.ts +6 -6
  381. package/dist/markdown/blocks.d.ts +6 -5
  382. package/dist/markdown/file-paths.d.ts +3 -3
  383. package/dist/markdown/files.d.ts +2 -2
  384. package/dist/markdown/highlight.d.ts +2 -2
  385. package/dist/markdown/html.d.ts +3 -12
  386. package/dist/markdown/images.d.ts +1 -1
  387. package/dist/markdown/inlines.d.ts +2 -2
  388. package/dist/markdown/parse.d.ts +3 -3
  389. package/dist/markdown/plugin.d.ts +21 -20
  390. package/dist/markdown/sanitize.d.ts +1 -1
  391. package/dist/markers.stylex.d.ts +13 -0
  392. package/dist/markers.stylex.js +11 -0
  393. package/dist/preset.d.ts +5 -5
  394. package/dist/preset.js +6 -6
  395. package/dist/tokens.stylex.d.ts +2 -0
  396. package/dist/tokens.stylex.js +10 -4
  397. package/dist/typography.d.ts +7 -0
  398. package/dist/typography.js +8 -0
  399. package/dist/visually-hidden.d.ts +18 -0
  400. package/dist/visually-hidden.js +21 -0
  401. package/dist/vite.d.ts +2 -2
  402. package/package.json +6 -2
  403. package/skills/building-ui/SKILL.md +162 -19
  404. package/skills/building-ui/references/components.md +39 -35
  405. package/skills/markdown/SKILL.md +1 -1
  406. package/skills/setup/SKILL.md +9 -1
  407. package/skills/styling/SKILL.md +58 -9
  408. package/skills/theming/SKILL.md +95 -2
@@ -4,6 +4,7 @@ import { space } from '../tokens.stylex.js';
4
4
  const gapFixed = stylex.create({
5
5
  0: { gap: 0 },
6
6
  1: { gap: space.x1 },
7
+ 1.5: { gap: space.x1_5 },
7
8
  2: { gap: space.x2 },
8
9
  3: { gap: space.x3 },
9
10
  4: { gap: space.x4 },
@@ -33,6 +34,7 @@ const gapChain = stylex.create({
33
34
  const gapDefault = stylex.create({
34
35
  0: { '--narvi-gap': '0px' },
35
36
  1: { '--narvi-gap': space.x1 },
37
+ 1.5: { '--narvi-gap': space.x1_5 },
36
38
  2: { '--narvi-gap': space.x2 },
37
39
  3: { '--narvi-gap': space.x3 },
38
40
  4: { '--narvi-gap': space.x4 },
@@ -46,6 +48,7 @@ const gapDefault = stylex.create({
46
48
  const gapSm = stylex.create({
47
49
  0: { '--narvi-gap-sm': '0px' },
48
50
  1: { '--narvi-gap-sm': space.x1 },
51
+ 1.5: { '--narvi-gap-sm': space.x1_5 },
49
52
  2: { '--narvi-gap-sm': space.x2 },
50
53
  3: { '--narvi-gap-sm': space.x3 },
51
54
  4: { '--narvi-gap-sm': space.x4 },
@@ -59,6 +62,7 @@ const gapSm = stylex.create({
59
62
  const gapMd = stylex.create({
60
63
  0: { '--narvi-gap-md': '0px' },
61
64
  1: { '--narvi-gap-md': space.x1 },
65
+ 1.5: { '--narvi-gap-md': space.x1_5 },
62
66
  2: { '--narvi-gap-md': space.x2 },
63
67
  3: { '--narvi-gap-md': space.x3 },
64
68
  4: { '--narvi-gap-md': space.x4 },
@@ -72,6 +76,7 @@ const gapMd = stylex.create({
72
76
  const gapLg = stylex.create({
73
77
  0: { '--narvi-gap-lg': '0px' },
74
78
  1: { '--narvi-gap-lg': space.x1 },
79
+ 1.5: { '--narvi-gap-lg': space.x1_5 },
75
80
  2: { '--narvi-gap-lg': space.x2 },
76
81
  3: { '--narvi-gap-lg': space.x3 },
77
82
  4: { '--narvi-gap-lg': space.x4 },
@@ -85,6 +90,7 @@ const gapLg = stylex.create({
85
90
  const gapXl = stylex.create({
86
91
  0: { '--narvi-gap-xl': '0px' },
87
92
  1: { '--narvi-gap-xl': space.x1 },
93
+ 1.5: { '--narvi-gap-xl': space.x1_5 },
88
94
  2: { '--narvi-gap-xl': space.x2 },
89
95
  3: { '--narvi-gap-xl': space.x3 },
90
96
  4: { '--narvi-gap-xl': space.x4 },
@@ -0,0 +1,22 @@
1
+ /**
2
+ * bits-ui leaves `| undefined` off some optional props (`side?: Side`), so an app that
3
+ * type-checks with `exactOptionalPropertyTypes` cannot pass `side={maybe}`. Narvi's props that
4
+ * are built on bits-ui's go through `Loose`, and bits-ui's own parts that Narvi passes on as
5
+ * they are go through `loose`. `scripts/exact` holds every exported component to it.
6
+ */
7
+ import type { Component } from 'svelte';
8
+ type OptionalKeys<T> = {
9
+ [K in keyof T]-?: Record<never, never> extends Pick<T, K> ? K : never;
10
+ }[keyof T];
11
+ /** `T`, with `undefined` allowed on every optional property. */
12
+ export type Loose<T> = {
13
+ [K in keyof T]: K extends OptionalKeys<T> ? T[K] | undefined : T[K];
14
+ };
15
+ /** A component of bits-ui's, typed to take `undefined` for each optional prop. */
16
+ export declare function loose<Props extends Record<string, any>, Exports extends Record<string, any>, Bindings extends keyof Props | ''>(component: Component<Props, Exports, Bindings>): Component<Loose<Props>, Exports, Bindings>;
17
+ /**
18
+ * The type `loose` gives a component, written out. Annotate with it where TypeScript cannot
19
+ * name the inferred one (TS2883): `const Root: Loosened<typeof DropdownMenu.Root> = …`.
20
+ */
21
+ export type Loosened<C> = C extends Component<infer Props extends Record<string, any>, infer Exports, infer Bindings> ? Component<Loose<Props>, Exports, Bindings extends keyof Loose<Props> | '' ? Bindings : never> : never;
22
+ export {};
@@ -0,0 +1,4 @@
1
+ /** A component of bits-ui's, typed to take `undefined` for each optional prop. */
2
+ export function loose(component) {
3
+ return component;
4
+ }
@@ -20,3 +20,7 @@ export declare const sidebarItemMarker: Readonly<{
20
20
  export declare const tabStripTabMarker: Readonly<{
21
21
  readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
22
22
  }>;
23
+ /** A SegmentedControl's radio, so the label after it follows its state. */
24
+ export declare const segmentedInputMarker: Readonly<{
25
+ readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
26
+ }>;
@@ -12,3 +12,5 @@ export const markdownTableMarker = stylex.defineMarker();
12
12
  export const sidebarItemMarker = stylex.defineMarker();
13
13
  /** A tab of a TabStrip: its close button shows while the pointer or focus is in the tab. */
14
14
  export const tabStripTabMarker = stylex.defineMarker();
15
+ /** A SegmentedControl's radio, so the label after it follows its state. */
16
+ export const segmentedInputMarker = stylex.defineMarker();
@@ -21,7 +21,7 @@ export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl';
21
21
  export declare const breakpoints: ReadonlyArray<Breakpoint>;
22
22
  /** A value, or values by breakpoint. Each applies from its breakpoint up, until a larger one. */
23
23
  export type Responsive<T> = T | Readonly<{
24
- default?: T;
24
+ default?: T | undefined;
25
25
  } & {
26
26
  [B in Breakpoint]?: T;
27
27
  }>;
@@ -12,6 +12,6 @@ export type RovingOptions = {
12
12
  /** Which elements inside are the items. */
13
13
  selector: string;
14
14
  /** Which arrow keys move: up and down, or left and right. */
15
- orientation?: 'vertical' | 'horizontal';
15
+ orientation?: 'vertical' | 'horizontal' | undefined;
16
16
  };
17
17
  export declare function roving({ selector, orientation }: RovingOptions): Attachment<HTMLElement>;
@@ -28,8 +28,8 @@ type StyleArg = Sx | Readonly<Record<string, unknown>> | ReadonlyArray<StyleArg>
28
28
  * Later styles win, so pass the consumer's `sx` last.
29
29
  */
30
30
  export declare function attrs(styles: ReadonlyArray<StyleArg>, className?: ClassValue | null): {
31
- class?: ClassValue;
32
- style?: string;
31
+ class?: ClassValue | undefined;
32
+ style?: string | undefined;
33
33
  };
34
34
  /**
35
35
  * Styles as attributes to spread onto an element or a component that takes `class` and
@@ -37,8 +37,8 @@ export declare function attrs(styles: ReadonlyArray<StyleArg>, className?: Class
37
37
  * it takes markers, and later styles win.
38
38
  */
39
39
  export declare function sx(...styles: ReadonlyArray<Sx>): {
40
- class?: string;
41
- style?: string;
40
+ class?: string | undefined;
41
+ style?: string | undefined;
42
42
  };
43
43
  /**
44
44
  * Styles as one class string, for a prop that takes only a class, such as `iconClass`, or
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A bits-ui tooltip trigger's props, for an element in a group that moves its own focus (the
3
+ * radios of a SegmentedControl, the tabs of Tabs). Left off: the trigger's `tabindex`, which
4
+ * would make every item a tab stop, and its `disabled`. A click the keyboard makes (`detail`
5
+ * 0, as when the arrow keys choose a radio) no longer shuts the tooltip, so it shows as the
6
+ * keys reach an item. A spread keeps the attachment bits-ui finds the trigger by, which is
7
+ * keyed by a symbol.
8
+ */
9
+ export declare function groupTrigger(props: Record<string, unknown>): Record<string, unknown>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * A bits-ui tooltip trigger's props, for an element in a group that moves its own focus (the
3
+ * radios of a SegmentedControl, the tabs of Tabs). Left off: the trigger's `tabindex`, which
4
+ * would make every item a tab stop, and its `disabled`. A click the keyboard makes (`detail`
5
+ * 0, as when the arrow keys choose a radio) no longer shuts the tooltip, so it shows as the
6
+ * keys reach an item. A spread keeps the attachment bits-ui finds the trigger by, which is
7
+ * keyed by a symbol.
8
+ */
9
+ export function groupTrigger(props) {
10
+ const rest = { ...props };
11
+ delete rest.tabindex;
12
+ delete rest.disabled;
13
+ const click = rest.onclick;
14
+ rest.onclick = (event) => {
15
+ if (event.detail !== 0)
16
+ click?.(event);
17
+ };
18
+ return rest;
19
+ }
@@ -21,7 +21,7 @@ export type Document = Point & {
21
21
  * The YAML front matter a file starts with, between its `---` lines, as written. Read only
22
22
  * with the `frontmatter` option, and then left out of `children`.
23
23
  */
24
- frontmatter?: string;
24
+ frontmatter?: string | undefined;
25
25
  };
26
26
  export type Paragraph = Point & {
27
27
  type: 'paragraph';
@@ -44,7 +44,7 @@ export type Blockquote = Point & {
44
44
  type: 'blockquote';
45
45
  id: number;
46
46
  /** Set when the quote is a GitHub alert; its `[!NOTE]` line is then left out of the children. */
47
- alert?: AlertKind;
47
+ alert?: AlertKind | undefined;
48
48
  children: Block[];
49
49
  };
50
50
  export type List = Point & {
@@ -167,7 +167,7 @@ export type Link = {
167
167
  * A link whose address is still being written, in a tidied preview: `[the docs](https://na`.
168
168
  * It has its words and no address yet. Drawn as a link that goes nowhere.
169
169
  */
170
- pending?: boolean;
170
+ pending?: boolean | undefined;
171
171
  };
172
172
  export type Image = {
173
173
  type: 'image';
@@ -176,13 +176,13 @@ export type Image = {
176
176
  /** The alt text, as plain text. */
177
177
  alt: string;
178
178
  /** The size an HTML `<img>` asked for. A Markdown image has none. */
179
- width?: string;
180
- height?: string;
179
+ width?: string | undefined;
180
+ height?: string | undefined;
181
181
  /**
182
182
  * Whether it is a video: an HTML `<video>`, or an image a transform marked as one, such
183
183
  * as a link to an `.mp4`. It is drawn with controls, and nothing of it loads until it is played.
184
184
  */
185
- video?: boolean;
185
+ video?: boolean | undefined;
186
186
  children: Inline[];
187
187
  };
188
188
  /** A reference to a footnote. Its number comes from the document's `footnotes`, in order. */
@@ -14,6 +14,7 @@
14
14
  * that use it. Blocks remember which labels they looked up and missed, and only those are
15
15
  * converted again when such a definition arrives.
16
16
  */
17
+ import type { Complete } from '../internal/complete.js';
17
18
  import type { Block, Definition, Document, FootnoteDefinition, TableRow } from './ast.js';
18
19
  type BlockType = 'document' | 'blockquote' | 'list' | 'item' | 'paragraph' | 'heading' | 'thematicBreak' | 'code' | 'html' | 'math' | 'table' | 'footnote';
19
20
  type ListData = {
@@ -30,7 +31,7 @@ type TableLine = {
30
31
  from: number;
31
32
  to: number;
32
33
  id: number;
33
- cache?: TableRow;
34
+ cache?: TableRow | undefined;
34
35
  };
35
36
  /** A block while it is parsed. Converted to the immutable `ast.ts` nodes for the outside. */
36
37
  declare class Node {
@@ -98,17 +99,17 @@ export declare function splitTableRow(text: string): string[];
98
99
  /** What the parser needs from the rest of the library to convert a block. */
99
100
  export type BlockOptions = {
100
101
  /** GFM extensions: tables, task lists, strikethrough, autolinks, footnotes. On by default. */
101
- gfm?: boolean;
102
+ gfm?: boolean | undefined;
102
103
  /**
103
104
  * Formulas: `$x$` and `\\(x\\)` in running text, `$$` and `\\[` for display. Off by default,
104
105
  * since it changes what a dollar sign and an escaped bracket mean.
105
106
  */
106
- math?: boolean;
107
+ math?: boolean | undefined;
107
108
  /**
108
109
  * Whether `~text~` strikes through, as `~~text~~` does. GitHub allows it, but in a reply
109
110
  * a tilde far more often means "about", as in "~5 minutes", so it is off by default.
110
111
  */
111
- singleTilde?: boolean;
112
+ singleTilde?: boolean | undefined;
112
113
  };
113
114
  export declare class BlockParser {
114
115
  doc: Node;
@@ -147,7 +148,7 @@ export declare class BlockParser {
147
148
  missedBy: Map<string, Set<Node>>;
148
149
  ids: number;
149
150
  ephemeral: boolean;
150
- options: Required<BlockOptions>;
151
+ options: Complete<BlockOptions>;
151
152
  constructor(options?: BlockOptions);
152
153
  nextId(): number;
153
154
  lineStartOf(line: number): number;
@@ -4,9 +4,9 @@
4
4
  /** A file, and where in it. */
5
5
  export type FileReference = {
6
6
  path: string;
7
- line?: number;
8
- column?: number;
9
- endLine?: number;
7
+ line?: number | undefined;
8
+ column?: number | undefined;
9
+ endLine?: number | undefined;
10
10
  };
11
11
  /** Splits `src/app.ts:42:7` or `src/app.ts#L42-L50` into the path and the place in it. */
12
12
  export declare function splitPosition(text: string): FileReference;
@@ -8,9 +8,9 @@ export type FilesOptions = {
8
8
  * asked, so a bare `package.json` can be found; without it, only text that looks like a
9
9
  * path becomes a chip.
10
10
  */
11
- resolve?: (path: string) => string | null | undefined;
11
+ resolve?: ((path: string) => string | null | undefined) | undefined;
12
12
  /** Opens a file when its chip is activated. Without it, chips only show. */
13
- open?: (file: FileReference, event: MouseEvent) => void;
13
+ open?: ((file: FileReference, event: MouseEvent) => void) | undefined;
14
14
  };
15
15
  /** The first-party file plugin. */
16
16
  export declare function files(options?: FilesOptions): MarkdownPlugin;
@@ -19,9 +19,9 @@ export type HighlightOptions = {
19
19
  themes?: {
20
20
  light: Theme;
21
21
  dark: Theme;
22
- };
22
+ } | undefined;
23
23
  /** Lines at or above this length are shown plain. Default 2000. */
24
- maxLineLength?: number;
24
+ maxLineLength?: number | undefined;
25
25
  };
26
26
  /**
27
27
  * The first-party highlighter plugin. A code block in a language Highlights does not know is
@@ -1,23 +1,14 @@
1
- /**
2
- * Writes a document as HTML, in the form the CommonMark and GFM spec tests expect.
3
- *
4
- * The Svelte renderer is what apps use. This one exists for the spec tests, for copying a
5
- * reply as HTML, and for places that need a string. By default raw HTML passes through as
6
- * written and a link keeps whatever address it was given, `javascript:` included, as the
7
- * specs have it. So use it on trusted text only, or with `rawHtml: false` and
8
- * `safeLinks: true` together.
9
- */
10
1
  import type { Document } from './ast.js';
11
2
  export type HtmlOptions = {
12
3
  /** Writes raw HTML as text instead of passing it through. Default `true` (pass through). */
13
- rawHtml?: boolean;
4
+ rawHtml?: boolean | undefined;
14
5
  /** Escapes the tags GFM's tag filter disallows, such as `<script>`. Default `true`. */
15
- tagFilter?: boolean;
6
+ tagFilter?: boolean | undefined;
16
7
  /**
17
8
  * Puts links and images through the default policy: a link whose address it refuses is
18
9
  * written as its text, and an image as its alt text. Default `false`.
19
10
  */
20
- safeLinks?: boolean;
11
+ safeLinks?: boolean | undefined;
21
12
  };
22
13
  export declare function escapeHtml(s: string): string;
23
14
  export declare function toHtml(doc: Document, options?: HtmlOptions): string;
@@ -4,7 +4,7 @@ export type ImagesOptions = {
4
4
  * Whether an image loads without asking. It is given the address as written, read as a
5
5
  * browser reads it. The default allows none.
6
6
  */
7
- allow?: (url: string) => boolean;
7
+ allow?: ((url: string) => boolean) | undefined;
8
8
  };
9
9
  /**
10
10
  * For `allow`: whether an address is on the page's own site: relative to it, or an `http(s)` address with
@@ -15,9 +15,9 @@ export type InlineContext = {
15
15
  footnotes: ReadonlySet<string>;
16
16
  gfm: boolean;
17
17
  /** Formulas: `$x$`, `$$x$$`, `\\(x\\)` and `\\[x\\]`. */
18
- math?: boolean;
18
+ math?: boolean | undefined;
19
19
  /** Whether one tilde on each side strikes text through, as well as two. */
20
- singleTilde?: boolean;
20
+ singleTilde?: boolean | undefined;
21
21
  };
22
22
  export type InlineResult = {
23
23
  children: Inline[];
@@ -10,7 +10,7 @@ export type ParseOptions = BlockOptions & {
10
10
  * left out of what is drawn. Off by default: a reply that starts with `---` starts with a
11
11
  * rule. Turn it on for files.
12
12
  */
13
- frontmatter?: boolean;
13
+ frontmatter?: boolean | undefined;
14
14
  };
15
15
  /**
16
16
  * A document that grows as text arrives. Each complete line is read once; `snapshot()` shows
@@ -69,8 +69,8 @@ export declare class MarkdownStream {
69
69
  * is the text it was written as.
70
70
  */
71
71
  snapshot({ tidy, final }?: {
72
- tidy?: boolean;
73
- final?: boolean;
72
+ tidy?: boolean | undefined;
73
+ final?: boolean | undefined;
74
74
  }): Document;
75
75
  /** A snapshot with all that the one before it said too kept as the same objects. */
76
76
  private shared;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * What a plugin can add to Narvi's Markdown, and the default policy for links and images.
3
3
  */
4
+ import type { Complete } from '../internal/complete.js';
4
5
  import type { Component } from 'svelte';
5
6
  import type { Block, Document, Image, Inline, Link } from './ast.js';
6
7
  /**
@@ -10,10 +11,10 @@ import type { Block, Document, Image, Inline, Link } from './ast.js';
10
11
  */
11
12
  export type HighlightToken = {
12
13
  text: string;
13
- kind?: string;
14
- color?: string;
15
- italic?: boolean;
16
- bold?: boolean;
14
+ kind?: string | undefined;
15
+ color?: string | undefined;
16
+ italic?: boolean | undefined;
17
+ bold?: boolean | undefined;
17
18
  };
18
19
  /** Turns code into lines of tokens, or returns null to show it plain. */
19
20
  export type Highlighter = (code: string, lang: string | null) => HighlightToken[][] | null;
@@ -33,7 +34,7 @@ export type HighlightStream = {
33
34
  export type NodeProps<N> = {
34
35
  node: N;
35
36
  /** Renders the node's children as Narvi would. */
36
- children?: import('svelte').Snippet;
37
+ children?: import('svelte').Snippet | undefined;
37
38
  };
38
39
  /** A component for a node, with extra props it is given beside `node` and `children`. */
39
40
  export type PluginComponent = {
@@ -56,66 +57,66 @@ export type LinkPolicy = {
56
57
  * `//host/…`, which starts with `/` and leaves the site: test `readUrl(url).kind`, not the
57
58
  * start of the string. A `javascript:` address is refused whatever this returns.
58
59
  */
59
- href?: (url: string, node: Link) => string | null;
60
+ href?: ((url: string, node: Link) => string | null) | undefined;
60
61
  /**
61
62
  * The address to load an image from, or null to show its alt text instead. The default
62
63
  * allows `http:`, `https:`, and addresses without a scheme. A remote image is requested as
63
64
  * soon as it is shown, so text written by a model can send data out through its address:
64
65
  * an app that renders such text should decide here which hosts it loads.
65
66
  */
66
- image?: (url: string, node: Image) => string | null;
67
+ image?: ((url: string, node: Image) => string | null) | undefined;
67
68
  /** Whether a link opens in a new tab. The default: links to another origin do. */
68
- external?: (href: string) => boolean;
69
+ external?: ((href: string) => boolean) | undefined;
69
70
  /**
70
71
  * Called when a link is clicked, before the browser follows it. Call
71
72
  * `event.preventDefault()` to open it yourself: in a side panel, an in-app browser, or
72
73
  * the app's own router. Modifier keys are on the event.
73
74
  */
74
- open?: (href: string, event: MouseEvent) => void;
75
+ open?: ((href: string, event: MouseEvent) => void) | undefined;
75
76
  };
76
77
  /** A policy with every decision filled in; `open` stays optional. */
77
- export type ResolvedLinkPolicy = Required<Omit<LinkPolicy, 'open'>> & Pick<LinkPolicy, 'open'>;
78
+ export type ResolvedLinkPolicy = Complete<Omit<LinkPolicy, 'open'>> & Pick<LinkPolicy, 'open'>;
78
79
  export type MarkdownPlugin = {
79
80
  name: string;
80
81
  /** Syntax to read beyond CommonMark and GFM. */
81
82
  syntax?: {
82
83
  /** Formulas: `$x$`, `$$x$$`, `\\(x\\)` and `\\[x\\]`, as `inlineMath` and `math` nodes. */
83
- math?: boolean;
84
- };
84
+ math?: boolean | undefined;
85
+ } | undefined;
85
86
  /**
86
87
  * Rewrites a block after it is parsed: for example, turning `@thread:12` in its text into
87
88
  * a link. It is called for the blocks that hold text or code (paragraphs, headings, tables,
88
89
  * code blocks, wherever they are nested), and never for the lists and quotes around them.
89
90
  * A finished block is transformed once; return the same block to change nothing.
90
91
  */
91
- transform?: (block: Block, document: Document) => Block;
92
+ transform?: ((block: Block, document: Document) => Block) | undefined;
92
93
  /**
93
94
  * Components that replace Narvi's for node types, and that draw the `custom` nodes a
94
95
  * transform adds, by their `name`. Use `withProps` to hand one extra props.
95
96
  */
96
- components?: Record<string, Component<NodeProps<never>> | PluginComponent>;
97
+ components?: Record<string, Component<NodeProps<never>> | PluginComponent> | undefined;
97
98
  /**
98
99
  * Components that draw a fenced code block in a language, by its name in lower case:
99
100
  * `{ mermaid: Diagram }`. One takes over once the fence has closed; while the block is
100
101
  * still being written it shows as code.
101
102
  */
102
- languages?: Record<string, Component<NodeProps<never>> | PluginComponent>;
103
+ languages?: Record<string, Component<NodeProps<never>> | PluginComponent> | undefined;
103
104
  /** Colours code blocks. */
104
- highlight?: Highlighter;
105
+ highlight?: Highlighter | undefined;
105
106
  /**
106
107
  * Colours a code block while it streams. Returns null for a language it does not know.
107
108
  * Without it, a streaming block is highlighted once its fence closes.
108
109
  */
109
- highlightStream?: (lang: string | null) => HighlightStream | null;
110
+ highlightStream?: ((lang: string | null) => HighlightStream | null) | undefined;
110
111
  /** Decides links and images. Later plugins override earlier ones, one function at a time. */
111
- links?: LinkPolicy;
112
+ links?: LinkPolicy | undefined;
112
113
  /**
113
114
  * For `static`: how to write the nodes this plugin draws as markup, by the same names as
114
115
  * `components`. A finished block that holds one of these nodes can then be written as
115
116
  * markup too; without it, the block is built from parts as ever. It is used only while
116
117
  * this plugin's own component is the one that draws the node.
117
118
  */
118
- static?: Record<string, StaticPart<never>>;
119
+ static?: Record<string, StaticPart<never>> | undefined;
119
120
  };
120
121
  /** What a `static` writer is given to work with. */
121
122
  export type StaticTools = {
@@ -135,7 +136,7 @@ export type StaticPart<N> = {
135
136
  /** The node as markup, or null to have the plugin's component draw it. */
136
137
  html: (node: N, tools: StaticTools) => string | null;
137
138
  /** Called for a click, or a middle click, on an element that carries `tools.part`. */
138
- click?: (element: HTMLElement, event: MouseEvent) => void;
139
+ click?: ((element: HTMLElement, event: MouseEvent) => void) | undefined;
139
140
  };
140
141
  /**
141
142
  * An address as a browser will read it. A browser drops tabs and line endings from anywhere
@@ -73,6 +73,6 @@ export declare function groupInlineHtml(inlines: Inline[], policy: UrlPolicy): R
73
73
  * by the same component, and a plugin that decides which images load decides these too.
74
74
  */
75
75
  export declare function imageOf(element: {
76
- tag?: string;
76
+ tag?: string | undefined;
77
77
  attrs: Record<string, string>;
78
78
  }): Image;
@@ -0,0 +1,13 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ /**
3
+ * Markers for styles of your own that follow a Narvi part's state:
4
+ *
5
+ * [stylex.when.ancestor('[data-reveal=shown]', revealMarker)]: 1
6
+ *
7
+ * Each part has its own, so a hover group of yours, marked with `stylex.defaultMarker()`,
8
+ * never answers to a Narvi part around it.
9
+ */
10
+ /** On a Reveal, which marks itself `data-reveal="hidden"`, then `"shown"`. */
11
+ export declare const revealMarker: Readonly<{
12
+ readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
13
+ }>;
@@ -0,0 +1,11 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ /**
3
+ * Markers for styles of your own that follow a Narvi part's state:
4
+ *
5
+ * [stylex.when.ancestor('[data-reveal=shown]', revealMarker)]: 1
6
+ *
7
+ * Each part has its own, so a hover group of yours, marked with `stylex.defaultMarker()`,
8
+ * never answers to a Narvi part around it.
9
+ */
10
+ /** On a Reveal, which marks itself `data-reveal="hidden"`, then `"shown"`. */
11
+ export const revealMarker = stylex.defineMarker();
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;