travelcircus-styleguide 2.1.9 → 2.2.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.
- package/dist/components/Button.js +38 -68
- package/dist/components/Checkbox.js +117 -98
- package/dist/components/EmptyState/EmptyState.js +15 -26
- package/dist/components/EmptyState/index.js +1 -2
- package/dist/components/FlatButton.js +61 -87
- package/dist/components/FlatInput.js +40 -44
- package/dist/components/IconChecker/IconChecker.js +35 -52
- package/dist/components/IconChecker/images.js +1 -2
- package/dist/components/IconChecker/index.js +2 -4
- package/dist/components/Radio.js +58 -48
- package/dist/components/RoundedButton.js +80 -95
- package/dist/components/RoundedInput.js +49 -83
- package/dist/components/RoundedSelect.js +119 -100
- package/dist/components/RoundedTextarea.js +56 -84
- package/dist/components/Stepper/Stepper.js +13 -25
- package/dist/components/Stepper/StepperElements.js +38 -49
- package/dist/components/Stepper/index.js +2 -4
- package/dist/components/Switch.js +109 -89
- package/dist/components/UnderlinedHeading/UnderlinedHeading.js +25 -46
- package/dist/components/UnderlinedHeading/UnderlinedHeadingElements.js +24 -51
- package/dist/components/UnderlinedHeading/index.js +8 -11
- package/dist/components/basic/Box.js +4 -11
- package/dist/components/basic/Button.js +18 -43
- package/dist/components/basic/Card.js +3 -21
- package/dist/components/basic/Flex.js +7 -28
- package/dist/components/basic/Icon.js +23 -49
- package/dist/components/basic/Input.js +20 -28
- package/dist/components/basic/PositionBox.js +4 -10
- package/dist/components/basic/Text.js +87 -140
- package/dist/components/index.js +86 -112
- package/dist/hocs/index.js +6 -8
- package/dist/hocs/withInputLabel.js +79 -106
- package/dist/hocs/withLabel.js +20 -52
- package/dist/icons.js +6 -14
- package/dist/index.js +20 -27
- package/dist/theme/ThemeProvider.js +31 -86
- package/dist/theme/browser.js +11 -37
- package/dist/theme/button.js +117 -120
- package/dist/theme/colors.js +160 -162
- package/dist/theme/flatButton.js +182 -87
- package/dist/theme/flatInput.js +51 -35
- package/dist/theme/index.js +20 -31
- package/dist/theme/media.js +13 -34
- package/dist/theme/roundedButton.js +515 -188
- package/dist/theme/roundedInput.js +70 -40
- package/dist/theme/roundedTextarea.js +14 -20
- package/dist/theme/theme.js +60 -86
- package/dist/utils/accessibility.js +24 -0
- package/dist/utils/number.js +6 -15
- package/dist/utils/styles.js +9 -18
- package/package.json +19 -18
|
@@ -3,47 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.default = exports.ButtonVariant = exports.ButtonRouter = exports.ButtonLink = exports.ButtonBlock = exports.Button = void 0;
|
|
8
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
8
|
var _reactRouterDom = require("react-router-dom");
|
|
11
|
-
|
|
12
9
|
var _button = require("../theme/button");
|
|
13
|
-
|
|
14
10
|
var _Button = require("./basic/Button");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function _templateObject2() {
|
|
19
|
-
var data = _taggedTemplateLiteral([""]);
|
|
20
|
-
|
|
21
|
-
_templateObject2 = function _templateObject2() {
|
|
22
|
-
return data;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return data;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function _templateObject() {
|
|
29
|
-
var data = _taggedTemplateLiteral([""]);
|
|
30
|
-
|
|
31
|
-
_templateObject = function _templateObject() {
|
|
32
|
-
return data;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return data;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
39
|
-
|
|
40
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
41
|
-
|
|
42
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
43
|
-
|
|
44
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
45
|
-
|
|
46
|
-
var ButtonVariant = {
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const ButtonVariant = exports.ButtonVariant = {
|
|
47
13
|
PRIMARY: 'primary',
|
|
48
14
|
PRIMARY_ACCENT: 'primaryAccent',
|
|
49
15
|
PRIMARY_ACTIVE: 'primaryActive',
|
|
@@ -57,60 +23,64 @@ var ButtonVariant = {
|
|
|
57
23
|
PRIMARY_TEXT_ACCENT: 'primaryTextAccent',
|
|
58
24
|
PRIMARY_ACCENT_DEFAULT: 'primaryAccentDefault'
|
|
59
25
|
};
|
|
60
|
-
|
|
61
|
-
var defaultProps = {
|
|
26
|
+
const defaultProps = {
|
|
62
27
|
variant: ButtonVariant.PRIMARY
|
|
63
28
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
':hover': {
|
|
71
|
-
backgroundColor: "".concat(primary),
|
|
72
|
-
borderColor: "".concat(primary)
|
|
29
|
+
const getCustomStyle = ({
|
|
30
|
+
theme: {
|
|
31
|
+
custom: {
|
|
32
|
+
color: {
|
|
33
|
+
primary
|
|
34
|
+
}
|
|
73
35
|
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
36
|
+
}
|
|
37
|
+
}) => ({
|
|
38
|
+
backgroundColor: `${primary}`,
|
|
39
|
+
borderColor: `${primary}`,
|
|
40
|
+
':hover': {
|
|
41
|
+
backgroundColor: `${primary}`,
|
|
42
|
+
borderColor: `${primary}`
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const handleCustom = props => props?.theme?.custom ? getCustomStyle(props) : {};
|
|
79
46
|
|
|
80
|
-
return props !== null && props !== void 0 && (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.custom ? getCustomStyle(props) : {};
|
|
81
|
-
};
|
|
82
47
|
/* ================================================== *
|
|
83
48
|
* Button (pure HTML button)
|
|
84
49
|
* ================================================== */
|
|
85
50
|
|
|
86
|
-
|
|
87
|
-
var Button = (0, _styledComponents.default)(_Button.Button)(_button.commonStyle, _button.variants, handleCustom);
|
|
88
|
-
exports.default = exports.Button = Button;
|
|
51
|
+
const Button = exports.default = exports.Button = (0, _styledComponents.default)(_Button.Button)(_button.commonStyle, _button.variants, handleCustom);
|
|
89
52
|
Button.displayName = 'Button';
|
|
90
|
-
Button.defaultProps =
|
|
53
|
+
Button.defaultProps = {
|
|
54
|
+
...defaultProps
|
|
55
|
+
};
|
|
56
|
+
|
|
91
57
|
/* ================================================== *
|
|
92
58
|
* <a> styled as a Button (HTML anchor)
|
|
93
59
|
* ================================================== */
|
|
94
60
|
|
|
95
|
-
|
|
61
|
+
const ButtonLink = exports.ButtonLink = (0, _styledComponents.default)(Button).attrs({
|
|
96
62
|
as: 'a'
|
|
97
|
-
})
|
|
98
|
-
exports.ButtonLink = ButtonLink;
|
|
63
|
+
})``;
|
|
99
64
|
ButtonLink.displayName = 'ButtonLink';
|
|
65
|
+
|
|
100
66
|
/* ================================================== *
|
|
101
67
|
* <div> styled as a Button (non-W3C compliant)
|
|
102
68
|
* ================================================== */
|
|
103
69
|
|
|
104
|
-
|
|
70
|
+
const ButtonBlock = exports.ButtonBlock = (0, _styledComponents.default)(Button).attrs({
|
|
105
71
|
as: 'div'
|
|
106
|
-
})
|
|
107
|
-
exports.ButtonBlock = ButtonBlock;
|
|
72
|
+
})``;
|
|
108
73
|
ButtonBlock.displayName = 'ButtonBlock';
|
|
74
|
+
|
|
109
75
|
/* ================================================== *
|
|
110
76
|
* React Router Link component styled as a Button
|
|
111
77
|
* ================================================== */
|
|
112
78
|
|
|
113
|
-
|
|
114
|
-
|
|
79
|
+
const ButtonRouter = exports.ButtonRouter = (0, _styledComponents.default)(_reactRouterDom.Link)({
|
|
80
|
+
..._Button.style,
|
|
81
|
+
..._button.commonStyle
|
|
82
|
+
}, _button.variants);
|
|
115
83
|
ButtonRouter.displayName = 'ButtonRouter';
|
|
116
|
-
ButtonRouter.defaultProps =
|
|
84
|
+
ButtonRouter.defaultProps = {
|
|
85
|
+
...defaultProps
|
|
86
|
+
};
|
|
@@ -4,112 +4,131 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
|
|
12
9
|
var _colors = require("../theme/colors");
|
|
13
|
-
|
|
14
10
|
var _Icon = _interopRequireDefault(require("./basic/Icon"));
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
-
|
|
20
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
|
-
|
|
22
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
-
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
-
|
|
28
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
-
|
|
30
|
-
function _templateObject() {
|
|
31
|
-
var data = _taggedTemplateLiteral(["\n display: block;\n width: ", "px;\n height: ", "px;\n cursor: pointer;\n text-align: center;\n line-height: 16px;\n padding-top: 3px;\n flex-grow: 0;\n flex-shrink: 0;\n position: relative;\n\n input {\n position: absolute;\n opacity: 0;\n width: 1px;\n height: 1px;\n margin: 0;\n padding: 0;\n border: 0;\n pointer-events: none;\n\n & ~ span {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid\n ", ";\n border-radius: 5px;\n background-color: transparent;\n }\n\n & ~ ", " {\n display: none;\n position: absolute;\n top: ", "px;\n left: ", "px;\n font-weight: 600;\n color: ", ";\n font-size: ", "px;\n }\n\n &:checked {\n & ~ span {\n border-color: ", ";\n background-color: ", ";\n }\n\n & ~ ", " {\n display: block;\n }\n }\n }\n"]);
|
|
32
|
-
|
|
33
|
-
_templateObject = function _templateObject() {
|
|
34
|
-
return data;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return data;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
41
|
-
|
|
42
|
-
var DEFAULT_PROPS = {
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
const DEFAULT_PROPS = {
|
|
43
14
|
size: 24,
|
|
44
15
|
space: 3,
|
|
45
16
|
isLightTheme: false,
|
|
46
17
|
themeColor: _colors.Color.BLACK,
|
|
47
18
|
checkColor: _colors.Color.WHITE
|
|
48
19
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
20
|
+
const StyledCheckboxWrapper = _styledComponents.default.label`
|
|
21
|
+
display: block;
|
|
22
|
+
width: ${({
|
|
23
|
+
size
|
|
24
|
+
}) => size}px;
|
|
25
|
+
height: ${({
|
|
26
|
+
size
|
|
27
|
+
}) => size}px;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
text-align: center;
|
|
30
|
+
line-height: 16px;
|
|
31
|
+
padding-top: 3px;
|
|
32
|
+
flex-grow: 0;
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
position: relative;
|
|
35
|
+
|
|
36
|
+
input {
|
|
37
|
+
position: absolute;
|
|
38
|
+
opacity: 0;
|
|
39
|
+
width: 1px;
|
|
40
|
+
height: 1px;
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 0;
|
|
43
|
+
border: 0;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
|
|
46
|
+
& ~ span {
|
|
47
|
+
display: block;
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
border: 2px solid
|
|
54
|
+
${({
|
|
55
|
+
isError,
|
|
56
|
+
borderColor = _colors.Color.HOTEL_LIGHT_GREY,
|
|
57
|
+
errorBorderColor = _colors.Color.RED
|
|
58
|
+
}) => isError ? errorBorderColor : borderColor};
|
|
59
|
+
border-radius: 5px;
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
& ~ ${_Icon.default} {
|
|
64
|
+
display: none;
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: ${({
|
|
67
|
+
space
|
|
68
|
+
}) => space}px;
|
|
69
|
+
left: ${({
|
|
70
|
+
space
|
|
71
|
+
}) => space}px;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
color: ${_colors.Color.WHITE};
|
|
74
|
+
font-size: ${({
|
|
75
|
+
size,
|
|
76
|
+
space
|
|
77
|
+
}) => size - space * 2}px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:checked {
|
|
81
|
+
& ~ span {
|
|
82
|
+
border-color: ${({
|
|
83
|
+
themeColor
|
|
84
|
+
}) => themeColor};
|
|
85
|
+
background-color: ${({
|
|
86
|
+
themeColor
|
|
87
|
+
}) => themeColor};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
& ~ ${_Icon.default} {
|
|
91
|
+
display: block;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:focus-visible ~ span {
|
|
96
|
+
outline: 2px solid #1e5bbb !important;
|
|
97
|
+
outline-offset: 2px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
StyledCheckboxWrapper.defaultProps = {
|
|
102
|
+
...DEFAULT_PROPS
|
|
103
|
+
};
|
|
104
|
+
const Checkbox = /*#__PURE__*/_react.default.forwardRef(({
|
|
105
|
+
size,
|
|
106
|
+
space,
|
|
107
|
+
themeColor,
|
|
108
|
+
isLightTheme,
|
|
109
|
+
isError,
|
|
110
|
+
borderColor,
|
|
111
|
+
errorBorderColor,
|
|
112
|
+
checkColor,
|
|
113
|
+
...rest
|
|
114
|
+
}, ref) => /*#__PURE__*/_react.default.createElement(StyledCheckboxWrapper, {
|
|
115
|
+
size: size,
|
|
116
|
+
space: space,
|
|
117
|
+
themeColor: themeColor,
|
|
118
|
+
isLightTheme: isLightTheme,
|
|
119
|
+
isError: isError,
|
|
120
|
+
borderColor: borderColor,
|
|
121
|
+
errorBorderColor: errorBorderColor
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
123
|
+
type: "checkbox"
|
|
124
|
+
}, rest, {
|
|
125
|
+
ref: ref
|
|
126
|
+
})), /*#__PURE__*/_react.default.createElement("span", null), /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
127
|
+
name: "netguru_check",
|
|
128
|
+
color: `${checkColor || _colors.Color.WHITE} !important`
|
|
129
|
+
})));
|
|
130
|
+
Checkbox.defaultProps = {
|
|
131
|
+
...DEFAULT_PROPS
|
|
132
|
+
};
|
|
113
133
|
Checkbox.displayName = 'Checkbox';
|
|
114
|
-
var _default = Checkbox;
|
|
115
|
-
exports.default = _default;
|
|
134
|
+
var _default = exports.default = Checkbox;
|
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.EmptyState = void 0;
|
|
9
|
-
|
|
10
7
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _components = require("../../components");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, "Nothing to see here!"), /*#__PURE__*/React.createElement(_components.Text, {
|
|
29
|
-
as: "p",
|
|
30
|
-
textAlign: "center",
|
|
31
|
-
mt: "0"
|
|
32
|
-
}, "This variant is missing but it could be implemented upon necessity."));
|
|
33
|
-
};
|
|
34
|
-
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
+
const EmptyState = () => /*#__PURE__*/React.createElement(_components.Box, null, /*#__PURE__*/React.createElement(_components.Text, {
|
|
11
|
+
as: "h1",
|
|
12
|
+
textAlign: "center",
|
|
13
|
+
mb: "8px"
|
|
14
|
+
}, "\uD83E\uDD17"), /*#__PURE__*/React.createElement(_components.Text, {
|
|
15
|
+
as: "h2",
|
|
16
|
+
textAlign: "center",
|
|
17
|
+
mt: "0",
|
|
18
|
+
mb: "0"
|
|
19
|
+
}, "Nothing to see here!"), /*#__PURE__*/React.createElement(_components.Text, {
|
|
20
|
+
as: "p",
|
|
21
|
+
textAlign: "center",
|
|
22
|
+
mt: "0"
|
|
23
|
+
}, "This variant is missing but it could be implemented upon necessity."));
|
|
35
24
|
exports.EmptyState = EmptyState;
|
|
@@ -3,25 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.
|
|
7
|
-
|
|
6
|
+
exports.default = exports.FlatButtonVariant = exports.FlatButton = void 0;
|
|
8
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
8
|
var _darken = _interopRequireDefault(require("polished/lib/color/darken"));
|
|
11
|
-
|
|
12
9
|
var _colors = _interopRequireDefault(require("../theme/colors"));
|
|
13
|
-
|
|
14
10
|
var _flatButton = require("../theme/flatButton");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
-
|
|
22
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
|
|
24
|
-
var variantGroups = {
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const variantGroups = {
|
|
25
13
|
primary: {
|
|
26
14
|
PRIMARY: 'primary',
|
|
27
15
|
PRIMARY_X_SMALL: 'primaryXSmall',
|
|
@@ -71,85 +59,71 @@ var variantGroups = {
|
|
|
71
59
|
TERTIARY_X_LARGE_LONG: 'tertiaryXLargeLong'
|
|
72
60
|
}
|
|
73
61
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var getCustomPrimaryStyle = function getCustomPrimaryStyle(_ref) {
|
|
83
|
-
var primary = _ref.color.primary;
|
|
84
|
-
return {
|
|
85
|
-
backgroundColor: "".concat(primary, " !important"),
|
|
86
|
-
borderColor: "".concat(primary, " !important"),
|
|
87
|
-
':hover': {
|
|
88
|
-
backgroundColor: "".concat((0, _darken.default)(0.05, primary), " !important"),
|
|
89
|
-
borderColor: "".concat((0, _darken.default)(0.05, primary), " !important")
|
|
90
|
-
}
|
|
91
|
-
};
|
|
62
|
+
const FlatButtonVariant = exports.FlatButtonVariant = {
|
|
63
|
+
...variantGroups.primary,
|
|
64
|
+
...variantGroups.primaryLong,
|
|
65
|
+
...variantGroups.secondary,
|
|
66
|
+
...variantGroups.secondaryLong,
|
|
67
|
+
...variantGroups.tertiary,
|
|
68
|
+
...variantGroups.tertiaryLong
|
|
92
69
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var primary = _ref2.color.primary;
|
|
96
|
-
return {
|
|
97
|
-
color: "".concat(primary, " !important"),
|
|
98
|
-
borderColor: "".concat(primary, " !important"),
|
|
99
|
-
backgroundColor: "".concat(_colors.default.white, " !important"),
|
|
100
|
-
':hover': {
|
|
101
|
-
color: "".concat(_colors.default.white, " !important"),
|
|
102
|
-
backgroundColor: "".concat(primary, " !important"),
|
|
103
|
-
borderColor: "".concat(primary, " !important")
|
|
104
|
-
}
|
|
105
|
-
};
|
|
70
|
+
const defaultProps = {
|
|
71
|
+
variant: FlatButtonVariant.PRIMARY
|
|
106
72
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
73
|
+
const getCustomPrimaryStyle = ({
|
|
74
|
+
color: {
|
|
75
|
+
primary
|
|
76
|
+
}
|
|
77
|
+
}) => ({
|
|
78
|
+
backgroundColor: `${primary} !important`,
|
|
79
|
+
borderColor: `${primary} !important`,
|
|
80
|
+
':hover': {
|
|
81
|
+
backgroundColor: `${(0, _darken.default)(0.05, primary)} !important`,
|
|
82
|
+
borderColor: `${(0, _darken.default)(0.05, primary)} !important`
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const getCustomSecondaryStyle = ({
|
|
86
|
+
color: {
|
|
87
|
+
primary
|
|
88
|
+
}
|
|
89
|
+
}) => ({
|
|
90
|
+
color: `${primary} !important`,
|
|
91
|
+
borderColor: `${primary} !important`,
|
|
92
|
+
backgroundColor: `${_colors.default.white} !important`,
|
|
93
|
+
':hover': {
|
|
94
|
+
color: `${_colors.default.white} !important`,
|
|
95
|
+
backgroundColor: `${primary} !important`,
|
|
96
|
+
borderColor: `${primary} !important`
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const getCustomStyles = ({
|
|
100
|
+
variant,
|
|
101
|
+
theme: {
|
|
102
|
+
custom
|
|
103
|
+
}
|
|
104
|
+
}) => {
|
|
112
105
|
if (variant.indexOf(FlatButtonVariant.PRIMARY) === 0) {
|
|
113
106
|
return getCustomPrimaryStyle(custom);
|
|
114
107
|
} else if (variant.indexOf(FlatButtonVariant.SECONDARY) === 0) {
|
|
115
108
|
return getCustomSecondaryStyle(custom);
|
|
116
109
|
}
|
|
117
|
-
|
|
118
110
|
return '';
|
|
119
111
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return props.fontWeight ? {
|
|
135
|
-
fontWeight: "".concat(props.fontWeight, " !important")
|
|
136
|
-
} : {};
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
var lineHeight = function lineHeight(props) {
|
|
140
|
-
return props.lineHeight ? {
|
|
141
|
-
lineHeight: "".concat(props.lineHeight, " !important")
|
|
142
|
-
} : {};
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
var handleCustom = function handleCustom(props) {
|
|
146
|
-
var _props$theme;
|
|
147
|
-
|
|
148
|
-
return props !== null && props !== void 0 && (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.custom ? getCustomStyles(props) : {};
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
var FlatButton = _styledComponents.default.button(_flatButton.commonStyle, _flatButton.variants, whiteSpace, fontSize, fontWeight, lineHeight, handleCustom);
|
|
152
|
-
|
|
153
|
-
exports.default = exports.FlatButton = FlatButton;
|
|
112
|
+
const whiteSpace = props => props.whiteSpace ? {
|
|
113
|
+
whiteSpace: props.whiteSpace
|
|
114
|
+
} : {};
|
|
115
|
+
const fontSize = props => props.fontSize ? {
|
|
116
|
+
fontSize: `${props.fontSize} !important`
|
|
117
|
+
} : {};
|
|
118
|
+
const fontWeight = props => props.fontWeight ? {
|
|
119
|
+
fontWeight: `${props.fontWeight} !important`
|
|
120
|
+
} : {};
|
|
121
|
+
const lineHeight = props => props.lineHeight ? {
|
|
122
|
+
lineHeight: `${props.lineHeight} !important`
|
|
123
|
+
} : {};
|
|
124
|
+
const handleCustom = props => props?.theme?.custom ? getCustomStyles(props) : {};
|
|
125
|
+
const FlatButton = exports.default = exports.FlatButton = _styledComponents.default.button(_flatButton.commonStyle, _flatButton.variants, whiteSpace, fontSize, fontWeight, lineHeight, handleCustom);
|
|
154
126
|
FlatButton.displayName = 'FlatButton';
|
|
155
|
-
FlatButton.defaultProps =
|
|
127
|
+
FlatButton.defaultProps = {
|
|
128
|
+
...defaultProps
|
|
129
|
+
};
|