@citygross/components 0.7.135 → 0.7.137
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/Button/IconButton.d.ts +1 -1
- package/build/cjs/components/src/components/Button/Button.styles.js +2 -2
- package/build/cjs/components/src/components/Button/IconButton.js +3 -2
- package/build/cjs/components/src/components/Button/IconButton.js.map +1 -1
- package/build/es/components/src/components/Button/Button.styles.js +2 -2
- package/build/es/components/src/components/Button/IconButton.js +3 -2
- package/build/es/components/src/components/Button/IconButton.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,4 +5,4 @@ export declare type TIconButton = styles.TBaseSmallButton & {
|
|
|
5
5
|
color?: TButtonColor;
|
|
6
6
|
icon: JSX.Element;
|
|
7
7
|
};
|
|
8
|
-
export declare function IconButton({ color, height, icon, isDisabled, loading, noWrap, onClick, border, shadow, width }: TIconButton): JSX.Element;
|
|
8
|
+
export declare function IconButton({ color, height, icon, isDisabled, loading, noWrap, onClick, border, shadow, width, ...props }: TIconButton): JSX.Element;
|
|
@@ -132,14 +132,14 @@ var LoadingContainer = styled__default["default"].div(templateObject_7 || (templ
|
|
|
132
132
|
var LoadingSpinner = styled__default["default"](Spinner.Spinner)(templateObject_8 || (templateObject_8 = _tslib.__makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"])));
|
|
133
133
|
var BaseIconButton = styled__default["default"](BaseButton)(templateObject_9 || (templateObject_9 = _tslib.__makeTemplateObject(["\n padding: ", "px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin: 0;\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n ", ";\n\n &::after {\n border-radius: 50%;\n box-shadow: ", ";\n }\n &::before {\n border-radius: 50%;\n }\n"], ["\n padding: ", "px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin: 0;\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n ", ";\n\n &::after {\n border-radius: 50%;\n box-shadow: ", ";\n }\n &::before {\n border-radius: 50%;\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { return props.height || 32; }, function (props) { return props.width || 32; }, function (props) { return props.width || 32; }, function (props) {
|
|
134
134
|
var _a;
|
|
135
|
-
return props.shadow && props.border
|
|
135
|
+
return props.shadow && props.border && !props.noShadow
|
|
136
136
|
? "box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.15), inset 0px 0px 0px 1px ".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium)
|
|
137
137
|
: props.shadow
|
|
138
138
|
? 'box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.15)'
|
|
139
139
|
: props.border
|
|
140
140
|
? "box-shadow: inset 0px 0px 0px 1px ".concat(props.border)
|
|
141
141
|
: '';
|
|
142
|
-
}, function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.boxShadow) === null || _b === void 0 ? void 0 : _b.iconButtonHover; });
|
|
142
|
+
}, function (props) { var _a, _b; return !props.noShadow && ((_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.boxShadow) === null || _b === void 0 ? void 0 : _b.iconButtonHover); });
|
|
143
143
|
var BasePaginationButton = styled__default["default"](BaseButton)(templateObject_10 || (templateObject_10 = _tslib.__makeTemplateObject(["\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n text-align: center;\n ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n"], ["\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n text-align: center;\n ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n"])), function (props) { return props.height || 36; }, function (props) { return props.width || 36; }, function (props) { return props.width || 36; }, function (props) {
|
|
144
144
|
var _a, _b, _c;
|
|
145
145
|
return props.color !== ((_b = (_a = props === null || props === void 0 ? void 0 : props.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.white)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var designTokens = require('@citygross/design-tokens');
|
|
7
8
|
var Button_styles = require('./Button.styles.js');
|
|
@@ -11,8 +12,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
13
|
|
|
13
14
|
function IconButton(_a) {
|
|
14
|
-
var _b = _a.color, color = _b === void 0 ? 'darkest' : _b, height = _a.height, icon = _a.icon, isDisabled = _a.isDisabled, loading = _a.loading, noWrap = _a.noWrap, onClick = _a.onClick, border = _a.border, shadow = _a.shadow, width = _a.width;
|
|
15
|
-
return (React__default["default"].createElement(Button_styles.BaseIconButton, { color: designTokens.theme && designTokens.theme.palette ? designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette[color] : '#333333', height: height, icon: icon, isDisabled: loading || isDisabled, loading: loading || null, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, width: width, border: border, shadow: shadow },
|
|
15
|
+
var _b = _a.color, color = _b === void 0 ? 'darkest' : _b, height = _a.height, icon = _a.icon, isDisabled = _a.isDisabled, loading = _a.loading, noWrap = _a.noWrap, onClick = _a.onClick, border = _a.border, shadow = _a.shadow, width = _a.width, props = _tslib.__rest(_a, ["color", "height", "icon", "isDisabled", "loading", "noWrap", "onClick", "border", "shadow", "width"]);
|
|
16
|
+
return (React__default["default"].createElement(Button_styles.BaseIconButton, _tslib.__assign({ color: designTokens.theme && designTokens.theme.palette ? designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette[color] : '#333333', height: height, icon: icon, isDisabled: loading || isDisabled, loading: loading || null, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, width: width, border: border, shadow: shadow }, props),
|
|
16
17
|
loading && (React__default["default"].createElement(Button_styles.Loading, null,
|
|
17
18
|
React__default["default"].createElement(Button_styles.LoadingContainer, null,
|
|
18
19
|
React__default["default"].createElement(Button_styles.LoadingSpinner, null)))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -124,14 +124,14 @@ var LoadingContainer = styled.div(templateObject_7 || (templateObject_7 = __make
|
|
|
124
124
|
var LoadingSpinner = styled(Spinner)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"])));
|
|
125
125
|
var BaseIconButton = styled(BaseButton)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n padding: ", "px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin: 0;\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n ", ";\n\n &::after {\n border-radius: 50%;\n box-shadow: ", ";\n }\n &::before {\n border-radius: 50%;\n }\n"], ["\n padding: ", "px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin: 0;\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n ", ";\n\n &::after {\n border-radius: 50%;\n box-shadow: ", ";\n }\n &::before {\n border-radius: 50%;\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { return props.height || 32; }, function (props) { return props.width || 32; }, function (props) { return props.width || 32; }, function (props) {
|
|
126
126
|
var _a;
|
|
127
|
-
return props.shadow && props.border
|
|
127
|
+
return props.shadow && props.border && !props.noShadow
|
|
128
128
|
? "box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.15), inset 0px 0px 0px 1px ".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium)
|
|
129
129
|
: props.shadow
|
|
130
130
|
? 'box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.15)'
|
|
131
131
|
: props.border
|
|
132
132
|
? "box-shadow: inset 0px 0px 0px 1px ".concat(props.border)
|
|
133
133
|
: '';
|
|
134
|
-
}, function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.boxShadow) === null || _b === void 0 ? void 0 : _b.iconButtonHover; });
|
|
134
|
+
}, function (props) { var _a, _b; return !props.noShadow && ((_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.boxShadow) === null || _b === void 0 ? void 0 : _b.iconButtonHover); });
|
|
135
135
|
var BasePaginationButton = styled(BaseButton)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n text-align: center;\n ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n"], ["\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n text-align: center;\n ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n"])), function (props) { return props.height || 36; }, function (props) { return props.width || 36; }, function (props) { return props.width || 36; }, function (props) {
|
|
136
136
|
var _a, _b, _c;
|
|
137
137
|
return props.color !== ((_b = (_a = props === null || props === void 0 ? void 0 : props.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.white)
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { __rest, __assign } from '../../../../_virtual/_tslib.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { theme } from '@citygross/design-tokens';
|
|
3
4
|
import { BaseIconButton, Loading, LoadingContainer, LoadingSpinner } from './Button.styles.js';
|
|
4
5
|
|
|
5
6
|
function IconButton(_a) {
|
|
6
|
-
var _b = _a.color, color = _b === void 0 ? 'darkest' : _b, height = _a.height, icon = _a.icon, isDisabled = _a.isDisabled, loading = _a.loading, noWrap = _a.noWrap, onClick = _a.onClick, border = _a.border, shadow = _a.shadow, width = _a.width;
|
|
7
|
-
return (React.createElement(BaseIconButton, { color: theme && theme.palette ? theme === null || theme === void 0 ? void 0 : theme.palette[color] : '#333333', height: height, icon: icon, isDisabled: loading || isDisabled, loading: loading || null, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, width: width, border: border, shadow: shadow },
|
|
7
|
+
var _b = _a.color, color = _b === void 0 ? 'darkest' : _b, height = _a.height, icon = _a.icon, isDisabled = _a.isDisabled, loading = _a.loading, noWrap = _a.noWrap, onClick = _a.onClick, border = _a.border, shadow = _a.shadow, width = _a.width, props = __rest(_a, ["color", "height", "icon", "isDisabled", "loading", "noWrap", "onClick", "border", "shadow", "width"]);
|
|
8
|
+
return (React.createElement(BaseIconButton, __assign({ color: theme && theme.palette ? theme === null || theme === void 0 ? void 0 : theme.palette[color] : '#333333', height: height, icon: icon, isDisabled: loading || isDisabled, loading: loading || null, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, width: width, border: border, shadow: shadow }, props),
|
|
8
9
|
loading && (React.createElement(Loading, null,
|
|
9
10
|
React.createElement(LoadingContainer, null,
|
|
10
11
|
React.createElement(LoadingSpinner, null)))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.137",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"moment": "^2.29.1",
|
|
72
72
|
"react-loading-skeleton": "^2.2.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "9b902009655edf042a17778741d7598acc93569a"
|
|
75
75
|
}
|