@platformatic/ui-components 0.1.2 → 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/Api/Endpoints.jsx +1 -1
- package/src/components/Api/Footer.jsx +1 -0
- package/src/components/Api/Status.jsx +1 -0
- package/src/components/Api/Version.jsx +1 -1
- package/src/components/Api.jsx +1 -1
- package/src/components/ApiDetail.jsx +2 -2
- package/src/components/BorderedBox.jsx +1 -0
- package/src/components/BorderedText.jsx +1 -1
- package/src/components/GHLoginButton.jsx +15 -0
- package/src/components/HorizontalSeparator.jsx +1 -1
- package/src/components/LoginButton.jsx +17 -0
- package/src/components/LoginButton.module.css +3 -0
- package/src/components/Main.jsx +1 -1
- package/src/components/Playground.jsx +1 -1
- package/src/components/Pr.jsx +1 -1
- package/src/components/SearchBar.jsx +1 -1
- package/src/components/StatValue.jsx +1 -1
- package/src/components/{StatView.jsx → StatsView.jsx} +1 -1
- package/src/components/Versions.jsx +1 -1
- package/src/components/VerticalSeparator.jsx +1 -1
- package/src/components/layouts/Layout.jsx +1 -0
- package/src/components/layouts/TwoColumnsLayout.jsx +1 -1
- package/src/stories/BorderedBox.stories.jsx +5 -0
- package/src/stories/GHLoginButton.stories.jsx +14 -0
- package/src/stories/LoginButton.stories.jsx +15 -0
- package/tailwind.config.cjs +1 -0
- package/vite.config.js +1 -10
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",
|
|
@@ -4,6 +4,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
|
4
4
|
import { faDatabase, faFileLines, faGear } from '@fortawesome/free-solid-svg-icons'
|
|
5
5
|
import BorderedText from '../BorderedText'
|
|
6
6
|
import styles from './Footer.module.css'
|
|
7
|
+
import React from 'react'
|
|
7
8
|
export default function ApiFooter (props) {
|
|
8
9
|
const { graphql, openapi } = props
|
|
9
10
|
return (
|
package/src/components/Api.jsx
CHANGED
|
@@ -9,7 +9,7 @@ import ApiStatus from './Api/Status'
|
|
|
9
9
|
import BorderedBox from './BorderedBox'
|
|
10
10
|
import HorizontalSeparator from './HorizontalSeparator'
|
|
11
11
|
import styles from './Api.module.css'
|
|
12
|
-
import { useState } from 'react'
|
|
12
|
+
import React, { useState } from 'react'
|
|
13
13
|
|
|
14
14
|
function ApiName (props) {
|
|
15
15
|
const { name } = props
|
|
@@ -5,9 +5,9 @@ import BorderedBox from './BorderedBox'
|
|
|
5
5
|
import BorderedText from './BorderedText'
|
|
6
6
|
import HorizontalSeparator from './HorizontalSeparator'
|
|
7
7
|
import TwoColumnsLayout from './layouts/TwoColumnsLayout'
|
|
8
|
-
import StatsView from './
|
|
8
|
+
import StatsView from './StatsView'
|
|
9
9
|
import VerticalSeparator from './VerticalSeparator'
|
|
10
|
-
|
|
10
|
+
import React from 'react'
|
|
11
11
|
export default function ApiDetails (props) {
|
|
12
12
|
const apiData = props.data
|
|
13
13
|
const { url, repository, version, openapi, graphql, source, lastDeploy } = apiData
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { getColor } from '../lib/utils'
|
|
4
4
|
import styles from './BorderedBox.module.css'
|
|
5
5
|
import commonStyles from './Common.module.css'
|
|
6
|
+
import React from 'react'
|
|
6
7
|
export default function BorderedBox (props) {
|
|
7
8
|
const { classes, color, children } = props
|
|
8
9
|
const borderColor = getColor('border', color)
|
|
@@ -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
|
+
}
|
package/src/components/Main.jsx
CHANGED
|
@@ -7,7 +7,7 @@ import TabbedWindow from './TabbedWindow'
|
|
|
7
7
|
import Prs from './Pr'
|
|
8
8
|
import Playground from './Playground'
|
|
9
9
|
import Versions from './Versions'
|
|
10
|
-
import { useState } from 'react'
|
|
10
|
+
import React, { useState } from 'react'
|
|
11
11
|
export default function Main () {
|
|
12
12
|
const [currentSearch, setCurrentSearch] = useState('')
|
|
13
13
|
const apis = [
|
package/src/components/Pr.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
+
import React, { useRef } from 'react'
|
|
2
3
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
3
4
|
import { faSearch } from '@fortawesome/free-solid-svg-icons'
|
|
4
|
-
import { useRef } from 'react'
|
|
5
5
|
import styles from './SearchBar.module.css'
|
|
6
6
|
import commonStyles from './Common.module.css'
|
|
7
7
|
export default function SearchBar (props) {
|
|
@@ -6,7 +6,7 @@ import styles from './StatsView.module.css'
|
|
|
6
6
|
import HorizontalSeparator from './HorizontalSeparator'
|
|
7
7
|
import VerticalSeparator from './VerticalSeparator'
|
|
8
8
|
import StatValue from './StatValue'
|
|
9
|
-
|
|
9
|
+
import React from 'react'
|
|
10
10
|
export default function StatsView (props) {
|
|
11
11
|
const { title, stats } = props
|
|
12
12
|
const mainStat = stats.mainStat
|
|
@@ -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
|
+
}
|
package/tailwind.config.cjs
CHANGED
package/vite.config.js
CHANGED
|
@@ -2,14 +2,5 @@ import { defineConfig } from 'vite'
|
|
|
2
2
|
import react from '@vitejs/plugin-react'
|
|
3
3
|
/** @type {import('vite').UserConfig} */
|
|
4
4
|
export default defineConfig({
|
|
5
|
-
plugins: [react()]
|
|
6
|
-
build: {
|
|
7
|
-
rollupOptions: {
|
|
8
|
-
output: {
|
|
9
|
-
assetFileNames: 'platformatic-ui.css',
|
|
10
|
-
chunkFileNames: 'platformatic-ui.js',
|
|
11
|
-
manualChunks: undefined
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
5
|
+
plugins: [react()]
|
|
15
6
|
})
|