@triptease/design-system-mcp 1.0.18 → 1.0.20
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/dist/index.js +28985 -0
- package/package.json +20 -13
- package/CHANGELOG.md +0 -185
- package/dist/package.json +0 -44
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -66
- package/dist/src/index.js.map +0 -1
- package/dist/src/manifests/components/entries/badge.d.ts +0 -27
- package/dist/src/manifests/components/entries/badge.js +0 -43
- package/dist/src/manifests/components/entries/badge.js.map +0 -1
- package/dist/src/manifests/components/entries/banner.d.ts +0 -23
- package/dist/src/manifests/components/entries/banner.js +0 -68
- package/dist/src/manifests/components/entries/banner.js.map +0 -1
- package/dist/src/manifests/components/entries/barChart.d.ts +0 -74
- package/dist/src/manifests/components/entries/barChart.js +0 -128
- package/dist/src/manifests/components/entries/barChart.js.map +0 -1
- package/dist/src/manifests/components/entries/button.d.ts +0 -40
- package/dist/src/manifests/components/entries/button.js +0 -59
- package/dist/src/manifests/components/entries/button.js.map +0 -1
- package/dist/src/manifests/components/entries/card.d.ts +0 -25
- package/dist/src/manifests/components/entries/card.js +0 -42
- package/dist/src/manifests/components/entries/card.js.map +0 -1
- package/dist/src/manifests/components/entries/checkbox.d.ts +0 -31
- package/dist/src/manifests/components/entries/checkbox.js +0 -64
- package/dist/src/manifests/components/entries/checkbox.js.map +0 -1
- package/dist/src/manifests/components/entries/combobox.d.ts +0 -65
- package/dist/src/manifests/components/entries/combobox.js +0 -177
- package/dist/src/manifests/components/entries/combobox.js.map +0 -1
- package/dist/src/manifests/components/entries/datePicker.d.ts +0 -35
- package/dist/src/manifests/components/entries/datePicker.js +0 -68
- package/dist/src/manifests/components/entries/datePicker.js.map +0 -1
- package/dist/src/manifests/components/entries/dateRangePicker.d.ts +0 -35
- package/dist/src/manifests/components/entries/dateRangePicker.js +0 -111
- package/dist/src/manifests/components/entries/dateRangePicker.js.map +0 -1
- package/dist/src/manifests/components/entries/dialog.d.ts +0 -39
- package/dist/src/manifests/components/entries/dialog.js +0 -74
- package/dist/src/manifests/components/entries/dialog.js.map +0 -1
- package/dist/src/manifests/components/entries/lineChart.d.ts +0 -87
- package/dist/src/manifests/components/entries/lineChart.js +0 -166
- package/dist/src/manifests/components/entries/lineChart.js.map +0 -1
- package/dist/src/manifests/components/entries/numberinput.d.ts +0 -52
- package/dist/src/manifests/components/entries/numberinput.js +0 -64
- package/dist/src/manifests/components/entries/numberinput.js.map +0 -1
- package/dist/src/manifests/components/entries/radio.d.ts +0 -31
- package/dist/src/manifests/components/entries/radio.js +0 -50
- package/dist/src/manifests/components/entries/radio.js.map +0 -1
- package/dist/src/manifests/components/entries/select.d.ts +0 -16
- package/dist/src/manifests/components/entries/select.js +0 -23
- package/dist/src/manifests/components/entries/select.js.map +0 -1
- package/dist/src/manifests/components/entries/statistic.d.ts +0 -21
- package/dist/src/manifests/components/entries/statistic.js +0 -69
- package/dist/src/manifests/components/entries/statistic.js.map +0 -1
- package/dist/src/manifests/components/entries/table.d.ts +0 -16
- package/dist/src/manifests/components/entries/table.js +0 -43
- package/dist/src/manifests/components/entries/table.js.map +0 -1
- package/dist/src/manifests/components/entries/textarea.d.ts +0 -40
- package/dist/src/manifests/components/entries/textarea.js +0 -54
- package/dist/src/manifests/components/entries/textarea.js.map +0 -1
- package/dist/src/manifests/components/entries/textinput.d.ts +0 -40
- package/dist/src/manifests/components/entries/textinput.js +0 -53
- package/dist/src/manifests/components/entries/textinput.js.map +0 -1
- package/dist/src/manifests/components/entries/toggle.d.ts +0 -23
- package/dist/src/manifests/components/entries/toggle.js +0 -30
- package/dist/src/manifests/components/entries/toggle.js.map +0 -1
- package/dist/src/manifests/components/entries/typography.d.ts +0 -23
- package/dist/src/manifests/components/entries/typography.js +0 -32
- package/dist/src/manifests/components/entries/typography.js.map +0 -1
- package/dist/src/manifests/components/index.d.ts +0 -2
- package/dist/src/manifests/components/index.js +0 -43
- package/dist/src/manifests/components/index.js.map +0 -1
- package/dist/src/manifests/components/types.d.ts +0 -57
- package/dist/src/manifests/components/types.js +0 -2
- package/dist/src/manifests/components/types.js.map +0 -1
- package/dist/src/resources/components/get.d.ts +0 -7
- package/dist/src/resources/components/get.js +0 -29
- package/dist/src/resources/components/get.js.map +0 -1
- package/dist/src/resources/components/index.d.ts +0 -2
- package/dist/src/resources/components/index.js +0 -3
- package/dist/src/resources/components/index.js.map +0 -1
- package/dist/src/resources/components/list.d.ts +0 -7
- package/dist/src/resources/components/list.js +0 -19
- package/dist/src/resources/components/list.js.map +0 -1
- package/dist/src/resources/guides/index.d.ts +0 -2
- package/dist/src/resources/guides/index.js +0 -3
- package/dist/src/resources/guides/index.js.map +0 -1
- package/dist/src/resources/guides/principles.d.ts +0 -60
- package/dist/src/resources/guides/principles.js +0 -158
- package/dist/src/resources/guides/principles.js.map +0 -1
- package/dist/src/resources/guides/setup.d.ts +0 -7
- package/dist/src/resources/guides/setup.js +0 -54
- package/dist/src/resources/guides/setup.js.map +0 -1
- package/dist/src/resources/index.d.ts +0 -3
- package/dist/src/resources/index.js +0 -4
- package/dist/src/resources/index.js.map +0 -1
- package/dist/src/resources/tokens/get.d.ts +0 -7
- package/dist/src/resources/tokens/get.js +0 -30
- package/dist/src/resources/tokens/get.js.map +0 -1
- package/dist/src/resources/tokens/index.d.ts +0 -2
- package/dist/src/resources/tokens/index.js +0 -3
- package/dist/src/resources/tokens/index.js.map +0 -1
- package/dist/src/resources/tokens/list.d.ts +0 -7
- package/dist/src/resources/tokens/list.js +0 -21
- package/dist/src/resources/tokens/list.js.map +0 -1
- package/dist/src/tools/getCSSTokens/handler.d.ts +0 -6
- package/dist/src/tools/getCSSTokens/handler.js +0 -29
- package/dist/src/tools/getCSSTokens/handler.js.map +0 -1
- package/dist/src/tools/getCSSTokens/index.d.ts +0 -12
- package/dist/src/tools/getCSSTokens/index.js +0 -14
- package/dist/src/tools/getCSSTokens/index.js.map +0 -1
- package/dist/src/tools/getCSSTokens/utils.d.ts +0 -5
- package/dist/src/tools/getCSSTokens/utils.js +0 -25
- package/dist/src/tools/getCSSTokens/utils.js.map +0 -1
- package/dist/src/tools/getComponentDocs/handler.d.ts +0 -6
- package/dist/src/tools/getComponentDocs/handler.js +0 -27
- package/dist/src/tools/getComponentDocs/handler.js.map +0 -1
- package/dist/src/tools/getComponentDocs/index.d.ts +0 -12
- package/dist/src/tools/getComponentDocs/index.js +0 -14
- package/dist/src/tools/getComponentDocs/index.js.map +0 -1
- package/dist/src/tools/getSetupGuide/handler.d.ts +0 -6
- package/dist/src/tools/getSetupGuide/handler.js +0 -50
- package/dist/src/tools/getSetupGuide/handler.js.map +0 -1
- package/dist/src/tools/getSetupGuide/index.d.ts +0 -12
- package/dist/src/tools/getSetupGuide/index.js +0 -17
- package/dist/src/tools/getSetupGuide/index.js.map +0 -1
- package/dist/src/tools/getSetupGuide/setupGuides.d.ts +0 -12
- package/dist/src/tools/getSetupGuide/setupGuides.js +0 -49
- package/dist/src/tools/getSetupGuide/setupGuides.js.map +0 -1
- package/dist/src/tools/listCSSTokens/handler.d.ts +0 -3
- package/dist/src/tools/listCSSTokens/handler.js +0 -20
- package/dist/src/tools/listCSSTokens/handler.js.map +0 -1
- package/dist/src/tools/listCSSTokens/index.d.ts +0 -8
- package/dist/src/tools/listCSSTokens/index.js +0 -10
- package/dist/src/tools/listCSSTokens/index.js.map +0 -1
- package/dist/src/tools/listComponents/handler.d.ts +0 -3
- package/dist/src/tools/listComponents/handler.js +0 -18
- package/dist/src/tools/listComponents/handler.js.map +0 -1
- package/dist/src/tools/listComponents/index.d.ts +0 -9
- package/dist/src/tools/listComponents/index.js +0 -11
- package/dist/src/tools/listComponents/index.js.map +0 -1
- package/dist/src/utils/buildCDNUrls.d.ts +0 -3
- package/dist/src/utils/buildCDNUrls.js +0 -6
- package/dist/src/utils/buildCDNUrls.js.map +0 -1
- package/src/index.ts +0 -127
- package/src/manifests/components/entries/badge.ts +0 -45
- package/src/manifests/components/entries/banner.ts +0 -69
- package/src/manifests/components/entries/barChart.ts +0 -135
- package/src/manifests/components/entries/button.ts +0 -61
- package/src/manifests/components/entries/card.ts +0 -43
- package/src/manifests/components/entries/checkbox.ts +0 -68
- package/src/manifests/components/entries/combobox.ts +0 -185
- package/src/manifests/components/entries/datePicker.ts +0 -74
- package/src/manifests/components/entries/dateRangePicker.ts +0 -119
- package/src/manifests/components/entries/dialog.ts +0 -78
- package/src/manifests/components/entries/lineChart.ts +0 -177
- package/src/manifests/components/entries/numberinput.ts +0 -66
- package/src/manifests/components/entries/radio.ts +0 -53
- package/src/manifests/components/entries/select.ts +0 -24
- package/src/manifests/components/entries/statistic.ts +0 -72
- package/src/manifests/components/entries/table.ts +0 -44
- package/src/manifests/components/entries/textarea.ts +0 -56
- package/src/manifests/components/entries/textinput.ts +0 -55
- package/src/manifests/components/entries/toggle.ts +0 -31
- package/src/manifests/components/entries/typography.ts +0 -33
- package/src/manifests/components/index.ts +0 -45
- package/src/manifests/components/types.ts +0 -65
- package/src/resources/components/get.test.ts +0 -39
- package/src/resources/components/get.ts +0 -35
- package/src/resources/components/index.ts +0 -2
- package/src/resources/components/list.test.ts +0 -40
- package/src/resources/components/list.ts +0 -20
- package/src/resources/guides/index.ts +0 -2
- package/src/resources/guides/principles.ts +0 -160
- package/src/resources/guides/setup.test.ts +0 -72
- package/src/resources/guides/setup.ts +0 -66
- package/src/resources/index.ts +0 -3
- package/src/resources/tokens/get.test.ts +0 -41
- package/src/resources/tokens/get.ts +0 -36
- package/src/resources/tokens/index.ts +0 -2
- package/src/resources/tokens/list.test.ts +0 -42
- package/src/resources/tokens/list.ts +0 -31
- package/src/tools/getCSSTokens/__snapshots__/handler.test.ts.snap +0 -78
- package/src/tools/getCSSTokens/handler.test.ts +0 -39
- package/src/tools/getCSSTokens/handler.ts +0 -36
- package/src/tools/getCSSTokens/index.ts +0 -15
- package/src/tools/getCSSTokens/utils.ts +0 -31
- package/src/tools/getComponentDocs/__snapshots__/handler.test.ts.snap +0 -23
- package/src/tools/getComponentDocs/handler.test.ts +0 -14
- package/src/tools/getComponentDocs/handler.ts +0 -34
- package/src/tools/getComponentDocs/index.ts +0 -15
- package/src/tools/getSetupGuide/__snapshots__/handler.test.ts.snap +0 -34
- package/src/tools/getSetupGuide/handler.test.ts +0 -20
- package/src/tools/getSetupGuide/handler.ts +0 -59
- package/src/tools/getSetupGuide/index.ts +0 -20
- package/src/tools/getSetupGuide/setupGuides.ts +0 -62
- package/src/tools/listCSSTokens/__snapshots__/handler.test.ts.snap +0 -12
- package/src/tools/listCSSTokens/handler.test.ts +0 -9
- package/src/tools/listCSSTokens/handler.ts +0 -32
- package/src/tools/listCSSTokens/index.ts +0 -12
- package/src/tools/listComponents/__snapshots__/handler.test.ts.snap +0 -12
- package/src/tools/listComponents/handler.test.ts +0 -9
- package/src/tools/listComponents/handler.ts +0 -20
- package/src/tools/listComponents/index.ts +0 -12
- package/src/utils/buildCDNUrls.ts +0 -7
- package/tsconfig.json +0 -12
- package/vitest.config.ts +0 -6
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
textarea: {
|
|
5
|
-
name: 'Textarea',
|
|
6
|
-
description: 'Multi-line text input field',
|
|
7
|
-
element: 'textarea',
|
|
8
|
-
usageGuidance: {
|
|
9
|
-
whenToUse: [
|
|
10
|
-
'Multi-line text input (comments, descriptions, messages)',
|
|
11
|
-
'Content length is unpredictable',
|
|
12
|
-
'Users need to review text while typing',
|
|
13
|
-
'Text may contain line breaks',
|
|
14
|
-
],
|
|
15
|
-
avoid: [
|
|
16
|
-
'Single-line input (use text input)',
|
|
17
|
-
'Formatted text needed (use rich text editor)',
|
|
18
|
-
'Very long content (consider breaking into sections)',
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
attributes: {
|
|
22
|
-
'aria-invalid': {
|
|
23
|
-
type: 'boolean',
|
|
24
|
-
description:
|
|
25
|
-
'Marks textarea as invalid for error styling. Pair with aria-describedby to associate error messages.',
|
|
26
|
-
},
|
|
27
|
-
disabled: {
|
|
28
|
-
type: 'boolean',
|
|
29
|
-
description: 'Disables the textarea',
|
|
30
|
-
},
|
|
31
|
-
placeholder: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'Placeholder text. Should not replace label - always provide visible label element.',
|
|
34
|
-
},
|
|
35
|
-
rows: {
|
|
36
|
-
type: 'number',
|
|
37
|
-
description: 'Number of visible text lines',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
states: ['default', 'hover', 'focus', 'disabled', 'invalid'],
|
|
41
|
-
examples: [
|
|
42
|
-
{
|
|
43
|
-
title: 'Basic usage',
|
|
44
|
-
code: `<label for="about">About</label>
|
|
45
|
-
<textarea id="about" rows="4"></textarea>`,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
title: 'Error state',
|
|
49
|
-
description: 'Use aria-invalid with aria-describedby to associate error messages for screen readers',
|
|
50
|
-
code: `<label for="description">Description</label>
|
|
51
|
-
<textarea id="description" rows="4" aria-invalid aria-describedby="description-error"></textarea>
|
|
52
|
-
<span id="description-error" class="text-error">Description is required</span>`,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
} satisfies ComponentManifest;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
textinput: {
|
|
5
|
-
name: 'Text Input',
|
|
6
|
-
description: 'Text input field for single-line text entry with automatic validation styling',
|
|
7
|
-
element: 'input',
|
|
8
|
-
usageGuidance: {
|
|
9
|
-
whenToUse: [
|
|
10
|
-
'Single-line text entry (names, email, search)',
|
|
11
|
-
'Predictable, short text length',
|
|
12
|
-
'Specific input types (email, password, tel, url)',
|
|
13
|
-
],
|
|
14
|
-
avoid: [
|
|
15
|
-
'Multi-line text (use textarea)',
|
|
16
|
-
'Selecting from options (use select, radio, or combobox)',
|
|
17
|
-
'Pure numeric entry (consider number input)',
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
attributes: {
|
|
21
|
-
type: {
|
|
22
|
-
values: ['text', 'email', 'password', 'tel', 'url'],
|
|
23
|
-
default: 'text',
|
|
24
|
-
},
|
|
25
|
-
'aria-invalid': {
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
description:
|
|
28
|
-
'Marks input as invalid for error styling. Pair with aria-describedby to associate error messages.',
|
|
29
|
-
},
|
|
30
|
-
disabled: {
|
|
31
|
-
type: 'boolean',
|
|
32
|
-
description: 'Disables the input',
|
|
33
|
-
},
|
|
34
|
-
placeholder: {
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'Placeholder text. Should not replace label - always provide visible label element.',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
states: ['default', 'hover', 'focus', 'disabled', 'invalid'],
|
|
40
|
-
examples: [
|
|
41
|
-
{
|
|
42
|
-
title: 'Basic usage',
|
|
43
|
-
code: `<label for="hotel-name">Hotel Name</label>
|
|
44
|
-
<input id="hotel-name" />`,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
title: 'Error state',
|
|
48
|
-
description: 'Use aria-invalid with aria-describedby to associate error messages for screen readers',
|
|
49
|
-
code: `<label for="email">Email</label>
|
|
50
|
-
<input id="email" type="email" aria-invalid aria-describedby="email-error" />
|
|
51
|
-
<span id="email-error" class="text-error">Please enter a valid email address</span>`,
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
} satisfies ComponentManifest;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
toggle: {
|
|
5
|
-
name: 'Toggle',
|
|
6
|
-
description: 'Toggle switch for binary on/off states with immediate effect',
|
|
7
|
-
element: "input[type='checkbox'][data-theme='toggle']",
|
|
8
|
-
usageGuidance: {
|
|
9
|
-
whenToUse: ['Binary on/off states', 'Changes take effect immediately', 'System or feature settings'],
|
|
10
|
-
avoid: [
|
|
11
|
-
'Changes require saving (use checkbox in form)',
|
|
12
|
-
'More than two options exist (use radio buttons or select)',
|
|
13
|
-
"Relationship between on/off isn't clear",
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
dataAttributes: {
|
|
17
|
-
'data-theme': {
|
|
18
|
-
type: 'enum',
|
|
19
|
-
values: ['toggle'],
|
|
20
|
-
description: "Use 'toggle' for switch style",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
examples: [
|
|
24
|
-
{
|
|
25
|
-
title: 'Toggle switch',
|
|
26
|
-
code: `<input type="checkbox" id="weekly-parity-report" data-theme="toggle" />
|
|
27
|
-
<label for="weekly-parity-report">Weekly Parity Report</label>`,
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
} satisfies ComponentManifest;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
typography: {
|
|
5
|
-
name: 'Typography',
|
|
6
|
-
description: 'Text styling using semantic HTML elements and utility classes',
|
|
7
|
-
element: 'h1-h4, p, strong, a',
|
|
8
|
-
usageGuidance: {
|
|
9
|
-
whenToUse: [
|
|
10
|
-
'Use semantic elements (h1-h4, strong, a) for document structure and accessibility',
|
|
11
|
-
'Use utility classes (.heading-1 through .heading-4, .display, .body, .small, .strong, .text-error) when visual styling must differ from semantic meaning',
|
|
12
|
-
"Follow heading hierarchy - don't skip levels (h1 → h2 → h3, not h1 → h3)",
|
|
13
|
-
'Use <strong> for semantic importance, .strong for visual styling only',
|
|
14
|
-
],
|
|
15
|
-
avoid: [
|
|
16
|
-
'Using heading classes for document structure (use semantic h1-h4 elements)',
|
|
17
|
-
'Skipping heading levels (breaks accessibility)',
|
|
18
|
-
'Using buttons styled as links or links styled as buttons (use correct semantic element)',
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
classes: {
|
|
22
|
-
display: 'Largest text size for hero sections and prominent headlines',
|
|
23
|
-
'heading-1': 'h1 visual styling',
|
|
24
|
-
'heading-2': 'h2 visual styling',
|
|
25
|
-
'heading-3': 'h3 visual styling',
|
|
26
|
-
'heading-4': 'h4 visual styling',
|
|
27
|
-
body: 'Standard body text styling',
|
|
28
|
-
strong: 'Bold text styling without semantic importance',
|
|
29
|
-
small: 'Smaller text for captions, helper text, fine print',
|
|
30
|
-
'text-error': 'Error text color for validation messages',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
} satisfies ComponentManifest;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { ComponentManifest } from './types.js';
|
|
2
|
-
|
|
3
|
-
import button from '@/manifests/components/entries/button.js';
|
|
4
|
-
import textinput from '@/manifests/components/entries/textinput.js';
|
|
5
|
-
import numberinput from '@/manifests/components/entries/numberinput.js';
|
|
6
|
-
import textarea from '@/manifests/components/entries/textarea.js';
|
|
7
|
-
import select from '@/manifests/components/entries/select.js';
|
|
8
|
-
import checkbox from '@/manifests/components/entries/checkbox.js';
|
|
9
|
-
import radio from '@/manifests/components/entries/radio.js';
|
|
10
|
-
import toggle from '@/manifests/components/entries/toggle.js';
|
|
11
|
-
import badge from '@/manifests/components/entries/badge.js';
|
|
12
|
-
import card from '@/manifests/components/entries/card.js';
|
|
13
|
-
import table from '@/manifests/components/entries/table.js';
|
|
14
|
-
import typography from '@/manifests/components/entries/typography.js';
|
|
15
|
-
import dialog from '@/manifests/components/entries/dialog.js';
|
|
16
|
-
import combobox from '@/manifests/components/entries/combobox.js';
|
|
17
|
-
import datePicker from '@/manifests/components/entries/datePicker.js';
|
|
18
|
-
import dateRangePicker from '@/manifests/components/entries/dateRangePicker.js';
|
|
19
|
-
import barChart from '@/manifests/components/entries/barChart.js';
|
|
20
|
-
import lineChart from '@/manifests/components/entries/lineChart.js';
|
|
21
|
-
import statistic from '@/manifests/components/entries/statistic.js';
|
|
22
|
-
import banner from '@/manifests/components/entries/banner.js';
|
|
23
|
-
|
|
24
|
-
export const componentManifest: ComponentManifest = {
|
|
25
|
-
...button,
|
|
26
|
-
...textinput,
|
|
27
|
-
...numberinput,
|
|
28
|
-
...textarea,
|
|
29
|
-
...select,
|
|
30
|
-
...checkbox,
|
|
31
|
-
...radio,
|
|
32
|
-
...toggle,
|
|
33
|
-
...badge,
|
|
34
|
-
...card,
|
|
35
|
-
...table,
|
|
36
|
-
...typography,
|
|
37
|
-
...dialog,
|
|
38
|
-
...combobox,
|
|
39
|
-
...datePicker,
|
|
40
|
-
...dateRangePicker,
|
|
41
|
-
...barChart,
|
|
42
|
-
...lineChart,
|
|
43
|
-
...statistic,
|
|
44
|
-
...banner,
|
|
45
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
interface UsageGuidance {
|
|
2
|
-
whenToUse: string[];
|
|
3
|
-
bestPractices?: string[];
|
|
4
|
-
accessibility?: string[];
|
|
5
|
-
avoid?: string[];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface PackageInstallationBase {
|
|
9
|
-
includesTypes: boolean;
|
|
10
|
-
optional: boolean;
|
|
11
|
-
guidance?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface NPMPackage extends PackageInstallationBase {
|
|
15
|
-
name: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface CDNPackage extends PackageInstallationBase {
|
|
19
|
-
name: string;
|
|
20
|
-
latestVersionUrl: string;
|
|
21
|
-
pinnedMajorVersionUrl: string;
|
|
22
|
-
pinnedVersionUrl: string;
|
|
23
|
-
moduleFormat?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface InstallationOptions {
|
|
27
|
-
npm?: NPMPackage[];
|
|
28
|
-
cdn?: CDNPackage[];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface DataAttribute {
|
|
32
|
-
type: string;
|
|
33
|
-
values?: (string | undefined)[];
|
|
34
|
-
default?: string;
|
|
35
|
-
description: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface HTMLAttribute {
|
|
39
|
-
type?: string;
|
|
40
|
-
values?: string[];
|
|
41
|
-
default?: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface ExampleUsage {
|
|
46
|
-
title: string;
|
|
47
|
-
description?: string;
|
|
48
|
-
code: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface ComponentConfig {
|
|
52
|
-
name: string;
|
|
53
|
-
description: string;
|
|
54
|
-
ssrSafe?: boolean;
|
|
55
|
-
element: string;
|
|
56
|
-
usageGuidance?: UsageGuidance;
|
|
57
|
-
installationOptions?: InstallationOptions;
|
|
58
|
-
dataAttributes?: Record<string, DataAttribute>;
|
|
59
|
-
classes?: Record<string, string>;
|
|
60
|
-
attributes?: Record<string, HTMLAttribute>;
|
|
61
|
-
states?: string[];
|
|
62
|
-
examples?: ExampleUsage[];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export type ComponentManifest = Record<string, ComponentConfig>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { getComponentDocs } from './get.js';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
|
|
4
|
-
describe('getComponentDocs resource', () => {
|
|
5
|
-
it('should return error for non-existent component', async () => {
|
|
6
|
-
const result = await getComponentDocs('foo');
|
|
7
|
-
const data = JSON.parse(result.contents[0].text);
|
|
8
|
-
|
|
9
|
-
expect(data.error).toBe("Component 'foo' not found");
|
|
10
|
-
expect(data.available).toBeDefined();
|
|
11
|
-
expect(Array.isArray(data.available)).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should return component manifest for valid component', async () => {
|
|
15
|
-
const result = await getComponentDocs('button');
|
|
16
|
-
const data = JSON.parse(result.contents[0].text);
|
|
17
|
-
|
|
18
|
-
expect(data.name).toBe('Button');
|
|
19
|
-
expect(data.element).toBe('button');
|
|
20
|
-
expect(data.description).toBeDefined();
|
|
21
|
-
expect(data.dataAttributes).toBeDefined();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('should return contents with correct URI and mimeType', async () => {
|
|
25
|
-
const result = await getComponentDocs('button');
|
|
26
|
-
|
|
27
|
-
expect(result.contents).toBeDefined();
|
|
28
|
-
expect(result.contents).toHaveLength(1);
|
|
29
|
-
expect(result.contents[0].uri).toBe('designsystem://components/button');
|
|
30
|
-
expect(result.contents[0].mimeType).toBe('application/json');
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should handle case-insensitive component names', async () => {
|
|
34
|
-
const lowerResult = await getComponentDocs('button');
|
|
35
|
-
const upperResult = await getComponentDocs('BUTTON');
|
|
36
|
-
|
|
37
|
-
expect(JSON.parse(lowerResult.contents[0].text)).toEqual(JSON.parse(upperResult.contents[0].text));
|
|
38
|
-
});
|
|
39
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { componentManifest } from '@/manifests/components/index.js';
|
|
2
|
-
|
|
3
|
-
export const getComponentDocs = async (name: string) => {
|
|
4
|
-
const componentName = name.toLowerCase();
|
|
5
|
-
const component = componentManifest[componentName];
|
|
6
|
-
|
|
7
|
-
if (!component) {
|
|
8
|
-
return {
|
|
9
|
-
contents: [
|
|
10
|
-
{
|
|
11
|
-
uri: `designsystem://components/${name}`,
|
|
12
|
-
mimeType: 'application/json',
|
|
13
|
-
text: JSON.stringify(
|
|
14
|
-
{
|
|
15
|
-
error: `Component '${componentName}' not found`,
|
|
16
|
-
available: Object.keys(componentManifest),
|
|
17
|
-
},
|
|
18
|
-
null,
|
|
19
|
-
2
|
|
20
|
-
),
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
contents: [
|
|
28
|
-
{
|
|
29
|
-
uri: `designsystem://components/${name}`,
|
|
30
|
-
mimeType: 'application/json',
|
|
31
|
-
text: JSON.stringify(component, null, 2),
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { listComponents } from './list.js';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
|
|
4
|
-
describe('listComponents resource', () => {
|
|
5
|
-
it('should return contents with correct URI and mimeType', async () => {
|
|
6
|
-
const result = await listComponents();
|
|
7
|
-
|
|
8
|
-
expect(result.contents).toBeDefined();
|
|
9
|
-
expect(result.contents).toHaveLength(1);
|
|
10
|
-
expect(result.contents[0].uri).toBe('designsystem://components');
|
|
11
|
-
expect(result.contents[0].mimeType).toBe('application/json');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should return all 20 components', async () => {
|
|
15
|
-
const result = await listComponents();
|
|
16
|
-
const data = JSON.parse(result.contents[0].text);
|
|
17
|
-
|
|
18
|
-
expect(data.components).toHaveLength(20);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should include component key, name, description, and element', async () => {
|
|
22
|
-
const result = await listComponents();
|
|
23
|
-
const data = JSON.parse(result.contents[0].text);
|
|
24
|
-
const firstComponent = data.components[0];
|
|
25
|
-
|
|
26
|
-
expect(firstComponent).toHaveProperty('key');
|
|
27
|
-
expect(firstComponent).toHaveProperty('name');
|
|
28
|
-
expect(firstComponent).toHaveProperty('description');
|
|
29
|
-
expect(firstComponent).toHaveProperty('element');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should include button component', async () => {
|
|
33
|
-
const result = await listComponents();
|
|
34
|
-
const data = JSON.parse(result.contents[0].text);
|
|
35
|
-
const buttonComponent = data.components.find((c: any) => c.key === 'button');
|
|
36
|
-
|
|
37
|
-
expect(buttonComponent).toBeDefined();
|
|
38
|
-
expect(buttonComponent.name).toBe('Button');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { componentManifest } from '@/manifests/components/index.js';
|
|
2
|
-
|
|
3
|
-
export const listComponents = async () => {
|
|
4
|
-
const components = Object.entries(componentManifest).map(([key, comp]) => ({
|
|
5
|
-
key,
|
|
6
|
-
name: comp.name,
|
|
7
|
-
description: comp.description,
|
|
8
|
-
element: comp.element,
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
contents: [
|
|
13
|
-
{
|
|
14
|
-
uri: 'designsystem://components',
|
|
15
|
-
mimeType: 'application/json',
|
|
16
|
-
text: JSON.stringify({ components }, null, 2),
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
export const designSystemPrinciples = {
|
|
2
|
-
overview: {
|
|
3
|
-
corePrinciple:
|
|
4
|
-
'Trust the design system. Components and classes are fully styled and production-ready. Use them as-is.',
|
|
5
|
-
philosophy:
|
|
6
|
-
'The design system handles styling, spacing, colors, and layouts. Your role is to compose components, not recreate their styling.',
|
|
7
|
-
},
|
|
8
|
-
cssClassUsage: {
|
|
9
|
-
defaultApproach: 'Use existing classes without writing additional CSS',
|
|
10
|
-
do: [
|
|
11
|
-
'Use classes as-is without extra styling (e.g., <div class="card">)',
|
|
12
|
-
'Check component documentation BEFORE writing any custom CSS',
|
|
13
|
-
'Compose with multiple classes when needed (e.g., class="card stat-card")',
|
|
14
|
-
'Override using CSS variables when provided (e.g., style="--card-padding: var(--space-scale-4)")',
|
|
15
|
-
'Trust that design system classes include ALL necessary styling (layout, spacing, colors, shadows)',
|
|
16
|
-
],
|
|
17
|
-
dont: [
|
|
18
|
-
"Don't duplicate CSS that classes already provide (border, background, padding, etc.)",
|
|
19
|
-
"Don't create new classes without checking if design system has it",
|
|
20
|
-
"Don't assume classes need additional styling - verify in docs first",
|
|
21
|
-
"Don't override design tokens with hardcoded values (use CSS variables instead)",
|
|
22
|
-
"Don't add wrapper divs just to style - compose classes directly",
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
verificationWorkflow: {
|
|
26
|
-
description: 'Follow this workflow BEFORE writing any custom CSS',
|
|
27
|
-
steps: [
|
|
28
|
-
'1. Check: Does the design system have this component? (Query designsystem://components)',
|
|
29
|
-
'2. Read: What does the component provide? (Check component docs)',
|
|
30
|
-
'3. Use: Apply the class without custom CSS first',
|
|
31
|
-
'4. Test: Does it work as-is? (Usually yes!)',
|
|
32
|
-
'5. Customize: Only if truly needed, use CSS variables or add modifier classes',
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
whenToWriteCustomCSS: {
|
|
36
|
-
description: 'Write custom CSS only in these scenarios',
|
|
37
|
-
scenarios: [
|
|
38
|
-
'User explicitly requests custom/unique styling',
|
|
39
|
-
'Design system genuinely lacks the needed component',
|
|
40
|
-
'Truly unique layout requirements that cannot be solved with existing classes or composition',
|
|
41
|
-
'Dashboard-specific or app-specific layout patterns (grids, specialized containers)',
|
|
42
|
-
],
|
|
43
|
-
notValidReasons: [
|
|
44
|
-
'Not valid: "I need a card with padding" - .card already has padding',
|
|
45
|
-
'Not valid: "I need a button with a border" - button already has borders',
|
|
46
|
-
'Not valid: "I need spacing between elements" - use design system spacing tokens',
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
compositionPatterns: {
|
|
50
|
-
description: 'How to combine design system classes effectively',
|
|
51
|
-
patterns: [
|
|
52
|
-
{
|
|
53
|
-
pattern: 'Base + Modifier',
|
|
54
|
-
example: '<div class="card stat-card">',
|
|
55
|
-
explanation: 'Use base design system class (card) + your modifier class (stat-card) for extensions',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
pattern: 'CSS Variable Override',
|
|
59
|
-
example: '<div class="card" style="--card-padding: var(--space-scale-5)">',
|
|
60
|
-
explanation: 'Override CSS variables for customization without duplicating styles',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
pattern: 'Multiple Design System Classes',
|
|
64
|
-
example: '<button class="primary large">',
|
|
65
|
-
explanation: 'Compose multiple utility/variant classes from design system',
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
designTokens: {
|
|
70
|
-
description: 'Use design tokens instead of hardcoded values',
|
|
71
|
-
principle: 'All spacing, colors, typography should use CSS custom properties (--*)',
|
|
72
|
-
examples: [
|
|
73
|
-
{
|
|
74
|
-
wrong: 'padding: 24px',
|
|
75
|
-
right: 'padding: var(--space-scale-3)',
|
|
76
|
-
why: 'Tokens ensure consistency and enable theming',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
wrong: 'color: #DA0707',
|
|
80
|
-
right: 'color: var(--color-alert-400)',
|
|
81
|
-
why: 'Semantic tokens communicate intent and adapt to themes',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
wrong: 'font-size: 16px',
|
|
85
|
-
right: 'font-size: var(--font-size-300)',
|
|
86
|
-
why: 'Typography scale ensures visual hierarchy',
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
},
|
|
90
|
-
commonMistakes: {
|
|
91
|
-
description: 'Common mistakes developers make (and how to avoid them)',
|
|
92
|
-
mistakes: [
|
|
93
|
-
{
|
|
94
|
-
mistake: 'Recreating .card styling',
|
|
95
|
-
problem: 'Duplicating background, border, padding, shadows that .card already provides',
|
|
96
|
-
solution: 'Use <div class="card"> directly. It includes everything.',
|
|
97
|
-
prevention: 'Read component docs BEFORE writing CSS',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
mistake: 'Adding wrapper divs for styling',
|
|
101
|
-
problem: '<div class="my-wrapper"><div class="card">...</div></div>',
|
|
102
|
-
solution: 'Style the card directly: <div class="card my-modifier">',
|
|
103
|
-
prevention: 'Compose classes instead of wrapping',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
mistake: 'Hardcoding spacing values',
|
|
107
|
-
problem: 'margin: 16px; gap: 12px;',
|
|
108
|
-
solution: 'margin: var(--space-scale-2); gap: var(--space-scale-1-5);',
|
|
109
|
-
prevention: 'Query designsystem://tokens/space for available values',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
mistake: 'Assuming classes are incomplete',
|
|
113
|
-
problem: 'Adding display: flex, border: 1px solid, etc. to classes that already have these',
|
|
114
|
-
solution: "Trust the design system. Check docs to see what's included.",
|
|
115
|
-
prevention: 'Default assumption: classes are complete, not partial',
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
resources: {
|
|
120
|
-
description: 'MCP resources for discovering design system capabilities',
|
|
121
|
-
available: [
|
|
122
|
-
{
|
|
123
|
-
resource: 'designsystem://components',
|
|
124
|
-
purpose: 'List all available components',
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
resource: 'designsystem://components/{name}',
|
|
128
|
-
purpose: 'Get detailed component documentation',
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
resource: 'designsystem://tokens',
|
|
132
|
-
purpose: 'List all token categories',
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
resource: 'designsystem://tokens/{category}',
|
|
136
|
-
purpose: 'Get tokens for specific category (color, space, font, etc.)',
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
resource: 'designsystem://guides/setup',
|
|
140
|
-
purpose: 'Installation instructions',
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
resource: 'designsystem://guides/principles',
|
|
144
|
-
purpose: 'This guide - design system usage principles',
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export const getPrinciplesGuide = async () => {
|
|
151
|
-
return {
|
|
152
|
-
contents: [
|
|
153
|
-
{
|
|
154
|
-
uri: 'designsystem://guides/principles',
|
|
155
|
-
mimeType: 'application/json',
|
|
156
|
-
text: JSON.stringify(designSystemPrinciples, null, 2),
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
};
|
|
160
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { getSetupGuide } from './setup.js';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
|
|
4
|
-
describe('getSetupGuide resource', () => {
|
|
5
|
-
it('should return all guides when no type is specified', async () => {
|
|
6
|
-
const result = await getSetupGuide();
|
|
7
|
-
const data = JSON.parse(result.contents[0].text);
|
|
8
|
-
|
|
9
|
-
expect(data.message).toBeDefined();
|
|
10
|
-
expect(data.options).toBeDefined();
|
|
11
|
-
expect(Array.isArray(data.options)).toBe(true);
|
|
12
|
-
expect(data.options).toHaveLength(2);
|
|
13
|
-
expect(data.options.some((opt: any) => opt.type === 'npm')).toBe(true);
|
|
14
|
-
expect(data.options.some((opt: any) => opt.type === 'cdn')).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('should return npm guide with correct structure', async () => {
|
|
18
|
-
const result = await getSetupGuide('npm');
|
|
19
|
-
const data = JSON.parse(result.contents[0].text);
|
|
20
|
-
|
|
21
|
-
expect(data.name).toBe('NPM Stylesheet Setup');
|
|
22
|
-
expect(data.description).toBeDefined();
|
|
23
|
-
expect(Array.isArray(data.steps)).toBe(true);
|
|
24
|
-
expect(data.steps.length).toBeGreaterThan(0);
|
|
25
|
-
expect(data.notes).toBeDefined();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should return cdn guide with correct structure', async () => {
|
|
29
|
-
const result = await getSetupGuide('cdn');
|
|
30
|
-
const data = JSON.parse(result.contents[0].text);
|
|
31
|
-
|
|
32
|
-
expect(data.name).toBe('CDN Stylesheet Setup');
|
|
33
|
-
expect(data.description).toBeDefined();
|
|
34
|
-
expect(Array.isArray(data.steps)).toBe(true);
|
|
35
|
-
expect(data.steps.length).toBeGreaterThan(0);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('should return error for invalid guide type', async () => {
|
|
39
|
-
const result = await getSetupGuide('invalid');
|
|
40
|
-
const data = JSON.parse(result.contents[0].text);
|
|
41
|
-
|
|
42
|
-
expect(data.error).toBe("Setup guide 'invalid' not found");
|
|
43
|
-
expect(data.available).toBeDefined();
|
|
44
|
-
expect(Array.isArray(data.available)).toBe(true);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should include code snippets in steps', async () => {
|
|
48
|
-
const result = await getSetupGuide('npm');
|
|
49
|
-
const data = JSON.parse(result.contents[0].text);
|
|
50
|
-
const firstStep = data.steps[0];
|
|
51
|
-
|
|
52
|
-
expect(firstStep).toHaveProperty('title');
|
|
53
|
-
expect(firstStep).toHaveProperty('code');
|
|
54
|
-
expect(firstStep).toHaveProperty('language');
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('should return contents with correct URI and mimeType for npm', async () => {
|
|
58
|
-
const result = await getSetupGuide('npm');
|
|
59
|
-
|
|
60
|
-
expect(result.contents).toBeDefined();
|
|
61
|
-
expect(result.contents).toHaveLength(1);
|
|
62
|
-
expect(result.contents[0].uri).toBe('designsystem://guides/setup/npm');
|
|
63
|
-
expect(result.contents[0].mimeType).toBe('application/json');
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('should handle case-insensitive guide type', async () => {
|
|
67
|
-
const lowerResult = await getSetupGuide('npm');
|
|
68
|
-
const upperResult = await getSetupGuide('NPM');
|
|
69
|
-
|
|
70
|
-
expect(JSON.parse(lowerResult.contents[0].text)).toEqual(JSON.parse(upperResult.contents[0].text));
|
|
71
|
-
});
|
|
72
|
-
});
|