@citygross/components 0.19.6 → 0.20.0

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.
@@ -37,6 +37,7 @@ export declare type TListItem = {
37
37
  item?: TItem;
38
38
  isSmall?: boolean;
39
39
  loading?: boolean;
40
+ label?: string;
40
41
  showPriceStripe?: boolean;
41
42
  smallSkeleton?: boolean;
42
43
  };
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
+ export declare enum EPillVariant {
3
+ rounded = "rounded",
4
+ square = "square"
5
+ }
2
6
  export declare type TPill = {
3
7
  active?: boolean;
4
- amount?: number;
8
+ children: React.ReactNode;
5
9
  onClick: () => void;
6
- text: string;
7
- };
10
+ variant?: EPillVariant;
11
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>;
8
12
  export declare const Pill: React.FunctionComponent<TPill>;
@@ -1,7 +1,5 @@
1
1
  import { TPill } from './Pill';
2
- declare type TActive = Pick<TPill, 'active'>;
3
- export declare const PillComponent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TActive, never>;
2
+ declare type TPillStyles = Pick<TPill, 'active' | 'variant'>;
4
3
  export declare const PillContent: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
5
- export declare const Text: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
6
- export declare const Amount: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const PillComponent: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, TPillStyles, never>;
7
5
  export {};
@@ -81,7 +81,7 @@ require('../Modal/Modal.js');
81
81
  require('../NavMainLink/NavMainLink.styled.js');
82
82
  require('../Pagination/Pagination.styles.js');
83
83
  require('../PartnerOffer/PartnerOffer.js');
84
- require('../Pill/Pill.styles.js');
84
+ require('../Pill/Pill.js');
85
85
  require('styled-components');
86
86
  require('../PersonalCouponCard/PersonalCouponCard.styles.js');
87
87
  require('../PriceTag/PriceTag.types.js');
@@ -4,10 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var Skeleton = require('react-loading-skeleton');
7
+ var designTokens = require('@citygross/design-tokens');
8
+ var AvailabilityLabel = require('../AvailabilityLabel/AvailabilityLabel.js');
7
9
  var Fieldset = require('../Fieldset/Fieldset.js');
8
10
  var Checkbox = require('../FormElements/Checkbox/Checkbox.js');
11
+ var Label = require('../Label/Label.js');
9
12
  var PriceStripe = require('../PriceStripe/PriceStripe.js');
10
- var AvailabilityLabel = require('../AvailabilityLabel/AvailabilityLabel.js');
11
13
  var ProductHeader = require('../ProductHeader/ProductHeader.js');
12
14
  var ListItem_styles = require('./ListItem.styles.js');
13
15
  var PriceTag_types = require('../PriceTag/PriceTag.types.js');
@@ -23,8 +25,8 @@ exports.EListItemAlignment = void 0;
23
25
  EListItemAlignment["TOP"] = "flex-start";
24
26
  })(exports.EListItemAlignment || (exports.EListItemAlignment = {}));
25
27
  var ListItem = function (_a) {
26
- var _b;
27
- var _c = _a.alignment, alignment = _c === void 0 ? exports.EListItemAlignment.CENTER : _c, children = _a.children, checkboxes = _a.checkboxes, fallBackImage = _a.fallBackImage, checkboxLegendLabel = _a.checkboxLegendLabel, imageAutoHeight = _a.imageAutoHeight, item = _a.item, isSmall = _a.isSmall, _d = _a.loading, loading = _d === void 0 ? false : _d, _e = _a.showPriceStripe, showPriceStripe = _e === void 0 ? false : _e, smallSkeleton = _a.smallSkeleton;
28
+ var _b, _c, _d;
29
+ var _e = _a.alignment, alignment = _e === void 0 ? exports.EListItemAlignment.CENTER : _e, children = _a.children, checkboxes = _a.checkboxes, fallBackImage = _a.fallBackImage, checkboxLegendLabel = _a.checkboxLegendLabel, imageAutoHeight = _a.imageAutoHeight, item = _a.item, isSmall = _a.isSmall, label = _a.label, _f = _a.loading, loading = _f === void 0 ? false : _f, _g = _a.showPriceStripe, showPriceStripe = _g === void 0 ? false : _g, smallSkeleton = _a.smallSkeleton;
28
30
  return (React__default["default"].createElement(ListItem_styles.ListItemContainer, null,
29
31
  React__default["default"].createElement(ListItem_styles.ListLeft, { alignment: alignment },
30
32
  React__default["default"].createElement(ListItem_styles.ListImageContainer, { isSmall: isSmall },
@@ -54,9 +56,10 @@ var ListItem = function (_a) {
54
56
  checkbox.onChange(e.target.checked);
55
57
  }
56
58
  }, value: checkbox.value, alignItems: "flex-start" }));
57
- })))))),
59
+ })))),
60
+ label && (React__default["default"].createElement(Label.Label, { background: (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.blueLighter, color: (_d = designTokens.theme.palette) === null || _d === void 0 ? void 0 : _d.disabledDarkGray, label: label })))),
58
61
  (item === null || item === void 0 ? void 0 : item.secondaryDescription) && item.secondaryDescription)),
59
- children && (React__default["default"].createElement(ListItem_styles.ListRight, null, children))));
62
+ children && React__default["default"].createElement(ListItem_styles.ListRight, null, children)));
60
63
  };
61
64
 
62
65
  exports.ListItem = ListItem;
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _tslib = require('../../../../_virtual/_tslib.js');
5
6
  var React = require('react');
6
7
  var Pill_styles = require('./Pill.styles.js');
7
8
 
@@ -9,18 +10,15 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
10
 
10
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
12
 
13
+ exports.EPillVariant = void 0;
14
+ (function (EPillVariant) {
15
+ EPillVariant["rounded"] = "rounded";
16
+ EPillVariant["square"] = "square";
17
+ })(exports.EPillVariant || (exports.EPillVariant = {}));
12
18
  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
- ")"))));
19
+ var _b = _a.active, active = _b === void 0 ? false : _b, children = _a.children, onClick = _a.onClick, _c = _a.type, type = _c === void 0 ? 'button' : _c, _d = _a.variant, variant = _d === void 0 ? exports.EPillVariant.rounded : _d, props = _tslib.__rest(_a, ["active", "children", "onClick", "type", "variant"]);
20
+ return (React__default["default"].createElement(Pill_styles.PillComponent, _tslib.__assign({}, props, { active: active, "aria-pressed": active, onClick: onClick, type: type, variant: variant }),
21
+ React__default["default"].createElement(Pill_styles.PillContent, null, children)));
24
22
  };
25
23
 
26
24
  exports.Pill = Pill;
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,34 +5,113 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _tslib = require('../../../../_virtual/_tslib.js');
6
6
  var styled = require('styled-components');
7
7
  var global_styles = require('../../shared/global.styles.js');
8
+ var Pill = require('./Pill.js');
8
9
 
9
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
11
 
11
12
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12
13
 
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; });
14
+ var PillContent = styled__default["default"].span(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n align-items: center;\n display: flex;\n gap: ", "px;\n"], ["\n align-items: center;\n display: flex;\n gap: ", "px;\n"])), function (_a) {
15
+ var _b;
16
+ var theme = _a.theme;
17
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
18
+ });
19
+ var roundedStyles = styled.css(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n line-height: ", "px;\n padding: ", "px\n ", "px;\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 line-height: ", "px;\n padding: ", "px\n ", "px;\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (_a) {
20
+ var _b, _c;
21
+ var active = _a.active, theme = _a.theme;
22
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white;
23
+ }, function (_a) {
24
+ var _b, _c;
25
+ var active = _a.active, theme = _a.theme;
26
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlue : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.medium;
27
+ }, function (_a) {
28
+ var _b;
29
+ var theme = _a.theme;
30
+ return (_b = theme.attributes) === null || _b === void 0 ? void 0 : _b.borderRadius.big;
31
+ }, function (_a) {
32
+ var _b;
33
+ var theme = _a.theme;
34
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.lineHeight.s2;
35
+ }, function (_a) {
36
+ var _b;
37
+ var theme = _a.theme;
38
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs2;
39
+ }, function (_a) {
40
+ var _b;
41
+ var theme = _a.theme;
42
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs2;
43
+ }, function (_a) {
44
+ var _b, _c;
45
+ var active = _a.active, theme = _a.theme;
46
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.lightest;
47
+ }, function (_a) {
48
+ var _b;
49
+ var active = _a.active, theme = _a.theme;
50
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlueHover : undefined;
51
+ }, function (_a) {
52
+ var _b, _c;
53
+ var active = _a.active, theme = _a.theme;
54
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLighter : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.lighter;
55
+ }, function (_a) {
56
+ var _b;
57
+ var active = _a.active, theme = _a.theme;
58
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlueHover : undefined;
59
+ });
60
+ var squareStyles = styled.css(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n color: ", ";\n height: ", "px;\n justify-content: center;\n padding: ", "px\n ", "px;\n\n &:hover {\n border-color: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n width: 100%;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n color: ", ";\n height: ", "px;\n justify-content: center;\n padding: ", "px\n ", "px;\n\n &:hover {\n border-color: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n width: 100%;\n }\n"])), function (_a) {
61
+ var _b, _c;
62
+ var active = _a.active, theme = _a.theme;
63
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white;
64
+ }, function (_a) {
65
+ var _b, _c;
66
+ var active = _a.active, theme = _a.theme;
67
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.medium;
68
+ }, function (_a) {
69
+ var _b;
70
+ var theme = _a.theme;
71
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
72
+ }, function (_a) {
73
+ var _b;
74
+ var active = _a.active, theme = _a.theme;
75
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white : 'inherit';
76
+ }, function (_a) {
77
+ var _b;
78
+ var theme = _a.theme;
79
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xl;
80
+ }, function (_a) {
81
+ var _b;
82
+ var theme = _a.theme;
83
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
84
+ }, function (_a) {
85
+ var _b;
86
+ var theme = _a.theme;
87
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
88
+ }, function (_a) {
89
+ var _b;
90
+ var theme = _a.theme;
91
+ return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder;
92
+ }, function (_a) {
93
+ var _b;
94
+ var theme = _a.theme;
95
+ return (_b = theme.breakpoints) === null || _b === void 0 ? void 0 : _b.md;
96
+ });
97
+ var PillComponent = styled__default["default"].button(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n border: none;\n cursor: pointer;\n display: flex;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n width: fit-content;\n\n ", "\n\n ", "\n"], ["\n border: none;\n cursor: pointer;\n display: flex;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n width: fit-content;\n\n ", "\n\n ", "\n"])), function (_a) {
98
+ var _b;
99
+ var theme = _a.theme;
100
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.type.primary;
101
+ }, function (_a) {
102
+ var _b;
103
+ var theme = _a.theme;
104
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size.s2;
105
+ }, function (_a) {
106
+ var _b;
107
+ var theme = _a.theme;
108
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.weight.medium;
109
+ }, global_styles.focusVisible, function (_a) {
110
+ var variant = _a.variant;
111
+ return variant === Pill.EPillVariant.square ? squareStyles : roundedStyles;
112
+ });
32
113
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
33
114
 
34
- exports.Amount = Amount;
35
115
  exports.PillComponent = PillComponent;
36
116
  exports.PillContent = PillContent;
37
- exports.Text = Text;
38
117
  //# sourceMappingURL=Pill.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -238,6 +238,10 @@ exports.Modal = Modal.Modal;
238
238
  exports.NavMainLink = NavMainLink.NavMainLink;
239
239
  exports.Pagination = Pagination.Pagination;
240
240
  exports.PartnerOffer = PartnerOffer.PartnerOffer;
241
+ Object.defineProperty(exports, 'EPillVariant', {
242
+ enumerable: true,
243
+ get: function () { return Pill.EPillVariant; }
244
+ });
241
245
  exports.Pill = Pill.Pill;
242
246
  exports.PersonalCouponCard = PersonalCouponCard.PersonalCouponCard;
243
247
  exports.PriceStripe = PriceStripe.PriceStripe;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -77,7 +77,7 @@ import '../Modal/Modal.js';
77
77
  import '../NavMainLink/NavMainLink.styled.js';
78
78
  import '../Pagination/Pagination.styles.js';
79
79
  import '../PartnerOffer/PartnerOffer.js';
80
- import '../Pill/Pill.styles.js';
80
+ import '../Pill/Pill.js';
81
81
  import 'styled-components';
82
82
  import '../PersonalCouponCard/PersonalCouponCard.styles.js';
83
83
  import '../PriceTag/PriceTag.types.js';
@@ -1,9 +1,11 @@
1
1
  import React, { Fragment } from 'react';
2
2
  import Skeleton from 'react-loading-skeleton';
3
+ import { theme } from '@citygross/design-tokens';
4
+ import { AvailabilityLabel } from '../AvailabilityLabel/AvailabilityLabel.js';
3
5
  import { Fieldset } from '../Fieldset/Fieldset.js';
4
6
  import { Checkbox } from '../FormElements/Checkbox/Checkbox.js';
7
+ import { Label } from '../Label/Label.js';
5
8
  import { PriceStripe } from '../PriceStripe/PriceStripe.js';
6
- import { AvailabilityLabel } from '../AvailabilityLabel/AvailabilityLabel.js';
7
9
  import { ProductHeader, EProductHeader } from '../ProductHeader/ProductHeader.js';
8
10
  import { ListItemContainer, ListLeft, ListImageContainer, ListImage, ItemInformationContainer, VisuallyHiddenLegend, CheckboxContainer, ListRight } from './ListItem.styles.js';
9
11
  import { EPriceSize, EPriceVariant } from '../PriceTag/PriceTag.types.js';
@@ -14,8 +16,8 @@ var EListItemAlignment;
14
16
  EListItemAlignment["TOP"] = "flex-start";
15
17
  })(EListItemAlignment || (EListItemAlignment = {}));
16
18
  var ListItem = function (_a) {
17
- var _b;
18
- var _c = _a.alignment, alignment = _c === void 0 ? EListItemAlignment.CENTER : _c, children = _a.children, checkboxes = _a.checkboxes, fallBackImage = _a.fallBackImage, checkboxLegendLabel = _a.checkboxLegendLabel, imageAutoHeight = _a.imageAutoHeight, item = _a.item, isSmall = _a.isSmall, _d = _a.loading, loading = _d === void 0 ? false : _d, _e = _a.showPriceStripe, showPriceStripe = _e === void 0 ? false : _e, smallSkeleton = _a.smallSkeleton;
19
+ var _b, _c, _d;
20
+ var _e = _a.alignment, alignment = _e === void 0 ? EListItemAlignment.CENTER : _e, children = _a.children, checkboxes = _a.checkboxes, fallBackImage = _a.fallBackImage, checkboxLegendLabel = _a.checkboxLegendLabel, imageAutoHeight = _a.imageAutoHeight, item = _a.item, isSmall = _a.isSmall, label = _a.label, _f = _a.loading, loading = _f === void 0 ? false : _f, _g = _a.showPriceStripe, showPriceStripe = _g === void 0 ? false : _g, smallSkeleton = _a.smallSkeleton;
19
21
  return (React.createElement(ListItemContainer, null,
20
22
  React.createElement(ListLeft, { alignment: alignment },
21
23
  React.createElement(ListImageContainer, { isSmall: isSmall },
@@ -45,9 +47,10 @@ var ListItem = function (_a) {
45
47
  checkbox.onChange(e.target.checked);
46
48
  }
47
49
  }, value: checkbox.value, alignItems: "flex-start" }));
48
- })))))),
50
+ })))),
51
+ label && (React.createElement(Label, { background: (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.blueLighter, color: (_d = theme.palette) === null || _d === void 0 ? void 0 : _d.disabledDarkGray, label: label })))),
49
52
  (item === null || item === void 0 ? void 0 : item.secondaryDescription) && item.secondaryDescription)),
50
- children && (React.createElement(ListRight, null, children))));
53
+ children && React.createElement(ListRight, null, children)));
51
54
  };
52
55
 
53
56
  export { EListItemAlignment, ListItem };
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,19 +1,17 @@
1
+ import { __rest, __assign } from '../../../../_virtual/_tslib.js';
1
2
  import React from 'react';
2
- import { PillComponent, PillContent, Text, Amount } from './Pill.styles.js';
3
+ import { PillComponent, PillContent } from './Pill.styles.js';
3
4
 
5
+ var EPillVariant;
6
+ (function (EPillVariant) {
7
+ EPillVariant["rounded"] = "rounded";
8
+ EPillVariant["square"] = "square";
9
+ })(EPillVariant || (EPillVariant = {}));
4
10
  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
- ")"))));
11
+ var _b = _a.active, active = _b === void 0 ? false : _b, children = _a.children, onClick = _a.onClick, _c = _a.type, type = _c === void 0 ? 'button' : _c, _d = _a.variant, variant = _d === void 0 ? EPillVariant.rounded : _d, props = __rest(_a, ["active", "children", "onClick", "type", "variant"]);
12
+ return (React.createElement(PillComponent, __assign({}, props, { active: active, "aria-pressed": active, onClick: onClick, type: type, variant: variant }),
13
+ React.createElement(PillContent, null, children)));
16
14
  };
17
15
 
18
- export { Pill };
16
+ export { EPillVariant, Pill };
19
17
  //# sourceMappingURL=Pill.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pill.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1,27 +1,108 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
- import styled from 'styled-components';
2
+ import styled, { css } from 'styled-components';
3
3
  import { focusVisible } from '../../shared/global.styles.js';
4
+ import { EPillVariant } from './Pill.js';
4
5
 
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; });
6
+ var PillContent = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n gap: ", "px;\n"], ["\n align-items: center;\n display: flex;\n gap: ", "px;\n"])), function (_a) {
7
+ var _b;
8
+ var theme = _a.theme;
9
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
10
+ });
11
+ var roundedStyles = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n line-height: ", "px;\n padding: ", "px\n ", "px;\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 line-height: ", "px;\n padding: ", "px\n ", "px;\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (_a) {
12
+ var _b, _c;
13
+ var active = _a.active, theme = _a.theme;
14
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white;
15
+ }, function (_a) {
16
+ var _b, _c;
17
+ var active = _a.active, theme = _a.theme;
18
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlue : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.medium;
19
+ }, function (_a) {
20
+ var _b;
21
+ var theme = _a.theme;
22
+ return (_b = theme.attributes) === null || _b === void 0 ? void 0 : _b.borderRadius.big;
23
+ }, function (_a) {
24
+ var _b;
25
+ var theme = _a.theme;
26
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.lineHeight.s2;
27
+ }, function (_a) {
28
+ var _b;
29
+ var theme = _a.theme;
30
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs2;
31
+ }, function (_a) {
32
+ var _b;
33
+ var theme = _a.theme;
34
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs2;
35
+ }, function (_a) {
36
+ var _b, _c;
37
+ var active = _a.active, theme = _a.theme;
38
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.lightest;
39
+ }, function (_a) {
40
+ var _b;
41
+ var active = _a.active, theme = _a.theme;
42
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlueHover : undefined;
43
+ }, function (_a) {
44
+ var _b, _c;
45
+ var active = _a.active, theme = _a.theme;
46
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.blueLighter : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.lighter;
47
+ }, function (_a) {
48
+ var _b;
49
+ var active = _a.active, theme = _a.theme;
50
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlueHover : undefined;
51
+ });
52
+ var squareStyles = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n color: ", ";\n height: ", "px;\n justify-content: center;\n padding: ", "px\n ", "px;\n\n &:hover {\n border-color: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n width: 100%;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: ", "px;\n color: ", ";\n height: ", "px;\n justify-content: center;\n padding: ", "px\n ", "px;\n\n &:hover {\n border-color: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n width: 100%;\n }\n"])), function (_a) {
53
+ var _b, _c;
54
+ var active = _a.active, theme = _a.theme;
55
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white;
56
+ }, function (_a) {
57
+ var _b, _c;
58
+ var active = _a.active, theme = _a.theme;
59
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkest : (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.medium;
60
+ }, function (_a) {
61
+ var _b;
62
+ var theme = _a.theme;
63
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
64
+ }, function (_a) {
65
+ var _b;
66
+ var active = _a.active, theme = _a.theme;
67
+ return active ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white : 'inherit';
68
+ }, function (_a) {
69
+ var _b;
70
+ var theme = _a.theme;
71
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xl;
72
+ }, function (_a) {
73
+ var _b;
74
+ var theme = _a.theme;
75
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
76
+ }, function (_a) {
77
+ var _b;
78
+ var theme = _a.theme;
79
+ return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
80
+ }, function (_a) {
81
+ var _b;
82
+ var theme = _a.theme;
83
+ return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder;
84
+ }, function (_a) {
85
+ var _b;
86
+ var theme = _a.theme;
87
+ return (_b = theme.breakpoints) === null || _b === void 0 ? void 0 : _b.md;
88
+ });
89
+ var PillComponent = styled.button(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: none;\n cursor: pointer;\n display: flex;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n width: fit-content;\n\n ", "\n\n ", "\n"], ["\n border: none;\n cursor: pointer;\n display: flex;\n font-family: ", ";\n font-size: ", "px;\n font-weight: ", ";\n width: fit-content;\n\n ", "\n\n ", "\n"])), function (_a) {
90
+ var _b;
91
+ var theme = _a.theme;
92
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.type.primary;
93
+ }, function (_a) {
94
+ var _b;
95
+ var theme = _a.theme;
96
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size.s2;
97
+ }, function (_a) {
98
+ var _b;
99
+ var theme = _a.theme;
100
+ return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.weight.medium;
101
+ }, focusVisible, function (_a) {
102
+ var variant = _a.variant;
103
+ return variant === EPillVariant.square ? squareStyles : roundedStyles;
104
+ });
24
105
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
25
106
 
26
- export { Amount, PillComponent, PillContent, Text };
107
+ export { PillComponent, PillContent };
27
108
  //# sourceMappingURL=Pill.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pill.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -65,7 +65,7 @@ export { EModalSize, EModalVariant, Modal } from './components/Modal/Modal.js';
65
65
  export { NavMainLink } from './components/NavMainLink/NavMainLink.js';
66
66
  export { Pagination } from './components/Pagination/Pagination.js';
67
67
  export { PartnerOffer } from './components/PartnerOffer/PartnerOffer.js';
68
- export { Pill } from './components/Pill/Pill.js';
68
+ export { EPillVariant, Pill } from './components/Pill/Pill.js';
69
69
  export { PersonalCouponCard } from './components/PersonalCouponCard/PersonalCouponCard.js';
70
70
  export { PriceStripe } from './components/PriceStripe/PriceStripe.js';
71
71
  export { PriceTag } from './components/PriceTag/PriceTag.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.19.6",
3
+ "version": "0.20.0",
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": "cd6ebba1870c2a4b11bc2b8be510b17f3b36fe93"
79
+ "gitHead": "05ecdc833130ba186c85a6de5a770233821a5ff5"
80
80
  }