listpage-next 0.0.63 → 0.0.65

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,3 +1,6 @@
1
- import { Fragment, jsx } from "react/jsx-runtime";
2
- const Demo8 = ()=>/*#__PURE__*/ jsx(Fragment, {});
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ChatGuidance } from "../features/ChatClient/index.js";
3
+ const Demo8 = ()=>/*#__PURE__*/ jsx(ChatGuidance, {
4
+ greetingText: "搜索海量信息,生成研究报告"
5
+ });
3
6
  export { Demo8 };
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ export interface ChatGuidanceProps {
3
+ greetingText?: string;
4
+ extra?: React.ReactNode;
5
+ value?: string;
6
+ onChange?: (value: string) => void;
7
+ onSubmit?: (value: string) => void;
8
+ style?: React.CSSProperties;
9
+ className?: string;
10
+ }
11
+ export declare const ChatGuidance: (props: ChatGuidanceProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Button, Divider, Input } from "antd";
4
+ import { useControllableValue } from "ahooks";
5
+ import { ChatInputBottom, ChatInputContent, ChatInputPanel, GreetingText } from "./styles.js";
6
+ const ChatGuidance = (props)=>{
7
+ const { greetingText, extra, style, onSubmit, className } = props;
8
+ const [value, onChange] = useControllableValue(props);
9
+ const disabled = !value;
10
+ return /*#__PURE__*/ jsxs("div", {
11
+ style: style,
12
+ className: className,
13
+ children: [
14
+ /*#__PURE__*/ jsx(GreetingText, {
15
+ children: greetingText
16
+ }),
17
+ /*#__PURE__*/ jsxs(ChatInputPanel, {
18
+ children: [
19
+ /*#__PURE__*/ jsx(ChatInputContent, {
20
+ children: /*#__PURE__*/ jsx(Input.TextArea, {
21
+ value: value,
22
+ onChange: (e)=>onChange(e.target.value),
23
+ autoSize: false
24
+ })
25
+ }),
26
+ /*#__PURE__*/ jsxs(ChatInputBottom, {
27
+ children: [
28
+ extra,
29
+ extra && /*#__PURE__*/ jsx(Divider, {
30
+ variant: "solid",
31
+ size: "large",
32
+ type: "vertical"
33
+ }),
34
+ /*#__PURE__*/ jsx(Button, {
35
+ type: "primary",
36
+ onClick: ()=>onSubmit?.(value),
37
+ disabled: disabled,
38
+ children: "发送"
39
+ })
40
+ ]
41
+ })
42
+ ]
43
+ })
44
+ ]
45
+ });
46
+ };
47
+ export { ChatGuidance };
@@ -0,0 +1,5 @@
1
+ export declare const GreetingText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const ChatInputPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const ChatInputContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
+ export declare const SkillTag: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("antd").TagProps & import("react").RefAttributes<HTMLSpanElement>, never>> & string & Omit<import("antd").TagType, keyof import("react").Component<any, {}, any>>;
5
+ export declare const ChatInputBottom: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,73 @@
1
+ import { Tag } from "antd";
2
+ import styled_components from "styled-components";
3
+ const GreetingText = styled_components.div`
4
+ font-size: 32px;
5
+ margin-bottom: 32px;
6
+ min-height: 45px;
7
+
8
+ font-family: Montserrat;
9
+ position: relative;
10
+
11
+ color: #000000d9;
12
+ font-weight: 600;
13
+
14
+ margin-bottom: 32px;
15
+ text-align: center;
16
+ `;
17
+ const ChatInputPanel = styled_components.div`
18
+ position: relative;
19
+ max-height: 300px;
20
+ min-height: 140px;
21
+ padding: 12px;
22
+ border-radius: 20px;
23
+ border: 1px solid rgb(107, 164, 238);
24
+ box-shadow: 0 0 20px 0 #c8efff80;
25
+ gap: 12px;
26
+
27
+ bottom-height: 36px;
28
+ display: flex;
29
+ flex-direction: column;
30
+ `;
31
+ const ChatInputContent = styled_components.div`
32
+ outline: none;
33
+ border: none;
34
+ flex-grow: 1;
35
+ max-height: 220px;
36
+ flex-shrink: 1;
37
+ overflow: auto;
38
+ &:focus-visible {
39
+ outline: none;
40
+ }
41
+
42
+ .ant-input {
43
+ border: none;
44
+ outline: none;
45
+ &:hover {
46
+ border: none;
47
+ outline: none;
48
+ box-shadow: none;
49
+ }
50
+ min-height: 100px;
51
+ max-height: 220px;
52
+ resize: none;
53
+
54
+ background-color: transparent;
55
+ }
56
+ `;
57
+ const SkillTag = styled_components(Tag)`
58
+ color: #0057ff;
59
+ margin-right: 4px;
60
+ padding: 2px 8px;
61
+ font-weight: 600;
62
+ line-height: 150%;
63
+
64
+ cursor: pointer;
65
+ `;
66
+ const ChatInputBottom = styled_components.div`
67
+ display: flex;
68
+ justify-content: flex-end;
69
+ align-items: center;
70
+
71
+ flex-shrink: 0;
72
+ `;
73
+ export { ChatInputBottom, ChatInputContent, ChatInputPanel, GreetingText, SkillTag };
@@ -1 +1,2 @@
1
1
  export * from './components/Layout';
2
+ export * from './components/ChatGuidance';
@@ -1 +1,2 @@
1
1
  export * from "./components/Layout/index.js";
2
+ export * from "./components/ChatGuidance/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.63",
3
+ "version": "0.0.65",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",