@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.
- package/README.md +102 -41
- package/dist/base.css +2 -2
- package/dist/color.d.ts +1 -1
- package/dist/color.js +1 -1
- package/dist/components/activity/ActivityContent.svelte +3 -15
- package/dist/components/activity/ActivityStep.svelte +12 -12
- package/dist/components/activity/ActivityThought.svelte +4 -4
- package/dist/components/activity/ActivityTrigger.svelte +3 -3
- package/dist/components/app-shell/AppShellBar.svelte +89 -0
- package/dist/components/app-shell/AppShellBar.svelte.d.ts +20 -0
- package/dist/components/app-shell/AppShellHeader.svelte +17 -16
- package/dist/components/app-shell/AppShellHeader.svelte.d.ts +2 -2
- package/dist/components/app-shell/AppShellMain.svelte +4 -20
- package/dist/components/app-shell/AppShellPanel.svelte +21 -19
- package/dist/components/app-shell/AppShellPanes.svelte +58 -0
- package/dist/components/app-shell/AppShellPanes.svelte.d.ts +11 -0
- package/dist/components/app-shell/AppShellRail.svelte +85 -0
- package/dist/components/app-shell/AppShellRail.svelte.d.ts +11 -0
- package/dist/components/app-shell/AppShellRoot.svelte +50 -24
- package/dist/components/app-shell/AppShellRoot.svelte.d.ts +8 -6
- package/dist/components/app-shell/AppShellSheet.svelte +95 -0
- package/dist/components/app-shell/AppShellSheet.svelte.d.ts +17 -0
- package/dist/components/app-shell/AppShellSidebar.svelte +37 -61
- package/dist/components/app-shell/AppShellSidebar.svelte.d.ts +1 -5
- package/dist/components/app-shell/AppShellToggle.svelte +62 -23
- package/dist/components/app-shell/AppShellToggle.svelte.d.ts +2 -0
- package/dist/components/app-shell/context.d.ts +6 -0
- package/dist/components/app-shell/index.d.ts +9 -1
- package/dist/components/app-shell/index.js +5 -1
- package/dist/components/approval/Approval.svelte +91 -19
- package/dist/components/approval/Approval.svelte.d.ts +7 -0
- package/dist/components/avatar/AvatarFallback.svelte +1 -2
- package/dist/components/avatar/AvatarRoot.svelte +2 -2
- package/dist/components/badge/Badge.svelte +5 -5
- package/dist/components/button/Button.svelte +219 -40
- package/dist/components/button/Button.svelte.d.ts +38 -2
- package/dist/components/card/Card.svelte +15 -26
- package/dist/components/change-stats/ChangeStats.svelte +1 -2
- package/dist/components/changes-summary/ChangesSummary.svelte +14 -15
- package/dist/components/checkbox/Checkbox.svelte +18 -15
- package/dist/components/checkbox/Checkbox.svelte.d.ts +5 -0
- package/dist/components/code/Code.svelte +1 -2
- package/dist/components/collapsible/CollapsibleTrigger.svelte +2 -2
- package/dist/components/command/CommandItem.svelte +1 -1
- package/dist/components/command/styles.d.ts +3 -2
- package/dist/components/command/styles.js +13 -10
- package/dist/components/composer/ComposerAttachButton.svelte +1 -1
- package/dist/components/composer/ComposerAttachment.svelte +9 -12
- package/dist/components/composer/ComposerModelPicker.svelte +18 -20
- package/dist/components/composer/ComposerRoot.svelte +8 -7
- package/dist/components/composer/ComposerSubmit.svelte +8 -15
- package/dist/components/composer/ComposerTextarea.svelte +1 -1
- package/dist/components/composer/ComposerToggle.svelte +9 -11
- package/dist/components/composer/ComposerTray.svelte +78 -0
- package/dist/components/composer/ComposerTray.svelte.d.ts +15 -0
- package/dist/components/composer/index.d.ts +3 -1
- package/dist/components/composer/index.js +3 -2
- package/dist/components/conversation/ConversationContent.svelte +3 -2
- package/dist/components/conversation/ConversationEmpty.svelte +1 -1
- package/dist/components/conversation/ConversationScrollButton.svelte +3 -3
- package/dist/components/dialog/ConfirmDialog.svelte +1 -1
- package/dist/components/dialog/styles.d.ts +2 -3
- package/dist/components/dialog/styles.js +5 -6
- package/dist/components/divider/Divider.svelte +3 -3
- package/dist/components/empty-state/EmptyState.svelte +4 -5
- package/dist/components/field/Field.svelte +4 -4
- package/dist/components/frame/Frame.svelte +6 -7
- package/dist/components/frame/Frame.svelte.d.ts +1 -1
- package/dist/components/heading/Heading.svelte +2 -2
- package/dist/components/kbd/Kbd.svelte +12 -7
- package/dist/components/link/Link.svelte +7 -3
- package/dist/components/link/Link.svelte.d.ts +4 -1
- package/dist/components/markdown/Markdown.svelte +714 -0
- package/dist/components/markdown/Markdown.svelte.d.ts +80 -0
- package/dist/components/markdown/MarkdownBlock.svelte +231 -0
- package/dist/components/markdown/MarkdownBlock.svelte.d.ts +11 -0
- package/dist/components/markdown/MarkdownBlocks.svelte +115 -0
- package/dist/components/markdown/MarkdownBlocks.svelte.d.ts +15 -0
- package/dist/components/markdown/MarkdownCode.svelte +583 -0
- package/dist/components/markdown/MarkdownCode.svelte.d.ts +23 -0
- package/dist/components/markdown/MarkdownDiagram.svelte +310 -0
- package/dist/components/markdown/MarkdownDiagram.svelte.d.ts +6 -0
- package/dist/components/markdown/MarkdownFile.svelte +134 -0
- package/dist/components/markdown/MarkdownFile.svelte.d.ts +19 -0
- package/dist/components/markdown/MarkdownFootnotes.svelte +61 -0
- package/dist/components/markdown/MarkdownFootnotes.svelte.d.ts +8 -0
- package/dist/components/markdown/MarkdownFresh.svelte +69 -0
- package/dist/components/markdown/MarkdownFresh.svelte.d.ts +6 -0
- package/dist/components/markdown/MarkdownHtml.svelte +72 -0
- package/dist/components/markdown/MarkdownHtml.svelte.d.ts +7 -0
- package/dist/components/markdown/MarkdownImage.svelte +150 -0
- package/dist/components/markdown/MarkdownImage.svelte.d.ts +8 -0
- package/dist/components/markdown/MarkdownInlines.svelte +225 -0
- package/dist/components/markdown/MarkdownInlines.svelte.d.ts +7 -0
- package/dist/components/markdown/MarkdownLink.svelte +120 -0
- package/dist/components/markdown/MarkdownLink.svelte.d.ts +25 -0
- package/dist/components/markdown/MarkdownMath.svelte +138 -0
- package/dist/components/markdown/MarkdownMath.svelte.d.ts +7 -0
- package/dist/components/markdown/MarkdownTable.svelte +265 -0
- package/dist/components/markdown/MarkdownTable.svelte.d.ts +17 -0
- package/dist/components/markdown/caret.d.ts +14 -0
- package/dist/components/markdown/caret.js +67 -0
- package/dist/components/markdown/context.d.ts +93 -0
- package/dist/components/markdown/context.js +128 -0
- package/dist/components/markdown/copy.d.ts +13 -0
- package/dist/components/markdown/copy.js +74 -0
- package/dist/components/markdown/hidden.d.ts +12 -0
- package/dist/components/markdown/hidden.js +31 -0
- package/dist/components/markdown/kept.d.ts +32 -0
- package/dist/components/markdown/kept.js +71 -0
- package/dist/components/markdown/labels.d.ts +46 -0
- package/dist/components/markdown/labels.js +35 -0
- package/dist/components/markdown/save.d.ts +11 -0
- package/dist/components/markdown/save.js +58 -0
- package/dist/components/markdown/scrollable.d.ts +24 -0
- package/dist/components/markdown/scrollable.js +152 -0
- package/dist/components/markdown/static.d.ts +37 -0
- package/dist/components/markdown/static.js +233 -0
- package/dist/components/markdown/styles.d.ts +328 -0
- package/dist/components/markdown/styles.js +302 -0
- package/dist/components/menu/MenuRadioItem.svelte +3 -3
- package/dist/components/menu/index.d.ts +23 -0
- package/dist/components/menu/index.js +3 -1
- package/dist/components/message/MessageAction.svelte +22 -2
- package/dist/components/message/MessageAction.svelte.d.ts +9 -0
- package/dist/components/message/MessageContent.svelte +2 -3
- package/dist/components/message/MessageCopy.svelte +62 -3
- package/dist/components/message/MessageCopy.svelte.d.ts +17 -1
- package/dist/components/message/MessageHeader.svelte +3 -3
- package/dist/components/message/MessagePending.svelte +1 -1
- package/dist/components/message/MessageTime.svelte +1 -1
- package/dist/components/notice/Notice.svelte +14 -10
- package/dist/components/plan/Plan.svelte +22 -17
- package/dist/components/progress/Progress.svelte +31 -33
- package/dist/components/questionnaire/Questionnaire.svelte +19 -22
- package/dist/components/queued-message/QueuedMessage.svelte +14 -7
- package/dist/components/rail/RailItem.svelte +37 -34
- package/dist/components/rail/RailItem.svelte.d.ts +3 -1
- package/dist/components/rail/RailRoot.svelte +18 -4
- package/dist/components/rail/RailRoot.svelte.d.ts +1 -1
- package/dist/components/rail/RailSeparator.svelte +17 -0
- package/dist/components/rail/RailSeparator.svelte.d.ts +18 -0
- package/dist/components/rail/index.d.ts +2 -1
- package/dist/components/rail/index.js +2 -1
- package/dist/components/reasoning/ReasoningContent.svelte +4 -8
- package/dist/components/reasoning/ReasoningTrigger.svelte +2 -2
- package/dist/components/resize-handle/ResizeHandle.svelte +2 -3
- package/dist/components/segmented/SegmentedControl.svelte +7 -8
- package/dist/components/select/Select.svelte +1 -1
- package/dist/components/separator/Separator.svelte +1 -1
- package/dist/components/settings-row/SettingsRow.svelte +5 -5
- package/dist/components/shimmer/Shimmer.svelte +34 -21
- package/dist/components/sidebar/SidebarContent.svelte +1 -1
- package/dist/components/sidebar/SidebarFolder.svelte +142 -0
- package/dist/components/sidebar/SidebarFolder.svelte.d.ts +19 -0
- package/dist/components/sidebar/SidebarFooter.svelte +1 -1
- package/dist/components/sidebar/SidebarGroup.svelte +36 -32
- package/dist/components/sidebar/SidebarGroup.svelte.d.ts +3 -3
- package/dist/components/sidebar/SidebarHeader.svelte +12 -6
- package/dist/components/sidebar/SidebarHeader.svelte.d.ts +4 -1
- package/dist/components/sidebar/SidebarItem.svelte +26 -32
- package/dist/components/sidebar/SidebarRoot.svelte +62 -0
- package/dist/components/sidebar/SidebarRoot.svelte.d.ts +14 -0
- package/dist/components/sidebar/index.d.ts +5 -1
- package/dist/components/sidebar/index.js +3 -1
- package/dist/components/skeleton/Skeleton.svelte +26 -15
- package/dist/components/slider/Slider.svelte +11 -10
- package/dist/components/spinner/Spinner.svelte +4 -11
- package/dist/components/status-indicator/StatusIndicator.svelte +1 -1
- package/dist/components/suggestions/SuggestionsItem.svelte +5 -5
- package/dist/components/switch/Switch.svelte +9 -14
- package/dist/components/tab-strip/TabStrip.svelte +340 -0
- package/dist/components/tab-strip/TabStrip.svelte.d.ts +31 -0
- package/dist/components/tabs/Tabs.svelte +13 -9
- package/dist/components/tabs/Tabs.svelte.d.ts +4 -0
- package/dist/components/text/Text.svelte +31 -23
- package/dist/components/text/Text.svelte.d.ts +8 -4
- package/dist/components/toast/Toaster.svelte +5 -5
- package/dist/components/tool/ToolContent.svelte +3 -8
- package/dist/components/tool/ToolSection.svelte +4 -5
- package/dist/components/tool/ToolTrigger.svelte +10 -9
- package/dist/components/tooltip/TooltipContent.svelte +3 -3
- package/dist/components/work-fold/WorkFold.svelte +5 -9
- package/dist/index.d.ts +16 -8
- package/dist/index.js +17 -10
- package/dist/internal/Code.svelte +3 -4
- package/dist/internal/Glyph.svelte +16 -0
- package/dist/internal/Glyph.svelte.d.ts +6 -0
- package/dist/internal/Tile.svelte +17 -37
- package/dist/internal/control.d.ts +4 -4
- package/dist/internal/control.js +20 -17
- package/dist/internal/layer.d.ts +3 -5
- package/dist/internal/layer.js +10 -12
- package/dist/internal/markers.stylex.d.ts +8 -0
- package/dist/internal/markers.stylex.js +4 -0
- package/dist/internal/plugin-order.d.ts +8 -0
- package/dist/internal/plugin-order.js +16 -0
- package/dist/internal/roving.js +5 -2
- package/dist/internal/shared.d.ts +8 -1
- package/dist/internal/shared.js +21 -5
- package/dist/internal/sx.d.ts +1 -1
- package/dist/internal/toggle.d.ts +1 -2
- package/dist/internal/toggle.js +8 -12
- package/dist/internal/visible.d.ts +32 -0
- package/dist/internal/visible.js +44 -0
- package/dist/markdown/ast.d.ts +209 -0
- package/dist/markdown/ast.js +10 -0
- package/dist/markdown/blocks.d.ts +177 -0
- package/dist/markdown/blocks.js +1489 -0
- package/dist/markdown/code-info.d.ts +10 -0
- package/dist/markdown/code-info.js +16 -0
- package/dist/markdown/common.d.ts +25 -0
- package/dist/markdown/common.js +107 -0
- package/dist/markdown/diagrams.d.ts +2 -0
- package/dist/markdown/diagrams.js +18 -0
- package/dist/markdown/file-paths.d.ts +29 -0
- package/dist/markdown/file-paths.js +80 -0
- package/dist/markdown/files.d.ts +16 -0
- package/dist/markdown/files.js +133 -0
- package/dist/markdown/highlight.d.ts +30 -0
- package/dist/markdown/highlight.js +127 -0
- package/dist/markdown/html.d.ts +23 -0
- package/dist/markdown/html.js +289 -0
- package/dist/markdown/images.d.ts +15 -0
- package/dist/markdown/images.js +45 -0
- package/dist/markdown/index.d.ts +12 -0
- package/dist/markdown/index.js +5 -0
- package/dist/markdown/inlines.d.ts +48 -0
- package/dist/markdown/inlines.js +1714 -0
- package/dist/markdown/math.d.ts +2 -0
- package/dist/markdown/math.js +22 -0
- package/dist/markdown/parse.d.ts +81 -0
- package/dist/markdown/parse.js +204 -0
- package/dist/markdown/plugin.d.ts +178 -0
- package/dist/markdown/plugin.js +160 -0
- package/dist/markdown/sanitize.d.ts +78 -0
- package/dist/markdown/sanitize.js +522 -0
- package/dist/markdown/share.d.ts +12 -0
- package/dist/markdown/share.js +59 -0
- package/dist/markdown/table.d.ts +13 -0
- package/dist/markdown/table.js +60 -0
- package/dist/preset.d.ts +40 -16
- package/dist/preset.js +169 -51
- package/dist/tokens.stylex.d.ts +55 -37
- package/dist/tokens.stylex.js +107 -62
- package/dist/typography.d.ts +48 -0
- package/dist/typography.js +55 -0
- package/dist/vite.d.ts +7 -1
- package/dist/vite.js +27 -2
- package/package.json +53 -6
- package/skills/building-ui/SKILL.md +242 -0
- package/skills/building-ui/references/components.md +207 -0
- package/skills/markdown/SKILL.md +452 -0
- package/skills/markdown/references/plugins.md +103 -0
- package/skills/setup/SKILL.md +191 -0
- package/skills/styling/SKILL.md +269 -0
- package/skills/theming/SKILL.md +184 -0
- package/dist/internal/loop.d.ts +0 -35
- 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
|
|
37
|
-
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.
|
|
60
|
+
boxShadow: `inset 0 0 0 1px ${colors.borderStrong}`,
|
|
56
61
|
color: colors.textMuted,
|
|
57
|
-
fontSize: font.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
34
|
-
height: '2.
|
|
35
|
+
width: '2.125rem',
|
|
36
|
+
height: '2.125rem',
|
|
35
37
|
margin: 0,
|
|
36
38
|
padding: 0,
|
|
37
39
|
borderWidth: 0,
|
|
38
|
-
borderRadius: radius.
|
|
40
|
+
borderRadius: radius.panel,
|
|
39
41
|
backgroundColor: {
|
|
40
42
|
default: 'transparent',
|
|
41
|
-
':hover': { default: null, [media.hover]: colors.
|
|
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
|
-
|
|
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:
|
|
66
|
+
// The open place: a fill, as the open row of a list has
|
|
59
67
|
current: {
|
|
60
|
-
backgroundColor: { default: colors.
|
|
61
|
-
|
|
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.
|
|
79
|
-
insetInlineEnd: '0.
|
|
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.
|
|
87
|
-
backgroundColor: colors.
|
|
88
|
-
|
|
89
|
-
|
|
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.
|
|
100
|
-
insetInlineEnd: '0.
|
|
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
|
|
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
|
|
137
|
-
|
|
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
|
|
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.
|
|
23
|
-
|
|
24
|
-
|
|
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';
|
|
@@ -15,21 +15,17 @@
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const styles = stylex.create({
|
|
18
|
-
// The thoughts
|
|
19
|
-
// quieter than
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
31
|
-
backgroundColor: colors.
|
|
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.
|
|
53
|
-
backgroundColor: { default: colors.
|
|
54
|
-
boxShadow: `inset 0 0 0 1px ${colors.
|
|
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.
|
|
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.
|
|
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.
|
|
59
|
+
check: { display: 'grid', marginInlineStart: 'auto', color: colors.accent }
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
type Group = { name: string | undefined; options: SelectOption[] };
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
paddingBlock: space.x4,
|
|
35
35
|
borderBottomWidth: '1px',
|
|
36
36
|
borderBottomStyle: 'solid',
|
|
37
|
-
borderBottomColor: colors.
|
|
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.
|
|
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.
|
|
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.
|
|
53
|
+
note: { margin: 0, fontSize: font.sizeMeta, lineHeight: font.leadingSnug },
|
|
54
54
|
error: { color: colors.danger },
|
|
55
|
-
warning: { color: colors.
|
|
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 {
|
|
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
|
-
//
|
|
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.
|
|
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 &&
|
|
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.
|
|
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)'
|