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.
- package/dist/components/styles/Input.styles.d.ts +1 -0
- package/dist/components/typings/Input.d.ts +3 -0
- package/dist/pebble-web.dev.js +36 -25
- package/dist/pebble-web.dev.js.map +1 -1
- package/dist/pebble-web.es.dev.js +36 -25
- package/dist/pebble-web.es.dev.js.map +1 -1
- package/dist/pebble-web.es.js +26 -17
- package/dist/pebble-web.es.js.map +1 -1
- package/dist/pebble-web.js +26 -17
- package/dist/pebble-web.js.map +1 -1
- package/dist/pebble-web.module.dev.js +36 -25
- package/dist/pebble-web.module.dev.js.map +1 -1
- package/dist/pebble-web.module.js +26 -17
- package/dist/pebble-web.module.js.map +1 -1
- package/dist/pebble-web.umd.dev.js +38 -25
- package/dist/pebble-web.umd.dev.js.map +1 -1
- package/dist/pebble-web.umd.js +28 -17
- package/dist/pebble-web.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Input.tsx +32 -15
- package/src/components/__tests__/__snapshots__/phonenumberinput.test.tsx.snap +65 -47
- package/src/components/__tests__/__snapshots__/select.test.tsx.snap +126 -81
- package/src/components/styles/Input.styles.ts +9 -5
- package/src/components/typings/Input.ts +3 -0
package/dist/pebble-web.js
CHANGED
|
@@ -1199,10 +1199,14 @@ var wrapperStyle$2 = /*#__PURE__*/emotion.css({
|
|
|
1199
1199
|
height: 110
|
|
1200
1200
|
}
|
|
1201
1201
|
}, ";label:wrapperStyle;" + ( "" ));
|
|
1202
|
+
var inputWrapperStyle = /*#__PURE__*/emotion.css({
|
|
1203
|
+
display: "flex",
|
|
1204
|
+
alignItems: "baseline",
|
|
1205
|
+
borderBottom: "1px solid ".concat(pebbleShared.colors.gray.lighter)
|
|
1206
|
+
}, ";label:inputWrapperStyle;" + ( "" ));
|
|
1202
1207
|
var inputStyle = /*#__PURE__*/emotion.css(_objectSpread$7(_objectSpread$7(_objectSpread$7({
|
|
1203
1208
|
outline: 0,
|
|
1204
1209
|
border: 0,
|
|
1205
|
-
borderBottom: "1px solid ".concat(pebbleShared.colors.gray.lighter),
|
|
1206
1210
|
padding: "24px 0 12px 0",
|
|
1207
1211
|
height: 48,
|
|
1208
1212
|
borderRadius: 0
|
|
@@ -1253,15 +1257,14 @@ var labelStyle = /*#__PURE__*/emotion.css({
|
|
|
1253
1257
|
}
|
|
1254
1258
|
}, ";label:labelStyle;" + ( "" ));
|
|
1255
1259
|
var messageStyle = /*#__PURE__*/emotion.css(_objectSpread$7(_objectSpread$7({}, typography.s.regular), {}, {
|
|
1256
|
-
marginTop:
|
|
1260
|
+
marginTop: 9,
|
|
1257
1261
|
lineHeight: "10px",
|
|
1258
1262
|
textAlign: "left"
|
|
1259
1263
|
}), ";label:messageStyle;" + ( "" ));
|
|
1260
|
-
var loadingStyle = /*#__PURE__*/emotion.css({
|
|
1261
|
-
|
|
1262
|
-
top:
|
|
1263
|
-
|
|
1264
|
-
}, ";label:loadingStyle;" + ( "" ));
|
|
1264
|
+
var loadingStyle = /*#__PURE__*/emotion.css( {
|
|
1265
|
+
name: "1vx6lh0-loadingStyle",
|
|
1266
|
+
styles: "position:relative;top:4px;;label:loadingStyle;"
|
|
1267
|
+
} );
|
|
1265
1268
|
|
|
1266
1269
|
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; }
|
|
1267
1270
|
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; }
|
|
@@ -1333,6 +1336,7 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1333
1336
|
type = _this$props.type,
|
|
1334
1337
|
placeholder = _this$props.placeholder,
|
|
1335
1338
|
className = _this$props.className,
|
|
1339
|
+
inputWrapperClassName = _this$props.inputWrapperClassName,
|
|
1336
1340
|
inputClassName = _this$props.inputClassName,
|
|
1337
1341
|
highlightClassName = _this$props.highlightClassName,
|
|
1338
1342
|
loadingClassName = _this$props.loadingClassName,
|
|
@@ -1346,9 +1350,12 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1346
1350
|
textArea = _this$props.textArea,
|
|
1347
1351
|
required = _this$props.required,
|
|
1348
1352
|
onClick = _this$props.onClick,
|
|
1349
|
-
loading = _this$props.loading
|
|
1353
|
+
loading = _this$props.loading,
|
|
1354
|
+
leftElement = _this$props.leftElement,
|
|
1355
|
+
rightElement = _this$props.rightElement;
|
|
1350
1356
|
var isFocused = this.state.isFocused;
|
|
1351
1357
|
var _message = errorMessage || successMessage || message;
|
|
1358
|
+
var _inputWrapperClassName = emotion.cx(inputWrapperStyle, inputWrapperClassName);
|
|
1352
1359
|
var _inputClassName = emotion.cx(inputStyle, (_cx2 = {}, _defineProperty(_cx2, inputDisabledStyle, !!disabled), _defineProperty(_cx2, inputReadOnlyStyle, !!readOnly), _defineProperty(_cx2, inputTextAreaStyle, !!textArea), _cx2), inputClassName);
|
|
1353
1360
|
var _inputProps = {
|
|
1354
1361
|
"aria-label": placeholder ? placeholder : undefined,
|
|
@@ -1365,7 +1372,7 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1365
1372
|
_pebble_input_highlight_disabled: !!disabled
|
|
1366
1373
|
}, highlightClassName);
|
|
1367
1374
|
var labelClassName = emotion.cx(labelStyle, {
|
|
1368
|
-
_pebble_input_label_focused: !!(isFocused ||
|
|
1375
|
+
_pebble_input_label_focused: !!(isFocused || value || fixLabelAtTop || leftElement)
|
|
1369
1376
|
});
|
|
1370
1377
|
var _wrapperStyle = emotion.cx(wrapperStyle$2, {
|
|
1371
1378
|
_pebble_input_wrapper_textarea: !!textArea
|
|
@@ -1376,9 +1383,15 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1376
1383
|
onFocus: this.addFocus,
|
|
1377
1384
|
onBlur: this.removeFocus,
|
|
1378
1385
|
onClick: onClick
|
|
1379
|
-
},
|
|
1386
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1387
|
+
className: _inputWrapperClassName
|
|
1388
|
+
}, leftElement === null || leftElement === void 0 ? void 0 : leftElement(), this.props.textArea ? /*#__PURE__*/React.createElement("textarea", Object.assign({}, _inputProps, this.props.inputProps)) : /*#__PURE__*/React.createElement("input", Object.assign({
|
|
1380
1389
|
type: type
|
|
1381
|
-
}, _inputProps, this.props.inputProps)),
|
|
1390
|
+
}, _inputProps, this.props.inputProps)), loading && /*#__PURE__*/React.createElement(Loader, {
|
|
1391
|
+
color: pebbleShared.colors.violet.base,
|
|
1392
|
+
scale: 0.6,
|
|
1393
|
+
className: _loadingStyle
|
|
1394
|
+
}), rightElement === null || rightElement === void 0 ? void 0 : rightElement()), !!placeholder && /*#__PURE__*/React.createElement("label", {
|
|
1382
1395
|
className: labelClassName
|
|
1383
1396
|
}, placeholder, required && /*#__PURE__*/React.createElement("span", {
|
|
1384
1397
|
style: {
|
|
@@ -1389,10 +1402,6 @@ var Input = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1389
1402
|
style: {
|
|
1390
1403
|
backgroundColor: getColor(errorMessage, successMessage, true)
|
|
1391
1404
|
}
|
|
1392
|
-
}), loading && /*#__PURE__*/React.createElement(Loader, {
|
|
1393
|
-
color: pebbleShared.colors.violet.base,
|
|
1394
|
-
scale: 0.6,
|
|
1395
|
-
className: _loadingStyle
|
|
1396
1405
|
}), _message && /*#__PURE__*/React.createElement("div", {
|
|
1397
1406
|
className: messageStyle,
|
|
1398
1407
|
style: {
|
|
@@ -3384,7 +3393,7 @@ var inputStyle$2 = /*#__PURE__*/emotion.css(_objectSpread$m(_objectSpread$m({
|
|
|
3384
3393
|
}, textEllipsis), {}, {
|
|
3385
3394
|
height: "48px"
|
|
3386
3395
|
}), ";label:inputStyle;" + ( "" ));
|
|
3387
|
-
var inputWrapperStyle = /*#__PURE__*/emotion.css({
|
|
3396
|
+
var inputWrapperStyle$1 = /*#__PURE__*/emotion.css({
|
|
3388
3397
|
position: "relative",
|
|
3389
3398
|
borderRadius: "3px",
|
|
3390
3399
|
fontSize: "14px",
|
|
@@ -3465,7 +3474,7 @@ var SecondaryInput = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
3465
3474
|
className: inputStyle$2,
|
|
3466
3475
|
onChange: this.handleChange
|
|
3467
3476
|
};
|
|
3468
|
-
var inputWrapperClassName = emotion.cx(inputWrapperStyle, (_cx2 = {}, _defineProperty(_cx2, inputDisabledStyle$1, !!disabled), _defineProperty(_cx2, inputReadOnlyStyle$1, !!readOnly), _cx2), inputClassName);
|
|
3477
|
+
var inputWrapperClassName = emotion.cx(inputWrapperStyle$1, (_cx2 = {}, _defineProperty(_cx2, inputDisabledStyle$1, !!disabled), _defineProperty(_cx2, inputReadOnlyStyle$1, !!readOnly), _cx2), inputClassName);
|
|
3469
3478
|
var placeholderClassName = emotion.cx(placeholderStyle, {
|
|
3470
3479
|
_pebble_secondary_input_label_focused: isFocused || !!value
|
|
3471
3480
|
});
|