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
|
@@ -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:
|
|
1254
|
+
marginTop: 9,
|
|
1251
1255
|
lineHeight: "10px",
|
|
1252
1256
|
textAlign: "left"
|
|
1253
1257
|
}), ";label:messageStyle;" + ( "" ));
|
|
1254
|
-
var loadingStyle = /*#__PURE__*/css({
|
|
1255
|
-
|
|
1256
|
-
top:
|
|
1257
|
-
|
|
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 ||
|
|
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
|
-
},
|
|
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)),
|
|
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
|
});
|