@timbal-ai/timbal-react 0.5.4 → 0.6.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/README.md +128 -4
- package/dist/app.cjs +5311 -0
- package/dist/app.d.cts +29 -0
- package/dist/app.d.ts +29 -0
- package/dist/app.esm.js +81 -0
- package/dist/chart-artifact-C71dk4xI.d.ts +329 -0
- package/dist/chart-artifact-CPEpOmtV.d.cts +329 -0
- package/dist/chat-CWtQWDtJ.d.cts +650 -0
- package/dist/chat-CWtQWDtJ.d.ts +650 -0
- package/dist/chat.cjs +4162 -0
- package/dist/chat.d.cts +13 -0
- package/dist/chat.d.ts +13 -0
- package/dist/chat.esm.js +51 -0
- package/dist/chunk-4TCJQSIX.esm.js +565 -0
- package/dist/chunk-IYENDIRY.esm.js +119 -0
- package/dist/chunk-KC5QLVUG.esm.js +22 -0
- package/dist/chunk-M4V6Q6XO.esm.js +1082 -0
- package/dist/chunk-OFHLFNJH.esm.js +138 -0
- package/dist/chunk-OVHR7J3J.esm.js +1574 -0
- package/dist/chunk-WLTW56MC.esm.js +66 -0
- package/dist/chunk-YJQLLFKP.esm.js +3672 -0
- package/dist/index.cjs +1823 -359
- package/dist/index.d.cts +15 -931
- package/dist/index.d.ts +15 -931
- package/dist/index.esm.js +187 -5578
- package/dist/layout-B9VayJhZ.d.cts +75 -0
- package/dist/layout-CQWngNQ7.d.ts +75 -0
- package/dist/studio.cjs +5734 -0
- package/dist/studio.d.cts +15 -0
- package/dist/studio.d.ts +15 -0
- package/dist/studio.esm.js +27 -0
- package/dist/styles.css +52 -2
- package/dist/timbal-v2-button-F4-z7m33.d.cts +40 -0
- package/dist/timbal-v2-button-F4-z7m33.d.ts +40 -0
- package/dist/ui.cjs +720 -0
- package/dist/ui.d.cts +74 -0
- package/dist/ui.d.ts +74 -0
- package/dist/ui.esm.js +44 -0
- package/dist/welcome--80i_O0p.d.cts +190 -0
- package/dist/welcome-BOizSp5h.d.ts +190 -0
- package/package.json +35 -3
- package/scripts/dev-linked.mjs +66 -0
- package/vite/local-dev.d.ts +4 -0
- package/vite/local-dev.mjs +71 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
studioSecondaryChromeClass,
|
|
3
|
+
studioTopbarPillHeightClass
|
|
4
|
+
} from "./chunk-YJQLLFKP.esm.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-4TCJQSIX.esm.js";
|
|
8
|
+
|
|
9
|
+
// src/chat/workforce-selector.tsx
|
|
10
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var WorkforceSelector = ({
|
|
13
|
+
workforces,
|
|
14
|
+
value,
|
|
15
|
+
onChange,
|
|
16
|
+
hideWhenSingle = true,
|
|
17
|
+
className,
|
|
18
|
+
placeholder = "Select agent"
|
|
19
|
+
}) => {
|
|
20
|
+
if (workforces.length === 0) return null;
|
|
21
|
+
if (hideWhenSingle && workforces.length === 1) return null;
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: cn(
|
|
26
|
+
"aui-workforce-selector relative inline-flex items-center",
|
|
27
|
+
studioTopbarPillHeightClass,
|
|
28
|
+
studioSecondaryChromeClass,
|
|
29
|
+
"rounded-full",
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsxs(
|
|
34
|
+
"select",
|
|
35
|
+
{
|
|
36
|
+
className: "aui-workforce-selector-input h-full cursor-pointer appearance-none rounded-full border-none bg-transparent pr-8 pl-3.5 text-sm font-medium text-foreground outline-none focus:outline-none",
|
|
37
|
+
value,
|
|
38
|
+
onChange: (e) => onChange(e.target.value),
|
|
39
|
+
"aria-label": placeholder,
|
|
40
|
+
children: [
|
|
41
|
+
!value && /* @__PURE__ */ jsx("option", { value: "", children: placeholder }),
|
|
42
|
+
workforces.map((w) => {
|
|
43
|
+
const id = idOf(w);
|
|
44
|
+
return /* @__PURE__ */ jsx("option", { value: id, children: w.name ?? id }, id);
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
ChevronDownIcon,
|
|
51
|
+
{
|
|
52
|
+
className: "aui-workforce-selector-icon pointer-events-none absolute right-3 size-3.5 text-muted-foreground/70",
|
|
53
|
+
"aria-hidden": true
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
function idOf(item) {
|
|
61
|
+
return item.id ?? item.uid ?? item.name ?? "";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
WorkforceSelector
|
|
66
|
+
};
|