@occmundial/occ-atomic 3.0.0-beta.15 → 3.0.0-beta.17
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +23 -0
- package/build/Button/__snapshots__/Button.test.js.snap +18 -18
- package/build/Button/styles.js +6 -6
- package/build/Checkbox/Checkbox.js +25 -2
- package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +63 -71
- package/build/Checkbox/styles.js +74 -81
- package/build/Pill/Choice/Choice.js +6 -4
- package/build/Pill/Choice/styles.js +13 -10
- package/build/Pill/Group/styles.js +5 -5
- package/build/Pill/Stack/Stack.js +2 -2
- package/build/Pill/Stack/styles.js +5 -8
- package/build/Radio/Radio.js +11 -4
- package/build/Radio/__snapshots__/Radio.test.js.snap +71 -79
- package/build/Radio/styles.js +84 -85
- package/build/SlideToggle/SlideToggle.js +19 -4
- package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +52 -37
- package/build/SlideToggle/styles.js +63 -44
- package/package.json +1 -1
@@ -44,12 +44,11 @@ var _default = {
|
|
44
44
|
'&:hover': {
|
45
45
|
background: _colors["default"].pill.unselected.bg.hover
|
46
46
|
},
|
47
|
-
'&:active
|
47
|
+
'&:active': {
|
48
48
|
background: _colors["default"].pill.unselected.bg.active
|
49
49
|
},
|
50
|
-
'&:
|
51
|
-
boxShadow: _shadows["default"]['focus-indigo']
|
52
|
-
background: _colors["default"].pill.unselected.bg["default"]
|
50
|
+
'&:focus-visible': {
|
51
|
+
boxShadow: _shadows["default"]['focus-indigo']
|
53
52
|
}
|
54
53
|
},
|
55
54
|
disabled: {
|
@@ -57,16 +56,16 @@ var _default = {
|
|
57
56
|
pointerEvents: 'none'
|
58
57
|
},
|
59
58
|
selected: {
|
60
|
-
background:
|
59
|
+
background: _colors["default"].pill.selected.bg["default"],
|
61
60
|
zIndex: 1,
|
62
61
|
color: _colors["default"].text.white.primary,
|
63
62
|
'&:hover': {
|
64
63
|
background: _colors["default"].pill.selected.bg.hover
|
65
64
|
},
|
66
|
-
'&:active
|
65
|
+
'&:active': {
|
67
66
|
background: _colors["default"].pill.selected.bg.active
|
68
67
|
},
|
69
|
-
'&:
|
68
|
+
'&:focus-visible': {
|
70
69
|
boxShadow: _shadows["default"]['focus-indigo']
|
71
70
|
}
|
72
71
|
},
|
@@ -80,9 +79,7 @@ var _default = {
|
|
80
79
|
font: (0, _styles.parseFontValue)(_fonts["default"]['body-regular']),
|
81
80
|
textOverflow: 'ellipsis',
|
82
81
|
whiteSpace: 'nowrap',
|
83
|
-
padding: [0, _spacing["default"]['size-1']]
|
84
|
-
marginLeft: _spacing["default"]['size-1'],
|
85
|
-
marginRight: _spacing["default"]['size-1']
|
82
|
+
padding: [0, _spacing["default"]['size-1']]
|
86
83
|
},
|
87
84
|
textSelectedDisabled: {
|
88
85
|
color: _colors["default"].text.white.secondary
|
@@ -95,6 +92,12 @@ var _default = {
|
|
95
92
|
},
|
96
93
|
textEnabled: {
|
97
94
|
color: _colors["default"].text.indigo.primary
|
95
|
+
},
|
96
|
+
leftIcon: {
|
97
|
+
marginRight: _spacing["default"]['size-1']
|
98
|
+
},
|
99
|
+
rightIcon: {
|
100
|
+
marginLeft: _spacing["default"]['size-1']
|
98
101
|
}
|
99
102
|
};
|
100
103
|
exports["default"] = _default;
|
@@ -43,15 +43,15 @@ var _default = {
|
|
43
43
|
whiteSpace: 'nowrap',
|
44
44
|
transition: '0.3s all',
|
45
45
|
cursor: 'pointer',
|
46
|
-
'&:not(:active):focus-visible': {
|
47
|
-
boxShadow: _shadows["default"]['focus-indigo'],
|
48
|
-
background: 'none'
|
49
|
-
},
|
50
46
|
'&:hover': {
|
51
47
|
background: _colors["default"].pill.unselected.bg.hover
|
52
48
|
},
|
53
|
-
'&:active
|
49
|
+
'&:active': {
|
54
50
|
background: _colors["default"].pill.unselected.bg.active
|
51
|
+
},
|
52
|
+
'&:focus-visible': {
|
53
|
+
boxShadow: _shadows["default"]['focus-indigo'],
|
54
|
+
background: 'none'
|
55
55
|
}
|
56
56
|
},
|
57
57
|
selected: {
|
@@ -52,8 +52,8 @@ var Stack = function Stack(_ref) {
|
|
52
52
|
className: classes.close,
|
53
53
|
iconName: "cross",
|
54
54
|
colors: [disabled ? _colors["default"].icon.brand.disabled : _colors["default"].icon.brand["default"]],
|
55
|
-
width:
|
56
|
-
height:
|
55
|
+
width: 16,
|
56
|
+
height: 16
|
57
57
|
})));
|
58
58
|
};
|
59
59
|
|
@@ -42,12 +42,11 @@ var _default = {
|
|
42
42
|
'&:hover': {
|
43
43
|
background: _colors["default"].pill.unselected.bg.hover
|
44
44
|
},
|
45
|
-
'&:active
|
45
|
+
'&:active': {
|
46
46
|
background: _colors["default"].pill.unselected.bg.active
|
47
47
|
},
|
48
|
-
'&:
|
49
|
-
boxShadow: _shadows["default"]['focus-indigo']
|
50
|
-
background: _colors["default"].pill.unselected.bg["default"]
|
48
|
+
'&:focus-visible': {
|
49
|
+
boxShadow: _shadows["default"]['focus-indigo']
|
51
50
|
}
|
52
51
|
},
|
53
52
|
disabled: {
|
@@ -61,8 +60,7 @@ var _default = {
|
|
61
60
|
color: _colors["default"].text.indigo.primary,
|
62
61
|
textOverflow: 'ellipsis',
|
63
62
|
whiteSpace: 'nowrap',
|
64
|
-
padding: [0, _spacing["default"]['size-1']]
|
65
|
-
marginRight: _spacing["default"]['size-1']
|
63
|
+
padding: [0, _spacing["default"]['size-1']]
|
66
64
|
},
|
67
65
|
textDisabled: {
|
68
66
|
color: _colors["default"].text.indigo.secondary
|
@@ -73,8 +71,7 @@ var _default = {
|
|
73
71
|
display: 'inline-flex',
|
74
72
|
justifyContent: 'center',
|
75
73
|
alignItems: 'center',
|
76
|
-
|
77
|
-
marginLeft: -_spacing["default"]['size-1']
|
74
|
+
marginLeft: _spacing["default"]['size-1']
|
78
75
|
}
|
79
76
|
};
|
80
77
|
exports["default"] = _default;
|
package/build/Radio/Radio.js
CHANGED
@@ -119,9 +119,16 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
119
119
|
},
|
120
120
|
style: style
|
121
121
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
122
|
-
className: classes.
|
123
|
-
|
124
|
-
|
122
|
+
className: classes.radioWrap
|
123
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
124
|
+
className: classes.radio
|
125
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
126
|
+
className: classes.radioOuter
|
127
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
128
|
+
className: classes.radioInner
|
129
|
+
}))), !!(option.label || option.right || option.tag) && /*#__PURE__*/_react["default"].createElement("div", {
|
130
|
+
className: classes.labelWrap
|
131
|
+
}, option.label && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
125
132
|
tag: "label",
|
126
133
|
className: "".concat(classes.label).concat(textOverflow ? " ".concat(classes.overflow) : '').concat(alignLeft ? " ".concat(classes.alignLeft) : '')
|
127
134
|
}, option.label), option.right && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
@@ -131,7 +138,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
131
138
|
}, option.right), option.tag && /*#__PURE__*/_react["default"].createElement(_Tag["default"], {
|
132
139
|
theme: "link",
|
133
140
|
className: classes.tag
|
134
|
-
}, option.tag));
|
141
|
+
}, option.tag)));
|
135
142
|
}));
|
136
143
|
}
|
137
144
|
}]);
|
@@ -6,12 +6,11 @@ exports[`Radio styles matches the snapshot 1`] = `
|
|
6
6
|
Object {
|
7
7
|
"active": Object {
|
8
8
|
"& $radio": Object {
|
9
|
-
"
|
9
|
+
"& $radioInner": Object {
|
10
10
|
"background": "#0059CD",
|
11
11
|
},
|
12
|
-
"
|
13
|
-
"
|
14
|
-
"borderWidth": 2,
|
12
|
+
"& $radioOuter": Object {
|
13
|
+
"boxShadow": "inset 0 0 0 2px #0059CD",
|
15
14
|
},
|
16
15
|
},
|
17
16
|
},
|
@@ -21,77 +20,68 @@ Object {
|
|
21
20
|
"cont": Object {
|
22
21
|
"&$active": Object {
|
23
22
|
"&:active": Object {
|
24
|
-
"& $radio
|
23
|
+
"& $radio $radioInner": Object {
|
25
24
|
"background": "#083CAE",
|
26
25
|
},
|
27
|
-
"& $radio
|
28
|
-
"
|
29
|
-
"borderWidth": "3px",
|
26
|
+
"& $radio $radioOuter": Object {
|
27
|
+
"boxShadow": "inset 0 0 0 3px #0047A5 !important",
|
30
28
|
},
|
31
29
|
},
|
32
|
-
"&:focus $radio:before": Object {
|
33
|
-
"borderColor": "#0059CD",
|
34
|
-
"boxShadow": "0 0 0 8px rgba(0,110,255,0.3)",
|
35
|
-
},
|
36
30
|
"&:hover": Object {
|
37
|
-
"& $radio
|
31
|
+
"& $radio $radioInner": Object {
|
38
32
|
"background": "#083CAE",
|
39
33
|
},
|
40
|
-
"& $radio
|
41
|
-
"
|
34
|
+
"& $radio $radioOuter": Object {
|
35
|
+
"boxShadow": "inset 0 0 0 2px #0047A5",
|
42
36
|
},
|
43
37
|
},
|
44
38
|
},
|
45
|
-
"&:
|
46
|
-
"
|
47
|
-
"borderColor": "#6C6F89",
|
48
|
-
"borderWidth": "2px",
|
49
|
-
"boxShadow": "initial",
|
50
|
-
},
|
51
|
-
"&:focus $radio:before": Object {
|
52
|
-
"borderColor": "#D3D4DC",
|
53
|
-
"boxShadow": "0 0 0 8px rgba(0,110,255,0.3)",
|
54
|
-
},
|
55
|
-
"&:hover $radio:before": Object {
|
56
|
-
"borderColor": "#6C6F89",
|
57
|
-
"boxShadow": "initial",
|
58
|
-
},
|
39
|
+
"&:active $radio $radioOuter": Object {
|
40
|
+
"boxShadow": "inset 0 0 0 2px #6C6F89",
|
59
41
|
},
|
60
|
-
"
|
42
|
+
"&:focus-visible $radio": Object {
|
43
|
+
"boxShadow": "0 0 0 8px rgba(0,110,255,0.3)",
|
44
|
+
},
|
45
|
+
"&:hover $radio $radioOuter": Object {
|
46
|
+
"boxShadow": "inset 0 0 0 1px #6C6F89",
|
47
|
+
},
|
48
|
+
"alignItems": "flex-start",
|
61
49
|
"boxSizing": "border-box",
|
62
50
|
"cursor": "pointer",
|
63
51
|
"display": "flex",
|
64
52
|
"outline": "0",
|
65
|
-
"paddingBottom": "8px",
|
66
|
-
"paddingTop": "8px",
|
67
53
|
},
|
68
54
|
"disabled": Object {
|
69
|
-
"&
|
70
|
-
"
|
55
|
+
"& $radio $radioInner": Object {
|
56
|
+
"background": "#EDEDF1",
|
57
|
+
},
|
58
|
+
"& $radio $radioOuter": Object {
|
59
|
+
"background": "#EDEDF1",
|
71
60
|
},
|
72
61
|
"&$active": Object {
|
73
|
-
"& $radio
|
62
|
+
"& $radio $radioInner": Object {
|
74
63
|
"background": "#8DA5DA",
|
75
64
|
},
|
76
|
-
"& $radio
|
77
|
-
"
|
78
|
-
},
|
79
|
-
},
|
80
|
-
"&:not($active)": Object {
|
81
|
-
"& $radio:after": Object {
|
82
|
-
"background": "#EDEDF1",
|
83
|
-
},
|
84
|
-
"& $radio:before": Object {
|
85
|
-
"background": "#EDEDF1",
|
65
|
+
"& $radio $radioOuter": Object {
|
66
|
+
"boxShadow": "inset 0 0 0 2px #8DA5DA",
|
86
67
|
},
|
87
68
|
},
|
88
69
|
"pointerEvents": "none",
|
89
70
|
},
|
90
71
|
"label": Object {
|
91
72
|
"cursor": "pointer",
|
92
|
-
"flex":
|
93
|
-
"
|
94
|
-
"
|
73
|
+
"flex": 1,
|
74
|
+
"marginLeft": "12px",
|
75
|
+
"pointerEvents": "none",
|
76
|
+
},
|
77
|
+
"labelWrap": Object {
|
78
|
+
"alignItems": "center",
|
79
|
+
"display": "flex",
|
80
|
+
"flex": 1,
|
81
|
+
"minHeight": 48,
|
82
|
+
"overflow": "hidden",
|
83
|
+
"paddingBottom": "4px",
|
84
|
+
"paddingTop": "4px",
|
95
85
|
},
|
96
86
|
"overflow": Object {
|
97
87
|
"overflow": "hidden",
|
@@ -99,41 +89,43 @@ Object {
|
|
99
89
|
"whiteSpace": "nowrap",
|
100
90
|
},
|
101
91
|
"radio": Object {
|
102
|
-
"
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
"
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
92
|
+
"alignItems": "center",
|
93
|
+
"borderRadius": "9999px",
|
94
|
+
"display": "grid",
|
95
|
+
"height": 20,
|
96
|
+
"justifyContent": "center",
|
97
|
+
"transition": "all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s",
|
98
|
+
"width": 20,
|
99
|
+
},
|
100
|
+
"radioInner": Object {
|
101
|
+
"background": "#fff",
|
102
|
+
"borderRadius": "9999px",
|
103
|
+
"gridColumnStart": 1,
|
104
|
+
"gridRowStart": 1,
|
105
|
+
"height": 10,
|
106
|
+
"margin": 5,
|
107
|
+
"transition": "all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s",
|
108
|
+
"width": 10,
|
109
|
+
},
|
110
|
+
"radioOuter": Object {
|
111
|
+
"background": "#fff",
|
112
|
+
"borderRadius": "9999px",
|
113
|
+
"boxShadow": "inset 0 0 0 1px #D3D4DC",
|
114
|
+
"gridColumnStart": 1,
|
115
|
+
"gridRowStart": 1,
|
116
|
+
"height": 20,
|
117
|
+
"transition": "all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s",
|
118
|
+
"width": 20,
|
119
|
+
},
|
120
|
+
"radioWrap": Object {
|
129
121
|
"alignItems": "center",
|
130
122
|
"display": "flex",
|
131
|
-
"
|
132
|
-
"
|
133
|
-
"
|
123
|
+
"flexShrink": 0,
|
124
|
+
"height": 48,
|
125
|
+
"justifyContent": "center",
|
126
|
+
"width": 52,
|
134
127
|
},
|
135
128
|
"right": Object {
|
136
|
-
"float": "right",
|
137
129
|
"marginLeft": "8px",
|
138
130
|
"pointerEvents": "none",
|
139
131
|
},
|
package/build/Radio/styles.js
CHANGED
@@ -11,133 +11,132 @@ var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
|
11
11
|
|
12
12
|
var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
|
13
13
|
|
14
|
+
var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"));
|
15
|
+
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
15
17
|
|
16
18
|
var radio = _colors["default"].radio;
|
19
|
+
var transition = 'all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s';
|
20
|
+
var contentHeight = 48;
|
21
|
+
var radioWidth = 52;
|
22
|
+
var radioSize = 20;
|
23
|
+
var radioInnerSize = 10;
|
17
24
|
var _default = {
|
18
25
|
cont: {
|
19
|
-
paddingTop: _spacing["default"]['size-2'],
|
20
|
-
paddingBottom: _spacing["default"]['size-2'],
|
21
26
|
boxSizing: 'border-box',
|
22
27
|
display: 'flex',
|
23
|
-
alignItems: '
|
28
|
+
alignItems: 'flex-start',
|
24
29
|
cursor: 'pointer',
|
25
30
|
outline: '0',
|
31
|
+
'&:focus-visible $radio': {
|
32
|
+
boxShadow: _shadows["default"]['focus-bright-blue']
|
33
|
+
},
|
34
|
+
'&:hover $radio $radioOuter': {
|
35
|
+
boxShadow: "inset 0 0 0 1px ".concat(radio.unselected.border.hover)
|
36
|
+
},
|
37
|
+
'&:active $radio $radioOuter': {
|
38
|
+
boxShadow: "inset 0 0 0 2px ".concat(radio.unselected.border.hover)
|
39
|
+
},
|
26
40
|
'&$active': {
|
27
|
-
'&:focus $radio:before': {
|
28
|
-
borderColor: radio['selected']['border']['default'],
|
29
|
-
boxShadow: _shadows["default"]['focus-bright-blue']
|
30
|
-
},
|
31
41
|
'&:hover': {
|
32
|
-
'& $radio
|
33
|
-
|
42
|
+
'& $radio $radioOuter': {
|
43
|
+
boxShadow: "inset 0 0 0 2px ".concat(radio.selected.border.hover)
|
34
44
|
},
|
35
|
-
'& $radio
|
36
|
-
background: radio
|
45
|
+
'& $radio $radioInner': {
|
46
|
+
background: radio.selected.bg.hover
|
37
47
|
}
|
38
48
|
},
|
39
49
|
'&:active': {
|
40
|
-
'& $radio
|
41
|
-
|
42
|
-
borderWidth: '3px'
|
50
|
+
'& $radio $radioOuter': {
|
51
|
+
boxShadow: "inset 0 0 0 3px ".concat(radio.selected.border.hover, " !important")
|
43
52
|
},
|
44
|
-
'& $radio
|
45
|
-
background: radio
|
53
|
+
'& $radio $radioInner': {
|
54
|
+
background: radio.selected.bg.hover
|
46
55
|
}
|
47
56
|
}
|
48
|
-
},
|
49
|
-
'&:not($active)': {
|
50
|
-
'&:hover $radio:before': {
|
51
|
-
borderColor: radio['unselected']['border']['hover'],
|
52
|
-
boxShadow: 'initial'
|
53
|
-
},
|
54
|
-
'&:active $radio:before': {
|
55
|
-
borderColor: radio['unselected']['border']['hover'],
|
56
|
-
borderWidth: '2px',
|
57
|
-
boxShadow: 'initial'
|
58
|
-
},
|
59
|
-
'&:focus $radio:before': {
|
60
|
-
borderColor: radio['unselected']['border']['default'],
|
61
|
-
boxShadow: _shadows["default"]['focus-bright-blue']
|
62
|
-
}
|
63
57
|
}
|
64
58
|
},
|
65
|
-
|
66
|
-
width:
|
67
|
-
height:
|
68
|
-
position: 'relative',
|
59
|
+
radioWrap: {
|
60
|
+
width: radioWidth,
|
61
|
+
height: contentHeight,
|
69
62
|
display: 'flex',
|
70
63
|
alignItems: 'center',
|
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
|
-
|
64
|
+
justifyContent: 'center',
|
65
|
+
flexShrink: 0
|
66
|
+
},
|
67
|
+
radio: {
|
68
|
+
width: radioSize,
|
69
|
+
height: radioSize,
|
70
|
+
borderRadius: _borderRadius["default"]['br-full'],
|
71
|
+
transition: transition,
|
72
|
+
display: 'grid',
|
73
|
+
alignItems: 'center',
|
74
|
+
justifyContent: 'center'
|
75
|
+
},
|
76
|
+
radioOuter: {
|
77
|
+
width: radioSize,
|
78
|
+
height: radioSize,
|
79
|
+
borderRadius: _borderRadius["default"]['br-full'],
|
80
|
+
boxShadow: "inset 0 0 0 1px ".concat(radio.unselected.border["default"]),
|
81
|
+
background: radio.bg["default"],
|
82
|
+
transition: transition,
|
83
|
+
gridRowStart: 1,
|
84
|
+
gridColumnStart: 1
|
85
|
+
},
|
86
|
+
radioInner: {
|
87
|
+
width: radioInnerSize,
|
88
|
+
height: radioInnerSize,
|
89
|
+
margin: 5,
|
90
|
+
borderRadius: _borderRadius["default"]['br-full'],
|
91
|
+
background: radio.bg["default"],
|
92
|
+
transition: transition,
|
93
|
+
gridRowStart: 1,
|
94
|
+
gridColumnStart: 1
|
98
95
|
},
|
99
96
|
active: {
|
100
97
|
'& $radio': {
|
101
|
-
'
|
102
|
-
|
103
|
-
borderColor: radio['selected']['border']['default']
|
98
|
+
'& $radioOuter': {
|
99
|
+
boxShadow: "inset 0 0 0 2px ".concat(radio.selected.border["default"])
|
104
100
|
},
|
105
|
-
'
|
106
|
-
background: radio
|
101
|
+
'& $radioInner': {
|
102
|
+
background: radio.selected.bg["default"]
|
107
103
|
}
|
108
104
|
}
|
109
105
|
},
|
110
106
|
disabled: {
|
111
107
|
pointerEvents: 'none',
|
112
|
-
'&
|
113
|
-
|
108
|
+
'& $radio $radioOuter': {
|
109
|
+
background: radio.bg.disabled
|
114
110
|
},
|
115
|
-
'
|
116
|
-
|
117
|
-
borderColor: radio['selected']['border']['disabled']
|
118
|
-
},
|
119
|
-
'& $radio:after': {
|
120
|
-
background: radio['selected']['bg']['disabled']
|
121
|
-
}
|
111
|
+
'& $radio $radioInner': {
|
112
|
+
background: radio.bg.disabled
|
122
113
|
},
|
123
|
-
'
|
124
|
-
'& $radio
|
125
|
-
|
114
|
+
'&$active': {
|
115
|
+
'& $radio $radioOuter': {
|
116
|
+
boxShadow: "inset 0 0 0 2px ".concat(radio.selected.border.disabled)
|
126
117
|
},
|
127
|
-
'& $radio
|
128
|
-
background: radio
|
118
|
+
'& $radio $radioInner': {
|
119
|
+
background: radio.selected.bg.disabled
|
129
120
|
}
|
130
121
|
}
|
131
122
|
},
|
123
|
+
labelWrap: {
|
124
|
+
minHeight: contentHeight,
|
125
|
+
display: 'flex',
|
126
|
+
alignItems: 'center',
|
127
|
+
paddingTop: _spacing["default"]['size-1'],
|
128
|
+
paddingBottom: _spacing["default"]['size-1'],
|
129
|
+
overflow: 'hidden',
|
130
|
+
flex: 1
|
131
|
+
},
|
132
132
|
label: {
|
133
|
-
marginLeft: _spacing["default"]['size-
|
133
|
+
marginLeft: _spacing["default"]['size-3'],
|
134
|
+
pointerEvents: 'none',
|
134
135
|
cursor: 'pointer',
|
135
|
-
|
136
|
-
flex: '1'
|
136
|
+
flex: 1
|
137
137
|
},
|
138
138
|
right: {
|
139
139
|
marginLeft: _spacing["default"]['size-2'],
|
140
|
-
"float": 'right',
|
141
140
|
pointerEvents: 'none'
|
142
141
|
},
|
143
142
|
overflow: {
|
@@ -13,6 +13,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
|
14
14
|
var _Text = _interopRequireDefault(require("../Text"));
|
15
15
|
|
16
|
+
var _Icon = _interopRequireDefault(require("../Icon"));
|
17
|
+
|
18
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
19
|
+
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
17
21
|
|
18
22
|
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); }
|
@@ -103,6 +107,7 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
|
|
103
107
|
name = _this$props2.name,
|
104
108
|
trk = _this$props2.trk,
|
105
109
|
testId = _this$props2.testId;
|
110
|
+
var iconColor = disabled ? _colors["default"].icon["default"].disabled : value ? _colors["default"].icon.brand.bold : _colors["default"].icon.brand.disabled;
|
106
111
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
107
112
|
id: id,
|
108
113
|
tabIndex: disabled ? -1 : 0,
|
@@ -112,6 +117,8 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
|
|
112
117
|
onClick: this.toggle,
|
113
118
|
className: "".concat(classes.cont).concat(disabled ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
|
114
119
|
style: style
|
120
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
121
|
+
className: classes.switchWrap
|
115
122
|
}, /*#__PURE__*/_react["default"].createElement("div", _extends({
|
116
123
|
id: trk,
|
117
124
|
name: name,
|
@@ -119,14 +126,22 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
|
|
119
126
|
"data-testid": testId
|
120
127
|
}, testId && {
|
121
128
|
'data-value': value ? 1 : 0
|
122
|
-
}), /*#__PURE__*/_react["default"].createElement("
|
123
|
-
className: classes.
|
129
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
130
|
+
className: classes.switchBg
|
124
131
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
132
|
+
className: classes.slider
|
133
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
134
|
+
iconName: value ? 'check' : 'x',
|
135
|
+
width: 16,
|
136
|
+
height: 16,
|
137
|
+
colors: [iconColor],
|
125
138
|
className: classes.icon
|
126
|
-
}))), label && /*#__PURE__*/_react["default"].createElement(
|
139
|
+
}))))), label && /*#__PURE__*/_react["default"].createElement("div", {
|
140
|
+
className: classes.labelWrap
|
141
|
+
}, /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
127
142
|
tag: "label",
|
128
143
|
className: classes.label
|
129
|
-
}, label));
|
144
|
+
}, label)));
|
130
145
|
}
|
131
146
|
}]);
|
132
147
|
|