listpage-next 0.0.180 → 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 };
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.180",
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",