laif-ds 0.2.74 → 0.2.76

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.
Files changed (155) hide show
  1. package/dist/CHANGELOG.md +446 -0
  2. package/dist/agent-docs/adoption-report.json +615 -0
  3. package/dist/agent-docs/components/Accordion.md +46 -16
  4. package/dist/agent-docs/components/Alert.md +90 -95
  5. package/dist/agent-docs/components/AlertDialog.md +132 -126
  6. package/dist/agent-docs/components/AppEditor.md +90 -90
  7. package/dist/agent-docs/components/AppRadioGroup.md +18 -18
  8. package/dist/agent-docs/components/AppSidebar.md +129 -122
  9. package/dist/agent-docs/components/AppStepper.md +81 -77
  10. package/dist/agent-docs/components/AspectRatio.md +70 -62
  11. package/dist/agent-docs/components/AudioVisualizer.md +5 -5
  12. package/dist/agent-docs/components/Avatar.md +112 -113
  13. package/dist/agent-docs/components/Badge.md +123 -118
  14. package/dist/agent-docs/components/Breadcrumb.md +8 -1
  15. package/dist/agent-docs/components/Button.md +131 -129
  16. package/dist/agent-docs/components/Card.md +172 -147
  17. package/dist/agent-docs/components/Carousel.md +148 -129
  18. package/dist/agent-docs/components/Chat.md +121 -109
  19. package/dist/agent-docs/components/ChatMessage.md +72 -61
  20. package/dist/agent-docs/components/Checkbox.md +150 -135
  21. package/dist/agent-docs/components/CircularProgress.md +53 -49
  22. package/dist/agent-docs/components/CodeHighlighter.md +4 -4
  23. package/dist/agent-docs/components/Collapsible.md +114 -95
  24. package/dist/agent-docs/components/Command.md +141 -142
  25. package/dist/agent-docs/components/Confirmer.md +182 -175
  26. package/dist/agent-docs/components/ContextMenu.md +196 -191
  27. package/dist/agent-docs/components/DataCrossTable.md +114 -94
  28. package/dist/agent-docs/components/DataTable.md +32 -24
  29. package/dist/agent-docs/components/Dialog.md +130 -125
  30. package/dist/agent-docs/components/Drawer.md +141 -127
  31. package/dist/agent-docs/components/FilePreviewer.md +138 -139
  32. package/dist/agent-docs/components/FileUploader.md +149 -129
  33. package/dist/agent-docs/components/Form.md +3 -1
  34. package/dist/agent-docs/components/FormComposer.md +163 -137
  35. package/dist/agent-docs/components/GanttChart.md +125 -122
  36. package/dist/agent-docs/components/HoverCard.md +1 -1
  37. package/dist/agent-docs/components/Icon.md +98 -99
  38. package/dist/agent-docs/components/Input.md +173 -138
  39. package/dist/agent-docs/components/InputOtp.md +6 -1
  40. package/dist/agent-docs/components/InputSelector.md +94 -97
  41. package/dist/agent-docs/components/InterruptPrompt.md +4 -4
  42. package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
  43. package/dist/agent-docs/components/Menubar.md +60 -57
  44. package/dist/agent-docs/components/MessageInput.md +134 -131
  45. package/dist/agent-docs/components/MessageList.md +110 -96
  46. package/dist/agent-docs/components/MultipleSelector.md +147 -146
  47. package/dist/agent-docs/components/NavigationMenu.md +6 -2
  48. package/dist/agent-docs/components/Popover.md +112 -103
  49. package/dist/agent-docs/components/PromptSuggestions.md +5 -5
  50. package/dist/agent-docs/components/RadioGroup.md +97 -90
  51. package/dist/agent-docs/components/Resizable.md +4 -1
  52. package/dist/agent-docs/components/ResizePrompt.md +12 -13
  53. package/dist/agent-docs/components/ScrollArea.md +6 -2
  54. package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
  55. package/dist/agent-docs/components/Select.md +131 -132
  56. package/dist/agent-docs/components/Sheet.md +8 -1
  57. package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
  58. package/dist/agent-docs/components/Sidebar.md +94 -85
  59. package/dist/agent-docs/components/Slider.md +62 -58
  60. package/dist/agent-docs/components/Sonner.md +1 -0
  61. package/dist/agent-docs/components/Spinner.md +14 -14
  62. package/dist/agent-docs/components/Stepper.md +93 -67
  63. package/dist/agent-docs/components/Switch.md +41 -42
  64. package/dist/agent-docs/components/TableSkeleton.md +8 -8
  65. package/dist/agent-docs/components/Tabs.md +106 -86
  66. package/dist/agent-docs/components/TextArea.md +51 -52
  67. package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
  68. package/dist/agent-docs/components/Toaster.md +1 -0
  69. package/dist/agent-docs/components/Tooltip.md +102 -91
  70. package/dist/agent-docs/components/Typo.md +68 -65
  71. package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
  72. package/dist/agent-docs/components-list.md +1 -0
  73. package/dist/agent-docs/manifest.json +5981 -0
  74. package/dist/agent-docs/truncated-cell.md +342 -0
  75. package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
  76. package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
  77. package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
  78. package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
  79. package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
  80. package/dist/components/ui/app-checkbox.js +1 -1
  81. package/dist/components/ui/app-dialog.js +70 -64
  82. package/dist/components/ui/app-editor.js +51 -51
  83. package/dist/components/ui/app-form.js +81 -81
  84. package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
  85. package/dist/components/ui/app-select.js +109 -104
  86. package/dist/components/ui/app-sidebar.js +41 -41
  87. package/dist/components/ui/app-stepper.js +1 -1
  88. package/dist/components/ui/app-time-picker.js +18 -18
  89. package/dist/components/ui/app-tooltip.js +1 -1
  90. package/dist/components/ui/async-select.js +5 -5
  91. package/dist/components/ui/audio-visualizer.js +61 -58
  92. package/dist/components/ui/card.js +1 -1
  93. package/dist/components/ui/carousel.js +2 -2
  94. package/dist/components/ui/chart.js +1 -1
  95. package/dist/components/ui/chat-message.js +8 -8
  96. package/dist/components/ui/chat.js +86 -88
  97. package/dist/components/ui/command.js +2 -2
  98. package/dist/components/ui/copy-button.js +4 -4
  99. package/dist/components/ui/date-picker.js +20 -20
  100. package/dist/components/ui/file-preview/index.js +13 -13
  101. package/dist/components/ui/file-previewer.js +12 -11
  102. package/dist/components/ui/file-uploader.js +86 -78
  103. package/dist/components/ui/form.js +2 -2
  104. package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
  105. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
  106. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
  107. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
  108. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
  109. package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
  110. package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
  111. package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
  112. package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
  113. package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
  114. package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
  115. package/dist/components/ui/input-selector.js +1 -1
  116. package/dist/components/ui/input.js +23 -23
  117. package/dist/components/ui/kanban.js +8 -9
  118. package/dist/components/ui/markdown-renderer.js +41 -35
  119. package/dist/components/ui/message-input.js +45 -44
  120. package/dist/components/ui/multiple-selector.js +91 -82
  121. package/dist/components/ui/secure-pdf-viewer.js +19 -7
  122. package/dist/components/ui/sidebar.js +1 -1
  123. package/dist/components/ui/slider.js +1 -1
  124. package/dist/components/ui/spinner.js +4 -4
  125. package/dist/components/ui/stepper.js +157 -138
  126. package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
  127. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
  128. package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
  129. package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
  130. package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
  131. package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
  132. package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
  133. package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
  134. package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
  135. package/dist/components/ui/tables/data-table/data-table.js +258 -250
  136. package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
  137. package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
  138. package/dist/components/ui/textarea.js +2 -2
  139. package/dist/components/ui/theme-switcher.js +1 -1
  140. package/dist/components/ui/toggle-group.js +2 -2
  141. package/dist/components/ui/truncated-cell.js +100 -0
  142. package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
  143. package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
  144. package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
  145. package/dist/components/ui/weekly-calendar/day-column.js +16 -16
  146. package/dist/components/ui/weekly-calendar/time-column.js +4 -4
  147. package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
  148. package/dist/hooks/use-audio-recording.js +1 -1
  149. package/dist/hooks/use-auto-scroll.js +18 -18
  150. package/dist/hooks/use-autosize-textarea.js +12 -13
  151. package/dist/index.d.ts +100 -45
  152. package/dist/index.js +362 -360
  153. package/dist/lib/utils.js +6 -6
  154. package/dist/styles.v3.css +1 -1
  155. package/package.json +14 -4
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsxs as x, jsx as r } from "react/jsx-runtime";
3
- import { useDebounce as me } from "../../hooks/use-debounce.js";
4
- import { cva as ue } from "../../node_modules/class-variance-authority/dist/index.js";
3
+ import { cva as me } from "../../node_modules/class-variance-authority/dist/index.js";
5
4
  import * as k from "react";
6
5
  import { useState as y, useEffect as A, useCallback as j } from "react";
7
6
  import { designTokens as u } from "../design-tokens.js";
7
+ import { useDebounce as ue } from "../../hooks/use-debounce.js";
8
8
  import { cn as z } from "../../lib/utils.js";
9
9
  import { Checkbox as he } from "./checkbox.js";
10
10
  import { Command as ge, CommandInput as pe, CommandList as we, CommandEmpty as xe, CommandGroup as _, CommandItem as O } from "./command.js";
@@ -12,7 +12,7 @@ import { Icon as Z } from "./icon.js";
12
12
  import { Label as ye } from "./label.js";
13
13
  import { Popover as Ne, PopoverTrigger as be, PopoverContent as Ce } from "./popover.js";
14
14
  import Ae from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
15
- const Se = ue(
15
+ const Se = me(
16
16
  z(
17
17
  u.input.base,
18
18
  u.radius.default,
@@ -56,7 +56,7 @@ function $e({
56
56
  id: ee,
57
57
  "data-testid": re
58
58
  }) {
59
- const [m, P] = y(!1), L = k.useRef(null), F = k.useRef(null), te = k.useRef(null), [ne, W] = y({ loading: !1, error: null }), [X, se] = y(""), B = me(X, N), [$, ce] = y(/* @__PURE__ */ new Map()), [G, K] = y([]), [q, ae] = y(0), [H, J] = y(() => n?.length ? new Map(
59
+ const [m, P] = y(!1), L = k.useRef(null), F = k.useRef(null), te = k.useRef(null), [ne, W] = y({ loading: !1, error: null }), [X, se] = y(""), B = ue(X, N), [$, ce] = y(/* @__PURE__ */ new Map()), [G, K] = y([]), [q, ae] = y(0), [H, J] = y(() => n?.length ? new Map(
60
60
  n.map((e) => [s(e), e])
61
61
  ) : /* @__PURE__ */ new Map());
62
62
  A(() => {
@@ -157,7 +157,7 @@ function $e({
157
157
  (e) => {
158
158
  e.stopPropagation(), e.preventDefault(), g?.(o ? [] : ""), P(!1);
159
159
  },
160
- [g]
160
+ [g, o]
161
161
  ), ie = k.useId(), Y = ee ?? ie;
162
162
  return /* @__PURE__ */ x("div", { className: z("flex flex-col gap-1.5", E), children: [
163
163
  C && /* @__PURE__ */ r(ye, { htmlFor: Y, children: C }),
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { jsx as g } from "react/jsx-runtime";
3
- import { useRef as i, useEffect as w } from "react";
2
+ import { jsx as p } from "react/jsx-runtime";
3
+ import { useRef as i, useEffect as R, useCallback as f } from "react";
4
4
  const c = {
5
5
  FFT_SIZE: 512,
6
6
  SMOOTHING: 0.8,
@@ -16,80 +16,83 @@ const c = {
16
16
  // MAX_INTENSITY - MIN_INTENSITY
17
17
  }
18
18
  };
19
- function x({
20
- stream: u,
21
- isRecording: l,
22
- onClick: S
19
+ function F({
20
+ stream: a,
21
+ isRecording: s,
22
+ onClick: B
23
23
  }) {
24
- const a = i(null), d = i(null), f = i(null), I = i(null), h = i(null), R = () => {
25
- I.current && cancelAnimationFrame(I.current), d.current && d.current.close();
24
+ const u = i(null), d = i(null), I = i(null), h = i(null), N = i(null), A = () => {
25
+ h.current && cancelAnimationFrame(h.current), d.current && d.current.close();
26
26
  };
27
- w(() => R, []), w(() => {
28
- u && l ? C() : R();
29
- }, [u, l]), w(() => {
30
- const e = () => {
31
- if (typeof window > "u" || !a.current || !h.current)
32
- return;
33
- const t = h.current, n = a.current, o = window.devicePixelRatio || 1, r = t.getBoundingClientRect();
34
- n.width = (r.width - 2) * o, n.height = (r.height - 2) * o, n.style.width = `${r.width - 2}px`, n.style.height = `${r.height - 2}px`;
35
- };
36
- if (typeof window < "u")
37
- return window.addEventListener("resize", e), e(), () => window.removeEventListener("resize", e);
38
- }, []);
39
- const C = async () => {
40
- try {
41
- const e = new AudioContext();
42
- d.current = e;
43
- const t = e.createAnalyser();
44
- t.fftSize = c.FFT_SIZE, t.smoothingTimeConstant = c.SMOOTHING, f.current = t, e.createMediaStreamSource(u).connect(t), p();
45
- } catch (e) {
46
- console.error("Error starting visualization:", e);
47
- }
48
- }, E = (e) => {
27
+ R(() => A, []);
28
+ const T = f((e) => {
49
29
  const t = Math.floor(e * c.COLOR.INTENSITY_RANGE) + c.COLOR.MIN_INTENSITY;
50
30
  return `rgb(${t}, ${t}, ${t})`;
51
- }, M = (e, t, n, o, r, s) => {
52
- e.fillStyle = s, e.fillRect(t, n - r, o, r), e.fillRect(t, n, o, r);
53
- }, p = () => {
54
- if (!l) return;
55
- const e = a.current, t = e?.getContext("2d");
56
- if (!e || !t || !f.current) return;
31
+ }, []), _ = f(
32
+ (e, t, n, o, r, l) => {
33
+ e.fillStyle = l, e.fillRect(t, n - r, o, r), e.fillRect(t, n, o, r);
34
+ },
35
+ []
36
+ ), m = f(() => {
37
+ if (!s) return;
38
+ const e = u.current, t = e?.getContext("2d");
39
+ if (!e || !t || !I.current) return;
57
40
  const n = window.devicePixelRatio || 1;
58
41
  t.scale(n, n);
59
- const o = f.current, r = o.frequencyBinCount, s = new Uint8Array(r), A = () => {
60
- I.current = requestAnimationFrame(A), o.getByteFrequencyData(s), t.clearRect(0, 0, e.width / n, e.height / n);
61
- const T = Math.max(
42
+ const o = I.current, r = o.frequencyBinCount, l = new Uint8Array(r), C = () => {
43
+ h.current = requestAnimationFrame(C), o.getByteFrequencyData(l), t.clearRect(0, 0, e.width / n, e.height / n);
44
+ const S = Math.max(
62
45
  c.MIN_BAR_WIDTH,
63
46
  e.width / n / r - c.BAR_SPACING
64
- ), _ = e.height / n / 2;
65
- let m = 0;
66
- for (let N = 0; N < r; N++) {
67
- const y = s[N] / 255, B = Math.max(
47
+ ), g = e.height / n / 2;
48
+ let E = 0;
49
+ for (let w = 0; w < r; w++) {
50
+ const M = l[w] / 255, O = Math.max(
68
51
  c.MIN_BAR_HEIGHT,
69
- y * _
52
+ M * g
70
53
  );
71
- M(
54
+ _(
72
55
  t,
73
- m,
74
- _,
75
- T,
76
- B,
77
- E(y)
78
- ), m += T + c.BAR_SPACING;
56
+ E,
57
+ g,
58
+ S,
59
+ O,
60
+ T(M)
61
+ ), E += S + c.BAR_SPACING;
79
62
  }
80
63
  };
81
- A();
82
- };
83
- return /* @__PURE__ */ g(
64
+ C();
65
+ }, [s, _, T]), y = f(async () => {
66
+ try {
67
+ const e = new AudioContext();
68
+ d.current = e;
69
+ const t = e.createAnalyser();
70
+ t.fftSize = c.FFT_SIZE, t.smoothingTimeConstant = c.SMOOTHING, I.current = t, e.createMediaStreamSource(a).connect(t), m();
71
+ } catch (e) {
72
+ console.error("Error starting visualization:", e);
73
+ }
74
+ }, [a, m]);
75
+ return R(() => {
76
+ a && s ? y() : A();
77
+ }, [a, s, y]), R(() => {
78
+ const e = () => {
79
+ if (typeof window > "u" || !u.current || !N.current)
80
+ return;
81
+ const t = N.current, n = u.current, o = window.devicePixelRatio || 1, r = t.getBoundingClientRect();
82
+ n.width = (r.width - 2) * o, n.height = (r.height - 2) * o, n.style.width = `${r.width - 2}px`, n.style.height = `${r.height - 2}px`;
83
+ };
84
+ if (typeof window < "u")
85
+ return window.addEventListener("resize", e), e(), () => window.removeEventListener("resize", e);
86
+ }, []), /* @__PURE__ */ p(
84
87
  "div",
85
88
  {
86
- ref: h,
89
+ ref: N,
87
90
  className: "bg-d-background/80 h-full w-full cursor-pointer rounded-lg backdrop-blur",
88
- onClick: S,
89
- children: /* @__PURE__ */ g("canvas", { ref: a, className: "h-full w-full" })
91
+ onClick: B,
92
+ children: /* @__PURE__ */ p("canvas", { ref: u, className: "h-full w-full" })
90
93
  }
91
94
  );
92
95
  }
93
96
  export {
94
- x as AudioVisualizer
97
+ F as AudioVisualizer
95
98
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as a } from "react/jsx-runtime";
3
+ import * as n from "react";
3
4
  import { designTokens as c } from "../design-tokens.js";
4
5
  import { cn as o } from "../../lib/utils.js";
5
- import * as n from "react";
6
6
  const s = n.createContext({
7
7
  size: "default"
8
8
  }), d = {
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as a, jsxs as h } from "react/jsx-runtime";
3
- import * as l from "react";
4
3
  import k from "../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js";
5
- import { cn as d } from "../../lib/utils.js";
4
+ import * as l from "react";
6
5
  import { Button as v } from "./button.js";
6
+ import { cn as d } from "../../lib/utils.js";
7
7
  import z from "../../node_modules/lucide-react/dist/esm/icons/arrow-right.js";
8
8
  import g from "../../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
9
9
  const p = l.createContext(null);
@@ -142,7 +142,7 @@ function A({
142
142
  m ? k : null,
143
143
  /* @__PURE__ */ s("span", { className: "text-muted-foreground", children: h?.label || n.name })
144
144
  ] }),
145
- n.value && /* @__PURE__ */ s("span", { className: "text-foreground font-mono font-medium tabular-nums", children: n.value.toLocaleString() })
145
+ typeof n.value == "number" && /* @__PURE__ */ s("span", { className: "text-foreground font-mono font-medium tabular-nums", children: n.value.toLocaleString() })
146
146
  ]
147
147
  }
148
148
  )
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsxs as n, jsx as e, Fragment as T } from "react/jsx-runtime";
3
- import { useMemo as P, useState as N, useRef as V, useEffect as j, Suspense as D } from "react";
4
- import { cva as X } from "../../node_modules/class-variance-authority/dist/index.js";
5
- import { motion as J } from "framer-motion";
6
- import { cn as l } from "../../lib/utils.js";
3
+ import { cva as P } from "../../node_modules/class-variance-authority/dist/index.js";
4
+ import { motion as V } from "framer-motion";
5
+ import { useMemo as X, useState as N, useRef as J, useEffect as j, Suspense as D } from "react";
7
6
  import { Collapsible as _, CollapsibleTrigger as q, CollapsibleContent as G } from "./collapsible.js";
8
7
  import { FilePreview as H } from "./file-preview/index.js";
9
8
  import { MarkdownRenderer as M } from "./markdown-renderer.js";
9
+ import { cn as l } from "../../lib/utils.js";
10
10
  import O from "../../node_modules/lucide-react/dist/esm/icons/x.js";
11
11
  import R from "../../node_modules/lucide-react/dist/esm/icons/check.js";
12
12
  import K from "../../node_modules/lucide-react/dist/esm/icons/pen.js";
@@ -15,7 +15,7 @@ import W from "../../node_modules/lucide-react/dist/esm/icons/ban.js";
15
15
  import Y from "../../node_modules/lucide-react/dist/esm/icons/code-xml.js";
16
16
  import Z from "../../node_modules/lucide-react/dist/esm/icons/terminal.js";
17
17
  import A from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
18
- const z = X(
18
+ const z = P(
19
19
  "group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",
20
20
  {
21
21
  variants: {
@@ -65,10 +65,10 @@ const z = X(
65
65
  toolInvocations: y,
66
66
  parts: w
67
67
  }) => {
68
- const I = P(() => B?.map((r) => {
68
+ const I = X(() => B?.map((r) => {
69
69
  const m = ee(r.url);
70
70
  return new File([m], r.name ?? "Unknown");
71
- }), [B]), i = s === "user", C = !i && v, [a, k] = N(!1), [c, f] = N(t), [b, F] = N(t), d = V(null);
71
+ }), [B]), i = s === "user", C = !i && v, [a, k] = N(!1), [c, f] = N(t), [b, F] = N(t), d = J(null);
72
72
  j(() => {
73
73
  a || (F(t), f(t));
74
74
  }, [t, a]), j(() => {
@@ -345,7 +345,7 @@ const re = ({ part: s }) => {
345
345
  /* @__PURE__ */ e("span", { children: "Thinking" })
346
346
  ] }) }) }),
347
347
  /* @__PURE__ */ e(G, { forceMount: !0, children: /* @__PURE__ */ e(
348
- J.div,
348
+ V.div,
349
349
  {
350
350
  initial: !1,
351
351
  animate: t ? "open" : "closed",
@@ -1,48 +1,48 @@
1
1
  "use client";
2
- import { jsxs as v, Fragment as y, jsx as t } from "react/jsx-runtime";
2
+ import { jsxs as b, Fragment as y, jsx as t } from "react/jsx-runtime";
3
3
  import { forwardRef as A, useRef as M, useCallback as k, useState as O } from "react";
4
- import { cn as q } from "../../lib/utils.js";
5
- import { useAutoScroll as H } from "../../hooks/use-auto-scroll.js";
6
- import { Button as N } from "./button.js";
4
+ import { Button as v } from "./button.js";
7
5
  import { CopyButton as S } from "./copy-button.js";
8
- import { MessageInput as J } from "./message-input.js";
9
- import { MessageList as K } from "./message-list.js";
10
- import { PromptSuggestions as Q } from "./prompt-suggestions.js";
6
+ import { MessageInput as q } from "./message-input.js";
7
+ import { MessageList as H } from "./message-list.js";
8
+ import { PromptSuggestions as J } from "./prompt-suggestions.js";
9
+ import { useAutoScroll as K } from "../../hooks/use-auto-scroll.js";
10
+ import { cn as Q } from "../../lib/utils.js";
11
11
  import { Typo as z } from "./typo.js";
12
12
  import j from "../../node_modules/lucide-react/dist/esm/icons/save.js";
13
13
  import V from "../../node_modules/lucide-react/dist/esm/icons/thumbs-up.js";
14
14
  import W from "../../node_modules/lucide-react/dist/esm/icons/thumbs-down.js";
15
15
  import X from "../../node_modules/lucide-react/dist/esm/icons/arrow-down.js";
16
16
  function Y({
17
- messages: e,
17
+ messages: o,
18
18
  welcomeTitle: n = "Da dove iniziamo?",
19
19
  handleSubmit: i,
20
- input: m,
20
+ input: f,
21
21
  handleInputChange: c,
22
22
  stop: s,
23
- isGenerating: u,
24
- append: f,
25
- suggestions: h,
26
- className: D,
27
- onRateResponse: w,
23
+ isGenerating: w,
24
+ append: m,
25
+ suggestions: u,
26
+ className: g,
27
+ onRateResponse: N,
28
28
  setMessages: x,
29
- transcribeAudio: L,
30
- allowAttachments: g = !1,
29
+ transcribeAudio: D,
30
+ allowAttachments: L = !1,
31
31
  onEdit: B,
32
32
  onMessageSave: d
33
33
  }) {
34
- const P = e.at(-1), T = e.length === 0, I = P?.role === "user", C = M(e);
35
- C.current = e;
34
+ const P = o.at(-1), T = o.length === 0, I = P?.role === "user", C = M(o);
35
+ C.current = o;
36
36
  const U = k(() => {
37
37
  if (s?.(), !x) return;
38
- const o = [...C.current], l = o.findLast(
38
+ const e = [...C.current], l = e.findLast(
39
39
  (a) => a.role === "assistant"
40
40
  );
41
41
  if (!l) return;
42
- let p = !1, b = { ...l };
42
+ let h = !1, p = { ...l };
43
43
  if (l.toolInvocations) {
44
44
  const a = l.toolInvocations.map(
45
- (r) => r.state === "call" ? (p = !0, {
45
+ (r) => r.state === "call" ? (h = !0, {
46
46
  ...r,
47
47
  state: "result",
48
48
  result: {
@@ -52,13 +52,13 @@ function Y({
52
52
  }
53
53
  }) : r
54
54
  );
55
- p && (b = {
56
- ...b,
55
+ h && (p = {
56
+ ...p,
57
57
  toolInvocations: a
58
58
  });
59
59
  }
60
60
  if (l.parts && l.parts.length > 0) {
61
- const a = l.parts.map((r) => r.type === "tool-invocation" && r.toolInvocation && r.toolInvocation.state === "call" ? (p = !0, {
61
+ const a = l.parts.map((r) => r.type === "tool-invocation" && r.toolInvocation && r.toolInvocation.state === "call" ? (h = !0, {
62
62
  ...r,
63
63
  toolInvocation: {
64
64
  ...r.toolInvocation,
@@ -69,73 +69,74 @@ function Y({
69
69
  }
70
70
  }
71
71
  }) : r);
72
- p && (b = {
73
- ...b,
72
+ h && (p = {
73
+ ...p,
74
74
  parts: a
75
+ // eslint-disable-line @typescript-eslint/no-explicit-any
75
76
  });
76
77
  }
77
- if (p) {
78
- const a = o.findIndex(
78
+ if (h) {
79
+ const a = e.findIndex(
79
80
  (r) => r.id === l.id
80
81
  );
81
- a !== -1 && (o[a] = b, x(o));
82
+ a !== -1 && (e[a] = p, x(e));
82
83
  }
83
84
  }, [s, x, C]), E = k(
84
- (o) => ({
85
- actions: w ? /* @__PURE__ */ v(y, { children: [
85
+ (e) => ({
86
+ actions: N ? /* @__PURE__ */ b(y, { children: [
86
87
  /* @__PURE__ */ t("div", { className: "border-d-border border-r pr-1", children: /* @__PURE__ */ t(
87
88
  S,
88
89
  {
89
- content: o.content,
90
+ content: e.content,
90
91
  copyMessage: "Copied response to clipboard!"
91
92
  }
92
93
  ) }),
93
94
  d && /* @__PURE__ */ t("div", { className: "border-d-border border-r pr-1", children: /* @__PURE__ */ t(
94
- N,
95
+ v,
95
96
  {
96
97
  size: "icon",
97
98
  variant: "ghost",
98
99
  className: "h-6 w-6",
99
- onClick: () => d(o.id, o.content),
100
+ onClick: () => d(e.id, e.content),
100
101
  title: "Save message",
101
102
  children: /* @__PURE__ */ t(j, { className: "h-4 w-4" })
102
103
  }
103
104
  ) }),
104
105
  /* @__PURE__ */ t(
105
- N,
106
+ v,
106
107
  {
107
108
  size: "icon",
108
109
  variant: "ghost",
109
110
  className: "h-6 w-6",
110
- onClick: () => w(o.id, "thumbs-up"),
111
+ onClick: () => N(e.id, "thumbs-up"),
111
112
  children: /* @__PURE__ */ t(V, { className: "h-4 w-4" })
112
113
  }
113
114
  ),
114
115
  /* @__PURE__ */ t(
115
- N,
116
+ v,
116
117
  {
117
118
  size: "icon",
118
119
  variant: "ghost",
119
120
  className: "h-6 w-6",
120
- onClick: () => w(o.id, "thumbs-down"),
121
+ onClick: () => N(e.id, "thumbs-down"),
121
122
  children: /* @__PURE__ */ t(W, { className: "h-4 w-4" })
122
123
  }
123
124
  )
124
- ] }) : /* @__PURE__ */ v(y, { children: [
125
+ ] }) : /* @__PURE__ */ b(y, { children: [
125
126
  /* @__PURE__ */ t(
126
127
  S,
127
128
  {
128
- content: o.content,
129
+ content: e.content,
129
130
  copyMessage: "Copied response to clipboard!"
130
131
  }
131
132
  ),
132
133
  d && /* @__PURE__ */ t("div", { className: "border-d-border border-l pl-1", children: /* @__PURE__ */ t(
133
- N,
134
+ v,
134
135
  {
135
136
  size: "icon",
136
137
  variant: "ghost",
137
138
  className: "h-6 w-6",
138
- onClick: () => d(o.id, o.content),
139
+ onClick: () => d(e.id, e.content),
139
140
  title: "Save message",
140
141
  children: /* @__PURE__ */ t(j, { className: "h-4 w-4" })
141
142
  }
@@ -143,48 +144,48 @@ function Y({
143
144
  ] }),
144
145
  onMessageSave: d
145
146
  }),
146
- [w, d]
147
+ [N, d]
147
148
  );
148
- return /* @__PURE__ */ v(F, { className: D, children: [
149
- T && /* @__PURE__ */ t("div", { className: "flex flex-1 flex-col items-center justify-center p-8", children: f && h && /* @__PURE__ */ v(y, { children: [
149
+ return /* @__PURE__ */ b(F, { className: g, children: [
150
+ T && /* @__PURE__ */ t("div", { className: "flex flex-1 flex-col items-center justify-center p-8", children: m && u && /* @__PURE__ */ b(y, { children: [
150
151
  /* @__PURE__ */ t(z, { variant: "h3", className: "mb-8 text-center", children: n }),
151
152
  /* @__PURE__ */ t(
152
- Q,
153
+ J,
153
154
  {
154
155
  label: "",
155
- append: f,
156
- suggestions: h
156
+ append: m,
157
+ suggestions: u
157
158
  }
158
159
  )
159
160
  ] }) }),
160
- e.length > 0 ? /* @__PURE__ */ t(Z, { messages: e, children: /* @__PURE__ */ t(
161
- K,
161
+ o.length > 0 ? /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(
162
+ H,
162
163
  {
163
- messages: e,
164
+ messages: o,
164
165
  isTyping: I,
165
166
  messageOptions: E,
166
167
  onEdit: B,
167
168
  onMessageSave: d
168
169
  }
169
170
  ) }) : null,
170
- T && !f && !h && /* @__PURE__ */ t(z, { variant: "h3", className: "mb-8 text-center", children: n }),
171
+ T && !m && !u && /* @__PURE__ */ t(z, { variant: "h3", className: "mb-8 text-center", children: n }),
171
172
  /* @__PURE__ */ t(
172
173
  _,
173
174
  {
174
175
  className: "flex-shrink-0",
175
- isPending: u || I,
176
+ isPending: w || I,
176
177
  handleSubmit: i,
177
- children: ({ files: o, setFiles: l }) => /* @__PURE__ */ t(
178
- J,
178
+ children: ({ files: e, setFiles: l }) => /* @__PURE__ */ t(
179
+ q,
179
180
  {
180
- value: m,
181
+ value: f,
181
182
  onChange: c,
182
- allowAttachments: g,
183
- files: o,
183
+ allowAttachments: L,
184
+ files: e,
184
185
  setFiles: l,
185
186
  stop: U,
186
- isGenerating: u,
187
- transcribeAudio: L
187
+ isGenerating: w,
188
+ transcribeAudio: D
188
189
  }
189
190
  )
190
191
  }
@@ -192,30 +193,27 @@ function Y({
192
193
  ] });
193
194
  }
194
195
  Y.displayName = "Chat";
195
- function Z({
196
- messages: e,
197
- children: n
198
- }) {
196
+ function Z({ children: o }) {
199
197
  const {
200
- containerRef: i,
201
- scrollToBottom: m,
202
- handleScroll: c,
203
- shouldAutoScroll: s,
204
- handleTouchStart: u
205
- } = H([e]);
206
- return /* @__PURE__ */ v(
198
+ containerRef: n,
199
+ scrollToBottom: i,
200
+ handleScroll: f,
201
+ shouldAutoScroll: c,
202
+ handleTouchStart: s
203
+ } = K();
204
+ return /* @__PURE__ */ b(
207
205
  "div",
208
206
  {
209
207
  className: "relative flex-1 overflow-y-auto pb-4",
210
- ref: i,
211
- onScroll: c,
212
- onTouchStart: u,
208
+ ref: n,
209
+ onScroll: f,
210
+ onTouchStart: s,
213
211
  children: [
214
- /* @__PURE__ */ t("div", { className: "max-w-full", children: n }),
215
- !s && /* @__PURE__ */ t("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 flex items-end justify-end", children: /* @__PURE__ */ t("div", { className: "sticky bottom-0 left-0 flex w-full justify-end", children: /* @__PURE__ */ t(
216
- N,
212
+ /* @__PURE__ */ t("div", { className: "max-w-full", children: o }),
213
+ !c && /* @__PURE__ */ t("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 flex items-end justify-end", children: /* @__PURE__ */ t("div", { className: "sticky bottom-0 left-0 flex w-full justify-end", children: /* @__PURE__ */ t(
214
+ v,
217
215
  {
218
- onClick: m,
216
+ onClick: i,
219
217
  className: "animate-in fade-in-0 slide-in-from-bottom-1 pointer-events-auto h-8 w-8 rounded-full ease-in-out",
220
218
  size: "icon",
221
219
  variant: "ghost",
@@ -226,34 +224,34 @@ function Z({
226
224
  }
227
225
  );
228
226
  }
229
- const F = A(({ className: e, ...n }, i) => /* @__PURE__ */ t(
227
+ const F = A(({ className: o, ...n }, i) => /* @__PURE__ */ t(
230
228
  "div",
231
229
  {
232
230
  ref: i,
233
- className: q("flex h-full max-h-full w-full flex-col", e),
231
+ className: Q("flex h-full max-h-full w-full flex-col", o),
234
232
  ...n
235
233
  }
236
234
  ));
237
235
  F.displayName = "ChatContainer";
238
236
  const _ = A(
239
- ({ children: e, handleSubmit: n, className: i }, m) => {
237
+ ({ children: o, handleSubmit: n, className: i }, f) => {
240
238
  const [c, s] = O(null);
241
- return /* @__PURE__ */ t("form", { ref: m, onSubmit: (f) => {
239
+ return /* @__PURE__ */ t("form", { ref: f, onSubmit: (m) => {
242
240
  if (!c) {
243
- n(f);
241
+ n(m);
244
242
  return;
245
243
  }
246
- const h = $(c);
247
- n(f, { experimental_attachments: h }), s(null);
248
- }, className: i, children: e({ files: c, setFiles: s }) });
244
+ const u = $(c);
245
+ n(m, { experimental_attachments: u }), s(null);
246
+ }, className: i, children: o({ files: c, setFiles: s }) });
249
247
  }
250
248
  );
251
249
  _.displayName = "ChatForm";
252
- function $(e) {
250
+ function $(o) {
253
251
  if (typeof window > "u")
254
252
  return {};
255
253
  const n = new DataTransfer();
256
- for (const i of Array.from(e))
254
+ for (const i of Array.from(o))
257
255
  n.items.add(i);
258
256
  return n.files;
259
257
  }
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as o, jsxs as n } from "react/jsx-runtime";
3
- import * as c from "react";
4
3
  import { Command as d } from "../../node_modules/cmdk/dist/index.js";
5
- import { cn as a } from "../../lib/utils.js";
4
+ import * as c from "react";
6
5
  import { Dialog as i, DialogHeader as l, DialogTitle as p, DialogDescription as u, DialogContent as g } from "./dialog.js";
6
+ import { cn as a } from "../../lib/utils.js";
7
7
  import f from "../../node_modules/lucide-react/dist/esm/icons/search.js";
8
8
  const m = c.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o(
9
9
  d,
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import { jsxs as a, jsx as o } from "react/jsx-runtime";
3
+ import { Button as n } from "./button.js";
4
+ import { useCopyToClipboard as c } from "../../hooks/use-copy-to-clipboard.js";
3
5
  import { cn as t } from "../../lib/utils.js";
4
- import { useCopyToClipboard as n } from "../../hooks/use-copy-to-clipboard.js";
5
- import { Button as c } from "./button.js";
6
6
  import l from "../../node_modules/lucide-react/dist/esm/icons/check.js";
7
7
  import m from "../../node_modules/lucide-react/dist/esm/icons/copy.js";
8
8
  function y({ content: s, copyMessage: i }) {
9
- const { isCopied: e, handleCopy: r } = n({
9
+ const { isCopied: e, handleCopy: r } = c({
10
10
  text: s,
11
11
  copyMessage: i
12
12
  });
13
13
  return /* @__PURE__ */ a(
14
- c,
14
+ n,
15
15
  {
16
16
  variant: "ghost",
17
17
  size: "icon",