x-ui-design 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/types/components/Button/Button.client.d.ts +2 -2
- package/dist/esm/types/components/Button/Button.d.ts +3 -4
- package/dist/esm/types/components/Checkbox/Checkbox.client.d.ts +23 -0
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +7 -0
- package/dist/esm/types/components/Checkbox/index.d.ts +1 -0
- package/dist/esm/types/types/checkbox.d.ts +22 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.esm.js +33 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +33 -2
- package/dist/index.js.map +1 -1
- package/{src/components/Checkbox/Checkbox.tsx → lib/components/Checkbox/Checkbox.client.tsx} +4 -5
- package/lib/components/Checkbox/Checkbox.tsx +59 -0
- package/{src → lib}/types/checkbox.ts +1 -1
- package/package.json +1 -1
- package/src/app/page.tsx +2 -0
- package/dist/index.css +0 -1
- package/dist/index.esm.css +0 -1
- /package/{src → lib}/components/Checkbox/index.ts +0 -0
- /package/{src → lib}/components/Checkbox/style.css +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ButtonProps } from '../../types/button';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const ButtonClient: (props: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default ButtonClient;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from '../../types/button';
|
|
3
3
|
import './style.css';
|
|
4
|
-
type
|
|
4
|
+
declare const Button: ({ type, variant, color, shape, size, htmlType, className, rootClassName, classNames: customClassNames, styles, prefixCls, iconPosition, disabled, ghost, danger, block, children, href, iconNode, isLoading, ...restProps }: ButtonProps & {
|
|
5
5
|
iconNode?: ReactNode;
|
|
6
6
|
isLoading?: boolean;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default ButtonBase;
|
|
7
|
+
}) => ReactElement;
|
|
8
|
+
export default Button;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import './style.css';
|
|
3
|
+
declare const CheckboxClient: import("react").ForwardRefExoticComponent<import("../../types").DefaultProps & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onChange?: (e: MouseEvent<HTMLInputElement> & import("../../types").TargetProps) => void;
|
|
6
|
+
onClick?: import("react").MouseEventHandler<HTMLElement>;
|
|
7
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLElement>;
|
|
8
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLElement>;
|
|
9
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement>;
|
|
10
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement>;
|
|
11
|
+
value?: boolean;
|
|
12
|
+
tabIndex?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
children?: import("react").ReactNode;
|
|
15
|
+
id?: string;
|
|
16
|
+
autoFocus?: boolean;
|
|
17
|
+
type?: string;
|
|
18
|
+
skipGroup?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
checked?: boolean;
|
|
22
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export default CheckboxClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { CheckboxProps } from '../../types/checkbox';
|
|
3
|
+
declare const Checkbox: {
|
|
4
|
+
({ prefixCls, className, defaultChecked, checked, style, disabled, onChange, onClick, onMouseEnter, onMouseLeave, onKeyPress, onKeyDown, tabIndex, name, children, id, autoFocus, type, value, required, noStyle }: CheckboxProps): ReactElement;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default Checkbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Checkbox } from '@/components/Checkbox/Checkbox';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { KeyboardEventHandler, MouseEvent, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { DefaultProps, TargetProps } from '.';
|
|
3
|
+
export type CheckboxProps = DefaultProps & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onChange?: (e: MouseEvent<HTMLInputElement> & TargetProps) => void;
|
|
6
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
7
|
+
onMouseEnter?: MouseEventHandler<HTMLElement>;
|
|
8
|
+
onMouseLeave?: MouseEventHandler<HTMLElement>;
|
|
9
|
+
onKeyPress?: KeyboardEventHandler<HTMLElement>;
|
|
10
|
+
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
|
11
|
+
value?: boolean;
|
|
12
|
+
tabIndex?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
id?: string;
|
|
16
|
+
autoFocus?: boolean;
|
|
17
|
+
type?: string;
|
|
18
|
+
skipGroup?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
checked?: boolean;
|
|
22
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -42,10 +42,9 @@ interface ButtonProps extends BaseButtonProps, Omit<ButtonHTMLAttributes<HTMLBut
|
|
|
42
42
|
htmlType?: ButtonHTMLType;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
type
|
|
45
|
+
declare const Button: ({ type, variant, color, shape, size, htmlType, className, rootClassName, classNames: customClassNames, styles, prefixCls, iconPosition, disabled, ghost, danger, block, children, href, iconNode, isLoading, ...restProps }: ButtonProps & {
|
|
46
46
|
iconNode?: ReactNode;
|
|
47
47
|
isLoading?: boolean;
|
|
48
|
-
};
|
|
49
|
-
declare const ButtonBase: ({ type, variant, color, shape, size, htmlType, className, rootClassName, classNames: customClassNames, styles, prefixCls, iconPosition, disabled, ghost, danger, block, children, href, iconNode, isLoading, ...restProps }: ButtonBaseProps) => ReactElement;
|
|
48
|
+
}) => ReactElement;
|
|
50
49
|
|
|
51
|
-
export {
|
|
50
|
+
export { Button };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
+
function styleInject(css, ref) {
|
|
4
|
+
if (ref === void 0) ref = {};
|
|
5
|
+
var insertAt = ref.insertAt;
|
|
6
|
+
if (!css || typeof document === 'undefined') {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
10
|
+
var style = document.createElement('style');
|
|
11
|
+
style.type = 'text/css';
|
|
12
|
+
if (insertAt === 'top') {
|
|
13
|
+
if (head.firstChild) {
|
|
14
|
+
head.insertBefore(style, head.firstChild);
|
|
15
|
+
} else {
|
|
16
|
+
head.appendChild(style);
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
head.appendChild(style);
|
|
20
|
+
}
|
|
21
|
+
if (style.styleSheet) {
|
|
22
|
+
style.styleSheet.cssText = css;
|
|
23
|
+
} else {
|
|
24
|
+
style.appendChild(document.createTextNode(css));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var css_248z$1 = ":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$1);
|
|
30
|
+
|
|
3
31
|
function clsx(...args) {
|
|
4
32
|
return args.flatMap(arg => {
|
|
5
33
|
if (!arg) {
|
|
@@ -23,7 +51,10 @@ function clsx(...args) {
|
|
|
23
51
|
|
|
24
52
|
const prefixClsButton = 'xUi-button';
|
|
25
53
|
|
|
26
|
-
|
|
54
|
+
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}";
|
|
55
|
+
styleInject(css_248z);
|
|
56
|
+
|
|
57
|
+
const Button = ({
|
|
27
58
|
type = 'default',
|
|
28
59
|
variant = 'solid',
|
|
29
60
|
color = 'default',
|
|
@@ -85,5 +116,5 @@ const ButtonBase = ({
|
|
|
85
116
|
});
|
|
86
117
|
};
|
|
87
118
|
|
|
88
|
-
export {
|
|
119
|
+
export { Button };
|
|
89
120
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../lib/helpers/index.ts","../lib/utils/index.ts","../lib/components/Button/Button.tsx"],"sourcesContent":["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 { ReactElement, ReactNode } from 'react';\nimport { clsx } from '../../helpers';\nimport { ButtonProps } from '../../types/button';\nimport { prefixClsButton } from '../../utils';\nimport './style.css';\n\
|
|
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 { 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","_jsxs","_Fragment","_jsx","icon","undefined"],"mappings":";;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE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,MAAM,CAACkB,IAAI;gBAEjBT,QAAAA;AAAQ,KAAA,CAEZ,EACDQ;MAAMrB,SAAS,EAAE,CAAGK,EAAAA,SAAS,CAAU,QAAA,CAAA;AAAGM,MAAAA,QAAA,EAAAA,QAAAA;KAAgB,CAAA,EACzDE,QAAQ,IAAIP,YAAY,KAAK,KAAK,IACjCe,GAAA,CAAA,MAAA,EAAA;MACErB,SAAS,EAAEvB,IAAI,CAAC,CAAG4B,EAAAA,SAAS,OAAO,EAAEF,gBAAgB,CAACmB,IAAI,CAAC;MAC3DtD,KAAK,EAAEoC,MAAM,CAACkB,IAAI;AAEjBX,MAAAA,QAAA,EAAAE,QAAAA;MAEJ,CAAA;AAAA,GAAA,CAEJ,CAAA;AAED,EAAA,IAAID,IAAI,EAAE;IACR,OACES;AACErB,MAAAA,SAAS,EAAEgB,OAAO;AAClBJ,MAAAA,IAAI,EAAEK,cAAc,GAAGM,SAAS,GAAGX,IAAI;AAAA,MAAA,eAAA,EACxBK,cAAc;AAE5BN,MAAAA,QAAA,EAAAO,OAAAA;AACC,KAAA,CAAA,CAAA;AAER,GAAA;EAEA,OACEG,GACE,CAAA,QAAA,EAAA;AAAAnD,IAAAA,IAAI,EAAE6B,QAAQ;AACdC,IAAAA,SAAS,EAAEgB,OAAO;AAClBT,IAAAA,QAAQ,EAAEU,cAAc;AACpB,IAAA,GAAAF,SAAS;cAEZG,OAAAA;AAAO,GAAA,CACD,CAAA;AAEb;;;;","x_google_ignoreList":[0]}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
|
|
5
|
+
function styleInject(css, ref) {
|
|
6
|
+
if (ref === void 0) ref = {};
|
|
7
|
+
var insertAt = ref.insertAt;
|
|
8
|
+
if (!css || typeof document === 'undefined') {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
12
|
+
var style = document.createElement('style');
|
|
13
|
+
style.type = 'text/css';
|
|
14
|
+
if (insertAt === 'top') {
|
|
15
|
+
if (head.firstChild) {
|
|
16
|
+
head.insertBefore(style, head.firstChild);
|
|
17
|
+
} else {
|
|
18
|
+
head.appendChild(style);
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
head.appendChild(style);
|
|
22
|
+
}
|
|
23
|
+
if (style.styleSheet) {
|
|
24
|
+
style.styleSheet.cssText = css;
|
|
25
|
+
} else {
|
|
26
|
+
style.appendChild(document.createTextNode(css));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var css_248z$1 = ":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$1);
|
|
32
|
+
|
|
5
33
|
function clsx(...args) {
|
|
6
34
|
return args.flatMap(arg => {
|
|
7
35
|
if (!arg) {
|
|
@@ -25,7 +53,10 @@ function clsx(...args) {
|
|
|
25
53
|
|
|
26
54
|
const prefixClsButton = 'xUi-button';
|
|
27
55
|
|
|
28
|
-
|
|
56
|
+
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}";
|
|
57
|
+
styleInject(css_248z);
|
|
58
|
+
|
|
59
|
+
const Button = ({
|
|
29
60
|
type = 'default',
|
|
30
61
|
variant = 'solid',
|
|
31
62
|
color = 'default',
|
|
@@ -87,5 +118,5 @@ const ButtonBase = ({
|
|
|
87
118
|
});
|
|
88
119
|
};
|
|
89
120
|
|
|
90
|
-
exports.Button =
|
|
121
|
+
exports.Button = Button;
|
|
91
122
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../lib/helpers/index.ts","../lib/utils/index.ts","../lib/components/Button/Button.tsx"],"sourcesContent":["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 { ReactElement, ReactNode } from 'react';\nimport { clsx } from '../../helpers';\nimport { ButtonProps } from '../../types/button';\nimport { prefixClsButton } from '../../utils';\nimport './style.css';\n\
|
|
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 { 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","_jsxs","_Fragment","_jsx","icon","undefined"],"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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A;AAAA,GAAA,CAEJ,CAAA;AAED,EAAA,IAAID,IAAI,EAAE;IACR,OACES;AACErB,MAAAA,SAAS,EAAEgB,OAAO;AAClBJ,MAAAA,IAAI,EAAEK,cAAc,GAAGM,SAAS,GAAGX,IAAI;AAAA,MAAA,eAAA,EACxBK,cAAc;AAE5BN,MAAAA,QAAA,EAAAO,OAAAA;AACC,KAAA,CAAA,CAAA;AAER,GAAA;EAEA,OACEG,cACE,CAAA,QAAA,EAAA;AAAAnD,IAAAA,IAAI,EAAE6B,QAAQ;AACdC,IAAAA,SAAS,EAAEgB,OAAO;AAClBT,IAAAA,QAAQ,EAAEU,cAAc;AACpB,IAAA,GAAAF,SAAS;cAEZG,OAAAA;AAAO,GAAA,CACD,CAAA;AAEb;;;;","x_google_ignoreList":[0]}
|
package/{src/components/Checkbox/Checkbox.tsx → lib/components/Checkbox/Checkbox.client.tsx}
RENAMED
|
@@ -11,13 +11,12 @@ import {
|
|
|
11
11
|
import { clsx } from '../../../lib/helpers';
|
|
12
12
|
import { SyntheticBaseEvent } from '../../types';
|
|
13
13
|
import { CheckboxProps } from '../../types/checkbox';
|
|
14
|
-
import { prefixClsCheckbox } from '../../../lib/utils';
|
|
15
14
|
import './style.css';
|
|
16
15
|
|
|
17
|
-
const
|
|
16
|
+
const CheckboxClient = forwardRef<HTMLDivElement, CheckboxProps>(
|
|
18
17
|
(
|
|
19
18
|
{
|
|
20
|
-
prefixCls
|
|
19
|
+
prefixCls,
|
|
21
20
|
className = '',
|
|
22
21
|
defaultChecked = false,
|
|
23
22
|
checked,
|
|
@@ -110,6 +109,6 @@ const Checkbox = forwardRef<HTMLDivElement, CheckboxProps>(
|
|
|
110
109
|
}
|
|
111
110
|
);
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
CheckboxClient.displayName = 'CheckboxClient';
|
|
114
113
|
|
|
115
|
-
export default
|
|
114
|
+
export default CheckboxClient;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { CheckboxProps } from '../../types/checkbox';
|
|
3
|
+
import { prefixClsCheckbox } from '../../../lib/utils';
|
|
4
|
+
import CheckboxClient from './Checkbox.client';
|
|
5
|
+
|
|
6
|
+
const Checkbox = ({
|
|
7
|
+
prefixCls = prefixClsCheckbox,
|
|
8
|
+
className = '',
|
|
9
|
+
defaultChecked = false,
|
|
10
|
+
checked,
|
|
11
|
+
style,
|
|
12
|
+
disabled = false,
|
|
13
|
+
onChange,
|
|
14
|
+
onClick,
|
|
15
|
+
onMouseEnter,
|
|
16
|
+
onMouseLeave,
|
|
17
|
+
onKeyPress,
|
|
18
|
+
onKeyDown,
|
|
19
|
+
tabIndex,
|
|
20
|
+
name,
|
|
21
|
+
children,
|
|
22
|
+
id,
|
|
23
|
+
autoFocus,
|
|
24
|
+
type = 'checkbox',
|
|
25
|
+
value = false,
|
|
26
|
+
required = false,
|
|
27
|
+
noStyle
|
|
28
|
+
}: CheckboxProps): ReactElement => {
|
|
29
|
+
return (
|
|
30
|
+
<CheckboxClient
|
|
31
|
+
prefixCls={prefixCls}
|
|
32
|
+
className={className}
|
|
33
|
+
defaultChecked={defaultChecked}
|
|
34
|
+
checked={checked}
|
|
35
|
+
style={style}
|
|
36
|
+
disabled={disabled}
|
|
37
|
+
onChange={onChange}
|
|
38
|
+
onClick={onClick}
|
|
39
|
+
onMouseEnter={onMouseEnter}
|
|
40
|
+
onMouseLeave={onMouseLeave}
|
|
41
|
+
onKeyPress={onKeyPress}
|
|
42
|
+
onKeyDown={onKeyDown}
|
|
43
|
+
tabIndex={tabIndex}
|
|
44
|
+
name={name}
|
|
45
|
+
id={id}
|
|
46
|
+
autoFocus={autoFocus}
|
|
47
|
+
type={type}
|
|
48
|
+
value={value}
|
|
49
|
+
required={required}
|
|
50
|
+
noStyle={noStyle}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
</CheckboxClient>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
Checkbox.displayName = 'Checkbox';
|
|
58
|
+
|
|
59
|
+
export default Checkbox;
|
package/package.json
CHANGED
package/src/app/page.tsx
CHANGED
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
: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}.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}
|
package/dist/index.esm.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
: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}.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}
|
|
File without changes
|
|
File without changes
|