@mcp-b/react-components 0.3.0 → 0.4.0
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/dist/attachment-preview-ChtC3HiU.js +25 -0
- package/dist/components/AgentChat.d.ts +38 -1
- package/dist/components/AgentChat.js +135 -39
- package/dist/components/AgentConnection.js +1 -1
- package/dist/components/BrowserLiveView.js +1 -1
- package/dist/components/Context.d.ts +28 -27
- package/dist/components/Context.js +48 -47
- package/dist/components/Message.d.ts +16 -2
- package/dist/components/Message.js +36 -2
- package/dist/components/PricingPage.js +1 -1
- package/dist/components/PromptInput.d.ts +532 -2
- package/dist/components/PromptInput.js +153 -15
- package/dist/components/Suggestion.d.ts +43 -0
- package/dist/components/Suggestion.js +39 -0
- package/dist/components/ThinkChat.d.ts +22 -1
- package/dist/components/ThinkChat.js +85 -17
- package/dist/styles/agent-chat.css +19 -0
- package/dist/styles/attachment-preview.css +21 -0
- package/dist/styles/context.css +9 -17
- package/dist/styles/index.css +2 -0
- package/dist/styles/message.css +48 -0
- package/dist/styles/prompt-input.css +172 -0
- package/dist/styles/suggestions.css +21 -0
- package/package.json +2 -2
- package/dist/PromptInput-Dzn-fOPc.d.ts +0 -444
package/dist/styles/context.css
CHANGED
|
@@ -3,20 +3,19 @@
|
|
|
3
3
|
font-family: var(--sigvelo-font-sans);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
/* Bare ring icon — undo the popover__trigger pill chrome. */
|
|
6
7
|
.context__trigger {
|
|
7
8
|
display: inline-flex;
|
|
8
9
|
align-items: center;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
display: inline-flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
padding: 0.25rem;
|
|
12
|
+
background: none;
|
|
13
|
+
border: none;
|
|
14
|
+
border-radius: var(--sigvelo-radius-sm);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.context__trigger
|
|
18
|
-
|
|
19
|
-
color: var(--sigvelo-color-text-muted);
|
|
17
|
+
.context__trigger:hover {
|
|
18
|
+
background-color: color-mix(in oklab, transparent, var(--sigvelo-color-text) 5%);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
.context__content {
|
|
@@ -98,7 +97,7 @@
|
|
|
98
97
|
|
|
99
98
|
.context__row {
|
|
100
99
|
display: grid;
|
|
101
|
-
grid-template-columns: 1fr auto
|
|
100
|
+
grid-template-columns: 1fr auto;
|
|
102
101
|
gap: 0.75rem;
|
|
103
102
|
font-size: 0.75rem;
|
|
104
103
|
align-items: baseline;
|
|
@@ -113,13 +112,6 @@
|
|
|
113
112
|
font-variant-numeric: tabular-nums;
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
.context__row-cost {
|
|
117
|
-
color: var(--sigvelo-color-text-muted);
|
|
118
|
-
font-family: var(--sigvelo-font-mono);
|
|
119
|
-
font-size: 0.6875rem;
|
|
120
|
-
font-variant-numeric: tabular-nums;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
115
|
.context__footer {
|
|
124
116
|
display: flex;
|
|
125
117
|
flex-direction: column;
|
package/dist/styles/index.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@import "./agent-connection.css" layer(components);
|
|
13
13
|
@import "./agent-chat.css" layer(components);
|
|
14
14
|
@import "./alert-dialog.css" layer(components);
|
|
15
|
+
@import "./attachment-preview.css" layer(components);
|
|
15
16
|
@import "./autocomplete.css" layer(components);
|
|
16
17
|
@import "./avatar.css" layer(components);
|
|
17
18
|
@import "./badge.css" layer(components);
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
@import "./separator.css" layer(components);
|
|
46
47
|
@import "./slider.css" layer(components);
|
|
47
48
|
@import "./stepper.css" layer(components);
|
|
49
|
+
@import "./suggestions.css" layer(components);
|
|
48
50
|
@import "./switch.css" layer(components);
|
|
49
51
|
@import "./tabs.css" layer(components);
|
|
50
52
|
@import "./toast.css" layer(components);
|
package/dist/styles/message.css
CHANGED
|
@@ -57,6 +57,54 @@
|
|
|
57
57
|
overflow: auto;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.message__attachment {
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 0.375rem;
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
font-size: 0.8125rem;
|
|
66
|
+
color: inherit;
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.message__attachment:hover .message__attachment-name {
|
|
71
|
+
text-decoration: underline;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.message__attachment-icon {
|
|
75
|
+
flex-shrink: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.message__attachment-name {
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.message__attachment-zoom {
|
|
85
|
+
display: block;
|
|
86
|
+
max-width: 100%;
|
|
87
|
+
padding: 0;
|
|
88
|
+
border: none;
|
|
89
|
+
background: none;
|
|
90
|
+
cursor: zoom-in;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.message__attachment-image {
|
|
94
|
+
display: block;
|
|
95
|
+
max-width: 16rem;
|
|
96
|
+
max-height: 16rem;
|
|
97
|
+
border-radius: var(--sigvelo-radius-md);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Quiet annotation under a part whose stored content was compacted. */
|
|
101
|
+
.message__compacted {
|
|
102
|
+
margin-block-start: 0.25rem;
|
|
103
|
+
font-size: var(--sigvelo-text-xs);
|
|
104
|
+
font-style: italic;
|
|
105
|
+
color: var(--sigvelo-color-text-muted);
|
|
106
|
+
}
|
|
107
|
+
|
|
60
108
|
.message__actions {
|
|
61
109
|
display: inline-flex;
|
|
62
110
|
align-items: center;
|
|
@@ -43,6 +43,83 @@
|
|
|
43
43
|
min-height: 1.5rem;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
.prompt-input__attachments {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-wrap: wrap;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: 0.375rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Hairline chip, borderless-direction: no fill, just the outline. */
|
|
54
|
+
.prompt-input__attachment {
|
|
55
|
+
position: relative;
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 0.375rem;
|
|
59
|
+
max-width: 14rem;
|
|
60
|
+
padding: 0.25rem 0.5rem;
|
|
61
|
+
border: var(--sigvelo-border-style) var(--sigvelo-border-width)
|
|
62
|
+
var(--sigvelo-color-neutral-border-subtle);
|
|
63
|
+
border-radius: var(--sigvelo-radius-md);
|
|
64
|
+
font-size: 0.75rem;
|
|
65
|
+
color: var(--sigvelo-color-text);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.prompt-input__attachment[data-image] {
|
|
69
|
+
padding: 0;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.prompt-input__attachment-zoom {
|
|
74
|
+
display: block;
|
|
75
|
+
padding: 0;
|
|
76
|
+
border: none;
|
|
77
|
+
background: none;
|
|
78
|
+
cursor: zoom-in;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.prompt-input__attachment-thumb {
|
|
82
|
+
display: block;
|
|
83
|
+
width: 3rem;
|
|
84
|
+
height: 3rem;
|
|
85
|
+
object-fit: cover;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.prompt-input__attachment-icon {
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
color: var(--sigvelo-color-text-muted);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.prompt-input__attachment-name {
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
text-overflow: ellipsis;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.prompt-input__attachment-remove {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
padding: 0.125rem;
|
|
104
|
+
border: none;
|
|
105
|
+
border-radius: var(--sigvelo-radius-sm);
|
|
106
|
+
background: none;
|
|
107
|
+
color: var(--sigvelo-color-text-muted);
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.prompt-input__attachment[data-image] .prompt-input__attachment-remove {
|
|
112
|
+
position: absolute;
|
|
113
|
+
inset-block-start: 0.125rem;
|
|
114
|
+
inset-inline-end: 0.125rem;
|
|
115
|
+
background-color: color-mix(in oklab, var(--sigvelo-color-surface), transparent 20%);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.prompt-input__attachment-remove:hover {
|
|
119
|
+
color: var(--sigvelo-color-text);
|
|
120
|
+
background-color: color-mix(in oklab, transparent, var(--sigvelo-color-text) 8%);
|
|
121
|
+
}
|
|
122
|
+
|
|
46
123
|
.prompt-input__body {
|
|
47
124
|
display: flex;
|
|
48
125
|
align-items: stretch;
|
|
@@ -84,6 +161,12 @@
|
|
|
84
161
|
padding-block-start: 0.25rem;
|
|
85
162
|
}
|
|
86
163
|
|
|
164
|
+
.prompt-input__footer-end {
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: 0.25rem;
|
|
168
|
+
}
|
|
169
|
+
|
|
87
170
|
.prompt-input__tools {
|
|
88
171
|
display: inline-flex;
|
|
89
172
|
align-items: center;
|
|
@@ -136,6 +219,95 @@
|
|
|
136
219
|
margin-inline-end: 0.5rem;
|
|
137
220
|
}
|
|
138
221
|
|
|
222
|
+
/* Undo .menu__trigger's boxed chrome — this trigger is a ghost footer button
|
|
223
|
+
like its neighbors: transparent at rest, background only on hover/open. */
|
|
224
|
+
.prompt-input__permissions-trigger {
|
|
225
|
+
gap: 0.25rem;
|
|
226
|
+
padding-block: 0.25rem;
|
|
227
|
+
padding-inline: 0.5rem;
|
|
228
|
+
font-size: 0.75rem;
|
|
229
|
+
font-weight: inherit;
|
|
230
|
+
background: none;
|
|
231
|
+
border: none;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.prompt-input__permissions-trigger:hover,
|
|
235
|
+
.prompt-input__permissions-trigger[data-popup-open] {
|
|
236
|
+
background-color: color-mix(in oklab, transparent, var(--sigvelo-color-text) 5%);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Bypass is the loud one — Codex-style warning tint so it can't be missed. */
|
|
240
|
+
.prompt-input__permissions-trigger[data-mode="bypass"],
|
|
241
|
+
.prompt-input__permissions-trigger[data-mode="bypass"]:hover:not([data-disabled]) {
|
|
242
|
+
color: var(--sigvelo-color-warning-text);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* Both modes stacked in one cell; the trigger is always as wide as the
|
|
246
|
+
widest, so toggling can't shift the footer. */
|
|
247
|
+
.prompt-input__permissions-current {
|
|
248
|
+
display: inline-grid;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.prompt-input__permissions-current-option {
|
|
252
|
+
grid-area: 1 / 1;
|
|
253
|
+
display: inline-flex;
|
|
254
|
+
align-items: center;
|
|
255
|
+
gap: 0.25rem;
|
|
256
|
+
justify-self: start;
|
|
257
|
+
white-space: nowrap;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.prompt-input__permissions-current-option:not([data-active]) {
|
|
261
|
+
visibility: hidden;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.prompt-input__permissions-menu {
|
|
265
|
+
min-width: 17rem;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.prompt-input__permissions-question {
|
|
269
|
+
padding-block: 0.375rem;
|
|
270
|
+
padding-inline: 0.75rem;
|
|
271
|
+
font-size: 0.75rem;
|
|
272
|
+
color: var(--sigvelo-color-text-muted);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.prompt-input__permissions-option {
|
|
276
|
+
align-items: flex-start;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.prompt-input__permissions-option-text {
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-direction: column;
|
|
282
|
+
gap: 0.125rem;
|
|
283
|
+
min-width: 0;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.prompt-input__permissions-option-label {
|
|
287
|
+
font-size: 0.8125rem;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.prompt-input__permissions-option-description {
|
|
291
|
+
font-size: 0.75rem;
|
|
292
|
+
color: var(--sigvelo-color-text-muted);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* Check on the right, drawn like the checkbox indicator instead of the dot. */
|
|
296
|
+
.prompt-input__permissions-check {
|
|
297
|
+
margin-inline-start: auto;
|
|
298
|
+
align-self: center;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.prompt-input__permissions-check::before {
|
|
302
|
+
width: 0.625rem;
|
|
303
|
+
height: 0.375rem;
|
|
304
|
+
background-color: transparent;
|
|
305
|
+
border-radius: 0;
|
|
306
|
+
border-inline-start: 2px solid currentColor;
|
|
307
|
+
border-block-end: 2px solid currentColor;
|
|
308
|
+
transform: rotate(-45deg) translateY(-1px);
|
|
309
|
+
}
|
|
310
|
+
|
|
139
311
|
.prompt-input__hover-card {
|
|
140
312
|
position: relative;
|
|
141
313
|
display: inline-block;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.suggestions {
|
|
2
|
+
width: 100%;
|
|
3
|
+
overflow-x: auto;
|
|
4
|
+
scrollbar-width: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.suggestions::-webkit-scrollbar {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.suggestions__row {
|
|
12
|
+
display: flex;
|
|
13
|
+
width: max-content;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 0.5rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.suggestions__chip {
|
|
19
|
+
border-radius: var(--sigvelo-radius-full);
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "MCP-B React components built on Base UI and shared design tokens, including Cloudflare Think chat primitives.",
|
|
5
5
|
"homepage": "https://design-system.sigvelo.com",
|
|
6
6
|
"bugs": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"anser": "^2.3.5",
|
|
50
50
|
"shiki": "^3.23.0",
|
|
51
51
|
"streamdown": "^2.5.0",
|
|
52
|
-
"@mcp-b/design-tokens": "0.
|
|
52
|
+
"@mcp-b/design-tokens": "0.4.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@ai-sdk/react": "^3.0.194",
|