@hipay/hipay-material-ui 3.7.13 → 3.9.0
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/HiAccordion/HiAccordion.js +82 -0
- package/HiAccordion/index.js +13 -0
- package/HiAccordionActions/HiAccordionActions.js +68 -0
- package/HiAccordionActions/index.js +13 -0
- package/HiAccordionSummary/HiAccordionSummary.js +73 -0
- package/HiAccordionSummary/index.js +13 -0
- package/HiAlertModal/HiAlertModal.js +67 -170
- package/HiAlertModal/index.js +5 -7
- package/HiAvatar/HiAvatar.js +51 -0
- package/HiAvatar/index.js +15 -0
- package/HiButton/HiButton.js +22 -22
- package/HiColoredLabel/HiColoredLabel.js +7 -7
- package/HiDatePicker/stylesheet.js +2 -2
- package/HiDialog/HiDialog.js +8 -24
- package/HiExpansionPanel/HiExpansionPanel.js +6 -6
- package/HiIconButton/HiIconButton.js +1 -1
- package/HiPaymentMeans/HiPaymentMeans.js +2 -1
- package/HiSelect/HiSelect.js +1 -1
- package/HiSelect/HiSelectInput.js +2 -3
- package/es/HiAccordion/HiAccordion.js +82 -0
- package/es/HiAccordion/index.js +13 -0
- package/es/HiAccordionActions/HiAccordionActions.js +68 -0
- package/es/HiAccordionActions/index.js +13 -0
- package/es/HiAccordionSummary/HiAccordionSummary.js +73 -0
- package/es/HiAccordionSummary/index.js +13 -0
- package/es/HiAlertModal/HiAlertModal.js +67 -170
- package/es/HiAlertModal/index.js +5 -7
- package/es/HiAvatar/HiAvatar.js +51 -0
- package/es/HiAvatar/index.js +15 -0
- package/es/HiButton/HiButton.js +22 -22
- package/es/HiColoredLabel/HiColoredLabel.js +7 -7
- package/es/HiDatePicker/stylesheet.js +2 -2
- package/es/HiDialog/HiDialog.js +8 -24
- package/es/HiExpansionPanel/HiExpansionPanel.js +6 -6
- package/es/HiIconButton/HiIconButton.js +1 -1
- package/es/HiPaymentMeans/HiPaymentMeans.js +2 -1
- package/es/HiSelect/HiSelect.js +1 -1
- package/es/HiSelect/HiSelectInput.js +2 -3
- package/package.json +5 -4
@@ -2,22 +2,20 @@
|
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
|
-
var
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
6
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
8
8
|
value: true
|
9
9
|
});
|
10
10
|
exports.default = void 0;
|
11
11
|
|
12
|
-
var
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
13
13
|
|
14
|
-
var
|
15
|
-
|
16
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
17
15
|
|
18
|
-
var
|
16
|
+
var _HiButton = _interopRequireDefault(require("../HiButton"));
|
19
17
|
|
20
|
-
var
|
18
|
+
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
21
19
|
|
22
20
|
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
23
21
|
|
@@ -25,195 +23,94 @@ var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogAct
|
|
25
23
|
|
26
24
|
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
27
25
|
|
28
|
-
var _DialogContentText = _interopRequireDefault(require("@material-ui/core/DialogContentText"));
|
29
|
-
|
30
26
|
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
31
27
|
|
32
|
-
var
|
33
|
-
|
34
|
-
var _HiButton = _interopRequireDefault(require("../HiButton"));
|
35
|
-
|
36
|
-
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
37
|
-
|
38
|
-
var _helpers = require("../utils/helpers");
|
28
|
+
var _core = require("@material-ui/core");
|
39
29
|
|
40
30
|
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); }
|
41
31
|
|
42
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
43
|
-
|
44
|
-
// @inheritedComponent Dialog
|
45
|
-
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
46
|
-
return {
|
47
|
-
classContent: {
|
48
|
-
fontSize: 14,
|
49
|
-
lineHeight: '24px',
|
50
|
-
color: '#484848',
|
51
|
-
position: 'relative'
|
52
|
-
},
|
53
|
-
classDialogPaper: {
|
54
|
-
backgroundColor: theme.palette.background3,
|
55
|
-
minHeight: 248,
|
56
|
-
maxWidth: 280,
|
57
|
-
borderRadius: 2
|
58
|
-
},
|
59
|
-
classCancelButton: {
|
60
|
-
margin: '0'
|
61
|
-
},
|
62
|
-
classSubmitButton: {
|
63
|
-
float: 'right'
|
64
|
-
},
|
65
|
-
classTitle: {
|
66
|
-
fontSize: 20,
|
67
|
-
fontFamily: theme.typography.fontFamily,
|
68
|
-
fontWeight: theme.typography.fontWeightLight,
|
69
|
-
lineHeight: '24px'
|
70
|
-
},
|
71
|
-
classAction: {
|
72
|
-
display: 'inline-block',
|
73
|
-
margin: '0',
|
74
|
-
padding: '0px 24px 24px 24px'
|
75
|
-
},
|
76
|
-
classDialogRoot: {
|
77
|
-
backgroundColor: 'rgba(0, 0, 0, 0.28)'
|
78
|
-
},
|
79
|
-
classBackgroundIcon: {
|
80
|
-
position: 'absolute',
|
81
|
-
top: 'calc(50%)',
|
82
|
-
left: '50%',
|
83
|
-
transform: 'translate(-50%, -50%)',
|
84
|
-
color: theme.palette.background2,
|
85
|
-
flex: '1'
|
86
|
-
},
|
87
|
-
backgroundIcon: function backgroundIcon(props) {
|
88
|
-
return {
|
89
|
-
fontSize: "".concat(props.iconSize, "px !important")
|
90
|
-
};
|
91
|
-
}
|
92
|
-
};
|
93
|
-
});
|
94
|
-
/**
|
95
|
-
* Pop up d'alert
|
96
|
-
*/
|
32
|
+
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; }
|
97
33
|
|
98
34
|
var HiAlertModal = function HiAlertModal(props) {
|
99
|
-
var backgroundIcon = props.backgroundIcon,
|
100
|
-
iconSize = props.iconSize,
|
101
|
-
content = props.content,
|
102
|
-
labelCancelButton = props.labelCancelButton,
|
103
|
-
labelSubmitButton = props.labelSubmitButton,
|
104
|
-
onCancelClick = props.onCancelClick,
|
105
|
-
onSubmitClick = props.onSubmitClick,
|
106
|
-
open = props.open,
|
107
|
-
cancelColor = props.cancelColor,
|
108
|
-
submitColor = props.submitColor,
|
109
|
-
title = props.title,
|
110
|
-
theme = props.theme,
|
111
|
-
onClose = props.onClose,
|
112
|
-
submitActionsRef = props.submitActionsRef,
|
113
|
-
cancelActionsRef = props.cancelActionsRef,
|
114
|
-
others = (0, _objectWithoutProperties2.default)(props, ["backgroundIcon", "iconSize", "content", "labelCancelButton", "labelSubmitButton", "onCancelClick", "onSubmitClick", "open", "cancelColor", "submitColor", "title", "theme", "onClose", "submitActionsRef", "cancelActionsRef"]);
|
115
|
-
var classes = useStyles(props);
|
116
35
|
var submitButtonRef = (0, _react.useRef)(null);
|
117
|
-
var cancelButtonRef = (0, _react.useRef)(null);
|
118
|
-
var thisCancelActionsRef = (0, _objectSpread2.default)({}, cancelActionsRef);
|
119
|
-
var thisSubmitActionsRef = (0, _objectSpread2.default)({}, submitActionsRef); // Appelé si clic en dehors de la pop up
|
36
|
+
var cancelButtonRef = (0, _react.useRef)(null); // Refs to HiButton to display focus state
|
120
37
|
|
121
|
-
var
|
122
|
-
|
123
|
-
onClose();
|
124
|
-
}
|
125
|
-
};
|
38
|
+
var submitActionsRef;
|
39
|
+
var cancelActionsRef; // On Dialog opening, focus an action button
|
126
40
|
|
127
41
|
var handleOnEntered = function handleOnEntered() {
|
128
|
-
if (labelSubmitButton) {
|
42
|
+
if (props.labelSubmitButton) {
|
43
|
+
// Focus submit button
|
129
44
|
submitButtonRef.current.focus();
|
130
|
-
|
45
|
+
submitActionsRef.focusVisible();
|
131
46
|
} else if (props.labelCancelButton) {
|
47
|
+
// Focus cancel button
|
132
48
|
cancelButtonRef.current.focus();
|
133
|
-
|
49
|
+
cancelActionsRef.focusVisible();
|
134
50
|
}
|
135
|
-
};
|
136
|
-
|
137
|
-
|
138
|
-
var dialogContent = content;
|
139
|
-
|
140
|
-
if (typeof content === 'string') {
|
141
|
-
dialogContent = /*#__PURE__*/_react.default.createElement("span", {
|
142
|
-
// eslint-disable-next-line react/no-danger
|
143
|
-
dangerouslySetInnerHTML: {
|
144
|
-
__html: (0, _helpers.escapeHTML)(content)
|
145
|
-
}
|
146
|
-
});
|
147
|
-
}
|
148
|
-
|
149
|
-
var bgIcon;
|
150
|
-
|
151
|
-
if (backgroundIcon) {
|
152
|
-
var iconProps = {
|
153
|
-
color: "inherit",
|
154
|
-
className: classes.backgroundIcon
|
155
|
-
};
|
156
|
-
|
157
|
-
if (typeof backgroundIcon === 'string') {
|
158
|
-
bgIcon = /*#__PURE__*/_react.default.createElement(_HiIcon.default, (0, _extends2.default)({
|
159
|
-
icon: backgroundIcon
|
160
|
-
}, iconProps));
|
161
|
-
} else if ((0, _typeof2.default)(backgroundIcon) === 'object') {
|
162
|
-
bgIcon = (0, _objectSpread2.default)({}, backgroundIcon);
|
163
|
-
bgIcon.props = (0, _objectSpread2.default)({}, iconProps);
|
164
|
-
}
|
165
|
-
}
|
51
|
+
};
|
166
52
|
|
167
|
-
return /*#__PURE__*/_react.default.createElement(_Dialog.default,
|
168
|
-
|
169
|
-
onClose: handleOnClose,
|
170
|
-
onEntered: handleOnEntered,
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
54
|
+
className: props.className,
|
171
55
|
classes: {
|
172
|
-
|
173
|
-
paper: classes.classDialogPaper
|
174
|
-
}
|
175
|
-
}, others), bgIcon && /*#__PURE__*/_react.default.createElement("div", {
|
176
|
-
className: classes.classBackgroundIcon
|
177
|
-
}, bgIcon), title && /*#__PURE__*/_react.default.createElement(_DialogTitle.default, {
|
178
|
-
disableTypography: true,
|
179
|
-
classes: {
|
180
|
-
root: classes.classTitle
|
181
|
-
}
|
182
|
-
}, title), /*#__PURE__*/_react.default.createElement(_DialogContent.default, null, /*#__PURE__*/_react.default.createElement(_DialogContentText.default, {
|
183
|
-
classes: {
|
184
|
-
root: classes.classContent
|
185
|
-
}
|
186
|
-
}, dialogContent)), /*#__PURE__*/_react.default.createElement(_DialogActions.default, {
|
187
|
-
classes: {
|
188
|
-
root: classes.classAction
|
189
|
-
}
|
190
|
-
}, labelCancelButton && /*#__PURE__*/_react.default.createElement(_HiButton.default, {
|
191
|
-
classes: {
|
192
|
-
root: classes.classCancelButton
|
56
|
+
paper: 'dialog-paper'
|
193
57
|
},
|
194
|
-
|
195
|
-
|
58
|
+
open: props.open,
|
59
|
+
onClose: props.onClose,
|
60
|
+
"aria-labelledby": "dialog-title",
|
61
|
+
"aria-describedby": "dialog-content",
|
62
|
+
TransitionProps: {
|
63
|
+
onEntered: handleOnEntered
|
64
|
+
}
|
65
|
+
}, props.title && /*#__PURE__*/_react.default.createElement(_DialogTitle.default, {
|
66
|
+
className: "dialog-title"
|
67
|
+
}, props.title), /*#__PURE__*/_react.default.createElement(_DialogContent.default, {
|
68
|
+
className: "dialog-content"
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Typography, {
|
70
|
+
component: 'div',
|
71
|
+
variant: "body1",
|
72
|
+
color: "textSecondary"
|
73
|
+
}, props.content)), /*#__PURE__*/_react.default.createElement(_DialogActions.default, {
|
74
|
+
className: "dialog-actions"
|
75
|
+
}, props.labelCancelButton && /*#__PURE__*/_react.default.createElement(_HiButton.default, {
|
76
|
+
className: "cancel-button",
|
77
|
+
onClick: props.onCancelClick,
|
78
|
+
variant: props.cancelButtonVariant,
|
79
|
+
color: props.cancelButtonColor,
|
196
80
|
innerRef: cancelButtonRef,
|
197
81
|
action: function action(actions) {
|
198
|
-
|
82
|
+
cancelActionsRef = actions;
|
199
83
|
}
|
200
|
-
}, labelCancelButton), labelSubmitButton && /*#__PURE__*/_react.default.createElement(_HiButton.default, {
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
color: submitColor,
|
84
|
+
}, props.labelCancelButton), props.labelSubmitButton && /*#__PURE__*/_react.default.createElement(_HiButton.default, {
|
85
|
+
className: "submit-button",
|
86
|
+
onClick: props.onSubmitClick,
|
87
|
+
color: props.submitButtonColor,
|
88
|
+
variant: props.submitButtonVariant,
|
206
89
|
innerRef: submitButtonRef,
|
207
90
|
action: function action(actions) {
|
208
|
-
|
91
|
+
submitActionsRef = actions;
|
209
92
|
}
|
210
|
-
},
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_HiIcon.default, null, props.submitIcon), /*#__PURE__*/_react.default.createElement("span", {
|
94
|
+
className: "submit-text"
|
95
|
+
}, props.labelSubmitButton))));
|
211
96
|
};
|
212
97
|
|
98
|
+
var StyledHiAlertModal = (0, _styledComponents.default)(HiAlertModal).withConfig({
|
99
|
+
displayName: "HiAlertModal__StyledHiAlertModal",
|
100
|
+
componentId: "sc-dmfyat-0"
|
101
|
+
})([".dialog-paper{padding:32px;", "{width:560px;min-width:560px;padding:55px;}}text-align:center;.dialog-title{padding:0;margin-bottom:25px;h2{font-weight:300;}}.dialog-content{padding:0;margin-bottom:25px;white-space:pre-line;}.dialog-actions{padding:0;display:flex;justify-content:space-around;}.cancel-button{width:122px;}.submit-button{width:288px;.submit-text{margin-left:6px;}}", "{.dialog-actions{flex-direction:column-reverse;justify-content:center;flex-wrap:wrap;padding:0;}.submit-button{width:100%;margin-bottom:16px;margin-left:0;}.cancel-button{width:100%;}}"], function (_ref) {
|
102
|
+
var theme = _ref.theme;
|
103
|
+
return theme.breakpoints.up('sm');
|
104
|
+
}, function (_ref2) {
|
105
|
+
var theme = _ref2.theme;
|
106
|
+
return theme.breakpoints.down('sm');
|
107
|
+
});
|
213
108
|
HiAlertModal.defaultProps = {
|
214
|
-
|
215
|
-
|
216
|
-
|
109
|
+
cancelButtonColor: 'neutral',
|
110
|
+
cancelButtonVariant: 'containedLight',
|
111
|
+
submitButtonColor: 'primary',
|
112
|
+
submitButtonVariant: 'contained',
|
113
|
+
submitIcon: 'done'
|
217
114
|
};
|
218
|
-
var _default =
|
115
|
+
var _default = StyledHiAlertModal;
|
219
116
|
exports.default = _default;
|
package/es/HiAlertModal/index.js
CHANGED
@@ -5,11 +5,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
return _HiAlertModal.default;
|
12
|
-
}
|
13
|
-
});
|
8
|
+
exports.default = void 0;
|
9
|
+
|
10
|
+
var _HiAlertModal = _interopRequireDefault(require("./HiAlertModal"));
|
14
11
|
|
15
|
-
var
|
12
|
+
var _default = _HiAlertModal.default;
|
13
|
+
exports.default = _default;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.default = void 0;
|
9
|
+
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
11
|
+
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
13
|
+
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
15
|
+
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
17
|
+
|
18
|
+
var _Avatar = _interopRequireDefault(require("@material-ui/core/Avatar"));
|
19
|
+
|
20
|
+
/*
|
21
|
+
* Display an material-ui Avatar
|
22
|
+
* If boolean internal is true, it displays white avatar with colored border and colored text
|
23
|
+
* If internal is false, it displays classic Avatar with colored background
|
24
|
+
*/
|
25
|
+
var HiAvatar = (0, _styledComponents.default)(function (_ref) {
|
26
|
+
var internal = _ref.internal,
|
27
|
+
color = _ref.color,
|
28
|
+
other = (0, _objectWithoutProperties2.default)(_ref, ["internal", "color"]);
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_Avatar.default, other);
|
30
|
+
}).withConfig({
|
31
|
+
displayName: "HiAvatar",
|
32
|
+
componentId: "sc-4o6l6c-0"
|
33
|
+
})(["background-color:", ";color:", ";border:", ";"], function (props) {
|
34
|
+
return props.internal ? 'white' : props.color;
|
35
|
+
}, function (props) {
|
36
|
+
return props.internal && props.color;
|
37
|
+
}, function (props) {
|
38
|
+
return props.internal && "solid 1px ".concat(props.color);
|
39
|
+
});
|
40
|
+
HiAvatar.propTypes = {
|
41
|
+
/* If internal user, display Avatar colors reversed */
|
42
|
+
internal: _propTypes.default.bool,
|
43
|
+
|
44
|
+
/* Avatar color */
|
45
|
+
color: _propTypes.default.string
|
46
|
+
};
|
47
|
+
HiAvatar.defaultProps = {
|
48
|
+
internal: false
|
49
|
+
};
|
50
|
+
var _default = HiAvatar;
|
51
|
+
exports.default = _default;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
Object.defineProperty(exports, "default", {
|
9
|
+
enumerable: true,
|
10
|
+
get: function get() {
|
11
|
+
return _HiAvatar.default;
|
12
|
+
}
|
13
|
+
});
|
14
|
+
|
15
|
+
var _HiAvatar = _interopRequireDefault(require("./HiAvatar"));
|
package/es/HiButton/HiButton.js
CHANGED
@@ -36,7 +36,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
36
36
|
return {
|
37
37
|
color: props.disabled ? theme.palette.action.disabled : theme.palette[props.color].main,
|
38
38
|
'&:hover': {
|
39
|
-
backgroundColor: (0, _colorManipulator.
|
39
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette[props.color].main, theme.palette.action.hoverOpacity),
|
40
40
|
// Reset on touch devices, it doesn't add specificity
|
41
41
|
'@media (hover: none)': {
|
42
42
|
backgroundColor: 'transparent'
|
@@ -47,7 +47,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
47
47
|
return {
|
48
48
|
color: props.disabled ? theme.palette.action.disabled : props.color,
|
49
49
|
"&:hover": {
|
50
|
-
backgroundColor: (0, _colorManipulator.
|
50
|
+
backgroundColor: (0, _colorManipulator.alpha)(props.color, theme.palette.action.hoverOpacity),
|
51
51
|
"@media (hover: none)": {
|
52
52
|
backgroundColor: "transparent"
|
53
53
|
}
|
@@ -84,28 +84,28 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
84
84
|
} else if (props.variant === "containedLight" && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(props.color)) {
|
85
85
|
return {
|
86
86
|
color: props.disabled ? theme.palette.neutral.contrastText : props.color,
|
87
|
-
backgroundColor: (0, _colorManipulator.
|
87
|
+
backgroundColor: (0, _colorManipulator.alpha)(props.disabled ? theme.palette.neutral.main : props.color, theme.palette.action.hoverOpacity),
|
88
88
|
"&:hover": {
|
89
|
-
backgroundColor: (0, _colorManipulator.
|
89
|
+
backgroundColor: (0, _colorManipulator.alpha)(props.color, theme.palette.action.hoverOpacity + 0.1),
|
90
90
|
"@media (hover: none)": {
|
91
|
-
backgroundColor: (0, _colorManipulator.
|
91
|
+
backgroundColor: (0, _colorManipulator.alpha)(props.disabled ? theme.palette.neutral.main : props.color, theme.palette.action.hoverOpacity)
|
92
92
|
}
|
93
93
|
}
|
94
94
|
};
|
95
95
|
} else if (props.variant === "containedLight" // && is a palette color
|
96
96
|
) {
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
}
|
97
|
+
return {
|
98
|
+
color: props.disabled ? theme.palette.neutral.contrastText : theme.palette[props.color].main,
|
99
|
+
backgroundColor: (0, _colorManipulator.alpha)(props.disabled ? theme.palette.neutral.main : theme.palette[props.color].main, theme.palette.action.hoverOpacity),
|
100
|
+
'&:hover': {
|
101
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette[props.color].main, theme.palette.action.hoverOpacity + 0.1),
|
102
|
+
// Reset on touch devices, it doesn't add specificity
|
103
|
+
'@media (hover: none)': {
|
104
|
+
backgroundColor: (0, _colorManipulator.alpha)(props.disabled ? theme.palette.neutral.main : theme.palette[props.color].main, theme.palette.action.hoverOpacity)
|
106
105
|
}
|
107
|
-
}
|
108
|
-
}
|
106
|
+
}
|
107
|
+
};
|
108
|
+
}
|
109
109
|
|
110
110
|
return null;
|
111
111
|
},
|
@@ -113,19 +113,19 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
113
113
|
if (['neutral', 'positive', 'middle', 'negative'].includes(props.color)) {
|
114
114
|
return {
|
115
115
|
color: theme.palette[props.color].main,
|
116
|
-
border: "1px solid ".concat((0, _colorManipulator.
|
116
|
+
border: "1px solid ".concat((0, _colorManipulator.alpha)(theme.palette[props.color].main, 0.5)),
|
117
117
|
'&:hover': {
|
118
118
|
border: "1px solid ".concat(theme.palette[props.color].main),
|
119
|
-
backgroundColor: (0, _colorManipulator.
|
119
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette[props.color].main, theme.palette.action.hoverOpacity)
|
120
120
|
}
|
121
121
|
};
|
122
122
|
} else if (/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(props.color)) {
|
123
123
|
return {
|
124
124
|
color: props.color,
|
125
|
-
border: "1px solid ".concat((0, _colorManipulator.
|
125
|
+
border: "1px solid ".concat((0, _colorManipulator.alpha)(props.color, 0.5)),
|
126
126
|
"&:hover": {
|
127
127
|
border: "1px solid ".concat(props.color),
|
128
|
-
backgroundColor: (0, _colorManipulator.
|
128
|
+
backgroundColor: (0, _colorManipulator.alpha)(props.color, theme.palette.action.hoverOpacity)
|
129
129
|
}
|
130
130
|
};
|
131
131
|
}
|
@@ -160,8 +160,8 @@ function HiButton(props) {
|
|
160
160
|
var _color = (0, _react.useMemo)(function () {
|
161
161
|
if (['neutral', 'positive', 'middle', 'negative'].includes(color) || /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color) // isHexColor
|
162
162
|
) {
|
163
|
-
|
164
|
-
|
163
|
+
return "inherit";
|
164
|
+
}
|
165
165
|
|
166
166
|
return color;
|
167
167
|
}, [color]);
|
@@ -50,37 +50,37 @@ var styles = function styles(theme) {
|
|
50
50
|
/* Styles applied to the root element if `color="primary"`. */
|
51
51
|
colorPrimary: {
|
52
52
|
color: theme.palette.primary.main,
|
53
|
-
backgroundColor: (0, _colorManipulator.
|
53
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette.primary.main, 0.08)
|
54
54
|
},
|
55
55
|
|
56
56
|
/* Styles applied to the root element if `color="secondary"`. */
|
57
57
|
colorSecondary: {
|
58
58
|
color: theme.palette.secondary.main,
|
59
|
-
backgroundColor: (0, _colorManipulator.
|
59
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette.secondary.main, 0.08)
|
60
60
|
},
|
61
61
|
|
62
62
|
/* Styles applied to the root element if `color="positive"`. */
|
63
63
|
colorPositive: {
|
64
64
|
color: theme.palette.positive.main,
|
65
|
-
backgroundColor: (0, _colorManipulator.
|
65
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette.positive.main, 0.08)
|
66
66
|
},
|
67
67
|
|
68
68
|
/* Styles applied to the root element if `color="negative"`. */
|
69
69
|
colorNegative: {
|
70
70
|
color: theme.palette.negative.main,
|
71
|
-
backgroundColor: (0, _colorManipulator.
|
71
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette.negative.main, 0.08)
|
72
72
|
},
|
73
73
|
|
74
74
|
/* Styles applied to the root element if `color="middle"`. */
|
75
75
|
colorMiddle: {
|
76
76
|
color: theme.palette.middle.main,
|
77
|
-
backgroundColor: (0, _colorManipulator.
|
77
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette.middle.main, 0.08)
|
78
78
|
},
|
79
79
|
|
80
80
|
/* Styles applied to the root element if `color="neutral"`. */
|
81
81
|
colorNeutral: {
|
82
82
|
color: theme.palette.neutral.main,
|
83
|
-
backgroundColor: (0, _colorManipulator.
|
83
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette.neutral.main, 0.08)
|
84
84
|
},
|
85
85
|
activeColor: {
|
86
86
|
fontWeight: 500
|
@@ -155,7 +155,7 @@ function HiColoredLabel(props) {
|
|
155
155
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
156
156
|
className: (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.color, !active), (0, _defineProperty2.default)(_classNames, classes.activeColor, active), (0, _defineProperty2.default)(_classNames, classes.outlined, outlined), (0, _defineProperty2.default)(_classNames, classes["activeColor".concat((0, _helpers.capitalize)(color))], active && isHiColor), (0, _defineProperty2.default)(_classNames, classes["color".concat((0, _helpers.capitalize)(color))], !active && isHiColor), (0, _defineProperty2.default)(_classNames, classes.body1, fontSize >= 15), (0, _defineProperty2.default)(_classNames, classes.body2, fontSize === 14), (0, _defineProperty2.default)(_classNames, classes.body3, fontSize === 13), (0, _defineProperty2.default)(_classNames, classes.body4, fontSize === 12), (0, _defineProperty2.default)(_classNames, classes.body5, fontSize <= 11), _classNames), className),
|
157
157
|
style: (0, _objectSpread2.default)({}, style, {}, isHexColor && {
|
158
|
-
backgroundColor: active ? color : (0, _colorManipulator.
|
158
|
+
backgroundColor: active ? color : (0, _colorManipulator.alpha)(color, 0.08),
|
159
159
|
color: active ? theme.palette.getContrastText(color) : color
|
160
160
|
}, {}, fontWeight && {
|
161
161
|
fontWeight: fontWeight
|
@@ -188,7 +188,7 @@ var _default = function _default(theme) {
|
|
188
188
|
fontWeight: theme.typography.fontWeightMedium,
|
189
189
|
textTransform: 'uppercase',
|
190
190
|
'&:hover': {
|
191
|
-
backgroundColor: (0, _colorManipulator.
|
191
|
+
backgroundColor: (0, _colorManipulator.alpha)(theme.palette.neutral.dark, theme.palette.action.hoverOpacity),
|
192
192
|
// Reset on touch devices, it doesn't add specificity
|
193
193
|
'@media (hover: none)': {
|
194
194
|
backgroundColor: 'transparent'
|
@@ -237,7 +237,7 @@ var _default = function _default(theme) {
|
|
237
237
|
},
|
238
238
|
*/
|
239
239
|
selected: {
|
240
|
-
// backgroundColor:
|
240
|
+
// backgroundColor: alpha(theme.palette.business.primary.normal, 0.36),
|
241
241
|
backgroundColor: theme.palette.primary.main,
|
242
242
|
color: theme.palette.primary.contrastText,
|
243
243
|
borderRadius: '0%',
|
package/es/HiDialog/HiDialog.js
CHANGED
@@ -17,10 +17,6 @@ var _styles = require("@material-ui/core/styles");
|
|
17
17
|
|
18
18
|
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
19
19
|
|
20
|
-
var _Close = _interopRequireDefault(require("mdi-material-ui/Close"));
|
21
|
-
|
22
|
-
var _HiIconButton = _interopRequireDefault(require("../HiIconButton"));
|
23
|
-
|
24
20
|
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); }
|
25
21
|
|
26
22
|
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; }
|
@@ -30,34 +26,29 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
30
26
|
paper: {
|
31
27
|
backgroundColor: theme.palette.background3,
|
32
28
|
minWidth: 400,
|
33
|
-
maxWidth: 400,
|
34
29
|
borderRadius: 2,
|
35
|
-
padding: "
|
30
|
+
padding: "50px"
|
36
31
|
},
|
37
32
|
header: {
|
38
|
-
|
39
|
-
|
33
|
+
textAlign: "center",
|
34
|
+
marginBottom: 25
|
40
35
|
},
|
41
36
|
closeDiv: {
|
42
37
|
marginTop: theme.spacing(-2),
|
43
38
|
marginRight: theme.spacing(-6)
|
44
39
|
},
|
45
|
-
title: (0, _objectSpread2.default)({}, theme.typography.
|
46
|
-
|
47
|
-
|
48
|
-
}
|
40
|
+
title: (0, _objectSpread2.default)({}, theme.typography.h1, {
|
41
|
+
margin: 0
|
42
|
+
})
|
49
43
|
};
|
50
44
|
});
|
51
45
|
|
52
|
-
var _ref = /*#__PURE__*/_react.default.createElement(_Close.default, null);
|
53
|
-
|
54
46
|
var HiDialog = function HiDialog(props) {
|
55
47
|
var content = props.content,
|
56
48
|
id = props.id,
|
57
49
|
onClose = props.onClose,
|
58
50
|
open = props.open,
|
59
|
-
title = props.title
|
60
|
-
closeBtn = props.closeBtn;
|
51
|
+
title = props.title;
|
61
52
|
var classes = useStyles(props);
|
62
53
|
var handleClose = (0, _react.useCallback)(function () {
|
63
54
|
if (onClose) {
|
@@ -75,14 +66,7 @@ var HiDialog = function HiDialog(props) {
|
|
75
66
|
className: classes.header
|
76
67
|
}, typeof title === "string" ? /*#__PURE__*/_react.default.createElement("p", {
|
77
68
|
className: classes.title
|
78
|
-
}, title) : title,
|
79
|
-
className: classes.closeDiv
|
80
|
-
}, /*#__PURE__*/_react.default.createElement(_HiIconButton.default, {
|
81
|
-
id: "close-dialog-btn",
|
82
|
-
onClick: onClose
|
83
|
-
}, _ref))), /*#__PURE__*/_react.default.createElement("div", {
|
84
|
-
className: classes.content
|
85
|
-
}, content));
|
69
|
+
}, title) : title), /*#__PURE__*/_react.default.createElement("div", null, content));
|
86
70
|
};
|
87
71
|
|
88
72
|
var _default = HiDialog;
|
@@ -21,11 +21,11 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/
|
|
21
21
|
|
22
22
|
var _react = _interopRequireWildcard(require("react"));
|
23
23
|
|
24
|
-
var
|
24
|
+
var _Accordion = _interopRequireDefault(require("@material-ui/core/Accordion"));
|
25
25
|
|
26
|
-
var
|
26
|
+
var _AccordionSummary = _interopRequireDefault(require("@material-ui/core/AccordionSummary"));
|
27
27
|
|
28
|
-
var
|
28
|
+
var _AccordionDetails = _interopRequireDefault(require("@material-ui/core/AccordionDetails"));
|
29
29
|
|
30
30
|
var _styles = require("@material-ui/core/styles");
|
31
31
|
|
@@ -138,7 +138,7 @@ function HiExpansionPanel(props) {
|
|
138
138
|
setPanelDetailsExited = _useState2[1];
|
139
139
|
|
140
140
|
var effectiveDisabled = disabled || !children;
|
141
|
-
return /*#__PURE__*/_react.default.createElement(
|
141
|
+
return /*#__PURE__*/_react.default.createElement(_Accordion.default, (0, _extends2.default)({
|
142
142
|
disabled: effectiveDisabled,
|
143
143
|
expanded: collapseDisable || expanded,
|
144
144
|
TransitionProps: (0, _objectSpread2.default)({
|
@@ -154,7 +154,7 @@ function HiExpansionPanel(props) {
|
|
154
154
|
root: classes.panel,
|
155
155
|
disabled: classes.disabledPanel
|
156
156
|
}
|
157
|
-
}), /*#__PURE__*/_react.default.createElement(
|
157
|
+
}), /*#__PURE__*/_react.default.createElement(_AccordionSummary.default, {
|
158
158
|
classes: {
|
159
159
|
root: classes.summaryRoot,
|
160
160
|
content: classes.summaryContent,
|
@@ -169,7 +169,7 @@ function HiExpansionPanel(props) {
|
|
169
169
|
className: classes.secondaryHeading
|
170
170
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
171
171
|
className: classes.secondaryHeadingSpan
|
172
|
-
}, !effectiveDisabled ? secondaryHeading : secondaryHeadingDisabled), secondaryHeadingIcon)), !!children && /*#__PURE__*/_react.default.createElement(
|
172
|
+
}, !effectiveDisabled ? secondaryHeading : secondaryHeadingDisabled), secondaryHeadingIcon)), !!children && /*#__PURE__*/_react.default.createElement(_AccordionDetails.default, {
|
173
173
|
className: (0, _classnames.default)(classes.panelDetails, (0, _defineProperty2.default)({}, classes.panelDetailsExited, panelDetailsExited))
|
174
174
|
}, children));
|
175
175
|
}
|