@citygross/components 0.7.61 → 0.7.62
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/index.d.ts +1 -0
- 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 +30 -0
- package/build/cjs/components/src/components/Chips/Chip.styles.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/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 +20 -0
- package/build/es/components/src/components/Chips/Chip.styles.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
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';
|
|
@@ -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
|
+
|
|
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
|
+
function Chip(_a) {
|
|
16
|
+
var _b, _c, _d, _e, _f;
|
|
17
|
+
var label = _a.label, checked = _a.checked, onClick = _a.onClick, _g = _a.background, background = _g === void 0 ? (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.lighter : _g, _h = _a.activeBackground, activeBackground = _h === void 0 ? (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.white : _h;
|
|
18
|
+
return (React__default['default'].createElement(Chip_styles.BaseChip, { checked: checked, onClick: onClick, background: background, activeBackground: activeBackground, whileHover: { scale: (_d = designTokens.theme.animations) === null || _d === void 0 ? void 0 : _d.hoverScale }, whileTap: { scale: (_e = designTokens.theme.animations) === null || _e === void 0 ? void 0 : _e.tapScale } },
|
|
19
|
+
checked
|
|
20
|
+
? (React__default['default'].createElement(Icon.Icons.CheckMark, { color: (_f = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _f === void 0 ? void 0 : _f.alertGreen, width: 12, height: 12, viewBox: '0 0 25 25' }))
|
|
21
|
+
: (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,30 @@
|
|
|
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
|
+
var framerMotion = require('framer-motion');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
|
+
|
|
14
|
+
var BaseChip = styled__default['default'](framerMotion.motion.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) {
|
|
15
|
+
return props.checked
|
|
16
|
+
? props.activeBackground && props.activeBackground
|
|
17
|
+
: props.background && props.background;
|
|
18
|
+
}, 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) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
return props.checked &&
|
|
21
|
+
"box-shadow: 0 0 0 1px inset " + ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.alertGreen) + ", 0px 2px 5px " + ((_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.boxShadowActive);
|
|
22
|
+
});
|
|
23
|
+
var ChipCheckbox = styled__default['default'].span(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n height: ", "px;\n width: ", "px;\n background: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n"], ["\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; });
|
|
24
|
+
var ChipLabel = styled__default['default'](typography.BodyText)(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
|
|
25
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
26
|
+
|
|
27
|
+
exports.BaseChip = BaseChip;
|
|
28
|
+
exports.ChipCheckbox = ChipCheckbox;
|
|
29
|
+
exports.ChipLabel = ChipLabel;
|
|
30
|
+
//# sourceMappingURL=Chip.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -19,6 +19,7 @@ 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');
|
|
22
23
|
require('react-loading-skeleton');
|
|
23
24
|
require('../CartItemSummary/CartItemSummary.styles.js');
|
|
24
25
|
require('../Divider/Divider.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');
|
|
@@ -86,6 +87,7 @@ exports.Box = Box.Box;
|
|
|
86
87
|
exports.IconButton = IconButton.IconButton;
|
|
87
88
|
exports.PaginationButton = PaginationButton.PaginationButton;
|
|
88
89
|
exports.BackButton = BackButton.BackButton;
|
|
90
|
+
exports.Chip = Chip.Chip;
|
|
89
91
|
exports.CartItemSummary = CartItemSummary.CartItemSummary;
|
|
90
92
|
exports.CartSummary = CartSummary.CartSummary;
|
|
91
93
|
exports.CustomerInfoBlock = CustomerInfoBlock.CustomerInfoBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.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
|
+
|
|
7
|
+
function Chip(_a) {
|
|
8
|
+
var _b, _c, _d, _e, _f;
|
|
9
|
+
var label = _a.label, checked = _a.checked, onClick = _a.onClick, _g = _a.background, background = _g === void 0 ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.lighter : _g, _h = _a.activeBackground, activeBackground = _h === void 0 ? (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white : _h;
|
|
10
|
+
return (React.createElement(BaseChip, { checked: checked, onClick: onClick, background: background, activeBackground: activeBackground, whileHover: { scale: (_d = theme.animations) === null || _d === void 0 ? void 0 : _d.hoverScale }, whileTap: { scale: (_e = theme.animations) === null || _e === void 0 ? void 0 : _e.tapScale } },
|
|
11
|
+
checked
|
|
12
|
+
? (React.createElement(Icons.CheckMark, { color: (_f = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _f === void 0 ? void 0 : _f.alertGreen, width: 12, height: 12, viewBox: '0 0 25 25' }))
|
|
13
|
+
: (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,20 @@
|
|
|
1
|
+
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { BodyText } from '@citygross/typography';
|
|
4
|
+
import { motion } from 'framer-motion';
|
|
5
|
+
|
|
6
|
+
var BaseChip = styled(motion.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) {
|
|
7
|
+
return props.checked
|
|
8
|
+
? props.activeBackground && props.activeBackground
|
|
9
|
+
: props.background && props.background;
|
|
10
|
+
}, 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) {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
return props.checked &&
|
|
13
|
+
"box-shadow: 0 0 0 1px inset " + ((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.alertGreen) + ", 0px 2px 5px " + ((_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.boxShadowActive);
|
|
14
|
+
});
|
|
15
|
+
var ChipCheckbox = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: ", "px;\n width: ", "px;\n background: white;\n border: 1px solid ", ";\n border-radius: ", "px;\n"], ["\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; });
|
|
16
|
+
var ChipLabel = styled(BodyText)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
|
|
17
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
18
|
+
|
|
19
|
+
export { BaseChip, ChipCheckbox, ChipLabel };
|
|
20
|
+
//# sourceMappingURL=Chip.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -15,6 +15,7 @@ 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';
|
|
18
19
|
import 'react-loading-skeleton';
|
|
19
20
|
import '../CartItemSummary/CartItemSummary.styles.js';
|
|
20
21
|
import '../Divider/Divider.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';
|
|
@@ -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.62",
|
|
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": "d5f7d33f07882c0a32394b9aa98edbde5af3cff6"
|
|
75
75
|
}
|