@occmundial/occ-atomic 2.0.0 → 3.0.0-beta.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,70 +5,100 @@ 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
+
12
+ var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
13
+
14
+ var _fonts = _interopRequireDefault(require("../tokens/fonts.json"));
15
+
16
+ var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"));
17
+
18
+ var _styles = require("../Text/styles");
11
19
 
12
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
21
 
14
- var gutter = _spacing["default"].gutter,
15
- tiny = _spacing["default"].tiny,
16
- small = _spacing["default"].small,
17
- base = _spacing["default"].base,
18
- xTiny = _spacing["default"].xTiny;
19
- var primLighter = _colors["default"].primLighter,
20
- grey50 = _colors["default"].grey50,
21
- grey200 = _colors["default"].grey200,
22
- bgWhite = _colors["default"].bgWhite,
23
- textLink = _colors["default"].textLink;
24
22
  var _default = {
25
23
  block: {
26
- background: bgWhite,
27
- border: "1px solid ".concat(grey200),
28
- borderRadius: xTiny,
29
- overflow: 'hidden'
24
+ background: _colors["default"]['text-field'].bg["default"],
25
+ border: "1px solid ".concat(_colors["default"]['text-field'].border["default"]),
26
+ borderRadius: _borderRadius["default"]['br-xs'],
27
+ overflow: 'hidden',
28
+ padding: _spacing["default"]['size-2'],
29
+ boxShadow: _shadows["default"]['elevation-elevation-4']
30
+ },
31
+ text: {
32
+ margin: 0
30
33
  },
31
34
  group: {
32
- padding: [small, small, xTiny]
35
+ padding: [_spacing["default"]['size-2'], _spacing["default"]['size-4'], 0],
36
+ display: 'inline-block'
37
+ },
38
+ groupText: {
39
+ font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-label'])
33
40
  },
34
41
  item: {
35
42
  display: 'flex',
36
43
  justifyContent: 'space-between',
37
- padding: [tiny, small],
44
+ alignItems: 'center',
45
+ padding: [_spacing["default"]['size-3'], _spacing["default"]['size-4']],
38
46
  transition: '0.1s all',
47
+ borderRadius: _borderRadius["default"]['br-xs'],
39
48
  position: 'relative',
40
49
  '&:hover': {
41
- background: grey50
50
+ background: _colors["default"].dropdown.bg.hover
51
+ },
52
+ '&:active, &:focus': {
53
+ background: _colors["default"].dropdown.bg.active,
54
+ '& > $rightText': {
55
+ color: _colors["default"].text.corp.primary
56
+ }
42
57
  }
43
58
  },
44
59
  itemPointer: {
45
60
  cursor: 'pointer'
46
61
  },
62
+ disabled: {
63
+ pointerEvents: 'none'
64
+ },
47
65
  right: {
48
- "float": 'right',
49
- transition: '0.1s all',
50
- marginLeft: small
66
+ marginLeft: _spacing["default"]['size-4']
67
+ },
68
+ rightText: {
69
+ font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-label']),
70
+ color: _colors["default"].text.corp.secondary
51
71
  },
52
72
  onFocus: {
53
- background: primLighter,
73
+ background: _colors["default"].dropdown.bg.active,
54
74
  '&:hover': {
55
- background: primLighter
75
+ background: _colors["default"].dropdown.bg.active
56
76
  }
57
77
  },
58
78
  icon: {
59
- marginRight: tiny,
60
- position: 'absolute',
61
- top: gutter
79
+ marginRight: _spacing["default"]['size-2']
62
80
  },
63
- iconText: {
81
+ mainText: {
64
82
  display: 'inline-block',
65
- marginLeft: base
83
+ font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-placeholder']),
84
+ color: _colors["default"].text.corp.primary
85
+ },
86
+ corpDisabled: {
87
+ color: _colors["default"].text.corp.disabled
66
88
  },
67
89
  extraText: {
68
- marginLeft: tiny
90
+ marginLeft: _spacing["default"]['size-1'],
91
+ display: 'inline-block',
92
+ font: (0, _styles.parseFontValue)(_fonts["default"]['heading-tag']),
93
+ color: _colors["default"].text.indigo.primary
94
+ },
95
+ highlighted: {
96
+ background: _colors["default"].bg.action.secondary["default"],
97
+ font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-placeholder'])
69
98
  },
70
- extraTextColor: {
71
- color: textLink
99
+ itemContainer: {
100
+ display: 'flex',
101
+ alignItems: 'center'
72
102
  }
73
103
  };
74
104
  exports["default"] = _default;
@@ -3,6 +3,7 @@
3
3
  exports[`FAB matches the snapshot 1`] = `
4
4
  <button
5
5
  className="Button-btn-0-1-28 Button-btn-0-1-1 Button-tertiary-0-1-23 Button-tertiary-0-1-6 fab Button-iconOnly-0-1-38 Button-iconOnly-0-1-18 Button-round-0-1-40 Button-round-0-1-20"
6
+ disabled={false}
6
7
  >
7
8
  <span
8
9
  className="Button-cont-0-1-29 Button-cont-0-1-2"
@@ -19,7 +19,7 @@ Object {
19
19
  "&$active": Object {
20
20
  "&:active": Object {
21
21
  "& $radio:after": Object {
22
- "background": "#0047A5",
22
+ "background": "#083CAE",
23
23
  },
24
24
  "& $radio:before": Object {
25
25
  "borderColor": "#0047A5",
@@ -29,11 +29,11 @@ Object {
29
29
  },
30
30
  "&:focus $radio:before": Object {
31
31
  "borderColor": "#0059CD",
32
- "boxShadow": undefined,
32
+ "boxShadow": "0 0 0 8px rgba(0,110,255,0.3)",
33
33
  },
34
34
  "&:hover": Object {
35
35
  "& $radio:after": Object {
36
- "background": "#0047A5",
36
+ "background": "#083CAE",
37
37
  },
38
38
  "& $radio:before": Object {
39
39
  "borderColor": "#0047A5",
@@ -49,7 +49,7 @@ Object {
49
49
  },
50
50
  "&:focus $radio:before": Object {
51
51
  "borderColor": "#D3D4DC",
52
- "boxShadow": undefined,
52
+ "boxShadow": "0 0 0 8px rgba(0,110,255,0.3)",
53
53
  },
54
54
  "&:hover $radio:before": Object {
55
55
  "borderColor": "#6C6F89",
@@ -9,6 +9,8 @@ var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
9
9
 
10
10
  var _colors = _interopRequireDefault(require("../tokens/colors.json"));
11
11
 
12
+ var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
15
 
14
16
  var radio = _colors["default"].radio;
@@ -24,7 +26,7 @@ var _default = {
24
26
  '&$active': {
25
27
  '&:focus $radio:before': {
26
28
  borderColor: radio['selected']['border']['default'],
27
- boxShadow: _colors["default"]['focus-bright-blue']
29
+ boxShadow: _shadows["default"]['focus-bright-blue']
28
30
  },
29
31
  '&:hover': {
30
32
  '& $radio:before': {
@@ -49,7 +51,7 @@ var _default = {
49
51
  '&:not($active)': {
50
52
  '&:focus $radio:before': {
51
53
  borderColor: radio['unselected']['border']['default'],
52
- boxShadow: _colors["default"]['focus-bright-blue']
54
+ boxShadow: _shadows["default"]['focus-bright-blue']
53
55
  },
54
56
  '&:hover $radio:before': {
55
57
  borderColor: radio['unselected']['border']['hover'],
@@ -95,6 +95,7 @@ var SlideToggle = /*#__PURE__*/function (_React$Component) {
95
95
  testId = _this$props2.testId;
96
96
  return /*#__PURE__*/_react["default"].createElement("div", {
97
97
  id: id,
98
+ tabIndex: -1,
98
99
  className: "".concat(classes.cont).concat(disabled ? " ".concat(classes.disabled) : '').concat(className ? " ".concat(className) : ''),
99
100
  style: style
100
101
  }, /*#__PURE__*/_react["default"].createElement("div", _extends({
@@ -6,38 +6,57 @@ exports[`SlideToggle styles matches the snapshot 1`] = `
6
6
  Object {
7
7
  "checked": Object {
8
8
  "& $icon": Object {
9
- "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJCQkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgoJCTxwYXRoIGZpbGw9IiMwODNjYWUiIGQ9Ik0xOC4zLDcuM2wxLjQsMS40bC04LjcsOWMtMC40LDAuNC0xLDAuNC0xLjQsMC4xbC00LjMtMy42bDEuMy0xLjVsMy42LDNDMTAuMiwxNS42LDE4LjMsNy4zLDE4LjMsNy4zeiIvPgoJCTwvc3ZnPg==)",
9
+ "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJCQkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgoJCTxwYXRoIGZpbGw9IiMwMDZFRkYiIGQ9Ik0xOC4zLDcuM2wxLjQsMS40bC04LjcsOWMtMC40LDAuNC0xLDAuNC0xLjQsMC4xbC00LjMtMy42bDEuMy0xLjVsMy42LDNDMTAuMiwxNS42LDE4LjMsNy4zLDE4LjMsNy4zeiIvPgoJCTwvc3ZnPg==)",
10
10
  },
11
11
  "& $slider": Object {
12
12
  "left": 16,
13
13
  },
14
- "background": "#083cae",
14
+ "background": "#0059CD",
15
15
  },
16
16
  "cont": Object {
17
+ "&:focus $switch$checked": Object {
18
+ "background": "#0059CD",
19
+ "boxShadow": "0 0 0 8px rgba(0,110,255,0.3)",
20
+ },
21
+ "&:focus $switch:not($checked)": Object {
22
+ "background": "#E9EEF8",
23
+ "boxShadow": "0 0 0 8px hsl(221 91.2% 35.7% / 0.3)",
24
+ },
25
+ "&:hover $switch$checked, &:active $switch$checked": Object {
26
+ "background": "#083CAE",
27
+ },
28
+ "&:hover $switch:not($checked), &:active $switch:not($checked)": Object {
29
+ "background": "#CAD5EE",
30
+ },
17
31
  "alignItems": "start",
18
32
  "boxSizing": "border-box",
19
33
  "cursor": "pointer",
20
34
  "display": "flex",
21
35
  "outline": 0,
22
- "paddingBottom": 8,
23
- "paddingTop": 8,
36
+ "paddingBottom": "8px",
37
+ "paddingTop": "8px",
24
38
  },
25
39
  "disabled": Object {
26
- "opacity": 0.4,
40
+ "& $icon": Object {
41
+ "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgIAkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgogICAgICAgIDxwYXRoIGZpbGw9IiNEM0Q0REMiIGQ9Ik0xMi4xLDEwLjhsNC42LTQuNkwxOCw3LjRMMTMuNCwxMmw0LjYsNC42TDE2LjcsMThsLTQuNi00LjZMNy40LDE4bC0xLjMtMS4zbDQuNi00LjZMNi4yLDcuNGwxLjMtMS4zTDEyLjEsMTAuOHoiLz4KICAgICAgICA8L3N2Zz4=)",
42
+ },
43
+ "& $switch": Object {
44
+ "background": "#EDEDF1",
45
+ },
27
46
  "pointerEvents": "none",
28
47
  },
29
48
  "icon": Object {
30
- "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgIAkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgogICAgICAgIDxwYXRoIGZpbGw9IiNhYWFhYWEiIGQ9Ik0xMi4xLDEwLjhsNC42LTQuNkwxOCw3LjRMMTMuNCwxMmw0LjYsNC42TDE2LjcsMThsLTQuNi00LjZMNy40LDE4bC0xLjMtMS4zbDQuNi00LjZMNi4yLDcuNGwxLjMtMS4zTDEyLjEsMTAuOHoiLz4KICAgICAgICA8L3N2Zz4=)",
49
+ "background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgIAkgdmlld0JveD0iMCAwIDI0IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNCAyNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgogICAgICAgIDxwYXRoIGZpbGw9IiM4REE1REEiIGQ9Ik0xMi4xLDEwLjhsNC42LTQuNkwxOCw3LjRMMTMuNCwxMmw0LjYsNC42TDE2LjcsMThsLTQuNi00LjZMNy40LDE4bC0xLjMtMS4zbDQuNi00LjZMNi4yLDcuNGwxLjMtMS4zTDEyLjEsMTAuOHoiLz4KICAgICAgICA8L3N2Zz4=)",
31
50
  "display": "block",
32
51
  "height": "100%",
33
52
  "transition": "0.3s all",
34
53
  "width": "100%",
35
54
  },
36
55
  "label": Object {
37
- "marginLeft": 8,
56
+ "marginLeft": "8px",
38
57
  },
39
58
  "slider": Object {
40
- "background": "#ffffff",
59
+ "background": "#fff",
41
60
  "borderRadius": "50%",
42
61
  "cursor": "pointer",
43
62
  "height": 20,
@@ -48,10 +67,10 @@ Object {
48
67
  "width": 20,
49
68
  },
50
69
  "switch": Object {
51
- "background": "#dddddd",
70
+ "background": "#E9EEF8",
52
71
  "borderRadius": 34,
53
72
  "display": "inline-block",
54
- "height": 24,
73
+ "height": "24px",
55
74
  "position": "relative",
56
75
  "transition": "0.3s all",
57
76
  "width": 38,
@@ -5,40 +5,58 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
- var _colors = _interopRequireDefault(require("../subatomic/colors"));
8
+ var _icons = _interopRequireDefault(require("../subatomic/icons"));
9
9
 
10
- var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
10
+ var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
11
11
 
12
- var _icons = _interopRequireDefault(require("../subatomic/icons"));
12
+ var _colors = _interopRequireDefault(require("../tokens/colors.json"));
13
+
14
+ var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
17
 
18
+ var toggle = _colors["default"]["switch"],
19
+ icon = _colors["default"].icon;
16
20
  var _default = {
17
21
  cont: {
18
- paddingTop: _spacing["default"].tiny,
19
- paddingBottom: _spacing["default"].tiny,
22
+ paddingTop: _spacing["default"]['size-2'],
23
+ paddingBottom: _spacing["default"]['size-2'],
20
24
  boxSizing: 'border-box',
21
25
  display: 'flex',
22
26
  alignItems: 'start',
23
27
  cursor: 'pointer',
24
- outline: 0
28
+ outline: 0,
29
+ '&:hover $switch$checked, &:active $switch$checked': {
30
+ background: toggle['selected']['bg']['hover']
31
+ },
32
+ '&:focus $switch$checked': {
33
+ boxShadow: _shadows["default"]['focus-bright-blue'],
34
+ background: toggle['selected']['bg']['default']
35
+ },
36
+ '&:hover $switch:not($checked), &:active $switch:not($checked)': {
37
+ background: toggle['unselected']['bg']['hover']
38
+ },
39
+ '&:focus $switch:not($checked)': {
40
+ background: toggle['unselected']['bg']['default'],
41
+ boxShadow: _shadows["default"]['focus-indigo']
42
+ }
25
43
  },
26
44
  "switch": {
27
45
  position: 'relative',
28
46
  display: 'inline-block',
29
47
  width: 38,
30
- height: _spacing["default"].base,
31
- background: _colors["default"].grey200,
48
+ height: _spacing["default"]['size-5'],
49
+ background: toggle['unselected']['bg']['default'],
32
50
  borderRadius: 34,
33
51
  transition: '0.3s all'
34
52
  },
35
53
  checked: {
36
- background: _colors["default"].prim,
54
+ background: toggle['selected']['bg']['default'],
37
55
  '& $slider': {
38
56
  left: 16
39
57
  },
40
58
  '& $icon': {
41
- background: _icons["default"].base(_icons["default"].check.icon([_colors["default"].prim]))
59
+ background: _icons["default"].base(_icons["default"].check.icon([icon.brand.bold]))
42
60
  }
43
61
  },
44
62
  slider: {
@@ -49,22 +67,27 @@ var _default = {
49
67
  width: 20,
50
68
  height: 20,
51
69
  borderRadius: '50%',
52
- background: _colors["default"].bgWhite,
70
+ background: toggle['bg']['default'],
53
71
  transition: '0.3s all'
54
72
  },
55
73
  icon: {
56
74
  width: '100%',
57
75
  height: '100%',
58
76
  display: 'block',
59
- background: _icons["default"].base(_icons["default"].cross.icon([_colors["default"].grey400])),
77
+ background: _icons["default"].base(_icons["default"].cross.icon([icon.brand.disabled])),
60
78
  transition: '0.3s all'
61
79
  },
62
80
  disabled: {
63
- opacity: 0.4,
81
+ '& $switch': {
82
+ background: toggle['bg']['disabled']
83
+ },
84
+ '& $icon': {
85
+ background: _icons["default"].base(_icons["default"].cross.icon([icon["default"].disabled]))
86
+ },
64
87
  pointerEvents: 'none'
65
88
  },
66
89
  label: {
67
- marginLeft: _spacing["default"].tiny
90
+ marginLeft: _spacing["default"]['size-2']
68
91
  }
69
92
  };
70
93
  exports["default"] = _default;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports["default"] = exports.parseFontValue = void 0;
7
7
 
8
8
  var _colors = _interopRequireDefault(require("../subatomic/colors"));
9
9
 
@@ -46,6 +46,7 @@ var parseFontValue = function parseFontValue(font) {
46
46
  return "".concat(font.fontWeight, " ").concat(font.fontSize, "/").concat(font.lineHeight, " ").concat(_fonts["default"].body);
47
47
  };
48
48
 
49
+ exports.parseFontValue = parseFontValue;
49
50
  var _default = {
50
51
  text: {
51
52
  letterSpacing: 0,