@campxdev/shared 1.0.0 → 1.0.2
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/.eslintrc.js
CHANGED
|
@@ -2,33 +2,39 @@ module.exports = {
|
|
|
2
2
|
env: {
|
|
3
3
|
browser: true,
|
|
4
4
|
es2021: true,
|
|
5
|
-
jest: true
|
|
5
|
+
jest: true,
|
|
6
6
|
},
|
|
7
7
|
parser: '@typescript-eslint/parser',
|
|
8
8
|
extends: ['prettier', 'plugin:storybook/recommended'],
|
|
9
|
-
overrides: [
|
|
9
|
+
overrides: [
|
|
10
|
+
{
|
|
11
|
+
files: ['**/*.stories.*'],
|
|
12
|
+
rules: {
|
|
13
|
+
'import/no-anonymous-default-export': 'off',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
],
|
|
10
17
|
parserOptions: {
|
|
11
18
|
ecmaVersion: 'latest',
|
|
12
19
|
sourceType: 'module',
|
|
13
20
|
ecmaFeatures: {
|
|
14
|
-
jsx: true
|
|
15
|
-
}
|
|
21
|
+
jsx: true,
|
|
22
|
+
},
|
|
16
23
|
},
|
|
17
24
|
settings: {
|
|
18
25
|
'import/resolver': {
|
|
19
|
-
typescript: {}
|
|
20
|
-
}
|
|
26
|
+
typescript: {},
|
|
27
|
+
},
|
|
21
28
|
},
|
|
22
29
|
plugins: ['react', '@typescript-eslint', 'prettier'],
|
|
23
30
|
rules: {
|
|
24
31
|
'react/react-in-jsx-scope': 'off',
|
|
25
|
-
'spaced-comment': 'error',
|
|
26
32
|
'no-duplicate-imports': 'error',
|
|
27
33
|
'no-console': 'warn',
|
|
28
34
|
'react/prop-types': ['off'],
|
|
29
35
|
'react/jsx-key': ['warn'],
|
|
30
36
|
'react/no-unescaped-entities': 'off',
|
|
31
|
-
'spaced-comment': 'off'
|
|
37
|
+
'spaced-comment': 'off',
|
|
32
38
|
},
|
|
33
|
-
ignorePatterns: ['**/*.html']
|
|
34
|
-
}
|
|
39
|
+
ignorePatterns: ['**/*.html'],
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"main": "./exports.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "react-scripts start",
|
|
@@ -78,17 +78,5 @@
|
|
|
78
78
|
"react-scripts": "^5.0.1",
|
|
79
79
|
"storybook-addon-react-router-v6": "^0.2.1",
|
|
80
80
|
"typescript": "^4.8.4"
|
|
81
|
-
},
|
|
82
|
-
"eslintConfig": {
|
|
83
|
-
"overrides": [
|
|
84
|
-
{
|
|
85
|
-
"files": [
|
|
86
|
-
"**/*.stories.*"
|
|
87
|
-
],
|
|
88
|
-
"rules": {
|
|
89
|
-
"import/no-anonymous-default-export": "off"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
81
|
}
|
|
94
82
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { ReactNode } from 'react'
|
|
11
11
|
import { Controller } from 'react-hook-form'
|
|
12
12
|
import FormLabel from './FormLabel'
|
|
13
|
-
|
|
13
|
+
type Props = {
|
|
14
14
|
name?: string
|
|
15
15
|
control?: any
|
|
16
16
|
options: Array<{ label: ReactNode; value: any }>
|
|
@@ -19,7 +19,7 @@ interface Props extends SelectProps {
|
|
|
19
19
|
onChange?: (value: any) => void
|
|
20
20
|
required?: boolean
|
|
21
21
|
firstItemEmpty?: boolean
|
|
22
|
-
}
|
|
22
|
+
} & SelectProps
|
|
23
23
|
|
|
24
24
|
const StyledFormControl = styled(FormControl)(({ theme }) => ({}))
|
|
25
25
|
|
|
@@ -50,6 +50,7 @@ export default function FormSingleSelect(props: Props) {
|
|
|
50
50
|
<FormLabel required={required} label={label} />
|
|
51
51
|
</InputLabel>
|
|
52
52
|
<Select
|
|
53
|
+
multiple={false}
|
|
53
54
|
size={size}
|
|
54
55
|
error={Boolean(error)}
|
|
55
56
|
variant="outlined"
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { ReactNode } from 'react'
|
|
10
10
|
import { Controller } from 'react-hook-form'
|
|
11
11
|
import FormLabel from './FormLabel'
|
|
12
|
-
|
|
12
|
+
type Props = {
|
|
13
13
|
name?: string
|
|
14
14
|
control?: any
|
|
15
15
|
options: Array<{ label: ReactNode; value: any }>
|
|
@@ -19,7 +19,7 @@ interface Props extends SelectProps {
|
|
|
19
19
|
required?: boolean
|
|
20
20
|
hookForm?: boolean
|
|
21
21
|
firstItemEmpty?: boolean
|
|
22
|
-
}
|
|
22
|
+
} & SelectProps
|
|
23
23
|
|
|
24
24
|
export default function SingleSelect(props: Props) {
|
|
25
25
|
const {
|
|
@@ -46,6 +46,7 @@ export default function SingleSelect(props: Props) {
|
|
|
46
46
|
<FormLabel required={required} label={label} />
|
|
47
47
|
</InputLabel>
|
|
48
48
|
<Select
|
|
49
|
+
multiple={false}
|
|
49
50
|
variant="outlined"
|
|
50
51
|
id={name}
|
|
51
52
|
value={props.value}
|
|
@@ -81,6 +82,7 @@ export default function SingleSelect(props: Props) {
|
|
|
81
82
|
<FormLabel required={required} label={label} />
|
|
82
83
|
</InputLabel>
|
|
83
84
|
<Select
|
|
85
|
+
multiple={false}
|
|
84
86
|
error={Boolean(error)}
|
|
85
87
|
variant="outlined"
|
|
86
88
|
sx={{ color: textColor }}
|