@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/prod.js CHANGED
@@ -28569,6 +28569,30 @@ exports.default = _default;
28569
28569
 
28570
28570
  var CancelIcon$1 = unwrapExports(Cancel);
28571
28571
 
28572
+ var ArrowDropDown = createCommonjsModule(function (module, exports) {
28573
+
28574
+
28575
+
28576
+
28577
+
28578
+ Object.defineProperty(exports, "__esModule", {
28579
+ value: true
28580
+ });
28581
+ exports.default = void 0;
28582
+
28583
+ var React = interopRequireWildcard(React__default);
28584
+
28585
+ var _createSvgIcon = interopRequireDefault(createSvgIcon$1);
28586
+
28587
+ var _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement("path", {
28588
+ d: "M7 10l5 5 5-5z"
28589
+ }), 'ArrowDropDown');
28590
+
28591
+ exports.default = _default;
28592
+ });
28593
+
28594
+ var ArrowDropDownIcon$1 = unwrapExports(ArrowDropDown);
28595
+
28572
28596
  var useStyles$5 = makeStyles$1(function (theme) {
28573
28597
  return {
28574
28598
  chip: {
@@ -30648,6 +30672,11 @@ var defaultComponents$1 = {
30648
30672
  MultiValueRemove: function MultiValueRemove(removeProps) {
30649
30673
  return React__default.createElement(CancelIcon$1, removeProps);
30650
30674
  }
30675
+ };
30676
+
30677
+ var ICON_VARIANTS = {
30678
+ dark: 'dark',
30679
+ light: 'light'
30651
30680
 
30652
30681
  /**
30653
30682
  * USelectPicker is a control for selecting a option from a list. Has the features below:
@@ -30678,7 +30707,8 @@ var defaultComponents$1 = {
30678
30707
  isDisabled = props.isDisabled,
30679
30708
  menuIsOpen = props.menuIsOpen,
30680
30709
  placeholder = props.placeholder,
30681
- others = objectWithoutProperties(props, ['label', 'variant', 'TextFieldProps', 'showNoOptionsWithEmptyTextField', 'onInputChange', 'components', 'showLabelHelp', 'InputLabelProps', 'InputLabelHelpProps', 'hideAvatar', 'readOnly', 'lineByLineOption', 'isClearable', 'isSearchable', 'isDisabled', 'menuIsOpen', 'placeholder']);
30710
+ iconVariant = props.iconVariant,
30711
+ others = objectWithoutProperties(props, ['label', 'variant', 'TextFieldProps', 'showNoOptionsWithEmptyTextField', 'onInputChange', 'components', 'showLabelHelp', 'InputLabelProps', 'InputLabelHelpProps', 'hideAvatar', 'readOnly', 'lineByLineOption', 'isClearable', 'isSearchable', 'isDisabled', 'menuIsOpen', 'placeholder', 'iconVariant']);
30682
30712
 
30683
30713
  var _useState = React.useState(true),
30684
30714
  _useState2 = slicedToArray(_useState, 2),
@@ -30688,6 +30718,7 @@ var defaultComponents$1 = {
30688
30718
  var selectStyles = {
30689
30719
  input: function input(base) {
30690
30720
  return _extends$1({}, base, {
30721
+ height: iconVariant === ICON_VARIANTS.dark ? theme.spacing(4) : 'inherit', // if dark variant, then match height with material ui controls
30691
30722
  color: theme.palette.text.primary,
30692
30723
  '& input': {
30693
30724
  font: 'inherit'
@@ -30724,11 +30755,17 @@ var defaultComponents$1 = {
30724
30755
  onInputChange && onInputChange(value);
30725
30756
  };
30726
30757
 
30727
- var extraComponents = readOnly ? {
30728
- DropdownIndicator: function DropdownIndicator() {
30729
- return null;
30730
- }
30731
- } : {};
30758
+ var extraComponents = {};
30759
+ if (iconVariant === ICON_VARIANTS.dark) extraComponents.DropdownIndicator = function () {
30760
+ return React__default.createElement(
30761
+ 'span',
30762
+ { style: { color: theme.palette.text.secondary } },
30763
+ React__default.createElement(ArrowDropDownIcon$1, null)
30764
+ );
30765
+ };
30766
+ if (readOnly) extraComponents.DropdownIndicator = function () {
30767
+ return null;
30768
+ };
30732
30769
 
30733
30770
  var selectPlaceholder = readOnly ? '' : placeholder;
30734
30771
 
@@ -30819,7 +30856,9 @@ USelectPicker.propTypes = {
30819
30856
  /** Whether the input is disabled */
30820
30857
  isDisabled: PropTypes__default.bool,
30821
30858
  /** Whether the menu is open */
30822
- menuIsOpen: PropTypes__default.bool
30859
+ menuIsOpen: PropTypes__default.bool,
30860
+ /** Down arrow variant */
30861
+ iconVariant: PropTypes__default.oneOf([ICON_VARIANTS.dark, ICON_VARIANTS.light])
30823
30862
  };
30824
30863
 
30825
30864
  USelectPicker.defaultProps = {
@@ -30835,7 +30874,8 @@ USelectPicker.defaultProps = {
30835
30874
  isSearchable: true,
30836
30875
  isDisabled: false,
30837
30876
  menuIsOpen: undefined,
30838
- lineByLineOption: false
30877
+ lineByLineOption: false,
30878
+ iconVariant: ICON_VARIANTS.light
30839
30879
  };
30840
30880
 
30841
30881
  /**
@@ -43414,7 +43454,7 @@ var Alert$1 = withStyles$1(styles$14, {
43414
43454
  * @ignore - internal component.
43415
43455
  */
43416
43456
 
43417
- var ArrowDropDownIcon$1 = createSvgIcon( /*#__PURE__*/React.createElement("path", {
43457
+ var ArrowDropDownIcon$2 = createSvgIcon( /*#__PURE__*/React.createElement("path", {
43418
43458
  d: "M7 10l5 5 5-5z"
43419
43459
  }));
43420
43460
 
@@ -44692,7 +44732,7 @@ var _ref$4 = /*#__PURE__*/React.createElement(CloseIcon, {
44692
44732
  fontSize: "small"
44693
44733
  });
44694
44734
 
44695
- var _ref2$3 = /*#__PURE__*/React.createElement(ArrowDropDownIcon$1, null);
44735
+ var _ref2$3 = /*#__PURE__*/React.createElement(ArrowDropDownIcon$2, null);
44696
44736
 
44697
44737
  var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(props, ref) {
44698
44738
  /* eslint-disable no-unused-vars */