Note: this is a "labs" component. While functional, these tasks are prerequisites to promotion to BrightspaceUI "official" status:
- Design organization buy-in
- Architectural sign-off
- Continuous integration
- Cross-browser testing
- Unit tests (if applicable)
- Accessibility tests
- Visual diff tests
- Localization with Serge (if applicable)
- Demo page
- README documentation
A Lit element component for toggling between views.
To install from NPM:
npm install @brightspace-ui-labs/view-toggle
<script type="module">
import '@brightspace-ui-labs/view-toggle/view-toggle.js';
</script>
<d2l-view-toggle
toggleOptions='[{"text":"Bananas","val":"overall"},{"text":"Minions","val":"minios"},{"text":"Pyjamas","val":"subject"}]'
text="Toggle: "
></d2l-view-toggle>
After cloning the repo, run npm install
to install dependencies.
# eslint and lit-analyzer
npm run lint
# eslint only
npm run lint:eslint
# lint & run headless unit tests
npm test
# unit tests only
npm run test:headless
# debug or run a subset of local unit tests
npm run test:headless:watch
To start a @web/dev-server that hosts the demo page and tests:
npm start
This repo is configured to use semantic-release
. Commits prefixed with fix:
and feat:
will trigger patch and minor releases when merged to main
.
To learn how to create major releases and release from maintenance branches, refer to the semantic-release GitHub Action documentation.