@citygross/components 0.7.64 → 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/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 +1 -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/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 +1 -0
- package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
- package/build/cjs/components/src/index.js +2 -0
- package/build/cjs/components/src/index.js.map +1 -1
- package/build/es/components/src/components/AddressBlock/AddressBlock.js +2 -1
- package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- 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 +1 -0
- package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
- package/build/es/components/src/index.js +1 -0
- package/build/es/components/src/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -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
|
@@ -41,6 +41,7 @@ export * from './components/Modal/Modal';
|
|
|
41
41
|
export * from './components/RadioBox';
|
|
42
42
|
export * from './components/RadioGroup';
|
|
43
43
|
export * from './components/RadioListItem/RadioListItem';
|
|
44
|
+
export * from './components/ProgressBar/ProgressBar';
|
|
44
45
|
export * from './components/RippleContainer/RippleContainer';
|
|
45
46
|
export * from './components/Select/Select';
|
|
46
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -55,6 +55,7 @@ require('../RadioBox/RadioBoxItem.styles.js');
|
|
|
55
55
|
require('../RadioBox/RadioBoxList.styles.js');
|
|
56
56
|
require('../RadioGroup/RadioGroup.styles.js');
|
|
57
57
|
require('../RadioListItem/RadioListItem.styles.js');
|
|
58
|
+
require('../ProgressBar/ProgressBar.styled.js');
|
|
58
59
|
require('../RippleContainer/RippleContainer.styles.js');
|
|
59
60
|
require('../Select/Select.styles.js');
|
|
60
61
|
require('../Stepper/Stepper.styles.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -45,6 +45,7 @@ var RadioBoxItem = require('./components/RadioBox/RadioBoxItem.js');
|
|
|
45
45
|
var RadioBoxList = require('./components/RadioBox/RadioBoxList.js');
|
|
46
46
|
var RadioGroup = require('./components/RadioGroup/RadioGroup.js');
|
|
47
47
|
var RadioListItem = require('./components/RadioListItem/RadioListItem.js');
|
|
48
|
+
var ProgressBar = require('./components/ProgressBar/ProgressBar.js');
|
|
48
49
|
var RippleContainer = require('./components/RippleContainer/RippleContainer.js');
|
|
49
50
|
var Select = require('./components/Select/Select.js');
|
|
50
51
|
var Spacer = require('./components/Spacer/Spacer.js');
|
|
@@ -138,6 +139,7 @@ exports.RadioBoxItem = RadioBoxItem.RadioBoxItem;
|
|
|
138
139
|
exports.RadioBoxList = RadioBoxList.RadioBoxList;
|
|
139
140
|
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
140
141
|
exports.RadioListItem = RadioListItem.RadioListItem;
|
|
142
|
+
exports.ProgressBar = ProgressBar.ProgressBar;
|
|
141
143
|
exports.RippleContainer = RippleContainer.RippleContainer;
|
|
142
144
|
exports.Select = Select.Select;
|
|
143
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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":";;;;;;;;;"}
|
|
@@ -51,6 +51,7 @@ import '../RadioBox/RadioBoxItem.styles.js';
|
|
|
51
51
|
import '../RadioBox/RadioBoxList.styles.js';
|
|
52
52
|
import '../RadioGroup/RadioGroup.styles.js';
|
|
53
53
|
import '../RadioListItem/RadioListItem.styles.js';
|
|
54
|
+
import '../ProgressBar/ProgressBar.styled.js';
|
|
54
55
|
import '../RippleContainer/RippleContainer.styles.js';
|
|
55
56
|
import '../Select/Select.styles.js';
|
|
56
57
|
import '../Stepper/Stepper.styles.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -41,6 +41,7 @@ export { RadioBoxItem } from './components/RadioBox/RadioBoxItem.js';
|
|
|
41
41
|
export { RadioBoxList } from './components/RadioBox/RadioBoxList.js';
|
|
42
42
|
export { RadioGroup } from './components/RadioGroup/RadioGroup.js';
|
|
43
43
|
export { RadioListItem } from './components/RadioListItem/RadioListItem.js';
|
|
44
|
+
export { ProgressBar } from './components/ProgressBar/ProgressBar.js';
|
|
44
45
|
export { RippleContainer } from './components/RippleContainer/RippleContainer.js';
|
|
45
46
|
export { Select } from './components/Select/Select.js';
|
|
46
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
|
}
|