@fundamental-styles/mcp 0.41.7-rc.2 → 0.41.7-rc.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/data/CHANGELOG.md +7 -3
- package/data/component-catalog.json +52 -28
- package/package.json +1 -1
- package/src/helpers.d.ts +42 -0
- package/src/helpers.js +75 -0
- package/src/helpers.js.map +1 -1
- package/src/server.js +611 -170
- package/src/server.js.map +1 -1
- package/src/update-descriptions.d.ts +8 -0
- package/src/update-descriptions.js +75 -0
- package/src/update-descriptions.js.map +1 -0
- package/src/validate-data.d.ts +11 -0
- package/src/validate-data.js +198 -0
- package/src/validate-data.js.map +1 -0
package/data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.41.7-rc.3](https://github.com/SAP/fundamental-styles/compare/v0.41.7-rc.2...v0.41.7-rc.3) (2026-05-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package fundamental-styles
|
|
9
|
+
|
|
6
10
|
## [0.41.7-rc.2](https://github.com/SAP/fundamental-styles/compare/v0.41.7-rc.1...v0.41.7-rc.2) (2026-05-14)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package fundamental-styles
|
|
@@ -6877,9 +6881,9 @@ Co-authored-by: droshev <mladen.droshev@sap.com>
|
|
|
6877
6881
|
|
|
6878
6882
|
- added a new modifier class to fd-row to achieve even alignment of its elements:fd-row--top in a form.
|
|
6879
6883
|
Before:
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6884
|
+
<div class="fd-row">
|
|
6885
|
+
After:
|
|
6886
|
+
<div class="fd-row fd-row--top">
|
|
6883
6887
|
|
|
6884
6888
|
### Bug Fixes
|
|
6885
6889
|
|
|
@@ -346,7 +346,11 @@
|
|
|
346
346
|
"role": null,
|
|
347
347
|
"ariaAttributes": []
|
|
348
348
|
},
|
|
349
|
-
"relatedComponents": [
|
|
349
|
+
"relatedComponents": [
|
|
350
|
+
"ai-writing-assistant",
|
|
351
|
+
"ai-text",
|
|
352
|
+
"ai-busy-indicator"
|
|
353
|
+
],
|
|
350
354
|
"dependencies": []
|
|
351
355
|
},
|
|
352
356
|
{
|
|
@@ -957,7 +961,7 @@
|
|
|
957
961
|
{
|
|
958
962
|
"id": "badge",
|
|
959
963
|
"name": "Badge",
|
|
960
|
-
"description": "
|
|
964
|
+
"description": "Badges display small amounts of color-coded meta information. Use to highlight entity states, notifications, or counts (e.g., \"3 pending items\"). Can be filled or outlined, with semantic colors for status indication.",
|
|
961
965
|
"baseClass": "fd-badge",
|
|
962
966
|
"cssImport": "fundamental-styles/dist/badge.css",
|
|
963
967
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-badge",
|
|
@@ -1326,7 +1330,7 @@
|
|
|
1326
1330
|
{
|
|
1327
1331
|
"id": "button-split",
|
|
1328
1332
|
"name": "Button Split",
|
|
1329
|
-
"description": "
|
|
1333
|
+
"description": "Split buttons combine a primary action with a dropdown menu of related secondary actions. The primary action executes immediately when clicked, while the arrow reveals additional options. Use when one option is used more frequently than others.",
|
|
1330
1334
|
"baseClass": "fd-button-split",
|
|
1331
1335
|
"cssImport": "fundamental-styles/dist/button-split.css",
|
|
1332
1336
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-button-split",
|
|
@@ -2721,7 +2725,7 @@
|
|
|
2721
2725
|
{
|
|
2722
2726
|
"id": "counter",
|
|
2723
2727
|
"name": "Counter",
|
|
2724
|
-
"description": "
|
|
2728
|
+
"description": "Counters display numerical values with optional indicators (e.g., \"5 new messages\"). Typically used in navigation items, cards, or list headers to show counts, notifications, or status summaries.",
|
|
2725
2729
|
"baseClass": "fd-counter",
|
|
2726
2730
|
"cssImport": "fundamental-styles/dist/counter.css",
|
|
2727
2731
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-counter",
|
|
@@ -2924,7 +2928,7 @@
|
|
|
2924
2928
|
{
|
|
2925
2929
|
"id": "dynamic-page",
|
|
2926
2930
|
"name": "Dynamic Page",
|
|
2927
|
-
"description": "Dynamic Page
|
|
2931
|
+
"description": "Dynamic Page is foundation for all SAP pages. Generic layout supporting various use cases with variable header and page content. Header is collapsible to help users focus on content while keeping important header info and actions readily available. Uses foundation layout components (dynamic page header, footer toolbar).",
|
|
2928
2932
|
"baseClass": "fd-dynamic-page",
|
|
2929
2933
|
"cssImport": "fundamental-styles/dist/dynamic-page.css",
|
|
2930
2934
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-dynamic-page",
|
|
@@ -3166,7 +3170,7 @@
|
|
|
3166
3170
|
{
|
|
3167
3171
|
"id": "dynamic-side-content",
|
|
3168
3172
|
"name": "Dynamic Side Content",
|
|
3169
|
-
"description": "Dynamic Side Content
|
|
3173
|
+
"description": "Dynamic Side Content is layout control displaying supplemental content in separate area to support understanding of main content. Two elements: side content section (`.fd-dynamic-side__side`) and main content section (`.fd-dynamic-side__main`). Screen width ratio varies based on available space - side displays left/right or bottom if space limited.",
|
|
3170
3174
|
"baseClass": "fd-dynamic-side-content",
|
|
3171
3175
|
"cssImport": "fundamental-styles/dist/dynamic-side-content.css",
|
|
3172
3176
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-dynamic-side-content",
|
|
@@ -3222,7 +3226,7 @@
|
|
|
3222
3226
|
{
|
|
3223
3227
|
"id": "facet",
|
|
3224
3228
|
"name": "Facet",
|
|
3225
|
-
"description": "
|
|
3229
|
+
"description": "Facets display key-value pairs in a compact, scannable format. Use in object headers or cards to show essential information like status, date, owner, or metrics. Supports icons and semantic colors.",
|
|
3226
3230
|
"baseClass": "fd-facet",
|
|
3227
3231
|
"cssImport": "fundamental-styles/dist/facet.css",
|
|
3228
3232
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-facet",
|
|
@@ -3476,7 +3480,7 @@
|
|
|
3476
3480
|
{
|
|
3477
3481
|
"id": "fieldset",
|
|
3478
3482
|
"name": "Fieldset",
|
|
3479
|
-
"description": "
|
|
3483
|
+
"description": "A fieldset gives semantic meaning to a group of elements inside a form (e.g., Billing or Shipping Address). Grouping fields provides styling and accessibility benefits, and is especially important for checkbox groups and radio button groups.",
|
|
3480
3484
|
"baseClass": "fd-fieldset",
|
|
3481
3485
|
"cssImport": "fundamental-styles/dist/fieldset.css",
|
|
3482
3486
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-fieldset",
|
|
@@ -3671,7 +3675,7 @@
|
|
|
3671
3675
|
{
|
|
3672
3676
|
"id": "flexible-column-layout",
|
|
3673
3677
|
"name": "Flexible Column Layout",
|
|
3674
|
-
"description": "Flexible Column Layout
|
|
3678
|
+
"description": "Flexible Column Layout is layout control displaying multiple floorplans on single page. Enables faster, more fluid navigation between floorplans than page-by-page. Offers layouts with up to 3 columns (1, 2, 3). Users can resize columns, switch layouts, view rightmost column in full screen. Responsive for desktop and mobile.",
|
|
3675
3679
|
"baseClass": "fd-flexible-column-layout",
|
|
3676
3680
|
"cssImport": "fundamental-styles/dist/flexible-column-layout.css",
|
|
3677
3681
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-flexible-column-layout",
|
|
@@ -3738,7 +3742,7 @@
|
|
|
3738
3742
|
{
|
|
3739
3743
|
"id": "form-group",
|
|
3740
3744
|
"name": "Form Group",
|
|
3741
|
-
"description": "Form
|
|
3745
|
+
"description": "Form groups assemble form elements with labels, messages, and help containers. Components like `fd-form__item` with label and control can be used independently when error messages aren't needed.",
|
|
3742
3746
|
"baseClass": "fd-form-group",
|
|
3743
3747
|
"cssImport": "fundamental-styles/dist/form-group.css",
|
|
3744
3748
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-form-group",
|
|
@@ -3804,7 +3808,7 @@
|
|
|
3804
3808
|
{
|
|
3805
3809
|
"id": "form-header",
|
|
3806
3810
|
"name": "Form Header",
|
|
3807
|
-
"description": "Form
|
|
3811
|
+
"description": "Form headers are titles that provide context about a group of input fields. For example, \"Personal Information\" would categorize fields like Name, Address, etc.",
|
|
3808
3812
|
"baseClass": "fd-form-header",
|
|
3809
3813
|
"cssImport": "fundamental-styles/dist/form-header.css",
|
|
3810
3814
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-form-header",
|
|
@@ -3991,7 +3995,7 @@
|
|
|
3991
3995
|
{
|
|
3992
3996
|
"id": "form-message",
|
|
3993
3997
|
"name": "Form Message",
|
|
3994
|
-
"description": "Form
|
|
3998
|
+
"description": "Form messages display value state text (success, error, warning, information) shown when focus is on the input field. They work with input control value states to provide feedback to users.",
|
|
3995
3999
|
"baseClass": "fd-form-message",
|
|
3996
4000
|
"cssImport": "fundamental-styles/dist/form-message.css",
|
|
3997
4001
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-form-message",
|
|
@@ -4140,7 +4144,7 @@
|
|
|
4140
4144
|
{
|
|
4141
4145
|
"id": "grid-list",
|
|
4142
4146
|
"name": "Grid List",
|
|
4143
|
-
"description": "Grid
|
|
4147
|
+
"description": "Grid list displays items in a grid format (not rows), ideal for visual content like images, charts, and object cards that benefit from more height. Usually used as an alternative view for lists or tables, focusing on complete items rather than cells.",
|
|
4144
4148
|
"baseClass": "fd-item",
|
|
4145
4149
|
"cssImport": "fundamental-styles/dist/grid-list.css",
|
|
4146
4150
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-grid-list",
|
|
@@ -4249,7 +4253,12 @@
|
|
|
4249
4253
|
"role": null,
|
|
4250
4254
|
"ariaAttributes": []
|
|
4251
4255
|
},
|
|
4252
|
-
"relatedComponents": [
|
|
4256
|
+
"relatedComponents": [
|
|
4257
|
+
"layout",
|
|
4258
|
+
"layout-grid",
|
|
4259
|
+
"margins",
|
|
4260
|
+
"paddings"
|
|
4261
|
+
],
|
|
4253
4262
|
"dependencies": []
|
|
4254
4263
|
},
|
|
4255
4264
|
{
|
|
@@ -4984,7 +4993,7 @@
|
|
|
4984
4993
|
{
|
|
4985
4994
|
"id": "input-group",
|
|
4986
4995
|
"name": "Input Group",
|
|
4987
|
-
"description": "Input Group
|
|
4996
|
+
"description": "Input Group combines form inputs with add-ons (text, icons, or buttons) to help users understand the information being entered. Add-ons can be positioned before, after, or on both sides of the input field. Supports validation states (success, error, warning, information).",
|
|
4988
4997
|
"baseClass": "fd-input-group",
|
|
4989
4998
|
"cssImport": "fundamental-styles/dist/input-group.css",
|
|
4990
4999
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-input-group",
|
|
@@ -5172,7 +5181,7 @@
|
|
|
5172
5181
|
{
|
|
5173
5182
|
"id": "layout-panel",
|
|
5174
5183
|
"name": "Layout Panel",
|
|
5175
|
-
"description": "Layout
|
|
5184
|
+
"description": "Layout Panels encapsulate part of content, form elements, lists, collections on a page. Place patterns and interactions within panels to achieve focus and separation for tasks with information displayed inside panel. Organizes content into distinct sections.",
|
|
5176
5185
|
"baseClass": "fd-layout-panel",
|
|
5177
5186
|
"cssImport": "fundamental-styles/dist/layout-panel.css",
|
|
5178
5187
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-layout-panel",
|
|
@@ -5762,7 +5771,11 @@
|
|
|
5762
5771
|
"role": null,
|
|
5763
5772
|
"ariaAttributes": []
|
|
5764
5773
|
},
|
|
5765
|
-
"relatedComponents": [
|
|
5774
|
+
"relatedComponents": [
|
|
5775
|
+
"paddings",
|
|
5776
|
+
"layout",
|
|
5777
|
+
"layout-grid"
|
|
5778
|
+
],
|
|
5766
5779
|
"dependencies": []
|
|
5767
5780
|
},
|
|
5768
5781
|
{
|
|
@@ -8127,7 +8140,10 @@
|
|
|
8127
8140
|
"role": null,
|
|
8128
8141
|
"ariaAttributes": []
|
|
8129
8142
|
},
|
|
8130
|
-
"relatedComponents": [
|
|
8143
|
+
"relatedComponents": [
|
|
8144
|
+
"helpers",
|
|
8145
|
+
"link"
|
|
8146
|
+
],
|
|
8131
8147
|
"dependencies": []
|
|
8132
8148
|
},
|
|
8133
8149
|
{
|
|
@@ -8175,7 +8191,11 @@
|
|
|
8175
8191
|
"role": null,
|
|
8176
8192
|
"ariaAttributes": []
|
|
8177
8193
|
},
|
|
8178
|
-
"relatedComponents": [
|
|
8194
|
+
"relatedComponents": [
|
|
8195
|
+
"margins",
|
|
8196
|
+
"layout",
|
|
8197
|
+
"layout-grid"
|
|
8198
|
+
],
|
|
8179
8199
|
"dependencies": []
|
|
8180
8200
|
},
|
|
8181
8201
|
{
|
|
@@ -8232,7 +8252,7 @@
|
|
|
8232
8252
|
{
|
|
8233
8253
|
"id": "page",
|
|
8234
8254
|
"name": "Page",
|
|
8235
|
-
"description": "Page
|
|
8255
|
+
"description": "Page is the foundation wrapper for all application pages. Provides consistent structure with optional header, footer, and content areas. Use as the outermost container for every page in your application.",
|
|
8236
8256
|
"baseClass": "fd-page",
|
|
8237
8257
|
"cssImport": "fundamental-styles/dist/page.css",
|
|
8238
8258
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-page",
|
|
@@ -9598,7 +9618,11 @@
|
|
|
9598
9618
|
"role": null,
|
|
9599
9619
|
"ariaAttributes": []
|
|
9600
9620
|
},
|
|
9601
|
-
"relatedComponents": [
|
|
9621
|
+
"relatedComponents": [
|
|
9622
|
+
"layout",
|
|
9623
|
+
"splitter",
|
|
9624
|
+
"dynamic-side-content"
|
|
9625
|
+
],
|
|
9602
9626
|
"dependencies": []
|
|
9603
9627
|
},
|
|
9604
9628
|
{
|
|
@@ -9703,7 +9727,7 @@
|
|
|
9703
9727
|
{
|
|
9704
9728
|
"id": "section",
|
|
9705
9729
|
"name": "Section",
|
|
9706
|
-
"description": "
|
|
9730
|
+
"description": "Sections group related content on a page with optional headers and visual separation. Use to organize page content into logical, scannable blocks. Can be collapsible to help users focus on relevant information.",
|
|
9707
9731
|
"baseClass": "fd-section",
|
|
9708
9732
|
"cssImport": "fundamental-styles/dist/section.css",
|
|
9709
9733
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-section",
|
|
@@ -10351,7 +10375,7 @@
|
|
|
10351
10375
|
{
|
|
10352
10376
|
"id": "side-nav",
|
|
10353
10377
|
"name": "Side Nav",
|
|
10354
|
-
"description": "Side
|
|
10378
|
+
"description": "Side Navigation provides hierarchical navigation for applications. Displays a collapsible sidebar with navigation items, icons, and nested submenus. Use for primary app navigation in the Shellbar or as dedicated sidebar.",
|
|
10355
10379
|
"baseClass": "fd-side-nav",
|
|
10356
10380
|
"cssImport": "fundamental-styles/dist/side-nav.css",
|
|
10357
10381
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-side-nav",
|
|
@@ -10639,7 +10663,7 @@
|
|
|
10639
10663
|
{
|
|
10640
10664
|
"id": "splitter",
|
|
10641
10665
|
"name": "Splitter",
|
|
10642
|
-
"description": "Splitter
|
|
10666
|
+
"description": "Splitter divides screen into resizable panes separated by a draggable divider. Users can adjust pane sizes by dragging the separator. Use for master-detail layouts or comparing content side-by-side.",
|
|
10643
10667
|
"baseClass": "fd-splitter",
|
|
10644
10668
|
"cssImport": "fundamental-styles/dist/splitter.css",
|
|
10645
10669
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-splitter",
|
|
@@ -11654,7 +11678,7 @@
|
|
|
11654
11678
|
{
|
|
11655
11679
|
"id": "tabs",
|
|
11656
11680
|
"name": "Tabs",
|
|
11657
|
-
"description": "Tabs
|
|
11681
|
+
"description": "Tabs organize content into separate views, allowing users to switch between different sections without leaving the page. Use for dividing content into meaningful categories that users can explore one at a time.",
|
|
11658
11682
|
"baseClass": "fd-tabs__process",
|
|
11659
11683
|
"cssImport": "fundamental-styles/dist/tabs.css",
|
|
11660
11684
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-tabs",
|
|
@@ -11955,7 +11979,7 @@
|
|
|
11955
11979
|
{
|
|
11956
11980
|
"id": "tile",
|
|
11957
11981
|
"name": "Tile",
|
|
11958
|
-
"description": "
|
|
11982
|
+
"description": "Tiles display summarized information or entry points to applications, pages, or actions. Use in home pages, launchpads, or dashboards to present options in a grid layout. Can include icons, titles, subtitles, and quick actions.",
|
|
11959
11983
|
"baseClass": "fd-tile",
|
|
11960
11984
|
"cssImport": "fundamental-styles/dist/tile.css",
|
|
11961
11985
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-tile",
|
|
@@ -12812,7 +12836,7 @@
|
|
|
12812
12836
|
{
|
|
12813
12837
|
"id": "tool-layout",
|
|
12814
12838
|
"name": "Tool Layout",
|
|
12815
|
-
"description": "Tool Layout
|
|
12839
|
+
"description": "Tool Layout consists of three main areas: Tool Header (always present, top-aligned with global actions and navigation controls), Navigation (side navigation in expanded/snapped variants), and Content (empty container for any content). Complete layout structure for tool-based applications.",
|
|
12816
12840
|
"baseClass": "fd-tool-layout",
|
|
12817
12841
|
"cssImport": "fundamental-styles/dist/tool-layout.css",
|
|
12818
12842
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-tool-layout",
|
|
@@ -13679,7 +13703,7 @@
|
|
|
13679
13703
|
{
|
|
13680
13704
|
"id": "wizard",
|
|
13681
13705
|
"name": "Wizard",
|
|
13682
|
-
"description": "Wizard
|
|
13706
|
+
"description": "Wizard guides user through long or unfamiliar task by dividing into sections, revealing information in digestible way. Consists of walkthrough screen (input required info) and summary page (read-only review before submission). Two types: standard (linear, known steps) and branching (non-linear, variable steps). Supports 3-8 steps, optional steps allowed.",
|
|
13683
13707
|
"baseClass": "fd-wizard",
|
|
13684
13708
|
"cssImport": "fundamental-styles/dist/wizard.css",
|
|
13685
13709
|
"storybookUrl": "https://sap.github.io/fundamental-styles/?path=/docs/components-wizard",
|
package/package.json
CHANGED
package/src/helpers.d.ts
CHANGED
|
@@ -2,3 +2,45 @@ import { ComponentMetadata } from './types/component-metadata';
|
|
|
2
2
|
export declare function findComponent(components: ComponentMetadata[], nameOrId: string): ComponentMetadata | undefined;
|
|
3
3
|
export declare function scoreMatch(component: ComponentMetadata, query: string): number;
|
|
4
4
|
export declare function truncate(text: string, maxLength: number): string;
|
|
5
|
+
/**
|
|
6
|
+
* Detect if a component has a generic/placeholder description
|
|
7
|
+
*/
|
|
8
|
+
export declare function hasGenericDescription(comp: ComponentMetadata): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Enhance a component description using available guidance data
|
|
11
|
+
*/
|
|
12
|
+
export declare function enhanceDescription(comp: ComponentMetadata, guidance?: {
|
|
13
|
+
description?: string;
|
|
14
|
+
whenToUse?: string[];
|
|
15
|
+
}): {
|
|
16
|
+
description: string;
|
|
17
|
+
enhanced: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Create data quality warnings for a component
|
|
21
|
+
*/
|
|
22
|
+
export interface DataQualityWarnings {
|
|
23
|
+
hasGenericDescription?: boolean;
|
|
24
|
+
missingExamples?: boolean;
|
|
25
|
+
emptyRelatedComponents?: boolean;
|
|
26
|
+
suggestions?: string[];
|
|
27
|
+
}
|
|
28
|
+
export declare function checkDataQuality(comp: ComponentMetadata, options: {
|
|
29
|
+
hasExamples: boolean;
|
|
30
|
+
hasGuidance: boolean;
|
|
31
|
+
}): DataQualityWarnings;
|
|
32
|
+
/**
|
|
33
|
+
* Check design token data quality
|
|
34
|
+
*/
|
|
35
|
+
export interface TokenQualityInfo {
|
|
36
|
+
hasPurpose: boolean;
|
|
37
|
+
hasValue: boolean;
|
|
38
|
+
hasCssUsage: boolean;
|
|
39
|
+
completeness: 'complete' | 'partial' | 'minimal';
|
|
40
|
+
}
|
|
41
|
+
export declare function checkTokenQuality(token: {
|
|
42
|
+
name: string;
|
|
43
|
+
purpose?: string;
|
|
44
|
+
value?: string;
|
|
45
|
+
cssUsage?: string;
|
|
46
|
+
}): TokenQualityInfo;
|
package/src/helpers.js
CHANGED
|
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.findComponent = findComponent;
|
|
4
4
|
exports.scoreMatch = scoreMatch;
|
|
5
5
|
exports.truncate = truncate;
|
|
6
|
+
exports.hasGenericDescription = hasGenericDescription;
|
|
7
|
+
exports.enhanceDescription = enhanceDescription;
|
|
8
|
+
exports.checkDataQuality = checkDataQuality;
|
|
9
|
+
exports.checkTokenQuality = checkTokenQuality;
|
|
6
10
|
function findComponent(components, nameOrId) {
|
|
7
11
|
const lower = nameOrId.toLowerCase();
|
|
8
12
|
// Exact match on id
|
|
@@ -77,4 +81,75 @@ function truncate(text, maxLength) {
|
|
|
77
81
|
return firstLine;
|
|
78
82
|
return firstLine.slice(0, maxLength - 3) + '...';
|
|
79
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Detect if a component has a generic/placeholder description
|
|
86
|
+
*/
|
|
87
|
+
function hasGenericDescription(comp) {
|
|
88
|
+
const desc = comp.description.toLowerCase();
|
|
89
|
+
// Patterns that indicate generic descriptions
|
|
90
|
+
return (desc.includes('component component') ||
|
|
91
|
+
desc === `${comp.name.toLowerCase()} component` ||
|
|
92
|
+
desc === comp.name.toLowerCase() ||
|
|
93
|
+
desc.length < 20 ||
|
|
94
|
+
desc.match(/^[a-z\s-]+ component$/i) !== null);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Enhance a component description using available guidance data
|
|
98
|
+
*/
|
|
99
|
+
function enhanceDescription(comp, guidance) {
|
|
100
|
+
// Use guidance description if available and better than catalog description
|
|
101
|
+
if ((guidance === null || guidance === void 0 ? void 0 : guidance.description) && guidance.description.length > 30) {
|
|
102
|
+
return { description: guidance.description, enhanced: true };
|
|
103
|
+
}
|
|
104
|
+
// If we have generic description but guidance has whenToUse, construct one
|
|
105
|
+
if (hasGenericDescription(comp) && (guidance === null || guidance === void 0 ? void 0 : guidance.whenToUse) && guidance.whenToUse.length > 0) {
|
|
106
|
+
const useCase = guidance.whenToUse[0];
|
|
107
|
+
return {
|
|
108
|
+
description: `${comp.name} - ${useCase}`,
|
|
109
|
+
enhanced: true
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return { description: comp.description, enhanced: false };
|
|
113
|
+
}
|
|
114
|
+
function checkDataQuality(comp, options) {
|
|
115
|
+
const warnings = {};
|
|
116
|
+
const suggestions = [];
|
|
117
|
+
// Check description quality
|
|
118
|
+
if (hasGenericDescription(comp)) {
|
|
119
|
+
warnings.hasGenericDescription = true;
|
|
120
|
+
if (!options.hasGuidance) {
|
|
121
|
+
suggestions.push('Component has a generic description. Use get_component_guidance for detailed information.');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Check for HTML examples
|
|
125
|
+
if (!options.hasExamples) {
|
|
126
|
+
warnings.missingExamples = true;
|
|
127
|
+
suggestions.push(`No HTML examples available. Check the Storybook docs: ${comp.storybookUrl}`);
|
|
128
|
+
}
|
|
129
|
+
// Check for related components
|
|
130
|
+
if (!comp.relatedComponents || comp.relatedComponents.length === 0) {
|
|
131
|
+
warnings.emptyRelatedComponents = true;
|
|
132
|
+
suggestions.push('No related components documented. Try search_components to find similar components.');
|
|
133
|
+
}
|
|
134
|
+
if (suggestions.length > 0) {
|
|
135
|
+
warnings.suggestions = suggestions;
|
|
136
|
+
}
|
|
137
|
+
return warnings;
|
|
138
|
+
}
|
|
139
|
+
function checkTokenQuality(token) {
|
|
140
|
+
const hasPurpose = Boolean(token.purpose && token.purpose.trim().length > 0);
|
|
141
|
+
const hasValue = Boolean(token.value && token.value.trim().length > 0);
|
|
142
|
+
const hasCssUsage = Boolean(token.cssUsage && token.cssUsage.trim().length > 0);
|
|
143
|
+
let completeness;
|
|
144
|
+
if (hasPurpose && hasValue && hasCssUsage) {
|
|
145
|
+
completeness = 'complete';
|
|
146
|
+
}
|
|
147
|
+
else if (hasPurpose || hasCssUsage) {
|
|
148
|
+
completeness = 'partial';
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
completeness = 'minimal';
|
|
152
|
+
}
|
|
153
|
+
return { hasPurpose, hasValue, hasCssUsage, completeness };
|
|
154
|
+
}
|
|
80
155
|
//# sourceMappingURL=helpers.js.map
|
package/src/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../packages/mcp/src/helpers.ts"],"names":[],"mappings":";;AAEA,sCA2BC;AAED,gCA+BC;AAED,4BAKC;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../packages/mcp/src/helpers.ts"],"names":[],"mappings":";;AAEA,sCA2BC;AAED,gCA+BC;AAED,4BAKC;AAKD,sDAWC;AAKD,gDAmBC;AAYD,4CAmCC;AAYD,8CAoBC;AA1LD,SAAgB,aAAa,CACzB,UAA+B,EAC/B,QAAgB;IAEhB,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAErC,oBAAoB;IACpB,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC;IACpD,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAEtB,2BAA2B;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,KAAK,IAAI,CAAC,CAAC,SAAS,KAAK,MAAM,KAAK,EAAE,CAAC,CAAC;IAC/F,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAE5B,sBAAsB;IACtB,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,CAAC;IACtE,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,sBAAsB;IACtB,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,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