@spaced-out/ui-design-system 0.5.18 → 0.5.20
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 +16 -0
- package/COMPONENT_PROMPT_TEMPLATE.md +223 -0
- package/lib/components/Input/Input.d.ts +2 -0
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +37 -16
- package/lib/components/Input/Input.module.css +19 -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 +43 -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,22 @@
|
|
|
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.20](https://github.com/spaced-out/ui-design-system/compare/v0.5.19...v0.5.20) (2025-11-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* non editable prefix text in Input component ([#427](https://github.com/spaced-out/ui-design-system/issues/427)) ([d9b3830](https://github.com/spaced-out/ui-design-system/commit/d9b3830fbef230895f457ecc33b04355707b2654))
|
|
11
|
+
|
|
12
|
+
### [0.5.19](https://github.com/spaced-out/ui-design-system/compare/v0.5.18...v0.5.19) (2025-11-11)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* 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))
|
|
18
|
+
* template card ([#426](https://github.com/spaced-out/ui-design-system/issues/426)) ([ba803e3](https://github.com/spaced-out/ui-design-system/commit/ba803e3adf17096cbae849a7961b44848bd8443a))
|
|
19
|
+
* 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))
|
|
20
|
+
|
|
5
21
|
### [0.5.18](https://github.com/spaced-out/ui-design-system/compare/v0.5.17...v0.5.18) (2025-11-11)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -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
|
|
@@ -6,6 +6,7 @@ type ClassNames = Readonly<{
|
|
|
6
6
|
iconLeft?: string;
|
|
7
7
|
iconRight?: string;
|
|
8
8
|
wrapper?: string;
|
|
9
|
+
prefixText?: string;
|
|
9
10
|
}>;
|
|
10
11
|
export declare const EXPONENT_CHARACTER_LIST: string[];
|
|
11
12
|
export declare const INPUT_TYPES: Readonly<{
|
|
@@ -72,6 +73,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
72
73
|
hidePasswordToggleIcon?: boolean;
|
|
73
74
|
testId?: string;
|
|
74
75
|
disableWheelPropagation?: boolean;
|
|
76
|
+
prefix?: string;
|
|
75
77
|
}
|
|
76
78
|
export declare const Input: Flow.AbstractComponent<InputProps, HTMLInputElement>;
|
|
77
79
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAOrD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAOlD,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAiB,MAAM,EAAE,CAAC;AAE9D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;EActB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,UACf,SAAQ,IAAI,CACV,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EACzC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
});
|
|
6
6
|
exports.Input = exports.INPUT_TYPES = exports.EXPONENT_CHARACTER_LIST = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
8
9
|
var _classify = require("../../utils/classify");
|
|
9
10
|
var _qa = require("../../utils/qa");
|
|
11
|
+
var _ConditionalWrapper = require("../ConditionalWrapper");
|
|
10
12
|
var _Icon = require("../Icon");
|
|
11
13
|
var _Text = require("../Text");
|
|
12
14
|
var _InputModule = _interopRequireDefault(require("./Input.module.css"));
|
|
@@ -61,6 +63,7 @@ const Input_ = (props, ref) => {
|
|
|
61
63
|
hidePasswordToggleIcon,
|
|
62
64
|
disableWheelPropagation = false,
|
|
63
65
|
testId,
|
|
66
|
+
prefix,
|
|
64
67
|
...inputProps
|
|
65
68
|
} = props;
|
|
66
69
|
const [showPassword, setShowPassword] = React.useState(false);
|
|
@@ -159,23 +162,41 @@ const Input_ = (props, ref) => {
|
|
|
159
162
|
color: disabled ? 'disabled' : 'secondary',
|
|
160
163
|
size: "small",
|
|
161
164
|
type: iconLeftType
|
|
162
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.ConditionalWrapper, {
|
|
166
|
+
condition: !(0, _isEmpty.default)(prefix),
|
|
167
|
+
wrapper: children => /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
168
|
+
className: _InputModule.default.prefixContainer,
|
|
169
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
170
|
+
base: testId,
|
|
171
|
+
slot: 'prefixContainer'
|
|
172
|
+
}),
|
|
173
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
174
|
+
className: (0, _classify.classify)(_InputModule.default.prefixText, classNames?.prefixText),
|
|
175
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
176
|
+
base: testId,
|
|
177
|
+
slot: 'prefixText'
|
|
178
|
+
}),
|
|
179
|
+
children: prefix
|
|
180
|
+
}), children]
|
|
167
181
|
}),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
183
|
+
...inputProps,
|
|
184
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
185
|
+
base: testId,
|
|
186
|
+
slot: 'input'
|
|
187
|
+
}),
|
|
188
|
+
disabled: locked || disabled,
|
|
189
|
+
name: name,
|
|
190
|
+
ref: inputRef,
|
|
191
|
+
placeholder: placeholder,
|
|
192
|
+
value: value,
|
|
193
|
+
onChange: onChange,
|
|
194
|
+
onFocus: onFocus,
|
|
195
|
+
onBlur: onBlur,
|
|
196
|
+
type: showPassword ? 'text' : type,
|
|
197
|
+
readOnly: readOnly,
|
|
198
|
+
onKeyDown: handleKeyDown
|
|
199
|
+
})
|
|
179
200
|
}), type === 'color' && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
180
201
|
"data-testid": (0, _qa.generateTestId)({
|
|
181
202
|
base: testId,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@value (
|
|
2
|
+
size2,
|
|
2
3
|
size18,
|
|
3
4
|
size42,
|
|
4
5
|
size30,
|
|
@@ -184,3 +185,21 @@ input::placeholder {
|
|
|
184
185
|
appearance: textfield;
|
|
185
186
|
-moz-appearance: textfield;
|
|
186
187
|
}
|
|
188
|
+
|
|
189
|
+
.prefixContainer {
|
|
190
|
+
display: flex;
|
|
191
|
+
width: sizeFluid;
|
|
192
|
+
cursor: inherit;
|
|
193
|
+
padding-left: size2;
|
|
194
|
+
overflow-y: auto;
|
|
195
|
+
|
|
196
|
+
& .prefixText {
|
|
197
|
+
color: colorTextTertiary;
|
|
198
|
+
white-space: nowrap;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
& input {
|
|
202
|
+
padding-left: spaceNone;
|
|
203
|
+
min-width: size18;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -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,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AAEH,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAC3D,M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AE,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)({
|