@citygross/components 0.7.61 → 0.7.65
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/Chips/Chip.d.ts +1 -1
- package/build/@types/components/Chips/Chip.styles.d.ts +2 -1
- package/build/@types/components/ProgressBar/ProgressBar.d.ts +7 -0
- package/build/@types/components/ProgressBar/ProgressBar.stories.d.ts +28 -0
- package/build/@types/components/ProgressBar/ProgressBar.styled.d.ts +10 -0
- package/build/@types/index.d.ts +2 -0
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +2 -1
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- package/build/cjs/components/src/components/Chips/Chip.js +26 -0
- package/build/cjs/components/src/components/Chips/Chip.js.map +1 -0
- package/build/cjs/components/src/components/Chips/Chip.styles.js +29 -0
- package/build/cjs/components/src/components/Chips/Chip.styles.js.map +1 -0
- package/build/cjs/components/src/components/DeliverySlotItem/DeliverySlotItem.js +9 -2
- package/build/cjs/components/src/components/DeliverySlotItem/DeliverySlotItem.js.map +1 -1
- package/build/cjs/components/src/components/ProgressBar/ProgressBar.js +22 -0
- package/build/cjs/components/src/components/ProgressBar/ProgressBar.js.map +1 -0
- package/build/cjs/components/src/components/ProgressBar/ProgressBar.styled.js +18 -0
- package/build/cjs/components/src/components/ProgressBar/ProgressBar.styled.js.map +1 -0
- package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +3 -1
- package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
- package/build/cjs/components/src/index.js +4 -0
- package/build/cjs/components/src/index.js.map +1 -1
- package/build/es/components/src/components/AddressBlock/AddressBlock.js +2 -1
- package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- package/build/es/components/src/components/Chips/Chip.js +18 -0
- package/build/es/components/src/components/Chips/Chip.js.map +1 -0
- package/build/es/components/src/components/Chips/Chip.styles.js +19 -0
- package/build/es/components/src/components/Chips/Chip.styles.js.map +1 -0
- package/build/es/components/src/components/DeliverySlotItem/DeliverySlotItem.js +9 -2
- package/build/es/components/src/components/DeliverySlotItem/DeliverySlotItem.js.map +1 -1
- package/build/es/components/src/components/ProgressBar/ProgressBar.js +14 -0
- package/build/es/components/src/components/ProgressBar/ProgressBar.js.map +1 -0
- package/build/es/components/src/components/ProgressBar/ProgressBar.styled.js +9 -0
- package/build/es/components/src/components/ProgressBar/ProgressBar.styled.js.map +1 -0
- package/build/es/components/src/components/WarningLabel/WarningLabel.js +3 -1
- package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
- package/build/es/components/src/index.js +2 -0
- package/build/es/components/src/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as styles from './Chip.styles';
|
|
2
|
-
export declare function Chip({ label, checked, onClick, background, activeBackground }: styles.TChip): JSX.Element;
|
|
2
|
+
export declare function Chip({ label, checked, onClick, background, activeBackground, loading }: styles.TChip): JSX.Element;
|
|
@@ -5,8 +5,9 @@ export declare type TChip = {
|
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
background?: string;
|
|
7
7
|
activeBackground?: string;
|
|
8
|
+
loading?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export declare const BaseChip: import("styled-components").StyledComponent<
|
|
10
|
+
export declare const BaseChip: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TChip, never>;
|
|
10
11
|
export declare const ChipCheckbox: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
11
12
|
export declare const ChipLabel: import("styled-components").StyledComponent<({ size, color, children, lineThrough, fontWeight, ...props }: {
|
|
12
13
|
children: import("react").ReactNode;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Story } from '@storybook/react';
|
|
2
|
+
import { ProgressBar, TProgressBar } from './ProgressBar';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
component: typeof ProgressBar;
|
|
5
|
+
title: string;
|
|
6
|
+
argTypes: {
|
|
7
|
+
background: {
|
|
8
|
+
options: string[];
|
|
9
|
+
mapping: import("@citygross/design-tokens").Palette | never[];
|
|
10
|
+
control: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
color: {
|
|
15
|
+
options: string[];
|
|
16
|
+
mapping: import("@citygross/design-tokens").Palette | never[];
|
|
17
|
+
control: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
args: {
|
|
23
|
+
maxValue: number;
|
|
24
|
+
currentValue: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
export declare const Default: Story<TProgressBar>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type TProgressContainer = {
|
|
2
|
+
color?: string;
|
|
3
|
+
};
|
|
4
|
+
export declare type TProgress = TProgressContainer & {
|
|
5
|
+
width: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const BarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TProgressContainer, never>;
|
|
8
|
+
export declare const Progress: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TProgressContainer & {
|
|
9
|
+
width: number;
|
|
10
|
+
}, never>;
|
package/build/@types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './components/Badge/Badge';
|
|
|
7
7
|
export * from './components/Box/Box';
|
|
8
8
|
export * from './components/Button';
|
|
9
9
|
export * from './components/BackButton/BackButton';
|
|
10
|
+
export * from './components/Chips/Chip';
|
|
10
11
|
export * from './components/CartItemSummary/CartItemSummary';
|
|
11
12
|
export * from './components/CartSummary/CartSummary';
|
|
12
13
|
export * from './components/CustomerInfoBlock/CustomerInfoBlock';
|
|
@@ -40,6 +41,7 @@ export * from './components/Modal/Modal';
|
|
|
40
41
|
export * from './components/RadioBox';
|
|
41
42
|
export * from './components/RadioGroup';
|
|
42
43
|
export * from './components/RadioListItem/RadioListItem';
|
|
44
|
+
export * from './components/ProgressBar/ProgressBar';
|
|
43
45
|
export * from './components/RippleContainer/RippleContainer';
|
|
44
46
|
export * from './components/Select/Select';
|
|
45
47
|
export * from './components/Spacer/Spacer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var Icon = require('@citygross/icons');
|
|
7
|
+
var typography = require('@citygross/typography');
|
|
8
|
+
var Chip_styles = require('./Chip.styles.js');
|
|
9
|
+
var designTokens = require('@citygross/design-tokens');
|
|
10
|
+
var Spinner = require('../Spinner/Spinner.js');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
|
|
16
|
+
function Chip(_a) {
|
|
17
|
+
var _b, _c, _d;
|
|
18
|
+
var label = _a.label, checked = _a.checked, onClick = _a.onClick, _e = _a.background, background = _e === void 0 ? (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.lighter : _e, _f = _a.activeBackground, activeBackground = _f === void 0 ? (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.white : _f, loading = _a.loading;
|
|
19
|
+
return (React__default['default'].createElement(Chip_styles.BaseChip, { checked: checked, onClick: onClick, background: background, activeBackground: activeBackground, loading: loading },
|
|
20
|
+
loading ? (React__default['default'].createElement(Spinner.Spinner, { size: 12 })) : (React__default['default'].createElement(React__default['default'].Fragment, null, checked ? (React__default['default'].createElement(Chip_styles.ChipCheckbox, null,
|
|
21
|
+
React__default['default'].createElement(Icon.Icons.CheckMark, { color: (_d = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _d === void 0 ? void 0 : _d.alertGreen, width: 12, height: 12, viewBox: '0 0 25 25' }))) : (React__default['default'].createElement(Chip_styles.ChipCheckbox, null)))),
|
|
22
|
+
React__default['default'].createElement(Chip_styles.ChipLabel, { forwardedAs: 'label', size: typography.TextTypes.TextSize.SMALL }, label)));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.Chip = Chip;
|
|
26
|
+
//# sourceMappingURL=Chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 typography = require('@citygross/typography');
|
|
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 BaseChip = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n border-radius: ", "px;\n background: ", ";\n /* static for height of chip */\n padding: ", "px\n ", "px;\n ", ";\n cursor: pointer;\n"], ["\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n border-radius: ", "px;\n background: ", ";\n /* static for height of chip */\n padding: ", "px\n ", "px;\n ", ";\n cursor: pointer;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius) === null || _b === void 0 ? void 0 : _b.small; }, function (props) {
|
|
14
|
+
return props.checked
|
|
15
|
+
? props.activeBackground && props.activeBackground
|
|
16
|
+
: props.background && props.background;
|
|
17
|
+
}, 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) {
|
|
18
|
+
var _a;
|
|
19
|
+
return props.checked &&
|
|
20
|
+
"box-shadow: 0 0 0 1px inset " + ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.alertGreen);
|
|
21
|
+
});
|
|
22
|
+
var ChipCheckbox = styled__default['default'].span(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n height: ", "px;\n width: ", "px;\n background: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n"], ["\n display: flex;\n height: ", "px;\n width: ", "px;\n background: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.chipCheckBox; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.chipCheckBox; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius) === null || _b === void 0 ? void 0 : _b.extraSmall; });
|
|
23
|
+
var ChipLabel = styled__default['default'](typography.BodyText)(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
|
|
24
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
25
|
+
|
|
26
|
+
exports.BaseChip = BaseChip;
|
|
27
|
+
exports.ChipCheckbox = ChipCheckbox;
|
|
28
|
+
exports.ChipLabel = ChipLabel;
|
|
29
|
+
//# sourceMappingURL=Chip.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -60,16 +60,23 @@ function DeliverySlotItem(_a) {
|
|
|
60
60
|
var options = {
|
|
61
61
|
root: null,
|
|
62
62
|
rootMargin: '0px',
|
|
63
|
-
threshold: 0.
|
|
63
|
+
threshold: 0.9
|
|
64
64
|
};
|
|
65
65
|
React.useEffect(function () {
|
|
66
|
+
if (!('IntersectionObserver' in window) ||
|
|
67
|
+
!('IntersectionObserverEntry' in window) ||
|
|
68
|
+
!('intersectionRatio' in window.IntersectionObserverEntry.prototype)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
66
71
|
var observer = new IntersectionObserver(callbackFn, options);
|
|
67
72
|
if (!observer)
|
|
68
73
|
return;
|
|
69
74
|
if (slotRef.current)
|
|
70
75
|
observer.observe(slotRef === null || slotRef === void 0 ? void 0 : slotRef.current);
|
|
71
76
|
return function () {
|
|
72
|
-
observer
|
|
77
|
+
if (observer) {
|
|
78
|
+
observer.disconnect();
|
|
79
|
+
}
|
|
73
80
|
};
|
|
74
81
|
}, [slotRef, options]);
|
|
75
82
|
var removeLeadingZero = function (day) { return day.replace(/^0+/, ''); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeliverySlotItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeliverySlotItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var designTokens = require('@citygross/design-tokens');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var ProgressBar_styled = require('./ProgressBar.styled.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
function ProgressBar(_a) {
|
|
14
|
+
var _b, _c;
|
|
15
|
+
var maxValue = _a.maxValue, currentValue = _a.currentValue, _d = _a.background, background = _d === void 0 ? (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.white : _d, _e = _a.color, color = _e === void 0 ? (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.alertBlue : _e;
|
|
16
|
+
var progress = (currentValue / maxValue) * 100;
|
|
17
|
+
return (React__default['default'].createElement(ProgressBar_styled.BarContainer, { color: background },
|
|
18
|
+
React__default['default'].createElement(ProgressBar_styled.Progress, { width: progress, color: color })));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.ProgressBar = ProgressBar;
|
|
22
|
+
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
|
+
|
|
12
|
+
var BarContainer = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n background: ", ";\n border-radius: ", "px;\n height: ", "px;\n overflow: hidden;\n"], ["\n background: ", ";\n border-radius: ", "px;\n height: ", "px;\n overflow: hidden;\n"])), function (props) { return props.color; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.default; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
13
|
+
var Progress = styled__default['default'].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n width: ", "%;\n background: ", ";\n height: 100%;\n"], ["\n width: ", "%;\n background: ", ";\n height: 100%;\n"])), function (props) { return props.width || 0; }, function (props) { return props.color; });
|
|
14
|
+
var templateObject_1, templateObject_2;
|
|
15
|
+
|
|
16
|
+
exports.BarContainer = BarContainer;
|
|
17
|
+
exports.Progress = Progress;
|
|
18
|
+
//# sourceMappingURL=ProgressBar.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -19,6 +19,8 @@ require('../Badge/Badge.styles.js');
|
|
|
19
19
|
require('../Box/Box.styles.js');
|
|
20
20
|
require('../Button/Button.styles.js');
|
|
21
21
|
require('../BackButton/BackButton.styles.js');
|
|
22
|
+
require('../Chips/Chip.styles.js');
|
|
23
|
+
require('../Spinner/Spinner.styles.js');
|
|
22
24
|
require('react-loading-skeleton');
|
|
23
25
|
require('../CartItemSummary/CartItemSummary.styles.js');
|
|
24
26
|
require('../Divider/Divider.styles.js');
|
|
@@ -53,9 +55,9 @@ require('../RadioBox/RadioBoxItem.styles.js');
|
|
|
53
55
|
require('../RadioBox/RadioBoxList.styles.js');
|
|
54
56
|
require('../RadioGroup/RadioGroup.styles.js');
|
|
55
57
|
require('../RadioListItem/RadioListItem.styles.js');
|
|
58
|
+
require('../ProgressBar/ProgressBar.styled.js');
|
|
56
59
|
require('../RippleContainer/RippleContainer.styles.js');
|
|
57
60
|
require('../Select/Select.styles.js');
|
|
58
|
-
require('../Spinner/Spinner.styles.js');
|
|
59
61
|
require('../Stepper/Stepper.styles.js');
|
|
60
62
|
var ToolTip = require('../ToolTip/ToolTip.js');
|
|
61
63
|
require('../StepperMobile/StepperMobile.styles.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -12,6 +12,7 @@ var Box = require('./components/Box/Box.js');
|
|
|
12
12
|
var IconButton = require('./components/Button/IconButton.js');
|
|
13
13
|
var PaginationButton = require('./components/Button/PaginationButton.js');
|
|
14
14
|
var BackButton = require('./components/BackButton/BackButton.js');
|
|
15
|
+
var Chip = require('./components/Chips/Chip.js');
|
|
15
16
|
var CartItemSummary = require('./components/CartItemSummary/CartItemSummary.js');
|
|
16
17
|
var CartSummary = require('./components/CartSummary/CartSummary.js');
|
|
17
18
|
var CustomerInfoBlock = require('./components/CustomerInfoBlock/CustomerInfoBlock.js');
|
|
@@ -44,6 +45,7 @@ var RadioBoxItem = require('./components/RadioBox/RadioBoxItem.js');
|
|
|
44
45
|
var RadioBoxList = require('./components/RadioBox/RadioBoxList.js');
|
|
45
46
|
var RadioGroup = require('./components/RadioGroup/RadioGroup.js');
|
|
46
47
|
var RadioListItem = require('./components/RadioListItem/RadioListItem.js');
|
|
48
|
+
var ProgressBar = require('./components/ProgressBar/ProgressBar.js');
|
|
47
49
|
var RippleContainer = require('./components/RippleContainer/RippleContainer.js');
|
|
48
50
|
var Select = require('./components/Select/Select.js');
|
|
49
51
|
var Spacer = require('./components/Spacer/Spacer.js');
|
|
@@ -86,6 +88,7 @@ exports.Box = Box.Box;
|
|
|
86
88
|
exports.IconButton = IconButton.IconButton;
|
|
87
89
|
exports.PaginationButton = PaginationButton.PaginationButton;
|
|
88
90
|
exports.BackButton = BackButton.BackButton;
|
|
91
|
+
exports.Chip = Chip.Chip;
|
|
89
92
|
exports.CartItemSummary = CartItemSummary.CartItemSummary;
|
|
90
93
|
exports.CartSummary = CartSummary.CartSummary;
|
|
91
94
|
exports.CustomerInfoBlock = CustomerInfoBlock.CustomerInfoBlock;
|
|
@@ -136,6 +139,7 @@ exports.RadioBoxItem = RadioBoxItem.RadioBoxItem;
|
|
|
136
139
|
exports.RadioBoxList = RadioBoxList.RadioBoxList;
|
|
137
140
|
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
138
141
|
exports.RadioListItem = RadioListItem.RadioListItem;
|
|
142
|
+
exports.ProgressBar = ProgressBar.ProgressBar;
|
|
139
143
|
exports.RippleContainer = RippleContainer.RippleContainer;
|
|
140
144
|
exports.Select = Select.Select;
|
|
141
145
|
exports.Spacer = Spacer.Spacer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icons } from '@citygross/icons';
|
|
3
|
+
import { TextTypes } from '@citygross/typography';
|
|
4
|
+
import { BaseChip, ChipCheckbox, ChipLabel } from './Chip.styles.js';
|
|
5
|
+
import { theme } from '@citygross/design-tokens';
|
|
6
|
+
import { Spinner } from '../Spinner/Spinner.js';
|
|
7
|
+
|
|
8
|
+
function Chip(_a) {
|
|
9
|
+
var _b, _c, _d;
|
|
10
|
+
var label = _a.label, checked = _a.checked, onClick = _a.onClick, _e = _a.background, background = _e === void 0 ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.lighter : _e, _f = _a.activeBackground, activeBackground = _f === void 0 ? (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white : _f, loading = _a.loading;
|
|
11
|
+
return (React.createElement(BaseChip, { checked: checked, onClick: onClick, background: background, activeBackground: activeBackground, loading: loading },
|
|
12
|
+
loading ? (React.createElement(Spinner, { size: 12 })) : (React.createElement(React.Fragment, null, checked ? (React.createElement(ChipCheckbox, null,
|
|
13
|
+
React.createElement(Icons.CheckMark, { color: (_d = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _d === void 0 ? void 0 : _d.alertGreen, width: 12, height: 12, viewBox: '0 0 25 25' }))) : (React.createElement(ChipCheckbox, null)))),
|
|
14
|
+
React.createElement(ChipLabel, { forwardedAs: 'label', size: TextTypes.TextSize.SMALL }, label)));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Chip };
|
|
18
|
+
//# sourceMappingURL=Chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { BodyText } from '@citygross/typography';
|
|
4
|
+
|
|
5
|
+
var BaseChip = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n border-radius: ", "px;\n background: ", ";\n /* static for height of chip */\n padding: ", "px\n ", "px;\n ", ";\n cursor: pointer;\n"], ["\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n border-radius: ", "px;\n background: ", ";\n /* static for height of chip */\n padding: ", "px\n ", "px;\n ", ";\n cursor: pointer;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius) === null || _b === void 0 ? void 0 : _b.small; }, function (props) {
|
|
6
|
+
return props.checked
|
|
7
|
+
? props.activeBackground && props.activeBackground
|
|
8
|
+
: props.background && props.background;
|
|
9
|
+
}, 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) {
|
|
10
|
+
var _a;
|
|
11
|
+
return props.checked &&
|
|
12
|
+
"box-shadow: 0 0 0 1px inset " + ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.alertGreen);
|
|
13
|
+
});
|
|
14
|
+
var ChipCheckbox = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n height: ", "px;\n width: ", "px;\n background: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n"], ["\n display: flex;\n height: ", "px;\n width: ", "px;\n background: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.chipCheckBox; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.chipCheckBox; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius) === null || _b === void 0 ? void 0 : _b.extraSmall; });
|
|
15
|
+
var ChipLabel = styled(BodyText)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
|
|
16
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
17
|
+
|
|
18
|
+
export { BaseChip, ChipCheckbox, ChipLabel };
|
|
19
|
+
//# sourceMappingURL=Chip.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -52,16 +52,23 @@ function DeliverySlotItem(_a) {
|
|
|
52
52
|
var options = {
|
|
53
53
|
root: null,
|
|
54
54
|
rootMargin: '0px',
|
|
55
|
-
threshold: 0.
|
|
55
|
+
threshold: 0.9
|
|
56
56
|
};
|
|
57
57
|
useEffect(function () {
|
|
58
|
+
if (!('IntersectionObserver' in window) ||
|
|
59
|
+
!('IntersectionObserverEntry' in window) ||
|
|
60
|
+
!('intersectionRatio' in window.IntersectionObserverEntry.prototype)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
58
63
|
var observer = new IntersectionObserver(callbackFn, options);
|
|
59
64
|
if (!observer)
|
|
60
65
|
return;
|
|
61
66
|
if (slotRef.current)
|
|
62
67
|
observer.observe(slotRef === null || slotRef === void 0 ? void 0 : slotRef.current);
|
|
63
68
|
return function () {
|
|
64
|
-
observer
|
|
69
|
+
if (observer) {
|
|
70
|
+
observer.disconnect();
|
|
71
|
+
}
|
|
65
72
|
};
|
|
66
73
|
}, [slotRef, options]);
|
|
67
74
|
var removeLeadingZero = function (day) { return day.replace(/^0+/, ''); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeliverySlotItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeliverySlotItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { theme } from '@citygross/design-tokens';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BarContainer, Progress } from './ProgressBar.styled.js';
|
|
4
|
+
|
|
5
|
+
function ProgressBar(_a) {
|
|
6
|
+
var _b, _c;
|
|
7
|
+
var maxValue = _a.maxValue, currentValue = _a.currentValue, _d = _a.background, background = _d === void 0 ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white : _d, _e = _a.color, color = _e === void 0 ? (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.alertBlue : _e;
|
|
8
|
+
var progress = (currentValue / maxValue) * 100;
|
|
9
|
+
return (React.createElement(BarContainer, { color: background },
|
|
10
|
+
React.createElement(Progress, { width: progress, color: color })));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ProgressBar };
|
|
14
|
+
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
var BarContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n border-radius: ", "px;\n height: ", "px;\n overflow: hidden;\n"], ["\n background: ", ";\n border-radius: ", "px;\n height: ", "px;\n overflow: hidden;\n"])), function (props) { return props.color; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.default; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
5
|
+
var Progress = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", "%;\n background: ", ";\n height: 100%;\n"], ["\n width: ", "%;\n background: ", ";\n height: 100%;\n"])), function (props) { return props.width || 0; }, function (props) { return props.color; });
|
|
6
|
+
var templateObject_1, templateObject_2;
|
|
7
|
+
|
|
8
|
+
export { BarContainer, Progress };
|
|
9
|
+
//# sourceMappingURL=ProgressBar.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -15,6 +15,8 @@ import '../Badge/Badge.styles.js';
|
|
|
15
15
|
import '../Box/Box.styles.js';
|
|
16
16
|
import '../Button/Button.styles.js';
|
|
17
17
|
import '../BackButton/BackButton.styles.js';
|
|
18
|
+
import '../Chips/Chip.styles.js';
|
|
19
|
+
import '../Spinner/Spinner.styles.js';
|
|
18
20
|
import 'react-loading-skeleton';
|
|
19
21
|
import '../CartItemSummary/CartItemSummary.styles.js';
|
|
20
22
|
import '../Divider/Divider.styles.js';
|
|
@@ -49,9 +51,9 @@ import '../RadioBox/RadioBoxItem.styles.js';
|
|
|
49
51
|
import '../RadioBox/RadioBoxList.styles.js';
|
|
50
52
|
import '../RadioGroup/RadioGroup.styles.js';
|
|
51
53
|
import '../RadioListItem/RadioListItem.styles.js';
|
|
54
|
+
import '../ProgressBar/ProgressBar.styled.js';
|
|
52
55
|
import '../RippleContainer/RippleContainer.styles.js';
|
|
53
56
|
import '../Select/Select.styles.js';
|
|
54
|
-
import '../Spinner/Spinner.styles.js';
|
|
55
57
|
import '../Stepper/Stepper.styles.js';
|
|
56
58
|
import { ToolTip } from '../ToolTip/ToolTip.js';
|
|
57
59
|
import '../StepperMobile/StepperMobile.styles.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -8,6 +8,7 @@ export { Box } from './components/Box/Box.js';
|
|
|
8
8
|
export { IconButton } from './components/Button/IconButton.js';
|
|
9
9
|
export { PaginationButton } from './components/Button/PaginationButton.js';
|
|
10
10
|
export { BackButton } from './components/BackButton/BackButton.js';
|
|
11
|
+
export { Chip } from './components/Chips/Chip.js';
|
|
11
12
|
export { CartItemSummary } from './components/CartItemSummary/CartItemSummary.js';
|
|
12
13
|
export { CartSummary } from './components/CartSummary/CartSummary.js';
|
|
13
14
|
export { CustomerInfoBlock } from './components/CustomerInfoBlock/CustomerInfoBlock.js';
|
|
@@ -40,6 +41,7 @@ export { RadioBoxItem } from './components/RadioBox/RadioBoxItem.js';
|
|
|
40
41
|
export { RadioBoxList } from './components/RadioBox/RadioBoxList.js';
|
|
41
42
|
export { RadioGroup } from './components/RadioGroup/RadioGroup.js';
|
|
42
43
|
export { RadioListItem } from './components/RadioListItem/RadioListItem.js';
|
|
44
|
+
export { ProgressBar } from './components/ProgressBar/ProgressBar.js';
|
|
43
45
|
export { RippleContainer } from './components/RippleContainer/RippleContainer.js';
|
|
44
46
|
export { Select } from './components/Select/Select.js';
|
|
45
47
|
export { Spacer } from './components/Spacer/Spacer.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.65",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"moment": "^2.29.1",
|
|
72
72
|
"react-loading-skeleton": "^2.2.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "d789018d7880a9599b6d57bffef9816335961522"
|
|
75
75
|
}
|