@thecb/components 5.6.7 → 5.6.9

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.
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ var React = _interopDefault(require('react'));
8
+ var styled = _interopDefault(require('styled-components'));
9
+
10
+ function _taggedTemplateLiteral(strings, raw) {
11
+ if (!raw) {
12
+ raw = strings.slice(0);
13
+ }
14
+
15
+ return Object.freeze(Object.defineProperties(strings, {
16
+ raw: {
17
+ value: Object.freeze(raw)
18
+ }
19
+ }));
20
+ }
21
+
22
+ /*
23
+ Need to add a new color? Visit http://chir.ag/projects/name-that-color to generate a color name.
24
+
25
+ Name already taken? If you can't use the existing color, then use thesaurus.com to pick a similar name
26
+ to the one generated by name-that-color.
27
+ */
28
+ var PEWTER_GREY = "#DFE1E4";
29
+ var MARINER_BLUE = "#2E75D2";
30
+
31
+ function _templateObject2() {
32
+ var data = _taggedTemplateLiteral(["\n height: 16px;\n width: 16px;\n background-color: ", ";\n border-radius: 8px;\n"]);
33
+
34
+ _templateObject2 = function _templateObject2() {
35
+ return data;
36
+ };
37
+
38
+ return data;
39
+ }
40
+
41
+ function _templateObject() {
42
+ var data = _taggedTemplateLiteral(["\n height: 24px;\n width: 24px;\n border: 1px solid\n ", ";\n border-radius: 12px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px;\n min-width: 24px;\n min-height: 24px;\n"]);
43
+
44
+ _templateObject = function _templateObject() {
45
+ return data;
46
+ };
47
+
48
+ return data;
49
+ }
50
+ var defaultTheme = {
51
+ theme: {
52
+ accentColor: MARINER_BLUE,
53
+ inactiveColor: PEWTER_GREY
54
+ }
55
+ };
56
+ var RadioButtonBorder = styled.div(_templateObject(), function (_ref) {
57
+ var isSelected = _ref.isSelected,
58
+ theme = _ref.theme;
59
+ return isSelected ? theme.accentColor : theme.inactiveColor;
60
+ });
61
+ RadioButtonBorder.defaultProps = defaultTheme;
62
+ var RadioButtonCenter = styled.div(_templateObject2(), function (_ref2) {
63
+ var theme = _ref2.theme;
64
+ return theme.accentColor;
65
+ });
66
+ RadioButtonCenter.defaultProps = defaultTheme;
67
+
68
+ var RadioButton = function RadioButton(_ref3) {
69
+ var isSelected = _ref3.isSelected,
70
+ name = _ref3.name;
71
+ return React.createElement(RadioButtonBorder, {
72
+ isSelected: isSelected,
73
+ name: name
74
+ }, isSelected && React.createElement(RadioButtonCenter, null));
75
+ };
76
+
77
+ exports.RadioButton = RadioButton;