@platformatic/ui-components 0.1.49 → 0.1.51

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 (177) hide show
  1. package/.github/workflows/ci.yml +26 -26
  2. package/.nvmrc +1 -1
  3. package/LICENSE +201 -201
  4. package/README.md +30 -30
  5. package/dist/api-icon-closed.svg +6 -0
  6. package/dist/api-icon.svg +9 -0
  7. package/dist/assets/Montserrat-Regular.dcfe8df2.ttf +0 -0
  8. package/dist/assets/index.691ca940.css +1 -0
  9. package/dist/assets/index.ff0dadfc.js +797 -0
  10. package/dist/index.html +14 -0
  11. package/dist/stats.html +6177 -0
  12. package/dist/vite.svg +1 -0
  13. package/fonts/Montserrat/README.txt +81 -81
  14. package/index.html +12 -12
  15. package/index.js +71 -71
  16. package/package.json +76 -76
  17. package/postcss.config.cjs +8 -8
  18. package/public/api-icon-closed.svg +6 -6
  19. package/public/api-icon.svg +9 -9
  20. package/src/App.jsx +12 -12
  21. package/src/components/BorderedBox.jsx +18 -18
  22. package/src/components/BorderedBox.module.css +8 -8
  23. package/src/components/BorderedText.jsx +8 -8
  24. package/src/components/BorderedText.module.css +2 -2
  25. package/src/components/Box.jsx +14 -14
  26. package/src/components/Box.module.css +7 -7
  27. package/src/components/Button.jsx +95 -95
  28. package/src/components/Button.module.css +127 -127
  29. package/src/components/ButtonFullRounded.jsx +17 -17
  30. package/src/components/ButtonFullRounded.module.css +28 -28
  31. package/src/components/Checkbox.jsx +11 -11
  32. package/src/components/Checkbox.module.css +18 -18
  33. package/src/components/Common.module.css +28 -28
  34. package/src/components/DetailedMetric.jsx +32 -32
  35. package/src/components/DetailedMetric.module.css +2 -2
  36. package/src/components/DropDown.jsx +35 -36
  37. package/src/components/DropDown.module.css +25 -27
  38. package/src/components/FollowUs.jsx +35 -35
  39. package/src/components/FollowUs.module.css +11 -11
  40. package/src/components/GHLoginButton.jsx +14 -14
  41. package/src/components/HorizontalSeparator.jsx +15 -15
  42. package/src/components/HorizontalSeparator.module.css +26 -26
  43. package/src/components/InfoBox.jsx +50 -50
  44. package/src/components/InfoBox.module.css +5 -5
  45. package/src/components/List.jsx +20 -20
  46. package/src/components/List.module.css +11 -11
  47. package/src/components/ListElement.jsx +23 -23
  48. package/src/components/ListElement.module.css +23 -23
  49. package/src/components/Loadable.jsx +34 -34
  50. package/src/components/Loadable.module.css +13 -13
  51. package/src/components/Loader.jsx +22 -22
  52. package/src/components/Loader.module.css +13 -13
  53. package/src/components/LoginButton.jsx +17 -17
  54. package/src/components/LoginButton.module.css +7 -7
  55. package/src/components/LoginButton.test.jsx +25 -25
  56. package/src/components/Logo.jsx +62 -62
  57. package/src/components/Logo.module.css +5 -5
  58. package/src/components/Main.jsx +33 -33
  59. package/src/components/MetricValue.jsx +15 -15
  60. package/src/components/MetricValue.module.css +9 -9
  61. package/src/components/Modal.jsx +93 -93
  62. package/src/components/Modal.module.css +50 -50
  63. package/src/components/PlatformaticIcon.jsx +57 -57
  64. package/src/components/PlatformaticIcon.module.css +2 -2
  65. package/src/components/Playground.jsx +9 -9
  66. package/src/components/SearchBar.jsx +63 -63
  67. package/src/components/SearchBar.module.css +20 -20
  68. package/src/components/Sidebar.jsx +151 -153
  69. package/src/components/Sidebar.module.css +70 -66
  70. package/src/components/SimpleMetric.jsx +28 -28
  71. package/src/components/SimpleMetric.module.css +6 -6
  72. package/src/components/Status.jsx +26 -26
  73. package/src/components/TabbedWindow.jsx +39 -39
  74. package/src/components/TabbedWindow.module.css +16 -16
  75. package/src/components/TextWithLabel.jsx +11 -11
  76. package/src/components/TextWithLabel.module.css +8 -8
  77. package/src/components/Versions.jsx +9 -9
  78. package/src/components/VerticalSeparator.jsx +5 -5
  79. package/src/components/forms/Field.jsx +53 -20
  80. package/src/components/forms/Field.module.css +23 -17
  81. package/src/components/forms/Input.jsx +80 -80
  82. package/src/components/forms/Input.module.css +28 -28
  83. package/src/components/forms/Preview.jsx +75 -77
  84. package/src/components/forms/Preview.module.css +14 -14
  85. package/src/components/forms/ToggleSwitch.jsx +18 -18
  86. package/src/components/forms/ToggleSwitch.module.css +42 -42
  87. package/src/components/forms/index.js +8 -8
  88. package/src/components/icons/AddIcon.jsx +78 -0
  89. package/src/components/icons/AlertIcon.jsx +81 -0
  90. package/src/components/icons/AllInOneIcon.jsx +111 -0
  91. package/src/components/icons/ApiCloudIcon.jsx +93 -0
  92. package/src/components/icons/ApiEmptyIcon.jsx +107 -107
  93. package/src/components/icons/ApiIcon.jsx +84 -29
  94. package/src/components/icons/ApiIconClosed.jsx +19 -19
  95. package/src/components/icons/AppEmptyIcon.jsx +94 -94
  96. package/src/components/icons/AppIcon.jsx +85 -38
  97. package/src/components/icons/AppListIcon.jsx +73 -73
  98. package/src/components/icons/ArrowDownFullIcon.jsx +76 -0
  99. package/src/components/icons/ArrowDownIcon.jsx +75 -0
  100. package/src/components/icons/ArrowLeftIcon.jsx +75 -0
  101. package/src/components/icons/ArrowRightIcon.jsx +75 -0
  102. package/src/components/icons/ArrowUpIcon.jsx +75 -0
  103. package/src/components/icons/Calendar1DayIcon.jsx +90 -0
  104. package/src/components/icons/Calendar7DaysIcon.jsx +88 -0
  105. package/src/components/icons/CalendarIcon.jsx +102 -56
  106. package/src/components/icons/CircleAddIcon.jsx +81 -40
  107. package/src/components/icons/CircleBackIcon.jsx +51 -51
  108. package/src/components/icons/{Calendar1Icon.jsx → CircleCheckMarkIcon.jsx} +66 -54
  109. package/src/components/icons/CircleCloseHoverIcon.jsx +42 -42
  110. package/src/components/icons/CircleCloseIcon.jsx +32 -32
  111. package/src/components/icons/CircleExclamationIcon.jsx +29 -29
  112. package/src/components/icons/CloseIcon.jsx +79 -31
  113. package/src/components/icons/CopyPasteIcon.jsx +81 -0
  114. package/src/components/icons/DatabaseIcon.jsx +81 -0
  115. package/src/components/icons/EditIcon.jsx +81 -38
  116. package/src/components/icons/GearIcon.jsx +78 -40
  117. package/src/components/icons/Icons.module.css +46 -29
  118. package/src/components/icons/LiveIcon.jsx +43 -43
  119. package/src/components/icons/MetricsIcon.jsx +52 -52
  120. package/src/components/icons/PlayIcon.jsx +20 -20
  121. package/src/components/icons/PullRequestIcon.jsx +35 -35
  122. package/src/components/icons/StopIcon.jsx +21 -21
  123. package/src/components/icons/TerminalIcon.jsx +22 -22
  124. package/src/components/icons/UpgradeIcon.jsx +48 -48
  125. package/src/components/icons/Users2Icon.jsx +84 -0
  126. package/src/components/icons/WorkspaceDynamicIcon.jsx +87 -0
  127. package/src/components/icons/WorkspaceReadyIcon.jsx +144 -0
  128. package/src/components/icons/WorkspaceStaticIcon.jsx +84 -0
  129. package/src/components/icons/index.js +83 -61
  130. package/src/components/layouts/Layout.jsx +11 -11
  131. package/src/components/layouts/TwoColumnsLayout.jsx +12 -12
  132. package/src/components/layouts/TwoColumnsLayout.module.css +9 -9
  133. package/src/hooks/useEscapeKey.js +20 -20
  134. package/src/lib/utils.js +23 -23
  135. package/src/main.jsx +9 -9
  136. package/src/stories/BorderedBox.stories.jsx +33 -33
  137. package/src/stories/BorderedText.stories.jsx +24 -24
  138. package/src/stories/Button.stories.jsx +114 -114
  139. package/src/stories/ButtonFullRounded.stories.jsx +61 -61
  140. package/src/stories/Checkbox.stories.jsx +27 -27
  141. package/src/stories/DetailedMetric.stories.jsx +33 -33
  142. package/src/stories/DropDown.stories.jsx +62 -62
  143. package/src/stories/FollowUs.stories.jsx +14 -14
  144. package/src/stories/GHLoginButton.stories.jsx +14 -14
  145. package/src/stories/HorizontalSeparator.stories.jsx +12 -12
  146. package/src/stories/InfoBox.stories.jsx +46 -46
  147. package/src/stories/Introduction.stories.mdx +211 -211
  148. package/src/stories/List.stories.jsx +29 -29
  149. package/src/stories/ListElement.stories.jsx +15 -15
  150. package/src/stories/Loadable.stories.jsx +75 -75
  151. package/src/stories/Loader.stories.jsx +44 -44
  152. package/src/stories/LoginButton.stories.jsx +15 -15
  153. package/src/stories/Logo.stories.jsx +17 -17
  154. package/src/stories/Modal.stories.jsx +100 -100
  155. package/src/stories/PlatformaticIcon.stories.jsx +57 -35
  156. package/src/stories/SearchBar.stories.jsx +28 -28
  157. package/src/stories/Sidebar.stories.jsx +61 -61
  158. package/src/stories/SimpleMetric.stories.jsx +41 -41
  159. package/src/stories/Status.stories.jsx +31 -31
  160. package/src/stories/TextWithLabel.stories.jsx +25 -25
  161. package/src/stories/TwoColumnsLayout.stories.jsx +42 -42
  162. package/src/stories/forms/Field.stories.jsx +89 -81
  163. package/src/stories/forms/Input.stories.jsx +89 -89
  164. package/src/stories/forms/Preview.stories.jsx +57 -57
  165. package/src/stories/forms/ToggleSwitch.stories.jsx +15 -15
  166. package/src/stories/icons/Icons.stories.jsx +68 -74
  167. package/src/styles/main.css +22 -15
  168. package/tailwind.config.cjs +60 -60
  169. package/vite.config.js +6 -6
  170. package/vitest.config.js +14 -14
  171. package/dist/main.css +0 -704
  172. package/src/components/icons/Calendar7Icon.jsx +0 -55
  173. package/src/components/icons/CopyIcon.jsx +0 -75
  174. package/src/components/icons/CreatedWorkspaceIcon.jsx +0 -70
  175. package/src/components/icons/DynamicWorkspaceIcon.jsx +0 -125
  176. package/src/components/icons/StaticWorkspaceIcon.jsx +0 -119
  177. package/src/components/icons/TriangleExclamationIcon.jsx +0 -26
@@ -1,44 +1,44 @@
1
- import React, { useState } from 'react'
2
- import Loader from '../components/Loader'
3
- import Button from '../components/Button'
4
- import BorderedBox from '../components/BorderedBox'
5
-
6
- 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.'
7
-
8
- export default {
9
- title: 'Platformatic/Loader',
10
- component: Loader
11
- }
12
-
13
- export const Loading = args =>
14
- <Loader {...args}>
15
- <BorderedBox>{loremIpsum}</BorderedBox>
16
- </Loader>
17
-
18
- Loading.args = {
19
- loading: true
20
- }
21
-
22
- export const LoadsAndStops = ({ loading, ...args }) => {
23
- const [showLoader, setShowLoader] = useState(args.loading)
24
- const show = () => setShowLoader(true)
25
- const hide = () => setShowLoader(false)
26
-
27
- function load () {
28
- show()
29
- const timer = setTimeout(() => {
30
- hide()
31
- }, 2000)
32
- return () => clearTimeout(timer)
33
- }
34
-
35
- return (
36
- <Loader loading={showLoader} {...args}>
37
- <Button label='Start Loading' color='error-red' onClick={() => load()} />
38
- <BorderedBox>{loremIpsum}</BorderedBox>
39
- </Loader>
40
- )
41
- }
42
- LoadsAndStops.args = {
43
- loading: false
44
- }
1
+ import React, { useState } from 'react'
2
+ import Loader from '../components/Loader'
3
+ import Button from '../components/Button'
4
+ import BorderedBox from '../components/BorderedBox'
5
+
6
+ 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.'
7
+
8
+ export default {
9
+ title: 'Platformatic/Loader',
10
+ component: Loader
11
+ }
12
+
13
+ export const Loading = args =>
14
+ <Loader {...args}>
15
+ <BorderedBox>{loremIpsum}</BorderedBox>
16
+ </Loader>
17
+
18
+ Loading.args = {
19
+ loading: true
20
+ }
21
+
22
+ export const LoadsAndStops = ({ loading, ...args }) => {
23
+ const [showLoader, setShowLoader] = useState(args.loading)
24
+ const show = () => setShowLoader(true)
25
+ const hide = () => setShowLoader(false)
26
+
27
+ function load () {
28
+ show()
29
+ const timer = setTimeout(() => {
30
+ hide()
31
+ }, 2000)
32
+ return () => clearTimeout(timer)
33
+ }
34
+
35
+ return (
36
+ <Loader loading={showLoader} {...args}>
37
+ <Button label='Start Loading' color='error-red' onClick={() => load()} />
38
+ <BorderedBox>{loremIpsum}</BorderedBox>
39
+ </Loader>
40
+ )
41
+ }
42
+ LoadsAndStops.args = {
43
+ loading: false
44
+ }
@@ -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,100 +1,100 @@
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
- argTypes: {
11
- layout: {
12
- type: 'string',
13
- control: {
14
- type: 'radio',
15
- options: ['info', 'invite', 'fullscreen']
16
- }
17
- }
18
- }
19
- }
20
-
21
- const Template = (args) => {
22
- const [isOpen, setIsOpen] = useState(false)
23
- const { text, ...rest } = args
24
- return (
25
- <main>
26
- <BorderedBox>This Is another Content</BorderedBox>
27
- <ContentThatLoads />
28
- <Button color='green' buttonClass='primary' onClick={() => setIsOpen(true)} label='Open Modal' />
29
- {isOpen && <Modal setIsOpen={setIsOpen} {...rest}>{text}</Modal>}
30
- </main>
31
- )
32
- }
33
-
34
- const TemplateInvite = (args) => {
35
- const [isOpen, setIsOpen] = useState(false)
36
- return (
37
- <main>
38
- <BorderedBox>This Is another Content</BorderedBox>
39
- <ContentThatLoads />
40
- <Button color='green' buttonClass='primary' onClick={() => setIsOpen(true)} label='Open Modal' />
41
- {isOpen && <Modal setIsOpen={setIsOpen} {...args}><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed</p><Button buttonClass='primary' onClick={() => setIsOpen(false)} label='Discard invite' /></Modal>}
42
- </main>
43
- )
44
- }
45
-
46
- const ContentThatLoads = () => {
47
- const [content, setContent] = useState(null)
48
- setTimeout(() => {
49
- setContent(<div className='mt-4'><BorderedBox>This is a Future Component</BorderedBox></div>)
50
- }, 1000)
51
-
52
- return content
53
- }
54
-
55
- export const Default = Template.bind({})
56
- Default.args = {
57
- title: 'List Title',
58
- text: 'Hello World',
59
- layout: 'info'
60
- }
61
-
62
- export const WithLongText = Template.bind({})
63
-
64
- WithLongText.args = {
65
- title: 'Modal',
66
- 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.
67
-
68
- `.repeat(5)
69
- }
70
-
71
- const MenuTemplate = () => {
72
- const [isOpen, setIsOpen] = useState(false)
73
- const dropDownArgs = {
74
- header: 'My Menu',
75
- items: [
76
- <span className='hover:cursor-pointer' key='2' onClick={() => setIsOpen(true)}>Show Modal</span>
77
- ]
78
- }
79
- return (
80
- <div>
81
- <div className='text-white'><DropDown {...dropDownArgs} /></div>
82
- <HorizontalSeparator />
83
- {isOpen && <Modal setIsOpen={setIsOpen} title='Modal Title'>Hello world!</Modal>}
84
- <ContentThatLoads />
85
- </div>
86
- )
87
- }
88
- export const WithDropDown = MenuTemplate.bind({})
89
-
90
- export const InviteLayout = TemplateInvite.bind({})
91
- InviteLayout.args = {
92
- title: 'Give me an invite',
93
- layout: 'invite'
94
- }
95
-
96
- export const FullscreenLayout = Template.bind({})
97
- FullscreenLayout.args = {
98
- title: 'Give me an invite',
99
- layout: 'fullscreen'
100
- }
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
+ argTypes: {
11
+ layout: {
12
+ type: 'string',
13
+ control: {
14
+ type: 'radio',
15
+ options: ['info', 'invite', 'fullscreen']
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ const Template = (args) => {
22
+ const [isOpen, setIsOpen] = useState(false)
23
+ const { text, ...rest } = args
24
+ return (
25
+ <main>
26
+ <BorderedBox>This Is another Content</BorderedBox>
27
+ <ContentThatLoads />
28
+ <Button color='green' buttonClass='primary' onClick={() => setIsOpen(true)} label='Open Modal' />
29
+ {isOpen && <Modal setIsOpen={setIsOpen} {...rest}>{text}</Modal>}
30
+ </main>
31
+ )
32
+ }
33
+
34
+ const TemplateInvite = (args) => {
35
+ const [isOpen, setIsOpen] = useState(false)
36
+ return (
37
+ <main>
38
+ <BorderedBox>This Is another Content</BorderedBox>
39
+ <ContentThatLoads />
40
+ <Button color='green' buttonClass='primary' onClick={() => setIsOpen(true)} label='Open Modal' />
41
+ {isOpen && <Modal setIsOpen={setIsOpen} {...args}><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed</p><Button buttonClass='primary' onClick={() => setIsOpen(false)} label='Discard invite' /></Modal>}
42
+ </main>
43
+ )
44
+ }
45
+
46
+ const ContentThatLoads = () => {
47
+ const [content, setContent] = useState(null)
48
+ setTimeout(() => {
49
+ setContent(<div className='mt-4'><BorderedBox>This is a Future Component</BorderedBox></div>)
50
+ }, 1000)
51
+
52
+ return content
53
+ }
54
+
55
+ export const Default = Template.bind({})
56
+ Default.args = {
57
+ title: 'List Title',
58
+ text: 'Hello World',
59
+ layout: 'info'
60
+ }
61
+
62
+ export const WithLongText = Template.bind({})
63
+
64
+ WithLongText.args = {
65
+ title: 'Modal',
66
+ 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.
67
+
68
+ `.repeat(5)
69
+ }
70
+
71
+ const MenuTemplate = () => {
72
+ const [isOpen, setIsOpen] = useState(false)
73
+ const dropDownArgs = {
74
+ header: 'My Menu',
75
+ items: [
76
+ <span className='hover:cursor-pointer' key='2' onClick={() => setIsOpen(true)}>Show Modal</span>
77
+ ]
78
+ }
79
+ return (
80
+ <div>
81
+ <div className='text-white'><DropDown {...dropDownArgs} /></div>
82
+ <HorizontalSeparator />
83
+ {isOpen && <Modal setIsOpen={setIsOpen} title='Modal Title'>Hello world!</Modal>}
84
+ <ContentThatLoads />
85
+ </div>
86
+ )
87
+ }
88
+ export const WithDropDown = MenuTemplate.bind({})
89
+
90
+ export const InviteLayout = TemplateInvite.bind({})
91
+ InviteLayout.args = {
92
+ title: 'Give me an invite',
93
+ layout: 'invite'
94
+ }
95
+
96
+ export const FullscreenLayout = Template.bind({})
97
+ FullscreenLayout.args = {
98
+ title: 'Give me an invite',
99
+ layout: 'fullscreen'
100
+ }
@@ -1,35 +1,57 @@
1
- import React from 'react'
2
- import PlatformaticIcon from '../components/PlatformaticIcon'
3
- import Icons from '../components/icons'
4
-
5
- const divStyle = {
6
- width: '100%',
7
- display: 'flex',
8
- flexGap: '10px'
9
- }
10
-
11
- export default {
12
- title: 'Platformatic/PlatformaticIcon',
13
- component: PlatformaticIcon
14
- }
15
-
16
- const Template = (args) => <PlatformaticIcon {...args} />
17
- export const PlatformaticIconDefault = Template.bind({})
18
- PlatformaticIconDefault.args = {
19
- iconName: 'CopyIcon',
20
- onClick: () => alert('clicked')
21
- }
22
-
23
- const AllIconsTemplate = (args) => {
24
- const icons = Object.values(Icons)
25
- return (
26
- <div style={divStyle}>
27
- {icons.map(IconComponent => <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} {...args} />)}
28
- </div>
29
- )
30
- }
31
- export const PlatformaticIconAll = AllIconsTemplate.bind({})
32
- PlatformaticIconAll.args = {
33
- color: 'white',
34
- size: 'small'
35
- }
1
+ import React from 'react'
2
+ import PlatformaticIcon from '../components/PlatformaticIcon'
3
+ import Icons from '../components/icons'
4
+
5
+ const divStyle = {
6
+ width: '100%',
7
+ display: 'flex',
8
+ flexGap: '10px'
9
+ }
10
+
11
+ export default {
12
+ title: 'Platformatic/PlatformaticIcon',
13
+ component: PlatformaticIcon
14
+ }
15
+
16
+ const Template = (args) => <PlatformaticIcon {...args} />
17
+ export const PlatformaticIconDefault = Template.bind({})
18
+ PlatformaticIconDefault.args = {
19
+ iconName: 'CopyPasteIcon',
20
+ onClick: () => alert('clicked')
21
+ }
22
+
23
+ const AllIconsTemplate = (args) => {
24
+ const icons = Object.values(Icons)
25
+ return (
26
+ <>
27
+ <p className='text-white'> Platformatic all icons size {args.size}</p>
28
+ <div style={divStyle}>
29
+ {icons.map(IconComponent => <PlatformaticIcon key={IconComponent.name} iconName={IconComponent.name} {...args} />)}
30
+ </div>
31
+ </>
32
+ )
33
+ }
34
+ export const PlatformaticIconSmall = AllIconsTemplate.bind({})
35
+ PlatformaticIconSmall.args = {
36
+ color: 'white',
37
+ size: 'small',
38
+ onClick: null
39
+ }
40
+
41
+ export const PlatformaticIconNormal = AllIconsTemplate.bind({})
42
+ PlatformaticIconNormal.args = {
43
+ color: 'white',
44
+ size: 'normal'
45
+ }
46
+
47
+ export const PlatformaticIconLarge = AllIconsTemplate.bind({})
48
+ PlatformaticIconLarge.args = {
49
+ color: 'green',
50
+ size: 'large'
51
+ }
52
+
53
+ export const PlatformaticIconExtraLarge = AllIconsTemplate.bind({})
54
+ PlatformaticIconExtraLarge.args = {
55
+ color: 'green',
56
+ size: 'extra-large'
57
+ }
@@ -1,28 +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
- 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
+ '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,61 +1,61 @@
1
- 'use strict'
2
- import { useState } from 'react'
3
- import Sidebar from '../components/Sidebar'
4
- import BorderedBox from '../components/BorderedBox'
5
-
6
- const divStyle = {
7
- display: 'flex',
8
- width: '100%',
9
- minHeight: '400px',
10
- gap: '10px'
11
- }
12
-
13
- export default {
14
- title: 'Platformatic/Sidebar',
15
- component: Sidebar,
16
- decorators: [
17
- (Story) => (
18
- <div style={divStyle}>
19
- <Story />
20
- <BorderedBox>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</BorderedBox>
21
- </div>
22
- )
23
- ]
24
- }
25
-
26
- const Template = (args) => <Sidebar {...args} />
27
-
28
- export const EmptySidebar = Template.bind({})
29
-
30
- EmptySidebar.args = {
31
- title: 'Sidebar bar empty',
32
- addTitle: 'Create',
33
- onClickAdd: () => alert('clicked on add EmptySidebar'),
34
- onClickSettings: () => alert('settings')
35
- }
36
-
37
- const FullSidebarTemplate = (args) => {
38
- const [items, setItems] = useState([
39
- { iconName: 'StaticWorkspaceIcon', subTitle: 'Subtitle', title: 'a very very very very very long title 1' },
40
- { title: 'Title number 2', subTitle: 'Subtitle 2' },
41
- { title: 'Another Title', subTitle: 'Subtitle 3', iconName: 'DynamicWorkspaceIcon' }
42
- ])
43
- function onClickAdd () {
44
- const tmpItem = items.map(item => item)
45
- tmpItem.push('Title number ' + (items.length + 1))
46
- setItems(tmpItem)
47
- }
48
-
49
- return (
50
- <Sidebar items={items} onClickAdd={() => onClickAdd()} {...args} />
51
- )
52
- }
53
-
54
- export const FullSidebar = FullSidebarTemplate.bind({})
55
-
56
- FullSidebar.args = {
57
- title: 'Sidebar bar Full',
58
- addTitle: 'Create',
59
- onClickItemSelected: (index) => alert('selected: ' + index),
60
- onClickSettings: () => alert('settings')
61
- }
1
+ 'use strict'
2
+ import { useState } from 'react'
3
+ import Sidebar from '../components/Sidebar'
4
+ import BorderedBox from '../components/BorderedBox'
5
+
6
+ const divStyle = {
7
+ display: 'flex',
8
+ width: '100%',
9
+ minHeight: '400px',
10
+ gap: '10px'
11
+ }
12
+
13
+ export default {
14
+ title: 'Platformatic/Sidebar',
15
+ component: Sidebar,
16
+ decorators: [
17
+ (Story) => (
18
+ <div style={divStyle}>
19
+ <Story />
20
+ <BorderedBox>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</BorderedBox>
21
+ </div>
22
+ )
23
+ ]
24
+ }
25
+
26
+ const Template = (args) => <Sidebar {...args} />
27
+
28
+ export const EmptySidebar = Template.bind({})
29
+
30
+ EmptySidebar.args = {
31
+ title: 'Sidebar bar empty',
32
+ addTitle: 'Create',
33
+ onClickAdd: () => alert('clicked on add EmptySidebar'),
34
+ onClickSettings: () => alert('settings')
35
+ }
36
+
37
+ const FullSidebarTemplate = (args) => {
38
+ const [items, setItems] = useState([
39
+ { iconName: 'WorkspaceStaticIcon', subTitle: 'Subtitle', title: 'a very very very very very long title 1' },
40
+ { title: 'Title number 2', subTitle: 'Subtitle 2' },
41
+ { title: 'Another Title', subTitle: 'Subtitle 3', iconName: 'WorkspaceDynamicIcon' }
42
+ ])
43
+ function onClickAdd () {
44
+ const tmpItem = items.map(item => item)
45
+ tmpItem.push('Title number ' + (items.length + 1))
46
+ setItems(tmpItem)
47
+ }
48
+
49
+ return (
50
+ <Sidebar items={items} onClickAdd={() => onClickAdd()} {...args} />
51
+ )
52
+ }
53
+
54
+ export const FullSidebar = FullSidebarTemplate.bind({})
55
+
56
+ FullSidebar.args = {
57
+ title: 'Sidebar bar Full',
58
+ addTitle: 'Create',
59
+ onClickItemSelected: (index) => alert('selected: ' + index),
60
+ onClickSettings: () => alert('settings')
61
+ }