1.5.0 • Published 2 years ago

cx-portal-shared-components v1.5.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Deprecated!

Please note that this library is discontinued and development will continue only in:

Catena-X Portal Shared UI Components

Contains the shared UI components that are used to build the Catena-X Portal Frontend. Get an overview about the available components here

yarn start:storybook

To use components in your own project follow this guide. First create a new react app and add dependencies for the library and Material UI. We are using yarn and TypeScript, if you prefer npm/npx or JavaScript use those.

yarn create react-app sample-shared-components --template typescript
cd sample-shared-components
yarn add cx-portal-shared-components @mui/icons-material @mui/material

Start the development server

yarn start

Edit src/index.tsx and wrap the App with the CX SharedThemeProvider context

ReactDOM.createRoot(
    document.getElementById('root') as HTMLElement
).render(
    <React.StrictMode>
        <SharedThemeProvider>
            <App />
        </SharedThemeProvider>
    </React.StrictMode>
)

Edit src/index.css and add this stylings

Note: replace <YOUR_PORTAL_HOSTNAME> with your installation host name.

@font-face {
    font-family: "LibreFranklin-SemiBold";
    font-display: block;
    src: url("https://<YOUR_PORTAL_HOSTNAME>/assets/fonts/LibreFranklin-VariableFont_wght.ttf") format("truetype");
    font-weight: 600;
}
@font-face {
    font-family: "LibreFranklin-Medium";
    font-display: block;
    src: url("https://<YOUR_PORTAL_HOSTNAME>/assets/fonts/LibreFranklin-VariableFont_wght.ttf") format("truetype");
    font-weight: 500;
}
@font-face {
    font-family: "LibreFranklin";
    font-display: block;
    src: url("https://<YOUR_PORTAL_HOSTNAME>/assets/fonts/LibreFranklin-VariableFont_wght.ttf") format("truetype");
    font-weight: 400;
}
@font-face {
    font-family: "LibreFranklin-Light";
    font-display: block;
    src: url("https://<YOUR_PORTAL_HOSTNAME>/assets/fonts/LibreFranklin-VariableFont_wght.ttf") format("truetype");
    font-weight: 300;
}

body {
    margin: 0;
    font-family: 'LibreFranklin', 'Libre Franklin', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    color: black;
    font-weight: 300;
}

Open App.tsx and replace the code with this example

import { Button } from "cx-portal-shared-components";
const App = () => <Button onClick={() => { alert('clicked') }}>Click me</Button>
export default App;
1.5.0

2 years ago

1.5.0-RC1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.3.0-RC3

2 years ago

1.3.0-RC4

2 years ago

1.3.0-RC1

2 years ago

1.3.0-RC2

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

1.0.0-RC5

2 years ago

1.0.0-RC6

2 years ago

1.0.0-RC7

2 years ago

1.0.0-RC8

2 years ago

1.0.0-RC9

2 years ago

1.0.0-RC4

2 years ago

0.10.0

2 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.5.5

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.5.4

3 years ago

0.4.3-a

3 years ago

0.4.3-d

3 years ago

0.4.3-c

3 years ago

0.4.4-a

3 years ago

0.4.3-b

3 years ago

0.4.5

3 years ago

0.5.3

3 years ago

0.4.4

3 years ago

0.5.2

3 years ago

0.4.3

3 years ago

0.5.1

3 years ago

0.3.5

3 years ago

0.4.1

3 years ago

0.3.4

3 years ago

0.1.0

3 years ago