@alquimia-ai/ui 2.0.0 → 2.2.1
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/{alert-dialog-CP71C4vl.d.mts → alert-dialog-HrXEPlTh.d.mts} +1 -1
- package/dist/{alert-dialog-CP71C4vl.d.ts → alert-dialog-HrXEPlTh.d.ts} +1 -1
- package/dist/components/atoms/index.d.mts +48 -3
- package/dist/components/atoms/index.d.ts +48 -3
- package/dist/components/atoms/index.js +239 -0
- package/dist/components/atoms/index.js.map +1 -1
- package/dist/components/atoms/index.mjs +207 -1
- package/dist/components/atoms/index.mjs.map +1 -1
- package/dist/components/genui/index.d.mts +79 -0
- package/dist/components/genui/index.d.ts +79 -0
- package/dist/components/genui/index.js +4693 -0
- package/dist/components/genui/index.js.map +1 -0
- package/dist/components/genui/index.mjs +4622 -0
- package/dist/components/genui/index.mjs.map +1 -0
- package/dist/components/hooks/index.d.mts +1 -1
- package/dist/components/hooks/index.d.ts +1 -1
- package/dist/components/molecules/documents/index.js +283 -58
- package/dist/components/molecules/documents/index.js.map +1 -1
- package/dist/components/molecules/documents/index.mjs +281 -58
- package/dist/components/molecules/documents/index.mjs.map +1 -1
- package/dist/components/molecules/index.d.mts +2 -2
- package/dist/components/molecules/index.d.ts +2 -2
- package/dist/components/molecules/index.js +335 -156
- package/dist/components/molecules/index.js.map +1 -1
- package/dist/components/molecules/index.mjs +331 -152
- package/dist/components/molecules/index.mjs.map +1 -1
- package/dist/components/molecules/viewers/index.js +182 -3
- package/dist/components/molecules/viewers/index.js.map +1 -1
- package/dist/components/molecules/viewers/index.mjs +182 -3
- package/dist/components/molecules/viewers/index.mjs.map +1 -1
- package/dist/components/organisms/index.d.mts +15 -2
- package/dist/components/organisms/index.d.ts +15 -2
- package/dist/components/organisms/index.js +434 -247
- package/dist/components/organisms/index.js.map +1 -1
- package/dist/components/organisms/index.mjs +431 -244
- package/dist/components/organisms/index.mjs.map +1 -1
- package/dist/components/templates/index.js +210 -31
- package/dist/components/templates/index.js.map +1 -1
- package/dist/components/templates/index.mjs +210 -31
- package/dist/components/templates/index.mjs.map +1 -1
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +554 -307
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +524 -310
- package/dist/index.mjs.map +1 -1
- package/dist/{toast-2xT7L1tJ.d.mts → toast-DEc6eGUE.d.mts} +1 -1
- package/dist/{toast-2xT7L1tJ.d.ts → toast-DEc6eGUE.d.ts} +1 -1
- package/package.json +22 -3
|
@@ -0,0 +1,4693 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _array_without_holes(arr) {
|
|
11
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
12
|
+
}
|
|
13
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
14
|
+
try {
|
|
15
|
+
var info = gen[key](arg);
|
|
16
|
+
var value = info.value;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
reject(error);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (info.done) {
|
|
22
|
+
resolve(value);
|
|
23
|
+
} else {
|
|
24
|
+
Promise.resolve(value).then(_next, _throw);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function _async_to_generator(fn) {
|
|
28
|
+
return function() {
|
|
29
|
+
var self = this, args = arguments;
|
|
30
|
+
return new Promise(function(resolve, reject) {
|
|
31
|
+
var gen = fn.apply(self, args);
|
|
32
|
+
function _next(value) {
|
|
33
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
34
|
+
}
|
|
35
|
+
function _throw(err) {
|
|
36
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
37
|
+
}
|
|
38
|
+
_next(undefined);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function _define_property(obj, key, value) {
|
|
43
|
+
if (key in obj) {
|
|
44
|
+
Object.defineProperty(obj, key, {
|
|
45
|
+
value: value,
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
obj[key] = value;
|
|
52
|
+
}
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
function _extends() {
|
|
56
|
+
_extends = Object.assign || function(target) {
|
|
57
|
+
for(var i = 1; i < arguments.length; i++){
|
|
58
|
+
var source = arguments[i];
|
|
59
|
+
for(var key in source){
|
|
60
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
61
|
+
target[key] = source[key];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return target;
|
|
66
|
+
};
|
|
67
|
+
return _extends.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
function _iterable_to_array(iter) {
|
|
70
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
71
|
+
}
|
|
72
|
+
function _iterable_to_array_limit(arr, i) {
|
|
73
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
74
|
+
if (_i == null) return;
|
|
75
|
+
var _arr = [];
|
|
76
|
+
var _n = true;
|
|
77
|
+
var _d = false;
|
|
78
|
+
var _s, _e;
|
|
79
|
+
try {
|
|
80
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
81
|
+
_arr.push(_s.value);
|
|
82
|
+
if (i && _arr.length === i) break;
|
|
83
|
+
}
|
|
84
|
+
} catch (err) {
|
|
85
|
+
_d = true;
|
|
86
|
+
_e = err;
|
|
87
|
+
} finally{
|
|
88
|
+
try {
|
|
89
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
90
|
+
} finally{
|
|
91
|
+
if (_d) throw _e;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return _arr;
|
|
95
|
+
}
|
|
96
|
+
function _non_iterable_rest() {
|
|
97
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
98
|
+
}
|
|
99
|
+
function _non_iterable_spread() {
|
|
100
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
101
|
+
}
|
|
102
|
+
function _object_destructuring_empty(o) {
|
|
103
|
+
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
104
|
+
return o;
|
|
105
|
+
}
|
|
106
|
+
function _object_spread(target) {
|
|
107
|
+
for(var i = 1; i < arguments.length; i++){
|
|
108
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
109
|
+
var ownKeys = Object.keys(source);
|
|
110
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
111
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
112
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
ownKeys.forEach(function(key) {
|
|
116
|
+
_define_property(target, key, source[key]);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return target;
|
|
120
|
+
}
|
|
121
|
+
function ownKeys(object, enumerableOnly) {
|
|
122
|
+
var keys = Object.keys(object);
|
|
123
|
+
if (Object.getOwnPropertySymbols) {
|
|
124
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
125
|
+
if (enumerableOnly) {
|
|
126
|
+
symbols = symbols.filter(function(sym) {
|
|
127
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
keys.push.apply(keys, symbols);
|
|
131
|
+
}
|
|
132
|
+
return keys;
|
|
133
|
+
}
|
|
134
|
+
function _object_spread_props(target, source) {
|
|
135
|
+
source = source != null ? source : {};
|
|
136
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
137
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
138
|
+
} else {
|
|
139
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
140
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return target;
|
|
144
|
+
}
|
|
145
|
+
function _object_without_properties(source, excluded) {
|
|
146
|
+
if (source == null) return {};
|
|
147
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
148
|
+
var key, i;
|
|
149
|
+
if (Object.getOwnPropertySymbols) {
|
|
150
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
151
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
152
|
+
key = sourceSymbolKeys[i];
|
|
153
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
154
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
155
|
+
target[key] = source[key];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return target;
|
|
159
|
+
}
|
|
160
|
+
function _object_without_properties_loose(source, excluded) {
|
|
161
|
+
if (source == null) return {};
|
|
162
|
+
var target = {};
|
|
163
|
+
var sourceKeys = Object.keys(source);
|
|
164
|
+
var key, i;
|
|
165
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
166
|
+
key = sourceKeys[i];
|
|
167
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
168
|
+
target[key] = source[key];
|
|
169
|
+
}
|
|
170
|
+
return target;
|
|
171
|
+
}
|
|
172
|
+
function _sliced_to_array(arr, i) {
|
|
173
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
174
|
+
}
|
|
175
|
+
function _to_consumable_array(arr) {
|
|
176
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
177
|
+
}
|
|
178
|
+
function _type_of(obj) {
|
|
179
|
+
"@swc/helpers - typeof";
|
|
180
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
181
|
+
}
|
|
182
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
183
|
+
if (!o) return;
|
|
184
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
185
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
186
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
187
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
188
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
189
|
+
}
|
|
190
|
+
function _ts_generator(thisArg, body) {
|
|
191
|
+
var f, y, t, g, _ = {
|
|
192
|
+
label: 0,
|
|
193
|
+
sent: function() {
|
|
194
|
+
if (t[0] & 1) throw t[1];
|
|
195
|
+
return t[1];
|
|
196
|
+
},
|
|
197
|
+
trys: [],
|
|
198
|
+
ops: []
|
|
199
|
+
};
|
|
200
|
+
return g = {
|
|
201
|
+
next: verb(0),
|
|
202
|
+
"throw": verb(1),
|
|
203
|
+
"return": verb(2)
|
|
204
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
205
|
+
return this;
|
|
206
|
+
}), g;
|
|
207
|
+
function verb(n) {
|
|
208
|
+
return function(v) {
|
|
209
|
+
return step([
|
|
210
|
+
n,
|
|
211
|
+
v
|
|
212
|
+
]);
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function step(op) {
|
|
216
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
217
|
+
while(_)try {
|
|
218
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
219
|
+
if (y = 0, t) op = [
|
|
220
|
+
op[0] & 2,
|
|
221
|
+
t.value
|
|
222
|
+
];
|
|
223
|
+
switch(op[0]){
|
|
224
|
+
case 0:
|
|
225
|
+
case 1:
|
|
226
|
+
t = op;
|
|
227
|
+
break;
|
|
228
|
+
case 4:
|
|
229
|
+
_.label++;
|
|
230
|
+
return {
|
|
231
|
+
value: op[1],
|
|
232
|
+
done: false
|
|
233
|
+
};
|
|
234
|
+
case 5:
|
|
235
|
+
_.label++;
|
|
236
|
+
y = op[1];
|
|
237
|
+
op = [
|
|
238
|
+
0
|
|
239
|
+
];
|
|
240
|
+
continue;
|
|
241
|
+
case 7:
|
|
242
|
+
op = _.ops.pop();
|
|
243
|
+
_.trys.pop();
|
|
244
|
+
continue;
|
|
245
|
+
default:
|
|
246
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
247
|
+
_ = 0;
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
251
|
+
_.label = op[1];
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
255
|
+
_.label = t[1];
|
|
256
|
+
t = op;
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
if (t && _.label < t[2]) {
|
|
260
|
+
_.label = t[2];
|
|
261
|
+
_.ops.push(op);
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
if (t[2]) _.ops.pop();
|
|
265
|
+
_.trys.pop();
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
op = body.call(thisArg, _);
|
|
269
|
+
} catch (e) {
|
|
270
|
+
op = [
|
|
271
|
+
6,
|
|
272
|
+
e
|
|
273
|
+
];
|
|
274
|
+
y = 0;
|
|
275
|
+
} finally{
|
|
276
|
+
f = t = 0;
|
|
277
|
+
}
|
|
278
|
+
if (op[0] & 5) throw op[1];
|
|
279
|
+
return {
|
|
280
|
+
value: op[0] ? op[1] : void 0,
|
|
281
|
+
done: true
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
var __create = Object.create;
|
|
286
|
+
var __defProp = Object.defineProperty;
|
|
287
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
288
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
289
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
290
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
291
|
+
var __export = function(target, all) {
|
|
292
|
+
for(var name in all)__defProp(target, name, {
|
|
293
|
+
get: all[name],
|
|
294
|
+
enumerable: true
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
var __copyProps = function(to, from, except, desc) {
|
|
298
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
299
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
300
|
+
try {
|
|
301
|
+
var _loop = function() {
|
|
302
|
+
var key = _step.value;
|
|
303
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
304
|
+
get: function() {
|
|
305
|
+
return from[key];
|
|
306
|
+
},
|
|
307
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
308
|
+
});
|
|
309
|
+
};
|
|
310
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
311
|
+
} catch (err) {
|
|
312
|
+
_didIteratorError = true;
|
|
313
|
+
_iteratorError = err;
|
|
314
|
+
} finally{
|
|
315
|
+
try {
|
|
316
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
317
|
+
_iterator.return();
|
|
318
|
+
}
|
|
319
|
+
} finally{
|
|
320
|
+
if (_didIteratorError) {
|
|
321
|
+
throw _iteratorError;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return to;
|
|
327
|
+
};
|
|
328
|
+
var __toESM = function(mod, isNodeMode, target) {
|
|
329
|
+
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
330
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
331
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
332
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
333
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
334
|
+
value: mod,
|
|
335
|
+
enumerable: true
|
|
336
|
+
}) : target, mod);
|
|
337
|
+
};
|
|
338
|
+
var __toCommonJS = function(mod) {
|
|
339
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
340
|
+
value: true
|
|
341
|
+
}), mod);
|
|
342
|
+
};
|
|
343
|
+
// src/components/genui/index.ts
|
|
344
|
+
var genui_exports = {};
|
|
345
|
+
__export(genui_exports, {
|
|
346
|
+
A2uiRenderer: function() {
|
|
347
|
+
return A2uiRenderer;
|
|
348
|
+
},
|
|
349
|
+
AssistantChat: function() {
|
|
350
|
+
return AssistantChat;
|
|
351
|
+
},
|
|
352
|
+
coreUiRegistry: function() {
|
|
353
|
+
return coreUiRegistry;
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
module.exports = __toCommonJS(genui_exports);
|
|
357
|
+
// src/components/genui/renderer.tsx
|
|
358
|
+
var React = __toESM(require("react"));
|
|
359
|
+
var import_genui = require("@alquimia-ai/tools/genui");
|
|
360
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
361
|
+
function A2uiRenderer(param) {
|
|
362
|
+
var surface = param.surface, registry = param.registry, onAgentAction = param.onAgentAction, onLocalAction = param.onLocalAction;
|
|
363
|
+
var _surface_dataModel;
|
|
364
|
+
var _React_useState = _sliced_to_array(React.useState((_surface_dataModel = surface.dataModel) !== null && _surface_dataModel !== void 0 ? _surface_dataModel : {}), 2), model = _React_useState[0], setModel = _React_useState[1];
|
|
365
|
+
React.useEffect(function() {
|
|
366
|
+
var _surface_dataModel;
|
|
367
|
+
setModel((_surface_dataModel = surface.dataModel) !== null && _surface_dataModel !== void 0 ? _surface_dataModel : {});
|
|
368
|
+
}, [
|
|
369
|
+
surface.surfaceId
|
|
370
|
+
]);
|
|
371
|
+
var byId = React.useMemo(function() {
|
|
372
|
+
var m = /* @__PURE__ */ new Map();
|
|
373
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
374
|
+
try {
|
|
375
|
+
for(var _iterator = surface.components[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
376
|
+
var c = _step.value;
|
|
377
|
+
m.set(c.id, c);
|
|
378
|
+
}
|
|
379
|
+
} catch (err) {
|
|
380
|
+
_didIteratorError = true;
|
|
381
|
+
_iteratorError = err;
|
|
382
|
+
} finally{
|
|
383
|
+
try {
|
|
384
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
385
|
+
_iterator.return();
|
|
386
|
+
}
|
|
387
|
+
} finally{
|
|
388
|
+
if (_didIteratorError) {
|
|
389
|
+
throw _iteratorError;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return m;
|
|
394
|
+
}, [
|
|
395
|
+
surface
|
|
396
|
+
]);
|
|
397
|
+
var emitAction = function(node, action) {
|
|
398
|
+
var kind = (0, import_genui.classifyAction)(action);
|
|
399
|
+
var ui = {
|
|
400
|
+
surfaceId: surface.surfaceId,
|
|
401
|
+
componentId: node.id,
|
|
402
|
+
action: action.name,
|
|
403
|
+
kind: kind,
|
|
404
|
+
payload: kind === "agent-bound" ? model : void 0
|
|
405
|
+
};
|
|
406
|
+
if (kind === "agent-bound") onAgentAction(ui);
|
|
407
|
+
else onLocalAction === null || onLocalAction === void 0 ? void 0 : onLocalAction(ui);
|
|
408
|
+
};
|
|
409
|
+
var renderNode = function(id, seen) {
|
|
410
|
+
if (seen.has(id)) return null;
|
|
411
|
+
var node = byId.get(id);
|
|
412
|
+
if (!node) return null;
|
|
413
|
+
var nextSeen = new Set(seen).add(id);
|
|
414
|
+
var _node_children;
|
|
415
|
+
var childIds = (_node_children = node.children) !== null && _node_children !== void 0 ? _node_children : node.child ? [
|
|
416
|
+
node.child
|
|
417
|
+
] : [];
|
|
418
|
+
var children = childIds.map(function(cid) {
|
|
419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(React.Fragment, {
|
|
420
|
+
children: renderNode(cid, nextSeen)
|
|
421
|
+
}, cid);
|
|
422
|
+
});
|
|
423
|
+
var Comp = registry[node.component];
|
|
424
|
+
if (!Comp) {
|
|
425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
426
|
+
className: "text-muted-foreground text-sm",
|
|
427
|
+
"data-a2ui-fallback": node.component,
|
|
428
|
+
children: [
|
|
429
|
+
"[unsupported component: ",
|
|
430
|
+
node.component,
|
|
431
|
+
"]"
|
|
432
|
+
]
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
var _node_binding;
|
|
436
|
+
var boundPath = (_node_binding = node.binding) !== null && _node_binding !== void 0 ? _node_binding : (0, import_genui.isPathRef)(node.value) ? node.value.path : void 0;
|
|
437
|
+
var value = boundPath !== void 0 ? (0, import_genui.getPointer)(model, boundPath) : node.value !== void 0 ? (0, import_genui.resolveDynamic)(node.value, model) : void 0;
|
|
438
|
+
var onChange = boundPath !== void 0 ? function(v) {
|
|
439
|
+
return setModel(function(m) {
|
|
440
|
+
return (0, import_genui.setPointer)(m, boundPath, v);
|
|
441
|
+
});
|
|
442
|
+
} : void 0;
|
|
443
|
+
var onAction = node.action ? function(a) {
|
|
444
|
+
return emitAction(node, a);
|
|
445
|
+
} : void 0;
|
|
446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, {
|
|
447
|
+
node: node,
|
|
448
|
+
value: value,
|
|
449
|
+
onChange: onChange,
|
|
450
|
+
onAction: onAction,
|
|
451
|
+
children: children.length ? children : void 0
|
|
452
|
+
});
|
|
453
|
+
};
|
|
454
|
+
var rootId = byId.has("root") ? "root" : surface.root;
|
|
455
|
+
if (!rootId) return null;
|
|
456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
457
|
+
children: renderNode(rootId, /* @__PURE__ */ new Set())
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
// src/components/genui/components/layout.tsx
|
|
461
|
+
var React6 = __toESM(require("react"));
|
|
462
|
+
// src/lib/utils.ts
|
|
463
|
+
var import_clsx = require("clsx");
|
|
464
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
465
|
+
function cn() {
|
|
466
|
+
for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
467
|
+
inputs[_key] = arguments[_key];
|
|
468
|
+
}
|
|
469
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
470
|
+
}
|
|
471
|
+
function hasToolResult(data) {
|
|
472
|
+
var _data_tool_output;
|
|
473
|
+
return (data === null || data === void 0 ? void 0 : (_data_tool_output = data.tool_output) === null || _data_tool_output === void 0 ? void 0 : _data_tool_output.result) && Object.keys(data.tool_output.result).length > 0;
|
|
474
|
+
}
|
|
475
|
+
function getErrorMessage(error_code) {
|
|
476
|
+
switch(error_code){
|
|
477
|
+
case "STREAM_ERROR":
|
|
478
|
+
return "Connection lost. Please try again.";
|
|
479
|
+
case "REQUEST_ERROR":
|
|
480
|
+
return "There was a problem with your request. Please try again.";
|
|
481
|
+
case "401":
|
|
482
|
+
case "403":
|
|
483
|
+
return "You are not authorized. Please try again.";
|
|
484
|
+
case "404":
|
|
485
|
+
return "Resource not found.";
|
|
486
|
+
case "500":
|
|
487
|
+
return "Server error. Please try again later.";
|
|
488
|
+
default:
|
|
489
|
+
return "We have an internal error, please try again later.";
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
// src/components/genui/style-props.ts
|
|
493
|
+
var TONE = {
|
|
494
|
+
default: "text-foreground",
|
|
495
|
+
muted: "text-muted-foreground",
|
|
496
|
+
primary: "text-primary",
|
|
497
|
+
success: "text-emerald-600 dark:text-emerald-400",
|
|
498
|
+
warning: "text-amber-600 dark:text-amber-400",
|
|
499
|
+
danger: "text-destructive"
|
|
500
|
+
};
|
|
501
|
+
var SIZE = {
|
|
502
|
+
sm: "text-sm",
|
|
503
|
+
md: "text-base",
|
|
504
|
+
lg: "text-lg"
|
|
505
|
+
};
|
|
506
|
+
var ALIGN = {
|
|
507
|
+
start: "text-left",
|
|
508
|
+
center: "text-center",
|
|
509
|
+
end: "text-right"
|
|
510
|
+
};
|
|
511
|
+
var DENSITY = {
|
|
512
|
+
compact: "gap-2",
|
|
513
|
+
comfortable: "gap-4"
|
|
514
|
+
};
|
|
515
|
+
function styleProps(node) {
|
|
516
|
+
return cn(typeof node.tone === "string" ? TONE[node.tone] : void 0, typeof node.size === "string" ? SIZE[node.size] : void 0, typeof node.align === "string" ? ALIGN[node.align] : void 0, typeof node.density === "string" ? DENSITY[node.density] : void 0, node.emphasis === "high" ? "font-semibold" : node.emphasis === "medium" ? "font-medium" : void 0);
|
|
517
|
+
}
|
|
518
|
+
// src/components/atoms/ui/card.tsx
|
|
519
|
+
var React2 = __toESM(require("react"));
|
|
520
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
521
|
+
var Card = React2.forwardRef(function(_param, ref) {
|
|
522
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
523
|
+
"className"
|
|
524
|
+
]);
|
|
525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", _object_spread({
|
|
526
|
+
ref: ref,
|
|
527
|
+
className: cn("rounded-lg", " border", "bg-card", "text-card-foreground", "shadow-raised", className)
|
|
528
|
+
}, props));
|
|
529
|
+
});
|
|
530
|
+
Card.displayName = "Card";
|
|
531
|
+
var CardHeader = React2.forwardRef(function(_param, ref) {
|
|
532
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
533
|
+
"className"
|
|
534
|
+
]);
|
|
535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", _object_spread({
|
|
536
|
+
ref: ref,
|
|
537
|
+
className: cn("flex flex-col space-y-1.5 p-6", className)
|
|
538
|
+
}, props));
|
|
539
|
+
});
|
|
540
|
+
CardHeader.displayName = "CardHeader";
|
|
541
|
+
var CardTitle = React2.forwardRef(function(_param, ref) {
|
|
542
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
543
|
+
"className"
|
|
544
|
+
]);
|
|
545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", _object_spread({
|
|
546
|
+
ref: ref,
|
|
547
|
+
className: cn("alq--typography-heading4", className)
|
|
548
|
+
}, props));
|
|
549
|
+
});
|
|
550
|
+
CardTitle.displayName = "CardTitle";
|
|
551
|
+
var CardDescription = React2.forwardRef(function(_param, ref) {
|
|
552
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
553
|
+
"className"
|
|
554
|
+
]);
|
|
555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", _object_spread({
|
|
556
|
+
ref: ref,
|
|
557
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
558
|
+
}, props));
|
|
559
|
+
});
|
|
560
|
+
CardDescription.displayName = "CardDescription";
|
|
561
|
+
var CardContent = React2.forwardRef(function(_param, ref) {
|
|
562
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
563
|
+
"className"
|
|
564
|
+
]);
|
|
565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", _object_spread({
|
|
566
|
+
ref: ref,
|
|
567
|
+
className: cn("p-6 pt-0", className)
|
|
568
|
+
}, props));
|
|
569
|
+
});
|
|
570
|
+
CardContent.displayName = "CardContent";
|
|
571
|
+
var CardFooter = React2.forwardRef(function(_param, ref) {
|
|
572
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
573
|
+
"className"
|
|
574
|
+
]);
|
|
575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", _object_spread({
|
|
576
|
+
ref: ref,
|
|
577
|
+
className: cn("flex items-center p-6 pt-0", className)
|
|
578
|
+
}, props));
|
|
579
|
+
});
|
|
580
|
+
CardFooter.displayName = "CardFooter";
|
|
581
|
+
// src/components/atoms/ui/separator.tsx
|
|
582
|
+
var React3 = __toESM(require("react"));
|
|
583
|
+
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
584
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
585
|
+
var Separator = React3.forwardRef(function(_param, ref) {
|
|
586
|
+
var className = _param.className, _param_orientation = _param.orientation, orientation = _param_orientation === void 0 ? "horizontal" : _param_orientation, _param_decorative = _param.decorative, decorative = _param_decorative === void 0 ? true : _param_decorative, props = _object_without_properties(_param, [
|
|
587
|
+
"className",
|
|
588
|
+
"orientation",
|
|
589
|
+
"decorative"
|
|
590
|
+
]);
|
|
591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SeparatorPrimitive.Root, _object_spread({
|
|
592
|
+
ref: ref,
|
|
593
|
+
decorative: decorative,
|
|
594
|
+
orientation: orientation,
|
|
595
|
+
className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className, "alq--separator")
|
|
596
|
+
}, props));
|
|
597
|
+
});
|
|
598
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
599
|
+
// src/components/atoms/ui/tabs.tsx
|
|
600
|
+
var React4 = __toESM(require("react"));
|
|
601
|
+
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"));
|
|
602
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
603
|
+
var Tabs = TabsPrimitive.Root;
|
|
604
|
+
var TabsList = React4.forwardRef(function(_param, ref) {
|
|
605
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
606
|
+
"className"
|
|
607
|
+
]);
|
|
608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TabsPrimitive.List, _object_spread({
|
|
609
|
+
ref: ref,
|
|
610
|
+
className: cn("inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground", className, "alq--tabs")
|
|
611
|
+
}, props));
|
|
612
|
+
});
|
|
613
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
614
|
+
var TabsTrigger = React4.forwardRef(function(_param, ref) {
|
|
615
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
616
|
+
"className"
|
|
617
|
+
]);
|
|
618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TabsPrimitive.Trigger, _object_spread({
|
|
619
|
+
ref: ref,
|
|
620
|
+
className: cn("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:border-b-2 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:text-foreground data-[state=active]:shadow-sm", className)
|
|
621
|
+
}, props));
|
|
622
|
+
});
|
|
623
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
624
|
+
var TabsContent = React4.forwardRef(function(_param, ref) {
|
|
625
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
626
|
+
"className"
|
|
627
|
+
]);
|
|
628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TabsPrimitive.Content, _object_spread({
|
|
629
|
+
ref: ref,
|
|
630
|
+
className: cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className)
|
|
631
|
+
}, props));
|
|
632
|
+
});
|
|
633
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
634
|
+
// src/components/atoms/ui/accordion.tsx
|
|
635
|
+
var React5 = __toESM(require("react"));
|
|
636
|
+
var AccordionPrimitive = __toESM(require("@radix-ui/react-accordion"));
|
|
637
|
+
var import_lucide_react = require("lucide-react");
|
|
638
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
639
|
+
var Accordion = AccordionPrimitive.Root;
|
|
640
|
+
var AccordionItem = React5.forwardRef(function(_param, ref) {
|
|
641
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
642
|
+
"className"
|
|
643
|
+
]);
|
|
644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AccordionPrimitive.Item, _object_spread({
|
|
645
|
+
ref: ref,
|
|
646
|
+
className: cn("border-b", className)
|
|
647
|
+
}, props));
|
|
648
|
+
});
|
|
649
|
+
AccordionItem.displayName = "AccordionItem";
|
|
650
|
+
var AccordionTrigger = React5.forwardRef(function(_param, ref) {
|
|
651
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
652
|
+
"className",
|
|
653
|
+
"children"
|
|
654
|
+
]);
|
|
655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AccordionPrimitive.Header, {
|
|
656
|
+
className: "flex",
|
|
657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(AccordionPrimitive.Trigger, _object_spread_props(_object_spread({
|
|
658
|
+
ref: ref,
|
|
659
|
+
className: cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className)
|
|
660
|
+
}, props), {
|
|
661
|
+
children: [
|
|
662
|
+
children,
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.ChevronDown, {
|
|
664
|
+
className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"
|
|
665
|
+
})
|
|
666
|
+
]
|
|
667
|
+
}))
|
|
668
|
+
});
|
|
669
|
+
});
|
|
670
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
671
|
+
var AccordionContent = React5.forwardRef(function(_param, ref) {
|
|
672
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
673
|
+
"className",
|
|
674
|
+
"children"
|
|
675
|
+
]);
|
|
676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AccordionPrimitive.Content, _object_spread_props(_object_spread({
|
|
677
|
+
ref: ref,
|
|
678
|
+
className: "overflow-hidden text-sm text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
679
|
+
}, props), {
|
|
680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", {
|
|
681
|
+
className: cn("pb-4 pt-0", className),
|
|
682
|
+
children: children
|
|
683
|
+
})
|
|
684
|
+
}));
|
|
685
|
+
});
|
|
686
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
687
|
+
// src/components/genui/components/layout.tsx
|
|
688
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
689
|
+
var gapClass = function(g) {
|
|
690
|
+
return g === "lg" ? "gap-6" : g === "sm" ? "gap-2" : "gap-4";
|
|
691
|
+
};
|
|
692
|
+
var Stack = function(param) {
|
|
693
|
+
var node = param.node, children = param.children;
|
|
694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
695
|
+
className: cn("flex", node.direction === "horizontal" ? "flex-row" : "flex-col", gapClass(node.gap), styleProps(node)),
|
|
696
|
+
children: children
|
|
697
|
+
});
|
|
698
|
+
};
|
|
699
|
+
var Row = function(param) {
|
|
700
|
+
var node = param.node, children = param.children;
|
|
701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
702
|
+
className: cn("flex flex-row", node.wrap ? "flex-wrap" : "", gapClass(node.gap), styleProps(node)),
|
|
703
|
+
children: children
|
|
704
|
+
});
|
|
705
|
+
};
|
|
706
|
+
var Column = function(param) {
|
|
707
|
+
var node = param.node, children = param.children;
|
|
708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
709
|
+
className: cn("flex flex-col", gapClass(node.gap), styleProps(node)),
|
|
710
|
+
children: children
|
|
711
|
+
});
|
|
712
|
+
};
|
|
713
|
+
var Grid = function(param) {
|
|
714
|
+
var node = param.node, children = param.children;
|
|
715
|
+
var cols = typeof node.columns === "number" ? Math.min(Math.max(node.columns, 1), 6) : 2;
|
|
716
|
+
var colClass = [
|
|
717
|
+
"",
|
|
718
|
+
"grid-cols-1",
|
|
719
|
+
"grid-cols-2",
|
|
720
|
+
"grid-cols-3",
|
|
721
|
+
"grid-cols-4",
|
|
722
|
+
"grid-cols-5",
|
|
723
|
+
"grid-cols-6"
|
|
724
|
+
][cols];
|
|
725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
726
|
+
className: cn("grid", colClass, gapClass(node.gap), styleProps(node)),
|
|
727
|
+
children: children
|
|
728
|
+
});
|
|
729
|
+
};
|
|
730
|
+
var Divider = function(param) {
|
|
731
|
+
var node = param.node;
|
|
732
|
+
return typeof node.label === "string" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", {
|
|
733
|
+
className: "flex items-center gap-3 text-xs text-muted-foreground",
|
|
734
|
+
children: [
|
|
735
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Separator, {
|
|
736
|
+
className: "flex-1"
|
|
737
|
+
}),
|
|
738
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
|
|
739
|
+
children: node.label
|
|
740
|
+
}),
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Separator, {
|
|
742
|
+
className: "flex-1"
|
|
743
|
+
})
|
|
744
|
+
]
|
|
745
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Separator, {});
|
|
746
|
+
};
|
|
747
|
+
var Spacer = function(param) {
|
|
748
|
+
var node = param.node;
|
|
749
|
+
var h = node.size === "lg" ? "h-8" : node.size === "sm" ? "h-2" : "h-4";
|
|
750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
751
|
+
className: h,
|
|
752
|
+
"aria-hidden": true
|
|
753
|
+
});
|
|
754
|
+
};
|
|
755
|
+
var CardNode = function(param) {
|
|
756
|
+
var node = param.node, children = param.children;
|
|
757
|
+
var variant = node.variant === "ghost" ? "border-transparent shadow-none bg-transparent" : node.variant === "outline" ? "shadow-none" : "";
|
|
758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Card, {
|
|
759
|
+
className: cn(variant, styleProps(node)),
|
|
760
|
+
children: [
|
|
761
|
+
(typeof node.title === "string" || typeof node.description === "string") && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(CardHeader, {
|
|
762
|
+
children: [
|
|
763
|
+
typeof node.title === "string" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CardTitle, {
|
|
764
|
+
children: node.title
|
|
765
|
+
}),
|
|
766
|
+
typeof node.description === "string" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CardDescription, {
|
|
767
|
+
children: node.description
|
|
768
|
+
})
|
|
769
|
+
]
|
|
770
|
+
}),
|
|
771
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CardContent, {
|
|
772
|
+
children: children
|
|
773
|
+
})
|
|
774
|
+
]
|
|
775
|
+
});
|
|
776
|
+
};
|
|
777
|
+
var TabsNode = function(param) {
|
|
778
|
+
var node = param.node, children = param.children;
|
|
779
|
+
var _tabs_;
|
|
780
|
+
var tabs = Array.isArray(node.tabs) ? node.tabs : [];
|
|
781
|
+
var kids = React6.Children.toArray(children);
|
|
782
|
+
if (!tabs.length) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
|
|
783
|
+
children: children
|
|
784
|
+
});
|
|
785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Tabs, {
|
|
786
|
+
defaultValue: (_tabs_ = tabs[0]) === null || _tabs_ === void 0 ? void 0 : _tabs_.value,
|
|
787
|
+
className: cn(styleProps(node)),
|
|
788
|
+
children: [
|
|
789
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsList, {
|
|
790
|
+
children: tabs.map(function(t) {
|
|
791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, {
|
|
792
|
+
value: t.value,
|
|
793
|
+
children: t.label
|
|
794
|
+
}, t.value);
|
|
795
|
+
})
|
|
796
|
+
}),
|
|
797
|
+
tabs.map(function(t, i) {
|
|
798
|
+
var _kids_i;
|
|
799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, {
|
|
800
|
+
value: t.value,
|
|
801
|
+
children: (_kids_i = kids[i]) !== null && _kids_i !== void 0 ? _kids_i : null
|
|
802
|
+
}, t.value);
|
|
803
|
+
})
|
|
804
|
+
]
|
|
805
|
+
});
|
|
806
|
+
};
|
|
807
|
+
var AccordionNode = function(param) {
|
|
808
|
+
var node = param.node, children = param.children;
|
|
809
|
+
var items = Array.isArray(node.items) ? node.items : [];
|
|
810
|
+
var kids = React6.Children.toArray(children);
|
|
811
|
+
if (!items.length) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
812
|
+
className: cn("flex flex-col gap-2", styleProps(node)),
|
|
813
|
+
children: children
|
|
814
|
+
});
|
|
815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Accordion, {
|
|
816
|
+
type: "single",
|
|
817
|
+
collapsible: true,
|
|
818
|
+
className: cn("rounded-md border border-border px-4", styleProps(node)),
|
|
819
|
+
children: items.map(function(it, i) {
|
|
820
|
+
var _kids_i;
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(AccordionItem, {
|
|
822
|
+
value: it.value,
|
|
823
|
+
children: [
|
|
824
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AccordionTrigger, {
|
|
825
|
+
children: it.title
|
|
826
|
+
}),
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AccordionContent, {
|
|
828
|
+
children: (_kids_i = kids[i]) !== null && _kids_i !== void 0 ? _kids_i : null
|
|
829
|
+
})
|
|
830
|
+
]
|
|
831
|
+
}, it.value);
|
|
832
|
+
})
|
|
833
|
+
});
|
|
834
|
+
};
|
|
835
|
+
// src/components/genui/components/content.tsx
|
|
836
|
+
var React9 = __toESM(require("react"));
|
|
837
|
+
var import_lucide_react2 = require("lucide-react");
|
|
838
|
+
// src/components/atoms/ui/alert.tsx
|
|
839
|
+
var React7 = __toESM(require("react"));
|
|
840
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
841
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
842
|
+
var alertVariants = (0, import_class_variance_authority.cva)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", {
|
|
843
|
+
variants: {
|
|
844
|
+
variant: {
|
|
845
|
+
default: "bg-background text-foreground",
|
|
846
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
defaultVariants: {
|
|
850
|
+
variant: "default"
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
var Alert = React7.forwardRef(function(_param, ref) {
|
|
854
|
+
var className = _param.className, variant = _param.variant, props = _object_without_properties(_param, [
|
|
855
|
+
"className",
|
|
856
|
+
"variant"
|
|
857
|
+
]);
|
|
858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", _object_spread({
|
|
859
|
+
ref: ref,
|
|
860
|
+
role: "alert",
|
|
861
|
+
className: cn(alertVariants({
|
|
862
|
+
variant: variant
|
|
863
|
+
}), className)
|
|
864
|
+
}, props));
|
|
865
|
+
});
|
|
866
|
+
Alert.displayName = "Alert";
|
|
867
|
+
var AlertTitle = React7.forwardRef(function(_param, ref) {
|
|
868
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
869
|
+
"className"
|
|
870
|
+
]);
|
|
871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h5", _object_spread({
|
|
872
|
+
ref: ref,
|
|
873
|
+
className: cn("mb-1 font-medium leading-none tracking-tight", className)
|
|
874
|
+
}, props));
|
|
875
|
+
});
|
|
876
|
+
AlertTitle.displayName = "AlertTitle";
|
|
877
|
+
var AlertDescription = React7.forwardRef(function(_param, ref) {
|
|
878
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
879
|
+
"className"
|
|
880
|
+
]);
|
|
881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", _object_spread({
|
|
882
|
+
ref: ref,
|
|
883
|
+
className: cn("text-sm [&_p]:leading-relaxed", className)
|
|
884
|
+
}, props));
|
|
885
|
+
});
|
|
886
|
+
AlertDescription.displayName = "AlertDescription";
|
|
887
|
+
// src/components/atoms/ui/badge.tsx
|
|
888
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
889
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
890
|
+
var badgeVariants = (0, import_class_variance_authority2.cva)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
891
|
+
variants: {
|
|
892
|
+
variant: {
|
|
893
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
894
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
895
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
896
|
+
outline: "text-foreground"
|
|
897
|
+
}
|
|
898
|
+
},
|
|
899
|
+
defaultVariants: {
|
|
900
|
+
variant: "default"
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
function Badge(_param) {
|
|
904
|
+
var className = _param.className, variant = _param.variant, props = _object_without_properties(_param, [
|
|
905
|
+
"className",
|
|
906
|
+
"variant"
|
|
907
|
+
]);
|
|
908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", _object_spread({
|
|
909
|
+
className: cn(badgeVariants({
|
|
910
|
+
variant: variant
|
|
911
|
+
}), className, "alq--badge")
|
|
912
|
+
}, props));
|
|
913
|
+
}
|
|
914
|
+
// src/components/atoms/ui/avatar.tsx
|
|
915
|
+
var React8 = __toESM(require("react"));
|
|
916
|
+
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
917
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
918
|
+
var Avatar = React8.forwardRef(function(_param, ref) {
|
|
919
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
920
|
+
"className"
|
|
921
|
+
]);
|
|
922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AvatarPrimitive.Root, _object_spread({
|
|
923
|
+
ref: ref,
|
|
924
|
+
className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className)
|
|
925
|
+
}, props));
|
|
926
|
+
});
|
|
927
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
928
|
+
var AvatarImage = React8.forwardRef(function(_param, ref) {
|
|
929
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
930
|
+
"className"
|
|
931
|
+
]);
|
|
932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AvatarPrimitive.Image, _object_spread({
|
|
933
|
+
ref: ref,
|
|
934
|
+
className: cn("aspect-square h-full w-full", className)
|
|
935
|
+
}, props));
|
|
936
|
+
});
|
|
937
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
938
|
+
var AvatarFallback = React8.forwardRef(function(_param, ref) {
|
|
939
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
940
|
+
"className"
|
|
941
|
+
]);
|
|
942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AvatarPrimitive.Fallback, _object_spread({
|
|
943
|
+
ref: ref,
|
|
944
|
+
className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className)
|
|
945
|
+
}, props));
|
|
946
|
+
});
|
|
947
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
948
|
+
// src/components/atoms/ui/rich-text.tsx
|
|
949
|
+
var import_react_markdown = __toESM(require("react-markdown"));
|
|
950
|
+
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
951
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
952
|
+
function RichText(param) {
|
|
953
|
+
var content = param.content, className = param.className;
|
|
954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_markdown.default, {
|
|
955
|
+
className: cn(className),
|
|
956
|
+
remarkPlugins: [
|
|
957
|
+
import_remark_gfm.default
|
|
958
|
+
],
|
|
959
|
+
children: content
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
// src/components/genui/components/content.tsx
|
|
963
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
964
|
+
var SAFE_IMG = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i;
|
|
965
|
+
var Text = function(param) {
|
|
966
|
+
var node = param.node;
|
|
967
|
+
var variant = node.variant === "muted" || node.variant === "caption" ? "text-muted-foreground" : "text-foreground";
|
|
968
|
+
var size = node.variant === "lead" ? "text-lg" : node.variant === "caption" ? "text-xs" : "";
|
|
969
|
+
var _node_text;
|
|
970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", {
|
|
971
|
+
className: cn(variant, size, styleProps(node)),
|
|
972
|
+
children: String((_node_text = node.text) !== null && _node_text !== void 0 ? _node_text : "")
|
|
973
|
+
});
|
|
974
|
+
};
|
|
975
|
+
var Heading = function(param) {
|
|
976
|
+
var node = param.node;
|
|
977
|
+
var level = typeof node.level === "number" ? Math.min(Math.max(node.level, 1), 4) : 1;
|
|
978
|
+
var Tag = [
|
|
979
|
+
"h1",
|
|
980
|
+
"h2",
|
|
981
|
+
"h3",
|
|
982
|
+
"h4"
|
|
983
|
+
][level - 1];
|
|
984
|
+
var size = [
|
|
985
|
+
"text-2xl",
|
|
986
|
+
"text-xl",
|
|
987
|
+
"text-lg",
|
|
988
|
+
"text-base"
|
|
989
|
+
][level - 1];
|
|
990
|
+
var _node_text;
|
|
991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Tag, {
|
|
992
|
+
className: cn("font-semibold text-foreground", size, styleProps(node)),
|
|
993
|
+
children: String((_node_text = node.text) !== null && _node_text !== void 0 ? _node_text : "")
|
|
994
|
+
});
|
|
995
|
+
};
|
|
996
|
+
var Markdown = function(param) {
|
|
997
|
+
var node = param.node;
|
|
998
|
+
var _node_text;
|
|
999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RichText, {
|
|
1000
|
+
content: String((_node_text = node.text) !== null && _node_text !== void 0 ? _node_text : ""),
|
|
1001
|
+
className: cn("prose prose-sm dark:prose-invert max-w-none", styleProps(node))
|
|
1002
|
+
});
|
|
1003
|
+
};
|
|
1004
|
+
var ImageNode = function(param) {
|
|
1005
|
+
var node = param.node;
|
|
1006
|
+
var src = typeof node.src === "string" ? node.src : "";
|
|
1007
|
+
if (!SAFE_IMG.test(src)) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {
|
|
1008
|
+
className: "text-muted-foreground text-sm",
|
|
1009
|
+
children: "[image omitted]"
|
|
1010
|
+
});
|
|
1011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", {
|
|
1012
|
+
src: src,
|
|
1013
|
+
alt: typeof node.alt === "string" ? node.alt : "",
|
|
1014
|
+
className: cn("max-w-full rounded-md", styleProps(node))
|
|
1015
|
+
});
|
|
1016
|
+
};
|
|
1017
|
+
var IconNode = function(param) {
|
|
1018
|
+
var node = param.node;
|
|
1019
|
+
var name = typeof node.name === "string" ? node.name : "";
|
|
1020
|
+
var Cmp = import_lucide_react2.icons[name];
|
|
1021
|
+
if (!Cmp) return null;
|
|
1022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Cmp, {
|
|
1023
|
+
className: cn("h-4 w-4", styleProps(node))
|
|
1024
|
+
});
|
|
1025
|
+
};
|
|
1026
|
+
var BADGE_VARIANT = {
|
|
1027
|
+
solid: "default",
|
|
1028
|
+
outline: "outline",
|
|
1029
|
+
subtle: "secondary"
|
|
1030
|
+
};
|
|
1031
|
+
var BadgeNode = function(param) {
|
|
1032
|
+
var node = param.node;
|
|
1033
|
+
var _node_variant, _BADGE_VARIANT_String, _node_text;
|
|
1034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Badge, {
|
|
1035
|
+
variant: (_BADGE_VARIANT_String = BADGE_VARIANT[String((_node_variant = node.variant) !== null && _node_variant !== void 0 ? _node_variant : "solid")]) !== null && _BADGE_VARIANT_String !== void 0 ? _BADGE_VARIANT_String : "default",
|
|
1036
|
+
className: styleProps(node),
|
|
1037
|
+
children: String((_node_text = node.text) !== null && _node_text !== void 0 ? _node_text : "")
|
|
1038
|
+
});
|
|
1039
|
+
};
|
|
1040
|
+
var AvatarNode = function(param) {
|
|
1041
|
+
var node = param.node;
|
|
1042
|
+
var src = typeof node.src === "string" && SAFE_IMG.test(node.src) ? node.src : void 0;
|
|
1043
|
+
var fallback = typeof node.fallback === "string" ? node.fallback.slice(0, 2).toUpperCase() : "?";
|
|
1044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Avatar, {
|
|
1045
|
+
className: styleProps(node),
|
|
1046
|
+
children: [
|
|
1047
|
+
src && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AvatarImage, {
|
|
1048
|
+
src: src
|
|
1049
|
+
}),
|
|
1050
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AvatarFallback, {
|
|
1051
|
+
children: fallback
|
|
1052
|
+
})
|
|
1053
|
+
]
|
|
1054
|
+
});
|
|
1055
|
+
};
|
|
1056
|
+
var ALERT_VARIANT = {
|
|
1057
|
+
info: "default",
|
|
1058
|
+
success: "default",
|
|
1059
|
+
warning: "default",
|
|
1060
|
+
danger: "destructive"
|
|
1061
|
+
};
|
|
1062
|
+
var AlertNode = function(param) {
|
|
1063
|
+
var node = param.node;
|
|
1064
|
+
var _node_variant, _ALERT_VARIANT_String, _node_text;
|
|
1065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Alert, {
|
|
1066
|
+
variant: (_ALERT_VARIANT_String = ALERT_VARIANT[String((_node_variant = node.variant) !== null && _node_variant !== void 0 ? _node_variant : "info")]) !== null && _ALERT_VARIANT_String !== void 0 ? _ALERT_VARIANT_String : "default",
|
|
1067
|
+
className: styleProps(node),
|
|
1068
|
+
children: [
|
|
1069
|
+
typeof node.title === "string" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AlertTitle, {
|
|
1070
|
+
children: node.title
|
|
1071
|
+
}),
|
|
1072
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AlertDescription, {
|
|
1073
|
+
children: String((_node_text = node.text) !== null && _node_text !== void 0 ? _node_text : "")
|
|
1074
|
+
})
|
|
1075
|
+
]
|
|
1076
|
+
});
|
|
1077
|
+
};
|
|
1078
|
+
var Stat = function(param) {
|
|
1079
|
+
var node = param.node;
|
|
1080
|
+
var _node_label;
|
|
1081
|
+
var label = (_node_label = node.label) !== null && _node_label !== void 0 ? _node_label : node.title;
|
|
1082
|
+
var _node_value;
|
|
1083
|
+
var value = (_node_value = node.value) !== null && _node_value !== void 0 ? _node_value : node.text;
|
|
1084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", {
|
|
1085
|
+
className: cn("flex flex-col", styleProps(node)),
|
|
1086
|
+
children: [
|
|
1087
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {
|
|
1088
|
+
className: "text-sm text-muted-foreground",
|
|
1089
|
+
children: String(label)
|
|
1090
|
+
}),
|
|
1091
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {
|
|
1092
|
+
className: "text-2xl font-semibold text-foreground",
|
|
1093
|
+
children: String(value !== null && value !== void 0 ? value : "")
|
|
1094
|
+
}),
|
|
1095
|
+
typeof node.delta === "string" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {
|
|
1096
|
+
className: "text-sm text-muted-foreground",
|
|
1097
|
+
children: node.delta
|
|
1098
|
+
})
|
|
1099
|
+
]
|
|
1100
|
+
});
|
|
1101
|
+
};
|
|
1102
|
+
var KeyValueNode = function(param) {
|
|
1103
|
+
var node = param.node, value = param.value;
|
|
1104
|
+
var src = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" ? value : node.data && _type_of(node.data) === "object" ? node.data : {};
|
|
1105
|
+
var obj = src;
|
|
1106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dl", {
|
|
1107
|
+
className: cn("grid grid-cols-2 gap-x-4 gap-y-1", styleProps(node)),
|
|
1108
|
+
children: Object.entries(obj).map(function(param) {
|
|
1109
|
+
var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
|
|
1110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(React9.Fragment, {
|
|
1111
|
+
children: [
|
|
1112
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", {
|
|
1113
|
+
className: "text-muted-foreground",
|
|
1114
|
+
children: k
|
|
1115
|
+
}),
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", {
|
|
1117
|
+
className: "text-foreground",
|
|
1118
|
+
children: String(v)
|
|
1119
|
+
})
|
|
1120
|
+
]
|
|
1121
|
+
}, k);
|
|
1122
|
+
})
|
|
1123
|
+
});
|
|
1124
|
+
};
|
|
1125
|
+
var ListNode = function(param) {
|
|
1126
|
+
var node = param.node, value = param.value;
|
|
1127
|
+
var items = Array.isArray(value) ? value : Array.isArray(node.items) ? node.items : [];
|
|
1128
|
+
var ordered = node.ordered === true;
|
|
1129
|
+
var Tag = ordered ? "ol" : "ul";
|
|
1130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Tag, {
|
|
1131
|
+
className: cn(ordered ? "list-decimal" : "list-disc", "pl-5", styleProps(node)),
|
|
1132
|
+
children: items.map(function(it, i) {
|
|
1133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", {
|
|
1134
|
+
children: String(it)
|
|
1135
|
+
}, i);
|
|
1136
|
+
})
|
|
1137
|
+
});
|
|
1138
|
+
};
|
|
1139
|
+
var Quote = function(param) {
|
|
1140
|
+
var node = param.node;
|
|
1141
|
+
var _node_text;
|
|
1142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("blockquote", {
|
|
1143
|
+
className: cn("border-l-2 border-border pl-4 italic text-muted-foreground", styleProps(node)),
|
|
1144
|
+
children: [
|
|
1145
|
+
String((_node_text = node.text) !== null && _node_text !== void 0 ? _node_text : ""),
|
|
1146
|
+
typeof node.cite === "string" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("footer", {
|
|
1147
|
+
className: "mt-1 text-xs not-italic",
|
|
1148
|
+
children: [
|
|
1149
|
+
"\u2014 ",
|
|
1150
|
+
node.cite
|
|
1151
|
+
]
|
|
1152
|
+
})
|
|
1153
|
+
]
|
|
1154
|
+
});
|
|
1155
|
+
};
|
|
1156
|
+
// src/components/genui/components/inputs.tsx
|
|
1157
|
+
var React21 = __toESM(require("react"));
|
|
1158
|
+
var import_date_fns = require("date-fns");
|
|
1159
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1160
|
+
// src/components/atoms/ui/input.tsx
|
|
1161
|
+
var import_react = require("react");
|
|
1162
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1163
|
+
var Input = (0, import_react.forwardRef)(function(_param, ref) {
|
|
1164
|
+
var className = _param.className, type = _param.type, props = _object_without_properties(_param, [
|
|
1165
|
+
"className",
|
|
1166
|
+
"type"
|
|
1167
|
+
]);
|
|
1168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", _object_spread({
|
|
1169
|
+
type: type,
|
|
1170
|
+
className: cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className, "alq--input"),
|
|
1171
|
+
ref: ref
|
|
1172
|
+
}, props));
|
|
1173
|
+
});
|
|
1174
|
+
Input.displayName = "Input";
|
|
1175
|
+
// src/components/atoms/ui/textarea.tsx
|
|
1176
|
+
var React10 = __toESM(require("react"));
|
|
1177
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1178
|
+
var Textarea = React10.forwardRef(function(_param, ref) {
|
|
1179
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1180
|
+
"className"
|
|
1181
|
+
]);
|
|
1182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("textarea", _object_spread({
|
|
1183
|
+
className: cn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className, "alq--textarea"),
|
|
1184
|
+
ref: ref
|
|
1185
|
+
}, props));
|
|
1186
|
+
});
|
|
1187
|
+
Textarea.displayName = "Textarea";
|
|
1188
|
+
// src/components/atoms/ui/label.tsx
|
|
1189
|
+
var React11 = __toESM(require("react"));
|
|
1190
|
+
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
1191
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1192
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1193
|
+
var labelVariants = (0, import_class_variance_authority3.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
1194
|
+
var Label = React11.forwardRef(function(_param, ref) {
|
|
1195
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1196
|
+
"className"
|
|
1197
|
+
]);
|
|
1198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LabelPrimitive.Root, _object_spread({
|
|
1199
|
+
ref: ref,
|
|
1200
|
+
className: cn(labelVariants(), className, "alq--label")
|
|
1201
|
+
}, props));
|
|
1202
|
+
});
|
|
1203
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
1204
|
+
// src/components/atoms/ui/checkbox.tsx
|
|
1205
|
+
var React12 = __toESM(require("react"));
|
|
1206
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
1207
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1208
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1209
|
+
var Checkbox = React12.forwardRef(function(_param, ref) {
|
|
1210
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1211
|
+
"className"
|
|
1212
|
+
]);
|
|
1213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CheckboxPrimitive.Root, _object_spread_props(_object_spread({
|
|
1214
|
+
ref: ref,
|
|
1215
|
+
className: cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", className, "alq--checkbox")
|
|
1216
|
+
}, props), {
|
|
1217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CheckboxPrimitive.Indicator, {
|
|
1218
|
+
className: cn("flex items-center justify-center text-current"),
|
|
1219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react3.Check, {
|
|
1220
|
+
className: "h-4 w-4"
|
|
1221
|
+
})
|
|
1222
|
+
})
|
|
1223
|
+
}));
|
|
1224
|
+
});
|
|
1225
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
1226
|
+
// src/components/atoms/ui/switch.tsx
|
|
1227
|
+
var React13 = __toESM(require("react"));
|
|
1228
|
+
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"));
|
|
1229
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1230
|
+
var Switch = React13.forwardRef(function(_param, ref) {
|
|
1231
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1232
|
+
"className"
|
|
1233
|
+
]);
|
|
1234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SwitchPrimitives.Root, _object_spread_props(_object_spread({
|
|
1235
|
+
className: cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className, "alq--switch")
|
|
1236
|
+
}, props), {
|
|
1237
|
+
ref: ref,
|
|
1238
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SwitchPrimitives.Thumb, {
|
|
1239
|
+
className: cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")
|
|
1240
|
+
})
|
|
1241
|
+
}));
|
|
1242
|
+
});
|
|
1243
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
1244
|
+
// src/components/atoms/ui/slider.tsx
|
|
1245
|
+
var React14 = __toESM(require("react"));
|
|
1246
|
+
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"));
|
|
1247
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1248
|
+
var Slider = React14.forwardRef(function(_param, ref) {
|
|
1249
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1250
|
+
"className"
|
|
1251
|
+
]);
|
|
1252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SliderPrimitive.Root, _object_spread_props(_object_spread({
|
|
1253
|
+
ref: ref,
|
|
1254
|
+
className: cn("relative flex w-44 touch-none select-none items-center", className, "alq--slider")
|
|
1255
|
+
}, props), {
|
|
1256
|
+
children: [
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SliderPrimitive.Track, {
|
|
1258
|
+
className: "relative h-2 w-44 grow overflow-hidden rounded-full bg-primary",
|
|
1259
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SliderPrimitive.Range, {
|
|
1260
|
+
className: "absolute h-full bg-secondary"
|
|
1261
|
+
})
|
|
1262
|
+
}),
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SliderPrimitive.Thumb, {
|
|
1264
|
+
className: "block h-5 w-5 rounded-full border-2 border-gray bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
|
1265
|
+
})
|
|
1266
|
+
]
|
|
1267
|
+
}));
|
|
1268
|
+
});
|
|
1269
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
1270
|
+
// src/components/atoms/ui/button.tsx
|
|
1271
|
+
var React15 = __toESM(require("react"));
|
|
1272
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
1273
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
1274
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1275
|
+
var buttonVariants = (0, import_class_variance_authority4.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
1276
|
+
variants: {
|
|
1277
|
+
variant: {
|
|
1278
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
1279
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1280
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
1281
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
1282
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
1283
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
1284
|
+
},
|
|
1285
|
+
size: {
|
|
1286
|
+
default: "h-10 px-4 py-2",
|
|
1287
|
+
sm: "h-9 rounded-md px-3",
|
|
1288
|
+
lg: "h-11 rounded-md px-8",
|
|
1289
|
+
icon: "h-10 w-10"
|
|
1290
|
+
}
|
|
1291
|
+
},
|
|
1292
|
+
defaultVariants: {
|
|
1293
|
+
variant: "default",
|
|
1294
|
+
size: "default"
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
var Button = React15.forwardRef(function(_param, ref) {
|
|
1298
|
+
var className = _param.className, variant = _param.variant, size = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties(_param, [
|
|
1299
|
+
"className",
|
|
1300
|
+
"variant",
|
|
1301
|
+
"size",
|
|
1302
|
+
"asChild"
|
|
1303
|
+
]);
|
|
1304
|
+
var Comp = asChild ? import_react_slot.Slot : "button";
|
|
1305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Comp, _object_spread({
|
|
1306
|
+
className: cn(buttonVariants({
|
|
1307
|
+
variant: variant,
|
|
1308
|
+
size: size,
|
|
1309
|
+
className: className
|
|
1310
|
+
})),
|
|
1311
|
+
ref: ref
|
|
1312
|
+
}, props));
|
|
1313
|
+
});
|
|
1314
|
+
Button.displayName = "Button";
|
|
1315
|
+
// src/components/atoms/ui/calendar.tsx
|
|
1316
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1317
|
+
var import_react_day_picker = require("react-day-picker");
|
|
1318
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1319
|
+
function Calendar(_param) {
|
|
1320
|
+
var className = _param.className, classNames = _param.classNames, _param_showOutsideDays = _param.showOutsideDays, showOutsideDays = _param_showOutsideDays === void 0 ? true : _param_showOutsideDays, props = _object_without_properties(_param, [
|
|
1321
|
+
"className",
|
|
1322
|
+
"classNames",
|
|
1323
|
+
"showOutsideDays"
|
|
1324
|
+
]);
|
|
1325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_day_picker.DayPicker, _object_spread({
|
|
1326
|
+
showOutsideDays: showOutsideDays,
|
|
1327
|
+
className: cn("p-3", className),
|
|
1328
|
+
classNames: _object_spread({
|
|
1329
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
1330
|
+
month: "space-y-4",
|
|
1331
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
1332
|
+
caption_label: "text-sm font-medium",
|
|
1333
|
+
nav: "space-x-1 flex items-center",
|
|
1334
|
+
nav_button: cn(buttonVariants({
|
|
1335
|
+
variant: "outline"
|
|
1336
|
+
}), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),
|
|
1337
|
+
nav_button_previous: "absolute left-1",
|
|
1338
|
+
nav_button_next: "absolute right-1",
|
|
1339
|
+
table: "w-full border-collapse space-y-1",
|
|
1340
|
+
head_row: "flex",
|
|
1341
|
+
head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
1342
|
+
row: "flex w-full mt-2",
|
|
1343
|
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
1344
|
+
day: cn(buttonVariants({
|
|
1345
|
+
variant: "ghost"
|
|
1346
|
+
}), "h-9 w-9 p-0 font-normal aria-selected:opacity-100"),
|
|
1347
|
+
day_range_end: "day-range-end",
|
|
1348
|
+
day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
|
1349
|
+
day_today: "bg-accent text-accent-foreground",
|
|
1350
|
+
day_outside: "day-outside text-muted-foreground opacity-50",
|
|
1351
|
+
day_disabled: "text-muted-foreground opacity-50",
|
|
1352
|
+
day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
1353
|
+
day_hidden: "invisible"
|
|
1354
|
+
}, classNames),
|
|
1355
|
+
components: {
|
|
1356
|
+
IconLeft: function() {
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react4.ChevronLeft, {
|
|
1358
|
+
className: "h-4 w-4"
|
|
1359
|
+
});
|
|
1360
|
+
},
|
|
1361
|
+
IconRight: function() {
|
|
1362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react4.ChevronRight, {
|
|
1363
|
+
className: "h-4 w-4"
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}, props));
|
|
1368
|
+
}
|
|
1369
|
+
Calendar.displayName = "Calendar";
|
|
1370
|
+
// src/components/atoms/ui/radio-group.tsx
|
|
1371
|
+
var React16 = __toESM(require("react"));
|
|
1372
|
+
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"));
|
|
1373
|
+
var import_lucide_react5 = require("lucide-react");
|
|
1374
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1375
|
+
var RadioGroup = React16.forwardRef(function(_param, ref) {
|
|
1376
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1377
|
+
"className"
|
|
1378
|
+
]);
|
|
1379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadioGroupPrimitive.Root, _object_spread({
|
|
1380
|
+
ref: ref,
|
|
1381
|
+
className: cn("grid gap-2", className)
|
|
1382
|
+
}, props));
|
|
1383
|
+
});
|
|
1384
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
1385
|
+
var RadioGroupItem = React16.forwardRef(function(_param, ref) {
|
|
1386
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1387
|
+
"className"
|
|
1388
|
+
]);
|
|
1389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadioGroupPrimitive.Item, _object_spread_props(_object_spread({
|
|
1390
|
+
ref: ref,
|
|
1391
|
+
className: cn("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
1392
|
+
}, props), {
|
|
1393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadioGroupPrimitive.Indicator, {
|
|
1394
|
+
className: "flex items-center justify-center",
|
|
1395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react5.Circle, {
|
|
1396
|
+
className: "h-2.5 w-2.5 fill-current text-current"
|
|
1397
|
+
})
|
|
1398
|
+
})
|
|
1399
|
+
}));
|
|
1400
|
+
});
|
|
1401
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
1402
|
+
// src/components/atoms/ui/popover.tsx
|
|
1403
|
+
var React17 = __toESM(require("react"));
|
|
1404
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
1405
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1406
|
+
var Popover = PopoverPrimitive.Root;
|
|
1407
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1408
|
+
var PopoverContent = React17.forwardRef(function(_param, ref) {
|
|
1409
|
+
var className = _param.className, _param_align = _param.align, align = _param_align === void 0 ? "center" : _param_align, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties(_param, [
|
|
1410
|
+
"className",
|
|
1411
|
+
"align",
|
|
1412
|
+
"sideOffset"
|
|
1413
|
+
]);
|
|
1414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PopoverPrimitive.Portal, {
|
|
1415
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PopoverPrimitive.Content, _object_spread({
|
|
1416
|
+
ref: ref,
|
|
1417
|
+
align: align,
|
|
1418
|
+
sideOffset: sideOffset,
|
|
1419
|
+
className: cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
|
|
1420
|
+
}, props))
|
|
1421
|
+
});
|
|
1422
|
+
});
|
|
1423
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1424
|
+
// src/components/atoms/ui/select.tsx
|
|
1425
|
+
var React18 = __toESM(require("react"));
|
|
1426
|
+
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
1427
|
+
var import_lucide_react6 = require("lucide-react");
|
|
1428
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1429
|
+
var Select = SelectPrimitive.Root;
|
|
1430
|
+
var SelectValue = SelectPrimitive.Value;
|
|
1431
|
+
var SelectTrigger = React18.forwardRef(function(_param, ref) {
|
|
1432
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
1433
|
+
"className",
|
|
1434
|
+
"children"
|
|
1435
|
+
]);
|
|
1436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(SelectPrimitive.Trigger, _object_spread_props(_object_spread({
|
|
1437
|
+
ref: ref,
|
|
1438
|
+
className: cn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className, "alq--select")
|
|
1439
|
+
}, props), {
|
|
1440
|
+
children: [
|
|
1441
|
+
children,
|
|
1442
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.Icon, {
|
|
1443
|
+
asChild: true,
|
|
1444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react6.ChevronDown, {
|
|
1445
|
+
className: "h-4 w-4 opacity-50"
|
|
1446
|
+
})
|
|
1447
|
+
})
|
|
1448
|
+
]
|
|
1449
|
+
}));
|
|
1450
|
+
});
|
|
1451
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1452
|
+
var SelectScrollUpButton = React18.forwardRef(function(_param, ref) {
|
|
1453
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1454
|
+
"className"
|
|
1455
|
+
]);
|
|
1456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.ScrollUpButton, _object_spread_props(_object_spread({
|
|
1457
|
+
ref: ref,
|
|
1458
|
+
className: cn("flex cursor-default items-center justify-center py-1", className)
|
|
1459
|
+
}, props), {
|
|
1460
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react6.ChevronUp, {
|
|
1461
|
+
className: "h-4 w-4"
|
|
1462
|
+
})
|
|
1463
|
+
}));
|
|
1464
|
+
});
|
|
1465
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1466
|
+
var SelectScrollDownButton = React18.forwardRef(function(_param, ref) {
|
|
1467
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1468
|
+
"className"
|
|
1469
|
+
]);
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.ScrollDownButton, _object_spread_props(_object_spread({
|
|
1471
|
+
ref: ref,
|
|
1472
|
+
className: cn("flex cursor-default items-center justify-center py-1", className)
|
|
1473
|
+
}, props), {
|
|
1474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react6.ChevronDown, {
|
|
1475
|
+
className: "h-4 w-4"
|
|
1476
|
+
})
|
|
1477
|
+
}));
|
|
1478
|
+
});
|
|
1479
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1480
|
+
var SelectContent = React18.forwardRef(function(_param, ref) {
|
|
1481
|
+
var className = _param.className, children = _param.children, _param_position = _param.position, position = _param_position === void 0 ? "popper" : _param_position, props = _object_without_properties(_param, [
|
|
1482
|
+
"className",
|
|
1483
|
+
"children",
|
|
1484
|
+
"position"
|
|
1485
|
+
]);
|
|
1486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.Portal, {
|
|
1487
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(SelectPrimitive.Content, _object_spread_props(_object_spread({
|
|
1488
|
+
ref: ref,
|
|
1489
|
+
className: cn("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
1490
|
+
position: position
|
|
1491
|
+
}, props), {
|
|
1492
|
+
children: [
|
|
1493
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectScrollUpButton, {}),
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.Viewport, {
|
|
1495
|
+
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
1496
|
+
children: children
|
|
1497
|
+
}),
|
|
1498
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectScrollDownButton, {})
|
|
1499
|
+
]
|
|
1500
|
+
}))
|
|
1501
|
+
});
|
|
1502
|
+
});
|
|
1503
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1504
|
+
var SelectLabel = React18.forwardRef(function(_param, ref) {
|
|
1505
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1506
|
+
"className"
|
|
1507
|
+
]);
|
|
1508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.Label, _object_spread({
|
|
1509
|
+
ref: ref,
|
|
1510
|
+
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)
|
|
1511
|
+
}, props));
|
|
1512
|
+
});
|
|
1513
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1514
|
+
var SelectItem = React18.forwardRef(function(_param, ref) {
|
|
1515
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
1516
|
+
"className",
|
|
1517
|
+
"children"
|
|
1518
|
+
]);
|
|
1519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(SelectPrimitive.Item, _object_spread_props(_object_spread({
|
|
1520
|
+
ref: ref,
|
|
1521
|
+
className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)
|
|
1522
|
+
}, props), {
|
|
1523
|
+
children: [
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", {
|
|
1525
|
+
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
1526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.ItemIndicator, {
|
|
1527
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react6.Check, {
|
|
1528
|
+
className: "h-4 w-4"
|
|
1529
|
+
})
|
|
1530
|
+
})
|
|
1531
|
+
}),
|
|
1532
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.ItemText, {
|
|
1533
|
+
children: children
|
|
1534
|
+
})
|
|
1535
|
+
]
|
|
1536
|
+
}));
|
|
1537
|
+
});
|
|
1538
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1539
|
+
var SelectSeparator = React18.forwardRef(function(_param, ref) {
|
|
1540
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1541
|
+
"className"
|
|
1542
|
+
]);
|
|
1543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectPrimitive.Separator, _object_spread({
|
|
1544
|
+
ref: ref,
|
|
1545
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
1546
|
+
}, props));
|
|
1547
|
+
});
|
|
1548
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1549
|
+
// src/components/atoms/ui/command.tsx
|
|
1550
|
+
var React20 = __toESM(require("react"));
|
|
1551
|
+
var import_cmdk = require("cmdk");
|
|
1552
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1553
|
+
// src/components/atoms/ui/dialog.tsx
|
|
1554
|
+
var React19 = __toESM(require("react"));
|
|
1555
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
1556
|
+
var import_lucide_react7 = require("lucide-react");
|
|
1557
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1558
|
+
var Dialog = DialogPrimitive.Root;
|
|
1559
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1560
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
1561
|
+
var DialogOverlay = React19.forwardRef(function(_param, ref) {
|
|
1562
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1563
|
+
"className"
|
|
1564
|
+
]);
|
|
1565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogPrimitive.Overlay, _object_spread({
|
|
1566
|
+
ref: ref,
|
|
1567
|
+
className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className)
|
|
1568
|
+
}, props));
|
|
1569
|
+
});
|
|
1570
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1571
|
+
var DialogContent = React19.forwardRef(function(_param, ref) {
|
|
1572
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
1573
|
+
"className",
|
|
1574
|
+
"children"
|
|
1575
|
+
]);
|
|
1576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DialogPortal, {
|
|
1577
|
+
children: [
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogOverlay, {}),
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DialogPrimitive.Content, _object_spread_props(_object_spread({
|
|
1580
|
+
ref: ref,
|
|
1581
|
+
className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className, "alq--dialog-content")
|
|
1582
|
+
}, props), {
|
|
1583
|
+
children: [
|
|
1584
|
+
children,
|
|
1585
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DialogPrimitive.Close, {
|
|
1586
|
+
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
1587
|
+
children: [
|
|
1588
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react7.X, {
|
|
1589
|
+
className: "h-4 w-4"
|
|
1590
|
+
}),
|
|
1591
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", {
|
|
1592
|
+
className: "sr-only",
|
|
1593
|
+
children: "Close"
|
|
1594
|
+
})
|
|
1595
|
+
]
|
|
1596
|
+
})
|
|
1597
|
+
]
|
|
1598
|
+
}))
|
|
1599
|
+
]
|
|
1600
|
+
});
|
|
1601
|
+
});
|
|
1602
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
1603
|
+
var DialogHeader = function(_param) {
|
|
1604
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1605
|
+
"className"
|
|
1606
|
+
]);
|
|
1607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", _object_spread({
|
|
1608
|
+
className: cn("flex flex-col space-y-1.5 text-center sm:text-left text-foreground", className, "alq--dialog-header")
|
|
1609
|
+
}, props));
|
|
1610
|
+
};
|
|
1611
|
+
DialogHeader.displayName = "DialogHeader";
|
|
1612
|
+
var DialogFooter = function(_param) {
|
|
1613
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1614
|
+
"className"
|
|
1615
|
+
]);
|
|
1616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", _object_spread({
|
|
1617
|
+
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
|
|
1618
|
+
}, props));
|
|
1619
|
+
};
|
|
1620
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1621
|
+
var DialogTitle = React19.forwardRef(function(_param, ref) {
|
|
1622
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1623
|
+
"className"
|
|
1624
|
+
]);
|
|
1625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogPrimitive.Title, _object_spread({
|
|
1626
|
+
ref: ref,
|
|
1627
|
+
className: cn("text-lg font-semibold leading-none tracking-tight text-foreground", className, "alq--dialog-title")
|
|
1628
|
+
}, props));
|
|
1629
|
+
});
|
|
1630
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1631
|
+
var DialogDescription = React19.forwardRef(function(_param, ref) {
|
|
1632
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1633
|
+
"className"
|
|
1634
|
+
]);
|
|
1635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DialogPrimitive.Description, _object_spread({
|
|
1636
|
+
ref: ref,
|
|
1637
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
1638
|
+
}, props));
|
|
1639
|
+
});
|
|
1640
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1641
|
+
// src/components/atoms/ui/command.tsx
|
|
1642
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1643
|
+
var Command = React20.forwardRef(function(_param, ref) {
|
|
1644
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1645
|
+
"className"
|
|
1646
|
+
]);
|
|
1647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_cmdk.Command, _object_spread({
|
|
1648
|
+
ref: ref,
|
|
1649
|
+
className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className)
|
|
1650
|
+
}, props));
|
|
1651
|
+
});
|
|
1652
|
+
Command.displayName = import_cmdk.Command.displayName;
|
|
1653
|
+
var CommandInput = React20.forwardRef(function(_param, ref) {
|
|
1654
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1655
|
+
"className"
|
|
1656
|
+
]);
|
|
1657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", {
|
|
1658
|
+
className: "flex items-center border-b px-3",
|
|
1659
|
+
"cmdk-input-wrapper": "",
|
|
1660
|
+
children: [
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react8.Search, {
|
|
1662
|
+
className: "mr-2 h-4 w-4 shrink-0 opacity-50"
|
|
1663
|
+
}),
|
|
1664
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_cmdk.Command.Input, _object_spread({
|
|
1665
|
+
ref: ref,
|
|
1666
|
+
className: cn("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
1667
|
+
}, props))
|
|
1668
|
+
]
|
|
1669
|
+
});
|
|
1670
|
+
});
|
|
1671
|
+
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
1672
|
+
var CommandList = React20.forwardRef(function(_param, ref) {
|
|
1673
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1674
|
+
"className"
|
|
1675
|
+
]);
|
|
1676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_cmdk.Command.List, _object_spread({
|
|
1677
|
+
ref: ref,
|
|
1678
|
+
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)
|
|
1679
|
+
}, props));
|
|
1680
|
+
});
|
|
1681
|
+
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
1682
|
+
var CommandEmpty = React20.forwardRef(function(props, ref) {
|
|
1683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_cmdk.Command.Empty, _object_spread({
|
|
1684
|
+
ref: ref,
|
|
1685
|
+
className: "py-6 text-center text-sm"
|
|
1686
|
+
}, props));
|
|
1687
|
+
});
|
|
1688
|
+
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
1689
|
+
var CommandGroup = React20.forwardRef(function(_param, ref) {
|
|
1690
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1691
|
+
"className"
|
|
1692
|
+
]);
|
|
1693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_cmdk.Command.Group, _object_spread({
|
|
1694
|
+
ref: ref,
|
|
1695
|
+
className: cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className)
|
|
1696
|
+
}, props));
|
|
1697
|
+
});
|
|
1698
|
+
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
1699
|
+
var CommandSeparator = React20.forwardRef(function(_param, ref) {
|
|
1700
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1701
|
+
"className"
|
|
1702
|
+
]);
|
|
1703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_cmdk.Command.Separator, _object_spread({
|
|
1704
|
+
ref: ref,
|
|
1705
|
+
className: cn("-mx-1 h-px bg-border", className)
|
|
1706
|
+
}, props));
|
|
1707
|
+
});
|
|
1708
|
+
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
1709
|
+
var CommandItem = React20.forwardRef(function(_param, ref) {
|
|
1710
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1711
|
+
"className"
|
|
1712
|
+
]);
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_cmdk.Command.Item, _object_spread({
|
|
1714
|
+
ref: ref,
|
|
1715
|
+
className: cn("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className)
|
|
1716
|
+
}, props));
|
|
1717
|
+
});
|
|
1718
|
+
CommandItem.displayName = import_cmdk.Command.Item.displayName;
|
|
1719
|
+
var CommandShortcut = function(_param) {
|
|
1720
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
1721
|
+
"className"
|
|
1722
|
+
]);
|
|
1723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", _object_spread({
|
|
1724
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className)
|
|
1725
|
+
}, props));
|
|
1726
|
+
};
|
|
1727
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
1728
|
+
// src/components/genui/components/inputs.tsx
|
|
1729
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1730
|
+
var opts = function(node) {
|
|
1731
|
+
return Array.isArray(node.options) ? node.options.map(function(o) {
|
|
1732
|
+
return typeof o === "string" || typeof o === "number" ? {
|
|
1733
|
+
label: String(o),
|
|
1734
|
+
value: o
|
|
1735
|
+
} : o;
|
|
1736
|
+
}) : [];
|
|
1737
|
+
};
|
|
1738
|
+
var toDate = function(v) {
|
|
1739
|
+
if (typeof v !== "string" || !v) return void 0;
|
|
1740
|
+
var d = new Date(v);
|
|
1741
|
+
return isNaN(d.getTime()) ? void 0 : d;
|
|
1742
|
+
};
|
|
1743
|
+
var Field = function(param) {
|
|
1744
|
+
var id = param.id, label = param.label, node = param.node, children = param.children;
|
|
1745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", {
|
|
1746
|
+
className: cn("flex flex-col gap-1.5", styleProps(node)),
|
|
1747
|
+
children: [
|
|
1748
|
+
typeof label === "string" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Label, {
|
|
1749
|
+
htmlFor: id,
|
|
1750
|
+
children: label
|
|
1751
|
+
}),
|
|
1752
|
+
children
|
|
1753
|
+
]
|
|
1754
|
+
});
|
|
1755
|
+
};
|
|
1756
|
+
var TextField = function(param) {
|
|
1757
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1758
|
+
var id = "f-".concat(node.id);
|
|
1759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
1760
|
+
id: id,
|
|
1761
|
+
label: node.label,
|
|
1762
|
+
node: node,
|
|
1763
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Input, {
|
|
1764
|
+
id: id,
|
|
1765
|
+
placeholder: typeof node.placeholder === "string" ? node.placeholder : void 0,
|
|
1766
|
+
value: typeof value === "string" ? value : "",
|
|
1767
|
+
onChange: function(e) {
|
|
1768
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
|
|
1769
|
+
}
|
|
1770
|
+
})
|
|
1771
|
+
});
|
|
1772
|
+
};
|
|
1773
|
+
var TextArea = function(param) {
|
|
1774
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1775
|
+
var id = "f-".concat(node.id);
|
|
1776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
1777
|
+
id: id,
|
|
1778
|
+
label: node.label,
|
|
1779
|
+
node: node,
|
|
1780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Textarea, {
|
|
1781
|
+
id: id,
|
|
1782
|
+
rows: typeof node.rows === "number" ? node.rows : void 0,
|
|
1783
|
+
placeholder: typeof node.placeholder === "string" ? node.placeholder : void 0,
|
|
1784
|
+
value: typeof value === "string" ? value : "",
|
|
1785
|
+
onChange: function(e) {
|
|
1786
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
|
|
1787
|
+
}
|
|
1788
|
+
})
|
|
1789
|
+
});
|
|
1790
|
+
};
|
|
1791
|
+
var NumberField = function(param) {
|
|
1792
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1793
|
+
var id = "f-".concat(node.id);
|
|
1794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
1795
|
+
id: id,
|
|
1796
|
+
label: node.label,
|
|
1797
|
+
node: node,
|
|
1798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Input, {
|
|
1799
|
+
id: id,
|
|
1800
|
+
type: "number",
|
|
1801
|
+
min: typeof node.min === "number" ? node.min : void 0,
|
|
1802
|
+
max: typeof node.max === "number" ? node.max : void 0,
|
|
1803
|
+
step: typeof node.step === "number" ? node.step : void 0,
|
|
1804
|
+
value: typeof value === "number" ? value : "",
|
|
1805
|
+
onChange: function(e) {
|
|
1806
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value === "" ? void 0 : Number(e.target.value));
|
|
1807
|
+
}
|
|
1808
|
+
})
|
|
1809
|
+
});
|
|
1810
|
+
};
|
|
1811
|
+
var SelectNode = function(param) {
|
|
1812
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1813
|
+
var id = "f-".concat(node.id);
|
|
1814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
1815
|
+
id: id,
|
|
1816
|
+
label: node.label,
|
|
1817
|
+
node: node,
|
|
1818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Select, {
|
|
1819
|
+
value: value != null ? String(value) : void 0,
|
|
1820
|
+
onValueChange: function(v) {
|
|
1821
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
1822
|
+
},
|
|
1823
|
+
children: [
|
|
1824
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectTrigger, {
|
|
1825
|
+
id: id,
|
|
1826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectValue, {
|
|
1827
|
+
placeholder: typeof node.placeholder === "string" ? node.placeholder : void 0
|
|
1828
|
+
})
|
|
1829
|
+
}),
|
|
1830
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectContent, {
|
|
1831
|
+
children: opts(node).map(function(o) {
|
|
1832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectItem, {
|
|
1833
|
+
value: String(o.value),
|
|
1834
|
+
children: o.label
|
|
1835
|
+
}, String(o.value));
|
|
1836
|
+
})
|
|
1837
|
+
})
|
|
1838
|
+
]
|
|
1839
|
+
})
|
|
1840
|
+
});
|
|
1841
|
+
};
|
|
1842
|
+
var MultiSelect = function(param) {
|
|
1843
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1844
|
+
var selected = Array.isArray(value) ? value : [];
|
|
1845
|
+
var toggle = function(v) {
|
|
1846
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(selected.includes(v) ? selected.filter(function(x) {
|
|
1847
|
+
return x !== v;
|
|
1848
|
+
}) : _to_consumable_array(selected).concat([
|
|
1849
|
+
v
|
|
1850
|
+
]));
|
|
1851
|
+
};
|
|
1852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
1853
|
+
id: "f-".concat(node.id),
|
|
1854
|
+
label: node.label,
|
|
1855
|
+
node: node,
|
|
1856
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", {
|
|
1857
|
+
className: "flex flex-col gap-1.5",
|
|
1858
|
+
children: opts(node).map(function(o) {
|
|
1859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", {
|
|
1860
|
+
className: "flex items-center gap-2 text-sm",
|
|
1861
|
+
children: [
|
|
1862
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Checkbox, {
|
|
1863
|
+
checked: selected.includes(o.value),
|
|
1864
|
+
onCheckedChange: function() {
|
|
1865
|
+
return toggle(o.value);
|
|
1866
|
+
}
|
|
1867
|
+
}),
|
|
1868
|
+
o.label
|
|
1869
|
+
]
|
|
1870
|
+
}, String(o.value));
|
|
1871
|
+
})
|
|
1872
|
+
})
|
|
1873
|
+
});
|
|
1874
|
+
};
|
|
1875
|
+
var Combobox = function(param) {
|
|
1876
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1877
|
+
var _React21_useState = _sliced_to_array(React21.useState(false), 2), open = _React21_useState[0], setOpen = _React21_useState[1];
|
|
1878
|
+
var selected = opts(node).find(function(o) {
|
|
1879
|
+
return o.value === value;
|
|
1880
|
+
});
|
|
1881
|
+
var placeholder = typeof node.placeholder === "string" ? node.placeholder : "Select\u2026";
|
|
1882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
1883
|
+
id: "f-".concat(node.id),
|
|
1884
|
+
label: node.label,
|
|
1885
|
+
node: node,
|
|
1886
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Popover, {
|
|
1887
|
+
open: open,
|
|
1888
|
+
onOpenChange: setOpen,
|
|
1889
|
+
children: [
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverTrigger, {
|
|
1891
|
+
asChild: true,
|
|
1892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, {
|
|
1893
|
+
variant: "outline",
|
|
1894
|
+
role: "combobox",
|
|
1895
|
+
className: "justify-between font-normal",
|
|
1896
|
+
children: selected ? selected.label : placeholder
|
|
1897
|
+
})
|
|
1898
|
+
}),
|
|
1899
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverContent, {
|
|
1900
|
+
className: "w-[--radix-popover-trigger-width] p-0",
|
|
1901
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Command, {
|
|
1902
|
+
children: [
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CommandInput, {
|
|
1904
|
+
placeholder: "Search\u2026"
|
|
1905
|
+
}),
|
|
1906
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CommandList, {
|
|
1907
|
+
children: [
|
|
1908
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CommandEmpty, {
|
|
1909
|
+
children: "No results."
|
|
1910
|
+
}),
|
|
1911
|
+
opts(node).map(function(o) {
|
|
1912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CommandItem, {
|
|
1913
|
+
value: o.label,
|
|
1914
|
+
onSelect: function() {
|
|
1915
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(o.value);
|
|
1916
|
+
setOpen(false);
|
|
1917
|
+
},
|
|
1918
|
+
children: o.label
|
|
1919
|
+
}, String(o.value));
|
|
1920
|
+
})
|
|
1921
|
+
]
|
|
1922
|
+
})
|
|
1923
|
+
]
|
|
1924
|
+
})
|
|
1925
|
+
})
|
|
1926
|
+
]
|
|
1927
|
+
})
|
|
1928
|
+
});
|
|
1929
|
+
};
|
|
1930
|
+
var CheckboxNode = function(param) {
|
|
1931
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1932
|
+
var id = "f-".concat(node.id);
|
|
1933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", {
|
|
1934
|
+
className: cn("flex items-center gap-2", styleProps(node)),
|
|
1935
|
+
children: [
|
|
1936
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Checkbox, {
|
|
1937
|
+
id: id,
|
|
1938
|
+
checked: value === true,
|
|
1939
|
+
onCheckedChange: function(c) {
|
|
1940
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(c === true);
|
|
1941
|
+
}
|
|
1942
|
+
}),
|
|
1943
|
+
typeof node.label === "string" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Label, {
|
|
1944
|
+
htmlFor: id,
|
|
1945
|
+
children: node.label
|
|
1946
|
+
})
|
|
1947
|
+
]
|
|
1948
|
+
});
|
|
1949
|
+
};
|
|
1950
|
+
var CheckboxGroup = function(param) {
|
|
1951
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1952
|
+
var selected = Array.isArray(value) ? value : [];
|
|
1953
|
+
var toggle = function(v) {
|
|
1954
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(selected.includes(v) ? selected.filter(function(x) {
|
|
1955
|
+
return x !== v;
|
|
1956
|
+
}) : _to_consumable_array(selected).concat([
|
|
1957
|
+
v
|
|
1958
|
+
]));
|
|
1959
|
+
};
|
|
1960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
1961
|
+
id: "f-".concat(node.id),
|
|
1962
|
+
label: node.label,
|
|
1963
|
+
node: node,
|
|
1964
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", {
|
|
1965
|
+
className: "flex flex-col gap-1.5",
|
|
1966
|
+
children: opts(node).map(function(o) {
|
|
1967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", {
|
|
1968
|
+
className: "flex items-center gap-2 text-sm",
|
|
1969
|
+
children: [
|
|
1970
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Checkbox, {
|
|
1971
|
+
checked: selected.includes(o.value),
|
|
1972
|
+
onCheckedChange: function() {
|
|
1973
|
+
return toggle(o.value);
|
|
1974
|
+
}
|
|
1975
|
+
}),
|
|
1976
|
+
o.label
|
|
1977
|
+
]
|
|
1978
|
+
}, String(o.value));
|
|
1979
|
+
})
|
|
1980
|
+
})
|
|
1981
|
+
});
|
|
1982
|
+
};
|
|
1983
|
+
var Radio = function(param) {
|
|
1984
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
1985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
1986
|
+
id: "f-".concat(node.id),
|
|
1987
|
+
label: node.label,
|
|
1988
|
+
node: node,
|
|
1989
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RadioGroup, {
|
|
1990
|
+
value: value != null ? String(value) : void 0,
|
|
1991
|
+
onValueChange: function(v) {
|
|
1992
|
+
var match = opts(node).find(function(o) {
|
|
1993
|
+
return String(o.value) === v;
|
|
1994
|
+
});
|
|
1995
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(match ? match.value : v);
|
|
1996
|
+
},
|
|
1997
|
+
children: opts(node).map(function(o) {
|
|
1998
|
+
var id = "r-".concat(node.id, "-").concat(o.value);
|
|
1999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", {
|
|
2000
|
+
className: "flex items-center gap-2 text-sm",
|
|
2001
|
+
children: [
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RadioGroupItem, {
|
|
2003
|
+
id: id,
|
|
2004
|
+
value: String(o.value)
|
|
2005
|
+
}),
|
|
2006
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Label, {
|
|
2007
|
+
htmlFor: id,
|
|
2008
|
+
className: "font-normal",
|
|
2009
|
+
children: o.label
|
|
2010
|
+
})
|
|
2011
|
+
]
|
|
2012
|
+
}, String(o.value));
|
|
2013
|
+
})
|
|
2014
|
+
})
|
|
2015
|
+
});
|
|
2016
|
+
};
|
|
2017
|
+
var SwitchNode = function(param) {
|
|
2018
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
2019
|
+
var id = "f-".concat(node.id);
|
|
2020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", {
|
|
2021
|
+
className: cn("flex items-center gap-2", styleProps(node)),
|
|
2022
|
+
children: [
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Switch, {
|
|
2024
|
+
id: id,
|
|
2025
|
+
checked: value === true,
|
|
2026
|
+
onCheckedChange: function(c) {
|
|
2027
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(c === true);
|
|
2028
|
+
}
|
|
2029
|
+
}),
|
|
2030
|
+
typeof node.label === "string" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Label, {
|
|
2031
|
+
htmlFor: id,
|
|
2032
|
+
children: node.label
|
|
2033
|
+
})
|
|
2034
|
+
]
|
|
2035
|
+
});
|
|
2036
|
+
};
|
|
2037
|
+
var SliderNode = function(param) {
|
|
2038
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
2039
|
+
var min = typeof node.min === "number" ? node.min : 0;
|
|
2040
|
+
var max = typeof node.max === "number" ? node.max : 100;
|
|
2041
|
+
var step = typeof node.step === "number" ? node.step : 1;
|
|
2042
|
+
var v = typeof value === "number" ? value : min;
|
|
2043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
2044
|
+
id: "f-".concat(node.id),
|
|
2045
|
+
label: node.label,
|
|
2046
|
+
node: node,
|
|
2047
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Slider, {
|
|
2048
|
+
min: min,
|
|
2049
|
+
max: max,
|
|
2050
|
+
step: step,
|
|
2051
|
+
value: [
|
|
2052
|
+
v
|
|
2053
|
+
],
|
|
2054
|
+
onValueChange: function(vals) {
|
|
2055
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(vals[0]);
|
|
2056
|
+
}
|
|
2057
|
+
})
|
|
2058
|
+
});
|
|
2059
|
+
};
|
|
2060
|
+
var DatePicker = function(param) {
|
|
2061
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
2062
|
+
var selected = toDate(value);
|
|
2063
|
+
var label = selected ? (0, import_date_fns.format)(selected, "PPP") : "Pick a date";
|
|
2064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
2065
|
+
id: "f-".concat(node.id),
|
|
2066
|
+
label: node.label,
|
|
2067
|
+
node: node,
|
|
2068
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Popover, {
|
|
2069
|
+
children: [
|
|
2070
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverTrigger, {
|
|
2071
|
+
asChild: true,
|
|
2072
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, {
|
|
2073
|
+
variant: "outline",
|
|
2074
|
+
className: "justify-start font-normal",
|
|
2075
|
+
children: label
|
|
2076
|
+
})
|
|
2077
|
+
}),
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverContent, {
|
|
2079
|
+
className: "w-auto p-0",
|
|
2080
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Calendar, {
|
|
2081
|
+
mode: "single",
|
|
2082
|
+
selected: selected,
|
|
2083
|
+
onSelect: function(d) {
|
|
2084
|
+
return d && (onChange === null || onChange === void 0 ? void 0 : onChange(d.toISOString()));
|
|
2085
|
+
}
|
|
2086
|
+
})
|
|
2087
|
+
})
|
|
2088
|
+
]
|
|
2089
|
+
})
|
|
2090
|
+
});
|
|
2091
|
+
};
|
|
2092
|
+
var DateRange = function(param) {
|
|
2093
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
2094
|
+
var parsed = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" ? value : void 0;
|
|
2095
|
+
var from = toDate(parsed === null || parsed === void 0 ? void 0 : parsed.from);
|
|
2096
|
+
var to = toDate(parsed === null || parsed === void 0 ? void 0 : parsed.to);
|
|
2097
|
+
var selected = from ? {
|
|
2098
|
+
from: from,
|
|
2099
|
+
to: to
|
|
2100
|
+
} : void 0;
|
|
2101
|
+
var label = from ? "".concat((0, import_date_fns.format)(from, "PP"), " – ").concat(to ? (0, import_date_fns.format)(to, "PP") : "\u2026") : "Pick a range";
|
|
2102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
2103
|
+
id: "f-".concat(node.id),
|
|
2104
|
+
label: node.label,
|
|
2105
|
+
node: node,
|
|
2106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Popover, {
|
|
2107
|
+
children: [
|
|
2108
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverTrigger, {
|
|
2109
|
+
asChild: true,
|
|
2110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, {
|
|
2111
|
+
variant: "outline",
|
|
2112
|
+
className: "justify-start font-normal",
|
|
2113
|
+
children: label
|
|
2114
|
+
})
|
|
2115
|
+
}),
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverContent, {
|
|
2117
|
+
className: "w-auto p-0",
|
|
2118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Calendar, {
|
|
2119
|
+
mode: "range",
|
|
2120
|
+
selected: selected,
|
|
2121
|
+
onSelect: function(r) {
|
|
2122
|
+
var _r_from, _r_to;
|
|
2123
|
+
var _r_from_toISOString, _r_to_toISOString;
|
|
2124
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
2125
|
+
from: (_r_from_toISOString = r === null || r === void 0 ? void 0 : (_r_from = r.from) === null || _r_from === void 0 ? void 0 : _r_from.toISOString()) !== null && _r_from_toISOString !== void 0 ? _r_from_toISOString : null,
|
|
2126
|
+
to: (_r_to_toISOString = r === null || r === void 0 ? void 0 : (_r_to = r.to) === null || _r_to === void 0 ? void 0 : _r_to.toISOString()) !== null && _r_to_toISOString !== void 0 ? _r_to_toISOString : null
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
2129
|
+
})
|
|
2130
|
+
})
|
|
2131
|
+
]
|
|
2132
|
+
})
|
|
2133
|
+
});
|
|
2134
|
+
};
|
|
2135
|
+
var FileUpload = function(param) {
|
|
2136
|
+
var node = param.node, onChange = param.onChange;
|
|
2137
|
+
var id = "f-".concat(node.id);
|
|
2138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
2139
|
+
id: id,
|
|
2140
|
+
label: node.label,
|
|
2141
|
+
node: node,
|
|
2142
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Input, {
|
|
2143
|
+
id: id,
|
|
2144
|
+
type: "file",
|
|
2145
|
+
accept: typeof node.accept === "string" ? node.accept : void 0,
|
|
2146
|
+
multiple: node.multiple === true,
|
|
2147
|
+
onChange: function(e) {
|
|
2148
|
+
var _e_target_files;
|
|
2149
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(Array.from((_e_target_files = e.target.files) !== null && _e_target_files !== void 0 ? _e_target_files : []).map(function(f) {
|
|
2150
|
+
return {
|
|
2151
|
+
name: f.name,
|
|
2152
|
+
size: f.size,
|
|
2153
|
+
type: f.type
|
|
2154
|
+
};
|
|
2155
|
+
}));
|
|
2156
|
+
}
|
|
2157
|
+
})
|
|
2158
|
+
});
|
|
2159
|
+
};
|
|
2160
|
+
var Rating = function(param) {
|
|
2161
|
+
var node = param.node, value = param.value, onChange = param.onChange;
|
|
2162
|
+
var max = typeof node.max === "number" ? node.max : 5;
|
|
2163
|
+
var current = typeof value === "number" ? value : 0;
|
|
2164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, {
|
|
2165
|
+
id: "f-".concat(node.id),
|
|
2166
|
+
label: node.label,
|
|
2167
|
+
node: node,
|
|
2168
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", {
|
|
2169
|
+
className: "flex items-center gap-1",
|
|
2170
|
+
role: "radiogroup",
|
|
2171
|
+
"aria-label": "rating",
|
|
2172
|
+
children: Array.from({
|
|
2173
|
+
length: max
|
|
2174
|
+
}, function(_, i) {
|
|
2175
|
+
return i + 1;
|
|
2176
|
+
}).map(function(n) {
|
|
2177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", {
|
|
2178
|
+
type: "button",
|
|
2179
|
+
"aria-label": "".concat(n, " star").concat(n > 1 ? "s" : ""),
|
|
2180
|
+
onClick: function() {
|
|
2181
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(n);
|
|
2182
|
+
},
|
|
2183
|
+
className: "text-amber-500",
|
|
2184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react9.Star, {
|
|
2185
|
+
className: cn("h-5 w-5", n <= current ? "fill-current" : "opacity-40")
|
|
2186
|
+
})
|
|
2187
|
+
}, n);
|
|
2188
|
+
})
|
|
2189
|
+
})
|
|
2190
|
+
});
|
|
2191
|
+
};
|
|
2192
|
+
// src/components/genui/components/data.tsx
|
|
2193
|
+
var React24 = __toESM(require("react"));
|
|
2194
|
+
var import_react_table = require("@tanstack/react-table");
|
|
2195
|
+
var import_recharts2 = require("recharts");
|
|
2196
|
+
// src/components/atoms/ui/table.tsx
|
|
2197
|
+
var React22 = __toESM(require("react"));
|
|
2198
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2199
|
+
var Table = React22.forwardRef(function(_param, ref) {
|
|
2200
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2201
|
+
"className"
|
|
2202
|
+
]);
|
|
2203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", {
|
|
2204
|
+
className: "relative w-full overflow-auto",
|
|
2205
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("table", _object_spread({
|
|
2206
|
+
ref: ref,
|
|
2207
|
+
className: cn("w-full caption-bottom text-sm text-foreground bg-background", className, "alq--table")
|
|
2208
|
+
}, props))
|
|
2209
|
+
});
|
|
2210
|
+
});
|
|
2211
|
+
Table.displayName = "Table";
|
|
2212
|
+
var TableHeader = React22.forwardRef(function(_param, ref) {
|
|
2213
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2214
|
+
"className"
|
|
2215
|
+
]);
|
|
2216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("thead", _object_spread({
|
|
2217
|
+
ref: ref,
|
|
2218
|
+
className: cn("[&_tr]:border-b border-border bg-muted", className, "alq--table-header")
|
|
2219
|
+
}, props));
|
|
2220
|
+
});
|
|
2221
|
+
TableHeader.displayName = "TableHeader";
|
|
2222
|
+
var TableBody = React22.forwardRef(function(_param, ref) {
|
|
2223
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2224
|
+
"className"
|
|
2225
|
+
]);
|
|
2226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("tbody", _object_spread({
|
|
2227
|
+
ref: ref,
|
|
2228
|
+
className: cn("[&_tr:last-child]:border-0 [&_tr]:border-b border-border", className, "alq--table-body")
|
|
2229
|
+
}, props));
|
|
2230
|
+
});
|
|
2231
|
+
TableBody.displayName = "TableBody";
|
|
2232
|
+
var TableFooter = React22.forwardRef(function(_param, ref) {
|
|
2233
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2234
|
+
"className"
|
|
2235
|
+
]);
|
|
2236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("tfoot", _object_spread({
|
|
2237
|
+
ref: ref,
|
|
2238
|
+
className: cn("border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0", className, "alq--table-footer")
|
|
2239
|
+
}, props));
|
|
2240
|
+
});
|
|
2241
|
+
TableFooter.displayName = "TableFooter";
|
|
2242
|
+
var TableRow = React22.forwardRef(function(_param, ref) {
|
|
2243
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2244
|
+
"className"
|
|
2245
|
+
]);
|
|
2246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("tr", _object_spread({
|
|
2247
|
+
ref: ref,
|
|
2248
|
+
className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className)
|
|
2249
|
+
}, props));
|
|
2250
|
+
});
|
|
2251
|
+
TableRow.displayName = "TableRow";
|
|
2252
|
+
var TableHead = React22.forwardRef(function(_param, ref) {
|
|
2253
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2254
|
+
"className"
|
|
2255
|
+
]);
|
|
2256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("th", _object_spread({
|
|
2257
|
+
ref: ref,
|
|
2258
|
+
className: cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className)
|
|
2259
|
+
}, props));
|
|
2260
|
+
});
|
|
2261
|
+
TableHead.displayName = "TableHead";
|
|
2262
|
+
var TableCell = React22.forwardRef(function(_param, ref) {
|
|
2263
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2264
|
+
"className"
|
|
2265
|
+
]);
|
|
2266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", _object_spread({
|
|
2267
|
+
ref: ref,
|
|
2268
|
+
className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)
|
|
2269
|
+
}, props));
|
|
2270
|
+
});
|
|
2271
|
+
TableCell.displayName = "TableCell";
|
|
2272
|
+
var TableCaption = React22.forwardRef(function(_param, ref) {
|
|
2273
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2274
|
+
"className"
|
|
2275
|
+
]);
|
|
2276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("caption", _object_spread({
|
|
2277
|
+
ref: ref,
|
|
2278
|
+
className: cn("mt-4 text-sm text-muted-foreground", className)
|
|
2279
|
+
}, props));
|
|
2280
|
+
});
|
|
2281
|
+
TableCaption.displayName = "TableCaption";
|
|
2282
|
+
// src/components/atoms/ui/progress.tsx
|
|
2283
|
+
var React23 = __toESM(require("react"));
|
|
2284
|
+
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
2285
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2286
|
+
var Progress = React23.forwardRef(function(_param, ref) {
|
|
2287
|
+
var className = _param.className, value = _param.value, props = _object_without_properties(_param, [
|
|
2288
|
+
"className",
|
|
2289
|
+
"value"
|
|
2290
|
+
]);
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ProgressPrimitive.Root, _object_spread_props(_object_spread({
|
|
2292
|
+
ref: ref,
|
|
2293
|
+
className: cn("relative h-2 w-full overflow-hidden rounded-full bg-muted", className)
|
|
2294
|
+
}, props), {
|
|
2295
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ProgressPrimitive.Indicator, {
|
|
2296
|
+
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
2297
|
+
style: {
|
|
2298
|
+
transform: "translateX(-".concat(100 - (value || 0), "%)")
|
|
2299
|
+
}
|
|
2300
|
+
})
|
|
2301
|
+
}));
|
|
2302
|
+
});
|
|
2303
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
2304
|
+
// src/components/atoms/ui/chart.tsx
|
|
2305
|
+
var import_recharts = require("recharts");
|
|
2306
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2307
|
+
var CHART_PALETTE = [
|
|
2308
|
+
"hsl(var(--chart-1))",
|
|
2309
|
+
"hsl(var(--chart-2))",
|
|
2310
|
+
"hsl(var(--chart-3))",
|
|
2311
|
+
"hsl(var(--chart-4))",
|
|
2312
|
+
"hsl(var(--chart-5))"
|
|
2313
|
+
];
|
|
2314
|
+
function Chart(param) {
|
|
2315
|
+
var className = param.className, _param_height = param.height, height = _param_height === void 0 ? 300 : _param_height, children = param.children;
|
|
2316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", {
|
|
2317
|
+
className: cn("w-full", className),
|
|
2318
|
+
style: {
|
|
2319
|
+
height: height
|
|
2320
|
+
},
|
|
2321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_recharts.ResponsiveContainer, {
|
|
2322
|
+
width: "100%",
|
|
2323
|
+
height: "100%",
|
|
2324
|
+
children: children
|
|
2325
|
+
})
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
Chart.displayName = "Chart";
|
|
2329
|
+
function themedChartAxes(x) {
|
|
2330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, {
|
|
2331
|
+
children: [
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_recharts.CartesianGrid, {
|
|
2333
|
+
strokeDasharray: "3 3",
|
|
2334
|
+
className: "stroke-border"
|
|
2335
|
+
}),
|
|
2336
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_recharts.XAxis, {
|
|
2337
|
+
dataKey: x,
|
|
2338
|
+
className: "text-xs"
|
|
2339
|
+
}),
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_recharts.YAxis, {
|
|
2341
|
+
className: "text-xs"
|
|
2342
|
+
}),
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_recharts.Tooltip, {}),
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_recharts.Legend, {})
|
|
2345
|
+
]
|
|
2346
|
+
});
|
|
2347
|
+
}
|
|
2348
|
+
// src/components/genui/components/data.tsx
|
|
2349
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2350
|
+
var PALETTE = CHART_PALETTE;
|
|
2351
|
+
var TableNode = function(param) {
|
|
2352
|
+
var node = param.node, value = param.value, onAction = param.onAction;
|
|
2353
|
+
var data = Array.isArray(value) ? value : Array.isArray(node.rows) ? node.rows : Array.isArray(node.data) ? node.data : [];
|
|
2354
|
+
var cols = (Array.isArray(node.columns) ? node.columns : []).map(function(c) {
|
|
2355
|
+
return typeof c === "string" ? {
|
|
2356
|
+
key: c,
|
|
2357
|
+
header: c
|
|
2358
|
+
} : c;
|
|
2359
|
+
});
|
|
2360
|
+
if (!cols.some(function(c) {
|
|
2361
|
+
return c.key;
|
|
2362
|
+
}) && data.length) {
|
|
2363
|
+
cols = Object.keys(data[0]).map(function(k) {
|
|
2364
|
+
return {
|
|
2365
|
+
key: k,
|
|
2366
|
+
header: k
|
|
2367
|
+
};
|
|
2368
|
+
});
|
|
2369
|
+
}
|
|
2370
|
+
var sortable = node.sortable === true;
|
|
2371
|
+
var _React24_useState = _sliced_to_array(React24.useState([]), 2), sorting = _React24_useState[0], setSorting = _React24_useState[1];
|
|
2372
|
+
var columns = React24.useMemo(function() {
|
|
2373
|
+
return cols.map(function(c, i) {
|
|
2374
|
+
var _c_key;
|
|
2375
|
+
var id = String((_c_key = c.key) !== null && _c_key !== void 0 ? _c_key : "col_".concat(i));
|
|
2376
|
+
var _c_header, _ref;
|
|
2377
|
+
var header = String((_ref = (_c_header = c.header) !== null && _c_header !== void 0 ? _c_header : c.key) !== null && _ref !== void 0 ? _ref : "Column ".concat(i + 1));
|
|
2378
|
+
return c.key ? {
|
|
2379
|
+
id: id,
|
|
2380
|
+
accessorKey: c.key,
|
|
2381
|
+
header: header
|
|
2382
|
+
} : {
|
|
2383
|
+
id: id,
|
|
2384
|
+
accessorFn: function() {
|
|
2385
|
+
return "";
|
|
2386
|
+
},
|
|
2387
|
+
header: header
|
|
2388
|
+
};
|
|
2389
|
+
});
|
|
2390
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2391
|
+
[
|
|
2392
|
+
node
|
|
2393
|
+
]);
|
|
2394
|
+
var table = (0, import_react_table.useReactTable)({
|
|
2395
|
+
data: data,
|
|
2396
|
+
columns: columns,
|
|
2397
|
+
state: {
|
|
2398
|
+
sorting: sorting
|
|
2399
|
+
},
|
|
2400
|
+
onSortingChange: setSorting,
|
|
2401
|
+
getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
|
|
2402
|
+
getSortedRowModel: (0, import_react_table.getSortedRowModel)(),
|
|
2403
|
+
enableSorting: sortable
|
|
2404
|
+
});
|
|
2405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Table, {
|
|
2406
|
+
className: styleProps(node),
|
|
2407
|
+
children: [
|
|
2408
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableHeader, {
|
|
2409
|
+
children: table.getHeaderGroups().map(function(hg) {
|
|
2410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableRow, {
|
|
2411
|
+
children: hg.headers.map(function(h) {
|
|
2412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableHead, {
|
|
2413
|
+
children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", {
|
|
2414
|
+
type: "button",
|
|
2415
|
+
onClick: function() {
|
|
2416
|
+
h.column.toggleSorting();
|
|
2417
|
+
onAction === null || onAction === void 0 ? void 0 : onAction({
|
|
2418
|
+
name: "sort",
|
|
2419
|
+
wantResponse: false
|
|
2420
|
+
});
|
|
2421
|
+
},
|
|
2422
|
+
children: (0, import_react_table.flexRender)(h.column.columnDef.header, h.getContext())
|
|
2423
|
+
}) : (0, import_react_table.flexRender)(h.column.columnDef.header, h.getContext())
|
|
2424
|
+
}, h.id);
|
|
2425
|
+
})
|
|
2426
|
+
}, hg.id);
|
|
2427
|
+
})
|
|
2428
|
+
}),
|
|
2429
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableBody, {
|
|
2430
|
+
children: table.getRowModel().rows.map(function(r) {
|
|
2431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableRow, {
|
|
2432
|
+
children: r.getVisibleCells().map(function(c) {
|
|
2433
|
+
var _c_getValue;
|
|
2434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, {
|
|
2435
|
+
children: String((_c_getValue = c.getValue()) !== null && _c_getValue !== void 0 ? _c_getValue : "")
|
|
2436
|
+
}, c.id);
|
|
2437
|
+
})
|
|
2438
|
+
}, r.id);
|
|
2439
|
+
})
|
|
2440
|
+
})
|
|
2441
|
+
]
|
|
2442
|
+
});
|
|
2443
|
+
};
|
|
2444
|
+
var ChartNode = function(param) {
|
|
2445
|
+
var node = param.node, value = param.value;
|
|
2446
|
+
var data = Array.isArray(value) ? value : Array.isArray(node.data) ? node.data : [];
|
|
2447
|
+
var series = (Array.isArray(node.series) ? node.series : []).map(function(s) {
|
|
2448
|
+
return typeof s === "string" ? {
|
|
2449
|
+
key: s
|
|
2450
|
+
} : s;
|
|
2451
|
+
});
|
|
2452
|
+
var _data_;
|
|
2453
|
+
var first = (_data_ = data[0]) !== null && _data_ !== void 0 ? _data_ : {};
|
|
2454
|
+
var _node_x, _ref;
|
|
2455
|
+
var x = String((_ref = (_node_x = node.x) !== null && _node_x !== void 0 ? _node_x : Object.keys(first).find(function(k) {
|
|
2456
|
+
return typeof first[k] !== "number";
|
|
2457
|
+
})) !== null && _ref !== void 0 ? _ref : "");
|
|
2458
|
+
if (!series.length && data.length) {
|
|
2459
|
+
series = Object.keys(first).filter(function(k) {
|
|
2460
|
+
return k !== x && typeof first[k] === "number";
|
|
2461
|
+
}).map(function(k) {
|
|
2462
|
+
return {
|
|
2463
|
+
key: k
|
|
2464
|
+
};
|
|
2465
|
+
});
|
|
2466
|
+
}
|
|
2467
|
+
var _node_kind;
|
|
2468
|
+
var kind = String((_node_kind = node.kind) !== null && _node_kind !== void 0 ? _node_kind : "bar");
|
|
2469
|
+
if (!data.length || !series.length) {
|
|
2470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", {
|
|
2471
|
+
className: "text-muted-foreground text-sm",
|
|
2472
|
+
children: "No data to display"
|
|
2473
|
+
});
|
|
2474
|
+
}
|
|
2475
|
+
var axes = themedChartAxes(x);
|
|
2476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", {
|
|
2477
|
+
className: cn("w-full", styleProps(node)),
|
|
2478
|
+
children: [
|
|
2479
|
+
typeof node.title === "string" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", {
|
|
2480
|
+
className: "mb-2 font-medium",
|
|
2481
|
+
children: node.title
|
|
2482
|
+
}),
|
|
2483
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Chart, {
|
|
2484
|
+
height: 300,
|
|
2485
|
+
children: kind === "line" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_recharts2.LineChart, {
|
|
2486
|
+
data: data,
|
|
2487
|
+
children: [
|
|
2488
|
+
axes,
|
|
2489
|
+
series.map(function(s, i) {
|
|
2490
|
+
var _s_label;
|
|
2491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_recharts2.Line, {
|
|
2492
|
+
dataKey: s.key,
|
|
2493
|
+
name: (_s_label = s.label) !== null && _s_label !== void 0 ? _s_label : s.key,
|
|
2494
|
+
stroke: PALETTE[i % PALETTE.length]
|
|
2495
|
+
}, s.key);
|
|
2496
|
+
})
|
|
2497
|
+
]
|
|
2498
|
+
}) : kind === "area" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_recharts2.AreaChart, {
|
|
2499
|
+
data: data,
|
|
2500
|
+
children: [
|
|
2501
|
+
axes,
|
|
2502
|
+
series.map(function(s, i) {
|
|
2503
|
+
var _s_label;
|
|
2504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_recharts2.Area, {
|
|
2505
|
+
dataKey: s.key,
|
|
2506
|
+
name: (_s_label = s.label) !== null && _s_label !== void 0 ? _s_label : s.key,
|
|
2507
|
+
stroke: PALETTE[i % PALETTE.length],
|
|
2508
|
+
fill: PALETTE[i % PALETTE.length],
|
|
2509
|
+
fillOpacity: 0.2
|
|
2510
|
+
}, s.key);
|
|
2511
|
+
})
|
|
2512
|
+
]
|
|
2513
|
+
}) : kind === "pie" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_recharts2.PieChart, {
|
|
2514
|
+
children: [
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_recharts2.Tooltip, {}),
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_recharts2.Legend, {}),
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_recharts2.Pie, {
|
|
2518
|
+
data: data,
|
|
2519
|
+
dataKey: series[0].key,
|
|
2520
|
+
nameKey: x,
|
|
2521
|
+
label: true,
|
|
2522
|
+
children: data.map(function(_, i) {
|
|
2523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_recharts2.Cell, {
|
|
2524
|
+
fill: PALETTE[i % PALETTE.length]
|
|
2525
|
+
}, i);
|
|
2526
|
+
})
|
|
2527
|
+
})
|
|
2528
|
+
]
|
|
2529
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_recharts2.BarChart, {
|
|
2530
|
+
data: data,
|
|
2531
|
+
children: [
|
|
2532
|
+
axes,
|
|
2533
|
+
series.map(function(s, i) {
|
|
2534
|
+
var _s_label;
|
|
2535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_recharts2.Bar, {
|
|
2536
|
+
dataKey: s.key,
|
|
2537
|
+
name: (_s_label = s.label) !== null && _s_label !== void 0 ? _s_label : s.key,
|
|
2538
|
+
fill: PALETTE[i % PALETTE.length]
|
|
2539
|
+
}, s.key);
|
|
2540
|
+
})
|
|
2541
|
+
]
|
|
2542
|
+
})
|
|
2543
|
+
})
|
|
2544
|
+
]
|
|
2545
|
+
});
|
|
2546
|
+
};
|
|
2547
|
+
var Progress2 = function(param) {
|
|
2548
|
+
var node = param.node;
|
|
2549
|
+
var max = typeof node.max === "number" && node.max > 0 ? node.max : 100;
|
|
2550
|
+
var value = typeof node.value === "number" ? Math.min(Math.max(node.value, 0), max) : 0;
|
|
2551
|
+
var pct = Math.round(value / max * 100);
|
|
2552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", {
|
|
2553
|
+
className: cn("flex flex-col gap-1", styleProps(node)),
|
|
2554
|
+
children: [
|
|
2555
|
+
typeof node.label === "string" && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", {
|
|
2556
|
+
className: "flex justify-between text-sm text-muted-foreground",
|
|
2557
|
+
children: [
|
|
2558
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", {
|
|
2559
|
+
children: node.label
|
|
2560
|
+
}),
|
|
2561
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", {
|
|
2562
|
+
children: [
|
|
2563
|
+
pct,
|
|
2564
|
+
"%"
|
|
2565
|
+
]
|
|
2566
|
+
})
|
|
2567
|
+
]
|
|
2568
|
+
}),
|
|
2569
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Progress, {
|
|
2570
|
+
value: pct
|
|
2571
|
+
})
|
|
2572
|
+
]
|
|
2573
|
+
});
|
|
2574
|
+
};
|
|
2575
|
+
var Timeline = function(param) {
|
|
2576
|
+
var node = param.node;
|
|
2577
|
+
var items = Array.isArray(node.items) ? node.items : [];
|
|
2578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("ol", {
|
|
2579
|
+
className: cn("relative ml-2 border-l border-border", styleProps(node)),
|
|
2580
|
+
children: items.map(function(it, i) {
|
|
2581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("li", {
|
|
2582
|
+
className: "mb-4 ml-4",
|
|
2583
|
+
children: [
|
|
2584
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", {
|
|
2585
|
+
className: "absolute -left-1.5 mt-1 h-3 w-3 rounded-full bg-primary"
|
|
2586
|
+
}),
|
|
2587
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", {
|
|
2588
|
+
className: "text-sm font-medium text-foreground",
|
|
2589
|
+
children: it.title
|
|
2590
|
+
}),
|
|
2591
|
+
it.timestamp && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", {
|
|
2592
|
+
className: "text-xs text-muted-foreground",
|
|
2593
|
+
children: it.timestamp
|
|
2594
|
+
}),
|
|
2595
|
+
it.description && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", {
|
|
2596
|
+
className: "text-sm text-muted-foreground",
|
|
2597
|
+
children: it.description
|
|
2598
|
+
})
|
|
2599
|
+
]
|
|
2600
|
+
}, i);
|
|
2601
|
+
})
|
|
2602
|
+
});
|
|
2603
|
+
};
|
|
2604
|
+
// src/components/genui/components/actions.tsx
|
|
2605
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2606
|
+
var BUTTON_VARIANT = {
|
|
2607
|
+
solid: "default",
|
|
2608
|
+
outline: "outline",
|
|
2609
|
+
ghost: "ghost",
|
|
2610
|
+
link: "link"
|
|
2611
|
+
};
|
|
2612
|
+
var BUTTON_SIZE = {
|
|
2613
|
+
sm: "sm",
|
|
2614
|
+
lg: "lg"
|
|
2615
|
+
};
|
|
2616
|
+
var ButtonNode = function(param) {
|
|
2617
|
+
var node = param.node, onAction = param.onAction;
|
|
2618
|
+
var _node_text, _ref, _ref1;
|
|
2619
|
+
var caption = (_ref1 = (_ref = (_node_text = node.text) !== null && _node_text !== void 0 ? _node_text : node.label) !== null && _ref !== void 0 ? _ref : node.title) !== null && _ref1 !== void 0 ? _ref1 : "";
|
|
2620
|
+
var _node_variant, _BUTTON_VARIANT_String;
|
|
2621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, {
|
|
2622
|
+
variant: (_BUTTON_VARIANT_String = BUTTON_VARIANT[String((_node_variant = node.variant) !== null && _node_variant !== void 0 ? _node_variant : "solid")]) !== null && _BUTTON_VARIANT_String !== void 0 ? _BUTTON_VARIANT_String : "default",
|
|
2623
|
+
size: typeof node.size === "string" ? BUTTON_SIZE[node.size] : void 0,
|
|
2624
|
+
className: node.emphasis === "high" ? "font-semibold" : void 0,
|
|
2625
|
+
onClick: function() {
|
|
2626
|
+
return node.action && (onAction === null || onAction === void 0 ? void 0 : onAction(node.action));
|
|
2627
|
+
},
|
|
2628
|
+
children: String(caption)
|
|
2629
|
+
});
|
|
2630
|
+
};
|
|
2631
|
+
var ButtonGroup = function(param) {
|
|
2632
|
+
var node = param.node, children = param.children;
|
|
2633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {
|
|
2634
|
+
className: cn("flex flex-row gap-2", styleProps(node)),
|
|
2635
|
+
children: children
|
|
2636
|
+
});
|
|
2637
|
+
};
|
|
2638
|
+
var SAFE_HREF = /^(\/|https:\/\/)/i;
|
|
2639
|
+
var LinkNode = function(param) {
|
|
2640
|
+
var node = param.node;
|
|
2641
|
+
var href = typeof node.href === "string" && SAFE_HREF.test(node.href) ? node.href : void 0;
|
|
2642
|
+
var _node_text;
|
|
2643
|
+
var text = String((_node_text = node.text) !== null && _node_text !== void 0 ? _node_text : "");
|
|
2644
|
+
if (!href) return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", {
|
|
2645
|
+
className: cn("text-muted-foreground", styleProps(node)),
|
|
2646
|
+
children: text
|
|
2647
|
+
});
|
|
2648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("a", {
|
|
2649
|
+
href: href,
|
|
2650
|
+
target: "_blank",
|
|
2651
|
+
rel: "noopener noreferrer",
|
|
2652
|
+
className: cn("text-primary underline underline-offset-2", styleProps(node)),
|
|
2653
|
+
children: text
|
|
2654
|
+
});
|
|
2655
|
+
};
|
|
2656
|
+
// src/components/genui/registry.tsx
|
|
2657
|
+
var coreUiRegistry = {
|
|
2658
|
+
// layout
|
|
2659
|
+
Stack: Stack,
|
|
2660
|
+
Row: Row,
|
|
2661
|
+
Column: Column,
|
|
2662
|
+
Grid: Grid,
|
|
2663
|
+
Divider: Divider,
|
|
2664
|
+
Spacer: Spacer,
|
|
2665
|
+
Card: CardNode,
|
|
2666
|
+
Tabs: TabsNode,
|
|
2667
|
+
Accordion: AccordionNode,
|
|
2668
|
+
// content
|
|
2669
|
+
Text: Text,
|
|
2670
|
+
Heading: Heading,
|
|
2671
|
+
Markdown: Markdown,
|
|
2672
|
+
Image: ImageNode,
|
|
2673
|
+
Icon: IconNode,
|
|
2674
|
+
Badge: BadgeNode,
|
|
2675
|
+
Avatar: AvatarNode,
|
|
2676
|
+
Alert: AlertNode,
|
|
2677
|
+
Stat: Stat,
|
|
2678
|
+
KeyValue: KeyValueNode,
|
|
2679
|
+
List: ListNode,
|
|
2680
|
+
Quote: Quote,
|
|
2681
|
+
// inputs
|
|
2682
|
+
TextField: TextField,
|
|
2683
|
+
TextArea: TextArea,
|
|
2684
|
+
NumberField: NumberField,
|
|
2685
|
+
Select: SelectNode,
|
|
2686
|
+
MultiSelect: MultiSelect,
|
|
2687
|
+
Combobox: Combobox,
|
|
2688
|
+
Checkbox: CheckboxNode,
|
|
2689
|
+
CheckboxGroup: CheckboxGroup,
|
|
2690
|
+
Radio: Radio,
|
|
2691
|
+
Switch: SwitchNode,
|
|
2692
|
+
Slider: SliderNode,
|
|
2693
|
+
DatePicker: DatePicker,
|
|
2694
|
+
DateRange: DateRange,
|
|
2695
|
+
FileUpload: FileUpload,
|
|
2696
|
+
Rating: Rating,
|
|
2697
|
+
// data
|
|
2698
|
+
Table: TableNode,
|
|
2699
|
+
Chart: ChartNode,
|
|
2700
|
+
Progress: Progress2,
|
|
2701
|
+
Timeline: Timeline,
|
|
2702
|
+
// actions
|
|
2703
|
+
Button: ButtonNode,
|
|
2704
|
+
ButtonGroup: ButtonGroup,
|
|
2705
|
+
Link: LinkNode
|
|
2706
|
+
};
|
|
2707
|
+
// src/components/genui/assistant-chat.tsx
|
|
2708
|
+
var React43 = __toESM(require("react"));
|
|
2709
|
+
var import_lucide_react20 = require("lucide-react");
|
|
2710
|
+
// src/components/organisms/assistant.tsx
|
|
2711
|
+
var React42 = __toESM(require("react"));
|
|
2712
|
+
var import_react8 = require("react");
|
|
2713
|
+
// src/components/atoms/ui/scroll-area.tsx
|
|
2714
|
+
var React25 = __toESM(require("react"));
|
|
2715
|
+
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
|
|
2716
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2717
|
+
var ScrollArea = React25.forwardRef(function(_param, ref) {
|
|
2718
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
2719
|
+
"className",
|
|
2720
|
+
"children"
|
|
2721
|
+
]);
|
|
2722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(ScrollAreaPrimitive.Root, _object_spread_props(_object_spread({
|
|
2723
|
+
ref: ref,
|
|
2724
|
+
className: cn("relative overflow-hidden", className)
|
|
2725
|
+
}, props), {
|
|
2726
|
+
children: [
|
|
2727
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollAreaPrimitive.Viewport, {
|
|
2728
|
+
className: "h-full w-full rounded-[inherit]",
|
|
2729
|
+
children: children
|
|
2730
|
+
}),
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollBar, {}),
|
|
2732
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollAreaPrimitive.Corner, {})
|
|
2733
|
+
]
|
|
2734
|
+
}));
|
|
2735
|
+
});
|
|
2736
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
2737
|
+
var ScrollBar = React25.forwardRef(function(_param, ref) {
|
|
2738
|
+
var className = _param.className, _param_orientation = _param.orientation, orientation = _param_orientation === void 0 ? "vertical" : _param_orientation, props = _object_without_properties(_param, [
|
|
2739
|
+
"className",
|
|
2740
|
+
"orientation"
|
|
2741
|
+
]);
|
|
2742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollAreaPrimitive.ScrollAreaScrollbar, _object_spread_props(_object_spread({
|
|
2743
|
+
ref: ref,
|
|
2744
|
+
orientation: orientation,
|
|
2745
|
+
className: cn("flex touch-none select-none transition-colors", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", className)
|
|
2746
|
+
}, props), {
|
|
2747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, {
|
|
2748
|
+
className: "relative flex-1 rounded-full bg-border"
|
|
2749
|
+
})
|
|
2750
|
+
}));
|
|
2751
|
+
});
|
|
2752
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
2753
|
+
// src/components/atoms/ui/skeleton.tsx
|
|
2754
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2755
|
+
// src/components/atoms/ui/drawer.tsx
|
|
2756
|
+
var React26 = __toESM(require("react"));
|
|
2757
|
+
var import_vaul = require("vaul");
|
|
2758
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2759
|
+
var Drawer = function(_param) {
|
|
2760
|
+
var _param_shouldScaleBackground = _param.shouldScaleBackground, shouldScaleBackground = _param_shouldScaleBackground === void 0 ? true : _param_shouldScaleBackground, props = _object_without_properties(_param, [
|
|
2761
|
+
"shouldScaleBackground"
|
|
2762
|
+
]);
|
|
2763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_vaul.Drawer.Root, _object_spread({
|
|
2764
|
+
shouldScaleBackground: shouldScaleBackground
|
|
2765
|
+
}, props));
|
|
2766
|
+
};
|
|
2767
|
+
Drawer.displayName = "Drawer";
|
|
2768
|
+
var DrawerTrigger = import_vaul.Drawer.Trigger;
|
|
2769
|
+
var DrawerPortal = import_vaul.Drawer.Portal;
|
|
2770
|
+
var DrawerClose = import_vaul.Drawer.Close;
|
|
2771
|
+
var DrawerOverlay = React26.forwardRef(function(_param, ref) {
|
|
2772
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2773
|
+
"className"
|
|
2774
|
+
]);
|
|
2775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_vaul.Drawer.Overlay, _object_spread({
|
|
2776
|
+
ref: ref,
|
|
2777
|
+
className: cn("fixed inset-0 z-50 bg-black/80", className)
|
|
2778
|
+
}, props));
|
|
2779
|
+
});
|
|
2780
|
+
DrawerOverlay.displayName = import_vaul.Drawer.Overlay.displayName;
|
|
2781
|
+
var DrawerContent = React26.forwardRef(function(_param, ref) {
|
|
2782
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
2783
|
+
"className",
|
|
2784
|
+
"children"
|
|
2785
|
+
]);
|
|
2786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(DrawerPortal, {
|
|
2787
|
+
children: [
|
|
2788
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DrawerOverlay, {}),
|
|
2789
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_vaul.Drawer.Content, _object_spread_props(_object_spread({
|
|
2790
|
+
ref: ref,
|
|
2791
|
+
className: cn("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-border bg-background text-foreground alq--drawer-content", className)
|
|
2792
|
+
}, props), {
|
|
2793
|
+
children: [
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", {
|
|
2795
|
+
className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"
|
|
2796
|
+
}),
|
|
2797
|
+
children
|
|
2798
|
+
]
|
|
2799
|
+
}))
|
|
2800
|
+
]
|
|
2801
|
+
});
|
|
2802
|
+
});
|
|
2803
|
+
DrawerContent.displayName = "DrawerContent";
|
|
2804
|
+
var DrawerHeader = function(_param) {
|
|
2805
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2806
|
+
"className"
|
|
2807
|
+
]);
|
|
2808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", _object_spread({
|
|
2809
|
+
className: cn("grid gap-1.5 p-4 text-center sm:text-left", className, "alq--drawer-header")
|
|
2810
|
+
}, props));
|
|
2811
|
+
};
|
|
2812
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
2813
|
+
var DrawerFooter = function(_param) {
|
|
2814
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2815
|
+
"className"
|
|
2816
|
+
]);
|
|
2817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", _object_spread({
|
|
2818
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className, "alq--drawer-footer")
|
|
2819
|
+
}, props));
|
|
2820
|
+
};
|
|
2821
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
2822
|
+
var DrawerTitle = React26.forwardRef(function(_param, ref) {
|
|
2823
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2824
|
+
"className"
|
|
2825
|
+
]);
|
|
2826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_vaul.Drawer.Title, _object_spread({
|
|
2827
|
+
ref: ref,
|
|
2828
|
+
className: cn("text-lg font-semibold leading-none tracking-tight", className, "alq--drawer-title")
|
|
2829
|
+
}, props));
|
|
2830
|
+
});
|
|
2831
|
+
DrawerTitle.displayName = import_vaul.Drawer.Title.displayName;
|
|
2832
|
+
var DrawerDescription = React26.forwardRef(function(_param, ref) {
|
|
2833
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2834
|
+
"className"
|
|
2835
|
+
]);
|
|
2836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_vaul.Drawer.Description, _object_spread({
|
|
2837
|
+
ref: ref,
|
|
2838
|
+
className: cn("text-sm text-muted-foreground", className, "alq--drawer-description")
|
|
2839
|
+
}, props));
|
|
2840
|
+
});
|
|
2841
|
+
DrawerDescription.displayName = import_vaul.Drawer.Description.displayName;
|
|
2842
|
+
// src/components/atoms/ui/typography/index.tsx
|
|
2843
|
+
var import_react2 = require("react");
|
|
2844
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2845
|
+
var Typography = (0, import_react2.forwardRef)(function(_param, ref) {
|
|
2846
|
+
var tmp = _param.as, Component = tmp === void 0 ? "p" : tmp, typeStyle = _param.typeStyle, props = _object_without_properties(_param, [
|
|
2847
|
+
"as",
|
|
2848
|
+
"typeStyle"
|
|
2849
|
+
]);
|
|
2850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Component, _object_spread_props(_object_spread({}, props), {
|
|
2851
|
+
className: cn(props.className, "alq--typography-".concat(typeStyle)),
|
|
2852
|
+
ref: ref
|
|
2853
|
+
}));
|
|
2854
|
+
});
|
|
2855
|
+
Typography.displayName = "Typography";
|
|
2856
|
+
// src/components/atoms/ui/toggle.tsx
|
|
2857
|
+
var React27 = __toESM(require("react"));
|
|
2858
|
+
var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"));
|
|
2859
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
2860
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2861
|
+
var toggleVariants = (0, import_class_variance_authority5.cva)("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", {
|
|
2862
|
+
variants: {
|
|
2863
|
+
variant: {
|
|
2864
|
+
default: "bg-transparent",
|
|
2865
|
+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
2866
|
+
},
|
|
2867
|
+
size: {
|
|
2868
|
+
default: "h-10 px-3",
|
|
2869
|
+
sm: "h-9 px-2.5",
|
|
2870
|
+
lg: "h-11 px-5"
|
|
2871
|
+
}
|
|
2872
|
+
},
|
|
2873
|
+
defaultVariants: {
|
|
2874
|
+
variant: "default",
|
|
2875
|
+
size: "default"
|
|
2876
|
+
}
|
|
2877
|
+
});
|
|
2878
|
+
var Toggle = React27.forwardRef(function(_param, ref) {
|
|
2879
|
+
var className = _param.className, variant = _param.variant, size = _param.size, props = _object_without_properties(_param, [
|
|
2880
|
+
"className",
|
|
2881
|
+
"variant",
|
|
2882
|
+
"size"
|
|
2883
|
+
]);
|
|
2884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TogglePrimitive.Root, _object_spread({
|
|
2885
|
+
ref: ref,
|
|
2886
|
+
className: cn(toggleVariants({
|
|
2887
|
+
variant: variant,
|
|
2888
|
+
size: size,
|
|
2889
|
+
className: className
|
|
2890
|
+
}), "alq--toggle")
|
|
2891
|
+
}, props));
|
|
2892
|
+
});
|
|
2893
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
2894
|
+
// src/components/atoms/ui/aspect-ratio.tsx
|
|
2895
|
+
var AspectRatioPrimitive = __toESM(require("@radix-ui/react-aspect-ratio"));
|
|
2896
|
+
// src/components/atoms/ui/breadcrumb.tsx
|
|
2897
|
+
var React28 = __toESM(require("react"));
|
|
2898
|
+
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
2899
|
+
var import_lucide_react10 = require("lucide-react");
|
|
2900
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2901
|
+
var Breadcrumb = React28.forwardRef(function(_param, ref) {
|
|
2902
|
+
var props = _extends({}, _object_destructuring_empty(_param));
|
|
2903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("nav", _object_spread({
|
|
2904
|
+
ref: ref,
|
|
2905
|
+
"aria-label": "breadcrumb"
|
|
2906
|
+
}, props));
|
|
2907
|
+
});
|
|
2908
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
2909
|
+
var BreadcrumbList = React28.forwardRef(function(_param, ref) {
|
|
2910
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2911
|
+
"className"
|
|
2912
|
+
]);
|
|
2913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ol", _object_spread({
|
|
2914
|
+
ref: ref,
|
|
2915
|
+
className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className)
|
|
2916
|
+
}, props));
|
|
2917
|
+
});
|
|
2918
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
2919
|
+
var BreadcrumbItem = React28.forwardRef(function(_param, ref) {
|
|
2920
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2921
|
+
"className"
|
|
2922
|
+
]);
|
|
2923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("li", _object_spread({
|
|
2924
|
+
ref: ref,
|
|
2925
|
+
className: cn("inline-flex items-center gap-1.5", className)
|
|
2926
|
+
}, props));
|
|
2927
|
+
});
|
|
2928
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
2929
|
+
var BreadcrumbLink = React28.forwardRef(function(_param, ref) {
|
|
2930
|
+
var asChild = _param.asChild, className = _param.className, props = _object_without_properties(_param, [
|
|
2931
|
+
"asChild",
|
|
2932
|
+
"className"
|
|
2933
|
+
]);
|
|
2934
|
+
var Comp = asChild ? import_react_slot2.Slot : "a";
|
|
2935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Comp, _object_spread({
|
|
2936
|
+
ref: ref,
|
|
2937
|
+
className: cn("transition-colors hover:text-foreground", className)
|
|
2938
|
+
}, props));
|
|
2939
|
+
});
|
|
2940
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
2941
|
+
var BreadcrumbPage = React28.forwardRef(function(_param, ref) {
|
|
2942
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2943
|
+
"className"
|
|
2944
|
+
]);
|
|
2945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", _object_spread({
|
|
2946
|
+
ref: ref,
|
|
2947
|
+
role: "link",
|
|
2948
|
+
"aria-disabled": "true",
|
|
2949
|
+
"aria-current": "page",
|
|
2950
|
+
className: cn("font-normal text-foreground", className)
|
|
2951
|
+
}, props));
|
|
2952
|
+
});
|
|
2953
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
2954
|
+
var BreadcrumbSeparator = function(_param) {
|
|
2955
|
+
var children = _param.children, className = _param.className, props = _object_without_properties(_param, [
|
|
2956
|
+
"children",
|
|
2957
|
+
"className"
|
|
2958
|
+
]);
|
|
2959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("li", _object_spread_props(_object_spread({
|
|
2960
|
+
role: "presentation",
|
|
2961
|
+
"aria-hidden": "true",
|
|
2962
|
+
className: cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)
|
|
2963
|
+
}, props), {
|
|
2964
|
+
children: children !== null && children !== void 0 ? children : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react10.ChevronRight, {})
|
|
2965
|
+
}));
|
|
2966
|
+
};
|
|
2967
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
2968
|
+
var BreadcrumbEllipsis = function(_param) {
|
|
2969
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2970
|
+
"className"
|
|
2971
|
+
]);
|
|
2972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", _object_spread_props(_object_spread({
|
|
2973
|
+
role: "presentation",
|
|
2974
|
+
"aria-hidden": "true",
|
|
2975
|
+
className: cn("flex h-9 w-9 items-center justify-center", className)
|
|
2976
|
+
}, props), {
|
|
2977
|
+
children: [
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react10.MoreHorizontal, {
|
|
2979
|
+
className: "h-4 w-4"
|
|
2980
|
+
}),
|
|
2981
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", {
|
|
2982
|
+
className: "sr-only",
|
|
2983
|
+
children: "More"
|
|
2984
|
+
})
|
|
2985
|
+
]
|
|
2986
|
+
}));
|
|
2987
|
+
};
|
|
2988
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
2989
|
+
// src/components/molecules/alert-dialog.tsx
|
|
2990
|
+
var React29 = __toESM(require("react"));
|
|
2991
|
+
var AlertDialogPrimitive = __toESM(require("@radix-ui/react-alert-dialog"));
|
|
2992
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2993
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
2994
|
+
var AlertDialogOverlay = React29.forwardRef(function(_param, ref) {
|
|
2995
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
2996
|
+
"className"
|
|
2997
|
+
]);
|
|
2998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogPrimitive.Overlay, _object_spread_props(_object_spread({
|
|
2999
|
+
className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className)
|
|
3000
|
+
}, props), {
|
|
3001
|
+
ref: ref
|
|
3002
|
+
}));
|
|
3003
|
+
});
|
|
3004
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
3005
|
+
var AlertDialogContent = React29.forwardRef(function(_param, ref) {
|
|
3006
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3007
|
+
"className"
|
|
3008
|
+
]);
|
|
3009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(AlertDialogPortal, {
|
|
3010
|
+
children: [
|
|
3011
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogOverlay, {}),
|
|
3012
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogPrimitive.Content, _object_spread({
|
|
3013
|
+
ref: ref,
|
|
3014
|
+
className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className)
|
|
3015
|
+
}, props))
|
|
3016
|
+
]
|
|
3017
|
+
});
|
|
3018
|
+
});
|
|
3019
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
3020
|
+
var AlertDialogHeader = function(_param) {
|
|
3021
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3022
|
+
"className"
|
|
3023
|
+
]);
|
|
3024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", _object_spread({
|
|
3025
|
+
className: cn("flex flex-col space-y-2 text-center sm:text-left", className)
|
|
3026
|
+
}, props));
|
|
3027
|
+
};
|
|
3028
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
3029
|
+
var AlertDialogFooter = function(_param) {
|
|
3030
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3031
|
+
"className"
|
|
3032
|
+
]);
|
|
3033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", _object_spread({
|
|
3034
|
+
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
|
|
3035
|
+
}, props));
|
|
3036
|
+
};
|
|
3037
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
3038
|
+
var AlertDialogTitle = React29.forwardRef(function(_param, ref) {
|
|
3039
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3040
|
+
"className"
|
|
3041
|
+
]);
|
|
3042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogPrimitive.Title, _object_spread({
|
|
3043
|
+
ref: ref,
|
|
3044
|
+
className: cn("text-lg font-semibold", className)
|
|
3045
|
+
}, props));
|
|
3046
|
+
});
|
|
3047
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
3048
|
+
var AlertDialogDescription = React29.forwardRef(function(_param, ref) {
|
|
3049
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3050
|
+
"className"
|
|
3051
|
+
]);
|
|
3052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogPrimitive.Description, _object_spread({
|
|
3053
|
+
ref: ref,
|
|
3054
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
3055
|
+
}, props));
|
|
3056
|
+
});
|
|
3057
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
3058
|
+
var AlertDialogAction = React29.forwardRef(function(_param, ref) {
|
|
3059
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3060
|
+
"className"
|
|
3061
|
+
]);
|
|
3062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogPrimitive.Action, _object_spread({
|
|
3063
|
+
ref: ref,
|
|
3064
|
+
className: cn(buttonVariants(), className)
|
|
3065
|
+
}, props));
|
|
3066
|
+
});
|
|
3067
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
3068
|
+
var AlertDialogCancel = React29.forwardRef(function(_param, ref) {
|
|
3069
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3070
|
+
"className"
|
|
3071
|
+
]);
|
|
3072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogPrimitive.Cancel, _object_spread({
|
|
3073
|
+
ref: ref,
|
|
3074
|
+
className: cn(buttonVariants({
|
|
3075
|
+
variant: "outline"
|
|
3076
|
+
}), "mt-2 sm:mt-0", className)
|
|
3077
|
+
}, props));
|
|
3078
|
+
});
|
|
3079
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
3080
|
+
// src/components/atoms/ui/toast.tsx
|
|
3081
|
+
var React30 = __toESM(require("react"));
|
|
3082
|
+
var ToastPrimitives = __toESM(require("@radix-ui/react-toast"));
|
|
3083
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
3084
|
+
var import_lucide_react11 = require("lucide-react");
|
|
3085
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3086
|
+
var ToastViewport = React30.forwardRef(function(_param, ref) {
|
|
3087
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3088
|
+
"className"
|
|
3089
|
+
]);
|
|
3090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ToastPrimitives.Viewport, _object_spread({
|
|
3091
|
+
ref: ref,
|
|
3092
|
+
className: cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]", className)
|
|
3093
|
+
}, props));
|
|
3094
|
+
});
|
|
3095
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
3096
|
+
var toastVariants = (0, import_class_variance_authority6.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", {
|
|
3097
|
+
variants: {
|
|
3098
|
+
variant: {
|
|
3099
|
+
default: "border bg-background text-foreground",
|
|
3100
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
|
|
3101
|
+
}
|
|
3102
|
+
},
|
|
3103
|
+
defaultVariants: {
|
|
3104
|
+
variant: "default"
|
|
3105
|
+
}
|
|
3106
|
+
});
|
|
3107
|
+
var Toast = React30.forwardRef(function(_param, ref) {
|
|
3108
|
+
var className = _param.className, variant = _param.variant, props = _object_without_properties(_param, [
|
|
3109
|
+
"className",
|
|
3110
|
+
"variant"
|
|
3111
|
+
]);
|
|
3112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ToastPrimitives.Root, _object_spread({
|
|
3113
|
+
ref: ref,
|
|
3114
|
+
className: cn(toastVariants({
|
|
3115
|
+
variant: variant
|
|
3116
|
+
}), className)
|
|
3117
|
+
}, props));
|
|
3118
|
+
});
|
|
3119
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
3120
|
+
var ToastAction = React30.forwardRef(function(_param, ref) {
|
|
3121
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3122
|
+
"className"
|
|
3123
|
+
]);
|
|
3124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ToastPrimitives.Action, _object_spread({
|
|
3125
|
+
ref: ref,
|
|
3126
|
+
className: cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive", className)
|
|
3127
|
+
}, props));
|
|
3128
|
+
});
|
|
3129
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
3130
|
+
var ToastClose = React30.forwardRef(function(_param, ref) {
|
|
3131
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3132
|
+
"className"
|
|
3133
|
+
]);
|
|
3134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ToastPrimitives.Close, _object_spread_props(_object_spread({
|
|
3135
|
+
ref: ref,
|
|
3136
|
+
className: cn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className),
|
|
3137
|
+
"toast-close": ""
|
|
3138
|
+
}, props), {
|
|
3139
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react11.X, {
|
|
3140
|
+
className: "h-4 w-4"
|
|
3141
|
+
})
|
|
3142
|
+
}));
|
|
3143
|
+
});
|
|
3144
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
3145
|
+
var ToastTitle = React30.forwardRef(function(_param, ref) {
|
|
3146
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3147
|
+
"className"
|
|
3148
|
+
]);
|
|
3149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ToastPrimitives.Title, _object_spread({
|
|
3150
|
+
ref: ref,
|
|
3151
|
+
className: cn("text-sm font-semibold", className)
|
|
3152
|
+
}, props));
|
|
3153
|
+
});
|
|
3154
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
3155
|
+
var ToastDescription = React30.forwardRef(function(_param, ref) {
|
|
3156
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3157
|
+
"className"
|
|
3158
|
+
]);
|
|
3159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ToastPrimitives.Description, _object_spread({
|
|
3160
|
+
ref: ref,
|
|
3161
|
+
className: cn("text-sm opacity-90", className)
|
|
3162
|
+
}, props));
|
|
3163
|
+
});
|
|
3164
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
3165
|
+
// src/components/atoms/ui/loader.tsx
|
|
3166
|
+
var React31 = __toESM(require("react"));
|
|
3167
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
3168
|
+
var import_lucide_react12 = require("lucide-react");
|
|
3169
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3170
|
+
var loaderVariants = (0, import_class_variance_authority7.cva)("flex justify-center items-center w-full", {
|
|
3171
|
+
variants: {
|
|
3172
|
+
size: {
|
|
3173
|
+
small: "h-6 w-6",
|
|
3174
|
+
medium: "h-8 w-8",
|
|
3175
|
+
large: "h-12 w-12",
|
|
3176
|
+
xl: "h-24 w-24"
|
|
3177
|
+
},
|
|
3178
|
+
colorVariant: {
|
|
3179
|
+
default: "text-primary",
|
|
3180
|
+
primary: "text-primary",
|
|
3181
|
+
secondary: "text-secondary",
|
|
3182
|
+
destructive: "text-destructive"
|
|
3183
|
+
}
|
|
3184
|
+
},
|
|
3185
|
+
defaultVariants: {
|
|
3186
|
+
size: "medium",
|
|
3187
|
+
colorVariant: "default"
|
|
3188
|
+
}
|
|
3189
|
+
});
|
|
3190
|
+
var Loader = React31.forwardRef(function(_param, ref) {
|
|
3191
|
+
var className = _param.className, size = _param.size, colorVariant = _param.colorVariant, props = _object_without_properties(_param, [
|
|
3192
|
+
"className",
|
|
3193
|
+
"size",
|
|
3194
|
+
"colorVariant"
|
|
3195
|
+
]);
|
|
3196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", _object_spread_props(_object_spread({
|
|
3197
|
+
ref: ref,
|
|
3198
|
+
className: cn(loaderVariants({
|
|
3199
|
+
size: size,
|
|
3200
|
+
colorVariant: colorVariant
|
|
3201
|
+
}), "flex justify-center items-center h-full w-full", className)
|
|
3202
|
+
}, props), {
|
|
3203
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react12.Loader2, {
|
|
3204
|
+
className: "animate-spin"
|
|
3205
|
+
})
|
|
3206
|
+
}));
|
|
3207
|
+
});
|
|
3208
|
+
Loader.displayName = "Loader";
|
|
3209
|
+
// src/components/hooks/use-toast.ts
|
|
3210
|
+
var React32 = __toESM(require("react"));
|
|
3211
|
+
// src/components/atoms/ui/toaster.tsx
|
|
3212
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3213
|
+
// src/components/atoms/ui/think-indicator.tsx
|
|
3214
|
+
var React33 = __toESM(require("react"));
|
|
3215
|
+
var import_react3 = require("react");
|
|
3216
|
+
var import_class_variance_authority8 = require("class-variance-authority");
|
|
3217
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3218
|
+
var thinkIndicatorVariants = (0, import_class_variance_authority8.cva)("flex items-center gap-3", {
|
|
3219
|
+
variants: {
|
|
3220
|
+
variant: {
|
|
3221
|
+
default: "text-muted-foreground",
|
|
3222
|
+
primary: "text-primary",
|
|
3223
|
+
secondary: "text-secondary"
|
|
3224
|
+
},
|
|
3225
|
+
size: {
|
|
3226
|
+
default: "gap-3",
|
|
3227
|
+
sm: "gap-2",
|
|
3228
|
+
lg: "gap-4"
|
|
3229
|
+
}
|
|
3230
|
+
},
|
|
3231
|
+
defaultVariants: {
|
|
3232
|
+
variant: "default",
|
|
3233
|
+
size: "default"
|
|
3234
|
+
}
|
|
3235
|
+
});
|
|
3236
|
+
var ThinkIndicator = React33.forwardRef(function(_param, ref) {
|
|
3237
|
+
var className = _param.className, variant = _param.variant, size = _param.size, _param_thoughts = _param.thoughts, thoughts = _param_thoughts === void 0 ? [
|
|
3238
|
+
"Analyzing your request...",
|
|
3239
|
+
"Processing information...",
|
|
3240
|
+
"Formulating response..."
|
|
3241
|
+
] : _param_thoughts, _param_interval = _param.interval, interval = _param_interval === void 0 ? 5e3 : _param_interval, loader = _param.loader, props = _object_without_properties(_param, [
|
|
3242
|
+
"className",
|
|
3243
|
+
"variant",
|
|
3244
|
+
"size",
|
|
3245
|
+
"thoughts",
|
|
3246
|
+
"interval",
|
|
3247
|
+
"loader"
|
|
3248
|
+
]);
|
|
3249
|
+
var _ref = _sliced_to_array((0, import_react3.useState)(0), 2), currentThoughtIndex = _ref[0], setCurrentThoughtIndex = _ref[1];
|
|
3250
|
+
var _ref1 = _sliced_to_array((0, import_react3.useState)(false), 2), isAnimating = _ref1[0], setIsAnimating = _ref1[1];
|
|
3251
|
+
(0, import_react3.useEffect)(function() {
|
|
3252
|
+
var timer = setInterval(function() {
|
|
3253
|
+
setIsAnimating(true);
|
|
3254
|
+
setTimeout(function() {
|
|
3255
|
+
setCurrentThoughtIndex(function(prev) {
|
|
3256
|
+
return prev < thoughts.length - 1 ? prev + 1 : prev;
|
|
3257
|
+
});
|
|
3258
|
+
setIsAnimating(false);
|
|
3259
|
+
}, 300);
|
|
3260
|
+
}, interval);
|
|
3261
|
+
if (currentThoughtIndex === thoughts.length - 1) {
|
|
3262
|
+
clearInterval(timer);
|
|
3263
|
+
}
|
|
3264
|
+
return function() {
|
|
3265
|
+
return clearInterval(timer);
|
|
3266
|
+
};
|
|
3267
|
+
}, [
|
|
3268
|
+
thoughts,
|
|
3269
|
+
interval,
|
|
3270
|
+
currentThoughtIndex
|
|
3271
|
+
]);
|
|
3272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", _object_spread_props(_object_spread({
|
|
3273
|
+
ref: ref,
|
|
3274
|
+
className: cn(thinkIndicatorVariants({
|
|
3275
|
+
variant: variant,
|
|
3276
|
+
size: size
|
|
3277
|
+
}), className, "alq--think-indicator")
|
|
3278
|
+
}, props), {
|
|
3279
|
+
children: [
|
|
3280
|
+
loader || /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Loader, {
|
|
3281
|
+
className: cn(size === "sm" ? "h-3 w-3" : size === "lg" ? "h-5 w-5" : "h-4 w-4")
|
|
3282
|
+
}),
|
|
3283
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", {
|
|
3284
|
+
className: cn("alq--think-indicator-text", "transition-all duration-300", isAnimating ? "opacity-0 -translate-y-2" : "opacity-100 translate-y-0"),
|
|
3285
|
+
children: thoughts[currentThoughtIndex]
|
|
3286
|
+
})
|
|
3287
|
+
]
|
|
3288
|
+
}));
|
|
3289
|
+
});
|
|
3290
|
+
ThinkIndicator.displayName = "ThinkIndicator";
|
|
3291
|
+
// src/components/molecules/page-container.tsx
|
|
3292
|
+
var import_react4 = require("react");
|
|
3293
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3294
|
+
var PageContainer = (0, import_react4.forwardRef)(function(_param, ref) {
|
|
3295
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3296
|
+
"className"
|
|
3297
|
+
]);
|
|
3298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", _object_spread({
|
|
3299
|
+
ref: ref,
|
|
3300
|
+
className: cn(className, "alq--page-container")
|
|
3301
|
+
}, props));
|
|
3302
|
+
});
|
|
3303
|
+
PageContainer.displayName = "PageContainer";
|
|
3304
|
+
// src/components/molecules/assistant-button.tsx
|
|
3305
|
+
var React34 = __toESM(require("react"));
|
|
3306
|
+
var import_react5 = require("react");
|
|
3307
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3308
|
+
var AssistantSuggestions = React34.forwardRef(function(param, ref) {
|
|
3309
|
+
var suggestions = param.suggestions, showSuggestions = param.showSuggestions, className = param.className;
|
|
3310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", {
|
|
3311
|
+
ref: ref,
|
|
3312
|
+
className: cn("absolute bottom-[calc(100%+0.5rem)] right-0 pb-2 mb-4 alq--assistant-suggestions-container", "transition-all duration-300", showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4", className),
|
|
3313
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", {
|
|
3314
|
+
className: "rounded-lg p-2 pr-0 w-64",
|
|
3315
|
+
children: suggestions.map(function(suggestion, index) {
|
|
3316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("button", {
|
|
3317
|
+
onClick: function() {
|
|
3318
|
+
var _suggestion_action;
|
|
3319
|
+
return (_suggestion_action = suggestion.action) === null || _suggestion_action === void 0 ? void 0 : _suggestion_action.call(suggestion);
|
|
3320
|
+
},
|
|
3321
|
+
style: {
|
|
3322
|
+
transitionDelay: showSuggestions ? "".concat(index * 50, "ms") : "0ms"
|
|
3323
|
+
},
|
|
3324
|
+
className: cn("bg-background flex items-center gap-2 border p-2 pr-4 my-2 rounded-full ml-auto", "text-primary hover:bg-secondary", "transition-all duration-100", "origin-bottom w-fit", "alq--assistant-suggestion", showSuggestions ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"),
|
|
3325
|
+
children: [
|
|
3326
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(suggestion.icon, {
|
|
3327
|
+
className: "w-5 h-5 text-primary"
|
|
3328
|
+
}),
|
|
3329
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", {
|
|
3330
|
+
className: "text-xs whitespace-nowrap font-normal",
|
|
3331
|
+
children: suggestion.label
|
|
3332
|
+
})
|
|
3333
|
+
]
|
|
3334
|
+
}, index);
|
|
3335
|
+
})
|
|
3336
|
+
})
|
|
3337
|
+
});
|
|
3338
|
+
});
|
|
3339
|
+
AssistantSuggestions.displayName = "Suggestions";
|
|
3340
|
+
var AssistantButton = React34.forwardRef(function(param, ref) {
|
|
3341
|
+
var Icon2 = param.icon, clickAction = param.clickAction, className = param.className, _param_suggestions = param.suggestions, suggestions = _param_suggestions === void 0 ? [] : _param_suggestions;
|
|
3342
|
+
var _ref = _sliced_to_array((0, import_react5.useState)(false), 2), isVisible = _ref[0], setIsVisible = _ref[1];
|
|
3343
|
+
var _ref1 = _sliced_to_array((0, import_react5.useState)(false), 2), showSuggestions = _ref1[0], setShowSuggestions = _ref1[1];
|
|
3344
|
+
var handleMouseEnter = function() {
|
|
3345
|
+
setIsVisible(true);
|
|
3346
|
+
requestAnimationFrame(function() {
|
|
3347
|
+
requestAnimationFrame(function() {
|
|
3348
|
+
setShowSuggestions(true);
|
|
3349
|
+
});
|
|
3350
|
+
});
|
|
3351
|
+
};
|
|
3352
|
+
var handleMouseLeave = function() {
|
|
3353
|
+
setShowSuggestions(false);
|
|
3354
|
+
setTimeout(function() {
|
|
3355
|
+
return setIsVisible(false);
|
|
3356
|
+
}, 300);
|
|
3357
|
+
};
|
|
3358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", {
|
|
3359
|
+
ref: ref,
|
|
3360
|
+
className: cn("fixed bottom-8 right-4 z-50", "alq--assistant-button-container", className),
|
|
3361
|
+
onMouseEnter: handleMouseEnter,
|
|
3362
|
+
onMouseLeave: handleMouseLeave,
|
|
3363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", {
|
|
3364
|
+
className: "relative group",
|
|
3365
|
+
children: [
|
|
3366
|
+
isVisible && suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AssistantSuggestions, {
|
|
3367
|
+
suggestions: suggestions,
|
|
3368
|
+
showSuggestions: showSuggestions
|
|
3369
|
+
}),
|
|
3370
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Button, {
|
|
3371
|
+
variant: "outline",
|
|
3372
|
+
size: "sm",
|
|
3373
|
+
className: cn("fixed hover:bg-opacity-70 transition-all duration-300", "bottom-4 h-12 w-12 right-4 z-50 rounded-full p-2", "shadow-md", "hover:shadow-lg", showSuggestions ? "scale-110" : "hover:scale-105", "alq--assistant-button"),
|
|
3374
|
+
onClick: clickAction,
|
|
3375
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon2, {
|
|
3376
|
+
style: {
|
|
3377
|
+
width: "22px",
|
|
3378
|
+
height: "22px"
|
|
3379
|
+
},
|
|
3380
|
+
className: "text-primary"
|
|
3381
|
+
})
|
|
3382
|
+
})
|
|
3383
|
+
]
|
|
3384
|
+
})
|
|
3385
|
+
});
|
|
3386
|
+
});
|
|
3387
|
+
AssistantButton.displayName = "AssistantButton";
|
|
3388
|
+
// src/components/molecules/carousel.tsx
|
|
3389
|
+
var React35 = __toESM(require("react"));
|
|
3390
|
+
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
3391
|
+
var import_lucide_react13 = require("lucide-react");
|
|
3392
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3393
|
+
var CarouselContext = React35.createContext(null);
|
|
3394
|
+
function useCarousel() {
|
|
3395
|
+
var context = React35.useContext(CarouselContext);
|
|
3396
|
+
if (!context) {
|
|
3397
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
3398
|
+
}
|
|
3399
|
+
return context;
|
|
3400
|
+
}
|
|
3401
|
+
var Carousel = React35.forwardRef(function(_param, ref) {
|
|
3402
|
+
var _param_orientation = _param.orientation, orientation = _param_orientation === void 0 ? "horizontal" : _param_orientation, opts2 = _param.opts, setApi = _param.setApi, plugins = _param.plugins, className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
3403
|
+
"orientation",
|
|
3404
|
+
"opts",
|
|
3405
|
+
"setApi",
|
|
3406
|
+
"plugins",
|
|
3407
|
+
"className",
|
|
3408
|
+
"children"
|
|
3409
|
+
]);
|
|
3410
|
+
var _ref = _sliced_to_array((0, import_embla_carousel_react.default)(_object_spread_props(_object_spread({}, opts2), {
|
|
3411
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
3412
|
+
}), plugins), 2), carouselRef = _ref[0], api = _ref[1];
|
|
3413
|
+
var _React35_useState = _sliced_to_array(React35.useState(false), 2), canScrollPrev = _React35_useState[0], setCanScrollPrev = _React35_useState[1];
|
|
3414
|
+
var _React35_useState1 = _sliced_to_array(React35.useState(false), 2), canScrollNext = _React35_useState1[0], setCanScrollNext = _React35_useState1[1];
|
|
3415
|
+
var onSelect = React35.useCallback(function(api2) {
|
|
3416
|
+
if (!api2) {
|
|
3417
|
+
return;
|
|
3418
|
+
}
|
|
3419
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
3420
|
+
setCanScrollNext(api2.canScrollNext());
|
|
3421
|
+
}, []);
|
|
3422
|
+
var scrollPrev = React35.useCallback(function() {
|
|
3423
|
+
api === null || api === void 0 ? void 0 : api.scrollPrev();
|
|
3424
|
+
}, [
|
|
3425
|
+
api
|
|
3426
|
+
]);
|
|
3427
|
+
var scrollNext = React35.useCallback(function() {
|
|
3428
|
+
api === null || api === void 0 ? void 0 : api.scrollNext();
|
|
3429
|
+
}, [
|
|
3430
|
+
api
|
|
3431
|
+
]);
|
|
3432
|
+
var handleKeyDown = React35.useCallback(function(event) {
|
|
3433
|
+
if (event.key === "ArrowLeft") {
|
|
3434
|
+
event.preventDefault();
|
|
3435
|
+
scrollPrev();
|
|
3436
|
+
} else if (event.key === "ArrowRight") {
|
|
3437
|
+
event.preventDefault();
|
|
3438
|
+
scrollNext();
|
|
3439
|
+
}
|
|
3440
|
+
}, [
|
|
3441
|
+
scrollPrev,
|
|
3442
|
+
scrollNext
|
|
3443
|
+
]);
|
|
3444
|
+
React35.useEffect(function() {
|
|
3445
|
+
if (!api || !setApi) {
|
|
3446
|
+
return;
|
|
3447
|
+
}
|
|
3448
|
+
setApi(api);
|
|
3449
|
+
}, [
|
|
3450
|
+
api,
|
|
3451
|
+
setApi
|
|
3452
|
+
]);
|
|
3453
|
+
React35.useEffect(function() {
|
|
3454
|
+
if (!api) {
|
|
3455
|
+
return;
|
|
3456
|
+
}
|
|
3457
|
+
onSelect(api);
|
|
3458
|
+
api.on("reInit", onSelect);
|
|
3459
|
+
api.on("select", onSelect);
|
|
3460
|
+
return function() {
|
|
3461
|
+
api === null || api === void 0 ? void 0 : api.off("select", onSelect);
|
|
3462
|
+
};
|
|
3463
|
+
}, [
|
|
3464
|
+
api,
|
|
3465
|
+
onSelect
|
|
3466
|
+
]);
|
|
3467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CarouselContext.Provider, {
|
|
3468
|
+
value: {
|
|
3469
|
+
carouselRef: carouselRef,
|
|
3470
|
+
api: api,
|
|
3471
|
+
opts: opts2,
|
|
3472
|
+
orientation: orientation || ((opts2 === null || opts2 === void 0 ? void 0 : opts2.axis) === "y" ? "vertical" : "horizontal"),
|
|
3473
|
+
scrollPrev: scrollPrev,
|
|
3474
|
+
scrollNext: scrollNext,
|
|
3475
|
+
canScrollPrev: canScrollPrev,
|
|
3476
|
+
canScrollNext: canScrollNext
|
|
3477
|
+
},
|
|
3478
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", _object_spread_props(_object_spread({
|
|
3479
|
+
ref: ref,
|
|
3480
|
+
onKeyDownCapture: handleKeyDown,
|
|
3481
|
+
className: cn("relative", className),
|
|
3482
|
+
role: "region",
|
|
3483
|
+
"aria-roledescription": "carousel"
|
|
3484
|
+
}, props), {
|
|
3485
|
+
children: children
|
|
3486
|
+
}))
|
|
3487
|
+
});
|
|
3488
|
+
});
|
|
3489
|
+
Carousel.displayName = "Carousel";
|
|
3490
|
+
var CarouselContent = React35.forwardRef(function(_param, ref) {
|
|
3491
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3492
|
+
"className"
|
|
3493
|
+
]);
|
|
3494
|
+
var _useCarousel = useCarousel(), carouselRef = _useCarousel.carouselRef, orientation = _useCarousel.orientation;
|
|
3495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", {
|
|
3496
|
+
ref: carouselRef,
|
|
3497
|
+
className: "overflow-hidden",
|
|
3498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", _object_spread({
|
|
3499
|
+
ref: ref,
|
|
3500
|
+
className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)
|
|
3501
|
+
}, props))
|
|
3502
|
+
});
|
|
3503
|
+
});
|
|
3504
|
+
CarouselContent.displayName = "CarouselContent";
|
|
3505
|
+
var CarouselItem = React35.forwardRef(function(_param, ref) {
|
|
3506
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3507
|
+
"className"
|
|
3508
|
+
]);
|
|
3509
|
+
var orientation = useCarousel().orientation;
|
|
3510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", _object_spread({
|
|
3511
|
+
ref: ref,
|
|
3512
|
+
role: "group",
|
|
3513
|
+
"aria-roledescription": "slide",
|
|
3514
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className)
|
|
3515
|
+
}, props));
|
|
3516
|
+
});
|
|
3517
|
+
CarouselItem.displayName = "CarouselItem";
|
|
3518
|
+
var CarouselPrevious = React35.forwardRef(function(_param, ref) {
|
|
3519
|
+
var className = _param.className, _param_variant = _param.variant, variant = _param_variant === void 0 ? "outline" : _param_variant, _param_size = _param.size, size = _param_size === void 0 ? "icon" : _param_size, props = _object_without_properties(_param, [
|
|
3520
|
+
"className",
|
|
3521
|
+
"variant",
|
|
3522
|
+
"size"
|
|
3523
|
+
]);
|
|
3524
|
+
var _useCarousel = useCarousel(), orientation = _useCarousel.orientation, scrollPrev = _useCarousel.scrollPrev, canScrollPrev = _useCarousel.canScrollPrev;
|
|
3525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Button, _object_spread_props(_object_spread({
|
|
3526
|
+
ref: ref,
|
|
3527
|
+
variant: variant,
|
|
3528
|
+
size: size,
|
|
3529
|
+
className: cn("absolute h-8 w-8 rounded-full", orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
3530
|
+
disabled: !canScrollPrev,
|
|
3531
|
+
onClick: scrollPrev
|
|
3532
|
+
}, props), {
|
|
3533
|
+
children: [
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react13.ArrowLeft, {
|
|
3535
|
+
className: "h-4 w-4"
|
|
3536
|
+
}),
|
|
3537
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", {
|
|
3538
|
+
className: "sr-only",
|
|
3539
|
+
children: "Previous slide"
|
|
3540
|
+
})
|
|
3541
|
+
]
|
|
3542
|
+
}));
|
|
3543
|
+
});
|
|
3544
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
3545
|
+
var CarouselNext = React35.forwardRef(function(_param, ref) {
|
|
3546
|
+
var className = _param.className, _param_variant = _param.variant, variant = _param_variant === void 0 ? "outline" : _param_variant, _param_size = _param.size, size = _param_size === void 0 ? "icon" : _param_size, props = _object_without_properties(_param, [
|
|
3547
|
+
"className",
|
|
3548
|
+
"variant",
|
|
3549
|
+
"size"
|
|
3550
|
+
]);
|
|
3551
|
+
var _useCarousel = useCarousel(), orientation = _useCarousel.orientation, scrollNext = _useCarousel.scrollNext, canScrollNext = _useCarousel.canScrollNext;
|
|
3552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Button, _object_spread_props(_object_spread({
|
|
3553
|
+
ref: ref,
|
|
3554
|
+
variant: variant,
|
|
3555
|
+
size: size,
|
|
3556
|
+
className: cn("absolute h-8 w-8 rounded-full", orientation === "horizontal" ? "-right-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
3557
|
+
disabled: !canScrollNext,
|
|
3558
|
+
onClick: scrollNext
|
|
3559
|
+
}, props), {
|
|
3560
|
+
children: [
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react13.ArrowRight, {
|
|
3562
|
+
className: "h-4 w-4"
|
|
3563
|
+
}),
|
|
3564
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", {
|
|
3565
|
+
className: "sr-only",
|
|
3566
|
+
children: "Next slide"
|
|
3567
|
+
})
|
|
3568
|
+
]
|
|
3569
|
+
}));
|
|
3570
|
+
});
|
|
3571
|
+
CarouselNext.displayName = "CarouselNext";
|
|
3572
|
+
// src/components/molecules/navigation-menu.tsx
|
|
3573
|
+
var React36 = __toESM(require("react"));
|
|
3574
|
+
var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"));
|
|
3575
|
+
var import_class_variance_authority9 = require("class-variance-authority");
|
|
3576
|
+
var import_lucide_react14 = require("lucide-react");
|
|
3577
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3578
|
+
var NavigationMenu = React36.forwardRef(function(_param, ref) {
|
|
3579
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
3580
|
+
"className",
|
|
3581
|
+
"children"
|
|
3582
|
+
]);
|
|
3583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(NavigationMenuPrimitive.Root, _object_spread_props(_object_spread({
|
|
3584
|
+
ref: ref,
|
|
3585
|
+
className: cn("relative z-10 flex max-w-max flex-1 items-center justify-center", className)
|
|
3586
|
+
}, props), {
|
|
3587
|
+
children: [
|
|
3588
|
+
children,
|
|
3589
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NavigationMenuViewport, {})
|
|
3590
|
+
]
|
|
3591
|
+
}));
|
|
3592
|
+
});
|
|
3593
|
+
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
3594
|
+
var NavigationMenuList = React36.forwardRef(function(_param, ref) {
|
|
3595
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3596
|
+
"className"
|
|
3597
|
+
]);
|
|
3598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NavigationMenuPrimitive.List, _object_spread({
|
|
3599
|
+
ref: ref,
|
|
3600
|
+
className: cn("group flex flex-1 list-none items-center justify-center space-x-1", className)
|
|
3601
|
+
}, props));
|
|
3602
|
+
});
|
|
3603
|
+
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
3604
|
+
var navigationMenuTriggerStyle = (0, import_class_variance_authority9.cva)("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50");
|
|
3605
|
+
var NavigationMenuTrigger = React36.forwardRef(function(_param, ref) {
|
|
3606
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
3607
|
+
"className",
|
|
3608
|
+
"children"
|
|
3609
|
+
]);
|
|
3610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(NavigationMenuPrimitive.Trigger, _object_spread_props(_object_spread({
|
|
3611
|
+
ref: ref,
|
|
3612
|
+
className: cn(navigationMenuTriggerStyle(), "group", className)
|
|
3613
|
+
}, props), {
|
|
3614
|
+
children: [
|
|
3615
|
+
children,
|
|
3616
|
+
" ",
|
|
3617
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react14.ChevronDown, {
|
|
3618
|
+
className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180",
|
|
3619
|
+
"aria-hidden": "true"
|
|
3620
|
+
})
|
|
3621
|
+
]
|
|
3622
|
+
}));
|
|
3623
|
+
});
|
|
3624
|
+
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
3625
|
+
var NavigationMenuContent = React36.forwardRef(function(_param, ref) {
|
|
3626
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3627
|
+
"className"
|
|
3628
|
+
]);
|
|
3629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NavigationMenuPrimitive.Content, _object_spread({
|
|
3630
|
+
ref: ref,
|
|
3631
|
+
className: cn("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ", className)
|
|
3632
|
+
}, props));
|
|
3633
|
+
});
|
|
3634
|
+
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
3635
|
+
var NavigationMenuViewport = React36.forwardRef(function(_param, ref) {
|
|
3636
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3637
|
+
"className"
|
|
3638
|
+
]);
|
|
3639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", {
|
|
3640
|
+
className: cn("absolute left-0 top-full flex justify-center"),
|
|
3641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NavigationMenuPrimitive.Viewport, _object_spread({
|
|
3642
|
+
className: cn("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]", className),
|
|
3643
|
+
ref: ref
|
|
3644
|
+
}, props))
|
|
3645
|
+
});
|
|
3646
|
+
});
|
|
3647
|
+
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
3648
|
+
var NavigationMenuIndicator = React36.forwardRef(function(_param, ref) {
|
|
3649
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
3650
|
+
"className"
|
|
3651
|
+
]);
|
|
3652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NavigationMenuPrimitive.Indicator, _object_spread_props(_object_spread({
|
|
3653
|
+
ref: ref,
|
|
3654
|
+
className: cn("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in", className)
|
|
3655
|
+
}, props), {
|
|
3656
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", {
|
|
3657
|
+
className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"
|
|
3658
|
+
})
|
|
3659
|
+
}));
|
|
3660
|
+
});
|
|
3661
|
+
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
3662
|
+
// src/components/molecules/sidebar.tsx
|
|
3663
|
+
var React37 = __toESM(require("react"));
|
|
3664
|
+
var import_class_variance_authority10 = require("class-variance-authority");
|
|
3665
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3666
|
+
var sidebarVariants = (0, import_class_variance_authority10.cva)("flex flex-col border-r", {
|
|
3667
|
+
variants: {
|
|
3668
|
+
size: {
|
|
3669
|
+
sm: "w-48",
|
|
3670
|
+
default: "w-64",
|
|
3671
|
+
lg: "w-72"
|
|
3672
|
+
}
|
|
3673
|
+
},
|
|
3674
|
+
defaultVariants: {
|
|
3675
|
+
size: "default"
|
|
3676
|
+
}
|
|
3677
|
+
});
|
|
3678
|
+
var SidebarFooter = React37.forwardRef(function(_param, ref) {
|
|
3679
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
3680
|
+
"className",
|
|
3681
|
+
"children"
|
|
3682
|
+
]);
|
|
3683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", _object_spread_props(_object_spread({
|
|
3684
|
+
ref: ref,
|
|
3685
|
+
className: cn("p-4", className)
|
|
3686
|
+
}, props), {
|
|
3687
|
+
children: children
|
|
3688
|
+
}));
|
|
3689
|
+
});
|
|
3690
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
3691
|
+
var Sidebar = React37.forwardRef(function(_param, ref) {
|
|
3692
|
+
var className = _param.className, items = _param.items, selectedSection = _param.selectedSection, onSelect = _param.onSelect, footerContent = _param.footerContent, _param_size = _param.size, size = _param_size === void 0 ? "default" : _param_size, _param_selectedVariant = _param.selectedVariant, selectedVariant = _param_selectedVariant === void 0 ? "secondary" : _param_selectedVariant, _param_defaultVariant = _param.defaultVariant, defaultVariant = _param_defaultVariant === void 0 ? "ghost" : _param_defaultVariant, buttonClassName = _param.buttonClassName, props = _object_without_properties(_param, [
|
|
3693
|
+
"className",
|
|
3694
|
+
"items",
|
|
3695
|
+
"selectedSection",
|
|
3696
|
+
"onSelect",
|
|
3697
|
+
"footerContent",
|
|
3698
|
+
"size",
|
|
3699
|
+
"selectedVariant",
|
|
3700
|
+
"defaultVariant",
|
|
3701
|
+
"buttonClassName"
|
|
3702
|
+
]);
|
|
3703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", _object_spread_props(_object_spread({
|
|
3704
|
+
className: cn(className, "alq--navigation-sidebar h-full"),
|
|
3705
|
+
ref: ref
|
|
3706
|
+
}, props), {
|
|
3707
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("aside", {
|
|
3708
|
+
className: cn(sidebarVariants({
|
|
3709
|
+
size: size
|
|
3710
|
+
}), "h-full"),
|
|
3711
|
+
children: [
|
|
3712
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ScrollArea, {
|
|
3713
|
+
className: "flex-grow justify-between",
|
|
3714
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", {
|
|
3715
|
+
className: "flex flex-col gap-2 p-4",
|
|
3716
|
+
children: items.map(function(item) {
|
|
3717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Button, {
|
|
3718
|
+
variant: (selectedSection === null || selectedSection === void 0 ? void 0 : selectedSection.name) === item.name ? selectedVariant : defaultVariant,
|
|
3719
|
+
className: cn("justify-start", buttonClassName),
|
|
3720
|
+
disabled: item.disabled,
|
|
3721
|
+
onClick: function() {
|
|
3722
|
+
if (onSelect) {
|
|
3723
|
+
onSelect(item);
|
|
3724
|
+
}
|
|
3725
|
+
},
|
|
3726
|
+
children: [
|
|
3727
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(item.icon, {
|
|
3728
|
+
className: "mr-2 h-4 w-4"
|
|
3729
|
+
}),
|
|
3730
|
+
item.name
|
|
3731
|
+
]
|
|
3732
|
+
}, item.name);
|
|
3733
|
+
})
|
|
3734
|
+
})
|
|
3735
|
+
}),
|
|
3736
|
+
footerContent && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SidebarFooter, {
|
|
3737
|
+
children: footerContent
|
|
3738
|
+
})
|
|
3739
|
+
]
|
|
3740
|
+
})
|
|
3741
|
+
}));
|
|
3742
|
+
});
|
|
3743
|
+
// src/components/molecules/sonner.tsx
|
|
3744
|
+
var import_sonner = require("sonner");
|
|
3745
|
+
// src/providers/theme-context.ts
|
|
3746
|
+
var import_react6 = require("react");
|
|
3747
|
+
var ThemeContext = (0, import_react6.createContext)({
|
|
3748
|
+
theme: "system",
|
|
3749
|
+
setTheme: function() {}
|
|
3750
|
+
});
|
|
3751
|
+
// src/components/molecules/sonner.tsx
|
|
3752
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3753
|
+
// src/components/molecules/rating-stars.tsx
|
|
3754
|
+
var React38 = __toESM(require("react"));
|
|
3755
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
3756
|
+
var import_lucide_react15 = require("lucide-react");
|
|
3757
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3758
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
3759
|
+
var Tooltip3 = TooltipPrimitive.Root;
|
|
3760
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
3761
|
+
var TooltipContent = React38.forwardRef(function(_param, ref) {
|
|
3762
|
+
var className = _param.className, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties(_param, [
|
|
3763
|
+
"className",
|
|
3764
|
+
"sideOffset"
|
|
3765
|
+
]);
|
|
3766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TooltipPrimitive.Content, _object_spread({
|
|
3767
|
+
ref: ref,
|
|
3768
|
+
sideOffset: sideOffset,
|
|
3769
|
+
className: cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
|
|
3770
|
+
}, props));
|
|
3771
|
+
});
|
|
3772
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
3773
|
+
var StarRating = React38.forwardRef(function(param, ref) {
|
|
3774
|
+
var rating = param.rating, onRate = param.onRate;
|
|
3775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", {
|
|
3776
|
+
ref: ref,
|
|
3777
|
+
className: "flex",
|
|
3778
|
+
children: [
|
|
3779
|
+
1,
|
|
3780
|
+
2,
|
|
3781
|
+
3,
|
|
3782
|
+
4,
|
|
3783
|
+
5
|
|
3784
|
+
].map(function(star) {
|
|
3785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Button, {
|
|
3786
|
+
onClick: function() {
|
|
3787
|
+
return onRate(star);
|
|
3788
|
+
},
|
|
3789
|
+
variant: "link",
|
|
3790
|
+
className: "p-1 transition-colors [&_svg]:size-5 h-5",
|
|
3791
|
+
"aria-label": "Rate ".concat(star, " star").concat(star !== 1 ? "s" : ""),
|
|
3792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react15.Star, {
|
|
3793
|
+
className: cn("w-5 h-5", star <= rating ? "alq-rating-star-active fill-current stroke-current" : "alq-rating-star-inactive")
|
|
3794
|
+
})
|
|
3795
|
+
}, star);
|
|
3796
|
+
})
|
|
3797
|
+
});
|
|
3798
|
+
});
|
|
3799
|
+
StarRating.displayName = "StarRating";
|
|
3800
|
+
var RatingStars = React38.forwardRef(function(param, ref) {
|
|
3801
|
+
var _param_currentRating = param.currentRating, currentRating = _param_currentRating === void 0 ? 0 : _param_currentRating, onRate = param.onRate, className = param.className, isLoading = param.isLoading;
|
|
3802
|
+
var _React38_useState = _sliced_to_array(React38.useState(false), 2), open = _React38_useState[0], setOpen = _React38_useState[1];
|
|
3803
|
+
var _React38_useState1 = _sliced_to_array(React38.useState(false), 2), animate = _React38_useState1[0], setAnimate = _React38_useState1[1];
|
|
3804
|
+
var handleRate = function(rating) {
|
|
3805
|
+
onRate(rating);
|
|
3806
|
+
setOpen(false);
|
|
3807
|
+
};
|
|
3808
|
+
React38.useEffect(function() {
|
|
3809
|
+
if (currentRating > 0) {
|
|
3810
|
+
setAnimate(true);
|
|
3811
|
+
var timer = setTimeout(function() {
|
|
3812
|
+
return setAnimate(false);
|
|
3813
|
+
}, 150);
|
|
3814
|
+
return function() {
|
|
3815
|
+
return clearTimeout(timer);
|
|
3816
|
+
};
|
|
3817
|
+
}
|
|
3818
|
+
}, [
|
|
3819
|
+
currentRating
|
|
3820
|
+
]);
|
|
3821
|
+
var hasRated = currentRating > 0;
|
|
3822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TooltipProvider, {
|
|
3823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Tooltip3, {
|
|
3824
|
+
open: open,
|
|
3825
|
+
onOpenChange: setOpen,
|
|
3826
|
+
children: [
|
|
3827
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TooltipTrigger, {
|
|
3828
|
+
asChild: true,
|
|
3829
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Button, {
|
|
3830
|
+
ref: ref,
|
|
3831
|
+
variant: "link",
|
|
3832
|
+
className: cn("inline-flex items-center justify-center rounded-md text-sm font-medium [&_svg]:size-5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", className),
|
|
3833
|
+
disabled: isLoading,
|
|
3834
|
+
onClick: function() {
|
|
3835
|
+
return setOpen(!open);
|
|
3836
|
+
},
|
|
3837
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react15.Star, {
|
|
3838
|
+
className: cn("w-5 h-5 transition-all duration-500", animate && "animate-ping", isLoading && "animate-pulse", hasRated ? "alq-rating-star-active fill-current stroke-current" : "alq-rating-star-inactive")
|
|
3839
|
+
})
|
|
3840
|
+
})
|
|
3841
|
+
}),
|
|
3842
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TooltipContent, {
|
|
3843
|
+
side: "top",
|
|
3844
|
+
align: "center",
|
|
3845
|
+
className: "p-0",
|
|
3846
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", {
|
|
3847
|
+
className: "p-2 bg-background",
|
|
3848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(StarRating, {
|
|
3849
|
+
rating: currentRating,
|
|
3850
|
+
onRate: handleRate
|
|
3851
|
+
})
|
|
3852
|
+
})
|
|
3853
|
+
})
|
|
3854
|
+
]
|
|
3855
|
+
})
|
|
3856
|
+
});
|
|
3857
|
+
});
|
|
3858
|
+
RatingStars.displayName = "RatingStars";
|
|
3859
|
+
// src/components/molecules/rating-thumbs.tsx
|
|
3860
|
+
var React39 = __toESM(require("react"));
|
|
3861
|
+
var import_lucide_react16 = require("lucide-react");
|
|
3862
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3863
|
+
var RatingThumbs = React39.forwardRef(function(param, ref) {
|
|
3864
|
+
var currentRating = param.currentRating, onRate = param.onRate, _param_direction = param.direction, direction = _param_direction === void 0 ? "row" : _param_direction, className = param.className, isLoading = param.isLoading;
|
|
3865
|
+
var _React39_useState = _sliced_to_array(React39.useState(false), 2), animate = _React39_useState[0], setAnimate = _React39_useState[1];
|
|
3866
|
+
React39.useEffect(function() {
|
|
3867
|
+
if (currentRating) {
|
|
3868
|
+
setAnimate(true);
|
|
3869
|
+
var timer = setTimeout(function() {
|
|
3870
|
+
return setAnimate(false);
|
|
3871
|
+
}, 150);
|
|
3872
|
+
return function() {
|
|
3873
|
+
return clearTimeout(timer);
|
|
3874
|
+
};
|
|
3875
|
+
}
|
|
3876
|
+
}, [
|
|
3877
|
+
currentRating
|
|
3878
|
+
]);
|
|
3879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", {
|
|
3880
|
+
ref: ref,
|
|
3881
|
+
className: cn("inline-flex", direction === "column" ? "flex-col" : "flex-row", "space-x-1 gap-4", className),
|
|
3882
|
+
children: [
|
|
3883
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, {
|
|
3884
|
+
variant: "link",
|
|
3885
|
+
onClick: function() {
|
|
3886
|
+
return onRate(currentRating === "thumbsUp" ? "" : "thumbsUp");
|
|
3887
|
+
},
|
|
3888
|
+
className: cn("p-1 transition-colors disabled:opacity-50 [&_svg]:size-5", "hover:alq-rating-thumbsup/10"),
|
|
3889
|
+
"aria-label": "Thumbs up",
|
|
3890
|
+
disabled: isLoading,
|
|
3891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react16.ThumbsUp, {
|
|
3892
|
+
className: cn("w-5 h-5 transition-all duration-500", animate && currentRating === "thumbsUp" && "animate-ping", isLoading && "animate-pulse", currentRating === "thumbsUp" ? "alq-rating-thumbsup fill-current stroke-current" : "alq-rating-thumbs-inactive fill-transparent")
|
|
3893
|
+
})
|
|
3894
|
+
}),
|
|
3895
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, {
|
|
3896
|
+
variant: "link",
|
|
3897
|
+
onClick: function() {
|
|
3898
|
+
return onRate(currentRating === "thumbsDown" ? "" : "thumbsDown");
|
|
3899
|
+
},
|
|
3900
|
+
className: cn("p-1 transition-colors disabled:opacity-50 mt-0.5 [&_svg]:size-5", "hover:bg-alq-rating-thumbsdown/10"),
|
|
3901
|
+
"aria-label": "Thumbs down",
|
|
3902
|
+
disabled: isLoading,
|
|
3903
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react16.ThumbsDown, {
|
|
3904
|
+
className: cn("w-5 h-5 transition-all duration-500", animate && currentRating === "thumbsDown" && "animate-ping", isLoading && "animate-pulse", currentRating === "thumbsDown" ? "alq-rating-thumbsdown fill-current stroke-current" : "alq-rating-thumbs-inactive fill-transparent")
|
|
3905
|
+
})
|
|
3906
|
+
})
|
|
3907
|
+
]
|
|
3908
|
+
});
|
|
3909
|
+
});
|
|
3910
|
+
RatingThumbs.displayName = "RatingThumbs";
|
|
3911
|
+
// src/components/molecules/rating-comment.tsx
|
|
3912
|
+
var React40 = __toESM(require("react"));
|
|
3913
|
+
var import_lucide_react17 = require("lucide-react");
|
|
3914
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3915
|
+
var RatingComment = React40.forwardRef(function(param, ref) {
|
|
3916
|
+
var currentRating = param.currentRating, onRate = param.onRate, className = param.className, isLoading = param.isLoading;
|
|
3917
|
+
var _React40_useState = _sliced_to_array(React40.useState(false), 2), open = _React40_useState[0], setOpen = _React40_useState[1];
|
|
3918
|
+
var _React40_useState1 = _sliced_to_array(React40.useState(""), 2), comment = _React40_useState1[0], setComment = _React40_useState1[1];
|
|
3919
|
+
var _React40_useState2 = _sliced_to_array(React40.useState(false), 2), animate = _React40_useState2[0], setAnimate = _React40_useState2[1];
|
|
3920
|
+
var handleRate = function() {
|
|
3921
|
+
onRate(comment);
|
|
3922
|
+
setOpen(false);
|
|
3923
|
+
};
|
|
3924
|
+
React40.useEffect(function() {
|
|
3925
|
+
if (currentRating) {
|
|
3926
|
+
setAnimate(true);
|
|
3927
|
+
var timer = setTimeout(function() {
|
|
3928
|
+
return setAnimate(false);
|
|
3929
|
+
}, 150);
|
|
3930
|
+
return function() {
|
|
3931
|
+
return clearTimeout(timer);
|
|
3932
|
+
};
|
|
3933
|
+
}
|
|
3934
|
+
}, [
|
|
3935
|
+
currentRating
|
|
3936
|
+
]);
|
|
3937
|
+
React40.useEffect(function() {
|
|
3938
|
+
setComment("");
|
|
3939
|
+
}, [
|
|
3940
|
+
open
|
|
3941
|
+
]);
|
|
3942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Dialog, {
|
|
3943
|
+
open: open,
|
|
3944
|
+
onOpenChange: setOpen,
|
|
3945
|
+
children: [
|
|
3946
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(DialogTrigger, {
|
|
3947
|
+
asChild: true,
|
|
3948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Button, {
|
|
3949
|
+
ref: ref,
|
|
3950
|
+
variant: "link",
|
|
3951
|
+
size: "lg",
|
|
3952
|
+
className: cn("inline-flex p-2 items-center justify-center rounded-md text-sm font-medium transition-colors [&_svg]:size-5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-transparent hover:none disabled:pointer-events-none disabled:opacity-50", className),
|
|
3953
|
+
disabled: isLoading,
|
|
3954
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react17.Book, {
|
|
3955
|
+
className: cn("w-5 h-5 transition-all duration-500", animate && "animate-ping", isLoading && "animate-pulse", "".concat(comment ? "alq-rating-comment" : "stroke-gray-400"))
|
|
3956
|
+
})
|
|
3957
|
+
})
|
|
3958
|
+
}),
|
|
3959
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(DialogOverlay, {
|
|
3960
|
+
className: "fixed inset-0 bg-black bg-opacity-50"
|
|
3961
|
+
}),
|
|
3962
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(DialogContent, {
|
|
3963
|
+
"aria-describedby": void 0,
|
|
3964
|
+
children: [
|
|
3965
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(DialogTitle, {
|
|
3966
|
+
className: "text-lg font-medium",
|
|
3967
|
+
children: "Deja un comentario"
|
|
3968
|
+
}),
|
|
3969
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("textarea", {
|
|
3970
|
+
className: "mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary",
|
|
3971
|
+
rows: 4,
|
|
3972
|
+
value: comment,
|
|
3973
|
+
onChange: function(e) {
|
|
3974
|
+
return setComment(e.target.value);
|
|
3975
|
+
}
|
|
3976
|
+
}),
|
|
3977
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", {
|
|
3978
|
+
className: "mt-4 flex justify-end",
|
|
3979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Button, {
|
|
3980
|
+
onClick: handleRate,
|
|
3981
|
+
disabled: !comment,
|
|
3982
|
+
children: "Enviar"
|
|
3983
|
+
})
|
|
3984
|
+
})
|
|
3985
|
+
]
|
|
3986
|
+
})
|
|
3987
|
+
]
|
|
3988
|
+
});
|
|
3989
|
+
});
|
|
3990
|
+
RatingComment.displayName = "RatingComment";
|
|
3991
|
+
// src/components/molecules/call-out.tsx
|
|
3992
|
+
var React41 = __toESM(require("react"));
|
|
3993
|
+
var import_lucide_react18 = require("lucide-react");
|
|
3994
|
+
// src/components/hooks/use-text-streaming.ts
|
|
3995
|
+
var import_react7 = require("react");
|
|
3996
|
+
var CHAR_DELAY = 15;
|
|
3997
|
+
var PUNCTUATION_DELAY = 300;
|
|
3998
|
+
function useTextStreaming(content, shouldStream, handleIsTextStreaming) {
|
|
3999
|
+
var _ref = _sliced_to_array((0, import_react7.useState)(""), 2), displayedText = _ref[0], setDisplayedText = _ref[1];
|
|
4000
|
+
var contentRef = (0, import_react7.useRef)(content);
|
|
4001
|
+
var indexRef = (0, import_react7.useRef)(0);
|
|
4002
|
+
var timerRef = (0, import_react7.useRef)(null);
|
|
4003
|
+
var hasStartedStreaming = (0, import_react7.useRef)(false);
|
|
4004
|
+
(0, import_react7.useEffect)(function() {
|
|
4005
|
+
contentRef.current = content;
|
|
4006
|
+
if (hasStartedStreaming.current && !timerRef.current && indexRef.current < contentRef.current.length) {
|
|
4007
|
+
typeNext();
|
|
4008
|
+
}
|
|
4009
|
+
}, [
|
|
4010
|
+
content
|
|
4011
|
+
]);
|
|
4012
|
+
var typeNext = (0, import_react7.useCallback)(function() {
|
|
4013
|
+
if (indexRef.current < contentRef.current.length) {
|
|
4014
|
+
var nextChar = contentRef.current.charAt(indexRef.current);
|
|
4015
|
+
setDisplayedText(function(prev) {
|
|
4016
|
+
return prev + nextChar;
|
|
4017
|
+
});
|
|
4018
|
+
indexRef.current++;
|
|
4019
|
+
var delay = /[.!?;:]/.test(nextChar) ? PUNCTUATION_DELAY : CHAR_DELAY;
|
|
4020
|
+
timerRef.current = setTimeout(function() {
|
|
4021
|
+
timerRef.current = null;
|
|
4022
|
+
typeNext();
|
|
4023
|
+
}, delay);
|
|
4024
|
+
} else {
|
|
4025
|
+
handleIsTextStreaming === null || handleIsTextStreaming === void 0 ? void 0 : handleIsTextStreaming(false);
|
|
4026
|
+
}
|
|
4027
|
+
}, []);
|
|
4028
|
+
(0, import_react7.useEffect)(function() {
|
|
4029
|
+
if (!shouldStream && !hasStartedStreaming.current) {
|
|
4030
|
+
setDisplayedText(contentRef.current);
|
|
4031
|
+
indexRef.current = contentRef.current.length;
|
|
4032
|
+
if (timerRef.current) {
|
|
4033
|
+
clearTimeout(timerRef.current);
|
|
4034
|
+
timerRef.current = null;
|
|
4035
|
+
}
|
|
4036
|
+
handleIsTextStreaming === null || handleIsTextStreaming === void 0 ? void 0 : handleIsTextStreaming(false);
|
|
4037
|
+
} else {
|
|
4038
|
+
if (indexRef.current < contentRef.current.length && !timerRef.current) {
|
|
4039
|
+
handleIsTextStreaming === null || handleIsTextStreaming === void 0 ? void 0 : handleIsTextStreaming(true);
|
|
4040
|
+
hasStartedStreaming.current = true;
|
|
4041
|
+
typeNext();
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
return function() {
|
|
4045
|
+
if (timerRef.current) {
|
|
4046
|
+
clearTimeout(timerRef.current);
|
|
4047
|
+
timerRef.current = null;
|
|
4048
|
+
}
|
|
4049
|
+
};
|
|
4050
|
+
}, [
|
|
4051
|
+
shouldStream,
|
|
4052
|
+
typeNext
|
|
4053
|
+
]);
|
|
4054
|
+
return displayedText;
|
|
4055
|
+
}
|
|
4056
|
+
// src/components/molecules/call-out.tsx
|
|
4057
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4058
|
+
var CallOut = React41.forwardRef(function(_param, ref) {
|
|
4059
|
+
var className = _param.className, children = _param.children, role = _param.role, props = _object_without_properties(_param, [
|
|
4060
|
+
"className",
|
|
4061
|
+
"children",
|
|
4062
|
+
"role"
|
|
4063
|
+
]);
|
|
4064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", _object_spread_props(_object_spread({
|
|
4065
|
+
ref: ref,
|
|
4066
|
+
className: cn("alq--callout-box", className),
|
|
4067
|
+
"data-role": role
|
|
4068
|
+
}, props), {
|
|
4069
|
+
children: children
|
|
4070
|
+
}));
|
|
4071
|
+
});
|
|
4072
|
+
var CallOutDate = React41.forwardRef(function(_param, ref) {
|
|
4073
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
4074
|
+
"className",
|
|
4075
|
+
"children"
|
|
4076
|
+
]);
|
|
4077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", _object_spread_props(_object_spread({
|
|
4078
|
+
ref: ref,
|
|
4079
|
+
className: cn("alq--callout-date", "text-sm text-muted-foreground", className)
|
|
4080
|
+
}, props), {
|
|
4081
|
+
children: children
|
|
4082
|
+
}));
|
|
4083
|
+
});
|
|
4084
|
+
var CallOutActions = React41.forwardRef(function(_param, ref) {
|
|
4085
|
+
var className = _param.className, actions = _param.actions, role = _param.role, message = _param.message, props = _object_without_properties(_param, [
|
|
4086
|
+
"className",
|
|
4087
|
+
"actions",
|
|
4088
|
+
"role",
|
|
4089
|
+
"message"
|
|
4090
|
+
]);
|
|
4091
|
+
var _React41_useState = _sliced_to_array(React41.useState(false), 2), isLoading = _React41_useState[0], setIsLoading = _React41_useState[1];
|
|
4092
|
+
var _React41_useState1 = _sliced_to_array(React41.useState(false), 2), isClicked = _React41_useState1[0], setIsClicked = _React41_useState1[1];
|
|
4093
|
+
if (role === "user") {
|
|
4094
|
+
return null;
|
|
4095
|
+
}
|
|
4096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", _object_spread_props(_object_spread({
|
|
4097
|
+
ref: ref,
|
|
4098
|
+
className: cn("alq--callout-actions", className)
|
|
4099
|
+
}, props), {
|
|
4100
|
+
children: actions.map(function(action) {
|
|
4101
|
+
var _action_component;
|
|
4102
|
+
return action.custom ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(React41.Fragment, {
|
|
4103
|
+
children: (_action_component = action.component) === null || _action_component === void 0 ? void 0 : _action_component.call(action, {
|
|
4104
|
+
message: message
|
|
4105
|
+
})
|
|
4106
|
+
}, action.label) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("button", {
|
|
4107
|
+
className: cn("alq--callout-action", {
|
|
4108
|
+
"alq--callout-animate-action": isLoading
|
|
4109
|
+
}, {
|
|
4110
|
+
"alq--callout-clicked-action": isClicked
|
|
4111
|
+
}),
|
|
4112
|
+
type: "button",
|
|
4113
|
+
title: action.label,
|
|
4114
|
+
onClick: function() {
|
|
4115
|
+
setIsLoading(true);
|
|
4116
|
+
action.onClick(message).then(function() {
|
|
4117
|
+
setIsLoading(false);
|
|
4118
|
+
setIsClicked(true);
|
|
4119
|
+
});
|
|
4120
|
+
},
|
|
4121
|
+
children: [
|
|
4122
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", {
|
|
4123
|
+
className: cn("alq-action-icon-wrapper", {
|
|
4124
|
+
"alq--callout-animate-action": isLoading
|
|
4125
|
+
}),
|
|
4126
|
+
children: action.icon
|
|
4127
|
+
}),
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", {
|
|
4129
|
+
children: action.label
|
|
4130
|
+
})
|
|
4131
|
+
]
|
|
4132
|
+
}, action.label);
|
|
4133
|
+
})
|
|
4134
|
+
}));
|
|
4135
|
+
});
|
|
4136
|
+
var CallOutResponse = React41.forwardRef(function(_param, ref) {
|
|
4137
|
+
var className = _param.className, children = _param.children, role = _param.role, additionalInfo = _param.additionalInfo, toggleAdditionalInfo = _param.toggleAdditionalInfo, isStreaming = _param.isStreaming, handleIsTextStreaming = _param.handleIsTextStreaming, props = _object_without_properties(_param, [
|
|
4138
|
+
"className",
|
|
4139
|
+
"children",
|
|
4140
|
+
"role",
|
|
4141
|
+
"additionalInfo",
|
|
4142
|
+
"toggleAdditionalInfo",
|
|
4143
|
+
"isStreaming",
|
|
4144
|
+
"handleIsTextStreaming"
|
|
4145
|
+
]);
|
|
4146
|
+
var _React41_useState = _sliced_to_array(React41.useState(false), 2), isAdditionalInfoOpen = _React41_useState[0], setIsAdditionalInfoOpen = _React41_useState[1];
|
|
4147
|
+
var content = String(children || "");
|
|
4148
|
+
var shouldStream = role === "assistant" && isStreaming;
|
|
4149
|
+
var displayedContent = useTextStreaming(content, shouldStream !== null && shouldStream !== void 0 ? shouldStream : false, handleIsTextStreaming);
|
|
4150
|
+
var showAsToggle = additionalInfo && toggleAdditionalInfo;
|
|
4151
|
+
var showInline = additionalInfo && !toggleAdditionalInfo;
|
|
4152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", _object_spread_props(_object_spread({
|
|
4153
|
+
ref: ref,
|
|
4154
|
+
"data-role": role,
|
|
4155
|
+
className: cn("alq--callout-response", "max-w-none", "text-foreground", className)
|
|
4156
|
+
}, props), {
|
|
4157
|
+
children: [
|
|
4158
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RichText, {
|
|
4159
|
+
content: displayedContent
|
|
4160
|
+
}),
|
|
4161
|
+
showInline && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", {
|
|
4162
|
+
className: cn("alq--callout-response-additional-info", "mt-2 text-sm text-muted-foreground whitespace-pre-line", "border-t border-border pt-2"),
|
|
4163
|
+
children: additionalInfo
|
|
4164
|
+
}),
|
|
4165
|
+
showAsToggle && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", {
|
|
4166
|
+
className: cn("alq--callout-response-additional-info", "mt-2 border-t border-border pt-2"),
|
|
4167
|
+
children: [
|
|
4168
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Button, {
|
|
4169
|
+
type: "button",
|
|
4170
|
+
variant: "ghost",
|
|
4171
|
+
size: "sm",
|
|
4172
|
+
className: "h-auto py-1.5 px-0 text-xs text-muted-foreground hover:bg-transparent hover:text-muted-foreground -ml-1",
|
|
4173
|
+
onClick: function() {
|
|
4174
|
+
return setIsAdditionalInfoOpen(function(prev) {
|
|
4175
|
+
return !prev;
|
|
4176
|
+
});
|
|
4177
|
+
},
|
|
4178
|
+
"aria-expanded": isAdditionalInfoOpen,
|
|
4179
|
+
children: [
|
|
4180
|
+
isAdditionalInfoOpen ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react18.ChevronUp, {
|
|
4181
|
+
className: "h-4 w-4 mr-1.5 shrink-0 transition-transform"
|
|
4182
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react18.ChevronDown, {
|
|
4183
|
+
className: "h-4 w-4 mr-1.5 shrink-0 transition-transform"
|
|
4184
|
+
}),
|
|
4185
|
+
isAdditionalInfoOpen ? "Hide details" : "Show details"
|
|
4186
|
+
]
|
|
4187
|
+
}),
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", {
|
|
4189
|
+
className: cn("grid transition-[grid-template-rows] duration-200 ease-out", isAdditionalInfoOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
4190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", {
|
|
4191
|
+
className: "overflow-hidden",
|
|
4192
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", {
|
|
4193
|
+
className: "text-sm text-muted-foreground pt-1 whitespace-pre-line",
|
|
4194
|
+
children: additionalInfo
|
|
4195
|
+
})
|
|
4196
|
+
})
|
|
4197
|
+
})
|
|
4198
|
+
]
|
|
4199
|
+
})
|
|
4200
|
+
]
|
|
4201
|
+
}));
|
|
4202
|
+
});
|
|
4203
|
+
CallOut.displayName = "CallOut";
|
|
4204
|
+
CallOutDate.displayName = "CallOutDate";
|
|
4205
|
+
CallOutActions.displayName = "CallOutActions";
|
|
4206
|
+
CallOutResponse.displayName = "CallOutResponse";
|
|
4207
|
+
// src/components/organisms/assistant.tsx
|
|
4208
|
+
var import_lucide_react19 = require("lucide-react");
|
|
4209
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4210
|
+
var Assistant = React42.forwardRef(function(_param, ref) {
|
|
4211
|
+
var className = _param.className, sdk = _param.sdk, title = _param.title, description = _param.description, children = _param.children, props = _object_without_properties(_param, [
|
|
4212
|
+
"className",
|
|
4213
|
+
"sdk",
|
|
4214
|
+
"title",
|
|
4215
|
+
"description",
|
|
4216
|
+
"children"
|
|
4217
|
+
]);
|
|
4218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", _object_spread_props(_object_spread({
|
|
4219
|
+
ref: ref,
|
|
4220
|
+
className: cn("flex flex-col h-full bg-background text-foreground", className)
|
|
4221
|
+
}, props), {
|
|
4222
|
+
children: [
|
|
4223
|
+
(title || description) && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(AssistantHeader, {
|
|
4224
|
+
children: [
|
|
4225
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AssistantTitle, {
|
|
4226
|
+
title: title
|
|
4227
|
+
}),
|
|
4228
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AssistantDescription, {
|
|
4229
|
+
description: description
|
|
4230
|
+
})
|
|
4231
|
+
]
|
|
4232
|
+
}),
|
|
4233
|
+
children
|
|
4234
|
+
]
|
|
4235
|
+
}));
|
|
4236
|
+
});
|
|
4237
|
+
Assistant.displayName = "Assistant";
|
|
4238
|
+
var AssistantTitle = React42.forwardRef(function(_param, ref) {
|
|
4239
|
+
var className = _param.className, title = _param.title, props = _object_without_properties(_param, [
|
|
4240
|
+
"className",
|
|
4241
|
+
"title"
|
|
4242
|
+
]);
|
|
4243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", _object_spread_props(_object_spread({
|
|
4244
|
+
ref: ref,
|
|
4245
|
+
className: cn("text-foreground", className)
|
|
4246
|
+
}, props), {
|
|
4247
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Typography, {
|
|
4248
|
+
typeStyle: "heading1",
|
|
4249
|
+
as: "h1",
|
|
4250
|
+
children: title
|
|
4251
|
+
})
|
|
4252
|
+
}));
|
|
4253
|
+
});
|
|
4254
|
+
AssistantTitle.displayName = "AssistantTitle";
|
|
4255
|
+
var AssistantDescription = React42.forwardRef(function(_param, ref) {
|
|
4256
|
+
var className = _param.className, description = _param.description, props = _object_without_properties(_param, [
|
|
4257
|
+
"className",
|
|
4258
|
+
"description"
|
|
4259
|
+
]);
|
|
4260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", _object_spread_props(_object_spread({
|
|
4261
|
+
ref: ref,
|
|
4262
|
+
className: cn("text-foreground", className)
|
|
4263
|
+
}, props), {
|
|
4264
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Typography, {
|
|
4265
|
+
typeStyle: "display",
|
|
4266
|
+
as: "p",
|
|
4267
|
+
children: description
|
|
4268
|
+
})
|
|
4269
|
+
}));
|
|
4270
|
+
});
|
|
4271
|
+
AssistantDescription.displayName = "AssistantDescription";
|
|
4272
|
+
var AssistantHeader = React42.forwardRef(function(_param, ref) {
|
|
4273
|
+
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
4274
|
+
"className",
|
|
4275
|
+
"children"
|
|
4276
|
+
]);
|
|
4277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", _object_spread_props(_object_spread({
|
|
4278
|
+
ref: ref,
|
|
4279
|
+
className: cn("bg-background text-foreground", className)
|
|
4280
|
+
}, props), {
|
|
4281
|
+
children: children
|
|
4282
|
+
}));
|
|
4283
|
+
});
|
|
4284
|
+
AssistantHeader.displayName = "AssistantHeader";
|
|
4285
|
+
var AssistantMessageArea = React42.forwardRef(function(_param, ref) {
|
|
4286
|
+
var className = _param.className, messages = _param.messages, messagesEndRef = _param.messagesEndRef, actions = _param.actions, streamingMessageId = _param.streamingMessageId, thinkIndicator = _param.thinkIndicator, handleIsTextStreaming = _param.handleIsTextStreaming, toolFactory = _param.toolFactory, isLoading = _param.isLoading, showDetailedErrors = _param.showDetailedErrors, interleave = _param.interleave, awaitingUser = _param.awaitingUser, _isMessageStreaming = _param.isMessageStreaming, props = _object_without_properties(_param, [
|
|
4287
|
+
"className",
|
|
4288
|
+
"messages",
|
|
4289
|
+
"messagesEndRef",
|
|
4290
|
+
"actions",
|
|
4291
|
+
"streamingMessageId",
|
|
4292
|
+
"thinkIndicator",
|
|
4293
|
+
"handleIsTextStreaming",
|
|
4294
|
+
"toolFactory",
|
|
4295
|
+
"isLoading",
|
|
4296
|
+
"showDetailedErrors",
|
|
4297
|
+
"interleave",
|
|
4298
|
+
"awaitingUser",
|
|
4299
|
+
"isMessageStreaming"
|
|
4300
|
+
]);
|
|
4301
|
+
(0, import_react8.useEffect)(function() {
|
|
4302
|
+
var _messagesEndRef_current;
|
|
4303
|
+
(_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({
|
|
4304
|
+
behavior: "instant"
|
|
4305
|
+
});
|
|
4306
|
+
}, []);
|
|
4307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", _object_spread_props(_object_spread({
|
|
4308
|
+
ref: ref,
|
|
4309
|
+
className: cn("p-6 overflow-y-auto flex-grow bg-background", className)
|
|
4310
|
+
}, props), {
|
|
4311
|
+
children: [
|
|
4312
|
+
interleave === null || interleave === void 0 ? void 0 : interleave(0),
|
|
4313
|
+
messages.map(function(message, index) {
|
|
4314
|
+
var _message_tooler;
|
|
4315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", {
|
|
4316
|
+
children: [
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(CallOut, {
|
|
4318
|
+
role: message.role,
|
|
4319
|
+
message: message,
|
|
4320
|
+
children: [
|
|
4321
|
+
streamingMessageId === message.id && (isLoading || message.content.length === 0) && !message.error_code && !awaitingUser && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", {
|
|
4322
|
+
children: thinkIndicator !== null && thinkIndicator !== void 0 ? thinkIndicator : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ThinkIndicator, {})
|
|
4323
|
+
}),
|
|
4324
|
+
message.error_code && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CallOutResponse, {
|
|
4325
|
+
role: "assistant",
|
|
4326
|
+
"data-error-code": message.error_code,
|
|
4327
|
+
additionalInfo: showDetailedErrors ? "".concat(message.error_detail).concat(message.taskid ? "\ntask id: ".concat(message.taskid) : "") : void 0,
|
|
4328
|
+
toggleAdditionalInfo: true,
|
|
4329
|
+
children: getErrorMessage(message.error_code)
|
|
4330
|
+
}),
|
|
4331
|
+
!message.error_code && ((_message_tooler = message.tooler) === null || _message_tooler === void 0 ? void 0 : _message_tooler.filter(hasToolResult).map(function(tool, index2) {
|
|
4332
|
+
var _tool_tool_summary, _tool_tool_summary1;
|
|
4333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(React42.Fragment, {
|
|
4334
|
+
children: toolFactory === null || toolFactory === void 0 ? void 0 : toolFactory.createTool(((_tool_tool_summary = tool.tool_summary) === null || _tool_tool_summary === void 0 ? void 0 : _tool_tool_summary.name) || "", tool.tool_output)
|
|
4335
|
+
}, tool.control_id || "".concat((_tool_tool_summary1 = tool.tool_summary) === null || _tool_tool_summary1 === void 0 ? void 0 : _tool_tool_summary1.name, "-").concat(index2));
|
|
4336
|
+
})),
|
|
4337
|
+
message.content && !message.error_code && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", {
|
|
4338
|
+
"data-role": message.role,
|
|
4339
|
+
className: "alq--callout-message-container",
|
|
4340
|
+
children: [
|
|
4341
|
+
message.created_at && streamingMessageId !== message.id && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", {
|
|
4342
|
+
className: "text-xs text-muted-foreground/80 pb-1 alq--callout-message-date",
|
|
4343
|
+
children: new Date(Number(message.created_at)).toLocaleString("es-ES", {
|
|
4344
|
+
hour: "2-digit",
|
|
4345
|
+
minute: "2-digit",
|
|
4346
|
+
hour12: false
|
|
4347
|
+
})
|
|
4348
|
+
}),
|
|
4349
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CallOutResponse, {
|
|
4350
|
+
role: message.role,
|
|
4351
|
+
isStreaming: streamingMessageId === message.id,
|
|
4352
|
+
handleIsTextStreaming: handleIsTextStreaming,
|
|
4353
|
+
additionalInfo: streamingMessageId !== message.id ? message === null || message === void 0 ? void 0 : message.additionalInfo : void 0,
|
|
4354
|
+
children: message.content
|
|
4355
|
+
}),
|
|
4356
|
+
actions && streamingMessageId !== message.id && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CallOutActions, {
|
|
4357
|
+
actions: actions,
|
|
4358
|
+
message: message,
|
|
4359
|
+
role: message.role
|
|
4360
|
+
}, message.id)
|
|
4361
|
+
]
|
|
4362
|
+
})
|
|
4363
|
+
]
|
|
4364
|
+
}, message.id),
|
|
4365
|
+
interleave === null || interleave === void 0 ? void 0 : interleave(index + 1)
|
|
4366
|
+
]
|
|
4367
|
+
}, message.id);
|
|
4368
|
+
}),
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", {
|
|
4370
|
+
ref: messagesEndRef
|
|
4371
|
+
})
|
|
4372
|
+
]
|
|
4373
|
+
}));
|
|
4374
|
+
});
|
|
4375
|
+
AssistantMessageArea.displayName = "AssistantMessageArea";
|
|
4376
|
+
var AssistantInput = React42.forwardRef(function(_param, ref) {
|
|
4377
|
+
var className = _param.className, sendMessageFunc = _param.sendMessageFunc, isButtonDisabled = _param.isButtonDisabled, input = _param.input, handleInputChange = _param.handleInputChange, isMessageStreaming = _param.isMessageStreaming, speechToTextComponent = _param.speechToTextComponent, userToolboxComponent = _param.userToolboxComponent, placeholders = _param.placeholders, onFileDrop = _param.onFileDrop, attachmentsSlot = _param.attachmentsSlot, props = _object_without_properties(_param, [
|
|
4378
|
+
"className",
|
|
4379
|
+
"sendMessageFunc",
|
|
4380
|
+
"isButtonDisabled",
|
|
4381
|
+
"input",
|
|
4382
|
+
"handleInputChange",
|
|
4383
|
+
"isMessageStreaming",
|
|
4384
|
+
"speechToTextComponent",
|
|
4385
|
+
"userToolboxComponent",
|
|
4386
|
+
"placeholders",
|
|
4387
|
+
"onFileDrop",
|
|
4388
|
+
"attachmentsSlot"
|
|
4389
|
+
]);
|
|
4390
|
+
var _ref = _sliced_to_array((0, import_react8.useState)(false), 2), isDragging = _ref[0], setIsDragging = _ref[1];
|
|
4391
|
+
var dragCounterRef = (0, import_react8.useRef)(0);
|
|
4392
|
+
var handleDragEnter = (0, import_react8.useCallback)(function(e) {
|
|
4393
|
+
e.preventDefault();
|
|
4394
|
+
e.stopPropagation();
|
|
4395
|
+
dragCounterRef.current += 1;
|
|
4396
|
+
if (e.dataTransfer.types.includes("Files")) {
|
|
4397
|
+
setIsDragging(true);
|
|
4398
|
+
}
|
|
4399
|
+
}, []);
|
|
4400
|
+
var handleDragOver = (0, import_react8.useCallback)(function(e) {
|
|
4401
|
+
e.preventDefault();
|
|
4402
|
+
e.stopPropagation();
|
|
4403
|
+
}, []);
|
|
4404
|
+
var handleDragLeave = (0, import_react8.useCallback)(function(e) {
|
|
4405
|
+
e.preventDefault();
|
|
4406
|
+
e.stopPropagation();
|
|
4407
|
+
dragCounterRef.current -= 1;
|
|
4408
|
+
if (dragCounterRef.current === 0) {
|
|
4409
|
+
setIsDragging(false);
|
|
4410
|
+
}
|
|
4411
|
+
}, []);
|
|
4412
|
+
var handleDrop = (0, import_react8.useCallback)(function(e) {
|
|
4413
|
+
e.preventDefault();
|
|
4414
|
+
e.stopPropagation();
|
|
4415
|
+
dragCounterRef.current = 0;
|
|
4416
|
+
setIsDragging(false);
|
|
4417
|
+
var files = Array.from(e.dataTransfer.files);
|
|
4418
|
+
if (files.length > 0) {
|
|
4419
|
+
onFileDrop === null || onFileDrop === void 0 ? void 0 : onFileDrop(files);
|
|
4420
|
+
}
|
|
4421
|
+
}, [
|
|
4422
|
+
onFileDrop
|
|
4423
|
+
]);
|
|
4424
|
+
var placeholder = placeholders ? isMessageStreaming ? placeholders[0] : placeholders[1] : isMessageStreaming ? "Processing..." : "Type your message here...";
|
|
4425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("form", _object_spread_props(_object_spread({
|
|
4426
|
+
onSubmit: sendMessageFunc,
|
|
4427
|
+
className: cn("flex flex-col relative rounded-lg border border-input bg-background", "focus-within:ring-2 focus-within:ring-ring", onFileDrop && isDragging && "ring-2 ring-primary/50 alq--assistant-input-dragover", className),
|
|
4428
|
+
ref: ref,
|
|
4429
|
+
onDragEnter: onFileDrop ? handleDragEnter : void 0,
|
|
4430
|
+
onDragOver: onFileDrop ? handleDragOver : void 0,
|
|
4431
|
+
onDragLeave: onFileDrop ? handleDragLeave : void 0,
|
|
4432
|
+
onDrop: onFileDrop ? handleDrop : void 0
|
|
4433
|
+
}, props), {
|
|
4434
|
+
children: [
|
|
4435
|
+
attachmentsSlot,
|
|
4436
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("textarea", {
|
|
4437
|
+
disabled: isButtonDisabled,
|
|
4438
|
+
value: input,
|
|
4439
|
+
onChange: handleInputChange,
|
|
4440
|
+
placeholder: placeholder,
|
|
4441
|
+
className: cn("flex-1 min-w-0 text-sm p-3 focus:outline-none w-full resize-none", "bg-transparent text-foreground", "placeholder:text-muted-foreground", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
4442
|
+
onKeyDown: function(e) {
|
|
4443
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
4444
|
+
e.preventDefault();
|
|
4445
|
+
sendMessageFunc(e);
|
|
4446
|
+
}
|
|
4447
|
+
}
|
|
4448
|
+
}),
|
|
4449
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", {
|
|
4450
|
+
className: "flex items-center relative alq--assistant-actions",
|
|
4451
|
+
children: [
|
|
4452
|
+
userToolboxComponent,
|
|
4453
|
+
speechToTextComponent,
|
|
4454
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", {
|
|
4455
|
+
type: "submit",
|
|
4456
|
+
"aria-label": "Send",
|
|
4457
|
+
disabled: isButtonDisabled,
|
|
4458
|
+
className: cn("w-10 h-10 rounded-full flex items-center justify-center alq--assistant-button-send", isButtonDisabled ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"),
|
|
4459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react19.Send, {
|
|
4460
|
+
className: "w-5 h-5"
|
|
4461
|
+
})
|
|
4462
|
+
})
|
|
4463
|
+
]
|
|
4464
|
+
})
|
|
4465
|
+
]
|
|
4466
|
+
}));
|
|
4467
|
+
});
|
|
4468
|
+
AssistantInput.displayName = "AssistantInput";
|
|
4469
|
+
// src/components/genui/assistant-chat.tsx
|
|
4470
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4471
|
+
function TypingDots() {
|
|
4472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {
|
|
4473
|
+
className: "flex w-fit items-center gap-1.5 rounded-2xl rounded-bl-md border border-border/60 bg-card px-4 py-3 shadow-sm",
|
|
4474
|
+
children: [
|
|
4475
|
+
0,
|
|
4476
|
+
1,
|
|
4477
|
+
2
|
|
4478
|
+
].map(function(i) {
|
|
4479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", {
|
|
4480
|
+
className: "h-2 w-2 animate-bounce rounded-full bg-primary",
|
|
4481
|
+
style: {
|
|
4482
|
+
animationDelay: "".concat(i * 0.15, "s"),
|
|
4483
|
+
animationDuration: "0.9s"
|
|
4484
|
+
}
|
|
4485
|
+
}, i);
|
|
4486
|
+
})
|
|
4487
|
+
});
|
|
4488
|
+
}
|
|
4489
|
+
function AssistantChat(param) {
|
|
4490
|
+
var alquimia = param.alquimia, _param_registry = param.registry, registry = _param_registry === void 0 ? coreUiRegistry : _param_registry, conversationId = param.conversationId, _param_placeholder = param.placeholder, placeholder = _param_placeholder === void 0 ? "Ask the agent to build something\u2026" : _param_placeholder, _param_suggestions = param.suggestions, suggestions = _param_suggestions === void 0 ? [] : _param_suggestions, className = param.className, thinkIndicator = param.thinkIndicator;
|
|
4491
|
+
var endRef = React43.useRef(null);
|
|
4492
|
+
var messages = alquimia.messages, input = alquimia.input, handleInputChange = alquimia.handleInputChange, handleSubmit = alquimia.handleSubmit, handleLoadingCancel = alquimia.handleLoadingCancel, isLoading = alquimia.isLoading, isMessageStreaming = alquimia.isMessageStreaming, streamingMessageId = alquimia.streamingMessageId, genui = alquimia.genui;
|
|
4493
|
+
var _genui_surfaces;
|
|
4494
|
+
var surfaces = (_genui_surfaces = genui === null || genui === void 0 ? void 0 : genui.surfaces) !== null && _genui_surfaces !== void 0 ? _genui_surfaces : [];
|
|
4495
|
+
var _genui_awaitingUser;
|
|
4496
|
+
var awaitingUser = (_genui_awaitingUser = genui === null || genui === void 0 ? void 0 : genui.awaitingUser) !== null && _genui_awaitingUser !== void 0 ? _genui_awaitingUser : false;
|
|
4497
|
+
var isBusy = !!(isLoading || isMessageStreaming);
|
|
4498
|
+
var hasContent = messages.some(function(m) {
|
|
4499
|
+
var _m_content;
|
|
4500
|
+
return m.role === "user" || m.role !== "system" && ((_m_content = m.content) !== null && _m_content !== void 0 ? _m_content : "").trim().length > 0;
|
|
4501
|
+
});
|
|
4502
|
+
var isEmpty = !hasContent && surfaces.length === 0;
|
|
4503
|
+
React43.useEffect(function() {
|
|
4504
|
+
var _endRef_current;
|
|
4505
|
+
(_endRef_current = endRef.current) === null || _endRef_current === void 0 ? void 0 : _endRef_current.scrollIntoView({
|
|
4506
|
+
behavior: "smooth"
|
|
4507
|
+
});
|
|
4508
|
+
}, [
|
|
4509
|
+
messages,
|
|
4510
|
+
surfaces
|
|
4511
|
+
]);
|
|
4512
|
+
var renderSurface = function(item) {
|
|
4513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", {
|
|
4514
|
+
className: "my-3 flex flex-col items-start gap-1.5",
|
|
4515
|
+
children: [
|
|
4516
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", {
|
|
4517
|
+
className: cn("relative w-full max-w-[95%] rounded-2xl border border-border/60 bg-card p-5 shadow-sm duration-500 animate-in fade-in slide-in-from-bottom-2", item.submitted && "opacity-70"),
|
|
4518
|
+
children: [
|
|
4519
|
+
item.submitted && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", {
|
|
4520
|
+
className: "absolute right-3 top-3 z-10 flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-600 dark:text-emerald-400",
|
|
4521
|
+
children: [
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react20.Check, {
|
|
4523
|
+
className: "h-3 w-3"
|
|
4524
|
+
}),
|
|
4525
|
+
item.dismissedWith ? "Skipped" : "Submitted"
|
|
4526
|
+
]
|
|
4527
|
+
}),
|
|
4528
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {
|
|
4529
|
+
className: cn(item.submitted && "pointer-events-none select-none"),
|
|
4530
|
+
"aria-disabled": item.submitted,
|
|
4531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(A2uiRenderer, {
|
|
4532
|
+
surface: item.surface,
|
|
4533
|
+
registry: registry,
|
|
4534
|
+
onAgentAction: genui ? genui.onAgentAction(item.controlId) : function() {}
|
|
4535
|
+
})
|
|
4536
|
+
})
|
|
4537
|
+
]
|
|
4538
|
+
}),
|
|
4539
|
+
item.dismissedWith && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", {
|
|
4540
|
+
className: "alq--surface-dismissed max-w-[95%] pl-1 text-sm text-muted-foreground",
|
|
4541
|
+
children: [
|
|
4542
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", {
|
|
4543
|
+
className: "font-medium text-foreground",
|
|
4544
|
+
children: "You replied:"
|
|
4545
|
+
}),
|
|
4546
|
+
" ",
|
|
4547
|
+
item.dismissedWith
|
|
4548
|
+
]
|
|
4549
|
+
})
|
|
4550
|
+
]
|
|
4551
|
+
}, "s-".concat(item.controlId));
|
|
4552
|
+
};
|
|
4553
|
+
var byCount = /* @__PURE__ */ new Map();
|
|
4554
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4555
|
+
try {
|
|
4556
|
+
for(var _iterator = surfaces[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4557
|
+
var s = _step.value;
|
|
4558
|
+
var _byCount_get;
|
|
4559
|
+
var arr = (_byCount_get = byCount.get(s.afterCount)) !== null && _byCount_get !== void 0 ? _byCount_get : [];
|
|
4560
|
+
arr.push(s);
|
|
4561
|
+
byCount.set(s.afterCount, arr);
|
|
4562
|
+
}
|
|
4563
|
+
} catch (err) {
|
|
4564
|
+
_didIteratorError = true;
|
|
4565
|
+
_iteratorError = err;
|
|
4566
|
+
} finally{
|
|
4567
|
+
try {
|
|
4568
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4569
|
+
_iterator.return();
|
|
4570
|
+
}
|
|
4571
|
+
} finally{
|
|
4572
|
+
if (_didIteratorError) {
|
|
4573
|
+
throw _iteratorError;
|
|
4574
|
+
}
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4577
|
+
var interleave = function(afterIndex) {
|
|
4578
|
+
var _byCount_get;
|
|
4579
|
+
var nodes = ((_byCount_get = byCount.get(afterIndex)) !== null && _byCount_get !== void 0 ? _byCount_get : []).map(renderSurface);
|
|
4580
|
+
if (afterIndex === 0 && isEmpty) {
|
|
4581
|
+
nodes.unshift(/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", {
|
|
4582
|
+
className: "flex min-h-full flex-col items-center justify-center gap-4 py-16 text-center",
|
|
4583
|
+
children: [
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", {
|
|
4585
|
+
className: "max-w-sm text-muted-foreground",
|
|
4586
|
+
children: "Ask the agent to build an interface."
|
|
4587
|
+
}),
|
|
4588
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", {
|
|
4589
|
+
className: "flex flex-col items-center gap-2",
|
|
4590
|
+
children: suggestions.map(function(s) {
|
|
4591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", {
|
|
4592
|
+
type: "button",
|
|
4593
|
+
onClick: function() {
|
|
4594
|
+
return handleInputChange({
|
|
4595
|
+
target: {
|
|
4596
|
+
value: s
|
|
4597
|
+
}
|
|
4598
|
+
});
|
|
4599
|
+
},
|
|
4600
|
+
className: "rounded-full border border-border/70 bg-card px-4 py-2 text-sm text-foreground/80 transition hover:border-primary/40 hover:shadow-sm",
|
|
4601
|
+
children: s
|
|
4602
|
+
}, s);
|
|
4603
|
+
})
|
|
4604
|
+
})
|
|
4605
|
+
]
|
|
4606
|
+
}, "empty"));
|
|
4607
|
+
}
|
|
4608
|
+
return nodes.length ? nodes : null;
|
|
4609
|
+
};
|
|
4610
|
+
var onSubmit = /*#__PURE__*/ function() {
|
|
4611
|
+
var _ref = _async_to_generator(function(e) {
|
|
4612
|
+
var e1;
|
|
4613
|
+
return _ts_generator(this, function(_state) {
|
|
4614
|
+
switch(_state.label){
|
|
4615
|
+
case 0:
|
|
4616
|
+
e.preventDefault();
|
|
4617
|
+
if (!input.trim()) return [
|
|
4618
|
+
2
|
|
4619
|
+
];
|
|
4620
|
+
if (awaitingUser && (genui === null || genui === void 0 ? void 0 : genui.dismiss)) {
|
|
4621
|
+
genui.dismiss(input);
|
|
4622
|
+
return [
|
|
4623
|
+
2
|
|
4624
|
+
];
|
|
4625
|
+
}
|
|
4626
|
+
if (isBusy) return [
|
|
4627
|
+
2
|
|
4628
|
+
];
|
|
4629
|
+
_state.label = 1;
|
|
4630
|
+
case 1:
|
|
4631
|
+
_state.trys.push([
|
|
4632
|
+
1,
|
|
4633
|
+
3,
|
|
4634
|
+
,
|
|
4635
|
+
4
|
|
4636
|
+
]);
|
|
4637
|
+
return [
|
|
4638
|
+
4,
|
|
4639
|
+
handleSubmit(e, void 0, conversationId !== null && conversationId !== void 0 ? conversationId : void 0)
|
|
4640
|
+
];
|
|
4641
|
+
case 2:
|
|
4642
|
+
_state.sent();
|
|
4643
|
+
return [
|
|
4644
|
+
3,
|
|
4645
|
+
4
|
|
4646
|
+
];
|
|
4647
|
+
case 3:
|
|
4648
|
+
e1 = _state.sent();
|
|
4649
|
+
handleLoadingCancel === null || handleLoadingCancel === void 0 ? void 0 : handleLoadingCancel();
|
|
4650
|
+
return [
|
|
4651
|
+
3,
|
|
4652
|
+
4
|
|
4653
|
+
];
|
|
4654
|
+
case 4:
|
|
4655
|
+
return [
|
|
4656
|
+
2
|
|
4657
|
+
];
|
|
4658
|
+
}
|
|
4659
|
+
});
|
|
4660
|
+
});
|
|
4661
|
+
return function onSubmit(e) {
|
|
4662
|
+
return _ref.apply(this, arguments);
|
|
4663
|
+
};
|
|
4664
|
+
}();
|
|
4665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Assistant, {
|
|
4666
|
+
className: cn("mx-auto flex h-full w-full max-w-2xl flex-col bg-transparent px-4", className),
|
|
4667
|
+
children: [
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AssistantMessageArea, {
|
|
4669
|
+
className: "bg-transparent",
|
|
4670
|
+
messages: messages,
|
|
4671
|
+
messagesEndRef: endRef,
|
|
4672
|
+
isLoading: !!isLoading,
|
|
4673
|
+
streamingMessageId: streamingMessageId !== null && streamingMessageId !== void 0 ? streamingMessageId : null,
|
|
4674
|
+
interleave: interleave,
|
|
4675
|
+
awaitingUser: awaitingUser,
|
|
4676
|
+
thinkIndicator: thinkIndicator !== null && thinkIndicator !== void 0 ? thinkIndicator : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TypingDots, {})
|
|
4677
|
+
}),
|
|
4678
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AssistantInput, {
|
|
4679
|
+
className: "mb-5 mt-2 rounded-2xl border-border/60 bg-card/90 shadow-lg backdrop-blur",
|
|
4680
|
+
sendMessageFunc: onSubmit,
|
|
4681
|
+
isButtonDisabled: isBusy && !awaitingUser,
|
|
4682
|
+
input: input,
|
|
4683
|
+
handleInputChange: handleInputChange,
|
|
4684
|
+
isMessageStreaming: !!isMessageStreaming,
|
|
4685
|
+
placeholders: [
|
|
4686
|
+
placeholder,
|
|
4687
|
+
placeholder
|
|
4688
|
+
]
|
|
4689
|
+
})
|
|
4690
|
+
]
|
|
4691
|
+
});
|
|
4692
|
+
}
|
|
4693
|
+
//# sourceMappingURL=index.js.map
|