@citygross/components 0.7.238 → 0.7.239
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 +25 -0
- package/build/@types/components/CgButton/CgButton.styles.d.ts +11 -0
- package/build/@types/index.d.ts +1 -0
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +1 -0
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- package/build/cjs/components/src/components/CgButton/CgButton.js +22 -0
- package/build/cjs/components/src/components/CgButton/CgButton.js.map +1 -0
- package/build/cjs/components/src/components/CgButton/CgButton.styles.js +69 -0
- package/build/cjs/components/src/components/CgButton/CgButton.styles.js.map +1 -0
- package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +1 -0
- package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
- package/build/cjs/components/src/index.js +9 -0
- package/build/cjs/components/src/index.js.map +1 -1
- package/build/es/components/src/components/AddressBlock/AddressBlock.js +1 -0
- package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- package/build/es/components/src/components/CgButton/CgButton.js +20 -0
- package/build/es/components/src/components/CgButton/CgButton.js.map +1 -0
- package/build/es/components/src/components/CgButton/CgButton.styles.js +63 -0
- package/build/es/components/src/components/CgButton/CgButton.styles.js.map +1 -0
- package/build/es/components/src/components/WarningLabel/WarningLabel.js +1 -0
- package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
- package/build/es/components/src/index.js +1 -0
- package/build/es/components/src/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare enum ECgButtonSize {
|
|
3
|
+
'small' = 0,
|
|
4
|
+
'medium' = 1,
|
|
5
|
+
'large' = 2
|
|
6
|
+
}
|
|
7
|
+
export declare enum EButtonVariant {
|
|
8
|
+
'primary' = 0,
|
|
9
|
+
'secondary' = 1,
|
|
10
|
+
'tertiary' = 2,
|
|
11
|
+
'prio' = 3,
|
|
12
|
+
'ghost' = 4
|
|
13
|
+
}
|
|
14
|
+
export declare type TCgButton = {
|
|
15
|
+
size?: ECgButtonSize;
|
|
16
|
+
variant?: EButtonVariant;
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
flexReverse?: boolean;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
onClick?: () => void;
|
|
23
|
+
};
|
|
24
|
+
declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children }: TCgButton) => JSX.Element;
|
|
25
|
+
export default CgButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ECgButtonSize, EButtonVariant } from './CgButton';
|
|
3
|
+
export declare type TCgButtonStyleProps = {
|
|
4
|
+
size?: ECgButtonSize;
|
|
5
|
+
variant?: EButtonVariant;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
flexReverse?: boolean;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
isIconOnly?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const CgButtonContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, TCgButtonStyleProps, never>;
|
package/build/@types/index.d.ts
CHANGED
|
@@ -73,3 +73,4 @@ export * from './components/SlideInOutContainer/SlideInOutContainer';
|
|
|
73
73
|
export * from './components/SearchSuggestionChip/SearchSuggestionChip';
|
|
74
74
|
export * from './components/ZipCodeInput/ZipCodeInput';
|
|
75
75
|
export * from './components/MaxHeightText/MaxHeightText';
|
|
76
|
+
export * from './components/CgButton/CgButton';
|
|
@@ -89,6 +89,7 @@ require('../SlideInOutContainer/SlideInOutContainer.styles.js');
|
|
|
89
89
|
require('../SearchSuggestionChip/SearchSuggestionChip.styles.js');
|
|
90
90
|
require('../ZipCodeInput/ZipCodeInput.styles.js');
|
|
91
91
|
require('../MaxHeightText/styles.js');
|
|
92
|
+
require('../CgButton/CgButton.js');
|
|
92
93
|
|
|
93
94
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
94
95
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('react');
|
|
6
|
+
require('./CgButton.styles.js');
|
|
7
|
+
|
|
8
|
+
exports.ECgButtonSize = void 0;
|
|
9
|
+
(function (ECgButtonSize) {
|
|
10
|
+
ECgButtonSize[ECgButtonSize["small"] = 0] = "small";
|
|
11
|
+
ECgButtonSize[ECgButtonSize["medium"] = 1] = "medium";
|
|
12
|
+
ECgButtonSize[ECgButtonSize["large"] = 2] = "large";
|
|
13
|
+
})(exports.ECgButtonSize || (exports.ECgButtonSize = {}));
|
|
14
|
+
exports.EButtonVariant = void 0;
|
|
15
|
+
(function (EButtonVariant) {
|
|
16
|
+
EButtonVariant[EButtonVariant["primary"] = 0] = "primary";
|
|
17
|
+
EButtonVariant[EButtonVariant["secondary"] = 1] = "secondary";
|
|
18
|
+
EButtonVariant[EButtonVariant["tertiary"] = 2] = "tertiary";
|
|
19
|
+
EButtonVariant[EButtonVariant["prio"] = 3] = "prio";
|
|
20
|
+
EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
|
|
21
|
+
})(exports.EButtonVariant || (exports.EButtonVariant = {}));
|
|
22
|
+
//# sourceMappingURL=CgButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
4
|
+
var styled = require('styled-components');
|
|
5
|
+
var global_styles = require('../../shared/global.styles.js');
|
|
6
|
+
var CgButton = require('./CgButton.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
|
+
|
|
12
|
+
var disabledBase = styled.css(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n"], ["\n color: ", ";\n background-color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.light; });
|
|
13
|
+
var CgPrimary = styled.css(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"], ["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueActive; }, disabledBase);
|
|
14
|
+
var CgGhost = styled.css(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n"], ["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.darkest; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledGray; });
|
|
15
|
+
var CgSecondary = styled.css(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n ", "\n border: 1px solid ", ";\n \n"], ["\n ", "\n border: 1px solid ", ";\n \n"])), CgGhost, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; });
|
|
16
|
+
var CgTertiary = styled.css(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"], ["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandYellow; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.darkest; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandYellowHover; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandYellowActive; }, disabledBase);
|
|
17
|
+
var CgPrio = styled.css(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"], ["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandPurple; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandPrioHover; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandPrioActive; }, disabledBase);
|
|
18
|
+
var buttonFontSize = function (size, fontSize) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
switch (size) {
|
|
21
|
+
case CgButton.ECgButtonSize.small:
|
|
22
|
+
return "".concat((_a = fontSize === null || fontSize === void 0 ? void 0 : fontSize.size) === null || _a === void 0 ? void 0 : _a.s2, "px");
|
|
23
|
+
default:
|
|
24
|
+
return "".concat((_b = fontSize === null || fontSize === void 0 ? void 0 : fontSize.size) === null || _b === void 0 ? void 0 : _b.s3, "px");
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var buttonPadding = function (size, spacings) {
|
|
28
|
+
switch (size) {
|
|
29
|
+
case CgButton.ECgButtonSize.small:
|
|
30
|
+
return "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs2, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px");
|
|
31
|
+
case CgButton.ECgButtonSize.medium:
|
|
32
|
+
return "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs2, "px");
|
|
33
|
+
default:
|
|
34
|
+
return "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs2, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.sm, "px");
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var buttonShadow = function (size, variant) {
|
|
38
|
+
if (variant === CgButton.EButtonVariant.secondary || variant === CgButton.EButtonVariant.ghost)
|
|
39
|
+
return 'none';
|
|
40
|
+
switch (size) {
|
|
41
|
+
case CgButton.ECgButtonSize.small:
|
|
42
|
+
return 'inset 0px -1px 0px rgba(0, 0, 0, 0.15)';
|
|
43
|
+
default:
|
|
44
|
+
return 'inset 0px -2px 0px rgba(0, 0, 0, 0.15)';
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
styled__default["default"].button(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n border-radius: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: ", "px;\n flex-direction: ", ";\n font-size ", ";\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n &:disabled{\n cursor: default;\n }\n &:after{\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n"], ["\n border-radius: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: ", "px;\n flex-direction: ", ";\n font-size ", ";\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n &:disabled{\n cursor: default;\n }\n &:after{\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { return (props.flexReverse ? 'row-reverse' : 'row'); }, function (props) { return buttonFontSize(props.size, props.theme.typography); }, function (props) {
|
|
48
|
+
var _a;
|
|
49
|
+
return props.isIconOnly
|
|
50
|
+
? "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px")
|
|
51
|
+
: buttonPadding(props.size, props.theme.spacings);
|
|
52
|
+
}, global_styles.focusVisible, function (props) { return buttonShadow(props.size, props.variant); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
|
|
53
|
+
switch (props.variant) {
|
|
54
|
+
case CgButton.EButtonVariant.primary:
|
|
55
|
+
return CgPrimary;
|
|
56
|
+
case CgButton.EButtonVariant.secondary:
|
|
57
|
+
return CgSecondary;
|
|
58
|
+
case CgButton.EButtonVariant.tertiary:
|
|
59
|
+
return CgTertiary;
|
|
60
|
+
case CgButton.EButtonVariant.prio:
|
|
61
|
+
return CgPrio;
|
|
62
|
+
case CgButton.EButtonVariant.ghost:
|
|
63
|
+
return CgGhost;
|
|
64
|
+
default:
|
|
65
|
+
return CgPrimary;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
69
|
+
//# sourceMappingURL=CgButton.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -89,6 +89,7 @@ require('../SlideInOutContainer/SlideInOutContainer.styles.js');
|
|
|
89
89
|
require('../SearchSuggestionChip/SearchSuggestionChip.styles.js');
|
|
90
90
|
require('../ZipCodeInput/ZipCodeInput.styles.js');
|
|
91
91
|
require('../MaxHeightText/styles.js');
|
|
92
|
+
require('../CgButton/CgButton.js');
|
|
92
93
|
|
|
93
94
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
94
95
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -80,6 +80,7 @@ var SlideInOutContainer = require('./components/SlideInOutContainer/SlideInOutCo
|
|
|
80
80
|
var SearchSuggestionChip = require('./components/SearchSuggestionChip/SearchSuggestionChip.js');
|
|
81
81
|
var ZipCodeInput = require('./components/ZipCodeInput/ZipCodeInput.js');
|
|
82
82
|
var MaxHeightText = require('./components/MaxHeightText/MaxHeightText.js');
|
|
83
|
+
var CgButton = require('./components/CgButton/CgButton.js');
|
|
83
84
|
|
|
84
85
|
|
|
85
86
|
|
|
@@ -192,4 +193,12 @@ exports.SlideInOutContainer = SlideInOutContainer.SlideInOutContainer;
|
|
|
192
193
|
exports.SearchSuggestionChip = SearchSuggestionChip.SearchSuggestionChip;
|
|
193
194
|
exports.ZipCodeInput = ZipCodeInput.ZipCodeInput;
|
|
194
195
|
exports.MaxHeightText = MaxHeightText.MaxHeightText;
|
|
196
|
+
Object.defineProperty(exports, 'EButtonVariant', {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
get: function () { return CgButton.EButtonVariant; }
|
|
199
|
+
});
|
|
200
|
+
Object.defineProperty(exports, 'ECgButtonSize', {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function () { return CgButton.ECgButtonSize; }
|
|
203
|
+
});
|
|
195
204
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -85,6 +85,7 @@ import '../SlideInOutContainer/SlideInOutContainer.styles.js';
|
|
|
85
85
|
import '../SearchSuggestionChip/SearchSuggestionChip.styles.js';
|
|
86
86
|
import '../ZipCodeInput/ZipCodeInput.styles.js';
|
|
87
87
|
import '../MaxHeightText/styles.js';
|
|
88
|
+
import '../CgButton/CgButton.js';
|
|
88
89
|
|
|
89
90
|
function AddressBlock(_a) {
|
|
90
91
|
var _b = _a.deliverOption, deliverOption = _b === void 0 ? 'Address' : _b, icon = _a.icon, storeName = _a.storeName, customerName = _a.customerName, street = _a.street, zipCode = _a.zipCode, city = _a.city, doorCode = _a.doorCode, floor = _a.floor, deliveryInstructions = _a.deliveryInstructions, xsSpacing = _a.xsSpacing, lgSpacing = _a.lgSpacing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import './CgButton.styles.js';
|
|
3
|
+
|
|
4
|
+
var ECgButtonSize;
|
|
5
|
+
(function (ECgButtonSize) {
|
|
6
|
+
ECgButtonSize[ECgButtonSize["small"] = 0] = "small";
|
|
7
|
+
ECgButtonSize[ECgButtonSize["medium"] = 1] = "medium";
|
|
8
|
+
ECgButtonSize[ECgButtonSize["large"] = 2] = "large";
|
|
9
|
+
})(ECgButtonSize || (ECgButtonSize = {}));
|
|
10
|
+
var EButtonVariant;
|
|
11
|
+
(function (EButtonVariant) {
|
|
12
|
+
EButtonVariant[EButtonVariant["primary"] = 0] = "primary";
|
|
13
|
+
EButtonVariant[EButtonVariant["secondary"] = 1] = "secondary";
|
|
14
|
+
EButtonVariant[EButtonVariant["tertiary"] = 2] = "tertiary";
|
|
15
|
+
EButtonVariant[EButtonVariant["prio"] = 3] = "prio";
|
|
16
|
+
EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
|
|
17
|
+
})(EButtonVariant || (EButtonVariant = {}));
|
|
18
|
+
|
|
19
|
+
export { EButtonVariant, ECgButtonSize };
|
|
20
|
+
//# sourceMappingURL=CgButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { focusVisible } from '../../shared/global.styles.js';
|
|
4
|
+
import { EButtonVariant, ECgButtonSize } from './CgButton.js';
|
|
5
|
+
|
|
6
|
+
var disabledBase = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n"], ["\n color: ", ";\n background-color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.light; });
|
|
7
|
+
var CgPrimary = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"], ["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueActive; }, disabledBase);
|
|
8
|
+
var CgGhost = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n"], ["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.darkest; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledGray; });
|
|
9
|
+
var CgSecondary = css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n border: 1px solid ", ";\n \n"], ["\n ", "\n border: 1px solid ", ";\n \n"])), CgGhost, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; });
|
|
10
|
+
var CgTertiary = css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"], ["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandYellow; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.darkest; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandYellowHover; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandYellowActive; }, disabledBase);
|
|
11
|
+
var CgPrio = css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"], ["\n background-color: ", ";\n color: ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n ", "\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandPurple; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandPrioHover; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandPrioActive; }, disabledBase);
|
|
12
|
+
var buttonFontSize = function (size, fontSize) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
switch (size) {
|
|
15
|
+
case ECgButtonSize.small:
|
|
16
|
+
return "".concat((_a = fontSize === null || fontSize === void 0 ? void 0 : fontSize.size) === null || _a === void 0 ? void 0 : _a.s2, "px");
|
|
17
|
+
default:
|
|
18
|
+
return "".concat((_b = fontSize === null || fontSize === void 0 ? void 0 : fontSize.size) === null || _b === void 0 ? void 0 : _b.s3, "px");
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var buttonPadding = function (size, spacings) {
|
|
22
|
+
switch (size) {
|
|
23
|
+
case ECgButtonSize.small:
|
|
24
|
+
return "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs2, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px");
|
|
25
|
+
case ECgButtonSize.medium:
|
|
26
|
+
return "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs2, "px");
|
|
27
|
+
default:
|
|
28
|
+
return "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs2, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.sm, "px");
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var buttonShadow = function (size, variant) {
|
|
32
|
+
if (variant === EButtonVariant.secondary || variant === EButtonVariant.ghost)
|
|
33
|
+
return 'none';
|
|
34
|
+
switch (size) {
|
|
35
|
+
case ECgButtonSize.small:
|
|
36
|
+
return 'inset 0px -1px 0px rgba(0, 0, 0, 0.15)';
|
|
37
|
+
default:
|
|
38
|
+
return 'inset 0px -2px 0px rgba(0, 0, 0, 0.15)';
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
styled.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-radius: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: ", "px;\n flex-direction: ", ";\n font-size ", ";\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n &:disabled{\n cursor: default;\n }\n &:after{\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n"], ["\n border-radius: ", "px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: ", "px;\n flex-direction: ", ";\n font-size ", ";\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n &:disabled{\n cursor: default;\n }\n &:after{\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { return (props.flexReverse ? 'row-reverse' : 'row'); }, function (props) { return buttonFontSize(props.size, props.theme.typography); }, function (props) {
|
|
42
|
+
var _a;
|
|
43
|
+
return props.isIconOnly
|
|
44
|
+
? "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px")
|
|
45
|
+
: buttonPadding(props.size, props.theme.spacings);
|
|
46
|
+
}, focusVisible, function (props) { return buttonShadow(props.size, props.variant); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
|
|
47
|
+
switch (props.variant) {
|
|
48
|
+
case EButtonVariant.primary:
|
|
49
|
+
return CgPrimary;
|
|
50
|
+
case EButtonVariant.secondary:
|
|
51
|
+
return CgSecondary;
|
|
52
|
+
case EButtonVariant.tertiary:
|
|
53
|
+
return CgTertiary;
|
|
54
|
+
case EButtonVariant.prio:
|
|
55
|
+
return CgPrio;
|
|
56
|
+
case EButtonVariant.ghost:
|
|
57
|
+
return CgGhost;
|
|
58
|
+
default:
|
|
59
|
+
return CgPrimary;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
63
|
+
//# sourceMappingURL=CgButton.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -85,6 +85,7 @@ import '../SlideInOutContainer/SlideInOutContainer.styles.js';
|
|
|
85
85
|
import '../SearchSuggestionChip/SearchSuggestionChip.styles.js';
|
|
86
86
|
import '../ZipCodeInput/ZipCodeInput.styles.js';
|
|
87
87
|
import '../MaxHeightText/styles.js';
|
|
88
|
+
import '../CgButton/CgButton.js';
|
|
88
89
|
|
|
89
90
|
function WarningLabel(_a) {
|
|
90
91
|
var children = _a.children, background = _a.background, toolTip = _a.toolTip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -76,4 +76,5 @@ export { SlideInOutContainer } from './components/SlideInOutContainer/SlideInOut
|
|
|
76
76
|
export { SearchSuggestionChip } from './components/SearchSuggestionChip/SearchSuggestionChip.js';
|
|
77
77
|
export { ZipCodeInput } from './components/ZipCodeInput/ZipCodeInput.js';
|
|
78
78
|
export { MaxHeightText } from './components/MaxHeightText/MaxHeightText.js';
|
|
79
|
+
export { EButtonVariant, ECgButtonSize } from './components/CgButton/CgButton.js';
|
|
79
80
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.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.239",
|
|
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": "5387f5b1c301e072a9a1798ec889ee981dcaa5d4"
|
|
80
80
|
}
|