@occmundial/occ-atomic 3.0.0-beta.15 → 3.0.0-beta.16

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [3.0.0-beta.16](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.15...v3.0.0-beta.16) (2024-06-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Change focus behavior in form components ([a3b6c9b](https://github.com/occmundial/occ-atomic/commit/a3b6c9b5194b1d8302a6f73bb5522df9e6a756fc))
7
+ * Changes to structure and styles of Checkbox ([6ed54c0](https://github.com/occmundial/occ-atomic/commit/6ed54c0a5ebae0542431b8305d0da8a052c2d3fb))
8
+ * Changes to structure and styles of Radio ([694c995](https://github.com/occmundial/occ-atomic/commit/694c9950a4c6c43a5bd7987536a293835860421e))
9
+ * Changes to structure and styles of SlideToggle ([5ec340f](https://github.com/occmundial/occ-atomic/commit/5ec340f0cc09b04d032ebb888034a92cf71f2f8a))
10
+ * Fix focus styles in form components ([e69d45b](https://github.com/occmundial/occ-atomic/commit/e69d45b84c3e35a433f37feb7c9b0012137bc2bb))
11
+ * Fix spacing and sizing of radio, checkbox and toggle ([b3a71c2](https://github.com/occmundial/occ-atomic/commit/b3a71c2e30e2b810036104a4ee57b6b805d2780c))
12
+ * Fix styles and icon color on Checkbox ([1c4e360](https://github.com/occmundial/occ-atomic/commit/1c4e360ec0d3291048d14f4ccd3859d0bdbc2817))
13
+ * Fix transition value in SlideToggle ([8423fc6](https://github.com/occmundial/occ-atomic/commit/8423fc6b9eea3219ed052add95f27ef4d181f5b5))
14
+ * Update componentData ([ff7c0bd](https://github.com/occmundial/occ-atomic/commit/ff7c0bd47ed55d652b01ace7526867d751a6e1c7))
15
+
1
16
  # [3.0.0-beta.15](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.14...v3.0.0-beta.15) (2024-06-18)
2
17
 
3
18
 
@@ -64,12 +64,12 @@ Object {
64
64
  "&:active": Object {
65
65
  "background": "hsl(234 75.4% 12.7% / 0.1)",
66
66
  },
67
+ "&:focus-visible": Object {
68
+ "boxShadow": "0 0 0 8px hsl(234 75.4% 12.7% / 0.1)",
69
+ },
67
70
  "&:hover": Object {
68
71
  "background": "hsl(234 75.4% 12.7% / 0.05)",
69
72
  },
70
- "&:not(:active):focus-visible": Object {
71
- "boxShadow": "0 0 0 8px hsl(234 75.4% 12.7% / 0.1)",
72
- },
73
73
  "background": "transparent",
74
74
  "color": "#5A5D7B",
75
75
  },
@@ -120,12 +120,12 @@ Object {
120
120
  "&:active": Object {
121
121
  "background": "rgba(255,255,255,0.1)",
122
122
  },
123
+ "&:focus-visible": Object {
124
+ "boxShadow": "0 0 0 8px rgba(255,255,255,0.2)",
125
+ },
123
126
  "&:hover": Object {
124
127
  "background": "rgba(255,255,255,0.05)",
125
128
  },
126
- "&:not(:active):focus-visible": Object {
127
- "boxShadow": "0 0 0 8px rgba(255,255,255,0.2)",
128
- },
129
129
  "background": "transparent",
130
130
  "color": "#fff",
131
131
  },
@@ -214,12 +214,12 @@ Object {
214
214
  "&:focus": Object {
215
215
  "outline": "2px solid rgba(255,255,255,0.2)",
216
216
  },
217
+ "&:focus-visible": Object {
218
+ "boxShadow": "0 0 0 8px hsl(344 87.1% 57.5% / 0.3)",
219
+ },
217
220
  "&:hover": Object {
218
221
  "background": "#A32444",
219
222
  },
220
- "&:not(:active):focus-visible": Object {
221
- "boxShadow": "0 0 0 8px hsl(344 87.1% 57.5% / 0.3)",
222
- },
223
223
  "background": "#D32E58",
224
224
  "color": "#fff",
225
225
  "outline": "2px solid rgba(255,255,255,0.2)",
@@ -245,12 +245,12 @@ Object {
245
245
  "&:active": Object {
246
246
  "background": "hsl(221 91.2% 35.7% / 0.2)",
247
247
  },
248
+ "&:focus-visible": Object {
249
+ "boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
250
+ },
248
251
  "&:hover": Object {
249
252
  "background": "hsl(221 91.2% 35.7% / 0.1)",
250
253
  },
251
- "&:not(:active):focus-visible": Object {
252
- "boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
253
- },
254
254
  "background": "hsl(221 91.2% 35.7% / 0.05)",
255
255
  "color": "#083CAE",
256
256
  },
@@ -275,12 +275,12 @@ Object {
275
275
  "&:focus": Object {
276
276
  "outline": "2px solid #083CAE",
277
277
  },
278
+ "&:focus-visible": Object {
279
+ "boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
280
+ },
278
281
  "&:hover": Object {
279
282
  "background": "hsl(221 91.2% 35.7% / 0.05)",
280
283
  },
281
- "&:not(:active):focus-visible": Object {
282
- "boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
283
- },
284
284
  "background": "transparent",
285
285
  "color": "#083CAE",
286
286
  "outline": "2px solid #083CAE",
@@ -303,12 +303,12 @@ Object {
303
303
  "&:focus": Object {
304
304
  "outline": "2px solid #fff",
305
305
  },
306
+ "&:focus-visible": Object {
307
+ "boxShadow": "0 0 0 8px rgba(255,255,255,0.2)",
308
+ },
306
309
  "&:hover": Object {
307
310
  "background": "rgba(255,255,255,0.05)",
308
311
  },
309
- "&:not(:active):focus-visible": Object {
310
- "boxShadow": "0 0 0 8px rgba(255,255,255,0.2)",
311
- },
312
312
  "background": "transparent",
313
313
  "color": "#fff",
314
314
  "outline": "2px solid #fff",
@@ -102,7 +102,7 @@ var _default = {
102
102
  '&:focus': {
103
103
  outline: "2px solid ".concat(_colors2["default"].button.primary.border["default"])
104
104
  },
105
- '&:not(:active):focus-visible': {
105
+ '&:focus-visible': {
106
106
  boxShadow: _shadows["default"]['focus-pink']
107
107
  },
108
108
  '&$disabled': {
@@ -130,7 +130,7 @@ var _default = {
130
130
  '&:active': {
131
131
  background: _colors2["default"].button.secondary.bg.active
132
132
  },
133
- '&:not(:active):focus-visible': {
133
+ '&:focus-visible': {
134
134
  boxShadow: _shadows["default"]['focus-indigo']
135
135
  },
136
136
  '&$disabled': {
@@ -165,7 +165,7 @@ var _default = {
165
165
  '&:focus': {
166
166
  outline: "2px solid ".concat(_colors2["default"].button.tertiary.border["default"])
167
167
  },
168
- '&:not(:active):focus-visible': {
168
+ '&:focus-visible': {
169
169
  boxShadow: _shadows["default"]['focus-indigo']
170
170
  },
171
171
  '& span span': {
@@ -201,7 +201,7 @@ var _default = {
201
201
  '&:focus': {
202
202
  outline: "2px solid ".concat(_colors2["default"].button.tertiary.border.inverse["default"])
203
203
  },
204
- '&:not(:active):focus-visible': {
204
+ '&:focus-visible': {
205
205
  boxShadow: _shadows["default"]['focus-white']
206
206
  },
207
207
  '& span span': {
@@ -261,7 +261,7 @@ var _default = {
261
261
  '&:active': {
262
262
  background: _colors2["default"].button.ghost.bg.active
263
263
  },
264
- '&:not(:active):focus-visible': {
264
+ '&:focus-visible': {
265
265
  boxShadow: _shadows["default"]['focus-corp']
266
266
  },
267
267
  '& span span': {
@@ -291,7 +291,7 @@ var _default = {
291
291
  '&:active': {
292
292
  background: _colors2["default"].button.ghost.bg.inverse.active
293
293
  },
294
- '&:not(:active):focus-visible': {
294
+ '&:focus-visible': {
295
295
  boxShadow: _shadows["default"]['focus-white']
296
296
  },
297
297
  '& span span': {
@@ -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); }
@@ -110,6 +114,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
110
114
  trk = _this$props2.trk,
111
115
  testId = _this$props2.testId;
112
116
  var iconClass = undetermined ? " ".concat(classes.undetermined) : value ? " ".concat(classes.active) : '';
117
+ var iconColor = disabled ? _colors["default"].icon.brand.disabled : _colors["default"].icon.inverse["default"];
113
118
  return /*#__PURE__*/_react["default"].createElement("div", _extends({
114
119
  id: id,
115
120
  tabIndex: disabled ? -1 : 0,
@@ -123,16 +128,34 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
123
128
  }, testId && {
124
129
  'data-value': value ? 1 : 0
125
130
  }), /*#__PURE__*/_react["default"].createElement("div", {
131
+ className: classes.checkWrap
132
+ }, /*#__PURE__*/_react["default"].createElement("div", {
126
133
  className: classes.check,
127
134
  id: trk
128
- }), label && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
135
+ }, /*#__PURE__*/_react["default"].createElement("div", {
136
+ className: classes.box
137
+ }), undetermined && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
138
+ iconName: "minus",
139
+ width: 16,
140
+ height: 16,
141
+ colors: [iconColor],
142
+ className: classes.icon
143
+ }), !undetermined && value && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
144
+ iconName: "check",
145
+ width: 16,
146
+ height: 16,
147
+ colors: [iconColor],
148
+ className: classes.icon
149
+ }))), !!(label || right) && /*#__PURE__*/_react["default"].createElement("div", {
150
+ className: classes.labelWrap
151
+ }, label && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
129
152
  tag: "label",
130
153
  className: "".concat(classes.label).concat(textOverflow ? " ".concat(classes.overflow) : '').concat(alignLeft ? " ".concat(classes.alignLeft) : '')
131
154
  }, label), right && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
132
155
  tag: "label",
133
156
  mid: true,
134
157
  className: classes.right
135
- }, right));
158
+ }, right)));
136
159
  }
137
160
  }]);
138
161
 
@@ -5,106 +5,103 @@ exports[`Checkbox matches the snapshot 1`] = `ShallowWrapper {}`;
5
5
  exports[`Checkbox styles matches the snapshot 1`] = `
6
6
  Object {
7
7
  "active": Object {
8
- "& $check:after": Object {
9
- "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJCQkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgoJCTxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xOC4zLDcuM2wxLjQsMS40bC04LjcsOWMtMC40LDAuNC0xLDAuNC0xLjQsMC4xbC00LjMtMy42bDEuMy0xLjVsMy42LDNDMTAuMiwxNS42LDE4LjMsNy4zLDE4LjMsNy4zeiIvPgoJCTwvc3ZnPg==)",
10
- },
11
- "& $check:before": Object {
8
+ "& $check $box": Object {
12
9
  "background": "#0059CD",
13
- "borderColor": "rgba(255,255,255,0.2)",
10
+ "boxShadow": "inset 0 0 0 1px rgba(255,255,255,0.2)",
14
11
  },
15
12
  },
16
13
  "alignLeft": Object {
17
14
  "flex": "none",
18
15
  },
16
+ "box": Object {
17
+ "background": "#fff",
18
+ "borderRadius": "4px",
19
+ "boxShadow": "inset 0 0 0 1px #D3D4DC",
20
+ "gridColumnStart": 1,
21
+ "gridRowStart": 1,
22
+ "height": 20,
23
+ "transition": "all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s",
24
+ "width": 20,
25
+ },
19
26
  "check": Object {
20
- "&:after": Object {
21
- "background": "transparent",
22
- "boxSizing": "border-box",
23
- "content": "\\"\\"",
24
- "height": 20,
25
- "left": "50%",
26
- "marginTop": -1,
27
- "position": "absolute",
28
- "top": "50%",
29
- "transform": "translate(-50%, -50%)",
30
- "transition": "0.3s all",
31
- "width": 20,
32
- },
33
- "&:before": Object {
34
- "background": "#fff",
35
- "border": "1px solid #D3D4DC",
36
- "borderRadius": "4px",
37
- "boxSizing": "border-box",
38
- "content": "\\"\\"",
39
- "height": 20,
40
- "left": "50%",
41
- "position": "absolute",
42
- "top": "50%",
43
- "transform": "translate(-50%, -50%)",
44
- "transition": "0.3s all",
45
- "width": 20,
46
- },
47
- "height": "24px",
48
- "position": "relative",
49
- "width": "24px",
27
+ "alignItems": "center",
28
+ "borderRadius": "4px",
29
+ "display": "grid",
30
+ "height": 20,
31
+ "justifyContent": "center",
32
+ "transition": "all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s",
33
+ "width": 20,
34
+ },
35
+ "checkWrap": Object {
36
+ "alignItems": "center",
37
+ "display": "flex",
38
+ "flexShrink": 0,
39
+ "height": 48,
40
+ "justifyContent": "center",
41
+ "width": 52,
50
42
  },
51
43
  "cont": Object {
52
44
  "&$active, &$undetermined": Object {
53
- "&:hover $check:before, &:active $check:before": Object {
45
+ "&:active $check $box": Object {
54
46
  "background": "#083CAE",
47
+ "boxShadow": "inset 0 0 0 2px rgba(255,255,255,0.2)",
55
48
  },
49
+ "&:hover $check $box": Object {
50
+ "background": "#083CAE",
51
+ "boxShadow": "inset 0 0 0 1px rgba(255,255,255,0.2)",
52
+ },
53
+ },
54
+ "&:active $check $box": Object {
55
+ "boxShadow": "inset 0 0 0 2px #6C6F89",
56
56
  },
57
57
  "&:after": Object {
58
58
  "clear": "both",
59
59
  "content": "\\"\\"",
60
60
  "display": "table",
61
61
  },
62
- "&:focus $check:before": Object {
63
- "borderWidth": 1,
62
+ "&:focus-visible $check": Object {
64
63
  "boxShadow": "0 0 0 8px rgba(0,110,255,0.3)",
65
64
  },
66
- "&:not($active), &:not($undetermined)": Object {
67
- "&:active $check:before": Object {
68
- "borderWidth": 2,
69
- },
70
- "&:hover $check:before, &:active $check:before": Object {
71
- "borderColor": "#6C6F89",
72
- },
65
+ "&:hover $check $box": Object {
66
+ "boxShadow": "inset 0 0 0 1px #6C6F89",
73
67
  },
74
- "alignItems": "start",
68
+ "alignItems": "flex-start",
75
69
  "boxSizing": "border-box",
76
70
  "cursor": "pointer",
77
71
  "display": "flex",
78
72
  "outline": "0",
79
- "paddingBottom": "8px",
80
- "paddingTop": "8px",
81
73
  },
82
74
  "disabled": Object {
83
- "&$active $check:after": Object {
84
- "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJCQkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgoJCTxwYXRoIGZpbGw9IiM4REE1REEiIGQ9Ik0xOC4zLDcuM2wxLjQsMS40bC04LjcsOWMtMC40LDAuNC0xLDAuNC0xLjQsMC4xbC00LjMtMy42bDEuMy0xLjVsMy42LDNDMTAuMiwxNS42LDE4LjMsNy4zLDE4LjMsNy4zeiIvPgoJCTwvc3ZnPg==)",
75
+ "& $check $box": Object {
76
+ "background": "#EDEDF1",
77
+ "boxShadow": "inset 0 0 0 1px #D3D4DC",
85
78
  },
86
79
  "&$active, &$undetermined": Object {
87
- "& $check:before": Object {
80
+ "& $check $box": Object {
88
81
  "background": "hsl(221 91.2% 35.7% / 0.1)",
89
- "borderColor": "rgba(255,255,255,0.2)",
90
- },
91
- },
92
- "&$undetermined $check:after": Object {
93
- "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgICAgICB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI0IDI0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiAgICAgICAgPHBvbHlnb24gcG9pbnRzPSI1LjMsMTMuMyA1LjMsMTAuNyAxOC43LDEwLjcgMTguNywxMy4zICIgZmlsbD0iIzhEQTVEQSIgLz4KICAgICAgICA8L3N2Zz4=)",
94
- },
95
- "&:not($active), &:not($undetermined)": Object {
96
- "& $check:before": Object {
97
- "background": "#EDEDF1",
98
- "borderColor": "#D3D4DC",
82
+ "boxShadow": "inset 0 0 0 1px rgba(255,255,255,0.2)",
99
83
  },
100
84
  },
101
85
  "pointerEvents": "none",
102
86
  },
87
+ "icon": Object {
88
+ "gridColumnStart": 1,
89
+ "gridRowStart": 1,
90
+ "margin": 2,
91
+ },
103
92
  "label": Object {
104
93
  "cursor": "pointer",
105
- "flex": "1",
106
- "float": "left",
107
- "marginLeft": "8px",
94
+ "flex": 1,
95
+ "marginLeft": "12px",
96
+ },
97
+ "labelWrap": Object {
98
+ "alignItems": "center",
99
+ "display": "flex",
100
+ "flex": 1,
101
+ "minHeight": 48,
102
+ "overflow": "hidden",
103
+ "paddingBottom": "4px",
104
+ "paddingTop": "4px",
108
105
  },
109
106
  "overflow": Object {
110
107
  "overflow": "hidden",
@@ -112,18 +109,13 @@ Object {
112
109
  "whiteSpace": "nowrap",
113
110
  },
114
111
  "right": Object {
115
- "float": "right",
116
112
  "marginLeft": "8px",
117
113
  "pointerEvents": "none",
118
114
  },
119
115
  "undetermined": Object {
120
- "& $check:after": Object {
121
- "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgICAgICB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI0IDI0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiAgICAgICAgPHBvbHlnb24gcG9pbnRzPSI1LjMsMTMuMyA1LjMsMTAuNyAxOC43LDEwLjcgMTguNywxMy4zICIgZmlsbD0iI2ZmZiIgLz4KICAgICAgICA8L3N2Zz4=)",
122
- "marginTop": 0,
123
- },
124
- "& $check:before": Object {
116
+ "& $check $box": Object {
125
117
  "background": "#0059CD",
126
- "borderColor": "rgba(255,255,255,0.2)",
118
+ "boxShadow": "inset 0 0 0 1px rgba(255,255,255,0.2)",
127
119
  },
128
120
  },
129
121
  }
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
- var _icons = _interopRequireDefault(require("../subatomic/icons"));
9
-
10
8
  var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
11
9
 
12
10
  var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
@@ -17,15 +15,16 @@ var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"
17
15
 
18
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
17
 
20
- var checkbox = _colors["default"].checkbox,
21
- icon = _colors["default"].icon;
18
+ var checkbox = _colors["default"].checkbox;
19
+ var transition = 'all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s';
20
+ var contentHeight = 48;
21
+ var checkboxWidth = 52;
22
+ var checkSize = 20;
22
23
  var _default = {
23
24
  cont: {
24
- paddingTop: _spacing["default"]['size-2'],
25
- paddingBottom: _spacing["default"]['size-2'],
26
25
  boxSizing: 'border-box',
27
26
  display: 'flex',
28
- alignItems: 'start',
27
+ alignItems: 'flex-start',
29
28
  cursor: 'pointer',
30
29
  outline: '0',
31
30
  '&:after': {
@@ -33,105 +32,99 @@ var _default = {
33
32
  display: 'table',
34
33
  clear: 'both'
35
34
  },
36
- '&:focus $check:before': {
37
- boxShadow: _shadows["default"]['focus-bright-blue'],
38
- borderWidth: 1
35
+ '&:focus-visible $check': {
36
+ boxShadow: _shadows["default"]['focus-bright-blue']
39
37
  },
40
- '&$active, &$undetermined': {
41
- '&:hover $check:before, &:active $check:before': {
42
- background: checkbox['selected']['bg']['hover']
43
- }
38
+ '&:hover $check $box': {
39
+ boxShadow: "inset 0 0 0 1px ".concat(checkbox.unselected.border.hover)
40
+ },
41
+ '&:active $check $box': {
42
+ boxShadow: "inset 0 0 0 2px ".concat(checkbox.unselected.border.hover)
44
43
  },
45
- '&:not($active), &:not($undetermined)': {
46
- '&:hover $check:before, &:active $check:before': {
47
- borderColor: checkbox['unselected']['border']['hover']
44
+ '&$active, &$undetermined': {
45
+ '&:hover $check $box': {
46
+ boxShadow: "inset 0 0 0 1px ".concat(checkbox.selected.border["default"]),
47
+ background: checkbox.selected.bg.hover
48
48
  },
49
- '&:active $check:before': {
50
- borderWidth: 2
49
+ '&:active $check $box': {
50
+ boxShadow: "inset 0 0 0 2px ".concat(checkbox.selected.border["default"]),
51
+ background: checkbox.selected.bg.hover
51
52
  }
52
53
  }
53
54
  },
55
+ checkWrap: {
56
+ width: checkboxWidth,
57
+ height: contentHeight,
58
+ display: 'flex',
59
+ alignItems: 'center',
60
+ justifyContent: 'center',
61
+ flexShrink: 0
62
+ },
54
63
  check: {
55
- width: _spacing["default"]['size-5'],
56
- height: _spacing["default"]['size-5'],
57
- position: 'relative',
58
- '&:before': {
59
- content: '""',
60
- boxSizing: 'border-box',
61
- width: 20,
62
- height: 20,
63
- borderRadius: _borderRadius["default"]['br-xs'],
64
- position: 'absolute',
65
- top: '50%',
66
- left: '50%',
67
- transform: 'translate(-50%, -50%)',
68
- border: "1px solid ".concat(checkbox['unselected']['border']['default']),
69
- background: checkbox['unselected']['bg']['default'],
70
- transition: '0.3s all'
71
- },
72
- '&:after': {
73
- content: '""',
74
- boxSizing: 'border-box',
75
- width: 20,
76
- height: 20,
77
- marginTop: -1,
78
- position: 'absolute',
79
- top: '50%',
80
- left: '50%',
81
- transform: 'translate(-50%, -50%)',
82
- transition: '0.3s all',
83
- background: 'transparent'
84
- }
64
+ width: checkSize,
65
+ height: checkSize,
66
+ borderRadius: _borderRadius["default"]['br-xs'],
67
+ transition: transition,
68
+ display: 'grid',
69
+ alignItems: 'center',
70
+ justifyContent: 'center'
71
+ },
72
+ box: {
73
+ width: checkSize,
74
+ height: checkSize,
75
+ borderRadius: _borderRadius["default"]['br-xs'],
76
+ boxShadow: "inset 0 0 0 1px ".concat(checkbox.unselected.border["default"]),
77
+ background: checkbox['unselected']['bg']['default'],
78
+ transition: transition,
79
+ gridRowStart: 1,
80
+ gridColumnStart: 1
81
+ },
82
+ icon: {
83
+ gridRowStart: 1,
84
+ gridColumnStart: 1,
85
+ margin: 2
85
86
  },
86
87
  active: {
87
- '& $check:after': {
88
- background: _icons["default"].base(_icons["default"].check.icon([icon['inverse']['default']]))
89
- },
90
- '& $check:before': {
91
- borderColor: checkbox['selected']['border']['default'],
92
- background: checkbox['selected']['bg']['default']
88
+ '& $check $box': {
89
+ boxShadow: "inset 0 0 0 1px ".concat(checkbox.selected.border["default"]),
90
+ background: checkbox.selected.bg["default"]
93
91
  }
94
92
  },
95
93
  undetermined: {
96
- '& $check:before': {
97
- borderColor: checkbox['selected']['border']['default'],
98
- background: checkbox['selected']['bg']['default']
99
- },
100
- '& $check:after': {
101
- background: _icons["default"].base(_icons["default"].minus.icon([icon['inverse']['default']])),
102
- marginTop: 0
94
+ '& $check $box': {
95
+ boxShadow: "inset 0 0 0 1px ".concat(checkbox.selected.border["default"]),
96
+ background: checkbox.selected.bg["default"]
103
97
  }
104
98
  },
105
99
  disabled: {
106
100
  pointerEvents: 'none',
107
- '&$active, &$undetermined': {
108
- '& $check:before': {
109
- borderColor: checkbox['selected']['border']['default'],
110
- background: checkbox['selected']['bg']['disabled']
111
- }
112
- },
113
- '&$undetermined $check:after': {
114
- background: _icons["default"].base(_icons["default"].minus.icon([icon['brand']['disabled']]))
101
+ '& $check $box': {
102
+ boxShadow: "inset 0 0 0 1px ".concat(checkbox.unselected.border["default"]),
103
+ background: checkbox.unselected.bg.disabled
115
104
  },
116
- '&$active $check:after': {
117
- background: _icons["default"].base(_icons["default"].check.icon([icon['brand']['disabled']]))
118
- },
119
- '&:not($active), &:not($undetermined)': {
120
- '& $check:before': {
121
- borderColor: checkbox['unselected']['border']['default'],
122
- background: checkbox['unselected']['bg']['disabled']
105
+ '&$active, &$undetermined': {
106
+ '& $check $box': {
107
+ boxShadow: "inset 0 0 0 1px ".concat(checkbox.selected.border["default"]),
108
+ background: checkbox.selected.bg.disabled
123
109
  }
124
110
  }
125
111
  },
112
+ labelWrap: {
113
+ minHeight: contentHeight,
114
+ display: 'flex',
115
+ alignItems: 'center',
116
+ paddingTop: _spacing["default"]['size-1'],
117
+ paddingBottom: _spacing["default"]['size-1'],
118
+ overflow: 'hidden',
119
+ flex: 1
120
+ },
126
121
  label: {
127
- marginLeft: _spacing["default"]['size-2'],
122
+ marginLeft: _spacing["default"]['size-3'],
128
123
  cursor: 'pointer',
129
- "float": 'left',
130
- flex: '1'
124
+ flex: 1
131
125
  },
132
126
  right: {
133
127
  marginLeft: _spacing["default"]['size-2'],
134
- "float": 'right',
135
128
  pointerEvents: 'none'
136
129
  },
137
130
  overflow: {
@@ -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.radio,
123
- id: option.trk
124
- }), option.label && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
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
  }]);