0.47.6 • Published 6 years ago
treact-ui v0.47.6
Treact UI Components
Requirements
Installation & Usage
Project Setup:
create-react-app my-app
cd my-app
touch .npmrcCopy the content of this proejct's .npmrc.azure file to your project's .npmrc and enter your credentials (password etc.) in this file for the placeholders.
Then on command line:
npm install @tls/treact-ui styled-componentsIn your global CSS:
html,
body {
font-size: 1px;
}And last but not least, in one of your React components:
import React from 'react';
import { Atoms } from '@tls/treact-ui';
const { ContentButtonPrimary } = Atoms;
const App = () => {
return (
<div>
<ContentButtonPrimary label="Click me" />
</div>
);
};
export default App;You are ready to go.
Relative Imports
Keep the bundle size small with relative imports:
import React from 'react';
import ContentButtonPrimary from '@tls/treact-ui/lib/ContentButtonPrimary';
const App = () => {
return (
<div>
<ContentButtonPrimary label="Click me" />
</div>
);
};
export default App;Contribution to Library
Setup:
git clone git@gitlab.com:TRUMPF-corp/treui/ui-components.gitcd ui-components- follow .npmrc
npm install
.npmrc
Add npm credentials from azure feed to your local .npmrc file. The credentials can be obtained by going to the TcXLibrary Feed: Connect To Feed > NPM > Generate NPM Credentials.
- Rename .npmrc.azure to .npmrc
- Add your password credentials from Azure Dev Ops to .npmrc
Scripts
Run Storybook:
npm run storybook
Build Storybook:
npm install -g http-servernpm run storybook-buildhttp-server dist/
Build Library:
npm run build
Run Tests:
npm testnpm run test:watch