@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
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _MenuItemBase = _interopRequireDefault(require("../MenuItemBase"));
|
|
13
|
+
|
|
14
|
+
var _Text = _interopRequireDefault(require("../Text"));
|
|
15
|
+
|
|
16
|
+
var _Avatar = _interopRequireDefault(require("../Avatar"));
|
|
17
|
+
|
|
18
|
+
var _idx = _interopRequireDefault(require("idx"));
|
|
19
|
+
|
|
20
|
+
var _MenuListProvider = require("../Provider/MenuListProvider");
|
|
21
|
+
|
|
22
|
+
var _excluded = ["classes", "disableText", "className", "title", "subtitle", "titleTextProps", "subtitleTextProps", "avatarProps", "dense", "children", "style", "component"];
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
32
|
+
/** MenuItem component with Avatar and subtitle. */
|
|
33
|
+
function MenuUser(_ref, ref) {
|
|
34
|
+
var classes = _ref.classes,
|
|
35
|
+
_ref$disableText = _ref.disableText,
|
|
36
|
+
disableText = _ref$disableText === void 0 ? false : _ref$disableText,
|
|
37
|
+
className = _ref.className,
|
|
38
|
+
title = _ref.title,
|
|
39
|
+
subtitle = _ref.subtitle,
|
|
40
|
+
titleTextProps = _ref.titleTextProps,
|
|
41
|
+
subtitleTextProps = _ref.subtitleTextProps,
|
|
42
|
+
avatarProps = _ref.avatarProps,
|
|
43
|
+
dense = _ref.dense,
|
|
44
|
+
children = _ref.children,
|
|
45
|
+
style = _ref.style,
|
|
46
|
+
_ref$component = _ref.component,
|
|
47
|
+
component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
48
|
+
menuItemprops = _objectWithoutProperties(_ref, _excluded);
|
|
49
|
+
|
|
50
|
+
var listContext = (0, _MenuListProvider.useMenuListContext)();
|
|
51
|
+
var isDense = typeof dense === 'undefined' ? listContext.dense : dense;
|
|
52
|
+
var primary = title || children;
|
|
53
|
+
var titleText = !primary ? null : disableText ? primary : /*#__PURE__*/_react["default"].createElement(_Text["default"], _extends({
|
|
54
|
+
className: classes.title + ((0, _idx["default"])(className, function (_) {
|
|
55
|
+
return _.title;
|
|
56
|
+
}) ? " ".concat(className.title) : ''),
|
|
57
|
+
tag: "span",
|
|
58
|
+
bodyLargeStrong: !isDense,
|
|
59
|
+
bodyRegularStrong: isDense
|
|
60
|
+
}, titleTextProps), primary);
|
|
61
|
+
var subtitleText = !subtitle ? null : disableText ? subtitle : /*#__PURE__*/_react["default"].createElement(_Text["default"], _extends({
|
|
62
|
+
className: classes.subtitle + ((0, _idx["default"])(className, function (_) {
|
|
63
|
+
return _.subtitle;
|
|
64
|
+
}) ? " ".concat(className.subtitle) : ''),
|
|
65
|
+
tag: "span",
|
|
66
|
+
small: true,
|
|
67
|
+
corpSecondary: true
|
|
68
|
+
}, subtitleTextProps), subtitle);
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItemBase["default"], _extends({
|
|
70
|
+
className: className && className.root,
|
|
71
|
+
dense: isDense,
|
|
72
|
+
component: component,
|
|
73
|
+
ref: ref,
|
|
74
|
+
style: style && style.root
|
|
75
|
+
}, menuItemprops), avatarProps && /*#__PURE__*/_react["default"].createElement("div", {
|
|
76
|
+
className: classes.avatarContainer + ((0, _idx["default"])(className, function (_) {
|
|
77
|
+
return _.avatarContainer;
|
|
78
|
+
}) ? " ".concat(className.avatarContainer) : ''),
|
|
79
|
+
style: style && style.avatarContainer
|
|
80
|
+
}, /*#__PURE__*/_react["default"].createElement(_Avatar["default"], _extends({
|
|
81
|
+
size: isDense ? 40 : 56
|
|
82
|
+
}, avatarProps))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
83
|
+
className: classes.textContainer + ((0, _idx["default"])(className, function (_) {
|
|
84
|
+
return _.textContainer;
|
|
85
|
+
}) ? " ".concat(className.textContainer) : ''),
|
|
86
|
+
style: style && style.textContainer
|
|
87
|
+
}, titleText, subtitleText));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var _default = /*#__PURE__*/_react["default"].forwardRef(MenuUser);
|
|
91
|
+
|
|
92
|
+
exports["default"] = _default;
|
|
93
|
+
MenuUser.propTypes = {
|
|
94
|
+
classes: _propTypes["default"].object,
|
|
95
|
+
|
|
96
|
+
/** Defines the align-items style property. */
|
|
97
|
+
alignItems: _propTypes["default"].oneOf(['center', 'start']),
|
|
98
|
+
|
|
99
|
+
/** Adds classes to the root, text, iconRight, iconLeft containers. */
|
|
100
|
+
className: _propTypes["default"].exact({
|
|
101
|
+
root: _propTypes["default"].string,
|
|
102
|
+
title: _propTypes["default"].string,
|
|
103
|
+
subtitle: _propTypes["default"].string,
|
|
104
|
+
avatarContainer: _propTypes["default"].string,
|
|
105
|
+
textContainer: _propTypes["default"].string
|
|
106
|
+
}),
|
|
107
|
+
|
|
108
|
+
/** Adds styles to the root, text, iconRight, iconLeft containers. */
|
|
109
|
+
style: _propTypes["default"].exact({
|
|
110
|
+
root: _propTypes["default"].object,
|
|
111
|
+
textContainer: _propTypes["default"].object,
|
|
112
|
+
avatarContainer: _propTypes["default"].objects
|
|
113
|
+
}),
|
|
114
|
+
|
|
115
|
+
/** Use to remove hover, focus and active stylings. */
|
|
116
|
+
nonActivatable: _propTypes["default"].bool,
|
|
117
|
+
|
|
118
|
+
/** If true, compact vertical padding designed for keyboard and mouse input is used. The prop defaults to the value inherited from the parent List component. */
|
|
119
|
+
dense: _propTypes["default"].bool,
|
|
120
|
+
|
|
121
|
+
/** If true, compact vertical padding designed for keyboard and mouse input is used. The prop defaults to the value inherited from the parent List component. */
|
|
122
|
+
disablePadding: _propTypes["default"].bool,
|
|
123
|
+
|
|
124
|
+
/** If true, the left and right padding is removed. */
|
|
125
|
+
disableGutters: _propTypes["default"].bool,
|
|
126
|
+
|
|
127
|
+
/** The content of the component. */
|
|
128
|
+
children: _propTypes["default"].node,
|
|
129
|
+
|
|
130
|
+
/** The component used for the root node. Either a string to use a HTML element or a component. */
|
|
131
|
+
selected: _propTypes["default"].bool,
|
|
132
|
+
|
|
133
|
+
/** If true, the children won't be wrapped by a Text component. This can be useful to render an alternative Text variant by wrapping the children text. */
|
|
134
|
+
component: _propTypes["default"].elementType,
|
|
135
|
+
|
|
136
|
+
/** If true, the children won't be wrapped by a Text component. This can be useful to render an alternative Text variant by wrapping the children text. */
|
|
137
|
+
disableText: _propTypes["default"].bool,
|
|
138
|
+
|
|
139
|
+
/** The title content element. */
|
|
140
|
+
title: _propTypes["default"].node,
|
|
141
|
+
|
|
142
|
+
/** These props will be forwarded to the title Text component (as long as disableText is not true). */
|
|
143
|
+
titleTextProps: _propTypes["default"].object,
|
|
144
|
+
|
|
145
|
+
/** The subtitle content element. */
|
|
146
|
+
subtitle: _propTypes["default"].node,
|
|
147
|
+
|
|
148
|
+
/** These props will be forwarded to the subtitle Text component (as long as disableText is not true). */
|
|
149
|
+
subtitleTextProps: _propTypes["default"].object,
|
|
150
|
+
|
|
151
|
+
/** These props will be forwarded to the Avatar component. */
|
|
152
|
+
avatarProps: _propTypes["default"].object
|
|
153
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactJss = _interopRequireDefault(require("react-jss"));
|
|
9
|
+
|
|
10
|
+
var _MenuUser = _interopRequireDefault(require("./MenuUser"));
|
|
11
|
+
|
|
12
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var _default = (0, _reactJss["default"])(_styles["default"])(_MenuUser["default"]);
|
|
17
|
+
|
|
18
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
avatarContainer: {
|
|
9
|
+
flexShrink: 0,
|
|
10
|
+
paddingRight: 12
|
|
11
|
+
},
|
|
12
|
+
title: {
|
|
13
|
+
display: 'block'
|
|
14
|
+
},
|
|
15
|
+
subtitle: {
|
|
16
|
+
display: 'block'
|
|
17
|
+
},
|
|
18
|
+
textContainer: {
|
|
19
|
+
flex: '1 1 auto'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Avatar = _interopRequireDefault(require("../Avatar"));
|
|
13
|
+
|
|
14
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
15
|
+
|
|
16
|
+
var _excluded = ["classes", "name", "disabled", "dense", "photo", "className"];
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
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); }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
|
|
28
|
+
function NavButton(_ref) {
|
|
29
|
+
var classes = _ref.classes,
|
|
30
|
+
name = _ref.name,
|
|
31
|
+
disabled = _ref.disabled,
|
|
32
|
+
dense = _ref.dense,
|
|
33
|
+
photo = _ref.photo,
|
|
34
|
+
className = _ref.className,
|
|
35
|
+
buttonProps = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
|
|
37
|
+
var buttonClasses = classes.avatarButton;
|
|
38
|
+
buttonClasses += dense ? " ".concat(classes.mini) : '';
|
|
39
|
+
buttonClasses += className ? " ".concat(className) : '';
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
|
|
41
|
+
iconRight: "chevron-down",
|
|
42
|
+
disabled: disabled
|
|
43
|
+
}, buttonProps, {
|
|
44
|
+
className: buttonClasses
|
|
45
|
+
}), /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
|
|
46
|
+
photo: photo,
|
|
47
|
+
name: name,
|
|
48
|
+
disabled: disabled
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
NavButton.propTypes = _defineProperty({
|
|
53
|
+
classes: _propTypes["default"].object.isRequired,
|
|
54
|
+
|
|
55
|
+
/** Button`s container ids */
|
|
56
|
+
id: _propTypes["default"].string,
|
|
57
|
+
|
|
58
|
+
/** Button`s container classname */
|
|
59
|
+
className: _propTypes["default"].string,
|
|
60
|
+
|
|
61
|
+
/** Button`s container style */
|
|
62
|
+
style: _propTypes["default"].object,
|
|
63
|
+
|
|
64
|
+
/** Mini variant */
|
|
65
|
+
dense: _propTypes["default"].bool,
|
|
66
|
+
|
|
67
|
+
/** The content of the component. */
|
|
68
|
+
children: _propTypes["default"].node,
|
|
69
|
+
|
|
70
|
+
/** There are four themes available: main, secondary, white, blue, flat. */
|
|
71
|
+
theme: _propTypes["default"].oneOf(['primary', 'secondary', 'tertiary', 'tertiaryWhite', 'ghostPink', 'ghostGrey', 'ghostWhite']),
|
|
72
|
+
|
|
73
|
+
/** The button has three different sizes: sm, md, lg. */
|
|
74
|
+
size: _propTypes["default"].oneOf(['sm', 'md', 'lg']),
|
|
75
|
+
|
|
76
|
+
/** The block property lets the button expand to ocupy the whole width of its parent. */
|
|
77
|
+
block: _propTypes["default"].bool,
|
|
78
|
+
|
|
79
|
+
/** It disables the button and shows it with the proper theme. */
|
|
80
|
+
disabled: _propTypes["default"].bool,
|
|
81
|
+
|
|
82
|
+
/** Use the name of any of the icons available in the library. */
|
|
83
|
+
icon: _propTypes["default"].string,
|
|
84
|
+
|
|
85
|
+
/** Use the name of any of the icons available in the library. The icon will be rendered on the right side of the button. */
|
|
86
|
+
iconRight: _propTypes["default"].string,
|
|
87
|
+
|
|
88
|
+
/** Property to make the button round when it only has an icon. */
|
|
89
|
+
round: _propTypes["default"].bool,
|
|
90
|
+
|
|
91
|
+
/** The loading property disables the button and shows a loading icon spinning. */
|
|
92
|
+
loading: _propTypes["default"].bool,
|
|
93
|
+
|
|
94
|
+
/** The function to call when the button is clicked. */
|
|
95
|
+
onClick: _propTypes["default"].func,
|
|
96
|
+
|
|
97
|
+
/** The function to call when the mouse is down on the button. */
|
|
98
|
+
onMouseDown: _propTypes["default"].func,
|
|
99
|
+
|
|
100
|
+
/** The function to call when the mouse is up on the button. */
|
|
101
|
+
onMouseUp: _propTypes["default"].func,
|
|
102
|
+
|
|
103
|
+
/** The function to call when the mouse moves out of the button. */
|
|
104
|
+
onMouseOut: _propTypes["default"].func,
|
|
105
|
+
|
|
106
|
+
/** Optionally, you can set the href property and use it like a link. */
|
|
107
|
+
href: _propTypes["default"].string,
|
|
108
|
+
|
|
109
|
+
/** If you use the href property, you can also define the target. */
|
|
110
|
+
target: _propTypes["default"].string,
|
|
111
|
+
|
|
112
|
+
/** If you use the href property, you can also define the rel attribute. */
|
|
113
|
+
rel: _propTypes["default"].string,
|
|
114
|
+
|
|
115
|
+
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
|
116
|
+
testId: _propTypes["default"].string,
|
|
117
|
+
|
|
118
|
+
/** A url to show a photo as the avatar. */
|
|
119
|
+
photo: _propTypes["default"].string,
|
|
120
|
+
|
|
121
|
+
/** Pass a name to show two initials. */
|
|
122
|
+
name: _propTypes["default"].string
|
|
123
|
+
}, "size", _propTypes["default"].number);
|
|
124
|
+
var _default = NavButton;
|
|
125
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactJss = _interopRequireDefault(require("react-jss"));
|
|
9
|
+
|
|
10
|
+
var _NavAvatarButton = _interopRequireDefault(require("./NavAvatarButton"));
|
|
11
|
+
|
|
12
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var _default = (0, _reactJss["default"])(_styles["default"])(_NavAvatarButton["default"]);
|
|
17
|
+
|
|
18
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = {
|
|
13
|
+
dense: {
|
|
14
|
+
padding: _spacing["default"]['size-1'],
|
|
15
|
+
'& > span > svg': {
|
|
16
|
+
marginLeft: _spacing["default"]['size-1']
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
avatarButton: {
|
|
20
|
+
'& > span > svg': {
|
|
21
|
+
transition: '0.3s all!important'
|
|
22
|
+
},
|
|
23
|
+
'&:hover, &:focus, &:active': {
|
|
24
|
+
'& > span > svg': {
|
|
25
|
+
transform: 'translateY(2px)'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Text = _interopRequireDefault(require("../Text"));
|
|
13
|
+
|
|
14
|
+
var _Flexbox = _interopRequireDefault(require("../Flexbox"));
|
|
15
|
+
|
|
16
|
+
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
17
|
+
|
|
18
|
+
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function NavButton(_ref) {
|
|
23
|
+
var classes = _ref.classes,
|
|
24
|
+
selected = _ref.selected,
|
|
25
|
+
label = _ref.label,
|
|
26
|
+
onClick = _ref.onClick,
|
|
27
|
+
direction = _ref.direction,
|
|
28
|
+
className = _ref.className,
|
|
29
|
+
testId = _ref.testId,
|
|
30
|
+
id = _ref.id,
|
|
31
|
+
iconName = _ref.iconName,
|
|
32
|
+
white = _ref.white;
|
|
33
|
+
var iconColor = white ? _colors["default"].bgWhite : _colors["default"].grey600;
|
|
34
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
35
|
+
className: "".concat(classes.cont).concat(selected ? " ".concat(classes.selected) : '').concat(className ? " ".concat(className) : ''),
|
|
36
|
+
onClick: onClick,
|
|
37
|
+
"data-testid": testId,
|
|
38
|
+
id: id
|
|
39
|
+
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
40
|
+
display: "flex",
|
|
41
|
+
direction: direction,
|
|
42
|
+
justifyContent: "center",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
className: classes.flex
|
|
45
|
+
}, iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
46
|
+
iconName: iconName,
|
|
47
|
+
colors: [iconColor]
|
|
48
|
+
}), label && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
|
49
|
+
bodyRegularStrong: true,
|
|
50
|
+
current: true
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
52
|
+
className: classes.text
|
|
53
|
+
}, label))));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
NavButton.propTypes = {
|
|
57
|
+
classes: _propTypes["default"].object.isRequired,
|
|
58
|
+
selected: _propTypes["default"].bool,
|
|
59
|
+
iconName: _propTypes["default"].string,
|
|
60
|
+
label: _propTypes["default"].string,
|
|
61
|
+
onClick: _propTypes["default"].func,
|
|
62
|
+
width: _propTypes["default"].number,
|
|
63
|
+
showBar: _propTypes["default"].bool,
|
|
64
|
+
direction: _propTypes["default"].oneOf(['col', 'row']),
|
|
65
|
+
className: _propTypes["default"].string,
|
|
66
|
+
|
|
67
|
+
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
|
68
|
+
testId: _propTypes["default"].string,
|
|
69
|
+
id: _propTypes["default"].string,
|
|
70
|
+
white: _propTypes["default"].bool
|
|
71
|
+
};
|
|
72
|
+
var _default = NavButton;
|
|
73
|
+
exports["default"] = _default;
|
|
@@ -7,12 +7,12 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _reactJss = _interopRequireDefault(require("react-jss"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _NavButton = _interopRequireDefault(require("./NavButton"));
|
|
11
11
|
|
|
12
12
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
15
|
|
|
16
|
-
var _default = (0, _reactJss["default"])(_styles["default"])(
|
|
16
|
+
var _default = (0, _reactJss["default"])(_styles["default"])(_NavButton["default"]);
|
|
17
17
|
|
|
18
18
|
exports["default"] = _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
|
9
|
+
|
|
10
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
|
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"]['size-9'],
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
position: 'relative',
|
|
23
|
+
'& $svg': {
|
|
24
|
+
fill: function fill(props) {
|
|
25
|
+
return props.white ? _colors["default"].text.white.secondary : _colors["default"].text.corp.secondary;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
'&:hover $svg, &:focus $svg, &:active $svg': {
|
|
29
|
+
fill: function fill(props) {
|
|
30
|
+
return props.white ? _colors["default"].text.white.primary : _colors["default"].text.corp.primary;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
'&:hover $text, &:focus $text, &:active $text': {
|
|
34
|
+
color: function color(props) {
|
|
35
|
+
return props.white ? _colors["default"].text.white.primary : _colors["default"].text.corp.primary;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
'&:after': {
|
|
39
|
+
content: '""',
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
width: '100%',
|
|
42
|
+
height: 3,
|
|
43
|
+
bottom: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
background: 'transparent',
|
|
46
|
+
transition: '0.3s all'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
flex: {
|
|
50
|
+
height: _spacing["default"]['size-9']
|
|
51
|
+
},
|
|
52
|
+
selected: {
|
|
53
|
+
'& $svg, &:hover $svg': {
|
|
54
|
+
fill: function fill(props) {
|
|
55
|
+
return props.white ? _colors["default"].text.white.primary : _colors["default"].text.corp.primary;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
'& $text, &:hover $text': {
|
|
59
|
+
color: function color(props) {
|
|
60
|
+
return props.white ? _colors["default"].text.white.primary : _colors["default"].text.corp.primary;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
'&:after': {
|
|
64
|
+
background: function background(props) {
|
|
65
|
+
return props.showBar ? _colors["default"].border.accent : null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
text: {
|
|
70
|
+
color: function color(props) {
|
|
71
|
+
return props.white ? _colors["default"].text.white.secondary : _colors["default"].text.corp.secondary;
|
|
72
|
+
},
|
|
73
|
+
marginLeft: function marginLeft(props) {
|
|
74
|
+
return props.direction !== 'col' ? _spacing["default"]['size-2'] : null;
|
|
75
|
+
},
|
|
76
|
+
transition: '0.3s all'
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports["default"] = _default;
|
package/build/NavItem/styles.js
CHANGED
|
@@ -7,7 +7,7 @@ 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
|
|
|
@@ -32,11 +32,11 @@ var _default = {
|
|
|
32
32
|
notification: {
|
|
33
33
|
display: 'inline-block',
|
|
34
34
|
borderRadius: '50%',
|
|
35
|
-
width: _spacing["default"]
|
|
36
|
-
height: _spacing["default"]
|
|
35
|
+
width: _spacing["default"]['size-2'],
|
|
36
|
+
height: _spacing["default"]['size-2'],
|
|
37
37
|
backgroundColor: _colors["default"].error,
|
|
38
38
|
marginBottom: 1,
|
|
39
|
-
marginLeft: _spacing["default"]
|
|
39
|
+
marginLeft: _spacing["default"]['size-1']
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
exports["default"] = _default;
|