@platformatic/ui-components 0.1.49 → 0.1.50

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 (152) 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/fonts/Montserrat/README.txt +81 -81
  6. package/index.html +12 -12
  7. package/index.js +71 -71
  8. package/package.json +76 -76
  9. package/postcss.config.cjs +8 -8
  10. package/public/api-icon-closed.svg +6 -6
  11. package/public/api-icon.svg +9 -9
  12. package/src/App.jsx +12 -12
  13. package/src/components/BorderedBox.jsx +18 -18
  14. package/src/components/BorderedBox.module.css +8 -8
  15. package/src/components/BorderedText.jsx +8 -8
  16. package/src/components/BorderedText.module.css +2 -2
  17. package/src/components/Box.jsx +14 -14
  18. package/src/components/Box.module.css +7 -7
  19. package/src/components/Button.jsx +95 -95
  20. package/src/components/Button.module.css +127 -127
  21. package/src/components/ButtonFullRounded.jsx +17 -17
  22. package/src/components/ButtonFullRounded.module.css +28 -28
  23. package/src/components/Checkbox.jsx +11 -11
  24. package/src/components/Checkbox.module.css +18 -18
  25. package/src/components/Common.module.css +28 -28
  26. package/src/components/DetailedMetric.jsx +32 -32
  27. package/src/components/DetailedMetric.module.css +2 -2
  28. package/src/components/DropDown.jsx +36 -36
  29. package/src/components/DropDown.module.css +27 -27
  30. package/src/components/FollowUs.jsx +35 -35
  31. package/src/components/FollowUs.module.css +11 -11
  32. package/src/components/GHLoginButton.jsx +14 -14
  33. package/src/components/HorizontalSeparator.jsx +15 -15
  34. package/src/components/HorizontalSeparator.module.css +26 -26
  35. package/src/components/InfoBox.jsx +50 -50
  36. package/src/components/InfoBox.module.css +5 -5
  37. package/src/components/List.jsx +20 -20
  38. package/src/components/List.module.css +11 -11
  39. package/src/components/ListElement.jsx +23 -23
  40. package/src/components/ListElement.module.css +23 -23
  41. package/src/components/Loadable.jsx +34 -34
  42. package/src/components/Loadable.module.css +13 -13
  43. package/src/components/Loader.jsx +22 -22
  44. package/src/components/Loader.module.css +13 -13
  45. package/src/components/LoginButton.jsx +17 -17
  46. package/src/components/LoginButton.module.css +7 -7
  47. package/src/components/LoginButton.test.jsx +25 -25
  48. package/src/components/Logo.jsx +62 -62
  49. package/src/components/Logo.module.css +5 -5
  50. package/src/components/Main.jsx +33 -33
  51. package/src/components/MetricValue.jsx +15 -15
  52. package/src/components/MetricValue.module.css +9 -9
  53. package/src/components/Modal.jsx +93 -93
  54. package/src/components/Modal.module.css +50 -50
  55. package/src/components/PlatformaticIcon.jsx +57 -57
  56. package/src/components/PlatformaticIcon.module.css +2 -2
  57. package/src/components/Playground.jsx +9 -9
  58. package/src/components/SearchBar.jsx +63 -63
  59. package/src/components/SearchBar.module.css +20 -20
  60. package/src/components/Sidebar.jsx +153 -153
  61. package/src/components/Sidebar.module.css +66 -66
  62. package/src/components/SimpleMetric.jsx +28 -28
  63. package/src/components/SimpleMetric.module.css +6 -6
  64. package/src/components/Status.jsx +26 -26
  65. package/src/components/TabbedWindow.jsx +39 -39
  66. package/src/components/TabbedWindow.module.css +16 -16
  67. package/src/components/TextWithLabel.jsx +11 -11
  68. package/src/components/TextWithLabel.module.css +8 -8
  69. package/src/components/Versions.jsx +9 -9
  70. package/src/components/VerticalSeparator.jsx +5 -5
  71. package/src/components/forms/Field.jsx +53 -20
  72. package/src/components/forms/Field.module.css +23 -17
  73. package/src/components/forms/Input.jsx +80 -80
  74. package/src/components/forms/Input.module.css +28 -28
  75. package/src/components/forms/Preview.jsx +75 -77
  76. package/src/components/forms/Preview.module.css +14 -14
  77. package/src/components/forms/ToggleSwitch.jsx +18 -18
  78. package/src/components/forms/ToggleSwitch.module.css +42 -42
  79. package/src/components/forms/index.js +8 -8
  80. package/src/components/icons/ApiEmptyIcon.jsx +107 -107
  81. package/src/components/icons/ApiIcon.jsx +29 -29
  82. package/src/components/icons/ApiIconClosed.jsx +19 -19
  83. package/src/components/icons/AppEmptyIcon.jsx +94 -94
  84. package/src/components/icons/AppIcon.jsx +38 -38
  85. package/src/components/icons/AppListIcon.jsx +73 -73
  86. package/src/components/icons/Calendar1Icon.jsx +54 -54
  87. package/src/components/icons/Calendar7Icon.jsx +55 -55
  88. package/src/components/icons/CalendarIcon.jsx +56 -56
  89. package/src/components/icons/CircleAddIcon.jsx +40 -40
  90. package/src/components/icons/CircleBackIcon.jsx +51 -51
  91. package/src/components/icons/CircleCheckMarkIcon.jsx +66 -0
  92. package/src/components/icons/CircleCloseHoverIcon.jsx +42 -42
  93. package/src/components/icons/CircleCloseIcon.jsx +32 -32
  94. package/src/components/icons/CircleExclamationIcon.jsx +29 -29
  95. package/src/components/icons/CloseIcon.jsx +31 -31
  96. package/src/components/icons/CopyIcon.jsx +75 -75
  97. package/src/components/icons/CreatedWorkspaceIcon.jsx +70 -70
  98. package/src/components/icons/DynamicWorkspaceIcon.jsx +125 -125
  99. package/src/components/icons/EditIcon.jsx +38 -38
  100. package/src/components/icons/GearIcon.jsx +40 -40
  101. package/src/components/icons/Icons.module.css +29 -29
  102. package/src/components/icons/LiveIcon.jsx +43 -43
  103. package/src/components/icons/MetricsIcon.jsx +52 -52
  104. package/src/components/icons/PlayIcon.jsx +20 -20
  105. package/src/components/icons/PullRequestIcon.jsx +35 -35
  106. package/src/components/icons/StaticWorkspaceIcon.jsx +119 -119
  107. package/src/components/icons/StopIcon.jsx +21 -21
  108. package/src/components/icons/TerminalIcon.jsx +22 -22
  109. package/src/components/icons/TriangleExclamationIcon.jsx +26 -26
  110. package/src/components/icons/UpgradeIcon.jsx +48 -48
  111. package/src/components/icons/index.js +63 -61
  112. package/src/components/layouts/Layout.jsx +11 -11
  113. package/src/components/layouts/TwoColumnsLayout.jsx +12 -12
  114. package/src/components/layouts/TwoColumnsLayout.module.css +9 -9
  115. package/src/hooks/useEscapeKey.js +20 -20
  116. package/src/lib/utils.js +23 -23
  117. package/src/main.jsx +9 -9
  118. package/src/stories/BorderedBox.stories.jsx +33 -33
  119. package/src/stories/BorderedText.stories.jsx +24 -24
  120. package/src/stories/Button.stories.jsx +114 -114
  121. package/src/stories/ButtonFullRounded.stories.jsx +61 -61
  122. package/src/stories/Checkbox.stories.jsx +27 -27
  123. package/src/stories/DetailedMetric.stories.jsx +33 -33
  124. package/src/stories/DropDown.stories.jsx +62 -62
  125. package/src/stories/FollowUs.stories.jsx +14 -14
  126. package/src/stories/GHLoginButton.stories.jsx +14 -14
  127. package/src/stories/HorizontalSeparator.stories.jsx +12 -12
  128. package/src/stories/InfoBox.stories.jsx +46 -46
  129. package/src/stories/Introduction.stories.mdx +211 -211
  130. package/src/stories/List.stories.jsx +29 -29
  131. package/src/stories/ListElement.stories.jsx +15 -15
  132. package/src/stories/Loadable.stories.jsx +75 -75
  133. package/src/stories/Loader.stories.jsx +44 -44
  134. package/src/stories/LoginButton.stories.jsx +15 -15
  135. package/src/stories/Logo.stories.jsx +17 -17
  136. package/src/stories/Modal.stories.jsx +100 -100
  137. package/src/stories/PlatformaticIcon.stories.jsx +51 -35
  138. package/src/stories/SearchBar.stories.jsx +28 -28
  139. package/src/stories/Sidebar.stories.jsx +61 -61
  140. package/src/stories/SimpleMetric.stories.jsx +41 -41
  141. package/src/stories/Status.stories.jsx +31 -31
  142. package/src/stories/TextWithLabel.stories.jsx +25 -25
  143. package/src/stories/TwoColumnsLayout.stories.jsx +42 -42
  144. package/src/stories/forms/Field.stories.jsx +89 -81
  145. package/src/stories/forms/Input.stories.jsx +89 -89
  146. package/src/stories/forms/Preview.stories.jsx +57 -57
  147. package/src/stories/forms/ToggleSwitch.stories.jsx +15 -15
  148. package/src/stories/icons/Icons.stories.jsx +74 -74
  149. package/src/styles/main.css +15 -15
  150. package/tailwind.config.cjs +60 -60
  151. package/vite.config.js +6 -6
  152. package/vitest.config.js +14 -14
@@ -1,26 +1,26 @@
1
- import * as React from 'react'
2
- import styles from './Icons.module.css'
3
- const TriangleExclamationIcon = ({ color = 'red' }) => {
4
- const className = styles[`${color}`]
5
- return (
6
- <svg
7
- width={16}
8
- height={16}
9
- viewBox='0 0 16 16'
10
- fill='none'
11
- xmlns='http://www.w3.org/2000/svg'
12
- className={className}
13
- >
14
- <path d='M14 14H2L8 2L14 14Z' stroke='none' strokeLinejoin='round' />
15
- <path
16
- d='M8 6V10.5'
17
- stroke='none'
18
- strokeLinecap='round'
19
- strokeLinejoin='round'
20
- />
21
- <circle cx={8} cy={12} r={0.5} fill='none' />
22
- </svg>
23
- )
24
- }
25
-
26
- export default TriangleExclamationIcon
1
+ import * as React from 'react'
2
+ import styles from './Icons.module.css'
3
+ const TriangleExclamationIcon = ({ color = 'red' }) => {
4
+ const className = styles[`${color}`]
5
+ return (
6
+ <svg
7
+ width={16}
8
+ height={16}
9
+ viewBox='0 0 16 16'
10
+ fill='none'
11
+ xmlns='http://www.w3.org/2000/svg'
12
+ className={className}
13
+ >
14
+ <path d='M14 14H2L8 2L14 14Z' stroke='none' strokeLinejoin='round' />
15
+ <path
16
+ d='M8 6V10.5'
17
+ stroke='none'
18
+ strokeLinecap='round'
19
+ strokeLinejoin='round'
20
+ />
21
+ <circle cx={8} cy={12} r={0.5} fill='none' />
22
+ </svg>
23
+ )
24
+ }
25
+
26
+ export default TriangleExclamationIcon
@@ -1,48 +1,48 @@
1
- import * as React from 'react'
2
- import styles from './Icons.module.css'
3
-
4
- const UpgradeIcon = ({ color = 'green', size = 'normal' }) => {
5
- const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
6
- let icon = <></>
7
- switch (size) {
8
- case 'extra-large':
9
- icon = (
10
- <svg
11
- width={120}
12
- height={120}
13
- viewBox='0 0 120 120'
14
- fill='none'
15
- xmlns='http://www.w3.org/2000/svg'
16
- className={className}
17
- >
18
- <path
19
- d='M73.5692 71.2499C70.4961 74.9505 65.8773 77.3043 60.7127 77.3043C55.2863 77.3043 50.4624 74.7057 47.4009 70.6768'
20
- stroke='none'
21
- strokeWidth={6.5}
22
- strokeLinecap='round'
23
- strokeLinejoin='round'
24
- />
25
- <path
26
- d='M23.2957 51.3793L17.6102 51.3793C16.1675 51.3793 15 52.5551 15 54.0082L15 66.8661C15 68.3192 16.1675 69.495 17.6102 69.495L23.2957 69.495C24.3778 69.495 25.3554 70.1738 25.7351 71.1967L28.4782 78.5003C28.8483 79.4946 28.5921 80.6226 27.8138 81.3491L24.074 84.8576C22.973 85.89 22.973 87.649 24.0645 88.691L32.9677 97.161C33.9549 98.1074 35.5115 98.117 36.5176 97.1897L41.4343 92.6775C42.2126 91.97 43.3326 91.7884 44.2913 92.2377L50.8405 95.2968C51.7707 95.727 52.3592 96.6639 52.3592 97.6868L52.3592 102.371C52.3592 103.824 53.5267 105 54.9694 105L65.9608 105C67.4035 105 68.571 103.824 68.571 102.371L68.571 97.4573C68.571 96.3197 69.3018 95.3064 70.3744 94.9527L77.9393 92.4671C78.8315 92.1804 79.8091 92.3907 80.502 93.0216L84.9346 97.0654C86.0167 98.05 87.6967 97.9545 88.6553 96.8455L96.7517 87.5247C97.6819 86.4541 97.5965 84.8289 96.5619 83.8634L93.088 80.613C92.3191 79.9056 92.0534 78.8062 92.3951 77.8216L94.749 71.0342C95.1192 69.973 96.1063 69.2656 97.2168 69.2656L102.39 69.2656C103.833 69.2656 105 68.0898 105 66.6367L105 54.2472C105 52.7941 103.833 51.6183 102.39 51.6183L97.2168 51.6183'
27
- stroke='none'
28
- strokeWidth={6.5}
29
- strokeLinecap='round'
30
- strokeLinejoin='round'
31
- />
32
- <path
33
- d='M59.1684 15.3455L37.5 36.8033L48.75 36.8034L48.75 60.1728L71.25 60.1728L71.25 37.7592L82.5 37.7592L59.1684 15.3455Z'
34
- stroke='none'
35
- strokeWidth={6.5}
36
- strokeLinecap='round'
37
- strokeLinejoin='round'
38
- />
39
- </svg>
40
- )
41
- break
42
- default:
43
- break
44
- }
45
- return icon
46
- }
47
-
48
- export default UpgradeIcon
1
+ import * as React from 'react'
2
+ import styles from './Icons.module.css'
3
+
4
+ const UpgradeIcon = ({ color = 'green', size = 'normal' }) => {
5
+ const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
6
+ let icon = <></>
7
+ switch (size) {
8
+ case 'extra-large':
9
+ icon = (
10
+ <svg
11
+ width={120}
12
+ height={120}
13
+ viewBox='0 0 120 120'
14
+ fill='none'
15
+ xmlns='http://www.w3.org/2000/svg'
16
+ className={className}
17
+ >
18
+ <path
19
+ d='M73.5692 71.2499C70.4961 74.9505 65.8773 77.3043 60.7127 77.3043C55.2863 77.3043 50.4624 74.7057 47.4009 70.6768'
20
+ stroke='none'
21
+ strokeWidth={6.5}
22
+ strokeLinecap='round'
23
+ strokeLinejoin='round'
24
+ />
25
+ <path
26
+ d='M23.2957 51.3793L17.6102 51.3793C16.1675 51.3793 15 52.5551 15 54.0082L15 66.8661C15 68.3192 16.1675 69.495 17.6102 69.495L23.2957 69.495C24.3778 69.495 25.3554 70.1738 25.7351 71.1967L28.4782 78.5003C28.8483 79.4946 28.5921 80.6226 27.8138 81.3491L24.074 84.8576C22.973 85.89 22.973 87.649 24.0645 88.691L32.9677 97.161C33.9549 98.1074 35.5115 98.117 36.5176 97.1897L41.4343 92.6775C42.2126 91.97 43.3326 91.7884 44.2913 92.2377L50.8405 95.2968C51.7707 95.727 52.3592 96.6639 52.3592 97.6868L52.3592 102.371C52.3592 103.824 53.5267 105 54.9694 105L65.9608 105C67.4035 105 68.571 103.824 68.571 102.371L68.571 97.4573C68.571 96.3197 69.3018 95.3064 70.3744 94.9527L77.9393 92.4671C78.8315 92.1804 79.8091 92.3907 80.502 93.0216L84.9346 97.0654C86.0167 98.05 87.6967 97.9545 88.6553 96.8455L96.7517 87.5247C97.6819 86.4541 97.5965 84.8289 96.5619 83.8634L93.088 80.613C92.3191 79.9056 92.0534 78.8062 92.3951 77.8216L94.749 71.0342C95.1192 69.973 96.1063 69.2656 97.2168 69.2656L102.39 69.2656C103.833 69.2656 105 68.0898 105 66.6367L105 54.2472C105 52.7941 103.833 51.6183 102.39 51.6183L97.2168 51.6183'
27
+ stroke='none'
28
+ strokeWidth={6.5}
29
+ strokeLinecap='round'
30
+ strokeLinejoin='round'
31
+ />
32
+ <path
33
+ d='M59.1684 15.3455L37.5 36.8033L48.75 36.8034L48.75 60.1728L71.25 60.1728L71.25 37.7592L82.5 37.7592L59.1684 15.3455Z'
34
+ stroke='none'
35
+ strokeWidth={6.5}
36
+ strokeLinecap='round'
37
+ strokeLinejoin='round'
38
+ />
39
+ </svg>
40
+ )
41
+ break
42
+ default:
43
+ break
44
+ }
45
+ return icon
46
+ }
47
+
48
+ export default UpgradeIcon
@@ -1,61 +1,63 @@
1
- import ApiIcon from './ApiIcon'
2
- import ApiIconClosed from './ApiIconClosed'
3
- import ApiEmptyIcon from './ApiEmptyIcon'
4
- import AppIcon from './AppIcon'
5
- import AppListIcon from './AppListIcon'
6
- import AppEmptyIcon from './AppEmptyIcon'
7
- import CalendarIcon from './CalendarIcon'
8
- import Calendar1Icon from './Calendar1Icon'
9
- import Calendar7Icon from './Calendar7Icon'
10
- import CircleAddIcon from './CircleAddIcon'
11
- import CircleBackIcon from './CircleBackIcon'
12
- import CircleExclamationIcon from './CircleExclamationIcon'
13
- import CircleCloseIcon from './CircleCloseIcon'
14
- import CircleCloseHoverIcon from './CircleCloseHoverIcon'
15
- import CloseIcon from './CloseIcon'
16
- import CopyIcon from './CopyIcon'
17
- import CreatedWorkspaceIcon from './CreatedWorkspaceIcon'
18
- import DynamicWorkspaceIcon from './DynamicWorkspaceIcon'
19
- import EditIcon from './EditIcon'
20
- import GearIcon from './GearIcon'
21
- import LiveIcon from './LiveIcon'
22
- import MetricsIcon from './MetricsIcon'
23
- import PlayIcon from './PlayIcon'
24
- import PullRequestIcon from './PullRequestIcon'
25
- import StaticWorkspaceIcon from './StaticWorkspaceIcon'
26
- import StopIcon from './StopIcon'
27
- import TerminalIcon from './TerminalIcon'
28
- import TriangleExclamationIcon from './TriangleExclamationIcon'
29
- import UpgradeIcon from './UpgradeIcon'
30
-
31
- export default {
32
- ApiIcon,
33
- ApiIconClosed,
34
- ApiEmptyIcon,
35
- AppIcon,
36
- AppListIcon,
37
- AppEmptyIcon,
38
- CalendarIcon,
39
- Calendar1Icon,
40
- Calendar7Icon,
41
- CircleAddIcon,
42
- CircleBackIcon,
43
- CircleExclamationIcon,
44
- CircleCloseIcon,
45
- CircleCloseHoverIcon,
46
- CloseIcon,
47
- CopyIcon,
48
- CreatedWorkspaceIcon,
49
- DynamicWorkspaceIcon,
50
- GearIcon,
51
- EditIcon,
52
- LiveIcon,
53
- MetricsIcon,
54
- PlayIcon,
55
- PullRequestIcon,
56
- StaticWorkspaceIcon,
57
- StopIcon,
58
- TerminalIcon,
59
- TriangleExclamationIcon,
60
- UpgradeIcon
61
- }
1
+ import ApiIcon from './ApiIcon'
2
+ import ApiIconClosed from './ApiIconClosed'
3
+ import ApiEmptyIcon from './ApiEmptyIcon'
4
+ import AppIcon from './AppIcon'
5
+ import AppListIcon from './AppListIcon'
6
+ import AppEmptyIcon from './AppEmptyIcon'
7
+ import CalendarIcon from './CalendarIcon'
8
+ import Calendar1Icon from './Calendar1Icon'
9
+ import Calendar7Icon from './Calendar7Icon'
10
+ import CircleAddIcon from './CircleAddIcon'
11
+ import CircleBackIcon from './CircleBackIcon'
12
+ import CircleExclamationIcon from './CircleExclamationIcon'
13
+ import CircleCheckMarkIcon from './CircleCheckMarkIcon'
14
+ import CircleCloseIcon from './CircleCloseIcon'
15
+ import CircleCloseHoverIcon from './CircleCloseHoverIcon'
16
+ import CloseIcon from './CloseIcon'
17
+ import CopyIcon from './CopyIcon'
18
+ import CreatedWorkspaceIcon from './CreatedWorkspaceIcon'
19
+ import DynamicWorkspaceIcon from './DynamicWorkspaceIcon'
20
+ import EditIcon from './EditIcon'
21
+ import GearIcon from './GearIcon'
22
+ import LiveIcon from './LiveIcon'
23
+ import MetricsIcon from './MetricsIcon'
24
+ import PlayIcon from './PlayIcon'
25
+ import PullRequestIcon from './PullRequestIcon'
26
+ import StaticWorkspaceIcon from './StaticWorkspaceIcon'
27
+ import StopIcon from './StopIcon'
28
+ import TerminalIcon from './TerminalIcon'
29
+ import TriangleExclamationIcon from './TriangleExclamationIcon'
30
+ import UpgradeIcon from './UpgradeIcon'
31
+
32
+ export default {
33
+ ApiIcon,
34
+ ApiIconClosed,
35
+ ApiEmptyIcon,
36
+ AppIcon,
37
+ AppListIcon,
38
+ AppEmptyIcon,
39
+ CalendarIcon,
40
+ Calendar1Icon,
41
+ Calendar7Icon,
42
+ CircleAddIcon,
43
+ CircleBackIcon,
44
+ CircleCheckMarkIcon,
45
+ CircleExclamationIcon,
46
+ CircleCloseIcon,
47
+ CircleCloseHoverIcon,
48
+ CloseIcon,
49
+ CopyIcon,
50
+ CreatedWorkspaceIcon,
51
+ DynamicWorkspaceIcon,
52
+ GearIcon,
53
+ EditIcon,
54
+ LiveIcon,
55
+ MetricsIcon,
56
+ PlayIcon,
57
+ PullRequestIcon,
58
+ StaticWorkspaceIcon,
59
+ StopIcon,
60
+ TerminalIcon,
61
+ TriangleExclamationIcon,
62
+ UpgradeIcon
63
+ }
@@ -1,11 +1,11 @@
1
- 'use strict'
2
- import React from 'react'
3
-
4
- export default function Layout (props) {
5
- return (
6
- <div className='container mx-auto px-5 my-5 flex flex-col gap-10 h-screen'>
7
- {props.children}
8
- </div>
9
-
10
- )
11
- }
1
+ 'use strict'
2
+ import React from 'react'
3
+
4
+ export default function Layout (props) {
5
+ return (
6
+ <div className='container mx-auto px-5 my-5 flex flex-col gap-10 h-screen'>
7
+ {props.children}
8
+ </div>
9
+
10
+ )
11
+ }
@@ -1,12 +1,12 @@
1
- 'use strict'
2
- import React from 'react'
3
- import styles from './TwoColumnsLayout.module.css'
4
-
5
- export default function TwoColumnsLayout ({ children, gridTemplate = 'columns' }) {
6
- const className = styles[`${gridTemplate}`]
7
- return (
8
- <div className={className}>
9
- {children}
10
- </div>
11
- )
12
- }
1
+ 'use strict'
2
+ import React from 'react'
3
+ import styles from './TwoColumnsLayout.module.css'
4
+
5
+ export default function TwoColumnsLayout ({ children, gridTemplate = 'columns' }) {
6
+ const className = styles[`${gridTemplate}`]
7
+ return (
8
+ <div className={className}>
9
+ {children}
10
+ </div>
11
+ )
12
+ }
@@ -1,10 +1,10 @@
1
-
2
- .columns {
3
- @apply grid grid-cols-2 gap-x-4;
4
- }
5
- .rows {
6
- @apply grid grid-rows-2 gap-y-4;
7
- }
8
- .responsive {
9
- @apply grid grid-rows-2 gap-y-4 md:grid-rows-none md:gap-y-0 md:grid-cols-2 md:gap-x-4;
1
+
2
+ .columns {
3
+ @apply grid grid-cols-2 gap-x-4;
4
+ }
5
+ .rows {
6
+ @apply grid grid-rows-2 gap-y-4;
7
+ }
8
+ .responsive {
9
+ @apply grid grid-rows-2 gap-y-4 md:grid-rows-none md:gap-y-0 md:grid-cols-2 md:gap-x-4;
10
10
  }
@@ -1,20 +1,20 @@
1
- import { useCallback, useEffect } from 'react'
2
- const KEY_NAME_ESC = 'Escape'
3
- const KEY_EVENT_TYPE = 'keyup'
4
- function useEscapeKey (handleClose) {
5
- const handleEscKey = useCallback((event) => {
6
- if (event.key === KEY_NAME_ESC) {
7
- handleClose()
8
- }
9
- }, [handleClose])
10
-
11
- useEffect(() => {
12
- document.addEventListener(KEY_EVENT_TYPE, handleEscKey, false)
13
-
14
- return () => {
15
- document.removeEventListener(KEY_EVENT_TYPE, handleEscKey, false)
16
- }
17
- }, [handleEscKey])
18
- }
19
-
20
- export default useEscapeKey
1
+ import { useCallback, useEffect } from 'react'
2
+ const KEY_NAME_ESC = 'Escape'
3
+ const KEY_EVENT_TYPE = 'keyup'
4
+ function useEscapeKey (handleClose) {
5
+ const handleEscKey = useCallback((event) => {
6
+ if (event.key === KEY_NAME_ESC) {
7
+ handleClose()
8
+ }
9
+ }, [handleClose])
10
+
11
+ useEffect(() => {
12
+ document.addEventListener(KEY_EVENT_TYPE, handleEscKey, false)
13
+
14
+ return () => {
15
+ document.removeEventListener(KEY_EVENT_TYPE, handleEscKey, false)
16
+ }
17
+ }, [handleEscKey])
18
+ }
19
+
20
+ export default useEscapeKey
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
+ }