@fragments-sdk/cli 0.8.1 → 0.9.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.
@@ -0,0 +1,72 @@
1
+ /**
2
+ * MCP server configuration examples per AI tool.
3
+ *
4
+ * Single source of truth for all READMEs and docs pages
5
+ * that show how to configure the Fragments MCP server.
6
+ */
7
+
8
+ export interface McpConfigDef {
9
+ /** AI tool name (e.g., "Claude Code", "Cursor") */
10
+ tool: string;
11
+ /** Config file path */
12
+ filePath: string;
13
+ /** JSON config string (with comment header) */
14
+ config: string;
15
+ }
16
+
17
+ const npxArgs = `["-y", "@fragments-sdk/mcp@latest"]`;
18
+
19
+ export const MCP_CONFIGS: McpConfigDef[] = [
20
+ {
21
+ tool: 'Claude Code',
22
+ filePath: '.mcp.json',
23
+ config: `// .mcp.json (project root)
24
+ {
25
+ "mcpServers": {
26
+ "fragments": {
27
+ "command": "npx",
28
+ "args": ${npxArgs}
29
+ }
30
+ }
31
+ }`,
32
+ },
33
+ {
34
+ tool: 'Cursor',
35
+ filePath: '.cursor/mcp.json',
36
+ config: `// .cursor/mcp.json
37
+ {
38
+ "mcpServers": {
39
+ "fragments": {
40
+ "command": "npx",
41
+ "args": ${npxArgs}
42
+ }
43
+ }
44
+ }`,
45
+ },
46
+ {
47
+ tool: 'VS Code',
48
+ filePath: '.vscode/mcp.json',
49
+ config: `// .vscode/mcp.json
50
+ {
51
+ "servers": {
52
+ "fragments": {
53
+ "command": "npx",
54
+ "args": ${npxArgs}
55
+ }
56
+ }
57
+ }`,
58
+ },
59
+ {
60
+ tool: 'Windsurf',
61
+ filePath: '~/.codeium/windsurf/mcp_config.json',
62
+ config: `// ~/.codeium/windsurf/mcp_config.json
63
+ {
64
+ "mcpServers": {
65
+ "fragments": {
66
+ "command": "npx",
67
+ "args": ${npxArgs}
68
+ }
69
+ }
70
+ }`,
71
+ },
72
+ ];
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Design token seed definitions — single source of truth.
3
+ *
4
+ * Values must match libs/ui/src/tokens/_seeds.scss exactly.
5
+ * READMEs, docs pages, and MCP tool descriptions are generated from these.
6
+ */
7
+
8
+ // ---------------------------------------------------------------------------
9
+ // Types
10
+ // ---------------------------------------------------------------------------
11
+
12
+ export interface PaletteDef {
13
+ name: string;
14
+ description: string;
15
+ }
16
+
17
+ export interface DensityDef {
18
+ readonly name: string;
19
+ readonly baseUnit: string;
20
+ readonly description: string;
21
+ }
22
+
23
+ export interface RadiusDef {
24
+ readonly name: string;
25
+ readonly description: string;
26
+ }
27
+
28
+ // ---------------------------------------------------------------------------
29
+ // Neutral Palettes (must match _seeds.scss:27)
30
+ // ---------------------------------------------------------------------------
31
+
32
+ export const NEUTRAL_PALETTES: PaletteDef[] = [
33
+ { name: 'stone', description: 'Cool gray neutrals (balanced, professional) — default' },
34
+ { name: 'ice', description: 'Cool blue-tinted grays (crisp, technical)' },
35
+ { name: 'earth', description: 'Warm brown-tinted grays (natural, grounded)' },
36
+ { name: 'sand', description: 'Warm tan-tinted grays (organic, approachable)' },
37
+ { name: 'fire', description: 'Warm red-tinted grays (bold, energetic)' },
38
+ ];
39
+
40
+ // ---------------------------------------------------------------------------
41
+ // Density Presets (must match _seeds.scss:32)
42
+ // ---------------------------------------------------------------------------
43
+
44
+ export const DENSITY_PRESETS: readonly DensityDef[] = [
45
+ { name: 'compact', baseUnit: '6px', description: 'Tighter spacing, smaller elements' },
46
+ { name: 'default', baseUnit: '7px', description: 'Balanced, standard appearance' },
47
+ { name: 'relaxed', baseUnit: '8px', description: 'More spacious layout' },
48
+ ] as const;
49
+
50
+ // ---------------------------------------------------------------------------
51
+ // Radius Styles (must match _seeds.scss:37)
52
+ // ---------------------------------------------------------------------------
53
+
54
+ export const RADIUS_STYLES: readonly RadiusDef[] = [
55
+ { name: 'sharp', description: 'No rounding (technical, precise)' },
56
+ { name: 'subtle', description: 'Minimal rounding (modern minimal)' },
57
+ { name: 'default', description: 'Balanced rounding' },
58
+ { name: 'rounded', description: 'More prominent (friendly)' },
59
+ { name: 'pill', description: 'Maximum rounding (playful, soft)' },
60
+ ] as const;
61
+
62
+ // ---------------------------------------------------------------------------
63
+ // Seed Defaults (must match _seeds.scss)
64
+ // ---------------------------------------------------------------------------
65
+
66
+ export const SEED_DEFAULTS = {
67
+ brand: '#18181b',
68
+ neutral: 'stone',
69
+ density: 'default',
70
+ radiusStyle: 'default',
71
+ danger: '#ef4444',
72
+ success: '#22c55e',
73
+ warning: '#f59e0b',
74
+ info: '#3b82f6',
75
+ } as const;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Correct code examples for setup documentation.
3
+ *
4
+ * These are the canonical snippets used across READMEs and docs pages.
5
+ * If you change a pattern here, all generated docs update automatically.
6
+ */
7
+
8
+ // ---------------------------------------------------------------------------
9
+ // SCSS Setup
10
+ // ---------------------------------------------------------------------------
11
+
12
+ /** Minimal SCSS setup — @use with() syntax, not standalone variables */
13
+ export const SCSS_SETUP_MINIMAL = `@use '@fragments-sdk/ui/styles' with (
14
+ $fui-brand: #0066ff
15
+ );`;
16
+
17
+ /** Full SCSS setup with all seeds */
18
+ export const SCSS_SETUP_FULL = `@use '@fragments-sdk/ui/styles' with (
19
+ $fui-brand: #0066ff,
20
+ $fui-neutral: "ice",
21
+ $fui-density: "compact",
22
+ $fui-radius-style: "rounded"
23
+ );`;
24
+
25
+ // ---------------------------------------------------------------------------
26
+ // Theme API
27
+ // ---------------------------------------------------------------------------
28
+
29
+ /** Correct useTheme() API — mode/setMode, NOT theme/setTheme */
30
+ export const USE_THEME_EXAMPLE = `const { mode, setMode } = useTheme();`;
31
+
32
+ /** Full useTheme return shape */
33
+ export const USE_THEME_RETURN_SHAPE = `interface UseThemeReturn {
34
+ mode: ThemeMode;
35
+ setMode: (mode: ThemeMode) => void;
36
+ resolvedMode: 'light' | 'dark';
37
+ systemPreference: 'light' | 'dark';
38
+ toggleMode: () => void;
39
+ }`;
40
+
41
+ /** Canonical ThemeProvider prop — defaultMode, NOT defaultTheme */
42
+ export const PROVIDER_SETUP_EXAMPLE = `<ThemeProvider defaultMode="system">`;
43
+
44
+ // ---------------------------------------------------------------------------
45
+ // Import Paths
46
+ // ---------------------------------------------------------------------------
47
+
48
+ /** Correct mixin import path (NOT /tokens) */
49
+ export const MIXIN_IMPORT = `@use '@fragments-sdk/ui/mixins' as *;`;
50
+
51
+ /** Correct styles import — JS side */
52
+ export const STYLES_IMPORT_JS = `import '@fragments-sdk/ui/styles';`;
53
+
54
+ /** Correct styles import — SCSS side */
55
+ export const STYLES_IMPORT_SCSS = `@use '@fragments-sdk/ui/styles'`;