@platformatic/ui-components 0.1.57 → 0.1.59

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 (104) hide show
  1. package/dist/assets/index.0de95a32.css +1 -0
  2. package/dist/assets/index.d6543e3d.js +40 -0
  3. package/dist/index.html +2 -2
  4. package/dist/main.css +10 -20
  5. package/package.json +1 -1
  6. package/src/components/BorderedBox.jsx +34 -6
  7. package/src/components/BorderedBox.module.css +0 -6
  8. package/src/components/Button.jsx +6 -6
  9. package/src/components/Button.module.css +0 -30
  10. package/src/components/ButtonFullRounded.jsx +53 -8
  11. package/src/components/ButtonFullRounded.module.css +1 -23
  12. package/src/components/Common.module.css +56 -0
  13. package/src/components/FollowUs.jsx +5 -6
  14. package/src/components/GHLoginButton.jsx +1 -2
  15. package/src/components/InfoBox.jsx +4 -3
  16. package/src/components/ListElement.jsx +1 -1
  17. package/src/components/LoginButton.jsx +3 -12
  18. package/src/components/LoginButton.test.jsx +4 -5
  19. package/src/components/Modal.jsx +1 -1
  20. package/src/components/PlatformaticIcon.jsx +4 -3
  21. package/src/components/SearchBar.jsx +2 -7
  22. package/src/components/Sidebar.jsx +18 -12
  23. package/src/components/SimpleMetric.jsx +0 -2
  24. package/src/components/Status.jsx +26 -19
  25. package/src/components/constants.js +4 -0
  26. package/src/components/forms/Input.jsx +1 -0
  27. package/src/components/icons/AddIcon.jsx +3 -2
  28. package/src/components/icons/AlertIcon.jsx +4 -3
  29. package/src/components/icons/AllInOneIcon.jsx +3 -2
  30. package/src/components/icons/ApiCloudIcon.jsx +3 -2
  31. package/src/components/icons/ApiEmptyIcon.jsx +3 -2
  32. package/src/components/icons/ApiIcon.jsx +3 -2
  33. package/src/components/icons/ApiIconClosed.jsx +3 -2
  34. package/src/components/icons/AppEmptyIcon.jsx +3 -2
  35. package/src/components/icons/AppIcon.jsx +3 -2
  36. package/src/components/icons/AppListIcon.jsx +3 -2
  37. package/src/components/icons/ArrowDownFullIcon.jsx +3 -2
  38. package/src/components/icons/ArrowDownIcon.jsx +3 -2
  39. package/src/components/icons/ArrowLeftIcon.jsx +3 -2
  40. package/src/components/icons/ArrowRightIcon.jsx +3 -2
  41. package/src/components/icons/ArrowUpIcon.jsx +3 -2
  42. package/src/components/icons/BellIcon.jsx +3 -2
  43. package/src/components/icons/BillingIcon.jsx +3 -2
  44. package/src/components/icons/Calendar1DayIcon.jsx +3 -2
  45. package/src/components/icons/Calendar7DaysIcon.jsx +3 -2
  46. package/src/components/icons/CalendarIcon.jsx +3 -2
  47. package/src/components/icons/CircleAddIcon.jsx +3 -2
  48. package/src/components/icons/CircleArrowLeftIcon.jsx +3 -2
  49. package/src/components/icons/CircleArrowRightIcon.jsx +3 -2
  50. package/src/components/icons/CircleCheckMarkIcon.jsx +3 -2
  51. package/src/components/icons/CircleCloseHoverIcon.jsx +3 -2
  52. package/src/components/icons/CircleCloseIcon.jsx +3 -2
  53. package/src/components/icons/CircleExclamationIcon.jsx +3 -2
  54. package/src/components/icons/CircleFullIcon.jsx +77 -0
  55. package/src/components/icons/CircleTwoArrowsDownIcon.jsx +3 -2
  56. package/src/components/icons/CircleTwoArrowsUpIcon.jsx +3 -2
  57. package/src/components/icons/CloseIcon.jsx +3 -2
  58. package/src/components/icons/CopyPasteIcon.jsx +3 -2
  59. package/src/components/icons/DatabaseIcon.jsx +3 -2
  60. package/src/components/icons/EditIcon.jsx +3 -2
  61. package/src/components/icons/EnlargeIcon.jsx +3 -2
  62. package/src/components/icons/EntryIcon.jsx +3 -2
  63. package/src/components/icons/ExploreDocIcon.jsx +3 -2
  64. package/src/components/icons/GearIcon.jsx +3 -2
  65. package/src/components/icons/GraphQLIcon.jsx +3 -2
  66. package/src/components/icons/Icons.module.css +24 -12
  67. package/src/components/icons/KeyIcon.jsx +3 -2
  68. package/src/components/icons/LayersIcon.jsx +3 -2
  69. package/src/components/icons/LensIcon.jsx +3 -2
  70. package/src/components/icons/LiveIcon.jsx +3 -2
  71. package/src/components/icons/LogOutIcon.jsx +3 -2
  72. package/src/components/icons/MetricsIcon.jsx +3 -2
  73. package/src/components/icons/PlayIcon.jsx +3 -2
  74. package/src/components/icons/PullRequestIcon.jsx +3 -2
  75. package/src/components/icons/SendIcon.jsx +3 -2
  76. package/src/components/icons/SocialDiscordIcon.jsx +3 -2
  77. package/src/components/icons/SocialGitHubIcon.jsx +3 -2
  78. package/src/components/icons/SocialGitLabIcon.jsx +3 -2
  79. package/src/components/icons/SocialLinkedInIcon.jsx +3 -2
  80. package/src/components/icons/SocialNPMIcon.jsx +3 -2
  81. package/src/components/icons/SocialTwitterIcon.jsx +3 -2
  82. package/src/components/icons/StopIcon.jsx +3 -2
  83. package/src/components/icons/TerminalIcon.jsx +3 -2
  84. package/src/components/icons/TwoUsersIcon.jsx +3 -2
  85. package/src/components/icons/UpgradeIcon.jsx +3 -2
  86. package/src/components/icons/WorkspaceDynamicIcon.jsx +3 -2
  87. package/src/components/icons/WorkspaceFailIcon.jsx +3 -2
  88. package/src/components/icons/WorkspaceReadyIcon.jsx +3 -2
  89. package/src/components/icons/WorkspaceStaticIcon.jsx +3 -2
  90. package/src/components/icons/index.js +2 -0
  91. package/src/stories/BorderedBox.stories.jsx +5 -5
  92. package/src/stories/Button.stories.jsx +4 -5
  93. package/src/stories/ButtonFullRounded.stories.jsx +11 -11
  94. package/src/stories/InfoBox.stories.jsx +1 -2
  95. package/src/stories/Modal.stories.jsx +2 -2
  96. package/src/stories/PlatformaticIcon.stories.jsx +2 -3
  97. package/src/stories/Sidebar.stories.jsx +18 -3
  98. package/src/stories/Status.stories.jsx +2 -2
  99. package/src/stories/forms/Input.stories.jsx +1 -1
  100. package/src/stories/forms/Preview.stories.jsx +1 -1
  101. package/src/stories/icons/Icons.stories.jsx +5 -4
  102. package/tailwind.config.cjs +11 -11
  103. package/dist/assets/index.691ca940.css +0 -1
  104. package/dist/assets/index.ff0dadfc.js +0 -797
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const PullRequestIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -77,11 +78,11 @@ PullRequestIcon.propTypes = {
77
78
  /**
78
79
  * color of text, icon and borders
79
80
  */
80
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
81
+ color: PropTypes.oneOf(COLORS_ICON),
81
82
  /**
82
83
  * Size
83
84
  */
84
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
85
+ size: PropTypes.oneOf(SIZES)
85
86
  }
86
87
 
87
88
  PullRequestIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const SendIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -60,11 +61,11 @@ SendIcon.propTypes = {
60
61
  /**
61
62
  * color of text, icon and borders
62
63
  */
63
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
64
+ color: PropTypes.oneOf(COLORS_ICON),
64
65
  /**
65
66
  * Size
66
67
  */
67
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
68
+ size: PropTypes.oneOf(SIZES)
68
69
  }
69
70
 
70
71
  SendIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const SocialDiscordIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -64,11 +65,11 @@ SocialDiscordIcon.propTypes = {
64
65
  /**
65
66
  * color of text, icon and borders
66
67
  */
67
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
68
+ color: PropTypes.oneOf(COLORS_ICON),
68
69
  /**
69
70
  * Size
70
71
  */
71
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
72
+ size: PropTypes.oneOf(SIZES)
72
73
  }
73
74
 
74
75
  SocialDiscordIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const SocialGitHubIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -83,11 +84,11 @@ SocialGitHubIcon.propTypes = {
83
84
  /**
84
85
  * color of text, icon and borders
85
86
  */
86
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
87
+ color: PropTypes.oneOf(COLORS_ICON),
87
88
  /**
88
89
  * Size
89
90
  */
90
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
91
+ size: PropTypes.oneOf(SIZES)
91
92
  }
92
93
 
93
94
  SocialGitHubIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const SocialGitLabIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -107,11 +108,11 @@ SocialGitLabIcon.propTypes = {
107
108
  /**
108
109
  * color of text, icon and borders
109
110
  */
110
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
111
+ color: PropTypes.oneOf(COLORS_ICON),
111
112
  /**
112
113
  * Size
113
114
  */
114
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
115
+ size: PropTypes.oneOf(SIZES)
115
116
  }
116
117
 
117
118
  SocialGitLabIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const SocialLinkedInIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -70,11 +71,11 @@ SocialLinkedInIcon.propTypes = {
70
71
  /**
71
72
  * color of text, icon and borders
72
73
  */
73
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
74
+ color: PropTypes.oneOf(COLORS_ICON),
74
75
  /**
75
76
  * Size
76
77
  */
77
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
78
+ size: PropTypes.oneOf(SIZES)
78
79
  }
79
80
 
80
81
  SocialLinkedInIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const SocialNPMIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -62,11 +63,11 @@ SocialNPMIcon.propTypes = {
62
63
  /**
63
64
  * color of text, icon and borders
64
65
  */
65
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
66
+ color: PropTypes.oneOf(COLORS_ICON),
66
67
  /**
67
68
  * Size
68
69
  */
69
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
70
+ size: PropTypes.oneOf(SIZES)
70
71
  }
71
72
 
72
73
  SocialNPMIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const SocialTwitterIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -62,11 +63,11 @@ SocialTwitterIcon.propTypes = {
62
63
  /**
63
64
  * color of text, icon and borders
64
65
  */
65
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
66
+ color: PropTypes.oneOf(COLORS_ICON),
66
67
  /**
67
68
  * Size
68
69
  */
69
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
70
+ size: PropTypes.oneOf(SIZES)
70
71
  }
71
72
 
72
73
  SocialTwitterIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const StopIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -63,11 +64,11 @@ StopIcon.propTypes = {
63
64
  /**
64
65
  * color of text, icon and borders
65
66
  */
66
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
67
+ color: PropTypes.oneOf(COLORS_ICON),
67
68
  /**
68
69
  * Size
69
70
  */
70
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
71
+ size: PropTypes.oneOf(SIZES)
71
72
  }
72
73
 
73
74
  StopIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const TerminalIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -67,11 +68,11 @@ TerminalIcon.propTypes = {
67
68
  /**
68
69
  * color of text, icon and borders
69
70
  */
70
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
71
+ color: PropTypes.oneOf(COLORS_ICON),
71
72
  /**
72
73
  * Size
73
74
  */
74
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
75
+ size: PropTypes.oneOf(SIZES)
75
76
  }
76
77
 
77
78
  TerminalIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const TwoUsersIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -69,11 +70,11 @@ TwoUsersIcon.propTypes = {
69
70
  /**
70
71
  * color of text, icon and borders
71
72
  */
72
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
73
+ color: PropTypes.oneOf(COLORS_ICON),
73
74
  /**
74
75
  * Size
75
76
  */
76
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
77
+ size: PropTypes.oneOf(SIZES)
77
78
  }
78
79
 
79
80
  TwoUsersIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const UpgradeIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -102,11 +103,11 @@ UpgradeIcon.propTypes = {
102
103
  /**
103
104
  * color of text, icon and borders
104
105
  */
105
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
106
+ color: PropTypes.oneOf(COLORS_ICON),
106
107
  /**
107
108
  * Size
108
109
  */
109
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
110
+ size: PropTypes.oneOf(SIZES)
110
111
  }
111
112
 
112
113
  UpgradeIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const WorkspaceDynamicIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -72,11 +73,11 @@ WorkspaceDynamicIcon.propTypes = {
72
73
  /**
73
74
  * color of text, icon and borders
74
75
  */
75
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
76
+ color: PropTypes.oneOf(COLORS_ICON),
76
77
  /**
77
78
  * Size
78
79
  */
79
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
80
+ size: PropTypes.oneOf(SIZES)
80
81
  }
81
82
 
82
83
  WorkspaceDynamicIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const WorkspaceFailIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -97,11 +98,11 @@ WorkspaceFailIcon.propTypes = {
97
98
  /**
98
99
  * color of text, icon and borders
99
100
  */
100
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
101
+ color: PropTypes.oneOf(COLORS_ICON),
101
102
  /**
102
103
  * Size
103
104
  */
104
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
105
+ size: PropTypes.oneOf(SIZES)
105
106
  }
106
107
 
107
108
  WorkspaceFailIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const WorkspaceReadyIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -129,11 +130,11 @@ WorkspaceReadyIcon.propTypes = {
129
130
  /**
130
131
  * color of text, icon and borders
131
132
  */
132
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
133
+ color: PropTypes.oneOf(COLORS_ICON),
133
134
  /**
134
135
  * Size
135
136
  */
136
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
137
+ size: PropTypes.oneOf(SIZES)
137
138
  }
138
139
 
139
140
  WorkspaceReadyIcon.defaultProps = {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Icons.module.css'
4
+ import { COLORS_ICON, SIZES } from '../constants'
4
5
 
5
6
  const WorkspaceStaticIcon = ({ color, size }) => {
6
7
  const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
@@ -69,11 +70,11 @@ WorkspaceStaticIcon.propTypes = {
69
70
  /**
70
71
  * color of text, icon and borders
71
72
  */
72
- color: PropTypes.oneOf(['green', 'white', 'main-dark-blue', 'red']),
73
+ color: PropTypes.oneOf(COLORS_ICON),
73
74
  /**
74
75
  * Size
75
76
  */
76
- size: PropTypes.oneOf(['small', 'medium', 'large', 'extra-large'])
77
+ size: PropTypes.oneOf(SIZES)
77
78
  }
78
79
 
79
80
  WorkspaceStaticIcon.defaultProps = {
@@ -25,6 +25,7 @@ import CircleExclamationIcon from './CircleExclamationIcon'
25
25
  import CircleCheckMarkIcon from './CircleCheckMarkIcon'
26
26
  import CircleCloseIcon from './CircleCloseIcon'
27
27
  import CircleCloseHoverIcon from './CircleCloseHoverIcon'
28
+ import CircleFullIcon from './CircleFullIcon'
28
29
  import CircleTwoArrowsDownIcon from './CircleTwoArrowsDownIcon'
29
30
  import CircleTwoArrowsUpIcon from './CircleTwoArrowsUpIcon'
30
31
  import CloseIcon from './CloseIcon'
@@ -88,6 +89,7 @@ export default {
88
89
  CircleExclamationIcon,
89
90
  CircleCloseIcon,
90
91
  CircleCloseHoverIcon,
92
+ CircleFullIcon,
91
93
  CircleTwoArrowsDownIcon,
92
94
  CircleTwoArrowsUpIcon,
93
95
  CloseIcon,
@@ -1,13 +1,14 @@
1
1
  'use strict'
2
2
  import BorderedBox from '../components/BorderedBox'
3
+ import { COLORS_BORDERED_BOX } from '../components/constants'
3
4
  export default {
4
5
  title: 'Platformatic/BorderedBox',
5
6
  component: BorderedBox,
6
7
  // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
7
8
  argTypes: {
8
9
  color: {
9
- options: ['green', 'red', 'white'],
10
- control: { type: ' radio' }
10
+ options: COLORS_BORDERED_BOX,
11
+ type: 'radio'
11
12
  }
12
13
  }
13
14
  }
@@ -18,16 +19,15 @@ const Template = (args) => <BorderedBox {...args}>Hello Platformatic</BorderedBo
18
19
  export const Green = Template.bind({})
19
20
 
20
21
  Green.args = {
21
- color: 'green'
22
+ color: 'main-green'
22
23
  }
23
24
  export const Red = Template.bind({})
24
25
 
25
26
  Red.args = {
26
- color: 'red'
27
+ color: 'error-red'
27
28
  }
28
29
 
29
30
  export const White = Template.bind({})
30
-
31
31
  White.args = {
32
32
  color: 'white'
33
33
  }
@@ -2,8 +2,7 @@
2
2
  import { faCheck } from '@fortawesome/free-solid-svg-icons'
3
3
  import { useState } from 'react'
4
4
  import Button from '../components/Button'
5
-
6
- const colors = ['main-green', 'dark-green', 'light-green', 'main-dark-blue', 'dark-blue', 'light-blue', 'white', 'error-red', 'tertiary-blue', 'transparent']
5
+ import { COLORS_BUTTON, SIZES } from '../components/constants'
7
6
 
8
7
  export default {
9
8
  title: 'Platformatic/Button',
@@ -20,14 +19,14 @@ export default {
20
19
  type: 'string',
21
20
  control: {
22
21
  type: 'radio',
23
- options: colors
22
+ options: COLORS_BUTTON
24
23
  }
25
24
  },
26
25
  color: {
27
26
  type: 'string',
28
27
  control: {
29
28
  type: 'radio',
30
- options: colors
29
+ options: COLORS_BUTTON
31
30
  }
32
31
  },
33
32
  disabled: {
@@ -37,7 +36,7 @@ export default {
37
36
  type: 'string',
38
37
  control: {
39
38
  type: 'radio',
40
- options: ['small', 'medium', 'large', 'extra-large']
39
+ options: SIZES
41
40
  }
42
41
  },
43
42
  hoverEffect: {
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
- import { faStop, faRefresh } from '@fortawesome/free-solid-svg-icons'
3
2
  import ButtonFullRounded from '../components/ButtonFullRounded'
3
+ import { COLORS_ICON, SIZES } from '../components/constants'
4
4
 
5
5
  export default {
6
6
  title: 'Platformatic/ButtonFullRounded',
@@ -17,14 +17,14 @@ export default {
17
17
  type: 'string',
18
18
  control: {
19
19
  type: 'radio',
20
- options: ['green', 'red', 'white']
20
+ options: [COLORS_ICON]
21
21
  }
22
22
  },
23
23
  size: {
24
24
  type: 'string',
25
25
  control: {
26
26
  type: 'radio',
27
- options: ['small', 'medium', 'large']
27
+ options: [SIZES]
28
28
  }
29
29
  }
30
30
  }
@@ -34,28 +34,28 @@ const Template = (args) => <ButtonFullRounded {...args} />
34
34
 
35
35
  export const WhiteLarge = Template.bind({})
36
36
  WhiteLarge.args = {
37
- icon: faStop,
38
- size: 'large'
37
+ iconName: 'PlayIcon',
38
+ iconSize: 'large'
39
39
  }
40
40
 
41
41
  export const GreenSmall = Template.bind({})
42
42
  GreenSmall.args = {
43
- icon: faStop,
44
- color: 'green',
45
- size: 'small'
43
+ iconName: 'StopIcon',
44
+ iconColor: 'main-green',
45
+ iconSize: 'small'
46
46
  }
47
47
 
48
48
  export const Disabled = Template.bind({})
49
49
 
50
50
  Disabled.args = {
51
- icon: faRefresh,
51
+ iconName: 'BellIcon',
52
52
  disabled: true
53
53
  }
54
54
 
55
55
  export const DisabledRed = Template.bind({})
56
56
 
57
57
  DisabledRed.args = {
58
- icon: faRefresh,
59
- color: 'red',
58
+ iconName: 'StopIcon',
59
+ iconColor: 'error-red',
60
60
  disabled: true
61
61
  }
@@ -28,7 +28,6 @@ InfoBoxSample.args = {
28
28
  buttonProps: {
29
29
  label: 'Sample button',
30
30
  backgroundColor: 'main-green',
31
- color: 'red',
32
31
  onClick: () => alert('Clicked InfoBoxSample')
33
32
  }
34
33
  }
@@ -48,7 +47,7 @@ InfoBoxContained.args = {
48
47
  export const InfoBoxErrorContained = ContainedTemplate.bind({})
49
48
  InfoBoxErrorContained.args = {
50
49
  iconName: 'WorkspaceFailIcon',
51
- iconColor: 'red',
50
+ iconColor: 'error-red',
52
51
  helpText: 'Write your own content',
53
52
  buttonProps: {
54
53
  label: 'Sample button',
@@ -25,7 +25,7 @@ const Template = (args) => {
25
25
  <main>
26
26
  <BorderedBox>This Is another Content</BorderedBox>
27
27
  <ContentThatLoads />
28
- <Button color='green' buttonClass='primary' onClick={() => setIsOpen(true)} label='Open Modal' />
28
+ <Button color='main-green' buttonClass='primary' onClick={() => setIsOpen(true)} label='Open Modal' />
29
29
  {isOpen && <Modal setIsOpen={setIsOpen} {...rest}>{text}</Modal>}
30
30
  </main>
31
31
  )
@@ -37,7 +37,7 @@ const TemplateInvite = (args) => {
37
37
  <main>
38
38
  <BorderedBox>This Is another Content</BorderedBox>
39
39
  <ContentThatLoads />
40
- <Button color='green' buttonClass='primary' onClick={() => setIsOpen(true)} label='Open Modal' />
40
+ <Button color='main-green' buttonClass='primary' onClick={() => setIsOpen(true)} label='Open Modal' />
41
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
42
  </main>
43
43
  )
@@ -1,8 +1,7 @@
1
1
  import React from 'react'
2
2
  import PlatformaticIcon from '../components/PlatformaticIcon'
3
3
  import Icons from '../components/icons'
4
-
5
- const colors = ['green', 'white', 'red', 'main-dark-blue']
4
+ import { COLORS_ICON } from '../components/constants'
6
5
 
7
6
  const divStyle = {
8
7
  width: '100%'
@@ -32,7 +31,7 @@ export default {
32
31
  type: 'string',
33
32
  control: {
34
33
  type: 'radio',
35
- options: colors
34
+ options: COLORS_ICON
36
35
  }
37
36
  },
38
37
  size: {
@@ -36,9 +36,9 @@ EmptySidebar.args = {
36
36
 
37
37
  const FullSidebarTemplate = (args) => {
38
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' }
39
+ { id: '1', iconName: 'WorkspaceStaticIcon', subTitle: 'Subtitle', title: 'a very very very very very long title 1' },
40
+ { id: '2', title: 'Title number 2', subTitle: 'Subtitle 2' },
41
+ { id: '3', title: 'Another Title', subTitle: 'Subtitle 3', iconName: 'WorkspaceDynamicIcon' }
42
42
  ])
43
43
  function onClickAdd () {
44
44
  const tmpItem = items.map(item => item)
@@ -59,3 +59,18 @@ FullSidebar.args = {
59
59
  onClickItemSelected: (index) => alert('selected: ' + index),
60
60
  onClickSettings: () => alert('settings')
61
61
  }
62
+
63
+ export const AlreadySelected = Template.bind({})
64
+
65
+ AlreadySelected.args = {
66
+ title: 'Sidebar bar Full',
67
+ addTitle: 'Create',
68
+ defaultSelected: '3',
69
+ items: [
70
+ { id: '1', iconName: 'WorkspaceStaticIcon', title: 'Static 1', subTitle: 'Subtitle 1' },
71
+ { id: '2', iconName: 'WorkspaceStaticIcon', title: 'Static 2', subTitle: 'Subtitle 2' },
72
+ { id: '3', iconName: 'WorkspaceDynamicIcon', title: 'Dynamic', subTitle: 'Subtitle 3' }
73
+ ],
74
+ onClickItemSelected: (index) => alert('selected: ' + index),
75
+ onClickSettings: () => alert('settings')
76
+ }
@@ -19,13 +19,13 @@ White.args = {
19
19
  export const Green = Template.bind({})
20
20
 
21
21
  Green.args = {
22
- color: 'green',
22
+ color: 'main-green',
23
23
  status: 'online'
24
24
  }
25
25
 
26
26
  export const Red = Template.bind({})
27
27
 
28
28
  Red.args = {
29
- color: 'red',
29
+ color: 'error-red',
30
30
  status: 'offline'
31
31
  }
@@ -84,6 +84,6 @@ IconBeforeAndAfter.args = {
84
84
  },
85
85
  afterIcon: {
86
86
  iconName: 'CircleAddIcon',
87
- color: 'red'
87
+ color: 'error-red'
88
88
  }
89
89
  }
@@ -52,6 +52,6 @@ WithIcon.args = {
52
52
  title: 'My title',
53
53
  value: 'My value',
54
54
  afterValueIcon: 'WorkspaceStaticIcon',
55
- afterValueIconColor: 'green',
55
+ afterValueIconColor: 'main-green',
56
56
  onClickAfterValueIcon: () => alert('icon clicked')
57
57
  }