@djangocfg/ui-tools 2.1.349 → 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.
@@ -1653,6 +1653,35 @@ function RemoveBtn({ onRemove }) {
1653
1653
  );
1654
1654
  }
1655
1655
  __name(RemoveBtn, "RemoveBtn");
1656
+ var SIZE_CLASSES = {
1657
+ sm: {
1658
+ slot: "[&>:not(textarea)]:h-8",
1659
+ button: "h-8 w-8",
1660
+ iconButton: "size-3.5",
1661
+ textarea: "min-h-8 max-h-48 px-3 py-1.5",
1662
+ text: "text-sm",
1663
+ padding: "gap-1.5",
1664
+ containerPadding: "px-2 pt-1.5 pb-[max(0.375rem,env(safe-area-inset-bottom))]"
1665
+ },
1666
+ md: {
1667
+ slot: "[&>:not(textarea)]:h-9",
1668
+ button: "h-9 w-9",
1669
+ iconButton: "size-4",
1670
+ textarea: "min-h-9 max-h-60 px-3.5 py-2",
1671
+ text: "text-base sm:text-sm",
1672
+ padding: "gap-1.5",
1673
+ containerPadding: "px-2.5 pt-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]"
1674
+ },
1675
+ lg: {
1676
+ slot: "[&>:not(textarea)]:h-12",
1677
+ button: "h-12 w-12",
1678
+ iconButton: "size-5",
1679
+ textarea: "min-h-12 max-h-72 px-4 py-3",
1680
+ text: "text-base",
1681
+ padding: "gap-2",
1682
+ containerPadding: "px-3.5 pt-3 pb-[max(0.875rem,env(safe-area-inset-bottom))]"
1683
+ }
1684
+ };
1656
1685
  var Composer = forwardRef(/* @__PURE__ */ __name(function Composer2({
1657
1686
  composer,
1658
1687
  placeholder = "Type a message...",
@@ -1664,6 +1693,7 @@ var Composer = forwardRef(/* @__PURE__ */ __name(function Composer2({
1664
1693
  attachmentTray,
1665
1694
  className,
1666
1695
  textareaClassName,
1696
+ size = "md",
1667
1697
  isStreaming: isStreamingProp,
1668
1698
  onCancel: onCancelProp
1669
1699
  }, ref) {
@@ -1671,12 +1701,14 @@ var Composer = forwardRef(/* @__PURE__ */ __name(function Composer2({
1671
1701
  const isStreaming = isStreamingProp ?? ctx?.isStreaming ?? false;
1672
1702
  const onCancel = onCancelProp ?? ctx?.cancelStream;
1673
1703
  const isDisabled = disabled ?? isStreaming;
1704
+ const sz = SIZE_CLASSES[size];
1674
1705
  return /* @__PURE__ */ jsxs(
1675
1706
  "div",
1676
1707
  {
1677
1708
  ref,
1678
1709
  className: cn(
1679
- "border-t border-border bg-background/95 px-2.5 pt-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]",
1710
+ "border-t border-border bg-background/95",
1711
+ sz.containerPadding,
1680
1712
  className
1681
1713
  ),
1682
1714
  children: [
@@ -1687,7 +1719,7 @@ var Composer = forwardRef(/* @__PURE__ */ __name(function Composer2({
1687
1719
  onRemove: (a) => composer.removeAttachment(a.id)
1688
1720
  }
1689
1721
  ) }) : null,
1690
- /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-1.5 [&>:not(textarea)]:shrink-0 [&>:not(textarea)]:h-9", children: [
1722
+ /* @__PURE__ */ jsxs("div", { className: cn("flex items-end [&>:not(textarea)]:shrink-0", sz.padding, sz.slot), children: [
1691
1723
  showAttachmentButton ? /* @__PURE__ */ jsx(
1692
1724
  Button,
1693
1725
  {
@@ -1697,8 +1729,8 @@ var Composer = forwardRef(/* @__PURE__ */ __name(function Composer2({
1697
1729
  onClick: onPickFiles,
1698
1730
  "aria-label": "Attach files",
1699
1731
  disabled: isDisabled,
1700
- className: "h-9 w-9",
1701
- children: /* @__PURE__ */ jsx(Paperclip, { "aria-hidden": true, className: "size-4" })
1732
+ className: sz.button,
1733
+ children: /* @__PURE__ */ jsx(Paperclip, { "aria-hidden": true, className: sz.iconButton })
1702
1734
  }
1703
1735
  ) : null,
1704
1736
  toolbarStart,
@@ -1712,7 +1744,9 @@ var Composer = forwardRef(/* @__PURE__ */ __name(function Composer2({
1712
1744
  "aria-multiline": "true",
1713
1745
  disabled: isDisabled,
1714
1746
  className: cn(
1715
- "min-h-9 max-h-60 flex-1 resize-none rounded-2xl px-3.5 py-2 text-base sm:text-sm",
1747
+ "flex-1 resize-none rounded-2xl",
1748
+ sz.textarea,
1749
+ sz.text,
1716
1750
  textareaClassName
1717
1751
  )
1718
1752
  }
@@ -1727,8 +1761,8 @@ var Composer = forwardRef(/* @__PURE__ */ __name(function Composer2({
1727
1761
  onClick: onCancel,
1728
1762
  "aria-label": "Stop",
1729
1763
  "aria-keyshortcuts": "Escape",
1730
- className: "h-9 w-9",
1731
- children: /* @__PURE__ */ jsx(Square, { "aria-hidden": true, className: "size-3.5" })
1764
+ className: sz.button,
1765
+ children: /* @__PURE__ */ jsx(Square, { "aria-hidden": true, className: sz.iconButton })
1732
1766
  }
1733
1767
  ) : /* @__PURE__ */ jsx(
1734
1768
  Button,
@@ -1739,8 +1773,8 @@ var Composer = forwardRef(/* @__PURE__ */ __name(function Composer2({
1739
1773
  disabled: !composer.canSubmit,
1740
1774
  "aria-label": "Send",
1741
1775
  "aria-keyshortcuts": "Enter",
1742
- className: "h-9 w-9",
1743
- children: /* @__PURE__ */ jsx(Send, { "aria-hidden": true, className: "size-4" })
1776
+ className: sz.button,
1777
+ children: /* @__PURE__ */ jsx(Send, { "aria-hidden": true, className: sz.iconButton })
1744
1778
  }
1745
1779
  )
1746
1780
  ] })
@@ -2351,7 +2385,8 @@ function ChatRootShell({ className, slots }) {
2351
2385
  onPickFiles: slots.onPickFiles,
2352
2386
  toolbarStart: slots.composerToolbarStart,
2353
2387
  toolbarEnd: slots.composerToolbarEnd,
2354
- attachmentTray: slots.composerAttachmentTray
2388
+ attachmentTray: slots.composerAttachmentTray,
2389
+ size: slots.composerSize
2355
2390
  }
2356
2391
  ),
2357
2392
  slots.footer ?? null
@@ -2366,5 +2401,5 @@ function copy2(text) {
2366
2401
  __name(copy2, "copy");
2367
2402
 
2368
2403
  export { Attachments, AttachmentsGrid, AttachmentsList, CHAT_EVENT_NAME, CSS_VARS, ChatProvider, ChatRoot, Composer, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, EmptyState, ErrorBanner, HOTKEYS, JumpToLatest, LIMITS, MessageActions, MessageBubble, MessageList, STORAGE_KEYS, Sources, StreamingIndicator, ToolCalls, createId, createTokenBuffer, deriveInitials, getChatLogger, initialState, reducer, resolvePersona, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatScroll };
2369
- //# sourceMappingURL=chunk-QCKJVSJF.mjs.map
2370
- //# sourceMappingURL=chunk-QCKJVSJF.mjs.map
2404
+ //# sourceMappingURL=chunk-XG3XAO7W.mjs.map
2405
+ //# sourceMappingURL=chunk-XG3XAO7W.mjs.map