@djangocfg/ui-tools 2.1.348 → 2.1.350

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.
@@ -0,0 +1,5 @@
1
+ export { ChatRoot } from './chunk-XG3XAO7W.mjs';
2
+ import './chunk-2ZLKZ5VR.mjs';
3
+ import './chunk-N2XQF2OL.mjs';
4
+ //# sourceMappingURL=ChatRoot-3FZ6DXBD.mjs.map
5
+ //# sourceMappingURL=ChatRoot-3FZ6DXBD.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-CZMOJOGD.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-3FZ6DXBD.mjs"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkHVIL2FEQ_cjs = require('./chunk-HVIL2FEQ.cjs');
4
+ require('./chunk-B5AWZOHJ.cjs');
5
+ require('./chunk-OLISEQHS.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "ChatRoot", {
10
+ enumerable: true,
11
+ get: function () { return chunkHVIL2FEQ_cjs.ChatRoot; }
12
+ });
13
+ //# sourceMappingURL=ChatRoot-7TTJRYBA.cjs.map
14
+ //# sourceMappingURL=ChatRoot-7TTJRYBA.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-VTYANC7M.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-7TTJRYBA.cjs"}
@@ -1655,6 +1655,35 @@ function RemoveBtn({ onRemove }) {
1655
1655
  );
1656
1656
  }
1657
1657
  chunkOLISEQHS_cjs.__name(RemoveBtn, "RemoveBtn");
1658
+ var SIZE_CLASSES = {
1659
+ sm: {
1660
+ slot: "[&>:not(textarea)]:h-8",
1661
+ button: "h-8 w-8",
1662
+ iconButton: "size-3.5",
1663
+ textarea: "min-h-8 max-h-48 px-3 py-1.5",
1664
+ text: "text-sm",
1665
+ padding: "gap-1.5",
1666
+ containerPadding: "px-2 pt-1.5 pb-[max(0.375rem,env(safe-area-inset-bottom))]"
1667
+ },
1668
+ md: {
1669
+ slot: "[&>:not(textarea)]:h-9",
1670
+ button: "h-9 w-9",
1671
+ iconButton: "size-4",
1672
+ textarea: "min-h-9 max-h-60 px-3.5 py-2",
1673
+ text: "text-base sm:text-sm",
1674
+ padding: "gap-1.5",
1675
+ containerPadding: "px-2.5 pt-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]"
1676
+ },
1677
+ lg: {
1678
+ slot: "[&>:not(textarea)]:h-12",
1679
+ button: "h-12 w-12",
1680
+ iconButton: "size-5",
1681
+ textarea: "min-h-12 max-h-72 px-4 py-3",
1682
+ text: "text-base",
1683
+ padding: "gap-2",
1684
+ containerPadding: "px-3.5 pt-3 pb-[max(0.875rem,env(safe-area-inset-bottom))]"
1685
+ }
1686
+ };
1658
1687
  var Composer = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function Composer2({
1659
1688
  composer,
1660
1689
  placeholder = "Type a message...",
@@ -1666,6 +1695,7 @@ var Composer = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(functio
1666
1695
  attachmentTray,
1667
1696
  className,
1668
1697
  textareaClassName,
1698
+ size = "md",
1669
1699
  isStreaming: isStreamingProp,
1670
1700
  onCancel: onCancelProp
1671
1701
  }, ref) {
@@ -1673,12 +1703,14 @@ var Composer = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(functio
1673
1703
  const isStreaming = isStreamingProp ?? ctx?.isStreaming ?? false;
1674
1704
  const onCancel = onCancelProp ?? ctx?.cancelStream;
1675
1705
  const isDisabled = disabled ?? isStreaming;
1706
+ const sz = SIZE_CLASSES[size];
1676
1707
  return /* @__PURE__ */ jsxRuntime.jsxs(
1677
1708
  "div",
1678
1709
  {
1679
1710
  ref,
1680
1711
  className: lib.cn(
1681
- "border-t border-border bg-background/95 px-2.5 pt-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]",
1712
+ "border-t border-border bg-background/95",
1713
+ sz.containerPadding,
1682
1714
  className
1683
1715
  ),
1684
1716
  children: [
@@ -1689,7 +1721,7 @@ var Composer = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(functio
1689
1721
  onRemove: (a) => composer.removeAttachment(a.id)
1690
1722
  }
1691
1723
  ) }) : null,
1692
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-1.5 [&>:not(textarea)]:shrink-0 [&>:not(textarea)]:h-9", children: [
1724
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: lib.cn("flex items-end [&>:not(textarea)]:shrink-0", sz.padding, sz.slot), children: [
1693
1725
  showAttachmentButton ? /* @__PURE__ */ jsxRuntime.jsx(
1694
1726
  components.Button,
1695
1727
  {
@@ -1699,8 +1731,8 @@ var Composer = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(functio
1699
1731
  onClick: onPickFiles,
1700
1732
  "aria-label": "Attach files",
1701
1733
  disabled: isDisabled,
1702
- className: "h-9 w-9",
1703
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Paperclip, { "aria-hidden": true, className: "size-4" })
1734
+ className: sz.button,
1735
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Paperclip, { "aria-hidden": true, className: sz.iconButton })
1704
1736
  }
1705
1737
  ) : null,
1706
1738
  toolbarStart,
@@ -1714,7 +1746,9 @@ var Composer = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(functio
1714
1746
  "aria-multiline": "true",
1715
1747
  disabled: isDisabled,
1716
1748
  className: lib.cn(
1717
- "min-h-9 max-h-60 flex-1 resize-none rounded-2xl px-3.5 py-2 text-base sm:text-sm",
1749
+ "flex-1 resize-none rounded-2xl",
1750
+ sz.textarea,
1751
+ sz.text,
1718
1752
  textareaClassName
1719
1753
  )
1720
1754
  }
@@ -1729,8 +1763,8 @@ var Composer = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(functio
1729
1763
  onClick: onCancel,
1730
1764
  "aria-label": "Stop",
1731
1765
  "aria-keyshortcuts": "Escape",
1732
- className: "h-9 w-9",
1733
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { "aria-hidden": true, className: "size-3.5" })
1766
+ className: sz.button,
1767
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { "aria-hidden": true, className: sz.iconButton })
1734
1768
  }
1735
1769
  ) : /* @__PURE__ */ jsxRuntime.jsx(
1736
1770
  components.Button,
@@ -1741,8 +1775,8 @@ var Composer = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(functio
1741
1775
  disabled: !composer.canSubmit,
1742
1776
  "aria-label": "Send",
1743
1777
  "aria-keyshortcuts": "Enter",
1744
- className: "h-9 w-9",
1745
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { "aria-hidden": true, className: "size-4" })
1778
+ className: sz.button,
1779
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { "aria-hidden": true, className: sz.iconButton })
1746
1780
  }
1747
1781
  )
1748
1782
  ] })
@@ -2353,7 +2387,8 @@ function ChatRootShell({ className, slots }) {
2353
2387
  onPickFiles: slots.onPickFiles,
2354
2388
  toolbarStart: slots.composerToolbarStart,
2355
2389
  toolbarEnd: slots.composerToolbarEnd,
2356
- attachmentTray: slots.composerAttachmentTray
2390
+ attachmentTray: slots.composerAttachmentTray,
2391
+ size: slots.composerSize
2357
2392
  }
2358
2393
  ),
2359
2394
  slots.footer ?? null
@@ -2406,5 +2441,5 @@ exports.useChatContextOptional = useChatContextOptional;
2406
2441
  exports.useChatHistory = useChatHistory;
2407
2442
  exports.useChatLayout = useChatLayout;
2408
2443
  exports.useChatScroll = useChatScroll;
2409
- //# sourceMappingURL=chunk-XYGB26BY.cjs.map
2410
- //# sourceMappingURL=chunk-XYGB26BY.cjs.map
2444
+ //# sourceMappingURL=chunk-HVIL2FEQ.cjs.map
2445
+ //# sourceMappingURL=chunk-HVIL2FEQ.cjs.map