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.
@@ -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
+ };
@@ -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 Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(
16
+ const CheckboxClient = forwardRef<HTMLDivElement, CheckboxProps>(
18
17
  (
19
18
  {
20
- prefixCls = prefixClsCheckbox,
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
- Checkbox.displayName = 'Checkbox';
112
+ CheckboxClient.displayName = 'CheckboxClient';
114
113
 
115
- export default Checkbox;
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;
@@ -4,7 +4,7 @@ import {
4
4
  MouseEventHandler,
5
5
  ReactNode
6
6
  } from 'react';
7
- import { DefaultProps, TargetProps } from '../../lib/types';
7
+ import { DefaultProps, TargetProps } from '.';
8
8
 
9
9
  export type CheckboxProps = DefaultProps & {
10
10
  disabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-ui-design",
3
- "version": "0.2.08",
3
+ "version": "0.2.09",
4
4
  "license": "ISC",
5
5
  "author": "Gabriel Boyajyan",
6
6
  "main": "dist/index.js",
package/src/app/page.tsx CHANGED
@@ -1,11 +1,13 @@
1
1
  'use client'
2
2
 
3
3
  import { Button } from "../../lib/components/Button"
4
+ import { Checkbox } from "../../lib/components/Checkbox"
4
5
 
5
6
  export default function Home() {
6
7
  return (
7
8
  <>
8
9
  <Button>Button</Button>
10
+ <Checkbox />
9
11
  </>
10
12
  )
11
13
  }
File without changes
File without changes