@pareto-engineering/design-system 4.0.0-alpha.61 → 4.0.0-alpha.63
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/cjs/a/TextSteps/TextSteps.js +4 -4
- package/dist/cjs/a/TextSteps/styles.scss +1 -1
- package/dist/cjs/f/FormInput/FormInput.js +43 -13
- package/dist/cjs/f/common/V2/Description/Description.js +76 -0
- package/dist/cjs/f/common/V2/Description/index.js +13 -0
- package/dist/cjs/f/common/V2/Description/styles.scss +10 -0
- package/dist/cjs/f/common/V2/Label/Label.js +84 -0
- package/dist/cjs/f/common/V2/Label/index.js +13 -0
- package/dist/cjs/f/common/V2/Label/styles.scss +9 -0
- package/dist/cjs/f/common/V2/index.js +19 -0
- package/dist/cjs/f/common/index.js +12 -0
- package/dist/cjs/f/fields/V2/Checkbox/Checkbox.js +122 -0
- package/dist/cjs/f/fields/V2/Checkbox/index.js +13 -0
- package/dist/cjs/f/fields/V2/Checkbox/styles.scss +16 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/ChoicesInput.js +154 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/common/Choice/Choice.js +104 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/common/Choice/index.js +13 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/common/index.js +12 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/styles.scss +79 -0
- package/dist/cjs/f/fields/V2/EditorInput/EditorInput.js +197 -0
- package/dist/cjs/f/fields/V2/EditorInput/common/Toolbar.js +257 -0
- package/dist/cjs/f/fields/V2/EditorInput/common/TreeViewPlugin.js +18 -0
- package/dist/cjs/f/fields/V2/EditorInput/common/index.js +20 -0
- package/dist/cjs/f/fields/V2/EditorInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/EditorInput/styles.scss +149 -0
- package/dist/cjs/f/fields/V2/LinkInput/LinkInput.js +156 -0
- package/dist/cjs/f/fields/V2/LinkInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/LinkInput/styles.scss +90 -0
- package/dist/cjs/f/fields/V2/QueryChoices/QueryChoices.js +137 -0
- package/dist/cjs/f/fields/V2/QueryChoices/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/QueryCombobox.js +229 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Combobox/Combobox.js +236 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Combobox/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Menu/Menu.js +83 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Menu/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +300 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/index.js +26 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/styles.scss +127 -0
- package/dist/cjs/f/fields/V2/QuerySelect/QuerySelect.js +198 -0
- package/dist/cjs/f/fields/V2/QuerySelect/index.js +13 -0
- package/dist/cjs/f/fields/V2/RatingsInput/RatingsInput.js +130 -0
- package/dist/cjs/f/fields/V2/RatingsInput/common/Rating/Rating.js +117 -0
- package/dist/cjs/f/fields/V2/RatingsInput/common/Rating/index.js +13 -0
- package/dist/cjs/f/fields/V2/RatingsInput/common/index.js +12 -0
- package/dist/cjs/f/fields/V2/RatingsInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/RatingsInput/styles.scss +48 -0
- package/dist/cjs/f/fields/V2/SelectInput/SelectInput.js +154 -0
- package/dist/cjs/f/fields/V2/SelectInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/SelectInput/styles.scss +87 -0
- package/dist/cjs/f/fields/V2/TextInput/TextInput.js +155 -0
- package/dist/cjs/f/fields/V2/TextInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/TextInput/styles.scss +78 -0
- package/dist/cjs/f/fields/V2/TextareaInput/TextareaInput.js +152 -0
- package/dist/cjs/f/fields/V2/TextareaInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/TextareaInput/styles.scss +53 -0
- package/dist/cjs/f/fields/V2/index.js +82 -0
- package/dist/cjs/f/fields/index.js +26 -1
- package/dist/es/a/TextSteps/TextSteps.js +4 -4
- package/dist/es/a/TextSteps/styles.scss +1 -1
- package/dist/es/f/FormInput/FormInput.js +33 -3
- package/dist/es/f/common/V2/Description/Description.js +68 -0
- package/dist/es/f/common/V2/Description/index.js +2 -0
- package/dist/es/f/common/V2/Description/styles.scss +10 -0
- package/dist/es/f/common/V2/Label/Label.js +76 -0
- package/dist/es/f/common/V2/Label/index.js +2 -0
- package/dist/es/f/common/V2/Label/styles.scss +9 -0
- package/dist/es/f/common/V2/index.js +2 -0
- package/dist/es/f/common/index.js +2 -1
- package/dist/es/f/fields/V2/Checkbox/Checkbox.js +114 -0
- package/dist/es/f/fields/V2/Checkbox/index.js +2 -0
- package/dist/es/f/fields/V2/Checkbox/styles.scss +16 -0
- package/dist/es/f/fields/V2/ChoicesInput/ChoicesInput.js +148 -0
- package/dist/es/f/fields/V2/ChoicesInput/common/Choice/Choice.js +97 -0
- package/dist/es/f/fields/V2/ChoicesInput/common/Choice/index.js +2 -0
- package/dist/es/f/fields/V2/ChoicesInput/common/index.js +1 -0
- package/dist/es/f/fields/V2/ChoicesInput/index.js +2 -0
- package/dist/es/f/fields/V2/ChoicesInput/styles.scss +79 -0
- package/dist/es/f/fields/V2/EditorInput/EditorInput.js +192 -0
- package/dist/es/f/fields/V2/EditorInput/common/Toolbar.js +246 -0
- package/dist/es/f/fields/V2/EditorInput/common/TreeViewPlugin.js +11 -0
- package/dist/es/f/fields/V2/EditorInput/common/index.js +2 -0
- package/dist/es/f/fields/V2/EditorInput/index.js +2 -0
- package/dist/es/f/fields/V2/EditorInput/styles.scss +149 -0
- package/dist/es/f/fields/V2/LinkInput/LinkInput.js +148 -0
- package/dist/es/f/fields/V2/LinkInput/index.js +2 -0
- package/dist/es/f/fields/V2/LinkInput/styles.scss +90 -0
- package/dist/es/f/fields/V2/QueryChoices/QueryChoices.js +126 -0
- package/dist/es/f/fields/V2/QueryChoices/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/QueryCombobox.js +221 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/Combobox/Combobox.js +229 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/Combobox/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/Menu/Menu.js +73 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/Menu/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +293 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/index.js +3 -0
- package/dist/es/f/fields/V2/QueryCombobox/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/styles.scss +127 -0
- package/dist/es/f/fields/V2/QuerySelect/QuerySelect.js +186 -0
- package/dist/es/f/fields/V2/QuerySelect/index.js +2 -0
- package/dist/es/f/fields/V2/RatingsInput/RatingsInput.js +124 -0
- package/dist/es/f/fields/V2/RatingsInput/common/Rating/Rating.js +109 -0
- package/dist/es/f/fields/V2/RatingsInput/common/Rating/index.js +2 -0
- package/dist/es/f/fields/V2/RatingsInput/common/index.js +1 -0
- package/dist/es/f/fields/V2/RatingsInput/index.js +2 -0
- package/dist/es/f/fields/V2/RatingsInput/styles.scss +48 -0
- package/dist/es/f/fields/V2/SelectInput/SelectInput.js +146 -0
- package/dist/es/f/fields/V2/SelectInput/index.js +2 -0
- package/dist/es/f/fields/V2/SelectInput/styles.scss +87 -0
- package/dist/es/f/fields/V2/TextInput/TextInput.js +147 -0
- package/dist/es/f/fields/V2/TextInput/index.js +2 -0
- package/dist/es/f/fields/V2/TextInput/styles.scss +78 -0
- package/dist/es/f/fields/V2/TextareaInput/TextareaInput.js +146 -0
- package/dist/es/f/fields/V2/TextareaInput/index.js +2 -0
- package/dist/es/f/fields/V2/TextareaInput/styles.scss +53 -0
- package/dist/es/f/fields/V2/index.js +11 -0
- package/dist/es/f/fields/index.js +2 -1
- package/package.json +3 -3
- package/src/stories/f/v2/Checkbox.stories.jsx +102 -0
- package/src/stories/f/v2/ChoicesInput.stories.jsx +139 -0
- package/src/stories/f/v2/EditorInput.stories.jsx +81 -0
- package/src/stories/f/v2/LinkInput.stories.jsx +93 -0
- package/src/stories/f/v2/QueryChoices.stories.jsx +144 -0
- package/src/stories/f/v2/QueryCombobox.stories.jsx +301 -0
- package/src/stories/f/v2/QuerySelect.stories.jsx +150 -0
- package/src/stories/f/v2/RatingsInput.stories.jsx +77 -0
- package/src/stories/f/v2/SelectInput.stories.jsx +95 -0
- package/src/stories/f/v2/TextInput.stories.jsx +120 -0
- package/src/stories/f/v2/TextareaInput.stories.jsx +107 -0
- package/src/stories/f/v2/__generated__/FormInputAllTaskStatusesQuery.graphql.js +122 -0
- package/src/stories/f/v2/__generated__/FormInputAllTeamsQuery.graphql.js +139 -0
- package/src/stories/f/v2/__generated__/QueryChoicesAllTaskStatusesQuery.graphql.js +122 -0
- package/src/stories/f/v2/__generated__/QueryComboboxAllTeamsQuery.graphql.js +139 -0
- package/src/stories/f/v2/__generated__/QuerySelectAllTaskStatusesQuery.graphql.js +122 -0
- package/src/ui/a/TextSteps/TextSteps.jsx +4 -4
- package/src/ui/a/TextSteps/styles.scss +1 -1
- package/src/ui/f/FormInput/FormInput.jsx +57 -12
- package/src/ui/f/common/V2/Description/Description.jsx +94 -0
- package/src/ui/f/common/V2/Description/index.js +2 -0
- package/src/ui/f/common/V2/Description/styles.scss +10 -0
- package/src/ui/f/common/V2/Label/Label.jsx +102 -0
- package/src/ui/f/common/V2/Label/index.js +2 -0
- package/src/ui/f/common/V2/Label/styles.scss +9 -0
- package/src/ui/f/common/V2/index.js +2 -0
- package/src/ui/f/common/index.js +1 -0
- package/src/ui/f/fields/V2/Checkbox/Checkbox.jsx +146 -0
- package/src/ui/f/fields/V2/Checkbox/index.js +2 -0
- package/src/ui/f/fields/V2/Checkbox/styles.scss +16 -0
- package/src/ui/f/fields/V2/ChoicesInput/ChoicesInput.jsx +183 -0
- package/src/ui/f/fields/V2/ChoicesInput/common/Choice/Choice.jsx +125 -0
- package/src/ui/f/fields/V2/ChoicesInput/common/Choice/index.js +2 -0
- package/src/ui/f/fields/V2/ChoicesInput/common/index.js +1 -0
- package/src/ui/f/fields/V2/ChoicesInput/index.js +2 -0
- package/src/ui/f/fields/V2/ChoicesInput/styles.scss +79 -0
- package/src/ui/f/fields/V2/EditorInput/EditorInput.jsx +244 -0
- package/src/ui/f/fields/V2/EditorInput/common/Toolbar.jsx +356 -0
- package/src/ui/f/fields/V2/EditorInput/common/TreeViewPlugin.jsx +16 -0
- package/src/ui/f/fields/V2/EditorInput/common/index.jsx +2 -0
- package/src/ui/f/fields/V2/EditorInput/index.js +2 -0
- package/src/ui/f/fields/V2/EditorInput/styles.scss +149 -0
- package/src/ui/f/fields/V2/LinkInput/LinkInput.jsx +187 -0
- package/src/ui/f/fields/V2/LinkInput/index.js +2 -0
- package/src/ui/f/fields/V2/LinkInput/styles.scss +90 -0
- package/src/ui/f/fields/V2/QueryChoices/QueryChoices.jsx +153 -0
- package/src/ui/f/fields/V2/QueryChoices/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/QueryCombobox.jsx +254 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/Combobox/Combobox.jsx +276 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/Combobox/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/Menu/Menu.jsx +103 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/Menu/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +362 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/index.js +3 -0
- package/src/ui/f/fields/V2/QueryCombobox/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/styles.scss +127 -0
- package/src/ui/f/fields/V2/QuerySelect/QuerySelect.jsx +220 -0
- package/src/ui/f/fields/V2/QuerySelect/index.js +2 -0
- package/src/ui/f/fields/V2/RatingsInput/RatingsInput.jsx +152 -0
- package/src/ui/f/fields/V2/RatingsInput/common/Rating/Rating.jsx +142 -0
- package/src/ui/f/fields/V2/RatingsInput/common/Rating/index.js +2 -0
- package/src/ui/f/fields/V2/RatingsInput/common/index.js +1 -0
- package/src/ui/f/fields/V2/RatingsInput/index.js +2 -0
- package/src/ui/f/fields/V2/RatingsInput/styles.scss +48 -0
- package/src/ui/f/fields/V2/SelectInput/SelectInput.jsx +187 -0
- package/src/ui/f/fields/V2/SelectInput/index.js +2 -0
- package/src/ui/f/fields/V2/SelectInput/styles.scss +87 -0
- package/src/ui/f/fields/V2/TextInput/TextInput.jsx +192 -0
- package/src/ui/f/fields/V2/TextInput/index.js +2 -0
- package/src/ui/f/fields/V2/TextInput/styles.scss +78 -0
- package/src/ui/f/fields/V2/TextareaInput/TextareaInput.jsx +180 -0
- package/src/ui/f/fields/V2/TextareaInput/index.js +2 -0
- package/src/ui/f/fields/V2/TextareaInput/styles.scss +53 -0
- package/src/ui/f/fields/V2/index.js +11 -0
- package/src/ui/f/fields/index.js +1 -0
- package/tests/__snapshots__/Storyshots.test.js.snap +5910 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { Formik, Form } from 'formik'
|
|
5
|
+
|
|
6
|
+
import { RatingsInputV2, FormDebugger } from 'ui'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title :'f/fields/V2/RatingsInputV2',
|
|
10
|
+
component :RatingsInputV2,
|
|
11
|
+
subcomponents:{
|
|
12
|
+
// Item:RatingsInputV2.Item
|
|
13
|
+
},
|
|
14
|
+
decorators:[
|
|
15
|
+
(storyfn) => (
|
|
16
|
+
<Formik
|
|
17
|
+
initialValues={{ ratings: '' }}
|
|
18
|
+
>
|
|
19
|
+
<Form>
|
|
20
|
+
{ storyfn() }
|
|
21
|
+
</Form>
|
|
22
|
+
</Formik>
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
argTypes:{
|
|
26
|
+
// backgroundColor:{ control: 'color' },
|
|
27
|
+
ratingCount :{ control: 'number' },
|
|
28
|
+
name :{ control: 'text' },
|
|
29
|
+
label :{ control: 'text' },
|
|
30
|
+
labelColor :{ control: 'text' },
|
|
31
|
+
showRatingValue :{ control: 'boolean' },
|
|
32
|
+
displayRatingsLabel:{ control: 'boolean' },
|
|
33
|
+
labelMax :{ control: 'text' },
|
|
34
|
+
labelMin :{ control: 'text' },
|
|
35
|
+
optional :{ control: 'boolean' },
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Template = (args) => (
|
|
40
|
+
<div
|
|
41
|
+
style={{
|
|
42
|
+
display :'flex',
|
|
43
|
+
flexDirection:'column',
|
|
44
|
+
gap :'1rem',
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<RatingsInputV2 {...args} />
|
|
48
|
+
<FormDebugger />
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
export const Base = Template.bind({})
|
|
53
|
+
Base.args = {
|
|
54
|
+
ratingCount:5,
|
|
55
|
+
name :'ratings',
|
|
56
|
+
label :'Your Rating',
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const Optional = Template.bind({})
|
|
60
|
+
Optional.args = {
|
|
61
|
+
...Base.args,
|
|
62
|
+
optional:true,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const Numbers = Template.bind({})
|
|
66
|
+
Numbers.args = {
|
|
67
|
+
...Base.args,
|
|
68
|
+
showRatingValue:true,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const Labels = Template.bind({})
|
|
72
|
+
Labels.args = {
|
|
73
|
+
...Numbers.args,
|
|
74
|
+
labelMax :'very satisfied.',
|
|
75
|
+
labelMin :'not satisfied.',
|
|
76
|
+
displayRatingsLabel:true,
|
|
77
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { Formik, Form } from 'formik'
|
|
4
|
+
|
|
5
|
+
import { SelectInputV2, FormDebugger } from 'ui'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title :'f/fields/V2/SelectInputV2',
|
|
9
|
+
component :SelectInputV2,
|
|
10
|
+
subcomponents:{
|
|
11
|
+
// Item:SelectInputV2.Item
|
|
12
|
+
},
|
|
13
|
+
decorators:[
|
|
14
|
+
(storyfn) => (
|
|
15
|
+
<Formik
|
|
16
|
+
initialValues={{ workType: '' }}
|
|
17
|
+
>
|
|
18
|
+
<Form>
|
|
19
|
+
{ storyfn() }
|
|
20
|
+
</Form>
|
|
21
|
+
</Formik>
|
|
22
|
+
),
|
|
23
|
+
],
|
|
24
|
+
argTypes:{
|
|
25
|
+
color :{ control: 'text' },
|
|
26
|
+
label :{ control: 'text' },
|
|
27
|
+
labelColor:{ control: 'text' },
|
|
28
|
+
disabled :{ control: 'boolean' },
|
|
29
|
+
optional :{ control: 'boolean' },
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const Template = (args) => (
|
|
34
|
+
<div
|
|
35
|
+
style={{
|
|
36
|
+
display :'flex',
|
|
37
|
+
flexDirection:'column',
|
|
38
|
+
gap :'1rem',
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<SelectInputV2 {...args} />
|
|
42
|
+
<FormDebugger />
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
export const Base = Template.bind({})
|
|
47
|
+
Base.args = {
|
|
48
|
+
name :'workType',
|
|
49
|
+
label :'Work Type',
|
|
50
|
+
options:[
|
|
51
|
+
{ value: '', label: 'Select an option', disabled: true },
|
|
52
|
+
{ value: 'Work', label: 'Work' },
|
|
53
|
+
{ value: 'Managing', label: 'Managing' },
|
|
54
|
+
{ value: 'Training', label: 'Training' },
|
|
55
|
+
],
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const Optional = Template.bind({})
|
|
59
|
+
Optional.args = {
|
|
60
|
+
...Base.args,
|
|
61
|
+
optional:true,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const StringAndObjects = Template.bind({})
|
|
65
|
+
StringAndObjects.args = {
|
|
66
|
+
...Base.args,
|
|
67
|
+
options:[...Base.args.options, 'Option1', 'Option2', 'Option3'],
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const requiredInput = (inputValue) => {
|
|
71
|
+
let error = ''
|
|
72
|
+
|
|
73
|
+
if (!inputValue || !inputValue?.length === 0) {
|
|
74
|
+
error = 'This information is required'
|
|
75
|
+
}
|
|
76
|
+
return error
|
|
77
|
+
}
|
|
78
|
+
export const Required = Template.bind({})
|
|
79
|
+
Required.args = {
|
|
80
|
+
...Base.args,
|
|
81
|
+
validate:requiredInput,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const DisabledSelectInput = Template.bind({})
|
|
85
|
+
DisabledSelectInput.args = {
|
|
86
|
+
...Base.args,
|
|
87
|
+
disabled:true,
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const DisabledWithDescriptionSelectInput = Template.bind({})
|
|
91
|
+
DisabledWithDescriptionSelectInput.args = {
|
|
92
|
+
...Base.args,
|
|
93
|
+
disabled :true,
|
|
94
|
+
description:'This is a description',
|
|
95
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { Formik, Form } from 'formik'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
TextInputV2,
|
|
7
|
+
FormDebugger,
|
|
8
|
+
} from 'ui'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title :'f/fields/V2/TextInput',
|
|
12
|
+
component :TextInputV2,
|
|
13
|
+
subcomponents:{
|
|
14
|
+
// Item:TextInput.Item
|
|
15
|
+
},
|
|
16
|
+
decorators:[
|
|
17
|
+
(storyfn) => (
|
|
18
|
+
<Formik
|
|
19
|
+
initialValues={{ email: '', name: '', company: '' }}
|
|
20
|
+
>
|
|
21
|
+
<Form>
|
|
22
|
+
|
|
23
|
+
{ storyfn() }
|
|
24
|
+
</Form>
|
|
25
|
+
</Formik>
|
|
26
|
+
),
|
|
27
|
+
],
|
|
28
|
+
argTypes:{
|
|
29
|
+
// backgroundColor:{ control: 'color' },
|
|
30
|
+
placeholder :{ control: 'text' },
|
|
31
|
+
autoComplete:{ control: 'select', options: ['off', 'on'] },
|
|
32
|
+
disabled :{ control: 'boolean' },
|
|
33
|
+
type :{ control: 'text' },
|
|
34
|
+
name :{ control: 'text' },
|
|
35
|
+
label :{ control: 'text' },
|
|
36
|
+
labelColor :{ control: 'text' },
|
|
37
|
+
optional :{ control: 'boolean' },
|
|
38
|
+
symbol :{ control: 'text' },
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line react/prop-types
|
|
43
|
+
const Template = (args) => (
|
|
44
|
+
<div
|
|
45
|
+
style={{
|
|
46
|
+
display :'flex',
|
|
47
|
+
flexDirection:'column',
|
|
48
|
+
gap :'1rem',
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<TextInputV2 {...args} />
|
|
52
|
+
<FormDebugger />
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
export const Base = Template.bind({})
|
|
57
|
+
Base.args = {
|
|
58
|
+
name :'email',
|
|
59
|
+
label:'How can we reach you ?',
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const Optional = Template.bind({})
|
|
63
|
+
Optional.args = {
|
|
64
|
+
...Base.args,
|
|
65
|
+
optional:true,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const validate = (value) => {
|
|
69
|
+
let errorMessage = ''
|
|
70
|
+
const isValid = value.length > 3
|
|
71
|
+
|
|
72
|
+
if (!isValid) {
|
|
73
|
+
errorMessage = 'Value should be greater than 3 characters'
|
|
74
|
+
}
|
|
75
|
+
return errorMessage
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const WithValidation = Template.bind({})
|
|
79
|
+
WithValidation.args = {
|
|
80
|
+
...Base.args,
|
|
81
|
+
validate,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const WithPlaceholder = Template.bind({})
|
|
85
|
+
WithPlaceholder.args = {
|
|
86
|
+
...Base.args,
|
|
87
|
+
placeholder:'Email address',
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const WithAutoCompleteOff = Template.bind({})
|
|
91
|
+
WithAutoCompleteOff.args = {
|
|
92
|
+
...Base.args,
|
|
93
|
+
autoComplete:'off',
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const WithDisabled = Template.bind({})
|
|
97
|
+
WithDisabled.args = {
|
|
98
|
+
...Base.args,
|
|
99
|
+
disabled:true,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const Date = Template.bind({})
|
|
103
|
+
Date.args = {
|
|
104
|
+
type :'date',
|
|
105
|
+
name :'date',
|
|
106
|
+
label:'Select date',
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const Time = Template.bind({})
|
|
110
|
+
Time.args = {
|
|
111
|
+
type :'time',
|
|
112
|
+
name :'time',
|
|
113
|
+
label:'Select time',
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const HasSymbol = Template.bind({})
|
|
117
|
+
HasSymbol.args = {
|
|
118
|
+
...Base.args,
|
|
119
|
+
symbol:"'$'",
|
|
120
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { Formik, Form } from 'formik'
|
|
5
|
+
|
|
6
|
+
import { TextareaInputV2, FormDebugger } from 'ui'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title :'f/fields/V2/TextareaInputV2',
|
|
10
|
+
component :TextareaInputV2,
|
|
11
|
+
subcomponents:{
|
|
12
|
+
// Item:TextareaInputV2.Item
|
|
13
|
+
},
|
|
14
|
+
decorators:[
|
|
15
|
+
(storyfn) => (
|
|
16
|
+
<Formik
|
|
17
|
+
initialValues={{ feedback: '' }}
|
|
18
|
+
>
|
|
19
|
+
<Form>
|
|
20
|
+
|
|
21
|
+
{ storyfn() }
|
|
22
|
+
</Form>
|
|
23
|
+
</Formik>
|
|
24
|
+
),
|
|
25
|
+
],
|
|
26
|
+
argTypes:{
|
|
27
|
+
// backgroundColor:{ control: 'color' },
|
|
28
|
+
name :{ control: 'text' },
|
|
29
|
+
label :{ control: 'text' },
|
|
30
|
+
labelColor :{ control: 'text' },
|
|
31
|
+
placeholder :{ control: 'text' },
|
|
32
|
+
disabled :{ control: 'boolean' },
|
|
33
|
+
labelAsDescription:{ control: 'boolean' },
|
|
34
|
+
optional :{ control: 'boolean' },
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const Template = (args) => (
|
|
39
|
+
<div
|
|
40
|
+
style={{
|
|
41
|
+
display :'flex',
|
|
42
|
+
flexDirection:'column',
|
|
43
|
+
gap :'1rem',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<TextareaInputV2 {...args} />
|
|
47
|
+
<FormDebugger />
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
export const Base = Template.bind({})
|
|
52
|
+
Base.args = {
|
|
53
|
+
name :'feedback',
|
|
54
|
+
label:'What can we improve on?',
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Optional = Template.bind({})
|
|
58
|
+
Optional.args = {
|
|
59
|
+
...Base.args,
|
|
60
|
+
optional:true,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const Placeholder = Template.bind({})
|
|
64
|
+
Placeholder.args = {
|
|
65
|
+
...Base.args,
|
|
66
|
+
placeholder:'Type your feedback here...',
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const validate = (value) => {
|
|
70
|
+
let errorMessage = ''
|
|
71
|
+
const isValid = value.length > 3
|
|
72
|
+
|
|
73
|
+
if (!isValid) {
|
|
74
|
+
errorMessage = 'Value should be greater than 3 characters'
|
|
75
|
+
}
|
|
76
|
+
return errorMessage
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const Validation = Template.bind({})
|
|
80
|
+
Validation.args = {
|
|
81
|
+
...Base.args,
|
|
82
|
+
validate,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const Disabled = Template.bind({})
|
|
86
|
+
Disabled.args = {
|
|
87
|
+
...Base.args,
|
|
88
|
+
disabled:true,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const VerticalResize = Template.bind({})
|
|
92
|
+
VerticalResize.args = {
|
|
93
|
+
...Base.args,
|
|
94
|
+
resize:'vertical',
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const HorizontalResize = Template.bind({})
|
|
98
|
+
HorizontalResize.args = {
|
|
99
|
+
...Base.args,
|
|
100
|
+
resize:'horizontal',
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const DisableResize = Template.bind({})
|
|
104
|
+
DisableResize.args = {
|
|
105
|
+
...Base.args,
|
|
106
|
+
resize:'none',
|
|
107
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @flow
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
/*::
|
|
10
|
+
import type { ConcreteRequest } from 'relay-runtime';
|
|
11
|
+
export type FormInputAllTaskStatusesQueryVariables = {||};
|
|
12
|
+
export type FormInputAllTaskStatusesQueryResponse = {|
|
|
13
|
+
+allTaskStatuses: ?{|
|
|
14
|
+
+edges: $ReadOnlyArray<?{|
|
|
15
|
+
+node: ?{|
|
|
16
|
+
+id: string,
|
|
17
|
+
+status: string,
|
|
18
|
+
|}
|
|
19
|
+
|}>
|
|
20
|
+
|}
|
|
21
|
+
|};
|
|
22
|
+
export type FormInputAllTaskStatusesQuery = {|
|
|
23
|
+
variables: FormInputAllTaskStatusesQueryVariables,
|
|
24
|
+
response: FormInputAllTaskStatusesQueryResponse,
|
|
25
|
+
|};
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
query FormInputAllTaskStatusesQuery {
|
|
31
|
+
allTaskStatuses {
|
|
32
|
+
edges {
|
|
33
|
+
node {
|
|
34
|
+
id
|
|
35
|
+
status
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
const node/*: ConcreteRequest*/ = (function(){
|
|
43
|
+
var v0 = [
|
|
44
|
+
{
|
|
45
|
+
"alias": null,
|
|
46
|
+
"args": null,
|
|
47
|
+
"concreteType": "TaskStatusNodeConnection",
|
|
48
|
+
"kind": "LinkedField",
|
|
49
|
+
"name": "allTaskStatuses",
|
|
50
|
+
"plural": false,
|
|
51
|
+
"selections": [
|
|
52
|
+
{
|
|
53
|
+
"alias": null,
|
|
54
|
+
"args": null,
|
|
55
|
+
"concreteType": "TaskStatusNodeEdge",
|
|
56
|
+
"kind": "LinkedField",
|
|
57
|
+
"name": "edges",
|
|
58
|
+
"plural": true,
|
|
59
|
+
"selections": [
|
|
60
|
+
{
|
|
61
|
+
"alias": null,
|
|
62
|
+
"args": null,
|
|
63
|
+
"concreteType": "TaskStatusNode",
|
|
64
|
+
"kind": "LinkedField",
|
|
65
|
+
"name": "node",
|
|
66
|
+
"plural": false,
|
|
67
|
+
"selections": [
|
|
68
|
+
{
|
|
69
|
+
"alias": null,
|
|
70
|
+
"args": null,
|
|
71
|
+
"kind": "ScalarField",
|
|
72
|
+
"name": "id",
|
|
73
|
+
"storageKey": null
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"alias": null,
|
|
77
|
+
"args": null,
|
|
78
|
+
"kind": "ScalarField",
|
|
79
|
+
"name": "status",
|
|
80
|
+
"storageKey": null
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"storageKey": null
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"storageKey": null
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"storageKey": null
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
return {
|
|
93
|
+
"fragment": {
|
|
94
|
+
"argumentDefinitions": [],
|
|
95
|
+
"kind": "Fragment",
|
|
96
|
+
"metadata": null,
|
|
97
|
+
"name": "FormInputAllTaskStatusesQuery",
|
|
98
|
+
"selections": (v0/*: any*/),
|
|
99
|
+
"type": "Query",
|
|
100
|
+
"abstractKey": null
|
|
101
|
+
},
|
|
102
|
+
"kind": "Request",
|
|
103
|
+
"operation": {
|
|
104
|
+
"argumentDefinitions": [],
|
|
105
|
+
"kind": "Operation",
|
|
106
|
+
"name": "FormInputAllTaskStatusesQuery",
|
|
107
|
+
"selections": (v0/*: any*/)
|
|
108
|
+
},
|
|
109
|
+
"params": {
|
|
110
|
+
"cacheID": "54ce3d351c6ef9fa16c73a954fc5cfea",
|
|
111
|
+
"id": null,
|
|
112
|
+
"metadata": {},
|
|
113
|
+
"name": "FormInputAllTaskStatusesQuery",
|
|
114
|
+
"operationKind": "query",
|
|
115
|
+
"text": "query FormInputAllTaskStatusesQuery {\n allTaskStatuses {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n"
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
})();
|
|
119
|
+
// prettier-ignore
|
|
120
|
+
(node/*: any*/).hash = 'a86a4a669c61db10cd2bd9b72b3eeb12';
|
|
121
|
+
|
|
122
|
+
module.exports = node;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @flow
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
/*::
|
|
10
|
+
import type { ConcreteRequest } from 'relay-runtime';
|
|
11
|
+
export type FormInputAllTeamsQueryVariables = {|
|
|
12
|
+
name_Icontains?: ?string
|
|
13
|
+
|};
|
|
14
|
+
export type FormInputAllTeamsQueryResponse = {|
|
|
15
|
+
+allTeams: ?{|
|
|
16
|
+
+edges: $ReadOnlyArray<?{|
|
|
17
|
+
+node: ?{|
|
|
18
|
+
+id: string,
|
|
19
|
+
+name: string,
|
|
20
|
+
|}
|
|
21
|
+
|}>
|
|
22
|
+
|}
|
|
23
|
+
|};
|
|
24
|
+
export type FormInputAllTeamsQuery = {|
|
|
25
|
+
variables: FormInputAllTeamsQueryVariables,
|
|
26
|
+
response: FormInputAllTeamsQueryResponse,
|
|
27
|
+
|};
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
query FormInputAllTeamsQuery(
|
|
33
|
+
$name_Icontains: String
|
|
34
|
+
) {
|
|
35
|
+
allTeams(name_Icontains: $name_Icontains) {
|
|
36
|
+
edges {
|
|
37
|
+
node {
|
|
38
|
+
id
|
|
39
|
+
name
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
const node/*: ConcreteRequest*/ = (function(){
|
|
47
|
+
var v0 = [
|
|
48
|
+
{
|
|
49
|
+
"defaultValue": null,
|
|
50
|
+
"kind": "LocalArgument",
|
|
51
|
+
"name": "name_Icontains"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
v1 = [
|
|
55
|
+
{
|
|
56
|
+
"alias": null,
|
|
57
|
+
"args": [
|
|
58
|
+
{
|
|
59
|
+
"kind": "Variable",
|
|
60
|
+
"name": "name_Icontains",
|
|
61
|
+
"variableName": "name_Icontains"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"concreteType": "TeamNodeConnection",
|
|
65
|
+
"kind": "LinkedField",
|
|
66
|
+
"name": "allTeams",
|
|
67
|
+
"plural": false,
|
|
68
|
+
"selections": [
|
|
69
|
+
{
|
|
70
|
+
"alias": null,
|
|
71
|
+
"args": null,
|
|
72
|
+
"concreteType": "TeamNodeEdge",
|
|
73
|
+
"kind": "LinkedField",
|
|
74
|
+
"name": "edges",
|
|
75
|
+
"plural": true,
|
|
76
|
+
"selections": [
|
|
77
|
+
{
|
|
78
|
+
"alias": null,
|
|
79
|
+
"args": null,
|
|
80
|
+
"concreteType": "TeamNode",
|
|
81
|
+
"kind": "LinkedField",
|
|
82
|
+
"name": "node",
|
|
83
|
+
"plural": false,
|
|
84
|
+
"selections": [
|
|
85
|
+
{
|
|
86
|
+
"alias": null,
|
|
87
|
+
"args": null,
|
|
88
|
+
"kind": "ScalarField",
|
|
89
|
+
"name": "id",
|
|
90
|
+
"storageKey": null
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"alias": null,
|
|
94
|
+
"args": null,
|
|
95
|
+
"kind": "ScalarField",
|
|
96
|
+
"name": "name",
|
|
97
|
+
"storageKey": null
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"storageKey": null
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"storageKey": null
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"storageKey": null
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
return {
|
|
110
|
+
"fragment": {
|
|
111
|
+
"argumentDefinitions": (v0/*: any*/),
|
|
112
|
+
"kind": "Fragment",
|
|
113
|
+
"metadata": null,
|
|
114
|
+
"name": "FormInputAllTeamsQuery",
|
|
115
|
+
"selections": (v1/*: any*/),
|
|
116
|
+
"type": "Query",
|
|
117
|
+
"abstractKey": null
|
|
118
|
+
},
|
|
119
|
+
"kind": "Request",
|
|
120
|
+
"operation": {
|
|
121
|
+
"argumentDefinitions": (v0/*: any*/),
|
|
122
|
+
"kind": "Operation",
|
|
123
|
+
"name": "FormInputAllTeamsQuery",
|
|
124
|
+
"selections": (v1/*: any*/)
|
|
125
|
+
},
|
|
126
|
+
"params": {
|
|
127
|
+
"cacheID": "dc9287c6d087d0f0e1be2e8ef405cb1f",
|
|
128
|
+
"id": null,
|
|
129
|
+
"metadata": {},
|
|
130
|
+
"name": "FormInputAllTeamsQuery",
|
|
131
|
+
"operationKind": "query",
|
|
132
|
+
"text": "query FormInputAllTeamsQuery(\n $name_Icontains: String\n) {\n allTeams(name_Icontains: $name_Icontains) {\n edges {\n node {\n id\n name\n }\n }\n }\n}\n"
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
})();
|
|
136
|
+
// prettier-ignore
|
|
137
|
+
(node/*: any*/).hash = 'c76b6f84436895e8a6d0725bdd41cfe0';
|
|
138
|
+
|
|
139
|
+
module.exports = node;
|