@rolder/kit 3.0.0-alpha.67 → 3.0.0-alpha.69

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.
@@ -1,11 +1,7 @@
1
1
  import { type StackProps } from '@mantine/core';
2
2
  import type { ReactNode } from 'react';
3
- import { type ScrollAreaProps } from '../../../ui';
4
- type MessagesProps = {
3
+ type MessagesProps = Omit<StackProps, 'children'> & {
5
4
  children: (messageId: string) => ReactNode;
6
- scrollAreaProps?: ScrollAreaProps;
7
- withScrollButton?: boolean;
8
- stackProps?: StackProps;
9
5
  };
10
- export declare const Messages: ({ children, scrollAreaProps, withScrollButton, stackProps, }: MessagesProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const Messages: ({ children, ...props }: MessagesProps) => import("react/jsx-runtime").JSX.Element;
11
7
  export {};
@@ -1,21 +1,11 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { Stack } from "@mantine/core";
3
- import { ScrollArea } from "../../../ui/index.js";
4
3
  import { useChatMessageIds } from "./store/index.js";
5
- const Messages = ({ children, scrollAreaProps, withScrollButton = true, stackProps })=>{
4
+ const Messages = ({ children, ...props })=>{
6
5
  const messageIds = useChatMessageIds();
7
- return /*#__PURE__*/ jsxs(ScrollArea, {
8
- autoScroll: true,
9
- scrollToBottomOnInit: true,
10
- p: "md",
11
- ...scrollAreaProps,
12
- children: [
13
- /*#__PURE__*/ jsx(Stack, {
14
- ...stackProps,
15
- children: 'function' == typeof children ? messageIds.map((messageId)=>children(messageId)) : null
16
- }),
17
- withScrollButton && /*#__PURE__*/ jsx(ScrollArea.ScrollButton, {})
18
- ]
6
+ return /*#__PURE__*/ jsx(Stack, {
7
+ ...props,
8
+ children: 'function' == typeof children ? messageIds.map((messageId)=>children(messageId)) : null
19
9
  });
20
10
  };
21
11
  export { Messages };
@@ -1,8 +1,11 @@
1
1
  import type { UseChatOptions } from '@ai-sdk/react';
2
2
  import { type PaperProps } from '@mantine/core';
3
3
  import type { ChatInit, UIMessage } from 'ai';
4
+ import { type ScrollAreaProps } from '../../../ui';
4
5
  export interface ConversationRootProps extends PaperProps {
5
6
  children?: React.ReactNode;
7
+ scrollAreaProps?: ScrollAreaProps;
8
+ withScrollButton?: boolean;
6
9
  chatOptions?: UseChatOptions<UIMessage> & ChatInit<UIMessage>;
7
10
  }
8
- export declare const Root: ({ children, chatOptions, ...props }: ConversationRootProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const Root: ({ children, scrollAreaProps, withScrollButton, chatOptions, ...props }: ConversationRootProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,12 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Paper } from "@mantine/core";
3
+ import { ScrollArea } from "../../../ui/index.js";
3
4
  import { useInitChat } from "./store/index.js";
4
5
  const ChatInitializer = ({ chatOptions })=>{
5
6
  useInitChat(chatOptions);
6
7
  return null;
7
8
  };
8
- const Root = ({ children, chatOptions, ...props })=>/*#__PURE__*/ jsxs(Fragment, {
9
+ const Root = ({ children, scrollAreaProps, withScrollButton = true, chatOptions, ...props })=>/*#__PURE__*/ jsxs(Fragment, {
9
10
  children: [
10
11
  /*#__PURE__*/ jsx(ChatInitializer, {
11
12
  chatOptions: chatOptions
@@ -14,7 +15,16 @@ const Root = ({ children, chatOptions, ...props })=>/*#__PURE__*/ jsxs(Fragment,
14
15
  withBorder: true,
15
16
  radius: "md",
16
17
  ...props,
17
- children: children
18
+ children: /*#__PURE__*/ jsxs(ScrollArea, {
19
+ autoScroll: true,
20
+ scrollToBottomOnInit: true,
21
+ p: "md",
22
+ ...scrollAreaProps,
23
+ children: [
24
+ children,
25
+ withScrollButton && /*#__PURE__*/ jsx(ScrollArea.ScrollButton, {})
26
+ ]
27
+ })
18
28
  })
19
29
  ]
20
30
  });
@@ -1,10 +1,7 @@
1
1
  export declare const Chat: {
2
- Root: ({ children, chatOptions, ...props }: import("./Root").ConversationRootProps) => import("react/jsx-runtime").JSX.Element;
3
- Messages: ({ children, scrollAreaProps, withScrollButton, stackProps, }: {
2
+ Root: ({ children, scrollAreaProps, withScrollButton, chatOptions, ...props }: import("./Root").ConversationRootProps) => import("react/jsx-runtime").JSX.Element;
3
+ Messages: ({ children, ...props }: Omit<import("@mantine/core").StackProps, "children"> & {
4
4
  children: (messageId: string) => import("react").ReactNode;
5
- scrollAreaProps?: import("../../..").ScrollAreaProps;
6
- withScrollButton?: boolean;
7
- stackProps?: import("@mantine/core").StackProps;
8
5
  }) => import("react/jsx-runtime").JSX.Element;
9
6
  Message: import("react").MemoExoticComponent<({ messageId }: {
10
7
  messageId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolder/kit",
3
- "version": "3.0.0-alpha.67",
3
+ "version": "3.0.0-alpha.69",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {