@hipay/hipay-material-ui 2.0.0-beta.51 → 2.0.0-beta.53

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.
@@ -132,6 +132,7 @@ export default function createPalette(palette) {
132
132
  contrastText: '#FFFFFF'
133
133
  },
134
134
  negative = {
135
+ ultraLight: '#EA9494',
135
136
  light: '#E66666',
136
137
  main: '#D50000',
137
138
  dark: '#A00000',
@@ -144,6 +145,7 @@ export default function createPalette(palette) {
144
145
  contrastText: '#FFFFFF'
145
146
  },
146
147
  neutral = {
148
+ ultraLight: '#8B8B8B',
147
149
  light: '#838383',
148
150
  main: '#737373',
149
151
  dark: '#20272B',
@@ -154,13 +156,17 @@ export default function createPalette(palette) {
154
156
  main: red[500],
155
157
  dark: red[700]
156
158
  },
159
+ lookup = {
160
+ light: '#FFFF8D',
161
+ main: '#EDED14'
162
+ },
157
163
  type = 'light',
158
- contrastThreshold = 2.9,
164
+ contrastThreshold = 2.8,
159
165
  // max light contrast
160
166
  tonalOffset = 0.2,
161
167
  context = 'local'
162
168
  } = palette,
163
- other = _objectWithoutProperties(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "type", "contrastThreshold", "tonalOffset", "context"]);
169
+ other = _objectWithoutProperties(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "lookup", "type", "contrastThreshold", "tonalOffset", "context"]);
164
170
 
165
171
  function getContrastText(background) {
166
172
  // Use the same logic as
@@ -170,7 +176,7 @@ export default function createPalette(palette) {
170
176
 
171
177
  if (process.env.NODE_ENV !== 'production') {
172
178
  const contrast = getContrastRatio(background, contrastText);
173
- process.env.NODE_ENV !== "production" ? warning(contrast >= 3, [`Material-UI: the contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n')) : void 0;
179
+ process.env.NODE_ENV !== "production" ? warning(contrast >= 2.8, [`Material-UI: the contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n')) : void 0;
174
180
  }
175
181
 
176
182
  return contrastText;
@@ -225,6 +231,8 @@ export default function createPalette(palette) {
225
231
  neutral,
226
232
  // The colors used to represent interface elements that the user should be made aware of.
227
233
  error,
234
+ // The colors used to represent form elements that have lookup state.
235
+ lookup,
228
236
  // The grey colors.
229
237
  grey,
230
238
  // Used by `getContrastText()` to maximize the contrast between the background and
package/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.51
1
+ /** @license HiPay-Material-UI v2.0.0-beta.53
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.51
1
+ /** @license HiPay-Material-UI v2.0.0-beta.53
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@hipay/hipay-material-ui",
3
3
  "private": false,
4
4
  "author": "HiPay PSYCHE Team",
5
- "version": "2.0.0-beta.51",
5
+ "version": "2.0.0-beta.53",
6
6
  "description": "React components that implement Google's Material Design.",
7
7
  "keywords": [
8
8
  "react",
@@ -48,6 +48,7 @@
48
48
  "jss-vendor-prefixer": "^8.0.1",
49
49
  "keycode": "^2.1.9",
50
50
  "mdi-material-ui": "^5.4.0",
51
+ "moment": "^2.22.2",
51
52
  "normalize-scroll-left": "^0.1.2",
52
53
  "popper.js": "^1.14.1",
53
54
  "prop-types": "^15.6.0",
@@ -155,6 +155,7 @@ function createPalette(palette) {
155
155
  } : _palette$positive,
156
156
  _palette$negative = palette.negative,
157
157
  negative = _palette$negative === void 0 ? {
158
+ ultraLight: '#EA9494',
158
159
  light: '#E66666',
159
160
  main: '#D50000',
160
161
  dark: '#A00000',
@@ -169,6 +170,7 @@ function createPalette(palette) {
169
170
  } : _palette$middle,
170
171
  _palette$neutral = palette.neutral,
171
172
  neutral = _palette$neutral === void 0 ? {
173
+ ultraLight: '#8B8B8B',
172
174
  light: '#838383',
173
175
  main: '#737373',
174
176
  dark: '#20272B',
@@ -180,15 +182,20 @@ function createPalette(palette) {
180
182
  main: _red.default[500],
181
183
  dark: _red.default[700]
182
184
  } : _palette$error,
185
+ _palette$lookup = palette.lookup,
186
+ lookup = _palette$lookup === void 0 ? {
187
+ light: '#FFFF8D',
188
+ main: '#EDED14'
189
+ } : _palette$lookup,
183
190
  _palette$type = palette.type,
184
191
  type = _palette$type === void 0 ? 'light' : _palette$type,
185
192
  _palette$contrastThre = palette.contrastThreshold,
186
- contrastThreshold = _palette$contrastThre === void 0 ? 2.9 : _palette$contrastThre,
193
+ contrastThreshold = _palette$contrastThre === void 0 ? 2.8 : _palette$contrastThre,
187
194
  _palette$tonalOffset = palette.tonalOffset,
188
195
  tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,
189
196
  _palette$context = palette.context,
190
197
  context = _palette$context === void 0 ? 'local' : _palette$context,
191
- other = (0, _objectWithoutProperties2.default)(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "type", "contrastThreshold", "tonalOffset", "context"]);
198
+ other = (0, _objectWithoutProperties2.default)(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "lookup", "type", "contrastThreshold", "tonalOffset", "context"]);
192
199
 
193
200
  function getContrastText(background) {
194
201
  // Use the same logic as
@@ -198,7 +205,7 @@ function createPalette(palette) {
198
205
 
199
206
  if (process.env.NODE_ENV !== 'production') {
200
207
  var contrast = (0, _colorManipulator.getContrastRatio)(background, contrastText);
201
- process.env.NODE_ENV !== "production" ? (0, _warning.default)(contrast >= 3, ["Material-UI: the contrast ratio of ".concat(contrast, ":1 for ").concat(contrastText, " on ").concat(background), 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n')) : void 0;
208
+ process.env.NODE_ENV !== "production" ? (0, _warning.default)(contrast >= 2.8, ["Material-UI: the contrast ratio of ".concat(contrast, ":1 for ").concat(contrastText, " on ").concat(background), 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n')) : void 0;
202
209
  }
203
210
 
204
211
  return contrastText;
@@ -257,6 +264,8 @@ function createPalette(palette) {
257
264
  neutral: neutral,
258
265
  // The colors used to represent interface elements that the user should be made aware of.
259
266
  error: error,
267
+ // The colors used to represent form elements that have lookup state.
268
+ lookup: lookup,
260
269
  // The grey colors.
261
270
  grey: _grey.default,
262
271
  // Used by `getContrastText()` to maximize the contrast between the background and
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.51
1
+ /** @license HiPay-Material-UI v2.0.0-beta.53
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -1086,6 +1086,7 @@
1086
1086
  } : _palette$positive,
1087
1087
  _palette$negative = palette.negative,
1088
1088
  negative = _palette$negative === void 0 ? {
1089
+ ultraLight: '#EA9494',
1089
1090
  light: '#E66666',
1090
1091
  main: '#D50000',
1091
1092
  dark: '#A00000',
@@ -1100,6 +1101,7 @@
1100
1101
  } : _palette$middle,
1101
1102
  _palette$neutral = palette.neutral,
1102
1103
  neutral = _palette$neutral === void 0 ? {
1104
+ ultraLight: '#8B8B8B',
1103
1105
  light: '#838383',
1104
1106
  main: '#737373',
1105
1107
  dark: '#20272B',
@@ -1111,15 +1113,20 @@
1111
1113
  main: red[500],
1112
1114
  dark: red[700]
1113
1115
  } : _palette$error,
1116
+ _palette$lookup = palette.lookup,
1117
+ lookup = _palette$lookup === void 0 ? {
1118
+ light: '#FFFF8D',
1119
+ main: '#EDED14'
1120
+ } : _palette$lookup,
1114
1121
  _palette$type = palette.type,
1115
1122
  type = _palette$type === void 0 ? 'light' : _palette$type,
1116
1123
  _palette$contrastThre = palette.contrastThreshold,
1117
- contrastThreshold = _palette$contrastThre === void 0 ? 2.9 : _palette$contrastThre,
1124
+ contrastThreshold = _palette$contrastThre === void 0 ? 2.8 : _palette$contrastThre,
1118
1125
  _palette$tonalOffset = palette.tonalOffset,
1119
1126
  tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,
1120
1127
  _palette$context = palette.context,
1121
1128
  context = _palette$context === void 0 ? 'local' : _palette$context,
1122
- other = objectWithoutProperties(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "type", "contrastThreshold", "tonalOffset", "context"]);
1129
+ other = objectWithoutProperties(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "lookup", "type", "contrastThreshold", "tonalOffset", "context"]);
1123
1130
 
1124
1131
  function getContrastText(background) {
1125
1132
  // Use the same logic as
@@ -1129,7 +1136,7 @@
1129
1136
 
1130
1137
  {
1131
1138
  var contrast = getContrastRatio(background, contrastText);
1132
- warning_1(contrast >= 3, ["Material-UI: the contrast ratio of ".concat(contrast, ":1 for ").concat(contrastText, " on ").concat(background), 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n'));
1139
+ warning_1(contrast >= 2.8, ["Material-UI: the contrast ratio of ".concat(contrast, ":1 for ").concat(contrastText, " on ").concat(background), 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n'));
1133
1140
  }
1134
1141
 
1135
1142
  return contrastText;
@@ -1188,6 +1195,8 @@
1188
1195
  neutral: neutral,
1189
1196
  // The colors used to represent interface elements that the user should be made aware of.
1190
1197
  error: error,
1198
+ // The colors used to represent form elements that have lookup state.
1199
+ lookup: lookup,
1191
1200
  // The grey colors.
1192
1201
  grey: grey,
1193
1202
  // Used by `getContrastText()` to maximize the contrast between the background and
@@ -66090,8 +66099,8 @@
66090
66099
 
66091
66100
  var HiCheckbox =
66092
66101
  /*#__PURE__*/
66093
- function (_React$Component) {
66094
- inherits(HiCheckbox, _React$Component);
66102
+ function (_React$PureComponent) {
66103
+ inherits(HiCheckbox, _React$PureComponent);
66095
66104
 
66096
66105
  function HiCheckbox(props) {
66097
66106
  var _this;
@@ -66178,7 +66187,7 @@
66178
66187
  }]);
66179
66188
 
66180
66189
  return HiCheckbox;
66181
- }(React__default.Component);
66190
+ }(React__default.PureComponent);
66182
66191
 
66183
66192
  HiCheckbox.defaultProps = {
66184
66193
  checked: false,
@@ -66313,7 +66322,8 @@
66313
66322
  '&:hover, &:focus': {
66314
66323
  backgroundColor: theme.palette.primary.main,
66315
66324
  color: theme.palette.grey[300]
66316
- }
66325
+ },
66326
+ position: 'relative'
66317
66327
  },
66318
66328
  badge: {
66319
66329
  height: 16,
@@ -66333,7 +66343,7 @@
66333
66343
  function HiChip(props) {
66334
66344
  var _classNames;
66335
66345
 
66336
- var label = props.label,
66346
+ var className = props.className,
66337
66347
  classes = props.classes,
66338
66348
  fallbackImage = props.fallbackImage,
66339
66349
  icon = props.icon,
@@ -66341,6 +66351,7 @@
66341
66351
  iconSize = _props$iconSize === void 0 ? 20 : _props$iconSize,
66342
66352
  id = props.id,
66343
66353
  img = props.img,
66354
+ label = props.label,
66344
66355
  onPrevious = props.onPrevious,
66345
66356
  onNext = props.onNext,
66346
66357
  onDelete = props.onDelete,
@@ -66354,7 +66365,7 @@
66354
66365
  titlePrevious = props.titlePrevious;
66355
66366
  return React__default.createElement("div", {
66356
66367
  id: id,
66357
- className: classnames(classes.root, (_classNames = {}, defineProperty(_classNames, classes.leftNavigation, onPrevious), defineProperty(_classNames, classes.rightNavigation, onNext), defineProperty(_classNames, classes.deletable, onDelete), defineProperty(_classNames, classes.leftIcon, icon), _classNames)),
66368
+ className: classnames(classes.root, className, (_classNames = {}, defineProperty(_classNames, classes.leftNavigation, onPrevious), defineProperty(_classNames, classes.rightNavigation, onNext), defineProperty(_classNames, classes.deletable, onDelete), defineProperty(_classNames, classes.leftIcon, icon), _classNames)),
66358
66369
  title: title$$1
66359
66370
  }, icon && React__default.createElement(HiIcon$1, {
66360
66371
  className: classnames(classes.icon, defineProperty({}, classes.iconClickable, onIconClick)),
@@ -66423,6 +66434,11 @@
66423
66434
  */
66424
66435
  classes: propTypes.object,
66425
66436
 
66437
+ /**
66438
+ * Surcharge les classes du composant
66439
+ */
66440
+ className: propTypes.object,
66441
+
66426
66442
  /**
66427
66443
  * Chemin vers l'image à afficher par défaut si une image n'est pas trouvée
66428
66444
  */
@@ -80415,6 +80431,9 @@
80415
80431
  '&:hover, &:focus': {
80416
80432
  backgroundColor: "".concat(theme.palette.action.hover, " !important")
80417
80433
  }
80434
+ },
80435
+ clicableRow: {
80436
+ cursor: 'pointer'
80418
80437
  }
80419
80438
  };
80420
80439
  };
@@ -80454,7 +80473,7 @@
80454
80473
  locale = _this$props.locale,
80455
80474
  rowdata = _this$props.rowdata;
80456
80475
  return React__default.createElement(TableRow$4, {
80457
- className: classes.row,
80476
+ className: classnames(classes.row, defineProperty({}, classes.clicableRow, this.props.onClick)),
80458
80477
  hover: true,
80459
80478
  onClick: function onClick(event) {
80460
80479
  return _this2.handleClick(event, rowdata);
@@ -80471,10 +80490,10 @@
80471
80490
  height: dense ? CELL_HEIGHT_DENSE : CELL_HEIGHT
80472
80491
  },
80473
80492
  tabIndex: 0
80474
- }, Object.keys(columns).map(function (key) {
80493
+ }, Object.keys(columns).map(function (column) {
80475
80494
  return React__default.createElement(HiCellBuilder, {
80476
- key: columns[key].colId,
80477
- column: columns[key],
80495
+ key: columns[column].colId,
80496
+ column: columns[column],
80478
80497
  data: rowdata,
80479
80498
  locale: locale
80480
80499
  });
@@ -94066,14 +94085,15 @@
94066
94085
  color = props.color,
94067
94086
  active = props.active,
94068
94087
  fontWeight = props.fontWeight,
94088
+ style = props.style,
94069
94089
  theme = props.theme,
94070
- other = objectWithoutProperties(props, ["classes", "className", "label", "color", "active", "fontWeight", "theme"]);
94090
+ other = objectWithoutProperties(props, ["classes", "className", "label", "color", "active", "fontWeight", "style", "theme"]);
94071
94091
 
94072
94092
  var isHiColor = ['primary', 'secondary', 'positive', 'negative', 'middle', 'neutral'].includes(color);
94073
94093
  var isHexColor = !isHiColor && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color);
94074
94094
  return React__default.createElement("div", _extends_1({
94075
94095
  className: classnames(classes.root, (_classNames = {}, defineProperty(_classNames, classes.color, !active), defineProperty(_classNames, classes.activeColor, active), defineProperty(_classNames, classes["activeColor".concat(capitalize(color))], active && isHiColor), defineProperty(_classNames, classes["color".concat(capitalize(color))], !active && isHiColor), _classNames), className),
94076
- style: _extends_1({}, isHexColor && {
94096
+ style: _extends_1({}, style, isHexColor && {
94077
94097
  backgroundColor: active ? color : fade(color, 0.08),
94078
94098
  color: active ? theme.palette.getContrastText(color) : color
94079
94099
  }, fontWeight && {
@@ -97966,6 +97986,8 @@
97966
97986
  name: 'HmuiHiLoader'
97967
97987
  })(HiLoader);
97968
97988
 
97989
+ var PureListSubheader = pure(ListSubheader$2);
97990
+ var PureListItem = pure(ListItem$2);
97969
97991
  var styles$p = function styles(theme) {
97970
97992
  return {
97971
97993
  root: {
@@ -98088,8 +98110,8 @@
98088
98110
 
98089
98111
  var HiSelectableListItem =
98090
98112
  /*#__PURE__*/
98091
- function (_React$Component) {
98092
- inherits(HiSelectableListItem, _React$Component);
98113
+ function (_React$PureComponent) {
98114
+ inherits(HiSelectableListItem, _React$PureComponent);
98093
98115
 
98094
98116
  function HiSelectableListItem(props) {
98095
98117
  var _this;
@@ -98175,6 +98197,7 @@
98175
98197
  fallbackImage = _this$props2.fallbackImage,
98176
98198
  hideCheckbox = _this$props2.hideCheckbox,
98177
98199
  onSelect = _this$props2.onSelect,
98200
+ onKeyDown = _this$props2.onKeyDown,
98178
98201
  indeterminate = _this$props2.indeterminate,
98179
98202
  indeterminateIcon = _this$props2.indeterminateIcon,
98180
98203
  icon = _this$props2.icon,
@@ -98207,7 +98230,7 @@
98207
98230
  displayedIcon = icon;
98208
98231
  }
98209
98232
 
98210
- var ListItemComponentName = pinned ? ListSubheader$2 : ListItem$2;
98233
+ var ListItemComponentName = pinned ? PureListSubheader : PureListItem;
98211
98234
  return React__default.createElement(ListItemComponentName, _extends_1({
98212
98235
  id: id,
98213
98236
  tabIndex: disabled ? '-1' : 0,
@@ -98220,12 +98243,14 @@
98220
98243
  }, disabled || {
98221
98244
  onClick: onSelect,
98222
98245
  onMouseEnter: this.setHover(true),
98223
- onMouseLeave: this.setHover(false)
98246
+ onMouseLeave: this.setHover(false),
98247
+ onKeyDown: onKeyDown
98224
98248
  }, {
98225
98249
  style: {
98226
98250
  paddingLeft: "".concat(paddingLeft + level * 32, "px")
98227
98251
  }
98228
98252
  }), !hideCheckbox && !pinned && React__default.createElement(HiCheckbox$1, {
98253
+ tabIndex: onKeyDown ? '-1' : 0,
98229
98254
  checked: selected,
98230
98255
  checkedIcon: checkedIcon,
98231
98256
  classes: {
@@ -98262,7 +98287,7 @@
98262
98287
  }]);
98263
98288
 
98264
98289
  return HiSelectableListItem;
98265
- }(React__default.Component);
98290
+ }(React__default.PureComponent);
98266
98291
 
98267
98292
  HiSelectableListItem.defaultProps = {
98268
98293
  centered: false,
@@ -98370,6 +98395,11 @@
98370
98395
  */
98371
98396
  onSelect: propTypes.func,
98372
98397
 
98398
+ /**
98399
+ * Fonction de callback à la sélection de l'élément
98400
+ */
98401
+ onKeyDown: propTypes.func,
98402
+
98373
98403
  /**
98374
98404
  * Padding par défaut des éléments
98375
98405
  */