0.21.0 • Published 4 years ago
@zenginehq/zengine-ui-react v0.21.0
Zengine UI React
Atomic design Components for Zengine Plugins built in React.
Installation
npm i @zenginehq/zengine-ui @zenginehq/zengine-ui-reactRunning Storybook
npm run storybook Publishing Changes
npm postpublishUsage
Add Font Awesome Icons
In index.html or equivalent:
<script src="https://kit.fontawesome.com/0cf0825a47.js" crossorigin="anonymous"></script>Import and Use
In your component.js file:
// Add styles. In the future this might be available on a CDN, for now include it locally.
import '@zenginehq/zengine-ui/style.css';
// Use components.
import { Button, TextField, NumberField, Form } from '@zenginehq/zengine-ui-react';
// Tree-shaking friendly imports also available.
import Button from '@zenginehq/zengine-ui-react/lib/atoms/Button';
function MyComponent() {
const myCallback = values => {
console.warn('submitted values', values);
};
return (
<Form onSubmit={myCallback}>
<TextField name="firstName" label="First Name" required />
<NumberField name="age" label="Age" required />
</Form>
);
}For more information see the Storybook.
Explanation of NPM scripts
storybook: starts the local dev version of the Storybooktest: starts the Jest interactive test runnertest:save: runs tests in CI mode (non-interactive just run all tests once) and logs output to a filetest:cover: runs tests in CI mode (see test:save) and generates code a coverage report (only considersapifolder)storybook:build: runs tests to generate the log output and builds the Storybookstorybook:publish: deploys the Storybook to Github Pagesbuild: builds the redistributable output for Zengine UI React; this is what people will get when theynpm installthis in their projectsbuild:js: helper script to build JS artifacts, gets called bynpm run buildbuild:css: helper script to build CSS artifacts, gets called bynpm run build- 'postpublish': 'test build and publish all in one command'
Directory Structure Guide
.cacheis an internal directory used by React, ignore it.storybookcontains Storybook configurationlibis where the generated package code goes whennpm run buildis executed; this directory won't exist unless you've run the commandpubliccontains static assets to be served with the Storybooksrccontains the actual Zengine UI React source codestorybook-staticis where the generated Storybook code whennpm run build-storybookis executed; this directory won't exist unless you've run the command
0.21.0
4 years ago
0.20.0
4 years ago
0.19.3
5 years ago
0.19.2
5 years ago
0.19.1
5 years ago
0.19.1-alpha.1
5 years ago
0.19.1-alpha.0
5 years ago
0.19.0
5 years ago
0.18.13
5 years ago
0.18.12
5 years ago
0.18.11
5 years ago
0.18.10
5 years ago
0.18.9
5 years ago
0.18.7
5 years ago
0.18.8
5 years ago
0.18.6
5 years ago
0.18.3
5 years ago
0.18.1
5 years ago
0.17.0
5 years ago
0.18.0
5 years ago
0.16.0
5 years ago
0.14.0
5 years ago
0.15.0
5 years ago
0.13.0
5 years ago
0.13.1
5 years ago
0.11.0
5 years ago
0.12.0
5 years ago
0.10.0
5 years ago
0.9.1
5 years ago
0.9.0
5 years ago
0.8.0
5 years ago
0.7.0
6 years ago
0.6.0
6 years ago
0.5.0
6 years ago
0.4.0
6 years ago
0.3.0
6 years ago
0.2.4
6 years ago
0.2.3
6 years ago
0.2.2
6 years ago
0.2.1
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago