@triptease/design-system-mcp 0.0.3

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 (162) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +340 -0
  3. package/dist/package.json +41 -0
  4. package/dist/src/index.d.ts +2 -0
  5. package/dist/src/index.js +39 -0
  6. package/dist/src/index.js.map +1 -0
  7. package/dist/src/manifests/components/entries/badge.d.ts +27 -0
  8. package/dist/src/manifests/components/entries/badge.js +43 -0
  9. package/dist/src/manifests/components/entries/badge.js.map +1 -0
  10. package/dist/src/manifests/components/entries/barChart.d.ts +73 -0
  11. package/dist/src/manifests/components/entries/barChart.js +125 -0
  12. package/dist/src/manifests/components/entries/barChart.js.map +1 -0
  13. package/dist/src/manifests/components/entries/button.d.ts +40 -0
  14. package/dist/src/manifests/components/entries/button.js +59 -0
  15. package/dist/src/manifests/components/entries/button.js.map +1 -0
  16. package/dist/src/manifests/components/entries/card.d.ts +20 -0
  17. package/dist/src/manifests/components/entries/card.js +34 -0
  18. package/dist/src/manifests/components/entries/card.js.map +1 -0
  19. package/dist/src/manifests/components/entries/checkbox.d.ts +31 -0
  20. package/dist/src/manifests/components/entries/checkbox.js +64 -0
  21. package/dist/src/manifests/components/entries/checkbox.js.map +1 -0
  22. package/dist/src/manifests/components/entries/combobox.d.ts +64 -0
  23. package/dist/src/manifests/components/entries/combobox.js +176 -0
  24. package/dist/src/manifests/components/entries/combobox.js.map +1 -0
  25. package/dist/src/manifests/components/entries/datePicker.d.ts +34 -0
  26. package/dist/src/manifests/components/entries/datePicker.js +67 -0
  27. package/dist/src/manifests/components/entries/datePicker.js.map +1 -0
  28. package/dist/src/manifests/components/entries/dateRangePicker.d.ts +34 -0
  29. package/dist/src/manifests/components/entries/dateRangePicker.js +110 -0
  30. package/dist/src/manifests/components/entries/dateRangePicker.js.map +1 -0
  31. package/dist/src/manifests/components/entries/dialog.d.ts +38 -0
  32. package/dist/src/manifests/components/entries/dialog.js +73 -0
  33. package/dist/src/manifests/components/entries/dialog.js.map +1 -0
  34. package/dist/src/manifests/components/entries/lineChart.d.ts +76 -0
  35. package/dist/src/manifests/components/entries/lineChart.js +141 -0
  36. package/dist/src/manifests/components/entries/lineChart.js.map +1 -0
  37. package/dist/src/manifests/components/entries/numberinput.d.ts +52 -0
  38. package/dist/src/manifests/components/entries/numberinput.js +64 -0
  39. package/dist/src/manifests/components/entries/numberinput.js.map +1 -0
  40. package/dist/src/manifests/components/entries/radio.d.ts +31 -0
  41. package/dist/src/manifests/components/entries/radio.js +50 -0
  42. package/dist/src/manifests/components/entries/radio.js.map +1 -0
  43. package/dist/src/manifests/components/entries/select.d.ts +16 -0
  44. package/dist/src/manifests/components/entries/select.js +23 -0
  45. package/dist/src/manifests/components/entries/select.js.map +1 -0
  46. package/dist/src/manifests/components/entries/table.d.ts +16 -0
  47. package/dist/src/manifests/components/entries/table.js +43 -0
  48. package/dist/src/manifests/components/entries/table.js.map +1 -0
  49. package/dist/src/manifests/components/entries/textarea.d.ts +40 -0
  50. package/dist/src/manifests/components/entries/textarea.js +54 -0
  51. package/dist/src/manifests/components/entries/textarea.js.map +1 -0
  52. package/dist/src/manifests/components/entries/textinput.d.ts +40 -0
  53. package/dist/src/manifests/components/entries/textinput.js +53 -0
  54. package/dist/src/manifests/components/entries/textinput.js.map +1 -0
  55. package/dist/src/manifests/components/entries/toggle.d.ts +23 -0
  56. package/dist/src/manifests/components/entries/toggle.js +30 -0
  57. package/dist/src/manifests/components/entries/toggle.js.map +1 -0
  58. package/dist/src/manifests/components/entries/typography.d.ts +23 -0
  59. package/dist/src/manifests/components/entries/typography.js +32 -0
  60. package/dist/src/manifests/components/entries/typography.js.map +1 -0
  61. package/dist/src/manifests/components/index.d.ts +2 -0
  62. package/dist/src/manifests/components/index.js +39 -0
  63. package/dist/src/manifests/components/index.js.map +1 -0
  64. package/dist/src/manifests/components/types.d.ts +56 -0
  65. package/dist/src/manifests/components/types.js +2 -0
  66. package/dist/src/manifests/components/types.js.map +1 -0
  67. package/dist/src/tools/getCSSTokens/handler.d.ts +6 -0
  68. package/dist/src/tools/getCSSTokens/handler.js +29 -0
  69. package/dist/src/tools/getCSSTokens/handler.js.map +1 -0
  70. package/dist/src/tools/getCSSTokens/index.d.ts +12 -0
  71. package/dist/src/tools/getCSSTokens/index.js +14 -0
  72. package/dist/src/tools/getCSSTokens/index.js.map +1 -0
  73. package/dist/src/tools/getCSSTokens/utils.d.ts +5 -0
  74. package/dist/src/tools/getCSSTokens/utils.js +25 -0
  75. package/dist/src/tools/getCSSTokens/utils.js.map +1 -0
  76. package/dist/src/tools/getComponentDocs/handler.d.ts +6 -0
  77. package/dist/src/tools/getComponentDocs/handler.js +27 -0
  78. package/dist/src/tools/getComponentDocs/handler.js.map +1 -0
  79. package/dist/src/tools/getComponentDocs/index.d.ts +12 -0
  80. package/dist/src/tools/getComponentDocs/index.js +14 -0
  81. package/dist/src/tools/getComponentDocs/index.js.map +1 -0
  82. package/dist/src/tools/getSetupGuide/handler.d.ts +6 -0
  83. package/dist/src/tools/getSetupGuide/handler.js +50 -0
  84. package/dist/src/tools/getSetupGuide/handler.js.map +1 -0
  85. package/dist/src/tools/getSetupGuide/index.d.ts +12 -0
  86. package/dist/src/tools/getSetupGuide/index.js +17 -0
  87. package/dist/src/tools/getSetupGuide/index.js.map +1 -0
  88. package/dist/src/tools/getSetupGuide/setupGuides.d.ts +12 -0
  89. package/dist/src/tools/getSetupGuide/setupGuides.js +49 -0
  90. package/dist/src/tools/getSetupGuide/setupGuides.js.map +1 -0
  91. package/dist/src/tools/listCSSTokens/handler.d.ts +3 -0
  92. package/dist/src/tools/listCSSTokens/handler.js +20 -0
  93. package/dist/src/tools/listCSSTokens/handler.js.map +1 -0
  94. package/dist/src/tools/listCSSTokens/index.d.ts +8 -0
  95. package/dist/src/tools/listCSSTokens/index.js +10 -0
  96. package/dist/src/tools/listCSSTokens/index.js.map +1 -0
  97. package/dist/src/tools/listComponents/handler.d.ts +3 -0
  98. package/dist/src/tools/listComponents/handler.js +18 -0
  99. package/dist/src/tools/listComponents/handler.js.map +1 -0
  100. package/dist/src/tools/listComponents/index.d.ts +9 -0
  101. package/dist/src/tools/listComponents/index.js +11 -0
  102. package/dist/src/tools/listComponents/index.js.map +1 -0
  103. package/dist/src/tools/searchComponents/handler.d.ts +6 -0
  104. package/dist/src/tools/searchComponents/handler.js +29 -0
  105. package/dist/src/tools/searchComponents/handler.js.map +1 -0
  106. package/dist/src/tools/searchComponents/index.d.ts +12 -0
  107. package/dist/src/tools/searchComponents/index.js +14 -0
  108. package/dist/src/tools/searchComponents/index.js.map +1 -0
  109. package/dist/src/utils/buildCDNUrls.d.ts +3 -0
  110. package/dist/src/utils/buildCDNUrls.js +6 -0
  111. package/dist/src/utils/buildCDNUrls.js.map +1 -0
  112. package/package.json +43 -0
  113. package/src/index.ts +46 -0
  114. package/src/manifests/components/entries/badge.ts +45 -0
  115. package/src/manifests/components/entries/barChart.ts +132 -0
  116. package/src/manifests/components/entries/button.ts +61 -0
  117. package/src/manifests/components/entries/card.ts +35 -0
  118. package/src/manifests/components/entries/checkbox.ts +68 -0
  119. package/src/manifests/components/entries/combobox.ts +184 -0
  120. package/src/manifests/components/entries/datePicker.ts +73 -0
  121. package/src/manifests/components/entries/dateRangePicker.ts +118 -0
  122. package/src/manifests/components/entries/dialog.ts +77 -0
  123. package/src/manifests/components/entries/lineChart.ts +150 -0
  124. package/src/manifests/components/entries/numberinput.ts +66 -0
  125. package/src/manifests/components/entries/radio.ts +53 -0
  126. package/src/manifests/components/entries/select.ts +24 -0
  127. package/src/manifests/components/entries/table.ts +44 -0
  128. package/src/manifests/components/entries/textarea.ts +56 -0
  129. package/src/manifests/components/entries/textinput.ts +55 -0
  130. package/src/manifests/components/entries/toggle.ts +31 -0
  131. package/src/manifests/components/entries/typography.ts +33 -0
  132. package/src/manifests/components/index.ts +41 -0
  133. package/src/manifests/components/types.ts +64 -0
  134. package/src/tools/getCSSTokens/__snapshots__/handler.test.ts.snap +78 -0
  135. package/src/tools/getCSSTokens/handler.test.ts +39 -0
  136. package/src/tools/getCSSTokens/handler.ts +36 -0
  137. package/src/tools/getCSSTokens/index.ts +15 -0
  138. package/src/tools/getCSSTokens/utils.ts +31 -0
  139. package/src/tools/getComponentDocs/__snapshots__/handler.test.ts.snap +23 -0
  140. package/src/tools/getComponentDocs/handler.test.ts +14 -0
  141. package/src/tools/getComponentDocs/handler.ts +34 -0
  142. package/src/tools/getComponentDocs/index.ts +15 -0
  143. package/src/tools/getSetupGuide/__snapshots__/handler.test.ts.snap +34 -0
  144. package/src/tools/getSetupGuide/handler.test.ts +20 -0
  145. package/src/tools/getSetupGuide/handler.ts +59 -0
  146. package/src/tools/getSetupGuide/index.ts +20 -0
  147. package/src/tools/getSetupGuide/setupGuides.ts +62 -0
  148. package/src/tools/listCSSTokens/__snapshots__/handler.test.ts.snap +12 -0
  149. package/src/tools/listCSSTokens/handler.test.ts +9 -0
  150. package/src/tools/listCSSTokens/handler.ts +32 -0
  151. package/src/tools/listCSSTokens/index.ts +12 -0
  152. package/src/tools/listComponents/__snapshots__/handler.test.ts.snap +12 -0
  153. package/src/tools/listComponents/handler.test.ts +9 -0
  154. package/src/tools/listComponents/handler.ts +20 -0
  155. package/src/tools/listComponents/index.ts +12 -0
  156. package/src/tools/searchComponents/__snapshots__/handler.test.ts.snap +23 -0
  157. package/src/tools/searchComponents/handler.test.ts +14 -0
  158. package/src/tools/searchComponents/handler.ts +36 -0
  159. package/src/tools/searchComponents/index.ts +15 -0
  160. package/src/utils/buildCDNUrls.ts +7 -0
  161. package/tsconfig.json +12 -0
  162. package/vitest.config.ts +6 -0
@@ -0,0 +1,132 @@
1
+ import { ComponentManifest } from '@/manifests/components/types.js';
2
+ import { buildCDNUrl, buildMajorVersion } from '@/utils/buildCDNUrls.js';
3
+ import packageJson from '@/../package.json' with { type: 'json' };
4
+
5
+ const latestBarChartVersion = packageJson.dependencies['@triptease/tt-bar-chart'];
6
+ const latestDatasetVersion = packageJson.dependencies['@triptease/tt-dataset'];
7
+ const latestDataPointVersion = packageJson.dependencies['@triptease/tt-data-point'];
8
+
9
+ export default {
10
+ 'bar-chart': {
11
+ name: 'Bar Chart - Web Component',
12
+ description: 'Bar chart for comparing values across categories',
13
+ ssrSafe: true,
14
+ element: 'tt-bar-chart',
15
+ usageGuidance: {
16
+ whenToUse: [
17
+ 'To compare size between two or more categories',
18
+ 'To show values that can be ranked in ascending or descending order',
19
+ 'To show short, discrete periods of time, when comparing individual periods matters more than showing a long-term trend',
20
+ 'To compare multiple datasets (series) across the same categories',
21
+ ],
22
+ avoid: [
23
+ 'When the number of datapoints makes the chart hard to read',
24
+ 'When showing long, continuous trends over time (use a line or area chart instead)',
25
+ 'When the user can expand the date range to very large periods, making bars inappropriate',
26
+ ],
27
+ },
28
+ installation: {
29
+ npm: [
30
+ { name: '@triptease/tt-bar-chart', includesTypes: true, optional: false },
31
+ { name: '@triptease/tt-dataset', includesTypes: true, optional: false },
32
+ { name: '@triptease/tt-data-point', includesTypes: true, optional: false },
33
+ { name: '@triptease/tt-highlight', includesTypes: true, optional: true },
34
+ ],
35
+ cdn: [
36
+ {
37
+ name: 'tt-bar-chart',
38
+ includesTypes: false,
39
+ optional: false,
40
+ pinnedVersionUrl: buildCDNUrl('tt-bar-chart', latestBarChartVersion),
41
+ pinnedMajorVersionUrl: buildCDNUrl('tt-bar-chart', buildMajorVersion(latestBarChartVersion)),
42
+ latestVersionUrl: buildCDNUrl('tt-bar-chart', 'latest'),
43
+ guidance:
44
+ 'Prefer pinned major version URL to avoid breaking changes. Do not use latest version URL in production code.',
45
+ },
46
+ {
47
+ name: 'tt-dataset',
48
+ includesTypes: false,
49
+ optional: false,
50
+ pinnedVersionUrl: buildCDNUrl('tt-dataset', latestDatasetVersion),
51
+ pinnedMajorVersionUrl: buildCDNUrl('tt-dataset', buildMajorVersion(latestDatasetVersion)),
52
+ latestVersionUrl: buildCDNUrl('tt-dataset', 'latest'),
53
+ guidance:
54
+ 'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
55
+ },
56
+ {
57
+ name: 'tt-data-point',
58
+ includesTypes: false,
59
+ optional: false,
60
+ pinnedVersionUrl: buildCDNUrl('tt-data-point', latestDataPointVersion),
61
+ pinnedMajorVersionUrl: buildCDNUrl('tt-data-point', buildMajorVersion(latestDataPointVersion)),
62
+ latestVersionUrl: buildCDNUrl('tt-data-point', 'latest'),
63
+ guidance:
64
+ 'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
65
+ },
66
+ ],
67
+ },
68
+ attributes: {
69
+ width: {
70
+ type: 'string',
71
+ description: 'Width of chart (any CSS value). Defaults to 100% to fill container.',
72
+ },
73
+ height: {
74
+ type: 'string',
75
+ description: 'Height of chart (any CSS value). Defaults to 100% to fill container.',
76
+ },
77
+ 'x-axis-title': {
78
+ type: 'string',
79
+ description: 'Title for x-axis. Use to clarify units of measurement. Keep concise.',
80
+ },
81
+ 'y-axis-title': {
82
+ type: 'string',
83
+ description: 'Title for y-axis. Use to clarify units of measurement. Keep concise.',
84
+ },
85
+ direction: {
86
+ type: 'enum',
87
+ values: ['horizontal', 'vertical'],
88
+ description: 'Bar orientation. Use vertical for time series data.',
89
+ },
90
+ stacked: {
91
+ type: 'boolean',
92
+ description:
93
+ 'Stack datasets vertically. Use when datasets contribute to meaningful total. Limit to 6 datasets max.',
94
+ },
95
+ loading: {
96
+ type: 'boolean',
97
+ description: 'Show loading state while data fetches. Component handles aria-busy automatically.',
98
+ },
99
+ },
100
+ examples: [
101
+ {
102
+ title: 'Basic bar chart',
103
+ code: `import '@triptease/tt-bar-chart';
104
+ import '@triptease/tt-dataset';
105
+ import '@triptease/tt-data-point';
106
+
107
+ <tt-bar-chart id="basic-chart">
108
+ <tt-dataset label="2024">
109
+ <tt-data-point label="Total Opens" value={2600}></tt-data-point>
110
+ <tt-data-point label="Total Clicks" value={355}></tt-data-point>
111
+ <tt-data-point label="Bookings" value={76}></tt-data-point>
112
+ </tt-dataset>
113
+ </tt-bar-chart>`,
114
+ },
115
+ {
116
+ title: 'Multiple datasets',
117
+ description:
118
+ 'Use multiple datasets to compare the same categories across different groups or time periods. Limit datasets to a maximum of 6, as more datasets make the chart difficult to read and compare.',
119
+ code: `<tt-bar-chart id="multiple-datasets-chart" height="30rem">
120
+ <tt-dataset label="2024">
121
+ <tt-data-point label="Total Bookings" value={7}></tt-data-point>
122
+ <tt-data-point label="Total Clicks" value={4}></tt-data-point>
123
+ </tt-dataset>
124
+ <tt-dataset label="2025">
125
+ <tt-data-point label="Total Bookings" value={2}></tt-data-point>
126
+ <tt-data-point label="Total Clicks" value={3}></tt-data-point>
127
+ </tt-dataset>
128
+ </tt-bar-chart>`,
129
+ },
130
+ ],
131
+ },
132
+ } satisfies ComponentManifest;
@@ -0,0 +1,61 @@
1
+ import type { ComponentManifest } from '@/manifests/components/types.js';
2
+
3
+ export default {
4
+ button: {
5
+ name: 'Button',
6
+ description: 'Interactive button component with multiple themes and states',
7
+ element: 'button',
8
+ usageGuidance: {
9
+ whenToUse: [
10
+ 'Submitting forms',
11
+ 'Triggering actions (save, delete, confirm)',
12
+ 'Opening modals or dialogs',
13
+ 'Navigation to a new page or state',
14
+ ],
15
+ avoid: [
16
+ 'For navigation to external pages (use links instead)',
17
+ 'To display non-interactive information (use text or badges)',
18
+ ],
19
+ },
20
+ dataAttributes: {
21
+ 'data-theme': {
22
+ type: 'enum',
23
+ values: [
24
+ 'primary',
25
+ 'secondary',
26
+ 'tertiary',
27
+ 'suggestion',
28
+ 'inline',
29
+ 'destructive-primary',
30
+ 'destructive-secondary',
31
+ 'destructive-tertiary',
32
+ ],
33
+ default: 'primary',
34
+ description:
35
+ '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.',
36
+ },
37
+ 'data-loading': {
38
+ type: 'boolean',
39
+ values: ['true', undefined],
40
+ description: 'Shows loading spinner. Always pair with aria-busy for accessibility.',
41
+ },
42
+ },
43
+ classes: {
44
+ small: 'Smaller button size for compact interfaces',
45
+ large: 'Larger button size for emphasis',
46
+ },
47
+ attributes: {
48
+ disabled: {
49
+ type: 'boolean',
50
+ description: 'Disables the button. Pair with aria-disabled for accessibility.',
51
+ },
52
+ },
53
+ states: ['default', 'hover', 'focus', 'disabled', 'loading'],
54
+ examples: [
55
+ {
56
+ title: 'Basic usage',
57
+ code: `<button>Click Me</button>`,
58
+ },
59
+ ],
60
+ },
61
+ } satisfies ComponentManifest;
@@ -0,0 +1,35 @@
1
+ import { ComponentManifest } from '@/manifests/components/types.js';
2
+
3
+ export default {
4
+ card: {
5
+ name: 'Card',
6
+ description: 'Container component that groups related content and actions in a visually distinct area',
7
+ element: 'div',
8
+ usageGuidance: {
9
+ whenToUse: [
10
+ 'Display related information as a single unit',
11
+ 'Create scannable layouts with multiple content items',
12
+ 'Group content with associated actions',
13
+ 'Highlight content that users can interact with',
14
+ ],
15
+ avoid: [
16
+ 'For single pieces of text (use standard layout instead)',
17
+ "When visual separation isn't needed",
18
+ 'In dense data tables or lists',
19
+ ],
20
+ },
21
+ classes: {
22
+ card: 'Standard card with padding',
23
+ 'card-dataview': 'Card optimized for displaying metrics/data',
24
+ },
25
+ examples: [
26
+ {
27
+ title: 'Basic card',
28
+ code: `<div class="card">
29
+ <h3>Card Title</h3>
30
+ <p>Card content goes here...</p>
31
+ </div>`,
32
+ },
33
+ ],
34
+ },
35
+ } satisfies ComponentManifest;
@@ -0,0 +1,68 @@
1
+ import { ComponentManifest } from '@/manifests/components/types.js';
2
+
3
+ export default {
4
+ checkbox: {
5
+ name: 'Checkbox',
6
+ description: 'Checkbox input for multiple selections',
7
+ element: "input[type='checkbox']",
8
+ usageGuidance: {
9
+ whenToUse: [
10
+ 'Multiple independent choices can be selected',
11
+ 'Turning a single option on or off',
12
+ 'Selecting items from a list (e.g., filters, preferences)',
13
+ 'Accepting terms and conditions',
14
+ ],
15
+ avoid: [
16
+ 'Only one option can be selected (use radio buttons)',
17
+ 'Immediate action is expected (use toggle switch)',
18
+ 'Very long lists (consider combobox with multi-select or grouping options)',
19
+ ],
20
+ },
21
+ attributes: {
22
+ disabled: {
23
+ type: 'boolean',
24
+ description:
25
+ 'Disables the checkbox. Can be applied to individual inputs or to parent fieldset to disable all checkboxes.',
26
+ },
27
+ 'aria-invalid': {
28
+ type: 'boolean',
29
+ description:
30
+ 'Marks checkbox as invalid for error styling. Pair with aria-describedby to associate error messages.',
31
+ },
32
+ checked: {
33
+ type: 'boolean',
34
+ description: 'Marks checkbox as checked by default',
35
+ },
36
+ },
37
+ examples: [
38
+ {
39
+ title: 'Checkbox group',
40
+ description: 'Use fieldset and legend for grouped checkboxes',
41
+ code: `<fieldset>
42
+ <legend>Choose colors:</legend>
43
+ <input type="checkbox" id="checkbox-red" name="color" value="red" />
44
+ <label for="checkbox-red">Red</label>
45
+ <input type="checkbox" id="checkbox-green" name="color" value="green" />
46
+ <label for="checkbox-green">Green</label>
47
+ <input type="checkbox" id="checkbox-blue" name="color" value="blue" />
48
+ <label for="checkbox-blue">Blue</label>
49
+ </fieldset>`,
50
+ },
51
+ {
52
+ title: 'Error state',
53
+ description:
54
+ 'Use aria-invalid with aria-describedby to associate error messages. Apply to all checkboxes in the group and provide a single error message.',
55
+ code: `<fieldset>
56
+ <legend>Choose colors:</legend>
57
+ <input type="checkbox" id="checkbox-red" name="color" value="red" aria-invalid aria-describedby="choose-color-error-message" />
58
+ <label for="checkbox-red">Red</label>
59
+ <input type="checkbox" id="checkbox-green" name="color" value="green" aria-invalid aria-describedby="choose-color-error-message" />
60
+ <label for="checkbox-green">Green</label>
61
+ <input type="checkbox" id="checkbox-blue" name="color" value="blue" aria-invalid aria-describedby="choose-color-error-message" />
62
+ <label for="checkbox-blue">Blue</label>
63
+ <p id="choose-color-error-message" class="text-error">Please select at least one color</p>
64
+ </fieldset>`,
65
+ },
66
+ ],
67
+ },
68
+ } satisfies ComponentManifest;
@@ -0,0 +1,184 @@
1
+ import { ComponentManifest } from '@/manifests/components/types.js';
2
+ import { buildCDNUrl, buildMajorVersion } from '@/utils/buildCDNUrls.js';
3
+ import packageJson from '@/../package.json' with { type: 'json' };
4
+
5
+ const version = packageJson.dependencies['@triptease/tt-combobox'];
6
+
7
+ export default {
8
+ combobox: {
9
+ name: 'Combobox',
10
+ description:
11
+ 'Searchable dropdown that combines a text input with a list, available as both React component and Web Component',
12
+ ssrSafe: true,
13
+ element: 'Combobox (React) / tt-combobox (Web Component)',
14
+ usageGuidance: {
15
+ whenToUse: [
16
+ 'Lists with many options where typing to filter is helpful',
17
+ 'Users need to search/filter through options quickly',
18
+ 'Space is limited for displaying all options at once',
19
+ 'Single or multiple selection needed',
20
+ ],
21
+ avoid: [
22
+ 'Small lists where all options should be visible (consider radio buttons)',
23
+ 'Users would benefit from seeing all options simultaneously for comparison',
24
+ ],
25
+ },
26
+ installation: {
27
+ npm: [{ name: '@triptease/tt-combobox', includesTypes: true, optional: false }],
28
+ cdn: [
29
+ {
30
+ name: '@triptease/tt-combobox',
31
+ includesTypes: false,
32
+ optional: false,
33
+ latestVersionUrl: buildCDNUrl('tt-combobox', 'latest'),
34
+ pinnedMajorVersionUrl: buildCDNUrl('tt-combobox', buildMajorVersion(version)),
35
+ pinnedVersionUrl: buildCDNUrl('tt-combobox', version),
36
+ guidance:
37
+ 'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
38
+ },
39
+ ],
40
+ },
41
+ attributes: {
42
+ multiselect: {
43
+ type: 'boolean',
44
+ description:
45
+ 'Enable multi-select mode where multiple options can be selected. Value is array of strings, serialized as JSON in forms.',
46
+ },
47
+ 'display-select-all': {
48
+ type: 'boolean',
49
+ description: 'Show a "Select All" option in multi-select mode. Only valid when multiselect is true.',
50
+ },
51
+ placeholder: {
52
+ type: 'string',
53
+ description: 'Placeholder text shown when no option is selected.',
54
+ },
55
+ disabled: {
56
+ type: 'boolean',
57
+ description: 'Disable the combobox. Use disabled attribute on option elements to disable specific options.',
58
+ },
59
+ invalid: {
60
+ type: 'boolean',
61
+ description: 'Mark the combobox as invalid for validation. Use with error slot to display error message.',
62
+ },
63
+ 'open-upward': {
64
+ type: 'boolean',
65
+ description: 'Make the dropdown open upward instead of downward. Use when combobox is near bottom of viewport.',
66
+ },
67
+ },
68
+ examples: [
69
+ {
70
+ title: 'React - Single select',
71
+ code: `import { Combobox } from '@triptease/react/combobox';
72
+
73
+ <label htmlFor="country">Country</label>
74
+ <Combobox id="country">
75
+ <option value="us" slot="option">United States</option>
76
+ <option value="uk" slot="option">United Kingdom</option>
77
+ <option value="ca" slot="option">Canada</option>
78
+ </Combobox>`,
79
+ },
80
+ {
81
+ title: 'React - Multi select',
82
+ description:
83
+ 'Use multiselect and displaySelectAll props for multi-select with "Select All" option. Set value prop with array for default selections.',
84
+ code: `import { Combobox } from '@triptease/react/combobox';
85
+
86
+ <label htmlFor="frameworks">Frameworks</label>
87
+ <Combobox id="frameworks" multiselect displaySelectAll>
88
+ <option value="react" slot="option">React</option>
89
+ <option value="vue" slot="option">Vue.js</option>
90
+ <option value="angular" slot="option">Angular</option>
91
+ </Combobox>`,
92
+ },
93
+ {
94
+ title: 'Web Component - Single select',
95
+ description:
96
+ 'Basic single-select allows typing to filter options. Set value with .value property. Use disabled attribute on options to prevent selection while keeping them visible. Use placeholder attribute for guidance text.',
97
+ code: `import '@triptease/tt-combobox';
98
+
99
+ <label for="country">Country</label>
100
+ <tt-combobox id="country">
101
+ <option value="us" slot="option">United States</option>
102
+ <option value="uk" slot="option">United Kingdom</option>
103
+ <option value="ca" slot="option">Canada</option>
104
+ </tt-combobox>`,
105
+ },
106
+ {
107
+ title: 'Web Component - With icon slot',
108
+ description: 'Use icon slot to add leading icon for visual context.',
109
+ code: `import '@triptease/tt-combobox';
110
+
111
+ <label for="search-country">Search country</label>
112
+ <tt-combobox id="search-country" placeholder="Type to search">
113
+ <span slot="icon">🔍</span>
114
+ <option value="us" slot="option">United States</option>
115
+ <option value="uk" slot="option">United Kingdom</option>
116
+ <option value="ca" slot="option">Canada</option>
117
+ </tt-combobox>`,
118
+ },
119
+ {
120
+ title: 'Web Component - With error slot',
121
+ description: 'Use invalid attribute with error slot to display validation errors.',
122
+ code: `import '@triptease/tt-combobox';
123
+
124
+ <label for="country">Country</label>
125
+ <tt-combobox id="country" invalid>
126
+ <option value="us" slot="option">United States</option>
127
+ <option value="uk" slot="option">United Kingdom</option>
128
+ <option value="ca" slot="option">Canada</option>
129
+ <span slot="error">Please select a valid country</span>
130
+ </tt-combobox>`,
131
+ },
132
+ {
133
+ title: 'Web Component - In form',
134
+ description: `Use with HTML forms via name attribute. Form value is JSON string (e.g., ["united-states"]). Add required for validation. Listen to change event for real-time updates.`,
135
+ code: `import '@triptease/tt-combobox';
136
+
137
+ <form onsubmit="handleSubmit(event)">
138
+ <label for="country">Country</label>
139
+ <tt-combobox id="country" name="country" required>
140
+ <option value="us" slot="option">United States</option>
141
+ <option value="uk" slot="option">United Kingdom</option>
142
+ <option value="ca" slot="option">Canada</option>
143
+ </tt-combobox>
144
+ <button type="submit">Submit</button>
145
+ </form>`,
146
+ },
147
+ {
148
+ title: 'Web Component - Multi select with select all',
149
+ description:
150
+ 'Use multiselect and display-select-all attributes for multi-select. Set value with array. Use hidden attribute on options to hide from list.',
151
+ code: `import '@triptease/tt-combobox';
152
+
153
+ <label for="frameworks">Frameworks</label>
154
+ <tt-combobox id="frameworks" multiselect display-select-all>
155
+ <option value="react" slot="option">React</option>
156
+ <option value="vue" slot="option">Vue.js</option>
157
+ <option value="angular" slot="option">Angular</option>
158
+ <option value="svelte" slot="option">Svelte</option>
159
+ </tt-combobox>`,
160
+ },
161
+ {
162
+ title: 'Web Component - CSS customization',
163
+ description: `Use CSS custom properties to customize appearance: --tt-combobox-min-width / --tt-combobox-max-width, --tt-combobox-background-color, --tt-combobox-border-color / --tt-combobox-border-width, --tt-combobox-placeholder-color, --tt-combobox-hover-background-color, --tt-combobox-option-background-color-hover, --tt-combobox-option-color-hover.`,
164
+ code: `import '@triptease/tt-combobox';
165
+
166
+ <label for="country">Country</label>
167
+ <tt-combobox
168
+ id="country"
169
+ placeholder="Select..."
170
+ style="
171
+ --tt-combobox-min-width: 150px;
172
+ --tt-combobox-max-width: 150px;
173
+ --tt-combobox-background-color: var(--color-surface-600);
174
+ --tt-combobox-border-color: var(--color-primary-500);
175
+ --tt-combobox-border-width: 2px;
176
+ ">
177
+ <option value="us" slot="option">United States</option>
178
+ <option value="uk" slot="option">United Kingdom</option>
179
+ <option value="ca" slot="option">Canada</option>
180
+ </tt-combobox>`,
181
+ },
182
+ ],
183
+ },
184
+ } satisfies ComponentManifest;
@@ -0,0 +1,73 @@
1
+ import { ComponentManifest } from '@/manifests/components/types.js';
2
+ import { buildCDNUrl, buildMajorVersion } from '@/utils/buildCDNUrls.js';
3
+ import packageJson from '@/../package.json' with { type: 'json' };
4
+
5
+ const version = packageJson.dependencies['@triptease/tt-date-picker'];
6
+
7
+ export default {
8
+ 'date-picker': {
9
+ name: 'Date Picker',
10
+ description: 'Date picker for selecting a single date, available as both React component and Web Component',
11
+ ssrSafe: true,
12
+ element: 'DatePicker (React) / tt-date-picker (Web Component)',
13
+ usageGuidance: {
14
+ whenToUse: [
15
+ 'Users need to select a specific single date',
16
+ 'Date format needs to be consistent',
17
+ 'Calendar visualization helps users pick dates',
18
+ 'Date constraints are needed (min/max dates)',
19
+ ],
20
+ avoid: ['Date ranges are needed (use date range picker)'],
21
+ },
22
+ installation: {
23
+ npm: [{ name: '@triptease/tt-date-picker', includesTypes: true, optional: false }],
24
+ cdn: [
25
+ {
26
+ name: '@triptease/tt-date-picker',
27
+ includesTypes: false,
28
+ optional: false,
29
+ latestVersionUrl: buildCDNUrl('tt-date-picker', 'latest'),
30
+ pinnedMajorVersionUrl: buildCDNUrl('tt-date-picker', buildMajorVersion(version)),
31
+ pinnedVersionUrl: buildCDNUrl('tt-date-picker', version),
32
+ guidance:
33
+ 'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
34
+ },
35
+ ],
36
+ },
37
+ examples: [
38
+ {
39
+ title: 'React - Basic',
40
+ description:
41
+ 'Uncontrolled date picker. Value is in ISO format (YYYY-MM-DD). Use minDate and maxDate props to restrict selectable dates. Use disabled prop to disable. Use openLeft prop for pickers near right edge.',
42
+ code: `import { DatePicker } from '@triptease/react/date-picker';
43
+
44
+ <label htmlFor="date">Select a date</label>
45
+ <DatePicker id="date" />`,
46
+ },
47
+ {
48
+ title: 'React - Controlled',
49
+ description:
50
+ 'Use controlled component with React state for dynamic behavior. Value prop and onChange handler manage the selection.',
51
+ code: `import { DatePicker } from '@triptease/react/date-picker';
52
+
53
+ const [selectedDate, setSelectedDate] = useState('');
54
+
55
+ <label htmlFor="date">Event date</label>
56
+ <DatePicker
57
+ id="date"
58
+ value={selectedDate}
59
+ onChange={(e) => setSelectedDate(e.target.value)}
60
+ />`,
61
+ },
62
+ {
63
+ title: 'Web Component - Basic',
64
+ description:
65
+ 'Web component date picker. Value is in ISO format (YYYY-MM-DD). Use mindate and maxdate attributes to restrict dates. Use disabled attribute to disable. Use open-left attribute for pickers near right edge.',
66
+ code: `import '@triptease/tt-date-picker';
67
+
68
+ <label for="date">Select a date</label>
69
+ <tt-date-picker id="date"></tt-date-picker>`,
70
+ },
71
+ ],
72
+ },
73
+ } satisfies ComponentManifest;
@@ -0,0 +1,118 @@
1
+ import { ComponentManifest } from '@/manifests/components/types.js';
2
+ import { buildCDNUrl, buildMajorVersion } from '@/utils/buildCDNUrls.js';
3
+ import packageJson from '@/../package.json' with { type: 'json' };
4
+
5
+ const version = packageJson.dependencies['@triptease/tt-date-range-picker'];
6
+
7
+ export default {
8
+ 'date-range-picker': {
9
+ name: 'Date Range Picker',
10
+ description:
11
+ 'Date range picker for selecting start and end dates, available as both React component and Web Component',
12
+ ssrSafe: true,
13
+ element: 'DateRangePicker (React) / tt-date-range-picker (Web Component)',
14
+ usageGuidance: {
15
+ whenToUse: [
16
+ 'Users need to select a date range (bookings, reports, filters)',
17
+ 'Start and end dates need to be validated together',
18
+ 'Range constraints are important (min/max days in range)',
19
+ 'Visual calendar helps users understand date spans',
20
+ ],
21
+ avoid: [
22
+ 'Only a single date is needed (use date picker)',
23
+ 'Dates are independent of each other (use two separate date pickers)',
24
+ ],
25
+ },
26
+ installation: {
27
+ npm: [{ name: '@triptease/react/date-range-picker', includesTypes: true, optional: false }],
28
+ cdn: [
29
+ {
30
+ name: '@triptease/tt-date-range-picker',
31
+ includesTypes: false,
32
+ optional: false,
33
+ latestVersionUrl: buildCDNUrl('tt-date-range-picker', 'latest'),
34
+ pinnedMajorVersionUrl: buildCDNUrl('tt-date-range-picker', buildMajorVersion(version)),
35
+ pinnedVersionUrl: buildCDNUrl('tt-date-range-picker', version),
36
+ guidance:
37
+ 'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
38
+ },
39
+ ],
40
+ },
41
+ examples: [
42
+ {
43
+ title: 'React - Basic',
44
+ description:
45
+ 'Uncontrolled date range picker. Dates are in ISO format (YYYY-MM-DD). Use start and end props for default values. Use minDate and maxDate props to restrict dates. Use disabled prop to disable. Use openLeft prop for pickers near right edge.',
46
+ code: `import { DateRangePicker } from '@triptease/react/date-range-picker';
47
+
48
+ <label htmlFor="daterange">Select date range</label>
49
+ <DateRangePicker id="daterange" />`,
50
+ },
51
+ {
52
+ title: 'React - Controlled',
53
+ description:
54
+ 'Use controlled component with React state for dynamic behavior. Access picker.start and picker.end from onChange event.',
55
+ code: `import { DateRangePicker } from '@triptease/react/date-range-picker';
56
+
57
+ const [startDate, setStartDate] = useState('');
58
+ const [endDate, setEndDate] = useState('');
59
+
60
+ const handleChange = (e) => {
61
+ const picker = e.target;
62
+ setStartDate(picker.start || '');
63
+ setEndDate(picker.end || '');
64
+ };
65
+
66
+ <label htmlFor="daterange">Booking dates</label>
67
+ <DateRangePicker id="daterange" start={startDate} end={endDate} onChange={handleChange} />`,
68
+ },
69
+ {
70
+ title: 'React - With presets',
71
+ description:
72
+ 'Use PresetButton component for quick date range selection. Pass Preset enum values for common ranges. PresetButton must be child of DateRangePicker with slot="preset".',
73
+ code: `import { DateRangePicker, PresetButton, Preset } from '@triptease/react/date-range-picker';
74
+
75
+ <label htmlFor="daterange">Travel dates</label>
76
+ <DateRangePicker id="daterange">
77
+ <PresetButton slot="preset" preset={Preset.ThisWeek}>This Week</PresetButton>
78
+ <PresetButton slot="preset" preset={Preset.ThisMonth}>This Month</PresetButton>
79
+ <PresetButton slot="preset" preset={Preset.Next1Month}>Next Month</PresetButton>
80
+ </DateRangePicker>`,
81
+ },
82
+ {
83
+ title: 'Web Component - Basic',
84
+ description:
85
+ 'Web component date range picker. Dates are in ISO format (YYYY-MM-DD). Use start and end attributes for default values. Use mindate and maxdate attributes to restrict dates. Use disabled attribute to disable. Use open-left attribute for pickers near right edge.',
86
+ code: `import '@triptease/tt-date-range-picker';
87
+
88
+ <label for="daterange">Select date range</label>
89
+ <tt-date-range-picker id="daterange"></tt-date-range-picker>`,
90
+ },
91
+ {
92
+ title: 'Web Component - In form',
93
+ description: `Use with HTML forms via name attribute. Form value is JSON string: {"startDate": "2025-01-01", "endDate": "2025-01-10"}. Parse JSON to access dates.`,
94
+ code: `import '@triptease/tt-date-range-picker';
95
+
96
+ <form onsubmit="handleSubmit(event)">
97
+ <label for="booking-dates">Booking dates</label>
98
+ <tt-date-range-picker id="booking-dates" name="booking-dates"></tt-date-range-picker>
99
+ <button type="submit">Submit</button>
100
+ </form>`,
101
+ },
102
+ {
103
+ title: 'Web Component - With presets',
104
+ description: `Use tt-preset-button for quick date range selection. Place inside tt-date-range-picker with slot="preset". Set preset attribute to range type: "this-week", "next-week", "this-month", "next-month", etc.`,
105
+ code: `import '@triptease/tt-date-range-picker';
106
+ import '@triptease/tt-preset-button';
107
+
108
+ <label for="daterange">Travel dates</label>
109
+ <tt-date-range-picker id="daterange">
110
+ <tt-preset-button slot="preset" preset="this-week">This Week</tt-preset-button>
111
+ <tt-preset-button slot="preset" preset="next-week">Next Week</tt-preset-button>
112
+ <tt-preset-button slot="preset" preset="this-month">This Month</tt-preset-button>
113
+ <tt-preset-button slot="preset" preset="next-month">Next Month</tt-preset-button>
114
+ </tt-date-range-picker>`,
115
+ },
116
+ ],
117
+ },
118
+ } satisfies ComponentManifest;