@citygross/components 0.8.40 → 0.8.42
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 +2 -1
- package/build/@types/components/CgButton/CgButton.styles.d.ts +1 -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 +2 -2
- package/build/cjs/components/src/components/CgButton/CgButton.styles.js +2 -2
- package/build/cjs/components/src/components/Pill/Pill.js +27 -0
- package/build/cjs/components/src/components/Pill/Pill.js.map +1 -0
- package/build/cjs/components/src/components/Pill/Pill.styles.js +38 -0
- package/build/cjs/components/src/components/Pill/Pill.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 +2 -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 +2 -2
- package/build/es/components/src/components/CgButton/CgButton.styles.js +2 -2
- package/build/es/components/src/components/Pill/Pill.js +19 -0
- package/build/es/components/src/components/Pill/Pill.js.map +1 -0
- package/build/es/components/src/components/Pill/Pill.styles.js +27 -0
- package/build/es/components/src/components/Pill/Pill.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
|
@@ -22,5 +22,6 @@ export declare type TCgButton = {
|
|
|
22
22
|
onClick?: () => void;
|
|
23
23
|
fullWidth?: boolean;
|
|
24
24
|
buttonRef?: React.Ref<HTMLButtonElement>;
|
|
25
|
+
round?: boolean;
|
|
25
26
|
};
|
|
26
|
-
export declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children, loading, fullWidth, buttonRef }: TCgButton) => JSX.Element;
|
|
27
|
+
export declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children, loading, fullWidth, buttonRef, round }: TCgButton) => JSX.Element;
|
|
@@ -8,6 +8,7 @@ export declare type TCgButtonStyleProps = {
|
|
|
8
8
|
loading?: boolean;
|
|
9
9
|
isIconOnly?: boolean;
|
|
10
10
|
fullWidth?: boolean;
|
|
11
|
+
round?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare const CgButtonContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, TCgButtonStyleProps, never>;
|
|
13
14
|
export declare const CgButtonContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<TCgButtonStyleProps, "flexReverse" | "size" | "loading">, never>;
|
package/build/@types/index.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ require('../CouponCode/CouponCode.js');
|
|
|
96
96
|
require('../CartCardLabel/CartCardLabel.styles.js');
|
|
97
97
|
require('../CartCard/CartCard.styles.js');
|
|
98
98
|
require('../PriceTag/PriceTag.js');
|
|
99
|
+
require('../Pill/Pill.styles.js');
|
|
99
100
|
|
|
100
101
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
101
102
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -25,8 +25,8 @@ 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 size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children, loading = _a.loading, fullWidth = _a.fullWidth, buttonRef = _a.buttonRef;
|
|
29
|
-
return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, { ref: buttonRef, size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled || loading, fullWidth: fullWidth, loading: loading, onKeyDown: function (event) {
|
|
28
|
+
var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children, loading = _a.loading, fullWidth = _a.fullWidth, buttonRef = _a.buttonRef, round = _a.round;
|
|
29
|
+
return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, { ref: buttonRef, round: round, size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled || loading, fullWidth: fullWidth, loading: loading, onKeyDown: function (event) {
|
|
30
30
|
if (event.key === 'Enter') {
|
|
31
31
|
onClick && onClick();
|
|
32
32
|
}
|
|
@@ -46,12 +46,12 @@ var buttonShadow = function (size, variant) {
|
|
|
46
46
|
return 'inset 0px -2px 0px rgba(0, 0, 0, 0.15)';
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
var CgButtonContainer = styled__default["default"].button(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\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"], ["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\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"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
|
|
49
|
+
var CgButtonContainer = styled__default["default"].button(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\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"], ["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\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"])), function (props) { var _a; return props.round ? '100' : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
|
|
50
50
|
var _a;
|
|
51
51
|
return props.isIconOnly
|
|
52
52
|
? "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px")
|
|
53
53
|
: buttonPadding(props.size, props.theme.spacings);
|
|
54
|
-
}, function (props) { return (props === null || props === void 0 ? void 0 : props.fullWidth) && "width: 100%;"; }, 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) {
|
|
54
|
+
}, function (props) { return (props === null || props === void 0 ? void 0 : props.fullWidth) && "width: 100%;"; }, global_styles.focusVisible, function (props) { return buttonShadow(props.size, props.variant); }, function (props) { var _a; return props.round ? '100' : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
|
|
55
55
|
switch (props.variant) {
|
|
56
56
|
case CgButton.EButtonVariant.primary:
|
|
57
57
|
return CgPrimary;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var Pill_styles = require('./Pill.styles.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
|
|
12
|
+
var Pill = function (_a) {
|
|
13
|
+
var _b = _a.active, active = _b === void 0 ? false : _b, amount = _a.amount, onClick = _a.onClick, text = _a.text;
|
|
14
|
+
return (React__default["default"].createElement(Pill_styles.PillComponent, { active: active, onClick: onClick, onKeyDown: function (e) {
|
|
15
|
+
if (e.key === 'Enter')
|
|
16
|
+
onClick();
|
|
17
|
+
}, tabIndex: 0 },
|
|
18
|
+
React__default["default"].createElement(Pill_styles.PillContent, null,
|
|
19
|
+
React__default["default"].createElement(Pill_styles.Text, null, text),
|
|
20
|
+
amount !== undefined && React__default["default"].createElement(Pill_styles.Amount, null,
|
|
21
|
+
"(",
|
|
22
|
+
amount,
|
|
23
|
+
")"))));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.Pill = Pill;
|
|
27
|
+
//# sourceMappingURL=Pill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
|
+
var styled = require('styled-components');
|
|
7
|
+
var global_styles = require('../../shared/global.styles.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
|
+
|
|
13
|
+
var PillComponent = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n cursor: pointer;\n font-size: ", "px;\n font-weight: ", ";\n line-height: ", "px;\n padding: ", "px\n ", "px;\n width: fit-content;\n\n ", "\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n cursor: pointer;\n font-size: ", "px;\n font-weight: ", ";\n line-height: ", "px;\n padding: ", "px\n ", "px;\n width: fit-content;\n\n ", "\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (props) { var _a, _b; return props.active ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
return props.active
|
|
16
|
+
? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue
|
|
17
|
+
: (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.medium;
|
|
18
|
+
}, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.big; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.medium; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.lineHeight.s2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; }, global_styles.focusVisible, function (props) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
return props.active
|
|
21
|
+
? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight
|
|
22
|
+
: (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.lightest;
|
|
23
|
+
}, function (props) { var _a; return props.active && ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover); }, function (props) {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
return props.active
|
|
26
|
+
? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLighter
|
|
27
|
+
: (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.lighter;
|
|
28
|
+
}, function (props) { var _a; return props.active && ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover); });
|
|
29
|
+
var PillContent = styled__default["default"].span(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
|
|
30
|
+
var Text = styled__default["default"].span(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.darkest; });
|
|
31
|
+
var Amount = styled__default["default"].span(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.placeholder; });
|
|
32
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
33
|
+
|
|
34
|
+
exports.Amount = Amount;
|
|
35
|
+
exports.PillComponent = PillComponent;
|
|
36
|
+
exports.PillContent = PillContent;
|
|
37
|
+
exports.Text = Text;
|
|
38
|
+
//# sourceMappingURL=Pill.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -96,6 +96,7 @@ require('../CouponCode/CouponCode.js');
|
|
|
96
96
|
require('../CartCardLabel/CartCardLabel.styles.js');
|
|
97
97
|
require('../CartCard/CartCard.styles.js');
|
|
98
98
|
require('../PriceTag/PriceTag.js');
|
|
99
|
+
require('../Pill/Pill.styles.js');
|
|
99
100
|
|
|
100
101
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
101
102
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -87,6 +87,7 @@ var CouponCode = require('./components/CouponCode/CouponCode.js');
|
|
|
87
87
|
var CartCardLabel = require('./components/CartCardLabel/CartCardLabel.js');
|
|
88
88
|
var CartCard = require('./components/CartCard/CartCard.js');
|
|
89
89
|
var PriceTag = require('./components/PriceTag/PriceTag.js');
|
|
90
|
+
var Pill = require('./components/Pill/Pill.js');
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
|
|
@@ -234,4 +235,5 @@ Object.defineProperty(exports, 'EPriceVariant', {
|
|
|
234
235
|
get: function () { return PriceTag.EPriceVariant; }
|
|
235
236
|
});
|
|
236
237
|
exports.PriceTag = PriceTag.PriceTag;
|
|
238
|
+
exports.Pill = Pill.Pill;
|
|
237
239
|
//# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -92,6 +92,7 @@ import '../CouponCode/CouponCode.js';
|
|
|
92
92
|
import '../CartCardLabel/CartCardLabel.styles.js';
|
|
93
93
|
import '../CartCard/CartCard.styles.js';
|
|
94
94
|
import '../PriceTag/PriceTag.js';
|
|
95
|
+
import '../Pill/Pill.styles.js';
|
|
95
96
|
|
|
96
97
|
function AddressBlock(_a) {
|
|
97
98
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -17,8 +17,8 @@ var EButtonVariant;
|
|
|
17
17
|
EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
|
|
18
18
|
})(EButtonVariant || (EButtonVariant = {}));
|
|
19
19
|
var CgButton = function (_a) {
|
|
20
|
-
var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children, loading = _a.loading, fullWidth = _a.fullWidth, buttonRef = _a.buttonRef;
|
|
21
|
-
return (React.createElement(CgButtonContainer, { ref: buttonRef, size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled || loading, fullWidth: fullWidth, loading: loading, onKeyDown: function (event) {
|
|
20
|
+
var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children, loading = _a.loading, fullWidth = _a.fullWidth, buttonRef = _a.buttonRef, round = _a.round;
|
|
21
|
+
return (React.createElement(CgButtonContainer, { ref: buttonRef, round: round, size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled || loading, fullWidth: fullWidth, loading: loading, onKeyDown: function (event) {
|
|
22
22
|
if (event.key === 'Enter') {
|
|
23
23
|
onClick && onClick();
|
|
24
24
|
}
|
|
@@ -38,12 +38,12 @@ var buttonShadow = function (size, variant) {
|
|
|
38
38
|
return 'inset 0px -2px 0px rgba(0, 0, 0, 0.15)';
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
var CgButtonContainer = styled.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\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"], ["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\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"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
|
|
41
|
+
var CgButtonContainer = styled.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\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"], ["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\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"])), function (props) { var _a; return props.round ? '100' : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
|
|
42
42
|
var _a;
|
|
43
43
|
return props.isIconOnly
|
|
44
44
|
? "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px")
|
|
45
45
|
: buttonPadding(props.size, props.theme.spacings);
|
|
46
|
-
}, function (props) { return (props === null || props === void 0 ? void 0 : props.fullWidth) && "width: 100%;"; }, 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) {
|
|
46
|
+
}, function (props) { return (props === null || props === void 0 ? void 0 : props.fullWidth) && "width: 100%;"; }, focusVisible, function (props) { return buttonShadow(props.size, props.variant); }, function (props) { var _a; return props.round ? '100' : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
|
|
47
47
|
switch (props.variant) {
|
|
48
48
|
case EButtonVariant.primary:
|
|
49
49
|
return CgPrimary;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PillComponent, PillContent, Text, Amount } from './Pill.styles.js';
|
|
3
|
+
|
|
4
|
+
var Pill = function (_a) {
|
|
5
|
+
var _b = _a.active, active = _b === void 0 ? false : _b, amount = _a.amount, onClick = _a.onClick, text = _a.text;
|
|
6
|
+
return (React.createElement(PillComponent, { active: active, onClick: onClick, onKeyDown: function (e) {
|
|
7
|
+
if (e.key === 'Enter')
|
|
8
|
+
onClick();
|
|
9
|
+
}, tabIndex: 0 },
|
|
10
|
+
React.createElement(PillContent, null,
|
|
11
|
+
React.createElement(Text, null, text),
|
|
12
|
+
amount !== undefined && React.createElement(Amount, null,
|
|
13
|
+
"(",
|
|
14
|
+
amount,
|
|
15
|
+
")"))));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { Pill };
|
|
19
|
+
//# sourceMappingURL=Pill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { focusVisible } from '../../shared/global.styles.js';
|
|
4
|
+
|
|
5
|
+
var PillComponent = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n cursor: pointer;\n font-size: ", "px;\n font-weight: ", ";\n line-height: ", "px;\n padding: ", "px\n ", "px;\n width: fit-content;\n\n ", "\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n cursor: pointer;\n font-size: ", "px;\n font-weight: ", ";\n line-height: ", "px;\n padding: ", "px\n ", "px;\n width: fit-content;\n\n ", "\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (props) { var _a, _b; return props.active ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
return props.active
|
|
8
|
+
? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue
|
|
9
|
+
: (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.medium;
|
|
10
|
+
}, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.big; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.medium; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.lineHeight.s2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs2; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; }, focusVisible, function (props) {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
return props.active
|
|
13
|
+
? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight
|
|
14
|
+
: (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.lightest;
|
|
15
|
+
}, function (props) { var _a; return props.active && ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover); }, function (props) {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
return props.active
|
|
18
|
+
? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLighter
|
|
19
|
+
: (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.lighter;
|
|
20
|
+
}, function (props) { var _a; return props.active && ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlueHover); });
|
|
21
|
+
var PillContent = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
|
|
22
|
+
var Text = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.darkest; });
|
|
23
|
+
var Amount = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.placeholder; });
|
|
24
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
25
|
+
|
|
26
|
+
export { Amount, PillComponent, PillContent, Text };
|
|
27
|
+
//# sourceMappingURL=Pill.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -92,6 +92,7 @@ import '../CouponCode/CouponCode.js';
|
|
|
92
92
|
import '../CartCardLabel/CartCardLabel.styles.js';
|
|
93
93
|
import '../CartCard/CartCard.styles.js';
|
|
94
94
|
import '../PriceTag/PriceTag.js';
|
|
95
|
+
import '../Pill/Pill.styles.js';
|
|
95
96
|
|
|
96
97
|
function WarningLabel(_a) {
|
|
97
98
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -83,4 +83,5 @@ export { CouponCode, ECouponCodeStatus } from './components/CouponCode/CouponCod
|
|
|
83
83
|
export { CartCardLabel } from './components/CartCardLabel/CartCardLabel.js';
|
|
84
84
|
export { CartCard } from './components/CartCard/CartCard.js';
|
|
85
85
|
export { EPriceVariant, PriceTag } from './components/PriceTag/PriceTag.js';
|
|
86
|
+
export { Pill } from './components/Pill/Pill.js';
|
|
86
87
|
//# 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.8.
|
|
3
|
+
"version": "0.8.42",
|
|
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": "6756c8b3fe74377a3f52958295e8c7854cbd3eac"
|
|
80
80
|
}
|