x-ui-design 0.2.44 → 0.2.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/types/lib/components/Checkbox/Checkbox.client.d.ts +23 -0
- package/dist/esm/types/lib/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/esm/types/lib/components/Checkbox/index.d.ts +1 -0
- package/dist/esm/types/lib/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +91 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +93 -10
- package/dist/index.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.client.tsx +113 -0
- package/lib/components/Checkbox/Checkbox.tsx +9 -0
- package/lib/components/Checkbox/index.ts +1 -0
- package/lib/components/Checkbox/style.css +91 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import './style.css';
|
|
3
|
+
declare const Checkbox: 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 Checkbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Checkbox } from '@/components/Checkbox/Checkbox';
|
package/dist/index.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React$1, { forwardRef, useState, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
function styleInject(css, ref) {
|
|
4
4
|
if (ref === void 0) ref = {};
|
|
@@ -25,8 +25,8 @@ function styleInject(css, ref) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var css_248z$
|
|
29
|
-
styleInject(css_248z$
|
|
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
|
function _extends() {
|
|
32
32
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -59,10 +59,11 @@ function clsx(...args) {
|
|
|
59
59
|
}).filter(Boolean).join(' ');
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
const prefixClsCheckbox = 'xUi-checkbox';
|
|
62
63
|
const prefixClsButton = 'xUi-button';
|
|
63
64
|
|
|
64
|
-
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}";
|
|
65
|
-
styleInject(css_248z);
|
|
65
|
+
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}";
|
|
66
|
+
styleInject(css_248z$1);
|
|
66
67
|
|
|
67
68
|
const Button = ({
|
|
68
69
|
type = 'default',
|
|
@@ -95,28 +96,107 @@ const Button = ({
|
|
|
95
96
|
[`${prefixCls}-disabled`]: disabled
|
|
96
97
|
}, className);
|
|
97
98
|
const mergedDisabled = disabled || isLoading;
|
|
98
|
-
const content = /*#__PURE__*/React.createElement(React.Fragment, null, iconNode && iconPosition === 'start' && /*#__PURE__*/React.createElement("span", {
|
|
99
|
+
const content = /*#__PURE__*/React$1.createElement(React$1.Fragment, null, iconNode && iconPosition === 'start' && /*#__PURE__*/React$1.createElement("span", {
|
|
99
100
|
className: clsx(`${prefixCls}-icon`, customClassNames.icon),
|
|
100
101
|
style: styles.icon
|
|
101
|
-
}, iconNode), /*#__PURE__*/React.createElement("span", {
|
|
102
|
+
}, iconNode), /*#__PURE__*/React$1.createElement("span", {
|
|
102
103
|
className: `${prefixCls}-content`
|
|
103
|
-
}, children), iconNode && iconPosition === 'end' && /*#__PURE__*/React.createElement("span", {
|
|
104
|
+
}, children), iconNode && iconPosition === 'end' && /*#__PURE__*/React$1.createElement("span", {
|
|
104
105
|
className: clsx(`${prefixCls}-icon`, customClassNames.icon),
|
|
105
106
|
style: styles.icon
|
|
106
107
|
}, iconNode));
|
|
107
108
|
if (href) {
|
|
108
|
-
return /*#__PURE__*/React.createElement("a", {
|
|
109
|
+
return /*#__PURE__*/React$1.createElement("a", {
|
|
109
110
|
className: classes,
|
|
110
111
|
href: mergedDisabled ? undefined : href,
|
|
111
112
|
"aria-disabled": mergedDisabled
|
|
112
113
|
}, content);
|
|
113
114
|
}
|
|
114
|
-
return /*#__PURE__*/React.createElement("button", _extends({
|
|
115
|
+
return /*#__PURE__*/React$1.createElement("button", _extends({
|
|
115
116
|
type: htmlType,
|
|
116
117
|
className: classes,
|
|
117
118
|
disabled: mergedDisabled
|
|
118
119
|
}, restProps), content);
|
|
119
120
|
};
|
|
120
121
|
|
|
121
|
-
|
|
122
|
+
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}";
|
|
123
|
+
styleInject(css_248z);
|
|
124
|
+
|
|
125
|
+
const Checkbox = /*#__PURE__*/forwardRef(({
|
|
126
|
+
prefixCls = prefixClsCheckbox,
|
|
127
|
+
className = '',
|
|
128
|
+
defaultChecked = false,
|
|
129
|
+
checked,
|
|
130
|
+
style,
|
|
131
|
+
disabled = false,
|
|
132
|
+
onChange,
|
|
133
|
+
onClick,
|
|
134
|
+
onMouseEnter,
|
|
135
|
+
onMouseLeave,
|
|
136
|
+
onKeyPress,
|
|
137
|
+
onKeyDown,
|
|
138
|
+
tabIndex,
|
|
139
|
+
name,
|
|
140
|
+
children,
|
|
141
|
+
id,
|
|
142
|
+
autoFocus,
|
|
143
|
+
type = 'checkbox',
|
|
144
|
+
value = false,
|
|
145
|
+
required = false,
|
|
146
|
+
noStyle
|
|
147
|
+
}, ref) => {
|
|
148
|
+
const isChecked = checked !== undefined ? checked : defaultChecked || value;
|
|
149
|
+
const [internalChecked, setInternalChecked] = useState(isChecked);
|
|
150
|
+
const handleClick = e => {
|
|
151
|
+
e.stopPropagation();
|
|
152
|
+
if (disabled) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
setInternalChecked(!internalChecked);
|
|
156
|
+
e.target.value = !internalChecked;
|
|
157
|
+
onClick?.(e);
|
|
158
|
+
onChange?.(e);
|
|
159
|
+
};
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (checked !== undefined) {
|
|
162
|
+
setInternalChecked(checked);
|
|
163
|
+
}
|
|
164
|
+
}, [checked]);
|
|
165
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
166
|
+
className: `${prefixCls}-wrapper`
|
|
167
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
ref: ref,
|
|
169
|
+
style: style,
|
|
170
|
+
onClick: handleClick,
|
|
171
|
+
className: clsx([prefixCls, className, {
|
|
172
|
+
noStyle: noStyle,
|
|
173
|
+
[`${prefixCls}-disabled`]: disabled,
|
|
174
|
+
[`${prefixCls}-checked`]: internalChecked
|
|
175
|
+
}])
|
|
176
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
177
|
+
id: id,
|
|
178
|
+
type: type,
|
|
179
|
+
name: name,
|
|
180
|
+
disabled: disabled,
|
|
181
|
+
tabIndex: tabIndex,
|
|
182
|
+
required: required,
|
|
183
|
+
autoFocus: autoFocus,
|
|
184
|
+
onKeyDown: onKeyDown,
|
|
185
|
+
onKeyPress: onKeyPress,
|
|
186
|
+
onMouseEnter: onMouseEnter,
|
|
187
|
+
onMouseLeave: onMouseLeave
|
|
188
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
189
|
+
className: `${prefixCls}-box`
|
|
190
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
191
|
+
className: `${prefixCls}-check`,
|
|
192
|
+
style: {
|
|
193
|
+
opacity: Number(internalChecked)
|
|
194
|
+
}
|
|
195
|
+
}))), children && /*#__PURE__*/React.createElement("span", {
|
|
196
|
+
className: `${prefixCls}-label`
|
|
197
|
+
}, children));
|
|
198
|
+
});
|
|
199
|
+
Checkbox.displayName = 'Checkbox';
|
|
200
|
+
|
|
201
|
+
export { Button, Checkbox as default };
|
|
122
202
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../../lib/helpers/index.ts","../../lib/utils/index.ts","../../lib/components/Button/Button.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","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","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, { 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"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","clsx","args","flatMap","arg","String","Array","isArray","split","Object","entries","filter","value","Boolean","map","key","join","prefixClsButton","Button","variant","color","shape","size","htmlType","className","rootClassName","classNames","customClassNames","styles","prefixCls","iconPosition","disabled","ghost","danger","block","children","href","iconNode","isLoading","restProps","classes","mergedDisabled","content","React","Fragment","icon","undefined","_extends"],"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;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,EAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;EAC3CD,KAAK,CAACE,IAAI,GAAG,UAAU,CAAA;EAEvB,IAAIN,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAIE,IAAI,CAACK,UAAU,EAAE;MACnBL,IAAI,CAACM,YAAY,CAACJ,KAAK,EAAEF,IAAI,CAACK,UAAU,CAAC,CAAA;AAC3C,KAAC,MAAM;AACLL,MAAAA,IAAI,CAACO,WAAW,CAACL,KAAK,CAAC,CAAA;AACzB,KAAA;AACF,GAAC,MAAM;AACLF,IAAAA,IAAI,CAACO,WAAW,CAACL,KAAK,CAAC,CAAA;AACzB,GAAA;EAEA,IAAIA,KAAK,CAACM,UAAU,EAAE;AACpBN,IAAAA,KAAK,CAACM,U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AEgB,OAAQ;AACnBT,IAAAA,QAAQ,EAAEU,cAAAA;GACNF,EAAAA,SAAS,CAEZG,EAAAA,OACK,CAAC,CAAA;AAEb;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../../lib/helpers/index.ts","../../lib/utils/index.ts","../../lib/components/Button/Button.tsx","../../lib/components/Checkbox/Checkbox.client.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","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","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, { 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 {\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 { prefixClsCheckbox } from '../../utils';\nimport './style.css';\n\nconst Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(\n (\n {\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 },\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\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","clsx","args","flatMap","arg","String","Array","isArray","split","Object","entries","filter","value","Boolean","map","key","join","prefixClsCheckbox","prefixClsButton","Button","variant","color","shape","size","htmlType","className","rootClassName","classNames","customClassNames","styles","prefixCls","iconPosition","disabled","ghost","danger","block","children","href","iconNode","isLoading","restProps","classes","mergedDisabled","content","React","Fragment","icon","undefined","_extends","Checkbox","forwardRef","defaultChecked","checked","onChange","onClick","onMouseEnter","onMouseLeave","onKeyPress","onKeyDown","tabIndex","name","id","autoFocus","required","noStyle","isChecked","internalChecked","setInternalChecked","useState","handleClick","e","stopPropagation","target","useEffect","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;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,EAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;EAC3CD,KA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5B,IAAAA,QAAQ,EAAEA,QAAS;AACnB2B,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,eAAAZ,KAAA,CAAAnD,aAAA,CAAA,MAAA,EAAA;IAAMgC,SAAS,EAAE,GAAGK,SAAS,CAAA,IAAA,CAAA;GAC3Bc,eAAAA,KAAA,CAAAnD,aAAA,CAAA,MAAA,EAAA;IACEgC,SAAS,EAAE,CAAGK,EAAAA,SAAS,CAAS,MAAA,CAAA;AAChCtC,IAAAA,KAAK,EAAE;MAAEkF,OAAO,EAAEC,MAAM,CAACT,eAAe,CAAA;AAAG,KAAA;GAE/C,CAAM,CACH,CAEL,EAAC9B,QAAQ,iBAAIQ,KAAA,CAAAnD,aAAA,CAAA,MAAA,EAAA;IAAMgC,SAAS,EAAE,GAAGK,SAAS,CAAA,MAAA,CAAA;GAAWM,EAAAA,QAAe,CACjE,CAAC,CAAA;AAEV,CAAC,EACF;AAEDa,QAAQ,CAAC2B,WAAW,GAAG,UAAU;;;;","x_google_ignoreList":[0]}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React$1 = require('react');
|
|
4
6
|
|
|
5
7
|
function styleInject(css, ref) {
|
|
6
8
|
if (ref === void 0) ref = {};
|
|
@@ -27,8 +29,8 @@ function styleInject(css, ref) {
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
var css_248z$
|
|
31
|
-
styleInject(css_248z$
|
|
32
|
+
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}";
|
|
33
|
+
styleInject(css_248z$2);
|
|
32
34
|
|
|
33
35
|
function _extends() {
|
|
34
36
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -61,10 +63,11 @@ function clsx(...args) {
|
|
|
61
63
|
}).filter(Boolean).join(' ');
|
|
62
64
|
}
|
|
63
65
|
|
|
66
|
+
const prefixClsCheckbox = 'xUi-checkbox';
|
|
64
67
|
const prefixClsButton = 'xUi-button';
|
|
65
68
|
|
|
66
|
-
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}";
|
|
67
|
-
styleInject(css_248z);
|
|
69
|
+
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}";
|
|
70
|
+
styleInject(css_248z$1);
|
|
68
71
|
|
|
69
72
|
const Button = ({
|
|
70
73
|
type = 'default',
|
|
@@ -97,28 +100,108 @@ const Button = ({
|
|
|
97
100
|
[`${prefixCls}-disabled`]: disabled
|
|
98
101
|
}, className);
|
|
99
102
|
const mergedDisabled = disabled || isLoading;
|
|
100
|
-
const content = /*#__PURE__*/React.createElement(React.Fragment, null, iconNode && iconPosition === 'start' && /*#__PURE__*/React.createElement("span", {
|
|
103
|
+
const content = /*#__PURE__*/React$1.createElement(React$1.Fragment, null, iconNode && iconPosition === 'start' && /*#__PURE__*/React$1.createElement("span", {
|
|
101
104
|
className: clsx(`${prefixCls}-icon`, customClassNames.icon),
|
|
102
105
|
style: styles.icon
|
|
103
|
-
}, iconNode), /*#__PURE__*/React.createElement("span", {
|
|
106
|
+
}, iconNode), /*#__PURE__*/React$1.createElement("span", {
|
|
104
107
|
className: `${prefixCls}-content`
|
|
105
|
-
}, children), iconNode && iconPosition === 'end' && /*#__PURE__*/React.createElement("span", {
|
|
108
|
+
}, children), iconNode && iconPosition === 'end' && /*#__PURE__*/React$1.createElement("span", {
|
|
106
109
|
className: clsx(`${prefixCls}-icon`, customClassNames.icon),
|
|
107
110
|
style: styles.icon
|
|
108
111
|
}, iconNode));
|
|
109
112
|
if (href) {
|
|
110
|
-
return /*#__PURE__*/React.createElement("a", {
|
|
113
|
+
return /*#__PURE__*/React$1.createElement("a", {
|
|
111
114
|
className: classes,
|
|
112
115
|
href: mergedDisabled ? undefined : href,
|
|
113
116
|
"aria-disabled": mergedDisabled
|
|
114
117
|
}, content);
|
|
115
118
|
}
|
|
116
|
-
return /*#__PURE__*/React.createElement("button", _extends({
|
|
119
|
+
return /*#__PURE__*/React$1.createElement("button", _extends({
|
|
117
120
|
type: htmlType,
|
|
118
121
|
className: classes,
|
|
119
122
|
disabled: mergedDisabled
|
|
120
123
|
}, restProps), content);
|
|
121
124
|
};
|
|
122
125
|
|
|
126
|
+
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}";
|
|
127
|
+
styleInject(css_248z);
|
|
128
|
+
|
|
129
|
+
const Checkbox = /*#__PURE__*/React$1.forwardRef(({
|
|
130
|
+
prefixCls = prefixClsCheckbox,
|
|
131
|
+
className = '',
|
|
132
|
+
defaultChecked = false,
|
|
133
|
+
checked,
|
|
134
|
+
style,
|
|
135
|
+
disabled = false,
|
|
136
|
+
onChange,
|
|
137
|
+
onClick,
|
|
138
|
+
onMouseEnter,
|
|
139
|
+
onMouseLeave,
|
|
140
|
+
onKeyPress,
|
|
141
|
+
onKeyDown,
|
|
142
|
+
tabIndex,
|
|
143
|
+
name,
|
|
144
|
+
children,
|
|
145
|
+
id,
|
|
146
|
+
autoFocus,
|
|
147
|
+
type = 'checkbox',
|
|
148
|
+
value = false,
|
|
149
|
+
required = false,
|
|
150
|
+
noStyle
|
|
151
|
+
}, ref) => {
|
|
152
|
+
const isChecked = checked !== undefined ? checked : defaultChecked || value;
|
|
153
|
+
const [internalChecked, setInternalChecked] = React$1.useState(isChecked);
|
|
154
|
+
const handleClick = e => {
|
|
155
|
+
e.stopPropagation();
|
|
156
|
+
if (disabled) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
setInternalChecked(!internalChecked);
|
|
160
|
+
e.target.value = !internalChecked;
|
|
161
|
+
onClick?.(e);
|
|
162
|
+
onChange?.(e);
|
|
163
|
+
};
|
|
164
|
+
React$1.useEffect(() => {
|
|
165
|
+
if (checked !== undefined) {
|
|
166
|
+
setInternalChecked(checked);
|
|
167
|
+
}
|
|
168
|
+
}, [checked]);
|
|
169
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
170
|
+
className: `${prefixCls}-wrapper`
|
|
171
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
172
|
+
ref: ref,
|
|
173
|
+
style: style,
|
|
174
|
+
onClick: handleClick,
|
|
175
|
+
className: clsx([prefixCls, className, {
|
|
176
|
+
noStyle: noStyle,
|
|
177
|
+
[`${prefixCls}-disabled`]: disabled,
|
|
178
|
+
[`${prefixCls}-checked`]: internalChecked
|
|
179
|
+
}])
|
|
180
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
181
|
+
id: id,
|
|
182
|
+
type: type,
|
|
183
|
+
name: name,
|
|
184
|
+
disabled: disabled,
|
|
185
|
+
tabIndex: tabIndex,
|
|
186
|
+
required: required,
|
|
187
|
+
autoFocus: autoFocus,
|
|
188
|
+
onKeyDown: onKeyDown,
|
|
189
|
+
onKeyPress: onKeyPress,
|
|
190
|
+
onMouseEnter: onMouseEnter,
|
|
191
|
+
onMouseLeave: onMouseLeave
|
|
192
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
193
|
+
className: `${prefixCls}-box`
|
|
194
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
195
|
+
className: `${prefixCls}-check`,
|
|
196
|
+
style: {
|
|
197
|
+
opacity: Number(internalChecked)
|
|
198
|
+
}
|
|
199
|
+
}))), children && /*#__PURE__*/React.createElement("span", {
|
|
200
|
+
className: `${prefixCls}-label`
|
|
201
|
+
}, children));
|
|
202
|
+
});
|
|
203
|
+
Checkbox.displayName = 'Checkbox';
|
|
204
|
+
|
|
123
205
|
exports.Button = Button;
|
|
206
|
+
exports.default = Checkbox;
|
|
124
207
|
//# sourceMappingURL=index.js.map
|
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/helpers/index.ts","../../lib/utils/index.ts","../../lib/components/Button/Button.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","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","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, { 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"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","clsx","args","flatMap","arg","String","Array","isArray","split","Object","entries","filter","value","Boolean","map","key","join","prefixClsButton","Button","variant","color","shape","size","htmlType","className","rootClassName","classNames","customClassNames","styles","prefixCls","iconPosition","disabled","ghost","danger","block","children","href","iconNode","isLoading","restProps","classes","mergedDisabled","content","React","Fragment","icon","undefined","_extends"],"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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EAAA;IAAM+B,SAAS,EAAE,GAAGK,SAAS,CAAA,QAAA,CAAA;GAAaM,EAAAA,QAAe,CACzD,EAACE,QAAQ,IAAIP,YAAY,KAAK,KAAK,iBACjCa,KAAA,CAAAlD,aAAA,CAAA,MAAA,EAAA;IACE+B,SAAS,EAAEvB,IAAI,CAAC,CAAG4B,EAAAA,SAAS,OAAO,EAAEF,gBAAgB,CAACkB,IAAI,CAAE;IAC5DrD,KAAK,EAAEoC,MAAM,CAACiB,IAAAA;GAEbR,EAAAA,QACG,CAEV,CACD,CAAA;AAED,EAAA,IAAID,IAAI,EAAE;IACR,oBACEO,KAAA,CAAAlD,aAAA,CAAA,GAAA,EAAA;AACE+B,MAAAA,SAAS,EAAEgB,OAAQ;AACnBJ,MAAAA,IAAI,EAAEK,cAAc,GAAGK,SAAS,GAAGV,IAAK;MACxC,eAAeK,EAAAA,cAAAA;AAAe,KAAA,EAE7BC,OACA,CAAC,CAAA;AAER,GAAA;AAEA,EAAA,oBACEC,KAAA,CAAAlD,aAAA,CAAA,QAAA,EAAAsD,QAAA,CAAA;AACErD,IAAAA,IAAI,EAAE6B,QAAS;AACfC,IAAAA,SAAS,EAAEgB,OAAQ;AACnBT,IAAAA,QAAQ,EAAEU,cAAAA;GACNF,EAAAA,SAAS,CAEZG,EAAAA,OACK,CAAC,CAAA;AAEb;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../../lib/helpers/index.ts","../../lib/utils/index.ts","../../lib/components/Button/Button.tsx","../../lib/components/Checkbox/Checkbox.client.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","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","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, { 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 {\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 { prefixClsCheckbox } from '../../utils';\nimport './style.css';\n\nconst Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(\n (\n {\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 },\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\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","clsx","args","flatMap","arg","String","Array","isArray","split","Object","entries","filter","value","Boolean","map","key","join","prefixClsCheckbox","prefixClsButton","Button","variant","color","shape","size","htmlType","className","rootClassName","classNames","customClassNames","styles","prefixCls","iconPosition","disabled","ghost","danger","block","children","href","iconNode","isLoading","restProps","classes","mergedDisabled","content","React","Fragment","icon","undefined","_extends","Checkbox","forwardRef","defaultChecked","checked","onChange","onClick","onMouseEnter","onMouseLeave","onKeyPress","onKeyDown","tabIndex","name","id","autoFocus","required","noStyle","isChecked","internalChecked","setInternalChecked","useState","handleClick","e","stopPropagation","target","useEffect","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;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,EAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;EAC3CD,KAAK,CAACE,IAAI,GAAG,UAAU,CAAA;EAEvB,IAAIN,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAIE,IAAI,CAACK,UAAU,EAAE;MACnBL,IAAI,CAACM,YAAY,CAACJ,KAAK,EAAEF,IAAI,CAACK,UAAU,CAAC,CAAA;AAC3C,KAAC,MAAM;AACLL,MAAAA,IAAI,CAACO,WAAW,CAACL,KAAK,CAAC,CAAA;AACzB,KAAA;AACF,GAAC,MAAM;AACLF,IAAAA,IAAI,CAACO,WAAW,CAACL,KAAK,CAAC,CAAA;AACzB,GAAA;EAEA,IAAIA,KAAK,CAACM,UAAU,EAAE;AACpBN,IAAAA,KAAK,CAACM,UAAU,CAACC,OAAO,GAAGb,GAAG,CAAA;AAChC,GAAC,MAAM;IACLM,KAAK,CAACK,WAAW,CAAC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AAA;AAChCtC,IAAAA,KAAK,EAAE;MAAEkF,OAAO,EAAEC,MAAM,CAACT,eAAe,CAAA;AAAG,KAAA;GAE/C,CAAM,CACH,CAEL,EAAC9B,QAAQ,iBAAIQ,KAAA,CAAAnD,aAAA,CAAA,MAAA,EAAA;IAAMgC,SAAS,EAAE,GAAGK,SAAS,CAAA,MAAA,CAAA;GAAWM,EAAAA,QAAe,CACjE,CAAC,CAAA;AAEV,CAAC,EACF;AAEDa,QAAQ,CAAC2B,WAAW,GAAG,UAAU;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ForwardedRef,
|
|
3
|
+
forwardRef,
|
|
4
|
+
MouseEvent,
|
|
5
|
+
ReactElement,
|
|
6
|
+
useEffect,
|
|
7
|
+
useState
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { clsx } from '../../helpers';
|
|
10
|
+
import { SyntheticBaseEvent } from '../../types';
|
|
11
|
+
import { CheckboxProps } from '../../types/checkbox';
|
|
12
|
+
import { prefixClsCheckbox } from '../../utils';
|
|
13
|
+
import './style.css';
|
|
14
|
+
|
|
15
|
+
const Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(
|
|
16
|
+
(
|
|
17
|
+
{
|
|
18
|
+
prefixCls = prefixClsCheckbox,
|
|
19
|
+
className = '',
|
|
20
|
+
defaultChecked = false,
|
|
21
|
+
checked,
|
|
22
|
+
style,
|
|
23
|
+
disabled = false,
|
|
24
|
+
onChange,
|
|
25
|
+
onClick,
|
|
26
|
+
onMouseEnter,
|
|
27
|
+
onMouseLeave,
|
|
28
|
+
onKeyPress,
|
|
29
|
+
onKeyDown,
|
|
30
|
+
tabIndex,
|
|
31
|
+
name,
|
|
32
|
+
children,
|
|
33
|
+
id,
|
|
34
|
+
autoFocus,
|
|
35
|
+
type = 'checkbox',
|
|
36
|
+
value = false,
|
|
37
|
+
required = false,
|
|
38
|
+
noStyle
|
|
39
|
+
},
|
|
40
|
+
ref: ForwardedRef<HTMLDivElement>
|
|
41
|
+
): ReactElement => {
|
|
42
|
+
const isChecked = checked !== undefined ? checked : defaultChecked || value;
|
|
43
|
+
const [internalChecked, setInternalChecked] = useState(isChecked);
|
|
44
|
+
|
|
45
|
+
const handleClick = (
|
|
46
|
+
e: MouseEvent<HTMLInputElement> & SyntheticBaseEvent
|
|
47
|
+
) => {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
|
|
50
|
+
if (disabled) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
setInternalChecked(!internalChecked);
|
|
55
|
+
e.target.value = !internalChecked;
|
|
56
|
+
|
|
57
|
+
onClick?.(e);
|
|
58
|
+
onChange?.(e);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (checked !== undefined) {
|
|
63
|
+
setInternalChecked(checked);
|
|
64
|
+
}
|
|
65
|
+
}, [checked]);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div className={`${prefixCls}-wrapper`}>
|
|
69
|
+
<div
|
|
70
|
+
ref={ref}
|
|
71
|
+
style={style}
|
|
72
|
+
onClick={handleClick}
|
|
73
|
+
className={clsx([
|
|
74
|
+
prefixCls,
|
|
75
|
+
className,
|
|
76
|
+
{
|
|
77
|
+
noStyle: noStyle,
|
|
78
|
+
[`${prefixCls}-disabled`]: disabled,
|
|
79
|
+
[`${prefixCls}-checked`]: internalChecked
|
|
80
|
+
}
|
|
81
|
+
])}
|
|
82
|
+
>
|
|
83
|
+
<input
|
|
84
|
+
id={id}
|
|
85
|
+
type={type}
|
|
86
|
+
name={name}
|
|
87
|
+
disabled={disabled}
|
|
88
|
+
tabIndex={tabIndex}
|
|
89
|
+
required={required}
|
|
90
|
+
autoFocus={autoFocus}
|
|
91
|
+
onKeyDown={onKeyDown}
|
|
92
|
+
onKeyPress={onKeyPress}
|
|
93
|
+
onMouseEnter={onMouseEnter}
|
|
94
|
+
onMouseLeave={onMouseLeave}
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<span className={`${prefixCls}-box`}>
|
|
98
|
+
<span
|
|
99
|
+
className={`${prefixCls}-check`}
|
|
100
|
+
style={{ opacity: Number(internalChecked) }}
|
|
101
|
+
/>
|
|
102
|
+
</span>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
{children && <span className={`${prefixCls}-label`}>{children}</span>}
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
Checkbox.displayName = 'Checkbox';
|
|
112
|
+
|
|
113
|
+
export default Checkbox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import dynamic from 'next/dynamic';
|
|
2
|
+
import { CheckboxProps } from '../../types/checkbox';
|
|
3
|
+
|
|
4
|
+
// Dynamically import the client version with "ssr: false" for Next.js
|
|
5
|
+
const ClientCheckbox = dynamic(() => import('./Checkbox.client'), { ssr: false });
|
|
6
|
+
|
|
7
|
+
export default function Checkbox(props: CheckboxProps) {
|
|
8
|
+
return <ClientCheckbox {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Checkbox } from '@/components/Checkbox/Checkbox'
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
.xUi-checkbox-wrapper {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
font-size: var(--xui-font-size-md);
|
|
4
|
+
align-items: center;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
color: var(--xui-main-color);
|
|
7
|
+
margin: 16px 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.xUi-checkbox {
|
|
11
|
+
width: 14px;
|
|
12
|
+
height: 14px;
|
|
13
|
+
position: relative;
|
|
14
|
+
border-radius: var(--xui-border-radius-sm);
|
|
15
|
+
transition: all 0.3s;
|
|
16
|
+
display: inline-block;
|
|
17
|
+
background-color: transparent;
|
|
18
|
+
border: 1px solid var(--xui-border-color);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.xUi-checkbox.xUi-checkbox-checked {
|
|
22
|
+
border-color: var(--xui-primary-color);
|
|
23
|
+
background-color: #f0f5ff;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.xUi-checkbox input {
|
|
27
|
+
inset: 0;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
position: absolute;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.xUi-checkbox-inner {
|
|
34
|
+
top: 50%;
|
|
35
|
+
left: 50%;
|
|
36
|
+
width: 10px;
|
|
37
|
+
height: 6px;
|
|
38
|
+
border-top: 0;
|
|
39
|
+
border-left: 0;
|
|
40
|
+
position: absolute;
|
|
41
|
+
border: 2px solid var(--xui-background-color);
|
|
42
|
+
transform: rotate(45deg) scale(0);
|
|
43
|
+
transition: transform 0.2s ease-in-out;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.xUi-checkbox-check {
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
display: block;
|
|
50
|
+
position: relative;
|
|
51
|
+
transition: 0.1s ease;
|
|
52
|
+
border-color: var(--xui-primary-color);
|
|
53
|
+
background-color: var(--xui-primary-color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.xUi-checkbox-check::after {
|
|
57
|
+
top: 1px;
|
|
58
|
+
left: 3px;
|
|
59
|
+
width: 5px;
|
|
60
|
+
height: 8px;
|
|
61
|
+
content: "";
|
|
62
|
+
position: absolute;
|
|
63
|
+
border: solid white;
|
|
64
|
+
transform: rotate(45deg);
|
|
65
|
+
border-width: 0 2px 2px 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.xUi-checkbox-disabled,
|
|
69
|
+
.xUi-checkbox-disabled .xUi-checkbox-check {
|
|
70
|
+
opacity: 0.5;
|
|
71
|
+
cursor: not-allowed;
|
|
72
|
+
background-color: var(--xui-color-disabled);
|
|
73
|
+
border-color: var(--xui-border-color) !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.xUi-checkbox-label {
|
|
77
|
+
margin-left: 8px;
|
|
78
|
+
user-select: none;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.xUi-checkbox:hover:not(.disabled),
|
|
83
|
+
.xUi-checkbox:focus:not(.disabled) {
|
|
84
|
+
border-color: var(--xui-primary-color);
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.xUi-checkbox.disabled {
|
|
89
|
+
opacity: 0.5;
|
|
90
|
+
cursor: not-allowed;
|
|
91
|
+
}
|
package/lib/index.ts
CHANGED