@platformatic/ui-components 0.1.32 → 0.1.34
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/.github/workflows/ci.yml +26 -26
- package/.nvmrc +1 -1
- package/LICENSE +201 -201
- package/README.md +30 -26
- package/dist/main.css +35 -23
- package/fonts/Montserrat/README.txt +81 -81
- package/index.html +12 -12
- package/index.js +62 -58
- package/package.json +76 -76
- package/postcss.config.cjs +8 -8
- package/public/api-icon-closed.svg +6 -6
- package/public/api-icon.svg +9 -9
- package/src/App.jsx +12 -12
- package/src/components/BorderedBox.jsx +16 -16
- package/src/components/BorderedBox.module.css +2 -2
- package/src/components/BorderedText.jsx +8 -8
- package/src/components/BorderedText.module.css +2 -2
- package/src/components/Box.jsx +14 -14
- package/src/components/Box.module.css +7 -7
- package/src/components/Button.jsx +23 -23
- package/src/components/Button.module.css +68 -21
- package/src/components/ButtonFullRounded.jsx +17 -0
- package/src/components/ButtonFullRounded.module.css +28 -0
- package/src/components/Checkbox.jsx +11 -0
- package/src/components/Checkbox.module.css +18 -0
- package/src/components/Common.module.css +7 -7
- package/src/components/DetailedMetric.jsx +32 -32
- package/src/components/DetailedMetric.module.css +2 -2
- package/src/components/DropDown.jsx +35 -35
- package/src/components/DropDown.module.css +22 -22
- package/src/components/FollowUs.jsx +35 -35
- package/src/components/FollowUs.module.css +11 -11
- package/src/components/GHLoginButton.jsx +14 -14
- package/src/components/HorizontalSeparator.jsx +10 -5
- package/src/components/HorizontalSeparator.module.css +23 -0
- package/src/components/Input.jsx +11 -11
- package/src/components/Input.module.css +7 -7
- package/src/components/List.jsx +20 -20
- package/src/components/List.module.css +11 -11
- package/src/components/ListElement.jsx +23 -23
- package/src/components/ListElement.module.css +23 -23
- package/src/components/Loadable.jsx +34 -34
- package/src/components/Loadable.module.css +13 -13
- package/src/components/LoginButton.jsx +17 -17
- package/src/components/LoginButton.module.css +7 -7
- package/src/components/LoginButton.test.jsx +25 -25
- package/src/components/Logo.jsx +58 -58
- package/src/components/Main.jsx +33 -33
- package/src/components/MetricValue.jsx +15 -15
- package/src/components/MetricValue.module.css +7 -7
- package/src/components/Modal.jsx +61 -29
- package/src/components/Modal.module.css +37 -25
- package/src/components/Playground.jsx +9 -9
- package/src/components/SearchBar.jsx +63 -63
- package/src/components/SearchBar.module.css +20 -20
- package/src/components/SimpleMetric.jsx +32 -32
- package/src/components/SimpleMetric.module.css +6 -6
- package/src/components/Status.jsx +26 -26
- package/src/components/TabbedWindow.jsx +34 -34
- package/src/components/TabbedWindow.module.css +16 -16
- package/src/components/TextWithLabel.jsx +11 -11
- package/src/components/TextWithLabel.module.css +8 -8
- package/src/components/Versions.jsx +9 -9
- package/src/components/VerticalSeparator.jsx +5 -5
- package/src/components/icons/ApiEmptyIcon.jsx +107 -107
- package/src/components/icons/ApiIcon.jsx +29 -29
- package/src/components/icons/ApiIconClosed.jsx +19 -19
- package/src/components/icons/CloseModalGreenHoverIcon.jsx +37 -0
- package/src/components/icons/CloseModalGreenIcon.jsx +27 -0
- package/src/components/icons/CloseModalIcon.jsx +26 -26
- package/src/components/icons/PullRequestIcon.jsx +31 -31
- package/src/components/icons/index.js +11 -9
- package/src/components/layouts/Layout.jsx +11 -11
- package/src/components/layouts/TwoColumnsLayout.jsx +12 -12
- package/src/components/layouts/TwoColumnsLayout.module.css +9 -9
- package/src/hooks/useEscapeKey.js +20 -20
- package/src/lib/utils.js +23 -23
- package/src/main.jsx +9 -9
- package/src/stories/BorderedBox.stories.jsx +33 -33
- package/src/stories/BorderedText.stories.jsx +24 -24
- package/src/stories/Button.stories.jsx +124 -107
- package/src/stories/ButtonFullRounded.stories.jsx +61 -0
- package/src/stories/Checkbox.stories.jsx +27 -0
- package/src/stories/DetailedMetric.stories.jsx +33 -33
- package/src/stories/DropDown.stories.jsx +62 -62
- package/src/stories/FollowUs.stories.jsx +14 -14
- package/src/stories/GHLoginButton.stories.jsx +14 -14
- package/src/stories/HorizontalSeparator.stories.jsx +12 -12
- package/src/stories/Input.stories.jsx +15 -15
- package/src/stories/Introduction.stories.mdx +211 -211
- package/src/stories/List.stories.jsx +29 -29
- package/src/stories/ListElement.stories.jsx +15 -15
- package/src/stories/Loadable.stories.jsx +75 -75
- package/src/stories/LoginButton.stories.jsx +15 -15
- package/src/stories/Logo.stories.jsx +17 -17
- package/src/stories/Modal.stories.jsx +94 -65
- package/src/stories/SearchBar.stories.jsx +28 -28
- package/src/stories/SimpleMetric.stories.jsx +41 -41
- package/src/stories/Status.stories.jsx +31 -31
- package/src/stories/TextWithLabel.stories.jsx +25 -25
- package/src/stories/TwoColumnsLayout.stories.jsx +42 -42
- package/src/styles/main.css +15 -15
- package/tailwind.config.cjs +42 -37
- package/vite.config.js +6 -6
- package/vitest.config.js +14 -14
- package/dist/api-icon-closed.svg +0 -6
- package/dist/api-icon.svg +0 -9
- package/dist/assets/index.5ac5acb7.js +0 -797
- package/dist/assets/index.d3f5882c.css +0 -1
- package/dist/index.html +0 -14
- package/dist/vite.svg +0 -1
package/src/lib/utils.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
function getColor (type, color) {
|
|
4
|
-
let convertedColor
|
|
5
|
-
switch (color) {
|
|
6
|
-
case 'green':
|
|
7
|
-
convertedColor = 'main-green'
|
|
8
|
-
break
|
|
9
|
-
case 'red':
|
|
10
|
-
convertedColor = 'error-red'
|
|
11
|
-
break
|
|
12
|
-
case 'white':
|
|
13
|
-
convertedColor = 'white'
|
|
14
|
-
break
|
|
15
|
-
default:
|
|
16
|
-
convertedColor = 'main-green'
|
|
17
|
-
break
|
|
18
|
-
}
|
|
19
|
-
return `${type}-${convertedColor}`
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
getColor
|
|
23
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
function getColor (type, color) {
|
|
4
|
+
let convertedColor
|
|
5
|
+
switch (color) {
|
|
6
|
+
case 'green':
|
|
7
|
+
convertedColor = 'main-green'
|
|
8
|
+
break
|
|
9
|
+
case 'red':
|
|
10
|
+
convertedColor = 'error-red'
|
|
11
|
+
break
|
|
12
|
+
case 'white':
|
|
13
|
+
convertedColor = 'white'
|
|
14
|
+
break
|
|
15
|
+
default:
|
|
16
|
+
convertedColor = 'main-green'
|
|
17
|
+
break
|
|
18
|
+
}
|
|
19
|
+
return `${type}-${convertedColor}`
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
getColor
|
|
23
|
+
}
|
package/src/main.jsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import ReactDOM from 'react-dom/client'
|
|
3
|
-
import App from './App'
|
|
4
|
-
import './styles/main.css'
|
|
5
|
-
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
6
|
-
<React.StrictMode>
|
|
7
|
-
<App />
|
|
8
|
-
</React.StrictMode>
|
|
9
|
-
)
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import ReactDOM from 'react-dom/client'
|
|
3
|
+
import App from './App'
|
|
4
|
+
import './styles/main.css'
|
|
5
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
6
|
+
<React.StrictMode>
|
|
7
|
+
<App />
|
|
8
|
+
</React.StrictMode>
|
|
9
|
+
)
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import BorderedBox from '../components/BorderedBox'
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Platformatic/BorderedBox',
|
|
5
|
-
component: BorderedBox,
|
|
6
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
7
|
-
argTypes: {
|
|
8
|
-
color: {
|
|
9
|
-
options: ['green', 'red', 'white'],
|
|
10
|
-
control: { type: ' radio' }
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
16
|
-
const Template = (args) => <BorderedBox {...args}>Hello Platformatic</BorderedBox>
|
|
17
|
-
|
|
18
|
-
export const Green = Template.bind({})
|
|
19
|
-
|
|
20
|
-
Green.args = {
|
|
21
|
-
color: 'green'
|
|
22
|
-
}
|
|
23
|
-
export const Red = Template.bind({})
|
|
24
|
-
|
|
25
|
-
Red.args = {
|
|
26
|
-
color: 'red'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const White = Template.bind({})
|
|
30
|
-
|
|
31
|
-
White.args = {
|
|
32
|
-
color: 'white'
|
|
33
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import BorderedBox from '../components/BorderedBox'
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Platformatic/BorderedBox',
|
|
5
|
+
component: BorderedBox,
|
|
6
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
7
|
+
argTypes: {
|
|
8
|
+
color: {
|
|
9
|
+
options: ['green', 'red', 'white'],
|
|
10
|
+
control: { type: ' radio' }
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
16
|
+
const Template = (args) => <BorderedBox {...args}>Hello Platformatic</BorderedBox>
|
|
17
|
+
|
|
18
|
+
export const Green = Template.bind({})
|
|
19
|
+
|
|
20
|
+
Green.args = {
|
|
21
|
+
color: 'green'
|
|
22
|
+
}
|
|
23
|
+
export const Red = Template.bind({})
|
|
24
|
+
|
|
25
|
+
Red.args = {
|
|
26
|
+
color: 'red'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const White = Template.bind({})
|
|
30
|
+
|
|
31
|
+
White.args = {
|
|
32
|
+
color: 'white'
|
|
33
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import BorderedText from '../components/BorderedText'
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Platformatic/BorderedText',
|
|
5
|
-
component: BorderedText,
|
|
6
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
7
|
-
argTypes: {
|
|
8
|
-
text: { control: 'string' }
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
13
|
-
const Template = (args) => <BorderedText {...args} />
|
|
14
|
-
|
|
15
|
-
export const Sample = Template.bind({})
|
|
16
|
-
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
17
|
-
Sample.args = {
|
|
18
|
-
text: 'Hello Platformatic!'
|
|
19
|
-
}
|
|
20
|
-
export const Version = Template.bind({})
|
|
21
|
-
|
|
22
|
-
Version.args = {
|
|
23
|
-
text: 'v1.2.3'
|
|
24
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import BorderedText from '../components/BorderedText'
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Platformatic/BorderedText',
|
|
5
|
+
component: BorderedText,
|
|
6
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
7
|
+
argTypes: {
|
|
8
|
+
text: { control: 'string' }
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
13
|
+
const Template = (args) => <BorderedText {...args} />
|
|
14
|
+
|
|
15
|
+
export const Sample = Template.bind({})
|
|
16
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
17
|
+
Sample.args = {
|
|
18
|
+
text: 'Hello Platformatic!'
|
|
19
|
+
}
|
|
20
|
+
export const Version = Template.bind({})
|
|
21
|
+
|
|
22
|
+
Version.args = {
|
|
23
|
+
text: 'v1.2.3'
|
|
24
|
+
}
|
|
@@ -1,107 +1,124 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import { faCheck } from '@fortawesome/free-solid-svg-icons'
|
|
3
|
-
import { useState } from 'react'
|
|
4
|
-
import Button from '../components/Button'
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Platformatic/Button',
|
|
8
|
-
component: Button,
|
|
9
|
-
argTypes: {
|
|
10
|
-
label: {
|
|
11
|
-
type: 'string',
|
|
12
|
-
control: 'text'
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
type: 'boolean'
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
type: 'string',
|
|
19
|
-
control: {
|
|
20
|
-
type: 'radio',
|
|
21
|
-
options: ['
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
import { faCheck } from '@fortawesome/free-solid-svg-icons'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import Button from '../components/Button'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Platformatic/Button',
|
|
8
|
+
component: Button,
|
|
9
|
+
argTypes: {
|
|
10
|
+
label: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
control: 'text'
|
|
13
|
+
},
|
|
14
|
+
bold: {
|
|
15
|
+
type: 'boolean'
|
|
16
|
+
},
|
|
17
|
+
buttonClass: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
control: {
|
|
20
|
+
type: 'radio',
|
|
21
|
+
options: ['primary', 'secondary', 'transparent']
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
color: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
control: {
|
|
27
|
+
type: 'radio',
|
|
28
|
+
options: ['green', 'red', 'white']
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
disabled: {
|
|
32
|
+
type: 'boolean'
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
control: {
|
|
37
|
+
type: 'radio',
|
|
38
|
+
options: ['small', 'medium', 'large', 'extra-large']
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const Template = (args) => <Button {...args} />
|
|
45
|
+
|
|
46
|
+
export const PrimaryGreen = Template.bind({})
|
|
47
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
48
|
+
PrimaryGreen.args = {
|
|
49
|
+
buttonClass: 'primary',
|
|
50
|
+
label: 'Primary Green',
|
|
51
|
+
color: 'green',
|
|
52
|
+
bold: true
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const SecondaryRed = Template.bind({})
|
|
56
|
+
SecondaryRed.args = {
|
|
57
|
+
label: 'Secondary Green',
|
|
58
|
+
color: 'red'
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const TransparentWhite = Template.bind({})
|
|
62
|
+
TransparentWhite.args = {
|
|
63
|
+
buttonClass: 'transparent',
|
|
64
|
+
label: 'Secondary Green',
|
|
65
|
+
color: 'white'
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const PrimaryWithIcon = Template.bind({})
|
|
69
|
+
PrimaryWithIcon.args = {
|
|
70
|
+
buttonClass: 'primary',
|
|
71
|
+
label: 'Primary with Icon',
|
|
72
|
+
icon: faCheck
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const SecondaryWithIcon = Template.bind({})
|
|
76
|
+
SecondaryWithIcon.args = {
|
|
77
|
+
buttonClass: 'secondary',
|
|
78
|
+
label: 'Secondary with Icon',
|
|
79
|
+
icon: faCheck,
|
|
80
|
+
color: 'white'
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const PrimaryRed = Template.bind({})
|
|
84
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
85
|
+
PrimaryRed.args = {
|
|
86
|
+
buttonClass: 'primary',
|
|
87
|
+
label: 'Primary Red',
|
|
88
|
+
color: 'red'
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const DisabledTemplate = (args) => {
|
|
92
|
+
const [enabled, setEnabled] = useState(false)
|
|
93
|
+
return (
|
|
94
|
+
<div className='flex flex-col gap-y-6 text-white'>
|
|
95
|
+
<div>
|
|
96
|
+
<Button {...args} disabled={!enabled} onClick={() => alert('clicked')} />
|
|
97
|
+
<span className='ml-4 text-xl'>👈 This button is {enabled ? 'enabled' : 'disabled'}</span>
|
|
98
|
+
</div>
|
|
99
|
+
<div>
|
|
100
|
+
<Button label='Toggle Disabled' primary='true' onClick={() => setEnabled(!enabled)} />
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const DisabledGreen = DisabledTemplate.bind({})
|
|
109
|
+
|
|
110
|
+
DisabledGreen.args = {
|
|
111
|
+
buttonClass: 'primary',
|
|
112
|
+
label: 'A simple button',
|
|
113
|
+
color: 'green',
|
|
114
|
+
disabled: true
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const DisabledRed = DisabledTemplate.bind({})
|
|
118
|
+
|
|
119
|
+
DisabledRed.args = {
|
|
120
|
+
buttonClass: 'primary',
|
|
121
|
+
label: 'A simple button',
|
|
122
|
+
color: 'red',
|
|
123
|
+
disabled: true
|
|
124
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import { faStop, faRefresh } from '@fortawesome/free-solid-svg-icons'
|
|
3
|
+
import ButtonFullRounded from '../components/ButtonFullRounded'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Platformatic/ButtonFullRounded',
|
|
7
|
+
component: ButtonFullRounded,
|
|
8
|
+
argTypes: {
|
|
9
|
+
label: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
control: 'text'
|
|
12
|
+
},
|
|
13
|
+
bold: {
|
|
14
|
+
type: 'boolean'
|
|
15
|
+
},
|
|
16
|
+
color: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
control: {
|
|
19
|
+
type: 'radio',
|
|
20
|
+
options: ['green', 'red', 'white']
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
control: {
|
|
26
|
+
type: 'radio',
|
|
27
|
+
options: ['small', 'medium', 'large']
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const Template = (args) => <ButtonFullRounded {...args} />
|
|
34
|
+
|
|
35
|
+
export const WhiteLarge = Template.bind({})
|
|
36
|
+
WhiteLarge.args = {
|
|
37
|
+
icon: faStop,
|
|
38
|
+
size: 'large'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const GreenSmall = Template.bind({})
|
|
42
|
+
GreenSmall.args = {
|
|
43
|
+
icon: faStop,
|
|
44
|
+
color: 'green',
|
|
45
|
+
size: 'small'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const Disabled = Template.bind({})
|
|
49
|
+
|
|
50
|
+
Disabled.args = {
|
|
51
|
+
icon: faRefresh,
|
|
52
|
+
disabled: true
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const DisabledRed = Template.bind({})
|
|
56
|
+
|
|
57
|
+
DisabledRed.args = {
|
|
58
|
+
icon: faRefresh,
|
|
59
|
+
color: 'red',
|
|
60
|
+
disabled: true
|
|
61
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import Checkbox from '../components/Checkbox'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Platformatic/Checkbox',
|
|
6
|
+
component: Checkbox,
|
|
7
|
+
argTypes: {
|
|
8
|
+
id: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
control: 'text'
|
|
11
|
+
},
|
|
12
|
+
disabled: {
|
|
13
|
+
type: 'boolean'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Template = (args) => <Checkbox {...args} />
|
|
19
|
+
|
|
20
|
+
export const CheckboxRegular = Template.bind({})
|
|
21
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
22
|
+
CheckboxRegular.args = {}
|
|
23
|
+
|
|
24
|
+
export const CheckboxDisabled = Template.bind({})
|
|
25
|
+
CheckboxDisabled.args = {
|
|
26
|
+
disabled: true
|
|
27
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import DetailedMetric from '../components/DetailedMetric'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Platformatic/DetailedMetric',
|
|
7
|
-
component: DetailedMetric
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const Template = (args) => <DetailedMetric {...args} />
|
|
11
|
-
|
|
12
|
-
export const Default = Template.bind({})
|
|
13
|
-
|
|
14
|
-
Default.args = {
|
|
15
|
-
title: 'Requests',
|
|
16
|
-
color: 'green',
|
|
17
|
-
unit: 'ms',
|
|
18
|
-
value: 120,
|
|
19
|
-
pre: 'P90',
|
|
20
|
-
tooltip: 'This is a tooltip for the metric',
|
|
21
|
-
leftDetail: {
|
|
22
|
-
value: 600,
|
|
23
|
-
unit: 'ms',
|
|
24
|
-
color: 'green',
|
|
25
|
-
pre: 'P99'
|
|
26
|
-
},
|
|
27
|
-
rightDetail: {
|
|
28
|
-
value: 4.42,
|
|
29
|
-
unit: 's',
|
|
30
|
-
color: 'green',
|
|
31
|
-
pre: 'P95'
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import DetailedMetric from '../components/DetailedMetric'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Platformatic/DetailedMetric',
|
|
7
|
+
component: DetailedMetric
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Template = (args) => <DetailedMetric {...args} />
|
|
11
|
+
|
|
12
|
+
export const Default = Template.bind({})
|
|
13
|
+
|
|
14
|
+
Default.args = {
|
|
15
|
+
title: 'Requests',
|
|
16
|
+
color: 'green',
|
|
17
|
+
unit: 'ms',
|
|
18
|
+
value: 120,
|
|
19
|
+
pre: 'P90',
|
|
20
|
+
tooltip: 'This is a tooltip for the metric',
|
|
21
|
+
leftDetail: {
|
|
22
|
+
value: 600,
|
|
23
|
+
unit: 'ms',
|
|
24
|
+
color: 'green',
|
|
25
|
+
pre: 'P99'
|
|
26
|
+
},
|
|
27
|
+
rightDetail: {
|
|
28
|
+
value: 4.42,
|
|
29
|
+
unit: 's',
|
|
30
|
+
color: 'green',
|
|
31
|
+
pre: 'P95'
|
|
32
|
+
}
|
|
33
|
+
}
|