@vadimcomanescu/nadicode-design-system 5.0.2 → 6.0.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/.agents/skills/seed/SKILL.md +2 -2
- package/.agents/skills/seed/references/composition.md +1 -1
- package/README.md +1 -1
- package/contracts/message-catalog-contract.json +9 -3
- package/contracts/release-governance-baseline.json +2 -2
- package/dist/{TeamPage-UO3V2JDK.js → TeamPage-XL574KIF.js} +54 -53
- package/dist/catalog/catalog.d.ts +290 -10
- package/dist/catalog/catalog.js +12 -12
- package/dist/catalog/components.d.ts +18 -16
- package/dist/catalog/components.js +53 -52
- package/dist/catalog/definitions/blocks-agent.d.ts +35 -2
- package/dist/catalog/definitions/blocks-agent.js +1 -1
- package/dist/catalog/definitions/blocks-auth.d.ts +40 -0
- package/dist/catalog/definitions/blocks-auth.js +1 -1
- package/dist/catalog/definitions/blocks-content.d.ts +22 -0
- package/dist/catalog/definitions/blocks-content.js +1 -1
- package/dist/catalog/definitions/blocks-crud.d.ts +102 -2
- package/dist/catalog/definitions/blocks-crud.js +1 -1
- package/dist/catalog/definitions/blocks-data.d.ts +58 -2
- package/dist/catalog/definitions/blocks-data.js +1 -1
- package/dist/catalog/definitions/blocks-marketing.d.ts +29 -4
- package/dist/catalog/definitions/blocks-marketing.js +1 -1
- package/dist/catalog/definitions/blocks-misc.d.ts +2 -0
- package/dist/catalog/definitions/blocks-misc.js +1 -1
- package/dist/catalog/definitions/display.d.ts +2 -0
- package/dist/catalog/definitions/display.js +1 -1
- package/dist/catalog/definitions/index.d.ts +290 -10
- package/dist/catalog/definitions/index.js +11 -11
- package/dist/catalog/primitives/chat.d.ts +2 -2
- package/dist/catalog/primitives/chat.js +1 -1
- package/dist/catalog/primitives/display.d.ts +7 -7
- package/dist/catalog/primitives/display.js +3 -3
- package/dist/catalog/primitives/form.d.ts +1 -1
- package/dist/catalog/primitives/form.js +1 -1
- package/dist/catalog/primitives/index.d.ts +14 -14
- package/dist/catalog/primitives/index.js +10 -10
- package/dist/catalog/primitives/layout.d.ts +1 -1
- package/dist/catalog/primitives/layout.js +1 -1
- package/dist/catalog/primitives/navigation.d.ts +4 -4
- package/dist/catalog/primitives/navigation.js +1 -1
- package/dist/catalog/primitives/overlay.d.ts +2 -2
- package/dist/catalog/primitives/overlay.js +1 -1
- package/dist/{chunk-PQOL3E2V.js → chunk-25QQEKGR.js} +7 -7
- package/dist/{chunk-XLN4NVKU.js → chunk-2BCMZV5U.js} +17 -10
- package/dist/{chunk-VQVWFCHF.js → chunk-2OEVKFZ2.js} +10 -10
- package/dist/{chunk-V4NBPGED.js → chunk-2UY4XZC6.js} +3 -1
- package/dist/{chunk-AP5SGSN7.js → chunk-3MGQGQTS.js} +8 -0
- package/dist/{chunk-WGQHM56J.js → chunk-4BG7ILL5.js} +43 -41
- package/dist/{chunk-OWWQP3YW.js → chunk-4DQMGKPG.js} +2 -2
- package/dist/{chunk-JDHD4L6N.js → chunk-4NRASS74.js} +1 -1
- package/dist/{chunk-4ZST7OY5.js → chunk-5DLTCQN4.js} +29 -7
- package/dist/{chunk-NBDUZA66.js → chunk-5HFOPRXI.js} +18 -13
- package/dist/{chunk-DSNPOAE6.js → chunk-5S34SGPQ.js} +7 -2
- package/dist/{chunk-BVXSAVKY.js → chunk-72EJ2TYY.js} +7 -10
- package/dist/{chunk-3BGWXRQC.js → chunk-7U55EQZD.js} +8 -11
- package/dist/{chunk-MPVYXUOD.js → chunk-A2IYJPTF.js} +3 -1
- package/dist/chunk-ACIJEUAH.js +213 -0
- package/dist/{chunk-PD6WW7E5.js → chunk-BRESMZ6G.js} +2 -5
- package/dist/{chunk-Q4CRHV5T.js → chunk-BVOJIX27.js} +55 -10
- package/dist/{chunk-PYRHNONA.js → chunk-CJDVIJEF.js} +6 -5
- package/dist/{chunk-FSU7ZM5V.js → chunk-CJT7SZNI.js} +8 -15
- package/dist/{chunk-PQBVNNEG.js → chunk-DEILZQEX.js} +12 -3
- package/dist/chunk-DORWHCRI.js +112 -0
- package/dist/{chunk-EJQ73FJ5.js → chunk-DW3XHDFX.js} +70 -15
- package/dist/{chunk-ZL6BPQNN.js → chunk-EKSXBDOA.js} +23 -11
- package/dist/{chunk-UCFR7GLW.js → chunk-EX5AIP2Q.js} +4 -4
- package/dist/chunk-F4BPNMAD.js +185 -0
- package/dist/{chunk-STNVWBJH.js → chunk-FGGGUS5L.js} +1 -1
- package/dist/{chunk-IZ7A62GI.js → chunk-GBKAQWME.js} +23 -23
- package/dist/{chunk-XYMFKNKG.js → chunk-GW7A5G4W.js} +26 -5
- package/dist/{chunk-IW36SVOH.js → chunk-HBVZYYTD.js} +79 -12
- package/dist/{chunk-P5I63ETD.js → chunk-HZ6WO2OD.js} +30 -3
- package/dist/{chunk-MOFWXBTK.js → chunk-IWFPYUHD.js} +1 -1
- package/dist/{chunk-CQ75K2DH.js → chunk-JA6QAEVX.js} +15 -13
- package/dist/{chunk-YEAJLVGB.js → chunk-JYDPEIAA.js} +31 -22
- package/dist/chunk-KEQFAIPJ.js +84 -0
- package/dist/{chunk-QCFDSOTV.js → chunk-KPRBRDSY.js} +6 -11
- package/dist/{chunk-W4KI424V.js → chunk-KRNAMBZZ.js} +5 -3
- package/dist/{chunk-XMGWLDNG.js → chunk-KSJUX6EA.js} +2 -2
- package/dist/{chunk-5RBO2IMZ.js → chunk-KYLXPIFE.js} +23 -16
- package/dist/{chunk-B4373MDA.js → chunk-M4AK7ZXY.js} +8 -1
- package/dist/{chunk-KANK5FAG.js → chunk-M5MUMF7S.js} +15 -6
- package/dist/{chunk-WAIZR4CR.js → chunk-MIVKO3MG.js} +3 -2
- package/dist/{chunk-FX3GYS5O.js → chunk-N3WTIJIB.js} +19 -3
- package/dist/{chunk-H3KTAHJP.js → chunk-NPJN6OLX.js} +11 -20
- package/dist/{chunk-7AUNUDHM.js → chunk-NPNQGXA7.js} +47 -13
- package/dist/{chunk-D6MFOI3N.js → chunk-OO2K4JUF.js} +35 -7
- package/dist/{chunk-3QMHVXSQ.js → chunk-OPX27RJE.js} +12 -2
- package/dist/{chunk-KKBTPNXT.js → chunk-QJ5ODJTH.js} +5 -1
- package/dist/{chunk-ZKA5X3E4.js → chunk-QLNATCF6.js} +5 -11
- package/dist/{chunk-ZU7MDRCI.js → chunk-RI4IK37T.js} +26 -11
- package/dist/{chunk-YMAEXGD2.js → chunk-RPUONGMF.js} +7 -2
- package/dist/{chunk-XUWKGDUY.js → chunk-S4ZZ3SJU.js} +32 -22
- package/dist/{chunk-6NL36QN3.js → chunk-T3ASBCI3.js} +8 -2
- package/dist/{chunk-R4SBK6Y5.js → chunk-T3J7RZV6.js} +9 -19
- package/dist/{chunk-UPMSE6PQ.js → chunk-TCDBSHAY.js} +4 -2
- package/dist/{chunk-PJ7DVYWA.js → chunk-TOMUOPVE.js} +4 -0
- package/dist/{chunk-OS2BLQ2G.js → chunk-TYNILBCP.js} +7 -2
- package/dist/{chunk-V5RSV4ZV.js → chunk-VTIT5C7L.js} +17 -3
- package/dist/{chunk-33UWVOQ6.js → chunk-WS6PKHGX.js} +1 -1
- package/dist/chunk-X5BYH7WG.js +27 -0
- package/dist/{chunk-IYK2ABFE.js → chunk-XMXH63A7.js} +2 -2
- package/dist/{chunk-3LROWCZE.js → chunk-XVV52J35.js} +24 -5
- package/dist/{chunk-OUXJUUCB.js → chunk-XZZVSBPC.js} +34 -3
- package/dist/{chunk-UMEBNHKR.js → chunk-YGB5BFFI.js} +4 -2
- package/dist/{chunk-CTVV6JS6.js → chunk-Z3NGVHHE.js} +1 -1
- package/dist/{chunk-A4QNTJUR.js → chunk-ZCYD22F2.js} +51 -7
- package/dist/components/blocks/AgentConversationBlock.d.ts +1 -1
- package/dist/components/blocks/AgentConversationBlock.js +107 -1
- package/dist/components/blocks/ApiKeysBlock.js +3 -1
- package/dist/components/blocks/AuthLayout.js +3 -2
- package/dist/components/blocks/BlogIndexBlock.d.ts +1 -1
- package/dist/components/blocks/BlogIndexBlock.js +1 -1
- package/dist/components/blocks/CallToActionBlock.d.ts +1 -1
- package/dist/components/blocks/CallToActionBlock.js +1 -2
- package/dist/components/blocks/ChartCollectionBlock.d.ts +1 -1
- package/dist/components/blocks/ChartCollectionBlock.js +2 -1
- package/dist/components/blocks/ChatLayout.d.ts +1 -1
- package/dist/components/blocks/ChatLayout.js +1 -2
- package/dist/components/blocks/CheckEmailBlock.js +2 -1
- package/dist/components/blocks/CommandPaletteBlock.js +1 -1
- package/dist/components/blocks/ContactBlock.js +2 -2
- package/dist/components/blocks/CreateBlock.js +2 -1
- package/dist/components/blocks/CrudListBlock.js +1 -1
- package/dist/components/blocks/DashboardBlock.js +2 -2
- package/dist/components/blocks/DataGridBlock.d.ts +3 -3
- package/dist/components/blocks/DataGridBlock.js +4 -2
- package/dist/components/blocks/DirectoryBlock.d.ts +1 -1
- package/dist/components/blocks/DirectoryBlock.js +1 -1
- package/dist/components/blocks/FAQBlock.d.ts +1 -1
- package/dist/components/blocks/FAQBlock.js +1 -1
- package/dist/components/blocks/FooterBlock.d.ts +1 -1
- package/dist/components/blocks/FooterBlock.js +1 -2
- package/dist/components/blocks/FormFieldBlock.d.ts +1 -1
- package/dist/components/blocks/FormFieldBlock.js +1 -1
- package/dist/components/blocks/GalleryBlock.d.ts +1 -1
- package/dist/components/blocks/GalleryBlock.js +1 -1
- package/dist/components/blocks/HeaderBlock.d.ts +1 -1
- package/dist/components/blocks/HeaderBlock.js +1 -2
- package/dist/components/blocks/HeroBlock.js +1 -2
- package/dist/components/blocks/IntegrationsBlock.js +2 -2
- package/dist/components/blocks/LoginBlock.js +2 -1
- package/dist/components/blocks/LogoCloud.js +2 -2
- package/dist/components/blocks/NewsletterBlock.js +2 -2
- package/dist/components/blocks/OnboardingFlowBlock.js +1 -1
- package/dist/components/blocks/PasswordRecoveryBlock.d.ts +3 -1
- package/dist/components/blocks/PasswordRecoveryBlock.js +2 -2
- package/dist/components/blocks/PricingBlock.d.ts +3 -1
- package/dist/components/blocks/PricingBlock.js +1 -1
- package/dist/components/blocks/ResetPasswordBlock.js +1 -1
- package/dist/components/blocks/SettingsNavBlock.d.ts +1 -1
- package/dist/components/blocks/SettingsNavBlock.js +1 -1
- package/dist/components/blocks/StatsMarketingBlock.js +1 -2
- package/dist/components/blocks/TeamManagementBlock.d.ts +3 -0
- package/dist/components/blocks/TeamManagementBlock.js +129 -0
- package/dist/components/blocks/TeamShowcaseBlock.d.ts +3 -0
- package/dist/components/blocks/{TeamBlock.js → TeamShowcaseBlock.js} +1 -1
- package/dist/components/blocks/TestimonialsBlock.js +2 -2
- package/dist/components/blocks/TwoFactorSetupBlock.d.ts +3 -1
- package/dist/components/blocks/TwoFactorSetupBlock.js +1 -2
- package/dist/components/blocks/WizardBlock.js +1 -1
- package/dist/components/blocks/user/InviteUserModal.js +2 -1
- package/dist/components/logos/index.js +1 -1
- package/dist/components/ui/CheckoutForm.js +1 -1
- package/dist/components/ui/DataTable.d.ts +4 -2
- package/dist/components/ui/DataTable.js +1 -1
- package/dist/components/ui/NavUser.d.ts +1 -1
- package/dist/components/ui/NavUser.js +1 -1
- package/dist/components/ui/SettingsModal.d.ts +2 -1
- package/dist/components/ui/SettingsModal.js +1 -1
- package/dist/components/ui/WorkspaceSwitcherBlock.js +1 -1
- package/dist/lib/json-render/app.js +1 -1
- package/dist/lib/json-render/catalog.d.ts +122 -8
- package/dist/lib/json-render/catalog.js +13 -13
- package/dist/lib/json-render/registry.js +13 -13
- package/dist/lib/json-render/showcase-spec.js +1 -1
- package/dist/messages/en.js +1 -1
- package/dist/messages/it.js +1 -1
- package/dist/test/PublicSeedTestProvider.js +2 -2
- package/eslint-rules/nadicode/data/catalog-names.json +2 -1
- package/eslint-rules/nadicode/rules/__tests__/require-catalog-import.test.js +0 -5
- package/eslint-rules/nadicode/rules/require-catalog-import.js +0 -1
- package/package.json +1 -1
- package/dist/chunk-6OBT3A5O.js +0 -21
- package/dist/chunk-NDQO7AO6.js +0 -105
- package/dist/chunk-TTDKPZ75.js +0 -45
- package/dist/chunk-YB3J4ZRZ.js +0 -180
- package/dist/components/blocks/TeamBlock.d.ts +0 -3
|
@@ -4,7 +4,7 @@ import { Timeline } from './chunk-YQIABLDO.js';
|
|
|
4
4
|
import { Spinner } from './chunk-ZLSWCV55.js';
|
|
5
5
|
import { SuccessCheck } from './chunk-7X3GXC7C.js';
|
|
6
6
|
import { RoleBadge } from './chunk-OHCQPI3W.js';
|
|
7
|
-
import { SettingsModal } from './chunk-
|
|
7
|
+
import { SettingsModal } from './chunk-QJ5ODJTH.js';
|
|
8
8
|
import { NotificationCenter } from './chunk-KL43KGCK.js';
|
|
9
9
|
import { Progress } from './chunk-JWQXBRE7.js';
|
|
10
10
|
import { ProgressRing } from './chunk-2LBEV4YF.js';
|
|
@@ -14,7 +14,7 @@ import { TrendIndicator } from './chunk-3R2VLZUR.js';
|
|
|
14
14
|
import { StatusDot } from './chunk-B5QL76GA.js';
|
|
15
15
|
import { Item } from './chunk-34MKVVGB.js';
|
|
16
16
|
import { DataFreshness } from './chunk-WST5NLLC.js';
|
|
17
|
-
import { DataTable } from './chunk-
|
|
17
|
+
import { DataTable } from './chunk-VTIT5C7L.js';
|
|
18
18
|
import { Table, TableCaption, TableHeader, TableRow, TableHead, TableBody, TableCell } from './chunk-PXDHNGTG.js';
|
|
19
19
|
import { DiffStat } from './chunk-ZSU5ZI4O.js';
|
|
20
20
|
import { CheckStatus } from './chunk-TV6CJ5NI.js';
|
|
@@ -29,6 +29,8 @@ import { AnnouncementBanner } from './chunk-44NVO477.js';
|
|
|
29
29
|
import { AudioWaveform } from './chunk-5UESKK6S.js';
|
|
30
30
|
import { Badge } from './chunk-S4JAHKOP.js';
|
|
31
31
|
import { Alert, AlertTitle, AlertDescription } from './chunk-6CLSVCWP.js';
|
|
32
|
+
import { useCallback } from 'react';
|
|
33
|
+
import { useBoundProp } from '@json-render/react';
|
|
32
34
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
33
35
|
|
|
34
36
|
var displayComponents = {
|
|
@@ -64,9 +66,12 @@ var displayComponents = {
|
|
|
64
66
|
}
|
|
65
67
|
);
|
|
66
68
|
},
|
|
67
|
-
DataTable: ({ props, emit }) => {
|
|
69
|
+
DataTable: ({ props, bindings, emit }) => {
|
|
68
70
|
const catalogColumns = props.columns ?? [];
|
|
69
71
|
const rows = props.rows ?? [];
|
|
72
|
+
const [, setBoundSortColumn] = useBoundProp(void 0, bindings?.sortColumn);
|
|
73
|
+
const [, setBoundSortDirection] = useBoundProp(void 0, bindings?.sortDirection);
|
|
74
|
+
const [, setBoundFilterValue] = useBoundProp(void 0, bindings?.filterValue);
|
|
70
75
|
const columns = catalogColumns.map((col) => ({
|
|
71
76
|
accessorKey: col.key,
|
|
72
77
|
header: col.header,
|
|
@@ -78,7 +83,20 @@ var displayComponents = {
|
|
|
78
83
|
columns,
|
|
79
84
|
data: rows,
|
|
80
85
|
searchKey: nn(props.searchKey),
|
|
81
|
-
onRowClick: () => emit("select")
|
|
86
|
+
onRowClick: () => emit("select"),
|
|
87
|
+
onSortChange: (sorting) => {
|
|
88
|
+
if (sorting.length > 0) {
|
|
89
|
+
setBoundSortColumn(sorting[0].id);
|
|
90
|
+
setBoundSortDirection(sorting[0].desc ? "desc" : "asc");
|
|
91
|
+
}
|
|
92
|
+
emit("sort");
|
|
93
|
+
},
|
|
94
|
+
onFilterChange: (filters) => {
|
|
95
|
+
if (filters.length > 0) {
|
|
96
|
+
setBoundFilterValue(String(filters[0].value));
|
|
97
|
+
}
|
|
98
|
+
emit("filter");
|
|
99
|
+
}
|
|
82
100
|
}
|
|
83
101
|
);
|
|
84
102
|
},
|
|
@@ -225,7 +243,7 @@ var displayComponents = {
|
|
|
225
243
|
}
|
|
226
244
|
);
|
|
227
245
|
},
|
|
228
|
-
NotificationCenter: ({ props, emit }) => {
|
|
246
|
+
NotificationCenter: ({ props, bindings, emit }) => {
|
|
229
247
|
const notifications = (props.notifications ?? []).map((n) => ({
|
|
230
248
|
id: n.id,
|
|
231
249
|
title: n.title,
|
|
@@ -234,12 +252,19 @@ var displayComponents = {
|
|
|
234
252
|
timestamp: nn(n.timestamp),
|
|
235
253
|
read: nn(n.read)
|
|
236
254
|
}));
|
|
255
|
+
const [, setBoundNotificationId] = useBoundProp(void 0, bindings?.selectedNotificationId);
|
|
237
256
|
return /* @__PURE__ */ jsx(
|
|
238
257
|
NotificationCenter,
|
|
239
258
|
{
|
|
240
259
|
notifications,
|
|
241
|
-
onDismiss: () =>
|
|
242
|
-
|
|
260
|
+
onDismiss: (id) => {
|
|
261
|
+
setBoundNotificationId(id);
|
|
262
|
+
emit("dismiss");
|
|
263
|
+
},
|
|
264
|
+
onNotificationClick: (notification) => {
|
|
265
|
+
setBoundNotificationId(notification.id);
|
|
266
|
+
emit("select");
|
|
267
|
+
},
|
|
243
268
|
emptyMessage: nn(props.emptyMessage),
|
|
244
269
|
className: nn(props.className)
|
|
245
270
|
}
|
|
@@ -261,12 +286,21 @@ var displayComponents = {
|
|
|
261
286
|
}
|
|
262
287
|
);
|
|
263
288
|
},
|
|
264
|
-
Carousel: ({ props, children }) => {
|
|
289
|
+
Carousel: ({ props, bindings, emit, children }) => {
|
|
290
|
+
const [, setBoundSelectedIndex] = useBoundProp(void 0, bindings?.selectedIndex);
|
|
291
|
+
const handleApi = useCallback((api) => {
|
|
292
|
+
if (!api) return;
|
|
293
|
+
api.on("select", () => {
|
|
294
|
+
setBoundSelectedIndex(api.selectedScrollSnap());
|
|
295
|
+
emit("select");
|
|
296
|
+
});
|
|
297
|
+
}, [setBoundSelectedIndex, emit]);
|
|
265
298
|
return /* @__PURE__ */ jsxs(
|
|
266
299
|
Carousel,
|
|
267
300
|
{
|
|
268
301
|
orientation: nn(props.orientation),
|
|
269
302
|
className: nn(props.className),
|
|
303
|
+
setApi: handleApi,
|
|
270
304
|
children: [
|
|
271
305
|
/* @__PURE__ */ jsx(CarouselContent, { children }),
|
|
272
306
|
/* @__PURE__ */ jsx(CarouselPrevious, {}),
|
|
@@ -334,7 +368,8 @@ var displayComponents = {
|
|
|
334
368
|
}
|
|
335
369
|
);
|
|
336
370
|
},
|
|
337
|
-
TreeView: ({ props, emit }) => {
|
|
371
|
+
TreeView: ({ props, bindings, emit }) => {
|
|
372
|
+
const [, setBoundSelectedNode] = useBoundProp(void 0, bindings?.selectedNode);
|
|
338
373
|
const toTreeNodes = (nodes) => nodes.map((n) => ({
|
|
339
374
|
id: n.id,
|
|
340
375
|
label: n.label,
|
|
@@ -344,27 +379,43 @@ var displayComponents = {
|
|
|
344
379
|
TreeView,
|
|
345
380
|
{
|
|
346
381
|
data: toTreeNodes(props.data),
|
|
347
|
-
onSelect: () =>
|
|
382
|
+
onSelect: (node) => {
|
|
383
|
+
setBoundSelectedNode(node.id);
|
|
384
|
+
emit("select");
|
|
385
|
+
},
|
|
348
386
|
className: nn(props.className)
|
|
349
387
|
}
|
|
350
388
|
);
|
|
351
389
|
},
|
|
352
|
-
AvatarUpload: ({ props, emit }) => {
|
|
390
|
+
AvatarUpload: ({ props, bindings, emit }) => {
|
|
391
|
+
const [boundValue, setBoundValue] = useBoundProp(
|
|
392
|
+
props.value,
|
|
393
|
+
bindings?.value
|
|
394
|
+
);
|
|
353
395
|
return /* @__PURE__ */ jsx(
|
|
354
396
|
AvatarUpload,
|
|
355
397
|
{
|
|
356
|
-
value:
|
|
357
|
-
onChange: () =>
|
|
398
|
+
value: boundValue ?? "",
|
|
399
|
+
onChange: (file) => {
|
|
400
|
+
if (file) {
|
|
401
|
+
const url = URL.createObjectURL(file);
|
|
402
|
+
setBoundValue(url);
|
|
403
|
+
} else {
|
|
404
|
+
setBoundValue("");
|
|
405
|
+
}
|
|
406
|
+
emit("change");
|
|
407
|
+
},
|
|
358
408
|
className: nn(props.className)
|
|
359
409
|
}
|
|
360
410
|
);
|
|
361
411
|
},
|
|
362
|
-
SettingsModal: ({ props, emit, children }) => {
|
|
412
|
+
SettingsModal: ({ props, bindings, emit, children }) => {
|
|
363
413
|
const tabs = (props.tabs ?? []).map((t) => ({
|
|
364
414
|
id: t.id,
|
|
365
415
|
label: nn(t.label),
|
|
366
416
|
icon: /* @__PURE__ */ jsx("span", { children: t.id })
|
|
367
417
|
}));
|
|
418
|
+
const [, setBoundSelectedTab] = useBoundProp(void 0, bindings?.selectedTab);
|
|
368
419
|
return /* @__PURE__ */ jsx(
|
|
369
420
|
SettingsModal,
|
|
370
421
|
{
|
|
@@ -374,7 +425,11 @@ var displayComponents = {
|
|
|
374
425
|
},
|
|
375
426
|
defaultTab: nn(props.defaultTab),
|
|
376
427
|
tabs: tabs.length > 0 ? tabs : void 0,
|
|
377
|
-
renderContent: () => children
|
|
428
|
+
renderContent: () => children,
|
|
429
|
+
onTabChange: (tab) => {
|
|
430
|
+
setBoundSelectedTab(tab);
|
|
431
|
+
emit("tabChange");
|
|
432
|
+
}
|
|
378
433
|
}
|
|
379
434
|
);
|
|
380
435
|
}
|
|
@@ -53,27 +53,31 @@ var blocksAuthDefinitions = {
|
|
|
53
53
|
CheckEmailBlock: {
|
|
54
54
|
props: z.object({
|
|
55
55
|
email: z.string().nullable(),
|
|
56
|
-
type: z.enum(["verification", "reset", "magic-link"]).nullable()
|
|
56
|
+
type: z.enum(["verification", "reset", "magic-link"]).nullable(),
|
|
57
|
+
state: z.enum(["idle", "loading", "sent", "error"]).nullable(),
|
|
58
|
+
error: z.string().nullable()
|
|
57
59
|
}),
|
|
58
60
|
events: ["resend", "backToLogin"],
|
|
59
61
|
description: "Post-submission email check prompt with resend action and step-by-step instructions.",
|
|
60
|
-
example: { email: "alex@company.com", type: "verification" }
|
|
62
|
+
example: { email: "alex@company.com", type: "verification", state: null, error: null }
|
|
61
63
|
},
|
|
62
64
|
LoginBlock: {
|
|
63
65
|
props: z.object({
|
|
64
66
|
type: z.enum(["login", "signup"]).nullable(),
|
|
65
67
|
showSocial: z.boolean().nullable(),
|
|
66
68
|
error: z.string().nullable(),
|
|
69
|
+
loading: z.boolean().nullable(),
|
|
67
70
|
forgotPasswordHref: z.string().nullable(),
|
|
68
71
|
signUpHref: z.string().nullable(),
|
|
69
72
|
signInHref: z.string().nullable(),
|
|
70
73
|
email: z.string().nullable(),
|
|
71
74
|
password: z.string().nullable(),
|
|
72
|
-
fullName: z.string().nullable()
|
|
75
|
+
fullName: z.string().nullable(),
|
|
76
|
+
selectedProvider: z.string().nullable()
|
|
73
77
|
}),
|
|
74
78
|
events: ["submit", "socialLogin"],
|
|
75
79
|
description: "Authentication login form with email/password fields and optional social login buttons.",
|
|
76
|
-
example: { type: "login", showSocial: true, error: null, forgotPasswordHref: "/reset-password", signUpHref: null, signInHref: null, email: null, password: null, fullName: null }
|
|
80
|
+
example: { type: "login", showSocial: true, error: null, loading: false, forgotPasswordHref: "/reset-password", signUpHref: null, signInHref: null, email: null, password: null, fullName: null, selectedProvider: null }
|
|
77
81
|
},
|
|
78
82
|
OTPBlock: {
|
|
79
83
|
props: z.object({
|
|
@@ -96,22 +100,26 @@ var blocksAuthDefinitions = {
|
|
|
96
100
|
description: z.string().nullable(),
|
|
97
101
|
buttonText: z.string().nullable(),
|
|
98
102
|
successTitle: z.string().nullable(),
|
|
99
|
-
email: z.string().nullable()
|
|
103
|
+
email: z.string().nullable(),
|
|
104
|
+
state: z.enum(["idle", "loading", "success", "error"]).nullable(),
|
|
105
|
+
error: z.string().nullable()
|
|
100
106
|
}),
|
|
101
|
-
events: ["submit", "backToLogin"],
|
|
107
|
+
events: ["submit", "resend", "backToLogin"],
|
|
102
108
|
description: "Password recovery form with email input. Supports reset and magic-link modes.",
|
|
103
|
-
example: { mode: "reset", title: "Forgot your password?", description: "Enter your email and we will send a reset link.", buttonText: "Send Reset Link", successTitle: "Check your inbox", email: null }
|
|
109
|
+
example: { mode: "reset", title: "Forgot your password?", description: "Enter your email and we will send a reset link.", buttonText: "Send Reset Link", successTitle: "Check your inbox", email: null, state: null, error: null }
|
|
104
110
|
},
|
|
105
111
|
ResetPasswordBlock: {
|
|
106
112
|
props: z.object({
|
|
107
113
|
title: z.string().nullable(),
|
|
108
114
|
description: z.string().nullable(),
|
|
109
115
|
password: z.string().nullable(),
|
|
110
|
-
confirmPassword: z.string().nullable()
|
|
116
|
+
confirmPassword: z.string().nullable(),
|
|
117
|
+
state: z.enum(["idle", "loading", "success", "error"]).nullable(),
|
|
118
|
+
error: z.string().nullable()
|
|
111
119
|
}),
|
|
112
120
|
events: ["submit", "backToLogin"],
|
|
113
121
|
description: "New password form with password confirmation. Shown after recovery link click.",
|
|
114
|
-
example: { title: "Set New Password", description: "Choose a strong password for your account.", password: null, confirmPassword: null }
|
|
122
|
+
example: { title: "Set New Password", description: "Choose a strong password for your account.", password: null, confirmPassword: null, state: null, error: null }
|
|
115
123
|
},
|
|
116
124
|
TwoFactorSetupBlock: {
|
|
117
125
|
props: z.object({
|
|
@@ -120,7 +128,9 @@ var blocksAuthDefinitions = {
|
|
|
120
128
|
backupCodes: z.array(z.string()).nullable(),
|
|
121
129
|
title: z.string().nullable(),
|
|
122
130
|
description: z.string().nullable(),
|
|
123
|
-
verifyCode: z.string().nullable()
|
|
131
|
+
verifyCode: z.string().nullable(),
|
|
132
|
+
state: z.enum(["idle", "loading", "success", "error"]).nullable(),
|
|
133
|
+
error: z.string().nullable()
|
|
124
134
|
}),
|
|
125
135
|
events: ["verify", "complete"],
|
|
126
136
|
description: "Two-factor setup wizard with QR code, secret key display, backup codes, and verification.",
|
|
@@ -130,7 +140,9 @@ var blocksAuthDefinitions = {
|
|
|
130
140
|
backupCodes: ["a1b2c3d4", "e5f6g7h8", "i9j0k1l2"],
|
|
131
141
|
title: "Enable Two-Factor Authentication",
|
|
132
142
|
description: "Scan the QR code with your authenticator app.",
|
|
133
|
-
verifyCode: null
|
|
143
|
+
verifyCode: null,
|
|
144
|
+
state: null,
|
|
145
|
+
error: null
|
|
134
146
|
}
|
|
135
147
|
}
|
|
136
148
|
};
|
|
@@ -2,7 +2,6 @@ import { TextReveal } from './chunk-LV4LBWCS.js';
|
|
|
2
2
|
import { AnimatedGradientText } from './chunk-XZ3A33GP.js';
|
|
3
3
|
import { MouseGlow } from './chunk-MZGGA75L.js';
|
|
4
4
|
import { Heading } from './chunk-UXX6HHPS.js';
|
|
5
|
-
import { siteConfig } from './chunk-A7NUWD76.js';
|
|
6
5
|
import { Card, CardHeader, CardContent } from './chunk-7UY24UWL.js';
|
|
7
6
|
import { Button } from './chunk-7KIDDF3I.js';
|
|
8
7
|
import { m, heroStagger } from './chunk-PD2YEH3H.js';
|
|
@@ -21,7 +20,7 @@ var TEXT_EFFECTS = {
|
|
|
21
20
|
};
|
|
22
21
|
var DEFAULT_PRIMARY_ACTION = { label: "Get Started" };
|
|
23
22
|
var DEFAULT_SECONDARY_ACTION = { label: "View Components" };
|
|
24
|
-
var DEFAULT_ANNOUNCEMENT = { label: "New", text:
|
|
23
|
+
var DEFAULT_ANNOUNCEMENT = { label: "New", text: "Design System v2.0 is now live", href: "#" };
|
|
25
24
|
function HeroCenteredVariant({
|
|
26
25
|
headline = "Experience the Future of Synthetic Intelligence",
|
|
27
26
|
subheadline = "Unleash the power of deep learning with our ultra-realistic, high-performance design system. Built for the next generation of AI interfaces.",
|
|
@@ -110,9 +109,10 @@ function HeroCenteredVariant({
|
|
|
110
109
|
}
|
|
111
110
|
var DEFAULT_SPLIT_PRIMARY_ACTION = { label: "Start Building" };
|
|
112
111
|
function HeroSplitVariant({
|
|
113
|
-
headline =
|
|
112
|
+
headline = "Build faster with our platform",
|
|
114
113
|
subheadline = "A complete component library for building modern, high-contrast AI applications.",
|
|
115
114
|
primaryAction = DEFAULT_SPLIT_PRIMARY_ACTION,
|
|
115
|
+
secondaryAction,
|
|
116
116
|
className
|
|
117
117
|
}) {
|
|
118
118
|
const shouldReduceMotion = useReducedMotion();
|
|
@@ -140,7 +140,7 @@ function HeroSplitVariant({
|
|
|
140
140
|
primaryAction.label,
|
|
141
141
|
/* @__PURE__ */ jsx(ZapIcon, { size: 16, className: "ml-2" })
|
|
142
142
|
] }),
|
|
143
|
-
/* @__PURE__ */ jsx(Button, { size: "lg", variant: "ghost", children: "Documentation" })
|
|
143
|
+
/* @__PURE__ */ jsx(Button, { size: "lg", variant: "ghost", onClick: secondaryAction?.onClick, children: secondaryAction?.label ?? "Documentation" })
|
|
144
144
|
] }) }),
|
|
145
145
|
/* @__PURE__ */ jsx(Item, { ...!shouldReduceMotion && { variants: heroStagger.child }, children: /* @__PURE__ */ jsxs("div", { className: "mt-8 flex items-center gap-4 text-sm text-text-tertiary", children: [
|
|
146
146
|
/* @__PURE__ */ jsx("div", { className: "flex -space-x-2", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsxs("div", { className: "h-8 w-8 rounded-full border-2 border-background bg-surface-active flex items-center justify-center text-[10px] font-semibold", children: [
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { HeatmapChartBlock } from './chunk-767GZSNJ.js';
|
|
2
|
+
import { AreaChart } from './chunk-ZTNHUABC.js';
|
|
3
|
+
import { BarChart } from './chunk-JICACDAV.js';
|
|
4
|
+
import { LineChart } from './chunk-Z2NBLCSD.js';
|
|
5
|
+
import { PieChart } from './chunk-O4QTL2EQ.js';
|
|
6
|
+
import { RadarChart } from './chunk-UFZH45UL.js';
|
|
7
|
+
import { RadialBarChart } from './chunk-RAVRFGA5.js';
|
|
8
|
+
import { StaggerChildren } from './chunk-DQPK2XRL.js';
|
|
9
|
+
import { Heading } from './chunk-UXX6HHPS.js';
|
|
10
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from './chunk-7UY24UWL.js';
|
|
11
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
var noop = () => {
|
|
14
|
+
};
|
|
15
|
+
var noopOn = () => ({ emit: noop, shouldPreventDefault: false, bound: false });
|
|
16
|
+
var areaData = [
|
|
17
|
+
{ month: "Jan", desktop: 186, mobile: 80 },
|
|
18
|
+
{ month: "Feb", desktop: 305, mobile: 200 },
|
|
19
|
+
{ month: "Mar", desktop: 237, mobile: 120 },
|
|
20
|
+
{ month: "Apr", desktop: 73, mobile: 190 },
|
|
21
|
+
{ month: "May", desktop: 209, mobile: 130 },
|
|
22
|
+
{ month: "Jun", desktop: 214, mobile: 140 }
|
|
23
|
+
];
|
|
24
|
+
var chartData = [
|
|
25
|
+
{ browser: "chrome", visitors: 275, fill: "rgb(var(--chart-1))" },
|
|
26
|
+
{ browser: "safari", visitors: 200, fill: "rgb(var(--chart-2))" },
|
|
27
|
+
{ browser: "firefox", visitors: 187, fill: "rgb(var(--chart-3))" },
|
|
28
|
+
{ browser: "edge", visitors: 173, fill: "rgb(var(--chart-4))" },
|
|
29
|
+
{ browser: "other", visitors: 90, fill: "rgb(var(--chart-5))" }
|
|
30
|
+
];
|
|
31
|
+
var radarData = [
|
|
32
|
+
{ month: "January", desktop: 186 },
|
|
33
|
+
{ month: "February", desktop: 305 },
|
|
34
|
+
{ month: "March", desktop: 237 },
|
|
35
|
+
{ month: "April", desktop: 273 },
|
|
36
|
+
{ month: "May", desktop: 209 },
|
|
37
|
+
{ month: "June", desktop: 214 }
|
|
38
|
+
];
|
|
39
|
+
var radialData = [
|
|
40
|
+
{ browser: "chrome", visitors: 275, fill: "rgb(var(--chart-1))" },
|
|
41
|
+
{ browser: "safari", visitors: 200, fill: "rgb(var(--chart-2))" },
|
|
42
|
+
{ browser: "firefox", visitors: 187, fill: "rgb(var(--chart-3))" },
|
|
43
|
+
{ browser: "edge", visitors: 173, fill: "rgb(var(--chart-4))" },
|
|
44
|
+
{ browser: "other", visitors: 90, fill: "rgb(var(--chart-5))" }
|
|
45
|
+
];
|
|
46
|
+
var areaConfig = {
|
|
47
|
+
desktop: {
|
|
48
|
+
label: "Desktop",
|
|
49
|
+
color: "rgb(var(--chart-1))"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var barLineConfig = {
|
|
53
|
+
desktop: {
|
|
54
|
+
label: "Desktop",
|
|
55
|
+
color: "rgb(var(--chart-1))"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var pieConfig = {
|
|
59
|
+
chrome: { label: "Chrome", color: "rgb(var(--chart-1))" },
|
|
60
|
+
safari: { label: "Safari", color: "rgb(var(--chart-2))" },
|
|
61
|
+
firefox: { label: "Firefox", color: "rgb(var(--chart-3))" },
|
|
62
|
+
edge: { label: "Edge", color: "rgb(var(--chart-4))" },
|
|
63
|
+
other: { label: "Other", color: "rgb(var(--chart-5))" }
|
|
64
|
+
};
|
|
65
|
+
var radarConfig = {
|
|
66
|
+
desktop: {
|
|
67
|
+
label: "Desktop",
|
|
68
|
+
color: "rgb(var(--chart-1))"
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var radialConfig = {
|
|
72
|
+
chrome: { label: "Chrome", color: "rgb(var(--chart-1))" },
|
|
73
|
+
safari: { label: "Safari", color: "rgb(var(--chart-2))" },
|
|
74
|
+
firefox: { label: "Firefox", color: "rgb(var(--chart-3))" },
|
|
75
|
+
edge: { label: "Edge", color: "rgb(var(--chart-4))" },
|
|
76
|
+
other: { label: "Other", color: "rgb(var(--chart-5))" }
|
|
77
|
+
};
|
|
78
|
+
function ChartCollectionBlock({ props }) {
|
|
79
|
+
const title = props.title ?? null;
|
|
80
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
81
|
+
title ? /* @__PURE__ */ jsx(Heading, { level: 2, size: "section", children: title }) : null,
|
|
82
|
+
/* @__PURE__ */ jsxs(StaggerChildren, { staggerMs: 100, className: "grid gap-6 md:grid-cols-2 lg:grid-cols-3", children: [
|
|
83
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
84
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
85
|
+
/* @__PURE__ */ jsx(CardTitle, { children: "Area Chart" }),
|
|
86
|
+
/* @__PURE__ */ jsx(CardDescription, { children: "Usage overview" })
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsx(CardContent, { children: areaData.length > 0 && /* @__PURE__ */ jsx(
|
|
89
|
+
AreaChart,
|
|
90
|
+
{
|
|
91
|
+
data: areaData,
|
|
92
|
+
config: areaConfig,
|
|
93
|
+
indexKey: "month",
|
|
94
|
+
areas: ["desktop"],
|
|
95
|
+
className: "h-[250px] w-full",
|
|
96
|
+
showLegend: false
|
|
97
|
+
}
|
|
98
|
+
) })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
101
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Bar Chart" }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(CardContent, { children: areaData.length > 0 && /* @__PURE__ */ jsx(
|
|
103
|
+
BarChart,
|
|
104
|
+
{
|
|
105
|
+
data: areaData,
|
|
106
|
+
config: barLineConfig,
|
|
107
|
+
indexKey: "month",
|
|
108
|
+
bars: ["desktop"],
|
|
109
|
+
className: "h-[250px] w-full",
|
|
110
|
+
showLegend: false
|
|
111
|
+
}
|
|
112
|
+
) })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
115
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Line Chart" }) }),
|
|
116
|
+
/* @__PURE__ */ jsx(CardContent, { children: areaData.length > 0 && /* @__PURE__ */ jsx(
|
|
117
|
+
LineChart,
|
|
118
|
+
{
|
|
119
|
+
data: areaData,
|
|
120
|
+
config: barLineConfig,
|
|
121
|
+
indexKey: "month",
|
|
122
|
+
lines: ["desktop"],
|
|
123
|
+
className: "h-[250px] w-full",
|
|
124
|
+
showLegend: false
|
|
125
|
+
}
|
|
126
|
+
) })
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
129
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Pie Chart" }) }),
|
|
130
|
+
/* @__PURE__ */ jsx(CardContent, { children: chartData.length > 0 && /* @__PURE__ */ jsx(
|
|
131
|
+
PieChart,
|
|
132
|
+
{
|
|
133
|
+
data: chartData,
|
|
134
|
+
config: pieConfig,
|
|
135
|
+
dataKey: "visitors",
|
|
136
|
+
nameKey: "browser",
|
|
137
|
+
variant: "donut",
|
|
138
|
+
innerRadius: 60,
|
|
139
|
+
showLegend: false
|
|
140
|
+
}
|
|
141
|
+
) })
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
144
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Radar Chart" }) }),
|
|
145
|
+
/* @__PURE__ */ jsx(CardContent, { children: radarData.length > 0 && /* @__PURE__ */ jsx(
|
|
146
|
+
RadarChart,
|
|
147
|
+
{
|
|
148
|
+
data: radarData,
|
|
149
|
+
config: radarConfig,
|
|
150
|
+
indexKey: "month",
|
|
151
|
+
series: ["desktop"],
|
|
152
|
+
className: "h-[250px] w-full",
|
|
153
|
+
showLegend: false
|
|
154
|
+
}
|
|
155
|
+
) })
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
158
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Radial Chart" }) }),
|
|
159
|
+
/* @__PURE__ */ jsx(CardContent, { children: radialData.length > 0 && /* @__PURE__ */ jsx(
|
|
160
|
+
RadialBarChart,
|
|
161
|
+
{
|
|
162
|
+
data: radialData,
|
|
163
|
+
config: radialConfig,
|
|
164
|
+
dataKey: "visitors",
|
|
165
|
+
nameKey: "browser",
|
|
166
|
+
innerRadius: 40,
|
|
167
|
+
outerRadius: 100,
|
|
168
|
+
className: "h-[250px] w-full",
|
|
169
|
+
showLegend: false
|
|
170
|
+
}
|
|
171
|
+
) })
|
|
172
|
+
] }),
|
|
173
|
+
/* @__PURE__ */ jsx(
|
|
174
|
+
HeatmapChartBlock,
|
|
175
|
+
{
|
|
176
|
+
props: { data: null, config: null, title: null, description: null },
|
|
177
|
+
emit: noop,
|
|
178
|
+
on: noopOn
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] })
|
|
182
|
+
] });
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export { ChartCollectionBlock };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ScrollArea } from './chunk-GLU236NN.js';
|
|
2
2
|
import { Input } from './chunk-AP3XXYAY.js';
|
|
3
|
-
import { useSafeTimeout } from './chunk-MDAYDDTC.js';
|
|
4
3
|
import { Avatar, AvatarFallback } from './chunk-NAAU5IWU.js';
|
|
5
4
|
import { Button } from './chunk-7KIDDF3I.js';
|
|
6
5
|
import { useMotionConfig, m, motionSpring } from './chunk-PD2YEH3H.js';
|
|
@@ -10,6 +9,7 @@ import { SendIcon } from './chunk-CRZ2JE24.js';
|
|
|
10
9
|
import { UserIcon } from './chunk-UHXGBV5N.js';
|
|
11
10
|
import { cn } from './chunk-QYZT24TS.js';
|
|
12
11
|
import * as React from 'react';
|
|
12
|
+
import { useBoundProp } from '@json-render/react';
|
|
13
13
|
import { useTranslations } from 'next-intl';
|
|
14
14
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
15
15
|
|
|
@@ -21,44 +21,44 @@ var defaultInitialMessages = [
|
|
|
21
21
|
}
|
|
22
22
|
];
|
|
23
23
|
function ChatLayout({
|
|
24
|
-
props
|
|
24
|
+
props,
|
|
25
|
+
bindings,
|
|
26
|
+
emit
|
|
25
27
|
}) {
|
|
26
28
|
const initialMessages = props.initialMessages ?? defaultInitialMessages;
|
|
29
|
+
const messages = props.messages ?? void 0;
|
|
27
30
|
const assistantName = props.assistantName ?? "AI Assistant";
|
|
28
31
|
const assistantStatus = props.assistantStatus ?? "Online";
|
|
29
32
|
const placeholder = props.placeholder ?? "Type a message...";
|
|
30
33
|
const className = props.className;
|
|
31
34
|
const t = useTranslations("blocks.chatLayout");
|
|
32
35
|
const motionConfig = useMotionConfig();
|
|
33
|
-
const [
|
|
34
|
-
const
|
|
36
|
+
const [localMessages, setLocalMessages] = React.useState(initialMessages);
|
|
37
|
+
const resolvedMessages = messages ?? localMessages;
|
|
38
|
+
const [boundInput, setBoundInput] = useBoundProp(props.messageInput, bindings?.messageInput);
|
|
39
|
+
const [localInput, setLocalInput] = React.useState("");
|
|
40
|
+
const isInputBound = !!bindings?.messageInput;
|
|
41
|
+
const input = isInputBound ? boundInput ?? "" : localInput;
|
|
42
|
+
const setInput = isInputBound ? setBoundInput : setLocalInput;
|
|
35
43
|
const scrollRef = React.useRef(null);
|
|
36
|
-
const setSafeTimeout = useSafeTimeout();
|
|
37
44
|
const handleSend = () => {
|
|
38
45
|
if (!input.trim()) return;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
if (!messages) {
|
|
47
|
+
const newMessage = {
|
|
48
|
+
id: Date.now().toString(),
|
|
49
|
+
role: "user",
|
|
50
|
+
content: input
|
|
51
|
+
};
|
|
52
|
+
setLocalMessages((prev) => [...prev, newMessage]);
|
|
53
|
+
}
|
|
54
|
+
emit("send");
|
|
45
55
|
setInput("");
|
|
46
|
-
setSafeTimeout(() => {
|
|
47
|
-
setMessages((prev) => [
|
|
48
|
-
...prev,
|
|
49
|
-
{
|
|
50
|
-
id: (Date.now() + 1).toString(),
|
|
51
|
-
role: "assistant",
|
|
52
|
-
content: "This is a simulated response matching the design system."
|
|
53
|
-
}
|
|
54
|
-
]);
|
|
55
|
-
}, 1e3);
|
|
56
56
|
};
|
|
57
57
|
React.useEffect(() => {
|
|
58
58
|
if (scrollRef.current) {
|
|
59
59
|
scrollRef.current.scrollIntoView({ behavior: "smooth" });
|
|
60
60
|
}
|
|
61
|
-
}, [
|
|
61
|
+
}, [resolvedMessages]);
|
|
62
62
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[350px] md:h-[500px] w-full flex-col overflow-hidden rounded-lg glass-panel", className), children: [
|
|
63
63
|
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-between border-b border-border/50 p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
64
64
|
/* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "bg-accent text-accent-foreground", children: /* @__PURE__ */ jsx(BotIcon, { size: 16 }) }) }),
|
|
@@ -68,7 +68,7 @@ function ChatLayout({
|
|
|
68
68
|
] })
|
|
69
69
|
] }) }),
|
|
70
70
|
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 p-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
71
|
-
|
|
71
|
+
resolvedMessages.map((message, index) => /* @__PURE__ */ jsxs(
|
|
72
72
|
m.div,
|
|
73
73
|
{
|
|
74
74
|
initial: { opacity: 0, y: 8 },
|
|
@@ -5,6 +5,7 @@ import { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, Menu
|
|
|
5
5
|
import { Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription } from './chunk-BHPATKC7.js';
|
|
6
6
|
import { FloatingDock } from './chunk-TXRGQO5M.js';
|
|
7
7
|
import { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbPage, BreadcrumbLink, BreadcrumbSeparator } from './chunk-35EX5FP5.js';
|
|
8
|
+
import { useBoundProp } from '@json-render/react';
|
|
8
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
11
|
var navigationComponents = {
|
|
@@ -18,12 +19,19 @@ var navigationComponents = {
|
|
|
18
19
|
] }) }, i);
|
|
19
20
|
}) }) });
|
|
20
21
|
},
|
|
21
|
-
NavigationMenu: ({ props, emit }) => {
|
|
22
|
+
NavigationMenu: ({ props, bindings, emit }) => {
|
|
22
23
|
const items = props.items ?? [];
|
|
24
|
+
const [, setBoundSelectedHref] = useBoundProp(void 0, bindings?.selectedHref);
|
|
23
25
|
return /* @__PURE__ */ jsx(NavigationMenu, { className: nn(props.className), children: /* @__PURE__ */ jsx(NavigationMenuList, { children: items.map((item, i) => /* @__PURE__ */ jsx(NavigationMenuItem, { children: item.children && item.children.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
26
|
/* @__PURE__ */ jsx(NavigationMenuTrigger, { children: item.label }),
|
|
25
|
-
/* @__PURE__ */ jsx(NavigationMenuContent, { children: /* @__PURE__ */ jsx("ul", { className: "grid gap-1 p-3 w-48", children: item.children.map((child, j) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(NavigationMenuLink, { href: child.href, onClick: () =>
|
|
26
|
-
|
|
27
|
+
/* @__PURE__ */ jsx(NavigationMenuContent, { children: /* @__PURE__ */ jsx("ul", { className: "grid gap-1 p-3 w-48", children: item.children.map((child, j) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(NavigationMenuLink, { href: child.href, onClick: () => {
|
|
28
|
+
setBoundSelectedHref(child.href);
|
|
29
|
+
emit("navigate");
|
|
30
|
+
}, className: "block rounded px-3 py-2 text-sm hover:bg-surface-hover transition-colors", children: child.label }) }, j)) }) })
|
|
31
|
+
] }) : /* @__PURE__ */ jsx(NavigationMenuLink, { href: item.href ?? "#", onClick: () => {
|
|
32
|
+
setBoundSelectedHref(item.href ?? "#");
|
|
33
|
+
emit("navigate");
|
|
34
|
+
}, className: "px-3 py-2 text-sm", children: item.label }) }, i)) }) });
|
|
27
35
|
},
|
|
28
36
|
Sidebar: ({ props, children }) => {
|
|
29
37
|
return /* @__PURE__ */ jsxs(SidebarProvider, { children: [
|
|
@@ -42,13 +50,22 @@ var navigationComponents = {
|
|
|
42
50
|
},
|
|
43
51
|
Drawer: ({
|
|
44
52
|
props,
|
|
53
|
+
bindings,
|
|
45
54
|
emit,
|
|
46
55
|
children
|
|
47
56
|
}) => {
|
|
57
|
+
const [boundOpen, setBoundOpen] = useBoundProp(
|
|
58
|
+
props.open,
|
|
59
|
+
bindings?.open
|
|
60
|
+
);
|
|
61
|
+
const isBound = !!bindings?.open;
|
|
62
|
+
const openProps = isBound ? { open: boundOpen ?? false } : {};
|
|
48
63
|
return /* @__PURE__ */ jsxs(
|
|
49
64
|
Drawer,
|
|
50
65
|
{
|
|
66
|
+
...openProps,
|
|
51
67
|
onOpenChange: (v) => {
|
|
68
|
+
if (isBound) setBoundOpen(v);
|
|
52
69
|
if (!v) emit("close");
|
|
53
70
|
},
|
|
54
71
|
children: [
|
|
@@ -78,11 +95,15 @@ var navigationComponents = {
|
|
|
78
95
|
}
|
|
79
96
|
);
|
|
80
97
|
},
|
|
81
|
-
Menubar: ({ props, emit }) => {
|
|
98
|
+
Menubar: ({ props, bindings, emit }) => {
|
|
82
99
|
const menus = props.menus ?? [];
|
|
100
|
+
const [, setBoundSelectedItem] = useBoundProp(void 0, bindings?.selectedItem);
|
|
83
101
|
return /* @__PURE__ */ jsx(Menubar, { className: nn(props.className), children: menus.map((menu, i) => /* @__PURE__ */ jsxs(MenubarMenu, { children: [
|
|
84
102
|
/* @__PURE__ */ jsx(MenubarTrigger, { children: menu.label }),
|
|
85
|
-
/* @__PURE__ */ jsx(MenubarContent, { children: menu.items.map((item) => /* @__PURE__ */ jsxs(MenubarItem, { onSelect: () =>
|
|
103
|
+
/* @__PURE__ */ jsx(MenubarContent, { children: menu.items.map((item) => /* @__PURE__ */ jsxs(MenubarItem, { onSelect: () => {
|
|
104
|
+
setBoundSelectedItem(item.value);
|
|
105
|
+
emit("select");
|
|
106
|
+
}, children: [
|
|
86
107
|
item.label,
|
|
87
108
|
item.shortcut && /* @__PURE__ */ jsx(MenubarShortcut, { children: item.shortcut })
|
|
88
109
|
] }, item.value)) })
|