@axle-lang/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/dist/app.css +337 -0
  4. package/dist/components/Seo.svelte +38 -0
  5. package/dist/components/Seo.svelte.d.ts +8 -0
  6. package/dist/components/atoms/Badge.svelte +11 -0
  7. package/dist/components/atoms/Badge.svelte.d.ts +8 -0
  8. package/dist/components/atoms/Button.svelte +32 -0
  9. package/dist/components/atoms/Button.svelte.d.ts +12 -0
  10. package/dist/components/atoms/Callout.svelte +11 -0
  11. package/dist/components/atoms/Callout.svelte.d.ts +8 -0
  12. package/dist/components/atoms/CodeChip.svelte +11 -0
  13. package/dist/components/atoms/CodeChip.svelte.d.ts +8 -0
  14. package/dist/components/atoms/Eyebrow.svelte +9 -0
  15. package/dist/components/atoms/Eyebrow.svelte.d.ts +8 -0
  16. package/dist/components/atoms/HandNote.svelte +15 -0
  17. package/dist/components/atoms/HandNote.svelte.d.ts +9 -0
  18. package/dist/components/atoms/Icon.svelte +40 -0
  19. package/dist/components/atoms/Icon.svelte.d.ts +11 -0
  20. package/dist/components/atoms/Kbd.svelte +11 -0
  21. package/dist/components/atoms/Kbd.svelte.d.ts +8 -0
  22. package/dist/components/atoms/Logo.svelte +18 -0
  23. package/dist/components/atoms/Logo.svelte.d.ts +6 -0
  24. package/dist/components/atoms/SearchButton.svelte +23 -0
  25. package/dist/components/atoms/SearchButton.svelte.d.ts +8 -0
  26. package/dist/components/atoms/Tag.svelte +21 -0
  27. package/dist/components/atoms/Tag.svelte.d.ts +10 -0
  28. package/dist/components/atoms/ThemeToggle.svelte +30 -0
  29. package/dist/components/atoms/ThemeToggle.svelte.d.ts +6 -0
  30. package/dist/components/code/Code.svelte +22 -0
  31. package/dist/components/code/Code.svelte.d.ts +9 -0
  32. package/dist/components/code/CodeWindow.svelte +42 -0
  33. package/dist/components/code/CodeWindow.svelte.d.ts +13 -0
  34. package/dist/components/code/CopyCommand.svelte +28 -0
  35. package/dist/components/code/CopyCommand.svelte.d.ts +7 -0
  36. package/dist/components/landing/BenchExplorer.svelte +157 -0
  37. package/dist/components/landing/BenchExplorer.svelte.d.ts +7 -0
  38. package/dist/components/landing/CTASection.svelte +12 -0
  39. package/dist/components/landing/CTASection.svelte.d.ts +11 -0
  40. package/dist/components/landing/ComparisonPanel.svelte +75 -0
  41. package/dist/components/landing/ComparisonPanel.svelte.d.ts +19 -0
  42. package/dist/components/landing/FeatureCard.svelte +19 -0
  43. package/dist/components/landing/FeatureCard.svelte.d.ts +10 -0
  44. package/dist/components/landing/FeatureGrid.svelte +26 -0
  45. package/dist/components/landing/FeatureGrid.svelte.d.ts +13 -0
  46. package/dist/components/landing/Hero.svelte +23 -0
  47. package/dist/components/landing/Hero.svelte.d.ts +14 -0
  48. package/dist/components/landing/RecipeDeck.svelte +137 -0
  49. package/dist/components/landing/RecipeDeck.svelte.d.ts +19 -0
  50. package/dist/components/layout/DocLayout.svelte +36 -0
  51. package/dist/components/layout/DocLayout.svelte.d.ts +21 -0
  52. package/dist/components/layout/PageShell.svelte +15 -0
  53. package/dist/components/layout/PageShell.svelte.d.ts +7 -0
  54. package/dist/components/molecules/Card.svelte +18 -0
  55. package/dist/components/molecules/Card.svelte.d.ts +9 -0
  56. package/dist/components/molecules/DataTable.svelte +43 -0
  57. package/dist/components/molecules/DataTable.svelte.d.ts +12 -0
  58. package/dist/components/molecules/PageHeading.svelte +23 -0
  59. package/dist/components/molecules/PageHeading.svelte.d.ts +10 -0
  60. package/dist/components/molecules/Section.svelte +20 -0
  61. package/dist/components/molecules/Section.svelte.d.ts +10 -0
  62. package/dist/components/molecules/SectionHeading.svelte +27 -0
  63. package/dist/components/molecules/SectionHeading.svelte.d.ts +10 -0
  64. package/dist/components/nav/DocHeader.svelte +44 -0
  65. package/dist/components/nav/DocHeader.svelte.d.ts +7 -0
  66. package/dist/components/nav/Footer.svelte +67 -0
  67. package/dist/components/nav/Footer.svelte.d.ts +3 -0
  68. package/dist/components/nav/Header.svelte +55 -0
  69. package/dist/components/nav/Header.svelte.d.ts +6 -0
  70. package/dist/components/nav/PrevNext.svelte +27 -0
  71. package/dist/components/nav/PrevNext.svelte.d.ts +13 -0
  72. package/dist/components/nav/RightRail.svelte +30 -0
  73. package/dist/components/nav/RightRail.svelte.d.ts +11 -0
  74. package/dist/components/nav/Sidebar.svelte +33 -0
  75. package/dist/components/nav/Sidebar.svelte.d.ts +18 -0
  76. package/dist/components/reference/MethodDetail.svelte +72 -0
  77. package/dist/components/reference/MethodDetail.svelte.d.ts +7 -0
  78. package/dist/components/reference/MethodSummary.svelte +41 -0
  79. package/dist/components/reference/MethodSummary.svelte.d.ts +8 -0
  80. package/dist/i18n/index.d.ts +47 -0
  81. package/dist/i18n/index.js +23 -0
  82. package/dist/i18n/messages/en.d.ts +43 -0
  83. package/dist/i18n/messages/en.js +50 -0
  84. package/dist/index.d.ts +47 -0
  85. package/dist/index.js +54 -0
  86. package/dist/site/site.d.ts +45 -0
  87. package/dist/site/site.js +66 -0
  88. package/dist/utils/cn.d.ts +6 -0
  89. package/dist/utils/cn.js +9 -0
  90. package/dist/utils/icons.d.ts +26 -0
  91. package/dist/utils/icons.js +55 -0
  92. package/dist/utils/tokenizer.d.ts +12 -0
  93. package/dist/utils/tokenizer.js +181 -0
  94. package/dist/utils/types.d.ts +50 -0
  95. package/dist/utils/types.js +4 -0
  96. package/dist/utils/variants.d.ts +20 -0
  97. package/dist/utils/variants.js +50 -0
  98. package/package.json +77 -0
@@ -0,0 +1,9 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+ /**
4
+ * Merge class names: clsx for conditionals, tailwind-merge to resolve
5
+ * conflicting Tailwind utilities (the later one wins).
6
+ */
7
+ export function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Icon path data (24x24 viewBox, stroke-based).
3
+ * Use with <Icon name="search" /> — see Icon.svelte.
4
+ * Each entry is an array of `d` attributes for <path>.
5
+ */
6
+ export declare const icons: {
7
+ search: string[];
8
+ theme: string[];
9
+ git: string[];
10
+ arrow: string[];
11
+ copy: string[];
12
+ check: string[];
13
+ info: string[];
14
+ edit: string[];
15
+ package: string[];
16
+ prev: string[];
17
+ next: string[];
18
+ noGc: string[];
19
+ shield: string[];
20
+ alert: string[];
21
+ cpu: string[];
22
+ timer: string[];
23
+ stack: string[];
24
+ };
25
+ /** A valid icon name (key of the `icons` map). */
26
+ export type IconName = keyof typeof icons;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Icon path data (24x24 viewBox, stroke-based).
3
+ * Use with <Icon name="search" /> — see Icon.svelte.
4
+ * Each entry is an array of `d` attributes for <path>.
5
+ */
6
+ export const icons = {
7
+ search: ['M11 11m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0', 'M21 21l-4.3 -4.3'],
8
+ theme: ['M12 3a6 6 0 0 0 9 9a9 9 0 1 1 -9 -9'],
9
+ git: [
10
+ 'M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12 12 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5'
11
+ ],
12
+ arrow: ['M5 12h14', 'M13 6l6 6l-6 6'],
13
+ copy: [
14
+ 'M9 9m0 2a2 2 0 0 1 2 -2h7a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2h-7a2 2 0 0 1 -2 -2z',
15
+ 'M5 15H4a2 2 0 0 1 -2 -2V4a2 2 0 0 1 2 -2h9a2 2 0 0 1 2 2v1'
16
+ ],
17
+ check: ['M5 12l5 5l10 -11'],
18
+ info: ['M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0', 'M12 9h.01', 'M11 12h1v4h1'],
19
+ edit: ['M4 20h4l10.5 -10.5a2.1 2.1 0 0 0 -3 -3l-10.5 10.5v3z', 'M13.5 6.5l3 3'],
20
+ package: ['M12 3l8 4.5v9l-8 4.5l-8 -4.5v-9z', 'M12 12l8 -4.5', 'M12 12v9', 'M12 12l-8 -4.5'],
21
+ prev: ['M15 6l-6 6l6 6'],
22
+ next: ['M9 6l6 6l-6 6'],
23
+ // feature icons
24
+ noGc: [
25
+ 'M4 7h16',
26
+ 'M10 11v6',
27
+ 'M14 11v6',
28
+ 'M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12',
29
+ 'M9 7V4a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3'
30
+ ],
31
+ shield: ['M12 3l8 4v5c0 4.4 -3 7.4 -8 9c-5 -1.6 -8 -4.6 -8 -9v-5z', 'M9 12l2 2l4 -4'],
32
+ alert: [
33
+ 'M12 9v4',
34
+ 'M12 17h.01',
35
+ 'M10.3 4.3l-8 14a2 2 0 0 0 1.7 3h16a2 2 0 0 0 1.7 -3l-8 -14a2 2 0 0 0 -3.4 0z'
36
+ ],
37
+ cpu: [
38
+ 'M9 3v2',
39
+ 'M15 3v2',
40
+ 'M9 19v2',
41
+ 'M15 19v2',
42
+ 'M3 9h2',
43
+ 'M3 15h2',
44
+ 'M19 9h2',
45
+ 'M19 15h2',
46
+ 'M6 6h12v12h-12z',
47
+ 'M10 10h4v4h-4z'
48
+ ],
49
+ timer: ['M12 8v4l3 2', 'M3.05 11a9 9 0 1 1 .5 4', 'M3 4v5h5'],
50
+ stack: [
51
+ 'M4 6a8 3 0 1 0 16 0a8 3 0 1 0 -16 0',
52
+ 'M4 6v6a8 3 0 0 0 16 0v-6',
53
+ 'M4 12v6a8 3 0 0 0 16 0v-6'
54
+ ]
55
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Lightweight multi-language syntax tokenizer.
3
+ * Emits HTML with .t-kw / .t-ty / .t-fn / .t-str / .t-num / .t-com / .t-p
4
+ * spans, coloured by the design-system tokens in app.css.
5
+ *
6
+ * `highlight(src, lang)` covers Axle plus the C / C++ / Rust / Go / Java
7
+ * comparison snippets (general mode: line + block comments and
8
+ * double/back/single-quoted strings) and a shell mode (sh / bash) with
9
+ * hash comments and $vars.
10
+ */
11
+ /** Returns an HTML string. Use with {@html ...} inside a <code> element. */
12
+ export declare function highlight(src: string, lang?: string): string;
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Lightweight multi-language syntax tokenizer.
3
+ * Emits HTML with .t-kw / .t-ty / .t-fn / .t-str / .t-num / .t-com / .t-p
4
+ * spans, coloured by the design-system tokens in app.css.
5
+ *
6
+ * `highlight(src, lang)` covers Axle plus the C / C++ / Rust / Go / Java
7
+ * comparison snippets (general mode: line + block comments and
8
+ * double/back/single-quoted strings) and a shell mode (sh / bash) with
9
+ * hash comments and $vars.
10
+ */
11
+ const KEYWORDS = new Set([
12
+ 'class',
13
+ 'fn',
14
+ 'let',
15
+ 'return',
16
+ 'new',
17
+ 'this',
18
+ 'constructor',
19
+ 'for',
20
+ 'of',
21
+ 'in',
22
+ 'if',
23
+ 'else',
24
+ 'while',
25
+ 'do',
26
+ 'defer',
27
+ 'throw',
28
+ 'throws',
29
+ 'try',
30
+ 'catch',
31
+ 'use',
32
+ 'spawn',
33
+ 'await',
34
+ 'true',
35
+ 'false',
36
+ 'extern',
37
+ 'import',
38
+ 'pub',
39
+ 'mut',
40
+ 'match',
41
+ 'as',
42
+ 'null',
43
+ 'break',
44
+ 'continue',
45
+ 'native',
46
+ 'static',
47
+ 'unsafe',
48
+ 'shared',
49
+ 'synchronized',
50
+ 'const',
51
+ 'struct',
52
+ 'enum',
53
+ 'func',
54
+ 'package',
55
+ 'var',
56
+ 'nil',
57
+ 'public',
58
+ 'private',
59
+ 'protected',
60
+ 'final',
61
+ 'finally',
62
+ 'interface',
63
+ 'implements',
64
+ 'readonly',
65
+ 'async',
66
+ 'int',
67
+ 'long',
68
+ 'short',
69
+ 'double',
70
+ 'float',
71
+ 'unsigned',
72
+ 'signed',
73
+ // Rust
74
+ 'impl',
75
+ 'trait',
76
+ 'where',
77
+ 'dyn',
78
+ 'move',
79
+ 'ref',
80
+ 'mod',
81
+ 'crate',
82
+ 'Self',
83
+ // shell control words
84
+ 'then',
85
+ 'fi',
86
+ 'elif',
87
+ 'done',
88
+ 'esac',
89
+ 'case',
90
+ 'function',
91
+ 'export',
92
+ 'local'
93
+ ]);
94
+ const PRIMITIVES = new Set([
95
+ 'i8',
96
+ 'i16',
97
+ 'i32',
98
+ 'i64',
99
+ 'u8',
100
+ 'u16',
101
+ 'u32',
102
+ 'u64',
103
+ 'f32',
104
+ 'f64',
105
+ 'bool',
106
+ 'string',
107
+ 'void',
108
+ 'char',
109
+ 'isize',
110
+ 'usize',
111
+ 'boolean',
112
+ 'str'
113
+ ]);
114
+ const GENERAL_RE = /(\/\*[\s\S]*?\*\/|\/\/[^\n]*)|("(?:\\.|[^"\\])*"|`(?:\\.|[^`\\])*`|'(?:\\.|[^'\\])*')|(\b\d[\d_]*(?:\.\d+)?)|([A-Za-z_]\w*)|(\s+)|([\s\S])/g;
115
+ const SHELL_RE = /(#[^\n]*)|("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')|(\$\w+|\$\{[^}]*\})|(\b\d[\d_]*(?:\.\d+)?)|([A-Za-z_]\w*)|(\s+)|([\s\S])/g;
116
+ function esc(s) {
117
+ return String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
118
+ }
119
+ const isShell = (lang) => ['sh', 'bash', 'shell', 'console', 'zsh'].includes((lang || '').toLowerCase());
120
+ /** Returns an HTML string. Use with {@html ...} inside a <code> element. */
121
+ export function highlight(src, lang) {
122
+ const sh = isShell(lang);
123
+ const re = sh ? SHELL_RE : GENERAL_RE;
124
+ re.lastIndex = 0;
125
+ const tokens = [];
126
+ let m;
127
+ while ((m = re.exec(src))) {
128
+ if (m[1] != null)
129
+ tokens.push(['com', m[1]]);
130
+ else if (m[2] != null)
131
+ tokens.push(['str', m[2]]);
132
+ else if (sh && m[3] != null)
133
+ tokens.push(['var', m[3]]);
134
+ else if (m[sh ? 4 : 3] != null)
135
+ tokens.push(['num', m[sh ? 4 : 3]]);
136
+ else if (m[sh ? 5 : 4] != null)
137
+ tokens.push(['id', m[sh ? 5 : 4]]);
138
+ else if (m[sh ? 6 : 5] != null)
139
+ tokens.push(['ws', m[sh ? 6 : 5]]);
140
+ else
141
+ tokens.push(['p', m[sh ? 7 : 6]]);
142
+ }
143
+ let out = '';
144
+ for (let i = 0; i < tokens.length; i++) {
145
+ const [type, value] = tokens[i];
146
+ if (type === 'ws') {
147
+ out += esc(value);
148
+ continue;
149
+ }
150
+ if (type === 'id') {
151
+ let cls = 't-id';
152
+ if (KEYWORDS.has(value))
153
+ cls = 't-kw';
154
+ else if (PRIMITIVES.has(value))
155
+ cls = 't-ty';
156
+ else if (/^[A-Z]/.test(value))
157
+ cls = 't-ty';
158
+ else {
159
+ let j = i + 1;
160
+ while (j < tokens.length && tokens[j][0] === 'ws')
161
+ j++;
162
+ if (j < tokens.length && tokens[j][1].charAt(0) === '(')
163
+ cls = 't-fn';
164
+ }
165
+ out += cls === 't-id' ? esc(value) : `<span class="${cls}">${esc(value)}</span>`;
166
+ }
167
+ else {
168
+ const cls = type === 'com'
169
+ ? 't-com'
170
+ : type === 'str'
171
+ ? 't-str'
172
+ : type === 'num'
173
+ ? 't-num'
174
+ : type === 'var'
175
+ ? 't-fn'
176
+ : 't-p';
177
+ out += `<span class="${cls}">${esc(value)}</span>`;
178
+ }
179
+ }
180
+ return out;
181
+ }
@@ -0,0 +1,50 @@
1
+ /** A documented parameter (axle_doc `@param`). */
2
+ export interface DocParam {
3
+ name: string;
4
+ desc: string;
5
+ }
6
+ /** A documented throw (axle_doc `@throws`). */
7
+ export interface DocThrow {
8
+ type: string;
9
+ desc: string;
10
+ }
11
+ /** A documented declaration — function, method, or constructor. */
12
+ export interface DocMethod {
13
+ name: string;
14
+ ret: string;
15
+ sig: string;
16
+ desc: string;
17
+ params?: DocParam[];
18
+ returns?: string;
19
+ throws?: DocThrow[];
20
+ }
21
+ /** One measured metric column of the benchmark table. */
22
+ export interface Metric {
23
+ key: string;
24
+ label: string;
25
+ unit: string;
26
+ group: string;
27
+ }
28
+ /** One language / opt-level row of results (metric key → value). */
29
+ export interface BenchResult {
30
+ lang: string;
31
+ opt: string;
32
+ [metric: string]: string | number;
33
+ }
34
+ /** One benchmarked program, with its per-language sources. */
35
+ export interface BenchProgram {
36
+ name: string;
37
+ blurb?: string;
38
+ results: BenchResult[];
39
+ sources: Record<string, string>;
40
+ }
41
+ /** A category grouping several programs. */
42
+ export interface BenchCategory {
43
+ name: string;
44
+ programs: BenchProgram[];
45
+ }
46
+ /** The full benchmark dataset consumed by `BenchExplorer`. */
47
+ export interface BenchData {
48
+ metrics: Metric[];
49
+ categories: BenchCategory[];
50
+ }
@@ -0,0 +1,4 @@
1
+ // Shared, public data shapes for the content the consuming apps inject
2
+ // into the components. The library renders these; the apps (and their
3
+ // generators) produce them. Re-exported from the package barrel.
4
+ export {};
@@ -0,0 +1,20 @@
1
+ /** Segmented pill button — metric / language / source tabs. */
2
+ export declare const tab: (props?: ({
3
+ size?: "sm" | "md" | null | undefined;
4
+ active?: boolean | null | undefined;
5
+ tone?: "surface" | "canvas" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ /** Bordered segmented control — the comparison-panel task tabs. */
8
+ export declare const segmented: (props?: ({
9
+ active?: boolean | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
+ /** Primary / secondary action button (link or <button>). */
12
+ export declare const button: (props?: ({
13
+ variant?: "primary" | "secondary" | null | undefined;
14
+ size?: "sm" | "md" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ /** Docs sidebar nav item. */
17
+ export declare const navItem: (props?: ({
18
+ active?: boolean | null | undefined;
19
+ indent?: boolean | null | undefined;
20
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,50 @@
1
+ import { cva } from 'class-variance-authority';
2
+ // Variant definitions for the recurring interactive controls, so call
3
+ // sites pass props (active/size/tone) instead of hand-writing ternary
4
+ // class strings.
5
+ /** Segmented pill button — metric / language / source tabs. */
6
+ export const tab = cva('flex items-center rounded-md font-medium cursor-pointer transition-colors', {
7
+ variants: {
8
+ size: { sm: 'h-7 px-2.5 text-[12px]', md: 'h-8 px-3 text-[12.5px]' },
9
+ active: { true: 'bg-accent text-white', false: 'text-muted hover:text-fg' },
10
+ // hover background depends on the surface the tab sits on
11
+ tone: { surface: '', canvas: '' }
12
+ },
13
+ compoundVariants: [
14
+ { active: false, tone: 'surface', class: 'hover:bg-surface' },
15
+ { active: false, tone: 'canvas', class: 'hover:bg-canvas' }
16
+ ],
17
+ defaultVariants: { size: 'md', active: false, tone: 'surface' }
18
+ });
19
+ /** Bordered segmented control — the comparison-panel task tabs. */
20
+ export const segmented = cva('flex items-center h-8 px-3 rounded-lg border text-[12.5px] font-medium cursor-pointer transition-colors', {
21
+ variants: {
22
+ active: {
23
+ true: 'bg-accent text-white border-accent',
24
+ false: 'bg-canvas text-muted border-line hover:text-fg hover:border-faint'
25
+ }
26
+ },
27
+ defaultVariants: { active: false }
28
+ });
29
+ /** Primary / secondary action button (link or <button>). */
30
+ export const button = cva('inline-flex items-center gap-1.5 font-medium cursor-pointer transition-colors rounded-lg', {
31
+ variants: {
32
+ variant: {
33
+ primary: 'bg-accent text-white hover:opacity-90',
34
+ secondary: 'bg-canvas text-fg border border-line hover:bg-surface'
35
+ },
36
+ size: { sm: 'h-9 px-4 text-[13px]', md: 'h-11 px-5 text-[14px]' }
37
+ },
38
+ defaultVariants: { variant: 'primary', size: 'md' }
39
+ });
40
+ /** Docs sidebar nav item. */
41
+ export const navItem = cva('block rounded-md px-3 py-1.5 text-[13px] transition-colors', {
42
+ variants: {
43
+ active: {
44
+ true: 'bg-accent-soft text-accent font-medium',
45
+ false: 'text-muted hover:text-fg hover:bg-surface'
46
+ },
47
+ indent: { true: 'pl-7', false: '' }
48
+ },
49
+ defaultVariants: { active: false, indent: false }
50
+ });
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@axle-lang/ui",
3
+ "version": "0.1.0",
4
+ "description": "Axle design system — content-agnostic Svelte 5 + Tailwind v4 components, routing helpers, and the i18n chrome catalog shared by the Axle landing and docs sites.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/axle-lang/axle-docs-ui.git"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "svelte": "./dist/index.js",
18
+ "types": "./dist/index.d.ts",
19
+ "sideEffects": [
20
+ "**/*.css"
21
+ ],
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "svelte": "./dist/index.js",
26
+ "default": "./dist/index.js"
27
+ },
28
+ "./app.css": "./dist/app.css",
29
+ "./tokenizer": {
30
+ "types": "./dist/utils/tokenizer.d.ts",
31
+ "svelte": "./dist/utils/tokenizer.js",
32
+ "default": "./dist/utils/tokenizer.js"
33
+ }
34
+ },
35
+ "peerDependencies": {
36
+ "@sveltejs/kit": "^2",
37
+ "svelte": "^5",
38
+ "svelte-i18n": "^4"
39
+ },
40
+ "dependencies": {
41
+ "class-variance-authority": "^0.7.1",
42
+ "clsx": "^2.1.1",
43
+ "tailwind-merge": "^3.6.0"
44
+ },
45
+ "devDependencies": {
46
+ "@eslint/js": "^9.18.0",
47
+ "@sveltejs/adapter-static": "^3.0.10",
48
+ "@sveltejs/kit": "^2.63.0",
49
+ "@sveltejs/package": "^2.3.7",
50
+ "@sveltejs/vite-plugin-svelte": "^7.1.2",
51
+ "@tailwindcss/vite": "^4.3.0",
52
+ "eslint": "^9.18.0",
53
+ "eslint-config-prettier": "^9.1.0",
54
+ "eslint-plugin-svelte": "^2.46.1",
55
+ "globals": "^15.14.0",
56
+ "prettier": "^3.4.2",
57
+ "prettier-plugin-svelte": "^3.3.2",
58
+ "publint": "^0.3.2",
59
+ "svelte": "^5.56.1",
60
+ "svelte-check": "^4.1.0",
61
+ "svelte-i18n": "^4.0.1",
62
+ "tailwindcss": "^4.3.0",
63
+ "typescript": "^5.7.0",
64
+ "typescript-eslint": "^8.20.0",
65
+ "vite": "^8.0.16"
66
+ },
67
+ "scripts": {
68
+ "dev": "vite dev",
69
+ "build": "vite build",
70
+ "preview": "vite preview",
71
+ "sync": "svelte-kit sync",
72
+ "package": "svelte-kit sync && svelte-package && publint",
73
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
74
+ "lint": "prettier --check . && eslint .",
75
+ "format": "prettier --write ."
76
+ }
77
+ }