@unicef/material-ui 0.11.6 → 0.11.8

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/lib/dev.js CHANGED
@@ -35128,6 +35128,30 @@ exports.default = _default;
35128
35128
 
35129
35129
  var CancelIcon$1 = unwrapExports(Cancel);
35130
35130
 
35131
+ var ArrowDropDown = createCommonjsModule(function (module, exports) {
35132
+
35133
+
35134
+
35135
+
35136
+
35137
+ Object.defineProperty(exports, "__esModule", {
35138
+ value: true
35139
+ });
35140
+ exports.default = void 0;
35141
+
35142
+ var React = interopRequireWildcard(React__default);
35143
+
35144
+ var _createSvgIcon = interopRequireDefault(createSvgIcon$1);
35145
+
35146
+ var _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement("path", {
35147
+ d: "M7 10l5 5 5-5z"
35148
+ }), 'ArrowDropDown');
35149
+
35150
+ exports.default = _default;
35151
+ });
35152
+
35153
+ var ArrowDropDownIcon$1 = unwrapExports(ArrowDropDown);
35154
+
35131
35155
  var useStyles$5 = makeStyles$1(function (theme) {
35132
35156
  return {
35133
35157
  chip: {
@@ -37207,6 +37231,11 @@ var defaultComponents$1 = {
37207
37231
  MultiValueRemove: function MultiValueRemove(removeProps) {
37208
37232
  return React__default.createElement(CancelIcon$1, removeProps);
37209
37233
  }
37234
+ };
37235
+
37236
+ var ICON_VARIANTS = {
37237
+ dark: 'dark',
37238
+ light: 'light'
37210
37239
 
37211
37240
  /**
37212
37241
  * USelectPicker is a control for selecting a option from a list. Has the features below:
@@ -37237,7 +37266,8 @@ var defaultComponents$1 = {
37237
37266
  isDisabled = props.isDisabled,
37238
37267
  menuIsOpen = props.menuIsOpen,
37239
37268
  placeholder = props.placeholder,
37240
- others = objectWithoutProperties(props, ['label', 'variant', 'TextFieldProps', 'showNoOptionsWithEmptyTextField', 'onInputChange', 'components', 'showLabelHelp', 'InputLabelProps', 'InputLabelHelpProps', 'hideAvatar', 'readOnly', 'lineByLineOption', 'isClearable', 'isSearchable', 'isDisabled', 'menuIsOpen', 'placeholder']);
37269
+ iconVariant = props.iconVariant,
37270
+ others = objectWithoutProperties(props, ['label', 'variant', 'TextFieldProps', 'showNoOptionsWithEmptyTextField', 'onInputChange', 'components', 'showLabelHelp', 'InputLabelProps', 'InputLabelHelpProps', 'hideAvatar', 'readOnly', 'lineByLineOption', 'isClearable', 'isSearchable', 'isDisabled', 'menuIsOpen', 'placeholder', 'iconVariant']);
37241
37271
 
37242
37272
  var _useState = React.useState(true),
37243
37273
  _useState2 = slicedToArray(_useState, 2),
@@ -37247,6 +37277,7 @@ var defaultComponents$1 = {
37247
37277
  var selectStyles = {
37248
37278
  input: function input(base) {
37249
37279
  return _extends$1({}, base, {
37280
+ height: iconVariant === ICON_VARIANTS.dark ? theme.spacing(4) : 'inherit', // if dark variant, then match height with material ui controls
37250
37281
  color: theme.palette.text.primary,
37251
37282
  '& input': {
37252
37283
  font: 'inherit'
@@ -37283,11 +37314,17 @@ var defaultComponents$1 = {
37283
37314
  onInputChange && onInputChange(value);
37284
37315
  };
37285
37316
 
37286
- var extraComponents = readOnly ? {
37287
- DropdownIndicator: function DropdownIndicator() {
37288
- return null;
37289
- }
37290
- } : {};
37317
+ var extraComponents = {};
37318
+ if (iconVariant === ICON_VARIANTS.dark) extraComponents.DropdownIndicator = function () {
37319
+ return React__default.createElement(
37320
+ 'span',
37321
+ { style: { color: theme.palette.text.secondary } },
37322
+ React__default.createElement(ArrowDropDownIcon$1, null)
37323
+ );
37324
+ };
37325
+ if (readOnly) extraComponents.DropdownIndicator = function () {
37326
+ return null;
37327
+ };
37291
37328
 
37292
37329
  var selectPlaceholder = readOnly ? '' : placeholder;
37293
37330
 
@@ -37378,7 +37415,9 @@ USelectPicker.propTypes = {
37378
37415
  /** Whether the input is disabled */
37379
37416
  isDisabled: PropTypes__default.bool,
37380
37417
  /** Whether the menu is open */
37381
- menuIsOpen: PropTypes__default.bool
37418
+ menuIsOpen: PropTypes__default.bool,
37419
+ /** Down arrow variant */
37420
+ iconVariant: PropTypes__default.oneOf([ICON_VARIANTS.dark, ICON_VARIANTS.light])
37382
37421
  };
37383
37422
 
37384
37423
  USelectPicker.defaultProps = {
@@ -37394,7 +37433,8 @@ USelectPicker.defaultProps = {
37394
37433
  isSearchable: true,
37395
37434
  isDisabled: false,
37396
37435
  menuIsOpen: undefined,
37397
- lineByLineOption: false
37436
+ lineByLineOption: false,
37437
+ iconVariant: ICON_VARIANTS.light
37398
37438
  };
37399
37439
 
37400
37440
  /**
@@ -50126,7 +50166,7 @@ var Alert$1 = withStyles$1(styles$14, {
50126
50166
  * @ignore - internal component.
50127
50167
  */
50128
50168
 
50129
- var ArrowDropDownIcon$1 = createSvgIcon( /*#__PURE__*/React.createElement("path", {
50169
+ var ArrowDropDownIcon$2 = createSvgIcon( /*#__PURE__*/React.createElement("path", {
50130
50170
  d: "M7 10l5 5 5-5z"
50131
50171
  }), 'ArrowDropDown');
50132
50172
 
@@ -51452,7 +51492,7 @@ var _ref$4 = /*#__PURE__*/React.createElement(CloseIcon, {
51452
51492
  fontSize: "small"
51453
51493
  });
51454
51494
 
51455
- var _ref2$3 = /*#__PURE__*/React.createElement(ArrowDropDownIcon$1, null);
51495
+ var _ref2$3 = /*#__PURE__*/React.createElement(ArrowDropDownIcon$2, null);
51456
51496
 
51457
51497
  var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(props, ref) {
51458
51498
  /* eslint-disable no-unused-vars */