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,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as w } from "react/jsx-runtime";
3
- import { cn as n } from "../../lib/utils.js";
4
3
  import { motion as c } from "framer-motion";
5
4
  import * as s from "react";
5
+ import { cn as n } from "../../lib/utils.js";
6
6
  const x = {
7
7
  container: {
8
8
  initial: { opacity: 0, y: 20 },
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsxs as f, jsx as l } from "react/jsx-runtime";
3
+ import { cva as j } from "../../node_modules/class-variance-authority/dist/index.js";
4
+ import * as a from "react";
3
5
  import { designTokens as o } from "../design-tokens.js";
4
6
  import { Label as se } from "./label.js";
5
7
  import { cn as n } from "../../lib/utils.js";
6
- import { cva as j } from "../../node_modules/class-variance-authority/dist/index.js";
7
- import * as a from "react";
8
8
  import { Icon as N } from "./icon.js";
9
9
  import { Typo as te } from "./typo.js";
10
10
  const ae = j(
@@ -64,7 +64,7 @@ const ae = j(
64
64
  startContent: S,
65
65
  endContent: E,
66
66
  size: g,
67
- disabled: d,
67
+ disabled: c,
68
68
  required: C,
69
69
  onBlur: O,
70
70
  onChange: _,
@@ -76,18 +76,18 @@ const ae = j(
76
76
  validityI18n: e,
77
77
  ...$
78
78
  }, J) => {
79
- const [u, K] = a.useState(!1), [h, k] = a.useState(!0), [Q, L] = a.useState(!1), [U, V] = a.useState(""), X = a.useId(), w = G ?? X, R = `${w}-validity`, x = a.useRef(null), b = p === "password", Y = b ? u ? "text" : "password" : p, W = F ?? (!h && Q ? !0 : void 0), Z = [H, B && R].filter(Boolean).join(" ").trim() || void 0;
79
+ const [d, K] = a.useState(!1), [h, k] = a.useState(!0), [Q, L] = a.useState(!1), [U, V] = a.useState(""), X = a.useId(), w = G ?? X, R = `${w}-validity`, x = a.useRef(null), b = p === "password", Y = b ? d ? "text" : "password" : p, W = F ?? (!h && Q ? !0 : void 0), Z = [H, B && R].filter(Boolean).join(" ").trim() || void 0;
80
80
  a.useImperativeHandle(J, () => x.current);
81
81
  const q = a.useCallback(
82
82
  (t) => {
83
- if (d) return;
83
+ if (c) return;
84
84
  const s = t.target;
85
85
  if (s.tagName === "INPUT" || s.tagName === "BUTTON") return;
86
86
  const r = x.current;
87
87
  r && (r.focus(), !b && p !== "file" && r.select());
88
88
  },
89
- [d, b, p]
90
- ), c = a.useCallback(
89
+ [c, b, p]
90
+ ), u = a.useCallback(
91
91
  (t) => {
92
92
  const s = t.validity, r = t.validationMessage !== "" ? t.validationMessage : "✓";
93
93
  if (s.valid)
@@ -104,28 +104,28 @@ const ae = j(
104
104
  );
105
105
  a.useEffect(() => {
106
106
  if (x.current) {
107
- const { isValid: t, message: s } = c(x.current);
107
+ const { isValid: t, message: s } = u(x.current);
108
108
  k(t), V(s);
109
109
  }
110
- }, [c]);
110
+ }, [u]);
111
111
  const y = a.useCallback(
112
112
  (t) => {
113
113
  L(!0);
114
- const { isValid: s, message: r } = c(t.currentTarget);
114
+ const { isValid: s, message: r } = u(t.currentTarget);
115
115
  k(s), V(r), _?.(t);
116
116
  },
117
- [_, c]
117
+ [_, u]
118
118
  ), I = a.useCallback(
119
119
  (t) => {
120
120
  L(!0), O?.(t);
121
121
  },
122
- [O, c]
122
+ [O]
123
123
  ), ee = a.useCallback(
124
124
  (t) => {
125
- const { isValid: s, message: r } = c(t.currentTarget);
125
+ const { isValid: s, message: r } = u(t.currentTarget);
126
126
  k(s), V(r), z?.(t);
127
127
  },
128
- [z, c]
128
+ [z, u]
129
129
  );
130
130
  return /* @__PURE__ */ f("div", { className: n("flex flex-col gap-1.5", A), children: [
131
131
  T && /* @__PURE__ */ f(se, { htmlFor: w, className: n("gap-0.5", D), children: [
@@ -138,7 +138,7 @@ const ae = j(
138
138
  {
139
139
  className: n(
140
140
  ae({ size: g }),
141
- d ? "cursor-not-allowed opacity-50" : "cursor-text"
141
+ c ? "cursor-not-allowed opacity-50" : "cursor-text"
142
142
  ),
143
143
  "aria-invalid": W,
144
144
  onClick: q,
@@ -155,7 +155,7 @@ const ae = j(
155
155
  "data-slot": "input",
156
156
  className: n(re({ size: g })),
157
157
  ref: x,
158
- disabled: d,
158
+ disabled: c,
159
159
  onChange: y,
160
160
  onBlur: I,
161
161
  onInvalid: ee,
@@ -175,22 +175,22 @@ const ae = j(
175
175
  },
176
176
  className: n(
177
177
  "text-d-muted-foreground flex shrink-0 cursor-pointer items-center",
178
- d && "cursor-not-allowed"
178
+ c && "cursor-not-allowed"
179
179
  ),
180
- "aria-label": u ? m.hide : m.show,
181
- "aria-pressed": u,
180
+ "aria-label": d ? m.hide : m.show,
181
+ "aria-pressed": d,
182
182
  "aria-controls": w,
183
- title: u ? m.hide : m.show,
184
- disabled: d,
183
+ title: d ? m.hide : m.show,
184
+ disabled: c,
185
185
  children: [
186
186
  /* @__PURE__ */ l(
187
187
  N,
188
188
  {
189
- name: u ? "EyeOff" : "Eye",
189
+ name: d ? "EyeOff" : "Eye",
190
190
  size: g === "lg" ? "sm" : "xs"
191
191
  }
192
192
  ),
193
- /* @__PURE__ */ l("span", { className: "sr-only", children: u ? m.hide : m.show })
193
+ /* @__PURE__ */ l("span", { className: "sr-only", children: d ? m.hide : m.show })
194
194
  ]
195
195
  }
196
196
  ) : (M || E) && /* @__PURE__ */ f("div", { className: "text-d-muted-foreground flex shrink-0 items-center gap-2", children: [
@@ -248,10 +248,7 @@ function xe({
248
248
  }, []), c = h(() => {
249
249
  const s = d.current;
250
250
  if (!s) return;
251
- if (t && Object.prototype.hasOwnProperty.call(
252
- t,
253
- "--kanban-column-min-height"
254
- )) {
251
+ if (t && Object.prototype.hasOwnProperty.call(t, "--kanban-column-min-height")) {
255
252
  n(null);
256
253
  return;
257
254
  }
@@ -279,7 +276,9 @@ function xe({
279
276
  x = Math.max(x, k.scrollHeight);
280
277
  b && s.style.setProperty("--kanban-column-min-height", b);
281
278
  const B = Math.ceil(x);
282
- n(Number.isFinite(B) && B > 0 ? B : 0);
279
+ n(
280
+ Number.isFinite(B) && B > 0 ? B : 0
281
+ );
283
282
  }, [n, t]), f = h(() => {
284
283
  i.current === null && (i.current = requestAnimationFrame(() => {
285
284
  i.current = null, c();
@@ -348,8 +347,8 @@ function ye({
348
347
  "aria-labelledby": `column-${r}-title`,
349
348
  className: D(
350
349
  se,
351
- g && "border-d-primary/80 bg-d-primary/10 ring-2 ring-d-primary/30",
352
- m && "border-d-destructive/70 bg-d-destructive/10 ring-2 ring-d-destructive/20",
350
+ g && "border-d-primary/80 bg-d-primary/10 ring-d-primary/30 ring-2",
351
+ m && "border-d-destructive/70 bg-d-destructive/10 ring-d-destructive/20 ring-2",
353
352
  e
354
353
  ),
355
354
  "aria-disabled": l,
@@ -523,7 +522,7 @@ function Te({
523
522
  !a && "bg-d-card/95",
524
523
  le,
525
524
  "focus-visible:ring-d-ring inline-flex w-full touch-manipulation flex-col gap-2 transition-all duration-200 focus-visible:ring-1 focus-visible:outline-none",
526
- t ? "group/card relative cursor-default" : c ? "cursor-grabbing active:cursor-grabbing opacity-40" : "group/card relative cursor-grab hover:-translate-y-0.5 hover:shadow-lg",
525
+ t ? "group/card relative cursor-default" : c ? "cursor-grabbing opacity-40 active:cursor-grabbing" : "group/card relative cursor-grab hover:-translate-y-0.5 hover:shadow-lg",
527
526
  l && "rotate-1 transform shadow-lg",
528
527
  e
529
528
  ),
@@ -539,7 +538,7 @@ function Te({
539
538
  g && g.length > 0 && /* @__PURE__ */ p("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: g.map((o, b) => /* @__PURE__ */ C(
540
539
  "div",
541
540
  {
542
- className: "text-d-muted-foreground inline-flex items-center gap-1 rounded-full border bg-d-muted/40 px-2 py-0.5 text-[11px]",
541
+ className: "text-d-muted-foreground bg-d-muted/40 inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]",
543
542
  style: {
544
543
  borderColor: a ? `${a}40` : void 0
545
544
  },
@@ -1,37 +1,37 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as p, Fragment as f } from "react/jsx-runtime";
3
- import y, { Suspense as x } from "react";
4
- import { cn as m } from "../../lib/utils.js";
2
+ import { jsx as o, jsxs as p, Fragment as y } from "react/jsx-runtime";
3
+ import g, { Suspense as x } from "react";
5
4
  import { CopyButton as k } from "./copy-button.js";
5
+ import { cn as m } from "../../lib/utils.js";
6
6
  import { Markdown as N } from "../../node_modules/react-markdown/lib/index.js";
7
7
  import v from "../../node_modules/remark-gfm/lib/index.js";
8
8
  function q({ children: e }) {
9
- return /* @__PURE__ */ t("div", { className: "space-y-3", children: /* @__PURE__ */ t(N, { remarkPlugins: [v], components: C, children: e }) });
9
+ return /* @__PURE__ */ o("div", { className: "space-y-3", children: /* @__PURE__ */ o(N, { remarkPlugins: [v], components: C, children: e }) });
10
10
  }
11
- const g = y.memo(
12
- async ({ children: e, language: o, ...n }) => {
13
- const { codeToTokens: d, bundledLanguages: i } = await import("../../node_modules/shiki/dist/index.js");
14
- if (!(o in i))
15
- return /* @__PURE__ */ t("pre", { ...n, children: e });
16
- const { tokens: l } = await d(e, {
17
- lang: o,
11
+ const h = g.memo(
12
+ async ({ children: e, language: t, ...n }) => {
13
+ const { codeToTokens: i, bundledLanguages: d } = await import("../../node_modules/shiki/dist/index.js");
14
+ if (!(t in d))
15
+ return /* @__PURE__ */ o("pre", { ...n, children: e });
16
+ const { tokens: l } = await i(e, {
17
+ lang: t,
18
18
  defaultColor: !1,
19
19
  themes: {
20
20
  light: "github-light",
21
21
  dark: "github-dark"
22
22
  }
23
23
  });
24
- return /* @__PURE__ */ t("pre", { ...n, children: /* @__PURE__ */ t("code", { children: l.map((h, c) => /* @__PURE__ */ p(f, { children: [
25
- /* @__PURE__ */ t("span", { children: h.map((a, u) => {
26
- const b = typeof a.htmlStyle == "string" ? void 0 : a.htmlStyle;
27
- return /* @__PURE__ */ t(
24
+ return /* @__PURE__ */ o("pre", { ...n, children: /* @__PURE__ */ o("code", { children: l.map((u, c) => /* @__PURE__ */ p(y, { children: [
25
+ /* @__PURE__ */ o("span", { children: u.map((a, b) => {
26
+ const f = typeof a.htmlStyle == "string" ? void 0 : a.htmlStyle;
27
+ return /* @__PURE__ */ o(
28
28
  "span",
29
29
  {
30
30
  className: "text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",
31
- style: b,
31
+ style: f,
32
32
  children: a.content
33
33
  },
34
- u
34
+ b
35
35
  );
36
36
  }) }, c),
37
37
  c !== l.length - 1 && `
@@ -39,34 +39,34 @@ const g = y.memo(
39
39
  ] })) }) });
40
40
  }
41
41
  );
42
- g.displayName = "HighlightedCode";
42
+ h.displayName = "HighlightedCode";
43
43
  const w = ({
44
44
  children: e,
45
- className: o,
45
+ className: t,
46
46
  language: n,
47
- ...d
47
+ ...i
48
48
  }) => {
49
- const i = typeof e == "string" ? e : s(e), l = m(
49
+ const d = typeof e == "string" ? e : s(e), l = m(
50
50
  "overflow-x-scroll rounded-md border border-d-border bg-d-background/50 p-4 font-mono text-sm [scrollbar-width:none]",
51
- o
51
+ t
52
52
  );
53
53
  return /* @__PURE__ */ p("div", { className: "group/code relative mb-4", children: [
54
- /* @__PURE__ */ t(
54
+ /* @__PURE__ */ o(
55
55
  x,
56
56
  {
57
- fallback: /* @__PURE__ */ t("pre", { className: l, ...d, children: e }),
58
- children: /* @__PURE__ */ t(g, { language: n, className: l, children: i })
57
+ fallback: /* @__PURE__ */ o("pre", { className: l, ...i, children: e }),
58
+ children: /* @__PURE__ */ o(h, { language: n, className: l, children: d })
59
59
  }
60
60
  ),
61
- /* @__PURE__ */ t("div", { className: "invisible absolute top-2 right-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100", children: /* @__PURE__ */ t(k, { content: i, copyMessage: "Copied code to clipboard" }) })
61
+ /* @__PURE__ */ o("div", { className: "invisible absolute top-2 right-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100", children: /* @__PURE__ */ o(k, { content: d, copyMessage: "Copied code to clipboard" }) })
62
62
  ] });
63
63
  };
64
64
  function s(e) {
65
65
  if (typeof e == "string")
66
66
  return e;
67
- if (e?.props?.children) {
68
- let o = e.props.children;
69
- return Array.isArray(o) ? o.map((n) => s(n)).join("") : s(o);
67
+ if (g.isValidElement(e) && e.props && typeof e.props == "object" && "children" in e.props) {
68
+ const t = e.props.children;
69
+ return t && typeof t == "object" && Array.isArray(t) ? t.map((n) => s(n)).join("") : s(t);
70
70
  }
71
71
  return "";
72
72
  }
@@ -79,15 +79,19 @@ const C = {
79
79
  strong: r("strong", "font-semibold"),
80
80
  a: r("a", "text-d-primary underline underline-offset-2"),
81
81
  blockquote: r("blockquote", "border-l-2 border-d-primary pl-4"),
82
- code: ({ children: e, className: o, node: n, ...d }) => {
83
- const i = /language-(\w+)/.exec(o || "");
84
- return i ? /* @__PURE__ */ t(w, { className: o, language: i[1], ...d, children: e }) : /* @__PURE__ */ t(
82
+ code: ({
83
+ children: e,
84
+ className: t,
85
+ ...n
86
+ }) => {
87
+ const i = /language-(\w+)/.exec(t || "");
88
+ return i ? /* @__PURE__ */ o(w, { className: t, language: i[1], ...n, children: e }) : /* @__PURE__ */ o(
85
89
  "code",
86
90
  {
87
91
  className: m(
88
92
  "[:not(pre)>&]:bg-d-background/50 font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"
89
93
  ),
90
- ...d,
94
+ ...n,
91
95
  children: e
92
96
  }
93
97
  );
@@ -112,8 +116,10 @@ const C = {
112
116
  p: r("p", "whitespace-pre-wrap"),
113
117
  hr: r("hr", "border-foreground/20")
114
118
  };
115
- function r(e, o) {
116
- const n = ({ node: d, ...i }) => /* @__PURE__ */ t(e, { className: o, ...i });
119
+ function r(e, t) {
120
+ const n = ({
121
+ ...i
122
+ }) => /* @__PURE__ */ o(e, { className: t, ...i });
117
123
  return n.displayName = String(e), n;
118
124
  }
119
125
  export {
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
3
3
  import { AnimatePresence as v, motion as w } from "framer-motion";
4
- import { useState as y, useEffect as S, useRef as Q } from "react";
5
- import { omit as T } from "../../node_modules/remeda/dist/omit-HZOiLuMO.js";
4
+ import { useState as y, useEffect as z, useRef as Q } from "react";
5
+ import { omit as S } from "../../node_modules/remeda/dist/omit-HZOiLuMO.js";
6
6
  import { AudioVisualizer as X } from "./audio-visualizer.js";
7
7
  import { Button as g } from "./button.js";
8
8
  import { FilePreview as Y } from "./file-preview/index.js";
9
9
  import { InterruptPrompt as Z } from "./interrupt-prompt.js";
10
10
  import { useAudioRecording as _ } from "../../hooks/use-audio-recording.js";
11
11
  import { useAutosizeTextArea as $ } from "../../hooks/use-autosize-textarea.js";
12
- import { cn as C } from "../../lib/utils.js";
13
- import P from "../../node_modules/lucide-react/dist/esm/icons/paperclip.js";
12
+ import { cn as T } from "../../lib/utils.js";
13
+ import C from "../../node_modules/lucide-react/dist/esm/icons/paperclip.js";
14
14
  import G from "../../node_modules/lucide-react/dist/esm/icons/mic.js";
15
15
  import ee from "../../node_modules/lucide-react/dist/esm/icons/square.js";
16
16
  import te from "../../node_modules/lucide-react/dist/esm/icons/arrow-up.js";
@@ -24,39 +24,41 @@ function ae({
24
24
  stop: s,
25
25
  isGenerating: u,
26
26
  enableInterrupt: A = !0,
27
- transcribeAudio: I,
28
- "data-testid": R,
27
+ transcribeAudio: P,
28
+ "data-testid": I,
29
29
  ...r
30
30
  }) {
31
- const [F, x] = y(!1), [N, f] = y(!1), {
32
- isListening: L,
33
- isSpeechSupported: M,
31
+ const [R, x] = y(!1), [N, f] = y(!1), {
32
+ isListening: F,
33
+ isSpeechSupported: L,
34
34
  isRecording: D,
35
- isTranscribing: O,
36
- audioStream: j,
37
- toggleListening: q,
35
+ isTranscribing: M,
36
+ audioStream: O,
37
+ toggleListening: j,
38
38
  stopRecording: k
39
39
  } = _({
40
- transcribeAudio: I,
40
+ transcribeAudio: P,
41
41
  onTranscriptionComplete: (t) => {
42
- r.onChange?.({ target: { value: t } });
42
+ r.onChange?.({
43
+ target: { value: t }
44
+ });
43
45
  }
44
46
  });
45
- S(() => {
47
+ z(() => {
46
48
  u || f(!1);
47
49
  }, [u]);
48
50
  const h = (t) => {
49
51
  r.allowAttachments && r.setFiles((a) => a === null ? t : t === null ? a : [...a, ...t]);
50
- }, E = (t) => {
52
+ }, q = (t) => {
51
53
  r.allowAttachments === !0 && (t.preventDefault(), x(!0));
52
- }, H = (t) => {
54
+ }, E = (t) => {
53
55
  r.allowAttachments === !0 && (t.preventDefault(), x(!1));
54
- }, K = (t) => {
56
+ }, H = (t) => {
55
57
  if (x(!1), r.allowAttachments !== !0) return;
56
58
  t.preventDefault();
57
59
  const a = t.dataTransfer;
58
60
  a.files.length && h(Array.from(a.files));
59
- }, U = (t) => {
61
+ }, K = (t) => {
60
62
  const a = t.clipboardData?.items;
61
63
  if (!a) return;
62
64
  const c = t.clipboardData.getData("text");
@@ -71,7 +73,7 @@ function ae({
71
73
  }
72
74
  const b = Array.from(a).map((m) => m.getAsFile()).filter((m) => m !== null);
73
75
  r.allowAttachments && b.length > 0 && h(b);
74
- }, V = (t) => {
76
+ }, U = (t) => {
75
77
  if (l && t.key === "Enter" && !t.shiftKey) {
76
78
  if (t.preventDefault(), u && s && A) {
77
79
  if (N)
@@ -86,23 +88,22 @@ function ae({
86
88
  d?.(t);
87
89
  }, p = Q(
88
90
  null
89
- ), [B, W] = y(0);
90
- S(() => {
91
- p.current && W(p.current.offsetHeight);
91
+ ), [V, B] = y(0);
92
+ z(() => {
93
+ p.current && B(p.current.offsetHeight);
92
94
  }, [r.value]);
93
- const z = r.allowAttachments && r.files && r.files.length > 0;
95
+ const W = r.allowAttachments && r.files && r.files.length > 0;
94
96
  return $({
95
97
  ref: p,
96
98
  maxHeight: 240,
97
- borderWidth: 1,
98
- dependencies: [r.value, z]
99
+ borderWidth: 1
99
100
  }), /* @__PURE__ */ o(
100
101
  "div",
101
102
  {
102
103
  className: "relative flex w-full",
103
- onDragOver: E,
104
- onDragLeave: H,
105
- onDrop: K,
104
+ onDragOver: q,
105
+ onDragLeave: E,
106
+ onDrop: H,
106
107
  children: [
107
108
  A && /* @__PURE__ */ e(
108
109
  Z,
@@ -125,15 +126,15 @@ function ae({
125
126
  "aria-label": "Write your prompt here",
126
127
  placeholder: i,
127
128
  ref: p,
128
- onPaste: U,
129
- onKeyDown: V,
130
- "data-testid": R,
131
- className: C(
129
+ onPaste: K,
130
+ onKeyDown: U,
131
+ "data-testid": I,
132
+ className: T(
132
133
  "border-d-input bg-d-input ring-offset-d-background placeholder:text-d-muted-foreground focus-visible:border-d-primary z-10 w-full grow resize-none rounded-xl border p-3 pr-24 text-sm transition-[border] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
133
- z && "pb-16",
134
+ W && "pb-16",
134
135
  n
135
136
  ),
136
- ...r.allowAttachments ? T(r, ["allowAttachments", "files", "setFiles"]) : T(r, ["allowAttachments"])
137
+ ...r.allowAttachments ? S(r, ["allowAttachments", "files", "setFiles"]) : S(r, ["allowAttachments"])
137
138
  }
138
139
  ),
139
140
  r.allowAttachments && /* @__PURE__ */ e("div", { className: "absolute inset-x-3 bottom-2 z-20 overflow-x-scroll py-3 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: /* @__PURE__ */ e("div", { className: "flex space-x-3", children: /* @__PURE__ */ e(v, { mode: "popLayout", children: r.files?.map((t) => /* @__PURE__ */ e(
@@ -166,18 +167,18 @@ function ae({
166
167
  const t = await le();
167
168
  h(t);
168
169
  },
169
- children: /* @__PURE__ */ e(P, { className: "h-4 w-4" })
170
+ children: /* @__PURE__ */ e(C, { className: "h-4 w-4" })
170
171
  }
171
172
  ),
172
- M && /* @__PURE__ */ e(
173
+ L && /* @__PURE__ */ e(
173
174
  g,
174
175
  {
175
176
  type: "button",
176
177
  variant: "outline",
177
- className: C("h-8 w-8", L && "text-d-primary"),
178
+ className: T("h-8 w-8", F && "text-d-primary"),
178
179
  "aria-label": "Voice input",
179
180
  size: "icon",
180
- onClick: q,
181
+ onClick: j,
181
182
  children: /* @__PURE__ */ e(G, { className: "h-4 w-4" })
182
183
  }
183
184
  ),
@@ -203,14 +204,14 @@ function ae({
203
204
  }
204
205
  )
205
206
  ] }),
206
- r.allowAttachments && /* @__PURE__ */ e(ne, { isDragging: F }),
207
+ r.allowAttachments && /* @__PURE__ */ e(ne, { isDragging: R }),
207
208
  /* @__PURE__ */ e(
208
209
  ce,
209
210
  {
210
211
  isRecording: D,
211
- isTranscribing: O,
212
- audioStream: j,
213
- textAreaHeight: B,
212
+ isTranscribing: M,
213
+ audioStream: O,
214
+ textAreaHeight: V,
214
215
  onStopRecording: k
215
216
  }
216
217
  )
@@ -230,7 +231,7 @@ function ne({ isDragging: i }) {
230
231
  transition: { duration: 0.2 },
231
232
  "aria-hidden": !0,
232
233
  children: [
233
- /* @__PURE__ */ e(P, { className: "h-4 w-4" }),
234
+ /* @__PURE__ */ e(C, { className: "h-4 w-4" }),
234
235
  /* @__PURE__ */ e("span", { children: "Drop your files here to attach them." })
235
236
  ]
236
237
  }