@occmundial/occ-atomic 3.0.0-beta.5 → 3.0.0-beta.51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/CHANGELOG.md +414 -0
  2. package/build/Avatar/Avatar.js +69 -21
  3. package/build/Avatar/Avatar.test.js +15 -8
  4. package/build/Avatar/AvatarContent/AvatarContent.js +61 -21
  5. package/build/Avatar/AvatarContent/AvatarContent.test.js +4 -18
  6. package/build/Avatar/AvatarContent/__snapshots__/AvatarContent.test.js.snap +75 -15
  7. package/build/Avatar/AvatarContent/styles.js +88 -21
  8. package/build/Avatar/__snapshots__/Avatar.test.js.snap +11 -2
  9. package/build/Avatar/styles.js +18 -7
  10. package/build/Banner/Banner.js +30 -40
  11. package/build/Banner/Banner.test.js +64 -17
  12. package/build/Banner/__snapshots__/Banner.test.js.snap +0 -28
  13. package/build/Banner/index.js +1 -6
  14. package/build/Button/Button.js +1 -1
  15. package/build/Button/Button.test.js +0 -11
  16. package/build/Button/__snapshots__/Button.test.js.snap +54 -60
  17. package/build/Button/styles.js +42 -75
  18. package/build/Checkbox/Checkbox.js +48 -3
  19. package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +81 -49
  20. package/build/Checkbox/styles.js +91 -48
  21. package/build/Fab/__snapshots__/Fab.test.js.snap +2 -2
  22. package/build/Footer/Footer.js +63 -84
  23. package/build/Footer/List/List.js +89 -124
  24. package/build/Footer/List/styles.js +85 -31
  25. package/build/Footer/__snapshots__/Footer.test.js.snap +113 -57
  26. package/build/Footer/styles.js +119 -53
  27. package/build/Grid/Col/__snapshots__/Col.test.js.snap +16 -2
  28. package/build/Grid/Col/styles.js +12 -6
  29. package/build/Grid/Row/__snapshots__/Row.test.js.snap +18 -2
  30. package/build/Grid/Row/styles.js +15 -5
  31. package/build/Grid/styles.js +26 -9
  32. package/build/Modal/Modal.js +94 -66
  33. package/build/Modal/Modal.test.js +14 -7
  34. package/build/Modal/__snapshots__/Modal.test.js.snap +155 -100
  35. package/build/Modal/styles.js +165 -143
  36. package/build/Pager/Page/Page.js +8 -5
  37. package/build/Pager/Page/Page.test.js +13 -9
  38. package/build/Pager/Page/__snapshots__/Page.test.js.snap +34 -10
  39. package/build/Pager/Page/styles.js +48 -14
  40. package/build/Pager/Pager.js +139 -235
  41. package/build/Pager/Pager.test.js +81 -36
  42. package/build/Pager/__snapshots__/Pager.test.js.snap +3 -36
  43. package/build/Pager/styles.js +5 -40
  44. package/build/Pill/Choice/Choice.js +6 -4
  45. package/build/Pill/Choice/styles.js +13 -10
  46. package/build/Pill/Group/styles.js +5 -5
  47. package/build/Pill/Stack/Stack.js +2 -2
  48. package/build/Pill/Stack/styles.js +5 -8
  49. package/build/Placeholder/Placeholder.js +29 -12
  50. package/build/Placeholder/Placeholder.test.js +4 -4
  51. package/build/Placeholder/__snapshots__/Placeholder.test.js.snap +81 -38
  52. package/build/Placeholder/styles.js +86 -42
  53. package/build/Provider/usePrevious.js +1 -1
  54. package/build/Radio/Radio.js +42 -6
  55. package/build/Radio/__snapshots__/Radio.test.js.snap +81 -80
  56. package/build/Radio/styles.js +93 -85
  57. package/build/SlideDown/SlideDown.js +162 -169
  58. package/build/SlideDown/SlideDown.test.js +49 -44
  59. package/build/SlideDown/__snapshots__/SlideDown.test.js.snap +45 -13
  60. package/build/SlideDown/styles.js +52 -18
  61. package/build/SlideToggle/SlideToggle.js +38 -6
  62. package/build/SlideToggle/SlideToggle.test.js +2 -2
  63. package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +53 -37
  64. package/build/SlideToggle/styles.js +64 -45
  65. package/build/Tabs/Tab/Tab.js +73 -0
  66. package/build/Tabs/Tab/index.js +34 -0
  67. package/build/Tabs/Tab/index.test.js +132 -0
  68. package/build/Tabs/Tab/styles.js +74 -0
  69. package/build/Tabs/TabContent/TabContent.js +76 -0
  70. package/build/Tabs/TabContent/index.js +34 -0
  71. package/build/Tabs/TabContent/index.test.js +68 -0
  72. package/build/Tabs/TabContent/styles.js +23 -0
  73. package/build/Tabs/TabIndicator/TabIndicator.js +158 -0
  74. package/build/Tabs/TabIndicator/index.js +34 -0
  75. package/build/Tabs/TabIndicator/styles.js +24 -0
  76. package/build/Tabs/TabList/TabList.js +108 -0
  77. package/build/Tabs/TabList/index.js +34 -0
  78. package/build/{Pager/Break → Tabs/TabList}/styles.js +3 -2
  79. package/build/Tabs/Tabs.js +74 -0
  80. package/build/Tabs/context.js +94 -0
  81. package/build/Tabs/index.js +34 -0
  82. package/build/Tabs/index.test.js +157 -0
  83. package/build/Tabs/styles.js +19 -0
  84. package/build/Tag/Tag.js +2 -2
  85. package/build/Tag/__snapshots__/Tag.test.js.snap +40 -43
  86. package/build/Tag/styles.js +76 -82
  87. package/build/Text/Text.js +6 -3
  88. package/build/TextField/TextField.js +7 -6
  89. package/build/TextField/__snapshots__/TextField.test.js.snap +3 -0
  90. package/build/TextField/styles.js +3 -0
  91. package/build/Tip/Tip.js +62 -95
  92. package/build/Tip/Tip.test.js +29 -6
  93. package/build/Tip/TipText/index.js +32 -0
  94. package/build/Tip/__snapshots__/Tip.test.js.snap +127 -15
  95. package/build/Tip/styles.js +125 -31
  96. package/build/Toaster/Toast/Toast.js +76 -64
  97. package/build/Toaster/Toast/styles.js +118 -46
  98. package/build/Toaster/Toaster.js +3 -2
  99. package/build/Toaster/Toaster.test.js +5 -2
  100. package/build/Toaster/__snapshots__/Toaster.test.js.snap +1 -1
  101. package/build/Toaster/functions.js +4 -0
  102. package/build/Toaster/styles.js +3 -3
  103. package/build/Tooltip/Tooltip.js +73 -22
  104. package/build/Tooltip/__snapshots__/Tooltip.test.js.snap +22 -6
  105. package/build/Tooltip/styles.js +32 -10
  106. package/build/index.js +14 -1
  107. package/build/subatomic/grid.js +5 -5
  108. package/build/tokens/colors.json +35 -3
  109. package/package.json +4 -1
  110. package/build/Banner/styles.js +0 -41
  111. package/build/Pager/Break/Break.js +0 -27
  112. package/build/Pager/Break/Break.test.js +0 -53
  113. package/build/Pager/Break/__snapshots__/Break.test.js.snap +0 -13
  114. package/build/Pager/Break/index.js +0 -18
  115. /package/build/Button/{Loading.js → Loading/index.js} +0 -0
@@ -5,78 +5,144 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
- var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
8
+ var _colors = _interopRequireDefault(require("../tokens/colors.json"));
9
9
 
10
- var _colors = _interopRequireDefault(require("../subatomic/colors"));
10
+ var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
11
+
12
+ var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
13
+
14
+ var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"));
11
15
 
12
16
  var _grid = _interopRequireDefault(require("../subatomic/grid"));
13
17
 
18
+ var _fonts = _interopRequireDefault(require("../tokens/fonts.json"));
19
+
20
+ var _styles = require("../Text/styles");
21
+
22
+ var _footerContainer, _column, _listContainer;
23
+
14
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
25
 
16
26
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
27
 
18
28
  var _default = {
19
- footer: _defineProperty({
20
- backgroundColor: _colors["default"].bgGrey,
21
- padding: [_spacing["default"].base, 0, _spacing["default"].medium]
22
- }, "@media (min-width: ".concat(_grid["default"].md, "px)"), {
23
- padding: [_spacing["default"].medium, 0, _spacing["default"].medium]
24
- }),
25
- footerWithoutColumns: _defineProperty({
26
- backgroundColor: _colors["default"].bgGrey,
27
- padding: [0, 0, _spacing["default"].medium]
28
- }, "@media (min-width: ".concat(_grid["default"].md, "px)"), {
29
- padding: [0, 0, _spacing["default"].medium]
30
- }),
31
- column: {
32
- paddingLeft: _spacing["default"].gutter,
33
- paddingRight: _spacing["default"].gutter,
34
- paddingBottom: _spacing["default"].small
35
- },
36
- list: {
37
- '&:not(:first-child)': {
38
- marginLeft: _spacing["default"].small
39
- }
29
+ footer: {
30
+ backgroundColor: _colors["default"].bg.surface["default"],
31
+ borderTop: "1px solid ".concat(_colors["default"].border["default"].subtle),
32
+ padding: [_spacing["default"]['size-7'], 0]
40
33
  },
34
+ footerContainer: (_footerContainer = {
35
+ display: 'flex',
36
+ flexDirection: 'column',
37
+ rowGap: _spacing["default"]['size-5']
38
+ }, _defineProperty(_footerContainer, "@media (min-width: ".concat(_grid["default"].xs, "px)"), {
39
+ rowGap: _spacing["default"]['size-7']
40
+ }), _defineProperty(_footerContainer, "@media (min-width: ".concat(_grid["default"].md, "px)"), {
41
+ rowGap: _spacing["default"]['size-8']
42
+ }), _footerContainer),
43
+ column: (_column = {
44
+ display: 'flex',
45
+ flexDirection: 'column',
46
+ flexWrap: 'wrap'
47
+ }, _defineProperty(_column, "@media (min-width: ".concat(_grid["default"].xs, "px)"), {
48
+ flexDirection: 'row',
49
+ columnGap: _spacing["default"]['size-4'],
50
+ rowGap: _spacing["default"]['size-7']
51
+ }), _defineProperty(_column, "@media (min-width: ".concat(_grid["default"].md, "px)"), {
52
+ columnGap: _spacing["default"]['size-5'],
53
+ rowGap: 0
54
+ }), _column),
41
55
  link: {
42
- color: _colors["default"].grey600,
56
+ font: (0, _styles.parseFontValue)(_fonts["default"]['body-regular']),
57
+ color: _colors["default"].text.corp.secondary,
43
58
  textDecoration: 'none',
44
- cursor: 'pointer',
45
- '&:hover, &:focus, &:active': {
46
- color: _colors["default"].grey600
47
- }
48
- },
49
- listElement: {
50
- paddingLeft: _spacing["default"].small,
51
- paddingRight: _spacing["default"].small,
52
- position: 'relative',
53
- display: 'inline-block',
54
- '&:first-child': {
55
- paddingLeft: 0
59
+ transition: 'all cubic-bezier(0.25,0.46,0.45,0.94) 0.2s',
60
+ '&:hover': {
61
+ color: _colors["default"].text.corp.primary
56
62
  },
57
- '&:not(:last-child)': {
58
- '&::after': {
59
- content: '"|"',
60
- position: 'absolute',
61
- right: -2
62
- }
63
+ '&:focus-visible': {
64
+ color: _colors["default"].text.corp.primary,
65
+ boxShadow: _shadows["default"]['focus-corp'],
66
+ borderRadius: _borderRadius["default"]['br-xs'],
67
+ outline: 0
63
68
  }
64
69
  },
65
- mobileListElement: {
66
- paddingLeft: 0,
70
+ listElement: _defineProperty({
67
71
  display: 'block',
68
- paddingBottom: _spacing["default"].tiny
72
+ textAlign: 'center'
73
+ }, "@media (min-width: ".concat(_grid["default"].sm, "px)"), {
74
+ position: 'relative',
75
+ display: 'inline-block'
76
+ }),
77
+ listContainer: (_listContainer = {
78
+ flexBasis: '100%'
79
+ }, _defineProperty(_listContainer, "@media (min-width: ".concat(_grid["default"].xs, "px)"), {
80
+ flexBasis: "calc(50% - ".concat(_spacing["default"]['size-4'], ")")
81
+ }), _defineProperty(_listContainer, "@media (min-width: ".concat(_grid["default"].md, "px)"), {
82
+ flexBasis: "calc(25% - ".concat(_spacing["default"]['size-5'], ")")
83
+ }), _listContainer),
84
+ bottomSection: {
85
+ display: 'flex',
86
+ flexDirection: 'column',
87
+ rowGap: _spacing["default"]['size-7']
69
88
  },
70
- footerBottom: {
71
- paddingLeft: _spacing["default"].gutter,
72
- paddingRight: _spacing["default"].gutter
89
+ bottomLinksContainer: _defineProperty({
90
+ display: 'flex',
91
+ flexDirection: 'column',
92
+ justifyContent: 'center',
93
+ columnGap: _spacing["default"]['size-5'],
94
+ rowGap: _spacing["default"]['size-4']
95
+ }, "@media (min-width: ".concat(_grid["default"].sm, "px)"), {
96
+ flexDirection: 'row',
97
+ alignItems: 'stretch'
98
+ }),
99
+ linkDivider: _defineProperty({
100
+ width: 1,
101
+ margin: [_spacing["default"]['size-0'], 0],
102
+ backgroundColor: _colors["default"].border["default"].bold,
103
+ alignSelf: 'stretch',
104
+ display: 'none'
105
+ }, "@media (min-width: ".concat(_grid["default"].sm, "px)"), {
106
+ display: 'block'
107
+ }),
108
+ copyright: {
109
+ font: (0, _styles.parseFontValue)(_fonts["default"]['body-regular']),
110
+ color: _colors["default"].text.corp.secondary,
111
+ '& > p': {
112
+ margin: 0
113
+ }
73
114
  },
74
- bottomWrap: {
75
- paddingTop: _spacing["default"].base,
76
- borderTop: "1px solid ".concat(_colors["default"].grey200)
115
+ bottomContainer: _defineProperty({
116
+ display: 'flex',
117
+ flexDirection: 'column',
118
+ rowGap: _spacing["default"]['size-4']
119
+ }, "@media (min-width: ".concat(_grid["default"].sm, "px)"), {
120
+ rowGap: _spacing["default"]['size-5']
121
+ }),
122
+ divider: {
123
+ borderTop: "1px solid ".concat(_colors["default"].border["default"].subtle)
77
124
  },
78
- buttonMobile: {
79
- marginTop: _spacing["default"].small
125
+ auxContainer: _defineProperty({
126
+ display: 'flex',
127
+ alignItems: 'center',
128
+ justifyContent: 'center',
129
+ flexDirection: 'column',
130
+ gap: _spacing["default"]['size-5']
131
+ }, "@media (min-width: ".concat(_grid["default"].md, "px)"), {
132
+ flexDirection: 'row',
133
+ gap: _spacing["default"]['size-9']
134
+ }),
135
+ badgesContainer: _defineProperty({
136
+ display: 'flex',
137
+ gap: _spacing["default"]['size-4'],
138
+ flexDirection: 'column'
139
+ }, "@media (min-width: ".concat(_grid["default"].xs, "px)"), {
140
+ flexDirection: 'row'
141
+ }),
142
+ socialMediaContainer: {
143
+ display: 'flex',
144
+ direction: 'row',
145
+ columnGap: _spacing["default"]['size-1']
80
146
  }
81
147
  };
82
148
  exports["default"] = _default;
@@ -795,10 +795,24 @@ Object {
795
795
  },
796
796
  },
797
797
  "col": Object {
798
+ "@media (min-width: 576px)": Object {
799
+ "padding": Array [
800
+ 0,
801
+ "8px",
802
+ ],
803
+ },
804
+ "@media (min-width: 768px)": Object {
805
+ "padding": Array [
806
+ 0,
807
+ "12px",
808
+ ],
809
+ },
798
810
  "boxSizing": "border-box",
799
811
  "minHeight": "1px",
800
- "paddingLeft": 12,
801
- "paddingRight": 12,
812
+ "padding": Array [
813
+ 0,
814
+ 6,
815
+ ],
802
816
  "position": "relative",
803
817
  },
804
818
  "offset-xxs1": Object {
@@ -7,18 +7,25 @@ exports["default"] = void 0;
7
7
 
8
8
  var _grid = _interopRequireDefault(require("../../subatomic/grid"));
9
9
 
10
- var _spacing = _interopRequireDefault(require("../../subatomic/spacing"));
10
+ var _spacing = _interopRequireDefault(require("../../tokens/spacing.json"));
11
+
12
+ var _col;
11
13
 
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
15
 
16
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+
14
18
  var styles = {
15
- col: {
19
+ col: (_col = {
16
20
  boxSizing: 'border-box',
17
21
  position: 'relative',
18
22
  minHeight: '1px',
19
- paddingRight: _spacing["default"].gutter,
20
- paddingLeft: _spacing["default"].gutter
21
- }
23
+ padding: [0, 6]
24
+ }, _defineProperty(_col, "@media (min-width: ".concat(_grid["default"].xs, "px)"), {
25
+ padding: [0, _spacing["default"]['size-2']]
26
+ }), _defineProperty(_col, "@media (min-width: ".concat(_grid["default"].sm, "px)"), {
27
+ padding: [0, _spacing["default"]['size-3']]
28
+ }), _col)
22
29
  };
23
30
 
24
31
  var pushGrid = function pushGrid() {
@@ -44,7 +51,6 @@ var pushGrid = function pushGrid() {
44
51
  };
45
52
  }
46
53
 
47
- ;
48
54
  styles[xs] = {};
49
55
  styles[sm] = {};
50
56
  styles[md] = {};
@@ -12,9 +12,25 @@ Object {
12
12
  "content": "\\"\\"",
13
13
  "display": "table",
14
14
  },
15
+ "@media (min-width: 0px)": Object {
16
+ "margin": Array [
17
+ 0,
18
+ "-6px",
19
+ ],
20
+ },
21
+ "@media (min-width: 576px)": Object {
22
+ "margin": Array [
23
+ 0,
24
+ "-8px",
25
+ ],
26
+ },
27
+ "@media (min-width: 768px)": Object {
28
+ "margin": Array [
29
+ 0,
30
+ "-12px",
31
+ ],
32
+ },
15
33
  "boxSizing": "border-box",
16
- "marginLeft": -12,
17
- "marginRight": -12,
18
34
  },
19
35
  }
20
36
  `;
@@ -5,15 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
- var _spacing = _interopRequireDefault(require("../../subatomic/spacing"));
8
+ var _grid = _interopRequireDefault(require("../../subatomic/grid"));
9
+
10
+ var _spacing = _interopRequireDefault(require("../../tokens/spacing.json"));
11
+
12
+ var _row;
9
13
 
10
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
15
 
16
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+
12
18
  var _default = {
13
- row: {
19
+ row: (_row = {
14
20
  boxSizing: 'border-box',
15
- marginRight: -_spacing["default"].gutter,
16
- marginLeft: -_spacing["default"].gutter,
17
21
  '&:before, &:after': {
18
22
  display: 'table',
19
23
  content: '""'
@@ -21,6 +25,12 @@ var _default = {
21
25
  '&:after': {
22
26
  clear: 'both'
23
27
  }
24
- }
28
+ }, _defineProperty(_row, "@media (min-width: ".concat(_grid["default"].xxs, "px)"), {
29
+ margin: [0, '-6px']
30
+ }), _defineProperty(_row, "@media (min-width: ".concat(_grid["default"].xs, "px)"), {
31
+ margin: [0, "-".concat(_spacing["default"]["size-2"])]
32
+ }), _defineProperty(_row, "@media (min-width: ".concat(_grid["default"].sm, "px)"), {
33
+ margin: [0, "-".concat(_spacing["default"]["size-3"])]
34
+ }), _row)
25
35
  };
26
36
  exports["default"] = _default;
@@ -7,7 +7,7 @@ exports["default"] = void 0;
7
7
 
8
8
  var _grid = _interopRequireDefault(require("../subatomic/grid"));
9
9
 
10
- var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
10
+ var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
11
11
 
12
12
  var _conFluid$con$Media;
13
13
 
@@ -18,8 +18,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
18
18
  var _default = (_conFluid$con$Media = {
19
19
  conFluid: {
20
20
  boxSizing: 'border-box',
21
- paddingRight: _spacing["default"].gutter,
22
- paddingLeft: _spacing["default"].gutter,
21
+ paddingRight: _spacing["default"]['size-3'],
22
+ paddingLeft: _spacing["default"]['size-3'],
23
23
  marginRight: 'auto',
24
24
  marginLeft: 'auto',
25
25
  '&:before, &:after': {
@@ -31,24 +31,41 @@ var _default = (_conFluid$con$Media = {
31
31
  }
32
32
  },
33
33
  con: {
34
- extend: 'conFluid',
35
- margin: '0 auto'
34
+ width: _grid["default"].full,
35
+ margin: '0 auto',
36
+ padding: [0, _spacing["default"]['size-3']]
36
37
  }
37
38
  }, _defineProperty(_conFluid$con$Media, "@media (min-width: ".concat(_grid["default"].xs, "px)"), {
38
39
  con: {
39
- width: _grid["default"].xsGrid
40
+ width: _grid["default"].full,
41
+ padding: [0, _spacing["default"]['size-4']]
42
+ },
43
+ conFluid: {
44
+ width: _grid["default"].full,
45
+ padding: [0, _spacing["default"]['size-4']]
40
46
  }
41
47
  }), _defineProperty(_conFluid$con$Media, "@media (min-width: ".concat(_grid["default"].sm, "px)"), {
42
48
  con: {
43
- width: _grid["default"].smGrid
49
+ width: _grid["default"].full,
50
+ padding: [0, _spacing["default"]['size-5']]
51
+ },
52
+ conFluid: {
53
+ width: _grid["default"].full,
54
+ padding: [0, _spacing["default"]['size-5']]
44
55
  }
45
56
  }), _defineProperty(_conFluid$con$Media, "@media (min-width: ".concat(_grid["default"].md, "px)"), {
46
57
  con: {
47
- width: _grid["default"].mdGrid
58
+ width: _grid["default"].full,
59
+ padding: [0, _spacing["default"]['size-7']]
60
+ },
61
+ conFluid: {
62
+ width: _grid["default"].full,
63
+ padding: [0, _spacing["default"]['size-7']]
48
64
  }
49
65
  }), _defineProperty(_conFluid$con$Media, "@media (min-width: ".concat(_grid["default"].lg, "px)"), {
50
66
  con: {
51
- width: _grid["default"].lgGrid
67
+ width: _grid["default"].lgGrid,
68
+ padding: 0
52
69
  }
53
70
  }), _defineProperty(_conFluid$con$Media, "@media (min-width: ".concat(_grid["default"].xl, "px)"), {
54
71
  con: {
@@ -11,20 +11,12 @@ var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
- var _Card = _interopRequireDefault(require("../Card"));
15
-
16
- var _Icon = _interopRequireDefault(require("../Icon"));
17
-
18
14
  var _Text = _interopRequireDefault(require("../Text"));
19
15
 
20
16
  var _Flexbox = _interopRequireDefault(require("../Flexbox"));
21
17
 
22
18
  var _Button = _interopRequireDefault(require("../Button"));
23
19
 
24
- var _colors = _interopRequireDefault(require("../subatomic/colors"));
25
-
26
- var _grid = _interopRequireDefault(require("../subatomic/grid"));
27
-
28
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
21
 
30
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); }
@@ -49,8 +41,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
49
41
 
50
42
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
43
 
52
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
53
-
54
44
  /**
55
45
  * The Modal component is rendered in any given container, avoiding z-index an position conflicts. Your application must have the logic to show or hide the Modal component.
56
46
  */
@@ -65,17 +55,12 @@ var Modal = /*#__PURE__*/function (_React$Component) {
65
55
  _classCallCheck(this, Modal);
66
56
 
67
57
  _this = _super.call(this, props);
68
-
69
- _defineProperty(_assertThisInitialized(_this), "resize", function () {
70
- _this.setState({
71
- mobile: window.innerWidth < _grid["default"].xs
72
- });
73
- });
74
-
75
58
  _this.state = {
76
- mobile: false
59
+ headerBorder: false,
60
+ footerBorder: false
77
61
  };
78
62
  _this.onKeyDown = _this.onKeyDown.bind(_assertThisInitialized(_this));
63
+ _this.onScroll = _this.onScroll.bind(_assertThisInitialized(_this));
79
64
  return _this;
80
65
  }
81
66
 
@@ -83,21 +68,53 @@ var Modal = /*#__PURE__*/function (_React$Component) {
83
68
  key: "componentDidMount",
84
69
  value: function componentDidMount() {
85
70
  window.addEventListener('keydown', this.onKeyDown);
86
- window.addEventListener('resize', this.resize);
87
- this.resize();
88
71
  }
89
72
  }, {
90
73
  key: "componentWillUnmount",
91
74
  value: function componentWillUnmount() {
92
75
  window.removeEventListener('keydown', this.onKeyDown);
93
- window.removeEventListener('resize', this.resize);
76
+ }
77
+ }, {
78
+ key: "onScroll",
79
+ value: function onScroll(e) {
80
+ var _e$currentTarget = e.currentTarget,
81
+ scrollTop = _e$currentTarget.scrollTop,
82
+ scrollHeight = _e$currentTarget.scrollHeight,
83
+ clientHeight = _e$currentTarget.clientHeight;
84
+
85
+ if (scrollHeight > clientHeight) {
86
+ if (scrollTop > 0) {
87
+ this.setState({
88
+ headerBorder: true
89
+ });
90
+ } else {
91
+ this.setState({
92
+ headerBorder: false
93
+ });
94
+ }
95
+
96
+ if (scrollTop + clientHeight + 1 < scrollHeight) {
97
+ this.setState({
98
+ footerBorder: true
99
+ });
100
+ } else {
101
+ this.setState({
102
+ footerBorder: false
103
+ });
104
+ }
105
+ } else {
106
+ this.setState({
107
+ headerBorder: false,
108
+ footerBorder: false
109
+ });
110
+ }
94
111
  }
95
112
  }, {
96
113
  key: "onKeyDown",
97
114
  value: function onKeyDown(_ref) {
98
115
  var which = _ref.which;
99
116
  var onClose = this.props.onClose;
100
- if (onClose && which == 27) onClose();
117
+ if (onClose && which === 27) onClose();
101
118
  }
102
119
  }, {
103
120
  key: "avoidClose",
@@ -107,7 +124,6 @@ var Modal = /*#__PURE__*/function (_React$Component) {
107
124
  }, {
108
125
  key: "render",
109
126
  value: function render() {
110
- var mobile = this.state.mobile;
111
127
  var _this$props = this.props,
112
128
  classes = _this$props.classes,
113
129
  children = _this$props.children,
@@ -116,28 +132,31 @@ var Modal = /*#__PURE__*/function (_React$Component) {
116
132
  mainBtn = _this$props.mainBtn,
117
133
  show = _this$props.show,
118
134
  secBtn = _this$props.secBtn,
119
- size = _this$props.size,
120
- imgTop = _this$props.imgTop,
121
- imgLeft = _this$props.imgLeft,
135
+ _this$props$size = _this$props.size,
136
+ size = _this$props$size === void 0 ? 'md' : _this$props$size,
137
+ _this$props$imgTop = _this$props.imgTop,
138
+ imgTop = _this$props$imgTop === void 0 ? {} : _this$props$imgTop,
139
+ _this$props$imgLeft = _this$props.imgLeft,
140
+ imgLeft = _this$props$imgLeft === void 0 ? {} : _this$props$imgLeft,
122
141
  onTransitionEnd = _this$props.onTransitionEnd,
123
142
  fullSize = _this$props.fullSize,
124
143
  testId = _this$props.testId;
144
+ var _this$state = this.state,
145
+ headerBorder = _this$state.headerBorder,
146
+ footerBorder = _this$state.footerBorder;
125
147
 
126
- var closeButton = /*#__PURE__*/_react["default"].createElement("div", {
127
- className: classes.closeIcon
128
- }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], _extends({
129
- iconName: "close",
130
- width: 24,
131
- height: 24,
132
- colors: [_colors["default"].grey900],
133
- onClick: onClose
148
+ var closeButton = /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
149
+ theme: "ghostGrey",
150
+ onClick: onClose,
151
+ icon: "x",
152
+ size: "md"
134
153
  }, testId && {
135
154
  testId: "".concat(testId, "__close-icon")
136
- })));
155
+ }));
137
156
 
138
157
  return /*#__PURE__*/_react["default"].createElement("div", {
139
158
  "data-testid": testId,
140
- className: "".concat(classes.overlay, " ").concat(show ? classes.overlayShow : classes.overlayHide).concat(!onClose ? " ".concat(classes.noClose) : ''),
159
+ className: "".concat(classes.overlay, " ").concat(show ? classes.show : classes.hide).concat(!onClose ? " ".concat(classes.noClose) : ''),
141
160
  onClick: onClose,
142
161
  onTransitionEnd: onTransitionEnd
143
162
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -145,43 +164,51 @@ var Modal = /*#__PURE__*/function (_React$Component) {
145
164
  }, /*#__PURE__*/_react["default"].createElement("div", {
146
165
  className: classes.cardBlock,
147
166
  onClick: this.avoidClose
148
- }, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
149
- shadow: 5,
150
- className: "".concat(classes.card).concat(size ? " ".concat(classes[size]) : '').concat(show ? " ".concat(classes.cardShow) : " ".concat(classes.cardHide))
151
- }, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
167
+ }, /*#__PURE__*/_react["default"].createElement("div", {
168
+ className: "".concat(classes.card).concat(size ? " ".concat(classes[size]) : '').concat(fullSize ? " ".concat(classes.fullSize) : '')
169
+ }, /*#__PURE__*/_react["default"].createElement("div", {
170
+ className: classes.split
171
+ }, imgLeft.img && /*#__PURE__*/_react["default"].createElement("div", {
172
+ style: {
173
+ backgroundColor: imgLeft.color || 'transparent',
174
+ backgroundImage: "url(".concat(imgLeft.img, ")"),
175
+ backgroundSize: imgLeft.size || 'cover',
176
+ backgroundPosition: imgLeft.position || 'center'
177
+ },
178
+ className: classes.imgLeft
179
+ }), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
152
180
  display: "flex",
153
- direction: imgLeft.img ? 'row' : 'col'
154
- }, (imgLeft.img || imgTop.img) && /*#__PURE__*/_react["default"].createElement("div", {
155
- className: imgLeft.img ? classes.imgLeft : classes.imgTop
156
- }, imgTop.img && onClose && /*#__PURE__*/_react["default"].createElement("div", {
157
- className: classes.closePosition
158
- }, closeButton)), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
159
- flex: imgLeft.img ? '1' : null
160
- }, fullSize && mobile ? /*#__PURE__*/_react["default"].createElement("div", {
161
- className: classes.top
162
- }, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
163
- alignItems: "end",
164
- className: classes.top
165
- }, !imgTop.img && onClose && closeButton), title && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
166
- heading: true,
167
- className: classes.title
168
- }, title)) : /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
181
+ direction: "col",
182
+ className: classes.contentWrapper
183
+ }, title || onClose ? /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
169
184
  display: "flex",
170
185
  justifyContent: "end",
171
186
  alignItems: "start",
172
- className: classes.top
187
+ className: "".concat(classes.header).concat(headerBorder ? " ".concat(classes.headerBorder) : '').concat(imgTop.img ? " ".concat(classes.stickyHeader) : '').concat(imgTop.img && headerBorder ? " ".concat(classes.solidHeader) : '')
173
188
  }, title && /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
174
189
  flex: "1"
175
- }, /*#__PURE__*/_react["default"].createElement(_Text["default"], {
176
- heading: true,
190
+ }, /*#__PURE__*/_react["default"].createElement("h4", {
177
191
  className: classes.title
178
- }, title)), !imgTop.img && onClose && closeButton), /*#__PURE__*/_react["default"].createElement("div", {
192
+ }, title)), onClose && closeButton) : null, /*#__PURE__*/_react["default"].createElement("div", {
193
+ onScroll: this.onScroll,
179
194
  className: classes.content
180
- }, children), mainBtn && /*#__PURE__*/_react["default"].createElement("div", {
181
- className: classes.bottom
195
+ }, imgTop.img && /*#__PURE__*/_react["default"].createElement("div", {
196
+ style: {
197
+ backgroundColor: imgTop.color || 'transparent',
198
+ backgroundImage: "url(".concat(imgTop.img, ")"),
199
+ backgroundSize: imgTop.size || 'cover',
200
+ backgroundPosition: imgTop.position || 'center'
201
+ },
202
+ className: classes.imgTop
203
+ }), /*#__PURE__*/_react["default"].createElement(_Text["default"], {
204
+ tag: "div",
205
+ className: "".concat(classes.contentChild).concat(!title && !onClose ? " ".concat(classes.noHeader) : '').concat(!mainBtn ? " ".concat(classes.noFooter) : '').concat(imgTop && imgTop.img ? " ".concat(classes.imgTopPadding) : '')
206
+ }, children)), mainBtn && /*#__PURE__*/_react["default"].createElement("div", {
207
+ className: "".concat(classes.footer).concat(footerBorder ? " ".concat(classes.footerBorder) : '')
182
208
  }, secBtn && /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
209
+ type: secBtn.type,
210
+ size: "lg",
183
211
  theme: "ghostGrey",
184
- className: classes.secBtn,
185
212
  onClick: secBtn.onClick,
186
213
  href: secBtn.href,
187
214
  target: secBtn.target,
@@ -189,9 +216,10 @@ var Modal = /*#__PURE__*/function (_React$Component) {
189
216
  disabled: secBtn.disabled,
190
217
  id: secBtn.id
191
218
  }, testId && {
192
- testId: "".concat(testId, "__button_secondary")
219
+ testId: "".concat(testId, "__button-secondary")
193
220
  }), secBtn.text), /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
194
- className: classes.mainBtn,
221
+ type: mainBtn.type,
222
+ size: "lg",
195
223
  onClick: mainBtn.onClick,
196
224
  href: mainBtn.href,
197
225
  target: mainBtn.target,
@@ -199,7 +227,7 @@ var Modal = /*#__PURE__*/function (_React$Component) {
199
227
  disabled: mainBtn.disabled,
200
228
  id: mainBtn.id
201
229
  }, testId && {
202
- testId: "".concat(testId, "__button_main")
230
+ testId: "".concat(testId, "__button-main")
203
231
  }), mainBtn.text))))))));
204
232
  }
205
233
  }]);