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,19 +1,19 @@
1
1
  "use client";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
- import { useState as t, useEffect as u, createContext as c, useContext as m } from "react";
4
- import C from "../../../_virtual/dayjs.min.js";
5
- const r = c(
3
+ import u from "../../../_virtual/dayjs.min.js";
4
+ import { useState as t, useEffect as c, createContext as m, useContext as C } from "react";
5
+ const r = m(
6
6
  void 0
7
7
  ), x = () => {
8
- const e = m(r);
8
+ const e = C(r);
9
9
  if (!e)
10
10
  throw new Error("useCalendar must be used within a CalendarProvider");
11
11
  return e;
12
12
  }, I = ({ children: e, value: n }) => {
13
13
  const [o, s] = t(null), [a, l] = t(null);
14
- return u(() => {
14
+ return c(() => {
15
15
  const d = setInterval(() => {
16
- l(C().format("HH:mm"));
16
+ l(u().format("HH:mm"));
17
17
  }, 1e3);
18
18
  return () => clearInterval(d);
19
19
  }, []), /* @__PURE__ */ i(
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
3
- import d from "../../../_virtual/dayjs.min.js";
4
3
  import "../../../_virtual/it.js";
5
- import { useCalendar as h } from "./calendar-context.js";
6
- import { l as g } from "../../../_virtual/lodash.js";
7
- import { Typo as a } from "../typo.js";
8
- import { Button as v } from "../button.js";
9
- import { Icon as s } from "../icon.js";
4
+ import d from "../../../_virtual/dayjs.min.js";
5
+ import { l as h } from "../../../_virtual/lodash.js";
6
+ import { Button as g } from "../button.js";
7
+ import { Icon as a } from "../icon.js";
8
+ import { Typo as s } from "../typo.js";
9
+ import { useCalendar as v } from "./calendar-context.js";
10
10
  d.locale("it");
11
11
  const O = () => {
12
12
  const {
@@ -17,11 +17,11 @@ const O = () => {
17
17
  goToPreviousWeek: c,
18
18
  goToNextWeek: m,
19
19
  goToCurrentWeek: f
20
- } = h(), o = d().startOf("isoWeek").add(n, "week"), p = o.endOf("isoWeek"), u = n === 0;
20
+ } = v(), o = d().startOf("isoWeek").add(n, "week"), p = o.endOf("isoWeek"), u = n === 0;
21
21
  return !i && !t ? null : /* @__PURE__ */ e("div", { className: "border-d-border bg-d-card border-t border-r border-l px-4 py-2", children: i && /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [
22
22
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
23
23
  /* @__PURE__ */ e(
24
- v,
24
+ g,
25
25
  {
26
26
  onClick: f,
27
27
  variant: "ghost",
@@ -31,12 +31,12 @@ const O = () => {
31
31
  children: l
32
32
  }
33
33
  ),
34
- /* @__PURE__ */ e("div", { className: "hover:bg-d-accent cursor-pointer rounded-full p-2", children: /* @__PURE__ */ e(s, { onClick: c, name: "ChevronLeft" }) }),
35
- /* @__PURE__ */ e("div", { className: "hover:bg-d-accent cursor-pointer rounded-full p-2", children: /* @__PURE__ */ e(s, { onClick: m, name: "ChevronRight" }) })
34
+ /* @__PURE__ */ e("div", { className: "hover:bg-d-accent cursor-pointer rounded-full p-2", children: /* @__PURE__ */ e(a, { onClick: c, name: "ChevronLeft" }) }),
35
+ /* @__PURE__ */ e("div", { className: "hover:bg-d-accent cursor-pointer rounded-full p-2", children: /* @__PURE__ */ e(a, { onClick: m, name: "ChevronRight" }) })
36
36
  ] }),
37
37
  /* @__PURE__ */ r("div", { className: "flex flex-col items-center py-2 text-center leading-tight", children: [
38
- /* @__PURE__ */ e(a, { variant: "h5", children: g.upperFirst(o.format("MMMM YYYY")) }),
39
- /* @__PURE__ */ r(a, { variant: "small", className: "text-d-muted-foreground", children: [
38
+ /* @__PURE__ */ e(s, { variant: "h5", children: h.upperFirst(o.format("MMMM YYYY")) }),
39
+ /* @__PURE__ */ r(s, { variant: "small", className: "text-d-muted-foreground", children: [
40
40
  o.format("D"),
41
41
  " – ",
42
42
  p.format("D MMM")
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { jsxs as i, jsx as r } from "react/jsx-runtime";
3
- import A from "react";
4
3
  import N from "../../../_virtual/dayjs.min.js";
5
- import { useCalendar as I } from "./calendar-context.js";
6
- import { AppointmentCard as W } from "./appointment-card.js";
7
- import { Typo as g } from "../typo.js";
8
- import { Badge as n } from "../badge.js";
4
+ import A from "react";
9
5
  import { cn as m } from "../../../lib/utils.js";
10
- import { Tooltip as M, TooltipTrigger as T, TooltipContent as w } from "../tooltip.js";
6
+ import { Badge as n } from "../badge.js";
7
+ import { Tooltip as g, TooltipTrigger as M, TooltipContent as T } from "../tooltip.js";
8
+ import { Typo as w } from "../typo.js";
9
+ import { AppointmentCard as I } from "./appointment-card.js";
10
+ import { useCalendar as W } from "./calendar-context.js";
11
11
  const F = ({ date: d, weekdayInfo: h }) => {
12
12
  const {
13
13
  calendarStartHour: l,
@@ -15,7 +15,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
15
15
  enableGrouping: f,
16
16
  appointmentsByDay: j,
17
17
  groupedAppointmentsByDay: D
18
- } = I(), O = A.useMemo(() => Array.from(
18
+ } = W(), O = A.useMemo(() => Array.from(
19
19
  { length: p - l + 1 },
20
20
  (e, a) => `${(a + l).toString().padStart(2, "0")}:00`
21
21
  ), [l, p]), u = d.format("YYYY-MM-DD"), o = f ? D[u] || {} : { default: j[u] || [] }, s = d.isSame(N(), "day"), t = Object.keys(o), c = t.length > 1, b = (e) => {
@@ -29,7 +29,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
29
29
  height: `${k}px`,
30
30
  zIndex: 10
31
31
  },
32
- children: /* @__PURE__ */ r(W, { appointment: e })
32
+ children: /* @__PURE__ */ r(I, { appointment: e })
33
33
  },
34
34
  e.id
35
35
  );
@@ -53,7 +53,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
53
53
  ),
54
54
  children: /* @__PURE__ */ i("div", { className: "flex flex-col items-start justify-center gap-0", children: [
55
55
  /* @__PURE__ */ r(
56
- g,
56
+ w,
57
57
  {
58
58
  variant: "h5",
59
59
  className: m("mb-0", s ? "text-d-primary" : ""),
@@ -61,7 +61,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
61
61
  }
62
62
  ),
63
63
  /* @__PURE__ */ r(
64
- g,
64
+ w,
65
65
  {
66
66
  variant: "small",
67
67
  className: m(
@@ -79,8 +79,8 @@ const F = ({ date: d, weekdayInfo: h }) => {
79
79
  {
80
80
  className: "border-d-border flex flex-1 items-center justify-center border-r px-2 py-1.5 last:border-r-0",
81
81
  style: { minWidth: "120px" },
82
- children: e.length > 10 ? /* @__PURE__ */ i(M, { children: [
83
- /* @__PURE__ */ r(T, { asChild: !0, children: /* @__PURE__ */ r(
82
+ children: e.length > 10 ? /* @__PURE__ */ i(g, { children: [
83
+ /* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(
84
84
  n,
85
85
  {
86
86
  variant: s ? "outline-primary" : "outline",
@@ -89,7 +89,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
89
89
  }
90
90
  ) }),
91
91
  /* @__PURE__ */ r(
92
- w,
92
+ T,
93
93
  {
94
94
  sideOffset: 4,
95
95
  className: "max-w-xs text-center break-words",
@@ -106,8 +106,8 @@ const F = ({ date: d, weekdayInfo: h }) => {
106
106
  )
107
107
  },
108
108
  e
109
- )) : /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center px-2 py-1.5", children: t[0].length > 15 ? /* @__PURE__ */ i(M, { children: [
110
- /* @__PURE__ */ r(T, { asChild: !0, children: /* @__PURE__ */ r(
109
+ )) : /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center px-2 py-1.5", children: t[0].length > 15 ? /* @__PURE__ */ i(g, { children: [
110
+ /* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(
111
111
  n,
112
112
  {
113
113
  variant: s ? "outline-primary" : "outline",
@@ -116,7 +116,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
116
116
  }
117
117
  ) }),
118
118
  /* @__PURE__ */ r(
119
- w,
119
+ T,
120
120
  {
121
121
  sideOffset: 4,
122
122
  className: "max-w-xs text-center break-words",
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import { jsxs as a, jsx as r } from "react/jsx-runtime";
3
3
  import u from "react";
4
- import { useCalendar as b } from "./calendar-context.js";
5
- import { Badge as p } from "../badge.js";
4
+ import { Badge as b } from "../badge.js";
5
+ import { useCalendar as p } from "./calendar-context.js";
6
6
  const N = () => {
7
7
  const {
8
8
  calendarStartHour: t = 6,
9
9
  calendarEndHour: d = 18,
10
10
  enableGrouping: s,
11
11
  groupLabel: i
12
- } = b(), c = u.useMemo(() => {
12
+ } = p(), c = u.useMemo(() => {
13
13
  const e = d - t + 1;
14
14
  return Array.from({ length: e }, (n, m) => {
15
15
  const o = m + t, l = o < 12 ? "AM" : "PM";
@@ -21,7 +21,7 @@ const N = () => {
21
21
  }, [t, d]);
22
22
  return /* @__PURE__ */ a("div", { className: "border-d-border bg-d-card z-20 flex-shrink-0 border-r px-2", children: [
23
23
  /* @__PURE__ */ r("div", { className: "border-d-border h-14 border-b" }),
24
- s && /* @__PURE__ */ r("div", { className: "border-d-border flex min-h-[2.5rem] items-center justify-center border-b", children: /* @__PURE__ */ r(p, { variant: "outline", children: i }) }),
24
+ s && /* @__PURE__ */ r("div", { className: "border-d-border flex min-h-[2.5rem] items-center justify-center border-b", children: /* @__PURE__ */ r(b, { variant: "outline", children: i }) }),
25
25
  /* @__PURE__ */ r("div", { className: "relative", children: c.map(({ label: e, ampm: n }) => /* @__PURE__ */ a(
26
26
  "div",
27
27
  {
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { jsx as f, jsxs as y } from "react/jsx-runtime";
3
- import d from "react";
4
3
  import a from "../../../_virtual/dayjs.min.js";
5
4
  import N from "../../../_virtual/isoWeek.js";
5
+ import d from "react";
6
6
  import { CalendarProvider as h } from "./calendar-context.js";
7
7
  import { CalendarHeader as B } from "./calendar-header.js";
8
- import { TimeColumn as C } from "./time-column.js";
8
+ import { CurrentTimeLine as C } from "./current-timeline.js";
9
9
  import { DayColumn as V } from "./day-column.js";
10
- import { CurrentTimeLine as z } from "./current-timeline.js";
10
+ import { TimeColumn as z } from "./time-column.js";
11
11
  a.extend(N);
12
12
  const L = [
13
13
  { key: "monday", label: "Lunedì", dayjs: 1 },
@@ -102,8 +102,8 @@ function Q({
102
102
  }, children: /* @__PURE__ */ y("div", { className: "flex h-full flex-col", children: [
103
103
  /* @__PURE__ */ f(B, {}),
104
104
  /* @__PURE__ */ y("div", { className: "border-d-border relative flex flex-1 border-t border-l", children: [
105
- /* @__PURE__ */ f(C, {}),
106
105
  /* @__PURE__ */ f(z, {}),
106
+ /* @__PURE__ */ f(C, {}),
107
107
  /* @__PURE__ */ f("div", { className: "flex flex-1 overflow-x-auto", children: k.map((e, t) => /* @__PURE__ */ f(
108
108
  V,
109
109
  {
@@ -17,7 +17,7 @@ function w({
17
17
  try {
18
18
  f.stop();
19
19
  const e = await a.current;
20
- if (t) {
20
+ if (t && e) {
21
21
  const s = await t(e);
22
22
  d?.(s);
23
23
  }
@@ -1,35 +1,35 @@
1
1
  "use client";
2
- import { useRef as l, useState as h, useEffect as s } from "react";
2
+ import { useRef as l, useState as w, useCallback as h, useEffect as s } from "react";
3
3
  const H = 50, m = 10;
4
- function D(u) {
5
- const e = l(null), t = l(null), [n, r] = h(!0), c = () => {
4
+ function D() {
5
+ const e = l(null), t = l(null), [r, n] = w(!0), c = h(() => {
6
6
  typeof window > "u" || e.current && (e.current.scrollTop = e.current.scrollHeight);
7
- }, i = () => {
7
+ }, []), u = () => {
8
8
  if (!(typeof window > "u") && e.current) {
9
- const { scrollTop: o, scrollHeight: d, clientHeight: p } = e.current, S = Math.abs(
10
- d - o - p
11
- ), a = t.current ? o < t.current : !1, T = t.current ? t.current - o : 0;
12
- if (a && T > m)
13
- r(!1);
9
+ const { scrollTop: o, scrollHeight: f, clientHeight: d } = e.current, a = Math.abs(
10
+ f - o - d
11
+ ), p = t.current ? o < t.current : !1, S = t.current ? t.current - o : 0;
12
+ if (p && S > m)
13
+ n(!1);
14
14
  else {
15
- const w = S < H;
16
- r(w);
15
+ const T = a < H;
16
+ n(T);
17
17
  }
18
18
  t.current = o;
19
19
  }
20
- }, f = () => {
21
- typeof window > "u" || r(!1);
20
+ }, i = () => {
21
+ typeof window > "u" || n(!1);
22
22
  };
23
23
  return s(() => {
24
24
  typeof window > "u" || e.current && (t.current = e.current.scrollTop);
25
25
  }, []), s(() => {
26
- typeof window > "u" || n && c();
27
- }, u), {
26
+ typeof window > "u" || r && c();
27
+ }, [r, c]), {
28
28
  containerRef: e,
29
29
  scrollToBottom: c,
30
- handleScroll: i,
31
- shouldAutoScroll: n,
32
- handleTouchStart: f
30
+ handleScroll: u,
31
+ shouldAutoScroll: r,
32
+ handleTouchStart: i
33
33
  };
34
34
  }
35
35
  export {
@@ -1,22 +1,21 @@
1
1
  "use client";
2
- import { useRef as f, useLayoutEffect as a } from "react";
3
- const d = typeof window < "u" ? a : () => {
2
+ import { useRef as l, useLayoutEffect as f } from "react";
3
+ const a = typeof window < "u" ? f : () => {
4
4
  };
5
- function m({
5
+ function h({
6
6
  ref: t,
7
7
  maxHeight: o = Number.MAX_SAFE_INTEGER,
8
- borderWidth: u = 0,
9
- dependencies: c
8
+ borderWidth: r = 0
10
9
  }) {
11
- const n = f(null);
12
- d(() => {
10
+ const n = l(null);
11
+ a(() => {
13
12
  if (typeof window > "u" || !t.current) return;
14
- const e = t.current, r = u * 2;
15
- n.current === null && (n.current = e.scrollHeight - r), e.style.removeProperty("height");
16
- const s = e.scrollHeight, i = Math.min(s, o), l = Math.max(i, n.current);
17
- e.style.height = `${l + r}px`;
18
- }, [o, t, ...c]);
13
+ const e = t.current, u = r * 2;
14
+ n.current === null && (n.current = e.scrollHeight - u), e.style.removeProperty("height");
15
+ const c = e.scrollHeight, s = Math.min(c, o), i = Math.max(s, n.current);
16
+ e.style.height = `${i + u}px`;
17
+ }, [o, t, r]);
19
18
  }
20
19
  export {
21
- m as useAutosizeTextArea
20
+ h as useAutosizeTextArea
22
21
  };