@citygross/components 0.8.45 → 0.8.46
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/SelectButton/SelectButton.d.ts +1 -2
- package/build/cjs/components/src/components/SelectButton/SelectButton.js +26 -0
- package/build/cjs/components/src/components/SelectButton/SelectButton.js.map +1 -0
- package/build/cjs/components/src/components/SelectButton/SelectButton.styles.js +7 -2
- package/build/cjs/components/src/components/SelectButton/SelectButton.styles.js.map +1 -1
- package/build/cjs/components/src/index.js +2 -3
- package/build/cjs/components/src/index.js.map +1 -1
- package/build/es/components/src/components/SelectButton/SelectButton.js +18 -0
- package/build/es/components/src/components/SelectButton/SelectButton.js.map +1 -0
- package/build/es/components/src/components/SelectButton/SelectButton.styles.js +4 -2
- package/build/es/components/src/components/SelectButton/SelectButton.styles.js.map +1 -1
- package/build/es/components/src/index.js +1 -3
- package/build/es/components/src/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -8,5 +8,4 @@ export declare type TSelectButton = {
|
|
|
8
8
|
selected: number;
|
|
9
9
|
width?: number;
|
|
10
10
|
};
|
|
11
|
-
declare const SelectButton: ({ items, selected, width }: TSelectButton) => JSX.Element;
|
|
12
|
-
export default SelectButton;
|
|
11
|
+
export declare const SelectButton: ({ items, selected, width }: TSelectButton) => JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var SelectButton_styles = require('./SelectButton.styles.js');
|
|
7
|
+
var designTokens = require('@citygross/design-tokens');
|
|
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
|
+
var SelectButton = function (_a) {
|
|
14
|
+
var items = _a.items, selected = _a.selected, _b = _a.width, width = _b === void 0 ? designTokens.constants.selectButtonWidth : _b;
|
|
15
|
+
var _c = React.useState(selected), localSelected = _c[0], setSelected = _c[1];
|
|
16
|
+
return (React__default["default"].createElement(SelectButton_styles.SelectButtonContainer, { length: items === null || items === void 0 ? void 0 : items.length, selected: localSelected, width: width }, items === null || items === void 0 ? void 0 : items.map(function (_a, i) {
|
|
17
|
+
var label = _a.label, onClick = _a.onClick;
|
|
18
|
+
return (React__default["default"].createElement(SelectButton_styles.SelectButton, { key: label, onClick: function () {
|
|
19
|
+
onClick && onClick();
|
|
20
|
+
setSelected(i);
|
|
21
|
+
}, selected: localSelected === i, width: width }, label));
|
|
22
|
+
})));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.SelectButton = SelectButton;
|
|
26
|
+
//# sourceMappingURL=SelectButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
4
6
|
var styled = require('styled-components');
|
|
5
7
|
var global_styles = require('../../shared/global.styles.js');
|
|
@@ -8,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
10
|
|
|
9
11
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
10
12
|
|
|
11
|
-
styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n display: inline-flex;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n z-index: ", ";\n\n &:after {\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n content: '';\n display: block;\n top: 0;\n bottom: 0;\n left: ", ";\n margin: ", ";\n position: absolute;\n transition: left 300ms ease;\n width: ", ";\n z-index: ", ";\n }\n"], ["\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n display: inline-flex;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n z-index: ", ";\n\n &:after {\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n content: '';\n display: block;\n top: 0;\n bottom: 0;\n left: ", ";\n margin: ", ";\n position: absolute;\n transition: left 300ms ease;\n width: ", ";\n z-index: ", ";\n }\n"])), function (_a) {
|
|
13
|
+
var SelectButtonContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n display: inline-flex;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n z-index: ", ";\n\n &:after {\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n content: '';\n display: block;\n top: 0;\n bottom: 0;\n left: ", ";\n margin: ", ";\n position: absolute;\n transition: left 300ms ease;\n width: ", ";\n z-index: ", ";\n }\n"], ["\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n display: inline-flex;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n z-index: ", ";\n\n &:after {\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n content: '';\n display: block;\n top: 0;\n bottom: 0;\n left: ", ";\n margin: ", ";\n position: absolute;\n transition: left 300ms ease;\n width: ", ";\n z-index: ", ";\n }\n"])), function (_a) {
|
|
12
14
|
var _b;
|
|
13
15
|
var theme = _a.theme;
|
|
14
16
|
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
@@ -65,7 +67,7 @@ styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__
|
|
|
65
67
|
var theme = _a.theme;
|
|
66
68
|
return (_b = theme.attributes) === null || _b === void 0 ? void 0 : _b.zIndex.low;
|
|
67
69
|
});
|
|
68
|
-
styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background: transparent;\n border: none;\n border-radius: ", "px;\n cursor: pointer;\n font-weight: ", ";\n font-size: ", "px;\n height: ", "px;\n width: ", "px;\n outline: none;\n text-align: center;\n z-index: ", ";\n\n ", "\n\n ", "\n"], ["\n background: transparent;\n border: none;\n border-radius: ", "px;\n cursor: pointer;\n font-weight: ", ";\n font-size: ", "px;\n height: ", "px;\n width: ", "px;\n outline: none;\n text-align: center;\n z-index: ", ";\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
70
|
+
var SelectButton = styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n background: transparent;\n border: none;\n border-radius: ", "px;\n cursor: pointer;\n font-weight: ", ";\n font-size: ", "px;\n height: ", "px;\n width: ", "px;\n outline: none;\n text-align: center;\n z-index: ", ";\n\n ", "\n\n ", "\n"], ["\n background: transparent;\n border: none;\n border-radius: ", "px;\n cursor: pointer;\n font-weight: ", ";\n font-size: ", "px;\n height: ", "px;\n width: ", "px;\n outline: none;\n text-align: center;\n z-index: ", ";\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
69
71
|
var _b;
|
|
70
72
|
var theme = _a.theme;
|
|
71
73
|
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
|
|
@@ -95,4 +97,7 @@ styled__default["default"].button(templateObject_2 || (templateObject_2 = _tslib
|
|
|
95
97
|
"&:active {\n background-color: ".concat((_b = theme.palette) === null || _b === void 0 ? void 0 : _b.lighter, ";\n }");
|
|
96
98
|
}, global_styles.focusVisible);
|
|
97
99
|
var templateObject_1, templateObject_2;
|
|
100
|
+
|
|
101
|
+
exports.SelectButton = SelectButton;
|
|
102
|
+
exports.SelectButtonContainer = SelectButtonContainer;
|
|
98
103
|
//# sourceMappingURL=SelectButton.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -88,9 +88,7 @@ var CartCardLabel = require('./components/CartCardLabel/CartCardLabel.js');
|
|
|
88
88
|
var CartCard = require('./components/CartCard/CartCard.js');
|
|
89
89
|
var PriceTag = require('./components/PriceTag/PriceTag.js');
|
|
90
90
|
var Pill = require('./components/Pill/Pill.js');
|
|
91
|
-
require('
|
|
92
|
-
require('./components/SelectButton/SelectButton.styles.js');
|
|
93
|
-
require('@citygross/design-tokens');
|
|
91
|
+
var SelectButton = require('./components/SelectButton/SelectButton.js');
|
|
94
92
|
|
|
95
93
|
|
|
96
94
|
|
|
@@ -239,4 +237,5 @@ Object.defineProperty(exports, 'EPriceVariant', {
|
|
|
239
237
|
});
|
|
240
238
|
exports.PriceTag = PriceTag.PriceTag;
|
|
241
239
|
exports.Pill = Pill.Pill;
|
|
240
|
+
exports.SelectButton = SelectButton.SelectButton;
|
|
242
241
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { SelectButtonContainer, SelectButton as SelectButton$1 } from './SelectButton.styles.js';
|
|
3
|
+
import { constants } from '@citygross/design-tokens';
|
|
4
|
+
|
|
5
|
+
var SelectButton = function (_a) {
|
|
6
|
+
var items = _a.items, selected = _a.selected, _b = _a.width, width = _b === void 0 ? constants.selectButtonWidth : _b;
|
|
7
|
+
var _c = useState(selected), localSelected = _c[0], setSelected = _c[1];
|
|
8
|
+
return (React.createElement(SelectButtonContainer, { length: items === null || items === void 0 ? void 0 : items.length, selected: localSelected, width: width }, items === null || items === void 0 ? void 0 : items.map(function (_a, i) {
|
|
9
|
+
var label = _a.label, onClick = _a.onClick;
|
|
10
|
+
return (React.createElement(SelectButton$1, { key: label, onClick: function () {
|
|
11
|
+
onClick && onClick();
|
|
12
|
+
setSelected(i);
|
|
13
|
+
}, selected: localSelected === i, width: width }, label));
|
|
14
|
+
})));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { SelectButton };
|
|
18
|
+
//# sourceMappingURL=SelectButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { focusVisible } from '../../shared/global.styles.js';
|
|
4
4
|
|
|
5
|
-
styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n display: inline-flex;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n z-index: ", ";\n\n &:after {\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n content: '';\n display: block;\n top: 0;\n bottom: 0;\n left: ", ";\n margin: ", ";\n position: absolute;\n transition: left 300ms ease;\n width: ", ";\n z-index: ", ";\n }\n"], ["\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n display: inline-flex;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n z-index: ", ";\n\n &:after {\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n content: '';\n display: block;\n top: 0;\n bottom: 0;\n left: ", ";\n margin: ", ";\n position: absolute;\n transition: left 300ms ease;\n width: ", ";\n z-index: ", ";\n }\n"])), function (_a) {
|
|
5
|
+
var SelectButtonContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n display: inline-flex;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n z-index: ", ";\n\n &:after {\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n content: '';\n display: block;\n top: 0;\n bottom: 0;\n left: ", ";\n margin: ", ";\n position: absolute;\n transition: left 300ms ease;\n width: ", ";\n z-index: ", ";\n }\n"], ["\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n display: inline-flex;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n z-index: ", ";\n\n &:after {\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n content: '';\n display: block;\n top: 0;\n bottom: 0;\n left: ", ";\n margin: ", ";\n position: absolute;\n transition: left 300ms ease;\n width: ", ";\n z-index: ", ";\n }\n"])), function (_a) {
|
|
6
6
|
var _b;
|
|
7
7
|
var theme = _a.theme;
|
|
8
8
|
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
@@ -59,7 +59,7 @@ styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ba
|
|
|
59
59
|
var theme = _a.theme;
|
|
60
60
|
return (_b = theme.attributes) === null || _b === void 0 ? void 0 : _b.zIndex.low;
|
|
61
61
|
});
|
|
62
|
-
styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: transparent;\n border: none;\n border-radius: ", "px;\n cursor: pointer;\n font-weight: ", ";\n font-size: ", "px;\n height: ", "px;\n width: ", "px;\n outline: none;\n text-align: center;\n z-index: ", ";\n\n ", "\n\n ", "\n"], ["\n background: transparent;\n border: none;\n border-radius: ", "px;\n cursor: pointer;\n font-weight: ", ";\n font-size: ", "px;\n height: ", "px;\n width: ", "px;\n outline: none;\n text-align: center;\n z-index: ", ";\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
62
|
+
var SelectButton = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: transparent;\n border: none;\n border-radius: ", "px;\n cursor: pointer;\n font-weight: ", ";\n font-size: ", "px;\n height: ", "px;\n width: ", "px;\n outline: none;\n text-align: center;\n z-index: ", ";\n\n ", "\n\n ", "\n"], ["\n background: transparent;\n border: none;\n border-radius: ", "px;\n cursor: pointer;\n font-weight: ", ";\n font-size: ", "px;\n height: ", "px;\n width: ", "px;\n outline: none;\n text-align: center;\n z-index: ", ";\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
63
63
|
var _b;
|
|
64
64
|
var theme = _a.theme;
|
|
65
65
|
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs;
|
|
@@ -89,4 +89,6 @@ styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n
|
|
|
89
89
|
"&:active {\n background-color: ".concat((_b = theme.palette) === null || _b === void 0 ? void 0 : _b.lighter, ";\n }");
|
|
90
90
|
}, focusVisible);
|
|
91
91
|
var templateObject_1, templateObject_2;
|
|
92
|
+
|
|
93
|
+
export { SelectButton, SelectButtonContainer };
|
|
92
94
|
//# sourceMappingURL=SelectButton.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -84,7 +84,5 @@ export { CartCardLabel } from './components/CartCardLabel/CartCardLabel.js';
|
|
|
84
84
|
export { CartCard } from './components/CartCard/CartCard.js';
|
|
85
85
|
export { EPriceVariant, PriceTag } from './components/PriceTag/PriceTag.js';
|
|
86
86
|
export { Pill } from './components/Pill/Pill.js';
|
|
87
|
-
|
|
88
|
-
import './components/SelectButton/SelectButton.styles.js';
|
|
89
|
-
import '@citygross/design-tokens';
|
|
87
|
+
export { SelectButton } from './components/SelectButton/SelectButton.js';
|
|
90
88
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.46",
|
|
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": "
|
|
79
|
+
"gitHead": "353925f7c4e1e21f2d01d4e8b6463697a0aa4fa7"
|
|
80
80
|
}
|