agentic-ui-kit 0.9.1 → 0.9.2

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 (2) hide show
  1. package/dist/index.js +18 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,9 +3,10 @@ import { a as LabelsProvider, c as Button, d as cx, i as useChatInteraction, l a
3
3
  import { a as readEventStream, c as activityTokens, h as settleToolCall, l as applyEvent, n as readAskUserInput, r as readAskUserResult, s as toBlocks, u as awaitingToolCalls } from "./ask-user-CwDYhXX4.js";
4
4
  import { clsx } from "clsx";
5
5
  import { Children, Fragment, createContext, createElement, isValidElement, memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
6
- import { Autocomplete, Button as Button$1, Dialog, DialogTrigger, DialogTrigger as DialogTrigger$1, Disclosure as Disclosure$1, DisclosurePanel, Focusable, Header, Heading, Input, Keyboard, Link, Menu as Menu$1, MenuItem as MenuItem$1, MenuSection as MenuSection$1, MenuTrigger, MenuTrigger as MenuTrigger$1, Modal as Modal$1, ModalOverlay, Popover as Popover$1, SearchField, Separator, SubmenuTrigger, Text, ToggleButton, ToggleButtonGroup, useFilter } from "react-aria-components";
6
+ import { Autocomplete, Button as Button$1, Dialog, DialogTrigger, DialogTrigger as DialogTrigger$1, Disclosure as Disclosure$1, DisclosurePanel, Focusable, Header, Heading, Input, Keyboard, Link, Menu as Menu$1, MenuItem as MenuItem$1, MenuSection as MenuSection$1, MenuTrigger, MenuTrigger as MenuTrigger$1, Modal as Modal$1, ModalOverlay, OverlayTriggerStateContext, Popover as Popover$1, SearchField, Separator, SubmenuTrigger, Text, ToggleButton, ToggleButtonGroup, useFilter } from "react-aria-components";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { AlertTriangle, ArrowDown, ArrowRight, ArrowUp, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsUpDown, Copy, FileText, Folder, FolderOpen, FolderPlus, Globe, GripVertical, Info, MessageSquare, Mic, MoreHorizontal, PanelLeft, Pencil, Pin, PinOff, Plus, RefreshCw, Share, ShieldQuestion, Square, ThumbsDown, ThumbsUp, Trash2, Volume2, X } from "lucide-react";
9
+ import { useIsHidden } from "react-aria/private/collections/Hidden";
9
10
  import { UNSAFE_PortalProvider } from "react-aria";
10
11
  import { createMathPlugin } from "@streamdown/math";
11
12
  import { Streamdown, defaultComponents, defaultRehypePlugins } from "streamdown";
@@ -242,22 +243,28 @@ function useNarrower(max) {
242
243
  }
243
244
  /** Floating panel for menus and pickers: surface color, rounded, soft shadow, fades in. On phones it's a bottom sheet. */
244
245
  function Popover({ className, offset = 6, sheet = 768, width = "auto", fullWidthOnPhones, children, ...props }) {
245
- if (useNarrower(sheet)) {
246
- const { isOpen, onOpenChange } = props;
246
+ const asSheet = useNarrower(sheet);
247
+ const isHidden = useIsHidden();
248
+ const triggerState = useContext(OverlayTriggerStateContext);
249
+ if (asSheet) {
250
+ const content = typeof children === "function" ? children({
251
+ placement: "bottom",
252
+ trigger: null,
253
+ isEntering: false,
254
+ isExiting: false,
255
+ defaultChildren: void 0
256
+ }) : children;
257
+ if (isHidden) return /* @__PURE__ */ jsx(Fragment$1, { children: content });
258
+ const isOpen = props.isOpen ?? triggerState?.isOpen ?? false;
259
+ const onOpenChange = props.onOpenChange ?? triggerState?.setOpen;
247
260
  return /* @__PURE__ */ jsx(ModalOverlay, {
248
- ...isOpen !== void 0 && { isOpen },
261
+ isOpen,
249
262
  ...onOpenChange && { onOpenChange },
250
263
  isDismissable: true,
251
264
  className: "fixed inset-0 z-50 flex items-end bg-(--chat-backdrop) data-entering:animate-chat-fade-in data-exiting:animate-chat-fade-out",
252
265
  children: /* @__PURE__ */ jsx(Modal$1, {
253
266
  className: cx("flex max-h-[85dvh] w-full flex-col overflow-auto rounded-t-chat-lg border-t border-chat-popover-border bg-chat-popover pb-[env(safe-area-inset-bottom)] font-chat-sans text-chat-fg shadow-chat-popover outline-none", "data-entering:animate-chat-sheet-in data-exiting:animate-chat-sheet-out", className),
254
- children: typeof children === "function" ? children({
255
- placement: "bottom",
256
- trigger: null,
257
- isEntering: false,
258
- isExiting: false,
259
- defaultChildren: void 0
260
- }) : children
267
+ children: content
261
268
  })
262
269
  });
263
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-ui-kit",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "React UI kit for LLM chat and agentic apps: streaming messages, tool calls, approvals, themable with CSS variables.",
5
5
  "license": "MIT",
6
6
  "type": "module",