@shopgate/pwa-ui-shared 6.22.4 → 6.23.0-beta.2
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/Button/index.js +1 -1
- package/Button/style.js +7 -1
- package/package.json +5 -5
package/Button/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeo
|
|
|
5
5
|
*/var Button=/*#__PURE__*/function(_Component){_inherits(Button,_Component);var _super=_createSuper(Button);function Button(){_classCallCheck(this,Button);return _super.apply(this,arguments);}_createClass(Button,[{key:"style",get:/**
|
|
6
6
|
* Getter for style depending on prop type.
|
|
7
7
|
* @returns {Object}
|
|
8
|
-
*/function get(){var _this$props=this.props,flat=_this$props.flat,disabled=_this$props.disabled;switch(this.props.type){case'plain':return styles.plain();case'regular':return styles.regular(disabled);default:case'primary':return styles.primary(disabled,flat);case'secondary':return styles.secondary(disabled,flat);}}/**
|
|
8
|
+
*/function get(){var _this$props=this.props,flat=_this$props.flat,disabled=_this$props.disabled;switch(this.props.type){case'plain':return styles.plain();case'regular':return styles.regular(disabled);case'simple':return styles.simple(disabled);default:case'primary':return styles.primary(disabled,flat);case'secondary':return styles.secondary(disabled,flat);}}/**
|
|
9
9
|
* Getter for the calculated button props.
|
|
10
10
|
* @returns {Object}
|
|
11
11
|
*/},{key:"buttonProps",get:function get(){var _this$props2=this.props,className=_this$props2.className,disabled=_this$props2.disabled,onClick=_this$props2.onClick,testId=_this$props2.testId,type=_this$props2.type,wrapContent=_this$props2.wrapContent,flat=_this$props2.flat,rest=_objectWithoutProperties(_this$props2,_excluded);var buttonProps=_extends({className:className,disabled:disabled,onClick:onClick},rest);return buttonProps;}/**
|
package/Button/style.js
CHANGED
|
@@ -14,6 +14,12 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
|
|
|
14
14
|
* Creates a plain button style object without any styling.
|
|
15
15
|
* @return {Object}
|
|
16
16
|
*/var plain=function plain(){return{button:css({padding:0,outline:0,border:0,textAlign:'left'}).toString(),content:''};};/**
|
|
17
|
+
* Creates a simple button style object.
|
|
18
|
+
@param {boolean} disabled Whether this button is disabled.
|
|
19
|
+
* @return {Object}
|
|
20
|
+
*/var simple=function simple(disabled){if(disabled){// simple disabled button style.
|
|
21
|
+
return createButtonStyles(themeConfig.colors.shade4,themeConfig.colors.shade7);}// simple enabled button style.
|
|
22
|
+
return createButtonStyles(themeConfig.colors.dark,themeConfig.colors.shade7);};/**
|
|
17
23
|
* The regular flat button style.
|
|
18
24
|
* @param {boolean} disabled Whether this button is disabled.
|
|
19
25
|
* @return {Object} An object of style definitions.
|
|
@@ -37,4 +43,4 @@ return createButtonStyles(themeConfig.colors.accent,null);};/**
|
|
|
37
43
|
return createButtonStyles(themeConfig.colors.shade4,themeConfig.colors.shade7);}// Regular enabled button style.
|
|
38
44
|
return createButtonStyles(themeConfig.colors.primaryContrast,themeConfig.colors.primary);}if(disabled){// Flat disabled button style.
|
|
39
45
|
return createButtonStyles(themeConfig.colors.shade4,null);}// Flat enabled button style.
|
|
40
|
-
return createButtonStyles(themeConfig.colors.primary,null);};export default{plain:plain,regular:regular,primary:primary,secondary:secondary,contentWrapper:contentWrapper};
|
|
46
|
+
return createButtonStyles(themeConfig.colors.primary,null);};export default{plain:plain,regular:regular,simple:simple,primary:primary,secondary:secondary,contentWrapper:contentWrapper};
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-ui-shared",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.23.0-beta.2",
|
|
4
4
|
"description": "Shopgate's shared UI components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@shopgate/pwa-ui-ios": "6.
|
|
9
|
-
"@shopgate/pwa-ui-material": "6.
|
|
8
|
+
"@shopgate/pwa-ui-ios": "6.23.0-beta.2",
|
|
9
|
+
"@shopgate/pwa-ui-material": "6.23.0-beta.2"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@shopgate/pwa-common": "6.
|
|
13
|
-
"@shopgate/pwa-common-commerce": "6.
|
|
12
|
+
"@shopgate/pwa-common": "6.23.0-beta.2",
|
|
13
|
+
"@shopgate/pwa-common-commerce": "6.23.0-beta.2",
|
|
14
14
|
"classnames": "^2.2.5",
|
|
15
15
|
"react": "~16.12.0"
|
|
16
16
|
},
|