@toptal/picasso-form 4.0.2 → 4.1.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-package/src/FormError/FormError.d.ts.map +1 -1
- package/dist-package/src/FormError/FormError.js +2 -6
- package/dist-package/src/FormError/FormError.js.map +1 -1
- package/dist-package/src/FormHint/FormHint.d.ts.map +1 -1
- package/dist-package/src/FormHint/FormHint.js +2 -6
- package/dist-package/src/FormHint/FormHint.js.map +1 -1
- package/dist-package/src/FormLabel/styles.d.ts +1 -1
- package/package.json +3 -1
- package/src/FormError/FormError.tsx +2 -10
- package/src/FormError/__snapshots__/test.tsx.snap +2 -2
- package/src/FormHint/FormHint.tsx +2 -10
- package/src/FormHint/__snapshots__/test.tsx.snap +1 -1
- package/dist-package/src/FormError/styles.d.ts +0 -3
- package/dist-package/src/FormError/styles.d.ts.map +0 -1
- package/dist-package/src/FormError/styles.js +0 -7
- package/dist-package/src/FormError/styles.js.map +0 -1
- package/dist-package/src/FormHint/styles.d.ts +0 -3
- package/dist-package/src/FormHint/styles.d.ts.map +0 -1
- package/dist-package/src/FormHint/styles.js +0 -7
- package/dist-package/src/FormHint/styles.js.map +0 -1
- package/src/FormError/styles.ts +0 -8
- package/src/FormHint/styles.ts +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormError.d.ts","sourceRoot":"","sources":["../../../src/FormError/FormError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"FormError.d.ts","sourceRoot":"","sources":["../../../src/FormError/FormError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,4BAA4B;IAC5B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,8EAkBpB,CAAA;AAIF,eAAe,SAAS,CAAA"}
|
|
@@ -10,15 +10,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef } from 'react';
|
|
13
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
14
|
-
import cx from 'classnames';
|
|
15
13
|
import { Typography } from '@toptal/picasso-typography';
|
|
16
|
-
import
|
|
17
|
-
const useStyles = makeStyles(styles, { name: 'PicassoFormError' });
|
|
14
|
+
import { twMerge } from '@toptal/picasso-tailwind-merge';
|
|
18
15
|
export const FormError = forwardRef(function FormError(props, ref) {
|
|
19
16
|
const { children, className, style } = props, rest = __rest(props, ["children", "className", "style"]);
|
|
20
|
-
|
|
21
|
-
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cx(classes.root, className), style: style }),
|
|
17
|
+
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: twMerge('mt-1', className), style: style }),
|
|
22
18
|
React.createElement(Typography, { color: 'red', size: 'xxsmall', className: 'cursor-default' }, children)));
|
|
23
19
|
});
|
|
24
20
|
FormError.displayName = 'FormError';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormError.js","sourceRoot":"","sources":["../../../src/FormError/FormError.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FormError.js","sourceRoot":"","sources":["../../../src/FormError/FormError.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAOxD,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAwB,SAAS,SAAS,CAC3E,KAAK,EACL,GAAG;IAEH,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA/C,kCAAuC,CAAQ,CAAA;IAErD,OAAO,CACL,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,EACrC,KAAK,EAAE,KAAK;QAEZ,oBAAC,UAAU,IAAC,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,gBAAgB,IAC9D,QAAQ,CACE,CACT,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAEnC,eAAe,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormHint.d.ts","sourceRoot":"","sources":["../../../src/FormHint/FormHint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"FormHint.d.ts","sourceRoot":"","sources":["../../../src/FormHint/FormHint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,QAAQ,8EAgBnB,CAAA;AAMF,eAAe,QAAQ,CAAA"}
|
|
@@ -10,15 +10,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef } from 'react';
|
|
13
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
14
|
-
import cx from 'classnames';
|
|
15
13
|
import { Typography } from '@toptal/picasso-typography';
|
|
16
|
-
import
|
|
17
|
-
const useStyles = makeStyles(styles, { name: 'FormHint' });
|
|
14
|
+
import { twMerge } from '@toptal/picasso-tailwind-merge';
|
|
18
15
|
export const FormHint = forwardRef(function FormHint(props, ref) {
|
|
19
16
|
const { children, className, style } = props, rest = __rest(props, ["children", "className", "style"]);
|
|
20
|
-
|
|
21
|
-
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cx(classes.root, className), style: style }),
|
|
17
|
+
return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: twMerge('mt-1', className), style: style }),
|
|
22
18
|
React.createElement(Typography, { size: 'xxsmall' }, children)));
|
|
23
19
|
});
|
|
24
20
|
FormHint.defaultProps = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormHint.js","sourceRoot":"","sources":["../../../src/FormHint/FormHint.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FormHint.js","sourceRoot":"","sources":["../../../src/FormHint/FormHint.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAOxD,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAwB,SAAS,QAAQ,CACzE,KAAK,EACL,GAAG;IAEH,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA/C,kCAAuC,CAAQ,CAAA;IAErD,OAAO,CACL,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,EACrC,KAAK,EAAE,KAAK;QAEZ,oBAAC,UAAU,IAAC,IAAI,EAAC,SAAS,IAAE,QAAQ,CAAc,CAC9C,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,YAAY,GAAG,EAAE,CAAA;AAE1B,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAA;AAEjC,eAAe,QAAQ,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Theme } from '@material-ui/core/styles';
|
|
2
|
-
declare const _default: ({ palette }: Theme) => import("@material-ui/styles").StyleRules<{}, "inline" | "
|
|
2
|
+
declare const _default: ({ palette }: Theme) => import("@material-ui/styles").StyleRules<{}, "inline" | "medium" | "large" | "root" | "disabled" | "horizontalLayout" | "asterisk" | "alignmentTop">;
|
|
3
3
|
export default _default;
|
|
4
4
|
//# sourceMappingURL=styles.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso-form",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Toptal UI components library - Form",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -41,12 +41,14 @@
|
|
|
41
41
|
"@material-ui/core": "4.12.4",
|
|
42
42
|
"@toptal/picasso-provider": "*",
|
|
43
43
|
"@toptal/picasso-tailwind": ">=2.7",
|
|
44
|
+
"@toptal/picasso-tailwind-merge": "^1.2.0",
|
|
44
45
|
"react": ">=16.12.0 < 19.0.0"
|
|
45
46
|
},
|
|
46
47
|
"exports": {
|
|
47
48
|
".": "./dist-package/src/index.js"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
51
|
+
"@toptal/picasso-tailwind-merge": "1.2.0",
|
|
50
52
|
"@toptal/picasso-provider": "5.0.0",
|
|
51
53
|
"@toptal/picasso-test-utils": "1.1.1"
|
|
52
54
|
},
|
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
import type { ReactNode, HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import type { Theme } from '@material-ui/core/styles'
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
5
|
-
import cx from 'classnames'
|
|
6
3
|
import type { BaseProps } from '@toptal/picasso-shared'
|
|
7
4
|
import { Typography } from '@toptal/picasso-typography'
|
|
8
|
-
|
|
9
|
-
import styles from './styles'
|
|
5
|
+
import { twMerge } from '@toptal/picasso-tailwind-merge'
|
|
10
6
|
|
|
11
7
|
export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
|
|
12
8
|
/** The text of the error */
|
|
13
9
|
children: ReactNode
|
|
14
10
|
}
|
|
15
11
|
|
|
16
|
-
const useStyles = makeStyles<Theme>(styles, { name: 'PicassoFormError' })
|
|
17
|
-
|
|
18
12
|
export const FormError = forwardRef<HTMLDivElement, Props>(function FormError(
|
|
19
13
|
props,
|
|
20
14
|
ref
|
|
21
15
|
) {
|
|
22
16
|
const { children, className, style, ...rest } = props
|
|
23
17
|
|
|
24
|
-
const classes = useStyles()
|
|
25
|
-
|
|
26
18
|
return (
|
|
27
19
|
<div
|
|
28
20
|
{...rest}
|
|
29
21
|
ref={ref}
|
|
30
|
-
className={
|
|
22
|
+
className={twMerge('mt-1', className)}
|
|
31
23
|
style={style}
|
|
32
24
|
>
|
|
33
25
|
<Typography color='red' size='xxsmall' className='cursor-default'>
|
|
@@ -33,7 +33,7 @@ exports[`FormError renders 1`] = `
|
|
|
33
33
|
/>
|
|
34
34
|
</div>
|
|
35
35
|
<div
|
|
36
|
-
class="
|
|
36
|
+
class="mt-1"
|
|
37
37
|
>
|
|
38
38
|
<p
|
|
39
39
|
class="m-0 text-2xs text-red font-regular cursor-default"
|
|
@@ -42,7 +42,7 @@ exports[`FormError renders 1`] = `
|
|
|
42
42
|
</p>
|
|
43
43
|
</div>
|
|
44
44
|
<div
|
|
45
|
-
class="
|
|
45
|
+
class="mt-1"
|
|
46
46
|
>
|
|
47
47
|
<p
|
|
48
48
|
class="m-0 text-2xs text-graphite font-regular"
|
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
import type { ReactNode, HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import type { Theme } from '@material-ui/core/styles'
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
5
|
-
import cx from 'classnames'
|
|
6
3
|
import type { BaseProps } from '@toptal/picasso-shared'
|
|
7
4
|
import { Typography } from '@toptal/picasso-typography'
|
|
8
|
-
|
|
9
|
-
import styles from './styles'
|
|
5
|
+
import { twMerge } from '@toptal/picasso-tailwind-merge'
|
|
10
6
|
|
|
11
7
|
export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
|
|
12
8
|
/** The text of the hint */
|
|
13
9
|
children: ReactNode
|
|
14
10
|
}
|
|
15
11
|
|
|
16
|
-
const useStyles = makeStyles<Theme>(styles, { name: 'FormHint' })
|
|
17
|
-
|
|
18
12
|
export const FormHint = forwardRef<HTMLDivElement, Props>(function FormHint(
|
|
19
13
|
props,
|
|
20
14
|
ref
|
|
21
15
|
) {
|
|
22
16
|
const { children, className, style, ...rest } = props
|
|
23
17
|
|
|
24
|
-
const classes = useStyles()
|
|
25
|
-
|
|
26
18
|
return (
|
|
27
19
|
<div
|
|
28
20
|
{...rest}
|
|
29
21
|
ref={ref}
|
|
30
|
-
className={
|
|
22
|
+
className={twMerge('mt-1', className)}
|
|
31
23
|
style={style}
|
|
32
24
|
>
|
|
33
25
|
<Typography size='xxsmall'>{children}</Typography>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/FormError/styles.ts"],"names":[],"mappings":";AAEA,wBAKI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/FormError/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,eAAe,GAAG,EAAE,CAClB,YAAY,CAAC;IACX,IAAI,EAAE;QACJ,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/FormHint/styles.ts"],"names":[],"mappings":";AAEA,wBAKI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/FormHint/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,eAAe,GAAG,EAAE,CAClB,YAAY,CAAC;IACX,IAAI,EAAE;QACJ,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAA"}
|
package/src/FormError/styles.ts
DELETED