sdocs 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/bin/sdocs.js +1 -1
  2. package/dist/client/App.svelte +16 -39
  3. package/dist/client/App.svelte.d.ts +1 -1
  4. package/dist/client/favicon.png +0 -0
  5. package/dist/client/tree-builder.js +57 -14
  6. package/dist/client/{CollapsiblePanel.svelte → views/CollapsiblePanel.svelte} +5 -5
  7. package/dist/client/{ComponentView.svelte → views/ComponentView.svelte} +39 -13
  8. package/dist/client/{ComponentView.svelte.d.ts → views/ComponentView.svelte.d.ts} +1 -1
  9. package/dist/client/{ControlsPanel.svelte → views/ControlsPanel.svelte} +10 -15
  10. package/dist/client/{ControlsPanel.svelte.d.ts → views/ControlsPanel.svelte.d.ts} +1 -1
  11. package/dist/client/{DataTable.svelte → views/DataTable.svelte} +8 -8
  12. package/dist/client/{HomePage.svelte → views/HomePage.svelte} +10 -8
  13. package/dist/client/{HomePage.svelte.d.ts → views/HomePage.svelte.d.ts} +1 -1
  14. package/dist/client/{LayoutView.svelte → views/LayoutView.svelte} +1 -1
  15. package/dist/client/{LayoutView.svelte.d.ts → views/LayoutView.svelte.d.ts} +1 -1
  16. package/dist/client/{PageView.svelte → views/PageView.svelte} +7 -7
  17. package/dist/client/{PageView.svelte.d.ts → views/PageView.svelte.d.ts} +1 -1
  18. package/dist/client/{PreviewFrame.svelte → views/PreviewFrame.svelte} +10 -3
  19. package/dist/client/views/Sidebar.svelte +369 -0
  20. package/dist/client/{Sidebar.svelte.d.ts → views/Sidebar.svelte.d.ts} +2 -2
  21. package/dist/commands/build.js +2 -2
  22. package/dist/commands/dev.js +2 -2
  23. package/dist/commands/init.js +4 -4
  24. package/dist/commands/preview.js +1 -1
  25. package/dist/{app-gen.d.ts → server/app-gen.d.ts} +1 -1
  26. package/dist/{app-gen.js → server/app-gen.js} +4 -4
  27. package/dist/{cli.js → server/cli.js} +4 -4
  28. package/dist/{config.d.ts → server/config.d.ts} +1 -1
  29. package/dist/{config.js → server/config.js} +7 -2
  30. package/dist/server/discovery.d.ts +1 -1
  31. package/dist/server/discovery.js +1 -1
  32. package/dist/server/meta-parser.js +1 -1
  33. package/dist/server/prop-parser.js +12 -4
  34. package/dist/server/snippet-compiler.js +8 -0
  35. package/dist/server/snippet-extractor.d.ts +1 -1
  36. package/dist/server/snippet-extractor.js +40 -5
  37. package/dist/server/toc-extractor.d.ts +0 -2
  38. package/dist/server/toc-extractor.js +0 -14
  39. package/dist/types.d.ts +3 -3
  40. package/dist/ui/About.page.sdoc +37 -0
  41. package/dist/ui/Button/Button.sdoc +51 -0
  42. package/dist/ui/Button/Button.svelte +90 -0
  43. package/dist/ui/Button/Button.svelte.d.ts +27 -0
  44. package/dist/ui/Button/index.d.ts +1 -0
  45. package/dist/ui/Button/index.js +1 -0
  46. package/dist/ui/Control/Checkbox.sdoc +17 -0
  47. package/dist/{client/controls/CheckboxControl.svelte → ui/Control/Checkbox.svelte} +1 -1
  48. package/dist/ui/Control/Checkbox.svelte.d.ts +8 -0
  49. package/dist/ui/Control/Color.sdoc +17 -0
  50. package/dist/{client/controls/ColorControl.svelte → ui/Control/Color.svelte} +4 -4
  51. package/dist/ui/Control/Color.svelte.d.ts +8 -0
  52. package/dist/ui/Control/Dimension.sdoc +17 -0
  53. package/dist/{client/controls/DimensionControl.svelte → ui/Control/Dimension.svelte} +5 -5
  54. package/dist/ui/Control/Dimension.svelte.d.ts +8 -0
  55. package/dist/ui/Control/Number.sdoc +17 -0
  56. package/dist/{client/controls/NumberControl.svelte → ui/Control/Number.svelte} +4 -4
  57. package/dist/ui/Control/Number.svelte.d.ts +8 -0
  58. package/dist/ui/Control/Select.sdoc +18 -0
  59. package/dist/{client/controls/SelectControl.svelte → ui/Control/Select.svelte} +4 -4
  60. package/dist/ui/Control/Select.svelte.d.ts +9 -0
  61. package/dist/ui/Control/Text.sdoc +17 -0
  62. package/dist/{client/controls/TextControl.svelte → ui/Control/Text.svelte} +4 -4
  63. package/dist/ui/Control/Text.svelte.d.ts +8 -0
  64. package/dist/ui/Control/index.d.ts +6 -0
  65. package/dist/ui/Control/index.js +6 -0
  66. package/dist/ui/Dashboard.layout.sdoc +60 -0
  67. package/dist/ui/Frame/Frame.sdoc +54 -0
  68. package/dist/ui/Frame/Frame.svelte +88 -0
  69. package/dist/ui/Frame/Frame.svelte.d.ts +15 -0
  70. package/dist/ui/Frame/index.d.ts +1 -0
  71. package/dist/ui/Frame/index.js +1 -0
  72. package/dist/ui/Icon/Icon.sdoc +45 -0
  73. package/dist/ui/Icon/Icon.svelte +47 -0
  74. package/dist/ui/Icon/Icon.svelte.d.ts +16 -0
  75. package/dist/ui/Icon/icons/bookmark.svg +1 -0
  76. package/dist/ui/Icon/icons/chevron-down.svg +1 -0
  77. package/dist/ui/Icon/icons/chevron-left.svg +1 -0
  78. package/dist/ui/Icon/icons/chevron-right.svg +1 -0
  79. package/dist/ui/Icon/icons/chevron-up.svg +1 -0
  80. package/dist/ui/Icon/icons/code.svg +1 -0
  81. package/dist/ui/Icon/icons/component.svg +1 -0
  82. package/dist/ui/Icon/icons/copy.svg +1 -0
  83. package/dist/ui/Icon/icons/diamond.svg +1 -0
  84. package/dist/ui/Icon/icons/file-code.svg +1 -0
  85. package/dist/ui/Icon/icons/file-text.svg +1 -0
  86. package/dist/ui/Icon/icons/folder-open.svg +1 -0
  87. package/dist/ui/Icon/icons/folder.svg +1 -0
  88. package/dist/ui/Icon/icons/panels-top-left.svg +1 -0
  89. package/dist/ui/Icon/icons/sdocs.svg +8 -0
  90. package/dist/ui/Icon/index.d.ts +1 -0
  91. package/dist/ui/Icon/index.js +1 -0
  92. package/dist/ui/NavTree/Group.sdoc +46 -0
  93. package/dist/ui/NavTree/Group.svelte +82 -0
  94. package/dist/ui/NavTree/Group.svelte.d.ts +11 -0
  95. package/dist/ui/NavTree/Item.sdoc +70 -0
  96. package/dist/ui/NavTree/Item.svelte +164 -0
  97. package/dist/ui/NavTree/Item.svelte.d.ts +33 -0
  98. package/dist/ui/NavTree/NavTree.sdoc +119 -0
  99. package/dist/ui/NavTree/NavTree.svelte +31 -0
  100. package/dist/ui/NavTree/NavTree.svelte.d.ts +8 -0
  101. package/dist/ui/NavTree/index.js +6 -0
  102. package/dist/ui/Stack/Stack.sdoc +44 -0
  103. package/dist/ui/Stack/Stack.svelte +41 -0
  104. package/dist/ui/Stack/Stack.svelte.d.ts +19 -0
  105. package/dist/ui/Stack/index.d.ts +1 -0
  106. package/dist/ui/Stack/index.js +1 -0
  107. package/dist/ui/index.d.ts +6 -0
  108. package/dist/ui/index.js +6 -0
  109. package/dist/ui/styles/fonts/jetbrains-mono-italic-latin-ext.woff2 +0 -0
  110. package/dist/ui/styles/fonts/jetbrains-mono-italic-latin.woff2 +0 -0
  111. package/dist/ui/styles/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  112. package/dist/ui/styles/fonts/jetbrains-mono-latin.woff2 +0 -0
  113. package/dist/ui/styles/fonts.css +87 -0
  114. package/dist/ui/styles/theme.css +910 -0
  115. package/dist/vite.js +47 -51
  116. package/package.json +5 -2
  117. package/dist/client/Sidebar.svelte +0 -329
  118. package/dist/client/controls/CheckboxControl.svelte.d.ts +0 -8
  119. package/dist/client/controls/ColorControl.svelte.d.ts +0 -8
  120. package/dist/client/controls/DimensionControl.svelte.d.ts +0 -8
  121. package/dist/client/controls/NumberControl.svelte.d.ts +0 -8
  122. package/dist/client/controls/SelectControl.svelte.d.ts +0 -9
  123. package/dist/client/controls/TextControl.svelte.d.ts +0 -8
  124. package/dist/client/theme.css +0 -80
  125. package/dist/server/sdocx-parser.d.ts +0 -11
  126. package/dist/server/sdocx-parser.js +0 -197
  127. /package/dist/client/{CollapsiblePanel.svelte.d.ts → views/CollapsiblePanel.svelte.d.ts} +0 -0
  128. /package/dist/client/{DataTable.svelte.d.ts → views/DataTable.svelte.d.ts} +0 -0
  129. /package/dist/client/{PreviewFrame.svelte.d.ts → views/PreviewFrame.svelte.d.ts} +0 -0
  130. /package/dist/{cli.d.ts → server/cli.d.ts} +0 -0
  131. /package/dist/{client → ui/styles}/fonts/figtree-italic-latin-ext.woff2 +0 -0
  132. /package/dist/{client → ui/styles}/fonts/figtree-italic-latin.woff2 +0 -0
  133. /package/dist/{client → ui/styles}/fonts/figtree-latin-ext.woff2 +0 -0
  134. /package/dist/{client → ui/styles}/fonts/figtree-latin.woff2 +0 -0
@@ -0,0 +1,60 @@
1
+ <script lang="ts">
2
+ export const meta = {
3
+ title: ':Layouts / Dashboard',
4
+ description: 'A dashboard layout with header, sidebar, and content area.',
5
+ };
6
+ </script>
7
+
8
+ <div style="display: flex; flex-direction: column; height: 100vh; font-family: system-ui, sans-serif;">
9
+ <header style="padding: 12px 24px; background: #1e293b; color: white; display: flex; align-items: center; justify-content: space-between;">
10
+ <span style="font-weight: 700; font-size: 16px;">Dashboard</span>
11
+ <nav style="display: flex; gap: 16px; font-size: 14px;">
12
+ <span style="color: #94a3b8; cursor: pointer;">Settings</span>
13
+ <span style="color: #94a3b8; cursor: pointer;">Profile</span>
14
+ </nav>
15
+ </header>
16
+ <div style="display: flex; flex: 1; overflow: hidden;">
17
+ <aside style="width: 200px; background: #f8fafc; border-right: 1px solid #e2e8f0; padding: 16px;">
18
+ <nav style="display: flex; flex-direction: column; gap: 4px;">
19
+ <div style="padding: 8px 12px; border-radius: 6px; color: #334155; background: #e2e8f0; font-size: 14px; font-weight: 500;">Overview</div>
20
+ <div style="padding: 8px 12px; border-radius: 6px; color: #64748b; font-size: 14px;">Analytics</div>
21
+ <div style="padding: 8px 12px; border-radius: 6px; color: #64748b; font-size: 14px;">Users</div>
22
+ <div style="padding: 8px 12px; border-radius: 6px; color: #64748b; font-size: 14px;">Reports</div>
23
+ </nav>
24
+ </aside>
25
+ <main style="flex: 1; padding: 24px; overflow-y: auto; background: #ffffff;">
26
+ <h1 style="font-size: 24px; font-weight: 700; margin: 0 0 16px; color: #0f172a;">Overview</h1>
27
+ <div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px;">
28
+ <div style="padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0;">
29
+ <div style="font-size: 13px; color: #64748b; margin-bottom: 4px;">Total Users</div>
30
+ <div style="font-size: 28px; font-weight: 700; color: #0f172a;">1,234</div>
31
+ </div>
32
+ <div style="padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0;">
33
+ <div style="font-size: 13px; color: #64748b; margin-bottom: 4px;">Revenue</div>
34
+ <div style="font-size: 28px; font-weight: 700; color: #0f172a;">$12.4k</div>
35
+ </div>
36
+ <div style="padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0;">
37
+ <div style="font-size: 13px; color: #64748b; margin-bottom: 4px;">Active Now</div>
38
+ <div style="font-size: 28px; font-weight: 700; color: #0f172a;">89</div>
39
+ </div>
40
+ </div>
41
+ <div style="padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0;">
42
+ <h2 style="font-size: 16px; font-weight: 600; margin: 0 0 12px; color: #0f172a;">Recent Activity</h2>
43
+ <div style="display: flex; flex-direction: column; gap: 12px;">
44
+ <div style="display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9;">
45
+ <span style="color: #334155; font-size: 14px;">New user registered</span>
46
+ <span style="color: #94a3b8; font-size: 13px;">2 min ago</span>
47
+ </div>
48
+ <div style="display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9;">
49
+ <span style="color: #334155; font-size: 14px;">Payment received</span>
50
+ <span style="color: #94a3b8; font-size: 13px;">15 min ago</span>
51
+ </div>
52
+ <div style="display: flex; justify-content: space-between;">
53
+ <span style="color: #334155; font-size: 14px;">Report generated</span>
54
+ <span style="color: #94a3b8; font-size: 13px;">1 hour ago</span>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </main>
59
+ </div>
60
+ </div>
@@ -0,0 +1,54 @@
1
+ <script lang="ts">
2
+ import Frame from './Frame.svelte';
3
+
4
+ export const meta = {
5
+ component: Frame,
6
+ title: 'Frame',
7
+ description: 'A flexible holy-grail layout with top, bottom, left, right, and center regions.',
8
+ };
9
+ </script>
10
+
11
+ {#snippet Default()}
12
+ <div style="height: 300px; border: 1px solid #ccc;">
13
+ <Frame>
14
+ {#snippet top()}
15
+ <div style="padding: 8px; background: var(--color-base-100); border-bottom: 1px solid var(--color-base-200);">Top</div>
16
+ {/snippet}
17
+ {#snippet left()}
18
+ <div style="padding: 8px; width: 120px; background: var(--color-base-50); border-right: 1px solid var(--color-base-200);">Left</div>
19
+ {/snippet}
20
+ <div style="padding: 8px;">Center content</div>
21
+ {#snippet right()}
22
+ <div style="padding: 8px; width: 120px; background: var(--color-base-50); border-left: 1px solid var(--color-base-200);">Right</div>
23
+ {/snippet}
24
+ {#snippet bottom()}
25
+ <div style="padding: 8px; background: var(--color-base-100); border-top: 1px solid var(--color-base-200);">Bottom</div>
26
+ {/snippet}
27
+ </Frame>
28
+ </div>
29
+ {/snippet}
30
+
31
+ {#snippet TopAndBottom()}
32
+ <div style="height: 200px; border: 1px solid #ccc;">
33
+ <Frame>
34
+ {#snippet top()}
35
+ <div style="padding: 8px; background: var(--color-base-100); border-bottom: 1px solid var(--color-base-200);">Header</div>
36
+ {/snippet}
37
+ <div style="padding: 8px;">Main content area</div>
38
+ {#snippet bottom()}
39
+ <div style="padding: 8px; background: var(--color-base-100); border-top: 1px solid var(--color-base-200);">Footer</div>
40
+ {/snippet}
41
+ </Frame>
42
+ </div>
43
+ {/snippet}
44
+
45
+ {#snippet Sidebar()}
46
+ <div style="height: 200px; border: 1px solid #ccc;">
47
+ <Frame>
48
+ {#snippet left()}
49
+ <div style="padding: 8px; width: 150px; background: var(--color-base-50); border-right: 1px solid var(--color-base-200);">Sidebar</div>
50
+ {/snippet}
51
+ <div style="padding: 8px;">Content</div>
52
+ </Frame>
53
+ </div>
54
+ {/snippet}
@@ -0,0 +1,88 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ /**
5
+ * A flexible layout component with slots for top, bottom, left, right, and center content.
6
+ */
7
+ interface Props {
8
+ top?: Snippet;
9
+ bottom?: Snippet;
10
+ left?: Snippet;
11
+ right?: Snippet;
12
+ children?: Snippet;
13
+ class?: string;
14
+ }
15
+
16
+ let { top, bottom, left, right, children, class: className = '' }: Props = $props();
17
+ </script>
18
+
19
+ <div class="Frame {className}">
20
+ {#if top}
21
+ <div class="Frame-top">
22
+ {@render top()}
23
+ </div>
24
+ {/if}
25
+
26
+ <div class="Frame-body">
27
+ {#if left}
28
+ <div class="Frame-left">
29
+ {@render left()}
30
+ </div>
31
+ {/if}
32
+
33
+ <div class="Frame-middle">
34
+ {#if children}
35
+ {@render children()}
36
+ {/if}
37
+ </div>
38
+
39
+ {#if right}
40
+ <div class="Frame-right">
41
+ {@render right()}
42
+ </div>
43
+ {/if}
44
+ </div>
45
+
46
+ {#if bottom}
47
+ <div class="Frame-bottom">
48
+ {@render bottom()}
49
+ </div>
50
+ {/if}
51
+ </div>
52
+
53
+ <style>
54
+ .Frame {
55
+ display: flex;
56
+ flex-direction: column;
57
+ height: 100%;
58
+ width: 100%;
59
+ }
60
+
61
+ .Frame-top {
62
+ flex-shrink: 0;
63
+ }
64
+
65
+ .Frame-body {
66
+ display: flex;
67
+ flex: 1;
68
+ min-height: 0;
69
+ }
70
+
71
+ .Frame-left {
72
+ flex-shrink: 0;
73
+ }
74
+
75
+ .Frame-middle {
76
+ flex: 1;
77
+ min-width: 0;
78
+ overflow: auto;
79
+ }
80
+
81
+ .Frame-right {
82
+ flex-shrink: 0;
83
+ }
84
+
85
+ .Frame-bottom {
86
+ flex-shrink: 0;
87
+ }
88
+ </style>
@@ -0,0 +1,15 @@
1
+ import type { Snippet } from 'svelte';
2
+ /**
3
+ * A flexible layout component with slots for top, bottom, left, right, and center content.
4
+ */
5
+ interface Props {
6
+ top?: Snippet;
7
+ bottom?: Snippet;
8
+ left?: Snippet;
9
+ right?: Snippet;
10
+ children?: Snippet;
11
+ class?: string;
12
+ }
13
+ declare const Frame: import("svelte").Component<Props, {}, "">;
14
+ type Frame = ReturnType<typeof Frame>;
15
+ export default Frame;
@@ -0,0 +1 @@
1
+ export { default as Frame } from './Frame.svelte';
@@ -0,0 +1 @@
1
+ export { default as Frame } from './Frame.svelte';
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ import Icon from './Icon.svelte';
3
+
4
+ export const meta = {
5
+ component: Icon,
6
+ title: 'Icon',
7
+ description: 'Displays an SVG icon by name. Supports sizing and color via CSS custom properties.',
8
+ args: {
9
+ name: 'chevron-right',
10
+ },
11
+ };
12
+ </script>
13
+
14
+ {#snippet Default(args)}
15
+ <Icon name="chevron-right" --w="24px" --h="24px" --fill="currentColor" />
16
+ {/snippet}
17
+
18
+ {#snippet AllIcons()}
19
+ <div style="display: flex; gap: 12px; align-items: center;">
20
+ <Icon name="chevron-up" />
21
+ <Icon name="chevron-down" />
22
+ <Icon name="chevron-left" />
23
+ <Icon name="chevron-right" />
24
+ <Icon name="folder" />
25
+ <Icon name="folder-open" />
26
+ </div>
27
+ {/snippet}
28
+
29
+ {#snippet CustomSize()}
30
+ <div style="display: flex; gap: 12px; align-items: center;">
31
+ <Icon name="chevron-right" --w="16px" --h="16px" />
32
+ <Icon name="chevron-right" />
33
+ <Icon name="chevron-right" --w="32px" --h="32px" />
34
+ <Icon name="chevron-right" --w="48px" --h="48px" />
35
+ </div>
36
+ {/snippet}
37
+
38
+ {#snippet CustomColor()}
39
+ <div style="display: flex; gap: 12px; align-items: center;">
40
+ <Icon name="chevron-right" --fill="tomato" />
41
+ <Icon name="chevron-right" --fill="dodgerblue" />
42
+ <Icon name="chevron-right" --fill="mediumseagreen" />
43
+ <Icon name="chevron-right" --fill="slateviolet" />
44
+ </div>
45
+ {/snippet}
@@ -0,0 +1,47 @@
1
+ <script lang="ts">
2
+ const modules = import.meta.glob('./icons/*.svg', { eager: true, query: '?raw', import: 'default' });
3
+
4
+ const icons: Record<string, string> = {};
5
+ for (const [path, raw] of Object.entries(modules)) {
6
+ const key = path.replace('./icons/', '').replace('.svg', '');
7
+ icons[key] = raw as string;
8
+ }
9
+
10
+ /**
11
+ * @cssvar {length} --w - Icon width (default: 24px)
12
+ * @cssvar {length} --h - Icon height (default: 24px)
13
+ * @cssvar {color} --fill - Icon color, inherited via currentColor (default: currentColor)
14
+ */
15
+ interface Props {
16
+ /** Icon name matching a filename in the icons folder (e.g. "chevron-right") */
17
+ name: string;
18
+ /** Additional CSS class names */
19
+ class?: string;
20
+ }
21
+
22
+ let { name, class: className = '' }: Props = $props();
23
+
24
+ const svg = $derived(icons[name] ?? '');
25
+
26
+ export { icons };
27
+ </script>
28
+
29
+ <span class="Icon {className}" aria-hidden="true">
30
+ {@html svg}
31
+ </span>
32
+
33
+ <style>
34
+ .Icon {
35
+ display: inline-flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ width: var(--w, 24px);
39
+ height: var(--h, 24px);
40
+ color: var(--fill, currentColor);
41
+ line-height: 0;
42
+ }
43
+ .Icon :global(svg) {
44
+ width: 100%;
45
+ height: 100%;
46
+ }
47
+ </style>
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @cssvar {length} --w - Icon width (default: 24px)
3
+ * @cssvar {length} --h - Icon height (default: 24px)
4
+ * @cssvar {color} --fill - Icon color, inherited via currentColor (default: currentColor)
5
+ */
6
+ interface Props {
7
+ /** Icon name matching a filename in the icons folder (e.g. "chevron-right") */
8
+ name: string;
9
+ /** Additional CSS class names */
10
+ class?: string;
11
+ }
12
+ declare const Icon: import("svelte").Component<Props, {
13
+ icons: Record<string, string>;
14
+ }, "">;
15
+ type Icon = ReturnType<typeof Icon>;
16
+ export default Icon;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bookmark-icon lucide-bookmark"><path d="M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-down-icon lucide-chevron-down"><path d="m6 9 6 6 6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left-icon lucide-chevron-left"><path d="m15 18-6-6 6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right-icon lucide-chevron-right"><path d="m9 18 6-6-6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-up-icon lucide-chevron-up"><path d="m18 15-6-6-6 6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code-icon lucide-code"><path d="m16 18 6-6-6-6"/><path d="m8 6-6 6 6 6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-component-icon lucide-component"><path d="M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"/><path d="M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"/><path d="M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"/><path d="M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-code-icon lucide-file-code"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12.5 8 15l2 2.5"/><path d="m14 12.5 2 2.5-2 2.5"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text-icon lucide-file-text"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open-icon lucide-folder-open"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-icon lucide-folder"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panels-top-left-icon lucide-panels-top-left"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M9 21V9"/></svg>
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256" fill="none">
2
+ <path d="M139.348 11.834C141.108 8.51523 145.336 6.82298 148.672 8.92871C151.935 10.989 153.402 15.46 154.298 19.0186C162.725 20.1811 173.886 24.7367 180.927 29.4521C202.943 44.1988 210.228 62.9807 214.865 87.8965C215.376 90.58 215.804 93.2786 216.149 95.9883C216.375 97.8709 216.626 100.924 217.004 102.691L217.036 102.841C219.077 101.659 221.183 100.318 223.188 99.0713C224.228 98.4042 225.53 97.5083 226.866 96.6943C227.033 96.5926 227.201 96.4921 227.368 96.3936C227.871 96.0977 228.375 95.819 228.867 95.5732C229.195 95.4094 229.518 95.2603 229.833 95.1309C230.147 95.0015 230.453 94.892 230.747 94.8066C241.327 91.7321 244.518 103.122 242.272 111.141C240.127 118.805 235.599 124.62 229.296 129.366C225.825 131.999 222.856 133.513 219.065 135.571C218.871 135.837 218.993 139.925 218.977 140.657C218.464 163.671 218.824 191.914 201.77 209.613C200.936 210.683 195.617 214.383 195.317 215.535C192.288 227.117 191.042 244.166 176.708 247.171C172.963 247.958 169.355 247.163 166.09 245.679C156.445 241.291 152.994 229.443 149.867 220.465C137.288 221.244 124.698 221.851 112.102 222.287C110.745 228.85 109.426 235.606 105.304 241.09C99.5842 248.701 88.3997 250.328 80.8623 244.452C73.4124 238.645 71.5373 228.316 70.3037 219.477C65.9113 218.29 62.1382 216.494 58.9238 213.211C43.5669 197.519 40.999 164.788 40.8135 144.327C39.9306 144.051 39.0569 143.744 38.1953 143.406C27.9394 139.405 18.7393 133.527 13.96 122.973C11.3008 117.1 10.3576 106.784 17.6592 103.544C23.0754 101.14 29.3215 106.059 33.7646 108.465C36.3585 109.869 39.1953 111.182 42.0088 112.383C43.2298 101.752 44.7651 91.968 48.1934 81.7754C56.5917 56.8064 73.8944 38.5704 97.3086 26.9619C96.2228 23.5129 96.1135 19.6319 98.9941 17.0547C104.245 12.3571 109.491 17.5442 112.801 21.3008C114.659 20.7139 116.489 20.3226 118.388 19.915C118.042 18.3592 117.913 16.838 118.243 15.2656C118.666 13.1675 119.937 11.3368 121.755 10.207C127.878 6.41192 131.688 13.6669 134.112 17.9375L138.306 17.71C138.222 15.5289 138.288 13.8316 139.348 11.834Z" fill="currentColor"/>
3
+ <path d="M82.4852 107.418C83.3083 97.6046 93.9165 92.8997 102.284 91.0454C118.248 87.6106 134.24 84.3002 150.255 81.1143C162.579 78.675 175.556 76.0282 188.083 75.0108C191.162 74.7608 196.819 74.6645 199.475 76.3154C202.173 77.994 203.042 84.01 203.714 87.1002C205.384 93.2652 207.419 114.355 204.508 119.567C204.15 123.161 198.556 129.808 195.728 131.952C178.089 145.332 152.911 148.205 131.463 146.459C122.309 145.714 104.583 141.077 97.8459 135.061C96.235 134.448 91.4236 129.522 90.216 128.045C85.2736 122.005 81.8798 115.32 82.4852 107.418Z" fill="#17161D"/>
4
+ <path d="M82.4852 107.418C83.3083 97.6046 93.9165 92.8997 102.284 91.0454C118.248 87.6106 134.24 84.3002 150.255 81.1143C162.579 78.675 175.556 76.0282 188.083 75.0108C191.162 74.7608 196.819 74.6645 199.475 76.3154C202.173 77.994 203.042 84.01 203.714 87.1002C202.204 85.951 198.501 82.7427 196.646 82.7636C195.569 82.7758 194.624 83.7593 193.933 84.6178C191.317 87.871 188.593 94.6718 184.241 95.5268C182.083 95.9509 180.206 94.1334 178.623 93.1252C175.698 91.3387 172.558 86.9348 168.961 87.0081C167.852 87.0306 166.615 88.4624 166.024 89.2859C163.028 93.4591 161.48 100.705 156.107 102.287C150.144 100.862 145.921 94.1034 141.022 92.3896C134.129 89.9785 133.489 109.07 126.074 108.089C121.775 107.52 114.443 96.1953 110.65 99.1445C106.567 102.32 106.979 111.41 101.165 113.611C95.43 112.536 93.2278 106.119 88.1483 105.576C87.2857 105.484 83.5111 107.029 82.4852 107.418Z" fill="white"/>
5
+ <path d="M145.799 119.057C151.721 120.173 155.956 128.452 160.92 129.949C165.423 131.309 169.802 118.065 173.534 116.155C179.323 113.19 184.845 124.456 189.66 125.861C192.116 126.577 195.968 122.61 198.203 121.336C200.781 119.866 201.361 118.921 204.508 119.567C204.15 123.161 198.556 129.808 195.728 131.952C178.089 145.332 152.911 148.205 131.463 146.459C122.309 145.714 104.583 141.077 97.8459 135.061C100.409 135.217 104.315 136.387 106.52 135.944C110.653 135.113 112.827 124.933 116.962 124.006C121.643 123.366 126.428 130.765 130.032 132.482C138.184 136.367 138.635 121.052 145.799 119.057Z" fill="white"/>
6
+ <path d="M93.9773 63.3803C98.4931 63.0609 104.615 66.1597 106.588 70.4796C107.928 73.4137 103.593 76.8015 100.865 73.5645C98.4097 70.6501 95.8394 69.225 92.0173 70.579L91.7637 70.671C89.2789 72.19 88.8776 73.6772 87.4981 76.0958C85.9139 78.8732 81.4801 79.0253 81.296 75.1604C81.1793 72.7109 82.6357 70.2483 84.1454 68.4172C86.8193 65.174 89.87 63.744 93.9773 63.3803Z" fill="#17161D"/>
7
+ <path d="M166.9 52.3263C169.765 51.7292 172.576 53.5538 173.198 56.4142C173.819 59.2746 172.017 62.1008 169.162 62.746C166.273 63.3987 163.406 61.5715 162.777 58.677C162.149 55.7826 164 52.9306 166.9 52.3263Z" fill="#17161D"/>
8
+ </svg>
@@ -0,0 +1 @@
1
+ export { default as Icon } from './Icon.svelte';
@@ -0,0 +1 @@
1
+ export { default as Icon } from './Icon.svelte';
@@ -0,0 +1,46 @@
1
+ <script lang="ts">
2
+ import Group from './Group.svelte';
3
+ import Item from './Item.svelte';
4
+ import NavTree from './NavTree.svelte';
5
+
6
+ export const meta = {
7
+ component: Group,
8
+ title: 'NavTree / NavTree.Group',
9
+ description: 'A collapsible section header with uppercase label. Used to organize items into named categories.',
10
+ };
11
+ </script>
12
+
13
+ {#snippet Default()}
14
+ <NavTree>
15
+ <Group label="Components">
16
+ <Item label="Button" href="#/button" />
17
+ <Item label="Icon" href="#/icon" />
18
+ <Item label="Card" href="#/card" />
19
+ </Group>
20
+ </NavTree>
21
+ {/snippet}
22
+
23
+ {#snippet Collapsed()}
24
+ <NavTree>
25
+ <Group label="Advanced" expanded={false}>
26
+ <Item label="Tree" href="#/tree" />
27
+ <Item label="Table" href="#/table" />
28
+ </Group>
29
+ </NavTree>
30
+ {/snippet}
31
+
32
+ {#snippet MultipleGroups()}
33
+ <NavTree>
34
+ <Group label="Components">
35
+ <Item label="Button" href="#/button" />
36
+ <Item label="Input" href="#/input" />
37
+ </Group>
38
+ <Group label="Pages">
39
+ <Item label="About" href="#/about" />
40
+ <Item label="Changelog" href="#/changelog" />
41
+ </Group>
42
+ <Group label="Layouts">
43
+ <Item label="Dashboard" href="#/dashboard" />
44
+ </Group>
45
+ </NavTree>
46
+ {/snippet}
@@ -0,0 +1,82 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { Icon } from '../Icon/index.js';
4
+
5
+ interface Props {
6
+ label: string;
7
+ expanded?: boolean;
8
+ children?: Snippet;
9
+ class?: string;
10
+ onclick?: () => void;
11
+ }
12
+
13
+ let { label, expanded = $bindable(true), children, class: className = '', onclick }: Props = $props();
14
+
15
+ function toggle() {
16
+ expanded = !expanded;
17
+ }
18
+ </script>
19
+
20
+ <div class="NavTree-group {className}">
21
+ <button class="NavTree-group-label" onclick={onclick ?? toggle}>
22
+ <span class="NavTree-group-text">{label}</span>
23
+ <span class="NavTree-chevron">
24
+ <Icon name={expanded ? 'chevron-down' : 'chevron-right'} --w="14px" --h="14px" />
25
+ </span>
26
+ </button>
27
+ {#if expanded && children}
28
+ <div class="NavTree-group-children">
29
+ {@render children()}
30
+ </div>
31
+ {/if}
32
+ </div>
33
+
34
+ <style>
35
+ .NavTree-group {
36
+ display: flex;
37
+ flex-direction: column;
38
+ gap: 4px;
39
+ padding: var(--p, 0);
40
+ margin: var(--m, 12px 0);
41
+ border-radius: var(--r, 0);
42
+ border: var(--b, none);
43
+ }
44
+
45
+ .NavTree-group-label {
46
+ display: flex;
47
+ align-items: center;
48
+ width: 100%;
49
+ padding: 0 12px;
50
+ border: none;
51
+ background: none;
52
+ font: inherit;
53
+ font-size: 11px;
54
+ font-weight: var(--font-weight, 600);
55
+ color: var(--color-base-400);
56
+ letter-spacing: 0.05em;
57
+ text-transform: uppercase;
58
+ cursor: pointer;
59
+ text-align: left;
60
+ }
61
+
62
+ .NavTree-group-label:hover {
63
+ color: var(--color-base-600);
64
+ }
65
+
66
+ .NavTree-group-text {
67
+ flex: 1;
68
+ }
69
+
70
+ .NavTree-chevron {
71
+ display: inline-flex;
72
+ align-items: center;
73
+ margin-left: auto;
74
+ }
75
+
76
+ .NavTree-group-children {
77
+ padding-left: 0;
78
+ display: flex;
79
+ flex-direction: column;
80
+ gap: 1px;
81
+ }
82
+ </style>
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ label: string;
4
+ expanded?: boolean;
5
+ children?: Snippet;
6
+ class?: string;
7
+ onclick?: () => void;
8
+ }
9
+ declare const Group: import("svelte").Component<Props, {}, "expanded">;
10
+ type Group = ReturnType<typeof Group>;
11
+ export default Group;
@@ -0,0 +1,70 @@
1
+ <script lang="ts">
2
+ import Item from './Item.svelte';
3
+ import NavTree from './NavTree.svelte';
4
+ import { Icon } from '../Icon/index.js';
5
+
6
+ export const meta = {
7
+ component: Item,
8
+ title: 'NavTree / NavTree.Item',
9
+ description: 'A tree node that acts as a leaf (link/button) or expandable folder when children are provided. Supports left and right snippet slots for custom content.',
10
+ args:{
11
+ label:"Label"
12
+ }
13
+ };
14
+ </script>
15
+
16
+ {#snippet Default({...args})}
17
+ <NavTree>
18
+ <Item {...args} >
19
+ <Item {...args} >
20
+
21
+ </Item>
22
+ <Item {...args} >
23
+
24
+ </Item>
25
+
26
+ </Item>
27
+ </NavTree>
28
+ {/snippet}
29
+
30
+ {#snippet LeftSlot()}
31
+ <NavTree>
32
+ <Item label="Home" href="#/home">
33
+ {#snippet left()}<Icon name="folder" --w="14px" --h="14px" />{/snippet}
34
+ </Item>
35
+ <Item label="Documents" href="#/docs">
36
+ {#snippet left()}<Icon name="folder-open" --w="14px" --h="14px" />{/snippet}
37
+ </Item>
38
+ </NavTree>
39
+ {/snippet}
40
+
41
+ {#snippet RightSlot()}
42
+ <NavTree>
43
+ <Item label="bundle.js" href="#/bundle">
44
+ {#snippet right()}<span style="font-size: 11px; color: tomato;">54kb</span>{/snippet}
45
+ </Item>
46
+ <Item label="style.css" href="#/style">
47
+ {#snippet right()}<span style="font-size: 11px; color: #9ca3af;">3.2kb</span>{/snippet}
48
+ </Item>
49
+ </NavTree>
50
+ {/snippet}
51
+
52
+ {#snippet Expandable()}
53
+ <NavTree>
54
+ <Item label="Controls" expanded>
55
+ <Item label="Text" href="#/text" />
56
+ <Item label="Number" href="#/number" />
57
+ </Item>
58
+ <Item label="Layout">
59
+ <Item label="Frame" href="#/frame" />
60
+ </Item>
61
+ </NavTree>
62
+ {/snippet}
63
+
64
+ {#snippet ActiveState()}
65
+ <NavTree>
66
+ <Item label="Regular item" href="#/one" />
67
+ <Item label="Active item" href="#/two" active />
68
+ <Item label="Another item" href="#/three" />
69
+ </NavTree>
70
+ {/snippet}