@occmundial/occ-atomic 3.0.0-beta.60 → 3.0.0-beta.61
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 +8 -0
- package/build/MenuDivider/MenuDivider.js +47 -0
- package/build/MenuDivider/index.js +18 -0
- package/build/MenuDivider/styles.js +21 -0
- package/build/MenuItem/MenuItem.js +160 -0
- package/build/MenuItem/index.js +18 -0
- package/build/MenuItem/styles.js +25 -0
- package/build/MenuItemBase/MenuItemBase.js +98 -0
- package/build/MenuItemBase/index.js +18 -0
- package/build/MenuItemBase/styles.js +57 -0
- package/build/MenuList/MenuList.js +71 -0
- package/build/MenuList/index.js +18 -0
- package/build/MenuList/styles.js +54 -0
- package/build/MenuUser/MenuUser.js +153 -0
- package/build/MenuUser/index.js +18 -0
- package/build/MenuUser/styles.js +22 -0
- package/build/NavAvatarButton/NavAvatarButton.js +125 -0
- package/build/NavAvatarButton/index.js +18 -0
- package/build/NavAvatarButton/styles.js +30 -0
- package/build/NavButton/NavButton.js +73 -0
- package/build/{NavIcon → NavButton}/index.js +2 -2
- package/build/NavButton/styles.js +79 -0
- package/build/NavItem/styles.js +4 -4
- package/build/NavTab/NavTab.js +47 -32
- package/build/NavTab/styles.js +63 -28
- package/build/NavTop/styles.js +6 -6
- package/build/Provider/MenuListProvider.js +38 -0
- package/build/index.js +14 -2
- package/package.json +1 -1
- package/build/NavIcon/NavIcon.js +0 -112
- package/build/NavIcon/styles.js +0 -81
package/build/NavTab/NavTab.js
CHANGED
|
@@ -17,7 +17,9 @@ var _Flexbox = _interopRequireDefault(require("../Flexbox"));
|
|
|
17
17
|
|
|
18
18
|
var _NavItem = _interopRequireDefault(require("../NavItem"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _NavButton = _interopRequireDefault(require("../NavButton"));
|
|
21
|
+
|
|
22
|
+
var _NavAvatarButton = _interopRequireDefault(require("../NavAvatarButton"));
|
|
21
23
|
|
|
22
24
|
var _NavTop = _interopRequireDefault(require("../NavTop"));
|
|
23
25
|
|
|
@@ -112,7 +114,7 @@ var NavTab = /*#__PURE__*/function (_React$Component) {
|
|
|
112
114
|
}, {
|
|
113
115
|
key: "renderItem",
|
|
114
116
|
value: function renderItem(item) {
|
|
115
|
-
if (item.type == 'link') return this.renderLink(item);else if (item.type == 'dropdownLink') return this.renderDropdownLink(item);else if (item.type == 'button') return this.renderButton(item);else if (item.type == '
|
|
117
|
+
if (item.type == 'link') return this.renderLink(item);else if (item.type == 'dropdownLink') return this.renderDropdownLink(item);else if (item.type == 'button') return this.renderButton(item);else if (item.type == 'navButton') return this.renderIcon(item);else if (item.type == 'logo') return this.renderLogo(item);else if (item.type == 'custom') return this.renderCustom(item);
|
|
116
118
|
}
|
|
117
119
|
}, {
|
|
118
120
|
key: "renderLink",
|
|
@@ -148,21 +150,25 @@ var NavTab = /*#__PURE__*/function (_React$Component) {
|
|
|
148
150
|
}, {
|
|
149
151
|
key: "renderButton",
|
|
150
152
|
value: function renderButton(item) {
|
|
151
|
-
var
|
|
153
|
+
var _this$props4 = this.props,
|
|
154
|
+
classes = _this$props4.classes,
|
|
155
|
+
blue = _this$props4.blue;
|
|
152
156
|
return /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
|
|
157
|
+
theme: blue ? "ghostWhite" : "ghostGrey",
|
|
158
|
+
size: item.iconLeft || item.iconRight ? 'lg' : 'md',
|
|
153
159
|
className: classes.button
|
|
154
160
|
}, item), item.text);
|
|
155
161
|
}
|
|
156
162
|
}, {
|
|
157
163
|
key: "renderIcon",
|
|
158
164
|
value: function renderIcon(item) {
|
|
159
|
-
var _this$
|
|
160
|
-
classes = _this$
|
|
161
|
-
blue = _this$
|
|
165
|
+
var _this$props5 = this.props,
|
|
166
|
+
classes = _this$props5.classes,
|
|
167
|
+
blue = _this$props5.blue;
|
|
162
168
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
163
169
|
className: classes.iconWrap,
|
|
164
170
|
key: item.key
|
|
165
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
171
|
+
}, /*#__PURE__*/_react["default"].createElement(_NavButton["default"], _extends({
|
|
166
172
|
className: classes.icon,
|
|
167
173
|
white: blue
|
|
168
174
|
}, item)));
|
|
@@ -193,19 +199,20 @@ var NavTab = /*#__PURE__*/function (_React$Component) {
|
|
|
193
199
|
var _this$state = this.state,
|
|
194
200
|
show = _this$state.show,
|
|
195
201
|
currentScroll = _this$state.currentScroll;
|
|
196
|
-
var _this$
|
|
197
|
-
classes = _this$
|
|
198
|
-
blue = _this$
|
|
199
|
-
left = _this$
|
|
200
|
-
right = _this$
|
|
201
|
-
center = _this$
|
|
202
|
-
flexCenter = _this$
|
|
203
|
-
top = _this$
|
|
204
|
-
fixed = _this$
|
|
205
|
-
bottom = _this$
|
|
206
|
-
className = _this$
|
|
207
|
-
winWidth = _this$
|
|
208
|
-
zIndex = _this$
|
|
202
|
+
var _this$props6 = this.props,
|
|
203
|
+
classes = _this$props6.classes,
|
|
204
|
+
blue = _this$props6.blue,
|
|
205
|
+
left = _this$props6.left,
|
|
206
|
+
right = _this$props6.right,
|
|
207
|
+
center = _this$props6.center,
|
|
208
|
+
flexCenter = _this$props6.flexCenter,
|
|
209
|
+
top = _this$props6.top,
|
|
210
|
+
fixed = _this$props6.fixed,
|
|
211
|
+
bottom = _this$props6.bottom,
|
|
212
|
+
className = _this$props6.className,
|
|
213
|
+
winWidth = _this$props6.winWidth,
|
|
214
|
+
zIndex = _this$props6.zIndex,
|
|
215
|
+
isResponsive = _this$props6.isResponsive;
|
|
209
216
|
var isFluid = winWidth < _grid["default"].xl;
|
|
210
217
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
211
218
|
className: "".concat(classes.container).concat(fixed ? " ".concat(classes.fixed, " ").concat(show ? classes.show : classes.hide).concat(currentScroll > 0 ? " ".concat(classes.isScrolled) : '').concat(bottom ? " ".concat(classes.bottom) : '') : '').concat(className ? " ".concat(className) : ''),
|
|
@@ -219,7 +226,7 @@ var NavTab = /*#__PURE__*/function (_React$Component) {
|
|
|
219
226
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
220
227
|
className: "".concat(classes.nav, " ").concat(blue ? classes.blue : classes.white)
|
|
221
228
|
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
222
|
-
className: classes.grid,
|
|
229
|
+
className: classes.grid + (isResponsive ? " ".concat(classes.gridFluid) : ''),
|
|
223
230
|
fluid: isFluid
|
|
224
231
|
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
225
232
|
display: "flex",
|
|
@@ -263,7 +270,7 @@ var NavTab = /*#__PURE__*/function (_React$Component) {
|
|
|
263
270
|
|
|
264
271
|
var positionPropTypes = _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
265
272
|
key: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
266
|
-
type: _propTypes["default"].oneOf(['button', 'link', 'dropdownLink', '
|
|
273
|
+
type: _propTypes["default"].oneOf(['button', 'link', 'dropdownLink', 'navButton', 'custom', 'logo']),
|
|
267
274
|
text: _propTypes["default"].string,
|
|
268
275
|
onClick: _propTypes["default"].func,
|
|
269
276
|
selected: _propTypes["default"].bool,
|
|
@@ -277,36 +284,44 @@ var positionPropTypes = _propTypes["default"].arrayOf(_propTypes["default"].shap
|
|
|
277
284
|
NavTab.propTypes = {
|
|
278
285
|
classes: _propTypes["default"].object.isRequired,
|
|
279
286
|
|
|
280
|
-
/**
|
|
287
|
+
/** Defines the components on the left side of the navigation bar. */
|
|
281
288
|
left: positionPropTypes,
|
|
282
289
|
|
|
283
|
-
/**
|
|
290
|
+
/** Defines the components on the right side of the navigation bar. */
|
|
284
291
|
right: positionPropTypes,
|
|
285
292
|
|
|
286
|
-
/**
|
|
293
|
+
/** Defines the components on the center of the navigation bar. */
|
|
287
294
|
center: positionPropTypes,
|
|
288
295
|
|
|
289
|
-
/**
|
|
296
|
+
/** Defines the components of the navigation bar. */
|
|
290
297
|
flexCenter: positionPropTypes,
|
|
291
298
|
|
|
292
|
-
/**
|
|
299
|
+
/** [Deprecated] Defines the Nav Top links. */
|
|
293
300
|
top: positionPropTypes,
|
|
294
301
|
|
|
295
|
-
/**
|
|
302
|
+
/** Sets blue theme. */
|
|
296
303
|
blue: _propTypes["default"].bool,
|
|
297
304
|
|
|
298
|
-
/**
|
|
305
|
+
/** Sets the NavTab to a fixed position at the top. */
|
|
299
306
|
fixed: _propTypes["default"].bool,
|
|
300
307
|
|
|
301
|
-
/**
|
|
308
|
+
/** Hides the nav on scroll. */
|
|
302
309
|
hideOnScroll: _propTypes["default"].bool,
|
|
303
310
|
|
|
304
311
|
/** Fixes the NavTab to the bottom of the screen (you have to also set fixed as true). */
|
|
305
312
|
bottom: _propTypes["default"].bool,
|
|
306
313
|
|
|
307
|
-
/**
|
|
314
|
+
/** Specifies the nav z-index (defaults to 999). */
|
|
308
315
|
zIndex: _propTypes["default"].number,
|
|
309
|
-
|
|
316
|
+
|
|
317
|
+
/** Adds classes to nav container. */
|
|
318
|
+
className: _propTypes["default"].string,
|
|
319
|
+
|
|
320
|
+
/** [Deprecated] Adds a simple responsive padding. */
|
|
321
|
+
isFluid: _propTypes["default"].bool,
|
|
322
|
+
|
|
323
|
+
/** Adds a responsive padding. */
|
|
324
|
+
isResponsive: _propTypes["default"].bool
|
|
310
325
|
};
|
|
311
326
|
|
|
312
327
|
var _default = (0, _WindowSize["default"])(NavTab);
|
package/build/NavTab/styles.js
CHANGED
|
@@ -7,14 +7,21 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _hexRgba = _interopRequireDefault(require("hex-rgba"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _shadows = _interopRequireDefault(require("../subatomic/shadows"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _grid = _interopRequireDefault(require("../subatomic/grid"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
|
15
|
+
|
|
16
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
|
17
|
+
|
|
18
|
+
var _gridResponsive;
|
|
15
19
|
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
21
|
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
var nav = _colors["default"].nav;
|
|
18
25
|
var _default = {
|
|
19
26
|
container: {
|
|
20
27
|
width: '100%',
|
|
@@ -35,7 +42,7 @@ var _default = {
|
|
|
35
42
|
marginTop: 0
|
|
36
43
|
},
|
|
37
44
|
hide: {
|
|
38
|
-
marginTop: -_spacing["default"]
|
|
45
|
+
marginTop: -_spacing["default"]['size-9'],
|
|
39
46
|
'& $nav': {
|
|
40
47
|
boxShadow: 'none !important'
|
|
41
48
|
}
|
|
@@ -45,14 +52,14 @@ var _default = {
|
|
|
45
52
|
boxShadow: _shadows["default"].lvl3
|
|
46
53
|
},
|
|
47
54
|
'& $blue': {
|
|
48
|
-
background: (0, _hexRgba["default"])(
|
|
55
|
+
background: (0, _hexRgba["default"])(nav.bg.inverse, 95)
|
|
49
56
|
},
|
|
50
57
|
'& $white': {
|
|
51
|
-
background: (0, _hexRgba["default"])(
|
|
58
|
+
background: (0, _hexRgba["default"])(nav.bg["default"], 95)
|
|
52
59
|
}
|
|
53
60
|
},
|
|
54
61
|
nav: {
|
|
55
|
-
height: _spacing["default"]
|
|
62
|
+
height: _spacing["default"]['size-9'],
|
|
56
63
|
transition: '0.3s all',
|
|
57
64
|
boxShadow: _shadows["default"].lvl1
|
|
58
65
|
},
|
|
@@ -61,57 +68,82 @@ var _default = {
|
|
|
61
68
|
height: '100%',
|
|
62
69
|
position: 'relative'
|
|
63
70
|
},
|
|
71
|
+
gridResponsive: (_gridResponsive = {}, _defineProperty(_gridResponsive, "@media screen and (min-width:".concat(_grid["default"].xxs, "px)"), {
|
|
72
|
+
padding: '0 12'
|
|
73
|
+
}), _defineProperty(_gridResponsive, "@media screen and (min-width:".concat(_grid["default"].xs, "px)"), {
|
|
74
|
+
padding: '0 16'
|
|
75
|
+
}), _defineProperty(_gridResponsive, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
|
76
|
+
padding: '0 24'
|
|
77
|
+
}), _defineProperty(_gridResponsive, "@media screen and (min-width:".concat(_grid["default"].md, "px)"), {
|
|
78
|
+
padding: '0 40'
|
|
79
|
+
}), _defineProperty(_gridResponsive, "@media screen and (min-width:".concat(_grid["default"].lg, "px)"), {
|
|
80
|
+
margin: '0 auto',
|
|
81
|
+
maxWidth: _grid["default"].lg - 60
|
|
82
|
+
}), _defineProperty(_gridResponsive, "@media screen and (min-width:".concat(_grid["default"].xl, "px)"), {
|
|
83
|
+
margin: '0 auto',
|
|
84
|
+
maxWidth: _grid["default"].xl - 60
|
|
85
|
+
}), _gridResponsive),
|
|
64
86
|
tab: {
|
|
65
87
|
height: '100%'
|
|
66
88
|
},
|
|
67
89
|
blue: {
|
|
68
|
-
background:
|
|
90
|
+
background: nav.bg.inverse
|
|
69
91
|
},
|
|
70
92
|
white: {
|
|
71
|
-
background:
|
|
93
|
+
background: nav.bg["default"]
|
|
72
94
|
},
|
|
73
95
|
left: {
|
|
74
|
-
'& $button
|
|
75
|
-
marginRight: _spacing["default"]
|
|
96
|
+
'& $button': {
|
|
97
|
+
marginRight: _spacing["default"]['size-5']
|
|
98
|
+
},
|
|
99
|
+
'& $iconWrap': {
|
|
100
|
+
marginRight: _spacing["default"]['size-2']
|
|
76
101
|
},
|
|
77
102
|
'& $button:first-child, & $iconWrap:first-child': {
|
|
78
103
|
marginLeft: 0
|
|
79
104
|
},
|
|
80
105
|
'& $navItem': {
|
|
81
|
-
marginRight: _spacing["default"]
|
|
106
|
+
marginRight: _spacing["default"]['size-4']
|
|
82
107
|
},
|
|
83
108
|
'& $navItem:first-child': {
|
|
84
109
|
marginLeft: 0
|
|
85
110
|
},
|
|
86
|
-
'& $logo': {
|
|
87
|
-
marginRight: _spacing["default"]
|
|
88
|
-
}
|
|
111
|
+
'& $logo': _defineProperty({}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
|
112
|
+
marginRight: _spacing["default"]['size-7']
|
|
113
|
+
})
|
|
89
114
|
},
|
|
90
115
|
right: {
|
|
91
|
-
'& $button
|
|
92
|
-
marginLeft: _spacing["default"]
|
|
116
|
+
'& $button': {
|
|
117
|
+
marginLeft: _spacing["default"]['size-1']
|
|
118
|
+
},
|
|
119
|
+
'& $iconWrap': {
|
|
120
|
+
marginLeft: _spacing["default"]['size-2']
|
|
93
121
|
},
|
|
94
122
|
'& $button:first-child, & $iconWrap:first-child': {
|
|
95
123
|
marginRight: 0
|
|
96
124
|
},
|
|
97
125
|
'& $navItem': {
|
|
98
|
-
marginLeft: _spacing["default"]
|
|
126
|
+
marginLeft: _spacing["default"]['size-4']
|
|
99
127
|
},
|
|
100
128
|
'& $navItem:first-child': {
|
|
101
129
|
marginRight: 0
|
|
102
130
|
},
|
|
103
|
-
'& $logo': {
|
|
104
|
-
|
|
105
|
-
}
|
|
131
|
+
'& $logo': _defineProperty({}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
|
132
|
+
marginRight: _spacing["default"]['size-7']
|
|
133
|
+
})
|
|
106
134
|
},
|
|
107
135
|
center: {
|
|
108
136
|
position: 'absolute',
|
|
109
137
|
left: '50%',
|
|
110
138
|
top: '50%',
|
|
111
139
|
transform: 'translate(-50%, -50%)',
|
|
112
|
-
'& $button, & $
|
|
113
|
-
marginLeft: _spacing["default"]
|
|
114
|
-
marginRight: _spacing["default"]
|
|
140
|
+
'& $button, & $logo': {
|
|
141
|
+
marginLeft: _spacing["default"]['size-1'],
|
|
142
|
+
marginRight: _spacing["default"]['size-1']
|
|
143
|
+
},
|
|
144
|
+
'& $iconWrap': {
|
|
145
|
+
marginLeft: _spacing["default"]['size-2'],
|
|
146
|
+
marginRight: _spacing["default"]['size-2']
|
|
115
147
|
},
|
|
116
148
|
'& $button:first-child, & $iconWrap:first-child': {
|
|
117
149
|
marginLeft: 0
|
|
@@ -120,8 +152,8 @@ var _default = {
|
|
|
120
152
|
marginRight: 0
|
|
121
153
|
},
|
|
122
154
|
'& $navItem': {
|
|
123
|
-
marginLeft: _spacing["default"]
|
|
124
|
-
marginRight: _spacing["default"]
|
|
155
|
+
marginLeft: _spacing["default"]['size-2'],
|
|
156
|
+
marginRight: _spacing["default"]['size-2']
|
|
125
157
|
},
|
|
126
158
|
'& $navItem:first-child': {
|
|
127
159
|
marginRight: 0
|
|
@@ -130,11 +162,14 @@ var _default = {
|
|
|
130
162
|
button: {},
|
|
131
163
|
navItem: {},
|
|
132
164
|
iconWrap: {
|
|
133
|
-
display: 'inline-block'
|
|
165
|
+
display: 'inline-block',
|
|
166
|
+
'& > div': {
|
|
167
|
+
padding: '0 8px'
|
|
168
|
+
}
|
|
134
169
|
},
|
|
135
170
|
icon: {},
|
|
136
171
|
arrow: {
|
|
137
|
-
marginBottom: -
|
|
172
|
+
marginBottom: -_spacing["default"]['size-1'],
|
|
138
173
|
transition: '0.3s all'
|
|
139
174
|
},
|
|
140
175
|
arrowUp: {
|
package/build/NavTop/styles.js
CHANGED
|
@@ -7,13 +7,13 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
|
9
9
|
|
|
10
|
-
var _spacing = _interopRequireDefault(require("../
|
|
10
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
|
|
14
14
|
var _default = {
|
|
15
15
|
top: {
|
|
16
|
-
height: _spacing["default"]
|
|
16
|
+
height: _spacing["default"]['size-6']
|
|
17
17
|
},
|
|
18
18
|
blue: {
|
|
19
19
|
background: _colors["default"].prim
|
|
@@ -26,8 +26,8 @@ var _default = {
|
|
|
26
26
|
},
|
|
27
27
|
navItem: {
|
|
28
28
|
position: 'relative',
|
|
29
|
-
marginRight: _spacing["default"]
|
|
30
|
-
marginLeft: _spacing["default"]
|
|
29
|
+
marginRight: _spacing["default"]['size-4'],
|
|
30
|
+
marginLeft: _spacing["default"]['size-4'],
|
|
31
31
|
'&:first-child': {
|
|
32
32
|
marginLeft: 0
|
|
33
33
|
},
|
|
@@ -38,10 +38,10 @@ var _default = {
|
|
|
38
38
|
content: '""',
|
|
39
39
|
display: 'block',
|
|
40
40
|
width: 1,
|
|
41
|
-
height: _spacing["default"]
|
|
41
|
+
height: _spacing["default"]['size-4'],
|
|
42
42
|
background: _colors["default"].grey400,
|
|
43
43
|
position: 'absolute',
|
|
44
|
-
right: -_spacing["default"]
|
|
44
|
+
right: -_spacing["default"]['size-4'],
|
|
45
45
|
top: '50%',
|
|
46
46
|
transform: 'translateY(-50%)'
|
|
47
47
|
},
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = MenuListProvider;
|
|
9
|
+
exports.useMenuListContext = exports.MenuListContext = void 0;
|
|
10
|
+
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
|
|
17
|
+
var MenuListContext = /*#__PURE__*/(0, _react.createContext)({
|
|
18
|
+
dense: false
|
|
19
|
+
});
|
|
20
|
+
exports.MenuListContext = MenuListContext;
|
|
21
|
+
|
|
22
|
+
var useMenuListContext = function useMenuListContext() {
|
|
23
|
+
return (0, _react.useContext)(MenuListContext);
|
|
24
|
+
}; // eslint-disable-next-line react/prop-types
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.useMenuListContext = useMenuListContext;
|
|
28
|
+
|
|
29
|
+
function MenuListProvider(_ref) {
|
|
30
|
+
var children = _ref.children,
|
|
31
|
+
_ref$dense = _ref.dense,
|
|
32
|
+
dense = _ref$dense === void 0 ? false : _ref$dense;
|
|
33
|
+
return /*#__PURE__*/_react["default"].createElement(MenuListContext.Provider, {
|
|
34
|
+
value: {
|
|
35
|
+
dense: dense
|
|
36
|
+
}
|
|
37
|
+
}, children);
|
|
38
|
+
}
|
package/build/index.js
CHANGED
|
@@ -88,6 +88,16 @@ var _Tab = _interopRequireDefault(require("./Tabs/Tab"));
|
|
|
88
88
|
|
|
89
89
|
var _TabContent = _interopRequireDefault(require("./Tabs/TabContent"));
|
|
90
90
|
|
|
91
|
+
var _MenuItem = _interopRequireDefault(require("./MenuItem"));
|
|
92
|
+
|
|
93
|
+
var _MenuUser = _interopRequireDefault(require("./MenuUser"));
|
|
94
|
+
|
|
95
|
+
var _MenuList = _interopRequireDefault(require("./MenuList"));
|
|
96
|
+
|
|
97
|
+
var _MenuDivider = _interopRequireDefault(require("./MenuDivider"));
|
|
98
|
+
|
|
99
|
+
var _NavAvatarButton = _interopRequireDefault(require("./NavAvatarButton"));
|
|
100
|
+
|
|
91
101
|
var _NavTab = _interopRequireDefault(require("./NavTab"));
|
|
92
102
|
|
|
93
103
|
var _NavItem = _interopRequireDefault(require("./NavItem"));
|
|
@@ -126,6 +136,8 @@ var _Provider = _interopRequireDefault(require("./Provider"));
|
|
|
126
136
|
|
|
127
137
|
var tokens = _interopRequireWildcard(require("./tokens"));
|
|
128
138
|
|
|
139
|
+
var _module$exports;
|
|
140
|
+
|
|
129
141
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
130
142
|
|
|
131
143
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -134,7 +146,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
134
146
|
|
|
135
147
|
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; }
|
|
136
148
|
|
|
137
|
-
module.exports =
|
|
149
|
+
module.exports = (_module$exports = {
|
|
138
150
|
Container: _Container["default"],
|
|
139
151
|
Row: _Row["default"],
|
|
140
152
|
Column: _Column["default"],
|
|
@@ -198,4 +210,4 @@ module.exports = _defineProperty({
|
|
|
198
210
|
TabsProviderUncontrolled: _context.TabsProviderUncontrolled,
|
|
199
211
|
Tab: _Tab["default"],
|
|
200
212
|
TabContent: _TabContent["default"]
|
|
201
|
-
}, "Menu", _Menu["default"]);
|
|
213
|
+
}, _defineProperty(_module$exports, "Menu", _Menu["default"]), _defineProperty(_module$exports, "MenuItem", _MenuItem["default"]), _defineProperty(_module$exports, "MenuUser", _MenuUser["default"]), _defineProperty(_module$exports, "MenuList", _MenuList["default"]), _defineProperty(_module$exports, "MenuDivider", _MenuDivider["default"]), _defineProperty(_module$exports, "NavAvatarButton", _NavAvatarButton["default"]), _module$exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@occmundial/occ-atomic",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.61",
|
|
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",
|
package/build/NavIcon/NavIcon.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _Text = _interopRequireDefault(require("../Text"));
|
|
15
|
-
|
|
16
|
-
var _Flexbox = _interopRequireDefault(require("../Flexbox"));
|
|
17
|
-
|
|
18
|
-
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
19
|
-
|
|
20
|
-
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
|
21
|
-
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
|
|
26
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
27
|
-
|
|
28
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
29
|
-
|
|
30
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
|
-
|
|
32
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
-
|
|
34
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
|
-
|
|
36
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
37
|
-
|
|
38
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
-
|
|
40
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
-
|
|
42
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
-
|
|
44
|
-
var NavIcon = /*#__PURE__*/function (_React$Component) {
|
|
45
|
-
_inherits(NavIcon, _React$Component);
|
|
46
|
-
|
|
47
|
-
var _super = _createSuper(NavIcon);
|
|
48
|
-
|
|
49
|
-
function NavIcon() {
|
|
50
|
-
_classCallCheck(this, NavIcon);
|
|
51
|
-
|
|
52
|
-
return _super.apply(this, arguments);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
_createClass(NavIcon, [{
|
|
56
|
-
key: "render",
|
|
57
|
-
value: function render() {
|
|
58
|
-
var _this$props = this.props,
|
|
59
|
-
classes = _this$props.classes,
|
|
60
|
-
selected = _this$props.selected,
|
|
61
|
-
label = _this$props.label,
|
|
62
|
-
onClick = _this$props.onClick,
|
|
63
|
-
direction = _this$props.direction,
|
|
64
|
-
className = _this$props.className,
|
|
65
|
-
testId = _this$props.testId,
|
|
66
|
-
id = _this$props.id,
|
|
67
|
-
iconName = _this$props.iconName,
|
|
68
|
-
white = _this$props.white;
|
|
69
|
-
var iconColor = white ? _colors["default"].bgWhite : _colors["default"].grey600;
|
|
70
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
|
-
className: "".concat(classes.cont).concat(selected ? " ".concat(classes.selected) : '').concat(className ? " ".concat(className) : ''),
|
|
72
|
-
onClick: onClick,
|
|
73
|
-
"data-testid": testId,
|
|
74
|
-
id: id
|
|
75
|
-
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
76
|
-
display: "flex",
|
|
77
|
-
direction: direction,
|
|
78
|
-
justifyContent: "center",
|
|
79
|
-
alignItems: "center",
|
|
80
|
-
className: classes.flex
|
|
81
|
-
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
82
|
-
iconName: iconName,
|
|
83
|
-
colors: [iconColor]
|
|
84
|
-
}), label && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
|
85
|
-
micro: true
|
|
86
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
87
|
-
className: classes.text
|
|
88
|
-
}, label))));
|
|
89
|
-
}
|
|
90
|
-
}]);
|
|
91
|
-
|
|
92
|
-
return NavIcon;
|
|
93
|
-
}(_react["default"].Component);
|
|
94
|
-
|
|
95
|
-
NavIcon.propTypes = {
|
|
96
|
-
classes: _propTypes["default"].object.isRequired,
|
|
97
|
-
selected: _propTypes["default"].bool,
|
|
98
|
-
iconName: _propTypes["default"].string.isRequired,
|
|
99
|
-
label: _propTypes["default"].string,
|
|
100
|
-
onClick: _propTypes["default"].func,
|
|
101
|
-
width: _propTypes["default"].number,
|
|
102
|
-
showBar: _propTypes["default"].bool,
|
|
103
|
-
direction: _propTypes["default"].oneOf(['col', 'row']),
|
|
104
|
-
className: _propTypes["default"].string,
|
|
105
|
-
|
|
106
|
-
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
|
107
|
-
testId: _propTypes["default"].string,
|
|
108
|
-
id: _propTypes["default"].string,
|
|
109
|
-
white: _propTypes["default"].bool
|
|
110
|
-
};
|
|
111
|
-
var _default = NavIcon;
|
|
112
|
-
exports["default"] = _default;
|
package/build/NavIcon/styles.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
|
|
9
|
-
|
|
10
|
-
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
var _default = {
|
|
15
|
-
cont: {
|
|
16
|
-
width: function width(props) {
|
|
17
|
-
return props.width ? props.width : null;
|
|
18
|
-
},
|
|
19
|
-
display: 'inline-block',
|
|
20
|
-
height: _spacing["default"].xLarge,
|
|
21
|
-
cursor: 'pointer',
|
|
22
|
-
position: 'relative',
|
|
23
|
-
'&:hover $svg': {
|
|
24
|
-
fill: function fill(props) {
|
|
25
|
-
return props.white ? _colors["default"].bgWhite : _colors["default"].grey900;
|
|
26
|
-
},
|
|
27
|
-
opacity: function opacity(props) {
|
|
28
|
-
return props.white ? 0.6 : null;
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
'&:hover $text': {
|
|
32
|
-
color: function color(props) {
|
|
33
|
-
return props.white ? _colors["default"].white : _colors["default"].ink;
|
|
34
|
-
},
|
|
35
|
-
opacity: function opacity(props) {
|
|
36
|
-
return props.white ? 0.6 : null;
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
'&:after': {
|
|
40
|
-
content: '""',
|
|
41
|
-
position: 'absolute',
|
|
42
|
-
width: '100%',
|
|
43
|
-
height: 3,
|
|
44
|
-
bottom: 0,
|
|
45
|
-
left: 0,
|
|
46
|
-
background: 'transparent',
|
|
47
|
-
transition: '0.3s all'
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
flex: {
|
|
51
|
-
height: _spacing["default"].xLarge
|
|
52
|
-
},
|
|
53
|
-
selected: {
|
|
54
|
-
'& $svg, &:hover $svg': {
|
|
55
|
-
fill: function fill(props) {
|
|
56
|
-
return props.white ? _colors["default"].bgWhite : _colors["default"].prim;
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
'& $text, &:hover $text': {
|
|
60
|
-
color: function color(props) {
|
|
61
|
-
return props.white ? _colors["default"].white : _colors["default"].prim;
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
'&:after': {
|
|
65
|
-
background: function background(props) {
|
|
66
|
-
return props.showBar ? props.white ? _colors["default"].sec : _colors["default"].prim : null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
text: {
|
|
71
|
-
color: function color(props) {
|
|
72
|
-
return props.white ? _colors["default"].white : _colors["default"].inkLight;
|
|
73
|
-
},
|
|
74
|
-
marginLeft: function marginLeft(props) {
|
|
75
|
-
return props.direction !== 'col' ? _spacing["default"].xTiny : null;
|
|
76
|
-
},
|
|
77
|
-
textTransform: 'uppercase',
|
|
78
|
-
transition: '0.3s all'
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
exports["default"] = _default;
|