# Wellcome Icons

## Introduction
These icons can be used across Wellcome's digital products. Currently this repository includes
a single React component that accepts two props - the `name` of the icon to be used and an optional
`viewbox` prop that allows for custom viewboxes to be applied to the icons.

We don't provide any styling or wrapper elements for the SVGs - these should be implemented within
the repository consuming this library.

### Installation

```npm install @wellcometrust/wellcome-icons --save```


### Import components

```js
import { Icon, IconProps } from '@wellcometrust/wellcome-icons';

```

### View All Icons

A complete gallery of all available icons is available on the project's GitHub Pages demo. You can:

- **View the live demo**: Visit the [GitHub Pages deployment](https://icons.frontend-wellcome.org/)
- **View locally**: Run `npm run dev:demo` to start a development server
- **Build for deployment**: Run `npm run build:demo` to create a production build

For detailed deployment instructions, see [DEPLOY.md](./DEPLOY.md).

## Contributing to Wellcome Icons development

### Clone this repo

```git clone git@github.com:wellcometrust/wellcome-icons.git```

### Node version and NVM

This repo supports a specific version of Node.js which is specified in [.nvmrc](.nvmrc). It is strongly recommended that you install [NVM](http://nvm.sh/) on your local machine to easily manage multiple versions of Node.

Running `nvm use` from the command line will automatically pick up the version named in the `.nvmrc` file and set this as the node version for the current terminal window.

### Installation

```npm install```

### Build all files

```npm run build```

### Publishing for consumption

Once a pull request with the necessary changes is merged, the developer:

1. Checks out a new branch, the name isn't particularly important, something appropriate such as `git checkout -b task/updates-version` is fine.
2. Ensure the dependencies are up-to-date, run `npm ci`.
3. Set the package version using the npm cli:

  ```
  npm version <major|minor|patch> -m "Released version %s: <brief_description>"
  ```

4. Runs the following command to publish the new version of the package:

   ```
   npm publish --access public
   ```

5. Push the branch *and the tags* to the Github repo:

  ```
  git push -u origin <branch_name> --follow-tags
  ```

6. Create a pull request against `main`, request a review from other developers
7. Once approved, merge the pull request into `main`.

You can now `npm install @wellcometrust/wellcome-icons@{version_number|latest}` to use the new version in your project.