@platformatic/ui-components 0.1.3 → 0.1.4
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/index.js +7 -1
- package/package.json +4 -3
- package/src/components/GHLoginButton.jsx +15 -0
- package/src/components/LoginButton.jsx +17 -0
- package/src/components/LoginButton.module.css +3 -0
- package/src/stories/GHLoginButton.stories.jsx +14 -0
- package/src/stories/LoginButton.stories.jsx +15 -0
- package/tailwind.config.cjs +1 -0
package/index.js
CHANGED
|
@@ -6,12 +6,15 @@ import BorderedBox from './src/components/BorderedBox'
|
|
|
6
6
|
import BorderedText from './src/components/BorderedText'
|
|
7
7
|
import HorizontalSeparator from './src/components/HorizontalSeparator'
|
|
8
8
|
import Layout from './src/components/layouts/Layout'
|
|
9
|
+
import TwoColumnsLayout from './src/components/layouts/TwoColumnsLayout'
|
|
9
10
|
import Playground from './src/components/Playground'
|
|
10
11
|
import Prs from './src/components/Pr'
|
|
11
12
|
import SearchBar from './src/components/SearchBar'
|
|
12
13
|
import TabbedWindow from './src/components/TabbedWindow'
|
|
13
14
|
import Versions from './src/components/Versions'
|
|
14
15
|
import VerticalSeparator from './src/components/VerticalSeparator'
|
|
16
|
+
import LoginButton from './src/components/LoginButton'
|
|
17
|
+
import GHLoginButton from './src/components/GHLoginButton'
|
|
15
18
|
export {
|
|
16
19
|
Api,
|
|
17
20
|
ApiDetails,
|
|
@@ -19,10 +22,13 @@ export {
|
|
|
19
22
|
BorderedText,
|
|
20
23
|
HorizontalSeparator,
|
|
21
24
|
Layout,
|
|
25
|
+
TwoColumnsLayout,
|
|
22
26
|
Playground,
|
|
23
27
|
Prs,
|
|
24
28
|
SearchBar,
|
|
25
29
|
TabbedWindow,
|
|
26
30
|
Versions,
|
|
27
|
-
VerticalSeparator
|
|
31
|
+
VerticalSeparator,
|
|
32
|
+
LoginButton,
|
|
33
|
+
GHLoginButton
|
|
28
34
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/ui-components",
|
|
3
3
|
"description": "Platformatic UI Components",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "vite",
|
|
9
9
|
"build": "vite build",
|
|
10
10
|
"preview": "vite preview",
|
|
11
|
-
"storybook": "start-storybook -p 6006",
|
|
12
|
-
"build-storybook": "build-storybook",
|
|
11
|
+
"storybook": "NODE_OPTIONS='--openssl-legacy-provider' start-storybook -p 6006",
|
|
12
|
+
"build-storybook": "NODE_OPTIONS='--openssl-legacy-provider' build-storybook",
|
|
13
13
|
"tailwind:watch": "tailwindcss -i ./src/styles/main.css -o ./dist/main.css --watch",
|
|
14
14
|
"tailwind": "tailwindcss -i ./src/styles/main.css -o ./dist/main.css",
|
|
15
15
|
"lint": "standard --fix"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@fortawesome/fontawesome-svg-core": "^6.2.0",
|
|
19
|
+
"@fortawesome/free-brands-svg-icons": "^6.2.0",
|
|
19
20
|
"@fortawesome/free-solid-svg-icons": "^6.2.0",
|
|
20
21
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
21
22
|
"autoprefixer": "^10.4.12",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
import LoginButton from './LoginButton'
|
|
4
|
+
import { faGithub } from '@fortawesome/free-brands-svg-icons'
|
|
5
|
+
|
|
6
|
+
export default function GHLoginButton ({ onClick, ...props }) {
|
|
7
|
+
return (
|
|
8
|
+
<LoginButton
|
|
9
|
+
label='Continue with Github'
|
|
10
|
+
onClick={onClick}
|
|
11
|
+
icon={faGithub}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
4
|
+
import styles from './LoginButton.module.css'
|
|
5
|
+
|
|
6
|
+
export default function LoginButton ({ icon, label, onClick, ...props }) {
|
|
7
|
+
return (
|
|
8
|
+
<button
|
|
9
|
+
type='button'
|
|
10
|
+
onClick={onClick}
|
|
11
|
+
className={styles.button}
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
{icon ? <FontAwesomeIcon icon={icon} /> : null} {label}
|
|
15
|
+
</button>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import GHLoginButton from '../components/GHLoginButton'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Example/GHLoginButton',
|
|
6
|
+
component: GHLoginButton
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Template = (args) => <GHLoginButton {...args} />
|
|
10
|
+
|
|
11
|
+
export const Default = Template.bind({})
|
|
12
|
+
Default.args = {
|
|
13
|
+
onClick: () => alert('clicked')
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import LoginButton from '../components/LoginButton'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Example/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
|
+
}
|