@platformatic/ui-components 0.1.104 → 0.1.105
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/.nvmrc +1 -1
- package/dist/assets/index-3e148026.js +206 -0
- package/dist/assets/{index.f8753767.css → index-6fadf156.css} +1 -1
- package/dist/index.html +2 -2
- package/index.js +2 -0
- package/package.json +20 -20
- package/src/components/ModalStepsForward.jsx +90 -0
- package/src/components/ModalStepsForward.module.css +32 -0
- package/src/components/constants.js +2 -0
- package/src/components/forms/Field.jsx +1 -1
- package/src/components/forms/Field.module.css +1 -1
- package/src/components/forms/Input.jsx +9 -7
- package/src/components/forms/Input.module.css +19 -5
- package/src/components/forms/Password.jsx +79 -0
- package/src/components/forms/Password.module.css +34 -0
- package/src/components/forms/RadioGroup.jsx +72 -0
- package/src/components/forms/RadioGroup.module.css +37 -0
- package/src/components/forms/Select.jsx +125 -0
- package/src/components/forms/Select.module.css +23 -0
- package/src/components/forms/TextArea.jsx +83 -0
- package/src/components/forms/TextArea.module.css +16 -0
- package/src/components/forms/index.js +13 -1
- package/src/components/icons/CircleCheckMarkFullIcon.jsx +50 -0
- package/src/components/icons/ConfigureDatabaseIcon.jsx +89 -0
- package/src/components/icons/CreatingAppIcon.jsx +95 -0
- package/src/components/icons/DatabaseMigrationIcon.jsx +86 -0
- package/src/components/icons/EyeClosedIcon.jsx +51 -0
- package/src/components/icons/EyeOpenedIcon.jsx +49 -0
- package/src/components/icons/GitHubRepoIcon.jsx +108 -0
- package/src/components/icons/NameAppIcon.jsx +90 -0
- package/src/components/icons/RunningIcon.jsx +83 -0
- package/src/components/icons/SocialGitLabIcon.jsx +3 -3
- package/src/components/icons/index.js +18 -0
- package/src/stories/ModalStepsForward.stories.jsx +60 -0
- package/src/stories/forms/Password.stories.jsx +63 -0
- package/src/stories/forms/RadioGroup.stories.jsx +77 -0
- package/src/stories/forms/Select.stories.jsx +71 -0
- package/src/stories/forms/TextArea.stories.jsx +73 -0
- package/dist/assets/index.605a6a5e.js +0 -206
- /package/dist/assets/{Montserrat-Regular.dcfe8df2.ttf → Montserrat-Regular-dcfe8df2.ttf} +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
import RadioGroup from '../../components/forms/RadioGroup'
|
|
4
|
+
|
|
5
|
+
const divStyle = {
|
|
6
|
+
width: '100%',
|
|
7
|
+
height: 'auto',
|
|
8
|
+
padding: '20px',
|
|
9
|
+
backgroundColor: 'white'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const radios = [{ label: 'One', value: '1' }, { label: 'Two', value: '2' }, { label: 'Three', value: '3' }]
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Platformatic/Forms/RadioGroup',
|
|
16
|
+
component: RadioGroup,
|
|
17
|
+
decorators: [
|
|
18
|
+
(Story) => (
|
|
19
|
+
<div style={divStyle}>
|
|
20
|
+
<Story />
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const Template = (args) => {
|
|
27
|
+
const [value, setValue] = useState(args.value || '')
|
|
28
|
+
|
|
29
|
+
function handleChange (event) {
|
|
30
|
+
setValue(event.target.value)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<p>Value of the radio {value}</p>
|
|
36
|
+
<RadioGroup {...args} value={value} onChange={handleChange} />
|
|
37
|
+
</>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Default = Template.bind({})
|
|
42
|
+
|
|
43
|
+
Default.args = {
|
|
44
|
+
name: 'test',
|
|
45
|
+
radios
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const DefaultInvalid = Template.bind({})
|
|
49
|
+
|
|
50
|
+
DefaultInvalid.args = {
|
|
51
|
+
name: 'test',
|
|
52
|
+
radios,
|
|
53
|
+
errorMessage: 'This is an error message'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const Disabled = Template.bind({})
|
|
57
|
+
|
|
58
|
+
Disabled.args = {
|
|
59
|
+
name: 'test',
|
|
60
|
+
radios,
|
|
61
|
+
disabled: true
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const Empty = Template.bind({})
|
|
65
|
+
|
|
66
|
+
Empty.args = {
|
|
67
|
+
name: 'test',
|
|
68
|
+
radios: []
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const ValueSelected = Template.bind({})
|
|
72
|
+
|
|
73
|
+
ValueSelected.args = {
|
|
74
|
+
name: 'test',
|
|
75
|
+
radios,
|
|
76
|
+
value: '3'
|
|
77
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
import Select from '../../components/forms/Select'
|
|
4
|
+
import { MAIN_DARK_BLUE, MAIN_GREEN } from '../../components/constants'
|
|
5
|
+
|
|
6
|
+
const divStyle = {
|
|
7
|
+
width: '100%',
|
|
8
|
+
height: 'auto',
|
|
9
|
+
padding: '20px',
|
|
10
|
+
backgroundColor: 'transparent'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Platformatic/Forms/Select',
|
|
15
|
+
component: Select,
|
|
16
|
+
decorators: [
|
|
17
|
+
(Story) => (
|
|
18
|
+
<div style={divStyle}>
|
|
19
|
+
<Story />
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Template = (args) => <Select {...args} />
|
|
26
|
+
|
|
27
|
+
export const Default = Template.bind({})
|
|
28
|
+
|
|
29
|
+
Default.args = {
|
|
30
|
+
name: 'test',
|
|
31
|
+
placeholder: 'Platformatic empty select',
|
|
32
|
+
borderColor: MAIN_GREEN
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const TemplateBorderMainDarkBlue = (args) => {
|
|
36
|
+
const [value, setValue] = useState('')
|
|
37
|
+
|
|
38
|
+
function handleChange (event) {
|
|
39
|
+
setValue(event.target.value)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function handleSelect (event) {
|
|
43
|
+
setValue(event.detail.label)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div style={{ backgroundColor: 'white', padding: '20px 10px' }}>
|
|
48
|
+
<p>Value of the input {value}</p>
|
|
49
|
+
<Select {...args} value={value} onChange={handleChange} onSelect={handleSelect} />
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const BorderMainDarkBlue = TemplateBorderMainDarkBlue.bind({})
|
|
55
|
+
|
|
56
|
+
BorderMainDarkBlue.args = {
|
|
57
|
+
name: 'test',
|
|
58
|
+
placeholder: 'Defaul option',
|
|
59
|
+
options: [...Array(20).keys()].map(ele => ({ label: `Option ${ele}`, value: `Value${ele}` })),
|
|
60
|
+
borderColor: MAIN_DARK_BLUE
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const DefaultInvalid = TemplateBorderMainDarkBlue.bind({})
|
|
64
|
+
|
|
65
|
+
DefaultInvalid.args = {
|
|
66
|
+
name: 'test',
|
|
67
|
+
placeholder: 'Platformatic empty select',
|
|
68
|
+
options: [{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }, { label: 'Option 3', value: '3' }],
|
|
69
|
+
borderColor: MAIN_GREEN,
|
|
70
|
+
errorMessage: 'This is an error message'
|
|
71
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
import TextArea from '../../components/forms/TextArea'
|
|
4
|
+
|
|
5
|
+
const divStyle = {
|
|
6
|
+
width: '100%',
|
|
7
|
+
height: 'auto',
|
|
8
|
+
padding: '20px',
|
|
9
|
+
backgroundColor: 'white'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'Platformatic/Forms/TextArea',
|
|
14
|
+
component: TextArea,
|
|
15
|
+
decorators: [
|
|
16
|
+
(Story) => (
|
|
17
|
+
<div style={divStyle}>
|
|
18
|
+
<Story />
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const Template = (args) => <TextArea {...args} />
|
|
25
|
+
|
|
26
|
+
export const Default = Template.bind({})
|
|
27
|
+
|
|
28
|
+
Default.args = {
|
|
29
|
+
name: 'test',
|
|
30
|
+
placeholder: 'Platformatic'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const DefaultInvalid = Template.bind({})
|
|
34
|
+
|
|
35
|
+
DefaultInvalid.args = {
|
|
36
|
+
name: 'test',
|
|
37
|
+
placeholder: 'Platformatic',
|
|
38
|
+
borderColor: 'main-dark-blue',
|
|
39
|
+
errorMessage: 'This is an error message'
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const TemplateValuedAndAlertChange = (args) => {
|
|
43
|
+
const [value, setValue] = useState('')
|
|
44
|
+
|
|
45
|
+
function handleChange (event) {
|
|
46
|
+
setValue(event.target.value)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<p>Value of the input {value}</p>
|
|
52
|
+
<TextArea {...args} value={value} onChange={handleChange} />
|
|
53
|
+
</>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const ValuedAndAlertChange = TemplateValuedAndAlertChange.bind({})
|
|
58
|
+
|
|
59
|
+
ValuedAndAlertChange.args = {
|
|
60
|
+
name: 'test',
|
|
61
|
+
placeholder: 'Platformatic'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const IconAfter = Template.bind({})
|
|
65
|
+
|
|
66
|
+
IconAfter.args = {
|
|
67
|
+
name: 'test',
|
|
68
|
+
placeholder: 'Platformatic',
|
|
69
|
+
afterIcon: {
|
|
70
|
+
iconName: 'CircleAddIcon',
|
|
71
|
+
color: 'error-red'
|
|
72
|
+
}
|
|
73
|
+
}
|