x-ui-design 0.2.8 → 0.2.9
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.
- package/dist/esm/types/components/Checkbox/Checkbox.client.d.ts +23 -0
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +7 -0
- package/dist/esm/types/components/Checkbox/index.d.ts +1 -0
- package/dist/esm/types/types/checkbox.d.ts +22 -0
- package/{src/components/Checkbox/Checkbox.tsx → lib/components/Checkbox/Checkbox.client.tsx} +4 -5
- package/lib/components/Checkbox/Checkbox.tsx +59 -0
- package/{src → lib}/types/checkbox.ts +1 -1
- package/package.json +1 -1
- package/src/app/page.tsx +2 -0
- /package/{src → lib}/components/Checkbox/index.ts +0 -0
- /package/{src → lib}/components/Checkbox/style.css +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import './style.css';
|
|
3
|
+
declare const CheckboxClient: import("react").ForwardRefExoticComponent<import("../../types").DefaultProps & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onChange?: (e: MouseEvent<HTMLInputElement> & import("../../types").TargetProps) => void;
|
|
6
|
+
onClick?: import("react").MouseEventHandler<HTMLElement>;
|
|
7
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLElement>;
|
|
8
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLElement>;
|
|
9
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement>;
|
|
10
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement>;
|
|
11
|
+
value?: boolean;
|
|
12
|
+
tabIndex?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
children?: import("react").ReactNode;
|
|
15
|
+
id?: string;
|
|
16
|
+
autoFocus?: boolean;
|
|
17
|
+
type?: string;
|
|
18
|
+
skipGroup?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
checked?: boolean;
|
|
22
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export default CheckboxClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { CheckboxProps } from '../../types/checkbox';
|
|
3
|
+
declare const Checkbox: {
|
|
4
|
+
({ prefixCls, className, defaultChecked, checked, style, disabled, onChange, onClick, onMouseEnter, onMouseLeave, onKeyPress, onKeyDown, tabIndex, name, children, id, autoFocus, type, value, required, noStyle }: CheckboxProps): ReactElement;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default Checkbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Checkbox } from '@/components/Checkbox/Checkbox';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { KeyboardEventHandler, MouseEvent, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { DefaultProps, TargetProps } from '.';
|
|
3
|
+
export type CheckboxProps = DefaultProps & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onChange?: (e: MouseEvent<HTMLInputElement> & TargetProps) => void;
|
|
6
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
7
|
+
onMouseEnter?: MouseEventHandler<HTMLElement>;
|
|
8
|
+
onMouseLeave?: MouseEventHandler<HTMLElement>;
|
|
9
|
+
onKeyPress?: KeyboardEventHandler<HTMLElement>;
|
|
10
|
+
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
|
11
|
+
value?: boolean;
|
|
12
|
+
tabIndex?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
id?: string;
|
|
16
|
+
autoFocus?: boolean;
|
|
17
|
+
type?: string;
|
|
18
|
+
skipGroup?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
checked?: boolean;
|
|
22
|
+
};
|
package/{src/components/Checkbox/Checkbox.tsx → lib/components/Checkbox/Checkbox.client.tsx}
RENAMED
|
@@ -11,13 +11,12 @@ import {
|
|
|
11
11
|
import { clsx } from '../../../lib/helpers';
|
|
12
12
|
import { SyntheticBaseEvent } from '../../types';
|
|
13
13
|
import { CheckboxProps } from '../../types/checkbox';
|
|
14
|
-
import { prefixClsCheckbox } from '../../../lib/utils';
|
|
15
14
|
import './style.css';
|
|
16
15
|
|
|
17
|
-
const
|
|
16
|
+
const CheckboxClient = forwardRef<HTMLDivElement, CheckboxProps>(
|
|
18
17
|
(
|
|
19
18
|
{
|
|
20
|
-
prefixCls
|
|
19
|
+
prefixCls,
|
|
21
20
|
className = '',
|
|
22
21
|
defaultChecked = false,
|
|
23
22
|
checked,
|
|
@@ -110,6 +109,6 @@ const Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(
|
|
|
110
109
|
}
|
|
111
110
|
);
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
CheckboxClient.displayName = 'CheckboxClient';
|
|
114
113
|
|
|
115
|
-
export default
|
|
114
|
+
export default CheckboxClient;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { CheckboxProps } from '../../types/checkbox';
|
|
3
|
+
import { prefixClsCheckbox } from '../../../lib/utils';
|
|
4
|
+
import CheckboxClient from './Checkbox.client';
|
|
5
|
+
|
|
6
|
+
const Checkbox = ({
|
|
7
|
+
prefixCls = prefixClsCheckbox,
|
|
8
|
+
className = '',
|
|
9
|
+
defaultChecked = false,
|
|
10
|
+
checked,
|
|
11
|
+
style,
|
|
12
|
+
disabled = false,
|
|
13
|
+
onChange,
|
|
14
|
+
onClick,
|
|
15
|
+
onMouseEnter,
|
|
16
|
+
onMouseLeave,
|
|
17
|
+
onKeyPress,
|
|
18
|
+
onKeyDown,
|
|
19
|
+
tabIndex,
|
|
20
|
+
name,
|
|
21
|
+
children,
|
|
22
|
+
id,
|
|
23
|
+
autoFocus,
|
|
24
|
+
type = 'checkbox',
|
|
25
|
+
value = false,
|
|
26
|
+
required = false,
|
|
27
|
+
noStyle
|
|
28
|
+
}: CheckboxProps): ReactElement => {
|
|
29
|
+
return (
|
|
30
|
+
<CheckboxClient
|
|
31
|
+
prefixCls={prefixCls}
|
|
32
|
+
className={className}
|
|
33
|
+
defaultChecked={defaultChecked}
|
|
34
|
+
checked={checked}
|
|
35
|
+
style={style}
|
|
36
|
+
disabled={disabled}
|
|
37
|
+
onChange={onChange}
|
|
38
|
+
onClick={onClick}
|
|
39
|
+
onMouseEnter={onMouseEnter}
|
|
40
|
+
onMouseLeave={onMouseLeave}
|
|
41
|
+
onKeyPress={onKeyPress}
|
|
42
|
+
onKeyDown={onKeyDown}
|
|
43
|
+
tabIndex={tabIndex}
|
|
44
|
+
name={name}
|
|
45
|
+
id={id}
|
|
46
|
+
autoFocus={autoFocus}
|
|
47
|
+
type={type}
|
|
48
|
+
value={value}
|
|
49
|
+
required={required}
|
|
50
|
+
noStyle={noStyle}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
</CheckboxClient>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
Checkbox.displayName = 'Checkbox';
|
|
58
|
+
|
|
59
|
+
export default Checkbox;
|
package/package.json
CHANGED
package/src/app/page.tsx
CHANGED
|
File without changes
|
|
File without changes
|