@ai-coding-agent/react-assistant 0.1.0 → 0.1.3

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,40 +1,8 @@
1
1
  import { default as React } from 'react';
2
- /**
3
- * 悬浮按钮的 Props 接口
4
- *
5
- * 属性说明:
6
- * - isOpen: 聊天窗口是否打开
7
- * - onClick: 点击事件处理函数
8
- * - position: 按钮在屏幕上的位置
9
- */
10
2
  interface FloatingButtonProps {
11
3
  isOpen: boolean;
12
4
  onClick: () => void;
13
5
  position?: 'bottom-right' | 'bottom-left';
14
6
  }
15
- /**
16
- * 悬浮按钮组件
17
- *
18
- * 参数说明:
19
- * - isOpen: 控制显示的图标类型
20
- * * true: 显示关闭图标 (X)
21
- * * false: 显示聊天图标
22
- *
23
- * - onClick: 点击按钮时调用的函数
24
- * * 通常用于切换聊天窗口的显示/隐藏
25
- *
26
- * - position: 按钮位置(可选,默认 'bottom-right')
27
- * * 'bottom-right': 右下角(推荐)
28
- * * 'bottom-left': 左下角
29
- *
30
- * 样式说明:
31
- * - fixed: 固定定位
32
- * - w-14 h-14: 宽高 56px
33
- * - bg-gradient-to-r: 渐变背景
34
- * - shadow-lg: 大阴影
35
- * - hover:scale-110: 悬停时放大 10%
36
- * - transition-all: 平滑过渡动画
37
- * - z-50: 层级 50(确保在最上层)
38
- */
39
7
  export declare const FloatingButton: React.FC<FloatingButtonProps>;
40
8
  export {};
package/dist/index.js CHANGED
@@ -1,241 +1,209 @@
1
1
  import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
2
- //#region \0rolldown/runtime.js
3
- var i = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), a = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
4
- if (typeof require < "u") return require.apply(this, arguments);
5
- throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
6
- }), o = /* @__PURE__ */ i(((e) => {
7
- var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
8
- function r(e, n, r) {
9
- var i = null;
10
- if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
11
- else r = n;
12
- return n = r.ref, {
13
- $$typeof: t,
14
- type: e,
15
- key: i,
16
- ref: n === void 0 ? null : n,
17
- props: r
18
- };
19
- }
20
- e.Fragment = n, e.jsx = r, e.jsxs = r;
21
- })), s = /* @__PURE__ */ i(((e) => {
22
- process.env.NODE_ENV !== "production" && (function() {
23
- function t(e) {
24
- if (e == null) return null;
25
- if (typeof e == "function") return e.$$typeof === k ? null : e.displayName || e.name || null;
26
- if (typeof e == "string") return e;
27
- switch (e) {
28
- case v: return "Fragment";
29
- case b: return "Profiler";
30
- case y: return "StrictMode";
31
- case w: return "Suspense";
32
- case T: return "SuspenseList";
33
- case O: return "Activity";
34
- }
35
- if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
36
- case _: return "Portal";
37
- case S: return e.displayName || "Context";
38
- case x: return (e._context.displayName || "Context") + ".Consumer";
39
- case C:
40
- var n = e.render;
41
- return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
42
- case E: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
43
- case D:
44
- n = e._payload, e = e._init;
45
- try {
46
- return t(e(n));
47
- } catch {}
48
- }
49
- return null;
50
- }
51
- function n(e) {
52
- return "" + e;
53
- }
54
- function r(e) {
55
- try {
56
- n(e);
57
- var t = !1;
58
- } catch {
59
- t = !0;
60
- }
61
- if (t) {
62
- t = console;
63
- var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
64
- return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
65
- }
66
- }
67
- function i(e) {
68
- if (e === v) return "<>";
69
- if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
70
- try {
71
- var n = t(e);
72
- return n ? "<" + n + ">" : "<...>";
73
- } catch {
74
- return "<...>";
75
- }
76
- }
77
- function o() {
78
- var e = A.A;
79
- return e === null ? null : e.getOwner();
80
- }
81
- function s() {
82
- return Error("react-stack-top-frame");
83
- }
84
- function c(e) {
85
- if (j.call(e, "key")) {
86
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
87
- if (t && t.isReactWarning) return !1;
88
- }
89
- return e.key !== void 0;
90
- }
91
- function l(e, t) {
92
- function n() {
93
- P || (P = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
94
- }
95
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
96
- get: n,
97
- configurable: !0
98
- });
99
- }
100
- function u() {
101
- var e = t(this.type);
102
- return F[e] || (F[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
103
- }
104
- function d(e, t, n, r, i, a) {
105
- var o = n.ref;
106
- return e = {
107
- $$typeof: g,
108
- type: e,
109
- key: t,
110
- props: n,
111
- _owner: r
112
- }, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
113
- enumerable: !1,
114
- value: null
115
- }) : Object.defineProperty(e, "ref", {
116
- enumerable: !1,
117
- get: u
118
- }), e._store = {}, Object.defineProperty(e._store, "validated", {
119
- configurable: !1,
120
- enumerable: !1,
121
- writable: !0,
122
- value: 0
123
- }), Object.defineProperty(e, "_debugInfo", {
124
- configurable: !1,
125
- enumerable: !1,
126
- writable: !0,
127
- value: null
128
- }), Object.defineProperty(e, "_debugStack", {
129
- configurable: !1,
130
- enumerable: !1,
131
- writable: !0,
132
- value: i
133
- }), Object.defineProperty(e, "_debugTask", {
134
- configurable: !1,
135
- enumerable: !1,
136
- writable: !0,
137
- value: a
138
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
139
- }
140
- function f(e, n, i, a, s, u) {
141
- var f = n.children;
142
- if (f !== void 0) if (a) if (M(f)) {
143
- for (a = 0; a < f.length; a++) p(f[a]);
144
- Object.freeze && Object.freeze(f);
145
- } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
146
- else p(f);
147
- if (j.call(n, "key")) {
148
- f = t(e);
149
- var m = Object.keys(n).filter(function(e) {
150
- return e !== "key";
151
- });
152
- a = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", R[f + a] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", a, f, m, f), R[f + a] = !0);
153
- }
154
- if (f = null, i !== void 0 && (r(i), f = "" + i), c(n) && (r(n.key), f = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
155
- else i = n;
156
- return f && l(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, i, o(), s, u);
157
- }
158
- function p(e) {
159
- m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
160
- }
161
- function m(e) {
162
- return typeof e == "object" && !!e && e.$$typeof === g;
163
- }
164
- var h = a("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), A = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, M = Array.isArray, N = console.createTask ? console.createTask : function() {
165
- return null;
166
- };
167
- h = { react_stack_bottom_frame: function(e) {
168
- return e();
169
- } };
170
- var P, F = {}, I = h.react_stack_bottom_frame.bind(h, s)(), L = N(i(s)), R = {};
171
- e.Fragment = v, e.jsx = function(e, t, n) {
172
- var r = 1e4 > A.recentlyCreatedOwnerStacks++;
173
- return f(e, t, n, !1, r ? Error("react-stack-top-frame") : I, r ? N(i(e)) : L);
174
- }, e.jsxs = function(e, t, n) {
175
- var r = 1e4 > A.recentlyCreatedOwnerStacks++;
176
- return f(e, t, n, !0, r ? Error("react-stack-top-frame") : I, r ? N(i(e)) : L);
177
- };
178
- })();
179
- })), c = (/* @__PURE__ */ i(((e, t) => {
180
- process.env.NODE_ENV === "production" ? t.exports = o() : t.exports = s();
181
- })))(), l = ({ isOpen: e, onClick: t, position: n = "bottom-right" }) => /* @__PURE__ */ (0, c.jsx)("button", {
182
- onClick: t,
183
- className: `fixed ${n === "bottom-right" ? "right-6 bottom-6" : "left-6 bottom-6"} w-14 h-14 bg-gradient-to-r from-blue-500 to-purple-600 text-white rounded-full shadow-lg hover:shadow-xl transform hover:scale-110 transition-all duration-300 flex items-center justify-center z-50`,
184
- "aria-label": "Toggle chat",
185
- children: e ? /* @__PURE__ */ (0, c.jsx)("svg", {
186
- className: "w-6 h-6",
187
- fill: "none",
188
- stroke: "currentColor",
189
- viewBox: "0 0 24 24",
190
- children: /* @__PURE__ */ (0, c.jsx)("path", {
191
- strokeLinecap: "round",
192
- strokeLinejoin: "round",
193
- strokeWidth: 2,
194
- d: "M6 18L18 6M6 6l12 12"
195
- })
196
- }) : /* @__PURE__ */ (0, c.jsx)("svg", {
197
- className: "w-6 h-6",
198
- fill: "none",
199
- stroke: "currentColor",
200
- viewBox: "0 0 24 24",
201
- children: /* @__PURE__ */ (0, c.jsx)("path", {
202
- strokeLinecap: "round",
203
- strokeLinejoin: "round",
204
- strokeWidth: 2,
205
- d: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"
2
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
3
+ //#region src/components/FloatingButton.tsx
4
+ var s = ({ isOpen: e, onClick: t, position: n = "bottom-right" }) => {
5
+ let r = {
6
+ ...n === "bottom-right" ? {
7
+ right: 24,
8
+ bottom: 24
9
+ } : {
10
+ left: 24,
11
+ bottom: 24
12
+ },
13
+ position: "fixed",
14
+ width: 56,
15
+ height: 56,
16
+ borderRadius: "50%",
17
+ background: "linear-gradient(to right, #3b82f6, #8b5cf6)",
18
+ color: "white",
19
+ border: "none",
20
+ boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
21
+ cursor: "pointer",
22
+ transition: "all 0.3s ease",
23
+ display: "flex",
24
+ alignItems: "center",
25
+ justifyContent: "center"
26
+ }, i = {
27
+ transform: "scale(1.1)",
28
+ boxShadow: "0 10px 15px rgba(0, 0, 0, 0.2)"
29
+ };
30
+ return /* @__PURE__ */ a("button", {
31
+ onClick: t,
32
+ style: r,
33
+ onMouseEnter: (e) => {
34
+ let t = e.target;
35
+ Object.assign(t.style, i);
36
+ },
37
+ onMouseLeave: (e) => {
38
+ let t = e.target;
39
+ t.style.transform = "scale(1)", t.style.boxShadow = "0 4px 6px rgba(0, 0, 0, 0.1)";
40
+ },
41
+ "aria-label": "Toggle chat",
42
+ children: e ? /* @__PURE__ */ a("svg", {
43
+ width: 24,
44
+ height: 24,
45
+ fill: "none",
46
+ stroke: "currentColor",
47
+ viewBox: "0 0 24 24",
48
+ children: /* @__PURE__ */ a("path", {
49
+ strokeLinecap: "round",
50
+ strokeLinejoin: "round",
51
+ strokeWidth: 2,
52
+ d: "M6 18L18 6M6 6l12 12"
53
+ })
54
+ }) : /* @__PURE__ */ a("svg", {
55
+ width: 24,
56
+ height: 24,
57
+ fill: "none",
58
+ stroke: "currentColor",
59
+ viewBox: "0 0 24 24",
60
+ children: /* @__PURE__ */ a("path", {
61
+ strokeLinecap: "round",
62
+ strokeLinejoin: "round",
63
+ strokeWidth: 2,
64
+ d: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"
65
+ })
206
66
  })
207
- })
208
- }), u = ({ messages: e, isLoading: i, onSendMessage: a, onClose: o, position: s = "bottom-right" }) => {
209
- let [l, u] = r(""), d = n(null), f = () => {
210
- d.current?.scrollIntoView({ behavior: "smooth" });
67
+ });
68
+ }, c = ({ messages: e, isLoading: s, onSendMessage: c, onClose: l, position: u = "bottom-right" }) => {
69
+ let [d, f] = r(""), p = n(null), m = () => {
70
+ p.current?.scrollIntoView({ behavior: "smooth" });
211
71
  };
212
72
  t(() => {
213
- f();
73
+ m();
214
74
  }, [e]);
215
- let p = (e) => {
216
- e.preventDefault(), l.trim() && !i && (a(l.trim()), u(""));
75
+ let h = (e) => {
76
+ e.preventDefault(), d.trim() && !s && (c(d.trim()), f(""));
77
+ }, g = {
78
+ ...u === "bottom-right" ? { right: 0 } : { left: 0 },
79
+ position: "fixed",
80
+ bottom: 80,
81
+ width: 384,
82
+ height: 500,
83
+ backgroundColor: "white",
84
+ borderRadius: 8,
85
+ boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
86
+ display: "flex",
87
+ flexDirection: "column",
88
+ overflow: "hidden",
89
+ border: "1px solid #e5e7eb",
90
+ zIndex: 50
91
+ }, _ = {
92
+ background: "linear-gradient(to right, #3b82f6, #8b5cf6)",
93
+ color: "white",
94
+ padding: "12px 16px",
95
+ display: "flex",
96
+ justifyContent: "space-between",
97
+ alignItems: "center"
98
+ }, v = {
99
+ margin: 0,
100
+ fontSize: 18,
101
+ fontWeight: 600
102
+ }, y = {
103
+ margin: 0,
104
+ fontSize: 12,
105
+ opacity: .9
106
+ }, b = {
107
+ background: "none",
108
+ border: "none",
109
+ color: "white",
110
+ cursor: "pointer",
111
+ padding: 4,
112
+ borderRadius: 4,
113
+ transition: "background 0.2s"
114
+ }, x = {
115
+ flex: 1,
116
+ overflowY: "auto",
117
+ padding: 16,
118
+ display: "flex",
119
+ flexDirection: "column",
120
+ gap: 16,
121
+ backgroundColor: "#f9fafb"
122
+ }, S = (e) => ({
123
+ display: "flex",
124
+ justifyContent: e === "user" ? "flex-end" : "flex-start"
125
+ }), C = (e) => ({
126
+ maxWidth: "80%",
127
+ padding: "8px 16px",
128
+ borderRadius: 16,
129
+ ...e === "user" && {
130
+ backgroundColor: "#3b82f6",
131
+ color: "white"
132
+ },
133
+ ...e === "assistant" && {
134
+ backgroundColor: "white",
135
+ color: "#1f2937",
136
+ border: "1px solid #e5e7eb"
137
+ }
138
+ }), w = {
139
+ fontSize: 11,
140
+ opacity: .7,
141
+ marginTop: 4,
142
+ display: "block"
143
+ }, T = {
144
+ padding: 16,
145
+ backgroundColor: "white",
146
+ borderTop: "1px solid #e5e7eb",
147
+ display: "flex",
148
+ gap: 8
149
+ }, E = {
150
+ flex: 1,
151
+ padding: "8px 16px",
152
+ border: "1px solid #d1d5db",
153
+ borderRadius: 9999,
154
+ outline: "none",
155
+ fontSize: 14
156
+ }, D = {
157
+ ...E,
158
+ borderColor: "#3b82f6",
159
+ boxShadow: "0 0 0 3px rgba(59, 130, 246, 0.1)"
160
+ }, O = () => {
161
+ let e = {
162
+ padding: "8px 16px",
163
+ backgroundColor: "#3b82f6",
164
+ color: "white",
165
+ border: "none",
166
+ borderRadius: 9999,
167
+ cursor: "pointer",
168
+ fontSize: 14,
169
+ transition: "background 0.2s"
170
+ };
171
+ return s || !d.trim() ? {
172
+ ...e,
173
+ opacity: .5,
174
+ cursor: "not-allowed"
175
+ } : e;
176
+ }, k = {
177
+ width: 8,
178
+ height: 8,
179
+ borderRadius: "50%",
180
+ backgroundColor: "#9ca3af",
181
+ animationName: "bounce",
182
+ animationDuration: "1s",
183
+ animationIterationCount: "infinite"
217
184
  };
218
- return /* @__PURE__ */ (0, c.jsxs)("div", {
219
- className: `fixed bottom-20 ${s === "bottom-right" ? "right-0" : "left-0"} w-96 h-[500px] bg-white rounded-lg shadow-2xl flex flex-col overflow-hidden border border-gray-200`,
185
+ return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("style", { children: "\n @keyframes bounce {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n }\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n .spinner {\n animation: spin 1s linear infinite;\n }\n " }), /* @__PURE__ */ o("div", {
186
+ style: g,
220
187
  children: [
221
- /* @__PURE__ */ (0, c.jsxs)("div", {
222
- className: "bg-gradient-to-r from-blue-500 to-purple-600 text-white px-4 py-3 flex justify-between items-center",
223
- children: [/* @__PURE__ */ (0, c.jsxs)("div", { children: [/* @__PURE__ */ (0, c.jsx)("h3", {
224
- className: "font-semibold text-lg",
188
+ /* @__PURE__ */ o("div", {
189
+ style: _,
190
+ children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h3", {
191
+ style: v,
225
192
  children: "AI Coding Assistant"
226
- }), /* @__PURE__ */ (0, c.jsx)("p", {
227
- className: "text-xs text-blue-100",
193
+ }), /* @__PURE__ */ a("p", {
194
+ style: y,
228
195
  children: "Ask me about your code"
229
- })] }), /* @__PURE__ */ (0, c.jsx)("button", {
230
- onClick: o,
231
- className: "text-white hover:bg-white/20 rounded-full p-1 transition-colors",
196
+ })] }), /* @__PURE__ */ a("button", {
197
+ onClick: l,
198
+ style: b,
232
199
  "aria-label": "Close chat",
233
- children: /* @__PURE__ */ (0, c.jsx)("svg", {
234
- className: "w-5 h-5",
200
+ children: /* @__PURE__ */ a("svg", {
201
+ width: 20,
202
+ height: 20,
235
203
  fill: "none",
236
204
  stroke: "currentColor",
237
205
  viewBox: "0 0 24 24",
238
- children: /* @__PURE__ */ (0, c.jsx)("path", {
206
+ children: /* @__PURE__ */ a("path", {
239
207
  strokeLinecap: "round",
240
208
  strokeLinejoin: "round",
241
209
  strokeWidth: 2,
@@ -244,125 +212,147 @@ var i = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), a
244
212
  })
245
213
  })]
246
214
  }),
247
- /* @__PURE__ */ (0, c.jsxs)("div", {
248
- className: "flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50",
215
+ /* @__PURE__ */ o("div", {
216
+ style: x,
249
217
  children: [
250
- e.length === 0 ? /* @__PURE__ */ (0, c.jsxs)("div", {
251
- className: "text-center text-gray-500 mt-10",
218
+ e.length === 0 ? /* @__PURE__ */ o("div", {
219
+ style: {
220
+ textAlign: "center",
221
+ color: "#6b7280",
222
+ marginTop: 40
223
+ },
252
224
  children: [
253
- /* @__PURE__ */ (0, c.jsx)("svg", {
254
- className: "w-16 h-16 mx-auto mb-4 text-gray-300",
225
+ /* @__PURE__ */ a("svg", {
226
+ width: 64,
227
+ height: 64,
228
+ style: {
229
+ margin: "0 auto 16px",
230
+ color: "#d1d5db"
231
+ },
255
232
  fill: "none",
256
233
  stroke: "currentColor",
257
234
  viewBox: "0 0 24 24",
258
- children: /* @__PURE__ */ (0, c.jsx)("path", {
235
+ children: /* @__PURE__ */ a("path", {
259
236
  strokeLinecap: "round",
260
237
  strokeLinejoin: "round",
261
238
  strokeWidth: 1.5,
262
239
  d: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"
263
240
  })
264
241
  }),
265
- /* @__PURE__ */ (0, c.jsx)("p", {
266
- className: "text-sm",
242
+ /* @__PURE__ */ a("p", {
243
+ style: {
244
+ margin: 0,
245
+ fontSize: 14
246
+ },
267
247
  children: "你好!我是你的代码助手。"
268
248
  }),
269
- /* @__PURE__ */ (0, c.jsx)("p", {
270
- className: "text-xs mt-1",
249
+ /* @__PURE__ */ a("p", {
250
+ style: {
251
+ margin: 0,
252
+ fontSize: 12,
253
+ marginTop: 4
254
+ },
271
255
  children: "问我关于这个代码库的任何问题"
272
256
  })
273
257
  ]
274
- }) : e.map((e) => /* @__PURE__ */ (0, c.jsx)("div", {
275
- className: `flex ${e.role === "user" ? "justify-end" : "justify-start"}`,
276
- children: /* @__PURE__ */ (0, c.jsxs)("div", {
277
- className: `max-w-[80%] rounded-2xl px-4 py-2 ${e.role === "user" ? "bg-blue-500 text-white" : "bg-white text-gray-800 border border-gray-200"}`,
278
- children: [/* @__PURE__ */ (0, c.jsx)("p", {
279
- className: "text-sm whitespace-pre-wrap break-words",
258
+ }) : e.map((e) => /* @__PURE__ */ a("div", {
259
+ style: S(e.role),
260
+ children: /* @__PURE__ */ o("div", {
261
+ style: C(e.role),
262
+ children: [/* @__PURE__ */ a("p", {
263
+ style: {
264
+ margin: 0,
265
+ fontSize: 14,
266
+ whiteSpace: "pre-wrap",
267
+ wordBreak: "break-word"
268
+ },
280
269
  children: e.content
281
- }), /* @__PURE__ */ (0, c.jsx)("span", {
282
- className: "text-xs opacity-70 mt-1 block",
270
+ }), /* @__PURE__ */ a("span", {
271
+ style: w,
283
272
  children: new Date(e.timestamp).toLocaleTimeString()
284
273
  })]
285
274
  })
286
275
  }, e.id)),
287
- i && /* @__PURE__ */ (0, c.jsx)("div", {
288
- className: "flex justify-start",
289
- children: /* @__PURE__ */ (0, c.jsx)("div", {
290
- className: "bg-white border border-gray-200 rounded-2xl px-4 py-3",
291
- children: /* @__PURE__ */ (0, c.jsxs)("div", {
292
- className: "flex space-x-2",
276
+ s && /* @__PURE__ */ a("div", {
277
+ style: S("assistant"),
278
+ children: /* @__PURE__ */ a("div", {
279
+ style: C("assistant"),
280
+ children: /* @__PURE__ */ o("div", {
281
+ style: {
282
+ display: "flex",
283
+ gap: 8
284
+ },
293
285
  children: [
294
- /* @__PURE__ */ (0, c.jsx)("div", {
295
- className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
296
- style: { animationDelay: "0ms" }
297
- }),
298
- /* @__PURE__ */ (0, c.jsx)("div", {
299
- className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
300
- style: { animationDelay: "150ms" }
301
- }),
302
- /* @__PURE__ */ (0, c.jsx)("div", {
303
- className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
304
- style: { animationDelay: "300ms" }
305
- })
286
+ /* @__PURE__ */ a("div", { style: k }),
287
+ /* @__PURE__ */ a("div", { style: {
288
+ ...k,
289
+ animationDelay: "150ms"
290
+ } }),
291
+ /* @__PURE__ */ a("div", { style: {
292
+ ...k,
293
+ animationDelay: "300ms"
294
+ } })
306
295
  ]
307
296
  })
308
297
  })
309
298
  }),
310
- /* @__PURE__ */ (0, c.jsx)("div", { ref: d })
299
+ /* @__PURE__ */ a("div", { ref: p })
311
300
  ]
312
301
  }),
313
- /* @__PURE__ */ (0, c.jsx)("form", {
314
- onSubmit: p,
315
- className: "p-4 bg-white border-t border-gray-200",
316
- children: /* @__PURE__ */ (0, c.jsxs)("div", {
317
- className: "flex space-x-2",
318
- children: [/* @__PURE__ */ (0, c.jsx)("input", {
319
- type: "text",
320
- value: l,
321
- onChange: (e) => u(e.target.value),
322
- placeholder: "输入你的问题...",
323
- disabled: i,
324
- className: "flex-1 px-4 py-2 border border-gray-300 rounded-full focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50 disabled:cursor-not-allowed"
325
- }), /* @__PURE__ */ (0, c.jsx)("button", {
326
- type: "submit",
327
- disabled: i || !l.trim(),
328
- className: "px-4 py-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
329
- children: i ? /* @__PURE__ */ (0, c.jsxs)("svg", {
330
- className: "w-5 h-5 animate-spin",
331
- fill: "none",
332
- viewBox: "0 0 24 24",
333
- children: [/* @__PURE__ */ (0, c.jsx)("circle", {
334
- className: "opacity-25",
335
- cx: "12",
336
- cy: "12",
337
- r: "10",
338
- stroke: "currentColor",
339
- strokeWidth: "4"
340
- }), /* @__PURE__ */ (0, c.jsx)("path", {
341
- className: "opacity-75",
342
- fill: "currentColor",
343
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
344
- })]
345
- }) : /* @__PURE__ */ (0, c.jsx)("svg", {
346
- className: "w-5 h-5",
347
- fill: "none",
302
+ /* @__PURE__ */ o("form", {
303
+ onSubmit: h,
304
+ style: T,
305
+ children: [/* @__PURE__ */ a("input", {
306
+ type: "text",
307
+ value: d,
308
+ onChange: (e) => f(e.target.value),
309
+ placeholder: "输入你的问题...",
310
+ disabled: s,
311
+ style: E,
312
+ onFocus: (e) => Object.assign(e.target.style, D),
313
+ onBlur: (e) => Object.assign(e.target.style, E)
314
+ }), /* @__PURE__ */ a("button", {
315
+ type: "submit",
316
+ disabled: s || !d.trim(),
317
+ style: O(),
318
+ children: s ? /* @__PURE__ */ o("svg", {
319
+ width: 20,
320
+ height: 20,
321
+ className: "spinner",
322
+ viewBox: "0 0 24 24",
323
+ children: [/* @__PURE__ */ a("circle", {
324
+ className: "opacity-25",
325
+ cx: "12",
326
+ cy: "12",
327
+ r: "10",
348
328
  stroke: "currentColor",
349
- viewBox: "0 0 24 24",
350
- children: /* @__PURE__ */ (0, c.jsx)("path", {
351
- strokeLinecap: "round",
352
- strokeLinejoin: "round",
353
- strokeWidth: 2,
354
- d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8"
355
- })
329
+ strokeWidth: "4"
330
+ }), /* @__PURE__ */ a("path", {
331
+ className: "opacity-75",
332
+ fill: "currentColor",
333
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 1 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
334
+ })]
335
+ }) : /* @__PURE__ */ a("svg", {
336
+ width: 20,
337
+ height: 20,
338
+ fill: "none",
339
+ stroke: "currentColor",
340
+ viewBox: "0 0 24 24",
341
+ children: /* @__PURE__ */ a("path", {
342
+ strokeLinecap: "round",
343
+ strokeLinejoin: "round",
344
+ strokeWidth: 2,
345
+ d: "M12 19l9 2-9-18-9-18 9 2-9 2zm0 0v-8"
356
346
  })
357
- })]
358
- })
347
+ })
348
+ })]
359
349
  })
360
350
  ]
361
- });
351
+ })] });
362
352
  };
363
353
  //#endregion
364
354
  //#region src/hooks/useChat.ts
365
- function d(t) {
355
+ function l(t) {
366
356
  let [n, i] = r([]), [a, o] = r(!1), [s, c] = r(null);
367
357
  return {
368
358
  messages: n,
@@ -408,26 +398,26 @@ function d(t) {
408
398
  }
409
399
  //#endregion
410
400
  //#region src/index.tsx
411
- var f = (e) => {
412
- let [t, n] = r(!1), { messages: i, isLoading: a, error: o, sendMessage: s, clearMessages: f } = d(e);
413
- return /* @__PURE__ */ (0, c.jsxs)(c.Fragment, { children: [
414
- /* @__PURE__ */ (0, c.jsx)(l, {
401
+ var u = (e) => {
402
+ let [t, n] = r(!1), { messages: u, isLoading: d, error: f, sendMessage: p } = l(e);
403
+ return /* @__PURE__ */ o(i, { children: [
404
+ /* @__PURE__ */ a(s, {
415
405
  isOpen: t,
416
406
  onClick: () => n(!t),
417
407
  position: e.position
418
408
  }),
419
- t && /* @__PURE__ */ (0, c.jsx)(u, {
420
- messages: i,
421
- isLoading: a,
422
- onSendMessage: s,
409
+ t && /* @__PURE__ */ a(c, {
410
+ messages: u,
411
+ isLoading: d,
412
+ onSendMessage: p,
423
413
  onClose: () => n(!1),
424
414
  position: e.position
425
415
  }),
426
- o && /* @__PURE__ */ (0, c.jsxs)("div", {
416
+ f && /* @__PURE__ */ o("div", {
427
417
  className: "fixed top-4 right-4 bg-red-500 text-white px-4 py-2 rounded-lg shadow-lg z-50",
428
- children: ["Error: ", o]
418
+ children: ["Error: ", f]
429
419
  })
430
420
  ] });
431
421
  };
432
422
  //#endregion
433
- export { f as CodingAssistant, f as default };
423
+ export { u as CodingAssistant, u as default };
@@ -1,6 +1,18 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`)):typeof define==`function`&&define.amd?define([`exports`,`react`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.CodingAssistant={},e.React))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e};t=((e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)))(t);var u=c((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),d=c((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===O?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case E:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===E)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=k.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(A.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){N||(N=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function l(){var e=t(this.type);return P[e]||(P[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,`ref`,{enumerable:!1,value:null}):Object.defineProperty(e,`ref`,{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,`_debugInfo`,{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,`_debugStack`,{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,`_debugTask`,{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0)if(o)if(j(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else f(p);if(A.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,L[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
2
- let props = %s;
3
- <%s {...props} />
4
- React keys must be passed directly to JSX without using spread:
5
- let props = %s;
6
- <%s key={someKey} {...props} />`,o,p,m,p),L[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=require(`react`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.client.reference`),k=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=Object.prototype.hasOwnProperty,j=Array.isArray,M=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var N,P={},F=m.react_stack_bottom_frame.bind(m,o)(),I=M(i(o)),L={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!1,r?Error(`react-stack-top-frame`):F,r?M(i(e)):I)},e.jsxs=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!0,r?Error(`react-stack-top-frame`):F,r?M(i(e)):I)}})()})),f=c(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=u():t.exports=d()}))(),p=({isOpen:e,onClick:t,position:n=`bottom-right`})=>(0,f.jsx)(`button`,{onClick:t,className:`fixed ${n===`bottom-right`?`right-6 bottom-6`:`left-6 bottom-6`} w-14 h-14 bg-gradient-to-r from-blue-500 to-purple-600 text-white rounded-full shadow-lg hover:shadow-xl transform hover:scale-110 transition-all duration-300 flex items-center justify-center z-50`,"aria-label":`Toggle chat`,children:e?(0,f.jsx)(`svg`,{className:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})}):(0,f.jsx)(`svg`,{className:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z`})})}),m=({messages:e,isLoading:n,onSendMessage:r,onClose:i,position:a=`bottom-right`})=>{let[o,s]=(0,t.useState)(``),c=(0,t.useRef)(null),l=()=>{c.current?.scrollIntoView({behavior:`smooth`})};(0,t.useEffect)(()=>{l()},[e]);let u=e=>{e.preventDefault(),o.trim()&&!n&&(r(o.trim()),s(``))};return(0,f.jsxs)(`div`,{className:`fixed bottom-20 ${a===`bottom-right`?`right-0`:`left-0`} w-96 h-[500px] bg-white rounded-lg shadow-2xl flex flex-col overflow-hidden border border-gray-200`,children:[(0,f.jsxs)(`div`,{className:`bg-gradient-to-r from-blue-500 to-purple-600 text-white px-4 py-3 flex justify-between items-center`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h3`,{className:`font-semibold text-lg`,children:`AI Coding Assistant`}),(0,f.jsx)(`p`,{className:`text-xs text-blue-100`,children:`Ask me about your code`})]}),(0,f.jsx)(`button`,{onClick:i,className:`text-white hover:bg-white/20 rounded-full p-1 transition-colors`,"aria-label":`Close chat`,children:(0,f.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]}),(0,f.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50`,children:[e.length===0?(0,f.jsxs)(`div`,{className:`text-center text-gray-500 mt-10`,children:[(0,f.jsx)(`svg`,{className:`w-16 h-16 mx-auto mb-4 text-gray-300`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z`})}),(0,f.jsx)(`p`,{className:`text-sm`,children:`你好!我是你的代码助手。`}),(0,f.jsx)(`p`,{className:`text-xs mt-1`,children:`问我关于这个代码库的任何问题`})]}):e.map(e=>(0,f.jsx)(`div`,{className:`flex ${e.role===`user`?`justify-end`:`justify-start`}`,children:(0,f.jsxs)(`div`,{className:`max-w-[80%] rounded-2xl px-4 py-2 ${e.role===`user`?`bg-blue-500 text-white`:`bg-white text-gray-800 border border-gray-200`}`,children:[(0,f.jsx)(`p`,{className:`text-sm whitespace-pre-wrap break-words`,children:e.content}),(0,f.jsx)(`span`,{className:`text-xs opacity-70 mt-1 block`,children:new Date(e.timestamp).toLocaleTimeString()})]})},e.id)),n&&(0,f.jsx)(`div`,{className:`flex justify-start`,children:(0,f.jsx)(`div`,{className:`bg-white border border-gray-200 rounded-2xl px-4 py-3`,children:(0,f.jsxs)(`div`,{className:`flex space-x-2`,children:[(0,f.jsx)(`div`,{className:`w-2 h-2 bg-gray-400 rounded-full animate-bounce`,style:{animationDelay:`0ms`}}),(0,f.jsx)(`div`,{className:`w-2 h-2 bg-gray-400 rounded-full animate-bounce`,style:{animationDelay:`150ms`}}),(0,f.jsx)(`div`,{className:`w-2 h-2 bg-gray-400 rounded-full animate-bounce`,style:{animationDelay:`300ms`}})]})})}),(0,f.jsx)(`div`,{ref:c})]}),(0,f.jsx)(`form`,{onSubmit:u,className:`p-4 bg-white border-t border-gray-200`,children:(0,f.jsxs)(`div`,{className:`flex space-x-2`,children:[(0,f.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`输入你的问题...`,disabled:n,className:`flex-1 px-4 py-2 border border-gray-300 rounded-full focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50 disabled:cursor-not-allowed`}),(0,f.jsx)(`button`,{type:`submit`,disabled:n||!o.trim(),className:`px-4 py-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:n?(0,f.jsxs)(`svg`,{className:`w-5 h-5 animate-spin`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,f.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}):(0,f.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 19l9 2-9-18-9 18 9-2zm0 0v-8`})})})]})})]})};function h(e){let[n,r]=(0,t.useState)([]),[i,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(null);return{messages:n,isLoading:i,error:o,sendMessage:(0,t.useCallback)(async t=>{let n={id:Date.now().toString(),role:`user`,content:t,timestamp:new Date};r(e=>[...e,n]),a(!0),s(null);try{let n=await fetch(`${e.apiUrl}/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({message:t,repoUrl:e.repoUrl,accessToken:e.accessToken,branch:e.branch})});if(!n.ok)throw Error(`HTTP error! status: ${n.status}`);let i=await n.json(),a={id:(Date.now()+1).toString(),role:`assistant`,content:i.response,timestamp:new Date};r(e=>[...e,a])}catch(e){s(e instanceof Error?e.message:`Unknown error`),console.error(`Error sending message:`,e)}finally{a(!1)}},[e]),clearMessages:(0,t.useCallback)(()=>{r([]),s(null)},[])}}var g=e=>{let[n,r]=(0,t.useState)(!1),{messages:i,isLoading:a,error:o,sendMessage:s,clearMessages:c}=h(e);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p,{isOpen:n,onClick:()=>r(!n),position:e.position}),n&&(0,f.jsx)(m,{messages:i,isLoading:a,onSendMessage:s,onClose:()=>r(!1),position:e.position}),o&&(0,f.jsxs)(`div`,{className:`fixed top-4 right-4 bg-red-500 text-white px-4 py-2 rounded-lg shadow-lg z-50`,children:[`Error: `,o]})]})};e.CodingAssistant=g,e.default=g});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.CodingAssistant={},e.React,e._jsx_runtime))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:r(s(e)),l(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)))(t);var u=({isOpen:e,onClick:t,position:r=`bottom-right`})=>{let i={...r===`bottom-right`?{right:24,bottom:24}:{left:24,bottom:24},position:`fixed`,width:56,height:56,borderRadius:`50%`,background:`linear-gradient(to right, #3b82f6, #8b5cf6)`,color:`white`,border:`none`,boxShadow:`0 4px 6px rgba(0, 0, 0, 0.1)`,cursor:`pointer`,transition:`all 0.3s ease`,display:`flex`,alignItems:`center`,justifyContent:`center`},a={transform:`scale(1.1)`,boxShadow:`0 10px 15px rgba(0, 0, 0, 0.2)`};return(0,n.jsx)(`button`,{onClick:t,style:i,onMouseEnter:e=>{let t=e.target;Object.assign(t.style,a)},onMouseLeave:e=>{let t=e.target;t.style.transform=`scale(1)`,t.style.boxShadow=`0 4px 6px rgba(0, 0, 0, 0.1)`},"aria-label":`Toggle chat`,children:e?(0,n.jsx)(`svg`,{width:24,height:24,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})}):(0,n.jsx)(`svg`,{width:24,height:24,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z`})})})},d=({messages:e,isLoading:r,onSendMessage:i,onClose:a,position:o=`bottom-right`})=>{let[s,c]=(0,t.useState)(``),l=(0,t.useRef)(null),u=()=>{l.current?.scrollIntoView({behavior:`smooth`})};(0,t.useEffect)(()=>{u()},[e]);let d=e=>{e.preventDefault(),s.trim()&&!r&&(i(s.trim()),c(``))},f={...o===`bottom-right`?{right:0}:{left:0},position:`fixed`,bottom:80,width:384,height:500,backgroundColor:`white`,borderRadius:8,boxShadow:`0 4px 6px rgba(0, 0, 0, 0.1)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,border:`1px solid #e5e7eb`,zIndex:50},p={background:`linear-gradient(to right, #3b82f6, #8b5cf6)`,color:`white`,padding:`12px 16px`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},m={margin:0,fontSize:18,fontWeight:600},h={margin:0,fontSize:12,opacity:.9},g={background:`none`,border:`none`,color:`white`,cursor:`pointer`,padding:4,borderRadius:4,transition:`background 0.2s`},_={flex:1,overflowY:`auto`,padding:16,display:`flex`,flexDirection:`column`,gap:16,backgroundColor:`#f9fafb`},v=e=>({display:`flex`,justifyContent:e===`user`?`flex-end`:`flex-start`}),y=e=>({maxWidth:`80%`,padding:`8px 16px`,borderRadius:16,...e===`user`&&{backgroundColor:`#3b82f6`,color:`white`},...e===`assistant`&&{backgroundColor:`white`,color:`#1f2937`,border:`1px solid #e5e7eb`}}),b={fontSize:11,opacity:.7,marginTop:4,display:`block`},x={padding:16,backgroundColor:`white`,borderTop:`1px solid #e5e7eb`,display:`flex`,gap:8},S={flex:1,padding:`8px 16px`,border:`1px solid #d1d5db`,borderRadius:9999,outline:`none`,fontSize:14},C={...S,borderColor:`#3b82f6`,boxShadow:`0 0 0 3px rgba(59, 130, 246, 0.1)`},w=()=>{let e={padding:`8px 16px`,backgroundColor:`#3b82f6`,color:`white`,border:`none`,borderRadius:9999,cursor:`pointer`,fontSize:14,transition:`background 0.2s`};return r||!s.trim()?{...e,opacity:.5,cursor:`not-allowed`}:e},T={width:8,height:8,borderRadius:`50%`,backgroundColor:`#9ca3af`,animationName:`bounce`,animationDuration:`1s`,animationIterationCount:`infinite`};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`style`,{children:`
2
+ @keyframes bounce {
3
+ 0%, 100% {
4
+ transform: translateY(0);
5
+ }
6
+ 50% {
7
+ transform: translateY(-10px);
8
+ }
9
+ }
10
+ @keyframes spin {
11
+ to {
12
+ transform: rotate(360deg);
13
+ }
14
+ }
15
+ .spinner {
16
+ animation: spin 1s linear infinite;
17
+ }
18
+ `}),(0,n.jsxs)(`div`,{style:f,children:[(0,n.jsxs)(`div`,{style:p,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`h3`,{style:m,children:`AI Coding Assistant`}),(0,n.jsx)(`p`,{style:h,children:`Ask me about your code`})]}),(0,n.jsx)(`button`,{onClick:a,style:g,"aria-label":`Close chat`,children:(0,n.jsx)(`svg`,{width:20,height:20,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]}),(0,n.jsxs)(`div`,{style:_,children:[e.length===0?(0,n.jsxs)(`div`,{style:{textAlign:`center`,color:`#6b7280`,marginTop:40},children:[(0,n.jsx)(`svg`,{width:64,height:64,style:{margin:`0 auto 16px`,color:`#d1d5db`},fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z`})}),(0,n.jsx)(`p`,{style:{margin:0,fontSize:14},children:`你好!我是你的代码助手。`}),(0,n.jsx)(`p`,{style:{margin:0,fontSize:12,marginTop:4},children:`问我关于这个代码库的任何问题`})]}):e.map(e=>(0,n.jsx)(`div`,{style:v(e.role),children:(0,n.jsxs)(`div`,{style:y(e.role),children:[(0,n.jsx)(`p`,{style:{margin:0,fontSize:14,whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:e.content}),(0,n.jsx)(`span`,{style:b,children:new Date(e.timestamp).toLocaleTimeString()})]})},e.id)),r&&(0,n.jsx)(`div`,{style:v(`assistant`),children:(0,n.jsx)(`div`,{style:y(`assistant`),children:(0,n.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,n.jsx)(`div`,{style:T}),(0,n.jsx)(`div`,{style:{...T,animationDelay:`150ms`}}),(0,n.jsx)(`div`,{style:{...T,animationDelay:`300ms`}})]})})}),(0,n.jsx)(`div`,{ref:l})]}),(0,n.jsxs)(`form`,{onSubmit:d,style:x,children:[(0,n.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`输入你的问题...`,disabled:r,style:S,onFocus:e=>Object.assign(e.target.style,C),onBlur:e=>Object.assign(e.target.style,S)}),(0,n.jsx)(`button`,{type:`submit`,disabled:r||!s.trim(),style:w(),children:r?(0,n.jsxs)(`svg`,{width:20,height:20,className:`spinner`,viewBox:`0 0 24 24`,children:[(0,n.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,n.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 1 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}):(0,n.jsx)(`svg`,{width:20,height:20,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 19l9 2-9-18-9-18 9 2-9 2zm0 0v-8`})})})]})]})]})};function f(e){let[n,r]=(0,t.useState)([]),[i,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(null);return{messages:n,isLoading:i,error:o,sendMessage:(0,t.useCallback)(async t=>{let n={id:Date.now().toString(),role:`user`,content:t,timestamp:new Date};r(e=>[...e,n]),a(!0),s(null);try{let n=await fetch(`${e.apiUrl}/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({message:t,repoUrl:e.repoUrl,accessToken:e.accessToken,branch:e.branch})});if(!n.ok)throw Error(`HTTP error! status: ${n.status}`);let i=await n.json(),a={id:(Date.now()+1).toString(),role:`assistant`,content:i.response,timestamp:new Date};r(e=>[...e,a])}catch(e){s(e instanceof Error?e.message:`Unknown error`),console.error(`Error sending message:`,e)}finally{a(!1)}},[e]),clearMessages:(0,t.useCallback)(()=>{r([]),s(null)},[])}}var p=e=>{let[r,i]=(0,t.useState)(!1),{messages:a,isLoading:o,error:s,sendMessage:c}=f(e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u,{isOpen:r,onClick:()=>i(!r),position:e.position}),r&&(0,n.jsx)(d,{messages:a,isLoading:o,onSendMessage:c,onClose:()=>i(!1),position:e.position}),s&&(0,n.jsxs)(`div`,{className:`fixed top-4 right-4 bg-red-500 text-white px-4 py-2 rounded-lg shadow-lg z-50`,children:[`Error: `,s]})]})};e.CodingAssistant=p,e.default=p});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-coding-agent/react-assistant",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "AI-powered coding assistant for React applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,9 +44,6 @@
44
44
  "@types/react": "^19.2.14",
45
45
  "@types/react-dom": "^19.2.3",
46
46
  "@vitejs/plugin-react": "^6.0.1",
47
- "autoprefixer": "^10.4.21",
48
- "postcss": "^8.5.3",
49
- "tailwindcss": "^3.4.1",
50
47
  "typescript": "~5.9.3",
51
48
  "vite": "^8.0.1",
52
49
  "vite-plugin-dts": "^4.5.3"
package/dist/index.css DELETED
@@ -1,2 +0,0 @@
1
- *,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.bottom-20{bottom:5rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-6{left:1.5rem}.right-0{right:0}.right-4{right:1rem}.right-6{right:1.5rem}.top-4{top:1rem}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.block{display:block}.flex{display:flex}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-\[500px\]{height:500px}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-96{width:24rem}.max-w-\[80\%\]{max-width:80%}.flex-1{flex:1}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.animate-bounce{animation:1s infinite bounce}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:1s linear infinite spin}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-t{border-top-width:1px}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-gradient-to-r{background-image:linear-gradient(to right, var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from:#3b82f6 var(--tw-gradient-from-position);--tw-gradient-to:#3b82f600 var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to)}.to-purple-600{--tw-gradient-to:#9333ea var(--tw-gradient-to-position)}.p-1{padding:.25rem}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-blue-100{--tw-text-opacity:1;color:rgb(219 234 254/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-25{opacity:.25}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.hover\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.focus\:border-transparent:focus{border-color:#0000}.focus\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}
2
- /*$vite$:1*/