@arcadeai/design-system 3.39.3 → 3.39.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/prompt-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EACL,OAAO,EAIR,MAAM,+BAA+B,CAAC;AA6BvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEhC,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,SAAiB,EACjB,SAAe,EACf,KAAK,EACL,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/prompt-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EACL,OAAO,EAIR,MAAM,+BAA+B,CAAC;AA6BvC,MAAM,MAAM,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AC;CAC5C,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;AAEzC,iBAAS,iBAAiB,CAAC,EACzB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAsBxB;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Textarea as
|
|
4
|
-
import { TooltipProvider as
|
|
1
|
+
import { jsx as a, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import P, { createContext as k, useState as C, useRef as T, useLayoutEffect as I, useContext as H } from "react";
|
|
3
|
+
import { Textarea as R } from "../atoms/textarea.js";
|
|
4
|
+
import { TooltipProvider as $, Tooltip as D, TooltipTrigger as j, TooltipContent as K } from "../atoms/tooltip.js";
|
|
5
5
|
import { cn as x } from "../../../lib/utils.js";
|
|
6
|
-
const
|
|
6
|
+
const v = k({
|
|
7
7
|
isLoading: !1,
|
|
8
8
|
value: "",
|
|
9
9
|
setValue: () => {
|
|
@@ -11,87 +11,88 @@ const b = _({
|
|
|
11
11
|
maxHeight: 240,
|
|
12
12
|
onSubmit: void 0,
|
|
13
13
|
disabled: !1,
|
|
14
|
-
textareaRef:
|
|
14
|
+
textareaRef: P.createRef()
|
|
15
15
|
});
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function y() {
|
|
17
|
+
return H(v);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
className:
|
|
21
|
-
isLoading:
|
|
19
|
+
function M({
|
|
20
|
+
className: r,
|
|
21
|
+
isLoading: o = !1,
|
|
22
22
|
maxHeight: n = 240,
|
|
23
23
|
value: s,
|
|
24
24
|
onValueChange: i,
|
|
25
|
-
onSubmit:
|
|
25
|
+
onSubmit: u,
|
|
26
26
|
children: e,
|
|
27
|
-
disabled:
|
|
27
|
+
disabled: p = !1,
|
|
28
28
|
onClick: d,
|
|
29
|
-
...
|
|
29
|
+
...c
|
|
30
30
|
}) {
|
|
31
|
-
const [
|
|
32
|
-
m(
|
|
33
|
-
}, t = (
|
|
34
|
-
|
|
31
|
+
const [f, m] = C(s || ""), h = T(null), g = (l) => {
|
|
32
|
+
m(l), i?.(l);
|
|
33
|
+
}, t = (l) => {
|
|
34
|
+
const b = l.target, w = b ? l.currentTarget.contains(b) : !1;
|
|
35
|
+
!p && w && h.current?.focus(), d?.(l);
|
|
35
36
|
};
|
|
36
|
-
return /* @__PURE__ */ a(
|
|
37
|
-
|
|
37
|
+
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(
|
|
38
|
+
v.Provider,
|
|
38
39
|
{
|
|
39
40
|
value: {
|
|
40
|
-
isLoading:
|
|
41
|
-
value: s ??
|
|
41
|
+
isLoading: o,
|
|
42
|
+
value: s ?? f,
|
|
42
43
|
setValue: i ?? g,
|
|
43
44
|
maxHeight: n,
|
|
44
|
-
onSubmit:
|
|
45
|
-
disabled:
|
|
46
|
-
textareaRef:
|
|
45
|
+
onSubmit: u,
|
|
46
|
+
disabled: p,
|
|
47
|
+
textareaRef: h
|
|
47
48
|
},
|
|
48
49
|
children: /* @__PURE__ */ a(
|
|
49
50
|
"div",
|
|
50
51
|
{
|
|
51
52
|
className: x(
|
|
52
53
|
"cursor-text rounded-lg border border-input bg-background p-2 shadow-xs transition-[box-shadow,border-color] focus-within:border focus-within:border-muted-foreground focus-within:shadow-[0_0_4px_color-mix(in_oklch,var(--ring)_4%,transparent)] dark:focus-within:shadow-[0_0_4px_color-mix(in_oklch,var(--ring)_8%,transparent)]",
|
|
53
|
-
|
|
54
|
+
r
|
|
54
55
|
),
|
|
55
56
|
"data-slot": "prompt-input",
|
|
56
57
|
onClick: t,
|
|
57
|
-
...
|
|
58
|
+
...c,
|
|
58
59
|
children: e
|
|
59
60
|
}
|
|
60
61
|
)
|
|
61
62
|
}
|
|
62
63
|
) });
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
className:
|
|
66
|
-
onKeyDown:
|
|
65
|
+
function W({
|
|
66
|
+
className: r,
|
|
67
|
+
onKeyDown: o,
|
|
67
68
|
disableAutosize: n = !1,
|
|
68
69
|
...s
|
|
69
70
|
}) {
|
|
70
|
-
const { value: i, setValue:
|
|
71
|
+
const { value: i, setValue: u, maxHeight: e, onSubmit: p, disabled: d, textareaRef: c } = y(), f = (t) => {
|
|
71
72
|
!t || n || (t.style.height = "auto", typeof e == "number" ? t.style.height = `${Math.min(t.scrollHeight, e)}px` : t.style.height = `min(${t.scrollHeight}px, ${e})`);
|
|
72
73
|
}, m = (t) => {
|
|
73
|
-
|
|
74
|
+
c.current = t, f(t);
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
-
if (!
|
|
76
|
+
I(() => {
|
|
77
|
+
if (!c.current || n)
|
|
77
78
|
return;
|
|
78
|
-
const t =
|
|
79
|
+
const t = c.current;
|
|
79
80
|
t.style.height = "auto", typeof e == "number" ? t.style.height = `${Math.min(t.scrollHeight, e)}px` : t.style.height = `min(${t.scrollHeight}px, ${e})`;
|
|
80
81
|
}, [i, e, n]);
|
|
81
|
-
const
|
|
82
|
-
|
|
82
|
+
const h = (t) => {
|
|
83
|
+
f(t.target), u(t.target.value);
|
|
83
84
|
}, g = (t) => {
|
|
84
|
-
t.key === "Enter" && !t.shiftKey && (t.preventDefault(), d ||
|
|
85
|
+
t.key === "Enter" && !t.shiftKey && (t.preventDefault(), d || p?.()), o?.(t);
|
|
85
86
|
};
|
|
86
87
|
return /* @__PURE__ */ a(
|
|
87
|
-
|
|
88
|
+
R,
|
|
88
89
|
{
|
|
89
90
|
className: x(
|
|
90
91
|
"min-h-[56px] w-full resize-none border-none bg-transparent text-foreground shadow-none outline-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",
|
|
91
|
-
|
|
92
|
+
r
|
|
92
93
|
),
|
|
93
94
|
"data-slot": "prompt-input-textarea",
|
|
94
|
-
onChange:
|
|
95
|
+
onChange: h,
|
|
95
96
|
onKeyDown: g,
|
|
96
97
|
ref: m,
|
|
97
98
|
rows: 1,
|
|
@@ -100,47 +101,47 @@ function L({
|
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
-
children:
|
|
105
|
-
className:
|
|
104
|
+
function q({
|
|
105
|
+
children: r,
|
|
106
|
+
className: o,
|
|
106
107
|
...n
|
|
107
108
|
}) {
|
|
108
109
|
return /* @__PURE__ */ a(
|
|
109
110
|
"div",
|
|
110
111
|
{
|
|
111
|
-
className: x("flex items-center gap-2",
|
|
112
|
+
className: x("flex items-center gap-2", o),
|
|
112
113
|
"data-slot": "prompt-input-actions",
|
|
113
114
|
...n,
|
|
114
|
-
children:
|
|
115
|
+
children: r
|
|
115
116
|
}
|
|
116
117
|
);
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
-
tooltip:
|
|
120
|
-
children:
|
|
119
|
+
function A({
|
|
120
|
+
tooltip: r,
|
|
121
|
+
children: o,
|
|
121
122
|
className: n,
|
|
122
123
|
side: s = "top",
|
|
123
124
|
...i
|
|
124
125
|
}) {
|
|
125
|
-
const { disabled:
|
|
126
|
-
return /* @__PURE__ */
|
|
126
|
+
const { disabled: u } = y();
|
|
127
|
+
return /* @__PURE__ */ _(D, { ...i, children: [
|
|
127
128
|
/* @__PURE__ */ a(
|
|
128
|
-
|
|
129
|
+
j,
|
|
129
130
|
{
|
|
130
|
-
disabled:
|
|
131
|
+
disabled: u,
|
|
131
132
|
onClick: (e) => e.stopPropagation(),
|
|
132
133
|
onPointerDown: (e) => {
|
|
133
134
|
e.pointerType !== "touch" && e.preventDefault();
|
|
134
135
|
},
|
|
135
|
-
render:
|
|
136
|
+
render: o
|
|
136
137
|
}
|
|
137
138
|
),
|
|
138
|
-
/* @__PURE__ */ a(
|
|
139
|
+
/* @__PURE__ */ a(K, { className: n, side: s, children: r })
|
|
139
140
|
] });
|
|
140
141
|
}
|
|
141
142
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
M as PromptInput,
|
|
144
|
+
A as PromptInputAction,
|
|
145
|
+
q as PromptInputActions,
|
|
146
|
+
W as PromptInputTextarea
|
|
146
147
|
};
|