@lawsafrica/web-components
v0.8.0-beta
Published
Laws.Africa Web Components
Downloads
4
Readme
Laws.Africa web component library (beta)
This is a collection of web components for formatting and adding interactivity to Akoma Ntoso documents.
These are web components, so they work in any major framework or with no framework at all.
Components
Content components
Behaviour components
Using these component
There are three methods for using these web components:
Script tag
- Put a script tag similar to this
<script type="module" src="https://cdn.jsdelivr.net/npm/@lawsafrica/[email protected]/dist/la-web-components/la-web-components.esm.js"></script>
in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
Node Modules
- Run
npm install @lawsafrica/web-components --save
- Put a script tag similar to this
<script type="module" src="node_modules/@laws-africa/web-components/dist/la-web-components/la-web-components.esm.js"></script>
in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
Development
Clone this repository and run:
npm install
Need help? Check out the Stencil docs.
Using Storybook
Development is easiest using Storybook for testing.
Run these commands in separate terminals:
npm run storybook
npm run stencil-for-storybook
To build Storybook for static use (not yet tested):
npm run build-storybook
Without Storybook
npm run start
Building for production
To build the component for production, run:
npm run build
Running tests
To run the unit tests for the components, run:
npm test
Releasing a new version
- Update the version number:
npm version --no-git-tag-version <version>
- Commit and push to GitHub using a Pull Request onto the master branch
- GitHub will build the package and update the
dist
directory - Tag and release using GitHub off of the
master
branch - GitHub will release a new version of the built package to GitHub packages
Copyright and license
Copyright 2021 Laws.Africa.
Licensed under GNU LGPLv3.