@occmundial/occ-atomic 2.0.0-beta.14 → 2.0.0-beta.15

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.0.0-beta.15](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.14...v2.0.0-beta.15) (2024-05-10)
2
+
3
+
4
+ ### Features
5
+
6
+ * Updated radio styles and documentation ([2c39496](https://github.com/occmundial/occ-atomic/commit/2c39496186092fe20434ce4a030c28e42cebff91))
7
+
1
8
  # [2.0.0-beta.14](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.13...v2.0.0-beta.14) (2024-05-07)
2
9
 
3
10
 
@@ -94,6 +94,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
94
94
  return /*#__PURE__*/_react["default"].createElement("div", _extends({
95
95
  id: option.trk,
96
96
  key: option.value,
97
+ tabIndex: -1,
97
98
  "data-testid": option.testId
98
99
  }, option.testId && {
99
100
  'data-value': selected == option.value ? 1 : 0
@@ -111,7 +112,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
111
112
  className: "".concat(classes.label).concat(textOverflow ? " ".concat(classes.overflow) : '')
112
113
  }, option.label), option.right && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
113
114
  tag: "label",
114
- mid: true,
115
+ corpSecondary: true,
115
116
  className: classes.right
116
117
  }, option.right));
117
118
  }));
@@ -147,8 +148,14 @@ Radio.propTypes = {
147
148
 
148
149
  /** Use this prop to overflow the text of the label, adding '...' and the end. */
149
150
  textOverflow: _propTypes["default"].bool,
151
+
152
+ /** Id of the component */
150
153
  id: _propTypes["default"].string,
154
+
155
+ /** Adds class(es) to each option container */
151
156
  className: _propTypes["default"].string,
157
+
158
+ /** Adds style(s) to each option container */
152
159
  style: _propTypes["default"].object
153
160
  };
154
161
  var _default = Radio;
@@ -5,39 +5,92 @@ exports[`Radio matches the snapshot 1`] = `ShallowWrapper {}`;
5
5
  exports[`Radio styles matches the snapshot 1`] = `
6
6
  Object {
7
7
  "active": Object {
8
- "& $radio:after": Object {
9
- "background": Array [
10
- "#083cae",
11
- "!important",
12
- ],
8
+ "& $radio": Object {
9
+ "&:after": Object {
10
+ "background": "#0059CD",
11
+ },
12
+ "&:before": Object {
13
+ "borderColor": "#0059CD",
14
+ "borderWidth": 2,
15
+ },
13
16
  },
14
17
  },
15
18
  "cont": Object {
16
- "&:after": Object {
17
- "clear": "both",
18
- "content": "\\"\\"",
19
- "display": "table",
19
+ "&$active": Object {
20
+ "&:active": Object {
21
+ "& $radio:after": Object {
22
+ "background": "#0047A5",
23
+ },
24
+ "& $radio:before": Object {
25
+ "borderColor": "#0047A5",
26
+ "borderWidth": "3px",
27
+ "boxShadow": "initial",
28
+ },
29
+ },
30
+ "&:focus $radio:before": Object {
31
+ "borderColor": "#0059CD",
32
+ "boxShadow": undefined,
33
+ },
34
+ "&:hover": Object {
35
+ "& $radio:after": Object {
36
+ "background": "#0047A5",
37
+ },
38
+ "& $radio:before": Object {
39
+ "borderColor": "#0047A5",
40
+ "boxShadow": "initial",
41
+ },
42
+ },
20
43
  },
21
- "&:hover $radio:after": Object {
22
- "background": "#dddddd",
44
+ "&:not($active)": Object {
45
+ "&:active $radio:before": Object {
46
+ "borderColor": "#6C6F89",
47
+ "borderWidth": "2px",
48
+ "boxShadow": "initial",
49
+ },
50
+ "&:focus $radio:before": Object {
51
+ "borderColor": "#D3D4DC",
52
+ "boxShadow": undefined,
53
+ },
54
+ "&:hover $radio:before": Object {
55
+ "borderColor": "#6C6F89",
56
+ "boxShadow": "initial",
57
+ },
23
58
  },
24
59
  "alignItems": "start",
25
60
  "boxSizing": "border-box",
26
61
  "cursor": "pointer",
27
62
  "display": "flex",
28
63
  "outline": "0",
29
- "paddingBottom": 8,
30
- "paddingTop": 8,
64
+ "paddingBottom": "8px",
65
+ "paddingTop": "8px",
31
66
  },
32
67
  "disabled": Object {
33
- "opacity": 0.4,
68
+ "& :not($radio)": Object {
69
+ "opacity": 0.4,
70
+ },
71
+ "&$active": Object {
72
+ "& $radio:after": Object {
73
+ "background": "#8DA5DA",
74
+ },
75
+ "& $radio:before": Object {
76
+ "borderColor": "#8DA5DA",
77
+ },
78
+ },
79
+ "&:not($active)": Object {
80
+ "& $radio:after": Object {
81
+ "background": "#EDEDF1",
82
+ },
83
+ "& $radio:before": Object {
84
+ "background": "#EDEDF1",
85
+ },
86
+ },
34
87
  "pointerEvents": "none",
35
88
  },
36
89
  "label": Object {
37
90
  "cursor": "pointer",
38
91
  "flex": "1",
39
92
  "float": "left",
40
- "marginLeft": 8,
93
+ "marginLeft": "8px",
41
94
  },
42
95
  "overflow": Object {
43
96
  "overflow": "hidden",
@@ -46,36 +99,38 @@ Object {
46
99
  },
47
100
  "radio": Object {
48
101
  "&:after": Object {
49
- "background": "transparent",
102
+ "background": "#fff",
50
103
  "borderRadius": "50%",
104
+ "boxSizing": "border-box",
51
105
  "content": "\\"\\"",
52
- "height": 6,
106
+ "height": 10,
53
107
  "left": "50%",
54
108
  "position": "absolute",
55
109
  "top": "50%",
56
110
  "transform": "translate(-50%, -50%)",
57
111
  "transition": "0.3s all",
58
- "width": 6,
112
+ "width": 10,
59
113
  },
60
114
  "&:before": Object {
61
- "background": "#ffffff",
62
- "border": "1px solid #dddddd",
115
+ "background": "#fff",
116
+ "border": "1px solid #D3D4DC",
63
117
  "borderRadius": "50%",
118
+ "boxSizing": "border-box",
64
119
  "content": "\\"\\"",
65
- "height": 16,
120
+ "height": 20,
66
121
  "left": "50%",
67
122
  "position": "absolute",
68
123
  "top": "50%",
69
124
  "transform": "translate(-50%, -50%)",
70
- "width": 16,
125
+ "width": 20,
71
126
  },
72
- "height": 24,
127
+ "height": "24px",
73
128
  "position": "relative",
74
- "width": 24,
129
+ "width": "24px",
75
130
  },
76
131
  "right": Object {
77
132
  "float": "right",
78
- "marginLeft": 8,
133
+ "marginLeft": "8px",
79
134
  },
80
135
  }
81
136
  `;
@@ -5,76 +5,135 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
- var _colors = _interopRequireDefault(require("../subatomic/colors"));
8
+ var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
9
9
 
10
- var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
10
+ var _colors = _interopRequireDefault(require("../tokens/colors.json"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
13
 
14
+ var radio = _colors["default"].radio;
14
15
  var _default = {
15
16
  cont: {
16
- paddingTop: _spacing["default"].tiny,
17
- paddingBottom: _spacing["default"].tiny,
17
+ paddingTop: _spacing["default"]['size-2'],
18
+ paddingBottom: _spacing["default"]['size-2'],
18
19
  boxSizing: 'border-box',
19
20
  display: 'flex',
20
21
  alignItems: 'start',
21
22
  cursor: 'pointer',
22
23
  outline: '0',
23
- '&:after': {
24
- content: '""',
25
- display: 'table',
26
- clear: 'both'
24
+ '&$active': {
25
+ '&:focus $radio:before': {
26
+ borderColor: radio['selected']['border']['default'],
27
+ boxShadow: _colors["default"]['focus-bright-blue']
28
+ },
29
+ '&:hover': {
30
+ '& $radio:before': {
31
+ borderColor: radio['selected']['border']['hover'],
32
+ boxShadow: 'initial'
33
+ },
34
+ '& $radio:after': {
35
+ background: radio['selected']['bg']['hover']
36
+ }
37
+ },
38
+ '&:active': {
39
+ '& $radio:before': {
40
+ borderColor: radio['selected']['border']['hover'],
41
+ borderWidth: '3px',
42
+ boxShadow: 'initial'
43
+ },
44
+ '& $radio:after': {
45
+ background: radio['selected']['bg']['hover']
46
+ }
47
+ }
27
48
  },
28
- '&:hover $radio:after': {
29
- background: _colors["default"].grey200
49
+ '&:not($active)': {
50
+ '&:focus $radio:before': {
51
+ borderColor: radio['unselected']['border']['default'],
52
+ boxShadow: _colors["default"]['focus-bright-blue']
53
+ },
54
+ '&:hover $radio:before': {
55
+ borderColor: radio['unselected']['border']['hover'],
56
+ boxShadow: 'initial'
57
+ },
58
+ '&:active $radio:before': {
59
+ borderColor: radio['unselected']['border']['hover'],
60
+ borderWidth: '2px',
61
+ boxShadow: 'initial'
62
+ }
30
63
  }
31
64
  },
32
65
  radio: {
33
- width: _spacing["default"].base,
34
- height: _spacing["default"].base,
66
+ width: _spacing["default"]['size-5'],
67
+ height: _spacing["default"]['size-5'],
35
68
  position: 'relative',
36
69
  '&:before': {
37
70
  content: '""',
38
- width: _spacing["default"].small,
39
- height: _spacing["default"].small,
71
+ boxSizing: 'border-box',
72
+ width: 20,
73
+ height: 20,
40
74
  borderRadius: '50%',
41
75
  position: 'absolute',
42
76
  top: '50%',
43
77
  left: '50%',
44
78
  transform: 'translate(-50%, -50%)',
45
- border: "1px solid ".concat(_colors["default"].grey200),
46
- background: _colors["default"].bgWhite
79
+ border: "1px solid ".concat(radio['unselected']['border']['default']),
80
+ background: radio['bg']['default']
47
81
  },
48
82
  '&:after': {
49
83
  content: '""',
50
- width: 6,
51
- height: 6,
84
+ boxSizing: 'border-box',
85
+ width: 10,
86
+ height: 10,
52
87
  borderRadius: '50%',
53
88
  position: 'absolute',
54
89
  top: '50%',
55
90
  left: '50%',
56
91
  transform: 'translate(-50%, -50%)',
57
92
  transition: '0.3s all',
58
- background: 'transparent'
93
+ background: radio['bg']['default']
59
94
  }
60
95
  },
61
96
  active: {
62
- '& $radio:after': {
63
- background: [_colors["default"].prim, '!important']
97
+ '& $radio': {
98
+ '&:before': {
99
+ borderWidth: 2,
100
+ borderColor: radio['selected']['border']['default']
101
+ },
102
+ '&:after': {
103
+ background: radio['selected']['bg']['default']
104
+ }
64
105
  }
65
106
  },
66
107
  disabled: {
67
- opacity: 0.4,
68
- pointerEvents: 'none'
108
+ pointerEvents: 'none',
109
+ '& :not($radio)': {
110
+ opacity: 0.4
111
+ },
112
+ '&$active': {
113
+ '& $radio:before': {
114
+ borderColor: radio['selected']['border']['disabled']
115
+ },
116
+ '& $radio:after': {
117
+ background: radio['selected']['bg']['disabled']
118
+ }
119
+ },
120
+ '&:not($active)': {
121
+ '& $radio:before': {
122
+ background: radio['bg']['disabled']
123
+ },
124
+ '& $radio:after': {
125
+ background: radio['bg']['disabled']
126
+ }
127
+ }
69
128
  },
70
129
  label: {
71
- marginLeft: _spacing["default"].tiny,
130
+ marginLeft: _spacing["default"]['size-2'],
72
131
  cursor: 'pointer',
73
132
  "float": 'left',
74
133
  flex: '1'
75
134
  },
76
135
  right: {
77
- marginLeft: _spacing["default"].tiny,
136
+ marginLeft: _spacing["default"]['size-2'],
78
137
  "float": 'right'
79
138
  },
80
139
  overflow: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@occmundial/occ-atomic",
3
- "version": "2.0.0-beta.14",
3
+ "version": "2.0.0-beta.15",
4
4
  "description": "Collection of shareable styled React components for OCC applications.",
5
5
  "homepage": "http://occmundial.github.io/occ-atomic",
6
6
  "main": "build/index.js",