@citygross/components 0.7.241 → 0.7.242

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.
@@ -21,5 +21,4 @@ export declare type TCgButton = {
21
21
  disabled?: boolean;
22
22
  onClick?: () => void;
23
23
  };
24
- declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children }: TCgButton) => JSX.Element;
25
- export default CgButton;
24
+ export declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children }: TCgButton) => JSX.Element;
@@ -18,7 +18,7 @@ var CartSubTotalContainer = styled__default["default"].div(templateObject_1 || (
18
18
  : "\n font-size: ".concat((_f = (_e = props.theme.typography) === null || _e === void 0 ? void 0 : _e.size) === null || _f === void 0 ? void 0 : _f.s2, "px;\n font-weight: ").concat((_h = (_g = props.theme.typography) === null || _g === void 0 ? void 0 : _g.weight) === null || _h === void 0 ? void 0 : _h.regular, ";\n ");
19
19
  });
20
20
  var SubTotalLabel = styled__default["default"].div(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.xs; });
21
- var ToolTipButton = styled__default["default"].button(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n outline: none;\n border: none;\n background: transparent;\n height: ", "px;\n ", "\n"], ["\n outline: none;\n border: none;\n background: transparent;\n height: ", "px;\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, global_styles.focusVisible);
21
+ var ToolTipButton = styled__default["default"].button(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n outline: none;\n border: none;\n background: transparent;\n height: ", "px;\n padding: 0;\n margin-bottom: ", "px;\n cursor: pointer;\n ", "\n"], ["\n outline: none;\n border: none;\n background: transparent;\n height: ", "px;\n padding: 0;\n margin-bottom: ", "px;\n cursor: pointer;\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, global_styles.focusVisible);
22
22
  var templateObject_1, templateObject_2, templateObject_3;
23
23
 
24
24
  exports.CartSubTotalContainer = CartSubTotalContainer;
@@ -2,8 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('react');
6
- require('./CgButton.styles.js');
5
+ var React = require('react');
6
+ var CgButton_styles = require('./CgButton.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);
7
11
 
8
12
  exports.ECgButtonSize = void 0;
9
13
  (function (ECgButtonSize) {
@@ -18,5 +22,20 @@ exports.EButtonVariant = void 0;
18
22
  EButtonVariant[EButtonVariant["tertiary"] = 2] = "tertiary";
19
23
  EButtonVariant[EButtonVariant["prio"] = 3] = "prio";
20
24
  EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
21
- })(exports.EButtonVariant || (exports.EButtonVariant = {}));
25
+ })(exports.EButtonVariant || (exports.EButtonVariant = {}));
26
+ var CgButton = function (_a) {
27
+ var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children;
28
+ return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, { size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled, onKeyDown: function (event) {
29
+ if (event.key === 'Enter') {
30
+ onClick && onClick();
31
+ }
32
+ }, onClick: function (e) {
33
+ e.preventDefault();
34
+ onClick && onClick();
35
+ } },
36
+ icon,
37
+ children));
38
+ };
39
+
40
+ exports.CgButton = CgButton;
22
41
  //# sourceMappingURL=CgButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var _tslib = require('../../../../_virtual/_tslib.js');
4
6
  var styled = require('styled-components');
5
7
  var global_styles = require('../../shared/global.styles.js');
@@ -44,7 +46,7 @@ var buttonShadow = function (size, variant) {
44
46
  return 'inset 0px -2px 0px rgba(0, 0, 0, 0.15)';
45
47
  }
46
48
  };
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) {
49
+ var CgButtonContainer = 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
50
  var _a;
49
51
  return props.isIconOnly
50
52
  ? "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px")
@@ -66,4 +68,6 @@ styled__default["default"].button(templateObject_7 || (templateObject_7 = _tslib
66
68
  }
67
69
  });
68
70
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
71
+
72
+ exports.CgButtonContainer = CgButtonContainer;
69
73
  //# sourceMappingURL=CgButton.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -202,6 +202,7 @@ Object.defineProperty(exports, 'ECartSubTotalTypes', {
202
202
  enumerable: true,
203
203
  get: function () { return CartSubTotal.ECartSubTotalTypes; }
204
204
  });
205
+ exports.CgButton = CgButton.CgButton;
205
206
  Object.defineProperty(exports, 'EButtonVariant', {
206
207
  enumerable: true,
207
208
  get: function () { return CgButton.EButtonVariant; }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -10,7 +10,7 @@ var CartSubTotalContainer = styled.div(templateObject_1 || (templateObject_1 = _
10
10
  : "\n font-size: ".concat((_f = (_e = props.theme.typography) === null || _e === void 0 ? void 0 : _e.size) === null || _f === void 0 ? void 0 : _f.s2, "px;\n font-weight: ").concat((_h = (_g = props.theme.typography) === null || _g === void 0 ? void 0 : _g.weight) === null || _h === void 0 ? void 0 : _h.regular, ";\n ");
11
11
  });
12
12
  var SubTotalLabel = styled.div(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.xs; });
13
- var ToolTipButton = styled.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n outline: none;\n border: none;\n background: transparent;\n height: ", "px;\n ", "\n"], ["\n outline: none;\n border: none;\n background: transparent;\n height: ", "px;\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, focusVisible);
13
+ var ToolTipButton = styled.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n outline: none;\n border: none;\n background: transparent;\n height: ", "px;\n padding: 0;\n margin-bottom: ", "px;\n cursor: pointer;\n ", "\n"], ["\n outline: none;\n border: none;\n background: transparent;\n height: ", "px;\n padding: 0;\n margin-bottom: ", "px;\n cursor: pointer;\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, focusVisible);
14
14
  var templateObject_1, templateObject_2, templateObject_3;
15
15
 
16
16
  export { CartSubTotalContainer, SubTotalLabel, ToolTipButton };
@@ -1,5 +1,5 @@
1
- import 'react';
2
- import './CgButton.styles.js';
1
+ import React from 'react';
2
+ import { CgButtonContainer } from './CgButton.styles.js';
3
3
 
4
4
  var ECgButtonSize;
5
5
  (function (ECgButtonSize) {
@@ -14,7 +14,20 @@ var EButtonVariant;
14
14
  EButtonVariant[EButtonVariant["tertiary"] = 2] = "tertiary";
15
15
  EButtonVariant[EButtonVariant["prio"] = 3] = "prio";
16
16
  EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
17
- })(EButtonVariant || (EButtonVariant = {}));
17
+ })(EButtonVariant || (EButtonVariant = {}));
18
+ var CgButton = function (_a) {
19
+ var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children;
20
+ return (React.createElement(CgButtonContainer, { size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled, onKeyDown: function (event) {
21
+ if (event.key === 'Enter') {
22
+ onClick && onClick();
23
+ }
24
+ }, onClick: function (e) {
25
+ e.preventDefault();
26
+ onClick && onClick();
27
+ } },
28
+ icon,
29
+ children));
30
+ };
18
31
 
19
- export { EButtonVariant, ECgButtonSize };
32
+ export { CgButton, EButtonVariant, ECgButtonSize };
20
33
  //# sourceMappingURL=CgButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CgButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -38,7 +38,7 @@ var buttonShadow = function (size, variant) {
38
38
  return 'inset 0px -2px 0px rgba(0, 0, 0, 0.15)';
39
39
  }
40
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) {
41
+ var CgButtonContainer = 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
42
  var _a;
43
43
  return props.isIconOnly
44
44
  ? "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px")
@@ -60,4 +60,6 @@ styled.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n
60
60
  }
61
61
  });
62
62
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
63
+
64
+ export { CgButtonContainer };
63
65
  //# sourceMappingURL=CgButton.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -78,6 +78,6 @@ export { ZipCodeInput } from './components/ZipCodeInput/ZipCodeInput.js';
78
78
  export { MaxHeightText } from './components/MaxHeightText/MaxHeightText.js';
79
79
  export { ToolTipDialog } from './components/ToolTipDialog/ToolTipDialog.js';
80
80
  export { CartSubTotal, ECartSubTotalTypes } from './components/CartSubTotal/CartSubTotal.js';
81
- export { EButtonVariant, ECgButtonSize } from './components/CgButton/CgButton.js';
81
+ export { CgButton, EButtonVariant, ECgButtonSize } from './components/CgButton/CgButton.js';
82
82
  export { RecipeLabel } from './components/RecipeLabel/RecipeLabel.js';
83
83
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.241",
3
+ "version": "0.7.242",
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": "8ae197149878330159779e1fe4dbb93dcf646b8e"
79
+ "gitHead": "289cf039019755eea756d3617c64f6941462e079"
80
80
  }