pebble-web 2.11.1 → 2.12.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.
@@ -1125,10 +1125,14 @@ const wrapperStyle$2 = /*#__PURE__*/css({
1125
1125
  height: 110
1126
1126
  }
1127
1127
  }, ";label:wrapperStyle;" + ( "" ));
1128
+ const inputWrapperStyle = /*#__PURE__*/css({
1129
+ display: "flex",
1130
+ alignItems: "baseline",
1131
+ borderBottom: `1px solid ${colors.gray.lighter}`
1132
+ }, ";label:inputWrapperStyle;" + ( "" ));
1128
1133
  const inputStyle = /*#__PURE__*/css({
1129
1134
  outline: 0,
1130
1135
  border: 0,
1131
- borderBottom: `1px solid ${colors.gray.lighter}`,
1132
1136
  padding: "24px 0 12px 0",
1133
1137
  height: 48,
1134
1138
  borderRadius: 0,
@@ -1180,15 +1184,14 @@ const labelStyle = /*#__PURE__*/css({
1180
1184
  }
1181
1185
  }, ";label:labelStyle;" + ( "" ));
1182
1186
  const messageStyle = /*#__PURE__*/css({ ...typography.s.regular,
1183
- marginTop: 10,
1187
+ marginTop: 9,
1184
1188
  lineHeight: "10px",
1185
1189
  textAlign: "left"
1186
1190
  }, ";label:messageStyle;" + ( "" ));
1187
- const loadingStyle = /*#__PURE__*/css({
1188
- right: -10,
1189
- top: 20,
1190
- position: "absolute"
1191
- }, ";label:loadingStyle;" + ( "" ));
1191
+ const loadingStyle = /*#__PURE__*/css( {
1192
+ name: "1vx6lh0-loadingStyle",
1193
+ styles: "position:relative;top:4px;;label:loadingStyle;"
1194
+ } );
1192
1195
 
1193
1196
  const dateClass = /*#__PURE__*/css( {
1194
1197
  name: "1ydb6k9-dateClass",
@@ -1248,6 +1251,7 @@ class Input extends PureComponent {
1248
1251
  type,
1249
1252
  placeholder,
1250
1253
  className,
1254
+ inputWrapperClassName,
1251
1255
  inputClassName,
1252
1256
  highlightClassName,
1253
1257
  loadingClassName,
@@ -1261,12 +1265,15 @@ class Input extends PureComponent {
1261
1265
  textArea,
1262
1266
  required,
1263
1267
  onClick,
1264
- loading
1268
+ loading,
1269
+ leftElement,
1270
+ rightElement
1265
1271
  } = this.props;
1266
1272
  const {
1267
1273
  isFocused
1268
1274
  } = this.state;
1269
1275
  const _message = errorMessage || successMessage || message;
1276
+ const _inputWrapperClassName = cx(inputWrapperStyle, inputWrapperClassName);
1270
1277
  const _inputClassName = cx(inputStyle, {
1271
1278
  [inputDisabledStyle]: !!disabled,
1272
1279
  [inputReadOnlyStyle]: !!readOnly,
@@ -1287,7 +1294,7 @@ class Input extends PureComponent {
1287
1294
  _pebble_input_highlight_disabled: !!disabled
1288
1295
  }, highlightClassName);
1289
1296
  const labelClassName = cx(labelStyle, {
1290
- _pebble_input_label_focused: !!(isFocused || !!value || fixLabelAtTop)
1297
+ _pebble_input_label_focused: !!(isFocused || value || fixLabelAtTop || leftElement)
1291
1298
  });
1292
1299
  const _wrapperStyle = cx(wrapperStyle$2, {
1293
1300
  _pebble_input_wrapper_textarea: !!textArea
@@ -1298,9 +1305,15 @@ class Input extends PureComponent {
1298
1305
  onFocus: this.addFocus,
1299
1306
  onBlur: this.removeFocus,
1300
1307
  onClick: onClick
1301
- }, this.props.textArea ? /*#__PURE__*/createElement("textarea", Object.assign({}, _inputProps, this.props.inputProps)) : /*#__PURE__*/createElement("input", Object.assign({
1308
+ }, /*#__PURE__*/createElement("div", {
1309
+ className: _inputWrapperClassName
1310
+ }, 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({
1302
1311
  type: type
1303
- }, _inputProps, this.props.inputProps)), !!placeholder && /*#__PURE__*/createElement("label", {
1312
+ }, _inputProps, this.props.inputProps)), loading && /*#__PURE__*/createElement(Loader, {
1313
+ color: colors.violet.base,
1314
+ scale: 0.6,
1315
+ className: _loadingStyle
1316
+ }), rightElement === null || rightElement === void 0 ? void 0 : rightElement()), !!placeholder && /*#__PURE__*/createElement("label", {
1304
1317
  className: labelClassName
1305
1318
  }, placeholder, required && /*#__PURE__*/createElement("span", {
1306
1319
  style: {
@@ -1311,10 +1324,6 @@ class Input extends PureComponent {
1311
1324
  style: {
1312
1325
  backgroundColor: getColor(errorMessage, successMessage, true)
1313
1326
  }
1314
- }), loading && /*#__PURE__*/createElement(Loader, {
1315
- color: colors.violet.base,
1316
- scale: 0.6,
1317
- className: _loadingStyle
1318
1327
  }), _message && /*#__PURE__*/createElement("div", {
1319
1328
  className: messageStyle,
1320
1329
  style: {
@@ -3077,7 +3086,7 @@ const inputStyle$2 = /*#__PURE__*/css({
3077
3086
  ...textEllipsis,
3078
3087
  height: "48px"
3079
3088
  }, ";label:inputStyle;" + ( "" ));
3080
- const inputWrapperStyle = /*#__PURE__*/css({
3089
+ const inputWrapperStyle$1 = /*#__PURE__*/css({
3081
3090
  position: "relative",
3082
3091
  borderRadius: "3px",
3083
3092
  fontSize: "14px",
@@ -3151,7 +3160,7 @@ class SecondaryInput extends PureComponent {
3151
3160
  className: inputStyle$2,
3152
3161
  onChange: this.handleChange
3153
3162
  };
3154
- const inputWrapperClassName = cx(inputWrapperStyle, {
3163
+ const inputWrapperClassName = cx(inputWrapperStyle$1, {
3155
3164
  [inputDisabledStyle$1]: !!disabled,
3156
3165
  [inputReadOnlyStyle$1]: !!readOnly
3157
3166
  }, inputClassName);