sdocs 0.0.15 → 0.0.17
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/bin/sdocs.js +1 -1
- package/dist/client/App.svelte +16 -39
- package/dist/client/App.svelte.d.ts +1 -1
- package/dist/client/favicon.png +0 -0
- package/dist/client/tree-builder.js +57 -14
- package/dist/client/{CollapsiblePanel.svelte → views/CollapsiblePanel.svelte} +5 -5
- package/dist/client/{ComponentView.svelte → views/ComponentView.svelte} +39 -13
- package/dist/client/{ComponentView.svelte.d.ts → views/ComponentView.svelte.d.ts} +1 -1
- package/dist/client/{ControlsPanel.svelte → views/ControlsPanel.svelte} +10 -15
- package/dist/client/{ControlsPanel.svelte.d.ts → views/ControlsPanel.svelte.d.ts} +1 -1
- package/dist/client/{DataTable.svelte → views/DataTable.svelte} +8 -8
- package/dist/client/{HomePage.svelte → views/HomePage.svelte} +10 -8
- package/dist/client/{HomePage.svelte.d.ts → views/HomePage.svelte.d.ts} +1 -1
- package/dist/client/{LayoutView.svelte → views/LayoutView.svelte} +1 -1
- package/dist/client/{LayoutView.svelte.d.ts → views/LayoutView.svelte.d.ts} +1 -1
- package/dist/client/{PageView.svelte → views/PageView.svelte} +7 -7
- package/dist/client/{PageView.svelte.d.ts → views/PageView.svelte.d.ts} +1 -1
- package/dist/client/{PreviewFrame.svelte → views/PreviewFrame.svelte} +10 -3
- package/dist/client/views/Sidebar.svelte +369 -0
- package/dist/client/{Sidebar.svelte.d.ts → views/Sidebar.svelte.d.ts} +2 -2
- package/dist/commands/build.js +2 -2
- package/dist/commands/dev.js +2 -2
- package/dist/commands/init.js +4 -4
- package/dist/commands/preview.js +1 -1
- package/dist/{app-gen.d.ts → server/app-gen.d.ts} +1 -1
- package/dist/{app-gen.js → server/app-gen.js} +4 -4
- package/dist/{cli.js → server/cli.js} +4 -4
- package/dist/{config.d.ts → server/config.d.ts} +1 -1
- package/dist/{config.js → server/config.js} +7 -2
- package/dist/server/discovery.d.ts +1 -1
- package/dist/server/discovery.js +1 -1
- package/dist/server/meta-parser.js +1 -1
- package/dist/server/prop-parser.js +12 -4
- package/dist/server/snippet-compiler.js +8 -0
- package/dist/server/snippet-extractor.d.ts +1 -1
- package/dist/server/snippet-extractor.js +40 -5
- package/dist/server/toc-extractor.d.ts +0 -2
- package/dist/server/toc-extractor.js +0 -14
- package/dist/types.d.ts +3 -3
- package/dist/ui/About.page.sdoc +37 -0
- package/dist/ui/Button/Button.sdoc +51 -0
- package/dist/ui/Button/Button.svelte +90 -0
- package/dist/ui/Button/Button.svelte.d.ts +27 -0
- package/dist/ui/Button/index.d.ts +1 -0
- package/dist/ui/Button/index.js +1 -0
- package/dist/ui/Control/Checkbox.sdoc +17 -0
- package/dist/{client/controls/CheckboxControl.svelte → ui/Control/Checkbox.svelte} +1 -1
- package/dist/ui/Control/Checkbox.svelte.d.ts +8 -0
- package/dist/ui/Control/Color.sdoc +17 -0
- package/dist/{client/controls/ColorControl.svelte → ui/Control/Color.svelte} +4 -4
- package/dist/ui/Control/Color.svelte.d.ts +8 -0
- package/dist/ui/Control/Dimension.sdoc +17 -0
- package/dist/{client/controls/DimensionControl.svelte → ui/Control/Dimension.svelte} +5 -5
- package/dist/ui/Control/Dimension.svelte.d.ts +8 -0
- package/dist/ui/Control/Number.sdoc +17 -0
- package/dist/{client/controls/NumberControl.svelte → ui/Control/Number.svelte} +4 -4
- package/dist/ui/Control/Number.svelte.d.ts +8 -0
- package/dist/ui/Control/Select.sdoc +18 -0
- package/dist/{client/controls/SelectControl.svelte → ui/Control/Select.svelte} +4 -4
- package/dist/ui/Control/Select.svelte.d.ts +9 -0
- package/dist/ui/Control/Text.sdoc +17 -0
- package/dist/{client/controls/TextControl.svelte → ui/Control/Text.svelte} +4 -4
- package/dist/ui/Control/Text.svelte.d.ts +8 -0
- package/dist/ui/Control/index.d.ts +6 -0
- package/dist/ui/Control/index.js +6 -0
- package/dist/ui/Dashboard.layout.sdoc +60 -0
- package/dist/ui/Frame/Frame.sdoc +54 -0
- package/dist/ui/Frame/Frame.svelte +88 -0
- package/dist/ui/Frame/Frame.svelte.d.ts +15 -0
- package/dist/ui/Frame/index.d.ts +1 -0
- package/dist/ui/Frame/index.js +1 -0
- package/dist/ui/Icon/Icon.sdoc +45 -0
- package/dist/ui/Icon/Icon.svelte +73 -0
- package/dist/ui/Icon/Icon.svelte.d.ts +16 -0
- package/dist/ui/Icon/icons/bookmark.svg +1 -0
- package/dist/ui/Icon/icons/chevron-down.svg +1 -0
- package/dist/ui/Icon/icons/chevron-left.svg +1 -0
- package/dist/ui/Icon/icons/chevron-right.svg +1 -0
- package/dist/ui/Icon/icons/chevron-up.svg +1 -0
- package/dist/ui/Icon/icons/code.svg +1 -0
- package/dist/ui/Icon/icons/component.svg +1 -0
- package/dist/ui/Icon/icons/copy.svg +1 -0
- package/dist/ui/Icon/icons/diamond.svg +1 -0
- package/dist/ui/Icon/icons/file-code.svg +1 -0
- package/dist/ui/Icon/icons/file-text.svg +1 -0
- package/dist/ui/Icon/icons/folder-open.svg +1 -0
- package/dist/ui/Icon/icons/folder.svg +1 -0
- package/dist/ui/Icon/icons/panels-top-left.svg +1 -0
- package/dist/ui/Icon/icons/sdocs.svg +8 -0
- package/dist/ui/Icon/index.d.ts +1 -0
- package/dist/ui/Icon/index.js +1 -0
- package/dist/ui/NavTree/Group.sdoc +46 -0
- package/dist/ui/NavTree/Group.svelte +82 -0
- package/dist/ui/NavTree/Group.svelte.d.ts +11 -0
- package/dist/ui/NavTree/Item.sdoc +70 -0
- package/dist/ui/NavTree/Item.svelte +164 -0
- package/dist/ui/NavTree/Item.svelte.d.ts +33 -0
- package/dist/ui/NavTree/NavTree.sdoc +119 -0
- package/dist/ui/NavTree/NavTree.svelte +31 -0
- package/dist/ui/NavTree/NavTree.svelte.d.ts +8 -0
- package/dist/ui/NavTree/index.js +6 -0
- package/dist/ui/Stack/Stack.sdoc +44 -0
- package/dist/ui/Stack/Stack.svelte +41 -0
- package/dist/ui/Stack/Stack.svelte.d.ts +19 -0
- package/dist/ui/Stack/index.d.ts +1 -0
- package/dist/ui/Stack/index.js +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +6 -0
- package/dist/{client/theme.css → ui/styles/fonts.css} +0 -37
- package/dist/ui/styles/theme.css +910 -0
- package/dist/vite.js +47 -51
- package/package.json +5 -2
- package/dist/client/Sidebar.svelte +0 -329
- package/dist/client/controls/CheckboxControl.svelte.d.ts +0 -8
- package/dist/client/controls/ColorControl.svelte.d.ts +0 -8
- package/dist/client/controls/DimensionControl.svelte.d.ts +0 -8
- package/dist/client/controls/NumberControl.svelte.d.ts +0 -8
- package/dist/client/controls/SelectControl.svelte.d.ts +0 -9
- package/dist/client/controls/TextControl.svelte.d.ts +0 -8
- package/dist/server/sdocx-parser.d.ts +0 -11
- package/dist/server/sdocx-parser.js +0 -197
- /package/dist/client/{CollapsiblePanel.svelte.d.ts → views/CollapsiblePanel.svelte.d.ts} +0 -0
- /package/dist/client/{DataTable.svelte.d.ts → views/DataTable.svelte.d.ts} +0 -0
- /package/dist/client/{PreviewFrame.svelte.d.ts → views/PreviewFrame.svelte.d.ts} +0 -0
- /package/dist/{cli.d.ts → server/cli.d.ts} +0 -0
- /package/dist/{client → ui/styles}/fonts/figtree-italic-latin-ext.woff2 +0 -0
- /package/dist/{client → ui/styles}/fonts/figtree-italic-latin.woff2 +0 -0
- /package/dist/{client → ui/styles}/fonts/figtree-latin-ext.woff2 +0 -0
- /package/dist/{client → ui/styles}/fonts/figtree-latin.woff2 +0 -0
- /package/dist/{client → ui/styles}/fonts/jetbrains-mono-italic-latin-ext.woff2 +0 -0
- /package/dist/{client → ui/styles}/fonts/jetbrains-mono-italic-latin.woff2 +0 -0
- /package/dist/{client → ui/styles}/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
- /package/dist/{client → ui/styles}/fonts/jetbrains-mono-latin.woff2 +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { Icon } from '../Icon/index.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @cssvar {shorthand} --p - Padding
|
|
7
|
+
* @cssvar {shorthand} --m - Margin
|
|
8
|
+
* @cssvar {length} --r - Border radius
|
|
9
|
+
* @cssvar {shorthand} --b - Border
|
|
10
|
+
* @cssvar {color} --bg - Background color
|
|
11
|
+
* @cssvar {color} --bg-active - Background when active
|
|
12
|
+
* @cssvar {color} --bg-active-hover - Background when active and hovered
|
|
13
|
+
* @cssvar {color} --bg-hover - Background on hover
|
|
14
|
+
* @cssvar {color} --expander-color - Expander icon color
|
|
15
|
+
* @cssvar {color} --expander-color-active - Expander icon color when active
|
|
16
|
+
* @cssvar {color} --expander-color-hover - Expander icon color on hover
|
|
17
|
+
* @cssvar {length} --expander-size - Expander icon size
|
|
18
|
+
* @cssvar {color} --font-color - Text color
|
|
19
|
+
* @cssvar {color} --font-color-active - Text color when active
|
|
20
|
+
* @cssvar {color} --font-color-hover - Text color on hover
|
|
21
|
+
* @cssvar {string} --font-weight - Font weight
|
|
22
|
+
*/
|
|
23
|
+
interface Props {
|
|
24
|
+
label: string;
|
|
25
|
+
href?: string;
|
|
26
|
+
active?: boolean;
|
|
27
|
+
left?: Snippet;
|
|
28
|
+
right?: Snippet;
|
|
29
|
+
expanded?: boolean;
|
|
30
|
+
children?: Snippet;
|
|
31
|
+
class?: string;
|
|
32
|
+
onclick?: () => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let {
|
|
36
|
+
label,
|
|
37
|
+
href,
|
|
38
|
+
active = false,
|
|
39
|
+
left,
|
|
40
|
+
right,
|
|
41
|
+
expanded = $bindable(false),
|
|
42
|
+
children,
|
|
43
|
+
class: className = '',
|
|
44
|
+
onclick,
|
|
45
|
+
}: Props = $props();
|
|
46
|
+
|
|
47
|
+
const isFolder = $derived(!!children);
|
|
48
|
+
|
|
49
|
+
function toggle() {
|
|
50
|
+
expanded = !expanded;
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
{#snippet content()}
|
|
55
|
+
{#if left}<span class="NavTree-left">{@render left()}</span>{/if}
|
|
56
|
+
<span class="NavTree-item-label">{label}</span>
|
|
57
|
+
{#if right}<span class="NavTree-right">{@render right()}</span>{/if}
|
|
58
|
+
<span class="NavTree-chevron" class:visible={isFolder}>
|
|
59
|
+
<Icon name={expanded ? 'chevron-down' : 'chevron-right'} --w="var(--expander-size, 14px)" --h="var(--expander-size, 14px)" --fill="var(--expander-color, var(--color-base-300))" />
|
|
60
|
+
</span>
|
|
61
|
+
{/snippet}
|
|
62
|
+
|
|
63
|
+
{#if isFolder}
|
|
64
|
+
<div class="NavTree-item-wrapper {className}">
|
|
65
|
+
<button class="NavTree-item" class:active onclick={onclick ?? toggle}>
|
|
66
|
+
{@render content()}
|
|
67
|
+
</button>
|
|
68
|
+
{#if expanded}
|
|
69
|
+
<div class="NavTree-children">
|
|
70
|
+
{@render children()}
|
|
71
|
+
</div>
|
|
72
|
+
{/if}
|
|
73
|
+
</div>
|
|
74
|
+
{:else if href}
|
|
75
|
+
<a {href} class="NavTree-item {className}" class:active {onclick}>
|
|
76
|
+
{@render content()}
|
|
77
|
+
</a>
|
|
78
|
+
{:else}
|
|
79
|
+
<button class="NavTree-item {className}" class:active {onclick}>
|
|
80
|
+
{@render content()}
|
|
81
|
+
</button>
|
|
82
|
+
{/if}
|
|
83
|
+
|
|
84
|
+
<style>
|
|
85
|
+
.NavTree-item {
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: 6px;
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 28px;
|
|
91
|
+
padding: var(--p, 0 12px);
|
|
92
|
+
margin: var(--m, 0);
|
|
93
|
+
border-radius: var(--r, 0);
|
|
94
|
+
border: var(--b, none);
|
|
95
|
+
font: inherit;
|
|
96
|
+
color: var(--font-color, inherit);
|
|
97
|
+
font-weight: var(--font-weight, inherit);
|
|
98
|
+
background: var(--bg, none);
|
|
99
|
+
text-decoration: none;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
text-align: left;
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.NavTree-item:hover {
|
|
106
|
+
background: var(--bg-hover, var(--color-base-150));
|
|
107
|
+
color: var(--font-color-hover, inherit);
|
|
108
|
+
--expander-color: var(--expander-color-hover, var(--color-base-400));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.NavTree-item.active {
|
|
112
|
+
background: var(--bg-active, var(--color-base-100));
|
|
113
|
+
color: var(--font-color-active, inherit);
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
--expander-color: var(--expander-color-active, var(--color-base-400));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.NavTree-item.active:hover {
|
|
119
|
+
background: var(--bg-active-hover, var(--color-base-150));
|
|
120
|
+
--expander-color: var(--expander-color-hover, var(--color-base-500));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.NavTree-item-label {
|
|
124
|
+
flex: 1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.NavTree-left {
|
|
128
|
+
display: inline-flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
flex-shrink: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.NavTree-right {
|
|
134
|
+
display: inline-flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
flex-shrink: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.NavTree-chevron {
|
|
140
|
+
display: inline-flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
width: var(--expander-size, 14px);
|
|
143
|
+
color: var(--expander-color, var(--color-base-300));
|
|
144
|
+
flex-shrink: 0;
|
|
145
|
+
visibility: hidden;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.NavTree-chevron.visible {
|
|
149
|
+
visibility: visible;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.NavTree-item-wrapper {
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-direction: column;
|
|
155
|
+
gap: 1px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.NavTree-children {
|
|
159
|
+
padding-left: 16px;
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-direction: column;
|
|
162
|
+
gap: 1px;
|
|
163
|
+
}
|
|
164
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
/**
|
|
3
|
+
* @cssvar {shorthand} --p - Padding
|
|
4
|
+
* @cssvar {shorthand} --m - Margin
|
|
5
|
+
* @cssvar {length} --r - Border radius
|
|
6
|
+
* @cssvar {shorthand} --b - Border
|
|
7
|
+
* @cssvar {color} --bg - Background color
|
|
8
|
+
* @cssvar {color} --bg-active - Background when active
|
|
9
|
+
* @cssvar {color} --bg-active-hover - Background when active and hovered
|
|
10
|
+
* @cssvar {color} --bg-hover - Background on hover
|
|
11
|
+
* @cssvar {color} --expander-color - Expander icon color
|
|
12
|
+
* @cssvar {color} --expander-color-active - Expander icon color when active
|
|
13
|
+
* @cssvar {color} --expander-color-hover - Expander icon color on hover
|
|
14
|
+
* @cssvar {length} --expander-size - Expander icon size
|
|
15
|
+
* @cssvar {color} --font-color - Text color
|
|
16
|
+
* @cssvar {color} --font-color-active - Text color when active
|
|
17
|
+
* @cssvar {color} --font-color-hover - Text color on hover
|
|
18
|
+
* @cssvar {string} --font-weight - Font weight
|
|
19
|
+
*/
|
|
20
|
+
interface Props {
|
|
21
|
+
label: string;
|
|
22
|
+
href?: string;
|
|
23
|
+
active?: boolean;
|
|
24
|
+
left?: Snippet;
|
|
25
|
+
right?: Snippet;
|
|
26
|
+
expanded?: boolean;
|
|
27
|
+
children?: Snippet;
|
|
28
|
+
class?: string;
|
|
29
|
+
onclick?: () => void;
|
|
30
|
+
}
|
|
31
|
+
declare const Item: import("svelte").Component<Props, {}, "expanded">;
|
|
32
|
+
type Item = ReturnType<typeof Item>;
|
|
33
|
+
export default Item;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import NavTree from './index.js';
|
|
3
|
+
import NavTreeRoot from './NavTree.svelte';
|
|
4
|
+
import { Icon } from '../Icon/index.js';
|
|
5
|
+
|
|
6
|
+
export const meta = {
|
|
7
|
+
component: NavTreeRoot,
|
|
8
|
+
title: 'NavTree',
|
|
9
|
+
description: 'A composable tree navigation with Item and Group subcomponents.',
|
|
10
|
+
};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
{#snippet Default()}
|
|
14
|
+
<NavTree>
|
|
15
|
+
<NavTree.Group label="Components">
|
|
16
|
+
<NavTree.Item label="UI" expanded>
|
|
17
|
+
{#snippet left()}<Icon name="folder-open" --w="14px" --h="14px" --fill="var(--color-base-400)" />{/snippet}
|
|
18
|
+
<NavTree.Item label="Button" expanded --font-weight="500">
|
|
19
|
+
{#snippet left()}<Icon name="component" --w="14px" --h="14px" --fill="var(--color-component-500)" />{/snippet}
|
|
20
|
+
<NavTree.Item label="Docs" href="#/ui/button/docs" --font-weight="400">
|
|
21
|
+
{#snippet left()}<Icon name="file-code" --w="14px" --h="14px" --fill="var(--color-docs-500)" />{/snippet}
|
|
22
|
+
</NavTree.Item>
|
|
23
|
+
<NavTree.Item label="Primary" href="#/ui/button/primary" active --font-weight="400">
|
|
24
|
+
{#snippet left()}<Icon name="bookmark" --w="14px" --h="14px" --fill="var(--color-example-600)" />{/snippet}
|
|
25
|
+
</NavTree.Item>
|
|
26
|
+
<NavTree.Item label="Outlined" href="#/ui/button/outlined" --font-weight="400">
|
|
27
|
+
{#snippet left()}<Icon name="bookmark" --w="14px" --h="14px" --fill="var(--color-example-600)" />{/snippet}
|
|
28
|
+
</NavTree.Item>
|
|
29
|
+
</NavTree.Item>
|
|
30
|
+
<NavTree.Item label="Icon" --font-weight="500">
|
|
31
|
+
{#snippet left()}<Icon name="component" --w="14px" --h="14px" --fill="var(--color-component-500)" />{/snippet}
|
|
32
|
+
<NavTree.Item label="Docs" href="#/ui/icon/docs" --font-weight="400">
|
|
33
|
+
{#snippet left()}<Icon name="file-code" --w="14px" --h="14px" --fill="var(--color-docs-500)" />{/snippet}
|
|
34
|
+
</NavTree.Item>
|
|
35
|
+
<NavTree.Item label="Sizes" href="#/ui/icon/sizes" --font-weight="400">
|
|
36
|
+
{#snippet left()}<Icon name="bookmark" --w="14px" --h="14px" --fill="var(--color-example-600)" />{/snippet}
|
|
37
|
+
</NavTree.Item>
|
|
38
|
+
</NavTree.Item>
|
|
39
|
+
<NavTree.Item label="Frame" --font-weight="500">
|
|
40
|
+
{#snippet left()}<Icon name="component" --w="14px" --h="14px" --fill="var(--color-component-500)" />{/snippet}
|
|
41
|
+
<NavTree.Item label="Docs" href="#/ui/frame/docs" --font-weight="400">
|
|
42
|
+
{#snippet left()}<Icon name="file-code" --w="14px" --h="14px" --fill="var(--color-docs-500)" />{/snippet}
|
|
43
|
+
</NavTree.Item>
|
|
44
|
+
</NavTree.Item>
|
|
45
|
+
</NavTree.Item>
|
|
46
|
+
<NavTree.Item label="Card" expanded --font-weight="500">
|
|
47
|
+
{#snippet left()}<Icon name="component" --w="14px" --h="14px" --fill="var(--color-component-500)" />{/snippet}
|
|
48
|
+
<NavTree.Item label="Docs" href="#/card/docs" --font-weight="400">
|
|
49
|
+
{#snippet left()}<Icon name="file-code" --w="14px" --h="14px" --fill="var(--color-docs-500)" />{/snippet}
|
|
50
|
+
</NavTree.Item>
|
|
51
|
+
<NavTree.Item label="WithImage" href="#/card/with-image" --font-weight="400">
|
|
52
|
+
{#snippet left()}<Icon name="bookmark" --w="14px" --h="14px" --fill="var(--color-example-600)" />{/snippet}
|
|
53
|
+
</NavTree.Item>
|
|
54
|
+
</NavTree.Item>
|
|
55
|
+
<NavTree.Item label="Badge" --font-weight="500">
|
|
56
|
+
{#snippet left()}<Icon name="component" --w="14px" --h="14px" --fill="var(--color-component-500)" />{/snippet}
|
|
57
|
+
<NavTree.Item label="Docs" href="#/badge/docs" --font-weight="400">
|
|
58
|
+
{#snippet left()}<Icon name="file-code" --w="14px" --h="14px" --fill="var(--color-docs-500)" />{/snippet}
|
|
59
|
+
</NavTree.Item>
|
|
60
|
+
<NavTree.Item label="Status" href="#/badge/status" --font-weight="400">
|
|
61
|
+
{#snippet left()}<Icon name="bookmark" --w="14px" --h="14px" --fill="var(--color-example-600)" />{/snippet}
|
|
62
|
+
</NavTree.Item>
|
|
63
|
+
</NavTree.Item>
|
|
64
|
+
</NavTree.Group>
|
|
65
|
+
<NavTree.Group label="Pages">
|
|
66
|
+
<NavTree.Item label="Getting Started" href="#/pages/getting-started" --font-weight="500">
|
|
67
|
+
{#snippet left()}<Icon name="file-text" --w="14px" --h="14px" --fill="var(--color-page-550)" />{/snippet}
|
|
68
|
+
</NavTree.Item>
|
|
69
|
+
<NavTree.Item label="Changelog" href="#/pages/changelog" --font-weight="500">
|
|
70
|
+
{#snippet left()}<Icon name="file-text" --w="14px" --h="14px" --fill="var(--color-page-550)" />{/snippet}
|
|
71
|
+
</NavTree.Item>
|
|
72
|
+
</NavTree.Group>
|
|
73
|
+
<NavTree.Group label="Layouts">
|
|
74
|
+
<NavTree.Item label="LoginForm" href="#/layouts/login-form" --font-weight="500">
|
|
75
|
+
{#snippet left()}<Icon name="panels-top-left" --w="14px" --h="14px" --fill="var(--color-layout-500)" />{/snippet}
|
|
76
|
+
</NavTree.Item>
|
|
77
|
+
<NavTree.Item label="Dashboard" href="#/layouts/dashboard" --font-weight="500">
|
|
78
|
+
{#snippet left()}<Icon name="panels-top-left" --w="14px" --h="14px" --fill="var(--color-layout-500)" />{/snippet}
|
|
79
|
+
</NavTree.Item>
|
|
80
|
+
</NavTree.Group>
|
|
81
|
+
</NavTree>
|
|
82
|
+
{/snippet}
|
|
83
|
+
|
|
84
|
+
{#snippet WithSlots()}
|
|
85
|
+
<NavTree>
|
|
86
|
+
<NavTree.Group label="Files">
|
|
87
|
+
<NavTree.Item label="index.ts" href="#/index">
|
|
88
|
+
{#snippet left()}<Icon name="folder" --w="14px" --h="14px" />{/snippet}
|
|
89
|
+
{#snippet right()}<span style="font-size: 11px; color: #9ca3af;">2.4kb</span>{/snippet}
|
|
90
|
+
</NavTree.Item>
|
|
91
|
+
<NavTree.Item label="utils.ts" href="#/utils">
|
|
92
|
+
{#snippet left()}<Icon name="folder" --w="14px" --h="14px" />{/snippet}
|
|
93
|
+
{#snippet right()}<span style="font-size: 11px; color: tomato;">54kb</span>{/snippet}
|
|
94
|
+
</NavTree.Item>
|
|
95
|
+
<NavTree.Item label="config.ts" href="#/config">
|
|
96
|
+
{#snippet left()}<Icon name="folder-open" --w="14px" --h="14px" --fill="var(--color-base-400)" />{/snippet}
|
|
97
|
+
{#snippet right()}<span style="font-size: 11px; color: #9ca3af;">1.1kb</span>{/snippet}
|
|
98
|
+
</NavTree.Item>
|
|
99
|
+
</NavTree.Group>
|
|
100
|
+
</NavTree>
|
|
101
|
+
{/snippet}
|
|
102
|
+
|
|
103
|
+
{#snippet NestedFolders()}
|
|
104
|
+
<NavTree>
|
|
105
|
+
<NavTree.Item label="src" expanded>
|
|
106
|
+
<NavTree.Item label="lib" expanded>
|
|
107
|
+
<NavTree.Item label="ui">
|
|
108
|
+
<NavTree.Item label="Frame.svelte" />
|
|
109
|
+
<NavTree.Item label="index.ts" />
|
|
110
|
+
</NavTree.Item>
|
|
111
|
+
<NavTree.Item label="server">
|
|
112
|
+
<NavTree.Item label="config.ts" />
|
|
113
|
+
<NavTree.Item label="cli.ts" />
|
|
114
|
+
</NavTree.Item>
|
|
115
|
+
</NavTree.Item>
|
|
116
|
+
<NavTree.Item label="app.ts" />
|
|
117
|
+
</NavTree.Item>
|
|
118
|
+
</NavTree>
|
|
119
|
+
{/snippet}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { children, class: className = '' }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<nav class="NavTree {className}">
|
|
13
|
+
{#if children}
|
|
14
|
+
{@render children()}
|
|
15
|
+
{/if}
|
|
16
|
+
</nav>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
.NavTree {
|
|
20
|
+
font-size: 13px;
|
|
21
|
+
line-height: 1.4;
|
|
22
|
+
color: var(--font-color, #111827);
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 1px;
|
|
26
|
+
padding: var(--p, 0);
|
|
27
|
+
margin: var(--m, 0);
|
|
28
|
+
border-radius: var(--r, 0);
|
|
29
|
+
border: var(--b, none);
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Stack from './Stack.svelte';
|
|
3
|
+
import { Button } from '../Button/index.js';
|
|
4
|
+
|
|
5
|
+
export const meta = {
|
|
6
|
+
component: Stack,
|
|
7
|
+
title: 'Stack',
|
|
8
|
+
description: 'A flex container with configurable direction, gap, alignment, and styling.',
|
|
9
|
+
};
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
{#snippet Column()}
|
|
13
|
+
<Stack --gap="8px">
|
|
14
|
+
<Button>One</Button>
|
|
15
|
+
<Button>Two</Button>
|
|
16
|
+
<Button>Three</Button>
|
|
17
|
+
</Stack>
|
|
18
|
+
{/snippet}
|
|
19
|
+
|
|
20
|
+
{#snippet Row()}
|
|
21
|
+
<Stack --direction="row" --gap="8px">
|
|
22
|
+
<Button>One</Button>
|
|
23
|
+
<Button>Two</Button>
|
|
24
|
+
<Button>Three</Button>
|
|
25
|
+
</Stack>
|
|
26
|
+
{/snippet}
|
|
27
|
+
|
|
28
|
+
{#snippet Centered()}
|
|
29
|
+
<Stack --direction="row" --gap="12px" --align="center" --justify="center" --p="16px" --bg="var(--color-base-50)" --r="8px">
|
|
30
|
+
<Button>Left</Button>
|
|
31
|
+
<Button>Center</Button>
|
|
32
|
+
<Button>Right</Button>
|
|
33
|
+
</Stack>
|
|
34
|
+
{/snippet}
|
|
35
|
+
|
|
36
|
+
{#snippet Wrap()}
|
|
37
|
+
<Stack --direction="row" --gap="8px" --wrap="wrap" style="max-width: 200px;">
|
|
38
|
+
<Button>A</Button>
|
|
39
|
+
<Button>B</Button>
|
|
40
|
+
<Button>C</Button>
|
|
41
|
+
<Button>D</Button>
|
|
42
|
+
<Button>E</Button>
|
|
43
|
+
</Stack>
|
|
44
|
+
{/snippet}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @cssvar {string} --direction - Flex direction (row | column)
|
|
6
|
+
* @cssvar {length} --gap - Gap between items
|
|
7
|
+
* @cssvar {string} --align - Align items
|
|
8
|
+
* @cssvar {string} --justify - Justify content
|
|
9
|
+
* @cssvar {string} --wrap - Flex wrap
|
|
10
|
+
* @cssvar {shorthand} --p - Padding
|
|
11
|
+
* @cssvar {color} --bg - Background color
|
|
12
|
+
* @cssvar {length} --r - Border radius
|
|
13
|
+
* @cssvar {shorthand} --b - Border
|
|
14
|
+
*/
|
|
15
|
+
interface Props {
|
|
16
|
+
children: Snippet;
|
|
17
|
+
class?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let { children, class: className = '' }: Props = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div class="Stack {className}">
|
|
24
|
+
{@render children()}
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<style>
|
|
28
|
+
.Stack {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: var(--direction, column);
|
|
31
|
+
gap: var(--gap, 0px);
|
|
32
|
+
align-items: var(--align, stretch);
|
|
33
|
+
justify-content: var(--justify, flex-start);
|
|
34
|
+
flex-wrap: var(--wrap, nowrap);
|
|
35
|
+
padding: var(--p, 0);
|
|
36
|
+
background: var(--bg, transparent);
|
|
37
|
+
border-radius: var(--r, 0);
|
|
38
|
+
border: var(--b, none);
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
/**
|
|
3
|
+
* @cssvar {string} --direction - Flex direction (row | column)
|
|
4
|
+
* @cssvar {length} --gap - Gap between items
|
|
5
|
+
* @cssvar {string} --align - Align items
|
|
6
|
+
* @cssvar {string} --justify - Justify content
|
|
7
|
+
* @cssvar {string} --wrap - Flex wrap
|
|
8
|
+
* @cssvar {shorthand} --p - Padding
|
|
9
|
+
* @cssvar {color} --bg - Background color
|
|
10
|
+
* @cssvar {length} --r - Border radius
|
|
11
|
+
* @cssvar {shorthand} --b - Border
|
|
12
|
+
*/
|
|
13
|
+
interface Props {
|
|
14
|
+
children: Snippet;
|
|
15
|
+
class?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const Stack: import("svelte").Component<Props, {}, "">;
|
|
18
|
+
type Stack = ReturnType<typeof Stack>;
|
|
19
|
+
export default Stack;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Stack } from './Stack.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Stack } from './Stack.svelte';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Button } from './Button/index.js';
|
|
2
|
+
export { Frame } from './Frame/index.js';
|
|
3
|
+
export { Icon } from './Icon/index.js';
|
|
4
|
+
export * as Control from './Control/index.js';
|
|
5
|
+
export { NavTree } from './NavTree/index.js';
|
|
6
|
+
export { Stack } from './Stack/index.js';
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Button } from './Button/index.js';
|
|
2
|
+
export { Frame } from './Frame/index.js';
|
|
3
|
+
export { Icon } from './Icon/index.js';
|
|
4
|
+
export * as Control from './Control/index.js';
|
|
5
|
+
export { NavTree } from './NavTree/index.js';
|
|
6
|
+
export { Stack } from './Stack/index.js';
|
|
@@ -85,40 +85,3 @@
|
|
|
85
85
|
U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
|
86
86
|
U+A720-A7FF;
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
/* sdocs design tokens */
|
|
90
|
-
|
|
91
|
-
:root,
|
|
92
|
-
[data-sdocs-theme="light"] {
|
|
93
|
-
--sdocs-font-sans: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
94
|
-
--sdocs-font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
|
|
95
|
-
--sdocs-bg: #ffffff;
|
|
96
|
-
--sdocs-bg-subtle: #f8fafc;
|
|
97
|
-
--sdocs-bg-hover: #f1f5f9;
|
|
98
|
-
--sdocs-border: #e2e8f0;
|
|
99
|
-
--sdocs-border-muted: #cbd5e1;
|
|
100
|
-
--sdocs-text: #475569;
|
|
101
|
-
--sdocs-text-secondary: #64748b;
|
|
102
|
-
--sdocs-text-muted: #94a3b8;
|
|
103
|
-
--sdocs-text-heading: #1e293b;
|
|
104
|
-
--sdocs-text-strong: #334155;
|
|
105
|
-
--sdocs-primary: #3b82f6;
|
|
106
|
-
--sdocs-primary-bg: rgba(59, 130, 246, 0.1);
|
|
107
|
-
--sdocs-shadow: rgba(0, 0, 0, 0.1);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
[data-sdocs-theme="dark"] {
|
|
111
|
-
--sdocs-bg: #0f172a;
|
|
112
|
-
--sdocs-bg-subtle: #1e293b;
|
|
113
|
-
--sdocs-bg-hover: #334155;
|
|
114
|
-
--sdocs-border: #334155;
|
|
115
|
-
--sdocs-border-muted: #475569;
|
|
116
|
-
--sdocs-text: #cbd5e1;
|
|
117
|
-
--sdocs-text-secondary: #94a3b8;
|
|
118
|
-
--sdocs-text-muted: #64748b;
|
|
119
|
-
--sdocs-text-heading: #f1f5f9;
|
|
120
|
-
--sdocs-text-strong: #e2e8f0;
|
|
121
|
-
--sdocs-primary: #60a5fa;
|
|
122
|
-
--sdocs-primary-bg: rgba(96, 165, 250, 0.15);
|
|
123
|
-
--sdocs-shadow: rgba(0, 0, 0, 0.3);
|
|
124
|
-
}
|