@mrshmllw/smores-react 9.12.1 → 9.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.
@@ -7,8 +7,10 @@ interface Props extends CommonFieldProps {
7
7
  value: string;
8
8
  onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
9
9
  }
10
+ type AutoComplete = 'off' | 'bday-day' | 'bday-month' | 'bday-year';
11
+ type InputMode = 'text' | 'email' | 'numeric';
10
12
  /** on change or on input required */
11
- type InputProps = {
13
+ type InputProps = ({
12
14
  /** on change is required and on input optional */
13
15
  onChange: (e: string) => void;
14
16
  onInputChange?: (e: FormEvent<HTMLInputElement>) => void;
@@ -16,6 +18,9 @@ type InputProps = {
16
18
  /** on input is required and on change optional */
17
19
  onChange?: (e: string) => void;
18
20
  onInputChange: (e: FormEvent<HTMLInputElement>) => void;
21
+ }) & {
22
+ autoComplete?: AutoComplete;
23
+ inputMode?: InputMode;
19
24
  };
20
25
  export type TextInputProps = Props & InputProps;
21
26
  export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -3,15 +3,15 @@ import { Box } from '../Box';
3
3
  import { Field } from '../fields/Field';
4
4
  import { Input, StyledFrontIcon, StyledTrailingIcon, } from '../fields/components/CommonInput';
5
5
  import { useUniqueId } from '../utils/id';
6
- export const TextInput = forwardRef(function TextInput({ id: idProp, type = 'text', placeholder, name, value, error = false, onBlur, onChange, onInputChange, disabled = false, frontIcon, trailingIcon, fallbackStyle, ...fieldProps }, ref) {
6
+ export const TextInput = forwardRef(function TextInput({ id: idProp, type = 'text', placeholder, name, value, error = false, onBlur, onChange, onInputChange, disabled = false, frontIcon, trailingIcon, fallbackStyle, autoComplete = 'off', inputMode, ...fieldProps }, ref) {
7
7
  const id = useUniqueId(idProp);
8
8
  return (React.createElement(Field, { ...fieldProps, htmlFor: id, error: error },
9
9
  React.createElement(Box, { flex: true, alignItems: "center", justifyContent: "flex-start" },
10
10
  frontIcon && (React.createElement(StyledFrontIcon, { "$disabled": disabled, render: frontIcon, color: "sesame" })),
11
- React.createElement(Input, { disabled: disabled, type: type, id: id, name: name, ref: ref, placeholder: placeholder, value: value, "$error": error, "$frontIcon": frontIcon, "$fallbackStyle": fallbackStyle, autoComplete: "off", onChange: (e) => {
11
+ React.createElement(Input, { disabled: disabled, type: type, id: id, name: name, ref: ref, placeholder: placeholder, value: value, "$error": error, "$frontIcon": frontIcon, "$fallbackStyle": fallbackStyle, autoComplete: autoComplete, onChange: (e) => {
12
12
  onChange && onChange(e.currentTarget.value);
13
13
  onInputChange && onInputChange(e);
14
- }, onBlur: onBlur }),
14
+ }, onBlur: onBlur, inputMode: inputMode }),
15
15
  trailingIcon && (React.createElement(StyledTrailingIcon, { "$disabled": disabled, render: trailingIcon, color: "sesame" })))));
16
16
  });
17
17
  //# sourceMappingURL=TextInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAuC,UAAU,EAAE,MAAM,OAAO,CAAA;AAE9E,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,OAAO,EACL,KAAK,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAyBzC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,SAAS,CACpD,EACE,EAAE,EAAE,MAAM,EACV,IAAI,GAAG,MAAM,EACb,WAAW,EACX,IAAI,EACJ,KAAK,EACL,KAAK,GAAG,KAAK,EACb,MAAM,EACN,QAAQ,EACR,aAAa,EACb,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,GAAG,UAAU,EACE,EACjB,GAAm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S,GACpB;YACD,YAAY,IAAI,CACf,oBAAC,kBAAkB,iBACN,QAAQ,EACnB,MAAM,EAAE,YAAY,EACpB,KAAK,EAAC,QAAQ,GACd,CACH,CACG,CACA,CACT,CAAA;AACH,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrshmllw/smores-react",
3
- "version": "9.12.1",
3
+ "version": "9.13.0",
4
4
  "main": "./dist/index.js",
5
5
  "description": "Collection of React components used by Marshmallow Technology",
6
6
  "keywords": [