0.8.0-beta • Published 3 years ago

@lawsafrica/web-components v0.8.0-beta

Weekly downloads
-
License
LGPL-3.0-or-later
Repository
github
Last release
3 years ago

Built With Stencil

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/web-components@0.7.3-beta/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

  1. Update the version number: npm version --no-git-tag-version <version>
  2. Commit and push to GitHub using a Pull Request onto the master branch
  3. GitHub will build the package and update the dist directory
  4. Tag and release using GitHub off of the master branch
  5. GitHub will release a new version of the built package to GitHub packages

Copyright and license

Copyright 2021 Laws.Africa.

Licensed under GNU LGPLv3.