listpage-next 0.0.179 → 0.0.181

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,8 @@
1
+ import { ReactNode } from 'react';
2
+ export interface CheckButtonProps {
3
+ icon?: ReactNode;
4
+ children: ReactNode;
5
+ value?: boolean;
6
+ onChange?: (value: boolean) => void;
7
+ }
8
+ export declare const CheckButton: (props: CheckButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsxs } from "react/jsx-runtime";
2
+ import { useControllableValue } from "ahooks";
3
+ import { styled } from "styled-components";
4
+ const CheckButton = (props)=>{
5
+ const { children, icon } = props;
6
+ const [checked, setChecked] = useControllableValue(props);
7
+ return /*#__PURE__*/ jsxs(CheckButtonContainer, {
8
+ checked: checked ?? false,
9
+ onClick: ()=>setChecked(!checked),
10
+ children: [
11
+ icon,
12
+ children
13
+ ]
14
+ });
15
+ };
16
+ const CheckButtonContainer = styled.div`
17
+ border: 1px solid #000;
18
+ padding: 10px 12px;
19
+ height: 36px;
20
+ min-width: 73px;
21
+ background: #fff;
22
+ border: 1px solid #00000014;
23
+ color: #000000d9;
24
+ border-radius: 10px;
25
+
26
+ display: flex;
27
+ align-items: center;
28
+ gap: 4px;
29
+
30
+ user-select: none;
31
+ cursor: pointer;
32
+
33
+ font-weight: 500;
34
+
35
+ &:hover {
36
+ background: #0000000a;
37
+ }
38
+
39
+ ${({ checked })=>checked && `
40
+ background: rgb(229, 238, 255) !important;
41
+ color: rgb(0, 87, 255);
42
+ font-weight: 400;
43
+ `}
44
+ `;
45
+ export { CheckButton };
@@ -1,7 +1,9 @@
1
- import { RefObject } from "react";
2
- import { BaseMessageInfo, ChatRender, ChatRequest } from "../../context";
3
- import { ChatInstance } from "../../context/useChatContext";
1
+ import { RefObject } from 'react';
2
+ import { BaseMessageInfo, ChatRender, ChatRequest } from '../../context';
3
+ import { ChatInstance } from '../../context/useChatContext';
4
+ import { ChatSenderProps } from '../ChatSender';
4
5
  export interface SimplifyChatPageProps<SessionData = any, MessageInfo extends BaseMessageInfo = any> {
6
+ senderProps?: ChatSenderProps;
5
7
  request: ChatRequest<SessionData, MessageInfo>;
6
8
  render: ChatRender<MessageInfo>;
7
9
  style?: React.CSSProperties;
@@ -4,12 +4,13 @@ import { ChatClientProvider, MessageProvider } from "../../context/index.js";
4
4
  import { useChatContext } from "../../context/useChatContext.js";
5
5
  import { SimplifyClientContentBody } from "../ChatContent/ClientContentBody.js";
6
6
  const SimplifyChatPageComponent = (props)=>{
7
- const { chatRef } = props;
7
+ const { chatRef, senderProps } = props;
8
8
  const context = useChatContext();
9
9
  useImperativeHandle(chatRef, ()=>context, [
10
10
  context
11
11
  ]);
12
12
  return /*#__PURE__*/ jsx(SimplifyClientContentBody, {
13
+ senderProps: senderProps,
13
14
  style: props.style
14
15
  });
15
16
  };
@@ -1,7 +1,3 @@
1
- export interface ChatSenderProps {
2
- extra?: React.ReactNode;
3
- placeholder?: string;
4
- style?: React.CSSProperties;
5
- className?: string;
6
- }
1
+ import { ChatInputProps } from '../../ui';
2
+ export type ChatSenderProps = Omit<ChatInputProps, 'onSubmit' | 'loading'>;
7
3
  export declare const ChatSender: (props: ChatSenderProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,10 @@ import { CSSProperties, ReactNode } from 'react';
2
2
  export interface ChatInputProps {
3
3
  loading?: boolean;
4
4
  onSubmit?: (message: string) => void;
5
- skills?: any[];
5
+ skills?: {
6
+ label: string;
7
+ value: string;
8
+ }[];
6
9
  style?: CSSProperties;
7
10
  className?: string;
8
11
  placeholder?: string;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './components/AsyncSelect';
7
7
  export * from './components/AsyncButton';
8
8
  export * from './components/TextOverflow';
9
9
  export * from './components/PageLayout';
10
+ export * from './components/CheckButton';
10
11
  export * from './features/JsonEditor';
11
12
  export * from './features/ChatClient';
12
13
  export * from './features/ListPage';
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export * from "./components/AsyncSelect/index.js";
7
7
  export * from "./components/AsyncButton/index.js";
8
8
  export * from "./components/TextOverflow/index.js";
9
9
  export * from "./components/PageLayout/index.js";
10
+ export * from "./components/CheckButton/index.js";
10
11
  export * from "./features/JsonEditor/index.js";
11
12
  export * from "./features/ChatClient/index.js";
12
13
  export * from "./features/ListPage/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.179",
3
+ "version": "0.0.181",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",