@theoremjs/react 0.3.5-next.1045.gcc305fe → 0.3.5-next.1046.g08fd205
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/README.md +2 -1
- package/package.json +3 -3
- package/ui/ChatComposerRow.js +18 -6
package/README.md
CHANGED
|
@@ -213,7 +213,8 @@ Each part of the look is a CSS custom property. Set it on any element above the
|
|
|
213
213
|
| `--theorem-composer-pill-fill` | The fill of each pill. | the surface's fill |
|
|
214
214
|
| `--theorem-composer-pill-shadow` | The shadow of each pill. | the surface's shadow |
|
|
215
215
|
| `--theorem-composer-pill-end-padding` | The space between the working pill's stop button and the pill's end. | half the pill's height less the stop button's, so the same ring of space goes round the button |
|
|
216
|
-
| `--theorem-composer-pill-align` | Where
|
|
216
|
+
| `--theorem-composer-pill-align` | Where the pills sit in the row, as `justify-content`. Pills that do not fit start at the row's start and scroll. | `center` |
|
|
217
|
+
| `--theorem-composer-pill-shadow-room` | How far the pill shadow reaches past a pill. The row keeps that much room, so the shadow is not cut. Raise it with a larger `pill-shadow`. | `var(--spacing-3)` |
|
|
217
218
|
|
|
218
219
|
```tsx
|
|
219
220
|
<TheoremChat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/react",
|
|
3
|
-
"version": "0.3.5-next.
|
|
3
|
+
"version": "0.3.5-next.1046.g08fd205",
|
|
4
4
|
"description": "React bindings for Theorem: headless hooks + transport, an Astryx chat UI, and a Web-standard server handler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@stylexjs/stylex": "0.19.0",
|
|
61
61
|
"react": "^19.0.0",
|
|
62
62
|
"react-dom": "^19.0.0",
|
|
63
|
-
"@theoremjs/agents": "^0.3.5-next.
|
|
64
|
-
"@theoremjs/web": "^0.3.5-next.
|
|
63
|
+
"@theoremjs/agents": "^0.3.5-next.1046.g08fd205",
|
|
64
|
+
"@theoremjs/web": "^0.3.5-next.1046.g08fd205"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@astryxdesign/core": {
|
package/ui/ChatComposerRow.js
CHANGED
|
@@ -55,6 +55,7 @@ const PILL_RADIUS = knob('pill-radius', 'var(--radius-full)');
|
|
|
55
55
|
const PILL_FILL = knob('pill-fill', FILL);
|
|
56
56
|
const PILL_SHADOW = knob('pill-shadow', SHADOW);
|
|
57
57
|
const PILL_ALIGN = knob('pill-align', 'center');
|
|
58
|
+
const PILL_SHADOW_ROOM = knob('pill-shadow-room', 'var(--spacing-3)');
|
|
58
59
|
/** The pill shape, kept whole when the row scrolls. */
|
|
59
60
|
const PILL = {
|
|
60
61
|
height: PILL_HEIGHT,
|
|
@@ -72,11 +73,22 @@ const WORKING_PILL = {
|
|
|
72
73
|
};
|
|
73
74
|
/** invariant: The pill row keeps one pill's height whatever it holds, so the composer never moves. */
|
|
74
75
|
const PILL_ROW = { paddingInline: INSET, minHeight: PILL_HEIGHT };
|
|
75
|
-
/**
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
/**
|
|
77
|
+
* why: The pills sit where `pill-align` puts them, however many there are; once they outgrow the
|
|
78
|
+
* row they scroll sideways from its start (`safe`), so none is out of reach.
|
|
79
|
+
* why: A scroller clips what its children paint outside it, so it reaches past the row by the pill
|
|
80
|
+
* shadow's room, above, below and at its start, and pads it back: the pills stay where they were and
|
|
81
|
+
* their shadows round off whole. The end needs none: the mask fades it.
|
|
82
|
+
*/
|
|
83
|
+
const PILLS = {
|
|
84
|
+
display: 'flex',
|
|
85
|
+
justifyContent: `safe ${PILL_ALIGN}`,
|
|
78
86
|
overflowX: 'auto',
|
|
79
87
|
scrollbarWidth: 'none',
|
|
88
|
+
paddingBlock: PILL_SHADOW_ROOM,
|
|
89
|
+
marginBlock: `calc(-1 * ${PILL_SHADOW_ROOM})`,
|
|
90
|
+
paddingInlineStart: PILL_SHADOW_ROOM,
|
|
91
|
+
marginInlineStart: `calc(-1 * ${PILL_SHADOW_ROOM})`,
|
|
80
92
|
// why: Pills that scroll fade out at the end instead of being cut against the hint.
|
|
81
93
|
maskImage: 'linear-gradient(to right, black calc(100% - var(--spacing-6)), transparent)',
|
|
82
94
|
};
|
|
@@ -117,8 +129,8 @@ function WorkingPill({ since, icons, renderPillWords, onStop, }) {
|
|
|
117
129
|
return (_jsx(Token, { size: "lg", className: "theorem-composer-pill", "data-pill": "working", style: WORKING_PILL, ...pillWords({ pill: 'working', words: label }, renderPillWords, _jsx(IconButton, { label: stop, tooltip: stop, size: "sm", variant: "secondary", icon: icons?.stop ?? _jsx(IconPlayerStopFilled, { size: 12 }), onClick: onStop })), icon: pillIcon(icons?.working, _jsx(Spinner, { size: "sm", shade: "inherit", "aria-label": label })) }));
|
|
118
130
|
}
|
|
119
131
|
/**
|
|
120
|
-
* The pill row.
|
|
121
|
-
*
|
|
132
|
+
* The pill row. The pills sit centred over the composer (see `pill-align`): the working pill leads
|
|
133
|
+
* and the rest follow it, scrolling sideways once they outgrow the row.
|
|
122
134
|
*/
|
|
123
135
|
function PillRow(props) {
|
|
124
136
|
const t = useLabels();
|
|
@@ -134,7 +146,7 @@ function PillRow(props) {
|
|
|
134
146
|
].filter(Boolean);
|
|
135
147
|
if (pills.length === 0 && !props.hint)
|
|
136
148
|
return null;
|
|
137
|
-
return (_jsxs(HStack, { gap: 2, vAlign: "center", className: "theorem-composer-pills", style: PILL_ROW, children: [_jsx(StackItem, { size: "fill", style:
|
|
149
|
+
return (_jsxs(HStack, { gap: 2, vAlign: "center", className: "theorem-composer-pills", style: PILL_ROW, children: [_jsx(StackItem, { size: "fill", style: PILLS, children: _jsx(HStack, { gap: 1, vAlign: "center", children: pills }) }), props.hint] }));
|
|
138
150
|
}
|
|
139
151
|
/**
|
|
140
152
|
* What waits to send, on a card of its own above the surface: a header with the count, then the
|