@international-energy-agency/vue-ui
v2.0.5
Published
Reusable Vue UI components that match IEA.org design system and behaviors.
Downloads
390
Readme
IEA Vue UI Components
[[TOC]]
Using the component library
Installation from GitLab
To install the library from the GitLab NPM registry you first need to set up NPM locally to use it. First set the registry with
npm config set @international-energy-agency:registry https://gitlab.com/api/v4/packages/npm/Then set your auth token with
npm config set '//gitlab.com/api/v4/packages/npm/:_authToken' "<your_token>"(Contact your GitLab admin or generate a token with read_registry permissions from Settings -> Repository on GitLab.)
You should now be able to:
npm install @international-energy-agency/vue-uiIncluding UI components in your project
import { StyledButton } from "@international-energy-agency/vue-ui";Including map components in your project
import { MapGetter } from "@international-energy-agency/vue-ui/maps";(Requires mapbox-gl as peer dependency)
Including Highcharts components in your porject
import { options } from "@international-energy-agency/vue-ui/highcharts";For now, no peer dependencies as it's just an options object. But in future may require Highcharts. Options can be used with higcharts-vue to provide sensible defaults. @iea/data-charts is now deprecated.
Development
Nodenv
We use nodenv to keep our node version consistent.
When it is installed, it should automatically use the correct version.
To verify this, you can run nodenv version and verify that it matches the contents of .node-version
If it doesn't match, run:
nodenv update
nodenv install
nodenv versionProject setup
npm installView storybook locally
npm run storybookView demo locally
npm run demoGo to http://localhost:5173
To use the local version of vue-ui in a project using the data browser boilerplate
This can be helpful if you want to test local changes to a component in a project as well as in the storybook.
- In the data project, change the
vue-uidependency to point to your local version of this repo. For example, if both repos are cloned into in the same directory:"@international-energy-agency/vue-ui": "file:../vue-ui", - In the data project, reinstall dependencies
npm install - In the data project, in
vite.config.js, add"@international-energy-agency/vue-ui"to the arraybuild.rollupOptions.external. - In
vue-ui(this project) build the package while watching for changesnpm run build-watch - In the data project, run the dev server with
--forceso that vite ignores its cachenpx vite --force
Note: do not commit these changes to dev or main, since they are only to help with local development.
Releases
On a new branch:
