@apteva/apteva-kit 0.1.94 → 0.1.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2271,12 +2271,14 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
2271
2271
  const handleChange = (e) => {
2272
2272
  setText(e.target.value);
2273
2273
  e.target.style.height = "auto";
2274
- e.target.style.height = `${e.target.scrollHeight}px`;
2274
+ const scrollHeight = e.target.scrollHeight;
2275
+ e.target.style.height = `${scrollHeight}px`;
2275
2276
  const hasNewline = e.target.value.includes("\n");
2276
- const textLength = e.target.value.length;
2277
- if (!isMultiLine && (hasNewline || textLength > 50)) {
2277
+ const singleLineHeight = 36;
2278
+ const isOverflowing = scrollHeight > singleLineHeight;
2279
+ if (!isMultiLine && (hasNewline || isOverflowing)) {
2278
2280
  setIsMultiLine(true);
2279
- } else if (isMultiLine && !hasNewline && textLength < 30) {
2281
+ } else if (isMultiLine && !hasNewline && !isOverflowing && e.target.value.length < 20) {
2280
2282
  setIsMultiLine(false);
2281
2283
  }
2282
2284
  };
@@ -2358,7 +2360,7 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
2358
2360
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2359
2361
  "div",
2360
2362
  {
2361
- className: "apteva-composer relative border-2 border-neutral-300 dark:border-neutral-700 bg-white dark:bg-neutral-900 transition-all duration-300 px-3 py-2 grid gap-x-3 gap-y-2",
2363
+ className: "apteva-composer",
2362
2364
  style: {
2363
2365
  gridTemplateColumns: "auto 1fr auto",
2364
2366
  gridTemplateAreas: isMultiLine ? '"textarea textarea textarea" "plus . send"' : '"plus textarea send"',
@@ -2438,9 +2440,9 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
2438
2440
  "button",
2439
2441
  {
2440
2442
  onClick: onStop,
2441
- className: "apteva-composer-stop-btn !w-8 !h-8 !p-0 !m-0 !rounded-lg !flex !items-center !justify-center !font-bold !transition-all !flex-shrink-0 !border !border-solid !border-red-400 dark:!border-red-500 !bg-red-50 dark:!bg-red-900/30 !text-red-600 dark:!text-red-400 hover:!bg-red-100 dark:hover:!bg-red-900/50 !outline-none !shadow-none",
2443
+ className: "apteva-composer-stop-btn",
2442
2444
  title: "Stop generation",
2443
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "!text-red-600 dark:!text-red-400", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "2", y: "2", width: "10", height: "10", rx: "1", fill: "currentColor" }) })
2445
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "2", y: "2", width: "10", height: "10", rx: "1", fill: "currentColor" }) })
2444
2446
  }
2445
2447
  ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2446
2448
  "button",
@@ -2744,9 +2746,9 @@ function CommandComposer({
2744
2746
  "button",
2745
2747
  {
2746
2748
  onClick: onStop,
2747
- className: "apteva-composer-stop-btn !w-8 !h-8 !p-0 !m-0 !rounded-lg !flex !items-center !justify-center !transition-all !border !border-solid !border-red-400 dark:!border-red-500 !bg-red-50 dark:!bg-red-900/30 !text-red-600 dark:!text-red-400 hover:!bg-red-100 dark:hover:!bg-red-900/50 !outline-none !shadow-none",
2749
+ className: "apteva-composer-stop-btn",
2748
2750
  title: "Stop generation",
2749
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "!text-red-600 dark:!text-red-400", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "2", y: "2", width: "10", height: "10", rx: "1", fill: "currentColor" }) })
2751
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "2", y: "2", width: "10", height: "10", rx: "1", fill: "currentColor" }) })
2750
2752
  }
2751
2753
  ),
2752
2754
  (state === "success" || state === "error") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,