@citygross/components 0.8.91 → 0.8.92
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/build/@types/components/CgButton/CgButton.d.ts +9 -8
- package/build/cjs/components/src/components/CgButton/CgButton.js +4 -8
- package/build/cjs/components/src/components/CgButton/CgButton.js.map +1 -1
- package/build/es/components/src/components/CgButton/CgButton.js +4 -8
- package/build/es/components/src/components/CgButton/CgButton.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,17 +12,18 @@ export declare enum EButtonVariant {
|
|
|
12
12
|
'ghost' = 4
|
|
13
13
|
}
|
|
14
14
|
export declare type TCgButton = {
|
|
15
|
-
|
|
16
|
-
variant?: EButtonVariant;
|
|
17
|
-
icon?: React.ReactNode;
|
|
18
|
-
flexReverse?: boolean;
|
|
19
|
-
loading?: boolean;
|
|
15
|
+
buttonRef?: React.Ref<HTMLButtonElement>;
|
|
20
16
|
children?: React.ReactNode;
|
|
21
17
|
disabled?: boolean;
|
|
22
|
-
|
|
18
|
+
flexReverse?: boolean;
|
|
23
19
|
fullWidth?: boolean;
|
|
24
|
-
|
|
20
|
+
icon?: React.ReactNode;
|
|
21
|
+
id?: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
onClick?: () => void;
|
|
25
24
|
round?: boolean;
|
|
26
25
|
shouldPreventDefault?: boolean;
|
|
26
|
+
size?: ECgButtonSize;
|
|
27
|
+
variant?: EButtonVariant;
|
|
27
28
|
};
|
|
28
|
-
export declare const CgButton: ({
|
|
29
|
+
export declare const CgButton: ({ buttonRef, children, disabled, flexReverse, fullWidth, icon, id, loading, onClick, round, shouldPreventDefault, size, variant }: TCgButton) => JSX.Element;
|
|
@@ -25,16 +25,12 @@ exports.EButtonVariant = void 0;
|
|
|
25
25
|
EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
|
|
26
26
|
})(exports.EButtonVariant || (exports.EButtonVariant = {}));
|
|
27
27
|
var CgButton = function (_a) {
|
|
28
|
-
var
|
|
29
|
-
return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, {
|
|
30
|
-
if (event.key === 'Enter' && !disabled) {
|
|
31
|
-
onClick && onClick();
|
|
32
|
-
}
|
|
33
|
-
}, onClick: function (e) {
|
|
28
|
+
var buttonRef = _a.buttonRef, children = _a.children, disabled = _a.disabled, flexReverse = _a.flexReverse, fullWidth = _a.fullWidth, icon = _a.icon, _b = _a.id, id = _b === void 0 ? 'cg-button' : _b, loading = _a.loading, onClick = _a.onClick, round = _a.round, _c = _a.shouldPreventDefault, shouldPreventDefault = _c === void 0 ? true : _c, size = _a.size, variant = _a.variant;
|
|
29
|
+
return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, { disabled: disabled || loading, flexReverse: flexReverse, fullWidth: fullWidth, isIconOnly: !children, id: id, loading: loading, onClick: function (e) {
|
|
34
30
|
shouldPreventDefault && e.preventDefault();
|
|
35
31
|
onClick && onClick();
|
|
36
|
-
} },
|
|
37
|
-
React__default["default"].createElement(CgButton_styles.CgButtonContent, {
|
|
32
|
+
}, ref: buttonRef, round: round, size: size, variant: variant },
|
|
33
|
+
React__default["default"].createElement(CgButton_styles.CgButtonContent, { flexReverse: flexReverse, loading: loading, size: size },
|
|
38
34
|
icon,
|
|
39
35
|
children),
|
|
40
36
|
loading && (React__default["default"].createElement(CgButton_styles.CgButtonLoader, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -17,16 +17,12 @@ var EButtonVariant;
|
|
|
17
17
|
EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
|
|
18
18
|
})(EButtonVariant || (EButtonVariant = {}));
|
|
19
19
|
var CgButton = function (_a) {
|
|
20
|
-
var
|
|
21
|
-
return (React.createElement(CgButtonContainer, {
|
|
22
|
-
if (event.key === 'Enter' && !disabled) {
|
|
23
|
-
onClick && onClick();
|
|
24
|
-
}
|
|
25
|
-
}, onClick: function (e) {
|
|
20
|
+
var buttonRef = _a.buttonRef, children = _a.children, disabled = _a.disabled, flexReverse = _a.flexReverse, fullWidth = _a.fullWidth, icon = _a.icon, _b = _a.id, id = _b === void 0 ? 'cg-button' : _b, loading = _a.loading, onClick = _a.onClick, round = _a.round, _c = _a.shouldPreventDefault, shouldPreventDefault = _c === void 0 ? true : _c, size = _a.size, variant = _a.variant;
|
|
21
|
+
return (React.createElement(CgButtonContainer, { disabled: disabled || loading, flexReverse: flexReverse, fullWidth: fullWidth, isIconOnly: !children, id: id, loading: loading, onClick: function (e) {
|
|
26
22
|
shouldPreventDefault && e.preventDefault();
|
|
27
23
|
onClick && onClick();
|
|
28
|
-
} },
|
|
29
|
-
React.createElement(CgButtonContent, {
|
|
24
|
+
}, ref: buttonRef, round: round, size: size, variant: variant },
|
|
25
|
+
React.createElement(CgButtonContent, { flexReverse: flexReverse, loading: loading, size: size },
|
|
30
26
|
icon,
|
|
31
27
|
children),
|
|
32
28
|
loading && (React.createElement(CgButtonLoader, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.92",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"react-slick": "^0.30.1",
|
|
77
77
|
"slick-carousel": "^1.8.1"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "1ad51c2343438dd5982ac807becbeb6b479aa269"
|
|
80
80
|
}
|