@mcp-b/react-components 0.5.1 → 0.5.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.
@@ -243,7 +243,7 @@ function WorkspaceExplorer({ workspace, className, title = "Workspace", actions,
243
243
  children: [showFileView ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
244
244
  variant: "ghost",
245
245
  color: "neutral",
246
- size: "sm",
246
+ size: "xs",
247
247
  onClick: () => setView("tree"),
248
248
  "aria-label": "Back to files",
249
249
  children: /* @__PURE__ */ jsx(ArrowLeftIcon, { "aria-hidden": "true" })
@@ -262,7 +262,7 @@ function WorkspaceExplorer({ workspace, className, title = "Workspace", actions,
262
262
  children: [actions, /* @__PURE__ */ jsx(Button, {
263
263
  variant: "ghost",
264
264
  color: "neutral",
265
- size: "sm",
265
+ size: "xs",
266
266
  onClick: refresh,
267
267
  disabled: isLoading,
268
268
  "aria-label": "Refresh workspace",
@@ -82,9 +82,15 @@
82
82
  counter-reset: line;
83
83
  }
84
84
 
85
+ /* The plain fallback emits .line spans with no newline text nodes, so it
86
+ needs block to break lines. Shiki output keeps its "\n" nodes — block
87
+ there gives every newline its own empty line box (double-spaced code). */
88
+ .code-block__content--numbered:is(pre) > code .line {
89
+ display: block;
90
+ }
91
+
85
92
  .code-block__content--numbered:is(pre) > code .line,
86
93
  .code-block__content--numbered pre code .line {
87
- display: block;
88
94
  counter-increment: line;
89
95
  }
90
96
 
@@ -102,10 +102,47 @@ button[data-streamdown="link"] {
102
102
  }
103
103
 
104
104
  [data-streamdown="image-wrapper"] {
105
+ position: relative;
105
106
  display: inline-block;
106
107
  margin-block: 0.5rem;
107
108
  }
108
109
 
110
+ /* The hover scrim and download button carry no data attributes, only
111
+ Tailwind classes we don't compile. The scrim adds nothing here; the
112
+ button becomes a hover-revealed overlay in the image corner. */
113
+ [data-streamdown="image-wrapper"] > div {
114
+ display: none;
115
+ }
116
+
117
+ [data-streamdown="image-wrapper"] > button {
118
+ position: absolute;
119
+ inset-block-end: 0.375rem;
120
+ inset-inline-end: 0.375rem;
121
+ display: inline-flex;
122
+ align-items: center;
123
+ justify-content: center;
124
+ padding: 0.25rem;
125
+ border: var(--sigvelo-border-style) var(--sigvelo-border-width)
126
+ var(--sigvelo-color-neutral-border-subtle);
127
+ border-radius: var(--sigvelo-radius-sm);
128
+ background-color: var(--sigvelo-color-surface);
129
+ color: var(--sigvelo-color-text-muted);
130
+ cursor: pointer;
131
+ opacity: 0;
132
+ transition:
133
+ opacity 120ms ease,
134
+ color 120ms ease;
135
+ }
136
+
137
+ [data-streamdown="image-wrapper"]:hover > button,
138
+ [data-streamdown="image-wrapper"] > button:focus-visible {
139
+ opacity: 1;
140
+ }
141
+
142
+ [data-streamdown="image-wrapper"] > button:hover {
143
+ color: var(--sigvelo-color-text);
144
+ }
145
+
109
146
  [data-streamdown="image"] {
110
147
  max-width: 100%;
111
148
  border-radius: var(--sigvelo-radius-md);
@@ -7,11 +7,13 @@
7
7
  color: var(--sigvelo-color-text);
8
8
  }
9
9
 
10
+ /* Compact masthead, sized to the pre-design-system nanites workbench. */
10
11
  .workspace-explorer__header {
11
12
  display: flex;
12
13
  align-items: center;
13
14
  gap: 0.5rem;
14
- padding: 0.5rem 0.75rem;
15
+ min-height: 2.5rem;
16
+ padding: 0.25rem 0.625rem;
15
17
  border-block-end: var(--sigvelo-border-style) var(--sigvelo-border-width)
16
18
  var(--sigvelo-color-neutral-border-subtle);
17
19
  }
@@ -47,10 +49,10 @@
47
49
  .workspace-explorer__body {
48
50
  display: flex;
49
51
  flex-direction: column;
50
- gap: 0.5rem;
52
+ gap: 0.375rem;
51
53
  min-height: 0;
52
54
  flex: 1;
53
- padding: 0.5rem 0.75rem;
55
+ padding: 0.375rem 0.625rem;
54
56
  overflow: auto;
55
57
  }
56
58
 
@@ -58,6 +60,7 @@
58
60
  display: flex;
59
61
  align-items: center;
60
62
  gap: 0.375rem;
63
+ min-height: 2rem;
61
64
  padding-inline: 0.5rem;
62
65
  color: var(--sigvelo-color-text-muted);
63
66
  border: var(--sigvelo-border-style) var(--sigvelo-border-width)
@@ -72,12 +75,12 @@
72
75
  .workspace-explorer__filter input {
73
76
  flex: 1;
74
77
  min-width: 0;
75
- padding-block: 0.375rem;
78
+ padding-block: 0.25rem;
76
79
  border: none;
77
80
  background: transparent;
78
81
  color: var(--sigvelo-color-text);
79
82
  font-family: inherit;
80
- font-size: 0.8125rem;
83
+ font-size: 0.75rem;
81
84
  outline: none;
82
85
  }
83
86
 
@@ -87,6 +90,20 @@
87
90
  padding-block: 0;
88
91
  }
89
92
 
93
+ /* Rows hug their label — hover reads as a pill around the name, not a
94
+ full-width bar (carried over from the original nanites workbench). */
95
+ .workspace-explorer__tree .file-tree__node {
96
+ inline-size: fit-content;
97
+ max-inline-size: 100%;
98
+ gap: 0.5rem;
99
+ padding-block: 0.3125rem;
100
+ border-radius: var(--sigvelo-radius-md);
101
+ }
102
+
103
+ .workspace-explorer__tree .file-tree__name {
104
+ line-height: 1.4;
105
+ }
106
+
90
107
  .workspace-explorer__empty {
91
108
  display: flex;
92
109
  flex: 1;
@@ -98,11 +115,22 @@
98
115
  text-align: center;
99
116
  }
100
117
 
118
+ /* File preview fills the pane flush — no card-in-pane inset. */
101
119
  .workspace-explorer__file {
102
120
  display: flex;
103
121
  flex-direction: column;
104
122
  min-height: 0;
105
123
  flex: 1;
106
124
  overflow: auto;
107
- padding: 0.5rem 0.75rem;
125
+ }
126
+
127
+ .workspace-explorer__code {
128
+ flex: 1;
129
+ border-radius: 0;
130
+ }
131
+
132
+ /* File contents read at gutter scale, like the original workbench preview. */
133
+ .workspace-explorer__code :is(.code-block__content, .code-block__content pre) {
134
+ font-size: 0.75rem;
135
+ line-height: 1.6;
108
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-b/react-components",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
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.5.1"
52
+ "@mcp-b/design-tokens": "0.5.3"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@ai-sdk/react": "^3.0.194",