@diegopluna/narvi 0.0.2 → 0.2.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 (313) hide show
  1. package/README.md +116 -44
  2. package/dist/base.css +96 -0
  3. package/dist/color.d.ts +1 -1
  4. package/dist/color.js +1 -1
  5. package/dist/components/activity/ActivityContent.svelte +3 -15
  6. package/dist/components/activity/ActivityStep.svelte +12 -12
  7. package/dist/components/activity/ActivityThought.svelte +4 -4
  8. package/dist/components/activity/ActivityTrigger.svelte +5 -6
  9. package/dist/components/app-shell/AppShellBar.svelte +89 -0
  10. package/dist/components/app-shell/AppShellBar.svelte.d.ts +20 -0
  11. package/dist/components/app-shell/AppShellHeader.svelte +17 -17
  12. package/dist/components/app-shell/AppShellHeader.svelte.d.ts +2 -2
  13. package/dist/components/app-shell/AppShellMain.svelte +4 -20
  14. package/dist/components/app-shell/AppShellPanel.svelte +21 -19
  15. package/dist/components/app-shell/AppShellPanes.svelte +58 -0
  16. package/dist/components/app-shell/AppShellPanes.svelte.d.ts +11 -0
  17. package/dist/components/app-shell/AppShellRail.svelte +85 -0
  18. package/dist/components/app-shell/AppShellRail.svelte.d.ts +11 -0
  19. package/dist/components/app-shell/AppShellRoot.svelte +50 -24
  20. package/dist/components/app-shell/AppShellRoot.svelte.d.ts +8 -6
  21. package/dist/components/app-shell/AppShellSheet.svelte +95 -0
  22. package/dist/components/app-shell/AppShellSheet.svelte.d.ts +17 -0
  23. package/dist/components/app-shell/AppShellSidebar.svelte +41 -65
  24. package/dist/components/app-shell/AppShellSidebar.svelte.d.ts +1 -5
  25. package/dist/components/app-shell/AppShellToggle.svelte +62 -23
  26. package/dist/components/app-shell/AppShellToggle.svelte.d.ts +2 -0
  27. package/dist/components/app-shell/context.d.ts +6 -0
  28. package/dist/components/app-shell/index.d.ts +9 -1
  29. package/dist/components/app-shell/index.js +5 -1
  30. package/dist/components/approval/Approval.svelte +99 -23
  31. package/dist/components/approval/Approval.svelte.d.ts +7 -0
  32. package/dist/components/avatar/AvatarFallback.svelte +1 -2
  33. package/dist/components/avatar/AvatarRoot.svelte +2 -2
  34. package/dist/components/badge/Badge.svelte +5 -5
  35. package/dist/components/button/Button.svelte +227 -51
  36. package/dist/components/button/Button.svelte.d.ts +38 -2
  37. package/dist/components/card/Card.svelte +19 -33
  38. package/dist/components/change-stats/ChangeStats.svelte +1 -2
  39. package/dist/components/changes-summary/ChangesSummary.svelte +14 -15
  40. package/dist/components/checkbox/Checkbox.svelte +31 -25
  41. package/dist/components/checkbox/Checkbox.svelte.d.ts +5 -0
  42. package/dist/components/code/Code.svelte +1 -2
  43. package/dist/components/collapsible/CollapsibleContent.svelte +38 -0
  44. package/dist/components/collapsible/CollapsibleContent.svelte.d.ts +11 -0
  45. package/dist/components/collapsible/CollapsibleRoot.svelte +44 -0
  46. package/dist/components/collapsible/CollapsibleRoot.svelte.d.ts +11 -0
  47. package/dist/components/collapsible/CollapsibleTrigger.svelte +83 -0
  48. package/dist/components/collapsible/CollapsibleTrigger.svelte.d.ts +13 -0
  49. package/dist/components/collapsible/context.d.ts +5 -0
  50. package/dist/components/collapsible/context.js +11 -0
  51. package/dist/components/collapsible/index.d.ts +7 -0
  52. package/dist/components/collapsible/index.js +4 -0
  53. package/dist/components/command/CommandItem.svelte +1 -1
  54. package/dist/components/command/styles.d.ts +3 -2
  55. package/dist/components/command/styles.js +15 -12
  56. package/dist/components/composer/ComposerAttachButton.svelte +1 -1
  57. package/dist/components/composer/ComposerAttachment.svelte +13 -18
  58. package/dist/components/composer/ComposerModelPicker.svelte +24 -28
  59. package/dist/components/composer/ComposerRoot.svelte +15 -13
  60. package/dist/components/composer/ComposerSubmit.svelte +12 -20
  61. package/dist/components/composer/ComposerTextarea.svelte +1 -1
  62. package/dist/components/composer/ComposerToggle.svelte +16 -18
  63. package/dist/components/composer/ComposerTray.svelte +78 -0
  64. package/dist/components/composer/ComposerTray.svelte.d.ts +15 -0
  65. package/dist/components/composer/index.d.ts +3 -1
  66. package/dist/components/composer/index.js +3 -2
  67. package/dist/components/conversation/ConversationContent.svelte +3 -2
  68. package/dist/components/conversation/ConversationEmpty.svelte +1 -1
  69. package/dist/components/conversation/ConversationScrollButton.svelte +9 -11
  70. package/dist/components/dialog/ConfirmDialog.svelte +1 -1
  71. package/dist/components/dialog/DialogContent.svelte +5 -1
  72. package/dist/components/dialog/styles.d.ts +2 -26
  73. package/dist/components/dialog/styles.js +12 -49
  74. package/dist/components/divider/Divider.svelte +3 -3
  75. package/dist/components/empty-state/EmptyState.svelte +4 -5
  76. package/dist/components/field/Field.svelte +4 -4
  77. package/dist/components/frame/Frame.svelte +6 -7
  78. package/dist/components/frame/Frame.svelte.d.ts +1 -1
  79. package/dist/components/grid/Grid.svelte +111 -0
  80. package/dist/components/grid/Grid.svelte.d.ts +27 -0
  81. package/dist/components/heading/Heading.svelte +2 -2
  82. package/dist/components/hover-card/HoverCardContent.svelte +50 -0
  83. package/dist/components/hover-card/HoverCardContent.svelte.d.ts +10 -0
  84. package/dist/components/hover-card/HoverCardRoot.svelte +22 -0
  85. package/dist/components/hover-card/HoverCardRoot.svelte.d.ts +5 -0
  86. package/dist/components/hover-card/index.d.ts +7 -0
  87. package/dist/components/hover-card/index.js +7 -0
  88. package/dist/components/kbd/Kbd.svelte +12 -7
  89. package/dist/components/link/Link.svelte +9 -7
  90. package/dist/components/link/Link.svelte.d.ts +4 -1
  91. package/dist/components/markdown/Markdown.svelte +714 -0
  92. package/dist/components/markdown/Markdown.svelte.d.ts +80 -0
  93. package/dist/components/markdown/MarkdownBlock.svelte +231 -0
  94. package/dist/components/markdown/MarkdownBlock.svelte.d.ts +11 -0
  95. package/dist/components/markdown/MarkdownBlocks.svelte +115 -0
  96. package/dist/components/markdown/MarkdownBlocks.svelte.d.ts +15 -0
  97. package/dist/components/markdown/MarkdownCode.svelte +583 -0
  98. package/dist/components/markdown/MarkdownCode.svelte.d.ts +23 -0
  99. package/dist/components/markdown/MarkdownDiagram.svelte +310 -0
  100. package/dist/components/markdown/MarkdownDiagram.svelte.d.ts +6 -0
  101. package/dist/components/markdown/MarkdownFile.svelte +134 -0
  102. package/dist/components/markdown/MarkdownFile.svelte.d.ts +19 -0
  103. package/dist/components/markdown/MarkdownFootnotes.svelte +61 -0
  104. package/dist/components/markdown/MarkdownFootnotes.svelte.d.ts +8 -0
  105. package/dist/components/markdown/MarkdownFresh.svelte +69 -0
  106. package/dist/components/markdown/MarkdownFresh.svelte.d.ts +6 -0
  107. package/dist/components/markdown/MarkdownHtml.svelte +72 -0
  108. package/dist/components/markdown/MarkdownHtml.svelte.d.ts +7 -0
  109. package/dist/components/markdown/MarkdownImage.svelte +150 -0
  110. package/dist/components/markdown/MarkdownImage.svelte.d.ts +8 -0
  111. package/dist/components/markdown/MarkdownInlines.svelte +225 -0
  112. package/dist/components/markdown/MarkdownInlines.svelte.d.ts +7 -0
  113. package/dist/components/markdown/MarkdownLink.svelte +120 -0
  114. package/dist/components/markdown/MarkdownLink.svelte.d.ts +25 -0
  115. package/dist/components/markdown/MarkdownMath.svelte +138 -0
  116. package/dist/components/markdown/MarkdownMath.svelte.d.ts +7 -0
  117. package/dist/components/markdown/MarkdownTable.svelte +265 -0
  118. package/dist/components/markdown/MarkdownTable.svelte.d.ts +17 -0
  119. package/dist/components/markdown/caret.d.ts +14 -0
  120. package/dist/components/markdown/caret.js +67 -0
  121. package/dist/components/markdown/context.d.ts +93 -0
  122. package/dist/components/markdown/context.js +128 -0
  123. package/dist/components/markdown/copy.d.ts +13 -0
  124. package/dist/components/markdown/copy.js +74 -0
  125. package/dist/components/markdown/hidden.d.ts +12 -0
  126. package/dist/components/markdown/hidden.js +31 -0
  127. package/dist/components/markdown/kept.d.ts +32 -0
  128. package/dist/components/markdown/kept.js +71 -0
  129. package/dist/components/markdown/labels.d.ts +46 -0
  130. package/dist/components/markdown/labels.js +35 -0
  131. package/dist/components/markdown/save.d.ts +11 -0
  132. package/dist/components/markdown/save.js +58 -0
  133. package/dist/components/markdown/scrollable.d.ts +24 -0
  134. package/dist/components/markdown/scrollable.js +152 -0
  135. package/dist/components/markdown/static.d.ts +37 -0
  136. package/dist/components/markdown/static.js +233 -0
  137. package/dist/components/markdown/styles.d.ts +328 -0
  138. package/dist/components/markdown/styles.js +302 -0
  139. package/dist/components/menu/MenuRadioItem.svelte +3 -3
  140. package/dist/components/menu/index.d.ts +23 -0
  141. package/dist/components/menu/index.js +3 -1
  142. package/dist/components/message/MessageAction.svelte +24 -5
  143. package/dist/components/message/MessageAction.svelte.d.ts +9 -0
  144. package/dist/components/message/MessageActions.svelte +2 -3
  145. package/dist/components/message/MessageContent.svelte +2 -3
  146. package/dist/components/message/MessageCopy.svelte +66 -8
  147. package/dist/components/message/MessageCopy.svelte.d.ts +17 -1
  148. package/dist/components/message/MessageHeader.svelte +3 -3
  149. package/dist/components/message/MessagePending.svelte +1 -1
  150. package/dist/components/message/MessageRoot.svelte +3 -4
  151. package/dist/components/message/MessageTime.svelte +3 -4
  152. package/dist/components/notice/Notice.svelte +14 -10
  153. package/dist/components/plan/Plan.svelte +25 -21
  154. package/dist/components/progress/Progress.svelte +34 -38
  155. package/dist/components/questionnaire/Questionnaire.svelte +19 -22
  156. package/dist/components/queued-message/QueuedMessage.svelte +14 -7
  157. package/dist/components/rail/RailItem.svelte +43 -40
  158. package/dist/components/rail/RailItem.svelte.d.ts +3 -1
  159. package/dist/components/rail/RailRoot.svelte +18 -4
  160. package/dist/components/rail/RailRoot.svelte.d.ts +1 -1
  161. package/dist/components/rail/RailSeparator.svelte +17 -0
  162. package/dist/components/rail/RailSeparator.svelte.d.ts +18 -0
  163. package/dist/components/rail/index.d.ts +2 -1
  164. package/dist/components/rail/index.js +2 -1
  165. package/dist/components/reasoning/ReasoningContent.svelte +4 -8
  166. package/dist/components/reasoning/ReasoningTrigger.svelte +4 -5
  167. package/dist/components/resize-handle/ResizeHandle.svelte +4 -7
  168. package/dist/components/reveal/Reveal.svelte +89 -0
  169. package/dist/components/reveal/Reveal.svelte.d.ts +17 -0
  170. package/dist/components/reveal/revealed.d.ts +38 -0
  171. package/dist/components/reveal/revealed.js +79 -0
  172. package/dist/components/segmented/SegmentedControl.svelte +11 -16
  173. package/dist/components/select/Select.svelte +1 -1
  174. package/dist/components/separator/Separator.svelte +1 -1
  175. package/dist/components/settings-row/SettingsRow.svelte +5 -5
  176. package/dist/components/sheet/SheetContent.svelte +63 -0
  177. package/dist/components/sheet/SheetContent.svelte.d.ts +18 -0
  178. package/dist/components/sheet/index.d.ts +12 -0
  179. package/dist/components/sheet/index.js +12 -0
  180. package/dist/components/sheet/styles.d.ts +51 -0
  181. package/dist/components/sheet/styles.js +65 -0
  182. package/dist/components/shimmer/Shimmer.svelte +41 -26
  183. package/dist/components/sidebar/SidebarContent.svelte +1 -1
  184. package/dist/components/sidebar/SidebarFolder.svelte +142 -0
  185. package/dist/components/sidebar/SidebarFolder.svelte.d.ts +19 -0
  186. package/dist/components/sidebar/SidebarFooter.svelte +1 -1
  187. package/dist/components/sidebar/SidebarGroup.svelte +41 -35
  188. package/dist/components/sidebar/SidebarGroup.svelte.d.ts +3 -3
  189. package/dist/components/sidebar/SidebarHeader.svelte +12 -6
  190. package/dist/components/sidebar/SidebarHeader.svelte.d.ts +4 -1
  191. package/dist/components/sidebar/SidebarItem.svelte +34 -38
  192. package/dist/components/sidebar/SidebarRoot.svelte +62 -0
  193. package/dist/components/sidebar/SidebarRoot.svelte.d.ts +14 -0
  194. package/dist/components/sidebar/index.d.ts +5 -1
  195. package/dist/components/sidebar/index.js +3 -1
  196. package/dist/components/skeleton/Skeleton.svelte +26 -15
  197. package/dist/components/slider/Slider.svelte +200 -0
  198. package/dist/components/slider/Slider.svelte.d.ts +55 -0
  199. package/dist/components/spinner/Spinner.svelte +4 -11
  200. package/dist/components/stack/Stack.svelte +37 -44
  201. package/dist/components/stack/Stack.svelte.d.ts +12 -6
  202. package/dist/components/status-indicator/StatusIndicator.svelte +1 -1
  203. package/dist/components/suggestions/SuggestionsItem.svelte +11 -13
  204. package/dist/components/switch/Switch.svelte +16 -25
  205. package/dist/components/tab-strip/TabStrip.svelte +340 -0
  206. package/dist/components/tab-strip/TabStrip.svelte.d.ts +31 -0
  207. package/dist/components/tabs/Tabs.svelte +15 -14
  208. package/dist/components/tabs/Tabs.svelte.d.ts +4 -0
  209. package/dist/components/text/Text.svelte +64 -14
  210. package/dist/components/text/Text.svelte.d.ts +13 -3
  211. package/dist/components/toast/Toaster.svelte +12 -10
  212. package/dist/components/toggle/Toggle.svelte +40 -0
  213. package/dist/components/toggle/Toggle.svelte.d.ts +15 -0
  214. package/dist/components/toggle-group/ToggleGroupItem.svelte +37 -0
  215. package/dist/components/toggle-group/ToggleGroupItem.svelte.d.ts +12 -0
  216. package/dist/components/toggle-group/ToggleGroupRoot.svelte +95 -0
  217. package/dist/components/toggle-group/ToggleGroupRoot.svelte.d.ts +33 -0
  218. package/dist/components/toggle-group/context.d.ts +6 -0
  219. package/dist/components/toggle-group/context.js +11 -0
  220. package/dist/components/toggle-group/index.d.ts +5 -0
  221. package/dist/components/toggle-group/index.js +3 -0
  222. package/dist/components/tool/ToolContent.svelte +3 -8
  223. package/dist/components/tool/ToolSection.svelte +4 -5
  224. package/dist/components/tool/ToolTrigger.svelte +14 -15
  225. package/dist/components/tooltip/TooltipContent.svelte +9 -6
  226. package/dist/components/work-fold/WorkFold.svelte +17 -34
  227. package/dist/components/work-fold/WorkFold.svelte.d.ts +1 -1
  228. package/dist/index.d.ts +38 -10
  229. package/dist/index.js +38 -12
  230. package/dist/internal/Chevron.svelte +2 -3
  231. package/dist/internal/Code.svelte +3 -4
  232. package/dist/internal/Collapse.svelte +6 -5
  233. package/dist/internal/Collapse.svelte.d.ts +2 -1
  234. package/dist/internal/Glyph.svelte +16 -0
  235. package/dist/internal/Glyph.svelte.d.ts +6 -0
  236. package/dist/internal/Tile.svelte +17 -37
  237. package/dist/internal/control.d.ts +4 -4
  238. package/dist/internal/control.js +21 -18
  239. package/dist/internal/layer.d.ts +3 -5
  240. package/dist/internal/layer.js +14 -18
  241. package/dist/internal/layout.d.ts +13 -0
  242. package/dist/internal/layout.js +453 -0
  243. package/dist/internal/markers.stylex.d.ts +8 -0
  244. package/dist/internal/markers.stylex.js +4 -0
  245. package/dist/internal/plugin-order.d.ts +8 -0
  246. package/dist/internal/plugin-order.js +16 -0
  247. package/dist/internal/responsive.d.ts +45 -0
  248. package/dist/internal/responsive.js +42 -0
  249. package/dist/internal/roving.js +5 -2
  250. package/dist/internal/shared.d.ts +8 -1
  251. package/dist/internal/shared.js +21 -5
  252. package/dist/internal/sx.d.ts +31 -4
  253. package/dist/internal/sx.js +17 -0
  254. package/dist/internal/toggle.d.ts +73 -0
  255. package/dist/internal/toggle.js +83 -0
  256. package/dist/internal/visible.d.ts +32 -0
  257. package/dist/internal/visible.js +44 -0
  258. package/dist/markdown/ast.d.ts +209 -0
  259. package/dist/markdown/ast.js +10 -0
  260. package/dist/markdown/blocks.d.ts +177 -0
  261. package/dist/markdown/blocks.js +1489 -0
  262. package/dist/markdown/code-info.d.ts +10 -0
  263. package/dist/markdown/code-info.js +16 -0
  264. package/dist/markdown/common.d.ts +25 -0
  265. package/dist/markdown/common.js +107 -0
  266. package/dist/markdown/diagrams.d.ts +2 -0
  267. package/dist/markdown/diagrams.js +18 -0
  268. package/dist/markdown/file-paths.d.ts +29 -0
  269. package/dist/markdown/file-paths.js +80 -0
  270. package/dist/markdown/files.d.ts +16 -0
  271. package/dist/markdown/files.js +133 -0
  272. package/dist/markdown/highlight.d.ts +30 -0
  273. package/dist/markdown/highlight.js +127 -0
  274. package/dist/markdown/html.d.ts +23 -0
  275. package/dist/markdown/html.js +289 -0
  276. package/dist/markdown/images.d.ts +15 -0
  277. package/dist/markdown/images.js +45 -0
  278. package/dist/markdown/index.d.ts +12 -0
  279. package/dist/markdown/index.js +5 -0
  280. package/dist/markdown/inlines.d.ts +48 -0
  281. package/dist/markdown/inlines.js +1714 -0
  282. package/dist/markdown/math.d.ts +2 -0
  283. package/dist/markdown/math.js +22 -0
  284. package/dist/markdown/parse.d.ts +81 -0
  285. package/dist/markdown/parse.js +204 -0
  286. package/dist/markdown/plugin.d.ts +178 -0
  287. package/dist/markdown/plugin.js +160 -0
  288. package/dist/markdown/sanitize.d.ts +78 -0
  289. package/dist/markdown/sanitize.js +522 -0
  290. package/dist/markdown/share.d.ts +12 -0
  291. package/dist/markdown/share.js +59 -0
  292. package/dist/markdown/table.d.ts +13 -0
  293. package/dist/markdown/table.js +60 -0
  294. package/dist/media.stylex.d.ts +52 -0
  295. package/dist/media.stylex.js +53 -0
  296. package/dist/preset.d.ts +40 -16
  297. package/dist/preset.js +169 -51
  298. package/dist/tokens.stylex.d.ts +70 -37
  299. package/dist/tokens.stylex.js +127 -62
  300. package/dist/typography.d.ts +48 -0
  301. package/dist/typography.js +55 -0
  302. package/dist/vite.d.ts +9 -1
  303. package/dist/vite.js +37 -4
  304. package/package.json +58 -6
  305. package/skills/building-ui/SKILL.md +242 -0
  306. package/skills/building-ui/references/components.md +207 -0
  307. package/skills/markdown/SKILL.md +452 -0
  308. package/skills/markdown/references/plugins.md +103 -0
  309. package/skills/setup/SKILL.md +191 -0
  310. package/skills/styling/SKILL.md +269 -0
  311. package/skills/theming/SKILL.md +184 -0
  312. package/dist/internal/loop.d.ts +0 -35
  313. package/dist/internal/loop.js +0 -72
@@ -6,6 +6,7 @@
6
6
  import { shared } from '../../internal/shared.js';
7
7
  import { attrs, type Sx } from '../../internal/sx.js';
8
8
  import { colors, font, motion, radius } from '../../tokens.stylex.js';
9
+ import { media } from '../../media.stylex.js';
9
10
  import { useConversation } from './context.js';
10
11
 
11
12
  export type ConversationScrollButtonProps = Omit<HTMLButtonAttributes, 'children'> & {
@@ -17,9 +18,6 @@
17
18
  children?: Snippet;
18
19
  };
19
20
 
20
- const HOVER = '@media (hover: hover) and (pointer: fine)';
21
- const MOTION = '@media (prefers-reduced-motion: no-preference)';
22
-
23
21
  const styles = stylex.create({
24
22
  button: {
25
23
  position: 'absolute',
@@ -36,15 +34,15 @@
36
34
  marginInline: 'auto',
37
35
  paddingInline: '0.5rem',
38
36
  borderWidth: 0,
39
- borderRadius: radius.full,
37
+ borderRadius: radius.pill,
40
38
  backgroundColor: colors.bgRaised,
41
39
  color: {
42
40
  default: colors.textMuted,
43
- ':hover': { default: null, [HOVER]: colors.text }
41
+ ':hover': { default: null, [media.hover]: colors.text }
44
42
  },
45
- boxShadow: `inset 0 0 0 1px ${colors.lineStrong}, inset 0 1px 0 ${colors.highlight}, 0 1px 2px ${colors.shade}, 0 8px 20px -8px ${colors.shade}`,
43
+ boxShadow: `inset 0 0 0 1px ${colors.borderStrong}, 0 8px 20px -8px ${colors.shadow}`,
46
44
  fontFamily: font.body,
47
- fontSize: font.sizeSm,
45
+ fontSize: font.sizeMeta,
48
46
  fontWeight: font.weightMedium,
49
47
  lineHeight: 1,
50
48
  whiteSpace: 'nowrap',
@@ -53,10 +51,10 @@
53
51
  // It rises into place, and drops away a little faster than it came
54
52
  opacity: 1,
55
53
  translate: '0 0',
56
- scale: { default: null, ':active': { default: null, [MOTION]: 0.96 } },
54
+ scale: { default: null, ':active': { default: null, [media.motion]: 0.96 } },
57
55
  transitionProperty: {
58
56
  default: 'opacity, color',
59
- [MOTION]: 'opacity, translate, scale, color'
57
+ [media.motion]: 'opacity, translate, scale, color'
60
58
  },
61
59
  transitionDuration: motion.slow,
62
60
  transitionTimingFunction: motion.easeOut
@@ -67,8 +65,8 @@
67
65
  },
68
66
  hidden: {
69
67
  opacity: 0,
70
- translate: { default: null, [MOTION]: '0 8px' },
71
- scale: { default: null, [MOTION]: 0.94 },
68
+ translate: { default: null, [media.motion]: '0 8px' },
69
+ scale: { default: null, [media.motion]: 0.94 },
72
70
  pointerEvents: 'none',
73
71
  transitionDuration: motion.base
74
72
  }
@@ -46,7 +46,7 @@
46
46
  note: {
47
47
  margin: 0,
48
48
  marginTop: '0.25rem',
49
- fontSize: font.sizeSm,
49
+ fontSize: font.sizeMeta,
50
50
  lineHeight: font.leadingSnug
51
51
  },
52
52
  error: { color: colors.danger, userSelect: 'text' },
@@ -5,6 +5,7 @@
5
5
  import Glyph from '../../internal/Glyph.svelte';
6
6
  import { attrs, type Sx } from '../../internal/sx.js';
7
7
  import Button from '../button/Button.svelte';
8
+ import { sheet } from '../sheet/styles.js';
8
9
  import { dialog } from './styles.js';
9
10
 
10
11
  export type DialogContentProps = Omit<Dialog.ContentProps, 'children' | 'child'> & {
@@ -37,7 +38,10 @@
37
38
  <Dialog.Content
38
39
  data-slot="dialog-content"
39
40
  {...rest}
40
- {...attrs([dialog.content, side ? [dialog.sheet, dialog[side]] : dialog[size], sx], className)}
41
+ {...attrs(
42
+ [dialog.content, side ? [sheet.sheet, sheet.md, sheet[side]] : dialog[size], sx],
43
+ className
44
+ )}
41
45
  >
42
46
  {@render children?.()}
43
47
  {#if closeLabel}
@@ -4,8 +4,7 @@ export declare const dialog: Readonly<{
4
4
  readonly position: stylex.StyleXClassNameFor<"position", "fixed">;
5
5
  readonly inset: stylex.StyleXClassNameFor<"inset", 0>;
6
6
  readonly zIndex: stylex.StyleXClassNameFor<"zIndex", 50>;
7
- readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "light-dark(rgb(20 23 28 / 0.32), rgb(0 0 0 / 0.56))">;
8
- readonly backdropFilter: stylex.StyleXClassNameFor<"backdropFilter", "blur(2px)">;
7
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
9
8
  readonly opacity: stylex.StyleXClassNameFor<"opacity", 0 | 1>;
10
9
  readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity">;
11
10
  readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", string>;
@@ -25,7 +24,7 @@ export declare const dialog: Readonly<{
25
24
  readonly translate: stylex.StyleXClassNameFor<"translate", "0 -50%">;
26
25
  readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
27
26
  readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
28
- readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", `inset 0 0 0 1px ${stylex.StyleXVar<string>}, inset 0 1px 0 ${stylex.StyleXVar<string>}, 0 24px 64px -16px rgb(0 0 0 / 0.5)`>;
27
+ readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", `inset 0 0 0 1px ${stylex.StyleXVar<string>}, 0 24px 64px -16px ${stylex.StyleXVar<string>}`>;
29
28
  readonly color: stylex.StyleXClassNameFor<"color", string>;
30
29
  readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
31
30
  readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
@@ -48,29 +47,6 @@ export declare const dialog: Readonly<{
48
47
  readonly lg: Readonly<{
49
48
  readonly maxWidth: stylex.StyleXClassNameFor<"maxWidth", "44rem">;
50
49
  }>;
51
- readonly sheet: Readonly<{
52
- readonly top: stylex.StyleXClassNameFor<"top", 0>;
53
- readonly bottom: stylex.StyleXClassNameFor<"bottom", 0>;
54
- readonly width: stylex.StyleXClassNameFor<"width", "min(26rem, calc(100vw - 2rem))">;
55
- readonly maxHeight: stylex.StyleXClassNameFor<"maxHeight", "none">;
56
- readonly marginInline: stylex.StyleXClassNameFor<"marginInline", 0>;
57
- readonly translate: stylex.StyleXClassNameFor<"translate", "none">;
58
- readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 0>;
59
- readonly scale: stylex.StyleXClassNameFor<"scale", null>;
60
- readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "opacity" | "opacity, translate">;
61
- readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", string>;
62
- readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", "cubic-bezier(0.32, 0.72, 0, 1)">;
63
- }>;
64
- readonly end: Readonly<{
65
- readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", "auto">;
66
- readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", 0>;
67
- readonly translate: stylex.StyleXClassNameFor<"translate", "0 0" | "100% 0" | null>;
68
- }>;
69
- readonly start: Readonly<{
70
- readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", 0>;
71
- readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", "auto">;
72
- readonly translate: stylex.StyleXClassNameFor<"translate", "0 0" | "-100% 0" | null>;
73
- }>;
74
50
  readonly header: Readonly<{
75
51
  readonly display: stylex.StyleXClassNameFor<"display", "flex">;
76
52
  readonly flexDirection: stylex.StyleXClassNameFor<"flexDirection", "column">;
@@ -1,15 +1,13 @@
1
1
  import * as stylex from '@stylexjs/stylex';
2
2
  import { colors, font, motion, radius, space } from '../../tokens.stylex.js';
3
- const MOTION = '@media (prefers-reduced-motion: no-preference)';
4
- const FORCED = '@media (forced-colors: active)';
3
+ import { media } from '../../media.stylex.js';
5
4
  const CLOSED = ':is([data-state="closed"])';
6
5
  export const dialog = stylex.create({
7
6
  overlay: {
8
7
  position: 'fixed',
9
8
  inset: 0,
10
9
  zIndex: 50,
11
- backgroundColor: 'light-dark(rgb(20 23 28 / 0.32), rgb(0 0 0 / 0.56))',
12
- backdropFilter: 'blur(2px)',
10
+ backgroundColor: colors.scrim,
13
11
  opacity: { default: 1, '@starting-style': 0, [CLOSED]: 0 },
14
12
  transitionProperty: 'opacity',
15
13
  transitionDuration: { default: motion.base, [CLOSED]: motion.fast },
@@ -30,62 +28,27 @@ export const dialog = stylex.create({
30
28
  translate: '0 -50%',
31
29
  borderRadius: radius.frame,
32
30
  backgroundColor: colors.bgRaised,
33
- boxShadow: `inset 0 0 0 1px ${colors.lineStrong}, inset 0 1px 0 ${colors.highlight}, 0 24px 64px -16px rgb(0 0 0 / 0.5)`,
31
+ boxShadow: `inset 0 0 0 1px ${colors.borderStrong}, 0 24px 64px -16px ${colors.shadow}`,
34
32
  color: colors.text,
35
33
  fontFamily: font.body,
36
- fontSize: font.sizeMd,
34
+ fontSize: font.sizeBody,
37
35
  lineHeight: font.leadingNormal,
38
36
  outlineStyle: 'solid',
39
- outlineWidth: { default: 0, [FORCED]: '1px' },
37
+ outlineWidth: { default: 0, [media.forcedColors]: '1px' },
40
38
  outlineColor: 'CanvasText',
41
39
  // A modal is not tied to a trigger, so it grows from its own centre
42
40
  opacity: { default: 1, '@starting-style': 0, [CLOSED]: 0 },
43
- scale: { default: null, [MOTION]: { default: 1, '@starting-style': 0.96, [CLOSED]: 0.98 } },
44
- transitionProperty: { default: 'opacity', [MOTION]: 'opacity, scale' },
41
+ scale: {
42
+ default: null,
43
+ [media.motion]: { default: 1, '@starting-style': 0.96, [CLOSED]: 0.98 }
44
+ },
45
+ transitionProperty: { default: 'opacity', [media.motion]: 'opacity, scale' },
45
46
  transitionDuration: { default: motion.base, [CLOSED]: motion.fast },
46
47
  transitionTimingFunction: motion.easeOut
47
48
  },
48
49
  sm: { maxWidth: '24rem' },
49
50
  md: { maxWidth: '32rem' },
50
51
  lg: { maxWidth: '44rem' },
51
- // A sheet: the full height of the window, along one edge
52
- sheet: {
53
- top: 0,
54
- bottom: 0,
55
- width: 'min(26rem, calc(100vw - 2rem))',
56
- maxHeight: 'none',
57
- marginInline: 0,
58
- translate: 'none',
59
- borderRadius: 0,
60
- scale: null,
61
- transitionProperty: { default: 'opacity', [MOTION]: 'opacity, translate' },
62
- transitionDuration: { default: motion.slow, [CLOSED]: motion.base },
63
- transitionTimingFunction: 'cubic-bezier(0.32, 0.72, 0, 1)'
64
- },
65
- end: {
66
- insetInlineStart: 'auto',
67
- insetInlineEnd: 0,
68
- translate: {
69
- default: null,
70
- [MOTION]: {
71
- default: '0 0',
72
- '@starting-style': '100% 0',
73
- [CLOSED]: '100% 0'
74
- }
75
- }
76
- },
77
- start: {
78
- insetInlineStart: 0,
79
- insetInlineEnd: 'auto',
80
- translate: {
81
- default: null,
82
- [MOTION]: {
83
- default: '0 0',
84
- '@starting-style': '-100% 0',
85
- [CLOSED]: '-100% 0'
86
- }
87
- }
88
- },
89
52
  header: {
90
53
  display: 'flex',
91
54
  flexDirection: 'column',
@@ -99,14 +62,14 @@ export const dialog = stylex.create({
99
62
  title: {
100
63
  margin: 0,
101
64
  color: colors.text,
102
- fontSize: font.sizeXl,
65
+ fontSize: font.sizeTitle,
103
66
  fontWeight: font.weightSemibold,
104
67
  lineHeight: font.leadingSnug
105
68
  },
106
69
  description: {
107
70
  margin: 0,
108
71
  color: colors.textMuted,
109
- fontSize: font.sizeMd,
72
+ fontSize: font.sizeBody,
110
73
  lineHeight: font.leadingNormal
111
74
  },
112
75
  body: {
@@ -18,11 +18,11 @@
18
18
  alignItems: 'center',
19
19
  gap: '0.75rem',
20
20
  color: colors.textSubtle,
21
- fontSize: font.sizeXs,
21
+ fontSize: font.sizeCaption,
22
22
  fontWeight: font.weightMedium,
23
23
  whiteSpace: 'nowrap',
24
- '::before': { content: '""', flexGrow: 1, height: '1px', backgroundColor: colors.line },
25
- '::after': { content: '""', flexGrow: 1, height: '1px', backgroundColor: colors.line }
24
+ '::before': { content: '""', flexGrow: 1, height: '1px', backgroundColor: colors.border },
25
+ '::after': { content: '""', flexGrow: 1, height: '1px', backgroundColor: colors.border }
26
26
  },
27
27
  label: { display: 'inline-flex', alignItems: 'center', gap: '0.375rem' }
28
28
  });
@@ -34,22 +34,21 @@
34
34
  width: '2.75rem',
35
35
  height: '2.75rem',
36
36
  marginBottom: space.x2,
37
- borderRadius: radius.xl,
38
- backgroundColor: colors.well,
39
- boxShadow: `inset 0 0 0 1px ${colors.line}`,
37
+ borderRadius: radius.card,
38
+ backgroundColor: colors.fillSunken,
40
39
  color: colors.textMuted
41
40
  },
42
41
  title: {
43
42
  margin: 0,
44
43
  color: colors.text,
45
- fontSize: font.sizeLg,
44
+ fontSize: font.sizeReading,
46
45
  fontWeight: font.weightSemibold
47
46
  },
48
47
  description: {
49
48
  maxWidth: '26rem',
50
49
  margin: 0,
51
50
  color: colors.textMuted,
52
- fontSize: font.sizeMd,
51
+ fontSize: font.sizeBody,
53
52
  lineHeight: font.leadingNormal
54
53
  },
55
54
  actions: {
@@ -40,7 +40,7 @@
40
40
  },
41
41
  label: {
42
42
  color: colors.text,
43
- fontSize: font.sizeSm,
43
+ fontSize: font.sizeMeta,
44
44
  fontWeight: font.weightMedium,
45
45
  lineHeight: font.leadingSnug
46
46
  },
@@ -53,20 +53,20 @@
53
53
  },
54
54
  optional: {
55
55
  color: colors.textSubtle,
56
- fontSize: font.sizeSm,
56
+ fontSize: font.sizeMeta,
57
57
  lineHeight: font.leadingSnug
58
58
  },
59
59
  description: {
60
60
  margin: 0,
61
61
  color: colors.textSubtle,
62
- fontSize: font.sizeXs,
62
+ fontSize: font.sizeCaption,
63
63
  lineHeight: font.leadingSnug,
64
64
  textWrap: 'pretty'
65
65
  },
66
66
  error: {
67
67
  margin: 0,
68
68
  color: colors.danger,
69
- fontSize: font.sizeXs,
69
+ fontSize: font.sizeCaption,
70
70
  lineHeight: font.leadingSnug,
71
71
  textWrap: 'pretty'
72
72
  }
@@ -11,7 +11,7 @@
11
11
  as?: 'div' | 'section' | 'article';
12
12
  /** Heading shown above the content. */
13
13
  title?: string;
14
- /** A short note at the far end of the header, set in monospace. */
14
+ /** A short note at the far end of the header. */
15
15
  tag?: string;
16
16
  /** Heading level for the title. */
17
17
  level?: 2 | 3 | 4 | 5 | 6;
@@ -21,7 +21,8 @@
21
21
  };
22
22
 
23
23
  const styles = stylex.create({
24
- // A tray around an inset panel. Its radius is the Card's radius plus this padding.
24
+ // A tray around an inset panel: a flat fill, so the panel's own edge is the only line.
25
+ // Its radius is the Card's radius plus this padding.
25
26
  root: {
26
27
  display: 'flex',
27
28
  flexDirection: 'column',
@@ -29,8 +30,7 @@
29
30
  minWidth: 0,
30
31
  padding: '0.3125rem',
31
32
  borderRadius: radius.frame,
32
- backgroundColor: colors.surface,
33
- boxShadow: `inset 0 0 0 1px ${colors.line}, inset 0 1px 0 ${colors.highlight}`,
33
+ backgroundColor: colors.fillMuted,
34
34
  color: colors.text,
35
35
  fontFamily: font.body
36
36
  },
@@ -46,15 +46,14 @@
46
46
  flexGrow: 1,
47
47
  minWidth: 0,
48
48
  margin: 0,
49
- fontSize: font.sizeMd,
49
+ fontSize: font.sizeBody,
50
50
  fontWeight: font.weightMedium,
51
51
  lineHeight: font.leadingSnug
52
52
  },
53
53
  tag: {
54
54
  flexShrink: 0,
55
55
  color: colors.textSubtle,
56
- fontFamily: font.mono,
57
- fontSize: font.sizeXs,
56
+ fontSize: font.sizeCaption,
58
57
  lineHeight: 1
59
58
  }
60
59
  });
@@ -6,7 +6,7 @@ export type FrameProps = Omit<HTMLAttributes<HTMLElement>, 'children' | 'title'>
6
6
  as?: 'div' | 'section' | 'article';
7
7
  /** Heading shown above the content. */
8
8
  title?: string;
9
- /** A short note at the far end of the header, set in monospace. */
9
+ /** A short note at the far end of the header. */
10
10
  tag?: string;
11
11
  /** Heading level for the title. */
12
12
  level?: 2 | 3 | 4 | 5 | 6;
@@ -0,0 +1,111 @@
1
+ <script lang="ts" module>
2
+ import * as stylex from '@stylexjs/stylex';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+ import {
6
+ alignStyles,
7
+ columnsStyles,
8
+ gapStyles,
9
+ type Align,
10
+ type Columns,
11
+ type Gap
12
+ } from '../../internal/layout.js';
13
+ import {
14
+ breakpoints,
15
+ isByBreakpoint,
16
+ responsive,
17
+ type Responsive
18
+ } from '../../internal/responsive.js';
19
+ import { attrs, type Sx } from '../../internal/sx.js';
20
+
21
+ /** Steps on the 4px spacing scale: `4` is 16px. */
22
+ export type GridGap = Gap;
23
+ export type GridAlign = Align;
24
+ /**
25
+ * A number of equal columns, from 1 to 12, or a `grid-template-columns` value of your own,
26
+ * such as `'1.15fr 1fr'` or `'repeat(auto-fill, minmax(14rem, 1fr))'`.
27
+ */
28
+ export type GridColumns = Columns | (string & {});
29
+
30
+ export type GridProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
31
+ /** Element to render. A `ul` or `ol` loses its markers and indent. */
32
+ as?: 'div' | 'section' | 'article' | 'nav' | 'header' | 'footer' | 'main' | 'ul' | 'ol' | 'li';
33
+ /** Columns. Like every layout prop, a value or values by breakpoint. */
34
+ columns?: Responsive<GridColumns>;
35
+ gap?: Responsive<GridGap>;
36
+ /** Alignment of each item in its cell, on the block axis. Items stretch by default. */
37
+ align?: Responsive<GridAlign>;
38
+ sx?: Sx;
39
+ children?: Snippet;
40
+ };
41
+
42
+ const styles = stylex.create({
43
+ base: {
44
+ display: 'grid',
45
+ boxSizing: 'border-box',
46
+ minWidth: 0,
47
+ margin: 0,
48
+ padding: 0,
49
+ listStyleType: 'none'
50
+ }
51
+ });
52
+
53
+ // A template of your own cannot be known at build time. It is set as a custom property,
54
+ // inline, and read by the same static rules as a count. (Always a custom property: StyleX's
55
+ // `attrs` misnames the inline variable of a dynamic style on a camel-cased property.)
56
+ const templates = stylex.create({
57
+ default: (template: string) => ({ '--narvi-columns': template }),
58
+ sm: (template: string) => ({ '--narvi-columns-sm': template }),
59
+ md: (template: string) => ({ '--narvi-columns-md': template }),
60
+ lg: (template: string) => ({ '--narvi-columns-lg': template }),
61
+ xl: (template: string) => ({ '--narvi-columns-xl': template })
62
+ });
63
+
64
+ const isCount = (value: GridColumns): value is Columns => typeof value === 'number';
65
+
66
+ function columnStyles(columns: Responsive<GridColumns> | undefined) {
67
+ if (!isByBreakpoint(columns)) {
68
+ const value = columns ?? 1;
69
+ return isCount(value)
70
+ ? [columnsStyles.fixed[value]]
71
+ : [columnsStyles.chain, templates.default(value)];
72
+ }
73
+ const result: unknown[] = [columnsStyles.chain];
74
+ for (const at of ['default', ...breakpoints] as const) {
75
+ const value = at === 'default' ? (columns.default ?? 1) : columns[at];
76
+ if (value === undefined) continue;
77
+ result.push(isCount(value) ? columnsStyles.set[at][value] : templates[at](value));
78
+ }
79
+ return result;
80
+ }
81
+ </script>
82
+
83
+ <script lang="ts">
84
+ let {
85
+ as = 'div',
86
+ columns = 1,
87
+ gap = 4,
88
+ align,
89
+ sx,
90
+ class: className,
91
+ children,
92
+ ...rest
93
+ }: GridProps = $props();
94
+ </script>
95
+
96
+ <svelte:element
97
+ this={as}
98
+ {...rest}
99
+ {...attrs(
100
+ [
101
+ styles.base,
102
+ columnStyles(columns) as ReadonlyArray<Readonly<Record<string, unknown>>>,
103
+ responsive(gap, 4, gapStyles),
104
+ responsive(align, undefined, alignStyles),
105
+ sx
106
+ ],
107
+ className
108
+ )}
109
+ >
110
+ {@render children?.()}
111
+ </svelte:element>
@@ -0,0 +1,27 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { type Align, type Columns, type Gap } from '../../internal/layout.js';
4
+ import { type Responsive } from '../../internal/responsive.js';
5
+ import { type Sx } from '../../internal/sx.js';
6
+ /** Steps on the 4px spacing scale: `4` is 16px. */
7
+ export type GridGap = Gap;
8
+ export type GridAlign = Align;
9
+ /**
10
+ * A number of equal columns, from 1 to 12, or a `grid-template-columns` value of your own,
11
+ * such as `'1.15fr 1fr'` or `'repeat(auto-fill, minmax(14rem, 1fr))'`.
12
+ */
13
+ export type GridColumns = Columns | (string & {});
14
+ export type GridProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
15
+ /** Element to render. A `ul` or `ol` loses its markers and indent. */
16
+ as?: 'div' | 'section' | 'article' | 'nav' | 'header' | 'footer' | 'main' | 'ul' | 'ol' | 'li';
17
+ /** Columns. Like every layout prop, a value or values by breakpoint. */
18
+ columns?: Responsive<GridColumns>;
19
+ gap?: Responsive<GridGap>;
20
+ /** Alignment of each item in its cell, on the block axis. Items stretch by default. */
21
+ align?: Responsive<GridAlign>;
22
+ sx?: Sx;
23
+ children?: Snippet;
24
+ };
25
+ declare const Grid: import("svelte").Component<GridProps, {}, "">;
26
+ type Grid = ReturnType<typeof Grid>;
27
+ export default Grid;
@@ -39,8 +39,8 @@
39
39
  });
40
40
 
41
41
  const sizes = stylex.create({
42
- sm: { fontSize: font.sizeMd },
43
- md: { fontSize: font.sizeLg },
42
+ sm: { fontSize: font.sizeBody },
43
+ md: { fontSize: font.sizeReading },
44
44
  lg: { fontSize: '1.125rem', letterSpacing: '-0.01em' },
45
45
  xl: { fontSize: '1.625rem' },
46
46
  '2xl': { fontSize: '2.125rem' },
@@ -0,0 +1,50 @@
1
+ <script lang="ts" module>
2
+ import { LinkPreview } from 'bits-ui';
3
+ import * as stylex from '@stylexjs/stylex';
4
+ import type { Snippet } from 'svelte';
5
+ import { layer } from '../../internal/layer.js';
6
+ import { attrs, type Sx } from '../../internal/sx.js';
7
+
8
+ export type HoverCardContentProps = Omit<LinkPreview.ContentProps, 'children' | 'child'> & {
9
+ sx?: Sx;
10
+ children?: Snippet;
11
+ };
12
+
13
+ const styles = stylex.create({
14
+ // A card of its own content: a preview of a thread, a file, a person
15
+ card: {
16
+ width: '20rem',
17
+ minWidth: 0,
18
+ padding: '0.75rem'
19
+ }
20
+ });
21
+ </script>
22
+
23
+ <script lang="ts">
24
+ let {
25
+ side = 'bottom',
26
+ sideOffset = 6,
27
+ collisionPadding = 8,
28
+ align = 'start',
29
+ ref = $bindable(null),
30
+ sx,
31
+ class: className,
32
+ children,
33
+ ...rest
34
+ }: HoverCardContentProps = $props();
35
+ </script>
36
+
37
+ <LinkPreview.Portal>
38
+ <LinkPreview.Content
39
+ bind:ref
40
+ {side}
41
+ {sideOffset}
42
+ {collisionPadding}
43
+ {align}
44
+ data-slot="hover-card"
45
+ {...rest}
46
+ {...attrs([layer.surface, styles.card, sx], className)}
47
+ >
48
+ {@render children?.()}
49
+ </LinkPreview.Content>
50
+ </LinkPreview.Portal>
@@ -0,0 +1,10 @@
1
+ import { LinkPreview } from 'bits-ui';
2
+ import type { Snippet } from 'svelte';
3
+ import { type Sx } from '../../internal/sx.js';
4
+ export type HoverCardContentProps = Omit<LinkPreview.ContentProps, 'children' | 'child'> & {
5
+ sx?: Sx;
6
+ children?: Snippet;
7
+ };
8
+ declare const HoverCardContent: import("svelte").Component<HoverCardContentProps, {}, "ref">;
9
+ type HoverCardContent = ReturnType<typeof HoverCardContent>;
10
+ export default HoverCardContent;
@@ -0,0 +1,22 @@
1
+ <script lang="ts" module>
2
+ import { LinkPreview } from 'bits-ui';
3
+
4
+ export type HoverCardRootProps = LinkPreview.RootProps;
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ // A card should not spring up as the pointer crosses on its way somewhere
9
+ // else, so it waits half a second; it lingers a moment on the way out, so the
10
+ // pointer can travel from the trigger into it.
11
+ let {
12
+ open = $bindable(false),
13
+ openDelay = 500,
14
+ closeDelay = 150,
15
+ children,
16
+ ...rest
17
+ }: HoverCardRootProps = $props();
18
+ </script>
19
+
20
+ <LinkPreview.Root bind:open {openDelay} {closeDelay} {...rest}>
21
+ {@render children?.()}
22
+ </LinkPreview.Root>
@@ -0,0 +1,5 @@
1
+ import { LinkPreview } from 'bits-ui';
2
+ export type HoverCardRootProps = LinkPreview.RootProps;
3
+ declare const HoverCardRoot: import("svelte").Component<import("bits-ui").LinkPreviewRootPropsWithoutHTML, {}, "open">;
4
+ type HoverCardRoot = ReturnType<typeof HoverCardRoot>;
5
+ export default HoverCardRoot;
@@ -0,0 +1,7 @@
1
+ import { LinkPreview } from 'bits-ui';
2
+ import Content from './HoverCardContent.svelte';
3
+ import Root from './HoverCardRoot.svelte';
4
+ declare const Trigger: import("svelte").Component<LinkPreview.TriggerProps, {}, "ref">;
5
+ export { Root, Trigger, Content };
6
+ export type { HoverCardContentProps } from './HoverCardContent.svelte';
7
+ export type { HoverCardRootProps } from './HoverCardRoot.svelte';
@@ -0,0 +1,7 @@
1
+ import { LinkPreview } from 'bits-ui';
2
+ import Content from './HoverCardContent.svelte';
3
+ import Root from './HoverCardRoot.svelte';
4
+ // Behaviour only: bits-ui's own part. It renders a link; pass `child` to make
5
+ // another element the trigger.
6
+ const Trigger = LinkPreview.Trigger;
7
+ export { Root, Trigger, Content };