listpage-next 0.0.158 → 0.0.160

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,24 @@
1
+ import { CardProps } from 'antd';
2
+ import type { ReactNode } from 'react';
3
+ export interface ChatSplitterProps {
4
+ pure?: boolean;
5
+ left: {
6
+ title?: string;
7
+ extra?: ReactNode;
8
+ body: ReactNode;
9
+ };
10
+ right: {
11
+ title?: string;
12
+ extra?: ReactNode;
13
+ body: ReactNode;
14
+ };
15
+ size?: {
16
+ default?: string;
17
+ min?: string;
18
+ max?: string;
19
+ };
20
+ }
21
+ export declare const ChatSplitter: (props: ChatSplitterProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const SplitterPanelCard: ({ pure, ...props }: CardProps & {
23
+ pure?: boolean;
24
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,81 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Card, Splitter } from "antd";
3
+ import styled_components from "styled-components";
4
+ const ChatSplitter = (props)=>{
5
+ const { pure, left, right, size } = props;
6
+ const defaultSize = size?.default || '70%';
7
+ const maxSize = size?.max || '80%';
8
+ const minSize = size?.min || '60%';
9
+ return /*#__PURE__*/ jsxs(StyledSplitter, {
10
+ children: [
11
+ /*#__PURE__*/ jsx(Splitter.Panel, {
12
+ size: defaultSize,
13
+ min: minSize,
14
+ max: maxSize,
15
+ resizable: !pure,
16
+ style: panelStyle,
17
+ children: /*#__PURE__*/ jsx(SplitterPanelCard, {
18
+ pure: !pure,
19
+ title: left.title,
20
+ extra: left.extra,
21
+ children: left.body
22
+ })
23
+ }),
24
+ /*#__PURE__*/ jsx(Splitter.Panel, {
25
+ style: panelStyle,
26
+ children: /*#__PURE__*/ jsx(SplitterPanelCard, {
27
+ title: right.title,
28
+ extra: right.extra,
29
+ children: right.body
30
+ })
31
+ })
32
+ ]
33
+ });
34
+ };
35
+ const StyledSplitter = styled_components(Splitter)`
36
+ height: 100%;
37
+ background: rgb(240, 240, 240);
38
+
39
+ .ant-splitter-bar-dragger::before {
40
+ background: transparent !important;
41
+ }
42
+ `;
43
+ const panelStyle = {
44
+ padding: 4
45
+ };
46
+ const SplitterPanelCard = ({ pure, ...props })=>{
47
+ const pureCardProps = pure ? {
48
+ ...props,
49
+ styles: {
50
+ body: {
51
+ padding: 0
52
+ }
53
+ },
54
+ title: void 0,
55
+ extra: void 0,
56
+ style: {
57
+ border: 'none',
58
+ background: 'transparent'
59
+ }
60
+ } : void 0;
61
+ return /*#__PURE__*/ jsx(Card, {
62
+ styles: {
63
+ body: {
64
+ height: 'calc(100% - 38px)',
65
+ overflow: 'auto'
66
+ },
67
+ header: {
68
+ background: 'rgba(0, 0, 0, 0.02)'
69
+ }
70
+ },
71
+ style: {
72
+ height: '100%'
73
+ },
74
+ size: "small",
75
+ title: props.title,
76
+ extra: props.extra,
77
+ ...pureCardProps,
78
+ children: props.children
79
+ });
80
+ };
81
+ export { ChatSplitter, SplitterPanelCard };
@@ -4,6 +4,7 @@ export * from './components/ChatContent';
4
4
  export * from './components/Bubble';
5
5
  export { SimplifyChatPage, type SimplifyChatPageProps, } from './components/ChatPage/SimplifyChatPage';
6
6
  export * from './components/ChatDialog';
7
+ export * from './components/ChatSplitter';
7
8
  export { useChatContext } from './context/useChatContext';
8
9
  export * from './context/types';
9
10
  export * from './utils/parseSse';
@@ -5,6 +5,7 @@ export * from "./components/ChatGuidance/index.js";
5
5
  export * from "./components/ChatContent/index.js";
6
6
  export * from "./components/Bubble/index.js";
7
7
  export * from "./components/ChatDialog/index.js";
8
+ export * from "./components/ChatSplitter/index.js";
8
9
  export * from "./context/types.js";
9
10
  export * from "./utils/parseSse.js";
10
11
  export { SimplifyChatPage, useChatContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.158",
3
+ "version": "0.0.160",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",