x-ui-design 0.2.26 → 0.2.28

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,7 +1,22 @@
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
- };
1
+ import React from 'react';
2
+ declare const Checkbox: React.ForwardRefExoticComponent<import("../../types").DefaultProps & {
3
+ disabled?: boolean;
4
+ onChange?: (e: React.MouseEvent<HTMLInputElement> & import("../../types").TargetProps) => void;
5
+ onClick?: React.MouseEventHandler<HTMLElement>;
6
+ onMouseEnter?: React.MouseEventHandler<HTMLElement>;
7
+ onMouseLeave?: React.MouseEventHandler<HTMLElement>;
8
+ onKeyPress?: React.KeyboardEventHandler<HTMLElement>;
9
+ onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
10
+ value?: boolean;
11
+ tabIndex?: number;
12
+ name?: string;
13
+ children?: React.ReactNode;
14
+ id?: string;
15
+ autoFocus?: boolean;
16
+ type?: string;
17
+ skipGroup?: boolean;
18
+ required?: boolean;
19
+ defaultChecked?: boolean;
20
+ checked?: boolean;
21
+ } & React.RefAttributes<HTMLDivElement>>;
7
22
  export default Checkbox;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { EmptyContentProps } from '../../types/empty';
2
+ import { EmptyProps } from '../../types/empty';
3
3
  import './style.css';
4
- declare const EmptyClient: ({ icon, style, className, title, description, prefixCls }: EmptyContentProps) => React.JSX.Element;
4
+ declare const EmptyClient: (props: EmptyProps) => React.JSX.Element;
5
5
  export default EmptyClient;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
- import { EmptyContentProps } from '../../types/empty';
3
- declare const Empty: ({ icon, style, className, title, description, prefixCls }: EmptyContentProps) => React.JSX.Element;
2
+ import { EmptyProps } from '../../types/empty';
3
+ import './style.css';
4
+ declare const Empty: ({ icon, style, className, title, description, prefixCls }: EmptyProps) => React.JSX.Element;
4
5
  export default Empty;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DefaultProps } from '.';
3
- export type EmptyContentProps = DefaultProps & {
3
+ export type EmptyProps = DefaultProps & {
4
4
  title?: string;
5
5
  description?: string;
6
6
  icon?: ReactNode;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React, { CSSProperties, ReactNode, ButtonHTMLAttributes, ReactElement, MouseEvent, MouseEventHandler, KeyboardEventHandler } from 'react';
1
+ import React, { CSSProperties, ReactNode, ButtonHTMLAttributes, ReactElement } from 'react';
2
2
 
3
3
  type RuleType = any;
4
4
  interface DefaultProps {
@@ -13,13 +13,13 @@ type TargetProps = {
13
13
  };
14
14
  };
15
15
 
16
- type EmptyContentProps = DefaultProps & {
16
+ type EmptyProps = DefaultProps & {
17
17
  title?: string;
18
18
  description?: string;
19
19
  icon?: ReactNode;
20
20
  };
21
21
 
22
- declare const Empty: ({ icon, style, className, title, description, prefixCls }: EmptyContentProps) => React.JSX.Element;
22
+ declare const Empty: ({ icon, style, className, title, description, prefixCls }: EmptyProps) => React.JSX.Element;
23
23
 
24
24
  declare const ButtonTypes: readonly ["default", "primary", "dashed", "link", "text", "ghost"];
25
25
  declare const ButtonShapes: readonly ["default", "circle", "round"];
@@ -68,18 +68,18 @@ declare const Button: ({ type, variant, color, shape, size, htmlType, className,
68
68
  isLoading?: boolean;
69
69
  }) => ReactElement;
70
70
 
71
- type CheckboxProps = DefaultProps & {
71
+ declare const Checkbox: React.ForwardRefExoticComponent<DefaultProps & {
72
72
  disabled?: boolean;
73
- onChange?: (e: MouseEvent<HTMLInputElement> & TargetProps) => void;
74
- onClick?: MouseEventHandler<HTMLElement>;
75
- onMouseEnter?: MouseEventHandler<HTMLElement>;
76
- onMouseLeave?: MouseEventHandler<HTMLElement>;
77
- onKeyPress?: KeyboardEventHandler<HTMLElement>;
78
- onKeyDown?: KeyboardEventHandler<HTMLElement>;
73
+ onChange?: (e: React.MouseEvent<HTMLInputElement> & TargetProps) => void;
74
+ onClick?: React.MouseEventHandler<HTMLElement>;
75
+ onMouseEnter?: React.MouseEventHandler<HTMLElement>;
76
+ onMouseLeave?: React.MouseEventHandler<HTMLElement>;
77
+ onKeyPress?: React.KeyboardEventHandler<HTMLElement>;
78
+ onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
79
79
  value?: boolean;
80
80
  tabIndex?: number;
81
81
  name?: string;
82
- children?: ReactNode;
82
+ children?: React.ReactNode;
83
83
  id?: string;
84
84
  autoFocus?: boolean;
85
85
  type?: string;
@@ -87,11 +87,6 @@ type CheckboxProps = DefaultProps & {
87
87
  required?: boolean;
88
88
  defaultChecked?: boolean;
89
89
  checked?: boolean;
90
- };
91
-
92
- declare const Checkbox: {
93
- ({ prefixCls, className, defaultChecked, checked, style, disabled, onChange, onClick, onMouseEnter, onMouseLeave, onKeyPress, onKeyDown, tabIndex, name, children, id, autoFocus, type, value, required, noStyle }: CheckboxProps): ReactElement;
94
- displayName: string;
95
- };
90
+ } & React.RefAttributes<HTMLDivElement>>;
96
91
 
97
92
  export { Button, Checkbox, Empty };
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useEffect, forwardRef, useState } from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
 
3
3
  function styleInject(css, ref) {
4
4
  if (ref === void 0) ref = {};
@@ -25,55 +25,14 @@ function styleInject(css, ref) {
25
25
  }
26
26
  }
27
27
 
28
- var css_248z$3 = ":root{--xui-color-hover:#f5f5f5;--xui-color-disabled:#e6e6e6;--xui-primary-color:#1677ff;--xui-primary-color-light:#40a9ff;--xui-text-color:rgba(0,0,0,.88);--xui-text-color-light:rgba(0,0,0,.5);--xui-error-color:#ff4d4f;--xui-error-color-light:#ff6668;--xui-success-color:#52c41a;--xui-background-color:#fff;--xui-font-size-xs:12px;--xui-font-size-sm:14px;--xui-font-size-md:14px;--xui-font-size-lg:16px;--xui-border-radius-sm:4px;--xui-border-radius-md:4px;--xui-border-radius-lg:6px;--xui-border-color:#d9d9d9;--xui-select-primary-color:var(--xui-primary-color);--xui-select-background-color:var(--xui-background-color)}html{font-family:sans-serif}.globalEllipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
29
- styleInject(css_248z$3);
28
+ var css_248z$2 = ":root{--xui-color-hover:#f5f5f5;--xui-color-disabled:#e6e6e6;--xui-primary-color:#1677ff;--xui-primary-color-light:#40a9ff;--xui-text-color:rgba(0,0,0,.88);--xui-text-color-light:rgba(0,0,0,.5);--xui-error-color:#ff4d4f;--xui-error-color-light:#ff6668;--xui-success-color:#52c41a;--xui-background-color:#fff;--xui-font-size-xs:12px;--xui-font-size-sm:14px;--xui-font-size-md:14px;--xui-font-size-lg:16px;--xui-border-radius-sm:4px;--xui-border-radius-md:4px;--xui-border-radius-lg:6px;--xui-border-color:#d9d9d9;--xui-select-primary-color:var(--xui-primary-color);--xui-select-background-color:var(--xui-background-color)}html{font-family:sans-serif}.globalEllipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
29
+ styleInject(css_248z$2);
30
30
 
31
31
  const prefixClsEmpty = 'xUi-empty';
32
- const prefixClsCheckbox = 'xUi-checkbox';
33
32
  const prefixClsButton = 'xUi-button';
34
33
 
35
- var css_248z$2 = ".xUi-empty{align-items:center;display:grid;gap:4px;justify-content:center;padding:14px}.xUi-empty-description{color:var(--xui-text-color);font-size:var(--xui-font-size-md);text-align:center}";
36
- styleInject(css_248z$2);
37
-
38
- const EmptyClient = ({
39
- icon,
40
- style = {},
41
- className = '',
42
- title = 'No Data',
43
- description = 'No data',
44
- prefixCls = prefixClsEmpty
45
- }) => {
46
- useEffect(() => {}, []);
47
- return /*#__PURE__*/React.createElement("div", {
48
- style: style,
49
- className: `${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`
50
- }, /*#__PURE__*/React.createElement("div", {
51
- className: `${prefixCls}-image`
52
- }, icon || /*#__PURE__*/React.createElement("svg", {
53
- width: "64",
54
- height: "41",
55
- viewBox: "0 0 64 41",
56
- xmlns: "http://www.w3.org/2000/svg"
57
- }, /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("g", {
58
- transform: "translate(0 1)",
59
- fill: "none"
60
- }, /*#__PURE__*/React.createElement("ellipse", {
61
- fill: "#f5f5f5",
62
- cx: "32",
63
- cy: "33",
64
- rx: "32",
65
- ry: "7"
66
- }), /*#__PURE__*/React.createElement("g", {
67
- stroke: "#d9d9d9"
68
- }, /*#__PURE__*/React.createElement("path", {
69
- d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
70
- }), /*#__PURE__*/React.createElement("path", {
71
- d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
72
- fill: "#fafafa"
73
- }))))), /*#__PURE__*/React.createElement("div", {
74
- className: `${prefixCls}-description`
75
- }, description));
76
- };
34
+ var css_248z$1 = ".xUi-empty{align-items:center;display:grid;gap:4px;justify-content:center;padding:14px}.xUi-empty-description{color:var(--xui-text-color);font-size:var(--xui-font-size-md);text-align:center}";
35
+ styleInject(css_248z$1);
77
36
 
78
37
  const Empty = ({
79
38
  icon,
@@ -82,16 +41,35 @@ const Empty = ({
82
41
  title = 'No Data',
83
42
  description = 'No data',
84
43
  prefixCls = prefixClsEmpty
85
- }) => {
86
- return /*#__PURE__*/React.createElement(EmptyClient, {
87
- icon: icon,
88
- style: style,
89
- className: className,
90
- title: title,
91
- description: description,
92
- prefixCls: prefixCls
93
- });
94
- };
44
+ }) => /*#__PURE__*/React.createElement("div", {
45
+ style: style,
46
+ className: `${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`
47
+ }, /*#__PURE__*/React.createElement("div", {
48
+ className: `${prefixCls}-image`
49
+ }, icon || /*#__PURE__*/React.createElement("svg", {
50
+ width: "64",
51
+ height: "41",
52
+ viewBox: "0 0 64 41",
53
+ xmlns: "http://www.w3.org/2000/svg"
54
+ }, /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("g", {
55
+ transform: "translate(0 1)",
56
+ fill: "none"
57
+ }, /*#__PURE__*/React.createElement("ellipse", {
58
+ fill: "#f5f5f5",
59
+ cx: "32",
60
+ cy: "33",
61
+ rx: "32",
62
+ ry: "7"
63
+ }), /*#__PURE__*/React.createElement("g", {
64
+ stroke: "#d9d9d9"
65
+ }, /*#__PURE__*/React.createElement("path", {
66
+ d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
67
+ }), /*#__PURE__*/React.createElement("path", {
68
+ d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
69
+ fill: "#fafafa"
70
+ }))))), /*#__PURE__*/React.createElement("div", {
71
+ className: `${prefixCls}-description`
72
+ }, description));
95
73
 
96
74
  function _extends() {
97
75
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
@@ -124,8 +102,8 @@ function clsx(...args) {
124
102
  }).filter(Boolean).join(' ');
125
103
  }
126
104
 
127
- var css_248z$1 = ".xUi-button{border:1px solid transparent;border-radius:6px;cursor:pointer;font-weight:400;line-height:1.5715;transition:all .3s ease;user-select:none;vertical-align:middle;white-space:nowrap}.xUi-button,.xUi-button-content,.xUi-button-icon{align-items:center;display:inline-flex;justify-content:center}.xUi-button-icon{line-height:0;margin-right:.5em}.xUi-button-icon:last-child{margin-left:.5em;margin-right:0}.xUi-button-spinner{animation:xUi-spin 1s linear infinite;border:1px solid transparent;border-radius:50%;border-top:1px solid var(--xui-text-color);height:1em;width:1em}@keyframes xUi-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.xUi-button-size-small{font-size:12px;height:24px;padding:4px 12px}.xUi-button-size-middle{font-size:14px;height:32px;padding:0 16px}.xUi-button-size-large{font-size:16px;height:40px;padding:8px 20px}.xUi-button-circle{border-radius:50%;justify-content:center;padding:0}.xUi-button-circle.xUi-button-size-small{height:24px;width:24px}.xUi-button-circle.xUi-button-size-large{height:40px;width:40px}.xUi-button-round{border-radius:9999px}.xUi-button-default{background-color:#fff;border-color:var(--xui-border-color);color:rgba(0,0,0,.85)}.xUi-button-default:hover{border-color:var(--xui-primary-color);color:var(--xui-primary-color)}.xUi-button-primary{background-color:var(--xui-primary-color);border-color:var(--xui-primary-color);color:#fff}.xUi-button-primary:hover{background-color:var(--xui-primary-color-light);border-color:var(--xui-primary-color-light);color:#fff}.xUi-button-dashed{background-color:#fff;border-color:var(--xui-border-color);border-style:dashed;color:rgba(0,0,0,.85)}.xUi-button-dashed:hover{border-color:var(--xui-primary-color);color:var(--xui-primary-color)}.xUi-button-text{background-color:transparent;border-color:transparent!important;color:rgba(0,0,0,.88)}.xUi-button-text:hover{background-color:rgba(0,0,0,.04);border-color:transparent;color:rgba(0,0,0,.88)}.xUi-button-link{background-color:transparent;border-color:transparent!important;color:var(--xui-primary-color)}.xUi-button-link:hover{border-color:transparent;color:var(--xui-primary-color-light)}.xUi-button-outlined{color:#fff}.xUi-button-filled,.xUi-button-outlined{background-color:transparent;border-color:var(--xui-border-color)}.xUi-button-filled{color:var(--xui-text-color)}.xUi-button-danger{background-color:transparent;border-color:var(--xui-error-color);color:var(--xui-error-color)}.xUi-button-danger:hover{border-color:var(--xui-error-color-light);color:var(--xui-error-color-light)}.xUi-button-ghost{opacity:0}.xUi-button-ghost:hover{opacity:1}.xUi-button-block{display:flex;width:100%}.xUi-button-disabled,.xUi-button-loading{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color);color:var(--xui-text-color);cursor:not-allowed;opacity:.5;pointer-events:none}.xUi-button-loading{background-color:transparent}";
128
- styleInject(css_248z$1);
105
+ var css_248z = ".xUi-button{border:1px solid transparent;border-radius:6px;cursor:pointer;font-weight:400;line-height:1.5715;transition:all .3s ease;user-select:none;vertical-align:middle;white-space:nowrap}.xUi-button,.xUi-button-content,.xUi-button-icon{align-items:center;display:inline-flex;justify-content:center}.xUi-button-icon{line-height:0;margin-right:.5em}.xUi-button-icon:last-child{margin-left:.5em;margin-right:0}.xUi-button-spinner{animation:xUi-spin 1s linear infinite;border:1px solid transparent;border-radius:50%;border-top:1px solid var(--xui-text-color);height:1em;width:1em}@keyframes xUi-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.xUi-button-size-small{font-size:12px;height:24px;padding:4px 12px}.xUi-button-size-middle{font-size:14px;height:32px;padding:0 16px}.xUi-button-size-large{font-size:16px;height:40px;padding:8px 20px}.xUi-button-circle{border-radius:50%;justify-content:center;padding:0}.xUi-button-circle.xUi-button-size-small{height:24px;width:24px}.xUi-button-circle.xUi-button-size-large{height:40px;width:40px}.xUi-button-round{border-radius:9999px}.xUi-button-default{background-color:#fff;border-color:var(--xui-border-color);color:rgba(0,0,0,.85)}.xUi-button-default:hover{border-color:var(--xui-primary-color);color:var(--xui-primary-color)}.xUi-button-primary{background-color:var(--xui-primary-color);border-color:var(--xui-primary-color);color:#fff}.xUi-button-primary:hover{background-color:var(--xui-primary-color-light);border-color:var(--xui-primary-color-light);color:#fff}.xUi-button-dashed{background-color:#fff;border-color:var(--xui-border-color);border-style:dashed;color:rgba(0,0,0,.85)}.xUi-button-dashed:hover{border-color:var(--xui-primary-color);color:var(--xui-primary-color)}.xUi-button-text{background-color:transparent;border-color:transparent!important;color:rgba(0,0,0,.88)}.xUi-button-text:hover{background-color:rgba(0,0,0,.04);border-color:transparent;color:rgba(0,0,0,.88)}.xUi-button-link{background-color:transparent;border-color:transparent!important;color:var(--xui-primary-color)}.xUi-button-link:hover{border-color:transparent;color:var(--xui-primary-color-light)}.xUi-button-outlined{color:#fff}.xUi-button-filled,.xUi-button-outlined{background-color:transparent;border-color:var(--xui-border-color)}.xUi-button-filled{color:var(--xui-text-color)}.xUi-button-danger{background-color:transparent;border-color:var(--xui-error-color);color:var(--xui-error-color)}.xUi-button-danger:hover{border-color:var(--xui-error-color-light);color:var(--xui-error-color-light)}.xUi-button-ghost{opacity:0}.xUi-button-ghost:hover{opacity:1}.xUi-button-block{display:flex;width:100%}.xUi-button-disabled,.xUi-button-loading{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color);color:var(--xui-text-color);cursor:not-allowed;opacity:.5;pointer-events:none}.xUi-button-loading{background-color:transparent}";
106
+ styleInject(css_248z);
129
107
 
130
108
  const Button = ({
131
109
  type = 'default',
@@ -181,17 +159,11 @@ const Button = ({
181
159
  }, restProps), content);
182
160
  };
183
161
 
184
- var css_248z = ".xUi-checkbox-wrapper{align-items:center;color:var(--xui-main-color);cursor:pointer;display:inline-flex;font-size:var(--xui-font-size-md);margin:16px 0}.xUi-checkbox{background-color:transparent;border:1px solid var(--xui-border-color);border-radius:var(--xui-border-radius-sm);display:inline-block;height:14px;position:relative;transition:all .3s;width:14px}.xUi-checkbox.xUi-checkbox-checked{background-color:#f0f5ff;border-color:var(--xui-primary-color)}.xUi-checkbox input{cursor:pointer;inset:0;opacity:0;position:absolute}.xUi-checkbox-inner{border-left:0;border-top:0;border:2px solid var(--xui-background-color);height:6px;left:50%;position:absolute;top:50%;transform:rotate(45deg) scale(0);transition:transform .2s ease-in-out;width:10px}.xUi-checkbox-check{background-color:var(--xui-primary-color);border-color:var(--xui-primary-color);display:block;height:100%;position:relative;transition:.1s ease;width:100%}.xUi-checkbox-check:after{border:solid #fff;border-width:0 2px 2px 0;content:\"\";height:8px;left:3px;position:absolute;top:1px;transform:rotate(45deg);width:5px}.xUi-checkbox-disabled,.xUi-checkbox-disabled .xUi-checkbox-check{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color)!important;cursor:not-allowed;opacity:.5}.xUi-checkbox-label{font-size:14px;margin-left:8px;user-select:none}.xUi-checkbox:focus:not(.disabled),.xUi-checkbox:hover:not(.disabled){border-color:var(--xui-primary-color);cursor:pointer}.xUi-checkbox.disabled{cursor:not-allowed;opacity:.5}";
185
- styleInject(css_248z);
186
-
187
- const CheckboxClient = /*#__PURE__*/forwardRef(({
162
+ const Checkbox = /*#__PURE__*/forwardRef(({
188
163
  prefixCls,
189
164
  className = '',
190
- defaultChecked = false,
191
- checked,
192
165
  style,
193
166
  disabled = false,
194
- onChange,
195
167
  onClick,
196
168
  onMouseEnter,
197
169
  onMouseLeave,
@@ -203,37 +175,20 @@ const CheckboxClient = /*#__PURE__*/forwardRef(({
203
175
  id,
204
176
  autoFocus,
205
177
  type = 'checkbox',
206
- value = false,
207
178
  required = false,
208
- noStyle
179
+ noStyle,
180
+ checked
209
181
  }, ref) => {
210
- const isChecked = checked !== undefined ? checked : defaultChecked || value;
211
- const [internalChecked, setInternalChecked] = useState(isChecked);
212
- const handleClick = e => {
213
- e.stopPropagation();
214
- if (disabled) {
215
- return;
216
- }
217
- setInternalChecked(!internalChecked);
218
- e.target.value = !internalChecked;
219
- onClick?.(e);
220
- onChange?.(e);
221
- };
222
- useEffect(() => {
223
- if (checked !== undefined) {
224
- setInternalChecked(checked);
225
- }
226
- }, [checked]);
227
182
  return /*#__PURE__*/React.createElement("div", {
228
183
  className: `${prefixCls}-wrapper`
229
184
  }, /*#__PURE__*/React.createElement("div", {
230
185
  ref: ref,
231
186
  style: style,
232
- onClick: handleClick,
187
+ onClick: onClick,
233
188
  className: clsx([prefixCls, className, {
234
189
  noStyle: noStyle,
235
190
  [`${prefixCls}-disabled`]: disabled,
236
- [`${prefixCls}-checked`]: internalChecked
191
+ [`${prefixCls}-checked`]: checked
237
192
  }])
238
193
  }, /*#__PURE__*/React.createElement("input", {
239
194
  id: id,
@@ -252,60 +207,12 @@ const CheckboxClient = /*#__PURE__*/forwardRef(({
252
207
  }, /*#__PURE__*/React.createElement("span", {
253
208
  className: `${prefixCls}-check`,
254
209
  style: {
255
- opacity: Number(internalChecked)
210
+ opacity: Number(checked)
256
211
  }
257
212
  }))), children && /*#__PURE__*/React.createElement("span", {
258
213
  className: `${prefixCls}-label`
259
214
  }, children));
260
215
  });
261
- CheckboxClient.displayName = 'CheckboxClient';
262
-
263
- const Checkbox = ({
264
- prefixCls = prefixClsCheckbox,
265
- className = '',
266
- defaultChecked = false,
267
- checked,
268
- style,
269
- disabled = false,
270
- onChange,
271
- onClick,
272
- onMouseEnter,
273
- onMouseLeave,
274
- onKeyPress,
275
- onKeyDown,
276
- tabIndex,
277
- name,
278
- children,
279
- id,
280
- autoFocus,
281
- type = 'checkbox',
282
- value = false,
283
- required = false,
284
- noStyle
285
- }) => {
286
- return /*#__PURE__*/React.createElement(CheckboxClient, {
287
- prefixCls: prefixCls,
288
- className: className,
289
- defaultChecked: defaultChecked,
290
- checked: checked,
291
- style: style,
292
- disabled: disabled,
293
- onChange: onChange,
294
- onClick: onClick,
295
- onMouseEnter: onMouseEnter,
296
- onMouseLeave: onMouseLeave,
297
- onKeyPress: onKeyPress,
298
- onKeyDown: onKeyDown,
299
- tabIndex: tabIndex,
300
- name: name,
301
- id: id,
302
- autoFocus: autoFocus,
303
- type: type,
304
- value: value,
305
- required: required,
306
- noStyle: noStyle
307
- }, children);
308
- };
309
216
  Checkbox.displayName = 'Checkbox';
310
217
 
311
218
  export { Button, Checkbox, Empty };
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../lib/utils/index.ts","../lib/components/Empty/Empty.client.tsx","../lib/components/Empty/Empty.tsx","../lib/helpers/index.ts","../lib/components/Button/Button.tsx","../lib/components/Checkbox/Checkbox.client.tsx","../lib/components/Checkbox/Checkbox.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","export const prefixClsForm = 'xUi-form';\nexport const prefixClsFormItem = 'xUi-form-item';\nexport const prefixClsEmpty = 'xUi-empty';\nexport const prefixClsInput = 'xUi-input';\nexport const prefixClsSelect = 'xUi-select';\nexport const prefixClsCheckbox = 'xUi-checkbox';\nexport const prefixClsRadio = 'xUi-radio';\nexport const prefixClsTextArea = 'xUi-textarea';\nexport const prefixClsUpload = 'xUi-upload';\nexport const prefixClsDatePicker = 'xUi-datepicker';\nexport const prefixClsRangePicker = 'xUi-rangepicker';\nexport const prefixClsTimePicker = 'xUi-timepicker';\nexport const prefixClsButton = 'xUi-button';\nexport const prefixClsSkeleton = 'xUi-skeleton';\n","'use client';\n\nimport React, { useEffect } from 'react';\nimport { EmptyContentProps } from '../../types/empty';\nimport { prefixClsEmpty } from '../../utils';\nimport './style.css';\n\nconst EmptyClient = ({\n icon,\n style = {},\n className = '',\n title = 'No Data',\n description = 'No data',\n prefixCls = prefixClsEmpty\n}: EmptyContentProps) => {\n useEffect(() => {}, [])\n return (\n <div\n style={style}\n className={`${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`}\n >\n <div className={`${prefixCls}-image`}>\n {icon || (\n <svg\n width=\"64\"\n height=\"41\"\n viewBox=\"0 0 64 41\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>{title}</title>\n <g transform=\"translate(0 1)\" fill=\"none\">\n <ellipse fill=\"#f5f5f5\" cx=\"32\" cy=\"33\" rx=\"32\" ry=\"7\"></ellipse>\n <g stroke=\"#d9d9d9\">\n <path d=\"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z\"></path>\n <path\n d=\"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z\"\n fill=\"#fafafa\"\n ></path>\n </g>\n </g>\n </svg>\n )}\n </div>\n <div className={`${prefixCls}-description`}>{description}</div>\n </div>\n)};\n\nexport default EmptyClient;","import React from 'react';\nimport { EmptyContentProps } from '../../types/empty';\nimport { prefixClsEmpty } from '../../utils';\nimport EmptyContentClient from './Empty.client';\n\nconst Empty = ({\n icon,\n style = {},\n className = '',\n title = 'No Data',\n description = 'No data',\n prefixCls = prefixClsEmpty\n}: EmptyContentProps) => {\n return (\n <EmptyContentClient\n icon={icon}\n style={style}\n className={className}\n title={title}\n description={description}\n prefixCls={prefixCls}\n />\n );\n};\n\nexport default Empty;","import { RuleType } from '../types';\n\nexport const parseValue = (value: RuleType): RuleType => {\n if (value === 'true') {\n return true;\n }\n\n if (value === 'false') {\n return false;\n }\n\n if (!isNaN(Number(value))) {\n return Number(value);\n }\n\n return value;\n};\n\nexport function createArray(length: number): number[] {\n return Array.from({ length }, (_, index) => index);\n}\n\nexport function clsx(...args: RuleType[]): string {\n return args\n .flatMap(arg => {\n if (!arg) {\n return [];\n }\n\n if (typeof arg === 'string') {\n return [arg];\n }\n\n if (typeof arg === 'number') {\n return [String(arg)];\n }\n\n if (Array.isArray(arg)) {\n return clsx(...arg).split(' ');\n }\n\n if (typeof arg === 'object') {\n return Object.entries(arg)\n .filter(([, value]) => Boolean(value))\n .map(([key]) => key);\n }\n\n return [];\n })\n .filter(Boolean)\n .join(' ');\n}\n","import React, { ReactElement, ReactNode } from 'react';\nimport { clsx } from '../../helpers';\nimport { ButtonProps } from '../../types/button';\nimport { prefixClsButton } from '../../utils';\nimport './style.css';\n\nconst Button = ({\n type = 'default',\n variant = 'solid',\n color = 'default',\n shape = 'default',\n size = 'middle',\n htmlType = 'button',\n className,\n rootClassName,\n classNames: customClassNames = {},\n styles = {},\n prefixCls = prefixClsButton,\n iconPosition = 'start',\n disabled = false,\n ghost = false,\n danger = false,\n block = false,\n children,\n href,\n iconNode,\n isLoading = false,\n ...restProps\n}: ButtonProps & {\n iconNode?: ReactNode;\n isLoading?: boolean;\n}): ReactElement => {\n const classes = clsx(\n prefixCls,\n rootClassName,\n `${prefixCls}-${type}`,\n `${prefixCls}-${variant}`,\n `${prefixCls}-${color}`,\n `${prefixCls}-${shape}`,\n `${prefixCls}-size-${size}`,\n {\n [`${prefixCls}-block`]: block,\n [`${prefixCls}-ghost`]: ghost,\n [`${prefixCls}-danger`]: danger,\n [`${prefixCls}-loading`]: isLoading,\n [`${prefixCls}-disabled`]: disabled\n },\n className\n );\n\n const mergedDisabled = disabled || isLoading;\n\n const content = (\n <>\n {iconNode && iconPosition === 'start' && (\n <span\n className={clsx(`${prefixCls}-icon`, customClassNames.icon)}\n style={styles.icon}\n >\n {iconNode}\n </span>\n )}\n <span className={`${prefixCls}-content`}>{children}</span>\n {iconNode && iconPosition === 'end' && (\n <span\n className={clsx(`${prefixCls}-icon`, customClassNames.icon)}\n style={styles.icon}\n >\n {iconNode}\n </span>\n )}\n </>\n );\n\n if (href) {\n return (\n <a\n className={classes}\n href={mergedDisabled ? undefined : href}\n aria-disabled={mergedDisabled}\n >\n {content}\n </a>\n );\n }\n\n return (\n <button\n type={htmlType}\n className={classes}\n disabled={mergedDisabled}\n {...restProps}\n >\n {content}\n </button>\n );\n};\n\nexport default Button;\n","'use client';\n\nimport React, {\n ForwardedRef,\n forwardRef,\n MouseEvent,\n ReactElement,\n useEffect,\n useState\n} from 'react';\nimport { clsx } from '../../helpers';\nimport { SyntheticBaseEvent } from '../../types';\nimport { CheckboxProps } from '../../types/checkbox';\nimport './style.css';\n\nconst CheckboxClient = forwardRef<HTMLDivElement, CheckboxProps>(\n (\n {\n prefixCls,\n className = '',\n defaultChecked = false,\n checked,\n style,\n disabled = false,\n onChange,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onKeyPress,\n onKeyDown,\n tabIndex,\n name,\n children,\n id,\n autoFocus,\n type = 'checkbox',\n value = false,\n required = false,\n noStyle\n },\n ref: ForwardedRef<HTMLDivElement>\n ): ReactElement => {\n const isChecked = checked !== undefined ? checked : defaultChecked || value;\n const [internalChecked, setInternalChecked] = useState(isChecked);\n\n const handleClick = (\n e: MouseEvent<HTMLInputElement> & SyntheticBaseEvent\n ) => {\n e.stopPropagation();\n\n if (disabled) {\n return;\n }\n\n setInternalChecked(!internalChecked);\n e.target.value = !internalChecked;\n\n onClick?.(e);\n onChange?.(e);\n };\n\n useEffect(() => {\n if (checked !== undefined) {\n setInternalChecked(checked);\n }\n }, [checked]);\n\n return (\n <div className={`${prefixCls}-wrapper`}>\n <div\n ref={ref}\n style={style}\n onClick={handleClick}\n className={clsx([\n prefixCls,\n className,\n {\n noStyle: noStyle,\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-checked`]: internalChecked\n }\n ])}\n >\n <input\n id={id}\n type={type}\n name={name}\n disabled={disabled}\n tabIndex={tabIndex}\n required={required}\n autoFocus={autoFocus}\n onKeyDown={onKeyDown}\n onKeyPress={onKeyPress}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n />\n\n <span className={`${prefixCls}-box`}>\n <span\n className={`${prefixCls}-check`}\n style={{ opacity: Number(internalChecked) }}\n />\n </span>\n </div>\n\n {children && <span className={`${prefixCls}-label`}>{children}</span>}\n </div>\n );\n }\n);\n\nCheckboxClient.displayName = 'CheckboxClient';\n\nexport default CheckboxClient;","import React, { ReactElement } from 'react';\nimport { CheckboxProps } from '../../types/checkbox';\nimport { prefixClsCheckbox } from '../../utils';\nimport CheckboxClient from './Checkbox.client';\n\nconst Checkbox = ({\n prefixCls = prefixClsCheckbox,\n className = '',\n defaultChecked = false,\n checked,\n style,\n disabled = false,\n onChange,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onKeyPress,\n onKeyDown,\n tabIndex,\n name,\n children,\n id,\n autoFocus,\n type = 'checkbox',\n value = false,\n required = false,\n noStyle\n}: CheckboxProps): ReactElement => {\n return (\n <CheckboxClient\n prefixCls={prefixCls}\n className={className}\n defaultChecked={defaultChecked}\n checked={checked}\n style={style}\n disabled={disabled}\n onChange={onChange}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onKeyPress={onKeyPress}\n onKeyDown={onKeyDown}\n tabIndex={tabIndex}\n name={name}\n id={id}\n autoFocus={autoFocus}\n type={type}\n value={value}\n required={required}\n noStyle={noStyle}\n >\n {children}\n </CheckboxClient>\n );\n};\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","prefixClsEmpty","prefixClsCheckbox","prefixClsButton","EmptyClient","icon","className","title","description","prefixCls","useEffect","React","width","height","viewBox","xmlns","transform","fill","cx","cy","rx","ry","stroke","d","Empty","EmptyContentClient","clsx","args","flatMap","arg","String","Array","isArray","split","Object","entries","filter","value","Boolean","map","key","join","Button","variant","color","shape","size","htmlType","rootClassName","classNames","customClassNames","styles","iconPosition","disabled","ghost","danger","block","children","href","iconNode","isLoading","restProps","classes","mergedDisabled","content","Fragment","undefined","_extends","CheckboxClient","forwardRef","defaultChecked","checked","onChange","onClick","onMouseEnter","onMouseLeave","onKeyPress","onKeyDown","tabIndex","name","id","autoFocus","required","noStyle","isChecked","internalChecked","setInternalChecked","useState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AG,UAAU;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../lib/utils/index.ts","../lib/components/Empty/Empty.tsx","../lib/helpers/index.ts","../lib/components/Button/Button.tsx","../lib/components/Checkbox/Checkbox.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","export const prefixClsForm = 'xUi-form';\nexport const prefixClsFormItem = 'xUi-form-item';\nexport const prefixClsEmpty = 'xUi-empty';\nexport const prefixClsInput = 'xUi-input';\nexport const prefixClsSelect = 'xUi-select';\nexport const prefixClsCheckbox = 'xUi-checkbox';\nexport const prefixClsRadio = 'xUi-radio';\nexport const prefixClsTextArea = 'xUi-textarea';\nexport const prefixClsUpload = 'xUi-upload';\nexport const prefixClsDatePicker = 'xUi-datepicker';\nexport const prefixClsRangePicker = 'xUi-rangepicker';\nexport const prefixClsTimePicker = 'xUi-timepicker';\nexport const prefixClsButton = 'xUi-button';\nexport const prefixClsSkeleton = 'xUi-skeleton';\n","import React from 'react';\nimport { EmptyProps } from '../../types/empty';\nimport { prefixClsEmpty } from '../../utils';\nimport './style.css';\n\nconst Empty = ({\n icon,\n style = {},\n className = '',\n title = 'No Data',\n description = 'No data',\n prefixCls = prefixClsEmpty\n}: EmptyProps) => (\n <div\n style={style}\n className={`${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`}\n >\n <div className={`${prefixCls}-image`}>\n {icon || (\n <svg\n width=\"64\"\n height=\"41\"\n viewBox=\"0 0 64 41\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>{title}</title>\n <g transform=\"translate(0 1)\" fill=\"none\">\n <ellipse fill=\"#f5f5f5\" cx=\"32\" cy=\"33\" rx=\"32\" ry=\"7\"></ellipse>\n <g stroke=\"#d9d9d9\">\n <path d=\"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z\"></path>\n <path\n d=\"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z\"\n fill=\"#fafafa\"\n ></path>\n </g>\n </g>\n </svg>\n )}\n </div>\n <div className={`${prefixCls}-description`}>{description}</div>\n </div>\n);\n\nexport default Empty;","import { RuleType } from '../types';\n\nexport const parseValue = (value: RuleType): RuleType => {\n if (value === 'true') {\n return true;\n }\n\n if (value === 'false') {\n return false;\n }\n\n if (!isNaN(Number(value))) {\n return Number(value);\n }\n\n return value;\n};\n\nexport function createArray(length: number): number[] {\n return Array.from({ length }, (_, index) => index);\n}\n\nexport function clsx(...args: RuleType[]): string {\n return args\n .flatMap(arg => {\n if (!arg) {\n return [];\n }\n\n if (typeof arg === 'string') {\n return [arg];\n }\n\n if (typeof arg === 'number') {\n return [String(arg)];\n }\n\n if (Array.isArray(arg)) {\n return clsx(...arg).split(' ');\n }\n\n if (typeof arg === 'object') {\n return Object.entries(arg)\n .filter(([, value]) => Boolean(value))\n .map(([key]) => key);\n }\n\n return [];\n })\n .filter(Boolean)\n .join(' ');\n}\n","import React, { ReactElement, ReactNode } from 'react';\nimport { clsx } from '../../helpers';\nimport { ButtonProps } from '../../types/button';\nimport { prefixClsButton } from '../../utils';\nimport './style.css';\n\nconst Button = ({\n type = 'default',\n variant = 'solid',\n color = 'default',\n shape = 'default',\n size = 'middle',\n htmlType = 'button',\n className,\n rootClassName,\n classNames: customClassNames = {},\n styles = {},\n prefixCls = prefixClsButton,\n iconPosition = 'start',\n disabled = false,\n ghost = false,\n danger = false,\n block = false,\n children,\n href,\n iconNode,\n isLoading = false,\n ...restProps\n}: ButtonProps & {\n iconNode?: ReactNode;\n isLoading?: boolean;\n}): ReactElement => {\n const classes = clsx(\n prefixCls,\n rootClassName,\n `${prefixCls}-${type}`,\n `${prefixCls}-${variant}`,\n `${prefixCls}-${color}`,\n `${prefixCls}-${shape}`,\n `${prefixCls}-size-${size}`,\n {\n [`${prefixCls}-block`]: block,\n [`${prefixCls}-ghost`]: ghost,\n [`${prefixCls}-danger`]: danger,\n [`${prefixCls}-loading`]: isLoading,\n [`${prefixCls}-disabled`]: disabled\n },\n className\n );\n\n const mergedDisabled = disabled || isLoading;\n\n const content = (\n <>\n {iconNode && iconPosition === 'start' && (\n <span\n className={clsx(`${prefixCls}-icon`, customClassNames.icon)}\n style={styles.icon}\n >\n {iconNode}\n </span>\n )}\n <span className={`${prefixCls}-content`}>{children}</span>\n {iconNode && iconPosition === 'end' && (\n <span\n className={clsx(`${prefixCls}-icon`, customClassNames.icon)}\n style={styles.icon}\n >\n {iconNode}\n </span>\n )}\n </>\n );\n\n if (href) {\n return (\n <a\n className={classes}\n href={mergedDisabled ? undefined : href}\n aria-disabled={mergedDisabled}\n >\n {content}\n </a>\n );\n }\n\n return (\n <button\n type={htmlType}\n className={classes}\n disabled={mergedDisabled}\n {...restProps}\n >\n {content}\n </button>\n );\n};\n\nexport default Button;\n","import React, { ForwardedRef, forwardRef, ReactElement } from 'react';\nimport { CheckboxProps } from '../../types/checkbox';\nimport { clsx } from '../../helpers';\n\nconst Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(\n (\n {\n prefixCls,\n className = '',\n style,\n disabled = false,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onKeyPress,\n onKeyDown,\n tabIndex,\n name,\n children,\n id,\n autoFocus,\n type = 'checkbox',\n required = false,\n noStyle,\n checked\n },\n ref: ForwardedRef<HTMLDivElement>\n ): ReactElement => {\n return (\n (\n <div className={`${prefixCls}-wrapper`}>\n <div\n ref={ref}\n style={style}\n onClick={onClick}\n className={clsx([\n prefixCls,\n className,\n {\n noStyle: noStyle,\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-checked`]: checked\n }\n ])}\n >\n <input\n id={id}\n type={type}\n name={name}\n disabled={disabled}\n tabIndex={tabIndex}\n required={required}\n autoFocus={autoFocus}\n onKeyDown={onKeyDown}\n onKeyPress={onKeyPress}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n />\n\n <span className={`${prefixCls}-box`}>\n <span\n className={`${prefixCls}-check`}\n style={{ opacity: Number(checked) }}\n />\n </span>\n </div>\n\n {children && <span className={`${prefixCls}-label`}>{children}</span>}\n </div>\n )\n );\n });\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","prefixClsEmpty","prefixClsButton","Empty","icon","className","title","description","prefixCls","React","width","height","viewBox","xmlns","transform","fill","cx","cy","rx","ry","stroke","d","clsx","args","flatMap","arg","String","Array","isArray","split","Object","entries","filter","value","Boolean","map","key","join","Button","variant","color","shape","size","htmlType","rootClassName","classNames","customClassNames","styles","iconPosition","disabled","ghost","danger","block","children","href","iconNode","isLoading","restProps","classes","mergedDisabled","content","Fragment","undefined","_extends","Checkbox","forwardRef","onClick","onMouseEnter","onMouseLeave","onKeyPress","onKeyDown","tabIndex","name","id","autoFocus","required","noStyle","checked","opacity","Number","displayName"],"mappings":";;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,GAAG,KAAK,KAAK,CAAC,EAAGA,GAAG,GAAG,EAAE,CAAA;AAC9B,EAAA,IA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sB,IAAAA,QAAQ,EAAEA,QAAS;AACnBI,IAAAA,QAAQ,EAAEA,QAAS;AACnBD,IAAAA,SAAS,EAAEA,SAAU;AACrBJ,IAAAA,SAAS,EAAEA,SAAU;AACrBD,IAAAA,UAAU,EAAEA,UAAW;AACvBF,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,YAAY,EAAEA,YAAAA;AAAa,GAG7B,CAAA,eAAA3D,KAAA,CAAAhB,aAAA,CAAA,MAAA,EAAA;IAAMY,SAAS,EAAE,GAAGG,SAAS,CAAA,IAAA,CAAA;GAC3BC,eAAAA,KAAA,CAAAhB,aAAA,CAAA,MAAA,EAAA;IACEY,SAAS,EAAE,CAAGG,EAAAA,SAAS,CAAS,MAAA,CAAA;AAChChB,IAAAA,KAAK,EAAE;MAAEsF,OAAO,EAAEC,MAAM,CAACF,OAAO,CAAA;AAAG,KAAA;GAEvC,CAAM,CACH,CAEL,EAACxB,QAAQ,iBAAI5C,KAAA,CAAAhB,aAAA,CAAA,MAAA,EAAA;IAAMY,SAAS,EAAE,GAAGG,SAAS,CAAA,MAAA,CAAA;GAAW6C,EAAAA,QAAe,CACjE,CAAC,CAAA;AAGZ,CAAC,EAAC;AAEJW,QAAQ,CAACgB,WAAW,GAAG,UAAU;;;;","x_google_ignoreList":[0]}
package/dist/index.js CHANGED
@@ -27,55 +27,14 @@ function styleInject(css, ref) {
27
27
  }
28
28
  }
29
29
 
30
- var css_248z$3 = ":root{--xui-color-hover:#f5f5f5;--xui-color-disabled:#e6e6e6;--xui-primary-color:#1677ff;--xui-primary-color-light:#40a9ff;--xui-text-color:rgba(0,0,0,.88);--xui-text-color-light:rgba(0,0,0,.5);--xui-error-color:#ff4d4f;--xui-error-color-light:#ff6668;--xui-success-color:#52c41a;--xui-background-color:#fff;--xui-font-size-xs:12px;--xui-font-size-sm:14px;--xui-font-size-md:14px;--xui-font-size-lg:16px;--xui-border-radius-sm:4px;--xui-border-radius-md:4px;--xui-border-radius-lg:6px;--xui-border-color:#d9d9d9;--xui-select-primary-color:var(--xui-primary-color);--xui-select-background-color:var(--xui-background-color)}html{font-family:sans-serif}.globalEllipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
31
- styleInject(css_248z$3);
30
+ var css_248z$2 = ":root{--xui-color-hover:#f5f5f5;--xui-color-disabled:#e6e6e6;--xui-primary-color:#1677ff;--xui-primary-color-light:#40a9ff;--xui-text-color:rgba(0,0,0,.88);--xui-text-color-light:rgba(0,0,0,.5);--xui-error-color:#ff4d4f;--xui-error-color-light:#ff6668;--xui-success-color:#52c41a;--xui-background-color:#fff;--xui-font-size-xs:12px;--xui-font-size-sm:14px;--xui-font-size-md:14px;--xui-font-size-lg:16px;--xui-border-radius-sm:4px;--xui-border-radius-md:4px;--xui-border-radius-lg:6px;--xui-border-color:#d9d9d9;--xui-select-primary-color:var(--xui-primary-color);--xui-select-background-color:var(--xui-background-color)}html{font-family:sans-serif}.globalEllipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
31
+ styleInject(css_248z$2);
32
32
 
33
33
  const prefixClsEmpty = 'xUi-empty';
34
- const prefixClsCheckbox = 'xUi-checkbox';
35
34
  const prefixClsButton = 'xUi-button';
36
35
 
37
- var css_248z$2 = ".xUi-empty{align-items:center;display:grid;gap:4px;justify-content:center;padding:14px}.xUi-empty-description{color:var(--xui-text-color);font-size:var(--xui-font-size-md);text-align:center}";
38
- styleInject(css_248z$2);
39
-
40
- const EmptyClient = ({
41
- icon,
42
- style = {},
43
- className = '',
44
- title = 'No Data',
45
- description = 'No data',
46
- prefixCls = prefixClsEmpty
47
- }) => {
48
- React.useEffect(() => {}, []);
49
- return /*#__PURE__*/React.createElement("div", {
50
- style: style,
51
- className: `${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`
52
- }, /*#__PURE__*/React.createElement("div", {
53
- className: `${prefixCls}-image`
54
- }, icon || /*#__PURE__*/React.createElement("svg", {
55
- width: "64",
56
- height: "41",
57
- viewBox: "0 0 64 41",
58
- xmlns: "http://www.w3.org/2000/svg"
59
- }, /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("g", {
60
- transform: "translate(0 1)",
61
- fill: "none"
62
- }, /*#__PURE__*/React.createElement("ellipse", {
63
- fill: "#f5f5f5",
64
- cx: "32",
65
- cy: "33",
66
- rx: "32",
67
- ry: "7"
68
- }), /*#__PURE__*/React.createElement("g", {
69
- stroke: "#d9d9d9"
70
- }, /*#__PURE__*/React.createElement("path", {
71
- d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
72
- }), /*#__PURE__*/React.createElement("path", {
73
- d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
74
- fill: "#fafafa"
75
- }))))), /*#__PURE__*/React.createElement("div", {
76
- className: `${prefixCls}-description`
77
- }, description));
78
- };
36
+ var css_248z$1 = ".xUi-empty{align-items:center;display:grid;gap:4px;justify-content:center;padding:14px}.xUi-empty-description{color:var(--xui-text-color);font-size:var(--xui-font-size-md);text-align:center}";
37
+ styleInject(css_248z$1);
79
38
 
80
39
  const Empty = ({
81
40
  icon,
@@ -84,16 +43,35 @@ const Empty = ({
84
43
  title = 'No Data',
85
44
  description = 'No data',
86
45
  prefixCls = prefixClsEmpty
87
- }) => {
88
- return /*#__PURE__*/React.createElement(EmptyClient, {
89
- icon: icon,
90
- style: style,
91
- className: className,
92
- title: title,
93
- description: description,
94
- prefixCls: prefixCls
95
- });
96
- };
46
+ }) => /*#__PURE__*/React.createElement("div", {
47
+ style: style,
48
+ className: `${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`
49
+ }, /*#__PURE__*/React.createElement("div", {
50
+ className: `${prefixCls}-image`
51
+ }, icon || /*#__PURE__*/React.createElement("svg", {
52
+ width: "64",
53
+ height: "41",
54
+ viewBox: "0 0 64 41",
55
+ xmlns: "http://www.w3.org/2000/svg"
56
+ }, /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("g", {
57
+ transform: "translate(0 1)",
58
+ fill: "none"
59
+ }, /*#__PURE__*/React.createElement("ellipse", {
60
+ fill: "#f5f5f5",
61
+ cx: "32",
62
+ cy: "33",
63
+ rx: "32",
64
+ ry: "7"
65
+ }), /*#__PURE__*/React.createElement("g", {
66
+ stroke: "#d9d9d9"
67
+ }, /*#__PURE__*/React.createElement("path", {
68
+ d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
69
+ }), /*#__PURE__*/React.createElement("path", {
70
+ d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
71
+ fill: "#fafafa"
72
+ }))))), /*#__PURE__*/React.createElement("div", {
73
+ className: `${prefixCls}-description`
74
+ }, description));
97
75
 
98
76
  function _extends() {
99
77
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
@@ -126,8 +104,8 @@ function clsx(...args) {
126
104
  }).filter(Boolean).join(' ');
127
105
  }
128
106
 
129
- var css_248z$1 = ".xUi-button{border:1px solid transparent;border-radius:6px;cursor:pointer;font-weight:400;line-height:1.5715;transition:all .3s ease;user-select:none;vertical-align:middle;white-space:nowrap}.xUi-button,.xUi-button-content,.xUi-button-icon{align-items:center;display:inline-flex;justify-content:center}.xUi-button-icon{line-height:0;margin-right:.5em}.xUi-button-icon:last-child{margin-left:.5em;margin-right:0}.xUi-button-spinner{animation:xUi-spin 1s linear infinite;border:1px solid transparent;border-radius:50%;border-top:1px solid var(--xui-text-color);height:1em;width:1em}@keyframes xUi-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.xUi-button-size-small{font-size:12px;height:24px;padding:4px 12px}.xUi-button-size-middle{font-size:14px;height:32px;padding:0 16px}.xUi-button-size-large{font-size:16px;height:40px;padding:8px 20px}.xUi-button-circle{border-radius:50%;justify-content:center;padding:0}.xUi-button-circle.xUi-button-size-small{height:24px;width:24px}.xUi-button-circle.xUi-button-size-large{height:40px;width:40px}.xUi-button-round{border-radius:9999px}.xUi-button-default{background-color:#fff;border-color:var(--xui-border-color);color:rgba(0,0,0,.85)}.xUi-button-default:hover{border-color:var(--xui-primary-color);color:var(--xui-primary-color)}.xUi-button-primary{background-color:var(--xui-primary-color);border-color:var(--xui-primary-color);color:#fff}.xUi-button-primary:hover{background-color:var(--xui-primary-color-light);border-color:var(--xui-primary-color-light);color:#fff}.xUi-button-dashed{background-color:#fff;border-color:var(--xui-border-color);border-style:dashed;color:rgba(0,0,0,.85)}.xUi-button-dashed:hover{border-color:var(--xui-primary-color);color:var(--xui-primary-color)}.xUi-button-text{background-color:transparent;border-color:transparent!important;color:rgba(0,0,0,.88)}.xUi-button-text:hover{background-color:rgba(0,0,0,.04);border-color:transparent;color:rgba(0,0,0,.88)}.xUi-button-link{background-color:transparent;border-color:transparent!important;color:var(--xui-primary-color)}.xUi-button-link:hover{border-color:transparent;color:var(--xui-primary-color-light)}.xUi-button-outlined{color:#fff}.xUi-button-filled,.xUi-button-outlined{background-color:transparent;border-color:var(--xui-border-color)}.xUi-button-filled{color:var(--xui-text-color)}.xUi-button-danger{background-color:transparent;border-color:var(--xui-error-color);color:var(--xui-error-color)}.xUi-button-danger:hover{border-color:var(--xui-error-color-light);color:var(--xui-error-color-light)}.xUi-button-ghost{opacity:0}.xUi-button-ghost:hover{opacity:1}.xUi-button-block{display:flex;width:100%}.xUi-button-disabled,.xUi-button-loading{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color);color:var(--xui-text-color);cursor:not-allowed;opacity:.5;pointer-events:none}.xUi-button-loading{background-color:transparent}";
130
- styleInject(css_248z$1);
107
+ var css_248z = ".xUi-button{border:1px solid transparent;border-radius:6px;cursor:pointer;font-weight:400;line-height:1.5715;transition:all .3s ease;user-select:none;vertical-align:middle;white-space:nowrap}.xUi-button,.xUi-button-content,.xUi-button-icon{align-items:center;display:inline-flex;justify-content:center}.xUi-button-icon{line-height:0;margin-right:.5em}.xUi-button-icon:last-child{margin-left:.5em;margin-right:0}.xUi-button-spinner{animation:xUi-spin 1s linear infinite;border:1px solid transparent;border-radius:50%;border-top:1px solid var(--xui-text-color);height:1em;width:1em}@keyframes xUi-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.xUi-button-size-small{font-size:12px;height:24px;padding:4px 12px}.xUi-button-size-middle{font-size:14px;height:32px;padding:0 16px}.xUi-button-size-large{font-size:16px;height:40px;padding:8px 20px}.xUi-button-circle{border-radius:50%;justify-content:center;padding:0}.xUi-button-circle.xUi-button-size-small{height:24px;width:24px}.xUi-button-circle.xUi-button-size-large{height:40px;width:40px}.xUi-button-round{border-radius:9999px}.xUi-button-default{background-color:#fff;border-color:var(--xui-border-color);color:rgba(0,0,0,.85)}.xUi-button-default:hover{border-color:var(--xui-primary-color);color:var(--xui-primary-color)}.xUi-button-primary{background-color:var(--xui-primary-color);border-color:var(--xui-primary-color);color:#fff}.xUi-button-primary:hover{background-color:var(--xui-primary-color-light);border-color:var(--xui-primary-color-light);color:#fff}.xUi-button-dashed{background-color:#fff;border-color:var(--xui-border-color);border-style:dashed;color:rgba(0,0,0,.85)}.xUi-button-dashed:hover{border-color:var(--xui-primary-color);color:var(--xui-primary-color)}.xUi-button-text{background-color:transparent;border-color:transparent!important;color:rgba(0,0,0,.88)}.xUi-button-text:hover{background-color:rgba(0,0,0,.04);border-color:transparent;color:rgba(0,0,0,.88)}.xUi-button-link{background-color:transparent;border-color:transparent!important;color:var(--xui-primary-color)}.xUi-button-link:hover{border-color:transparent;color:var(--xui-primary-color-light)}.xUi-button-outlined{color:#fff}.xUi-button-filled,.xUi-button-outlined{background-color:transparent;border-color:var(--xui-border-color)}.xUi-button-filled{color:var(--xui-text-color)}.xUi-button-danger{background-color:transparent;border-color:var(--xui-error-color);color:var(--xui-error-color)}.xUi-button-danger:hover{border-color:var(--xui-error-color-light);color:var(--xui-error-color-light)}.xUi-button-ghost{opacity:0}.xUi-button-ghost:hover{opacity:1}.xUi-button-block{display:flex;width:100%}.xUi-button-disabled,.xUi-button-loading{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color);color:var(--xui-text-color);cursor:not-allowed;opacity:.5;pointer-events:none}.xUi-button-loading{background-color:transparent}";
108
+ styleInject(css_248z);
131
109
 
132
110
  const Button = ({
133
111
  type = 'default',
@@ -183,17 +161,11 @@ const Button = ({
183
161
  }, restProps), content);
184
162
  };
185
163
 
186
- var css_248z = ".xUi-checkbox-wrapper{align-items:center;color:var(--xui-main-color);cursor:pointer;display:inline-flex;font-size:var(--xui-font-size-md);margin:16px 0}.xUi-checkbox{background-color:transparent;border:1px solid var(--xui-border-color);border-radius:var(--xui-border-radius-sm);display:inline-block;height:14px;position:relative;transition:all .3s;width:14px}.xUi-checkbox.xUi-checkbox-checked{background-color:#f0f5ff;border-color:var(--xui-primary-color)}.xUi-checkbox input{cursor:pointer;inset:0;opacity:0;position:absolute}.xUi-checkbox-inner{border-left:0;border-top:0;border:2px solid var(--xui-background-color);height:6px;left:50%;position:absolute;top:50%;transform:rotate(45deg) scale(0);transition:transform .2s ease-in-out;width:10px}.xUi-checkbox-check{background-color:var(--xui-primary-color);border-color:var(--xui-primary-color);display:block;height:100%;position:relative;transition:.1s ease;width:100%}.xUi-checkbox-check:after{border:solid #fff;border-width:0 2px 2px 0;content:\"\";height:8px;left:3px;position:absolute;top:1px;transform:rotate(45deg);width:5px}.xUi-checkbox-disabled,.xUi-checkbox-disabled .xUi-checkbox-check{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color)!important;cursor:not-allowed;opacity:.5}.xUi-checkbox-label{font-size:14px;margin-left:8px;user-select:none}.xUi-checkbox:focus:not(.disabled),.xUi-checkbox:hover:not(.disabled){border-color:var(--xui-primary-color);cursor:pointer}.xUi-checkbox.disabled{cursor:not-allowed;opacity:.5}";
187
- styleInject(css_248z);
188
-
189
- const CheckboxClient = /*#__PURE__*/React.forwardRef(({
164
+ const Checkbox = /*#__PURE__*/React.forwardRef(({
190
165
  prefixCls,
191
166
  className = '',
192
- defaultChecked = false,
193
- checked,
194
167
  style,
195
168
  disabled = false,
196
- onChange,
197
169
  onClick,
198
170
  onMouseEnter,
199
171
  onMouseLeave,
@@ -205,37 +177,20 @@ const CheckboxClient = /*#__PURE__*/React.forwardRef(({
205
177
  id,
206
178
  autoFocus,
207
179
  type = 'checkbox',
208
- value = false,
209
180
  required = false,
210
- noStyle
181
+ noStyle,
182
+ checked
211
183
  }, ref) => {
212
- const isChecked = checked !== undefined ? checked : defaultChecked || value;
213
- const [internalChecked, setInternalChecked] = React.useState(isChecked);
214
- const handleClick = e => {
215
- e.stopPropagation();
216
- if (disabled) {
217
- return;
218
- }
219
- setInternalChecked(!internalChecked);
220
- e.target.value = !internalChecked;
221
- onClick?.(e);
222
- onChange?.(e);
223
- };
224
- React.useEffect(() => {
225
- if (checked !== undefined) {
226
- setInternalChecked(checked);
227
- }
228
- }, [checked]);
229
184
  return /*#__PURE__*/React.createElement("div", {
230
185
  className: `${prefixCls}-wrapper`
231
186
  }, /*#__PURE__*/React.createElement("div", {
232
187
  ref: ref,
233
188
  style: style,
234
- onClick: handleClick,
189
+ onClick: onClick,
235
190
  className: clsx([prefixCls, className, {
236
191
  noStyle: noStyle,
237
192
  [`${prefixCls}-disabled`]: disabled,
238
- [`${prefixCls}-checked`]: internalChecked
193
+ [`${prefixCls}-checked`]: checked
239
194
  }])
240
195
  }, /*#__PURE__*/React.createElement("input", {
241
196
  id: id,
@@ -254,60 +209,12 @@ const CheckboxClient = /*#__PURE__*/React.forwardRef(({
254
209
  }, /*#__PURE__*/React.createElement("span", {
255
210
  className: `${prefixCls}-check`,
256
211
  style: {
257
- opacity: Number(internalChecked)
212
+ opacity: Number(checked)
258
213
  }
259
214
  }))), children && /*#__PURE__*/React.createElement("span", {
260
215
  className: `${prefixCls}-label`
261
216
  }, children));
262
217
  });
263
- CheckboxClient.displayName = 'CheckboxClient';
264
-
265
- const Checkbox = ({
266
- prefixCls = prefixClsCheckbox,
267
- className = '',
268
- defaultChecked = false,
269
- checked,
270
- style,
271
- disabled = false,
272
- onChange,
273
- onClick,
274
- onMouseEnter,
275
- onMouseLeave,
276
- onKeyPress,
277
- onKeyDown,
278
- tabIndex,
279
- name,
280
- children,
281
- id,
282
- autoFocus,
283
- type = 'checkbox',
284
- value = false,
285
- required = false,
286
- noStyle
287
- }) => {
288
- return /*#__PURE__*/React.createElement(CheckboxClient, {
289
- prefixCls: prefixCls,
290
- className: className,
291
- defaultChecked: defaultChecked,
292
- checked: checked,
293
- style: style,
294
- disabled: disabled,
295
- onChange: onChange,
296
- onClick: onClick,
297
- onMouseEnter: onMouseEnter,
298
- onMouseLeave: onMouseLeave,
299
- onKeyPress: onKeyPress,
300
- onKeyDown: onKeyDown,
301
- tabIndex: tabIndex,
302
- name: name,
303
- id: id,
304
- autoFocus: autoFocus,
305
- type: type,
306
- value: value,
307
- required: required,
308
- noStyle: noStyle
309
- }, children);
310
- };
311
218
  Checkbox.displayName = 'Checkbox';
312
219
 
313
220
  exports.Button = Button;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../lib/utils/index.ts","../lib/components/Empty/Empty.client.tsx","../lib/components/Empty/Empty.tsx","../lib/helpers/index.ts","../lib/components/Button/Button.tsx","../lib/components/Checkbox/Checkbox.client.tsx","../lib/components/Checkbox/Checkbox.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","export const prefixClsForm = 'xUi-form';\nexport const prefixClsFormItem = 'xUi-form-item';\nexport const prefixClsEmpty = 'xUi-empty';\nexport const prefixClsInput = 'xUi-input';\nexport const prefixClsSelect = 'xUi-select';\nexport const prefixClsCheckbox = 'xUi-checkbox';\nexport const prefixClsRadio = 'xUi-radio';\nexport const prefixClsTextArea = 'xUi-textarea';\nexport const prefixClsUpload = 'xUi-upload';\nexport const prefixClsDatePicker = 'xUi-datepicker';\nexport const prefixClsRangePicker = 'xUi-rangepicker';\nexport const prefixClsTimePicker = 'xUi-timepicker';\nexport const prefixClsButton = 'xUi-button';\nexport const prefixClsSkeleton = 'xUi-skeleton';\n","'use client';\n\nimport React, { useEffect } from 'react';\nimport { EmptyContentProps } from '../../types/empty';\nimport { prefixClsEmpty } from '../../utils';\nimport './style.css';\n\nconst EmptyClient = ({\n icon,\n style = {},\n className = '',\n title = 'No Data',\n description = 'No data',\n prefixCls = prefixClsEmpty\n}: EmptyContentProps) => {\n useEffect(() => {}, [])\n return (\n <div\n style={style}\n className={`${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`}\n >\n <div className={`${prefixCls}-image`}>\n {icon || (\n <svg\n width=\"64\"\n height=\"41\"\n viewBox=\"0 0 64 41\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>{title}</title>\n <g transform=\"translate(0 1)\" fill=\"none\">\n <ellipse fill=\"#f5f5f5\" cx=\"32\" cy=\"33\" rx=\"32\" ry=\"7\"></ellipse>\n <g stroke=\"#d9d9d9\">\n <path d=\"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z\"></path>\n <path\n d=\"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z\"\n fill=\"#fafafa\"\n ></path>\n </g>\n </g>\n </svg>\n )}\n </div>\n <div className={`${prefixCls}-description`}>{description}</div>\n </div>\n)};\n\nexport default EmptyClient;","import React from 'react';\nimport { EmptyContentProps } from '../../types/empty';\nimport { prefixClsEmpty } from '../../utils';\nimport EmptyContentClient from './Empty.client';\n\nconst Empty = ({\n icon,\n style = {},\n className = '',\n title = 'No Data',\n description = 'No data',\n prefixCls = prefixClsEmpty\n}: EmptyContentProps) => {\n return (\n <EmptyContentClient\n icon={icon}\n style={style}\n className={className}\n title={title}\n description={description}\n prefixCls={prefixCls}\n />\n );\n};\n\nexport default Empty;","import { RuleType } from '../types';\n\nexport const parseValue = (value: RuleType): RuleType => {\n if (value === 'true') {\n return true;\n }\n\n if (value === 'false') {\n return false;\n }\n\n if (!isNaN(Number(value))) {\n return Number(value);\n }\n\n return value;\n};\n\nexport function createArray(length: number): number[] {\n return Array.from({ length }, (_, index) => index);\n}\n\nexport function clsx(...args: RuleType[]): string {\n return args\n .flatMap(arg => {\n if (!arg) {\n return [];\n }\n\n if (typeof arg === 'string') {\n return [arg];\n }\n\n if (typeof arg === 'number') {\n return [String(arg)];\n }\n\n if (Array.isArray(arg)) {\n return clsx(...arg).split(' ');\n }\n\n if (typeof arg === 'object') {\n return Object.entries(arg)\n .filter(([, value]) => Boolean(value))\n .map(([key]) => key);\n }\n\n return [];\n })\n .filter(Boolean)\n .join(' ');\n}\n","import React, { ReactElement, ReactNode } from 'react';\nimport { clsx } from '../../helpers';\nimport { ButtonProps } from '../../types/button';\nimport { prefixClsButton } from '../../utils';\nimport './style.css';\n\nconst Button = ({\n type = 'default',\n variant = 'solid',\n color = 'default',\n shape = 'default',\n size = 'middle',\n htmlType = 'button',\n className,\n rootClassName,\n classNames: customClassNames = {},\n styles = {},\n prefixCls = prefixClsButton,\n iconPosition = 'start',\n disabled = false,\n ghost = false,\n danger = false,\n block = false,\n children,\n href,\n iconNode,\n isLoading = false,\n ...restProps\n}: ButtonProps & {\n iconNode?: ReactNode;\n isLoading?: boolean;\n}): ReactElement => {\n const classes = clsx(\n prefixCls,\n rootClassName,\n `${prefixCls}-${type}`,\n `${prefixCls}-${variant}`,\n `${prefixCls}-${color}`,\n `${prefixCls}-${shape}`,\n `${prefixCls}-size-${size}`,\n {\n [`${prefixCls}-block`]: block,\n [`${prefixCls}-ghost`]: ghost,\n [`${prefixCls}-danger`]: danger,\n [`${prefixCls}-loading`]: isLoading,\n [`${prefixCls}-disabled`]: disabled\n },\n className\n );\n\n const mergedDisabled = disabled || isLoading;\n\n const content = (\n <>\n {iconNode && iconPosition === 'start' && (\n <span\n className={clsx(`${prefixCls}-icon`, customClassNames.icon)}\n style={styles.icon}\n >\n {iconNode}\n </span>\n )}\n <span className={`${prefixCls}-content`}>{children}</span>\n {iconNode && iconPosition === 'end' && (\n <span\n className={clsx(`${prefixCls}-icon`, customClassNames.icon)}\n style={styles.icon}\n >\n {iconNode}\n </span>\n )}\n </>\n );\n\n if (href) {\n return (\n <a\n className={classes}\n href={mergedDisabled ? undefined : href}\n aria-disabled={mergedDisabled}\n >\n {content}\n </a>\n );\n }\n\n return (\n <button\n type={htmlType}\n className={classes}\n disabled={mergedDisabled}\n {...restProps}\n >\n {content}\n </button>\n );\n};\n\nexport default Button;\n","'use client';\n\nimport React, {\n ForwardedRef,\n forwardRef,\n MouseEvent,\n ReactElement,\n useEffect,\n useState\n} from 'react';\nimport { clsx } from '../../helpers';\nimport { SyntheticBaseEvent } from '../../types';\nimport { CheckboxProps } from '../../types/checkbox';\nimport './style.css';\n\nconst CheckboxClient = forwardRef<HTMLDivElement, CheckboxProps>(\n (\n {\n prefixCls,\n className = '',\n defaultChecked = false,\n checked,\n style,\n disabled = false,\n onChange,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onKeyPress,\n onKeyDown,\n tabIndex,\n name,\n children,\n id,\n autoFocus,\n type = 'checkbox',\n value = false,\n required = false,\n noStyle\n },\n ref: ForwardedRef<HTMLDivElement>\n ): ReactElement => {\n const isChecked = checked !== undefined ? checked : defaultChecked || value;\n const [internalChecked, setInternalChecked] = useState(isChecked);\n\n const handleClick = (\n e: MouseEvent<HTMLInputElement> & SyntheticBaseEvent\n ) => {\n e.stopPropagation();\n\n if (disabled) {\n return;\n }\n\n setInternalChecked(!internalChecked);\n e.target.value = !internalChecked;\n\n onClick?.(e);\n onChange?.(e);\n };\n\n useEffect(() => {\n if (checked !== undefined) {\n setInternalChecked(checked);\n }\n }, [checked]);\n\n return (\n <div className={`${prefixCls}-wrapper`}>\n <div\n ref={ref}\n style={style}\n onClick={handleClick}\n className={clsx([\n prefixCls,\n className,\n {\n noStyle: noStyle,\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-checked`]: internalChecked\n }\n ])}\n >\n <input\n id={id}\n type={type}\n name={name}\n disabled={disabled}\n tabIndex={tabIndex}\n required={required}\n autoFocus={autoFocus}\n onKeyDown={onKeyDown}\n onKeyPress={onKeyPress}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n />\n\n <span className={`${prefixCls}-box`}>\n <span\n className={`${prefixCls}-check`}\n style={{ opacity: Number(internalChecked) }}\n />\n </span>\n </div>\n\n {children && <span className={`${prefixCls}-label`}>{children}</span>}\n </div>\n );\n }\n);\n\nCheckboxClient.displayName = 'CheckboxClient';\n\nexport default CheckboxClient;","import React, { ReactElement } from 'react';\nimport { CheckboxProps } from '../../types/checkbox';\nimport { prefixClsCheckbox } from '../../utils';\nimport CheckboxClient from './Checkbox.client';\n\nconst Checkbox = ({\n prefixCls = prefixClsCheckbox,\n className = '',\n defaultChecked = false,\n checked,\n style,\n disabled = false,\n onChange,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onKeyPress,\n onKeyDown,\n tabIndex,\n name,\n children,\n id,\n autoFocus,\n type = 'checkbox',\n value = false,\n required = false,\n noStyle\n}: CheckboxProps): ReactElement => {\n return (\n <CheckboxClient\n prefixCls={prefixCls}\n className={className}\n defaultChecked={defaultChecked}\n checked={checked}\n style={style}\n disabled={disabled}\n onChange={onChange}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onKeyPress={onKeyPress}\n onKeyDown={onKeyDown}\n tabIndex={tabIndex}\n name={name}\n id={id}\n autoFocus={autoFocus}\n type={type}\n value={value}\n required={required}\n noStyle={noStyle}\n >\n {children}\n </CheckboxClient>\n );\n};\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","prefixClsEmpty","prefixClsCheckbox","prefixClsButton","EmptyClient","icon","className","title","description","prefixCls","useEffect","React","width","height","viewBox","xmlns","transform","fill","cx","cy","rx","ry","stroke","d","Empty","EmptyContentClient","clsx","args","flatMap","arg","String","Array","isArray","split","Object","entries","filter","value","Boolean","map","key","join","Button","variant","color","shape","size","htmlType","rootClassName","classNames","customClassNames","styles","iconPosition","disabled","ghost","danger","block","children","href","iconNode","isLoading","restProps","classes","mergedDisabled","content","Fragment","undefined","_extends","CheckboxClient","forwardRef","defaultChecked","checked","onChange","onClick","onMouseEnter","onMouseLeave","onKeyPress","onKeyDown","tabIndex","name","id","autoFocus","required","noStyle","isChecked","internalChecked","setInternalChecked","useState","handleClick","e","stopPropagation","target","opacity","Number","displayName","Checkbox"],"mappings":";;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,G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KAAK;EAChBmB,QAAQ;EACRC,OAAO;EACPC,YAAY;EACZC,YAAY;EACZC,UAAU;EACVC,SAAS;EACTC,QAAQ;EACRC,IAAI;EACJtB,QAAQ;EACRuB,EAAE;EACFC,SAAS;AACTvF,EAAAA,IAAI,GAAG,UAAU;AACjB2C,EAAAA,KAAK,GAAG,KAAK;AACb6C,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,OAAAA;AAAO,CACO,KAAkB;AAChC,EAAA,oBACExE,KAAA,CAAAlB,aAAA,CAAC2E,cAAc,EAAA;AACb3D,IAAAA,SAAS,EAAEA,SAAU;AACrBH,IAAAA,SAAS,EAAEA,SAAU;AACrBgE,IAAAA,cAAc,EAAEA,cAAe;AAC/BC,IAAAA,OAAO,EAAEA,OAAQ;AACjB/E,IAAAA,KAAK,EAAEA,KAAM;AACb6D,IAAAA,QAAQ,EAAEA,QAAS;AACnBmB,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,EAAE,EAAEA,EAAG;AACPC,IAAAA,SAAS,EAAEA,SAAU;AACrBvF,IAAAA,IAAI,EAAEA,IAAK;AACX2C,IAAAA,KAAK,EAAEA,KAAM;AACb6C,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,OAAO,EAAEA,OAAAA;AAAQ,GAAA,EAEhB1B,QACa,CAAC,CAAA;AAErB,EAAC;AAEDsC,QAAQ,CAACD,WAAW,GAAG,UAAU;;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../lib/utils/index.ts","../lib/components/Empty/Empty.tsx","../lib/helpers/index.ts","../lib/components/Button/Button.tsx","../lib/components/Checkbox/Checkbox.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","export const prefixClsForm = 'xUi-form';\nexport const prefixClsFormItem = 'xUi-form-item';\nexport const prefixClsEmpty = 'xUi-empty';\nexport const prefixClsInput = 'xUi-input';\nexport const prefixClsSelect = 'xUi-select';\nexport const prefixClsCheckbox = 'xUi-checkbox';\nexport const prefixClsRadio = 'xUi-radio';\nexport const prefixClsTextArea = 'xUi-textarea';\nexport const prefixClsUpload = 'xUi-upload';\nexport const prefixClsDatePicker = 'xUi-datepicker';\nexport const prefixClsRangePicker = 'xUi-rangepicker';\nexport const prefixClsTimePicker = 'xUi-timepicker';\nexport const prefixClsButton = 'xUi-button';\nexport const prefixClsSkeleton = 'xUi-skeleton';\n","import React from 'react';\nimport { EmptyProps } from '../../types/empty';\nimport { prefixClsEmpty } from '../../utils';\nimport './style.css';\n\nconst Empty = ({\n icon,\n style = {},\n className = '',\n title = 'No Data',\n description = 'No data',\n prefixCls = prefixClsEmpty\n}: EmptyProps) => (\n <div\n style={style}\n className={`${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`}\n >\n <div className={`${prefixCls}-image`}>\n {icon || (\n <svg\n width=\"64\"\n height=\"41\"\n viewBox=\"0 0 64 41\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>{title}</title>\n <g transform=\"translate(0 1)\" fill=\"none\">\n <ellipse fill=\"#f5f5f5\" cx=\"32\" cy=\"33\" rx=\"32\" ry=\"7\"></ellipse>\n <g stroke=\"#d9d9d9\">\n <path d=\"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z\"></path>\n <path\n d=\"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z\"\n fill=\"#fafafa\"\n ></path>\n </g>\n </g>\n </svg>\n )}\n </div>\n <div className={`${prefixCls}-description`}>{description}</div>\n </div>\n);\n\nexport default Empty;","import { RuleType } from '../types';\n\nexport const parseValue = (value: RuleType): RuleType => {\n if (value === 'true') {\n return true;\n }\n\n if (value === 'false') {\n return false;\n }\n\n if (!isNaN(Number(value))) {\n return Number(value);\n }\n\n return value;\n};\n\nexport function createArray(length: number): number[] {\n return Array.from({ length }, (_, index) => index);\n}\n\nexport function clsx(...args: RuleType[]): string {\n return args\n .flatMap(arg => {\n if (!arg) {\n return [];\n }\n\n if (typeof arg === 'string') {\n return [arg];\n }\n\n if (typeof arg === 'number') {\n return [String(arg)];\n }\n\n if (Array.isArray(arg)) {\n return clsx(...arg).split(' ');\n }\n\n if (typeof arg === 'object') {\n return Object.entries(arg)\n .filter(([, value]) => Boolean(value))\n .map(([key]) => key);\n }\n\n return [];\n })\n .filter(Boolean)\n .join(' ');\n}\n","import React, { ReactElement, ReactNode } from 'react';\nimport { clsx } from '../../helpers';\nimport { ButtonProps } from '../../types/button';\nimport { prefixClsButton } from '../../utils';\nimport './style.css';\n\nconst Button = ({\n type = 'default',\n variant = 'solid',\n color = 'default',\n shape = 'default',\n size = 'middle',\n htmlType = 'button',\n className,\n rootClassName,\n classNames: customClassNames = {},\n styles = {},\n prefixCls = prefixClsButton,\n iconPosition = 'start',\n disabled = false,\n ghost = false,\n danger = false,\n block = false,\n children,\n href,\n iconNode,\n isLoading = false,\n ...restProps\n}: ButtonProps & {\n iconNode?: ReactNode;\n isLoading?: boolean;\n}): ReactElement => {\n const classes = clsx(\n prefixCls,\n rootClassName,\n `${prefixCls}-${type}`,\n `${prefixCls}-${variant}`,\n `${prefixCls}-${color}`,\n `${prefixCls}-${shape}`,\n `${prefixCls}-size-${size}`,\n {\n [`${prefixCls}-block`]: block,\n [`${prefixCls}-ghost`]: ghost,\n [`${prefixCls}-danger`]: danger,\n [`${prefixCls}-loading`]: isLoading,\n [`${prefixCls}-disabled`]: disabled\n },\n className\n );\n\n const mergedDisabled = disabled || isLoading;\n\n const content = (\n <>\n {iconNode && iconPosition === 'start' && (\n <span\n className={clsx(`${prefixCls}-icon`, customClassNames.icon)}\n style={styles.icon}\n >\n {iconNode}\n </span>\n )}\n <span className={`${prefixCls}-content`}>{children}</span>\n {iconNode && iconPosition === 'end' && (\n <span\n className={clsx(`${prefixCls}-icon`, customClassNames.icon)}\n style={styles.icon}\n >\n {iconNode}\n </span>\n )}\n </>\n );\n\n if (href) {\n return (\n <a\n className={classes}\n href={mergedDisabled ? undefined : href}\n aria-disabled={mergedDisabled}\n >\n {content}\n </a>\n );\n }\n\n return (\n <button\n type={htmlType}\n className={classes}\n disabled={mergedDisabled}\n {...restProps}\n >\n {content}\n </button>\n );\n};\n\nexport default Button;\n","import React, { ForwardedRef, forwardRef, ReactElement } from 'react';\nimport { CheckboxProps } from '../../types/checkbox';\nimport { clsx } from '../../helpers';\n\nconst Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(\n (\n {\n prefixCls,\n className = '',\n style,\n disabled = false,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onKeyPress,\n onKeyDown,\n tabIndex,\n name,\n children,\n id,\n autoFocus,\n type = 'checkbox',\n required = false,\n noStyle,\n checked\n },\n ref: ForwardedRef<HTMLDivElement>\n ): ReactElement => {\n return (\n (\n <div className={`${prefixCls}-wrapper`}>\n <div\n ref={ref}\n style={style}\n onClick={onClick}\n className={clsx([\n prefixCls,\n className,\n {\n noStyle: noStyle,\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-checked`]: checked\n }\n ])}\n >\n <input\n id={id}\n type={type}\n name={name}\n disabled={disabled}\n tabIndex={tabIndex}\n required={required}\n autoFocus={autoFocus}\n onKeyDown={onKeyDown}\n onKeyPress={onKeyPress}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n />\n\n <span className={`${prefixCls}-box`}>\n <span\n className={`${prefixCls}-check`}\n style={{ opacity: Number(checked) }}\n />\n </span>\n </div>\n\n {children && <span className={`${prefixCls}-label`}>{children}</span>}\n </div>\n )\n );\n });\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","prefixClsEmpty","prefixClsButton","Empty","icon","className","title","description","prefixCls","React","width","height","viewBox","xmlns","transform","fill","cx","cy","rx","ry","stroke","d","clsx","args","flatMap","arg","String","Array","isArray","split","Object","entries","filter","value","Boolean","map","key","join","Button","variant","color","shape","size","htmlType","rootClassName","classNames","customClassNames","styles","iconPosition","disabled","ghost","danger","block","children","href","iconNode","isLoading","restProps","classes","mergedDisabled","content","Fragment","undefined","_extends","Checkbox","forwardRef","onClick","onMouseEnter","onMouseLeave","onKeyPress","onKeyDown","tabIndex","name","id","autoFocus","required","noStyle","checked","opacity","Number","displayName"],"mappings":";;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,GAAG,KAAK,KAAK,CAAC,EAAGA,GAAG,GAAG,EAAE,CAAA;AAC9B,EAAA,IAAIC,QAAQ,GAAGD,GAAG,CAACC,QAAQ,CAAA;AAE3B,EAAA,IAAI,CAACF,GAAG,IAAI,OAAOG,QAAQ,KAAK,WAAW,EAAE;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A,SAAS,EAAEA,SAAU;AACrBD,IAAAA,UAAU,EAAEA,UAAW;AACvBF,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,YAAY,EAAEA,YAAAA;AAAa,GAG7B,CAAA,eAAA3D,KAAA,CAAAhB,aAAA,CAAA,MAAA,EAAA;IAAMY,SAAS,EAAE,GAAGG,SAAS,CAAA,IAAA,CAAA;GAC3BC,eAAAA,KAAA,CAAAhB,aAAA,CAAA,MAAA,EAAA;IACEY,SAAS,EAAE,CAAGG,EAAAA,SAAS,CAAS,MAAA,CAAA;AAChChB,IAAAA,KAAK,EAAE;MAAEsF,OAAO,EAAEC,MAAM,CAACF,OAAO,CAAA;AAAG,KAAA;GAEvC,CAAM,CACH,CAEL,EAACxB,QAAQ,iBAAI5C,KAAA,CAAAhB,aAAA,CAAA,MAAA,EAAA;IAAMY,SAAS,EAAE,GAAGG,SAAS,CAAA,MAAA,CAAA;GAAW6C,EAAAA,QAAe,CACjE,CAAC,CAAA;AAGZ,CAAC,EAAC;AAEJW,QAAQ,CAACgB,WAAW,GAAG,UAAU;;;;;;","x_google_ignoreList":[0]}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import React, { useEffect, useMemo, useState } from 'react';
4
- import ButtonBase from './Button';
4
+ import Button from './Button';
5
5
  import { ButtonProps } from '../../types/button';
6
6
  import { prefixClsButton } from '../../utils';
7
7
 
@@ -33,7 +33,7 @@ const ButtonClient = (props: ButtonProps) => {
33
33
  : icon;
34
34
  }, [icon, innerLoading, loading, prefixCls]);
35
35
 
36
- return <ButtonBase {...props} isLoading={innerLoading} iconNode={iconNode} />;
36
+ return <Button {...props} isLoading={innerLoading} iconNode={iconNode} />;
37
37
  };
38
38
 
39
39
  export default ButtonClient;
@@ -8,35 +8,21 @@ import React, {
8
8
  useEffect,
9
9
  useState
10
10
  } from 'react';
11
- import { clsx } from '../../helpers';
12
11
  import { SyntheticBaseEvent } from '../../types';
13
12
  import { CheckboxProps } from '../../types/checkbox';
13
+ import Checkbox from './Checkbox';
14
14
  import './style.css';
15
15
 
16
16
  const CheckboxClient = forwardRef<HTMLDivElement, CheckboxProps>(
17
17
  (
18
18
  {
19
- prefixCls,
20
- className = '',
21
19
  defaultChecked = false,
22
20
  checked,
23
- style,
24
21
  disabled = false,
25
22
  onChange,
26
23
  onClick,
27
- onMouseEnter,
28
- onMouseLeave,
29
- onKeyPress,
30
- onKeyDown,
31
- tabIndex,
32
- name,
33
- children,
34
- id,
35
- autoFocus,
36
- type = 'checkbox',
37
24
  value = false,
38
- required = false,
39
- noStyle
25
+ ...props
40
26
  },
41
27
  ref: ForwardedRef<HTMLDivElement>
42
28
  ): ReactElement => {
@@ -66,46 +52,13 @@ const CheckboxClient = forwardRef<HTMLDivElement, CheckboxProps>(
66
52
  }, [checked]);
67
53
 
68
54
  return (
69
- <div className={`${prefixCls}-wrapper`}>
70
- <div
71
- ref={ref}
72
- style={style}
73
- onClick={handleClick}
74
- className={clsx([
75
- prefixCls,
76
- className,
77
- {
78
- noStyle: noStyle,
79
- [`${prefixCls}-disabled`]: disabled,
80
- [`${prefixCls}-checked`]: internalChecked
81
- }
82
- ])}
83
- >
84
- <input
85
- id={id}
86
- type={type}
87
- name={name}
88
- disabled={disabled}
89
- tabIndex={tabIndex}
90
- required={required}
91
- autoFocus={autoFocus}
92
- onKeyDown={onKeyDown}
93
- onKeyPress={onKeyPress}
94
- onMouseEnter={onMouseEnter}
95
- onMouseLeave={onMouseLeave}
96
- />
97
-
98
- <span className={`${prefixCls}-box`}>
99
- <span
100
- className={`${prefixCls}-check`}
101
- style={{ opacity: Number(internalChecked) }}
102
- />
103
- </span>
104
- </div>
105
-
106
- {children && <span className={`${prefixCls}-label`}>{children}</span>}
107
- </div>
108
- );
55
+ <Checkbox
56
+ ref={ref}
57
+ {...props}
58
+ onClick={handleClick}
59
+ checked={internalChecked}
60
+ />
61
+ )
109
62
  }
110
63
  );
111
64
 
@@ -1,58 +1,75 @@
1
- import React, { ReactElement } from 'react';
1
+ import React, { ForwardedRef, forwardRef, ReactElement } from 'react';
2
2
  import { CheckboxProps } from '../../types/checkbox';
3
- import { prefixClsCheckbox } from '../../utils';
4
- import CheckboxClient from './Checkbox.client';
3
+ import { clsx } from '../../helpers';
5
4
 
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
- };
5
+ const Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(
6
+ (
7
+ {
8
+ prefixCls,
9
+ className = '',
10
+ style,
11
+ disabled = false,
12
+ onClick,
13
+ onMouseEnter,
14
+ onMouseLeave,
15
+ onKeyPress,
16
+ onKeyDown,
17
+ tabIndex,
18
+ name,
19
+ children,
20
+ id,
21
+ autoFocus,
22
+ type = 'checkbox',
23
+ required = false,
24
+ noStyle,
25
+ checked
26
+ },
27
+ ref: ForwardedRef<HTMLDivElement>
28
+ ): ReactElement => {
29
+ return (
30
+ (
31
+ <div className={`${prefixCls}-wrapper`}>
32
+ <div
33
+ ref={ref}
34
+ style={style}
35
+ onClick={onClick}
36
+ className={clsx([
37
+ prefixCls,
38
+ className,
39
+ {
40
+ noStyle: noStyle,
41
+ [`${prefixCls}-disabled`]: disabled,
42
+ [`${prefixCls}-checked`]: checked
43
+ }
44
+ ])}
45
+ >
46
+ <input
47
+ id={id}
48
+ type={type}
49
+ name={name}
50
+ disabled={disabled}
51
+ tabIndex={tabIndex}
52
+ required={required}
53
+ autoFocus={autoFocus}
54
+ onKeyDown={onKeyDown}
55
+ onKeyPress={onKeyPress}
56
+ onMouseEnter={onMouseEnter}
57
+ onMouseLeave={onMouseLeave}
58
+ />
59
+
60
+ <span className={`${prefixCls}-box`}>
61
+ <span
62
+ className={`${prefixCls}-check`}
63
+ style={{ opacity: Number(checked) }}
64
+ />
65
+ </span>
66
+ </div>
67
+
68
+ {children && <span className={`${prefixCls}-label`}>{children}</span>}
69
+ </div>
70
+ )
71
+ );
72
+ });
56
73
 
57
74
  Checkbox.displayName = 'Checkbox';
58
75
 
@@ -1,48 +1,12 @@
1
1
  'use client';
2
2
 
3
- import React, { useEffect } from 'react';
4
- import { EmptyContentProps } from '../../types/empty';
5
- import { prefixClsEmpty } from '../../utils';
3
+ import React from 'react';
4
+ import { EmptyProps } from '../../types/empty';
5
+ import Empty from './Empty';
6
6
  import './style.css';
7
7
 
8
- const EmptyClient = ({
9
- icon,
10
- style = {},
11
- className = '',
12
- title = 'No Data',
13
- description = 'No data',
14
- prefixCls = prefixClsEmpty
15
- }: EmptyContentProps) => {
16
- useEffect(() => {}, [])
17
- return (
18
- <div
19
- style={style}
20
- className={`${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`}
21
- >
22
- <div className={`${prefixCls}-image`}>
23
- {icon || (
24
- <svg
25
- width="64"
26
- height="41"
27
- viewBox="0 0 64 41"
28
- xmlns="http://www.w3.org/2000/svg"
29
- >
30
- <title>{title}</title>
31
- <g transform="translate(0 1)" fill="none">
32
- <ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse>
33
- <g stroke="#d9d9d9">
34
- <path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path>
35
- <path
36
- d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
37
- fill="#fafafa"
38
- ></path>
39
- </g>
40
- </g>
41
- </svg>
42
- )}
43
- </div>
44
- <div className={`${prefixCls}-description`}>{description}</div>
45
- </div>
46
- )};
8
+ const EmptyClient = (props: EmptyProps) => (
9
+ <Empty {...props} />
10
+ );
47
11
 
48
12
  export default EmptyClient;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { EmptyContentProps } from '../../types/empty';
2
+ import { EmptyProps } from '../../types/empty';
3
3
  import { prefixClsEmpty } from '../../utils';
4
- import EmptyContentClient from './Empty.client';
4
+ import './style.css';
5
5
 
6
6
  const Empty = ({
7
7
  icon,
@@ -10,17 +10,35 @@ const Empty = ({
10
10
  title = 'No Data',
11
11
  description = 'No data',
12
12
  prefixCls = prefixClsEmpty
13
- }: EmptyContentProps) => {
14
- return (
15
- <EmptyContentClient
16
- icon={icon}
17
- style={style}
18
- className={className}
19
- title={title}
20
- description={description}
21
- prefixCls={prefixCls}
22
- />
23
- );
24
- };
13
+ }: EmptyProps) => (
14
+ <div
15
+ style={style}
16
+ className={`${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`}
17
+ >
18
+ <div className={`${prefixCls}-image`}>
19
+ {icon || (
20
+ <svg
21
+ width="64"
22
+ height="41"
23
+ viewBox="0 0 64 41"
24
+ xmlns="http://www.w3.org/2000/svg"
25
+ >
26
+ <title>{title}</title>
27
+ <g transform="translate(0 1)" fill="none">
28
+ <ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse>
29
+ <g stroke="#d9d9d9">
30
+ <path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path>
31
+ <path
32
+ d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
33
+ fill="#fafafa"
34
+ ></path>
35
+ </g>
36
+ </g>
37
+ </svg>
38
+ )}
39
+ </div>
40
+ <div className={`${prefixCls}-description`}>{description}</div>
41
+ </div>
42
+ );
25
43
 
26
44
  export default Empty;
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DefaultProps } from '.';
3
3
 
4
- export type EmptyContentProps = DefaultProps & {
4
+ export type EmptyProps = DefaultProps & {
5
5
  title?: string;
6
6
  description?: string;
7
7
  icon?: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-ui-design",
3
- "version": "0.2.26",
3
+ "version": "0.2.28",
4
4
  "license": "ISC",
5
5
  "author": "Gabriel Boyajyan",
6
6
  "main": "dist/index.js",