@platformatic/ui-components 0.1.29 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/Box.jsx +6 -3
- package/src/components/Box.module.css +5 -1
- package/src/components/Logo.jsx +37 -55
- package/src/components/Modal.jsx +3 -3
- package/src/components/Modal.module.css +2 -2
- package/src/components/TabbedWindow.module.css +1 -1
- package/src/components/icons/CloseModalIcon.jsx +26 -0
- package/src/components/icons/index.js +2 -1
- package/src/components/layouts/Layout.jsx +1 -1
- package/src/components/layouts/TwoColumnsLayout.jsx +6 -3
- package/src/components/layouts/TwoColumnsLayout.module.css +10 -0
- package/src/stories/Logo.stories.jsx +5 -2
- package/src/stories/TwoColumnsLayout.stories.jsx +42 -0
- package/tailwind.config.cjs +6 -1
package/package.json
CHANGED
package/src/components/Box.jsx
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import styles from './Box.module.css'
|
|
4
4
|
import React from 'react'
|
|
5
|
-
export default function Box (
|
|
5
|
+
export default function Box ({ justifyCentered, children }) {
|
|
6
|
+
let className = `${styles.box}`
|
|
7
|
+
if (justifyCentered) className += ` ${styles.justifyCentered}`
|
|
8
|
+
|
|
6
9
|
return (
|
|
7
|
-
<div className={
|
|
8
|
-
{
|
|
10
|
+
<div className={className}>
|
|
11
|
+
{children}
|
|
9
12
|
</div>
|
|
10
13
|
)
|
|
11
14
|
}
|
package/src/components/Logo.jsx
CHANGED
|
@@ -1,75 +1,57 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
export default function Logo ({ width, heigth }) {
|
|
2
|
+
export default function Logo ({ width = 107, heigth = 86 }) {
|
|
3
3
|
return (
|
|
4
4
|
<svg
|
|
5
|
-
data-name='Layer 1'
|
|
6
|
-
xmlns='http://www.w3.org/2000/svg'
|
|
7
|
-
viewBox='0 0 2000 2000'
|
|
8
5
|
width={width}
|
|
9
6
|
height={heigth}
|
|
7
|
+
viewBox='0 0 107 86'
|
|
8
|
+
fill='none'
|
|
9
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
10
10
|
>
|
|
11
11
|
<path
|
|
12
|
-
d='
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
strokeLinecap: 'round',
|
|
18
|
-
strokeLinejoin: 'round'
|
|
19
|
-
}}
|
|
12
|
+
d='M30.8197 62.5803H89.7919V62.5614C92.0266 62.4574 94.2096 61.8539 96.1799 60.7954C98.1502 59.7369 99.8577 58.2503 101.177 56.4452C102.496 54.6401 103.392 52.5624 103.801 50.3652C104.21 48.168 104.12 45.9072 103.538 43.7493C102.956 41.5915 101.897 39.5915 100.438 37.8967C98.9799 36.202 97.1596 34.8556 95.1114 33.9567C93.0632 33.0579 90.8392 32.6294 88.6032 32.703C86.3673 32.7765 84.1763 33.3502 82.1917 34.3817C80.9669 31.5572 79.1131 29.0491 76.7716 27.0482C74.43 25.0473 71.6623 23.6064 68.6792 22.8352M18.1691 22.8352C13.8266 23.9537 9.97973 26.4828 7.23367 30.0244C4.48761 33.566 2.99827 37.9192 3 42.399C3.00173 46.8787 4.49443 51.2307 7.24322 54.7702C9.992 58.3098 13.8409 60.8359 18.1841 61.951'
|
|
13
|
+
stroke='white'
|
|
14
|
+
stroke-width='4.21053'
|
|
15
|
+
stroke-linecap='round'
|
|
16
|
+
stroke-linejoin='round'
|
|
20
17
|
/>
|
|
21
18
|
<path
|
|
22
|
-
d='
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
strokeLinecap: 'round',
|
|
28
|
-
strokeLinejoin: 'round'
|
|
29
|
-
}}
|
|
19
|
+
d='M41.4979 35.2219L33.6299 37.9838L37.0924 45.3197'
|
|
20
|
+
stroke='#21FA90'
|
|
21
|
+
stroke-width='4.21053'
|
|
22
|
+
stroke-linecap='round'
|
|
23
|
+
stroke-linejoin='round'
|
|
30
24
|
/>
|
|
31
25
|
<path
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
strokeLinecap: 'round',
|
|
38
|
-
strokeLinejoin: 'round'
|
|
39
|
-
}}
|
|
40
|
-
d='M501.83 1630.69v56.45'
|
|
26
|
+
d='M33.8069 38.1138C37.3946 40.2213 41.5789 41.0853 45.709 40.5715C49.8391 40.0577 53.6834 38.1948 56.6441 35.2727C59.6047 32.3505 61.5157 28.5329 62.0797 24.4136C62.6437 20.2943 61.8292 16.1043 59.7628 12.4953C57.6964 8.88629 54.494 6.0606 50.6537 4.45774C46.8135 2.85489 42.5506 2.56474 38.5281 3.63241C34.5057 4.70009 30.9492 7.06574 28.4119 10.3614C25.8745 13.6571 24.4986 17.698 24.498 21.8556V49.9806'
|
|
27
|
+
stroke='#21FA90'
|
|
28
|
+
stroke-width='4.21053'
|
|
29
|
+
stroke-linecap='round'
|
|
30
|
+
stroke-linejoin='round'
|
|
41
31
|
/>
|
|
42
32
|
<path
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
strokeLinejoin: 'round'
|
|
50
|
-
}}
|
|
51
|
-
d='M502.33 1453.1v89.15'
|
|
33
|
+
opacity='0.2'
|
|
34
|
+
d='M24.498 79.7146V83.0001'
|
|
35
|
+
stroke='#21FA90'
|
|
36
|
+
stroke-width='4.21053'
|
|
37
|
+
stroke-linecap='round'
|
|
38
|
+
stroke-linejoin='round'
|
|
52
39
|
/>
|
|
53
40
|
<path
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
strokeLinejoin: 'round'
|
|
61
|
-
}}
|
|
62
|
-
d='M501.83 1211.73v149.07'
|
|
41
|
+
opacity='0.4'
|
|
42
|
+
d='M24.5283 69.3757V74.5658'
|
|
43
|
+
stroke='#21FA90'
|
|
44
|
+
stroke-width='4.21053'
|
|
45
|
+
stroke-linecap='round'
|
|
46
|
+
stroke-linejoin='round'
|
|
63
47
|
/>
|
|
64
48
|
<path
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
strokeLinejoin: 'round'
|
|
72
|
-
}}
|
|
49
|
+
opacity='0.7'
|
|
50
|
+
d='M24.498 55.3254V64.0028'
|
|
51
|
+
stroke='#21FA90'
|
|
52
|
+
stroke-width='4.21053'
|
|
53
|
+
stroke-linecap='round'
|
|
54
|
+
stroke-linejoin='round'
|
|
73
55
|
/>
|
|
74
56
|
</svg>
|
|
75
57
|
)
|
package/src/components/Modal.jsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { faClose } from '@fortawesome/free-solid-svg-icons'
|
|
2
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
3
1
|
import React from 'react'
|
|
4
2
|
import useEscapeKey from '../hooks/useEscapeKey'
|
|
3
|
+
import CloseModalIcon from './icons/CloseModalIcon'
|
|
5
4
|
import styles from './Modal.module.css'
|
|
6
5
|
export default function Modal (props) {
|
|
7
6
|
const { setIsOpen, title } = props
|
|
@@ -14,13 +13,14 @@ export default function Modal (props) {
|
|
|
14
13
|
<div className={styles.header}>
|
|
15
14
|
<div className={styles.title}>{title}</div>
|
|
16
15
|
<div className={styles.close} onClick={() => setIsOpen(false)}>
|
|
17
|
-
<
|
|
16
|
+
<CloseModalIcon />
|
|
18
17
|
</div>
|
|
19
18
|
</div>
|
|
20
19
|
<hr className={styles.hr} />
|
|
21
20
|
<div>
|
|
22
21
|
{props.children}
|
|
23
22
|
</div>
|
|
23
|
+
<hr className={styles.hr} />
|
|
24
24
|
</div>
|
|
25
25
|
</div>
|
|
26
26
|
</>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@apply fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]
|
|
10
10
|
}
|
|
11
11
|
.modal {
|
|
12
|
-
@apply bg-[#E9F7FF] p-4 rounded-md mx-auto my-auto min-w-[480px] max-h-[85vh] overflow-y-
|
|
12
|
+
@apply bg-[#E9F7FF] p-4 rounded-md mx-auto my-auto min-w-[480px] max-h-[85vh] overflow-y-auto;
|
|
13
13
|
}
|
|
14
14
|
.header {
|
|
15
15
|
@apply flex justify-between items-center;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
@apply hover:cursor-pointer;
|
|
19
19
|
}
|
|
20
20
|
.hr {
|
|
21
|
-
@apply text-[#00283D] my-2
|
|
21
|
+
@apply text-[#00283D] my-2 opacity-20;
|
|
22
22
|
}
|
|
23
23
|
.title {
|
|
24
24
|
@apply font-bold text-lg;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
@apply flex justify-start text-white uppercase hover:cursor-pointer mb-4 tracking-[.25rem] h-[2rem];
|
|
7
7
|
}
|
|
8
8
|
.tab {
|
|
9
|
-
@apply
|
|
9
|
+
@apply mx-8 min-w-[105px] text-center text-sm first:ml-0 last:mr-0;
|
|
10
10
|
}
|
|
11
11
|
.selected-tab {
|
|
12
12
|
@apply underline text-main-green underline-offset-8 font-bold;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
const CloseModalIcon = () => (
|
|
4
|
+
<svg
|
|
5
|
+
width='16'
|
|
6
|
+
height='16'
|
|
7
|
+
viewBox='0 0 16 16'
|
|
8
|
+
fill='none'
|
|
9
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
d='M2 2L14 14'
|
|
13
|
+
stroke='#00283D'
|
|
14
|
+
stroke-linecap='round'
|
|
15
|
+
stroke-linejoin='round'
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
d='M2 14L14 2'
|
|
19
|
+
stroke='#00283D'
|
|
20
|
+
stroke-linecap='round'
|
|
21
|
+
stroke-linejoin='round'
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export default CloseModalIcon
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import ApiIcon from './ApiIcon'
|
|
2
2
|
import ApiIconClosed from './ApiIconClosed'
|
|
3
|
+
import CloseModalIcon from './CloseModalIcon'
|
|
3
4
|
import PullRequestIcon from './PullRequestIcon'
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
|
-
ApiIcon, ApiIconClosed, PullRequestIcon
|
|
7
|
+
ApiIcon, ApiIconClosed, CloseModalIcon, PullRequestIcon
|
|
7
8
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
|
|
3
|
+
import styles from './TwoColumnsLayout.module.css'
|
|
4
|
+
|
|
5
|
+
export default function TwoColumnsLayout ({ children, gridTemplate = 'columns' }) {
|
|
6
|
+
const className = styles[`${gridTemplate}`]
|
|
4
7
|
return (
|
|
5
|
-
<div className=
|
|
6
|
-
{
|
|
8
|
+
<div className={className}>
|
|
9
|
+
{children}
|
|
7
10
|
</div>
|
|
8
11
|
)
|
|
9
12
|
}
|
|
@@ -7,8 +7,11 @@ export default {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const Template = (args) => <Logo {...args} />
|
|
10
|
-
export const
|
|
11
|
-
|
|
10
|
+
export const LogoLarge = Template.bind({})
|
|
11
|
+
LogoLarge.args = {
|
|
12
12
|
width: 300,
|
|
13
13
|
heigth: 300
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
export const LogoNormal = Template.bind({})
|
|
17
|
+
LogoNormal.args = {}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import TwoColumnsLayout from '../components/layouts/TwoColumnsLayout'
|
|
3
|
+
import BorderedBox from '../components/BorderedBox'
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Platformatic/TwoColumnsLayout',
|
|
6
|
+
component: TwoColumnsLayout
|
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
8
|
+
/* argTypes: {
|
|
9
|
+
gridTemplate: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
control: {
|
|
12
|
+
type: 'radio',
|
|
13
|
+
options: ['Default', 'Columns', 'Rows', 'Responsive' ],
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
} */
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
20
|
+
const Template = (args) => <TwoColumnsLayout {...args}><BorderedBox>1st</BorderedBox><BorderedBox>2nd</BorderedBox></TwoColumnsLayout>
|
|
21
|
+
|
|
22
|
+
export const Default = Template.bind({})
|
|
23
|
+
|
|
24
|
+
Default.args = { }
|
|
25
|
+
|
|
26
|
+
export const Columns = Template.bind({})
|
|
27
|
+
|
|
28
|
+
Columns.args = {
|
|
29
|
+
gridTemplate: 'columns'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const Rows = Template.bind({})
|
|
33
|
+
|
|
34
|
+
Rows.args = {
|
|
35
|
+
gridTemplate: 'rows'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Responsive = Template.bind({})
|
|
39
|
+
|
|
40
|
+
Responsive.args = {
|
|
41
|
+
gridTemplate: 'responsive'
|
|
42
|
+
}
|
package/tailwind.config.cjs
CHANGED