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