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.
@@ -1385,6 +1385,7 @@
1385
1385
  PebbleIcon["Play"] = "play";
1386
1386
  PebbleIcon["Plus"] = "plus";
1387
1387
  PebbleIcon["PossessionLetter"] = "possession-letter";
1388
+ PebbleIcon["PostSales"] = "post-sales";
1388
1389
  PebbleIcon["Premium"] = "premium";
1389
1390
  PebbleIcon["Print"] = "print";
1390
1391
  PebbleIcon["PriorityChange"] = "priority-change";
@@ -9050,17 +9051,18 @@
9050
9051
  isSelected = _this$props.isSelected,
9051
9052
  disabled = _this$props.disabled,
9052
9053
  labelClassName = _this$props.labelClassName,
9054
+ controlled = _this$props.controlled,
9053
9055
  _onOutsideClick = _this$props.onOutsideClick;
9054
- var isOpen = this.state.isOpen;
9056
+ var _isDropDownOpen = controlled ? !!this.props.isOpen : this.state.isOpen;
9055
9057
  return /*#__PURE__*/React.createElement(OutsideClick, {
9056
9058
  className: cx(wrapperStyle$1, className),
9057
9059
  onOutsideClick: function onOutsideClick() {
9058
9060
  _this2.setState({
9059
9061
  isOpen: false
9060
9062
  });
9061
- if (_onOutsideClick) _onOutsideClick(isOpen);
9063
+ if (_onOutsideClick) _onOutsideClick(_isDropDownOpen);
9062
9064
  },
9063
- disabled: !isOpen
9065
+ disabled: !_isDropDownOpen
9064
9066
  }, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, function (_ref) {
9065
9067
  var ref = _ref.ref;
9066
9068
  return /*#__PURE__*/React.createElement("div", {
@@ -9070,17 +9072,17 @@
9070
9072
  },
9071
9073
  ref: ref
9072
9074
  }, labelComponent ? labelComponent({
9073
- isOpen: isOpen,
9075
+ isOpen: _isDropDownOpen,
9074
9076
  toggleDropdown: _this2.toggleDropdown
9075
9077
  }) : /*#__PURE__*/React.createElement(DropDownButton, {
9076
9078
  isSelected: !!isSelected,
9077
- isOpen: isOpen,
9079
+ isOpen: _isDropDownOpen,
9078
9080
  onClick: _this2.toggleDropdown,
9079
9081
  disabled: disabled,
9080
9082
  className: labelClassName
9081
9083
  }, buttonLabel));
9082
9084
  }), /*#__PURE__*/React.createElement(MountTransition, {
9083
- visible: isOpen
9085
+ visible: _isDropDownOpen
9084
9086
  }, function (transitionStyles) {
9085
9087
  return /*#__PURE__*/React.createElement(renderprops_cjs_7.div, {
9086
9088
  className: cx(dropDownStyle, dropDownClassName),
@@ -9107,7 +9109,7 @@
9107
9109
  "data-placement": placement
9108
9110
  }, children({
9109
9111
  toggle: _this2.toggleDropdown,
9110
- isOpen: _this2.state.isOpen
9112
+ isOpen: _isDropDownOpen
9111
9113
  }));
9112
9114
  }));
9113
9115
  })));
@@ -11221,7 +11223,10 @@
11221
11223
  errorMessage = _this$props.errorMessage,
11222
11224
  placement = _this$props.placement,
11223
11225
  wrapperClassName = _this$props.wrapperClassName,
11224
- initiallyOpen = _this$props.initiallyOpen;
11226
+ initiallyOpen = _this$props.initiallyOpen,
11227
+ onOutsideClick = _this$props.onOutsideClick,
11228
+ controlled = _this$props.controlled,
11229
+ isOpen = _this$props.isOpen;
11225
11230
  var _wrapperClassName = cx(wrapperStyle$3, wrapperClassName);
11226
11231
  var _dropDownClassName = cx(dropDownClassName, this.props.dropDownClassName);
11227
11232
  return /*#__PURE__*/React.createElement(DropDown, {
@@ -11241,7 +11246,7 @@
11241
11246
  value: value,
11242
11247
  placeholder: placeholder,
11243
11248
  onClick: function onClick() {
11244
- if (disabled) return;
11249
+ if (disabled || controlled) return;
11245
11250
  toggleDropdown();
11246
11251
  },
11247
11252
  fixLabelAtTop: true
@@ -11259,7 +11264,10 @@
11259
11264
  className: _wrapperClassName,
11260
11265
  placement: placement,
11261
11266
  modifiers: modifiers$1,
11262
- initiallyOpen: initiallyOpen
11267
+ initiallyOpen: initiallyOpen,
11268
+ onOutsideClick: onOutsideClick,
11269
+ controlled: controlled,
11270
+ isOpen: isOpen
11263
11271
  }, function (_ref3) {
11264
11272
  var toggle = _ref3.toggle;
11265
11273
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Calendar, Object.assign({
@@ -11270,6 +11278,9 @@
11270
11278
  range: false,
11271
11279
  onChange: function onChange(date) {
11272
11280
  _this2.onCalendarDateChange(date);
11281
+ if (controlled) {
11282
+ return;
11283
+ }
11273
11284
  toggle();
11274
11285
  }
11275
11286
  })), errorMessage && /*#__PURE__*/React.createElement("div", {