@autoguru/overdrive 4.28.1 → 4.30.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/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Image/SimpleImage.d.ts +2 -2
- package/dist/components/Image/SimpleImage.d.ts.map +1 -1
- package/dist/components/Image/SimpleImage.js +14 -5
- package/dist/components/NumberInput/NumberInput.d.ts +1 -0
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.js +6 -3
- package/dist/components/NumberInput/stories.js +7 -0
- package/dist/components/TextAreaInput/TextAreaInput.d.ts +1 -1
- package/dist/components/TextAreaInput/TextAreaInput.d.ts.map +1 -1
- package/dist/components/TextAreaInput/TextAreaInput.js +3 -1
- package/dist/components/TextAreaInput/stories.js +9 -1
- package/dist/components/TextInput/TextInput.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/components/TextInput/TextInput.js +3 -1
- package/dist/components/TextInput/stories.js +8 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../lib/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../lib/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM5E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC,MAAM,WAAW,KAAK;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IACzD,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,CAAC;CAChE;AAED,eAAO,MAAM,IAAI,EAAE,iBAAiB,CAAC,KAAK,CA0BzC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useNullCheck } from "../../hooks/useNullCheck/index.js";
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { cloneElement } from 'react';
|
|
5
|
+
import { useNullCheck } from "../../hooks/useNullCheck/index.js";
|
|
6
6
|
import { resolveResponsiveStyle } from "../../utils/resolveResponsiveProps.js";
|
|
7
7
|
import { Box, useBoxStyles } from "../Box/index.js";
|
|
8
8
|
import * as styles from "./Icon.css.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
1
|
+
import { FunctionComponent, ReactElement } from 'react';
|
|
2
2
|
export interface Props extends Partial<Omit<HTMLImageElement, 'loading' | 'className' | 'width' | 'height'>> {
|
|
3
3
|
src: string;
|
|
4
4
|
eager?: boolean;
|
|
@@ -7,7 +7,7 @@ export interface Props extends Partial<Omit<HTMLImageElement, 'loading' | 'class
|
|
|
7
7
|
width?: string;
|
|
8
8
|
height?: string;
|
|
9
9
|
className?: string;
|
|
10
|
+
fallbackComponent?: ReactElement;
|
|
10
11
|
}
|
|
11
12
|
export declare const SimpleImage: FunctionComponent<Props>;
|
|
12
|
-
export default SimpleImage;
|
|
13
13
|
//# sourceMappingURL=SimpleImage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleImage.d.ts","sourceRoot":"","sources":["../../../lib/components/Image/SimpleImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SimpleImage.d.ts","sourceRoot":"","sources":["../../../lib/components/Image/SimpleImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,KAChB,SAAQ,OAAO,CACd,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC,CACpE;IACD,GAAG,EAAE,MAAM,CAAC;IAKZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAMhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAMhB,YAAY,CAAC,EAAE,OAAO,CAAC;IAMvB,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,iBAAiB,CAAC,EAAE,YAAY,CAAC;CACjC;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,KAAK,CAgChD,CAAC"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["eager", "syncDecoding", "className", "src", "srcSet"];
|
|
5
|
+
const _excluded = ["eager", "syncDecoding", "className", "src", "srcSet", "fallbackComponent"];
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
import * as React from 'react';
|
|
9
|
+
import { useState } from 'react';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
export const SimpleImage = _ref => {
|
|
11
12
|
let {
|
|
@@ -13,15 +14,23 @@ export const SimpleImage = _ref => {
|
|
|
13
14
|
syncDecoding = 'false',
|
|
14
15
|
className = '',
|
|
15
16
|
src,
|
|
16
|
-
srcSet
|
|
17
|
+
srcSet,
|
|
18
|
+
fallbackComponent
|
|
17
19
|
} = _ref,
|
|
18
20
|
imgProps = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
const [hasError, setHasError] = useState(false);
|
|
22
|
+
const handleError = () => {
|
|
23
|
+
setHasError(true);
|
|
24
|
+
};
|
|
25
|
+
if (hasError && fallbackComponent) {
|
|
26
|
+
return fallbackComponent;
|
|
27
|
+
}
|
|
19
28
|
return _jsx("img", _objectSpread({
|
|
20
29
|
loading: eager ? 'eager' : 'lazy',
|
|
21
30
|
decoding: syncDecoding ? 'sync' : 'async',
|
|
22
31
|
className: className,
|
|
23
32
|
srcSet: srcSet,
|
|
24
|
-
src: src
|
|
33
|
+
src: src,
|
|
34
|
+
onError: handleError
|
|
25
35
|
}, imgProps));
|
|
26
|
-
};
|
|
27
|
-
export default SimpleImage;
|
|
36
|
+
};
|
|
@@ -5,6 +5,7 @@ interface Props extends Partial<Pick<HTMLInputElement, 'min' | 'max' | 'step'>>,
|
|
|
5
5
|
onChange?: FormEventHandler<HTMLInputElement>;
|
|
6
6
|
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
7
7
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
8
|
+
max?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const NumberInput: React.ForwardRefExoticComponent<Props & import("../private/InputBase/withEnhancedInput").EnhanceInputPrimitiveProps & import("../private/InputBase/withEnhancedInput").EventHandlers<HTMLInputElement> & import("../private/InputBase/withEnhancedInput").ValidationProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
11
|
export default NumberInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAc5D,UAAU,KACT,SAAQ,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC,EAC9D,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,WAAW,oTA+CvB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
const _excluded = ["ref"],
|
|
6
|
-
_excluded2 = ["field", "eventHandlers", "validation", "isLoading", "suffixed", "prefixed", "preventMouseWheel", "size", "onChange", "onFocus", "onBlur"];
|
|
6
|
+
_excluded2 = ["field", "eventHandlers", "validation", "isLoading", "suffixed", "prefixed", "preventMouseWheel", "size", "onChange", "onFocus", "onBlur", "max"];
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
9
|
import * as React from 'react';
|
|
@@ -13,6 +13,7 @@ import { useNumberInputBehaviours } from "./useNumberInputBehaviours.js";
|
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
const isEdge = typeof navigator !== 'undefined' && /edge/i.test(navigator.userAgent);
|
|
15
15
|
const type = isEdge ? 'text' : 'number';
|
|
16
|
+
const MAX_NUMBER_INPUT_VALUE = 2147483647;
|
|
16
17
|
export const NumberInput = withEnhancedInput(_ref => {
|
|
17
18
|
let {
|
|
18
19
|
field: {
|
|
@@ -27,7 +28,8 @@ export const NumberInput = withEnhancedInput(_ref => {
|
|
|
27
28
|
size,
|
|
28
29
|
onChange: incomingOnChange,
|
|
29
30
|
onFocus: incomingOnFocus,
|
|
30
|
-
onBlur: incomingOnBlur
|
|
31
|
+
onBlur: incomingOnBlur,
|
|
32
|
+
max
|
|
31
33
|
} = _ref,
|
|
32
34
|
incomingFieldProps = _objectWithoutProperties(_ref.field, _excluded),
|
|
33
35
|
rest = _objectWithoutProperties(_ref, _excluded2);
|
|
@@ -55,7 +57,8 @@ export const NumberInput = withEnhancedInput(_ref => {
|
|
|
55
57
|
}, incomingFieldProps), rest), {}, {
|
|
56
58
|
autoComplete: "off",
|
|
57
59
|
type: type,
|
|
58
|
-
value: value
|
|
60
|
+
value: value,
|
|
61
|
+
max: max || MAX_NUMBER_INPUT_VALUE
|
|
59
62
|
}));
|
|
60
63
|
}, {
|
|
61
64
|
primitiveType: type
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const TextAreaInput: React.ForwardRefExoticComponent<import("../private/InputBase/withEnhancedInput").EnhanceInputPrimitiveProps & import("../private/InputBase/withEnhancedInput").EventHandlers<
|
|
2
|
+
export declare const TextAreaInput: React.ForwardRefExoticComponent<Partial<Pick<HTMLTextAreaElement, "maxLength" | "type">> & import("../private/InputBase/withEnhancedInput").EnhanceInputPrimitiveProps & import("../private/InputBase/withEnhancedInput").EventHandlers<HTMLInputElement> & import("../private/InputBase/withEnhancedInput").ValidationProps & React.RefAttributes<HTMLInputElement>>;
|
|
3
3
|
export default TextAreaInput;
|
|
4
4
|
//# sourceMappingURL=TextAreaInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAreaInput.d.ts","sourceRoot":"","sources":["../../../lib/components/TextAreaInput/TextAreaInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextAreaInput.d.ts","sourceRoot":"","sources":["../../../lib/components/TextAreaInput/TextAreaInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,eAAO,MAAM,aAAa,uWA6BzB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -9,6 +9,7 @@ import * as React from 'react';
|
|
|
9
9
|
import { Box } from "../Box/index.js";
|
|
10
10
|
import { withEnhancedInput } from "../private/InputBase/index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const MAX_TEXT_AREA_INPUT_LENGTH = 4000;
|
|
12
13
|
export const TextAreaInput = withEnhancedInput(_ref => {
|
|
13
14
|
let {
|
|
14
15
|
field,
|
|
@@ -23,7 +24,8 @@ export const TextAreaInput = withEnhancedInput(_ref => {
|
|
|
23
24
|
return _jsx(Box, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
24
25
|
is: "textarea"
|
|
25
26
|
}, eventHandlers), field), rest), {}, {
|
|
26
|
-
autoComplete: "off"
|
|
27
|
+
autoComplete: "off",
|
|
28
|
+
maxLength: rest.maxLength || MAX_TEXT_AREA_INPUT_LENGTH
|
|
27
29
|
}));
|
|
28
30
|
}, {
|
|
29
31
|
primitiveType: 'textarea',
|
|
@@ -16,7 +16,15 @@ export default {
|
|
|
16
16
|
};
|
|
17
17
|
const defaultValue = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.\nPhasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut';
|
|
18
18
|
const defaultPlaceholder = 'Tell us about your car.';
|
|
19
|
-
const argTypes = {
|
|
19
|
+
const argTypes = {
|
|
20
|
+
maxLength: {
|
|
21
|
+
defaultValue: null,
|
|
22
|
+
description: 'Set the max length of the input',
|
|
23
|
+
control: {
|
|
24
|
+
type: 'number'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
20
28
|
const Template = args => _jsx(TextAreaInput, _objectSpread({}, args));
|
|
21
29
|
const sharedProps = {
|
|
22
30
|
disabled: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const TextInput: React.ForwardRefExoticComponent<Partial<Pick<HTMLInputElement, "type">> & import("../private/InputBase/withEnhancedInput").EnhanceInputPrimitiveProps & import("../private/InputBase/withEnhancedInput").EventHandlers<HTMLInputElement> & import("../private/InputBase/withEnhancedInput").ValidationProps & React.RefAttributes<HTMLInputElement>>;
|
|
2
|
+
export declare const TextInput: React.ForwardRefExoticComponent<Partial<Pick<HTMLInputElement, "maxLength" | "type">> & import("../private/InputBase/withEnhancedInput").EnhanceInputPrimitiveProps & import("../private/InputBase/withEnhancedInput").EventHandlers<HTMLInputElement> & import("../private/InputBase/withEnhancedInput").ValidationProps & React.RefAttributes<HTMLInputElement>>;
|
|
3
3
|
export default TextInput;
|
|
4
4
|
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../lib/components/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../lib/components/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,eAAO,MAAM,SAAS,oWA0BrB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -9,6 +9,7 @@ import * as React from 'react';
|
|
|
9
9
|
import { Box } from "../Box/index.js";
|
|
10
10
|
import { withEnhancedInput } from "../private/InputBase/index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const MAX_TEXT_INPUT_LENGTH = 2000;
|
|
12
13
|
export const TextInput = withEnhancedInput(_ref => {
|
|
13
14
|
var _rest$type;
|
|
14
15
|
let {
|
|
@@ -25,7 +26,8 @@ export const TextInput = withEnhancedInput(_ref => {
|
|
|
25
26
|
is: "input"
|
|
26
27
|
}, eventHandlers), field), rest), {}, {
|
|
27
28
|
autoComplete: "off",
|
|
28
|
-
type: (_rest$type = rest.type) !== null && _rest$type !== void 0 ? _rest$type : 'text'
|
|
29
|
+
type: (_rest$type = rest.type) !== null && _rest$type !== void 0 ? _rest$type : 'text',
|
|
30
|
+
maxLength: rest.maxLength || MAX_TEXT_INPUT_LENGTH
|
|
29
31
|
}));
|
|
30
32
|
}, {
|
|
31
33
|
primitiveType: 'text'
|
|
@@ -61,7 +61,14 @@ const argTypes = {
|
|
|
61
61
|
type: 'select'
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
backgroundColour: boxArgTypes['backgroundColour']
|
|
64
|
+
backgroundColour: boxArgTypes['backgroundColour'],
|
|
65
|
+
maxLength: {
|
|
66
|
+
defaultValue: null,
|
|
67
|
+
description: 'Set the max length of the input',
|
|
68
|
+
control: {
|
|
69
|
+
type: 'number'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
65
72
|
};
|
|
66
73
|
const Template = args => _jsx(TextInput, _objectSpread({}, args));
|
|
67
74
|
const sharedProps = {
|