pebble-web 2.11.1 → 2.13.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.
@@ -476,13 +476,13 @@ var Button = function Button(_ref) {
476
476
  _ref$showRipple = _ref.showRipple,
477
477
  showRipple = _ref$showRipple === void 0 ? true : _ref$showRipple,
478
478
  loading = _ref.loading,
479
- filled = _ref.filled,
479
+ outline = _ref.outline,
480
480
  _ref$size = _ref.size,
481
481
  size = _ref$size === void 0 ? "small" : _ref$size,
482
482
  buttonProps = _ref.buttonProps;
483
483
  var disableAction = disabled || loading;
484
- var _filled = size !== "x-small" && filled !== false;
485
- var _className = cx(getButtonStyle(size, type, !!showShadow, _filled), className);
484
+ var _outline = size === "x-small" || !!outline;
485
+ var _className = cx(getButtonStyle(size, type, !!showShadow, !_outline), className);
486
486
  return /*#__PURE__*/createElement("button", Object.assign({
487
487
  className: _className,
488
488
  onClick: !disableAction ? onClick : undefined,
@@ -1193,10 +1193,14 @@ var wrapperStyle$2 = /*#__PURE__*/css({
1193
1193
  height: 110
1194
1194
  }
1195
1195
  }, ";label:wrapperStyle;" + ( "" ));
1196
+ var inputWrapperStyle = /*#__PURE__*/css({
1197
+ display: "flex",
1198
+ alignItems: "baseline",
1199
+ borderBottom: "1px solid ".concat(colors.gray.lighter)
1200
+ }, ";label:inputWrapperStyle;" + ( "" ));
1196
1201
  var inputStyle = /*#__PURE__*/css(_objectSpread$7(_objectSpread$7(_objectSpread$7({
1197
1202
  outline: 0,
1198
1203
  border: 0,
1199
- borderBottom: "1px solid ".concat(colors.gray.lighter),
1200
1204
  padding: "24px 0 12px 0",
1201
1205
  height: 48,
1202
1206
  borderRadius: 0
@@ -1247,15 +1251,14 @@ var labelStyle = /*#__PURE__*/css({
1247
1251
  }
1248
1252
  }, ";label:labelStyle;" + ( "" ));
1249
1253
  var messageStyle = /*#__PURE__*/css(_objectSpread$7(_objectSpread$7({}, typography.s.regular), {}, {
1250
- marginTop: 10,
1254
+ marginTop: 9,
1251
1255
  lineHeight: "10px",
1252
1256
  textAlign: "left"
1253
1257
  }), ";label:messageStyle;" + ( "" ));
1254
- var loadingStyle = /*#__PURE__*/css({
1255
- right: -10,
1256
- top: 20,
1257
- position: "absolute"
1258
- }, ";label:loadingStyle;" + ( "" ));
1258
+ var loadingStyle = /*#__PURE__*/css( {
1259
+ name: "1vx6lh0-loadingStyle",
1260
+ styles: "position:relative;top:4px;;label:loadingStyle;"
1261
+ } );
1259
1262
 
1260
1263
  function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
1261
1264
  function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$8(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -1327,6 +1330,7 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
1327
1330
  type = _this$props.type,
1328
1331
  placeholder = _this$props.placeholder,
1329
1332
  className = _this$props.className,
1333
+ inputWrapperClassName = _this$props.inputWrapperClassName,
1330
1334
  inputClassName = _this$props.inputClassName,
1331
1335
  highlightClassName = _this$props.highlightClassName,
1332
1336
  loadingClassName = _this$props.loadingClassName,
@@ -1340,9 +1344,12 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
1340
1344
  textArea = _this$props.textArea,
1341
1345
  required = _this$props.required,
1342
1346
  onClick = _this$props.onClick,
1343
- loading = _this$props.loading;
1347
+ loading = _this$props.loading,
1348
+ leftElement = _this$props.leftElement,
1349
+ rightElement = _this$props.rightElement;
1344
1350
  var isFocused = this.state.isFocused;
1345
1351
  var _message = errorMessage || successMessage || message;
1352
+ var _inputWrapperClassName = cx(inputWrapperStyle, inputWrapperClassName);
1346
1353
  var _inputClassName = cx(inputStyle, (_cx2 = {}, _defineProperty(_cx2, inputDisabledStyle, !!disabled), _defineProperty(_cx2, inputReadOnlyStyle, !!readOnly), _defineProperty(_cx2, inputTextAreaStyle, !!textArea), _cx2), inputClassName);
1347
1354
  var _inputProps = {
1348
1355
  "aria-label": placeholder ? placeholder : undefined,
@@ -1359,7 +1366,7 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
1359
1366
  _pebble_input_highlight_disabled: !!disabled
1360
1367
  }, highlightClassName);
1361
1368
  var labelClassName = cx(labelStyle, {
1362
- _pebble_input_label_focused: !!(isFocused || !!value || fixLabelAtTop)
1369
+ _pebble_input_label_focused: !!(isFocused || value || fixLabelAtTop || leftElement)
1363
1370
  });
1364
1371
  var _wrapperStyle = cx(wrapperStyle$2, {
1365
1372
  _pebble_input_wrapper_textarea: !!textArea
@@ -1370,9 +1377,15 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
1370
1377
  onFocus: this.addFocus,
1371
1378
  onBlur: this.removeFocus,
1372
1379
  onClick: onClick
1373
- }, this.props.textArea ? /*#__PURE__*/createElement("textarea", Object.assign({}, _inputProps, this.props.inputProps)) : /*#__PURE__*/createElement("input", Object.assign({
1380
+ }, /*#__PURE__*/createElement("div", {
1381
+ className: _inputWrapperClassName
1382
+ }, leftElement === null || leftElement === void 0 ? void 0 : leftElement(), this.props.textArea ? /*#__PURE__*/createElement("textarea", Object.assign({}, _inputProps, this.props.inputProps)) : /*#__PURE__*/createElement("input", Object.assign({
1374
1383
  type: type
1375
- }, _inputProps, this.props.inputProps)), !!placeholder && /*#__PURE__*/createElement("label", {
1384
+ }, _inputProps, this.props.inputProps)), loading && /*#__PURE__*/createElement(Loader, {
1385
+ color: colors.violet.base,
1386
+ scale: 0.6,
1387
+ className: _loadingStyle
1388
+ }), rightElement === null || rightElement === void 0 ? void 0 : rightElement()), !!placeholder && /*#__PURE__*/createElement("label", {
1376
1389
  className: labelClassName
1377
1390
  }, placeholder, required && /*#__PURE__*/createElement("span", {
1378
1391
  style: {
@@ -1383,10 +1396,6 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
1383
1396
  style: {
1384
1397
  backgroundColor: getColor(errorMessage, successMessage, true)
1385
1398
  }
1386
- }), loading && /*#__PURE__*/createElement(Loader, {
1387
- color: colors.violet.base,
1388
- scale: 0.6,
1389
- className: _loadingStyle
1390
1399
  }), _message && /*#__PURE__*/createElement("div", {
1391
1400
  className: messageStyle,
1392
1401
  style: {
@@ -3378,7 +3387,7 @@ var inputStyle$2 = /*#__PURE__*/css(_objectSpread$m(_objectSpread$m({
3378
3387
  }, textEllipsis), {}, {
3379
3388
  height: "48px"
3380
3389
  }), ";label:inputStyle;" + ( "" ));
3381
- var inputWrapperStyle = /*#__PURE__*/css({
3390
+ var inputWrapperStyle$1 = /*#__PURE__*/css({
3382
3391
  position: "relative",
3383
3392
  borderRadius: "3px",
3384
3393
  fontSize: "14px",
@@ -3459,7 +3468,7 @@ var SecondaryInput = /*#__PURE__*/function (_React$PureComponent) {
3459
3468
  className: inputStyle$2,
3460
3469
  onChange: this.handleChange
3461
3470
  };
3462
- var inputWrapperClassName = cx(inputWrapperStyle, (_cx2 = {}, _defineProperty(_cx2, inputDisabledStyle$1, !!disabled), _defineProperty(_cx2, inputReadOnlyStyle$1, !!readOnly), _cx2), inputClassName);
3471
+ var inputWrapperClassName = cx(inputWrapperStyle$1, (_cx2 = {}, _defineProperty(_cx2, inputDisabledStyle$1, !!disabled), _defineProperty(_cx2, inputReadOnlyStyle$1, !!readOnly), _cx2), inputClassName);
3463
3472
  var placeholderClassName = cx(placeholderStyle, {
3464
3473
  _pebble_secondary_input_label_focused: isFocused || !!value
3465
3474
  });