@diegopluna/narvi 0.1.0 → 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 (259) hide show
  1. package/README.md +102 -41
  2. package/dist/base.css +2 -2
  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 +3 -3
  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 -16
  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 +37 -61
  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 +91 -19
  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 +219 -40
  36. package/dist/components/button/Button.svelte.d.ts +38 -2
  37. package/dist/components/card/Card.svelte +15 -26
  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 +18 -15
  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/CollapsibleTrigger.svelte +2 -2
  44. package/dist/components/command/CommandItem.svelte +1 -1
  45. package/dist/components/command/styles.d.ts +3 -2
  46. package/dist/components/command/styles.js +13 -10
  47. package/dist/components/composer/ComposerAttachButton.svelte +1 -1
  48. package/dist/components/composer/ComposerAttachment.svelte +9 -12
  49. package/dist/components/composer/ComposerModelPicker.svelte +18 -20
  50. package/dist/components/composer/ComposerRoot.svelte +8 -7
  51. package/dist/components/composer/ComposerSubmit.svelte +8 -15
  52. package/dist/components/composer/ComposerTextarea.svelte +1 -1
  53. package/dist/components/composer/ComposerToggle.svelte +9 -11
  54. package/dist/components/composer/ComposerTray.svelte +78 -0
  55. package/dist/components/composer/ComposerTray.svelte.d.ts +15 -0
  56. package/dist/components/composer/index.d.ts +3 -1
  57. package/dist/components/composer/index.js +3 -2
  58. package/dist/components/conversation/ConversationContent.svelte +3 -2
  59. package/dist/components/conversation/ConversationEmpty.svelte +1 -1
  60. package/dist/components/conversation/ConversationScrollButton.svelte +3 -3
  61. package/dist/components/dialog/ConfirmDialog.svelte +1 -1
  62. package/dist/components/dialog/styles.d.ts +2 -3
  63. package/dist/components/dialog/styles.js +5 -6
  64. package/dist/components/divider/Divider.svelte +3 -3
  65. package/dist/components/empty-state/EmptyState.svelte +4 -5
  66. package/dist/components/field/Field.svelte +4 -4
  67. package/dist/components/frame/Frame.svelte +6 -7
  68. package/dist/components/frame/Frame.svelte.d.ts +1 -1
  69. package/dist/components/heading/Heading.svelte +2 -2
  70. package/dist/components/kbd/Kbd.svelte +12 -7
  71. package/dist/components/link/Link.svelte +7 -3
  72. package/dist/components/link/Link.svelte.d.ts +4 -1
  73. package/dist/components/markdown/Markdown.svelte +714 -0
  74. package/dist/components/markdown/Markdown.svelte.d.ts +80 -0
  75. package/dist/components/markdown/MarkdownBlock.svelte +231 -0
  76. package/dist/components/markdown/MarkdownBlock.svelte.d.ts +11 -0
  77. package/dist/components/markdown/MarkdownBlocks.svelte +115 -0
  78. package/dist/components/markdown/MarkdownBlocks.svelte.d.ts +15 -0
  79. package/dist/components/markdown/MarkdownCode.svelte +583 -0
  80. package/dist/components/markdown/MarkdownCode.svelte.d.ts +23 -0
  81. package/dist/components/markdown/MarkdownDiagram.svelte +310 -0
  82. package/dist/components/markdown/MarkdownDiagram.svelte.d.ts +6 -0
  83. package/dist/components/markdown/MarkdownFile.svelte +134 -0
  84. package/dist/components/markdown/MarkdownFile.svelte.d.ts +19 -0
  85. package/dist/components/markdown/MarkdownFootnotes.svelte +61 -0
  86. package/dist/components/markdown/MarkdownFootnotes.svelte.d.ts +8 -0
  87. package/dist/components/markdown/MarkdownFresh.svelte +69 -0
  88. package/dist/components/markdown/MarkdownFresh.svelte.d.ts +6 -0
  89. package/dist/components/markdown/MarkdownHtml.svelte +72 -0
  90. package/dist/components/markdown/MarkdownHtml.svelte.d.ts +7 -0
  91. package/dist/components/markdown/MarkdownImage.svelte +150 -0
  92. package/dist/components/markdown/MarkdownImage.svelte.d.ts +8 -0
  93. package/dist/components/markdown/MarkdownInlines.svelte +225 -0
  94. package/dist/components/markdown/MarkdownInlines.svelte.d.ts +7 -0
  95. package/dist/components/markdown/MarkdownLink.svelte +120 -0
  96. package/dist/components/markdown/MarkdownLink.svelte.d.ts +25 -0
  97. package/dist/components/markdown/MarkdownMath.svelte +138 -0
  98. package/dist/components/markdown/MarkdownMath.svelte.d.ts +7 -0
  99. package/dist/components/markdown/MarkdownTable.svelte +265 -0
  100. package/dist/components/markdown/MarkdownTable.svelte.d.ts +17 -0
  101. package/dist/components/markdown/caret.d.ts +14 -0
  102. package/dist/components/markdown/caret.js +67 -0
  103. package/dist/components/markdown/context.d.ts +93 -0
  104. package/dist/components/markdown/context.js +128 -0
  105. package/dist/components/markdown/copy.d.ts +13 -0
  106. package/dist/components/markdown/copy.js +74 -0
  107. package/dist/components/markdown/hidden.d.ts +12 -0
  108. package/dist/components/markdown/hidden.js +31 -0
  109. package/dist/components/markdown/kept.d.ts +32 -0
  110. package/dist/components/markdown/kept.js +71 -0
  111. package/dist/components/markdown/labels.d.ts +46 -0
  112. package/dist/components/markdown/labels.js +35 -0
  113. package/dist/components/markdown/save.d.ts +11 -0
  114. package/dist/components/markdown/save.js +58 -0
  115. package/dist/components/markdown/scrollable.d.ts +24 -0
  116. package/dist/components/markdown/scrollable.js +152 -0
  117. package/dist/components/markdown/static.d.ts +37 -0
  118. package/dist/components/markdown/static.js +233 -0
  119. package/dist/components/markdown/styles.d.ts +328 -0
  120. package/dist/components/markdown/styles.js +302 -0
  121. package/dist/components/menu/MenuRadioItem.svelte +3 -3
  122. package/dist/components/menu/index.d.ts +23 -0
  123. package/dist/components/menu/index.js +3 -1
  124. package/dist/components/message/MessageAction.svelte +22 -2
  125. package/dist/components/message/MessageAction.svelte.d.ts +9 -0
  126. package/dist/components/message/MessageContent.svelte +2 -3
  127. package/dist/components/message/MessageCopy.svelte +62 -3
  128. package/dist/components/message/MessageCopy.svelte.d.ts +17 -1
  129. package/dist/components/message/MessageHeader.svelte +3 -3
  130. package/dist/components/message/MessagePending.svelte +1 -1
  131. package/dist/components/message/MessageTime.svelte +1 -1
  132. package/dist/components/notice/Notice.svelte +14 -10
  133. package/dist/components/plan/Plan.svelte +22 -17
  134. package/dist/components/progress/Progress.svelte +31 -33
  135. package/dist/components/questionnaire/Questionnaire.svelte +19 -22
  136. package/dist/components/queued-message/QueuedMessage.svelte +14 -7
  137. package/dist/components/rail/RailItem.svelte +37 -34
  138. package/dist/components/rail/RailItem.svelte.d.ts +3 -1
  139. package/dist/components/rail/RailRoot.svelte +18 -4
  140. package/dist/components/rail/RailRoot.svelte.d.ts +1 -1
  141. package/dist/components/rail/RailSeparator.svelte +17 -0
  142. package/dist/components/rail/RailSeparator.svelte.d.ts +18 -0
  143. package/dist/components/rail/index.d.ts +2 -1
  144. package/dist/components/rail/index.js +2 -1
  145. package/dist/components/reasoning/ReasoningContent.svelte +4 -8
  146. package/dist/components/reasoning/ReasoningTrigger.svelte +2 -2
  147. package/dist/components/resize-handle/ResizeHandle.svelte +2 -3
  148. package/dist/components/segmented/SegmentedControl.svelte +7 -8
  149. package/dist/components/select/Select.svelte +1 -1
  150. package/dist/components/separator/Separator.svelte +1 -1
  151. package/dist/components/settings-row/SettingsRow.svelte +5 -5
  152. package/dist/components/shimmer/Shimmer.svelte +34 -21
  153. package/dist/components/sidebar/SidebarContent.svelte +1 -1
  154. package/dist/components/sidebar/SidebarFolder.svelte +142 -0
  155. package/dist/components/sidebar/SidebarFolder.svelte.d.ts +19 -0
  156. package/dist/components/sidebar/SidebarFooter.svelte +1 -1
  157. package/dist/components/sidebar/SidebarGroup.svelte +36 -32
  158. package/dist/components/sidebar/SidebarGroup.svelte.d.ts +3 -3
  159. package/dist/components/sidebar/SidebarHeader.svelte +12 -6
  160. package/dist/components/sidebar/SidebarHeader.svelte.d.ts +4 -1
  161. package/dist/components/sidebar/SidebarItem.svelte +26 -32
  162. package/dist/components/sidebar/SidebarRoot.svelte +62 -0
  163. package/dist/components/sidebar/SidebarRoot.svelte.d.ts +14 -0
  164. package/dist/components/sidebar/index.d.ts +5 -1
  165. package/dist/components/sidebar/index.js +3 -1
  166. package/dist/components/skeleton/Skeleton.svelte +26 -15
  167. package/dist/components/slider/Slider.svelte +11 -10
  168. package/dist/components/spinner/Spinner.svelte +4 -11
  169. package/dist/components/status-indicator/StatusIndicator.svelte +1 -1
  170. package/dist/components/suggestions/SuggestionsItem.svelte +5 -5
  171. package/dist/components/switch/Switch.svelte +9 -14
  172. package/dist/components/tab-strip/TabStrip.svelte +340 -0
  173. package/dist/components/tab-strip/TabStrip.svelte.d.ts +31 -0
  174. package/dist/components/tabs/Tabs.svelte +13 -9
  175. package/dist/components/tabs/Tabs.svelte.d.ts +4 -0
  176. package/dist/components/text/Text.svelte +31 -23
  177. package/dist/components/text/Text.svelte.d.ts +8 -4
  178. package/dist/components/toast/Toaster.svelte +5 -5
  179. package/dist/components/tool/ToolContent.svelte +3 -8
  180. package/dist/components/tool/ToolSection.svelte +4 -5
  181. package/dist/components/tool/ToolTrigger.svelte +10 -9
  182. package/dist/components/tooltip/TooltipContent.svelte +3 -3
  183. package/dist/components/work-fold/WorkFold.svelte +5 -9
  184. package/dist/index.d.ts +16 -8
  185. package/dist/index.js +17 -10
  186. package/dist/internal/Code.svelte +3 -4
  187. package/dist/internal/Glyph.svelte +16 -0
  188. package/dist/internal/Glyph.svelte.d.ts +6 -0
  189. package/dist/internal/Tile.svelte +17 -37
  190. package/dist/internal/control.d.ts +4 -4
  191. package/dist/internal/control.js +20 -17
  192. package/dist/internal/layer.d.ts +3 -5
  193. package/dist/internal/layer.js +10 -12
  194. package/dist/internal/markers.stylex.d.ts +8 -0
  195. package/dist/internal/markers.stylex.js +4 -0
  196. package/dist/internal/plugin-order.d.ts +8 -0
  197. package/dist/internal/plugin-order.js +16 -0
  198. package/dist/internal/roving.js +5 -2
  199. package/dist/internal/shared.d.ts +8 -1
  200. package/dist/internal/shared.js +21 -5
  201. package/dist/internal/sx.d.ts +1 -1
  202. package/dist/internal/toggle.d.ts +1 -2
  203. package/dist/internal/toggle.js +8 -12
  204. package/dist/internal/visible.d.ts +32 -0
  205. package/dist/internal/visible.js +44 -0
  206. package/dist/markdown/ast.d.ts +209 -0
  207. package/dist/markdown/ast.js +10 -0
  208. package/dist/markdown/blocks.d.ts +177 -0
  209. package/dist/markdown/blocks.js +1489 -0
  210. package/dist/markdown/code-info.d.ts +10 -0
  211. package/dist/markdown/code-info.js +16 -0
  212. package/dist/markdown/common.d.ts +25 -0
  213. package/dist/markdown/common.js +107 -0
  214. package/dist/markdown/diagrams.d.ts +2 -0
  215. package/dist/markdown/diagrams.js +18 -0
  216. package/dist/markdown/file-paths.d.ts +29 -0
  217. package/dist/markdown/file-paths.js +80 -0
  218. package/dist/markdown/files.d.ts +16 -0
  219. package/dist/markdown/files.js +133 -0
  220. package/dist/markdown/highlight.d.ts +30 -0
  221. package/dist/markdown/highlight.js +127 -0
  222. package/dist/markdown/html.d.ts +23 -0
  223. package/dist/markdown/html.js +289 -0
  224. package/dist/markdown/images.d.ts +15 -0
  225. package/dist/markdown/images.js +45 -0
  226. package/dist/markdown/index.d.ts +12 -0
  227. package/dist/markdown/index.js +5 -0
  228. package/dist/markdown/inlines.d.ts +48 -0
  229. package/dist/markdown/inlines.js +1714 -0
  230. package/dist/markdown/math.d.ts +2 -0
  231. package/dist/markdown/math.js +22 -0
  232. package/dist/markdown/parse.d.ts +81 -0
  233. package/dist/markdown/parse.js +204 -0
  234. package/dist/markdown/plugin.d.ts +178 -0
  235. package/dist/markdown/plugin.js +160 -0
  236. package/dist/markdown/sanitize.d.ts +78 -0
  237. package/dist/markdown/sanitize.js +522 -0
  238. package/dist/markdown/share.d.ts +12 -0
  239. package/dist/markdown/share.js +59 -0
  240. package/dist/markdown/table.d.ts +13 -0
  241. package/dist/markdown/table.js +60 -0
  242. package/dist/preset.d.ts +40 -16
  243. package/dist/preset.js +169 -51
  244. package/dist/tokens.stylex.d.ts +55 -37
  245. package/dist/tokens.stylex.js +107 -62
  246. package/dist/typography.d.ts +48 -0
  247. package/dist/typography.js +55 -0
  248. package/dist/vite.d.ts +7 -1
  249. package/dist/vite.js +27 -2
  250. package/package.json +53 -6
  251. package/skills/building-ui/SKILL.md +242 -0
  252. package/skills/building-ui/references/components.md +207 -0
  253. package/skills/markdown/SKILL.md +452 -0
  254. package/skills/markdown/references/plugins.md +103 -0
  255. package/skills/setup/SKILL.md +191 -0
  256. package/skills/styling/SKILL.md +269 -0
  257. package/skills/theming/SKILL.md +184 -0
  258. package/dist/internal/loop.d.ts +0 -35
  259. package/dist/internal/loop.js +0 -72
@@ -32,11 +32,16 @@
32
32
  children?: Snippet;
33
33
  };
34
34
 
35
+ // One short label each. What "queued" means is said on hover, not strung on with a dot.
35
36
  const STATUS: Record<QueuedMessageStatus, string> = {
36
- queued: 'Queued · sends when this turn ends',
37
- editing: 'Queued · editing',
37
+ queued: 'Queued',
38
+ editing: 'Editing',
38
39
  unsent: 'Not sent'
39
40
  };
41
+ const DETAIL: Partial<Record<QueuedMessageStatus, string>> = {
42
+ queued: 'Sends when this turn ends',
43
+ editing: 'Still queued; sends when this turn ends'
44
+ };
40
45
 
41
46
  const styles = stylex.create({
42
47
  root: {
@@ -52,9 +57,9 @@
52
57
  paddingInline: '0.875rem',
53
58
  borderRadius: radius.frame,
54
59
  backgroundColor: 'transparent',
55
- boxShadow: `inset 0 0 0 1px ${colors.lineStrong}`,
60
+ boxShadow: `inset 0 0 0 1px ${colors.borderStrong}`,
56
61
  color: colors.textMuted,
57
- fontSize: font.sizeLg,
62
+ fontSize: font.sizeReading,
58
63
  lineHeight: font.leadingNormal,
59
64
  whiteSpace: 'pre-wrap',
60
65
  overflowWrap: 'anywhere'
@@ -64,11 +69,11 @@
64
69
  boxShadow: 'none',
65
70
  outlineStyle: 'dashed',
66
71
  outlineWidth: '1px',
67
- outlineColor: colors.lineStrong,
72
+ outlineColor: colors.borderStrong,
68
73
  outlineOffset: '-1px'
69
74
  },
70
75
  foot: { display: 'flex', alignItems: 'center', gap: '0.125rem' },
71
- status: { paddingInlineEnd: '0.25rem', color: colors.textSubtle, fontSize: font.sizeXs },
76
+ status: { paddingInlineEnd: '0.25rem', color: colors.textSubtle, fontSize: font.sizeCaption },
72
77
  unsent: { color: colors.danger }
73
78
  });
74
79
  </script>
@@ -104,7 +109,9 @@
104
109
  {@render children?.()}
105
110
  </div>
106
111
  <div {...stylex.attrs(styles.foot)}>
107
- <span {...stylex.attrs(styles.status, status === 'unsent' && styles.unsent)}
112
+ <span
113
+ title={statusText ? undefined : DETAIL[status]}
114
+ {...stylex.attrs(styles.status, status === 'unsent' && styles.unsent)}
108
115
  >{statusText ?? STATUS[status]}</span
109
116
  >
110
117
  <Tooltip.Provider delayDuration={400}>
@@ -16,11 +16,13 @@
16
16
  current?: boolean;
17
17
  /** A count, or `true` for a dot: something there wants attention. */
18
18
  badge?: number | boolean;
19
+ /** What the badge says: `live` (the default) for something new, `success` for something up and well. */
20
+ badgeTone?: 'live' | 'success';
19
21
  /** The keys that go there, shown in the tooltip. */
20
22
  shortcut?: string[];
21
23
  sx?: Sx;
22
24
  class?: string;
23
- /** A 16 to 20px icon, or a mark. */
25
+ /** A 16 to 20px icon, or a letter. */
24
26
  children?: Snippet;
25
27
  };
26
28
 
@@ -30,24 +32,30 @@
30
32
  display: 'grid',
31
33
  placeItems: 'center',
32
34
  flexShrink: 0,
33
- width: '2.25rem',
34
- height: '2.25rem',
35
+ width: '2.125rem',
36
+ height: '2.125rem',
35
37
  margin: 0,
36
38
  padding: 0,
37
39
  borderWidth: 0,
38
- borderRadius: radius.lg,
40
+ borderRadius: radius.panel,
39
41
  backgroundColor: {
40
42
  default: 'transparent',
41
- ':hover': { default: null, [media.hover]: colors.hover }
43
+ ':hover': { default: null, [media.hover]: colors.fillHover }
42
44
  },
43
45
  color: {
44
46
  default: colors.textSubtle,
45
47
  ':hover': { default: null, [media.hover]: colors.text }
46
48
  },
49
+ fontFamily: 'inherit',
50
+ fontSize: font.sizeMeta,
51
+ fontWeight: font.weightSemibold,
52
+ lineHeight: 1,
47
53
  cursor: 'pointer',
48
54
  textDecoration: 'none',
49
55
  WebkitTapHighlightColor: 'transparent',
50
- scale: { default: null, ':active': { default: null, [media.motion]: 0.95 } },
56
+ // The tile is 34px; its hit area reaches 40px, as far as the gap to the next tile allows
57
+ '::after': { content: '""', position: 'absolute', inset: '-3px' },
58
+ scale: { default: null, ':active': { default: null, [media.motion]: 0.96 } },
51
59
  transitionProperty: {
52
60
  default: 'background-color, color',
53
61
  [media.motion]: 'background-color, color, scale'
@@ -55,39 +63,25 @@
55
63
  transitionDuration: motion.fast,
56
64
  transitionTimingFunction: 'ease'
57
65
  },
58
- // The open place: lifted, with ithildin at the rail's edge
66
+ // The open place: a fill, as the open row of a list has
59
67
  current: {
60
- backgroundColor: { default: colors.surfaceRaised, ':hover': colors.surfaceRaised },
61
- boxShadow: `inset 0 0 0 1px ${colors.line}, 0 1px 2px ${colors.shade}`,
62
- color: colors.text,
63
- '::before': {
64
- content: '""',
65
- position: 'absolute',
66
- insetInlineStart: '-0.5rem',
67
- top: '25%',
68
- bottom: '25%',
69
- width: '2px',
70
- borderRadius: '2px',
71
- backgroundColor: { default: colors.ithil, [media.forcedColors]: 'Highlight' },
72
- boxShadow: `0 0 8px ${colors.glow}`,
73
- forcedColorAdjust: 'none'
74
- }
68
+ backgroundColor: { default: colors.fillSelected, ':hover': colors.fillSelected },
69
+ color: colors.text
75
70
  },
76
71
  badge: {
77
72
  position: 'absolute',
78
- top: '0.125rem',
79
- insetInlineEnd: '0.125rem',
73
+ top: '-0.25rem',
74
+ insetInlineEnd: '-0.25rem',
80
75
  display: 'grid',
81
76
  placeItems: 'center',
82
77
  minWidth: '1rem',
83
78
  height: '1rem',
84
79
  paddingInline: '0.25rem',
85
80
  boxSizing: 'border-box',
86
- borderRadius: radius.full,
87
- backgroundColor: colors.ithil,
88
- boxShadow: `0 0 0 2px ${colors.bg}`,
89
- color: colors.onIthil,
90
- fontSize: '0.625rem',
81
+ borderRadius: radius.pill,
82
+ backgroundColor: colors.accent,
83
+ color: colors.onAccent,
84
+ fontSize: font.sizeMicro,
91
85
  fontWeight: font.weightSemibold,
92
86
  fontVariantNumeric: 'tabular-nums',
93
87
  lineHeight: 1
@@ -96,9 +90,10 @@
96
90
  minWidth: '0.5rem',
97
91
  height: '0.5rem',
98
92
  padding: 0,
99
- top: '0.375rem',
100
- insetInlineEnd: '0.375rem'
93
+ top: '0.3125rem',
94
+ insetInlineEnd: '0.3125rem'
101
95
  },
96
+ badgeSuccess: { backgroundColor: colors.success },
102
97
  hidden: {
103
98
  position: 'absolute',
104
99
  width: '1px',
@@ -117,6 +112,7 @@
117
112
  onclick,
118
113
  current = false,
119
114
  badge,
115
+ badgeTone = 'live',
120
116
  shortcut,
121
117
  sx,
122
118
  class: className,
@@ -130,11 +126,18 @@
130
126
  {#snippet face()}
131
127
  {@render children?.()}
132
128
  {#if count !== undefined}
133
- <span aria-hidden="true" {...stylex.attrs(styles.badge)}>{count > 99 ? '99+' : count}</span>
129
+ <span
130
+ aria-hidden="true"
131
+ {...stylex.attrs(styles.badge, badgeTone === 'success' && styles.badgeSuccess)}
132
+ >{count > 99 ? '99+' : count}</span
133
+ >
134
134
  <span {...stylex.attrs(styles.hidden)}>, {count} new</span>
135
135
  {:else if dot}
136
- <span aria-hidden="true" {...stylex.attrs(styles.badge, styles.dot)}></span>
137
- <span {...stylex.attrs(styles.hidden)}>, new</span>
136
+ <span
137
+ aria-hidden="true"
138
+ {...stylex.attrs(styles.badge, styles.dot, badgeTone === 'success' && styles.badgeSuccess)}
139
+ ></span>
140
+ <span {...stylex.attrs(styles.hidden)}>{badgeTone === 'success' ? ', online' : ', new'}</span>
138
141
  {/if}
139
142
  {/snippet}
140
143
 
@@ -9,11 +9,13 @@ export type RailItemProps = {
9
9
  current?: boolean;
10
10
  /** A count, or `true` for a dot: something there wants attention. */
11
11
  badge?: number | boolean;
12
+ /** What the badge says: `live` (the default) for something new, `success` for something up and well. */
13
+ badgeTone?: 'live' | 'success';
12
14
  /** The keys that go there, shown in the tooltip. */
13
15
  shortcut?: string[];
14
16
  sx?: Sx;
15
17
  class?: string;
16
- /** A 16 to 20px icon, or a mark. */
18
+ /** A 16 to 20px icon, or a letter. */
17
19
  children?: Snippet;
18
20
  };
19
21
  declare const RailItem: import("svelte").Component<RailItemProps, {}, "">;
@@ -1,3 +1,10 @@
1
+ <!--
2
+ A narrow strip of places to go: workspaces, tools, settings. One tab stop, and
3
+ each item is named by a tooltip.
4
+
5
+ It stands on its own anywhere there is a height to fill, and is the rail of an
6
+ app shell when it is put in AppShell.Rail. It has no surface or edge of its own.
7
+ -->
1
8
  <script lang="ts" module>
2
9
  import * as stylex from '@stylexjs/stylex';
3
10
  import type { Snippet } from 'svelte';
@@ -10,7 +17,7 @@
10
17
  /** Names it for assistive technology: "Workspaces". */
11
18
  label: string;
12
19
  sx?: Sx;
13
- /** Rail.Item buttons; anything after a `Rail.Spacer` sits at the bottom. */
20
+ /** Rail.Item buttons, with a Rail.Separator between kinds; anything after a `Rail.Spacer` sits at the bottom. */
14
21
  children?: Snippet;
15
22
  };
16
23
 
@@ -19,9 +26,16 @@
19
26
  display: 'flex',
20
27
  flexDirection: 'column',
21
28
  alignItems: 'center',
22
- gap: '0.25rem',
23
- width: '100%',
24
- paddingBlock: '0.5rem',
29
+ gap: '0.375rem',
30
+ boxSizing: 'border-box',
31
+ flexShrink: 0,
32
+ // As wide as an app shell's rail, in one or out of one, and as tall as its place
33
+ width: 'var(--narvi-rail-width, 3.25rem)',
34
+ height: '100%',
35
+ minHeight: 0,
36
+ // The first tile is centred on the line of the sheet's 3rem heads
37
+ paddingTop: '0.4375rem',
38
+ paddingBottom: '0.625rem',
25
39
  overflowY: 'auto',
26
40
  scrollbarWidth: 'none'
27
41
  }
@@ -5,7 +5,7 @@ export type RailRootProps = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
5
5
  /** Names it for assistive technology: "Workspaces". */
6
6
  label: string;
7
7
  sx?: Sx;
8
- /** Rail.Item buttons; anything after a `Rail.Spacer` sits at the bottom. */
8
+ /** Rail.Item buttons, with a Rail.Separator between kinds; anything after a `Rail.Spacer` sits at the bottom. */
9
9
  children?: Snippet;
10
10
  };
11
11
  declare const RailRoot: import("svelte").Component<RailRootProps, {}, "">;
@@ -0,0 +1,17 @@
1
+ <!-- A short hairline between two kinds of thing in a rail: workspaces, then tools. -->
2
+ <script lang="ts" module>
3
+ import * as stylex from '@stylexjs/stylex';
4
+ import { colors } from '../../tokens.stylex.js';
5
+
6
+ const styles = stylex.create({
7
+ separator: {
8
+ flexShrink: 0,
9
+ width: '0.875rem',
10
+ height: '1px',
11
+ marginBlock: '0.25rem',
12
+ backgroundColor: colors.borderStrong
13
+ }
14
+ });
15
+ </script>
16
+
17
+ <div data-slot="rail-separator" role="separator" {...stylex.attrs(styles.separator)}></div>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const RailSeparator: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type RailSeparator = InstanceType<typeof RailSeparator>;
18
+ export default RailSeparator;
@@ -1,6 +1,7 @@
1
1
  import Item from './RailItem.svelte';
2
2
  import Root from './RailRoot.svelte';
3
+ import Separator from './RailSeparator.svelte';
3
4
  import Spacer from './RailSpacer.svelte';
4
- export { Root, Item, Spacer };
5
+ export { Root, Item, Separator, Spacer };
5
6
  export type { RailItemProps } from './RailItem.svelte';
6
7
  export type { RailRootProps } from './RailRoot.svelte';
@@ -1,4 +1,5 @@
1
1
  import Item from './RailItem.svelte';
2
2
  import Root from './RailRoot.svelte';
3
+ import Separator from './RailSeparator.svelte';
3
4
  import Spacer from './RailSpacer.svelte';
4
- export { Root, Item, Spacer };
5
+ export { Root, Item, Separator, Spacer };
@@ -15,21 +15,17 @@
15
15
  };
16
16
 
17
17
  const styles = stylex.create({
18
- // The thoughts hang from a rail under the bulb, set apart from the answer and
19
- // quieter than it; their text lines up with the label above
18
+ // The thoughts are set in under the bulb, in line with the label above, and are
19
+ // quieter than the answer
20
20
  thoughts: {
21
21
  display: 'flex',
22
22
  flexDirection: 'column',
23
23
  gap: '0.5rem',
24
24
  marginTop: '0.375rem',
25
25
  marginBottom: '0.25rem',
26
- marginInlineStart: 'calc(0.75rem - 0.5px)',
27
- paddingInlineStart: 'calc(1.375rem - 0.5px)',
28
- borderInlineStartWidth: '1px',
29
- borderInlineStartStyle: 'solid',
30
- borderInlineStartColor: colors.line,
26
+ paddingInlineStart: '1.625rem',
31
27
  color: colors.textMuted,
32
- fontSize: font.sizeMd,
28
+ fontSize: font.sizeBody,
33
29
  lineHeight: font.leadingNormal,
34
30
  overflowWrap: 'break-word'
35
31
  }
@@ -30,14 +30,14 @@
30
30
  margin: 0,
31
31
  padding: 0,
32
32
  borderWidth: 0,
33
- borderRadius: radius.xs,
33
+ borderRadius: radius.chip,
34
34
  backgroundColor: 'transparent',
35
35
  color: {
36
36
  default: colors.textMuted,
37
37
  ':hover': { default: null, [media.hover]: colors.text }
38
38
  },
39
39
  fontFamily: 'inherit',
40
- fontSize: font.sizeMd,
40
+ fontSize: font.sizeBody,
41
41
  lineHeight: 1,
42
42
  cursor: 'pointer',
43
43
  WebkitTapHighlightColor: 'transparent',
@@ -52,11 +52,10 @@
52
52
  position: 'absolute',
53
53
  backgroundColor: {
54
54
  default: 'transparent',
55
- ':hover': { default: null, [media.hover]: colors.ithil },
55
+ ':hover': { default: null, [media.hover]: colors.accent },
56
56
  ':focus-visible': colors.focusRing,
57
57
  [media.forcedColors]: 'CanvasText'
58
58
  },
59
- boxShadow: { default: null, ':hover': `0 0 8px ${colors.glow}` },
60
59
  transitionProperty: 'background-color',
61
60
  transitionDuration: motion.base,
62
61
  transitionTimingFunction: 'ease',
@@ -76,7 +75,7 @@
76
75
  '::after': { insetInline: 0, top: 'calc(50% - 1px)', height: '2px' }
77
76
  },
78
77
  dragging: {
79
- '::after': { backgroundColor: colors.ithil, transitionDelay: '0ms' }
78
+ '::after': { backgroundColor: colors.accent, transitionDelay: '0ms' }
80
79
  }
81
80
  });
82
81
  </script>
@@ -27,9 +27,8 @@
27
27
  gridAutoColumns: '1fr',
28
28
  boxSizing: 'border-box',
29
29
  padding: '0.1875rem',
30
- borderRadius: `calc(${radius.sm} + 0.1875rem)`,
31
- backgroundColor: colors.well,
32
- boxShadow: `inset 0 0 0 1px ${colors.line}, inset 0 1px 2px ${colors.shade}`,
30
+ borderRadius: `calc(${radius.item} + 0.1875rem)`,
31
+ backgroundColor: colors.fillSunken,
33
32
  fontFamily: font.body,
34
33
  outlineStyle: 'solid',
35
34
  outlineWidth: '1px',
@@ -49,9 +48,9 @@
49
48
  default: 'calc(var(--narvi-seg-index) * 100%) 0',
50
49
  ':dir(rtl)': 'calc(var(--narvi-seg-index) * -100%) 0'
51
50
  },
52
- borderRadius: radius.sm,
53
- backgroundColor: { default: colors.surfaceRaised, [media.forcedColors]: 'Canvas' },
54
- boxShadow: `inset 0 0 0 1px ${colors.lineStrong}, inset 0 1px 0 ${colors.highlight}, 0 1px 3px ${colors.shade}`,
51
+ borderRadius: radius.item,
52
+ backgroundColor: { default: colors.bgRaised, [media.forcedColors]: 'Canvas' },
53
+ boxShadow: `inset 0 0 0 1px ${colors.border}`,
55
54
  outlineStyle: 'solid',
56
55
  outlineWidth: '2px',
57
56
  outlineOffset: '-2px',
@@ -88,13 +87,13 @@
88
87
  placeItems: 'center',
89
88
  minHeight: '1.75rem',
90
89
  paddingInline: '0.75rem',
91
- borderRadius: radius.sm,
90
+ borderRadius: radius.item,
92
91
  color: {
93
92
  default: colors.textMuted,
94
93
  ':hover': { default: null, [media.hover]: colors.text },
95
94
  [stylex.when.siblingBefore(':checked')]: colors.text
96
95
  },
97
- fontSize: font.sizeMd,
96
+ fontSize: font.sizeBody,
98
97
  fontWeight: {
99
98
  default: font.weightMedium,
100
99
  [stylex.when.siblingBefore(':checked')]: font.weightSemibold
@@ -56,7 +56,7 @@
56
56
  },
57
57
  placeholder: { color: colors.textSubtle },
58
58
  selector: { display: 'grid', flexShrink: 0, color: colors.textSubtle },
59
- check: { display: 'grid', marginInlineStart: 'auto', color: colors.ithil }
59
+ check: { display: 'grid', marginInlineStart: 'auto', color: colors.accent }
60
60
  });
61
61
 
62
62
  type Group = { name: string | undefined; options: SelectOption[] };
@@ -16,7 +16,7 @@
16
16
  flexShrink: 0,
17
17
  margin: 0,
18
18
  borderWidth: 0,
19
- backgroundColor: colors.line
19
+ backgroundColor: colors.border
20
20
  },
21
21
  horizontal: {
22
22
  width: '100%',
@@ -34,14 +34,14 @@
34
34
  paddingBlock: space.x4,
35
35
  borderBottomWidth: '1px',
36
36
  borderBottomStyle: 'solid',
37
- borderBottomColor: colors.line
37
+ borderBottomColor: colors.border
38
38
  },
39
39
  text: { display: 'flex', flexDirection: 'column', gap: '0.125rem', minWidth: 0 },
40
- label: { color: colors.text, fontSize: font.sizeMd, fontWeight: font.weightMedium },
40
+ label: { color: colors.text, fontSize: font.sizeBody, fontWeight: font.weightMedium },
41
41
  description: {
42
42
  margin: 0,
43
43
  color: colors.textMuted,
44
- fontSize: font.sizeSm,
44
+ fontSize: font.sizeMeta,
45
45
  lineHeight: font.leadingSnug
46
46
  },
47
47
  control: {
@@ -50,9 +50,9 @@
50
50
  alignItems: { default: 'flex-start', [WIDE]: 'flex-end' },
51
51
  gap: '0.375rem'
52
52
  },
53
- note: { margin: 0, fontSize: font.sizeSm, lineHeight: font.leadingSnug },
53
+ note: { margin: 0, fontSize: font.sizeMeta, lineHeight: font.leadingSnug },
54
54
  error: { color: colors.danger },
55
- warning: { color: colors.warningInk }
55
+ warning: { color: colors.warningText }
56
56
  });
57
57
  </script>
58
58
 
@@ -2,9 +2,9 @@
2
2
  import * as stylex from '@stylexjs/stylex';
3
3
  import type { Snippet } from 'svelte';
4
4
  import type { HTMLAttributes } from 'svelte/elements';
5
- import { loop } from '../../internal/loop.js';
6
5
  import { attrs, type Sx } from '../../internal/sx.js';
7
- import { colors } from '../../tokens.stylex.js';
6
+ import { whileVisible } from '../../internal/visible.js';
7
+ import { colors, play } from '../../tokens.stylex.js';
8
8
  import { media } from '../../media.stylex.js';
9
9
 
10
10
  export type ShimmerProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
@@ -14,12 +14,28 @@
14
14
  children?: Snippet;
15
15
  };
16
16
 
17
+ // A band of light crosses the line, start to end
18
+ const glint = stylex.keyframes({
19
+ from: { backgroundPosition: '100% 0' },
20
+ to: { backgroundPosition: '0% 0' }
21
+ });
22
+ const glintRtl = stylex.keyframes({
23
+ from: { backgroundPosition: '0% 0' },
24
+ to: { backgroundPosition: '100% 0' }
25
+ });
26
+ // With less motion asked for, the text breathes in place instead
27
+ const breathe = stylex.keyframes({
28
+ '0%': { opacity: 1 },
29
+ '50%': { opacity: 0.55 },
30
+ '100%': { opacity: 1 }
31
+ });
32
+
17
33
  const styles = stylex.create({
18
34
  // Inline, so it wraps and truncates like the text around it
19
35
  base: {
20
36
  display: 'inline'
21
37
  },
22
- // Ithildin: the letters are only half there until moonlight passes over them
38
+ // The letters are only half there until a band of the accent passes over them
23
39
  active: {
24
40
  color: {
25
41
  default: 'transparent',
@@ -27,30 +43,27 @@
27
43
  [media.forcedColors]: 'CanvasText'
28
44
  },
29
45
  backgroundImage: {
30
- default: `linear-gradient(90deg, ${colors.textSubtle} 0%, ${colors.textSubtle} 40%, ${colors.ithil} 50%, ${colors.textSubtle} 60%, ${colors.textSubtle} 100%)`,
46
+ default: `linear-gradient(90deg, ${colors.textSubtle} 0%, ${colors.textSubtle} 40%, ${colors.accent} 50%, ${colors.textSubtle} 60%, ${colors.textSubtle} 100%)`,
31
47
  [media.reducedMotion]: 'none',
32
48
  [media.forcedColors]: 'none'
33
49
  },
34
50
  backgroundSize: '300% 100%',
35
51
  backgroundClip: 'text',
36
- WebkitBackgroundClip: 'text'
52
+ WebkitBackgroundClip: 'text',
53
+ // Stepped: thirty frames in 2.2 seconds is about fourteen a second, which reads as
54
+ // smooth for a slow band of light and leaves the display's other frames alone
55
+ animationName: {
56
+ default: glint,
57
+ ':dir(rtl)': glintRtl,
58
+ [media.reducedMotion]: breathe,
59
+ [media.forcedColors]: 'none'
60
+ },
61
+ animationDuration: { default: '2.2s', [media.reducedMotion]: '2s' },
62
+ animationTimingFunction: { default: 'steps(30)', [media.reducedMotion]: 'steps(12)' },
63
+ animationIterationCount: 'infinite',
64
+ animationPlayState: play.whileVisible
37
65
  }
38
66
  });
39
-
40
- // The band of light crosses the line every 2.2 seconds, on Narvi's shared clock.
41
- // With reduced motion the text breathes in place instead.
42
- const glint = loop(
43
- (reduced) => (reduced ? 2000 : 2200),
44
- (element, { progress, reduced, rtl }) => {
45
- if (reduced) {
46
- element.style.backgroundPosition = '';
47
- element.style.opacity = String(0.775 + 0.225 * Math.cos(progress * 2 * Math.PI));
48
- return;
49
- }
50
- element.style.opacity = '';
51
- element.style.backgroundPosition = `${rtl ? progress * 100 : 100 - progress * 100}% 0`;
52
- }
53
- );
54
67
  </script>
55
68
 
56
69
  <script lang="ts">
@@ -62,7 +75,7 @@
62
75
  data-active={active || undefined}
63
76
  {...rest}
64
77
  {...attrs([styles.base, active && styles.active, sx], className)}
65
- {@attach active && glint}
78
+ {@attach active && whileVisible}
66
79
  >
67
80
  {@render children?.()}
68
81
  </span>
@@ -23,7 +23,7 @@
23
23
  paddingInline: '0.5rem',
24
24
  paddingBottom: '0.75rem',
25
25
  scrollbarWidth: 'thin',
26
- scrollbarColor: `${colors.lineStrong} transparent`,
26
+ scrollbarColor: `${colors.borderStrong} transparent`,
27
27
  // The list fades at an edge with more beyond it
28
28
  maskImage:
29
29
  'linear-gradient(to bottom, transparent, #000 var(--narvi-fade-start, 0px), #000 calc(100% - var(--narvi-fade-end, 0px)), transparent)'