@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.
- package/CHANGELOG.md +26 -0
- package/README.md +340 -0
- package/dist/package.json +41 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +39 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/manifests/components/entries/badge.d.ts +27 -0
- package/dist/src/manifests/components/entries/badge.js +43 -0
- package/dist/src/manifests/components/entries/badge.js.map +1 -0
- package/dist/src/manifests/components/entries/barChart.d.ts +73 -0
- package/dist/src/manifests/components/entries/barChart.js +125 -0
- package/dist/src/manifests/components/entries/barChart.js.map +1 -0
- package/dist/src/manifests/components/entries/button.d.ts +40 -0
- package/dist/src/manifests/components/entries/button.js +59 -0
- package/dist/src/manifests/components/entries/button.js.map +1 -0
- package/dist/src/manifests/components/entries/card.d.ts +20 -0
- package/dist/src/manifests/components/entries/card.js +34 -0
- package/dist/src/manifests/components/entries/card.js.map +1 -0
- package/dist/src/manifests/components/entries/checkbox.d.ts +31 -0
- package/dist/src/manifests/components/entries/checkbox.js +64 -0
- package/dist/src/manifests/components/entries/checkbox.js.map +1 -0
- package/dist/src/manifests/components/entries/combobox.d.ts +64 -0
- package/dist/src/manifests/components/entries/combobox.js +176 -0
- package/dist/src/manifests/components/entries/combobox.js.map +1 -0
- package/dist/src/manifests/components/entries/datePicker.d.ts +34 -0
- package/dist/src/manifests/components/entries/datePicker.js +67 -0
- package/dist/src/manifests/components/entries/datePicker.js.map +1 -0
- package/dist/src/manifests/components/entries/dateRangePicker.d.ts +34 -0
- package/dist/src/manifests/components/entries/dateRangePicker.js +110 -0
- package/dist/src/manifests/components/entries/dateRangePicker.js.map +1 -0
- package/dist/src/manifests/components/entries/dialog.d.ts +38 -0
- package/dist/src/manifests/components/entries/dialog.js +73 -0
- package/dist/src/manifests/components/entries/dialog.js.map +1 -0
- package/dist/src/manifests/components/entries/lineChart.d.ts +76 -0
- package/dist/src/manifests/components/entries/lineChart.js +141 -0
- package/dist/src/manifests/components/entries/lineChart.js.map +1 -0
- package/dist/src/manifests/components/entries/numberinput.d.ts +52 -0
- package/dist/src/manifests/components/entries/numberinput.js +64 -0
- package/dist/src/manifests/components/entries/numberinput.js.map +1 -0
- package/dist/src/manifests/components/entries/radio.d.ts +31 -0
- package/dist/src/manifests/components/entries/radio.js +50 -0
- package/dist/src/manifests/components/entries/radio.js.map +1 -0
- package/dist/src/manifests/components/entries/select.d.ts +16 -0
- package/dist/src/manifests/components/entries/select.js +23 -0
- package/dist/src/manifests/components/entries/select.js.map +1 -0
- package/dist/src/manifests/components/entries/table.d.ts +16 -0
- package/dist/src/manifests/components/entries/table.js +43 -0
- package/dist/src/manifests/components/entries/table.js.map +1 -0
- package/dist/src/manifests/components/entries/textarea.d.ts +40 -0
- package/dist/src/manifests/components/entries/textarea.js +54 -0
- package/dist/src/manifests/components/entries/textarea.js.map +1 -0
- package/dist/src/manifests/components/entries/textinput.d.ts +40 -0
- package/dist/src/manifests/components/entries/textinput.js +53 -0
- package/dist/src/manifests/components/entries/textinput.js.map +1 -0
- package/dist/src/manifests/components/entries/toggle.d.ts +23 -0
- package/dist/src/manifests/components/entries/toggle.js +30 -0
- package/dist/src/manifests/components/entries/toggle.js.map +1 -0
- package/dist/src/manifests/components/entries/typography.d.ts +23 -0
- package/dist/src/manifests/components/entries/typography.js +32 -0
- package/dist/src/manifests/components/entries/typography.js.map +1 -0
- package/dist/src/manifests/components/index.d.ts +2 -0
- package/dist/src/manifests/components/index.js +39 -0
- package/dist/src/manifests/components/index.js.map +1 -0
- package/dist/src/manifests/components/types.d.ts +56 -0
- package/dist/src/manifests/components/types.js +2 -0
- package/dist/src/manifests/components/types.js.map +1 -0
- package/dist/src/tools/getCSSTokens/handler.d.ts +6 -0
- package/dist/src/tools/getCSSTokens/handler.js +29 -0
- package/dist/src/tools/getCSSTokens/handler.js.map +1 -0
- package/dist/src/tools/getCSSTokens/index.d.ts +12 -0
- package/dist/src/tools/getCSSTokens/index.js +14 -0
- package/dist/src/tools/getCSSTokens/index.js.map +1 -0
- package/dist/src/tools/getCSSTokens/utils.d.ts +5 -0
- package/dist/src/tools/getCSSTokens/utils.js +25 -0
- package/dist/src/tools/getCSSTokens/utils.js.map +1 -0
- package/dist/src/tools/getComponentDocs/handler.d.ts +6 -0
- package/dist/src/tools/getComponentDocs/handler.js +27 -0
- package/dist/src/tools/getComponentDocs/handler.js.map +1 -0
- package/dist/src/tools/getComponentDocs/index.d.ts +12 -0
- package/dist/src/tools/getComponentDocs/index.js +14 -0
- package/dist/src/tools/getComponentDocs/index.js.map +1 -0
- package/dist/src/tools/getSetupGuide/handler.d.ts +6 -0
- package/dist/src/tools/getSetupGuide/handler.js +50 -0
- package/dist/src/tools/getSetupGuide/handler.js.map +1 -0
- package/dist/src/tools/getSetupGuide/index.d.ts +12 -0
- package/dist/src/tools/getSetupGuide/index.js +17 -0
- package/dist/src/tools/getSetupGuide/index.js.map +1 -0
- package/dist/src/tools/getSetupGuide/setupGuides.d.ts +12 -0
- package/dist/src/tools/getSetupGuide/setupGuides.js +49 -0
- package/dist/src/tools/getSetupGuide/setupGuides.js.map +1 -0
- package/dist/src/tools/listCSSTokens/handler.d.ts +3 -0
- package/dist/src/tools/listCSSTokens/handler.js +20 -0
- package/dist/src/tools/listCSSTokens/handler.js.map +1 -0
- package/dist/src/tools/listCSSTokens/index.d.ts +8 -0
- package/dist/src/tools/listCSSTokens/index.js +10 -0
- package/dist/src/tools/listCSSTokens/index.js.map +1 -0
- package/dist/src/tools/listComponents/handler.d.ts +3 -0
- package/dist/src/tools/listComponents/handler.js +18 -0
- package/dist/src/tools/listComponents/handler.js.map +1 -0
- package/dist/src/tools/listComponents/index.d.ts +9 -0
- package/dist/src/tools/listComponents/index.js +11 -0
- package/dist/src/tools/listComponents/index.js.map +1 -0
- package/dist/src/tools/searchComponents/handler.d.ts +6 -0
- package/dist/src/tools/searchComponents/handler.js +29 -0
- package/dist/src/tools/searchComponents/handler.js.map +1 -0
- package/dist/src/tools/searchComponents/index.d.ts +12 -0
- package/dist/src/tools/searchComponents/index.js +14 -0
- package/dist/src/tools/searchComponents/index.js.map +1 -0
- package/dist/src/utils/buildCDNUrls.d.ts +3 -0
- package/dist/src/utils/buildCDNUrls.js +6 -0
- package/dist/src/utils/buildCDNUrls.js.map +1 -0
- package/package.json +43 -0
- package/src/index.ts +46 -0
- package/src/manifests/components/entries/badge.ts +45 -0
- package/src/manifests/components/entries/barChart.ts +132 -0
- package/src/manifests/components/entries/button.ts +61 -0
- package/src/manifests/components/entries/card.ts +35 -0
- package/src/manifests/components/entries/checkbox.ts +68 -0
- package/src/manifests/components/entries/combobox.ts +184 -0
- package/src/manifests/components/entries/datePicker.ts +73 -0
- package/src/manifests/components/entries/dateRangePicker.ts +118 -0
- package/src/manifests/components/entries/dialog.ts +77 -0
- package/src/manifests/components/entries/lineChart.ts +150 -0
- package/src/manifests/components/entries/numberinput.ts +66 -0
- package/src/manifests/components/entries/radio.ts +53 -0
- package/src/manifests/components/entries/select.ts +24 -0
- package/src/manifests/components/entries/table.ts +44 -0
- package/src/manifests/components/entries/textarea.ts +56 -0
- package/src/manifests/components/entries/textinput.ts +55 -0
- package/src/manifests/components/entries/toggle.ts +31 -0
- package/src/manifests/components/entries/typography.ts +33 -0
- package/src/manifests/components/index.ts +41 -0
- package/src/manifests/components/types.ts +64 -0
- package/src/tools/getCSSTokens/__snapshots__/handler.test.ts.snap +78 -0
- package/src/tools/getCSSTokens/handler.test.ts +39 -0
- package/src/tools/getCSSTokens/handler.ts +36 -0
- package/src/tools/getCSSTokens/index.ts +15 -0
- package/src/tools/getCSSTokens/utils.ts +31 -0
- package/src/tools/getComponentDocs/__snapshots__/handler.test.ts.snap +23 -0
- package/src/tools/getComponentDocs/handler.test.ts +14 -0
- package/src/tools/getComponentDocs/handler.ts +34 -0
- package/src/tools/getComponentDocs/index.ts +15 -0
- package/src/tools/getSetupGuide/__snapshots__/handler.test.ts.snap +34 -0
- package/src/tools/getSetupGuide/handler.test.ts +20 -0
- package/src/tools/getSetupGuide/handler.ts +59 -0
- package/src/tools/getSetupGuide/index.ts +20 -0
- package/src/tools/getSetupGuide/setupGuides.ts +62 -0
- package/src/tools/listCSSTokens/__snapshots__/handler.test.ts.snap +12 -0
- package/src/tools/listCSSTokens/handler.test.ts +9 -0
- package/src/tools/listCSSTokens/handler.ts +32 -0
- package/src/tools/listCSSTokens/index.ts +12 -0
- package/src/tools/listComponents/__snapshots__/handler.test.ts.snap +12 -0
- package/src/tools/listComponents/handler.test.ts +9 -0
- package/src/tools/listComponents/handler.ts +20 -0
- package/src/tools/listComponents/index.ts +12 -0
- package/src/tools/searchComponents/__snapshots__/handler.test.ts.snap +23 -0
- package/src/tools/searchComponents/handler.test.ts +14 -0
- package/src/tools/searchComponents/handler.ts +36 -0
- package/src/tools/searchComponents/index.ts +15 -0
- package/src/utils/buildCDNUrls.ts +7 -0
- package/tsconfig.json +12 -0
- package/vitest.config.ts +6 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
+
import packageJson from '@/../package.json' with { type: 'json' };
|
|
3
|
+
import { buildCDNUrl, buildMajorVersion } from '@/utils/buildCDNUrls.js';
|
|
4
|
+
|
|
5
|
+
const version = packageJson.dependencies['@triptease/tt-dialog'];
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
dialog: {
|
|
9
|
+
name: 'Dialog - Web Component',
|
|
10
|
+
description: 'Dialog component that displays content in a layer above the page',
|
|
11
|
+
ssrSafe: true,
|
|
12
|
+
element: 'tt-dialog',
|
|
13
|
+
usageGuidance: {
|
|
14
|
+
whenToUse: [
|
|
15
|
+
'User interaction is required to proceed',
|
|
16
|
+
"The task is short, self-contained or doesn't fit naturally into a page",
|
|
17
|
+
'The underlying page content should remain visible',
|
|
18
|
+
"Intentionally disrupting the user's flow is beneficial (e.g. confirmations, critical notifications)",
|
|
19
|
+
],
|
|
20
|
+
avoid: [
|
|
21
|
+
'The content is long, complex, or scrollable (e.g. multi-step forms, detailed instructions)',
|
|
22
|
+
'The content should be shareable or linkable (prefer a dedicated page)',
|
|
23
|
+
'The information is not time-sensitive or critical (prefer toasts or inline disclosures)',
|
|
24
|
+
'The user did not initiate the interaction (unsolicited pop-ups can be frustrating)',
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
installation: {
|
|
28
|
+
npm: [{ name: '@triptease/tt-dialog', includesTypes: true, optional: false }],
|
|
29
|
+
cdn: [
|
|
30
|
+
{
|
|
31
|
+
name: 'tt-dialog',
|
|
32
|
+
includesTypes: false,
|
|
33
|
+
optional: false,
|
|
34
|
+
pinnedVersionUrl: buildCDNUrl('tt-dialog', version),
|
|
35
|
+
pinnedMajorVersionUrl: buildCDNUrl('tt-dialog', buildMajorVersion(version)),
|
|
36
|
+
latestVersionUrl: buildCDNUrl('tt-dialog', 'latest'),
|
|
37
|
+
guidance:
|
|
38
|
+
'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
examples: [
|
|
43
|
+
{
|
|
44
|
+
title: 'Basic usage',
|
|
45
|
+
code: `<button data-theme="primary" onclick="document.querySelector('#my-dialog').show()">
|
|
46
|
+
Open Dialog
|
|
47
|
+
</button>
|
|
48
|
+
<tt-dialog id="my-dialog" aria-label="Example dialog">
|
|
49
|
+
<div class="container">
|
|
50
|
+
<h2>Dialog Title</h2>
|
|
51
|
+
<p>This is a basic dialog with some content.</p>
|
|
52
|
+
<button data-theme="primary" onclick="document.querySelector('#my-dialog').hide()">
|
|
53
|
+
Close
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
</tt-dialog>`,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: 'With CSS custom properties',
|
|
60
|
+
description:
|
|
61
|
+
'Use CSS custom properties to customize dialog positioning:\n\n- `--dialog-left-distance`: Control the horizontal position of the dialog.',
|
|
62
|
+
code: `<button data-theme="primary" onclick="document.querySelector('#positioned-dialog').show()">
|
|
63
|
+
Open Dialog
|
|
64
|
+
</button>
|
|
65
|
+
<tt-dialog id="positioned-dialog" aria-label="Positioned dialog" style="--dialog-left-distance: 100px;">
|
|
66
|
+
<div class="container">
|
|
67
|
+
<h2>Custom Positioned Dialog</h2>
|
|
68
|
+
<p>This dialog has custom positioning using CSS custom properties.</p>
|
|
69
|
+
<button data-theme="primary" onclick="document.querySelector('#positioned-dialog').hide()">
|
|
70
|
+
Close
|
|
71
|
+
</button>
|
|
72
|
+
</div>
|
|
73
|
+
</tt-dialog>`,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
} satisfies ComponentManifest;
|
|
@@ -0,0 +1,150 @@
|
|
|
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 latestLineChartVersion = packageJson.dependencies['@triptease/tt-line-chart'];
|
|
6
|
+
const latestDatasetVersion = packageJson.dependencies['@triptease/tt-dataset'];
|
|
7
|
+
const latestDataPointVersion = packageJson.dependencies['@triptease/tt-data-point'];
|
|
8
|
+
const latestHighlightVersion = packageJson.dependencies['@triptease/tt-highlight'];
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
'line-chart': {
|
|
12
|
+
name: 'Line Chart - Web Component',
|
|
13
|
+
description: 'Line chart for visualizing trends over continuous data',
|
|
14
|
+
ssrSafe: true,
|
|
15
|
+
element: 'tt-line-chart',
|
|
16
|
+
usageGuidance: {
|
|
17
|
+
whenToUse: [
|
|
18
|
+
'To visualize trends along a continuous x-axis',
|
|
19
|
+
'To compare how multiple datasets for the same measure change relative to each other',
|
|
20
|
+
],
|
|
21
|
+
avoid: [
|
|
22
|
+
'When the x-axis does not represent a continuous range (use a bar chart instead)',
|
|
23
|
+
'When there are too few data points to form a meaningful trend (use a bar chart instead)',
|
|
24
|
+
'When comparing datasets that do not have a meaningful or explainable relationship',
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
installation: {
|
|
28
|
+
npm: [
|
|
29
|
+
{ name: '@triptease/tt-line-chart', includesTypes: true, optional: false },
|
|
30
|
+
{ name: '@triptease/tt-dataset', includesTypes: true, optional: false },
|
|
31
|
+
{ name: '@triptease/tt-data-point', includesTypes: true, optional: false },
|
|
32
|
+
{ name: '@triptease/tt-highlight', includesTypes: true, optional: true },
|
|
33
|
+
],
|
|
34
|
+
cdn: [
|
|
35
|
+
{
|
|
36
|
+
name: 'tt-line-chart',
|
|
37
|
+
includesTypes: false,
|
|
38
|
+
optional: false,
|
|
39
|
+
pinnedVersionUrl: buildCDNUrl('tt-line-chart', latestLineChartVersion),
|
|
40
|
+
pinnedMajorVersionUrl: buildCDNUrl('tt-line-chart', buildMajorVersion(latestLineChartVersion)),
|
|
41
|
+
latestVersionUrl: buildCDNUrl('tt-line-chart', 'latest'),
|
|
42
|
+
guidance:
|
|
43
|
+
'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'tt-dataset',
|
|
47
|
+
includesTypes: false,
|
|
48
|
+
optional: false,
|
|
49
|
+
pinnedVersionUrl: buildCDNUrl('tt-dataset', latestDatasetVersion),
|
|
50
|
+
pinnedMajorVersionUrl: buildCDNUrl('tt-dataset', buildMajorVersion(latestDatasetVersion)),
|
|
51
|
+
latestVersionUrl: buildCDNUrl('tt-dataset', 'latest'),
|
|
52
|
+
guidance:
|
|
53
|
+
'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'tt-data-point',
|
|
57
|
+
includesTypes: false,
|
|
58
|
+
optional: false,
|
|
59
|
+
pinnedVersionUrl: buildCDNUrl('tt-data-point', latestDataPointVersion),
|
|
60
|
+
pinnedMajorVersionUrl: buildCDNUrl('tt-data-point', buildMajorVersion(latestDataPointVersion)),
|
|
61
|
+
latestVersionUrl: buildCDNUrl('tt-data-point', 'latest'),
|
|
62
|
+
guidance:
|
|
63
|
+
'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'tt-highlight',
|
|
67
|
+
includesTypes: false,
|
|
68
|
+
optional: true,
|
|
69
|
+
pinnedVersionUrl: buildCDNUrl('tt-highlight', latestHighlightVersion),
|
|
70
|
+
pinnedMajorVersionUrl: buildCDNUrl('tt-highlight', buildMajorVersion(latestHighlightVersion)),
|
|
71
|
+
latestVersionUrl: buildCDNUrl('tt-highlight', 'latest'),
|
|
72
|
+
guidance:
|
|
73
|
+
'Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code.',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
attributes: {
|
|
78
|
+
width: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
description: 'Width of chart (any CSS value). Defaults to 100% to fill container.',
|
|
81
|
+
},
|
|
82
|
+
height: {
|
|
83
|
+
type: 'string',
|
|
84
|
+
description: 'Height of chart (any CSS value). Defaults to 100% to fill container.',
|
|
85
|
+
},
|
|
86
|
+
'x-axis-title': {
|
|
87
|
+
type: 'string',
|
|
88
|
+
description: 'Title for x-axis. Use to clarify units of measurement. Keep concise.',
|
|
89
|
+
},
|
|
90
|
+
'y-axis-title': {
|
|
91
|
+
type: 'string',
|
|
92
|
+
description: 'Title for y-axis. Use to clarify units of measurement. Keep concise.',
|
|
93
|
+
},
|
|
94
|
+
loading: {
|
|
95
|
+
type: 'boolean',
|
|
96
|
+
description: 'Show loading state while data fetches. Component handles aria-busy automatically.',
|
|
97
|
+
},
|
|
98
|
+
'hide-numbers': {
|
|
99
|
+
type: 'boolean',
|
|
100
|
+
description:
|
|
101
|
+
'Hide y-axis numbers and tooltips. Use when numbers could mislead. Removes ARIA labels, so provide trend description.',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
examples: [
|
|
105
|
+
{
|
|
106
|
+
title: 'Basic line chart',
|
|
107
|
+
code: `import '@triptease/tt-line-chart';
|
|
108
|
+
import '@triptease/tt-dataset';
|
|
109
|
+
import '@triptease/tt-data-point';
|
|
110
|
+
|
|
111
|
+
<tt-line-chart id="basic-chart">
|
|
112
|
+
<tt-dataset label="2024">
|
|
113
|
+
<tt-data-point label="Jan 1" value={45}></tt-data-point>
|
|
114
|
+
<tt-data-point label="Jan 2" value={48}></tt-data-point>
|
|
115
|
+
<tt-data-point label="Jan 3" value={52}></tt-data-point>
|
|
116
|
+
</tt-dataset>
|
|
117
|
+
</tt-line-chart>`,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
title: 'Multiple datasets',
|
|
121
|
+
description:
|
|
122
|
+
'Use multiple datasets to compare trends of the same measure for different groups. Limit datasets to a maximum of 4, as more datasets make the chart difficult to read and compare. The component automatically uses symbols to help identify each dataset without relying on color.',
|
|
123
|
+
code: `<tt-line-chart id="multiple-datasets" height="20rem">
|
|
124
|
+
<tt-dataset label="2025">
|
|
125
|
+
<tt-data-point label="Jan 1" value={45}></tt-data-point>
|
|
126
|
+
<tt-data-point label="Jan 2" value={48}></tt-data-point>
|
|
127
|
+
</tt-dataset>
|
|
128
|
+
<tt-dataset label="2024">
|
|
129
|
+
<tt-data-point label="Jan 1" value={42}></tt-data-point>
|
|
130
|
+
<tt-data-point label="Jan 2" value={44}></tt-data-point>
|
|
131
|
+
</tt-dataset>
|
|
132
|
+
</tt-line-chart>`,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
title: 'With highlighted regions',
|
|
136
|
+
description:
|
|
137
|
+
'Use highlighted regions to draw attention to and label significant intervals. Only use when something significant occurs that may have affected the data. Use sparingly and highlight only the most important intervals to avoid clutter. Avoid overlapping regions as this can make it difficult to see where each interval starts and ends. Do not use when displaying multiple datasets if the highlight applies to only one dataset, as users may assume it applies to all.',
|
|
138
|
+
code: `import '@triptease/tt-highlight';
|
|
139
|
+
|
|
140
|
+
<tt-line-chart id="highlighted-chart" height="20rem">
|
|
141
|
+
<tt-dataset label="2025">
|
|
142
|
+
<tt-data-point label="Jan 1" value={45}></tt-data-point>
|
|
143
|
+
<tt-data-point label="Jan 2" value={48}></tt-data-point>
|
|
144
|
+
</tt-dataset>
|
|
145
|
+
<tt-highlight label="Easter Boost" from="15 Mar" to="5 Apr"></tt-highlight>
|
|
146
|
+
</tt-line-chart>;`,
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
} satisfies ComponentManifest;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
numberinput: {
|
|
5
|
+
name: 'Number Input',
|
|
6
|
+
description: 'Number input field with browser-provided increment/decrement controls',
|
|
7
|
+
element: "input[type='number']",
|
|
8
|
+
usageGuidance: {
|
|
9
|
+
whenToUse: [
|
|
10
|
+
'Collecting numeric data (age, quantity, price)',
|
|
11
|
+
'Values have clear min/max bounds',
|
|
12
|
+
'Users benefit from increment/decrement buttons',
|
|
13
|
+
],
|
|
14
|
+
avoid: [
|
|
15
|
+
'Numbers containing formatting (phone numbers, credit cards - use text input)',
|
|
16
|
+
'Complex number validation needed',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
attributes: {
|
|
20
|
+
type: {
|
|
21
|
+
values: ['number'],
|
|
22
|
+
default: 'number',
|
|
23
|
+
},
|
|
24
|
+
'aria-invalid': {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
description:
|
|
27
|
+
'Marks input as invalid for error styling. Pair with aria-describedby to associate error messages.',
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description: 'Disables the input',
|
|
32
|
+
},
|
|
33
|
+
placeholder: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'Placeholder text. Should not replace label - always provide visible label element.',
|
|
36
|
+
},
|
|
37
|
+
min: {
|
|
38
|
+
type: 'number',
|
|
39
|
+
description: 'Minimum allowed value',
|
|
40
|
+
},
|
|
41
|
+
max: {
|
|
42
|
+
type: 'number',
|
|
43
|
+
description: 'Maximum allowed value',
|
|
44
|
+
},
|
|
45
|
+
step: {
|
|
46
|
+
type: 'number',
|
|
47
|
+
description: 'Increment/decrement step size',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
states: ['default', 'hover', 'focus', 'disabled', 'invalid'],
|
|
51
|
+
examples: [
|
|
52
|
+
{
|
|
53
|
+
title: 'Basic usage',
|
|
54
|
+
code: `<label for="hotel-count">Number of Hotels</label>
|
|
55
|
+
<input id="hotel-count" type="number" />`,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: 'Error state',
|
|
59
|
+
description: 'Use aria-invalid with aria-describedby to associate error messages for screen readers',
|
|
60
|
+
code: `<label for="quantity">Quantity</label>
|
|
61
|
+
<input id="quantity" type="number" min="1" max="10" aria-invalid aria-describedby="quantity-error" />
|
|
62
|
+
<span id="quantity-error" class="text-error">Please enter a number between 1 and 10</span>`,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
} satisfies ComponentManifest;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
radio: {
|
|
5
|
+
name: 'Radio',
|
|
6
|
+
description: 'Radio button for selecting exactly one option from mutually exclusive choices',
|
|
7
|
+
element: "input[type='radio']",
|
|
8
|
+
usageGuidance: {
|
|
9
|
+
whenToUse: [
|
|
10
|
+
'Only one option can be selected from a small set',
|
|
11
|
+
'All options need to be visible at once',
|
|
12
|
+
'Comparing options side-by-side is important',
|
|
13
|
+
'Default selection is recommended',
|
|
14
|
+
],
|
|
15
|
+
avoid: [
|
|
16
|
+
'Multiple selections allowed (use checkboxes)',
|
|
17
|
+
'Long lists of options (consider select dropdown or combobox)',
|
|
18
|
+
'Immediate action expected (use toggle or button)',
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
attributes: {
|
|
22
|
+
name: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'Groups radio buttons together. All radio buttons in a group must have the same name.',
|
|
25
|
+
},
|
|
26
|
+
checked: {
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
description: 'Marks radio button as selected by default. Only one radio in a group should be checked.',
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
description:
|
|
33
|
+
'Disables the radio button. Can be applied to individual inputs or to parent fieldset to disable all radios.',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
examples: [
|
|
37
|
+
{
|
|
38
|
+
title: 'Radio group',
|
|
39
|
+
description:
|
|
40
|
+
'Use fieldset and legend for grouped radio buttons. All radios must share the same name attribute.',
|
|
41
|
+
code: `<fieldset>
|
|
42
|
+
<legend>Choose a color:</legend>
|
|
43
|
+
<input type="radio" id="radio-red" name="color" value="red" />
|
|
44
|
+
<label for="radio-red">Red</label>
|
|
45
|
+
<input type="radio" id="radio-green" name="color" value="green" />
|
|
46
|
+
<label for="radio-green">Green</label>
|
|
47
|
+
<input type="radio" id="radio-blue" name="color" value="blue" />
|
|
48
|
+
<label for="radio-blue">Blue</label>
|
|
49
|
+
</fieldset>`,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
} satisfies ComponentManifest;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
select: {
|
|
5
|
+
name: 'Select Input',
|
|
6
|
+
description: 'Dropdown list for selecting a single option',
|
|
7
|
+
element: 'select',
|
|
8
|
+
usageGuidance: {
|
|
9
|
+
whenToUse: ['Selecting from a list of predefined options', 'Limited screen space'],
|
|
10
|
+
avoid: ['Multiple selections (use the Combobox webcomponent)'],
|
|
11
|
+
},
|
|
12
|
+
examples: [
|
|
13
|
+
{
|
|
14
|
+
title: 'Basic select',
|
|
15
|
+
code: `<label for="reports">Select report frequency</label>
|
|
16
|
+
<select name="reports">
|
|
17
|
+
<option value="daily">Daily Report</option>
|
|
18
|
+
<option value="weekly">Weekly Report</option>
|
|
19
|
+
<option value="monthly">Monthly Report</option>
|
|
20
|
+
</select>`,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
} satisfies ComponentManifest;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
table: {
|
|
5
|
+
name: 'Table',
|
|
6
|
+
description: 'Organize and display data in rows and columns',
|
|
7
|
+
element: 'table',
|
|
8
|
+
usageGuidance: {
|
|
9
|
+
whenToUse: [
|
|
10
|
+
'Display structured data with multiple attributes',
|
|
11
|
+
'Enable comparison across data rows',
|
|
12
|
+
'Present numerical or tabular information',
|
|
13
|
+
'Show data relationships clearly',
|
|
14
|
+
],
|
|
15
|
+
avoid: [
|
|
16
|
+
'For layout purposes (use CSS Grid or Flexbox)',
|
|
17
|
+
'When data is better visualized as a chart',
|
|
18
|
+
'For small amounts of data that could be in a list',
|
|
19
|
+
"On small screens where columns won't fit (consider alternative layouts)",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
examples: [
|
|
23
|
+
{
|
|
24
|
+
title: 'Basic table',
|
|
25
|
+
code: `<table>
|
|
26
|
+
<thead>
|
|
27
|
+
<tr>
|
|
28
|
+
<th>Property Name</th>
|
|
29
|
+
<th>Impressions</th>
|
|
30
|
+
<th>Revenue</th>
|
|
31
|
+
</tr>
|
|
32
|
+
</thead>
|
|
33
|
+
<tbody>
|
|
34
|
+
<tr>
|
|
35
|
+
<td>Downtown Suites</td>
|
|
36
|
+
<td>12,450</td>
|
|
37
|
+
<td>$5,760.00</td>
|
|
38
|
+
</tr>
|
|
39
|
+
</tbody>
|
|
40
|
+
</table>`,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
} satisfies ComponentManifest;
|
|
@@ -0,0 +1,56 @@
|
|
|
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;
|
|
@@ -0,0 +1,55 @@
|
|
|
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;
|
|
@@ -0,0 +1,31 @@
|
|
|
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;
|
|
@@ -0,0 +1,33 @@
|
|
|
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;
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
|
|
22
|
+
export const componentManifest: ComponentManifest = {
|
|
23
|
+
...button,
|
|
24
|
+
...textinput,
|
|
25
|
+
...numberinput,
|
|
26
|
+
...textarea,
|
|
27
|
+
...select,
|
|
28
|
+
...checkbox,
|
|
29
|
+
...radio,
|
|
30
|
+
...toggle,
|
|
31
|
+
...badge,
|
|
32
|
+
...card,
|
|
33
|
+
...table,
|
|
34
|
+
...typography,
|
|
35
|
+
...dialog,
|
|
36
|
+
...combobox,
|
|
37
|
+
...datePicker,
|
|
38
|
+
...dateRangePicker,
|
|
39
|
+
...barChart,
|
|
40
|
+
...lineChart,
|
|
41
|
+
};
|