@triptease/design-system-mcp 1.1.8 → 1.2.1
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/README.md +92 -23
- package/dist/index.js +263 -29
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -246,41 +246,100 @@ Claude: [Reads designsystem://components, filters results]
|
|
|
246
246
|
|
|
247
247
|
- **Transport**: StdioServerTransport (local, on-demand)
|
|
248
248
|
- **Token Source**: `../../packages/stylesheet/dist/web/tokens.json` (relative to compiled dist directory)
|
|
249
|
-
- **Components**:
|
|
249
|
+
- **Components**: Individual manifest entries in `src/manifests/components/entries/`, aggregated by `src/manifests/components/index.ts`
|
|
250
250
|
- **Response Format**: JSON for all tool responses
|
|
251
251
|
|
|
252
252
|
## Maintenance
|
|
253
253
|
|
|
254
254
|
### Adding New Components
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
Each component has its own manifest entry file. Follow these steps:
|
|
257
|
+
|
|
258
|
+
**1. Create an entry file** at `src/manifests/components/entries/<componentName>.ts`:
|
|
257
259
|
|
|
258
260
|
```typescript
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
261
|
+
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
262
|
+
|
|
263
|
+
export default {
|
|
264
|
+
componentName: {
|
|
265
|
+
name: 'Component Name',
|
|
266
|
+
description: 'Brief description',
|
|
267
|
+
element: 'html-element',
|
|
268
|
+
usageGuidance: {
|
|
269
|
+
whenToUse: ['...'],
|
|
270
|
+
bestPractices: ['...'],
|
|
271
|
+
accessibility: ['...'],
|
|
272
|
+
avoid: ['...'],
|
|
273
|
+
},
|
|
274
|
+
attributes: {
|
|
275
|
+
/* optional */
|
|
276
|
+
},
|
|
277
|
+
dataAttributes: {
|
|
278
|
+
/* optional */
|
|
279
|
+
},
|
|
280
|
+
classes: {
|
|
281
|
+
/* optional */
|
|
282
|
+
},
|
|
283
|
+
events: {
|
|
284
|
+
/* optional */
|
|
285
|
+
},
|
|
286
|
+
states: [
|
|
287
|
+
/* optional */
|
|
288
|
+
],
|
|
289
|
+
examples: [
|
|
290
|
+
{
|
|
291
|
+
title: 'Example name',
|
|
292
|
+
code: `<html example code>`,
|
|
293
|
+
},
|
|
294
|
+
],
|
|
268
295
|
},
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
296
|
+
} satisfies ComponentManifest;
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
For web components distributed via CDN, also add installation options with versioned URLs:
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
import packageJson from '@/../package.json' with { type: 'json' };
|
|
303
|
+
import { buildCDNUrl, buildMajorVersion } from '@/utils/buildCDNUrls.js';
|
|
304
|
+
|
|
305
|
+
const version = packageJson.componentVersions['@triptease/tt-my-component'];
|
|
306
|
+
|
|
307
|
+
// Then in the manifest entry:
|
|
308
|
+
installationOptions: {
|
|
309
|
+
npm: [{ name: '@triptease/tt-my-component', includesTypes: true, optional: false }],
|
|
310
|
+
cdn: [{
|
|
311
|
+
name: 'tt-my-component',
|
|
312
|
+
includesTypes: false,
|
|
313
|
+
optional: false,
|
|
314
|
+
moduleFormat: 'esm',
|
|
315
|
+
pinnedVersionUrl: buildCDNUrl('tt-my-component', version),
|
|
316
|
+
pinnedMajorVersionUrl: buildCDNUrl('tt-my-component', buildMajorVersion(version)),
|
|
317
|
+
latestVersionUrl: buildCDNUrl('tt-my-component', 'latest'),
|
|
318
|
+
guidance: 'Prefer pinned major version URL to avoid unexpected breaking changes.',
|
|
319
|
+
}],
|
|
320
|
+
},
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
**2. Register the entry** in `src/manifests/components/index.ts`:
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
import myComponent from '@/manifests/components/entries/myComponent.js';
|
|
327
|
+
|
|
328
|
+
export const componentManifest: ComponentManifest = {
|
|
329
|
+
// ...existing entries
|
|
330
|
+
...myComponent,
|
|
331
|
+
};
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
**3. Add the version** (web components only) to `componentVersions` in `package.json`:
|
|
335
|
+
|
|
336
|
+
```json
|
|
337
|
+
"componentVersions": {
|
|
338
|
+
"@triptease/tt-my-component": "1.0.0"
|
|
280
339
|
}
|
|
281
340
|
```
|
|
282
341
|
|
|
283
|
-
|
|
342
|
+
**4. Build and verify:**
|
|
284
343
|
|
|
285
344
|
```bash
|
|
286
345
|
yarn build
|
|
@@ -325,7 +384,17 @@ _For project-level installation:_
|
|
|
325
384
|
- Check Node.js version is 18+
|
|
326
385
|
- Verify no TypeScript compilation errors
|
|
327
386
|
|
|
387
|
+
## Distribution
|
|
388
|
+
|
|
389
|
+
This MCP server is distributed through two channels:
|
|
390
|
+
|
|
391
|
+
1. **npm** (`@triptease/design-system-mcp`): Published via Changesets on release. Users with `npx -y` get the latest version automatically on each Claude session.
|
|
392
|
+
2. **Claude Code plugin** (`triptease-design-system` in the `triptease-plugins` marketplace): The plugin bundles an `.mcp.json` that points to this npm package. The plugin provides design guidance (SKILL.md) while this server provides structured component data.
|
|
393
|
+
|
|
394
|
+
Changes to component manifests, tokens, or setup guides in this repo propagate to users automatically after an npm release — no plugin update is needed. The plugin only needs updating when its own files change (SKILL.md, .mcp.json).
|
|
395
|
+
|
|
328
396
|
## Related
|
|
329
397
|
|
|
398
|
+
- **Design System Plugin**: [triptease/claude-plugins](https://github.com/triptease/claude-plugins) — `triptease-design-system` marketplace plugin
|
|
330
399
|
- **Design System Documentation**: For design system patterns and usage, see the main component library README
|
|
331
400
|
- **MCP Protocol**: https://modelcontextprotocol.io/
|
package/dist/index.js
CHANGED
|
@@ -7656,11 +7656,11 @@ function datetimeRegex(args) {
|
|
|
7656
7656
|
regex = `${regex}(${opts.join("|")})`;
|
|
7657
7657
|
return new RegExp(`^${regex}$`);
|
|
7658
7658
|
}
|
|
7659
|
-
function isValidIP(ip,
|
|
7660
|
-
if ((
|
|
7659
|
+
function isValidIP(ip, version8) {
|
|
7660
|
+
if ((version8 === "v4" || !version8) && ipv4Regex.test(ip)) {
|
|
7661
7661
|
return true;
|
|
7662
7662
|
}
|
|
7663
|
-
if ((
|
|
7663
|
+
if ((version8 === "v6" || !version8) && ipv6Regex.test(ip)) {
|
|
7664
7664
|
return true;
|
|
7665
7665
|
}
|
|
7666
7666
|
return false;
|
|
@@ -7687,11 +7687,11 @@ function isValidJWT(jwt2, alg) {
|
|
|
7687
7687
|
return false;
|
|
7688
7688
|
}
|
|
7689
7689
|
}
|
|
7690
|
-
function isValidCidr(ip,
|
|
7691
|
-
if ((
|
|
7690
|
+
function isValidCidr(ip, version8) {
|
|
7691
|
+
if ((version8 === "v4" || !version8) && ipv4CidrRegex.test(ip)) {
|
|
7692
7692
|
return true;
|
|
7693
7693
|
}
|
|
7694
|
-
if ((
|
|
7694
|
+
if ((version8 === "v6" || !version8) && ipv6CidrRegex.test(ip)) {
|
|
7695
7695
|
return true;
|
|
7696
7696
|
}
|
|
7697
7697
|
return false;
|
|
@@ -11644,10 +11644,10 @@ var nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
|
11644
11644
|
var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
11645
11645
|
var extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
11646
11646
|
var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
11647
|
-
var uuid = (
|
|
11648
|
-
if (!
|
|
11647
|
+
var uuid = (version8) => {
|
|
11648
|
+
if (!version8)
|
|
11649
11649
|
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
11650
|
-
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${
|
|
11650
|
+
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version8}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
11651
11651
|
};
|
|
11652
11652
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
11653
11653
|
var uuid6 = /* @__PURE__ */ uuid(6);
|
|
@@ -23302,7 +23302,7 @@ var StdioServerTransport = class {
|
|
|
23302
23302
|
// package.json
|
|
23303
23303
|
var package_default = {
|
|
23304
23304
|
name: "@triptease/design-system-mcp",
|
|
23305
|
-
version: "1.1
|
|
23305
|
+
version: "1.2.1",
|
|
23306
23306
|
description: "MCP server for Triptease design system documentation",
|
|
23307
23307
|
type: "module",
|
|
23308
23308
|
main: "dist/index.js",
|
|
@@ -23334,6 +23334,8 @@ var package_default = {
|
|
|
23334
23334
|
"@triptease/tt-highlight": "1.1.1",
|
|
23335
23335
|
"@triptease/tt-line-chart": "1.1.2",
|
|
23336
23336
|
"@triptease/tt-milestone": "1.1.1",
|
|
23337
|
+
"@triptease/tt-paginator": "1.0.4",
|
|
23338
|
+
"@triptease/tt-table-wrapper": "1.0.3",
|
|
23337
23339
|
"@triptease/tt-tabs": "1.1.0"
|
|
23338
23340
|
},
|
|
23339
23341
|
dependencies: {
|
|
@@ -23845,35 +23847,119 @@ var card_default = {
|
|
|
23845
23847
|
}
|
|
23846
23848
|
};
|
|
23847
23849
|
|
|
23850
|
+
// src/utils/buildCDNUrls.ts
|
|
23851
|
+
var buildCDNUrl = (componentName, version8) => {
|
|
23852
|
+
return `https://cdn.design-system.triptease.io/${componentName}/${version8}/${componentName}.js`;
|
|
23853
|
+
};
|
|
23854
|
+
var buildMajorVersion = (version8) => `${version8.split(".")[0]}.x.x`;
|
|
23855
|
+
|
|
23848
23856
|
// src/manifests/components/entries/table.ts
|
|
23857
|
+
var tableWrapperVersion = package_default.componentVersions["@triptease/tt-table-wrapper"];
|
|
23858
|
+
var paginatorVersion = package_default.componentVersions["@triptease/tt-paginator"];
|
|
23849
23859
|
var table_default = {
|
|
23850
23860
|
table: {
|
|
23851
23861
|
name: "Table",
|
|
23852
|
-
description: "
|
|
23862
|
+
description: "Display structured data in rows and columns. Wrap in tt-table-wrapper to add sorting and pagination.",
|
|
23853
23863
|
element: "table",
|
|
23854
23864
|
usageGuidance: {
|
|
23855
23865
|
whenToUse: [
|
|
23856
|
-
"Display structured data with multiple attributes",
|
|
23857
|
-
"
|
|
23858
|
-
"
|
|
23859
|
-
"Show data relationships clearly"
|
|
23866
|
+
"Display structured data with multiple attributes that users need to compare",
|
|
23867
|
+
"Present numerical or tabular information where row-by-row comparison matters",
|
|
23868
|
+
"Show data relationships across a consistent set of columns"
|
|
23860
23869
|
],
|
|
23861
23870
|
avoid: [
|
|
23862
|
-
"For layout purposes
|
|
23863
|
-
"When data is better
|
|
23864
|
-
"For small amounts of data that
|
|
23865
|
-
"On small screens where columns
|
|
23871
|
+
"For layout purposes \u2014 use CSS Grid or Flexbox instead",
|
|
23872
|
+
"When data is better visualised as a chart or graph",
|
|
23873
|
+
"For small amounts of data that would read more naturally as a list",
|
|
23874
|
+
"On small screens where columns cannot fit \u2014 consider alternative layouts"
|
|
23875
|
+
],
|
|
23876
|
+
accessibility: [
|
|
23877
|
+
'Use th scope="col" on column headers to help screen readers associate cells with their headings',
|
|
23878
|
+
'Sortable column headers receive aria-sort="ascending" or aria-sort="descending" automatically when using tt-table-wrapper',
|
|
23879
|
+
"Add a caption to provide an accessible label for the table, especially when multiple tables appear on the same page",
|
|
23880
|
+
"Do not rely on visual position alone to convey data relationships \u2014 use semantic HTML (th, scope) so the structure is machine-readable"
|
|
23881
|
+
]
|
|
23882
|
+
},
|
|
23883
|
+
installationOptions: {
|
|
23884
|
+
npm: [
|
|
23885
|
+
{
|
|
23886
|
+
name: "@triptease/tt-table-wrapper",
|
|
23887
|
+
includesTypes: true,
|
|
23888
|
+
optional: true,
|
|
23889
|
+
guidance: "Required for sorting and pagination."
|
|
23890
|
+
},
|
|
23891
|
+
{
|
|
23892
|
+
name: "@triptease/tt-paginator",
|
|
23893
|
+
includesTypes: true,
|
|
23894
|
+
optional: true,
|
|
23895
|
+
guidance: "Peer dependency of tt-table-wrapper \u2014 install alongside it."
|
|
23896
|
+
}
|
|
23897
|
+
],
|
|
23898
|
+
cdn: [
|
|
23899
|
+
{
|
|
23900
|
+
name: "tt-table-wrapper",
|
|
23901
|
+
includesTypes: false,
|
|
23902
|
+
optional: true,
|
|
23903
|
+
moduleFormat: "esm",
|
|
23904
|
+
pinnedVersionUrl: buildCDNUrl("tt-table-wrapper", tableWrapperVersion),
|
|
23905
|
+
pinnedMajorVersionUrl: buildCDNUrl("tt-table-wrapper", buildMajorVersion(tableWrapperVersion)),
|
|
23906
|
+
latestVersionUrl: buildCDNUrl("tt-table-wrapper", "latest"),
|
|
23907
|
+
guidance: "Optional \u2014 required for sorting and pagination. Prefer pinned major version URL."
|
|
23908
|
+
},
|
|
23909
|
+
{
|
|
23910
|
+
name: "tt-paginator",
|
|
23911
|
+
includesTypes: false,
|
|
23912
|
+
optional: true,
|
|
23913
|
+
moduleFormat: "esm",
|
|
23914
|
+
pinnedVersionUrl: buildCDNUrl("tt-paginator", paginatorVersion),
|
|
23915
|
+
pinnedMajorVersionUrl: buildCDNUrl("tt-paginator", buildMajorVersion(paginatorVersion)),
|
|
23916
|
+
latestVersionUrl: buildCDNUrl("tt-paginator", "latest"),
|
|
23917
|
+
guidance: "Peer dependency of tt-table-wrapper \u2014 must be loaded before it."
|
|
23918
|
+
}
|
|
23866
23919
|
]
|
|
23867
23920
|
},
|
|
23921
|
+
dataAttributes: {
|
|
23922
|
+
"data-sort-key": {
|
|
23923
|
+
type: "string",
|
|
23924
|
+
description: "Add to th elements to make them sortable. The value identifies the column and is included in the sort-change event detail."
|
|
23925
|
+
}
|
|
23926
|
+
},
|
|
23927
|
+
attributes: {
|
|
23928
|
+
"total-rows": {
|
|
23929
|
+
type: "number",
|
|
23930
|
+
default: "0",
|
|
23931
|
+
description: "Set on tt-table-wrapper. Total number of rows in the full dataset, used by the embedded paginator."
|
|
23932
|
+
},
|
|
23933
|
+
"page-size": {
|
|
23934
|
+
type: "number",
|
|
23935
|
+
default: "10",
|
|
23936
|
+
description: "Set on tt-table-wrapper. Number of rows per page, used by the embedded paginator."
|
|
23937
|
+
}
|
|
23938
|
+
},
|
|
23939
|
+
events: {
|
|
23940
|
+
"sort-change": {
|
|
23941
|
+
description: "Fired by tt-table-wrapper when the user clicks a sortable column header.",
|
|
23942
|
+
detail: {
|
|
23943
|
+
key: "string \u2014 the data-sort-key value of the clicked header",
|
|
23944
|
+
direction: "SortDirection \u2014 'asc' | 'desc' | 'none'"
|
|
23945
|
+
},
|
|
23946
|
+
bubbles: true
|
|
23947
|
+
},
|
|
23948
|
+
"page-change": {
|
|
23949
|
+
description: "Fired by tt-table-wrapper when the user navigates pages.",
|
|
23950
|
+
detail: { page: "number \u2014 the 1-indexed page number" },
|
|
23951
|
+
bubbles: true
|
|
23952
|
+
}
|
|
23953
|
+
},
|
|
23868
23954
|
examples: [
|
|
23869
23955
|
{
|
|
23870
23956
|
title: "Basic table",
|
|
23871
23957
|
code: `<table>
|
|
23872
23958
|
<thead>
|
|
23873
23959
|
<tr>
|
|
23874
|
-
<th>Property Name</th>
|
|
23875
|
-
<th>Impressions</th>
|
|
23876
|
-
<th>Revenue</th>
|
|
23960
|
+
<th scope="col">Property Name</th>
|
|
23961
|
+
<th scope="col">Impressions</th>
|
|
23962
|
+
<th scope="col">Revenue</th>
|
|
23877
23963
|
</tr>
|
|
23878
23964
|
</thead>
|
|
23879
23965
|
<tbody>
|
|
@@ -23882,8 +23968,81 @@ var table_default = {
|
|
|
23882
23968
|
<td>12,450</td>
|
|
23883
23969
|
<td>$5,760.00</td>
|
|
23884
23970
|
</tr>
|
|
23971
|
+
<tr>
|
|
23972
|
+
<td>Oceanview Villas</td>
|
|
23973
|
+
<td>9,875</td>
|
|
23974
|
+
<td>$3,420.00</td>
|
|
23975
|
+
</tr>
|
|
23885
23976
|
</tbody>
|
|
23886
23977
|
</table>`
|
|
23978
|
+
},
|
|
23979
|
+
{
|
|
23980
|
+
title: "Sortable table",
|
|
23981
|
+
description: "Use sortable columns when the user needs to compare rows by a specific attribute.",
|
|
23982
|
+
code: `<tt-table-wrapper>
|
|
23983
|
+
<table>
|
|
23984
|
+
<thead>
|
|
23985
|
+
<tr>
|
|
23986
|
+
<th scope="col" data-sort-key="name">Property Name</th>
|
|
23987
|
+
<th scope="col" data-sort-key="impressions">Impressions</th>
|
|
23988
|
+
<th scope="col" data-sort-key="revenue">Revenue</th>
|
|
23989
|
+
</tr>
|
|
23990
|
+
</thead>
|
|
23991
|
+
<tbody>
|
|
23992
|
+
<tr>
|
|
23993
|
+
<td>Downtown Suites</td>
|
|
23994
|
+
<td>12,450</td>
|
|
23995
|
+
<td>$5,760.00</td>
|
|
23996
|
+
</tr>
|
|
23997
|
+
<tr>
|
|
23998
|
+
<td>Oceanview Villas</td>
|
|
23999
|
+
<td>9,875</td>
|
|
24000
|
+
<td>$3,420.00</td>
|
|
24001
|
+
</tr>
|
|
24002
|
+
</tbody>
|
|
24003
|
+
</table>
|
|
24004
|
+
</tt-table-wrapper>
|
|
24005
|
+
|
|
24006
|
+
<script>
|
|
24007
|
+
const wrapper = document.querySelector('tt-table-wrapper');
|
|
24008
|
+
wrapper.addEventListener('sort-change', (e) => {
|
|
24009
|
+
// re-render tbody with data sorted by e.detail.key in e.detail.direction
|
|
24010
|
+
});
|
|
24011
|
+
</script>`
|
|
24012
|
+
},
|
|
24013
|
+
{
|
|
24014
|
+
title: "Paginated table",
|
|
24015
|
+
description: "Use pagination when the dataset is too large to display in a single table.",
|
|
24016
|
+
code: `<tt-table-wrapper total-rows="50" page-size="10">
|
|
24017
|
+
<table>
|
|
24018
|
+
<thead>
|
|
24019
|
+
<tr>
|
|
24020
|
+
<th scope="col">Property Name</th>
|
|
24021
|
+
<th scope="col">Impressions</th>
|
|
24022
|
+
<th scope="col">Revenue</th>
|
|
24023
|
+
</tr>
|
|
24024
|
+
</thead>
|
|
24025
|
+
<tbody>
|
|
24026
|
+
<tr>
|
|
24027
|
+
<td>Downtown Suites</td>
|
|
24028
|
+
<td>12,450</td>
|
|
24029
|
+
<td>$5,760.00</td>
|
|
24030
|
+
</tr>
|
|
24031
|
+
<tr>
|
|
24032
|
+
<td>Oceanview Villas</td>
|
|
24033
|
+
<td>9,875</td>
|
|
24034
|
+
<td>$3,420.00</td>
|
|
24035
|
+
</tr>
|
|
24036
|
+
</tbody>
|
|
24037
|
+
</table>
|
|
24038
|
+
</tt-table-wrapper>
|
|
24039
|
+
|
|
24040
|
+
<script>
|
|
24041
|
+
const wrapper = document.querySelector('tt-table-wrapper');
|
|
24042
|
+
wrapper.addEventListener('page-change', (e) => {
|
|
24043
|
+
// re-render tbody with the slice for e.detail.page
|
|
24044
|
+
});
|
|
24045
|
+
</script>`
|
|
23887
24046
|
}
|
|
23888
24047
|
]
|
|
23889
24048
|
}
|
|
@@ -23922,12 +24081,6 @@ var typography_default = {
|
|
|
23922
24081
|
}
|
|
23923
24082
|
};
|
|
23924
24083
|
|
|
23925
|
-
// src/utils/buildCDNUrls.ts
|
|
23926
|
-
var buildCDNUrl = (componentName, version7) => {
|
|
23927
|
-
return `https://cdn.design-system.triptease.io/${componentName}/${version7}/${componentName}.js`;
|
|
23928
|
-
};
|
|
23929
|
-
var buildMajorVersion = (version7) => `${version7.split(".")[0]}.x.x`;
|
|
23930
|
-
|
|
23931
24084
|
// src/manifests/components/entries/dialog.ts
|
|
23932
24085
|
var version2 = package_default.componentVersions["@triptease/tt-dialog"];
|
|
23933
24086
|
var dialog_default = {
|
|
@@ -24898,6 +25051,86 @@ var tabs_default = {
|
|
|
24898
25051
|
}
|
|
24899
25052
|
};
|
|
24900
25053
|
|
|
25054
|
+
// src/manifests/components/entries/paginator.ts
|
|
25055
|
+
var version7 = package_default.componentVersions["@triptease/tt-paginator"];
|
|
25056
|
+
var paginator_default = {
|
|
25057
|
+
paginator: {
|
|
25058
|
+
name: "Paginator - Web Component",
|
|
25059
|
+
description: "Numeric pagination component for navigating through paged data",
|
|
25060
|
+
ssrSafe: true,
|
|
25061
|
+
element: "tt-paginator",
|
|
25062
|
+
usageGuidance: {
|
|
25063
|
+
whenToUse: [
|
|
25064
|
+
"Navigating through large datasets split into pages",
|
|
25065
|
+
"Providing page controls below tables or lists",
|
|
25066
|
+
"When the total number of items is known upfront"
|
|
25067
|
+
],
|
|
25068
|
+
bestPractices: [
|
|
25069
|
+
"Set total-rows and page-size attributes to control pagination",
|
|
25070
|
+
"Listen for the page-change event to fetch or display the correct page of data",
|
|
25071
|
+
"The component auto-hides when there is only one page or fewer"
|
|
25072
|
+
],
|
|
25073
|
+
accessibility: [
|
|
25074
|
+
"Keyboard navigation: ArrowRight/ArrowLeft for next/previous, Home/End for first/last",
|
|
25075
|
+
'Uses role="navigation" with aria-label="Pagination"',
|
|
25076
|
+
'Active page is marked with aria-current="page"'
|
|
25077
|
+
],
|
|
25078
|
+
avoid: [
|
|
25079
|
+
"When the dataset is small enough to display without pagination",
|
|
25080
|
+
"For infinite scroll patterns (use intersection observers instead)",
|
|
25081
|
+
"Prefer tt-table-wrapper when paginating a table, as it embeds tt-paginator automatically"
|
|
25082
|
+
]
|
|
25083
|
+
},
|
|
25084
|
+
installationOptions: {
|
|
25085
|
+
npm: [{ name: "@triptease/tt-paginator", includesTypes: true, optional: false }],
|
|
25086
|
+
cdn: [
|
|
25087
|
+
{
|
|
25088
|
+
name: "tt-paginator",
|
|
25089
|
+
includesTypes: false,
|
|
25090
|
+
optional: false,
|
|
25091
|
+
moduleFormat: "esm",
|
|
25092
|
+
pinnedVersionUrl: buildCDNUrl("tt-paginator", version7),
|
|
25093
|
+
pinnedMajorVersionUrl: buildCDNUrl("tt-paginator", buildMajorVersion(version7)),
|
|
25094
|
+
latestVersionUrl: buildCDNUrl("tt-paginator", "latest"),
|
|
25095
|
+
guidance: "Prefer pinned major version URL to avoid unexpected breaking changes. Do not use latest version URL in production code."
|
|
25096
|
+
}
|
|
25097
|
+
]
|
|
25098
|
+
},
|
|
25099
|
+
attributes: {
|
|
25100
|
+
"total-rows": {
|
|
25101
|
+
type: "number",
|
|
25102
|
+
default: "0",
|
|
25103
|
+
description: "Total number of rows in the dataset. Used to calculate total pages."
|
|
25104
|
+
},
|
|
25105
|
+
"page-size": {
|
|
25106
|
+
type: "number",
|
|
25107
|
+
default: "10",
|
|
25108
|
+
description: "Number of rows per page."
|
|
25109
|
+
}
|
|
25110
|
+
},
|
|
25111
|
+
events: {
|
|
25112
|
+
"page-change": {
|
|
25113
|
+
description: "Fired when the user navigates to a different page.",
|
|
25114
|
+
detail: { page: "number \u2014 the 1-indexed page number" },
|
|
25115
|
+
bubbles: true
|
|
25116
|
+
}
|
|
25117
|
+
},
|
|
25118
|
+
examples: [
|
|
25119
|
+
{
|
|
25120
|
+
title: "Basic usage",
|
|
25121
|
+
code: `<tt-paginator total-rows="100" page-size="10"></tt-paginator>
|
|
25122
|
+
|
|
25123
|
+
<script>
|
|
25124
|
+
document.querySelector('tt-paginator')
|
|
25125
|
+
.addEventListener('page-change', (e) => {
|
|
25126
|
+
console.log('Page:', e.detail.page);
|
|
25127
|
+
});
|
|
25128
|
+
</script>`
|
|
25129
|
+
}
|
|
25130
|
+
]
|
|
25131
|
+
}
|
|
25132
|
+
};
|
|
25133
|
+
|
|
24901
25134
|
// src/manifests/components/index.ts
|
|
24902
25135
|
var componentManifest = {
|
|
24903
25136
|
...button_default,
|
|
@@ -24920,7 +25153,8 @@ var componentManifest = {
|
|
|
24920
25153
|
...lineChart_default,
|
|
24921
25154
|
...statistic_default,
|
|
24922
25155
|
...banner_default,
|
|
24923
|
-
...tabs_default
|
|
25156
|
+
...tabs_default,
|
|
25157
|
+
...paginator_default
|
|
24924
25158
|
};
|
|
24925
25159
|
|
|
24926
25160
|
// src/resources/components/list.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@triptease/design-system-mcp",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "MCP server for Triptease design system documentation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"@triptease/tt-highlight": "1.1.1",
|
|
33
33
|
"@triptease/tt-line-chart": "1.1.2",
|
|
34
34
|
"@triptease/tt-milestone": "1.1.1",
|
|
35
|
+
"@triptease/tt-paginator": "1.0.4",
|
|
36
|
+
"@triptease/tt-table-wrapper": "1.0.3",
|
|
35
37
|
"@triptease/tt-tabs": "1.1.0"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|