Common web components for the OSP ecosystem
npm install osp-lit-commonThis repo contains some general-use components implementing the OSP design language and assorted simple functionality.
Static docs, which may not correspond exactly to your version: https://rmer.info/osp
To run your own synchronized version:
* git clone (this repo)
* (in repo dir) yarn install
* yarn watch
* Visit http://localhost:8080
* yarn add osp-lit-common
* Follow lit-element and lit-html docs, except inherit from OspElement instead, and use its provided registry in preference to customElements:
``
import { OspElement } from 'osp-lit-common';
export class OspMyFooComponent extends OspElement {
// ...
}
OspElement.define(OspMyFooComponent);
`
Also, in your template, import html and similar utilities from osp-lit-common as well, instead of directly referencing lit-element or lit-html.
More information about this is above in the API documentation.
TODO: there should be a bundle URL you can link from OSP to get all the common components while taking advantage of the client cache to not duplicate them between pages.
Until that's configured:
* yarn add osp-lit-commonimport
* components as needed, e.g: import { OspInput } from 'osp-lit-common/src/components/Input'
* Use the corresponding tags as needed in your templates,