@patterninc/pattern-ui 0.0.0-main.202610262330.1739a2f13aa2 → 0.0.0-main.202610270514.2e8a0fcab86d
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/ai-elements/reasoning/reasoning.js +112 -124
- package/dist/ai-elements/thinking/thinking.js +75 -63
- package/dist/browser/@patterninc/pattern-ui/reasoning-stepped.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/reasoning.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/thinking.js +1 -1
- package/dist/browser/_chunks/reasoning-CF8YvujA.js +1 -0
- package/dist/play-cdn-claude.js +1 -1
- package/package.json +1 -1
- package/src/ai-elements/reasoning/reasoning.tsx +19 -46
- package/src/ai-elements/thinking/thinking.tsx +13 -4
- package/dist/browser/_chunks/reasoning-D7oBFArT.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { panelTransition, springTransition } from "../../utils/transitions.js";
|
|
2
|
+
import { useExpandableHeight } from "../../utils/use-expandable-height.js";
|
|
2
3
|
import SpinnerIcon from "../../components/icons/SpinnerIcon.js";
|
|
3
4
|
import CloseIcon from "../../components/icons/CloseIcon.js";
|
|
4
5
|
import ChevronRightIcon from "../../components/icons/ChevronRightIcon.js";
|
|
@@ -7,7 +8,7 @@ import Completed from "../../components/icons/Completed.js";
|
|
|
7
8
|
import LogoPIStroke from "../../components/icons/LogoPIStroke.js";
|
|
8
9
|
import { c } from "react/compiler-runtime";
|
|
9
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { createContext, useContext,
|
|
11
|
+
import { createContext, useContext, useId, useState } from "react";
|
|
11
12
|
import { motion } from "motion/react";
|
|
12
13
|
import { useLingui } from "@lingui/react";
|
|
13
14
|
import { cn } from "cn";
|
|
@@ -29,11 +30,12 @@ const useReasoning = () => {
|
|
|
29
30
|
return context;
|
|
30
31
|
};
|
|
31
32
|
function Reasoning(t0) {
|
|
32
|
-
const $ = c(
|
|
33
|
+
const $ = c(16);
|
|
33
34
|
const { className, children, open: controlledOpen, defaultOpen: t1, onOpenChange, qaTestId: t2 } = t0;
|
|
34
35
|
const defaultOpen = t1 === void 0 ? false : t1;
|
|
35
36
|
const qaTestId = t2 === void 0 ? "reasoning" : t2;
|
|
36
37
|
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
38
|
+
const contentId = useId();
|
|
37
39
|
const isControlled = controlledOpen !== void 0;
|
|
38
40
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
39
41
|
let t3;
|
|
@@ -48,52 +50,54 @@ function Reasoning(t0) {
|
|
|
48
50
|
} else t3 = $[2];
|
|
49
51
|
const setIsOpen = t3;
|
|
50
52
|
let t4;
|
|
51
|
-
if ($[3] !==
|
|
53
|
+
if ($[3] !== contentId || $[4] !== isOpen || $[5] !== setIsOpen) {
|
|
52
54
|
t4 = {
|
|
53
55
|
isOpen,
|
|
54
|
-
setIsOpen
|
|
56
|
+
setIsOpen,
|
|
57
|
+
contentId
|
|
55
58
|
};
|
|
56
|
-
$[3] =
|
|
57
|
-
$[4] =
|
|
58
|
-
$[5] =
|
|
59
|
-
|
|
59
|
+
$[3] = contentId;
|
|
60
|
+
$[4] = isOpen;
|
|
61
|
+
$[5] = setIsOpen;
|
|
62
|
+
$[6] = t4;
|
|
63
|
+
} else t4 = $[6];
|
|
60
64
|
let t5;
|
|
61
|
-
if ($[
|
|
65
|
+
if ($[7] !== className) {
|
|
62
66
|
t5 = cn("not-prose", className);
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
} else t5 = $[
|
|
67
|
+
$[7] = className;
|
|
68
|
+
$[8] = t5;
|
|
69
|
+
} else t5 = $[8];
|
|
66
70
|
let t6;
|
|
67
|
-
if ($[
|
|
71
|
+
if ($[9] !== children || $[10] !== qaTestId || $[11] !== t5) {
|
|
68
72
|
t6 = /* @__PURE__ */ jsx("div", {
|
|
69
73
|
className: t5,
|
|
70
74
|
"qa-test-id": qaTestId,
|
|
71
75
|
children
|
|
72
76
|
});
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
} else t6 = $[
|
|
77
|
+
$[9] = children;
|
|
78
|
+
$[10] = qaTestId;
|
|
79
|
+
$[11] = t5;
|
|
80
|
+
$[12] = t6;
|
|
81
|
+
} else t6 = $[12];
|
|
78
82
|
let t7;
|
|
79
|
-
if ($[
|
|
83
|
+
if ($[13] !== t4 || $[14] !== t6) {
|
|
80
84
|
t7 = /* @__PURE__ */ jsx(ReasoningContext.Provider, {
|
|
81
85
|
value: t4,
|
|
82
86
|
children: t6
|
|
83
87
|
});
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
} else t7 = $[
|
|
88
|
+
$[13] = t4;
|
|
89
|
+
$[14] = t6;
|
|
90
|
+
$[15] = t7;
|
|
91
|
+
} else t7 = $[15];
|
|
88
92
|
return t7;
|
|
89
93
|
}
|
|
90
94
|
function ReasoningTrigger(t0) {
|
|
91
|
-
const $ = c(
|
|
95
|
+
const $ = c(25);
|
|
92
96
|
const { className, headerText, status: t1, children, qaTestId: t2 } = t0;
|
|
93
97
|
const status = t1 === void 0 ? "thinking" : t1;
|
|
94
98
|
const qaTestId = t2 === void 0 ? "reasoning-trigger" : t2;
|
|
95
99
|
const { _: $__ } = useLingui();
|
|
96
|
-
const { isOpen, setIsOpen } = useReasoning();
|
|
100
|
+
const { isOpen, setIsOpen, contentId } = useReasoning();
|
|
97
101
|
let t3;
|
|
98
102
|
if ($[0] !== status) {
|
|
99
103
|
t3 = getReasoningIcon(status);
|
|
@@ -162,10 +166,12 @@ function ReasoningTrigger(t0) {
|
|
|
162
166
|
$[17] = t9;
|
|
163
167
|
} else t9 = $[17];
|
|
164
168
|
let t10;
|
|
165
|
-
if ($[18] !==
|
|
169
|
+
if ($[18] !== contentId || $[19] !== handleClick || $[20] !== isOpen || $[21] !== qaTestId || $[22] !== t7 || $[23] !== t9) {
|
|
166
170
|
t10 = /* @__PURE__ */ jsx(motion.button, {
|
|
167
171
|
type: "button",
|
|
168
172
|
onClick: handleClick,
|
|
173
|
+
"aria-expanded": isOpen,
|
|
174
|
+
"aria-controls": contentId,
|
|
169
175
|
whileTap: t5,
|
|
170
176
|
transition: springTransition,
|
|
171
177
|
className: t7,
|
|
@@ -173,150 +179,132 @@ function ReasoningTrigger(t0) {
|
|
|
173
179
|
"qa-test-id": qaTestId,
|
|
174
180
|
children: t9
|
|
175
181
|
});
|
|
176
|
-
$[18] =
|
|
177
|
-
$[19] =
|
|
178
|
-
$[20] =
|
|
179
|
-
$[21] =
|
|
180
|
-
$[22] =
|
|
181
|
-
|
|
182
|
+
$[18] = contentId;
|
|
183
|
+
$[19] = handleClick;
|
|
184
|
+
$[20] = isOpen;
|
|
185
|
+
$[21] = qaTestId;
|
|
186
|
+
$[22] = t7;
|
|
187
|
+
$[23] = t9;
|
|
188
|
+
$[24] = t10;
|
|
189
|
+
} else t10 = $[24];
|
|
182
190
|
return t10;
|
|
183
191
|
}
|
|
184
192
|
function ReasoningContent(t0) {
|
|
185
|
-
const $ = c(
|
|
193
|
+
const $ = c(26);
|
|
186
194
|
const { className, children, tags: t1, qaTestId: t2 } = t0;
|
|
187
195
|
let t3;
|
|
188
196
|
if ($[0] !== t1) {
|
|
189
|
-
t3 = t1 === void 0 ? [
|
|
197
|
+
t3 = t1 === void 0 ? [] : t1;
|
|
190
198
|
$[0] = t1;
|
|
191
199
|
$[1] = t3;
|
|
192
200
|
} else t3 = $[1];
|
|
193
201
|
const tags = t3;
|
|
194
202
|
const qaTestId = t2 === void 0 ? "reasoning-content" : t2;
|
|
195
|
-
const { isOpen } = useReasoning();
|
|
196
|
-
const contentRef =
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const element = contentRef.current;
|
|
205
|
-
if (element) setMeasuredHeight(element.scrollHeight);
|
|
206
|
-
};
|
|
207
|
-
let frameId = requestAnimationFrame(() => {
|
|
208
|
-
frameId = requestAnimationFrame(measureHeight);
|
|
209
|
-
});
|
|
210
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
211
|
-
if (contentRef.current) requestAnimationFrame(measureHeight);
|
|
212
|
-
});
|
|
213
|
-
resizeObserver.observe(contentElement);
|
|
214
|
-
return () => {
|
|
215
|
-
resizeObserver.disconnect();
|
|
216
|
-
if (frameId !== null) cancelAnimationFrame(frameId);
|
|
217
|
-
};
|
|
203
|
+
const { isOpen, contentId } = useReasoning();
|
|
204
|
+
const { contentRef, measuredHeight } = useExpandableHeight();
|
|
205
|
+
const t4 = isOpen ? measuredHeight : 0;
|
|
206
|
+
const t5 = isOpen ? 1 : 0;
|
|
207
|
+
let t6;
|
|
208
|
+
if ($[2] !== t4 || $[3] !== t5) {
|
|
209
|
+
t6 = {
|
|
210
|
+
height: t4,
|
|
211
|
+
opacity: t5
|
|
218
212
|
};
|
|
219
213
|
$[2] = t4;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
$[4] = tags;
|
|
226
|
-
$[5] = t5;
|
|
227
|
-
} else t5 = $[5];
|
|
228
|
-
useEffect(t4, t5);
|
|
229
|
-
const t6 = isOpen ? measuredHeight : 0;
|
|
230
|
-
const t7 = isOpen ? 1 : 0;
|
|
214
|
+
$[3] = t5;
|
|
215
|
+
$[4] = t6;
|
|
216
|
+
} else t6 = $[4];
|
|
217
|
+
const contentAnimationValues = t6;
|
|
218
|
+
const t7 = !isOpen;
|
|
231
219
|
let t8;
|
|
232
|
-
if ($[
|
|
233
|
-
t8 =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
$[6] = t6;
|
|
238
|
-
$[7] = t7;
|
|
239
|
-
$[8] = t8;
|
|
240
|
-
} else t8 = $[8];
|
|
241
|
-
const contentAnimationValues = t8;
|
|
220
|
+
if ($[5] !== className) {
|
|
221
|
+
t8 = cn("w-full overflow-hidden", className);
|
|
222
|
+
$[5] = className;
|
|
223
|
+
$[6] = t8;
|
|
224
|
+
} else t8 = $[6];
|
|
242
225
|
let t9;
|
|
243
|
-
if ($[
|
|
244
|
-
t9 =
|
|
245
|
-
$[9] = className;
|
|
246
|
-
$[10] = t9;
|
|
247
|
-
} else t9 = $[10];
|
|
248
|
-
let t10;
|
|
249
|
-
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
250
|
-
t10 = {
|
|
226
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
227
|
+
t9 = {
|
|
251
228
|
willChange: "height, opacity",
|
|
252
229
|
transform: "translate3d(0, 0, 0)",
|
|
253
230
|
backfaceVisibility: "hidden"
|
|
254
231
|
};
|
|
255
|
-
$[
|
|
256
|
-
} else
|
|
257
|
-
let
|
|
258
|
-
if ($[
|
|
259
|
-
|
|
232
|
+
$[7] = t9;
|
|
233
|
+
} else t9 = $[7];
|
|
234
|
+
let t10;
|
|
235
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
236
|
+
t10 = /* @__PURE__ */ jsx("div", {
|
|
260
237
|
className: "flex w-6 items-center justify-center",
|
|
261
238
|
children: /* @__PURE__ */ jsx("div", { className: "h-full w-[1.5px] rounded-full bg-border-soft" })
|
|
262
239
|
});
|
|
263
|
-
$[
|
|
264
|
-
} else
|
|
265
|
-
let
|
|
266
|
-
if ($[
|
|
267
|
-
|
|
240
|
+
$[8] = t10;
|
|
241
|
+
} else t10 = $[8];
|
|
242
|
+
let t11;
|
|
243
|
+
if ($[9] !== children) {
|
|
244
|
+
t11 = /* @__PURE__ */ jsx("div", {
|
|
268
245
|
className: "py-2",
|
|
269
246
|
children: /* @__PURE__ */ jsx("div", {
|
|
270
247
|
className: "pui-text-body-medium-compact wrap-break-word whitespace-pre-wrap text-text-soft",
|
|
271
248
|
children
|
|
272
249
|
})
|
|
273
250
|
});
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
} else
|
|
277
|
-
let
|
|
278
|
-
if ($[
|
|
279
|
-
|
|
251
|
+
$[9] = children;
|
|
252
|
+
$[10] = t11;
|
|
253
|
+
} else t11 = $[10];
|
|
254
|
+
let t12;
|
|
255
|
+
if ($[11] !== tags) {
|
|
256
|
+
t12 = tags.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
280
257
|
className: "flex flex-wrap gap-2 py-2",
|
|
281
258
|
children: tags.map(_temp)
|
|
282
259
|
}) : null;
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
} else
|
|
260
|
+
$[11] = tags;
|
|
261
|
+
$[12] = t12;
|
|
262
|
+
} else t12 = $[12];
|
|
263
|
+
let t13;
|
|
264
|
+
if ($[13] !== t11 || $[14] !== t12) {
|
|
265
|
+
t13 = /* @__PURE__ */ jsxs("div", {
|
|
266
|
+
className: "flex gap-2",
|
|
267
|
+
children: [t10, /* @__PURE__ */ jsxs("div", {
|
|
268
|
+
className: "flex-1 space-y-2",
|
|
269
|
+
children: [t11, t12]
|
|
270
|
+
})]
|
|
271
|
+
});
|
|
272
|
+
$[13] = t11;
|
|
273
|
+
$[14] = t12;
|
|
274
|
+
$[15] = t13;
|
|
275
|
+
} else t13 = $[15];
|
|
286
276
|
let t14;
|
|
287
|
-
if ($[
|
|
277
|
+
if ($[16] !== contentRef || $[17] !== t13) {
|
|
288
278
|
t14 = /* @__PURE__ */ jsx("div", {
|
|
289
279
|
ref: contentRef,
|
|
290
280
|
className: "pt-2 pb-4",
|
|
291
|
-
children:
|
|
292
|
-
className: "flex gap-2",
|
|
293
|
-
children: [t11, /* @__PURE__ */ jsxs("div", {
|
|
294
|
-
className: "flex-1 space-y-2",
|
|
295
|
-
children: [t12, t13]
|
|
296
|
-
})]
|
|
297
|
-
})
|
|
281
|
+
children: t13
|
|
298
282
|
});
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
} else t14 = $[
|
|
283
|
+
$[16] = contentRef;
|
|
284
|
+
$[17] = t13;
|
|
285
|
+
$[18] = t14;
|
|
286
|
+
} else t14 = $[18];
|
|
303
287
|
let t15;
|
|
304
|
-
if ($[
|
|
288
|
+
if ($[19] !== contentAnimationValues || $[20] !== contentId || $[21] !== qaTestId || $[22] !== t14 || $[23] !== t7 || $[24] !== t8) {
|
|
305
289
|
t15 = /* @__PURE__ */ jsx(motion.div, {
|
|
290
|
+
id: contentId,
|
|
291
|
+
inert: t7,
|
|
306
292
|
initial: contentAnimationValues,
|
|
307
293
|
animate: contentAnimationValues,
|
|
308
294
|
transition: panelTransition,
|
|
309
|
-
className:
|
|
310
|
-
style:
|
|
295
|
+
className: t8,
|
|
296
|
+
style: t9,
|
|
311
297
|
"qa-test-id": qaTestId,
|
|
312
298
|
children: t14
|
|
313
299
|
});
|
|
314
|
-
$[
|
|
300
|
+
$[19] = contentAnimationValues;
|
|
301
|
+
$[20] = contentId;
|
|
315
302
|
$[21] = qaTestId;
|
|
316
303
|
$[22] = t14;
|
|
317
|
-
$[23] =
|
|
318
|
-
$[24] =
|
|
319
|
-
|
|
304
|
+
$[23] = t7;
|
|
305
|
+
$[24] = t8;
|
|
306
|
+
$[25] = t15;
|
|
307
|
+
} else t15 = $[25];
|
|
320
308
|
return t15;
|
|
321
309
|
}
|
|
322
310
|
function _temp(tag, index) {
|
|
@@ -6,7 +6,7 @@ import { AnimatedLogoPI } from "../../components/icons-animated/AnimatedLogoPI/A
|
|
|
6
6
|
import { useToggle } from "../../hooks/useToggle/useToggle.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { createContext, useContext, useState } from "react";
|
|
9
|
+
import { createContext, useContext, useId, useState } from "react";
|
|
10
10
|
import { motion } from "motion/react";
|
|
11
11
|
import { useLingui } from "@lingui/react";
|
|
12
12
|
import { cn } from "cn";
|
|
@@ -19,11 +19,12 @@ function useThinking() {
|
|
|
19
19
|
return context;
|
|
20
20
|
}
|
|
21
21
|
/** Thinking — Collapsible container for AI thinking/reasoning content. */ function Thinking(t0) {
|
|
22
|
-
const $ = c(
|
|
22
|
+
const $ = c(16);
|
|
23
23
|
const { className, children, open: controlledOpen, defaultOpen: t1, onOpenChange, qaTestId: t2 } = t0;
|
|
24
24
|
const defaultOpen = t1 === void 0 ? false : t1;
|
|
25
25
|
const qaTestId = t2 === void 0 ? "thinking" : t2;
|
|
26
26
|
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
27
|
+
const contentId = useId();
|
|
27
28
|
const isControlled = controlledOpen !== void 0;
|
|
28
29
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
29
30
|
let t3;
|
|
@@ -38,52 +39,54 @@ function useThinking() {
|
|
|
38
39
|
} else t3 = $[2];
|
|
39
40
|
const setIsOpen = t3;
|
|
40
41
|
let t4;
|
|
41
|
-
if ($[3] !==
|
|
42
|
+
if ($[3] !== contentId || $[4] !== isOpen || $[5] !== setIsOpen) {
|
|
42
43
|
t4 = {
|
|
43
44
|
isOpen,
|
|
44
|
-
setIsOpen
|
|
45
|
+
setIsOpen,
|
|
46
|
+
contentId
|
|
45
47
|
};
|
|
46
|
-
$[3] =
|
|
47
|
-
$[4] =
|
|
48
|
-
$[5] =
|
|
49
|
-
|
|
48
|
+
$[3] = contentId;
|
|
49
|
+
$[4] = isOpen;
|
|
50
|
+
$[5] = setIsOpen;
|
|
51
|
+
$[6] = t4;
|
|
52
|
+
} else t4 = $[6];
|
|
50
53
|
let t5;
|
|
51
|
-
if ($[
|
|
54
|
+
if ($[7] !== className) {
|
|
52
55
|
t5 = cn("not-prose", className);
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
} else t5 = $[
|
|
56
|
+
$[7] = className;
|
|
57
|
+
$[8] = t5;
|
|
58
|
+
} else t5 = $[8];
|
|
56
59
|
let t6;
|
|
57
|
-
if ($[
|
|
60
|
+
if ($[9] !== children || $[10] !== qaTestId || $[11] !== t5) {
|
|
58
61
|
t6 = /* @__PURE__ */ jsx("div", {
|
|
59
62
|
className: t5,
|
|
60
63
|
"qa-test-id": qaTestId,
|
|
61
64
|
children
|
|
62
65
|
});
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
} else t6 = $[
|
|
66
|
+
$[9] = children;
|
|
67
|
+
$[10] = qaTestId;
|
|
68
|
+
$[11] = t5;
|
|
69
|
+
$[12] = t6;
|
|
70
|
+
} else t6 = $[12];
|
|
68
71
|
let t7;
|
|
69
|
-
if ($[
|
|
72
|
+
if ($[13] !== t4 || $[14] !== t6) {
|
|
70
73
|
t7 = /* @__PURE__ */ jsx(ThinkingContext.Provider, {
|
|
71
74
|
value: t4,
|
|
72
75
|
children: t6
|
|
73
76
|
});
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
} else t7 = $[
|
|
77
|
+
$[13] = t4;
|
|
78
|
+
$[14] = t6;
|
|
79
|
+
$[15] = t7;
|
|
80
|
+
} else t7 = $[15];
|
|
78
81
|
return t7;
|
|
79
82
|
}
|
|
80
83
|
/** ThinkingTrigger — Clickable trigger that shows the PI logo and timing text. */ function ThinkingTrigger(t0) {
|
|
81
|
-
const $ = c(
|
|
84
|
+
const $ = c(36);
|
|
82
85
|
const { className, headerText, isThinking: t1, qaTestId: t2 } = t0;
|
|
83
86
|
const isThinking = t1 === void 0 ? false : t1;
|
|
84
87
|
const qaTestId = t2 === void 0 ? "thinking-trigger" : t2;
|
|
85
88
|
const { _: $__ } = useLingui();
|
|
86
|
-
const { isOpen, setIsOpen } = useThinking();
|
|
89
|
+
const { isOpen, setIsOpen, contentId } = useThinking();
|
|
87
90
|
const labelColor = isOpen ? "text-text-sub" : "text-text-soft group-hover:text-text-sub";
|
|
88
91
|
let t3;
|
|
89
92
|
if ($[0] !== isOpen || $[1] !== setIsOpen) {
|
|
@@ -180,10 +183,12 @@ function useThinking() {
|
|
|
180
183
|
$[25] = t16;
|
|
181
184
|
} else t16 = $[25];
|
|
182
185
|
let t17;
|
|
183
|
-
if ($[26] !==
|
|
186
|
+
if ($[26] !== contentId || $[27] !== isOpen || $[28] !== qaTestId || $[29] !== t12 || $[30] !== t16 || $[31] !== t3 || $[32] !== t5 || $[33] !== t6 || $[34] !== t9) {
|
|
184
187
|
t17 = /* @__PURE__ */ jsxs(motion.button, {
|
|
185
188
|
type: "button",
|
|
186
189
|
onClick: t3,
|
|
190
|
+
"aria-expanded": isOpen,
|
|
191
|
+
"aria-controls": contentId,
|
|
187
192
|
whileTap: t4,
|
|
188
193
|
transition: springTransition,
|
|
189
194
|
className: t5,
|
|
@@ -195,19 +200,21 @@ function useThinking() {
|
|
|
195
200
|
t16
|
|
196
201
|
]
|
|
197
202
|
});
|
|
198
|
-
$[26] =
|
|
199
|
-
$[27] =
|
|
200
|
-
$[28] =
|
|
201
|
-
$[29] =
|
|
202
|
-
$[30] =
|
|
203
|
-
$[31] =
|
|
204
|
-
$[32] =
|
|
205
|
-
$[33] =
|
|
206
|
-
|
|
203
|
+
$[26] = contentId;
|
|
204
|
+
$[27] = isOpen;
|
|
205
|
+
$[28] = qaTestId;
|
|
206
|
+
$[29] = t12;
|
|
207
|
+
$[30] = t16;
|
|
208
|
+
$[31] = t3;
|
|
209
|
+
$[32] = t5;
|
|
210
|
+
$[33] = t6;
|
|
211
|
+
$[34] = t9;
|
|
212
|
+
$[35] = t17;
|
|
213
|
+
} else t17 = $[35];
|
|
207
214
|
return t17;
|
|
208
215
|
}
|
|
209
216
|
/** ThinkingContent — Animated expandable panel for thinking text and tags. */ function ThinkingContent(t0) {
|
|
210
|
-
const $ = c(
|
|
217
|
+
const $ = c(18);
|
|
211
218
|
const { className, children, tags: t1, qaTestId: t2 } = t0;
|
|
212
219
|
let t3;
|
|
213
220
|
if ($[0] !== t1) {
|
|
@@ -217,7 +224,7 @@ function useThinking() {
|
|
|
217
224
|
} else t3 = $[1];
|
|
218
225
|
const tags = t3;
|
|
219
226
|
const qaTestId = t2 === void 0 ? "thinking-content" : t2;
|
|
220
|
-
const { isOpen } = useThinking();
|
|
227
|
+
const { isOpen, contentId } = useThinking();
|
|
221
228
|
const [hasOpened, setHasOpened] = useState(isOpen);
|
|
222
229
|
if (isOpen && !hasOpened) setHasOpened(true);
|
|
223
230
|
const { contentRef, measuredHeight } = useExpandableHeight();
|
|
@@ -234,18 +241,19 @@ function useThinking() {
|
|
|
234
241
|
$[4] = t6;
|
|
235
242
|
} else t6 = $[4];
|
|
236
243
|
const contentAnimationValues = t6;
|
|
237
|
-
|
|
244
|
+
const t7 = !isOpen;
|
|
245
|
+
let t8;
|
|
238
246
|
if ($[5] !== className) {
|
|
239
|
-
|
|
247
|
+
t8 = cn("w-full overflow-hidden", className);
|
|
240
248
|
$[5] = className;
|
|
241
|
-
$[6] =
|
|
242
|
-
} else
|
|
243
|
-
const
|
|
249
|
+
$[6] = t8;
|
|
250
|
+
} else t8 = $[6];
|
|
251
|
+
const t9 = useToggle("pi_long_chat_render_perf") ? void 0 : {
|
|
244
252
|
willChange: "height, opacity",
|
|
245
253
|
transform: "translate3d(0, 0, 0)",
|
|
246
254
|
backfaceVisibility: "hidden"
|
|
247
255
|
};
|
|
248
|
-
const
|
|
256
|
+
const t10 = !useToggle("pi_long_chat_render_perf") || hasOpened ? /* @__PURE__ */ jsxs("div", {
|
|
249
257
|
className: "flex gap-2",
|
|
250
258
|
children: [/* @__PURE__ */ jsx("div", {
|
|
251
259
|
className: "flex w-6 items-center justify-center",
|
|
@@ -264,36 +272,40 @@ function useThinking() {
|
|
|
264
272
|
}) : null]
|
|
265
273
|
})]
|
|
266
274
|
}) : null;
|
|
267
|
-
let
|
|
268
|
-
if ($[7] !== contentRef || $[8] !==
|
|
269
|
-
|
|
275
|
+
let t11;
|
|
276
|
+
if ($[7] !== contentRef || $[8] !== t10) {
|
|
277
|
+
t11 = /* @__PURE__ */ jsx("div", {
|
|
270
278
|
ref: contentRef,
|
|
271
279
|
className: "py-4",
|
|
272
|
-
children:
|
|
280
|
+
children: t10
|
|
273
281
|
});
|
|
274
282
|
$[7] = contentRef;
|
|
275
|
-
$[8] =
|
|
276
|
-
$[9] =
|
|
277
|
-
} else
|
|
278
|
-
let
|
|
279
|
-
if ($[10] !== contentAnimationValues || $[11] !==
|
|
280
|
-
|
|
283
|
+
$[8] = t10;
|
|
284
|
+
$[9] = t11;
|
|
285
|
+
} else t11 = $[9];
|
|
286
|
+
let t12;
|
|
287
|
+
if ($[10] !== contentAnimationValues || $[11] !== contentId || $[12] !== qaTestId || $[13] !== t11 || $[14] !== t7 || $[15] !== t8 || $[16] !== t9) {
|
|
288
|
+
t12 = /* @__PURE__ */ jsx(motion.div, {
|
|
289
|
+
id: contentId,
|
|
290
|
+
inert: t7,
|
|
281
291
|
initial: contentAnimationValues,
|
|
282
292
|
animate: contentAnimationValues,
|
|
283
293
|
transition: panelTransition,
|
|
284
|
-
className:
|
|
285
|
-
style:
|
|
294
|
+
className: t8,
|
|
295
|
+
style: t9,
|
|
286
296
|
"qa-test-id": qaTestId,
|
|
287
|
-
children:
|
|
297
|
+
children: t11
|
|
288
298
|
});
|
|
289
299
|
$[10] = contentAnimationValues;
|
|
290
|
-
$[11] =
|
|
291
|
-
$[12] =
|
|
292
|
-
$[13] =
|
|
293
|
-
$[14] =
|
|
294
|
-
$[15] =
|
|
295
|
-
|
|
296
|
-
|
|
300
|
+
$[11] = contentId;
|
|
301
|
+
$[12] = qaTestId;
|
|
302
|
+
$[13] = t11;
|
|
303
|
+
$[14] = t7;
|
|
304
|
+
$[15] = t8;
|
|
305
|
+
$[16] = t9;
|
|
306
|
+
$[17] = t12;
|
|
307
|
+
} else t12 = $[17];
|
|
308
|
+
return t12;
|
|
297
309
|
}
|
|
298
310
|
function _temp(tag, index) {
|
|
299
311
|
return /* @__PURE__ */ jsx(Tag, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../_chunks/rolldown-runtime-BWaJ3C7D.js";import{t}from"../../_chunks/compiler-runtime-B3BlmaWz.js";import{t as n}from"../../_chunks/jsx-runtime-Dgn0yPdi.js";import{t as r}from"../../_chunks/dist-BNSTMZct.js";import{n as i,r as a,t as o}from"../../_chunks/reasoning-
|
|
1
|
+
import{a as e}from"../../_chunks/rolldown-runtime-BWaJ3C7D.js";import{t}from"../../_chunks/compiler-runtime-B3BlmaWz.js";import{t as n}from"../../_chunks/jsx-runtime-Dgn0yPdi.js";import{t as r}from"../../_chunks/dist-BNSTMZct.js";import{n as i,r as a,t as o}from"../../_chunks/reasoning-CF8YvujA.js";var s=t(),c=/* @__PURE__ */ e(n(),1);function l(e){let t=(0,s.c)(9),{className:n,children:i,qaTestId:a}=e,o=a===void 0?`reasoning-stepped`:a,l;t[0]===n?l=t[1]:(l=r(`relative`,n),t[0]=n,t[1]=l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=/* @__PURE__ */ (0,c.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-3.5 bottom-0 left-3 w-[1.5px] -translate-x-1/2 rounded-full bg-border-soft`,"data-slot":`reasoning-spine`}),t[2]=u):u=t[2];let d;t[3]===i?d=t[4]:(d=/* @__PURE__ */ (0,c.jsx)(`div`,{className:`relative flex flex-col gap-2`,children:i}),t[3]=i,t[4]=d);let f;return t[5]!==o||t[6]!==l||t[7]!==d?(f=/* @__PURE__ */ (0,c.jsxs)(`div`,{className:l,"qa-test-id":o,children:[u,d]}),t[5]=o,t[6]=l,t[7]=d,t[8]=f):f=t[8],f}function u(e){let t=(0,s.c)(15),{className:n,status:l,headerText:u,tags:d,children:f,qaTestId:p}=e,m;t[0]===d?m=t[1]:(m=d===void 0?[]:d,t[0]=d,t[1]=m);let h=m,g=p===void 0?`reasoning-step`:p,_;t[2]===n?_=t[3]:(_=r(`not-prose`,n),t[2]=n,t[3]=_);let v;t[4]!==u||t[5]!==l?(v=/* @__PURE__ */ (0,c.jsx)(a,{status:l,headerText:u,className:`w-full bg-base-inverse py-1`}),t[4]=u,t[5]=l,t[6]=v):v=t[6];let y;t[7]!==f||t[8]!==h?(y=/* @__PURE__ */ (0,c.jsx)(i,{tags:h,children:f}),t[7]=f,t[8]=h,t[9]=y):y=t[9];let b;return t[10]!==g||t[11]!==_||t[12]!==v||t[13]!==y?(b=/* @__PURE__ */ (0,c.jsxs)(o,{className:_,qaTestId:g,children:[v,y]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y,t[14]=b):b=t[14],b}export{u as ReasoningStep,l as ReasoningStepped};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as Reasoning,n as ReasoningContent,r as ReasoningTrigger}from"../../_chunks/reasoning-
|
|
1
|
+
export{t as Reasoning,n as ReasoningContent,r as ReasoningTrigger}from"../../_chunks/reasoning-CF8YvujA.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../_chunks/rolldown-runtime-BWaJ3C7D.js";import{p as t,v as n}from"../../_chunks/transitions-Cn0Tw_ua.js";import{t as r}from"../../_chunks/react-CUaU2Z9V.js";import{t as i}from"../../_chunks/ChevronRightIcon-Dgm8qBR8.js";import{t as a}from"../../_chunks/compiler-runtime-B3BlmaWz.js";import{t as o}from"../../_chunks/jsx-runtime-Dgn0yPdi.js";import{t as s}from"../../_chunks/dist-BNSTMZct.js";import{n as c}from"../../_chunks/react-CqECE5Y5.js";import{i as l}from"../../_chunks/dist-BRMXKypj.js";import{t as u}from"../../_chunks/Tag-ORoY16Bh.js";import{t as d}from"../../_chunks/useToggle-KhIvNcUP.js";import{t as f}from"../../_chunks/AnimatedLogoPI-D_hFmT9Q.js";import{t as p}from"../../_chunks/use-expandable-height-L9fv496p.js";var m=a(),h=/* @__PURE__ */ e(o(),1),g=/* @__PURE__ */ e(r(),1);const _=(0,g.createContext)(null);function v(){let e=(0,g.useContext)(_);if(!e)throw Error(`ThinkingTrigger and ThinkingContent must be used within a Thinking provider`);return e}function y(e){let t=(0,m.c)(
|
|
1
|
+
import{a as e}from"../../_chunks/rolldown-runtime-BWaJ3C7D.js";import{p as t,v as n}from"../../_chunks/transitions-Cn0Tw_ua.js";import{t as r}from"../../_chunks/react-CUaU2Z9V.js";import{t as i}from"../../_chunks/ChevronRightIcon-Dgm8qBR8.js";import{t as a}from"../../_chunks/compiler-runtime-B3BlmaWz.js";import{t as o}from"../../_chunks/jsx-runtime-Dgn0yPdi.js";import{t as s}from"../../_chunks/dist-BNSTMZct.js";import{n as c}from"../../_chunks/react-CqECE5Y5.js";import{i as l}from"../../_chunks/dist-BRMXKypj.js";import{t as u}from"../../_chunks/Tag-ORoY16Bh.js";import{t as d}from"../../_chunks/useToggle-KhIvNcUP.js";import{t as f}from"../../_chunks/AnimatedLogoPI-D_hFmT9Q.js";import{t as p}from"../../_chunks/use-expandable-height-L9fv496p.js";var m=a(),h=/* @__PURE__ */ e(o(),1),g=/* @__PURE__ */ e(r(),1);const _=(0,g.createContext)(null);function v(){let e=(0,g.useContext)(_);if(!e)throw Error(`ThinkingTrigger and ThinkingContent must be used within a Thinking provider`);return e}function y(e){let t=(0,m.c)(16),{className:n,children:r,open:i,defaultOpen:a,onOpenChange:o,qaTestId:c}=e,l=a!==void 0&&a,u=c===void 0?`thinking`:c,[d,f]=(0,g.useState)(l),p=(0,g.useId)(),v=i!==void 0,y=v?i:d,b;t[0]!==v||t[1]!==o?(b=e=>{v||f(e),o?.(e)},t[0]=v,t[1]=o,t[2]=b):b=t[2];let x=b,S;t[3]!==p||t[4]!==y||t[5]!==x?(S={isOpen:y,setIsOpen:x,contentId:p},t[3]=p,t[4]=y,t[5]=x,t[6]=S):S=t[6];let C;t[7]===n?C=t[8]:(C=s(`not-prose`,n),t[7]=n,t[8]=C);let w;t[9]!==r||t[10]!==u||t[11]!==C?(w=/* @__PURE__ */ (0,h.jsx)(`div`,{className:C,"qa-test-id":u,children:r}),t[9]=r,t[10]=u,t[11]=C,t[12]=w):w=t[12];let T;return t[13]!==S||t[14]!==w?(T=/* @__PURE__ */ (0,h.jsx)(_.Provider,{value:S,children:w}),t[13]=S,t[14]=w,t[15]=T):T=t[15],T}function b(e){let t=(0,m.c)(36),{className:r,headerText:a,isThinking:o,qaTestId:u}=e,p=o!==void 0&&o,g=u===void 0?`thinking-trigger`:u,{_}=l(),{isOpen:y,setIsOpen:b,contentId:x}=v(),S=y?`text-text-sub`:`text-text-soft group-hover:text-text-sub`,C;t[0]!==y||t[1]!==b?(C=()=>b(!y),t[0]=y,t[1]=b,t[2]=C):C=t[2];let w;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w={scale:.95},t[3]=w):w=t[3];let T;t[4]===r?T=t[5]:(T=s(`pui-text-body-medium-alt group flex items-center gap-2 transition-colors`,`cursor-pointer border-none bg-transparent p-0`,r),t[4]=r,t[5]=T);let E=d(`pi_long_chat_render_perf`)?void 0:{transform:`translate3d(0, 0, 0)`,backfaceVisibility:`hidden`},D;t[6]===S?D=t[7]:(D=s(`transition-colors`,S),t[6]=S,t[7]=D);let O;t[8]===p?O=t[9]:(O=/* @__PURE__ */ (0,h.jsx)(f,{isAnimating:p,size:20}),t[8]=p,t[9]=O);let k;t[10]!==D||t[11]!==O?(k=/* @__PURE__ */ (0,h.jsx)(`div`,{className:D,children:O}),t[10]=D,t[11]=O,t[12]=k):k=t[12];let A;t[13]===S?A=t[14]:(A=s(`pui-text-body-medium-compact transition-colors`,S),t[13]=S,t[14]=A);let j;t[15]!==_||t[16]!==a?(j=a??_({id:`-D6jVS`}),t[15]=_,t[16]=a,t[17]=j):j=t[17];let M;t[18]!==A||t[19]!==j?(M=/* @__PURE__ */ (0,h.jsx)(`span`,{className:A,children:j}),t[18]=A,t[19]=j,t[20]=M):M=t[20];let N=y?`rotate-90`:`rotate-0`,P;t[21]===N?P=t[22]:(P=s(`text-icon-soft transition-all duration-200 group-hover:text-icon-strong`,N),t[21]=N,t[22]=P);let F;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(F=/* @__PURE__ */ (0,h.jsx)(i,{size:20,color:`currentColor`}),t[23]=F):F=t[23];let I;t[24]===P?I=t[25]:(I=/* @__PURE__ */ (0,h.jsx)(`div`,{className:P,children:F}),t[24]=P,t[25]=I);let L;return t[26]!==x||t[27]!==y||t[28]!==g||t[29]!==M||t[30]!==I||t[31]!==C||t[32]!==T||t[33]!==E||t[34]!==k?(L=/* @__PURE__ */ (0,h.jsxs)(c.button,{type:`button`,onClick:C,"aria-expanded":y,"aria-controls":x,whileTap:w,transition:n,className:T,style:E,"qa-test-id":g,children:[k,M,I]}),t[26]=x,t[27]=y,t[28]=g,t[29]=M,t[30]=I,t[31]=C,t[32]=T,t[33]=E,t[34]=k,t[35]=L):L=t[35],L}function x(e){let n=(0,m.c)(18),{className:r,children:i,tags:a,qaTestId:o}=e,l;n[0]===a?l=n[1]:(l=a===void 0?[]:a,n[0]=a,n[1]=l);let u=l,f=o===void 0?`thinking-content`:o,{isOpen:_,contentId:y}=v(),[b,x]=(0,g.useState)(_);_&&!b&&x(!0);let{contentRef:C,measuredHeight:w}=p(),T=_?w:0,E=+!!_,D;n[2]!==T||n[3]!==E?(D={height:T,opacity:E},n[2]=T,n[3]=E,n[4]=D):D=n[4];let O=D,k=!_,A;n[5]===r?A=n[6]:(A=s(`w-full overflow-hidden`,r),n[5]=r,n[6]=A);let j=d(`pi_long_chat_render_perf`)?void 0:{willChange:`height, opacity`,transform:`translate3d(0, 0, 0)`,backfaceVisibility:`hidden`},M=!d(`pi_long_chat_render_perf`)||b?/* @__PURE__ */ (0,h.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,h.jsx)(`div`,{className:`flex w-6 items-center justify-center`,children:/* @__PURE__ */ (0,h.jsx)(`div`,{className:`h-full w-px rounded-full bg-depth-black-4`})}),/* @__PURE__ */ (0,h.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[/* @__PURE__ */ (0,h.jsx)(`div`,{className:`py-2`,children:/* @__PURE__ */ (0,h.jsx)(`div`,{className:s(`pui-text-body-medium-compact text-text-soft`,`wrap-break-word whitespace-pre-wrap`),children:i})}),u.length>0?/* @__PURE__ */ (0,h.jsx)(`div`,{className:`flex flex-wrap gap-2 py-2`,children:u.map(S)}):null]})]}):null,N;n[7]!==C||n[8]!==M?(N=/* @__PURE__ */ (0,h.jsx)(`div`,{ref:C,className:`py-4`,children:M}),n[7]=C,n[8]=M,n[9]=N):N=n[9];let P;return n[10]!==O||n[11]!==y||n[12]!==f||n[13]!==N||n[14]!==k||n[15]!==A||n[16]!==j?(P=/* @__PURE__ */ (0,h.jsx)(c.div,{id:y,inert:k,initial:O,animate:O,transition:t,className:A,style:j,"qa-test-id":f,children:N}),n[10]=O,n[11]=y,n[12]=f,n[13]=N,n[14]=k,n[15]=A,n[16]=j,n[17]=P):P=n[17],P}function S(e,t){return/* @__PURE__ */ (0,h.jsx)(u,{variant:`weak`,size:`large`,children:e},t)}export{y as Thinking,x as ThinkingContent,b as ThinkingTrigger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BWaJ3C7D.js";import{p as t,v as n}from"./transitions-Cn0Tw_ua.js";import{t as r}from"./react-CUaU2Z9V.js";import{t as i}from"./ChevronRightIcon-Dgm8qBR8.js";import{t as a}from"./compiler-runtime-B3BlmaWz.js";import{t as o}from"./jsx-runtime-Dgn0yPdi.js";import{t as s}from"./dist-BNSTMZct.js";import{n as c}from"./react-CqECE5Y5.js";import{t as l}from"./SpinnerIcon-BSwmpdfe.js";import{i as u}from"./dist-BRMXKypj.js";import{t as d}from"./CloseIcon-CpFDDETM.js";import{t as f}from"./Tag-ORoY16Bh.js";import{t as p}from"./Completed-xCMFHFwB.js";import{t as m}from"./LogoPIStroke-BYfdxUw2.js";import{t as h}from"./use-expandable-height-L9fv496p.js";var g=a(),_=/* @__PURE__ */ e(o(),1),v=/* @__PURE__ */ e(r(),1);function y(e){switch(e){case`thinking`:return m;case`loading`:return l;case`complete`:return p;case`error`:return d;default:return m}}const b=(0,v.createContext)(null),x=()=>{let e=(0,v.useContext)(b);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e};function S(e){let t=(0,g.c)(16),{className:n,children:r,open:i,defaultOpen:a,onOpenChange:o,qaTestId:c}=e,l=a!==void 0&&a,u=c===void 0?`reasoning`:c,[d,f]=(0,v.useState)(l),p=(0,v.useId)(),m=i!==void 0,h=m?i:d,y;t[0]!==m||t[1]!==o?(y=e=>{m||f(e),o?.(e)},t[0]=m,t[1]=o,t[2]=y):y=t[2];let x=y,S;t[3]!==p||t[4]!==h||t[5]!==x?(S={isOpen:h,setIsOpen:x,contentId:p},t[3]=p,t[4]=h,t[5]=x,t[6]=S):S=t[6];let C;t[7]===n?C=t[8]:(C=s(`not-prose`,n),t[7]=n,t[8]=C);let w;t[9]!==r||t[10]!==u||t[11]!==C?(w=/* @__PURE__ */ (0,_.jsx)(`div`,{className:C,"qa-test-id":u,children:r}),t[9]=r,t[10]=u,t[11]=C,t[12]=w):w=t[12];let T;return t[13]!==S||t[14]!==w?(T=/* @__PURE__ */ (0,_.jsx)(b.Provider,{value:S,children:w}),t[13]=S,t[14]=w,t[15]=T):T=t[15],T}function C(e){let t=(0,g.c)(25),{className:r,headerText:a,status:o,children:l,qaTestId:d}=e,f=o===void 0?`thinking`:o,p=d===void 0?`reasoning-trigger`:d,{_:m}=u(),{isOpen:h,setIsOpen:v,contentId:b}=x(),S;t[0]===f?S=t[1]:(S=y(f),t[0]=f,t[1]=S);let C=S,w=f===`error`,T;t[2]!==h||t[3]!==v?(T=()=>{v(!h)},t[2]=h,t[3]=v,t[4]=T):T=t[4];let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D={scale:.95},t[5]=D):D=t[5];let O=l&&(w?`hover:text-negative-light`:`hover:text-text-strong`),k;t[6]!==r||t[7]!==O?(k=s(`pui-text-body-medium-alt group flex items-center gap-2 transition-colors`,`cursor-pointer border-none bg-transparent p-0`,O,r),t[6]=r,t[7]=O,t[8]=k):k=t[8];let A;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(A={transform:`translate3d(0, 0, 0)`,backfaceVisibility:`hidden`},t[9]=A):A=t[9];let j;t[10]!==m||t[11]!==C||t[12]!==l||t[13]!==a||t[14]!==w||t[15]!==h||t[16]!==f?(j=l??/* @__PURE__ */ (0,_.jsxs)(_.Fragment,{children:[/* @__PURE__ */ (0,_.jsx)(`div`,{className:s(`transition-colors`,!w&&`text-icon-soft group-hover:text-icon-strong`,w&&`text-negative-base group-hover:text-negative-light`,f===`loading`&&`animate-spin`),children:/* @__PURE__ */ (0,_.jsx)(C,{size:20})}),/* @__PURE__ */ (0,_.jsx)(`span`,{className:s(`pui-text-body-medium-compact transition-colors`,`text-text-soft group-hover:text-text-strong`,w&&`group-hover:text-negative-light`),children:a??m({id:`-D6jVS`})}),/* @__PURE__ */ (0,_.jsx)(`div`,{className:s(`text-icon-soft transition-all duration-200 group-hover:text-icon-strong`,w&&`group-hover:text-negative-light`,h?`rotate-90`:`rotate-0`),children:/* @__PURE__ */ (0,_.jsx)(i,{size:20,color:`currentColor`})})]}),t[10]=m,t[11]=C,t[12]=l,t[13]=a,t[14]=w,t[15]=h,t[16]=f,t[17]=j):j=t[17];let M;return t[18]!==b||t[19]!==E||t[20]!==h||t[21]!==p||t[22]!==k||t[23]!==j?(M=/* @__PURE__ */ (0,_.jsx)(c.button,{type:`button`,onClick:E,"aria-expanded":h,"aria-controls":b,whileTap:D,transition:n,className:k,style:A,"qa-test-id":p,children:j}),t[18]=b,t[19]=E,t[20]=h,t[21]=p,t[22]=k,t[23]=j,t[24]=M):M=t[24],M}function w(e){let n=(0,g.c)(26),{className:r,children:i,tags:a,qaTestId:o}=e,l;n[0]===a?l=n[1]:(l=a===void 0?[]:a,n[0]=a,n[1]=l);let u=l,d=o===void 0?`reasoning-content`:o,{isOpen:f,contentId:p}=x(),{contentRef:m,measuredHeight:v}=h(),y=f?v:0,b=+!!f,S;n[2]!==y||n[3]!==b?(S={height:y,opacity:b},n[2]=y,n[3]=b,n[4]=S):S=n[4];let C=S,w=!f,E;n[5]===r?E=n[6]:(E=s(`w-full overflow-hidden`,r),n[5]=r,n[6]=E);let D;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(D={willChange:`height, opacity`,transform:`translate3d(0, 0, 0)`,backfaceVisibility:`hidden`},n[7]=D):D=n[7];let O;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=/* @__PURE__ */ (0,_.jsx)(`div`,{className:`flex w-6 items-center justify-center`,children:/* @__PURE__ */ (0,_.jsx)(`div`,{className:`h-full w-[1.5px] rounded-full bg-border-soft`})}),n[8]=O):O=n[8];let k;n[9]===i?k=n[10]:(k=/* @__PURE__ */ (0,_.jsx)(`div`,{className:`py-2`,children:/* @__PURE__ */ (0,_.jsx)(`div`,{className:`pui-text-body-medium-compact wrap-break-word whitespace-pre-wrap text-text-soft`,children:i})}),n[9]=i,n[10]=k);let A;n[11]===u?A=n[12]:(A=u.length>0?/* @__PURE__ */ (0,_.jsx)(`div`,{className:`flex flex-wrap gap-2 py-2`,children:u.map(T)}):null,n[11]=u,n[12]=A);let j;n[13]!==k||n[14]!==A?(j=/* @__PURE__ */ (0,_.jsxs)(`div`,{className:`flex gap-2`,children:[O,/* @__PURE__ */ (0,_.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[k,A]})]}),n[13]=k,n[14]=A,n[15]=j):j=n[15];let M;n[16]!==m||n[17]!==j?(M=/* @__PURE__ */ (0,_.jsx)(`div`,{ref:m,className:`pt-2 pb-4`,children:j}),n[16]=m,n[17]=j,n[18]=M):M=n[18];let N;return n[19]!==C||n[20]!==p||n[21]!==d||n[22]!==M||n[23]!==w||n[24]!==E?(N=/* @__PURE__ */ (0,_.jsx)(c.div,{id:p,inert:w,initial:C,animate:C,transition:t,className:E,style:D,"qa-test-id":d,children:M}),n[19]=C,n[20]=p,n[21]=d,n[22]=M,n[23]=w,n[24]=E,n[25]=N):N=n[25],N}function T(e,t){return/* @__PURE__ */ (0,_.jsx)(f,{variant:`weak`,size:`large`,children:e},t)}export{w as n,C as r,S as t};
|
package/dist/play-cdn-claude.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const NPM_CDN = "https://cdn.jsdelivr.net/npm/";
|
|
3
3
|
const SHARED = /^(@patterninc\/pattern-ui\/|(react|react-dom|@lingui\/core|@lingui\/react|sucrase)(\/|$))/;
|
|
4
4
|
const scriptUrl = document.currentScript instanceof HTMLScriptElement ? document.currentScript.src : "";
|
|
5
|
-
const packageUrl = new URL("../", scriptUrl || location.href).href.replace(/\/@patterninc\/pattern-ui(@[^/]*)?\//, `/@patterninc/pattern-ui@0.0.0-main.
|
|
5
|
+
const packageUrl = new URL("../", scriptUrl || location.href).href.replace(/\/@patterninc\/pattern-ui(@[^/]*)?\//, `/@patterninc/pattern-ui@0.0.0-main.202610270514.2e8a0fcab86d/`);
|
|
6
6
|
const browserUrl = `${packageUrl}dist/browser/`;
|
|
7
7
|
globalThis.patternPlayCdnUrl = (specifier) => {
|
|
8
8
|
if (specifier.endsWith(".css")) return `${browserUrl}${specifier}`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useLingui } from '@lingui/react/macro'
|
|
2
2
|
import { cn } from 'cn'
|
|
3
3
|
import { motion } from 'motion/react'
|
|
4
|
-
import { createContext, useContext,
|
|
4
|
+
import { createContext, useContext, useId, useState } from 'react'
|
|
5
5
|
|
|
6
6
|
import ChevronRight from '../../components/icons/ChevronRightIcon'
|
|
7
7
|
import Close from '../../components/icons/CloseIcon'
|
|
@@ -10,6 +10,7 @@ import LogoPIStroke from '../../components/icons/LogoPIStroke'
|
|
|
10
10
|
import Spinner from '../../components/icons/SpinnerIcon'
|
|
11
11
|
import { Tag } from '../../components/Tag/Tag'
|
|
12
12
|
import { panelTransition, springTransition } from '../../utils/transitions'
|
|
13
|
+
import { useExpandableHeight } from '../../utils/use-expandable-height'
|
|
13
14
|
|
|
14
15
|
export type IconType = 'thinking' | 'loading' | 'complete' | 'error'
|
|
15
16
|
|
|
@@ -31,6 +32,7 @@ function getReasoningIcon(type: IconType) {
|
|
|
31
32
|
type ReasoningContextValue = {
|
|
32
33
|
isOpen: boolean
|
|
33
34
|
setIsOpen: (open: boolean) => void
|
|
35
|
+
contentId: string
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
const ReasoningContext = createContext<ReasoningContextValue | null>(null)
|
|
@@ -82,6 +84,7 @@ export function Reasoning({
|
|
|
82
84
|
qaTestId = 'reasoning',
|
|
83
85
|
}: ReasoningProps) {
|
|
84
86
|
const [internalOpen, setInternalOpen] = useState(defaultOpen)
|
|
87
|
+
const contentId = useId()
|
|
85
88
|
|
|
86
89
|
// Support both controlled and uncontrolled modes
|
|
87
90
|
const isControlled = controlledOpen !== undefined
|
|
@@ -95,7 +98,7 @@ export function Reasoning({
|
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
return (
|
|
98
|
-
<ReasoningContext.Provider value={{ isOpen, setIsOpen }}>
|
|
101
|
+
<ReasoningContext.Provider value={{ isOpen, setIsOpen, contentId }}>
|
|
99
102
|
<div className={cn('not-prose', className)} qa-test-id={qaTestId}>
|
|
100
103
|
{children}
|
|
101
104
|
</div>
|
|
@@ -124,7 +127,7 @@ export function ReasoningTrigger({
|
|
|
124
127
|
qaTestId = 'reasoning-trigger',
|
|
125
128
|
}: ReasoningTriggerProps) {
|
|
126
129
|
const { t } = useLingui()
|
|
127
|
-
const { isOpen, setIsOpen } = useReasoning()
|
|
130
|
+
const { isOpen, setIsOpen, contentId } = useReasoning()
|
|
128
131
|
const IconComponent = getReasoningIcon(status)
|
|
129
132
|
const isError = status === 'error'
|
|
130
133
|
|
|
@@ -136,6 +139,8 @@ export function ReasoningTrigger({
|
|
|
136
139
|
<motion.button
|
|
137
140
|
type='button'
|
|
138
141
|
onClick={handleClick}
|
|
142
|
+
aria-expanded={isOpen}
|
|
143
|
+
aria-controls={contentId}
|
|
139
144
|
whileTap={{ scale: 0.95 }}
|
|
140
145
|
transition={springTransition}
|
|
141
146
|
className={cn(
|
|
@@ -203,55 +208,23 @@ export type ReasoningContentProps = {
|
|
|
203
208
|
export function ReasoningContent({
|
|
204
209
|
className,
|
|
205
210
|
children,
|
|
206
|
-
tags = [
|
|
211
|
+
tags = [],
|
|
207
212
|
qaTestId = 'reasoning-content',
|
|
208
213
|
}: ReasoningContentProps) {
|
|
209
|
-
const { isOpen } = useReasoning()
|
|
210
|
-
const contentRef =
|
|
211
|
-
const [measuredHeight, setMeasuredHeight] = useState(0)
|
|
214
|
+
const { isOpen, contentId } = useReasoning()
|
|
215
|
+
const { contentRef, measuredHeight } = useExpandableHeight()
|
|
212
216
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const measureHeight = () => {
|
|
219
|
-
const element = contentRef.current
|
|
220
|
-
if (element) {
|
|
221
|
-
setMeasuredHeight(element.scrollHeight)
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
let frameId: number | null = requestAnimationFrame(() => {
|
|
226
|
-
frameId = requestAnimationFrame(measureHeight)
|
|
227
|
-
})
|
|
228
|
-
|
|
229
|
-
// Setup ResizeObserver for dynamic content changes
|
|
230
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
231
|
-
if (contentRef.current) {
|
|
232
|
-
requestAnimationFrame(measureHeight)
|
|
233
|
-
}
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
resizeObserver.observe(contentElement)
|
|
237
|
-
|
|
238
|
-
return () => {
|
|
239
|
-
resizeObserver.disconnect()
|
|
240
|
-
if (frameId !== null) cancelAnimationFrame(frameId)
|
|
241
|
-
}
|
|
242
|
-
}, [children, tags])
|
|
243
|
-
|
|
244
|
-
// Memoize animation values to prevent object recreation
|
|
245
|
-
const contentAnimationValues = useMemo(
|
|
246
|
-
() => ({
|
|
247
|
-
height: isOpen ? measuredHeight : 0,
|
|
248
|
-
opacity: isOpen ? 1 : 0,
|
|
249
|
-
}),
|
|
250
|
-
[isOpen, measuredHeight],
|
|
251
|
-
)
|
|
217
|
+
const contentAnimationValues = {
|
|
218
|
+
height: isOpen ? measuredHeight : 0,
|
|
219
|
+
opacity: isOpen ? 1 : 0,
|
|
220
|
+
}
|
|
252
221
|
|
|
253
222
|
return (
|
|
254
223
|
<motion.div
|
|
224
|
+
id={contentId}
|
|
225
|
+
// Collapsed content stays mounted for the height animation; inert keeps it out of the
|
|
226
|
+
// accessibility tree and tab order.
|
|
227
|
+
inert={!isOpen}
|
|
255
228
|
initial={contentAnimationValues}
|
|
256
229
|
animate={contentAnimationValues}
|
|
257
230
|
transition={panelTransition}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useLingui } from '@lingui/react/macro'
|
|
2
2
|
import { cn } from 'cn'
|
|
3
3
|
import { motion } from 'motion/react'
|
|
4
|
-
import { createContext, useContext, useState } from 'react'
|
|
4
|
+
import { createContext, useContext, useId, useState } from 'react'
|
|
5
5
|
|
|
6
6
|
import { AnimatedLogoPI } from '../../components/icons-animated/AnimatedLogoPI/AnimatedLogoPI'
|
|
7
7
|
import ChevronRight from '../../components/icons/ChevronRightIcon'
|
|
@@ -15,6 +15,8 @@ type ThinkingContextValue = {
|
|
|
15
15
|
isOpen: boolean
|
|
16
16
|
/** Setter to update the open state */
|
|
17
17
|
setIsOpen: (open: boolean) => void
|
|
18
|
+
/** Id of the content panel; wires the trigger's `aria-controls` to it */
|
|
19
|
+
contentId: string
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const ThinkingContext = createContext<ThinkingContextValue | null>(null)
|
|
@@ -67,6 +69,7 @@ export function Thinking({
|
|
|
67
69
|
qaTestId = 'thinking',
|
|
68
70
|
}: ThinkingProps) {
|
|
69
71
|
const [internalOpen, setInternalOpen] = useState(defaultOpen)
|
|
72
|
+
const contentId = useId()
|
|
70
73
|
|
|
71
74
|
// Support both controlled and uncontrolled modes
|
|
72
75
|
const isControlled = controlledOpen !== undefined
|
|
@@ -80,7 +83,7 @@ export function Thinking({
|
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
return (
|
|
83
|
-
<ThinkingContext.Provider value={{ isOpen, setIsOpen }}>
|
|
86
|
+
<ThinkingContext.Provider value={{ isOpen, setIsOpen, contentId }}>
|
|
84
87
|
<div className={cn('not-prose', className)} qa-test-id={qaTestId}>
|
|
85
88
|
{children}
|
|
86
89
|
</div>
|
|
@@ -107,13 +110,15 @@ export function ThinkingTrigger({
|
|
|
107
110
|
qaTestId = 'thinking-trigger',
|
|
108
111
|
}: ThinkingTriggerProps) {
|
|
109
112
|
const { t } = useLingui()
|
|
110
|
-
const { isOpen, setIsOpen } = useThinking()
|
|
113
|
+
const { isOpen, setIsOpen, contentId } = useThinking()
|
|
111
114
|
const labelColor = isOpen ? 'text-text-sub' : 'text-text-soft group-hover:text-text-sub'
|
|
112
115
|
|
|
113
116
|
return (
|
|
114
117
|
<motion.button
|
|
115
118
|
type='button'
|
|
116
119
|
onClick={() => setIsOpen(!isOpen)}
|
|
120
|
+
aria-expanded={isOpen}
|
|
121
|
+
aria-controls={contentId}
|
|
117
122
|
whileTap={{ scale: 0.95 }}
|
|
118
123
|
transition={springTransition}
|
|
119
124
|
className={cn(
|
|
@@ -172,7 +177,7 @@ export function ThinkingContent({
|
|
|
172
177
|
tags = [],
|
|
173
178
|
qaTestId = 'thinking-content',
|
|
174
179
|
}: ThinkingContentProps) {
|
|
175
|
-
const { isOpen } = useThinking()
|
|
180
|
+
const { isOpen, contentId } = useThinking()
|
|
176
181
|
// Mount the body on first open only; a long thread carries one collapsed panel per reasoning step.
|
|
177
182
|
const [hasOpened, setHasOpened] = useState(isOpen)
|
|
178
183
|
if (isOpen && !hasOpened) setHasOpened(true)
|
|
@@ -185,6 +190,10 @@ export function ThinkingContent({
|
|
|
185
190
|
|
|
186
191
|
return (
|
|
187
192
|
<motion.div
|
|
193
|
+
id={contentId}
|
|
194
|
+
// Collapsed content stays mounted for the height animation; inert keeps it out of the
|
|
195
|
+
// accessibility tree and tab order.
|
|
196
|
+
inert={!isOpen}
|
|
188
197
|
initial={contentAnimationValues}
|
|
189
198
|
animate={contentAnimationValues}
|
|
190
199
|
transition={panelTransition}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BWaJ3C7D.js";import{p as t,v as n}from"./transitions-Cn0Tw_ua.js";import{t as r}from"./react-CUaU2Z9V.js";import{t as i}from"./ChevronRightIcon-Dgm8qBR8.js";import{t as a}from"./compiler-runtime-B3BlmaWz.js";import{t as o}from"./jsx-runtime-Dgn0yPdi.js";import{t as s}from"./dist-BNSTMZct.js";import{n as c}from"./react-CqECE5Y5.js";import{t as l}from"./SpinnerIcon-BSwmpdfe.js";import{i as u}from"./dist-BRMXKypj.js";import{t as d}from"./CloseIcon-CpFDDETM.js";import{t as f}from"./Tag-ORoY16Bh.js";import{t as p}from"./Completed-xCMFHFwB.js";import{t as m}from"./LogoPIStroke-BYfdxUw2.js";var h=a(),g=/* @__PURE__ */ e(o(),1),_=/* @__PURE__ */ e(r(),1);function v(e){switch(e){case`thinking`:return m;case`loading`:return l;case`complete`:return p;case`error`:return d;default:return m}}const y=(0,_.createContext)(null),b=()=>{let e=(0,_.useContext)(y);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e};function x(e){let t=(0,h.c)(15),{className:n,children:r,open:i,defaultOpen:a,onOpenChange:o,qaTestId:c}=e,l=a!==void 0&&a,u=c===void 0?`reasoning`:c,[d,f]=(0,_.useState)(l),p=i!==void 0,m=p?i:d,v;t[0]!==p||t[1]!==o?(v=e=>{p||f(e),o?.(e)},t[0]=p,t[1]=o,t[2]=v):v=t[2];let b=v,x;t[3]!==m||t[4]!==b?(x={isOpen:m,setIsOpen:b},t[3]=m,t[4]=b,t[5]=x):x=t[5];let S;t[6]===n?S=t[7]:(S=s(`not-prose`,n),t[6]=n,t[7]=S);let C;t[8]!==r||t[9]!==u||t[10]!==S?(C=/* @__PURE__ */ (0,g.jsx)(`div`,{className:S,"qa-test-id":u,children:r}),t[8]=r,t[9]=u,t[10]=S,t[11]=C):C=t[11];let w;return t[12]!==x||t[13]!==C?(w=/* @__PURE__ */ (0,g.jsx)(y.Provider,{value:x,children:C}),t[12]=x,t[13]=C,t[14]=w):w=t[14],w}function S(e){let t=(0,h.c)(23),{className:r,headerText:a,status:o,children:l,qaTestId:d}=e,f=o===void 0?`thinking`:o,p=d===void 0?`reasoning-trigger`:d,{_:m}=u(),{isOpen:_,setIsOpen:y}=b(),x;t[0]===f?x=t[1]:(x=v(f),t[0]=f,t[1]=x);let S=x,C=f===`error`,w;t[2]!==_||t[3]!==y?(w=()=>{y(!_)},t[2]=_,t[3]=y,t[4]=w):w=t[4];let T=w,E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E={scale:.95},t[5]=E):E=t[5];let D=l&&(C?`hover:text-negative-light`:`hover:text-text-strong`),O;t[6]!==r||t[7]!==D?(O=s(`pui-text-body-medium-alt group flex items-center gap-2 transition-colors`,`cursor-pointer border-none bg-transparent p-0`,D,r),t[6]=r,t[7]=D,t[8]=O):O=t[8];let k;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(k={transform:`translate3d(0, 0, 0)`,backfaceVisibility:`hidden`},t[9]=k):k=t[9];let A;t[10]!==m||t[11]!==S||t[12]!==l||t[13]!==a||t[14]!==C||t[15]!==_||t[16]!==f?(A=l??/* @__PURE__ */ (0,g.jsxs)(g.Fragment,{children:[/* @__PURE__ */ (0,g.jsx)(`div`,{className:s(`transition-colors`,!C&&`text-icon-soft group-hover:text-icon-strong`,C&&`text-negative-base group-hover:text-negative-light`,f===`loading`&&`animate-spin`),children:/* @__PURE__ */ (0,g.jsx)(S,{size:20})}),/* @__PURE__ */ (0,g.jsx)(`span`,{className:s(`pui-text-body-medium-compact transition-colors`,`text-text-soft group-hover:text-text-strong`,C&&`group-hover:text-negative-light`),children:a??m({id:`-D6jVS`})}),/* @__PURE__ */ (0,g.jsx)(`div`,{className:s(`text-icon-soft transition-all duration-200 group-hover:text-icon-strong`,C&&`group-hover:text-negative-light`,_?`rotate-90`:`rotate-0`),children:/* @__PURE__ */ (0,g.jsx)(i,{size:20,color:`currentColor`})})]}),t[10]=m,t[11]=S,t[12]=l,t[13]=a,t[14]=C,t[15]=_,t[16]=f,t[17]=A):A=t[17];let j;return t[18]!==T||t[19]!==p||t[20]!==O||t[21]!==A?(j=/* @__PURE__ */ (0,g.jsx)(c.button,{type:`button`,onClick:T,whileTap:E,transition:n,className:O,style:k,"qa-test-id":p,children:A}),t[18]=T,t[19]=p,t[20]=O,t[21]=A,t[22]=j):j=t[22],j}function C(e){let n=(0,h.c)(25),{className:r,children:i,tags:a,qaTestId:o}=e,l;n[0]===a?l=n[1]:(l=a===void 0?[`schema.json`]:a,n[0]=a,n[1]=l);let u=l,d=o===void 0?`reasoning-content`:o,{isOpen:f}=b(),p=(0,_.useRef)(null),[m,v]=(0,_.useState)(0),y;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{let e=p.current;if(!e)return;let t=()=>{let e=p.current;e&&v(e.scrollHeight)},n=requestAnimationFrame(()=>{n=requestAnimationFrame(t)}),r=new ResizeObserver(()=>{p.current&&requestAnimationFrame(t)});return r.observe(e),()=>{r.disconnect(),n!==null&&cancelAnimationFrame(n)}},n[2]=y):y=n[2];let x;n[3]!==i||n[4]!==u?(x=[i,u],n[3]=i,n[4]=u,n[5]=x):x=n[5],(0,_.useEffect)(y,x);let S=f?m:0,C=+!!f,T;n[6]!==S||n[7]!==C?(T={height:S,opacity:C},n[6]=S,n[7]=C,n[8]=T):T=n[8];let E=T,D;n[9]===r?D=n[10]:(D=s(`w-full overflow-hidden`,r),n[9]=r,n[10]=D);let O;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(O={willChange:`height, opacity`,transform:`translate3d(0, 0, 0)`,backfaceVisibility:`hidden`},n[11]=O):O=n[11];let k;n[12]===Symbol.for(`react.memo_cache_sentinel`)?(k=/* @__PURE__ */ (0,g.jsx)(`div`,{className:`flex w-6 items-center justify-center`,children:/* @__PURE__ */ (0,g.jsx)(`div`,{className:`h-full w-[1.5px] rounded-full bg-border-soft`})}),n[12]=k):k=n[12];let A;n[13]===i?A=n[14]:(A=/* @__PURE__ */ (0,g.jsx)(`div`,{className:`py-2`,children:/* @__PURE__ */ (0,g.jsx)(`div`,{className:`pui-text-body-medium-compact wrap-break-word whitespace-pre-wrap text-text-soft`,children:i})}),n[13]=i,n[14]=A);let j;n[15]===u?j=n[16]:(j=u.length>0?/* @__PURE__ */ (0,g.jsx)(`div`,{className:`flex flex-wrap gap-2 py-2`,children:u.map(w)}):null,n[15]=u,n[16]=j);let M;n[17]!==A||n[18]!==j?(M=/* @__PURE__ */ (0,g.jsx)(`div`,{ref:p,className:`pt-2 pb-4`,children:/* @__PURE__ */ (0,g.jsxs)(`div`,{className:`flex gap-2`,children:[k,/* @__PURE__ */ (0,g.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[A,j]})]})}),n[17]=A,n[18]=j,n[19]=M):M=n[19];let N;return n[20]!==E||n[21]!==d||n[22]!==M||n[23]!==D?(N=/* @__PURE__ */ (0,g.jsx)(c.div,{initial:E,animate:E,transition:t,className:D,style:O,"qa-test-id":d,children:M}),n[20]=E,n[21]=d,n[22]=M,n[23]=D,n[24]=N):N=n[24],N}function w(e,t){return/* @__PURE__ */ (0,g.jsx)(f,{variant:`weak`,size:`large`,children:e},t)}export{C as n,S as r,x as t};
|