@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.
- package/README.md +116 -44
- package/dist/base.css +96 -0
- 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 +5 -6
- 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 -17
- 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 +41 -65
- 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 +99 -23
- 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 +227 -51
- package/dist/components/button/Button.svelte.d.ts +38 -2
- package/dist/components/card/Card.svelte +19 -33
- package/dist/components/change-stats/ChangeStats.svelte +1 -2
- package/dist/components/changes-summary/ChangesSummary.svelte +14 -15
- package/dist/components/checkbox/Checkbox.svelte +31 -25
- package/dist/components/checkbox/Checkbox.svelte.d.ts +5 -0
- package/dist/components/code/Code.svelte +1 -2
- package/dist/components/collapsible/CollapsibleContent.svelte +38 -0
- package/dist/components/collapsible/CollapsibleContent.svelte.d.ts +11 -0
- package/dist/components/collapsible/CollapsibleRoot.svelte +44 -0
- package/dist/components/collapsible/CollapsibleRoot.svelte.d.ts +11 -0
- package/dist/components/collapsible/CollapsibleTrigger.svelte +83 -0
- package/dist/components/collapsible/CollapsibleTrigger.svelte.d.ts +13 -0
- package/dist/components/collapsible/context.d.ts +5 -0
- package/dist/components/collapsible/context.js +11 -0
- package/dist/components/collapsible/index.d.ts +7 -0
- package/dist/components/collapsible/index.js +4 -0
- package/dist/components/command/CommandItem.svelte +1 -1
- package/dist/components/command/styles.d.ts +3 -2
- package/dist/components/command/styles.js +15 -12
- package/dist/components/composer/ComposerAttachButton.svelte +1 -1
- package/dist/components/composer/ComposerAttachment.svelte +13 -18
- package/dist/components/composer/ComposerModelPicker.svelte +24 -28
- package/dist/components/composer/ComposerRoot.svelte +15 -13
- package/dist/components/composer/ComposerSubmit.svelte +12 -20
- package/dist/components/composer/ComposerTextarea.svelte +1 -1
- package/dist/components/composer/ComposerToggle.svelte +16 -18
- 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 +9 -11
- package/dist/components/dialog/ConfirmDialog.svelte +1 -1
- package/dist/components/dialog/DialogContent.svelte +5 -1
- package/dist/components/dialog/styles.d.ts +2 -26
- package/dist/components/dialog/styles.js +12 -49
- 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/grid/Grid.svelte +111 -0
- package/dist/components/grid/Grid.svelte.d.ts +27 -0
- package/dist/components/heading/Heading.svelte +2 -2
- package/dist/components/hover-card/HoverCardContent.svelte +50 -0
- package/dist/components/hover-card/HoverCardContent.svelte.d.ts +10 -0
- package/dist/components/hover-card/HoverCardRoot.svelte +22 -0
- package/dist/components/hover-card/HoverCardRoot.svelte.d.ts +5 -0
- package/dist/components/hover-card/index.d.ts +7 -0
- package/dist/components/hover-card/index.js +7 -0
- package/dist/components/kbd/Kbd.svelte +12 -7
- package/dist/components/link/Link.svelte +9 -7
- 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 +24 -5
- package/dist/components/message/MessageAction.svelte.d.ts +9 -0
- package/dist/components/message/MessageActions.svelte +2 -3
- package/dist/components/message/MessageContent.svelte +2 -3
- package/dist/components/message/MessageCopy.svelte +66 -8
- 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/MessageRoot.svelte +3 -4
- package/dist/components/message/MessageTime.svelte +3 -4
- package/dist/components/notice/Notice.svelte +14 -10
- package/dist/components/plan/Plan.svelte +25 -21
- package/dist/components/progress/Progress.svelte +34 -38
- package/dist/components/questionnaire/Questionnaire.svelte +19 -22
- package/dist/components/queued-message/QueuedMessage.svelte +14 -7
- package/dist/components/rail/RailItem.svelte +43 -40
- 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 +4 -5
- package/dist/components/resize-handle/ResizeHandle.svelte +4 -7
- package/dist/components/reveal/Reveal.svelte +89 -0
- package/dist/components/reveal/Reveal.svelte.d.ts +17 -0
- package/dist/components/reveal/revealed.d.ts +38 -0
- package/dist/components/reveal/revealed.js +79 -0
- package/dist/components/segmented/SegmentedControl.svelte +11 -16
- 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/sheet/SheetContent.svelte +63 -0
- package/dist/components/sheet/SheetContent.svelte.d.ts +18 -0
- package/dist/components/sheet/index.d.ts +12 -0
- package/dist/components/sheet/index.js +12 -0
- package/dist/components/sheet/styles.d.ts +51 -0
- package/dist/components/sheet/styles.js +65 -0
- package/dist/components/shimmer/Shimmer.svelte +41 -26
- 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 +41 -35
- 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 +34 -38
- 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 +200 -0
- package/dist/components/slider/Slider.svelte.d.ts +55 -0
- package/dist/components/spinner/Spinner.svelte +4 -11
- package/dist/components/stack/Stack.svelte +37 -44
- package/dist/components/stack/Stack.svelte.d.ts +12 -6
- package/dist/components/status-indicator/StatusIndicator.svelte +1 -1
- package/dist/components/suggestions/SuggestionsItem.svelte +11 -13
- package/dist/components/switch/Switch.svelte +16 -25
- 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 +15 -14
- package/dist/components/tabs/Tabs.svelte.d.ts +4 -0
- package/dist/components/text/Text.svelte +64 -14
- package/dist/components/text/Text.svelte.d.ts +13 -3
- package/dist/components/toast/Toaster.svelte +12 -10
- package/dist/components/toggle/Toggle.svelte +40 -0
- package/dist/components/toggle/Toggle.svelte.d.ts +15 -0
- package/dist/components/toggle-group/ToggleGroupItem.svelte +37 -0
- package/dist/components/toggle-group/ToggleGroupItem.svelte.d.ts +12 -0
- package/dist/components/toggle-group/ToggleGroupRoot.svelte +95 -0
- package/dist/components/toggle-group/ToggleGroupRoot.svelte.d.ts +33 -0
- package/dist/components/toggle-group/context.d.ts +6 -0
- package/dist/components/toggle-group/context.js +11 -0
- package/dist/components/toggle-group/index.d.ts +5 -0
- package/dist/components/toggle-group/index.js +3 -0
- package/dist/components/tool/ToolContent.svelte +3 -8
- package/dist/components/tool/ToolSection.svelte +4 -5
- package/dist/components/tool/ToolTrigger.svelte +14 -15
- package/dist/components/tooltip/TooltipContent.svelte +9 -6
- package/dist/components/work-fold/WorkFold.svelte +17 -34
- package/dist/components/work-fold/WorkFold.svelte.d.ts +1 -1
- package/dist/index.d.ts +38 -10
- package/dist/index.js +38 -12
- package/dist/internal/Chevron.svelte +2 -3
- package/dist/internal/Code.svelte +3 -4
- package/dist/internal/Collapse.svelte +6 -5
- package/dist/internal/Collapse.svelte.d.ts +2 -1
- 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 +21 -18
- package/dist/internal/layer.d.ts +3 -5
- package/dist/internal/layer.js +14 -18
- package/dist/internal/layout.d.ts +13 -0
- package/dist/internal/layout.js +453 -0
- 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/responsive.d.ts +45 -0
- package/dist/internal/responsive.js +42 -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 +31 -4
- package/dist/internal/sx.js +17 -0
- package/dist/internal/toggle.d.ts +73 -0
- package/dist/internal/toggle.js +83 -0
- 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/media.stylex.d.ts +52 -0
- package/dist/media.stylex.js +53 -0
- package/dist/preset.d.ts +40 -16
- package/dist/preset.js +169 -51
- package/dist/tokens.stylex.d.ts +70 -37
- package/dist/tokens.stylex.js +127 -62
- package/dist/typography.d.ts +48 -0
- package/dist/typography.js +55 -0
- package/dist/vite.d.ts +9 -1
- package/dist/vite.js +37 -4
- package/package.json +58 -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
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import * as stylex from '@stylexjs/stylex';
|
|
2
|
+
import { media } from '../media.stylex.js';
|
|
3
|
+
import { space } from '../tokens.stylex.js';
|
|
4
|
+
const gapFixed = stylex.create({
|
|
5
|
+
0: { gap: 0 },
|
|
6
|
+
1: { gap: space.x1 },
|
|
7
|
+
2: { gap: space.x2 },
|
|
8
|
+
3: { gap: space.x3 },
|
|
9
|
+
4: { gap: space.x4 },
|
|
10
|
+
5: { gap: space.x5 },
|
|
11
|
+
6: { gap: space.x6 },
|
|
12
|
+
8: { gap: space.x8 },
|
|
13
|
+
10: { gap: space.x10 },
|
|
14
|
+
12: { gap: space.x12 },
|
|
15
|
+
16: { gap: space.x16 }
|
|
16
|
+
});
|
|
17
|
+
const gapChain = stylex.create({
|
|
18
|
+
chain: {
|
|
19
|
+
'--narvi-gap': 'initial',
|
|
20
|
+
'--narvi-gap-sm': 'initial',
|
|
21
|
+
'--narvi-gap-md': 'initial',
|
|
22
|
+
'--narvi-gap-lg': 'initial',
|
|
23
|
+
'--narvi-gap-xl': 'initial',
|
|
24
|
+
gap: {
|
|
25
|
+
default: 'var(--narvi-gap)',
|
|
26
|
+
[media.sm]: 'var(--narvi-gap-sm, var(--narvi-gap))',
|
|
27
|
+
[media.md]: 'var(--narvi-gap-md, var(--narvi-gap-sm, var(--narvi-gap)))',
|
|
28
|
+
[media.lg]: 'var(--narvi-gap-lg, var(--narvi-gap-md, var(--narvi-gap-sm, var(--narvi-gap))))',
|
|
29
|
+
[media.xl]: 'var(--narvi-gap-xl, var(--narvi-gap-lg, var(--narvi-gap-md, var(--narvi-gap-sm, var(--narvi-gap)))))'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const gapDefault = stylex.create({
|
|
34
|
+
0: { '--narvi-gap': '0px' },
|
|
35
|
+
1: { '--narvi-gap': space.x1 },
|
|
36
|
+
2: { '--narvi-gap': space.x2 },
|
|
37
|
+
3: { '--narvi-gap': space.x3 },
|
|
38
|
+
4: { '--narvi-gap': space.x4 },
|
|
39
|
+
5: { '--narvi-gap': space.x5 },
|
|
40
|
+
6: { '--narvi-gap': space.x6 },
|
|
41
|
+
8: { '--narvi-gap': space.x8 },
|
|
42
|
+
10: { '--narvi-gap': space.x10 },
|
|
43
|
+
12: { '--narvi-gap': space.x12 },
|
|
44
|
+
16: { '--narvi-gap': space.x16 }
|
|
45
|
+
});
|
|
46
|
+
const gapSm = stylex.create({
|
|
47
|
+
0: { '--narvi-gap-sm': '0px' },
|
|
48
|
+
1: { '--narvi-gap-sm': space.x1 },
|
|
49
|
+
2: { '--narvi-gap-sm': space.x2 },
|
|
50
|
+
3: { '--narvi-gap-sm': space.x3 },
|
|
51
|
+
4: { '--narvi-gap-sm': space.x4 },
|
|
52
|
+
5: { '--narvi-gap-sm': space.x5 },
|
|
53
|
+
6: { '--narvi-gap-sm': space.x6 },
|
|
54
|
+
8: { '--narvi-gap-sm': space.x8 },
|
|
55
|
+
10: { '--narvi-gap-sm': space.x10 },
|
|
56
|
+
12: { '--narvi-gap-sm': space.x12 },
|
|
57
|
+
16: { '--narvi-gap-sm': space.x16 }
|
|
58
|
+
});
|
|
59
|
+
const gapMd = stylex.create({
|
|
60
|
+
0: { '--narvi-gap-md': '0px' },
|
|
61
|
+
1: { '--narvi-gap-md': space.x1 },
|
|
62
|
+
2: { '--narvi-gap-md': space.x2 },
|
|
63
|
+
3: { '--narvi-gap-md': space.x3 },
|
|
64
|
+
4: { '--narvi-gap-md': space.x4 },
|
|
65
|
+
5: { '--narvi-gap-md': space.x5 },
|
|
66
|
+
6: { '--narvi-gap-md': space.x6 },
|
|
67
|
+
8: { '--narvi-gap-md': space.x8 },
|
|
68
|
+
10: { '--narvi-gap-md': space.x10 },
|
|
69
|
+
12: { '--narvi-gap-md': space.x12 },
|
|
70
|
+
16: { '--narvi-gap-md': space.x16 }
|
|
71
|
+
});
|
|
72
|
+
const gapLg = stylex.create({
|
|
73
|
+
0: { '--narvi-gap-lg': '0px' },
|
|
74
|
+
1: { '--narvi-gap-lg': space.x1 },
|
|
75
|
+
2: { '--narvi-gap-lg': space.x2 },
|
|
76
|
+
3: { '--narvi-gap-lg': space.x3 },
|
|
77
|
+
4: { '--narvi-gap-lg': space.x4 },
|
|
78
|
+
5: { '--narvi-gap-lg': space.x5 },
|
|
79
|
+
6: { '--narvi-gap-lg': space.x6 },
|
|
80
|
+
8: { '--narvi-gap-lg': space.x8 },
|
|
81
|
+
10: { '--narvi-gap-lg': space.x10 },
|
|
82
|
+
12: { '--narvi-gap-lg': space.x12 },
|
|
83
|
+
16: { '--narvi-gap-lg': space.x16 }
|
|
84
|
+
});
|
|
85
|
+
const gapXl = stylex.create({
|
|
86
|
+
0: { '--narvi-gap-xl': '0px' },
|
|
87
|
+
1: { '--narvi-gap-xl': space.x1 },
|
|
88
|
+
2: { '--narvi-gap-xl': space.x2 },
|
|
89
|
+
3: { '--narvi-gap-xl': space.x3 },
|
|
90
|
+
4: { '--narvi-gap-xl': space.x4 },
|
|
91
|
+
5: { '--narvi-gap-xl': space.x5 },
|
|
92
|
+
6: { '--narvi-gap-xl': space.x6 },
|
|
93
|
+
8: { '--narvi-gap-xl': space.x8 },
|
|
94
|
+
10: { '--narvi-gap-xl': space.x10 },
|
|
95
|
+
12: { '--narvi-gap-xl': space.x12 },
|
|
96
|
+
16: { '--narvi-gap-xl': space.x16 }
|
|
97
|
+
});
|
|
98
|
+
export const gapStyles = {
|
|
99
|
+
fixed: gapFixed,
|
|
100
|
+
chain: gapChain.chain,
|
|
101
|
+
set: {
|
|
102
|
+
default: gapDefault,
|
|
103
|
+
sm: gapSm,
|
|
104
|
+
md: gapMd,
|
|
105
|
+
lg: gapLg,
|
|
106
|
+
xl: gapXl
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const alignFixed = stylex.create({
|
|
110
|
+
start: { alignItems: 'flex-start' },
|
|
111
|
+
center: { alignItems: 'center' },
|
|
112
|
+
end: { alignItems: 'flex-end' },
|
|
113
|
+
stretch: { alignItems: 'stretch' },
|
|
114
|
+
baseline: { alignItems: 'baseline' }
|
|
115
|
+
});
|
|
116
|
+
const alignChain = stylex.create({
|
|
117
|
+
chain: {
|
|
118
|
+
'--narvi-align': 'initial',
|
|
119
|
+
'--narvi-align-sm': 'initial',
|
|
120
|
+
'--narvi-align-md': 'initial',
|
|
121
|
+
'--narvi-align-lg': 'initial',
|
|
122
|
+
'--narvi-align-xl': 'initial',
|
|
123
|
+
alignItems: {
|
|
124
|
+
default: 'var(--narvi-align)',
|
|
125
|
+
[media.sm]: 'var(--narvi-align-sm, var(--narvi-align))',
|
|
126
|
+
[media.md]: 'var(--narvi-align-md, var(--narvi-align-sm, var(--narvi-align)))',
|
|
127
|
+
[media.lg]: 'var(--narvi-align-lg, var(--narvi-align-md, var(--narvi-align-sm, var(--narvi-align))))',
|
|
128
|
+
[media.xl]: 'var(--narvi-align-xl, var(--narvi-align-lg, var(--narvi-align-md, var(--narvi-align-sm, var(--narvi-align)))))'
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
const alignDefault = stylex.create({
|
|
133
|
+
start: { '--narvi-align': 'flex-start' },
|
|
134
|
+
center: { '--narvi-align': 'center' },
|
|
135
|
+
end: { '--narvi-align': 'flex-end' },
|
|
136
|
+
stretch: { '--narvi-align': 'stretch' },
|
|
137
|
+
baseline: { '--narvi-align': 'baseline' }
|
|
138
|
+
});
|
|
139
|
+
const alignSm = stylex.create({
|
|
140
|
+
start: { '--narvi-align-sm': 'flex-start' },
|
|
141
|
+
center: { '--narvi-align-sm': 'center' },
|
|
142
|
+
end: { '--narvi-align-sm': 'flex-end' },
|
|
143
|
+
stretch: { '--narvi-align-sm': 'stretch' },
|
|
144
|
+
baseline: { '--narvi-align-sm': 'baseline' }
|
|
145
|
+
});
|
|
146
|
+
const alignMd = stylex.create({
|
|
147
|
+
start: { '--narvi-align-md': 'flex-start' },
|
|
148
|
+
center: { '--narvi-align-md': 'center' },
|
|
149
|
+
end: { '--narvi-align-md': 'flex-end' },
|
|
150
|
+
stretch: { '--narvi-align-md': 'stretch' },
|
|
151
|
+
baseline: { '--narvi-align-md': 'baseline' }
|
|
152
|
+
});
|
|
153
|
+
const alignLg = stylex.create({
|
|
154
|
+
start: { '--narvi-align-lg': 'flex-start' },
|
|
155
|
+
center: { '--narvi-align-lg': 'center' },
|
|
156
|
+
end: { '--narvi-align-lg': 'flex-end' },
|
|
157
|
+
stretch: { '--narvi-align-lg': 'stretch' },
|
|
158
|
+
baseline: { '--narvi-align-lg': 'baseline' }
|
|
159
|
+
});
|
|
160
|
+
const alignXl = stylex.create({
|
|
161
|
+
start: { '--narvi-align-xl': 'flex-start' },
|
|
162
|
+
center: { '--narvi-align-xl': 'center' },
|
|
163
|
+
end: { '--narvi-align-xl': 'flex-end' },
|
|
164
|
+
stretch: { '--narvi-align-xl': 'stretch' },
|
|
165
|
+
baseline: { '--narvi-align-xl': 'baseline' }
|
|
166
|
+
});
|
|
167
|
+
export const alignStyles = {
|
|
168
|
+
fixed: alignFixed,
|
|
169
|
+
chain: alignChain.chain,
|
|
170
|
+
set: {
|
|
171
|
+
default: alignDefault,
|
|
172
|
+
sm: alignSm,
|
|
173
|
+
md: alignMd,
|
|
174
|
+
lg: alignLg,
|
|
175
|
+
xl: alignXl
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
const directionFixed = stylex.create({
|
|
179
|
+
column: { flexDirection: 'column' },
|
|
180
|
+
row: { flexDirection: 'row' }
|
|
181
|
+
});
|
|
182
|
+
const directionChain = stylex.create({
|
|
183
|
+
chain: {
|
|
184
|
+
'--narvi-direction': 'initial',
|
|
185
|
+
'--narvi-direction-sm': 'initial',
|
|
186
|
+
'--narvi-direction-md': 'initial',
|
|
187
|
+
'--narvi-direction-lg': 'initial',
|
|
188
|
+
'--narvi-direction-xl': 'initial',
|
|
189
|
+
flexDirection: {
|
|
190
|
+
default: 'var(--narvi-direction)',
|
|
191
|
+
[media.sm]: 'var(--narvi-direction-sm, var(--narvi-direction))',
|
|
192
|
+
[media.md]: 'var(--narvi-direction-md, var(--narvi-direction-sm, var(--narvi-direction)))',
|
|
193
|
+
[media.lg]: 'var(--narvi-direction-lg, var(--narvi-direction-md, var(--narvi-direction-sm, var(--narvi-direction))))',
|
|
194
|
+
[media.xl]: 'var(--narvi-direction-xl, var(--narvi-direction-lg, var(--narvi-direction-md, var(--narvi-direction-sm, var(--narvi-direction)))))'
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
const directionDefault = stylex.create({
|
|
199
|
+
column: { '--narvi-direction': 'column' },
|
|
200
|
+
row: { '--narvi-direction': 'row' }
|
|
201
|
+
});
|
|
202
|
+
const directionSm = stylex.create({
|
|
203
|
+
column: { '--narvi-direction-sm': 'column' },
|
|
204
|
+
row: { '--narvi-direction-sm': 'row' }
|
|
205
|
+
});
|
|
206
|
+
const directionMd = stylex.create({
|
|
207
|
+
column: { '--narvi-direction-md': 'column' },
|
|
208
|
+
row: { '--narvi-direction-md': 'row' }
|
|
209
|
+
});
|
|
210
|
+
const directionLg = stylex.create({
|
|
211
|
+
column: { '--narvi-direction-lg': 'column' },
|
|
212
|
+
row: { '--narvi-direction-lg': 'row' }
|
|
213
|
+
});
|
|
214
|
+
const directionXl = stylex.create({
|
|
215
|
+
column: { '--narvi-direction-xl': 'column' },
|
|
216
|
+
row: { '--narvi-direction-xl': 'row' }
|
|
217
|
+
});
|
|
218
|
+
export const directionStyles = {
|
|
219
|
+
fixed: directionFixed,
|
|
220
|
+
chain: directionChain.chain,
|
|
221
|
+
set: {
|
|
222
|
+
default: directionDefault,
|
|
223
|
+
sm: directionSm,
|
|
224
|
+
md: directionMd,
|
|
225
|
+
lg: directionLg,
|
|
226
|
+
xl: directionXl
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
const justifyFixed = stylex.create({
|
|
230
|
+
start: { justifyContent: 'flex-start' },
|
|
231
|
+
center: { justifyContent: 'center' },
|
|
232
|
+
end: { justifyContent: 'flex-end' },
|
|
233
|
+
between: { justifyContent: 'space-between' }
|
|
234
|
+
});
|
|
235
|
+
const justifyChain = stylex.create({
|
|
236
|
+
chain: {
|
|
237
|
+
'--narvi-justify': 'initial',
|
|
238
|
+
'--narvi-justify-sm': 'initial',
|
|
239
|
+
'--narvi-justify-md': 'initial',
|
|
240
|
+
'--narvi-justify-lg': 'initial',
|
|
241
|
+
'--narvi-justify-xl': 'initial',
|
|
242
|
+
justifyContent: {
|
|
243
|
+
default: 'var(--narvi-justify)',
|
|
244
|
+
[media.sm]: 'var(--narvi-justify-sm, var(--narvi-justify))',
|
|
245
|
+
[media.md]: 'var(--narvi-justify-md, var(--narvi-justify-sm, var(--narvi-justify)))',
|
|
246
|
+
[media.lg]: 'var(--narvi-justify-lg, var(--narvi-justify-md, var(--narvi-justify-sm, var(--narvi-justify))))',
|
|
247
|
+
[media.xl]: 'var(--narvi-justify-xl, var(--narvi-justify-lg, var(--narvi-justify-md, var(--narvi-justify-sm, var(--narvi-justify)))))'
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
const justifyDefault = stylex.create({
|
|
252
|
+
start: { '--narvi-justify': 'flex-start' },
|
|
253
|
+
center: { '--narvi-justify': 'center' },
|
|
254
|
+
end: { '--narvi-justify': 'flex-end' },
|
|
255
|
+
between: { '--narvi-justify': 'space-between' }
|
|
256
|
+
});
|
|
257
|
+
const justifySm = stylex.create({
|
|
258
|
+
start: { '--narvi-justify-sm': 'flex-start' },
|
|
259
|
+
center: { '--narvi-justify-sm': 'center' },
|
|
260
|
+
end: { '--narvi-justify-sm': 'flex-end' },
|
|
261
|
+
between: { '--narvi-justify-sm': 'space-between' }
|
|
262
|
+
});
|
|
263
|
+
const justifyMd = stylex.create({
|
|
264
|
+
start: { '--narvi-justify-md': 'flex-start' },
|
|
265
|
+
center: { '--narvi-justify-md': 'center' },
|
|
266
|
+
end: { '--narvi-justify-md': 'flex-end' },
|
|
267
|
+
between: { '--narvi-justify-md': 'space-between' }
|
|
268
|
+
});
|
|
269
|
+
const justifyLg = stylex.create({
|
|
270
|
+
start: { '--narvi-justify-lg': 'flex-start' },
|
|
271
|
+
center: { '--narvi-justify-lg': 'center' },
|
|
272
|
+
end: { '--narvi-justify-lg': 'flex-end' },
|
|
273
|
+
between: { '--narvi-justify-lg': 'space-between' }
|
|
274
|
+
});
|
|
275
|
+
const justifyXl = stylex.create({
|
|
276
|
+
start: { '--narvi-justify-xl': 'flex-start' },
|
|
277
|
+
center: { '--narvi-justify-xl': 'center' },
|
|
278
|
+
end: { '--narvi-justify-xl': 'flex-end' },
|
|
279
|
+
between: { '--narvi-justify-xl': 'space-between' }
|
|
280
|
+
});
|
|
281
|
+
export const justifyStyles = {
|
|
282
|
+
fixed: justifyFixed,
|
|
283
|
+
chain: justifyChain.chain,
|
|
284
|
+
set: {
|
|
285
|
+
default: justifyDefault,
|
|
286
|
+
sm: justifySm,
|
|
287
|
+
md: justifyMd,
|
|
288
|
+
lg: justifyLg,
|
|
289
|
+
xl: justifyXl
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
const wrapFixed = stylex.create({
|
|
293
|
+
wrap: { flexWrap: 'wrap' },
|
|
294
|
+
nowrap: { flexWrap: 'nowrap' }
|
|
295
|
+
});
|
|
296
|
+
const wrapChain = stylex.create({
|
|
297
|
+
chain: {
|
|
298
|
+
'--narvi-wrap': 'initial',
|
|
299
|
+
'--narvi-wrap-sm': 'initial',
|
|
300
|
+
'--narvi-wrap-md': 'initial',
|
|
301
|
+
'--narvi-wrap-lg': 'initial',
|
|
302
|
+
'--narvi-wrap-xl': 'initial',
|
|
303
|
+
flexWrap: {
|
|
304
|
+
default: 'var(--narvi-wrap)',
|
|
305
|
+
[media.sm]: 'var(--narvi-wrap-sm, var(--narvi-wrap))',
|
|
306
|
+
[media.md]: 'var(--narvi-wrap-md, var(--narvi-wrap-sm, var(--narvi-wrap)))',
|
|
307
|
+
[media.lg]: 'var(--narvi-wrap-lg, var(--narvi-wrap-md, var(--narvi-wrap-sm, var(--narvi-wrap))))',
|
|
308
|
+
[media.xl]: 'var(--narvi-wrap-xl, var(--narvi-wrap-lg, var(--narvi-wrap-md, var(--narvi-wrap-sm, var(--narvi-wrap)))))'
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
const wrapDefault = stylex.create({
|
|
313
|
+
wrap: { '--narvi-wrap': 'wrap' },
|
|
314
|
+
nowrap: { '--narvi-wrap': 'nowrap' }
|
|
315
|
+
});
|
|
316
|
+
const wrapSm = stylex.create({
|
|
317
|
+
wrap: { '--narvi-wrap-sm': 'wrap' },
|
|
318
|
+
nowrap: { '--narvi-wrap-sm': 'nowrap' }
|
|
319
|
+
});
|
|
320
|
+
const wrapMd = stylex.create({
|
|
321
|
+
wrap: { '--narvi-wrap-md': 'wrap' },
|
|
322
|
+
nowrap: { '--narvi-wrap-md': 'nowrap' }
|
|
323
|
+
});
|
|
324
|
+
const wrapLg = stylex.create({
|
|
325
|
+
wrap: { '--narvi-wrap-lg': 'wrap' },
|
|
326
|
+
nowrap: { '--narvi-wrap-lg': 'nowrap' }
|
|
327
|
+
});
|
|
328
|
+
const wrapXl = stylex.create({
|
|
329
|
+
wrap: { '--narvi-wrap-xl': 'wrap' },
|
|
330
|
+
nowrap: { '--narvi-wrap-xl': 'nowrap' }
|
|
331
|
+
});
|
|
332
|
+
export const wrapStyles = {
|
|
333
|
+
fixed: wrapFixed,
|
|
334
|
+
chain: wrapChain.chain,
|
|
335
|
+
set: {
|
|
336
|
+
default: wrapDefault,
|
|
337
|
+
sm: wrapSm,
|
|
338
|
+
md: wrapMd,
|
|
339
|
+
lg: wrapLg,
|
|
340
|
+
xl: wrapXl
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
const columnsFixed = stylex.create({
|
|
344
|
+
1: { gridTemplateColumns: 'repeat(1, minmax(0, 1fr))' },
|
|
345
|
+
2: { gridTemplateColumns: 'repeat(2, minmax(0, 1fr))' },
|
|
346
|
+
3: { gridTemplateColumns: 'repeat(3, minmax(0, 1fr))' },
|
|
347
|
+
4: { gridTemplateColumns: 'repeat(4, minmax(0, 1fr))' },
|
|
348
|
+
5: { gridTemplateColumns: 'repeat(5, minmax(0, 1fr))' },
|
|
349
|
+
6: { gridTemplateColumns: 'repeat(6, minmax(0, 1fr))' },
|
|
350
|
+
7: { gridTemplateColumns: 'repeat(7, minmax(0, 1fr))' },
|
|
351
|
+
8: { gridTemplateColumns: 'repeat(8, minmax(0, 1fr))' },
|
|
352
|
+
9: { gridTemplateColumns: 'repeat(9, minmax(0, 1fr))' },
|
|
353
|
+
10: { gridTemplateColumns: 'repeat(10, minmax(0, 1fr))' },
|
|
354
|
+
11: { gridTemplateColumns: 'repeat(11, minmax(0, 1fr))' },
|
|
355
|
+
12: { gridTemplateColumns: 'repeat(12, minmax(0, 1fr))' }
|
|
356
|
+
});
|
|
357
|
+
const columnsChain = stylex.create({
|
|
358
|
+
chain: {
|
|
359
|
+
'--narvi-columns': 'initial',
|
|
360
|
+
'--narvi-columns-sm': 'initial',
|
|
361
|
+
'--narvi-columns-md': 'initial',
|
|
362
|
+
'--narvi-columns-lg': 'initial',
|
|
363
|
+
'--narvi-columns-xl': 'initial',
|
|
364
|
+
gridTemplateColumns: {
|
|
365
|
+
default: 'var(--narvi-columns)',
|
|
366
|
+
[media.sm]: 'var(--narvi-columns-sm, var(--narvi-columns))',
|
|
367
|
+
[media.md]: 'var(--narvi-columns-md, var(--narvi-columns-sm, var(--narvi-columns)))',
|
|
368
|
+
[media.lg]: 'var(--narvi-columns-lg, var(--narvi-columns-md, var(--narvi-columns-sm, var(--narvi-columns))))',
|
|
369
|
+
[media.xl]: 'var(--narvi-columns-xl, var(--narvi-columns-lg, var(--narvi-columns-md, var(--narvi-columns-sm, var(--narvi-columns)))))'
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
const columnsDefault = stylex.create({
|
|
374
|
+
1: { '--narvi-columns': 'repeat(1, minmax(0, 1fr))' },
|
|
375
|
+
2: { '--narvi-columns': 'repeat(2, minmax(0, 1fr))' },
|
|
376
|
+
3: { '--narvi-columns': 'repeat(3, minmax(0, 1fr))' },
|
|
377
|
+
4: { '--narvi-columns': 'repeat(4, minmax(0, 1fr))' },
|
|
378
|
+
5: { '--narvi-columns': 'repeat(5, minmax(0, 1fr))' },
|
|
379
|
+
6: { '--narvi-columns': 'repeat(6, minmax(0, 1fr))' },
|
|
380
|
+
7: { '--narvi-columns': 'repeat(7, minmax(0, 1fr))' },
|
|
381
|
+
8: { '--narvi-columns': 'repeat(8, minmax(0, 1fr))' },
|
|
382
|
+
9: { '--narvi-columns': 'repeat(9, minmax(0, 1fr))' },
|
|
383
|
+
10: { '--narvi-columns': 'repeat(10, minmax(0, 1fr))' },
|
|
384
|
+
11: { '--narvi-columns': 'repeat(11, minmax(0, 1fr))' },
|
|
385
|
+
12: { '--narvi-columns': 'repeat(12, minmax(0, 1fr))' }
|
|
386
|
+
});
|
|
387
|
+
const columnsSm = stylex.create({
|
|
388
|
+
1: { '--narvi-columns-sm': 'repeat(1, minmax(0, 1fr))' },
|
|
389
|
+
2: { '--narvi-columns-sm': 'repeat(2, minmax(0, 1fr))' },
|
|
390
|
+
3: { '--narvi-columns-sm': 'repeat(3, minmax(0, 1fr))' },
|
|
391
|
+
4: { '--narvi-columns-sm': 'repeat(4, minmax(0, 1fr))' },
|
|
392
|
+
5: { '--narvi-columns-sm': 'repeat(5, minmax(0, 1fr))' },
|
|
393
|
+
6: { '--narvi-columns-sm': 'repeat(6, minmax(0, 1fr))' },
|
|
394
|
+
7: { '--narvi-columns-sm': 'repeat(7, minmax(0, 1fr))' },
|
|
395
|
+
8: { '--narvi-columns-sm': 'repeat(8, minmax(0, 1fr))' },
|
|
396
|
+
9: { '--narvi-columns-sm': 'repeat(9, minmax(0, 1fr))' },
|
|
397
|
+
10: { '--narvi-columns-sm': 'repeat(10, minmax(0, 1fr))' },
|
|
398
|
+
11: { '--narvi-columns-sm': 'repeat(11, minmax(0, 1fr))' },
|
|
399
|
+
12: { '--narvi-columns-sm': 'repeat(12, minmax(0, 1fr))' }
|
|
400
|
+
});
|
|
401
|
+
const columnsMd = stylex.create({
|
|
402
|
+
1: { '--narvi-columns-md': 'repeat(1, minmax(0, 1fr))' },
|
|
403
|
+
2: { '--narvi-columns-md': 'repeat(2, minmax(0, 1fr))' },
|
|
404
|
+
3: { '--narvi-columns-md': 'repeat(3, minmax(0, 1fr))' },
|
|
405
|
+
4: { '--narvi-columns-md': 'repeat(4, minmax(0, 1fr))' },
|
|
406
|
+
5: { '--narvi-columns-md': 'repeat(5, minmax(0, 1fr))' },
|
|
407
|
+
6: { '--narvi-columns-md': 'repeat(6, minmax(0, 1fr))' },
|
|
408
|
+
7: { '--narvi-columns-md': 'repeat(7, minmax(0, 1fr))' },
|
|
409
|
+
8: { '--narvi-columns-md': 'repeat(8, minmax(0, 1fr))' },
|
|
410
|
+
9: { '--narvi-columns-md': 'repeat(9, minmax(0, 1fr))' },
|
|
411
|
+
10: { '--narvi-columns-md': 'repeat(10, minmax(0, 1fr))' },
|
|
412
|
+
11: { '--narvi-columns-md': 'repeat(11, minmax(0, 1fr))' },
|
|
413
|
+
12: { '--narvi-columns-md': 'repeat(12, minmax(0, 1fr))' }
|
|
414
|
+
});
|
|
415
|
+
const columnsLg = stylex.create({
|
|
416
|
+
1: { '--narvi-columns-lg': 'repeat(1, minmax(0, 1fr))' },
|
|
417
|
+
2: { '--narvi-columns-lg': 'repeat(2, minmax(0, 1fr))' },
|
|
418
|
+
3: { '--narvi-columns-lg': 'repeat(3, minmax(0, 1fr))' },
|
|
419
|
+
4: { '--narvi-columns-lg': 'repeat(4, minmax(0, 1fr))' },
|
|
420
|
+
5: { '--narvi-columns-lg': 'repeat(5, minmax(0, 1fr))' },
|
|
421
|
+
6: { '--narvi-columns-lg': 'repeat(6, minmax(0, 1fr))' },
|
|
422
|
+
7: { '--narvi-columns-lg': 'repeat(7, minmax(0, 1fr))' },
|
|
423
|
+
8: { '--narvi-columns-lg': 'repeat(8, minmax(0, 1fr))' },
|
|
424
|
+
9: { '--narvi-columns-lg': 'repeat(9, minmax(0, 1fr))' },
|
|
425
|
+
10: { '--narvi-columns-lg': 'repeat(10, minmax(0, 1fr))' },
|
|
426
|
+
11: { '--narvi-columns-lg': 'repeat(11, minmax(0, 1fr))' },
|
|
427
|
+
12: { '--narvi-columns-lg': 'repeat(12, minmax(0, 1fr))' }
|
|
428
|
+
});
|
|
429
|
+
const columnsXl = stylex.create({
|
|
430
|
+
1: { '--narvi-columns-xl': 'repeat(1, minmax(0, 1fr))' },
|
|
431
|
+
2: { '--narvi-columns-xl': 'repeat(2, minmax(0, 1fr))' },
|
|
432
|
+
3: { '--narvi-columns-xl': 'repeat(3, minmax(0, 1fr))' },
|
|
433
|
+
4: { '--narvi-columns-xl': 'repeat(4, minmax(0, 1fr))' },
|
|
434
|
+
5: { '--narvi-columns-xl': 'repeat(5, minmax(0, 1fr))' },
|
|
435
|
+
6: { '--narvi-columns-xl': 'repeat(6, minmax(0, 1fr))' },
|
|
436
|
+
7: { '--narvi-columns-xl': 'repeat(7, minmax(0, 1fr))' },
|
|
437
|
+
8: { '--narvi-columns-xl': 'repeat(8, minmax(0, 1fr))' },
|
|
438
|
+
9: { '--narvi-columns-xl': 'repeat(9, minmax(0, 1fr))' },
|
|
439
|
+
10: { '--narvi-columns-xl': 'repeat(10, minmax(0, 1fr))' },
|
|
440
|
+
11: { '--narvi-columns-xl': 'repeat(11, minmax(0, 1fr))' },
|
|
441
|
+
12: { '--narvi-columns-xl': 'repeat(12, minmax(0, 1fr))' }
|
|
442
|
+
});
|
|
443
|
+
export const columnsStyles = {
|
|
444
|
+
fixed: columnsFixed,
|
|
445
|
+
chain: columnsChain.chain,
|
|
446
|
+
set: {
|
|
447
|
+
default: columnsDefault,
|
|
448
|
+
sm: columnsSm,
|
|
449
|
+
md: columnsMd,
|
|
450
|
+
lg: columnsLg,
|
|
451
|
+
xl: columnsXl
|
|
452
|
+
}
|
|
453
|
+
};
|
|
@@ -8,7 +8,15 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
8
8
|
export declare const messageMarker: Readonly<{
|
|
9
9
|
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
10
10
|
}>;
|
|
11
|
+
/** Placed around a Markdown table, so its copy button appears while the table is hovered or holds focus. */
|
|
12
|
+
export declare const markdownTableMarker: Readonly<{
|
|
13
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
14
|
+
}>;
|
|
11
15
|
/** Placed on Sidebar.Item, so its actions appear and its trailing note steps aside on hover. */
|
|
12
16
|
export declare const sidebarItemMarker: Readonly<{
|
|
13
17
|
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
14
18
|
}>;
|
|
19
|
+
/** A tab of a TabStrip: its close button shows while the pointer or focus is in the tab. */
|
|
20
|
+
export declare const tabStripTabMarker: Readonly<{
|
|
21
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
22
|
+
}>;
|
|
@@ -6,5 +6,9 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
6
6
|
*/
|
|
7
7
|
/** Placed on Message.Root, so its actions can appear while the message is hovered. */
|
|
8
8
|
export const messageMarker = stylex.defineMarker();
|
|
9
|
+
/** Placed around a Markdown table, so its copy button appears while the table is hovered or holds focus. */
|
|
10
|
+
export const markdownTableMarker = stylex.defineMarker();
|
|
9
11
|
/** Placed on Sidebar.Item, so its actions appear and its trailing note steps aside on hover. */
|
|
10
12
|
export const sidebarItemMarker = stylex.defineMarker();
|
|
13
|
+
/** A tab of a TabStrip: its close button shows while the pointer or focus is in the tab. */
|
|
14
|
+
export const tabStripTabMarker = stylex.defineMarker();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throws when `narvi()` is listed before the Svelte plugin. It would then be handed raw
|
|
3
|
+
* `.svelte` source, and the build would stop at StyleX's parser with "Unexpected token" in
|
|
4
|
+
* every component, which says nothing about the cause.
|
|
5
|
+
*/
|
|
6
|
+
export declare function assertAfterSvelte(plugins: ReadonlyArray<{
|
|
7
|
+
name: string;
|
|
8
|
+
}>, self: unknown): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** What the Svelte plugin calls the step that compiles `.svelte` files. Older versions have one plugin for everything. */
|
|
2
|
+
const SVELTE_COMPILE = ['vite-plugin-svelte:compile', 'vite-plugin-svelte'];
|
|
3
|
+
/**
|
|
4
|
+
* Throws when `narvi()` is listed before the Svelte plugin. It would then be handed raw
|
|
5
|
+
* `.svelte` source, and the build would stop at StyleX's parser with "Unexpected token" in
|
|
6
|
+
* every component, which says nothing about the cause.
|
|
7
|
+
*/
|
|
8
|
+
export function assertAfterSvelte(plugins, self) {
|
|
9
|
+
const own = plugins.indexOf(self);
|
|
10
|
+
const svelte = SVELTE_COMPILE.map((name) => plugins.findIndex((plugin) => plugin.name === name)).find((index) => index >= 0);
|
|
11
|
+
if (own < 0 || svelte === undefined || own > svelte)
|
|
12
|
+
return;
|
|
13
|
+
throw new Error('[narvi] narvi() is listed before the Svelte plugin. Move it after sveltekit(), or after svelte() in a plain Vite app:\n\n' +
|
|
14
|
+
' plugins: [sveltekit(), narvi()]\n\n' +
|
|
15
|
+
'It compiles the styles in components the Svelte compiler has already processed.');
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout props that take a value, or one value per breakpoint:
|
|
3
|
+
* `gap={4}` or `gap={{ default: 4, lg: 8 }}`.
|
|
4
|
+
*
|
|
5
|
+
* StyleX merges styles one property at a time, so a style for `lg` cannot sit on top of
|
|
6
|
+
* the default: it would replace it. A responsive prop therefore applies one static rule
|
|
7
|
+
* that reads custom properties, one per breakpoint, each falling back to the one below:
|
|
8
|
+
*
|
|
9
|
+
* ```css
|
|
10
|
+
* gap: var(--narvi-gap);
|
|
11
|
+
* @media (min-width: 640px) { gap: var(--narvi-gap-sm, var(--narvi-gap)) }
|
|
12
|
+
* …
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* and one static class per value and breakpoint, which sets one of those properties. The
|
|
16
|
+
* same rule resets every one of them to `initial`, so a layout never inherits its parent's.
|
|
17
|
+
* No styles are made at runtime. A plain value takes a plain class, as before.
|
|
18
|
+
*/
|
|
19
|
+
/** The breakpoints of `media`: `sm` 640px, `md` 768px, `lg` 1024px, `xl` 1280px. */
|
|
20
|
+
export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl';
|
|
21
|
+
export declare const breakpoints: ReadonlyArray<Breakpoint>;
|
|
22
|
+
/** A value, or values by breakpoint. Each applies from its breakpoint up, until a larger one. */
|
|
23
|
+
export type Responsive<T> = T | Readonly<{
|
|
24
|
+
default?: T;
|
|
25
|
+
} & {
|
|
26
|
+
[B in Breakpoint]?: T;
|
|
27
|
+
}>;
|
|
28
|
+
/** A compiled style, as `stylex.create` returns it. */
|
|
29
|
+
type Style = Readonly<Record<string, unknown>>;
|
|
30
|
+
/** The styles a responsive prop is built from. */
|
|
31
|
+
export type ResponsiveStyles<T extends PropertyKey> = {
|
|
32
|
+
/** For a plain value. */
|
|
33
|
+
fixed: Readonly<Record<T, Style>>;
|
|
34
|
+
/** The rule that reads the custom properties and resets them. */
|
|
35
|
+
chain: Style;
|
|
36
|
+
/** Sets the custom property for each breakpoint, `default` included. */
|
|
37
|
+
set: Readonly<Record<'default' | Breakpoint, Readonly<Record<T, Style>>>>;
|
|
38
|
+
};
|
|
39
|
+
export declare function isByBreakpoint<T>(value: Responsive<T> | undefined): value is Exclude<Responsive<T>, T>;
|
|
40
|
+
/**
|
|
41
|
+
* The styles for one prop. `fallback` stands in for a missing value, and for a missing
|
|
42
|
+
* `default` in values by breakpoint.
|
|
43
|
+
*/
|
|
44
|
+
export declare function responsive<T extends PropertyKey>(value: Responsive<T> | undefined, fallback: T | undefined, styles: ResponsiveStyles<T>): Style[];
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout props that take a value, or one value per breakpoint:
|
|
3
|
+
* `gap={4}` or `gap={{ default: 4, lg: 8 }}`.
|
|
4
|
+
*
|
|
5
|
+
* StyleX merges styles one property at a time, so a style for `lg` cannot sit on top of
|
|
6
|
+
* the default: it would replace it. A responsive prop therefore applies one static rule
|
|
7
|
+
* that reads custom properties, one per breakpoint, each falling back to the one below:
|
|
8
|
+
*
|
|
9
|
+
* ```css
|
|
10
|
+
* gap: var(--narvi-gap);
|
|
11
|
+
* @media (min-width: 640px) { gap: var(--narvi-gap-sm, var(--narvi-gap)) }
|
|
12
|
+
* …
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* and one static class per value and breakpoint, which sets one of those properties. The
|
|
16
|
+
* same rule resets every one of them to `initial`, so a layout never inherits its parent's.
|
|
17
|
+
* No styles are made at runtime. A plain value takes a plain class, as before.
|
|
18
|
+
*/
|
|
19
|
+
export const breakpoints = ['sm', 'md', 'lg', 'xl'];
|
|
20
|
+
export function isByBreakpoint(value) {
|
|
21
|
+
return typeof value === 'object' && value !== null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The styles for one prop. `fallback` stands in for a missing value, and for a missing
|
|
25
|
+
* `default` in values by breakpoint.
|
|
26
|
+
*/
|
|
27
|
+
export function responsive(value, fallback, styles) {
|
|
28
|
+
if (!isByBreakpoint(value)) {
|
|
29
|
+
const resolved = value ?? fallback;
|
|
30
|
+
return resolved === undefined ? [] : [styles.fixed[resolved]];
|
|
31
|
+
}
|
|
32
|
+
const result = [styles.chain];
|
|
33
|
+
const base = value.default ?? fallback;
|
|
34
|
+
if (base !== undefined)
|
|
35
|
+
result.push(styles.set.default[base]);
|
|
36
|
+
for (const breakpoint of breakpoints) {
|
|
37
|
+
const at = value[breakpoint];
|
|
38
|
+
if (at !== undefined)
|
|
39
|
+
result.push(styles.set[breakpoint][at]);
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
package/dist/internal/roving.js
CHANGED
|
@@ -3,7 +3,10 @@ const isTyping = (target) => target instanceof HTMLElement &&
|
|
|
3
3
|
export function roving({ selector, orientation = 'vertical' }) {
|
|
4
4
|
return (container) => {
|
|
5
5
|
let last = null;
|
|
6
|
-
const items = () => [...container.querySelectorAll(selector)].filter((item) => !item.hasAttribute('disabled') &&
|
|
6
|
+
const items = () => [...container.querySelectorAll(selector)].filter((item) => !item.hasAttribute('disabled') &&
|
|
7
|
+
item.getClientRects().length > 0 &&
|
|
8
|
+
// Folded away: still laid out, but inert, so focus would not take
|
|
9
|
+
!item.closest('[inert]'));
|
|
7
10
|
const settle = () => {
|
|
8
11
|
const all = items();
|
|
9
12
|
const stop = (last && all.includes(last) && last) ||
|
|
@@ -54,7 +57,7 @@ export function roving({ selector, orientation = 'vertical' }) {
|
|
|
54
57
|
childList: true,
|
|
55
58
|
subtree: true,
|
|
56
59
|
attributes: true,
|
|
57
|
-
attributeFilter: ['aria-current', 'disabled', 'hidden']
|
|
60
|
+
attributeFilter: ['aria-current', 'disabled', 'hidden', 'inert']
|
|
58
61
|
});
|
|
59
62
|
container.addEventListener('focusin', onfocusin);
|
|
60
63
|
container.addEventListener('keydown', onkeydown);
|
|
@@ -11,6 +11,13 @@ export declare const shared: Readonly<{
|
|
|
11
11
|
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "2px" | "-1px">;
|
|
12
12
|
readonly WebkitAppRegion: stylex.StyleXClassNameFor<"WebkitAppRegion", "no-drag">;
|
|
13
13
|
}>;
|
|
14
|
+
readonly spin: Readonly<{
|
|
15
|
+
readonly animationName: stylex.StyleXClassNameFor<"animationName", string>;
|
|
16
|
+
readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration", "600ms" | "2.4s">;
|
|
17
|
+
readonly animationTimingFunction: stylex.StyleXClassNameFor<"animationTimingFunction", "linear">;
|
|
18
|
+
readonly animationIterationCount: stylex.StyleXClassNameFor<"animationIterationCount", "infinite">;
|
|
19
|
+
readonly animationPlayState: stylex.StyleXClassNameFor<"animationPlayState", string>;
|
|
20
|
+
}>;
|
|
14
21
|
readonly dragRegion: Readonly<{
|
|
15
22
|
readonly WebkitAppRegion: stylex.StyleXClassNameFor<"WebkitAppRegion", "drag">;
|
|
16
23
|
readonly WebkitUserSelect: stylex.StyleXClassNameFor<"WebkitUserSelect", "none">;
|
|
@@ -22,7 +29,7 @@ export declare const shared: Readonly<{
|
|
|
22
29
|
readonly eyebrow: Readonly<{
|
|
23
30
|
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
24
31
|
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
25
|
-
readonly fontSize: stylex.StyleXClassNameFor<"fontSize",
|
|
32
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
26
33
|
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", "500">;
|
|
27
34
|
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", 1.2>;
|
|
28
35
|
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|