@spaced-out/ui-design-system 0.5.18 → 0.5.19
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/.cspell/custom-words.txt +2 -0
- package/.github/workflows/publish-mcp.yml +81 -0
- package/CHANGELOG.md +9 -0
- package/COMPONENT_PROMPT_TEMPLATE.md +223 -0
- package/lib/components/PromptChip/PromptChip.d.ts +1 -0
- package/lib/components/PromptChip/PromptChip.d.ts.map +1 -1
- package/lib/components/PromptChip/PromptChip.js +14 -12
- package/lib/components/PromptChip/PromptChip.module.css +69 -37
- package/lib/components/TemplateCard/TemplateCard.d.ts +29 -0
- package/lib/components/TemplateCard/TemplateCard.d.ts.map +1 -0
- package/lib/components/TemplateCard/TemplateCard.js +92 -0
- package/lib/components/TemplateCard/TemplateCard.module.css +170 -0
- package/lib/components/TemplateCard/index.d.ts +2 -0
- package/lib/components/TemplateCard/index.d.ts.map +1 -0
- package/lib/components/TemplateCard/index.js +16 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +11 -0
- package/mcp/README.md +306 -0
- package/mcp/build-mcp-data.js +247 -0
- package/mcp/index.js +1239 -0
- package/mcp/package.json +44 -0
- package/mcp/test-server.js +65 -0
- package/package.json +1 -1
package/.cspell/custom-words.txt
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Author: Vishwanath
|
|
2
|
+
# Publishes the Genesis MCP Server to NPM when design system changes
|
|
3
|
+
|
|
4
|
+
name: Publish MCP Server to NPM
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
# Run after the main NPM publish workflow completes successfully
|
|
8
|
+
workflow_run:
|
|
9
|
+
workflows: ['Release Genesis to NPM']
|
|
10
|
+
types:
|
|
11
|
+
- completed
|
|
12
|
+
branches: [master]
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
publish-mcp:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
# Only run if triggered manually or if the workflow_run succeeded
|
|
19
|
+
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
|
20
|
+
steps:
|
|
21
|
+
- name: Check Permissions
|
|
22
|
+
id: check-permissions
|
|
23
|
+
env:
|
|
24
|
+
ALLOWED_USERS: superrover, Anant-Raj, diwakersurya, ashwini-sensehq, vish-sah, VishalBarnawal, sanskar-s, VivekJangid, sharad-kushwah, Swatantramishra1, bhatiarush27, darsh-mecwan-sense, keshavsensehq, SahilShrivastava1, aditya-kaushal, LakshayKumar-1
|
|
25
|
+
if: ${{ !contains(env.ALLOWED_USERS, github.actor) }}
|
|
26
|
+
run: |
|
|
27
|
+
echo "You don't have correct permissions to publish the MCP server"
|
|
28
|
+
exit 1
|
|
29
|
+
|
|
30
|
+
- name: Checkout
|
|
31
|
+
uses: actions/checkout@v4
|
|
32
|
+
with:
|
|
33
|
+
token: ${{ secrets.NPM_PUBLISH_USER_ACCESS_TOKEN }}
|
|
34
|
+
fetch-depth: 0
|
|
35
|
+
|
|
36
|
+
- name: Setup Node.js
|
|
37
|
+
uses: actions/setup-node@v4
|
|
38
|
+
with:
|
|
39
|
+
registry-url: https://registry.npmjs.org/
|
|
40
|
+
node-version: '22.18.0'
|
|
41
|
+
|
|
42
|
+
- name: Git configuration
|
|
43
|
+
run: |
|
|
44
|
+
git config --global user.email "86281150+superrover@users.noreply.github.com"
|
|
45
|
+
git config --global user.name "Nishant Gaurav"
|
|
46
|
+
|
|
47
|
+
- name: Install main dependencies
|
|
48
|
+
run: yarn install
|
|
49
|
+
|
|
50
|
+
- name: Install MCP dependencies
|
|
51
|
+
working-directory: ./mcp
|
|
52
|
+
run: yarn install
|
|
53
|
+
|
|
54
|
+
- name: Auto-bump patch version
|
|
55
|
+
if: github.event_name == 'workflow_run'
|
|
56
|
+
working-directory: ./mcp
|
|
57
|
+
run: |
|
|
58
|
+
echo "📦 Auto-bumping patch version after design system publish"
|
|
59
|
+
yarn version --patch --no-git-tag-version
|
|
60
|
+
NEW_VERSION=$(node -p "require('./package.json').version")
|
|
61
|
+
echo "New version: $NEW_VERSION"
|
|
62
|
+
echo "MCP_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
|
63
|
+
|
|
64
|
+
- name: Build MCP data
|
|
65
|
+
working-directory: ./mcp
|
|
66
|
+
run: yarn build
|
|
67
|
+
|
|
68
|
+
- name: Commit version bump
|
|
69
|
+
if: github.event_name == 'workflow_run'
|
|
70
|
+
env:
|
|
71
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
72
|
+
run: |
|
|
73
|
+
git add mcp/package.json mcp/yarn.lock
|
|
74
|
+
git commit -m "chore(release-mcp): ${{ env.MCP_VERSION }} [skip ci]"
|
|
75
|
+
git push origin master
|
|
76
|
+
|
|
77
|
+
- name: Publish to NPM
|
|
78
|
+
working-directory: ./mcp
|
|
79
|
+
env:
|
|
80
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
|
81
|
+
run: yarn publish --verbose --access public
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.5.19](https://github.com/spaced-out/ui-design-system/compare/v0.5.18...v0.5.19) (2025-11-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add Genesis MCP server with automated publishing ([#421](https://github.com/spaced-out/ui-design-system/issues/421)) ([f8ae05c](https://github.com/spaced-out/ui-design-system/commit/f8ae05c3e0344eccbaad33c394bd68711afa8579))
|
|
11
|
+
* template card ([#426](https://github.com/spaced-out/ui-design-system/issues/426)) ([ba803e3](https://github.com/spaced-out/ui-design-system/commit/ba803e3adf17096cbae849a7961b44848bd8443a))
|
|
12
|
+
* wrap prop added in prompt chip ([#423](https://github.com/spaced-out/ui-design-system/issues/423)) ([25f60c4](https://github.com/spaced-out/ui-design-system/commit/25f60c4e82b9a177033dedca108dae3faed1a16c))
|
|
13
|
+
|
|
5
14
|
### [0.5.18](https://github.com/spaced-out/ui-design-system/compare/v0.5.17...v0.5.18) (2025-11-11)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Genesis Design System - Component Implementation Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when creating new components to ensure proper integration with the Genesis Design System MCP server.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Component Implementation Request
|
|
8
|
+
|
|
9
|
+
### Component Name
|
|
10
|
+
|
|
11
|
+
**[ComponentName]** (e.g., "TemplateCard", "StatusBadge", "AlertDialog")
|
|
12
|
+
|
|
13
|
+
### Design Reference
|
|
14
|
+
|
|
15
|
+
Implement this design from Figma:
|
|
16
|
+
@[Figma URL with node-id]
|
|
17
|
+
|
|
18
|
+
**Additional References (if applicable):**
|
|
19
|
+
|
|
20
|
+
- Component states: @[Figma URL]
|
|
21
|
+
- Component anatomy: @[Figma URL]
|
|
22
|
+
- Interactions: @[Figma URL]
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Genesis Design System Integration
|
|
27
|
+
|
|
28
|
+
### 1. Check Similar Components First
|
|
29
|
+
|
|
30
|
+
Before starting, review existing Genesis components for patterns:
|
|
31
|
+
|
|
32
|
+
- [List similar components to check, e.g., "Card", "Icon", "Button"]
|
|
33
|
+
|
|
34
|
+
**Ask:** "What similar components exist in Genesis?"
|
|
35
|
+
|
|
36
|
+
### 2. Identify Reusable Components & Types
|
|
37
|
+
|
|
38
|
+
This component will use:
|
|
39
|
+
|
|
40
|
+
- [ ] Icon component → Query for `IconType`, `IconSize` exports
|
|
41
|
+
- [ ] Button component → Query for `ButtonProps`, button variants
|
|
42
|
+
- [ ] [Other components] → Check their exported types
|
|
43
|
+
|
|
44
|
+
**Ask:** "What types does [Component] export?"
|
|
45
|
+
|
|
46
|
+
### 3. Implementation Checklist
|
|
47
|
+
|
|
48
|
+
Before implementing:
|
|
49
|
+
|
|
50
|
+
- [ ] Call `get_css_module_guidelines` for CSS best practices
|
|
51
|
+
- [ ] Call `get_component` for each component you'll use (to get exported types)
|
|
52
|
+
- [ ] Call `get_design_tokens` for relevant categories (color, space, size, etc.)
|
|
53
|
+
- [ ] Review similar component's CSS for state/modifier patterns
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Component Specifications
|
|
58
|
+
|
|
59
|
+
### TypeScript Requirements ⚠️
|
|
60
|
+
|
|
61
|
+
**IMPORTANT**: Use **pure TypeScript** only. Do NOT use Flow types.
|
|
62
|
+
|
|
63
|
+
- ❌ **NO** `Flow.AbstractComponent`
|
|
64
|
+
- ❌ **NO** `import type {Flow} from 'flow-to-typescript-codemod'`
|
|
65
|
+
- ✅ **YES** `React.forwardRef<HTMLDivElement, Props>`
|
|
66
|
+
|
|
67
|
+
**Correct TypeScript Pattern:**
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
export const ComponentName = React.forwardRef<
|
|
71
|
+
HTMLDivElement,
|
|
72
|
+
ComponentNameProps
|
|
73
|
+
>(({prop1, prop2, ...props}, ref) => (
|
|
74
|
+
<div ref={ref} {...props}>
|
|
75
|
+
{/* component content */}
|
|
76
|
+
</div>
|
|
77
|
+
));
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Props Interface
|
|
81
|
+
|
|
82
|
+
Define the component props clearly:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
export interface [ComponentName]Props {
|
|
86
|
+
// List each prop with:
|
|
87
|
+
// - name: type - description
|
|
88
|
+
// - Indicate if using imported types from other components
|
|
89
|
+
|
|
90
|
+
classNames?: ClassNames; // Standard Genesis pattern
|
|
91
|
+
testId?: string; // Standard Genesis pattern
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Example:**
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
export interface TemplateCardProps {
|
|
99
|
+
headerColor?: HeaderColorType; // Custom type for this component
|
|
100
|
+
iconName: string; // Use string, render Icon internally
|
|
101
|
+
iconType?: IconType; // ✅ Import from Icon component
|
|
102
|
+
footer?: React.ReactNode; // Flexible content
|
|
103
|
+
children?: React.ReactNode; // Flexible content
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Component Structure
|
|
108
|
+
|
|
109
|
+
Describe the component's structure:
|
|
110
|
+
|
|
111
|
+
1. **[Section Name]**: Description
|
|
112
|
+
|
|
113
|
+
- Details about this section
|
|
114
|
+
- Behavior notes
|
|
115
|
+
|
|
116
|
+
2. **[Another Section]**: Description
|
|
117
|
+
- Details
|
|
118
|
+
|
|
119
|
+
### Behavior & Interactions
|
|
120
|
+
|
|
121
|
+
- [Describe interactive behavior]
|
|
122
|
+
- [Describe state management]
|
|
123
|
+
- [Describe accessibility requirements]
|
|
124
|
+
|
|
125
|
+
### Content Philosophy
|
|
126
|
+
|
|
127
|
+
Specify which parts are:
|
|
128
|
+
|
|
129
|
+
- **Fixed structure** (controlled by component)
|
|
130
|
+
- **Flexible content** (user provides via props)
|
|
131
|
+
|
|
132
|
+
**Important:** Keep all content demonstrations in Storybook stories only, not in the component implementation.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## States/Variants
|
|
137
|
+
|
|
138
|
+
List all component states or variants:
|
|
139
|
+
|
|
140
|
+
- State 1: Description
|
|
141
|
+
- State 2: Description
|
|
142
|
+
- Default state
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Special Instructions
|
|
147
|
+
|
|
148
|
+
Any component-specific requirements or constraints:
|
|
149
|
+
|
|
150
|
+
- [Special requirement 1]
|
|
151
|
+
- [Special requirement 2]
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Example Implementation
|
|
156
|
+
|
|
157
|
+
Provide any code examples or patterns to follow:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
// Example pattern to follow
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Notes
|
|
166
|
+
|
|
167
|
+
- **Use TypeScript only** (NO Flow types like `Flow.AbstractComponent`)
|
|
168
|
+
- Follow all Genesis Design System patterns (accessible via MCP)
|
|
169
|
+
- Use design tokens for all values (no hardcoded pixels/colors)
|
|
170
|
+
- Reuse exported types from existing components
|
|
171
|
+
- Test all states in Storybook
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Why This Template Works
|
|
176
|
+
|
|
177
|
+
### MCP Server Integration
|
|
178
|
+
|
|
179
|
+
This template is designed to work with the Genesis MCP server which provides:
|
|
180
|
+
|
|
181
|
+
- **`get_css_module_guidelines`** - CSS best practices and patterns
|
|
182
|
+
- **`get_component`** - Component details including exported types
|
|
183
|
+
- **`get_design_tokens`** - Available design tokens by category
|
|
184
|
+
- **`get_component_template`** - Template files for new components
|
|
185
|
+
|
|
186
|
+
### Key Benefits
|
|
187
|
+
|
|
188
|
+
1. **Pure TypeScript**: All new components use modern TypeScript patterns (no Flow)
|
|
189
|
+
2. **Type Reuse**: Automatically discover and import existing types
|
|
190
|
+
3. **Pattern Consistency**: Follow established CSS and component patterns
|
|
191
|
+
4. **Token Usage**: Use design tokens instead of hardcoded values
|
|
192
|
+
5. **Guided Implementation**: Checklist ensures nothing is missed
|
|
193
|
+
|
|
194
|
+
### Magic Phrases
|
|
195
|
+
|
|
196
|
+
Include these in your prompts to trigger MCP usage:
|
|
197
|
+
|
|
198
|
+
- ✅ "Query [Component] for exported types"
|
|
199
|
+
- ✅ "Call get_css_module_guidelines before creating CSS"
|
|
200
|
+
- ✅ "Compare with [SimilarComponent].module.css for patterns"
|
|
201
|
+
- ✅ "Use design tokens (check get_design_tokens)"
|
|
202
|
+
- ✅ "Import [Type] from [Component] (don't redefine)"
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Quick Start
|
|
207
|
+
|
|
208
|
+
For any new component:
|
|
209
|
+
|
|
210
|
+
1. **Discovery Phase:**
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
"What similar components exist in Genesis?"
|
|
214
|
+
"What types does Icon/Button/[Component] export?"
|
|
215
|
+
"Show me CSS Module guidelines"
|
|
216
|
+
"What design tokens are available for colors/spacing/sizes?"
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
2. **Fill out this template** with your specific requirements
|
|
220
|
+
|
|
221
|
+
3. **Provide to AI** with all Figma links and specifications
|
|
222
|
+
|
|
223
|
+
4. **Review implementation** against Genesis patterns
|
|
@@ -37,6 +37,7 @@ export type PromptChipProps = {
|
|
|
37
37
|
rightSlot?: React.ReactNode;
|
|
38
38
|
showInfoIcon?: boolean;
|
|
39
39
|
infoIconTooltip?: BaseTooltipProps;
|
|
40
|
+
isMultiline?: boolean;
|
|
40
41
|
};
|
|
41
42
|
export declare const PromptChip: Flow.AbstractComponent<PromptChipProps, HTMLDivElement>;
|
|
42
43
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptChip.d.ts","sourceRoot":"","sources":["../../../src/components/PromptChip/PromptChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAMrD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAM7D,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE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I,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC,GACtD,IAAI,GACJ,SAAS,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEJ,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,iBAAiB,CAC7C,eAAe,EACf,cAAc,CA+If,CAAC"}
|
|
@@ -32,7 +32,8 @@ const PromptChip = exports.PromptChip = /*#__PURE__*/React.forwardRef((props, re
|
|
|
32
32
|
dismissable,
|
|
33
33
|
showInfoIcon,
|
|
34
34
|
infoIconTooltip,
|
|
35
|
-
testId
|
|
35
|
+
testId,
|
|
36
|
+
isMultiline
|
|
36
37
|
} = props;
|
|
37
38
|
// Type narrowing to safely access properties only when they exist
|
|
38
39
|
const onDismiss = dismissable === true && 'onDismiss' in props ? props.onDismiss : undefined;
|
|
@@ -63,19 +64,20 @@ const PromptChip = exports.PromptChip = /*#__PURE__*/React.forwardRef((props, re
|
|
|
63
64
|
role: "button",
|
|
64
65
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
65
66
|
className: (0, _classify.classify)(_PromptChipModule.default.promptChipContainer, {
|
|
66
|
-
[_PromptChipModule.default.promptChipContainerHover]: !!onClick
|
|
67
|
+
[_PromptChipModule.default.promptChipContainerHover]: !!onClick,
|
|
68
|
+
[_PromptChipModule.default.multilinePromptChipContainer]: !!isMultiline
|
|
67
69
|
}, classNames?.container),
|
|
68
70
|
"data-testid": (0, _qa.generateTestId)({
|
|
69
71
|
base: testId,
|
|
70
72
|
slot: 'content'
|
|
71
73
|
}),
|
|
72
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
74
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
73
75
|
className: (0, _classify.classify)(_PromptChipModule.default.leftSection, classNames?.leftSlot),
|
|
74
76
|
"data-testid": (0, _qa.generateTestId)({
|
|
75
77
|
base: testId,
|
|
76
78
|
slot: 'left'
|
|
77
79
|
}),
|
|
78
|
-
children:
|
|
80
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
79
81
|
size: _Icon.ICON_SIZE.small,
|
|
80
82
|
name: iconName,
|
|
81
83
|
type: iconType,
|
|
@@ -87,14 +89,14 @@ const PromptChip = exports.PromptChip = /*#__PURE__*/React.forwardRef((props, re
|
|
|
87
89
|
base: testId,
|
|
88
90
|
slot: 'icon'
|
|
89
91
|
})
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
})
|
|
93
|
+
}), !!children && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
94
|
+
className: (0, _classify.classify)(_PromptChipModule.default.childrenWrapper, classNames?.children),
|
|
95
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
96
|
+
base: testId,
|
|
97
|
+
slot: 'text'
|
|
98
|
+
}),
|
|
99
|
+
children: children
|
|
98
100
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
99
101
|
className: (0, _classify.classify)(_PromptChipModule.default.rightSection, classNames?.rightSlot),
|
|
100
102
|
"data-testid": (0, _qa.generateTestId)({
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
@value (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
spaceSmall,
|
|
3
|
+
spaceXSmall,
|
|
4
|
+
spaceFluid
|
|
5
5
|
) from '../../styles/variables/_space.css';
|
|
6
|
+
|
|
6
7
|
@value (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
colorDataViz2,
|
|
9
|
+
colorFillPrimary,
|
|
10
|
+
colorInformation,
|
|
11
|
+
colorFocusPrimary,
|
|
12
|
+
colorFillSecondary,
|
|
13
|
+
colorTextClickable,
|
|
14
|
+
colorNeutralLightest,
|
|
15
|
+
colorBackgroundTertiary,
|
|
16
|
+
colorInformationLightest
|
|
17
|
+
) from '../../styles/variables/_color.css';
|
|
18
|
+
|
|
17
19
|
@value (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
borderWidthNone,
|
|
21
|
+
borderRadiusMedium,
|
|
22
|
+
borderWidthPrimary,
|
|
23
|
+
borderWidthTertiary
|
|
24
|
+
) from '../../styles/variables/_border.css';
|
|
25
|
+
|
|
23
26
|
@value (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
opacity0,
|
|
28
|
+
opacity100
|
|
29
|
+
) from '../../styles/variables/_opacity.css';
|
|
27
30
|
|
|
28
31
|
.promptChipWrapper {
|
|
29
32
|
composes: boxShadow2 from '../../styles/shadow.module.css';
|
|
@@ -53,41 +56,70 @@
|
|
|
53
56
|
background-color: colorNeutralLightest;
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
/* ---- Grid Layout for Content ---- */
|
|
56
60
|
.promptChipContainer {
|
|
57
|
-
display:
|
|
61
|
+
display: grid;
|
|
58
62
|
width: spaceFluid;
|
|
59
63
|
gap: spaceSmall;
|
|
60
64
|
padding: spaceXSmall;
|
|
61
65
|
padding-left: spaceSmall;
|
|
62
66
|
align-items: center;
|
|
63
67
|
border-radius: borderRadiusMedium;
|
|
64
|
-
justify-content: space-between;
|
|
65
68
|
|
|
66
|
-
|
|
69
|
+
.chipIconDefaultColor {
|
|
67
70
|
color: colorDataViz2;
|
|
68
71
|
}
|
|
69
|
-
}
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
/*
|
|
74
|
+
NORMAL MODE (when isMultiline={false}):
|
|
75
|
+
- single row, 3 columns: icon | children | right
|
|
76
|
+
*/
|
|
77
|
+
&:not(.multilinePromptChipContainer) {
|
|
78
|
+
grid-template-columns: auto 1fr auto;
|
|
79
|
+
grid-template-areas: 'leftSection childrenWrapper rightSection';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
MULTILINE MODE (when isMultiline={true}):
|
|
84
|
+
- 2 rows: first row for icon (leftSection) and actions (rightSection)
|
|
85
|
+
- children on second row spanning full width
|
|
86
|
+
*/
|
|
87
|
+
&.multilinePromptChipContainer {
|
|
88
|
+
grid-template-columns: auto 1fr auto;
|
|
89
|
+
grid-template-areas:
|
|
90
|
+
'leftSection . rightSection'
|
|
91
|
+
'childrenWrapper childrenWrapper childrenWrapper';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.promptChipContainerHover:hover {
|
|
95
|
+
background-image: linear-gradient(
|
|
96
|
+
to right,
|
|
97
|
+
colorFillSecondary,
|
|
98
|
+
colorInformationLightest
|
|
99
|
+
);
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
|
|
102
|
+
.chipIconDefaultColor {
|
|
103
|
+
color: colorTextClickable;
|
|
104
|
+
}
|
|
81
105
|
}
|
|
82
106
|
}
|
|
83
107
|
|
|
84
|
-
.leftSection
|
|
85
|
-
|
|
108
|
+
.leftSection {
|
|
109
|
+
grid-area: leftSection;
|
|
86
110
|
display: flex;
|
|
87
111
|
gap: spaceSmall;
|
|
88
112
|
align-items: center;
|
|
89
113
|
}
|
|
90
114
|
|
|
91
115
|
.childrenWrapper {
|
|
116
|
+
grid-area: childrenWrapper;
|
|
92
117
|
composes: bodyMedium from '../../styles/typography.module.css';
|
|
93
118
|
}
|
|
119
|
+
|
|
120
|
+
.rightSection {
|
|
121
|
+
grid-area: rightSection;
|
|
122
|
+
display: flex;
|
|
123
|
+
gap: spaceSmall;
|
|
124
|
+
align-items: center;
|
|
125
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { IconType } from '../../components/Icon';
|
|
3
|
+
export declare const TEMPLATE_CARD_HEADER_COLOR: Readonly<{
|
|
4
|
+
information: "information";
|
|
5
|
+
success: "success";
|
|
6
|
+
warning: "warning";
|
|
7
|
+
error: "error";
|
|
8
|
+
neutral: "neutral";
|
|
9
|
+
pending: "pending";
|
|
10
|
+
}>;
|
|
11
|
+
export type HeaderColorType = (typeof TEMPLATE_CARD_HEADER_COLOR)[keyof typeof TEMPLATE_CARD_HEADER_COLOR];
|
|
12
|
+
type ClassNames = Readonly<{
|
|
13
|
+
wrapper?: string;
|
|
14
|
+
header?: string;
|
|
15
|
+
content?: string;
|
|
16
|
+
footer?: string;
|
|
17
|
+
}>;
|
|
18
|
+
export interface TemplateCardProps {
|
|
19
|
+
headerColor?: HeaderColorType;
|
|
20
|
+
iconName: string;
|
|
21
|
+
iconType?: IconType;
|
|
22
|
+
footer?: React.ReactNode;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
classNames?: ClassNames;
|
|
25
|
+
testId?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const TemplateCard: React.ForwardRefExoticComponent<TemplateCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=TemplateCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateCard.d.ts","sourceRoot":"","sources":["../../../src/components/TemplateCard/TemplateCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAMlD,eAAO,MAAM,0BAA0B;;;;;;;EAOrC,CAAC;AAEH,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC;AAE/E,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,0FAsExB,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TemplateCard = exports.TEMPLATE_CARD_HEADER_COLOR = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
+
var _qa = require("../../utils/qa");
|
|
10
|
+
var _Icon = require("../Icon");
|
|
11
|
+
var _TemplateCardModule = _interopRequireDefault(require("./TemplateCard.module.css"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
const TEMPLATE_CARD_HEADER_COLOR = exports.TEMPLATE_CARD_HEADER_COLOR = Object.freeze({
|
|
16
|
+
information: 'information',
|
|
17
|
+
success: 'success',
|
|
18
|
+
warning: 'warning',
|
|
19
|
+
error: 'error',
|
|
20
|
+
neutral: 'neutral',
|
|
21
|
+
pending: 'pending'
|
|
22
|
+
});
|
|
23
|
+
const TemplateCard = exports.TemplateCard = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
24
|
+
let {
|
|
25
|
+
headerColor = 'neutral',
|
|
26
|
+
iconName,
|
|
27
|
+
iconType = 'solid',
|
|
28
|
+
footer,
|
|
29
|
+
children,
|
|
30
|
+
classNames,
|
|
31
|
+
testId
|
|
32
|
+
} = _ref;
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
34
|
+
className: (0, _classify.default)(_TemplateCardModule.default.wrapper, classNames?.wrapper),
|
|
35
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
36
|
+
base: testId,
|
|
37
|
+
slot: 'wrapper'
|
|
38
|
+
}),
|
|
39
|
+
ref: ref,
|
|
40
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
41
|
+
className: (0, _classify.default)(_TemplateCardModule.default.header, _TemplateCardModule.default[headerColor], classNames?.header),
|
|
42
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
43
|
+
base: testId,
|
|
44
|
+
slot: 'header'
|
|
45
|
+
}),
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
|
+
className: (0, _classify.default)(_TemplateCardModule.default.iconContainer, _TemplateCardModule.default[headerColor]),
|
|
48
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
49
|
+
base: testId,
|
|
50
|
+
slot: 'icon-container'
|
|
51
|
+
}),
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
53
|
+
name: iconName,
|
|
54
|
+
type: iconType,
|
|
55
|
+
size: "large",
|
|
56
|
+
className: _TemplateCardModule.default[headerColor],
|
|
57
|
+
testId: (0, _qa.generateTestId)({
|
|
58
|
+
base: testId,
|
|
59
|
+
slot: 'icon'
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
}), children && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
64
|
+
className: (0, _classify.default)(_TemplateCardModule.default.content, classNames?.content),
|
|
65
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
66
|
+
base: testId,
|
|
67
|
+
slot: 'content'
|
|
68
|
+
}),
|
|
69
|
+
children: children
|
|
70
|
+
}), footer && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
71
|
+
className: (0, _classify.default)(_TemplateCardModule.default.footer, classNames?.footer),
|
|
72
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
73
|
+
base: testId,
|
|
74
|
+
slot: 'footer'
|
|
75
|
+
}),
|
|
76
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
77
|
+
className: _TemplateCardModule.default.footerSeparator,
|
|
78
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
79
|
+
base: testId,
|
|
80
|
+
slot: 'footer-separator'
|
|
81
|
+
})
|
|
82
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
83
|
+
className: _TemplateCardModule.default.footerContent,
|
|
84
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
85
|
+
base: testId,
|
|
86
|
+
slot: 'footer-content'
|
|
87
|
+
}),
|
|
88
|
+
children: footer
|
|
89
|
+
})]
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
});
|