@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.
Files changed (205) hide show
  1. package/dist/index.js +28985 -0
  2. package/package.json +20 -13
  3. package/CHANGELOG.md +0 -185
  4. package/dist/package.json +0 -44
  5. package/dist/src/index.d.ts +0 -2
  6. package/dist/src/index.js +0 -66
  7. package/dist/src/index.js.map +0 -1
  8. package/dist/src/manifests/components/entries/badge.d.ts +0 -27
  9. package/dist/src/manifests/components/entries/badge.js +0 -43
  10. package/dist/src/manifests/components/entries/badge.js.map +0 -1
  11. package/dist/src/manifests/components/entries/banner.d.ts +0 -23
  12. package/dist/src/manifests/components/entries/banner.js +0 -68
  13. package/dist/src/manifests/components/entries/banner.js.map +0 -1
  14. package/dist/src/manifests/components/entries/barChart.d.ts +0 -74
  15. package/dist/src/manifests/components/entries/barChart.js +0 -128
  16. package/dist/src/manifests/components/entries/barChart.js.map +0 -1
  17. package/dist/src/manifests/components/entries/button.d.ts +0 -40
  18. package/dist/src/manifests/components/entries/button.js +0 -59
  19. package/dist/src/manifests/components/entries/button.js.map +0 -1
  20. package/dist/src/manifests/components/entries/card.d.ts +0 -25
  21. package/dist/src/manifests/components/entries/card.js +0 -42
  22. package/dist/src/manifests/components/entries/card.js.map +0 -1
  23. package/dist/src/manifests/components/entries/checkbox.d.ts +0 -31
  24. package/dist/src/manifests/components/entries/checkbox.js +0 -64
  25. package/dist/src/manifests/components/entries/checkbox.js.map +0 -1
  26. package/dist/src/manifests/components/entries/combobox.d.ts +0 -65
  27. package/dist/src/manifests/components/entries/combobox.js +0 -177
  28. package/dist/src/manifests/components/entries/combobox.js.map +0 -1
  29. package/dist/src/manifests/components/entries/datePicker.d.ts +0 -35
  30. package/dist/src/manifests/components/entries/datePicker.js +0 -68
  31. package/dist/src/manifests/components/entries/datePicker.js.map +0 -1
  32. package/dist/src/manifests/components/entries/dateRangePicker.d.ts +0 -35
  33. package/dist/src/manifests/components/entries/dateRangePicker.js +0 -111
  34. package/dist/src/manifests/components/entries/dateRangePicker.js.map +0 -1
  35. package/dist/src/manifests/components/entries/dialog.d.ts +0 -39
  36. package/dist/src/manifests/components/entries/dialog.js +0 -74
  37. package/dist/src/manifests/components/entries/dialog.js.map +0 -1
  38. package/dist/src/manifests/components/entries/lineChart.d.ts +0 -87
  39. package/dist/src/manifests/components/entries/lineChart.js +0 -166
  40. package/dist/src/manifests/components/entries/lineChart.js.map +0 -1
  41. package/dist/src/manifests/components/entries/numberinput.d.ts +0 -52
  42. package/dist/src/manifests/components/entries/numberinput.js +0 -64
  43. package/dist/src/manifests/components/entries/numberinput.js.map +0 -1
  44. package/dist/src/manifests/components/entries/radio.d.ts +0 -31
  45. package/dist/src/manifests/components/entries/radio.js +0 -50
  46. package/dist/src/manifests/components/entries/radio.js.map +0 -1
  47. package/dist/src/manifests/components/entries/select.d.ts +0 -16
  48. package/dist/src/manifests/components/entries/select.js +0 -23
  49. package/dist/src/manifests/components/entries/select.js.map +0 -1
  50. package/dist/src/manifests/components/entries/statistic.d.ts +0 -21
  51. package/dist/src/manifests/components/entries/statistic.js +0 -69
  52. package/dist/src/manifests/components/entries/statistic.js.map +0 -1
  53. package/dist/src/manifests/components/entries/table.d.ts +0 -16
  54. package/dist/src/manifests/components/entries/table.js +0 -43
  55. package/dist/src/manifests/components/entries/table.js.map +0 -1
  56. package/dist/src/manifests/components/entries/textarea.d.ts +0 -40
  57. package/dist/src/manifests/components/entries/textarea.js +0 -54
  58. package/dist/src/manifests/components/entries/textarea.js.map +0 -1
  59. package/dist/src/manifests/components/entries/textinput.d.ts +0 -40
  60. package/dist/src/manifests/components/entries/textinput.js +0 -53
  61. package/dist/src/manifests/components/entries/textinput.js.map +0 -1
  62. package/dist/src/manifests/components/entries/toggle.d.ts +0 -23
  63. package/dist/src/manifests/components/entries/toggle.js +0 -30
  64. package/dist/src/manifests/components/entries/toggle.js.map +0 -1
  65. package/dist/src/manifests/components/entries/typography.d.ts +0 -23
  66. package/dist/src/manifests/components/entries/typography.js +0 -32
  67. package/dist/src/manifests/components/entries/typography.js.map +0 -1
  68. package/dist/src/manifests/components/index.d.ts +0 -2
  69. package/dist/src/manifests/components/index.js +0 -43
  70. package/dist/src/manifests/components/index.js.map +0 -1
  71. package/dist/src/manifests/components/types.d.ts +0 -57
  72. package/dist/src/manifests/components/types.js +0 -2
  73. package/dist/src/manifests/components/types.js.map +0 -1
  74. package/dist/src/resources/components/get.d.ts +0 -7
  75. package/dist/src/resources/components/get.js +0 -29
  76. package/dist/src/resources/components/get.js.map +0 -1
  77. package/dist/src/resources/components/index.d.ts +0 -2
  78. package/dist/src/resources/components/index.js +0 -3
  79. package/dist/src/resources/components/index.js.map +0 -1
  80. package/dist/src/resources/components/list.d.ts +0 -7
  81. package/dist/src/resources/components/list.js +0 -19
  82. package/dist/src/resources/components/list.js.map +0 -1
  83. package/dist/src/resources/guides/index.d.ts +0 -2
  84. package/dist/src/resources/guides/index.js +0 -3
  85. package/dist/src/resources/guides/index.js.map +0 -1
  86. package/dist/src/resources/guides/principles.d.ts +0 -60
  87. package/dist/src/resources/guides/principles.js +0 -158
  88. package/dist/src/resources/guides/principles.js.map +0 -1
  89. package/dist/src/resources/guides/setup.d.ts +0 -7
  90. package/dist/src/resources/guides/setup.js +0 -54
  91. package/dist/src/resources/guides/setup.js.map +0 -1
  92. package/dist/src/resources/index.d.ts +0 -3
  93. package/dist/src/resources/index.js +0 -4
  94. package/dist/src/resources/index.js.map +0 -1
  95. package/dist/src/resources/tokens/get.d.ts +0 -7
  96. package/dist/src/resources/tokens/get.js +0 -30
  97. package/dist/src/resources/tokens/get.js.map +0 -1
  98. package/dist/src/resources/tokens/index.d.ts +0 -2
  99. package/dist/src/resources/tokens/index.js +0 -3
  100. package/dist/src/resources/tokens/index.js.map +0 -1
  101. package/dist/src/resources/tokens/list.d.ts +0 -7
  102. package/dist/src/resources/tokens/list.js +0 -21
  103. package/dist/src/resources/tokens/list.js.map +0 -1
  104. package/dist/src/tools/getCSSTokens/handler.d.ts +0 -6
  105. package/dist/src/tools/getCSSTokens/handler.js +0 -29
  106. package/dist/src/tools/getCSSTokens/handler.js.map +0 -1
  107. package/dist/src/tools/getCSSTokens/index.d.ts +0 -12
  108. package/dist/src/tools/getCSSTokens/index.js +0 -14
  109. package/dist/src/tools/getCSSTokens/index.js.map +0 -1
  110. package/dist/src/tools/getCSSTokens/utils.d.ts +0 -5
  111. package/dist/src/tools/getCSSTokens/utils.js +0 -25
  112. package/dist/src/tools/getCSSTokens/utils.js.map +0 -1
  113. package/dist/src/tools/getComponentDocs/handler.d.ts +0 -6
  114. package/dist/src/tools/getComponentDocs/handler.js +0 -27
  115. package/dist/src/tools/getComponentDocs/handler.js.map +0 -1
  116. package/dist/src/tools/getComponentDocs/index.d.ts +0 -12
  117. package/dist/src/tools/getComponentDocs/index.js +0 -14
  118. package/dist/src/tools/getComponentDocs/index.js.map +0 -1
  119. package/dist/src/tools/getSetupGuide/handler.d.ts +0 -6
  120. package/dist/src/tools/getSetupGuide/handler.js +0 -50
  121. package/dist/src/tools/getSetupGuide/handler.js.map +0 -1
  122. package/dist/src/tools/getSetupGuide/index.d.ts +0 -12
  123. package/dist/src/tools/getSetupGuide/index.js +0 -17
  124. package/dist/src/tools/getSetupGuide/index.js.map +0 -1
  125. package/dist/src/tools/getSetupGuide/setupGuides.d.ts +0 -12
  126. package/dist/src/tools/getSetupGuide/setupGuides.js +0 -49
  127. package/dist/src/tools/getSetupGuide/setupGuides.js.map +0 -1
  128. package/dist/src/tools/listCSSTokens/handler.d.ts +0 -3
  129. package/dist/src/tools/listCSSTokens/handler.js +0 -20
  130. package/dist/src/tools/listCSSTokens/handler.js.map +0 -1
  131. package/dist/src/tools/listCSSTokens/index.d.ts +0 -8
  132. package/dist/src/tools/listCSSTokens/index.js +0 -10
  133. package/dist/src/tools/listCSSTokens/index.js.map +0 -1
  134. package/dist/src/tools/listComponents/handler.d.ts +0 -3
  135. package/dist/src/tools/listComponents/handler.js +0 -18
  136. package/dist/src/tools/listComponents/handler.js.map +0 -1
  137. package/dist/src/tools/listComponents/index.d.ts +0 -9
  138. package/dist/src/tools/listComponents/index.js +0 -11
  139. package/dist/src/tools/listComponents/index.js.map +0 -1
  140. package/dist/src/utils/buildCDNUrls.d.ts +0 -3
  141. package/dist/src/utils/buildCDNUrls.js +0 -6
  142. package/dist/src/utils/buildCDNUrls.js.map +0 -1
  143. package/src/index.ts +0 -127
  144. package/src/manifests/components/entries/badge.ts +0 -45
  145. package/src/manifests/components/entries/banner.ts +0 -69
  146. package/src/manifests/components/entries/barChart.ts +0 -135
  147. package/src/manifests/components/entries/button.ts +0 -61
  148. package/src/manifests/components/entries/card.ts +0 -43
  149. package/src/manifests/components/entries/checkbox.ts +0 -68
  150. package/src/manifests/components/entries/combobox.ts +0 -185
  151. package/src/manifests/components/entries/datePicker.ts +0 -74
  152. package/src/manifests/components/entries/dateRangePicker.ts +0 -119
  153. package/src/manifests/components/entries/dialog.ts +0 -78
  154. package/src/manifests/components/entries/lineChart.ts +0 -177
  155. package/src/manifests/components/entries/numberinput.ts +0 -66
  156. package/src/manifests/components/entries/radio.ts +0 -53
  157. package/src/manifests/components/entries/select.ts +0 -24
  158. package/src/manifests/components/entries/statistic.ts +0 -72
  159. package/src/manifests/components/entries/table.ts +0 -44
  160. package/src/manifests/components/entries/textarea.ts +0 -56
  161. package/src/manifests/components/entries/textinput.ts +0 -55
  162. package/src/manifests/components/entries/toggle.ts +0 -31
  163. package/src/manifests/components/entries/typography.ts +0 -33
  164. package/src/manifests/components/index.ts +0 -45
  165. package/src/manifests/components/types.ts +0 -65
  166. package/src/resources/components/get.test.ts +0 -39
  167. package/src/resources/components/get.ts +0 -35
  168. package/src/resources/components/index.ts +0 -2
  169. package/src/resources/components/list.test.ts +0 -40
  170. package/src/resources/components/list.ts +0 -20
  171. package/src/resources/guides/index.ts +0 -2
  172. package/src/resources/guides/principles.ts +0 -160
  173. package/src/resources/guides/setup.test.ts +0 -72
  174. package/src/resources/guides/setup.ts +0 -66
  175. package/src/resources/index.ts +0 -3
  176. package/src/resources/tokens/get.test.ts +0 -41
  177. package/src/resources/tokens/get.ts +0 -36
  178. package/src/resources/tokens/index.ts +0 -2
  179. package/src/resources/tokens/list.test.ts +0 -42
  180. package/src/resources/tokens/list.ts +0 -31
  181. package/src/tools/getCSSTokens/__snapshots__/handler.test.ts.snap +0 -78
  182. package/src/tools/getCSSTokens/handler.test.ts +0 -39
  183. package/src/tools/getCSSTokens/handler.ts +0 -36
  184. package/src/tools/getCSSTokens/index.ts +0 -15
  185. package/src/tools/getCSSTokens/utils.ts +0 -31
  186. package/src/tools/getComponentDocs/__snapshots__/handler.test.ts.snap +0 -23
  187. package/src/tools/getComponentDocs/handler.test.ts +0 -14
  188. package/src/tools/getComponentDocs/handler.ts +0 -34
  189. package/src/tools/getComponentDocs/index.ts +0 -15
  190. package/src/tools/getSetupGuide/__snapshots__/handler.test.ts.snap +0 -34
  191. package/src/tools/getSetupGuide/handler.test.ts +0 -20
  192. package/src/tools/getSetupGuide/handler.ts +0 -59
  193. package/src/tools/getSetupGuide/index.ts +0 -20
  194. package/src/tools/getSetupGuide/setupGuides.ts +0 -62
  195. package/src/tools/listCSSTokens/__snapshots__/handler.test.ts.snap +0 -12
  196. package/src/tools/listCSSTokens/handler.test.ts +0 -9
  197. package/src/tools/listCSSTokens/handler.ts +0 -32
  198. package/src/tools/listCSSTokens/index.ts +0 -12
  199. package/src/tools/listComponents/__snapshots__/handler.test.ts.snap +0 -12
  200. package/src/tools/listComponents/handler.test.ts +0 -9
  201. package/src/tools/listComponents/handler.ts +0 -20
  202. package/src/tools/listComponents/index.ts +0 -12
  203. package/src/utils/buildCDNUrls.ts +0 -7
  204. package/tsconfig.json +0 -12
  205. package/vitest.config.ts +0 -6
@@ -1,66 +0,0 @@
1
- import { setupGuides } from '@/tools/getSetupGuide/setupGuides.js';
2
-
3
- export const getSetupGuide = async (type?: string) => {
4
- // Return both guides if no type specified
5
- if (!type) {
6
- const allGuides = Object.entries(setupGuides).map(([key, guide]) => ({
7
- type: key,
8
- name: guide.name,
9
- description: guide.description,
10
- guide,
11
- }));
12
-
13
- return {
14
- contents: [
15
- {
16
- uri: 'designsystem://guides/setup',
17
- mimeType: 'application/json',
18
- text: JSON.stringify(
19
- {
20
- message: 'Multiple setup options available. Choose based on user preference or project requirements.',
21
- options: allGuides,
22
- },
23
- null,
24
- 2
25
- ),
26
- },
27
- ],
28
- };
29
- }
30
-
31
- const guideType = type.toLowerCase();
32
- const guide = setupGuides[guideType];
33
-
34
- if (!guide) {
35
- return {
36
- contents: [
37
- {
38
- uri: `designsystem://guides/setup/${type}`,
39
- mimeType: 'application/json',
40
- text: JSON.stringify(
41
- {
42
- error: `Setup guide '${guideType}' not found`,
43
- available: Object.keys(setupGuides).map((key) => ({
44
- key,
45
- name: setupGuides[key].name,
46
- description: setupGuides[key].description,
47
- })),
48
- },
49
- null,
50
- 2
51
- ),
52
- },
53
- ],
54
- };
55
- }
56
-
57
- return {
58
- contents: [
59
- {
60
- uri: `designsystem://guides/setup/${type}`,
61
- mimeType: 'application/json',
62
- text: JSON.stringify(guide, null, 2),
63
- },
64
- ],
65
- };
66
- };
@@ -1,3 +0,0 @@
1
- export * from './components/index.js';
2
- export * from './tokens/index.js';
3
- export * from './guides/index.js';
@@ -1,41 +0,0 @@
1
- import { getCSSTokens } from './get.js';
2
- import { describe, expect, it } from 'vitest';
3
-
4
- describe('getCSSTokens resource', () => {
5
- it('should return error for invalid category', async () => {
6
- const result = await getCSSTokens('invalid');
7
- const data = JSON.parse(result.contents[0].text);
8
-
9
- expect(data.error).toBe("Invalid category 'invalid'");
10
- expect(data.available).toBeDefined();
11
- expect(Array.isArray(data.available)).toBe(true);
12
- });
13
-
14
- it('should return tokens array for valid category', async () => {
15
- const result = await getCSSTokens('color');
16
- const data = JSON.parse(result.contents[0].text);
17
-
18
- expect(Array.isArray(data)).toBe(true);
19
- expect(data.length).toBeGreaterThan(0);
20
- });
21
-
22
- it('should return tokens with token and value properties', async () => {
23
- const result = await getCSSTokens('color');
24
- const data = JSON.parse(result.contents[0].text);
25
- const firstToken = data[0];
26
-
27
- expect(firstToken).toHaveProperty('token');
28
- expect(firstToken).toHaveProperty('value');
29
- expect(typeof firstToken.token).toBe('string');
30
- expect(typeof firstToken.value).toBe('string');
31
- });
32
-
33
- it('should return contents with correct URI and mimeType', async () => {
34
- const result = await getCSSTokens('color');
35
-
36
- expect(result.contents).toBeDefined();
37
- expect(result.contents).toHaveLength(1);
38
- expect(result.contents[0].uri).toBe('designsystem://tokens/color');
39
- expect(result.contents[0].mimeType).toBe('application/json');
40
- });
41
- });
@@ -1,36 +0,0 @@
1
- import designTokens from '@triptease/stylesheet/tokens' with { type: 'json' };
2
- import { buildTokens } from '@/tools/getCSSTokens/utils.js';
3
-
4
- export const getCSSTokens = async (category: string) => {
5
- const tokens = buildTokens(designTokens);
6
- const categories = Object.keys(tokens);
7
-
8
- if (!categories.includes(category)) {
9
- return {
10
- contents: [
11
- {
12
- uri: `designsystem://tokens/${category}`,
13
- mimeType: 'application/json',
14
- text: JSON.stringify(
15
- {
16
- error: `Invalid category '${category}'`,
17
- available: categories,
18
- },
19
- null,
20
- 2
21
- ),
22
- },
23
- ],
24
- };
25
- }
26
-
27
- return {
28
- contents: [
29
- {
30
- uri: `designsystem://tokens/${category}`,
31
- mimeType: 'application/json',
32
- text: JSON.stringify(tokens[category], null, 2),
33
- },
34
- ],
35
- };
36
- };
@@ -1,2 +0,0 @@
1
- export { listCSSTokens } from './list.js';
2
- export { getCSSTokens } from './get.js';
@@ -1,42 +0,0 @@
1
- import { listCSSTokens } from './list.js';
2
- import { describe, expect, it } from 'vitest';
3
-
4
- describe('listCSSTokens resource', () => {
5
- it('should return contents with correct URI and mimeType', async () => {
6
- const result = await listCSSTokens();
7
-
8
- expect(result.contents).toBeDefined();
9
- expect(result.contents).toHaveLength(1);
10
- expect(result.contents[0].uri).toBe('designsystem://tokens');
11
- expect(result.contents[0].mimeType).toBe('application/json');
12
- });
13
-
14
- it('should return token categories as an object', async () => {
15
- const result = await listCSSTokens();
16
- const data = JSON.parse(result.contents[0].text);
17
-
18
- expect(typeof data).toBe('object');
19
- expect(data).not.toBeNull();
20
- });
21
-
22
- it('should include count property for each category', async () => {
23
- const result = await listCSSTokens();
24
- const data = JSON.parse(result.contents[0].text);
25
- const categories = Object.keys(data);
26
-
27
- expect(categories.length).toBeGreaterThan(0);
28
- categories.forEach((category) => {
29
- expect(data[category]).toHaveProperty('count');
30
- expect(typeof data[category].count).toBe('number');
31
- expect(data[category].count).toBeGreaterThan(0);
32
- });
33
- });
34
-
35
- it('should include color category', async () => {
36
- const result = await listCSSTokens();
37
- const data = JSON.parse(result.contents[0].text);
38
-
39
- expect(data).toHaveProperty('color');
40
- expect(data.color.count).toBeGreaterThan(0);
41
- });
42
- });
@@ -1,31 +0,0 @@
1
- import designTokens from '@triptease/stylesheet/tokens' with { type: 'json' };
2
- import { buildTokens } from '@/tools/getCSSTokens/utils.js';
3
-
4
- interface Summary {
5
- count: number;
6
- }
7
-
8
- interface SummaryMap {
9
- [category: string]: Summary;
10
- }
11
-
12
- export const listCSSTokens = async () => {
13
- const tokens = buildTokens(designTokens);
14
- const categories = Object.keys(tokens);
15
- const result: SummaryMap = {};
16
-
17
- for (const category of categories) {
18
- const tokenCount = tokens[category].length;
19
- result[category] = { count: tokenCount };
20
- }
21
-
22
- return {
23
- contents: [
24
- {
25
- uri: 'designsystem://tokens',
26
- mimeType: 'application/json',
27
- text: JSON.stringify(result, null, 2),
28
- },
29
- ],
30
- };
31
- };
@@ -1,78 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`getCSSTokens handler > should return all border tokens 1`] = `
4
- {
5
- "content": [
6
- {
7
- "text": "[{"token":"--border-radius","value":"0.5rem"}]",
8
- "type": "text",
9
- },
10
- ],
11
- }
12
- `;
13
-
14
- exports[`getCSSTokens handler > should return all border-radius tokens 1`] = `
15
- {
16
- "content": [
17
- {
18
- "text": "[{"token":"--border-radius-50","value":"0.25rem"},{"token":"--border-radius-100","value":"0.5rem"},{"token":"--border-radius-200","value":"1rem"}]",
19
- "type": "text",
20
- },
21
- ],
22
- }
23
- `;
24
-
25
- exports[`getCSSTokens handler > should return all box-shadows tokens 1`] = `
26
- {
27
- "content": [
28
- {
29
- "text": "[{"token":"--box-shadow-sm","value":"0px 2px 5px rgba(0, 0, 0, 0.1)"},{"token":"--box-shadow-lg","value":"0px 2px 20px rgba(0, 0, 0, 0.1)"},{"token":"--box-shadow-lg-hover","value":"0px 10px 20px rgba(0, 0, 0, 0.2)"}]",
30
- "type": "text",
31
- },
32
- ],
33
- }
34
- `;
35
-
36
- exports[`getCSSTokens handler > should return all color tokens 1`] = `
37
- {
38
- "content": [
39
- {
40
- "text": "[{"token":"--color-alert-100","value":"#FFD6D6"},{"token":"--color-alert-200","value":"#FF9999"},{"token":"--color-alert-300","value":"#F93939"},{"token":"--color-alert-400","value":"#DA0707"},{"token":"--color-alert-500","value":"#A80505"},{"token":"--color-alert-subtle","value":"#FFD8EB"},{"token":"--color-alert-strong","value":"#D02521"},{"token":"--color-border-100","value":"#E8EAEC"},{"token":"--color-border-200","value":"#E0E1E5"},{"token":"--color-border-300","value":"#D7D9DD"},{"token":"--color-border-400","value":"#C5C8CE"},{"token":"--color-border-500","value":"#B7BBC2"},{"token":"--color-text-100","value":"#FFFFFF"},{"token":"--color-text-200","value":"#B5B0B5"},{"token":"--color-text-300","value":"#575157"},{"token":"--color-text-400","value":"#3B353B"},{"token":"--color-text-500","value":"#0D0C0D"},{"token":"--color-text-inverted-100","value":"#0D0C0D"},{"token":"--color-text-inverted-200","value":"#77758A"},{"token":"--color-text-inverted-300","value":"#9D9CAB"},{"token":"--color-text-inverted-400","value":"#D3D3DA"},{"token":"--color-text-inverted-500","value":"#FFFFFF"},{"token":"--color-info-100","value":"#E5F3FF"},{"token":"--color-info-200","value":"#C2E3FF"},{"token":"--color-info-300","value":"#8FCBFF"},{"token":"--color-info-400","value":"#0B99FF"},{"token":"--color-info-500","value":"#007DD6"},{"token":"--color-info-subtle","value":"#F0F8FF"},{"token":"--color-info-strong","value":"#2475B9"},{"token":"--color-primary-100","value":"#F3F0FA"},{"token":"--color-primary-200","value":"#E8E3F6"},{"token":"--color-primary-300","value":"#CFC6ED"},{"token":"--color-primary-400","value":"#5E43C2"},{"token":"--color-primary-500","value":"#4D35A1"},{"token":"--color-success-100","value":"#E8F6E3"},{"token":"--color-success-200","value":"#C8E9BB"},{"token":"--color-success-300","value":"#A7DB93"},{"token":"--color-success-400","value":"#86D06D"},{"token":"--color-success-500","value":"#65C345"},{"token":"--color-success-subtle","value":"#DEF5D6"},{"token":"--color-success-strong","value":"#227D02"},{"token":"--color-surface-100","value":"#FFFFFF"},{"token":"--color-surface-200","value":"#F9FAFB"},{"token":"--color-surface-300","value":"#F1F2F4"},{"token":"--color-surface-400","value":"#E8EAEC"},{"token":"--color-surface-500","value":"#E0E1E5"},{"token":"--color-surface-600","value":"#D7D9DD"},{"token":"--color-surface-700","value":"#75767E"},{"token":"--color-surface-800","value":"#1C1B27"},{"token":"--color-surface-inverted-100","value":"#1C1B27"},{"token":"--color-surface-inverted-200","value":"#3A384D"},{"token":"--color-surface-inverted-300","value":"#5B5974"},{"token":"--color-surface-inverted-400","value":"#7F7D95"},{"token":"--color-surface-inverted-500","value":"#ACAABC"},{"token":"--color-warning-100","value":"#FFEDD6"},{"token":"--color-warning-200","value":"#FFE0B8"},{"token":"--color-warning-300","value":"#FFCE8F"},{"token":"--color-warning-400","value":"#FFB95E"},{"token":"--color-warning-500","value":"#FF9D1F"},{"token":"--color-warning-subtle","value":"#FFEDD6"},{"token":"--color-warning-strong","value":"#AC5500"}]",
41
- "type": "text",
42
- },
43
- ],
44
- }
45
- `;
46
-
47
- exports[`getCSSTokens handler > should return all font tokens 1`] = `
48
- {
49
- "content": [
50
- {
51
- "text": "[{"token":"--font-family-serif","value":"'Noe Text', 'PT Serif', serif"},{"token":"--font-family-sans","value":"'Roboto', sans-serif"},{"token":"--font-family-inter","value":"'Inter', 'Helvetica Neue', sans-serif"},{"token":"--font-line-height-100","value":"1.4"},{"token":"--font-line-height-200","value":"1.5"},{"token":"--font-line-height-300","value":"1.3"},{"token":"--font-line-height-400","value":"1.4"},{"token":"--font-line-height-500","value":"1.3"},{"token":"--font-line-height-600","value":"1.5"},{"token":"--font-size-100","value":"0.875rem"},{"token":"--font-size-200","value":"1rem"},{"token":"--font-size-300","value":"1.125rem"},{"token":"--font-size-400","value":"1.25rem"},{"token":"--font-size-500","value":"1.5rem"},{"token":"--font-size-600","value":"2rem"}]",
52
- "type": "text",
53
- },
54
- ],
55
- }
56
- `;
57
-
58
- exports[`getCSSTokens handler > should return all spacing tokens 1`] = `
59
- {
60
- "content": [
61
- {
62
- "text": "[{"token":"--space-scale-1","value":"0.5rem"},{"token":"--space-scale-2","value":"1rem"},{"token":"--space-scale-3","value":"1.5rem"},{"token":"--space-scale-4","value":"2.5rem"},{"token":"--space-scale-5","value":"3.5rem"},{"token":"--space-scale-6","value":"4.5rem"},{"token":"--space-scale-7","value":"5.5rem"},{"token":"--space-scale-8","value":"6.5rem"},{"token":"--space-scale-9","value":"7.5rem"},{"token":"--space-scale-10","value":"8.5rem"},{"token":"--space-scale-0-5","value":"0.25rem"},{"token":"--space-scale-1-5","value":"0.75rem"},{"token":"--space-scale-2-5","value":"1.25rem"},{"token":"--space-scale-3-5","value":"2rem"},{"token":"--space-scale-4-5","value":"3rem"},{"token":"--space-scale-5-5","value":"4rem"},{"token":"--space-scale-6-5","value":"5rem"},{"token":"--space-scale-7-5","value":"6rem"},{"token":"--space-scale-8-5","value":"7rem"},{"token":"--space-scale-9-5","value":"8rem"}]",
63
- "type": "text",
64
- },
65
- ],
66
- }
67
- `;
68
-
69
- exports[`getCSSTokens handler > should return error on invalid category 1`] = `
70
- {
71
- "content": [
72
- {
73
- "text": "{"error":"Invalid category 'doctorWhoIsTheBestShowInTheWorld'","available":["color","font","space","border","border-radius","box-shadow"]}",
74
- "type": "text",
75
- },
76
- ],
77
- }
78
- `;
@@ -1,39 +0,0 @@
1
- import handler from './handler.js';
2
- import { describe, expect, it } from 'vitest';
3
-
4
- describe('getCSSTokens handler', () => {
5
- it('should return all color tokens', () => {
6
- const result = handler({ category: 'color' });
7
- expect(result).toMatchSnapshot();
8
- });
9
-
10
- it('should return all spacing tokens', () => {
11
- const result = handler({ category: 'space' });
12
- expect(result).toMatchSnapshot();
13
- });
14
-
15
- it('should return all font tokens', () => {
16
- const result = handler({ category: 'font' });
17
- expect(result).toMatchSnapshot();
18
- });
19
-
20
- it('should return all box-shadows tokens', () => {
21
- const result = handler({ category: 'box-shadow' });
22
- expect(result).toMatchSnapshot();
23
- });
24
-
25
- it('should return all border tokens', () => {
26
- const result = handler({ category: 'border' });
27
- expect(result).toMatchSnapshot();
28
- });
29
-
30
- it('should return all border-radius tokens', () => {
31
- const result = handler({ category: 'border-radius' });
32
- expect(result).toMatchSnapshot();
33
- });
34
-
35
- it('should return error on invalid category', () => {
36
- const result = handler({ category: 'doctorWhoIsTheBestShowInTheWorld' });
37
- expect(result).toMatchSnapshot();
38
- });
39
- });
@@ -1,36 +0,0 @@
1
- import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
- import designTokens from '@triptease/stylesheet/tokens' with { type: 'json' };
3
- import { buildTokens } from '@/tools/getCSSTokens/utils.js';
4
-
5
- export interface GetDesignTokensArgs {
6
- category: string;
7
- }
8
-
9
- export default (args: GetDesignTokensArgs): CallToolResult => {
10
- const category = args.category;
11
- const tokens = buildTokens(designTokens);
12
-
13
- const categories = Object.keys(tokens);
14
- if (!categories.includes(category)) {
15
- return {
16
- content: [
17
- {
18
- type: 'text',
19
- text: JSON.stringify({
20
- error: `Invalid category '${category}'`,
21
- available: categories,
22
- }),
23
- },
24
- ],
25
- };
26
- }
27
-
28
- return {
29
- content: [
30
- {
31
- type: 'text',
32
- text: JSON.stringify(tokens[category]),
33
- },
34
- ],
35
- };
36
- };
@@ -1,15 +0,0 @@
1
- import handler from './handler.js';
2
- import { z } from 'zod';
3
-
4
- const toolDefinition = {
5
- name: 'get_css_tokens',
6
- config: {
7
- description: 'Returns the CSS tokens for a specific category.',
8
- inputSchema: {
9
- category: z.string().describe('Token category: one of the category names returned by the listCSSTokens tool.'),
10
- },
11
- },
12
- handler: handler,
13
- };
14
-
15
- export default toolDefinition;
@@ -1,31 +0,0 @@
1
- export interface TokenOutput {
2
- token: string;
3
- value: string;
4
- }
5
-
6
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
- const isDesignToken = (v: any): v is { value: string; path: string[] } => {
8
- return v && typeof v === 'object' && typeof v.value === 'string' && Array.isArray(v.path);
9
- };
10
-
11
- const processTokenGroup = (prefix: string[], group: object): TokenOutput[] => {
12
- return Object.entries(group).flatMap(([key, value]) => {
13
- if (isDesignToken(value)) {
14
- return { token: `--${[...prefix, key].join('-')}`, value: value.value };
15
- } else if (value && typeof value === 'object') {
16
- return processTokenGroup([...prefix, key], value);
17
- } else {
18
- return [];
19
- }
20
- });
21
- };
22
-
23
- export const buildTokens = (input: Record<string, object>): Record<string, TokenOutput[]> => {
24
- const result: Record<string, TokenOutput[]> = {};
25
-
26
- for (const category of Object.keys(input).filter((category) => category !== 'asset')) {
27
- result[category] = processTokenGroup([category], input[category]);
28
- }
29
-
30
- return result;
31
- };
@@ -1,23 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`getComponentDocs handler > should return not found if the provided component does not exist in the manifest 1`] = `
4
- {
5
- "content": [
6
- {
7
- "text": "{"error":"Component 'foo' not found","available":["button","textinput","numberinput","textarea","select","checkbox","radio","toggle","badge","card","table","typography","dialog","combobox","date-picker","date-range-picker","bar-chart","line-chart","statistic","banner"]}",
8
- "type": "text",
9
- },
10
- ],
11
- }
12
- `;
13
-
14
- exports[`getComponentDocs handler > should return with the manifest entry if the component exists 1`] = `
15
- {
16
- "content": [
17
- {
18
- "text": "{"name":"Button","description":"Interactive button component with multiple themes and states","element":"button","usageGuidance":{"whenToUse":["Submitting forms","Triggering actions (save, delete, confirm)","Opening modals or dialogs","Navigation to a new page or state"],"avoid":["For navigation to external pages (use links instead)","To display non-interactive information (use text or badges)"]},"dataAttributes":{"data-theme":{"type":"enum","values":["primary","secondary","tertiary","suggestion","inline","destructive-primary","destructive-secondary","destructive-tertiary"],"default":"primary","description":"Visual theme of the button. Use primary for main actions, secondary for supporting actions, tertiary for minimal emphasis. Use destructive themes for actions that cannot be undone (delete, remove). All themes work with disabled and data-loading attributes."},"data-loading":{"type":"boolean","values":["true",null],"description":"Shows loading spinner. Always pair with aria-busy for accessibility."}},"classes":{"small":"Smaller button size for compact interfaces","large":"Larger button size for emphasis"},"attributes":{"disabled":{"type":"boolean","description":"Disables the button. Pair with aria-disabled for accessibility."}},"states":["default","hover","focus","disabled","loading"],"examples":[{"title":"Basic usage","code":"<button>Click Me</button>"}]}",
19
- "type": "text",
20
- },
21
- ],
22
- }
23
- `;
@@ -1,14 +0,0 @@
1
- import handler from './handler.js';
2
- import { describe, expect, it } from 'vitest';
3
-
4
- describe('getComponentDocs handler', () => {
5
- it('should return not found if the provided component does not exist in the manifest', () => {
6
- const result = handler({ component: 'foo' });
7
- expect(result).toMatchSnapshot();
8
- });
9
-
10
- it('should return with the manifest entry if the component exists', () => {
11
- const result = handler({ component: 'button' });
12
- expect(result).toMatchSnapshot();
13
- });
14
- });
@@ -1,34 +0,0 @@
1
- import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
- import { componentManifest } from '@/manifests/components/index.js';
3
-
4
- export interface GetComponentDocsArgs {
5
- component: string;
6
- }
7
-
8
- export default (args: GetComponentDocsArgs): CallToolResult => {
9
- const componentName = args.component.toLowerCase();
10
- const component = componentManifest[componentName];
11
-
12
- if (!component) {
13
- return {
14
- content: [
15
- {
16
- type: 'text',
17
- text: JSON.stringify({
18
- error: `Component '${componentName}' not found`,
19
- available: Object.keys(componentManifest),
20
- }),
21
- },
22
- ],
23
- };
24
- }
25
-
26
- return {
27
- content: [
28
- {
29
- type: 'text',
30
- text: JSON.stringify(component),
31
- },
32
- ],
33
- };
34
- };
@@ -1,15 +0,0 @@
1
- import { z } from 'zod';
2
- import handler from './handler.js';
3
-
4
- const toolDefinition = {
5
- name: 'get_component_docs',
6
- config: {
7
- description: 'Get documentation for a design system component (button, input, badge, checkbox, card, etc.)',
8
- inputSchema: {
9
- component: z.string().describe("Component name (e.g., 'button', 'input', 'badge')"),
10
- },
11
- },
12
- handler,
13
- };
14
-
15
- export default toolDefinition;
@@ -1,34 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`getSetupGuide handler > should return a specific guide when type is provided 1`] = `
4
- {
5
- "content": [
6
- {
7
- "text": "{"error":"Setup guide 'foo' not found","available":[{"key":"npm","name":"NPM Stylesheet Setup","description":"Setup instructions for using the stylesheet package via npm."},{"key":"cdn","name":"CDN Stylesheet Setup","description":"Setup instructions for using the stylesheet via CDN."}]}",
8
- "type": "text",
9
- },
10
- ],
11
- }
12
- `;
13
-
14
- exports[`getSetupGuide handler > should return all setup guides if no type is given 1`] = `
15
- {
16
- "content": [
17
- {
18
- "text": "{"message":"Multiple setup options available. Choose based on user preference or project requirements.","options":[{"type":"npm","name":"NPM Stylesheet Setup","description":"Setup instructions for using the stylesheet package via npm.","guide":{"name":"NPM Stylesheet Setup","description":"Setup instructions for using the stylesheet package via npm.","steps":[{"title":"Install the stylesheet package","description":"Choose your package manager:","code":"# NPM\\nnpm install @triptease/stylesheet\\n\\n# Yarn\\nyarn add @triptease/stylesheet\\n\\n# Bun\\nbun add @triptease/stylesheet","language":"bash"},{"title":"Import the stylesheet","description":"Add this import to your application entry point:","code":"import '@triptease/stylesheet';","language":"typescript"}],"notes":["Current version: @triptease/stylesheet@1.4.7"]}},{"type":"cdn","name":"CDN Stylesheet Setup","description":"Setup instructions for using the stylesheet via CDN.","guide":{"name":"CDN Stylesheet Setup","description":"Setup instructions for using the stylesheet via CDN.","steps":[{"title":"Add stylesheet link to HTML","description":"Include this in the <head> of your HTML document:","code":"<head>\\n <!-- Specific version (recommended) -->\\n <link rel=\\"stylesheet\\" href=\\"https://cdn.design-system.triptease.io/1.4.7/triptease.css\\">\\n\\n <!-- Or, latest version (dangerous - breaking changes may occur) -->\\n <link rel=\\"stylesheet\\" href=\\"https://cdn.design-system.triptease.io/triptease.css\\">\\n</head>","language":"html"}]}}]}",
19
- "type": "text",
20
- },
21
- ],
22
- }
23
- `;
24
-
25
- exports[`getSetupGuide handler > should return an error for an invalid type 1`] = `
26
- {
27
- "content": [
28
- {
29
- "text": "{"error":"Setup guide 'invalidtype' not found","available":[{"key":"npm","name":"NPM Stylesheet Setup","description":"Setup instructions for using the stylesheet package via npm."},{"key":"cdn","name":"CDN Stylesheet Setup","description":"Setup instructions for using the stylesheet via CDN."}]}",
30
- "type": "text",
31
- },
32
- ],
33
- }
34
- `;
@@ -1,20 +0,0 @@
1
- import handler from './handler.js';
2
- import { describe, it, expect } from 'vitest';
3
-
4
- describe('getSetupGuide handler', () => {
5
- it('should return all setup guides if no type is given', () => {
6
- const result = handler({});
7
- expect(result).toMatchSnapshot();
8
- });
9
-
10
- it('should return a specific guide when type is provided', () => {
11
- const type = 'foo';
12
- const result = handler({ type });
13
- expect(result).toMatchSnapshot();
14
- });
15
-
16
- it('should return an error for an invalid type', () => {
17
- const result = handler({ type: 'invalidType' });
18
- expect(result).toMatchSnapshot();
19
- });
20
- });
@@ -1,59 +0,0 @@
1
- import { setupGuides } from './setupGuides.js';
2
- import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
3
-
4
- export interface GetSetupGuideArgs {
5
- type?: string;
6
- }
7
-
8
- export default (args: GetSetupGuideArgs): CallToolResult => {
9
- if (!args.type) {
10
- const allGuides = Object.entries(setupGuides).map(([key, guide]) => ({
11
- type: key,
12
- name: guide.name,
13
- description: guide.description,
14
- guide,
15
- }));
16
-
17
- return {
18
- content: [
19
- {
20
- type: 'text',
21
- text: JSON.stringify({
22
- message: 'Multiple setup options available. Choose based on user preference or project requirements.',
23
- options: allGuides,
24
- }),
25
- },
26
- ],
27
- };
28
- }
29
-
30
- const guideType = args.type.toLowerCase();
31
- const guide = setupGuides[guideType];
32
-
33
- if (!guide) {
34
- return {
35
- content: [
36
- {
37
- type: 'text',
38
- text: JSON.stringify({
39
- error: `Setup guide '${guideType}' not found`,
40
- available: Object.keys(setupGuides).map((key) => ({
41
- key,
42
- name: setupGuides[key].name,
43
- description: setupGuides[key].description,
44
- })),
45
- }),
46
- },
47
- ],
48
- };
49
- }
50
-
51
- return {
52
- content: [
53
- {
54
- type: 'text',
55
- text: JSON.stringify(guide, null, 2),
56
- },
57
- ],
58
- };
59
- };