1.5.0 • Published 11 months ago

cx-portal-shared-components v1.5.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months 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

11 months ago

1.5.0-RC1

11 months ago

1.4.0

12 months ago

1.3.0

1 year ago

1.3.0-RC3

1 year ago

1.3.0-RC4

1 year ago

1.3.0-RC1

1 year ago

1.3.0-RC2

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

1.0.0-RC5

1 year ago

1.0.0-RC6

1 year ago

1.0.0-RC7

1 year ago

1.0.0-RC8

1 year ago

1.0.0-RC9

1 year ago

1.0.0-RC4

1 year ago

0.10.0

1 year ago

0.9.0

1 year ago

0.8.0

1 year ago

0.5.5

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.5.4

2 years ago

0.4.3-a

2 years ago

0.4.3-d

2 years ago

0.4.3-c

2 years ago

0.4.4-a

2 years ago

0.4.3-b

2 years ago

0.4.5

2 years ago

0.5.3

2 years ago

0.4.4

2 years ago

0.5.2

2 years ago

0.4.3

2 years ago

0.5.1

2 years ago

0.3.5

2 years ago

0.4.1

2 years ago

0.3.4

2 years ago

0.1.0

2 years ago