@synerise/ds-button 0.17.15 → 0.17.16
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/CHANGELOG.md +12 -0
- package/dist/Button.js +6 -5
- package/dist/Button.styles.js +5 -3
- package/dist/Button.types.d.ts +1 -0
- package/dist/Creator/Creator.styles.js +3 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.17.16](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.17.15...@synerise/ds-button@0.17.16) (2023-05-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **button:** add readOnly styles to button ([e02c5f3](https://github.com/synerise/synerise-design/commit/e02c5f34963de704766e9f69bb775f0171a04a77))
|
|
12
|
+
* **card-tabs:** changes button creator height ([d822687](https://github.com/synerise/synerise-design/commit/d822687f69b513d5adb4e67ade2650d454909aae))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [0.17.15](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.17.14...@synerise/ds-button@0.17.15) (2023-05-20)
|
|
7
19
|
|
|
8
20
|
|
package/dist/Button.js
CHANGED
|
@@ -64,10 +64,11 @@ var Button = function Button(_ref) {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
var classNameString = React.useMemo(function () {
|
|
67
|
-
var modeStringifed =
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
var modeStringifed = mode || '';
|
|
68
|
+
var readOnlyStringifed = antdProps.readOnly ? 'read-only' : '';
|
|
69
|
+
var classNameStringifed = className || '';
|
|
70
|
+
return "ds-button " + modeStringifed + " " + classNameStringifed + " " + readOnlyStringifed;
|
|
71
|
+
}, [mode, className, antdProps.readOnly]);
|
|
71
72
|
return /*#__PURE__*/React.createElement(S.AntdButton, _extends({
|
|
72
73
|
justifyContent: justifyContent,
|
|
73
74
|
type: type || 'secondary',
|
|
@@ -88,7 +89,7 @@ var Button = function Button(_ref) {
|
|
|
88
89
|
customColor: color
|
|
89
90
|
/* eslint-disable-next-line react/jsx-props-no-spreading */
|
|
90
91
|
|
|
91
|
-
}, antdProps), /*#__PURE__*/React.createElement(S.RippleEffect, {
|
|
92
|
+
}, antdProps), !antdProps.readOnly && /*#__PURE__*/React.createElement(S.RippleEffect, {
|
|
92
93
|
ref: rippleRef,
|
|
93
94
|
className: "btn-ripple " + rippleClassName
|
|
94
95
|
}), antdProps.children, loading && /*#__PURE__*/React.createElement(S.Spinner, {
|
package/dist/Button.styles.js
CHANGED
|
@@ -65,7 +65,7 @@ export var AntdButton = styled(function (_ref) {
|
|
|
65
65
|
}).withConfig({
|
|
66
66
|
displayName: "Buttonstyles__AntdButton",
|
|
67
67
|
componentId: "sc-3lgta1-3"
|
|
68
|
-
})([" &&{-webkit-mask-image:-webkit-radial-gradient(white,black);border:0;display:inline-flex;align-items:center;padding:0 12px;position:relative;overflow:hidden;justify-content:", ";", ";> *:not(.btn-focus){position:relative;}> .ds-icon{display:flex;align-items:center;justify-content:center;margin:0;width:24px;height:24px;}&:disabled{&&{", "{box-shadow:none;}}};", " &&.ant-btn-default:not(.ds-expander):not(.ds-button-creator),&&.ant-btn-secondary:not(.ds-expander):not(.ds-button-creator){&:active{", "}&:focus:not(:active){color:", ";svg{fill:", ";}background:", ";}&:hover:not(:disabled):not(:focus){background-color:", ";&.ant-btn .btn-focus{box-shadow:inset 0 0 0 1px ", ";}> span:not(.btn-focus) +.ds-icon:before{background-color:", ";}", "}&:active{color:", ";svg{fill:", ";!important;}}}", ";", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "}"], function (props) {
|
|
68
|
+
})([" &&{-webkit-mask-image:-webkit-radial-gradient(white,black);border:0;display:inline-flex;align-items:center;padding:0 12px;position:relative;overflow:hidden;justify-content:", ";", ";> *:not(.btn-focus){position:relative;}> .ds-icon{display:flex;align-items:center;justify-content:center;margin:0;width:24px;height:24px;}&:disabled{&&{", "{box-shadow:none;}}};", " &&.ant-btn-default:not(.ds-expander):not(.ds-button-creator):not(.read-only),&&.ant-btn-secondary:not(.ds-expander):not(.ds-button-creator):not(.read-only){&:active{", "}&:focus:not(:active){color:", ";svg{fill:", ";}background:", ";}&:hover:not(:disabled):not(:focus){background-color:", ";&.ant-btn .btn-focus{box-shadow:inset 0 0 0 1px ", ";}> span:not(.btn-focus) +.ds-icon:before{background-color:", ";}", "}&:active{color:", ";svg{fill:", ";!important;}}}", " ", ";", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "}"], function (props) {
|
|
69
69
|
return props.justifyContent;
|
|
70
70
|
}, function (props) {
|
|
71
71
|
return props.shape && props.shape === 'circle' && css(["border-radius:50%;"]);
|
|
@@ -91,6 +91,8 @@ export var AntdButton = styled(function (_ref) {
|
|
|
91
91
|
return props.theme.palette['blue-600'];
|
|
92
92
|
}, function (props) {
|
|
93
93
|
return props.theme.palette['blue-600'];
|
|
94
|
+
}, function (props) {
|
|
95
|
+
return props.readOnly && css(["&&.ant-btn{cursor:default;transition:none;}&&.ant-btn-secondary{&:hover,&:focus{background:", ";.btn-focus{box-shadow:inset 0 0 0 1px ", ";}span,svg{color:", ";}svg{fill:", " !important;}}}"], props.theme.palette['grey-050'], props.theme.palette['grey-300'], props.theme.palette['grey-700'], props.theme.palette['grey-700']);
|
|
94
96
|
}, function (props) {
|
|
95
97
|
return props.loading && css(["> *:not(.btn-focus){opacity:0;visibility:hidden;}", "{opacity:1;visibility:visible;}"], Spinner);
|
|
96
98
|
}, function (props) {
|
|
@@ -114,13 +116,13 @@ export var AntdButton = styled(function (_ref) {
|
|
|
114
116
|
}, function (props) {
|
|
115
117
|
return props.groupVariant === 'right-rounded' && css(["&.ant-btn{border-radius:0 3px 3px 0;}"]);
|
|
116
118
|
}, function (props) {
|
|
117
|
-
return props.activated && css(["&&&.ant-btn{background-color:", ";span{color:", ";}svg{fill:", ";}&&&:focus{background-color:", ";span{color:", ";}svg{fill:", ";}&&&:hover:not(:active){background-color:", ";}}}&.ant-btn .btn-focus{box-shadow:none;}"], props.theme.palette["blue-050"], props.theme.palette['blue-600'], props.theme.palette['blue-600'], props.theme.palette["blue-050"], props.theme.palette['blue-600'], props.theme.palette['blue-600'], props.theme.palette["blue-100"]);
|
|
119
|
+
return props.activated && css(["&&&.ant-btn:not(.read-only){background-color:", ";span{color:", ";}svg{fill:", ";}&&&:focus{background-color:", ";span{color:", ";}svg{fill:", ";}&&&:hover:not(:active){background-color:", ";}}}&.ant-btn .btn-focus{box-shadow:none;}"], props.theme.palette["blue-050"], props.theme.palette['blue-600'], props.theme.palette['blue-600'], props.theme.palette["blue-050"], props.theme.palette['blue-600'], props.theme.palette['blue-600'], props.theme.palette["blue-100"]);
|
|
118
120
|
}, function (props) {
|
|
119
121
|
return props.error && css(["&.ant-btn{background-color:", ";box-shadow:inset 0 0 0 1px ", ";span{color:", ";}svg{fill:", ";}.btn-focus{box-shadow:none;}&&&:hover:not(:disabled):not(:focus){background-color:", ";box-shadow:inset 0 0 0 1px ", ";span{color:", ";}svg{fill:", " !important;}}&:active{background-color:", ";box-shadow:none;span{color:", ";}svg{fill:", ";}}&&&:focus:not(:active){border:none !important;background-color:", ";span{color:", ";}.btn-focus{box-shadow:inset 0 0 0 2px ", ";}}svg{fill:", ";}}", "{background-color:", ";}"], props.theme.palette["red-100"], props.theme.palette['red-600'], props.theme.palette["red-600"], props.theme.palette["red-600"], props.theme.palette["red-200"], props.theme.palette['red-600'], props.theme.palette["red-600"], props.theme.palette["red-600"], props.theme.palette["red-700"], props.theme.palette.white, props.theme.palette.white, props.theme.palette["red-100"], props.theme.palette["red-600"], props.theme.palette['blue-600'], props.theme.palette["red-600"], RippleEffect, props.theme.palette["red-700"]);
|
|
120
122
|
}, function (props) {
|
|
121
123
|
return props.error && props.type === 'secondary' && css(["&&&.ant-btn{span{color:", ";}svg{fill:", ";}.btn-focus{box-shadow:none;}&&&:hover{background-color:", ";.btn-focus{box-shadow:none;}}&&&:focus:not(:active){.btn-focus{box-shadow:inset 0 0 0 2px ", ";}}&&&:active{background-color:", ";span{color:", ";}svg{fill:", ";}}", "{background-color:", ";}}"], props.theme.palette["red-600"], props.theme.palette["red-600"], props.theme.palette["red-200"], props.theme.palette['blue-600'], props.theme.palette["red-700"], props.theme.palette.white, props.theme.palette.white, RippleEffect, props.theme.palette["red-700"]);
|
|
122
124
|
}, function (props) {
|
|
123
|
-
return props.type === 'custom-color' && !props.error && css(["&.ant-btn{background-color:", ";border:0 solid transparent;color:", ";span{color:", ";}svg{color:", ";fill:", ";}", "{box-shadow:inset 0 0 0 0px transparent;}", "{background-color:", ";}&:focus{", "{box-shadow:inset 0 0 0 2px ", ";}}&:hover:not(:disabled):not(:focus){background-color:", ";span{color:", ";}svg{color:", " !important;fill:", " !important;}}&:disabled{opacity:0.4;background-color:", ";span{color:", ";}svg{color:", " !important;fill:", " !important;}}}"], props.theme.palette[props.customColor + "-600"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white, props.theme.palette.white, ButtonFocus, RippleEffect, props.theme.palette[props.customColor + "-700"], ButtonFocus, props.theme.palette['blue-600'], props.theme.palette[props.customColor + "-500"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white, props.theme.palette[props.customColor + "-600"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white);
|
|
125
|
+
return props.type === 'custom-color' && !props.error && css(["&.ant-btn{background-color:", ";border:0 solid transparent;color:", ";span{color:", ";}svg{color:", ";fill:", ";}", "{box-shadow:inset 0 0 0 0px transparent;}", "{background-color:", ";}&:focus:not(.read-only){", "{box-shadow:inset 0 0 0 2px ", ";}}&:hover:not(:disabled):not(:focus){background-color:", ";span{color:", ";}svg{color:", " !important;fill:", " !important;}}&:disabled{opacity:0.4;background-color:", ";span{color:", ";}svg{color:", " !important;fill:", " !important;}}}"], props.theme.palette[props.customColor + "-600"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white, props.theme.palette.white, ButtonFocus, RippleEffect, props.theme.palette[props.customColor + "-700"], ButtonFocus, props.theme.palette['blue-600'], props.theme.palette[props.readOnly ? props.customColor + "-600" : props.customColor + "-500"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white, props.theme.palette[props.customColor + "-600"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white);
|
|
124
126
|
}, function (props) {
|
|
125
127
|
return props.type === 'custom-color-ghost' && !props.error && css(["color:", ";.ds-icon > svg{fill:", ";}&:hover:not(:disabled):not(:focus){color:", ";span{color:", ";}svg{fill:", " !important;}}&:disabled{opacity:0.4;color:", ";.ds-icon > svg{fill:", " !important;}}"], props.theme.palette[props.customColor + "-600"], props.theme.palette[props.customColor + "-600"], props.theme.palette[props.customColor + "-500"], props.theme.palette[props.customColor + "-500"], props.theme.palette[props.customColor + "-500"], props.theme.palette[props.customColor + "-600"], props.theme.palette[props.customColor + "-600"]);
|
|
126
128
|
});
|
package/dist/Button.types.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare type Props = Omit<ButtonProps, 'type'> & {
|
|
|
42
42
|
iconColor?: string | 'blue' | 'grey' | 'red' | 'green' | 'yellow' | 'pink' | 'mars' | 'orange' | 'fern' | 'cyan' | 'purple' | 'violet';
|
|
43
43
|
error?: boolean;
|
|
44
44
|
activated?: boolean;
|
|
45
|
+
readOnly?: boolean;
|
|
45
46
|
};
|
|
46
47
|
export declare type ButtonSubComponents = {
|
|
47
48
|
Expander: React.ElementType;
|
|
@@ -35,9 +35,10 @@ export var Creator = styled(function (_ref3) {
|
|
|
35
35
|
}).withConfig({
|
|
36
36
|
displayName: "Creatorstyles__Creator",
|
|
37
37
|
componentId: "sc-1w96u6h-1"
|
|
38
|
-
})(["&&&{width:", ";opacity:", ";height:
|
|
38
|
+
})(["&&&{width:", ";opacity:", ";height:48px;", " padding:0;border-radius:3px;border:1px dashed ", ";background:", ";transition:all 0.3s ease;justify-content:", ";align-items:center;", "{margin:auto 12px;svg{transition:all 0.3s ease;color:", ";fill:", ";}}", "{background-color:", ";}", "{display:none;}&:hover:not(:disabled){", "{svg{color:", " !important;fill:", " !important;}}", "{color:", ";}}&:hover:not(:disabled):not(:focus){border:1px dashed ", ";background-color:", ";}", " &:focus:active{border:1px dashed ", " !important;box-shadow:none;background-color:", ";}&:focus{border:1px dashed ", ";box-shadow:none;}&:disabled{border-color:", ";background-color:", ";}", " ", "}"], function (props) {
|
|
39
|
+
if (!props.withLabel) return '48px';
|
|
39
40
|
if (props.block) return '100%';
|
|
40
|
-
return
|
|
41
|
+
return 'auto';
|
|
41
42
|
}, function (props) {
|
|
42
43
|
return props.disabled ? "0.4" : '1';
|
|
43
44
|
}, function (props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-button",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.16",
|
|
4
4
|
"description": "Button UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"@synerise/ds-utils": "^0.19.0",
|
|
44
44
|
"csstype": "2.6.9"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "9a0fe37374409f1830fa642965975a26a72116c8"
|
|
47
47
|
}
|