@designa8/vibedesign-tinkerly-dryrun-ds-176b 0.0.7 → 0.0.8
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 +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
- package/src/organisms/ChatWindow/ChatWindow.tsx +26 -1
- package/src/organisms/ChatWindow/preview.tsx +37 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-tinkerly-dryrun-ds-176b
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.0.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.0.8**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -7798,6 +7798,7 @@ var MAX_COMPOSER_ROWS = 6;
|
|
|
7798
7798
|
var ChatWindow = React49.forwardRef(
|
|
7799
7799
|
({
|
|
7800
7800
|
variant = "channel",
|
|
7801
|
+
chrome = "card",
|
|
7801
7802
|
channelName = "Project Kickoff",
|
|
7802
7803
|
title,
|
|
7803
7804
|
subtitle,
|
|
@@ -7827,6 +7828,7 @@ var ChatWindow = React49.forwardRef(
|
|
|
7827
7828
|
const [reactions, setReactions] = React49.useState({});
|
|
7828
7829
|
const [selectedMode, setSelectedMode] = React49.useState("");
|
|
7829
7830
|
const isAssistant = variant === "assistant";
|
|
7831
|
+
const isFlush = chrome === "none";
|
|
7830
7832
|
const heading = (isAssistant ? title ?? channelName : channelName) || channelName;
|
|
7831
7833
|
const threadLabel = "Conversation in " + heading;
|
|
7832
7834
|
const placeholder = "Message " + heading;
|
|
@@ -7941,7 +7943,8 @@ var ChatWindow = React49.forwardRef(
|
|
|
7941
7943
|
{
|
|
7942
7944
|
ref,
|
|
7943
7945
|
className: cn33(
|
|
7944
|
-
"flex w-full flex-col overflow-hidden
|
|
7946
|
+
"flex w-full flex-col overflow-hidden",
|
|
7947
|
+
isFlush ? "h-full" : "rounded-lg border border-hairline bg-surface shadow-card",
|
|
7945
7948
|
className
|
|
7946
7949
|
),
|
|
7947
7950
|
...rest,
|
package/dist/index.js
CHANGED
|
@@ -7673,6 +7673,7 @@ var MAX_COMPOSER_ROWS = 6;
|
|
|
7673
7673
|
var ChatWindow = React49.forwardRef(
|
|
7674
7674
|
({
|
|
7675
7675
|
variant = "channel",
|
|
7676
|
+
chrome = "card",
|
|
7676
7677
|
channelName = "Project Kickoff",
|
|
7677
7678
|
title,
|
|
7678
7679
|
subtitle,
|
|
@@ -7702,6 +7703,7 @@ var ChatWindow = React49.forwardRef(
|
|
|
7702
7703
|
const [reactions, setReactions] = React49.useState({});
|
|
7703
7704
|
const [selectedMode, setSelectedMode] = React49.useState("");
|
|
7704
7705
|
const isAssistant = variant === "assistant";
|
|
7706
|
+
const isFlush = chrome === "none";
|
|
7705
7707
|
const heading = (isAssistant ? title ?? channelName : channelName) || channelName;
|
|
7706
7708
|
const threadLabel = "Conversation in " + heading;
|
|
7707
7709
|
const placeholder = "Message " + heading;
|
|
@@ -7816,7 +7818,8 @@ var ChatWindow = React49.forwardRef(
|
|
|
7816
7818
|
{
|
|
7817
7819
|
ref,
|
|
7818
7820
|
className: cn33(
|
|
7819
|
-
"flex w-full flex-col overflow-hidden
|
|
7821
|
+
"flex w-full flex-col overflow-hidden",
|
|
7822
|
+
isFlush ? "h-full" : "rounded-lg border border-hairline bg-surface shadow-card",
|
|
7820
7823
|
className
|
|
7821
7824
|
),
|
|
7822
7825
|
...rest,
|
package/package.json
CHANGED
|
@@ -28,9 +28,22 @@ import { Textarea } from "../../atoms/Textarea";
|
|
|
28
28
|
* send button that waits for a draft. Enter sends, Shift+Enter adds a line.
|
|
29
29
|
* A floating "scroll to latest" control appears above the composer once the
|
|
30
30
|
* thread is scrolled up.
|
|
31
|
+
*
|
|
32
|
+
* `chrome` decides whether the window paints its own outer surface:
|
|
33
|
+
*
|
|
34
|
+
* - `"card"` (default) — the bordered, rounded, shadowed card that stands alone
|
|
35
|
+
* on a canvas.
|
|
36
|
+
* - `"none"` — no outer border, radius, shadow or background of its own, so the
|
|
37
|
+
* window sits flush inside an app's side panel and fills its height (`h-full`):
|
|
38
|
+
* the thread scrolls and the composer stays pinned to the bottom. The header
|
|
39
|
+
* keeps its bottom divider so it still separates from the thread. Both
|
|
40
|
+
* variants support it.
|
|
31
41
|
*/
|
|
32
42
|
export type ChatWindowVariant = "channel" | "assistant";
|
|
33
43
|
|
|
44
|
+
/** Whether the window paints its own outer card surface. */
|
|
45
|
+
export type ChatWindowChrome = "card" | "none";
|
|
46
|
+
|
|
34
47
|
/** Who wrote a message. Only the `assistant` variant reads this. */
|
|
35
48
|
export type ChatMessageRole = "user" | "assistant";
|
|
36
49
|
|
|
@@ -91,6 +104,13 @@ export interface ChatWindowProps
|
|
|
91
104
|
extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSubmit" | "children"> {
|
|
92
105
|
/** Conversation surface — see `ChatWindowVariant`. Defaults to `"channel"`. */
|
|
93
106
|
variant?: ChatWindowVariant;
|
|
107
|
+
/**
|
|
108
|
+
* Outer surface. `"card"` (default) paints the bordered, rounded, shadowed
|
|
109
|
+
* card; `"none"` drops the window's own border, radius, shadow and background
|
|
110
|
+
* so it sits flush inside a panel and fills the available height. The header
|
|
111
|
+
* keeps its bottom divider either way.
|
|
112
|
+
*/
|
|
113
|
+
chrome?: ChatWindowChrome;
|
|
94
114
|
/** Channel variant: the channel name. Also the assistant fallback title. */
|
|
95
115
|
channelName?: string;
|
|
96
116
|
/** Assistant variant: the thread title. */
|
|
@@ -152,6 +172,7 @@ export const ChatWindow = React.forwardRef<HTMLDivElement, ChatWindowProps>(
|
|
|
152
172
|
(
|
|
153
173
|
{
|
|
154
174
|
variant = "channel",
|
|
175
|
+
chrome = "card",
|
|
155
176
|
channelName = "Project Kickoff",
|
|
156
177
|
title,
|
|
157
178
|
subtitle,
|
|
@@ -184,6 +205,7 @@ export const ChatWindow = React.forwardRef<HTMLDivElement, ChatWindowProps>(
|
|
|
184
205
|
const [selectedMode, setSelectedMode] = React.useState<string>("");
|
|
185
206
|
|
|
186
207
|
const isAssistant = variant === "assistant";
|
|
208
|
+
const isFlush = chrome === "none";
|
|
187
209
|
const heading =
|
|
188
210
|
(isAssistant ? title ?? channelName : channelName) || channelName;
|
|
189
211
|
|
|
@@ -329,7 +351,10 @@ export const ChatWindow = React.forwardRef<HTMLDivElement, ChatWindowProps>(
|
|
|
329
351
|
<div
|
|
330
352
|
ref={ref}
|
|
331
353
|
className={cn(
|
|
332
|
-
"flex w-full flex-col overflow-hidden
|
|
354
|
+
"flex w-full flex-col overflow-hidden",
|
|
355
|
+
isFlush
|
|
356
|
+
? "h-full"
|
|
357
|
+
: "rounded-lg border border-hairline bg-surface shadow-card",
|
|
333
358
|
className,
|
|
334
359
|
)}
|
|
335
360
|
{...rest}
|
|
@@ -133,6 +133,43 @@ export default function ChatWindowPreview(): React.ReactElement {
|
|
|
133
133
|
onSend={(text) => note("channel sent: " + text)}
|
|
134
134
|
/>
|
|
135
135
|
|
|
136
|
+
{/* chrome="none" — flush inside a side panel, no card of its own. */}
|
|
137
|
+
<div className="w-full">
|
|
138
|
+
<p className="mb-sm text-body-sm text-muted">
|
|
139
|
+
chrome="none" — flush inside a side panel
|
|
140
|
+
</p>
|
|
141
|
+
|
|
142
|
+
<div className="h-[480px] w-full overflow-hidden rounded-lg border border-hairline bg-surface-soft p-sm">
|
|
143
|
+
<ChatWindow
|
|
144
|
+
variant="assistant"
|
|
145
|
+
chrome="none"
|
|
146
|
+
title="Workspace helper"
|
|
147
|
+
subtitle="Pinned to the panel"
|
|
148
|
+
headerActions={[
|
|
149
|
+
{
|
|
150
|
+
icon: "plus",
|
|
151
|
+
label: "New thread",
|
|
152
|
+
onClick: () => note("new thread"),
|
|
153
|
+
},
|
|
154
|
+
]}
|
|
155
|
+
messages={thread}
|
|
156
|
+
suggestions={["Summarise this sprint"]}
|
|
157
|
+
onSuggestion={sendMessage}
|
|
158
|
+
composerPlaceholder="Ask about this panel"
|
|
159
|
+
composerModes={MODES}
|
|
160
|
+
mode={mode}
|
|
161
|
+
onModeChange={(next) => {
|
|
162
|
+
setMode(next);
|
|
163
|
+
note("mode: " + next);
|
|
164
|
+
}}
|
|
165
|
+
onSend={sendMessage}
|
|
166
|
+
onMessageAction={(id: string, action: ChatMessageAction) =>
|
|
167
|
+
note(action + " on " + id)
|
|
168
|
+
}
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
136
173
|
<p className="text-body-sm text-muted">
|
|
137
174
|
{log.length > 0
|
|
138
175
|
? "Latest events: " + log.join(" · ")
|