@toptal/picasso-timepicker 1.0.26 → 2.0.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/TimePicker/TimePicker.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AASvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AAQ5D,MAAM,WAAW,KACf,SAAQ,SAAS,EACf,IAAI,CACF,UAAU,EACR,IAAI,GACJ,OAAO,GACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,WAAW,GACX,MAAM,GACN,cAAc,GACd,MAAM,GACN,MAAM,GACN,cAAc,GACd,SAAS,GACT,cAAc,GACd,gBAAgB,GAChB,oBAAoB,GACpB,SAAS,GACT,OAAO,GACP,aAAa,GACb,QAAQ,CACX;IACH,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC,CAAA;IAC7C,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAID,eAAO,MAAM,UAAU;YAAW,KAAK;;;;;CA4GtC,CAAA;AAQD,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/TimePicker/TimePicker.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAMvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AAG5D,MAAM,WAAW,KACf,SAAQ,SAAS,EACf,IAAI,CACF,UAAU,EACR,IAAI,GACJ,OAAO,GACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,WAAW,GACX,MAAM,GACN,cAAc,GACd,MAAM,GACN,MAAM,GACN,cAAc,GACd,SAAS,GACT,cAAc,GACd,gBAAgB,GAChB,oBAAoB,GACpB,SAAS,GACT,OAAO,GACP,aAAa,GACb,QAAQ,CACX;IACH,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC,CAAA;IAC7C,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAID,eAAO,MAAM,UAAU;YAAW,KAAK;;;;;CAsHtC,CAAA;AAQD,eAAe,UAAU,CAAA"}
@@ -10,17 +10,12 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React, { useEffect, useState } from 'react';
13
- import { makeStyles } from '@material-ui/core/styles';
14
13
  import InputMask from 'react-input-mask';
15
14
  import { detect } from 'detect-browser';
16
- import cx from 'classnames';
17
15
  import { Input } from '@toptal/picasso-input';
18
16
  import { Time16 } from '@toptal/picasso-icons';
19
17
  import { usePropDeprecationWarning } from '@toptal/picasso-utils';
20
- import styles from './styles';
21
- const useStyles = makeStyles(styles, {
22
- name: 'PicassoTimePicker',
23
- });
18
+ import { twMerge } from '@toptal/picasso-tailwind-merge';
24
19
  const VALID_TIME_REGEX = new RegExp(/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/);
25
20
  export const TimePicker = (props) => {
26
21
  const { onChange: externalOnChange, value: externalValue, width, className, error, status, highlight } = props, rest = __rest(props, ["onChange", "value", "width", "className", "error", "status", "highlight"]);
@@ -48,7 +43,6 @@ export const TimePicker = (props) => {
48
43
  componentName: 'TimePicker',
49
44
  description: 'Use the `status` prop instead. `error` is deprecated and will be removed in the next major release.',
50
45
  });
51
- const classes = useStyles();
52
46
  const browser = detect();
53
47
  const isSafari = (browser === null || browser === void 0 ? void 0 : browser.name) === 'safari';
54
48
  const startsWithTwo = value && value[0] === '2';
@@ -59,11 +53,16 @@ export const TimePicker = (props) => {
59
53
  /[0-5]/,
60
54
  /[0-9]/,
61
55
  ];
62
- const icon = React.createElement(Time16, { classes: { root: classes.icon } });
56
+ const icon = (React.createElement(Time16, { classes: {
57
+ root: 'bg-white absolute right-[0.625rem] pointer-events-none m-0 select-none',
58
+ } }));
59
+ const inputClassName = twMerge('cursor-default', className);
60
+ const inputPropClassName = `-mr-[8px] [&::-webkit-calendar-picker-indicator]:absolute [&::-webkit-calendar-picker-indicator]:right-2
61
+ [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:bg-none`;
63
62
  if (isSafari) {
64
- return (React.createElement(Input, { type: 'text', readOnly: true, iconPosition: 'end', icon: icon, width: width, status: error ? 'error' : status, className: cx(classes.root, className), highlight: highlight, inputProps: Object.assign({ className: classes.inputBase }, rest), startAdornment: React.createElement(InputMask, { mask: inputMask, alwaysShowMask: true, maskPlaceholder: '-', value: value, onChange: onChange, className: classes.inputMask }) }));
63
+ return (React.createElement(Input, { type: 'text', readOnly: true, iconPosition: 'end', icon: icon, width: width, status: error ? 'error' : status, className: inputClassName, highlight: highlight, inputProps: Object.assign({ className: inputPropClassName }, rest), startAdornment: React.createElement(InputMask, { mask: inputMask, alwaysShowMask: true, maskPlaceholder: '-', value: value, onChange: onChange, className: 'text-sm border-none p-0 m-0 outline-none' }) }));
65
64
  }
66
- return (React.createElement(Input, { type: 'time', value: value, className: cx(classes.root, className), onChange: onChange, iconPosition: 'end', highlight: highlight, icon: icon, width: width, status: error ? 'error' : status, inputProps: Object.assign({ className: classes.inputBase, step: 60 }, rest) }));
65
+ return (React.createElement(Input, { type: 'time', value: value, className: inputClassName, onChange: onChange, iconPosition: 'end', highlight: highlight, icon: icon, width: width, status: error ? 'error' : status, inputProps: Object.assign({ className: inputPropClassName, step: 60 }, rest) }));
67
66
  };
68
67
  TimePicker.defaultProps = {
69
68
  status: 'default',
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../src/TimePicker/TimePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,SAAS,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAIjE,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,MAAM,SAAS,GAAG,UAAU,CAAQ,MAAM,EAAE;IAC1C,IAAI,EAAE,mBAAmB;CAC1B,CAAC,CAAA;AAkCF,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,kCAAkC,CAAC,CAAA;AAEvE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAY,EAAE,EAAE;IACzC,MAAM,EACJ,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,aAAa,EACpB,KAAK,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,KAEP,KAAK,EADJ,IAAI,UACL,KAAK,EATH,2EASL,CAAQ,CAAA;IAET,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,uEAAuE;QACvE,IAAI,aAAa,IAA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AAG,EACnB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,0CAA0C,GACrD,GAEJ,CACH,CAAA;KACF;IAED,OAAO,CACL,oBAAC,KAAK,IACJ,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,cAAc,EACzB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAC,KAAK,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAChC,UAAU,kBACR,SAAS,EAAE,kBAAkB,EAC7B,IAAI,EAAE,EAAE,IACL,IAAI,IAET,CACH,CAAA;AACH,CAAC,CAAA;AAED,UAAU,CAAC,YAAY,GAAG;IACxB,MAAM,EAAE,SAAS;CAClB,CAAA;AAED,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,eAAe,UAAU,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/picasso-timepicker",
3
- "version": "1.0.26",
3
+ "version": "2.0.1",
4
4
  "description": "Toptal UI components library - Timepicker",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,11 +22,10 @@
22
22
  },
23
23
  "homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
24
24
  "dependencies": {
25
- "@toptal/picasso-icons": "1.5.0",
26
- "@toptal/picasso-input": "2.0.8",
27
- "@toptal/picasso-outlined-input": "1.1.5",
25
+ "@toptal/picasso-icons": "1.6.0",
26
+ "@toptal/picasso-input": "3.0.1",
27
+ "@toptal/picasso-outlined-input": "2.0.1",
28
28
  "@toptal/picasso-utils": "1.0.3",
29
- "classnames": "^2.5.1",
30
29
  "detect-browser": "^5.3.0",
31
30
  "react-input-mask": "^3.0.0-alpha.2"
32
31
  },
@@ -35,7 +34,8 @@
35
34
  "**/styles.js"
36
35
  ],
37
36
  "peerDependencies": {
38
- "@material-ui/core": "4.12.4",
37
+ "@toptal/picasso-tailwind-merge": "1.2.0",
38
+ "@toptal/picasso-tailwind": ">=2.5.0",
39
39
  "react": ">=16.12.0 < 19.0.0"
40
40
  },
41
41
  "exports": {
@@ -1,21 +1,13 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import type { BaseProps } from '@toptal/picasso-shared'
3
- import type { Theme } from '@material-ui/core/styles'
4
- import { makeStyles } from '@material-ui/core/styles'
5
3
  import InputMask from 'react-input-mask'
6
4
  import { detect } from 'detect-browser'
7
- import cx from 'classnames'
8
5
  import { Input } from '@toptal/picasso-input'
9
6
  import { Time16 } from '@toptal/picasso-icons'
10
7
  import { usePropDeprecationWarning } from '@toptal/picasso-utils'
11
8
  import type { InputProps } from '@toptal/picasso-input'
12
9
  import type { Status } from '@toptal/picasso-outlined-input'
13
-
14
- import styles from './styles'
15
-
16
- const useStyles = makeStyles<Theme>(styles, {
17
- name: 'PicassoTimePicker',
18
- })
10
+ import { twMerge } from '@toptal/picasso-tailwind-merge'
19
11
 
20
12
  export interface Props
21
13
  extends BaseProps,
@@ -97,7 +89,6 @@ export const TimePicker = (props: Props) => {
97
89
  'Use the `status` prop instead. `error` is deprecated and will be removed in the next major release.',
98
90
  })
99
91
 
100
- const classes = useStyles()
101
92
  const browser = detect()
102
93
  const isSafari = browser?.name === 'safari'
103
94
  const startsWithTwo = value && value[0] === '2'
@@ -110,7 +101,18 @@ export const TimePicker = (props: Props) => {
110
101
  /[0-9]/,
111
102
  ]
112
103
 
113
- const icon = <Time16 classes={{ root: classes.icon }} />
104
+ const icon = (
105
+ <Time16
106
+ classes={{
107
+ root: 'bg-white absolute right-[0.625rem] pointer-events-none m-0 select-none',
108
+ }}
109
+ />
110
+ )
111
+
112
+ const inputClassName = twMerge('cursor-default', className)
113
+
114
+ const inputPropClassName = `-mr-[8px] [&::-webkit-calendar-picker-indicator]:absolute [&::-webkit-calendar-picker-indicator]:right-2
115
+ [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:bg-none`
114
116
 
115
117
  if (isSafari) {
116
118
  return (
@@ -121,10 +123,10 @@ export const TimePicker = (props: Props) => {
121
123
  icon={icon}
122
124
  width={width}
123
125
  status={error ? 'error' : status}
124
- className={cx(classes.root, className)}
126
+ className={inputClassName}
125
127
  highlight={highlight}
126
128
  inputProps={{
127
- className: classes.inputBase,
129
+ className: inputPropClassName,
128
130
  ...rest,
129
131
  }}
130
132
  startAdornment={
@@ -134,7 +136,7 @@ export const TimePicker = (props: Props) => {
134
136
  maskPlaceholder='-'
135
137
  value={value}
136
138
  onChange={onChange}
137
- className={classes.inputMask}
139
+ className={'text-sm border-none p-0 m-0 outline-none'}
138
140
  />
139
141
  }
140
142
  />
@@ -145,7 +147,7 @@ export const TimePicker = (props: Props) => {
145
147
  <Input
146
148
  type='time'
147
149
  value={value}
148
- className={cx(classes.root, className)}
150
+ className={inputClassName}
149
151
  onChange={onChange}
150
152
  iconPosition='end'
151
153
  highlight={highlight}
@@ -153,7 +155,7 @@ export const TimePicker = (props: Props) => {
153
155
  width={width}
154
156
  status={error ? 'error' : status}
155
157
  inputProps={{
156
- className: classes.inputBase,
158
+ className: inputPropClassName,
157
159
  step: 60, // 1 min
158
160
  ...rest,
159
161
  }}
@@ -6,21 +6,21 @@ exports[`TimePicker renders 1`] = `
6
6
  class="Picasso-root"
7
7
  >
8
8
  <div
9
- class="MuiInputBase-root MuiOutlinedInput-root PicassoOutlinedInput-root PicassoInput-root PicassoOutlinedInput-rootAuto PicassoOutlinedInput-rootMedium PicassoTimePicker-root MuiInputBase-adornedStart MuiOutlinedInput-adornedStart MuiInputBase-adornedEnd MuiOutlinedInput-adornedEnd"
9
+ class="base-Input base-Input base-Input relative inline-flex gap-y gap-x items-center rounded-sm [font-size:_unset] hover:[&_.resetButtonDirty]:visible p-2 h-8 w-[18.75rem] bg-white after:content-[""] after:inline-block after:absolute after:top-0 after:bottom-0 after:right-0 after:left-0 after:pointer-events after:border-solid after:rounded-sm after:border-gray [&:has(input:focus)]:after:border-blue after:border [&:has(input:focus)]:after:shadow-[0_0_0_3px] [&:has(input:focus)]:after:shadow-blue hover:[&:not(:has(input:focus))]:after:border-gray text-black cursor-default"
10
10
  >
11
11
  <input
12
12
  aria-invalid="false"
13
13
  autocomplete="none"
14
- class="MuiInputBase-input MuiOutlinedInput-input PicassoOutlinedInput-input PicassoOutlinedInput-inputMedium PicassoTimePicker-inputBase MuiInputBase-inputAdornedStart MuiOutlinedInput-inputAdornedStart MuiInputBase-inputAdornedEnd MuiOutlinedInput-inputAdornedEnd"
14
+ class="base-Input bg-transparent border-none box-border cursor-[inherit] h-full outline-none p-0 peer resize-none w-full text-md leading-4 text-black [&::placeholder]:text-gray [&::placeholder]:opacity-100 -mr [&::-webkit-calendar-picker [&::-webkit-calendar-picker-indicator]:right [&::-webkit-calendar-picker-indicator]:cursor [&::-webkit-calendar-picker-indicator]:bg"
15
15
  step="60"
16
16
  type="time"
17
17
  value="21:00"
18
18
  />
19
19
  <div
20
- class="MuiInputAdornment-root PicassoInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-disablePointerEvents"
20
+ class="text-graphite h-auto flex items-center whitespace-nowrap max-h justify-end ml-auto flex-grow flex-shrink basis-auto pointer-events"
21
21
  >
22
22
  <svg
23
- class="PicassoSvgTime16-root PicassoTimePicker-icon PicassoInputIconAdornment-icon"
23
+ class="PicassoSvgTime16-root bg-white absolute right-[0.625rem] pointer-events m-0 select-none grow shrink basis-0"
24
24
  style="min-width: 16px; min-height: 16px;"
25
25
  viewBox="0 0 16 16"
26
26
  >
@@ -29,20 +29,6 @@ exports[`TimePicker renders 1`] = `
29
29
  />
30
30
  </svg>
31
31
  </div>
32
- <fieldset
33
- aria-hidden="true"
34
- class="PrivateNotchedOutline-root MuiOutlinedInput-notchedOutline PicassoOutlinedInput-notchedOutline"
35
- style="padding-left: 8px;"
36
- >
37
- <legend
38
- class="PrivateNotchedOutline-legend"
39
- style="width: 0.01px;"
40
- >
41
- <span>
42
-
43
- </span>
44
- </legend>
45
- </fieldset>
46
32
  </div>
47
33
  </div>
48
34
  </div>
@@ -1,4 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- declare const _default: ({ palette }: Theme) => import("@material-ui/styles").StyleRules<{}, "root" | "icon" | "inputBase" | "inputMask">;
3
- export default _default;
4
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/TimePicker/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;sCAGxB,KAAK;AAAlC,wBAkCI"}
@@ -1,35 +0,0 @@
1
- import { createStyles } from '@material-ui/core/styles';
2
- export default ({ palette }) => createStyles({
3
- root: {
4
- cursor: 'default',
5
- },
6
- icon: {
7
- background: palette.common.white,
8
- position: 'absolute',
9
- right: '0.625rem',
10
- pointerEvents: 'none',
11
- margin: 0,
12
- userSelect: 'none',
13
- },
14
- inputBase: {
15
- marginRight: '-8px',
16
- // this workaround is needed to show the picker when we click our own clock icon
17
- // eventually, we could "display: none" this native icon and use native showPicker()
18
- // but currently not all browsers support the picker (e.g. Safari and Firefox), so for now we
19
- // hide the native icon (with its functionality available) behind our icon
20
- '&::-webkit-calendar-picker-indicator': {
21
- position: 'absolute',
22
- right: '0.5rem',
23
- cursor: 'pointer',
24
- background: 'none',
25
- },
26
- },
27
- inputMask: {
28
- fontSize: '0.8125rem',
29
- border: 'none',
30
- padding: '0',
31
- margin: '0',
32
- outline: 'none',
33
- },
34
- });
35
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/TimePicker/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,eAAe,CAAC,EAAE,OAAO,EAAS,EAAE,EAAE,CACpC,YAAY,CAAC;IACX,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;KAClB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;QAChC,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,UAAU;QACjB,aAAa,EAAE,MAAM;QACrB,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,MAAM;KACnB;IACD,SAAS,EAAE;QACT,WAAW,EAAE,MAAM;QAEnB,gFAAgF;QAChF,oFAAoF;QACpF,6FAA6F;QAC7F,0EAA0E;QAC1E,sCAAsC,EAAE;YACtC,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,MAAM;SACnB;KACF;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,MAAM;KAChB;CACF,CAAC,CAAA"}
@@ -1,38 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles'
2
- import { createStyles } from '@material-ui/core/styles'
3
-
4
- export default ({ palette }: Theme) =>
5
- createStyles({
6
- root: {
7
- cursor: 'default',
8
- },
9
- icon: {
10
- background: palette.common.white,
11
- position: 'absolute',
12
- right: '0.625rem',
13
- pointerEvents: 'none',
14
- margin: 0,
15
- userSelect: 'none',
16
- },
17
- inputBase: {
18
- marginRight: '-8px', // override default margin for icon position
19
-
20
- // this workaround is needed to show the picker when we click our own clock icon
21
- // eventually, we could "display: none" this native icon and use native showPicker()
22
- // but currently not all browsers support the picker (e.g. Safari and Firefox), so for now we
23
- // hide the native icon (with its functionality available) behind our icon
24
- '&::-webkit-calendar-picker-indicator': {
25
- position: 'absolute',
26
- right: '0.5rem',
27
- cursor: 'pointer',
28
- background: 'none',
29
- },
30
- },
31
- inputMask: {
32
- fontSize: '0.8125rem',
33
- border: 'none',
34
- padding: '0',
35
- margin: '0',
36
- outline: 'none',
37
- },
38
- })