@citygross/components 0.8.142 → 0.8.144

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.
@@ -1,3 +1,10 @@
1
- export declare const Button: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, Omit<import("./CgButton.types").TCgButtonRoot, "children" | "loading" | "variant"> & import("./CgButton.types").TButtonSizeAttributes & import("./CgButton.types").TButtonVariantAttributes, never>;
2
- export declare const LinkAsButton: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, Omit<import("./CgButton.types").TCgButtonRoot, "children" | "loading" | "variant"> & import("./CgButton.types").TButtonSizeAttributes & import("./CgButton.types").TButtonVariantAttributes, never>;
3
- export declare const CgReactRouterLinkAsButton: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, Omit<import("./CgButton.types").TCgButtonRoot, "children" | "loading" | "variant"> & import("./CgButton.types").TButtonSizeAttributes & import("./CgButton.types").TButtonVariantAttributes, never>;
1
+ import { TCgButtonStyle } from './CgButton.types';
2
+ export declare const sharedButtonStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<TCgButtonStyle, import("styled-components").DefaultTheme>>;
3
+ export declare const ButtonStyle: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, Omit<import("./CgButton.types").TCgButtonRoot, "children" | "loading" | "variant"> & {
4
+ sizeAttributes: import("./CgButton.types").TButtonSizeAttributes;
5
+ variantAttributes: import("./CgButton.types").TButtonVariantAttributes;
6
+ }, never>;
7
+ export declare const DivAsButton: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Omit<import("./CgButton.types").TCgButtonRoot, "children" | "loading" | "variant"> & {
8
+ sizeAttributes: import("./CgButton.types").TButtonSizeAttributes;
9
+ variantAttributes: import("./CgButton.types").TButtonVariantAttributes;
10
+ }, never>;
@@ -22,8 +22,10 @@ export declare type TCgButtonRoot = {
22
22
  variant?: EButtonVariant;
23
23
  };
24
24
  export declare type TCgButton = TCgButtonRoot & React.ButtonHTMLAttributes<HTMLButtonElement>;
25
- export declare type TCgReactRouterLinkAsButton = TCgButtonRoot;
26
- export declare type TCgButtonStyle = Omit<TCgButtonRoot, 'children' | 'loading' | 'variant'> & TButtonSizeAttributes & TButtonVariantAttributes;
25
+ export declare type TCgButtonStyle = Omit<TCgButtonRoot, 'children' | 'loading' | 'variant'> & {
26
+ sizeAttributes: TButtonSizeAttributes;
27
+ variantAttributes: TButtonVariantAttributes;
28
+ };
27
29
  export declare type TButtonSizeAttributes = {
28
30
  fontSize?: number;
29
31
  height?: number;
@@ -0,0 +1,2 @@
1
+ import { TCgButtonRoot } from '../CgButton.types';
2
+ export declare const DivAsButton: ({ boxShadow, children, circle, fullWidth, rounded, size, variant, ...props }: TCgButtonRoot) => JSX.Element;
@@ -12,8 +12,8 @@ export * from './components/CartItemSummary/CartItemSummary';
12
12
  export * from './components/CartSubTotal/CartSubTotal';
13
13
  export * from './components/CartSummary/CartSummary';
14
14
  export * from './components/CgButton/CgButton';
15
- export * from './components/CgButton/ReactRouterLinkAsButton';
16
15
  export * from './components/CgButton/CgButton.types';
16
+ export * from './components/CgButton/CgButton.styles';
17
17
  export * from './components/Chips/Chip';
18
18
  export * from './components/Collapsable/Collapsable';
19
19
  export * from './components/CouponCode/CouponCode';
@@ -89,3 +89,4 @@ export * from './components/WarningLabel/WarningLabel';
89
89
  export * from './components/ZipCodeInput/ZipCodeInput';
90
90
  export * from './containers/PageContainer/PageContainer';
91
91
  export * from './containers/TwoColumnsContainer/TwoColumnsPageContainer';
92
+ export * from './helpers/button';
@@ -16,7 +16,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
16
  var CgButton = React.forwardRef(function (_a, ref) {
17
17
  var boxShadow = _a.boxShadow, children = _a.children, circle = _a.circle, fullWidth = _a.fullWidth, loading = _a.loading, rounded = _a.rounded, _b = _a.size, size = _b === void 0 ? CgButton_types.EButtonSize.medium : _b, _c = _a.variant, variant = _c === void 0 ? CgButton_types.EButtonVariant.primary : _c, props = _tslib.__rest(_a, ["boxShadow", "children", "circle", "fullWidth", "loading", "rounded", "size", "variant"]);
18
18
  var _d = button.getButtonAttributes(size, variant), sizeAttributes = _d.sizeAttributes, variantAttributes = _d.variantAttributes;
19
- return (React__default["default"].createElement(CgButton_styles.Button, _tslib.__assign({ backgroundColor: variantAttributes.backgroundColor, backgroundHover: variantAttributes.backgroundHover, backgroundDisabled: variantAttributes.backgroundDisabled, backgroundActive: variantAttributes.backgroundActive, border: variantAttributes.border, boxShadow: boxShadow, circle: circle, fontColor: variantAttributes.fontColor, fontSize: sizeAttributes.fontSize, height: sizeAttributes.height, fullWidth: fullWidth, paddingX: sizeAttributes.paddingX, paddingY: sizeAttributes.paddingY, ref: ref, rounded: rounded, size: size }, props),
19
+ return (React__default["default"].createElement(CgButton_styles.ButtonStyle, _tslib.__assign({ boxShadow: boxShadow, circle: circle, fullWidth: fullWidth, ref: ref, rounded: rounded, size: size, sizeAttributes: sizeAttributes, variantAttributes: variantAttributes }, props),
20
20
  loading && (React__default["default"].createElement(Spinner.Spinner, { animationSpeedMs: 1000, size: sizeAttributes.loadingSpinner })),
21
21
  children));
22
22
  });
@@ -13,10 +13,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
13
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
14
14
 
15
15
  var _a, _b, _c, _d, _e;
16
- var sharedButtonStyles = styled.css(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n border: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n background-color: ", ";\n color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ", "px;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n height: ", ";\n width: ", ";\n padding: ", ";\n transition: background-color 0.3s ease;\n white-space: nowrap;\n\n &:active {\n background-color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n border: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n background-color: ", ";\n color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ", "px;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n height: ", ";\n width: ", ";\n padding: ", ";\n transition: background-color 0.3s ease;\n white-space: nowrap;\n\n &:active {\n background-color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n"])), function (_a) {
16
+ var sharedButtonStyles = styled.css(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n border: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n background-color: ", ";\n color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ", "px;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n height: ", ";\n width: ", ";\n padding: ", ";\n transition: background-color 0.3s ease;\n white-space: nowrap;\n\n &:not(:disabled):hover {\n background-color: ", ";\n }\n\n &:not(:disabled):active,\n &:not(:disabled):hover:active,\n &:not(:disabled):focus:active {\n background-color: ", ";\n }\n\n ", "\n"], ["\n border: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n background-color: ", ";\n color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ", "px;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n height: ", ";\n width: ", ";\n padding: ", ";\n transition: background-color 0.3s ease;\n white-space: nowrap;\n\n &:not(:disabled):hover {\n background-color: ", ";\n }\n\n &:not(:disabled):active,\n &:not(:disabled):hover:active,\n &:not(:disabled):focus:active {\n background-color: ", ";\n }\n\n ", "\n"])), function (_a) {
17
17
  var _b;
18
- var border = _a.border;
19
- return border ? "1px solid ".concat((_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder) : 'none';
18
+ var variantAttributes = _a.variantAttributes;
19
+ return variantAttributes.border
20
+ ? "1px solid ".concat((_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder)
21
+ : 'none';
20
22
  }, function (_a) {
21
23
  var _b, _c, _d;
22
24
  var circle = _a.circle, rounded = _a.rounded;
@@ -34,38 +36,40 @@ var sharedButtonStyles = styled.css(templateObject_1 || (templateObject_1 = _tsl
34
36
  : (_c = designTokens.theme.attributes) === null || _c === void 0 ? void 0 : _c.boxShadow.layoutShadowInsetMedium
35
37
  : 'none';
36
38
  }, function (_a) {
37
- var backgroundColor = _a.backgroundColor;
38
- return backgroundColor;
39
+ var variantAttributes = _a.variantAttributes;
40
+ return variantAttributes.backgroundColor;
39
41
  }, function (_a) {
40
- var fontColor = _a.fontColor;
41
- return fontColor;
42
+ var variantAttributes = _a.variantAttributes;
43
+ return variantAttributes.fontColor;
42
44
  }, (_a = designTokens.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, (_b = designTokens.theme.typography) === null || _b === void 0 ? void 0 : _b.type.primary, function (_a) {
43
- var fontSize = _a.fontSize;
44
- return fontSize;
45
+ var sizeAttributes = _a.sizeAttributes;
46
+ return sizeAttributes.fontSize;
45
47
  }, (_d = (_c = designTokens.theme.typography) === null || _c === void 0 ? void 0 : _c.weight) === null || _d === void 0 ? void 0 : _d.medium, function (_a) {
46
- var circle = _a.circle, height = _a.height;
47
- return (!circle ? "".concat(height, "px") : 'max-content');
48
+ var circle = _a.circle, sizeAttributes = _a.sizeAttributes;
49
+ return !circle ? "".concat(sizeAttributes.height, "px") : 'max-content';
48
50
  }, function (_a) {
49
51
  var fullWidth = _a.fullWidth;
50
52
  return (fullWidth ? '100%' : 'max-content');
51
53
  }, function (_a) {
52
- var circle = _a.circle, paddingX = _a.paddingX, paddingY = _a.paddingY;
53
- return circle ? "".concat(paddingY, "px") : "".concat(paddingY, "px ").concat(paddingX, "px");
54
+ var circle = _a.circle, sizeAttributes = _a.sizeAttributes;
55
+ return circle
56
+ ? "".concat(sizeAttributes.paddingY, "px")
57
+ : "".concat(sizeAttributes.paddingY, "px ").concat(sizeAttributes.paddingX, "px");
54
58
  }, function (_a) {
55
- var backgroundActive = _a.backgroundActive;
56
- return backgroundActive;
59
+ var variantAttributes = _a.variantAttributes;
60
+ return variantAttributes.backgroundHover;
57
61
  }, function (_a) {
58
- var backgroundHover = _a.backgroundHover;
59
- return backgroundHover;
62
+ var variantAttributes = _a.variantAttributes;
63
+ return variantAttributes.backgroundActive;
60
64
  }, global_styles.focusVisible);
61
- var Button = styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n ", "\n\n cursor: pointer;\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: default;\n }\n"], ["\n ", "\n\n cursor: pointer;\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: default;\n }\n"])), sharedButtonStyles, function (_a) {
62
- var backgroundDisabled = _a.backgroundDisabled;
63
- return backgroundDisabled;
65
+ var ButtonStyle = styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n ", "\n cursor: pointer;\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: default;\n }\n"], ["\n ", "\n cursor: pointer;\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: default;\n }\n"])), sharedButtonStyles, function (_a) {
66
+ var variantAttributes = _a.variantAttributes;
67
+ return variantAttributes.backgroundDisabled;
64
68
  }, (_e = designTokens.theme.palette) === null || _e === void 0 ? void 0 : _e.placeholder);
65
- styled__default["default"].a(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n ", "\n text-decoration: none;\n"], ["\n ", "\n text-decoration: none;\n"])), sharedButtonStyles);
66
- var CgReactRouterLinkAsButton = styled__default["default"].a(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n ", "\n text-decoration: none;\n"], ["\n ", "\n text-decoration: none;\n"])), sharedButtonStyles);
67
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
69
+ var DivAsButton = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n ", "\n cursor: pointer;\n"], ["\n ", "\n cursor: pointer;\n"])), sharedButtonStyles);
70
+ var templateObject_1, templateObject_2, templateObject_3;
68
71
 
69
- exports.Button = Button;
70
- exports.CgReactRouterLinkAsButton = CgReactRouterLinkAsButton;
72
+ exports.ButtonStyle = ButtonStyle;
73
+ exports.DivAsButton = DivAsButton;
74
+ exports.sharedButtonStyles = sharedButtonStyles;
71
75
  //# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -19,8 +19,8 @@ var CartItemSummary = require('./components/CartItemSummary/CartItemSummary.js')
19
19
  var CartSubTotal = require('./components/CartSubTotal/CartSubTotal.js');
20
20
  var CartSummary = require('./components/CartSummary/CartSummary.js');
21
21
  var CgButton = require('./components/CgButton/CgButton.js');
22
- var ReactRouterLinkAsButton = require('./components/CgButton/ReactRouterLinkAsButton.js');
23
22
  var CgButton_types = require('./components/CgButton/CgButton.types.js');
23
+ var CgButton_styles = require('./components/CgButton/CgButton.styles.js');
24
24
  var Chip = require('./components/Chips/Chip.js');
25
25
  var Collapsable = require('./components/Collapsable/Collapsable.js');
26
26
  var CouponCode = require('./components/CouponCode/CouponCode.js');
@@ -98,6 +98,7 @@ var WarningLabel = require('./components/WarningLabel/WarningLabel.js');
98
98
  var ZipCodeInput = require('./components/ZipCodeInput/ZipCodeInput.js');
99
99
  var PageContainer = require('./containers/PageContainer/PageContainer.js');
100
100
  var TwoColumnsPageContainer = require('./containers/TwoColumnsContainer/TwoColumnsPageContainer.js');
101
+ var button = require('./helpers/button.js');
101
102
 
102
103
 
103
104
 
@@ -130,7 +131,6 @@ Object.defineProperty(exports, 'ECartSubTotalTypes', {
130
131
  });
131
132
  exports.CartSummary = CartSummary.CartSummary;
132
133
  exports.CgButton = CgButton.CgButton;
133
- exports.CgReactRouterLinkAsButton = ReactRouterLinkAsButton.CgReactRouterLinkAsButton;
134
134
  Object.defineProperty(exports, 'EButtonSize', {
135
135
  enumerable: true,
136
136
  get: function () { return CgButton_types.EButtonSize; }
@@ -139,6 +139,9 @@ Object.defineProperty(exports, 'EButtonVariant', {
139
139
  enumerable: true,
140
140
  get: function () { return CgButton_types.EButtonVariant; }
141
141
  });
142
+ exports.ButtonStyle = CgButton_styles.ButtonStyle;
143
+ exports.DivAsButton = CgButton_styles.DivAsButton;
144
+ exports.sharedButtonStyles = CgButton_styles.sharedButtonStyles;
142
145
  exports.Chip = Chip.Chip;
143
146
  exports.Collapsable = Collapsable.Collapsable;
144
147
  exports.CouponCode = CouponCode.CouponCode;
@@ -268,4 +271,5 @@ exports.WarningLabel = WarningLabel.WarningLabel;
268
271
  exports.ZipCodeInput = ZipCodeInput.ZipCodeInput;
269
272
  exports.PageContainer = PageContainer.PageContainer;
270
273
  exports.TwoColumnsPageContainer = TwoColumnsPageContainer.TwoColumnsPageContainer;
274
+ exports.getButtonAttributes = button.getButtonAttributes;
271
275
  //# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { __rest, __assign } from '../../../../_virtual/_tslib.js';
2
2
  import React, { forwardRef } from 'react';
3
- import { Button } from './CgButton.styles.js';
3
+ import { ButtonStyle } from './CgButton.styles.js';
4
4
  import { Spinner } from '../Spinner/Spinner.js';
5
5
  import { EButtonSize, EButtonVariant } from './CgButton.types.js';
6
6
  import { getButtonAttributes } from '../../helpers/button.js';
@@ -8,7 +8,7 @@ import { getButtonAttributes } from '../../helpers/button.js';
8
8
  var CgButton = forwardRef(function (_a, ref) {
9
9
  var boxShadow = _a.boxShadow, children = _a.children, circle = _a.circle, fullWidth = _a.fullWidth, loading = _a.loading, rounded = _a.rounded, _b = _a.size, size = _b === void 0 ? EButtonSize.medium : _b, _c = _a.variant, variant = _c === void 0 ? EButtonVariant.primary : _c, props = __rest(_a, ["boxShadow", "children", "circle", "fullWidth", "loading", "rounded", "size", "variant"]);
10
10
  var _d = getButtonAttributes(size, variant), sizeAttributes = _d.sizeAttributes, variantAttributes = _d.variantAttributes;
11
- return (React.createElement(Button, __assign({ backgroundColor: variantAttributes.backgroundColor, backgroundHover: variantAttributes.backgroundHover, backgroundDisabled: variantAttributes.backgroundDisabled, backgroundActive: variantAttributes.backgroundActive, border: variantAttributes.border, boxShadow: boxShadow, circle: circle, fontColor: variantAttributes.fontColor, fontSize: sizeAttributes.fontSize, height: sizeAttributes.height, fullWidth: fullWidth, paddingX: sizeAttributes.paddingX, paddingY: sizeAttributes.paddingY, ref: ref, rounded: rounded, size: size }, props),
11
+ return (React.createElement(ButtonStyle, __assign({ boxShadow: boxShadow, circle: circle, fullWidth: fullWidth, ref: ref, rounded: rounded, size: size, sizeAttributes: sizeAttributes, variantAttributes: variantAttributes }, props),
12
12
  loading && (React.createElement(Spinner, { animationSpeedMs: 1000, size: sizeAttributes.loadingSpinner })),
13
13
  children));
14
14
  });
@@ -5,10 +5,12 @@ import { EButtonSize } from './CgButton.types.js';
5
5
  import { theme } from '@citygross/design-tokens';
6
6
 
7
7
  var _a, _b, _c, _d, _e;
8
- var sharedButtonStyles = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n background-color: ", ";\n color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ", "px;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n height: ", ";\n width: ", ";\n padding: ", ";\n transition: background-color 0.3s ease;\n white-space: nowrap;\n\n &:active {\n background-color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n border: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n background-color: ", ";\n color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ", "px;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n height: ", ";\n width: ", ";\n padding: ", ";\n transition: background-color 0.3s ease;\n white-space: nowrap;\n\n &:active {\n background-color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n"])), function (_a) {
8
+ var sharedButtonStyles = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n background-color: ", ";\n color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ", "px;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n height: ", ";\n width: ", ";\n padding: ", ";\n transition: background-color 0.3s ease;\n white-space: nowrap;\n\n &:not(:disabled):hover {\n background-color: ", ";\n }\n\n &:not(:disabled):active,\n &:not(:disabled):hover:active,\n &:not(:disabled):focus:active {\n background-color: ", ";\n }\n\n ", "\n"], ["\n border: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n background-color: ", ";\n color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ", "px;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n height: ", ";\n width: ", ";\n padding: ", ";\n transition: background-color 0.3s ease;\n white-space: nowrap;\n\n &:not(:disabled):hover {\n background-color: ", ";\n }\n\n &:not(:disabled):active,\n &:not(:disabled):hover:active,\n &:not(:disabled):focus:active {\n background-color: ", ";\n }\n\n ", "\n"])), function (_a) {
9
9
  var _b;
10
- var border = _a.border;
11
- return border ? "1px solid ".concat((_b = theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder) : 'none';
10
+ var variantAttributes = _a.variantAttributes;
11
+ return variantAttributes.border
12
+ ? "1px solid ".concat((_b = theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder)
13
+ : 'none';
12
14
  }, function (_a) {
13
15
  var _b, _c, _d;
14
16
  var circle = _a.circle, rounded = _a.rounded;
@@ -26,37 +28,38 @@ var sharedButtonStyles = css(templateObject_1 || (templateObject_1 = __makeTempl
26
28
  : (_c = theme.attributes) === null || _c === void 0 ? void 0 : _c.boxShadow.layoutShadowInsetMedium
27
29
  : 'none';
28
30
  }, function (_a) {
29
- var backgroundColor = _a.backgroundColor;
30
- return backgroundColor;
31
+ var variantAttributes = _a.variantAttributes;
32
+ return variantAttributes.backgroundColor;
31
33
  }, function (_a) {
32
- var fontColor = _a.fontColor;
33
- return fontColor;
34
+ var variantAttributes = _a.variantAttributes;
35
+ return variantAttributes.fontColor;
34
36
  }, (_a = theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.type.primary, function (_a) {
35
- var fontSize = _a.fontSize;
36
- return fontSize;
37
+ var sizeAttributes = _a.sizeAttributes;
38
+ return sizeAttributes.fontSize;
37
39
  }, (_d = (_c = theme.typography) === null || _c === void 0 ? void 0 : _c.weight) === null || _d === void 0 ? void 0 : _d.medium, function (_a) {
38
- var circle = _a.circle, height = _a.height;
39
- return (!circle ? "".concat(height, "px") : 'max-content');
40
+ var circle = _a.circle, sizeAttributes = _a.sizeAttributes;
41
+ return !circle ? "".concat(sizeAttributes.height, "px") : 'max-content';
40
42
  }, function (_a) {
41
43
  var fullWidth = _a.fullWidth;
42
44
  return (fullWidth ? '100%' : 'max-content');
43
45
  }, function (_a) {
44
- var circle = _a.circle, paddingX = _a.paddingX, paddingY = _a.paddingY;
45
- return circle ? "".concat(paddingY, "px") : "".concat(paddingY, "px ").concat(paddingX, "px");
46
+ var circle = _a.circle, sizeAttributes = _a.sizeAttributes;
47
+ return circle
48
+ ? "".concat(sizeAttributes.paddingY, "px")
49
+ : "".concat(sizeAttributes.paddingY, "px ").concat(sizeAttributes.paddingX, "px");
46
50
  }, function (_a) {
47
- var backgroundActive = _a.backgroundActive;
48
- return backgroundActive;
51
+ var variantAttributes = _a.variantAttributes;
52
+ return variantAttributes.backgroundHover;
49
53
  }, function (_a) {
50
- var backgroundHover = _a.backgroundHover;
51
- return backgroundHover;
54
+ var variantAttributes = _a.variantAttributes;
55
+ return variantAttributes.backgroundActive;
52
56
  }, focusVisible);
53
- var Button = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n\n cursor: pointer;\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: default;\n }\n"], ["\n ", "\n\n cursor: pointer;\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: default;\n }\n"])), sharedButtonStyles, function (_a) {
54
- var backgroundDisabled = _a.backgroundDisabled;
55
- return backgroundDisabled;
57
+ var ButtonStyle = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n cursor: pointer;\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: default;\n }\n"], ["\n ", "\n cursor: pointer;\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: default;\n }\n"])), sharedButtonStyles, function (_a) {
58
+ var variantAttributes = _a.variantAttributes;
59
+ return variantAttributes.backgroundDisabled;
56
60
  }, (_e = theme.palette) === null || _e === void 0 ? void 0 : _e.placeholder);
57
- styled.a(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n text-decoration: none;\n"], ["\n ", "\n text-decoration: none;\n"])), sharedButtonStyles);
58
- var CgReactRouterLinkAsButton = styled.a(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n text-decoration: none;\n"], ["\n ", "\n text-decoration: none;\n"])), sharedButtonStyles);
59
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
61
+ var DivAsButton = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n cursor: pointer;\n"], ["\n ", "\n cursor: pointer;\n"])), sharedButtonStyles);
62
+ var templateObject_1, templateObject_2, templateObject_3;
60
63
 
61
- export { Button, CgReactRouterLinkAsButton };
64
+ export { ButtonStyle, DivAsButton, sharedButtonStyles };
62
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -15,8 +15,8 @@ export { CartItemSummary } from './components/CartItemSummary/CartItemSummary.js
15
15
  export { CartSubTotal, ECartSubTotalTypes } from './components/CartSubTotal/CartSubTotal.js';
16
16
  export { CartSummary } from './components/CartSummary/CartSummary.js';
17
17
  export { CgButton } from './components/CgButton/CgButton.js';
18
- export { CgReactRouterLinkAsButton } from './components/CgButton/ReactRouterLinkAsButton.js';
19
18
  export { EButtonSize, EButtonVariant } from './components/CgButton/CgButton.types.js';
19
+ export { ButtonStyle, DivAsButton, sharedButtonStyles } from './components/CgButton/CgButton.styles.js';
20
20
  export { Chip } from './components/Chips/Chip.js';
21
21
  export { Collapsable } from './components/Collapsable/Collapsable.js';
22
22
  export { CouponCode, ECouponCodeStatus } from './components/CouponCode/CouponCode.js';
@@ -94,4 +94,5 @@ export { WarningLabel } from './components/WarningLabel/WarningLabel.js';
94
94
  export { ZipCodeInput } from './components/ZipCodeInput/ZipCodeInput.js';
95
95
  export { PageContainer } from './containers/PageContainer/PageContainer.js';
96
96
  export { TwoColumnsPageContainer } from './containers/TwoColumnsContainer/TwoColumnsPageContainer.js';
97
+ export { getButtonAttributes } from './helpers/button.js';
97
98
  //# 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.142",
3
+ "version": "0.8.144",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -74,5 +74,5 @@
74
74
  "react-slick": "^0.30.1",
75
75
  "slick-carousel": "^1.8.1"
76
76
  },
77
- "gitHead": "961e05b14868e4153d7062da5b823f5abe5c13d9"
77
+ "gitHead": "6e953b71579d653a5f1e24897e69183101f0a469"
78
78
  }
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { TCgReactRouterLinkAsButton } from './CgButton.types';
3
- export declare const CgReactRouterLinkAsButton: ({ children, size, variant, ...props }: TCgReactRouterLinkAsButton) => JSX.Element;
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../../../_virtual/_tslib.js');
6
- var React = require('react');
7
- var button = require('../../helpers/button.js');
8
- var CgButton_types = require('./CgButton.types.js');
9
- var CgButton_styles = require('./CgButton.styles.js');
10
-
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
-
15
- var CgReactRouterLinkAsButton = function (_a) {
16
- var children = _a.children, _b = _a.size, size = _b === void 0 ? CgButton_types.EButtonSize.medium : _b, _c = _a.variant, variant = _c === void 0 ? CgButton_types.EButtonVariant.primary : _c, props = _tslib.__rest(_a, ["children", "size", "variant"]);
17
- var _d = button.getButtonAttributes(size, variant), sizeAttributes = _d.sizeAttributes, variantAttributes = _d.variantAttributes;
18
- return (React__default["default"].createElement(CgButton_styles.CgReactRouterLinkAsButton, _tslib.__assign({ backgroundColor: variantAttributes.backgroundColor, backgroundHover: variantAttributes.backgroundHover, backgroundDisabled: variantAttributes.backgroundDisabled, backgroundActive: variantAttributes.backgroundActive, border: variantAttributes.border, boxShadow: props.boxShadow, circle: props.circle, fontColor: variantAttributes.fontColor, fontSize: sizeAttributes.fontSize, height: sizeAttributes.height, fullWidth: props.fullWidth, paddingX: sizeAttributes.paddingX, paddingY: sizeAttributes.paddingY, rounded: props.rounded, size: size }, props), children));
19
- };
20
-
21
- exports.CgReactRouterLinkAsButton = CgReactRouterLinkAsButton;
22
- //# sourceMappingURL=ReactRouterLinkAsButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactRouterLinkAsButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,14 +0,0 @@
1
- import { __rest, __assign } from '../../../../_virtual/_tslib.js';
2
- import React from 'react';
3
- import { getButtonAttributes } from '../../helpers/button.js';
4
- import { EButtonSize, EButtonVariant } from './CgButton.types.js';
5
- import { CgReactRouterLinkAsButton as CgReactRouterLinkAsButton$1 } from './CgButton.styles.js';
6
-
7
- var CgReactRouterLinkAsButton = function (_a) {
8
- var children = _a.children, _b = _a.size, size = _b === void 0 ? EButtonSize.medium : _b, _c = _a.variant, variant = _c === void 0 ? EButtonVariant.primary : _c, props = __rest(_a, ["children", "size", "variant"]);
9
- var _d = getButtonAttributes(size, variant), sizeAttributes = _d.sizeAttributes, variantAttributes = _d.variantAttributes;
10
- return (React.createElement(CgReactRouterLinkAsButton$1, __assign({ backgroundColor: variantAttributes.backgroundColor, backgroundHover: variantAttributes.backgroundHover, backgroundDisabled: variantAttributes.backgroundDisabled, backgroundActive: variantAttributes.backgroundActive, border: variantAttributes.border, boxShadow: props.boxShadow, circle: props.circle, fontColor: variantAttributes.fontColor, fontSize: sizeAttributes.fontSize, height: sizeAttributes.height, fullWidth: props.fullWidth, paddingX: sizeAttributes.paddingX, paddingY: sizeAttributes.paddingY, rounded: props.rounded, size: size }, props), children));
11
- };
12
-
13
- export { CgReactRouterLinkAsButton };
14
- //# sourceMappingURL=ReactRouterLinkAsButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactRouterLinkAsButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}