@platformatic/ui-components 0.1.31 → 0.1.33

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.
Files changed (102) hide show
  1. package/.github/workflows/ci.yml +26 -26
  2. package/.nvmrc +1 -1
  3. package/LICENSE +201 -201
  4. package/README.md +26 -26
  5. package/dist/main.css +31 -18
  6. package/fonts/Montserrat/README.txt +81 -81
  7. package/index.html +12 -12
  8. package/index.js +58 -58
  9. package/package.json +76 -76
  10. package/postcss.config.cjs +8 -8
  11. package/public/api-icon-closed.svg +6 -6
  12. package/public/api-icon.svg +9 -9
  13. package/src/App.jsx +12 -12
  14. package/src/components/BorderedBox.jsx +16 -16
  15. package/src/components/BorderedBox.module.css +2 -2
  16. package/src/components/BorderedText.jsx +8 -8
  17. package/src/components/BorderedText.module.css +2 -2
  18. package/src/components/Box.jsx +14 -14
  19. package/src/components/Box.module.css +7 -7
  20. package/src/components/Button.jsx +23 -23
  21. package/src/components/Button.module.css +20 -20
  22. package/src/components/Common.module.css +7 -7
  23. package/src/components/DetailedMetric.jsx +32 -32
  24. package/src/components/DetailedMetric.module.css +2 -2
  25. package/src/components/DropDown.jsx +35 -35
  26. package/src/components/DropDown.module.css +22 -22
  27. package/src/components/FollowUs.jsx +35 -35
  28. package/src/components/FollowUs.module.css +11 -11
  29. package/src/components/GHLoginButton.jsx +14 -14
  30. package/src/components/HorizontalSeparator.jsx +9 -5
  31. package/src/components/Input.jsx +11 -11
  32. package/src/components/Input.module.css +7 -7
  33. package/src/components/List.jsx +20 -20
  34. package/src/components/List.module.css +11 -11
  35. package/src/components/ListElement.jsx +23 -23
  36. package/src/components/ListElement.module.css +23 -23
  37. package/src/components/Loadable.jsx +34 -34
  38. package/src/components/Loadable.module.css +13 -13
  39. package/src/components/LoginButton.jsx +17 -17
  40. package/src/components/LoginButton.module.css +7 -7
  41. package/src/components/LoginButton.test.jsx +25 -25
  42. package/src/components/Logo.jsx +58 -58
  43. package/src/components/Main.jsx +33 -33
  44. package/src/components/MetricValue.jsx +15 -15
  45. package/src/components/MetricValue.module.css +7 -7
  46. package/src/components/Modal.jsx +29 -29
  47. package/src/components/Modal.module.css +24 -24
  48. package/src/components/Playground.jsx +9 -9
  49. package/src/components/SearchBar.jsx +63 -33
  50. package/src/components/SearchBar.module.css +20 -5
  51. package/src/components/SimpleMetric.jsx +32 -32
  52. package/src/components/SimpleMetric.module.css +6 -6
  53. package/src/components/Status.jsx +26 -26
  54. package/src/components/TabbedWindow.jsx +34 -34
  55. package/src/components/TabbedWindow.module.css +16 -16
  56. package/src/components/TextWithLabel.jsx +11 -11
  57. package/src/components/TextWithLabel.module.css +8 -8
  58. package/src/components/Versions.jsx +9 -9
  59. package/src/components/VerticalSeparator.jsx +5 -5
  60. package/src/components/icons/ApiEmptyIcon.jsx +107 -0
  61. package/src/components/icons/ApiIcon.jsx +29 -29
  62. package/src/components/icons/ApiIconClosed.jsx +19 -19
  63. package/src/components/icons/CloseModalIcon.jsx +26 -26
  64. package/src/components/icons/PullRequestIcon.jsx +31 -31
  65. package/src/components/icons/index.js +9 -8
  66. package/src/components/layouts/Layout.jsx +11 -11
  67. package/src/components/layouts/TwoColumnsLayout.jsx +12 -12
  68. package/src/components/layouts/TwoColumnsLayout.module.css +9 -9
  69. package/src/hooks/useEscapeKey.js +20 -20
  70. package/src/lib/utils.js +23 -23
  71. package/src/main.jsx +9 -9
  72. package/src/stories/BorderedBox.stories.jsx +33 -33
  73. package/src/stories/BorderedText.stories.jsx +24 -24
  74. package/src/stories/Button.stories.jsx +107 -107
  75. package/src/stories/DetailedMetric.stories.jsx +33 -33
  76. package/src/stories/DropDown.stories.jsx +62 -62
  77. package/src/stories/FollowUs.stories.jsx +14 -14
  78. package/src/stories/GHLoginButton.stories.jsx +14 -14
  79. package/src/stories/HorizontalSeparator.stories.jsx +12 -12
  80. package/src/stories/Input.stories.jsx +15 -15
  81. package/src/stories/Introduction.stories.mdx +211 -211
  82. package/src/stories/List.stories.jsx +29 -29
  83. package/src/stories/ListElement.stories.jsx +15 -15
  84. package/src/stories/Loadable.stories.jsx +75 -75
  85. package/src/stories/LoginButton.stories.jsx +15 -15
  86. package/src/stories/Logo.stories.jsx +17 -17
  87. package/src/stories/Modal.stories.jsx +65 -65
  88. package/src/stories/SearchBar.stories.jsx +28 -27
  89. package/src/stories/SimpleMetric.stories.jsx +41 -41
  90. package/src/stories/Status.stories.jsx +31 -31
  91. package/src/stories/TextWithLabel.stories.jsx +25 -25
  92. package/src/stories/TwoColumnsLayout.stories.jsx +42 -42
  93. package/src/styles/main.css +15 -15
  94. package/tailwind.config.cjs +37 -37
  95. package/vite.config.js +6 -6
  96. package/vitest.config.js +14 -14
  97. package/dist/api-icon-closed.svg +0 -6
  98. package/dist/api-icon.svg +0 -9
  99. package/dist/assets/index.5ac5acb7.js +0 -797
  100. package/dist/assets/index.d3f5882c.css +0 -1
  101. package/dist/index.html +0 -14
  102. package/dist/vite.svg +0 -1
@@ -1,29 +1,29 @@
1
- import React from 'react'
2
- import List from '../components/List'
3
- import ListElement from '../components/ListElement'
4
-
5
- export default {
6
- title: 'Platformatic/List',
7
- component: List
8
- }
9
-
10
- const Template = (args) => <List {...args} />
11
- export const ListWithNoElements = Template.bind({})
12
- ListWithNoElements.args = {
13
- title: 'List Title'
14
- }
15
-
16
- const TemplateWithElements = (args) => (
17
- <List {...args}>
18
- <ListElement title='List Element 1' detail='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et dui facilisis, molestie urna sed, volutpat nibh.' />
19
- <ListElement title='List Element 2' detail='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et dui facilisis, molestie urna sed, volutpat nibh.' />
20
- </List>
21
- )
22
-
23
- export const ListWithElements = TemplateWithElements.bind({})
24
- ListWithElements.args = {
25
- title: 'List Title'
26
- }
27
-
28
- export const ListWithElementsNoTitle = TemplateWithElements.bind({})
29
- ListWithElementsNoTitle.args = {}
1
+ import React from 'react'
2
+ import List from '../components/List'
3
+ import ListElement from '../components/ListElement'
4
+
5
+ export default {
6
+ title: 'Platformatic/List',
7
+ component: List
8
+ }
9
+
10
+ const Template = (args) => <List {...args} />
11
+ export const ListWithNoElements = Template.bind({})
12
+ ListWithNoElements.args = {
13
+ title: 'List Title'
14
+ }
15
+
16
+ const TemplateWithElements = (args) => (
17
+ <List {...args}>
18
+ <ListElement title='List Element 1' detail='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et dui facilisis, molestie urna sed, volutpat nibh.' />
19
+ <ListElement title='List Element 2' detail='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et dui facilisis, molestie urna sed, volutpat nibh.' />
20
+ </List>
21
+ )
22
+
23
+ export const ListWithElements = TemplateWithElements.bind({})
24
+ ListWithElements.args = {
25
+ title: 'List Title'
26
+ }
27
+
28
+ export const ListWithElementsNoTitle = TemplateWithElements.bind({})
29
+ ListWithElementsNoTitle.args = {}
@@ -1,15 +1,15 @@
1
- import React from 'react'
2
- import ListElement from '../components/ListElement'
3
-
4
- export default {
5
- title: 'Platformatic/ListElement',
6
- component: ListElement
7
- }
8
-
9
- const Template = (args) => <ListElement {...args} />
10
-
11
- export const ListElementFull = Template.bind({})
12
- ListElementFull.args = {
13
- title: 'List Element Title',
14
- detail: 'Lorem Ipsum dolor sit amet consectetur adipiscing elit. Qui enim potest, nisi quis potest, negare'
15
- }
1
+ import React from 'react'
2
+ import ListElement from '../components/ListElement'
3
+
4
+ export default {
5
+ title: 'Platformatic/ListElement',
6
+ component: ListElement
7
+ }
8
+
9
+ const Template = (args) => <ListElement {...args} />
10
+
11
+ export const ListElementFull = Template.bind({})
12
+ ListElementFull.args = {
13
+ title: 'List Element Title',
14
+ detail: 'Lorem Ipsum dolor sit amet consectetur adipiscing elit. Qui enim potest, nisi quis potest, negare'
15
+ }
@@ -1,75 +1,75 @@
1
- import React, { useEffect } from 'react'
2
- import Loadable from '../components/Loadable'
3
- import BorderedBox from '../components/BorderedBox'
4
-
5
- const loremIpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus est nisl, maximus aliquet urna eu, consequat semper nisi. Nam vel elit feugiat dui congue elementum. Sed turpis urna, egestas at pharetra et, lacinia ac mauris. Pellentesque cursus, ipsum nec malesuada ornare, dui purus ultrices elit, non blandit nisi quam non nisi. Suspendisse sapien leo, ultricies pretium vulputate sed, malesuada sed justo. Suspendisse euismod erat ut lacus feugiat malesuada. In tempor a eros et egestas. Nam pretium dolor sollicitudin, cursus sem vitae, elementum enim. Nam in nisi ipsum.
6
- `
7
-
8
- export default {
9
- title: 'Platformatic/Loadable',
10
- component: Loadable
11
- }
12
-
13
- const ContentThatLoads = ({ startLoading }) => {
14
- startLoading()
15
- return <BorderedBox>{loremIpsum}</BorderedBox>
16
- }
17
-
18
- export const Loading = args =>
19
- <Loadable {...args}>
20
- <ContentThatLoads />
21
- </Loadable>
22
- Loading.args = {}
23
-
24
- const ContentThatLoadsAndStops = ({ startLoading, stopLoading }) => {
25
- useEffect(() => {
26
- startLoading()
27
- const timer = setTimeout(() => {
28
- stopLoading()
29
- }, 2000)
30
- return () => clearTimeout(timer)
31
- }, [])
32
- return <BorderedBox>{loremIpsum}</BorderedBox>
33
- }
34
-
35
- export const LoadsAndStops = args => {
36
- return (
37
- <Loadable {...args}>
38
- <ContentThatLoadsAndStops />
39
- </Loadable>
40
- )
41
- }
42
- LoadsAndStops.args = {}
43
-
44
- export const LoadsAndStops2 = args => {
45
- return (
46
- <Loadable {...args}>
47
- <ContentThatLoadsAndStops />
48
- <ContentThatLoadsAndStops />
49
- </Loadable>
50
- )
51
- }
52
- LoadsAndStops2.args = {}
53
-
54
- const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
55
- const ContentThatToggle = ({ startLoading, stopLoading }) => {
56
- useEffect(() => {
57
- startLoading()
58
- const toggle = async () => {
59
- await sleep(1000)
60
- stopLoading()
61
- await sleep(1000)
62
- startLoading(true)
63
- }
64
- toggle()
65
- }, [])
66
- return <BorderedBox>{loremIpsum}</BorderedBox>
67
- }
68
- export const Toggle = args => {
69
- return (
70
- <Loadable {...args}>
71
- <ContentThatToggle />
72
- </Loadable>
73
- )
74
- }
75
- Toggle.args = {}
1
+ import React, { useEffect } from 'react'
2
+ import Loadable from '../components/Loadable'
3
+ import BorderedBox from '../components/BorderedBox'
4
+
5
+ const loremIpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus est nisl, maximus aliquet urna eu, consequat semper nisi. Nam vel elit feugiat dui congue elementum. Sed turpis urna, egestas at pharetra et, lacinia ac mauris. Pellentesque cursus, ipsum nec malesuada ornare, dui purus ultrices elit, non blandit nisi quam non nisi. Suspendisse sapien leo, ultricies pretium vulputate sed, malesuada sed justo. Suspendisse euismod erat ut lacus feugiat malesuada. In tempor a eros et egestas. Nam pretium dolor sollicitudin, cursus sem vitae, elementum enim. Nam in nisi ipsum.
6
+ `
7
+
8
+ export default {
9
+ title: 'Platformatic/Loadable',
10
+ component: Loadable
11
+ }
12
+
13
+ const ContentThatLoads = ({ startLoading }) => {
14
+ startLoading()
15
+ return <BorderedBox>{loremIpsum}</BorderedBox>
16
+ }
17
+
18
+ export const Loading = args =>
19
+ <Loadable {...args}>
20
+ <ContentThatLoads />
21
+ </Loadable>
22
+ Loading.args = {}
23
+
24
+ const ContentThatLoadsAndStops = ({ startLoading, stopLoading }) => {
25
+ useEffect(() => {
26
+ startLoading()
27
+ const timer = setTimeout(() => {
28
+ stopLoading()
29
+ }, 2000)
30
+ return () => clearTimeout(timer)
31
+ }, [])
32
+ return <BorderedBox>{loremIpsum}</BorderedBox>
33
+ }
34
+
35
+ export const LoadsAndStops = args => {
36
+ return (
37
+ <Loadable {...args}>
38
+ <ContentThatLoadsAndStops />
39
+ </Loadable>
40
+ )
41
+ }
42
+ LoadsAndStops.args = {}
43
+
44
+ export const LoadsAndStops2 = args => {
45
+ return (
46
+ <Loadable {...args}>
47
+ <ContentThatLoadsAndStops />
48
+ <ContentThatLoadsAndStops />
49
+ </Loadable>
50
+ )
51
+ }
52
+ LoadsAndStops2.args = {}
53
+
54
+ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
55
+ const ContentThatToggle = ({ startLoading, stopLoading }) => {
56
+ useEffect(() => {
57
+ startLoading()
58
+ const toggle = async () => {
59
+ await sleep(1000)
60
+ stopLoading()
61
+ await sleep(1000)
62
+ startLoading(true)
63
+ }
64
+ toggle()
65
+ }, [])
66
+ return <BorderedBox>{loremIpsum}</BorderedBox>
67
+ }
68
+ export const Toggle = args => {
69
+ return (
70
+ <Loadable {...args}>
71
+ <ContentThatToggle />
72
+ </Loadable>
73
+ )
74
+ }
75
+ Toggle.args = {}
@@ -1,15 +1,15 @@
1
- import React from 'react'
2
- import LoginButton from '../components/LoginButton'
3
-
4
- export default {
5
- title: 'Platformatic/LoginButton',
6
- component: LoginButton
7
- }
8
-
9
- const Template = (args) => <LoginButton {...args} />
10
-
11
- export const NoIcon = Template.bind({})
12
- NoIcon.args = {
13
- label: 'Click here',
14
- onClick: () => alert('clicked')
15
- }
1
+ import React from 'react'
2
+ import LoginButton from '../components/LoginButton'
3
+
4
+ export default {
5
+ title: 'Platformatic/LoginButton',
6
+ component: LoginButton
7
+ }
8
+
9
+ const Template = (args) => <LoginButton {...args} />
10
+
11
+ export const NoIcon = Template.bind({})
12
+ NoIcon.args = {
13
+ label: 'Click here',
14
+ onClick: () => alert('clicked')
15
+ }
@@ -1,17 +1,17 @@
1
- import React from 'react'
2
- import Logo from '../components/Logo'
3
-
4
- export default {
5
- title: 'Platformatic/Logo',
6
- component: Logo
7
- }
8
-
9
- const Template = (args) => <Logo {...args} />
10
- export const LogoLarge = Template.bind({})
11
- LogoLarge.args = {
12
- width: 300,
13
- heigth: 300
14
- }
15
-
16
- export const LogoNormal = Template.bind({})
17
- LogoNormal.args = {}
1
+ import React from 'react'
2
+ import Logo from '../components/Logo'
3
+
4
+ export default {
5
+ title: 'Platformatic/Logo',
6
+ component: Logo
7
+ }
8
+
9
+ const Template = (args) => <Logo {...args} />
10
+ export const LogoLarge = Template.bind({})
11
+ LogoLarge.args = {
12
+ width: 300,
13
+ heigth: 300
14
+ }
15
+
16
+ export const LogoNormal = Template.bind({})
17
+ LogoNormal.args = {}
@@ -1,65 +1,65 @@
1
- import React, { useState } from 'react'
2
- import Modal from '../components/Modal'
3
- import Button from '../components/Button'
4
- import BorderedBox from '../components/BorderedBox'
5
- import DropDown from '../components/DropDown'
6
- import HorizontalSeparator from '../components/HorizontalSeparator'
7
- export default {
8
- title: 'Platformatic/Modal',
9
- component: Modal
10
- }
11
-
12
- const Template = (args) => {
13
- const [isOpen, setIsOpen] = useState(false)
14
- return (
15
- <main>
16
- <BorderedBox>This Is another Content</BorderedBox>
17
- <ContentThatLoads />
18
- <Button color='green' primary='true' onClick={() => setIsOpen(true)} label='Open Modal' />
19
- {isOpen && <Modal setIsOpen={setIsOpen} title='Modal Title'>{args.text}</Modal>}
20
- </main>
21
- )
22
- }
23
-
24
- const ContentThatLoads = () => {
25
- const [content, setContent] = useState(null)
26
- setTimeout(() => {
27
- setContent(<div className='mt-4'><BorderedBox>This is a Future Component</BorderedBox></div>)
28
- }, 1000)
29
-
30
- return content
31
- }
32
-
33
- export const Default = Template.bind({})
34
- Default.args = {
35
- title: 'List Title',
36
- text: 'Hello World'
37
- }
38
-
39
- export const WithLongText = Template.bind({})
40
-
41
- WithLongText.args = {
42
- title: 'Modal',
43
- text: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fermentum, lorem nec tincidunt pellentesque, odio orci posuere lacus, et hendrerit turpis dolor nec metus. Nunc quis finibus enim. Vestibulum a mollis velit. Ut nec vestibulum urna. Phasellus ut odio nec leo hendrerit laoreet eget at turpis. Nulla facilisi. Vivamus accumsan arcu malesuada, imperdiet ligula vitae, varius elit. Morbi blandit eros nec eros rutrum mattis. Nulla nibh nisi, pellentesque a ornare at, ultrices sit amet felis. Nulla bibendum metus diam, vitae gravida dui semper iaculis.
44
-
45
- `.repeat(5)
46
- }
47
-
48
- const MenuTemplate = () => {
49
- const [isOpen, setIsOpen] = useState(false)
50
- const dropDownArgs = {
51
- header: 'My Menu',
52
- items: [
53
- <span className='hover:cursor-pointer' key='2' onClick={() => setIsOpen(true)}>Show Modal</span>
54
- ]
55
- }
56
- return (
57
- <div>
58
- <div className='text-white'><DropDown {...dropDownArgs} /></div>
59
- <HorizontalSeparator />
60
- {isOpen && <Modal setIsOpen={setIsOpen} title='Modal Title'>Hello world!</Modal>}
61
- <ContentThatLoads />
62
- </div>
63
- )
64
- }
65
- export const WithDropDown = MenuTemplate.bind({})
1
+ import React, { useState } from 'react'
2
+ import Modal from '../components/Modal'
3
+ import Button from '../components/Button'
4
+ import BorderedBox from '../components/BorderedBox'
5
+ import DropDown from '../components/DropDown'
6
+ import HorizontalSeparator from '../components/HorizontalSeparator'
7
+ export default {
8
+ title: 'Platformatic/Modal',
9
+ component: Modal
10
+ }
11
+
12
+ const Template = (args) => {
13
+ const [isOpen, setIsOpen] = useState(false)
14
+ return (
15
+ <main>
16
+ <BorderedBox>This Is another Content</BorderedBox>
17
+ <ContentThatLoads />
18
+ <Button color='green' primary='true' onClick={() => setIsOpen(true)} label='Open Modal' />
19
+ {isOpen && <Modal setIsOpen={setIsOpen} title='Modal Title'>{args.text}</Modal>}
20
+ </main>
21
+ )
22
+ }
23
+
24
+ const ContentThatLoads = () => {
25
+ const [content, setContent] = useState(null)
26
+ setTimeout(() => {
27
+ setContent(<div className='mt-4'><BorderedBox>This is a Future Component</BorderedBox></div>)
28
+ }, 1000)
29
+
30
+ return content
31
+ }
32
+
33
+ export const Default = Template.bind({})
34
+ Default.args = {
35
+ title: 'List Title',
36
+ text: 'Hello World'
37
+ }
38
+
39
+ export const WithLongText = Template.bind({})
40
+
41
+ WithLongText.args = {
42
+ title: 'Modal',
43
+ text: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fermentum, lorem nec tincidunt pellentesque, odio orci posuere lacus, et hendrerit turpis dolor nec metus. Nunc quis finibus enim. Vestibulum a mollis velit. Ut nec vestibulum urna. Phasellus ut odio nec leo hendrerit laoreet eget at turpis. Nulla facilisi. Vivamus accumsan arcu malesuada, imperdiet ligula vitae, varius elit. Morbi blandit eros nec eros rutrum mattis. Nulla nibh nisi, pellentesque a ornare at, ultrices sit amet felis. Nulla bibendum metus diam, vitae gravida dui semper iaculis.
44
+
45
+ `.repeat(5)
46
+ }
47
+
48
+ const MenuTemplate = () => {
49
+ const [isOpen, setIsOpen] = useState(false)
50
+ const dropDownArgs = {
51
+ header: 'My Menu',
52
+ items: [
53
+ <span className='hover:cursor-pointer' key='2' onClick={() => setIsOpen(true)}>Show Modal</span>
54
+ ]
55
+ }
56
+ return (
57
+ <div>
58
+ <div className='text-white'><DropDown {...dropDownArgs} /></div>
59
+ <HorizontalSeparator />
60
+ {isOpen && <Modal setIsOpen={setIsOpen} title='Modal Title'>Hello world!</Modal>}
61
+ <ContentThatLoads />
62
+ </div>
63
+ )
64
+ }
65
+ export const WithDropDown = MenuTemplate.bind({})
@@ -1,27 +1,28 @@
1
- 'use strict'
2
- import SearchBar from '../components/SearchBar'
3
- export default {
4
- title: 'Platformatic/SearchBar',
5
- component: SearchBar,
6
- argTypes: {
7
- onChange: { control: 'function' },
8
- onSubmit: { control: 'function' }
9
- }
10
- }
11
- const Template = (args) => {
12
- return (
13
- <>
14
- <SearchBar {...args}>Hello Platformatic</SearchBar>
15
- </>
16
-
17
- )
18
- }
19
- export const Standard = Template.bind({})
20
- Standard.args = {
21
- onChange: (value) => {
22
- console.log('Current search: ' + value)
23
- },
24
- onSubmit: (value) => {
25
- alert('Query value: ' + value)
26
- }
27
- }
1
+ 'use strict'
2
+ import SearchBar from '../components/SearchBar'
3
+ export default {
4
+ title: 'Platformatic/SearchBar',
5
+ component: SearchBar,
6
+ argTypes: {
7
+ onChange: { control: 'function' },
8
+ onSubmit: { control: 'function' },
9
+ title: { control: 'text' }
10
+ }
11
+ }
12
+ const Template = (args) => {
13
+ return (
14
+ <>
15
+ <SearchBar {...args}>Hello Platformatic</SearchBar>
16
+ </>
17
+
18
+ )
19
+ }
20
+ export const Standard = Template.bind({})
21
+ Standard.args = {
22
+ onChange: (value) => {
23
+ console.log('Current search: ' + value)
24
+ },
25
+ onSubmit: (value) => {
26
+ alert('Query value: ' + value)
27
+ }
28
+ }
@@ -1,41 +1,41 @@
1
- 'use strict'
2
-
3
- import SimpleMetric from '../components/SimpleMetric'
4
-
5
- export default {
6
- title: 'Platformatic/SimpleMetric',
7
- component: SimpleMetric
8
- }
9
-
10
- const Template = (args) => <SimpleMetric {...args} />
11
-
12
- export const Green = Template.bind({})
13
-
14
- Green.args = {
15
- title: 'Requests',
16
- color: 'green',
17
- unit: 'ms',
18
- value: 120,
19
- tooltip: 'This is a tooltip for the metric'
20
- }
21
-
22
- export const Red = Template.bind({})
23
-
24
- Red.args = {
25
- title: 'Requests',
26
- color: 'red',
27
- unit: 'ms',
28
- value: 120,
29
- tooltip: 'This is a tooltip for the metric'
30
- }
31
-
32
- export const WithPrefix = Template.bind({})
33
-
34
- WithPrefix.args = {
35
- title: 'Requests',
36
- color: 'green',
37
- unit: 'ms',
38
- value: 120,
39
- pre: 'P90',
40
- tooltip: 'This is a tooltip for the metric'
41
- }
1
+ 'use strict'
2
+
3
+ import SimpleMetric from '../components/SimpleMetric'
4
+
5
+ export default {
6
+ title: 'Platformatic/SimpleMetric',
7
+ component: SimpleMetric
8
+ }
9
+
10
+ const Template = (args) => <SimpleMetric {...args} />
11
+
12
+ export const Green = Template.bind({})
13
+
14
+ Green.args = {
15
+ title: 'Requests',
16
+ color: 'green',
17
+ unit: 'ms',
18
+ value: 120,
19
+ tooltip: 'This is a tooltip for the metric'
20
+ }
21
+
22
+ export const Red = Template.bind({})
23
+
24
+ Red.args = {
25
+ title: 'Requests',
26
+ color: 'red',
27
+ unit: 'ms',
28
+ value: 120,
29
+ tooltip: 'This is a tooltip for the metric'
30
+ }
31
+
32
+ export const WithPrefix = Template.bind({})
33
+
34
+ WithPrefix.args = {
35
+ title: 'Requests',
36
+ color: 'green',
37
+ unit: 'ms',
38
+ value: 120,
39
+ pre: 'P90',
40
+ tooltip: 'This is a tooltip for the metric'
41
+ }
@@ -1,31 +1,31 @@
1
- 'use strict'
2
- import Status from '../components/Status'
3
-
4
- export default {
5
- title: 'Platformatic/Status',
6
- component: Status,
7
- argTypes: {}
8
- }
9
-
10
- const Template = (args) => <Status {...args} />
11
-
12
- export const White = Template.bind({})
13
-
14
- White.args = {
15
- color: 'white',
16
- status: 'available'
17
- }
18
-
19
- export const Green = Template.bind({})
20
-
21
- Green.args = {
22
- color: 'green',
23
- status: 'online'
24
- }
25
-
26
- export const Red = Template.bind({})
27
-
28
- Red.args = {
29
- color: 'red',
30
- status: 'offline'
31
- }
1
+ 'use strict'
2
+ import Status from '../components/Status'
3
+
4
+ export default {
5
+ title: 'Platformatic/Status',
6
+ component: Status,
7
+ argTypes: {}
8
+ }
9
+
10
+ const Template = (args) => <Status {...args} />
11
+
12
+ export const White = Template.bind({})
13
+
14
+ White.args = {
15
+ color: 'white',
16
+ status: 'available'
17
+ }
18
+
19
+ export const Green = Template.bind({})
20
+
21
+ Green.args = {
22
+ color: 'green',
23
+ status: 'online'
24
+ }
25
+
26
+ export const Red = Template.bind({})
27
+
28
+ Red.args = {
29
+ color: 'red',
30
+ status: 'offline'
31
+ }