@arcadeai/design-system 3.33.2 → 3.34.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/dist/components/index.js +595 -567
- package/dist/components/ui/atoms/avatar-notification-badge.d.ts +34 -0
- package/dist/components/ui/atoms/avatar-notification-badge.d.ts.map +1 -0
- package/dist/components/ui/atoms/avatar-notification-badge.js +78 -0
- package/dist/components/ui/atoms/index.d.ts +3 -0
- package/dist/components/ui/atoms/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/index.js +512 -504
- package/dist/components/ui/atoms/json-highlight.d.ts +60 -0
- package/dist/components/ui/atoms/json-highlight.d.ts.map +1 -0
- package/dist/components/ui/atoms/json-highlight.js +77 -0
- package/dist/components/ui/atoms/scroll-button.js +8 -8
- package/dist/components/ui/atoms/view-tools-control.d.ts +1 -1
- package/dist/components/ui/atoms/view-tools-control.d.ts.map +1 -1
- package/dist/components/ui/atoms/view-tools-control.js +20 -19
- package/dist/components/ui/index.js +595 -567
- package/dist/components/ui/molecules/chat-message-list.d.ts +5 -2
- package/dist/components/ui/molecules/chat-message-list.d.ts.map +1 -1
- package/dist/components/ui/molecules/chat-message-list.js +2 -2
- package/dist/components/ui/molecules/index.d.ts +8 -0
- package/dist/components/ui/molecules/index.d.ts.map +1 -1
- package/dist/components/ui/molecules/index.js +48 -28
- package/dist/components/ui/molecules/prompt-input.js +20 -20
- package/dist/components/ui/molecules/requirement-badges.js +8 -4
- package/dist/components/ui/molecules/switcher.d.ts +83 -0
- package/dist/components/ui/molecules/switcher.d.ts.map +1 -0
- package/dist/components/ui/molecules/switcher.js +164 -0
- package/dist/components/ui/molecules/tool-authorization.d.ts +56 -0
- package/dist/components/ui/molecules/tool-authorization.d.ts.map +1 -0
- package/dist/components/ui/molecules/tool-authorization.js +160 -0
- package/dist/components/ui/molecules/tool-call-accordion.d.ts +36 -0
- package/dist/components/ui/molecules/tool-call-accordion.d.ts.map +1 -0
- package/dist/components/ui/molecules/tool-call-accordion.js +301 -0
- package/dist/components/ui/molecules/toolkit-card.js +1 -1
- package/dist/components/ui/molecules/user-nav.d.ts +65 -0
- package/dist/components/ui/molecules/user-nav.d.ts.map +1 -0
- package/dist/components/ui/molecules/user-nav.js +154 -0
- package/dist/components/ui/pages/chat-page.d.ts +18 -10
- package/dist/components/ui/pages/chat-page.d.ts.map +1 -1
- package/dist/components/ui/pages/chat-page.js +328 -243
- package/dist/components/ui/templates/chat-template.d.ts +1 -1
- package/dist/components/ui/templates/chat-template.d.ts.map +1 -1
- package/dist/components/ui/templates/chat-template.js +11 -11
- package/dist/main.js +621 -593
- package/dist/{toolkit-card-k8jio69G.js → toolkit-card-DAgQXF93.js} +13 -10
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ComponentProps, NamedExoticComponent } from 'react';
|
|
3
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
4
|
+
declare const jsonHighlightVariants: (props?: ({
|
|
5
|
+
theme?: "default" | "branded" | "monochrome" | null | undefined;
|
|
6
|
+
} & ClassProp) | undefined) => string;
|
|
7
|
+
type JsonHighlightProps = {
|
|
8
|
+
code: string;
|
|
9
|
+
} & VariantProps<typeof jsonHighlightVariants> & ComponentProps<"div">;
|
|
10
|
+
/**
|
|
11
|
+
* Lightweight, synchronous JSON syntax highlighter.
|
|
12
|
+
*
|
|
13
|
+
* Uses a single-pass regex tokenizer — **O(n)** over the input string — to
|
|
14
|
+
* colour keys, strings, numbers, and keywords (true / false / null).
|
|
15
|
+
*
|
|
16
|
+
* ## Themes
|
|
17
|
+
*
|
|
18
|
+
* Use the `theme` prop to pick a colour preset:
|
|
19
|
+
*
|
|
20
|
+
* - `"default"` — amber keys, red strings, teal numbers, green true, red false, gray null.
|
|
21
|
+
* - `"branded"` — uses design system tokens (chart-2, chart-1, warning, success, destructive).
|
|
22
|
+
* - `"monochrome"` — foreground keys, muted values (for subdued contexts).
|
|
23
|
+
*
|
|
24
|
+
* ## Customising individual colours
|
|
25
|
+
*
|
|
26
|
+
* Token colours are CSS custom properties. Override any via `className`:
|
|
27
|
+
*
|
|
28
|
+
* | Variable | Token |
|
|
29
|
+
* | ------------ | ------------ |
|
|
30
|
+
* | `--jh-key` | Object keys |
|
|
31
|
+
* | `--jh-str` | Strings |
|
|
32
|
+
* | `--jh-num` | Numbers |
|
|
33
|
+
* | `--jh-true` | `true` |
|
|
34
|
+
* | `--jh-false` | `false` |
|
|
35
|
+
* | `--jh-null` | `null` |
|
|
36
|
+
*
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <JsonHighlight
|
|
39
|
+
* code={json}
|
|
40
|
+
* className="[--jh-str:#2563eb] dark:[--jh-str:#93c5fd]"
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* ## When to use this over `CodeBlockCode`
|
|
45
|
+
*
|
|
46
|
+
* - The content is **always JSON** (no multi-language support needed).
|
|
47
|
+
* - The component appears in a **hot path** where Shiki's WASM bundle
|
|
48
|
+
* (~695 KB gzipped) and async initialisation would cause visible lag.
|
|
49
|
+
* - You need **synchronous first-paint** (no loading flash).
|
|
50
|
+
*
|
|
51
|
+
* ## When to prefer `CodeBlockCode` (Shiki)
|
|
52
|
+
*
|
|
53
|
+
* - The language is not JSON, or can vary at runtime.
|
|
54
|
+
* - You need advanced features like line numbers or line highlighting.
|
|
55
|
+
* - The code block renders once in a non-latency-critical context.
|
|
56
|
+
*/
|
|
57
|
+
declare const JsonHighlight: NamedExoticComponent<JsonHighlightProps>;
|
|
58
|
+
export { JsonHighlight, jsonHighlightVariants };
|
|
59
|
+
export type { JsonHighlightProps };
|
|
60
|
+
//# sourceMappingURL=json-highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-highlight.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/atoms/json-highlight.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,OAAO,CAAC;AAyD3D,QAAA,MAAM,qBAAqB;;8EAiC1B,CAAC;AAeF,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,GAC5C,cAAc,CAAC,KAAK,CAAC,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,QAAA,MAAM,aAAa,0DA8BjB,CAAC;AAEH,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "../../../index-UgeK3A8s.js";
|
|
3
|
+
import { memo as m, useMemo as j } from "react";
|
|
4
|
+
import { cn as p } from "../../../lib/utils.js";
|
|
5
|
+
const x = /("(?:[^"\\]|\\.)*")\s*(?=:)|("(?:[^"\\]|\\.)*")|\b(true)\b|\b(false)\b|\b(null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;
|
|
6
|
+
function v(s) {
|
|
7
|
+
const e = [];
|
|
8
|
+
let a = 0;
|
|
9
|
+
for (const o of s.matchAll(x)) {
|
|
10
|
+
const t = o.index;
|
|
11
|
+
t > a && e.push(s.slice(a, t));
|
|
12
|
+
const [n, r, u, h, f, d, i] = o;
|
|
13
|
+
r ? e.push({ type: "key", text: r, offset: t }) : u ? e.push({ type: "str", text: u, offset: t }) : h ? e.push({ type: "true", text: h, offset: t }) : f ? e.push({ type: "false", text: f, offset: t }) : d ? e.push({ type: "null", text: d, offset: t }) : i && e.push({ type: "num", text: i, offset: t }), a = t + n.length;
|
|
14
|
+
}
|
|
15
|
+
return a < s.length && e.push(s.slice(a)), e;
|
|
16
|
+
}
|
|
17
|
+
const g = c(
|
|
18
|
+
"w-full overflow-x-auto text-[13px] text-foreground/90",
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
theme: {
|
|
22
|
+
default: [
|
|
23
|
+
"[--jh-key:#8a6c14] dark:[--jh-key:#b8a965]",
|
|
24
|
+
"[--jh-str:#a8453a] dark:[--jh-str:#c98a7d]",
|
|
25
|
+
"[--jh-num:#0f766e] dark:[--jh-num:#4c9a91]",
|
|
26
|
+
"[--jh-true:#2f6e4e] dark:[--jh-true:#4d9375]",
|
|
27
|
+
"[--jh-false:#a8453a] dark:[--jh-false:#c98a7d]",
|
|
28
|
+
"[--jh-null:#71717a] dark:[--jh-null:#a1a1aa]"
|
|
29
|
+
],
|
|
30
|
+
branded: [
|
|
31
|
+
"[--jh-key:var(--chart-2)]",
|
|
32
|
+
"[--jh-str:var(--chart-1)]",
|
|
33
|
+
"[--jh-num:var(--warning)]",
|
|
34
|
+
"[--jh-true:var(--success)]",
|
|
35
|
+
"[--jh-false:var(--destructive)]",
|
|
36
|
+
"[--jh-null:var(--color-muted-foreground)]"
|
|
37
|
+
],
|
|
38
|
+
monochrome: [
|
|
39
|
+
"[--jh-key:var(--color-foreground)]",
|
|
40
|
+
"[--jh-str:var(--color-muted-foreground)]",
|
|
41
|
+
"[--jh-num:var(--color-muted-foreground)]",
|
|
42
|
+
"[--jh-true:var(--color-muted-foreground)]",
|
|
43
|
+
"[--jh-false:var(--color-muted-foreground)]",
|
|
44
|
+
"[--jh-null:var(--color-muted-foreground)]"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
defaultVariants: { theme: "default" }
|
|
49
|
+
}
|
|
50
|
+
), k = {
|
|
51
|
+
key: "text-[var(--jh-key)]",
|
|
52
|
+
str: "text-[var(--jh-str)]",
|
|
53
|
+
num: "text-[var(--jh-num)]",
|
|
54
|
+
true: "text-[var(--jh-true)]",
|
|
55
|
+
false: "text-[var(--jh-false)]",
|
|
56
|
+
null: "text-[var(--jh-null)]"
|
|
57
|
+
}, E = m(function({
|
|
58
|
+
code: e,
|
|
59
|
+
theme: a,
|
|
60
|
+
className: o,
|
|
61
|
+
...t
|
|
62
|
+
}) {
|
|
63
|
+
const n = j(() => v(e), [e]);
|
|
64
|
+
return /* @__PURE__ */ l(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: p(g({ theme: a }), o),
|
|
68
|
+
"data-slot": "json-highlight",
|
|
69
|
+
...t,
|
|
70
|
+
children: /* @__PURE__ */ l("pre", { className: "wrap-break-word max-w-full whitespace-pre-wrap p-3 font-mono leading-relaxed", children: /* @__PURE__ */ l("code", { children: n.map((r) => typeof r == "string" ? r : /* @__PURE__ */ l("span", { className: k[r.type], children: r.text }, r.offset)) }) })
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
E as JsonHighlight,
|
|
76
|
+
g as jsonHighlightVariants
|
|
77
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronDown as s } from "lucide-react";
|
|
3
3
|
import { Button as c } from "./button.js";
|
|
4
4
|
import { Tooltip as m, TooltipTrigger as p, TooltipContent as u } from "./tooltip.js";
|
|
@@ -10,28 +10,28 @@ function y({
|
|
|
10
10
|
size: n = "sm",
|
|
11
11
|
...e
|
|
12
12
|
}) {
|
|
13
|
-
const { isAtBottom:
|
|
13
|
+
const { isAtBottom: o, scrollToBottom: i } = h();
|
|
14
14
|
return /* @__PURE__ */ a(m, { children: [
|
|
15
|
-
/* @__PURE__ */
|
|
15
|
+
/* @__PURE__ */ t(p, { asChild: !0, children: /* @__PURE__ */ t(
|
|
16
16
|
c,
|
|
17
17
|
{
|
|
18
|
-
"aria-hidden":
|
|
18
|
+
"aria-hidden": o,
|
|
19
19
|
"aria-label": "Scroll to bottom",
|
|
20
20
|
className: d(
|
|
21
21
|
"h-10 w-10 rounded-full transition-all duration-150 ease-out",
|
|
22
|
-
|
|
22
|
+
o ? "pointer-events-none translate-y-4 scale-95 opacity-0" : "translate-y-0 scale-100 opacity-100",
|
|
23
23
|
r
|
|
24
24
|
),
|
|
25
25
|
"data-slot": "scroll-button",
|
|
26
26
|
onClick: () => i(),
|
|
27
27
|
size: n,
|
|
28
|
-
tabIndex:
|
|
28
|
+
tabIndex: o ? -1 : 0,
|
|
29
29
|
variant: l,
|
|
30
30
|
...e,
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ t(s, { className: "h-5 w-5" })
|
|
32
32
|
}
|
|
33
33
|
) }),
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
!o && /* @__PURE__ */ t(u, { children: "Scroll to bottom" })
|
|
35
35
|
] });
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
export type ViewToolsControlProps = {
|
|
2
3
|
toolsCount: number;
|
|
3
4
|
selectedCount?: number;
|
|
@@ -7,7 +8,6 @@ export type ViewToolsControlProps = {
|
|
|
7
8
|
name: string;
|
|
8
9
|
};
|
|
9
10
|
declare function ViewToolsControlImpl({ toolsCount, selectedCount, indeterminate, onClick, className, name, }: ViewToolsControlProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
import * as React from "react";
|
|
11
11
|
export declare const ViewToolsControl: React.MemoExoticComponent<typeof ViewToolsControlImpl>;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=view-tools-control.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-tools-control.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/atoms/view-tools-control.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view-tools-control.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/atoms/view-tools-control.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAaF,iBAAS,oBAAoB,CAAC,EAC5B,UAAU,EACV,aAAiB,EACjB,aAAa,EACb,OAAO,EACP,SAAS,EACT,IAAI,GACL,EAAE,qBAAqB,2CAoBvB;AAED,eAAO,MAAM,gBAAgB,wDAU5B,CAAC"}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsxs as e, jsx as
|
|
1
|
+
import { jsxs as e, jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRight as c } from "lucide-react";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
3
|
+
import * as p from "react";
|
|
4
|
+
import { Button as f } from "./button.js";
|
|
5
|
+
import { createPropsComparator as u } from "../utils/memo.js";
|
|
6
|
+
import { cn as d } from "../../../lib/utils.js";
|
|
7
|
+
function g(o, t = 0, r) {
|
|
8
8
|
return r && t > 0 ? `${t}/${o}` : String(o);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function x({
|
|
11
11
|
toolsCount: o,
|
|
12
12
|
selectedCount: t = 0,
|
|
13
13
|
indeterminate: r,
|
|
14
14
|
onClick: n,
|
|
15
|
-
className:
|
|
16
|
-
name:
|
|
15
|
+
className: a,
|
|
16
|
+
name: i
|
|
17
17
|
}) {
|
|
18
|
-
const s =
|
|
18
|
+
const s = g(o, t, r);
|
|
19
19
|
return /* @__PURE__ */ e(
|
|
20
|
-
|
|
20
|
+
f,
|
|
21
21
|
{
|
|
22
|
-
"aria-label": `View tools in ${
|
|
23
|
-
className:
|
|
22
|
+
"aria-label": `View tools in ${i}`,
|
|
23
|
+
className: d("gap-1", a),
|
|
24
|
+
"data-slot": "view-tools-control",
|
|
24
25
|
"data-testid": "view-tools",
|
|
25
|
-
onClick: (
|
|
26
|
-
|
|
26
|
+
onClick: (l) => {
|
|
27
|
+
l.stopPropagation(), n();
|
|
27
28
|
},
|
|
28
29
|
size: "sm",
|
|
29
30
|
variant: "outline",
|
|
@@ -32,14 +33,14 @@ function b({
|
|
|
32
33
|
s,
|
|
33
34
|
" tools"
|
|
34
35
|
] }),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ m(c, { className: "size-3.5 transition-transform group-hover:translate-x-0.5" })
|
|
36
37
|
]
|
|
37
38
|
}
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
|
-
const N =
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const N = p.memo(
|
|
42
|
+
x,
|
|
43
|
+
u([
|
|
43
44
|
"toolsCount",
|
|
44
45
|
"selectedCount",
|
|
45
46
|
"indeterminate",
|