@occmundial/occ-atomic 1.20.1 → 1.21.2

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,25 @@
1
+ ## [1.21.2](https://github.com/occmundial/occ-atomic/compare/v1.21.1...v1.21.2) (2022-05-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fix in Modal styles for full screen mode ([eeb7081](https://github.com/occmundial/occ-atomic/commit/eeb70814e172828b3fde2789d674676ac11a565d))
7
+
8
+ ## [1.21.1](https://github.com/occmundial/occ-atomic/compare/v1.21.0...v1.21.1) (2022-05-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Change in dimensions of full screen modal ([c3434a2](https://github.com/occmundial/occ-atomic/commit/c3434a28d1bf6455205b5f37419cd14567ddb126))
14
+ * Ignore plugin directory in doc gen ([d06e206](https://github.com/occmundial/occ-atomic/commit/d06e2064f9ec30066fef70432122d3d49a6ae99f))
15
+
16
+ # [1.21.0](https://github.com/occmundial/occ-atomic/compare/v1.20.1...v1.21.0) (2022-02-16)
17
+
18
+
19
+ ### Features
20
+
21
+ * Implement babel plugin ([a73c4fe](https://github.com/occmundial/occ-atomic/commit/a73c4fe73abd82e8c159ed7b6bfae0e26ecb613b))
22
+
1
23
  ## [1.20.1](https://github.com/occmundial/occ-atomic/compare/v1.20.0...v1.20.1) (2022-01-31)
2
24
 
3
25
 
@@ -65,17 +65,26 @@ var _default = {
65
65
  noClose: {
66
66
  cursor: 'default'
67
67
  },
68
- cardWrapper: {
68
+ cardWrapper: _defineProperty({
69
69
  position: 'relative',
70
- maxWidth: '100vw',
71
- maxHeight: '100vh'
72
- },
70
+ maxWidth: '100%',
71
+ maxHeight: '100%'
72
+ }, "@media screen and (max-width:".concat(_grid["default"].xs - 1, "px)"), {
73
+ height: function height(_ref) {
74
+ var fullSize = _ref.fullSize;
75
+ return fullSize && '100%';
76
+ }
77
+ }),
73
78
  cardBlock: _defineProperty({
74
79
  margin: _spacing["default"].gutter
75
80
  }, "@media screen and (max-width:".concat(_grid["default"].xs - 1, "px)"), {
76
- margin: function margin(_ref) {
77
- var fullSize = _ref.fullSize;
81
+ margin: function margin(_ref2) {
82
+ var fullSize = _ref2.fullSize;
78
83
  return fullSize && 0;
84
+ },
85
+ height: function height(_ref3) {
86
+ var fullSize = _ref3.fullSize;
87
+ return fullSize && '100%';
79
88
  }
80
89
  }),
81
90
  card: (_card = {
@@ -86,16 +95,16 @@ var _default = {
86
95
  }, _defineProperty(_card, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
87
96
  padding: _spacing["default"].medium
88
97
  }), _defineProperty(_card, "@media screen and (max-width:".concat(_grid["default"].xs - 1, "px)"), {
89
- padding: function padding(_ref2) {
90
- var fullSize = _ref2.fullSize;
98
+ padding: function padding(_ref4) {
99
+ var fullSize = _ref4.fullSize;
91
100
  return fullSize && _spacing["default"].base;
92
101
  },
93
- minHeight: function minHeight(_ref3) {
94
- var fullSize = _ref3.fullSize;
95
- return fullSize && '100vh';
102
+ minHeight: function minHeight(_ref5) {
103
+ var fullSize = _ref5.fullSize;
104
+ return fullSize && '100%';
96
105
  },
97
- borderRadius: function borderRadius(_ref4) {
98
- var fullSize = _ref4.fullSize;
106
+ borderRadius: function borderRadius(_ref6) {
107
+ var fullSize = _ref6.fullSize;
99
108
  return fullSize && 0;
100
109
  }
101
110
  }), _card),
@@ -161,20 +170,20 @@ var _default = {
161
170
  },
162
171
  imgLeft: _defineProperty({
163
172
  width: 200,
164
- backgroundImage: function backgroundImage(_ref5) {
165
- var imgLeft = _ref5.imgLeft;
173
+ backgroundImage: function backgroundImage(_ref7) {
174
+ var imgLeft = _ref7.imgLeft;
166
175
  return "url(".concat(imgLeft.img, ")");
167
176
  },
168
- backgroundPosition: function backgroundPosition(_ref6) {
169
- var imgLeft = _ref6.imgLeft;
177
+ backgroundPosition: function backgroundPosition(_ref8) {
178
+ var imgLeft = _ref8.imgLeft;
170
179
  return "center ".concat(imgLeft.position || 'center');
171
180
  },
172
- backgroundSize: function backgroundSize(_ref7) {
173
- var imgLeft = _ref7.imgLeft;
181
+ backgroundSize: function backgroundSize(_ref9) {
182
+ var imgLeft = _ref9.imgLeft;
174
183
  return imgLeft.size === 'contain' ? '100% auto' : 'cover';
175
184
  },
176
- backgroundColor: function backgroundColor(_ref8) {
177
- var imgLeft = _ref8.imgLeft;
185
+ backgroundColor: function backgroundColor(_ref10) {
186
+ var imgLeft = _ref10.imgLeft;
178
187
  return imgLeft.color || null;
179
188
  },
180
189
  backgroundRepeat: 'no-repeat',
@@ -191,24 +200,24 @@ var _default = {
191
200
  }),
192
201
  imgTop: _defineProperty({
193
202
  position: 'relative',
194
- height: function height(_ref9) {
195
- var imgTop = _ref9.imgTop;
203
+ height: function height(_ref11) {
204
+ var imgTop = _ref11.imgTop;
196
205
  return imgTop.height || 128;
197
206
  },
198
- backgroundImage: function backgroundImage(_ref10) {
199
- var imgTop = _ref10.imgTop;
207
+ backgroundImage: function backgroundImage(_ref12) {
208
+ var imgTop = _ref12.imgTop;
200
209
  return "url(".concat(imgTop.img, ")");
201
210
  },
202
- backgroundPosition: function backgroundPosition(_ref11) {
203
- var imgTop = _ref11.imgTop;
211
+ backgroundPosition: function backgroundPosition(_ref13) {
212
+ var imgTop = _ref13.imgTop;
204
213
  return "".concat(imgTop.position || 'center', " center");
205
214
  },
206
- backgroundSize: function backgroundSize(_ref12) {
207
- var imgTop = _ref12.imgTop;
215
+ backgroundSize: function backgroundSize(_ref14) {
216
+ var imgTop = _ref14.imgTop;
208
217
  return imgTop.size === 'contain' ? 'auto 100%' : imgTop.size || 'cover';
209
218
  },
210
- backgroundColor: function backgroundColor(_ref13) {
211
- var imgTop = _ref13.imgTop;
219
+ backgroundColor: function backgroundColor(_ref15) {
220
+ var imgTop = _ref15.imgTop;
212
221
  return imgTop.color || null;
213
222
  },
214
223
  backgroundRepeat: 'no-repeat',
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ var types = require('@babel/types');
4
+
5
+ function error(msg) {
6
+ throw new Error("babel-plugin-occ-atomic: ".concat(msg));
7
+ }
8
+
9
+ function getImportsList(path) {
10
+ return path.node.specifiers.filter(function (specifier) {
11
+ if (specifier.type !== 'ImportSpecifier') {
12
+ error('Import entire module detected. Using this syntax means we cannot tree shake properly.');
13
+ } else return true;
14
+ });
15
+ }
16
+
17
+ function importDeclaration(specifier, path) {
18
+ return types.importDeclaration([specifier], types.stringLiteral(path));
19
+ }
20
+
21
+ function replaceImport(path, statements) {
22
+ if (statements.length > 0) {
23
+ path.replaceWithMultiple(statements);
24
+ }
25
+
26
+ return path;
27
+ }
28
+
29
+ var subatomic = ['colors', 'fonts', 'grid', 'icons', 'iconSizes', 'shadows', 'spacing'];
30
+
31
+ function importModule(path) {
32
+ var importsList = getImportsList(path);
33
+ var importStatements = importsList.map(function (specifier) {
34
+ var importName = specifier.imported.name;
35
+
36
+ if (importName === 'toaster') {
37
+ return importDeclaration(specifier, '@occmundial/occ-atomic/build/Toaster/functions');
38
+ } else if (importName === 'Nav' || importName === 'Menu') {
39
+ return importDeclaration(specifier, "@occmundial/occ-atomic/build/Header/".concat(importName));
40
+ } else if (subatomic.includes(importName)) {
41
+ return importDeclaration(types.importDefaultSpecifier(types.identifier(importName)), "@occmundial/occ-atomic/build/subatomic/".concat(importName));
42
+ }
43
+
44
+ return importDeclaration(types.importDefaultSpecifier(types.identifier(importName)), "@occmundial/occ-atomic/build/".concat(importName));
45
+ });
46
+ replaceImport(path, importStatements);
47
+ }
48
+
49
+ module.exports = function () {
50
+ return {
51
+ visitor: {
52
+ ImportDeclaration: function ImportDeclaration(path) {
53
+ if (path.node.source.value === '@occmundial/occ-atomic') {
54
+ return importModule(path);
55
+ }
56
+ }
57
+ }
58
+ };
59
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@occmundial/occ-atomic",
3
- "version": "1.20.1",
3
+ "version": "1.21.2",
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",