pebble-web 2.10.0 → 2.11.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.
@@ -1521,6 +1521,7 @@
1521
1521
  PebbleIcon["Play"] = "play";
1522
1522
  PebbleIcon["Plus"] = "plus";
1523
1523
  PebbleIcon["PossessionLetter"] = "possession-letter";
1524
+ PebbleIcon["PostSales"] = "post-sales";
1524
1525
  PebbleIcon["Premium"] = "premium";
1525
1526
  PebbleIcon["Print"] = "print";
1526
1527
  PebbleIcon["PriorityChange"] = "priority-change";
@@ -9813,17 +9814,18 @@
9813
9814
  isSelected = _this$props.isSelected,
9814
9815
  disabled = _this$props.disabled,
9815
9816
  labelClassName = _this$props.labelClassName,
9817
+ controlled = _this$props.controlled,
9816
9818
  _onOutsideClick = _this$props.onOutsideClick;
9817
- var isOpen = this.state.isOpen;
9819
+ var _isDropDownOpen = controlled ? !!this.props.isOpen : this.state.isOpen;
9818
9820
  return /*#__PURE__*/React.createElement(OutsideClick, {
9819
9821
  className: cx(wrapperStyle$1, className),
9820
9822
  onOutsideClick: function onOutsideClick() {
9821
9823
  _this2.setState({
9822
9824
  isOpen: false
9823
9825
  });
9824
- if (_onOutsideClick) _onOutsideClick(isOpen);
9826
+ if (_onOutsideClick) _onOutsideClick(_isDropDownOpen);
9825
9827
  },
9826
- disabled: !isOpen
9828
+ disabled: !_isDropDownOpen
9827
9829
  }, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, function (_ref) {
9828
9830
  var ref = _ref.ref;
9829
9831
  return /*#__PURE__*/React.createElement("div", {
@@ -9833,17 +9835,17 @@
9833
9835
  },
9834
9836
  ref: ref
9835
9837
  }, labelComponent ? labelComponent({
9836
- isOpen: isOpen,
9838
+ isOpen: _isDropDownOpen,
9837
9839
  toggleDropdown: _this2.toggleDropdown
9838
9840
  }) : /*#__PURE__*/React.createElement(DropDownButton, {
9839
9841
  isSelected: !!isSelected,
9840
- isOpen: isOpen,
9842
+ isOpen: _isDropDownOpen,
9841
9843
  onClick: _this2.toggleDropdown,
9842
9844
  disabled: disabled,
9843
9845
  className: labelClassName
9844
9846
  }, buttonLabel));
9845
9847
  }), /*#__PURE__*/React.createElement(MountTransition, {
9846
- visible: isOpen
9848
+ visible: _isDropDownOpen
9847
9849
  }, function (transitionStyles) {
9848
9850
  return /*#__PURE__*/React.createElement(renderprops_cjs_7.div, {
9849
9851
  className: cx(dropDownStyle, dropDownClassName),
@@ -9870,7 +9872,7 @@
9870
9872
  "data-placement": placement
9871
9873
  }, children({
9872
9874
  toggle: _this2.toggleDropdown,
9873
- isOpen: _this2.state.isOpen
9875
+ isOpen: _isDropDownOpen
9874
9876
  }));
9875
9877
  }));
9876
9878
  })));
@@ -12010,7 +12012,10 @@
12010
12012
  errorMessage = _this$props.errorMessage,
12011
12013
  placement = _this$props.placement,
12012
12014
  wrapperClassName = _this$props.wrapperClassName,
12013
- initiallyOpen = _this$props.initiallyOpen;
12015
+ initiallyOpen = _this$props.initiallyOpen,
12016
+ onOutsideClick = _this$props.onOutsideClick,
12017
+ controlled = _this$props.controlled,
12018
+ isOpen = _this$props.isOpen;
12014
12019
  var _wrapperClassName = cx(wrapperStyle$3, wrapperClassName);
12015
12020
  var _dropDownClassName = cx(dropDownClassName, this.props.dropDownClassName);
12016
12021
  return /*#__PURE__*/React.createElement(DropDown, {
@@ -12030,7 +12035,7 @@
12030
12035
  value: value,
12031
12036
  placeholder: placeholder,
12032
12037
  onClick: function onClick() {
12033
- if (disabled) return;
12038
+ if (disabled || controlled) return;
12034
12039
  toggleDropdown();
12035
12040
  },
12036
12041
  fixLabelAtTop: true
@@ -12048,7 +12053,10 @@
12048
12053
  className: _wrapperClassName,
12049
12054
  placement: placement,
12050
12055
  modifiers: modifiers$1,
12051
- initiallyOpen: initiallyOpen
12056
+ initiallyOpen: initiallyOpen,
12057
+ onOutsideClick: onOutsideClick,
12058
+ controlled: controlled,
12059
+ isOpen: isOpen
12052
12060
  }, function (_ref3) {
12053
12061
  var toggle = _ref3.toggle;
12054
12062
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Calendar, Object.assign({
@@ -12059,6 +12067,9 @@
12059
12067
  range: false,
12060
12068
  onChange: function onChange(date) {
12061
12069
  _this2.onCalendarDateChange(date);
12070
+ if (controlled) {
12071
+ return;
12072
+ }
12062
12073
  toggle();
12063
12074
  }
12064
12075
  })), errorMessage && /*#__PURE__*/React.createElement("div", {