@hexure/ui v1.13.24
Getting Started
InsTech UI is the source repository for the @hexure/ui npm package. This library of components is the React implementation of the Hexure Design System, and should be used across all Hexure React applications and projects.
Usage
- Run
npm i @hexure/ui --save
- If needed, install/update any required peer dependencies: react, react-dom, @mdi/font, @mdi/js, @mdi/react, moment, numeral
- Refer to Hexure Design System for available components and how to use them.
Import components as needed into your React project:
import { Button } from @hexure/ui
b. To use the UI Library in your project
npx install @hexure/ui
Some common Commands:npm run rollup
to run rollup and generate a dist foldernpm run storybook
to run storybook server and see components on storybook.npm run test
to run all test cases.Optional: Applying a custom theme:
- Import the
ThemeProvider
from styled-components:import { ThemeProvider } from 'styled-components'
- Wrap your top level application with the ThemeProvider:
<ThemeProvider><YourApp /></ThemeProvider>
- Define your custom theme on the provider:
<ThemeProvider theme={{ PRIMARY_COLOR: { Hex: 'Blue', Rgb: '10,10,10' } }}><YourApp /></ThemeProvider>
- As of v1.9.0 the only theme option is
PRIMARY_COLOR
and it must be an object withHex
andRbg
values.
Contribute
Setting up your local environment
- Clone the repo to your machine
- Make sure you have Node and NPM install on your machine
- Navigate to the clone repo directory and install it's npm packages:
npm i
- Run the storybook command to preview the components and your changes:
npm run storybook
Creating a new component
- Pull down the latest version of main and create a new branch off it that corresponds with a Jira ticket:
git branch -b [your_name]/[FEE-#]
- Create a new directory in
src/components
with the following files:- index.ts
- ComponentName.tsx: This should match the name of the React component and the name of the component in the Design System
- ComponentName.stories.tsx: This should match the name of the tsx file above
- Add the following content to index.ts
export { default } from './ComponentName';
- Build out ComponentName.tsx and ComponentName.stories.tsx as needed.
- Be sure to follow our front-end guidelines and standards found at https://insurancetechnologies.atlassian.net/jira/software/projects/FEE/pages
- Make sure ESLint passes by before committing/pushing your changes
npm run eslint
. You can usenpm run eslint-fix
to auto-fix some of the ESLint errors - Make sure you run Prettier before committing/pushing your changes:
npm run prettier
- Once you're work is complete, create a new Pull Request in Azure DevOps against the main branch.
- Your Pull Request must be reviewed and approved by the lead over this repository.
- Once approved, merge your pull request into main and follow the steps under "Releasing a new version"
Modifying an existing component
- Pull down the latest version of main and create a new branch off it that corresponds with a Jira ticket:
git branch -b [your_name]/[FEE-#]
- Modify ComponentName.tsx and ComponentName.stories.tsx as neeeded.
- Be sure to follow our front-end guidelines and standards found at https://insurancetechnologies.atlassian.net/jira/software/projects/FEE/pages
- Make sure ESLint passes by before committing/pushing your changes
npm run eslint
. You can usenpm run eslint-fix
to auto-fix some of the ESLint errors - Make sure you run Prettier before committing/pushing your changes:
npm run prettier
- Once you're work is complete, create a new Pull Request in Azure DevOps against the main branch.
- Your Pull Request must be reviewed and approved by the lead over this repository.
- Once approved, merge your pull request into main and follow the steps under "Releasing a new version"
Releasing a new version
You should release a new version of this package immediately after a Pull Request in approved.
- Determine the new version number based on the following:
- Major: The only time this would be bumped is if we're making wholistic breaking changes, like doing a major upgrade to React.
- Minor: This should be bumped if we are:
- Adding a new component or utility
- Making breaking changes to an individual component or utility
- Patch: This should be bumped if we are:
- Making non-breaking changes to an indivdiual component or utility
- Making minor bumps to npm packages
- Fixing bugs with existing components
- Pull down the latest version of main and create a new branch off it that corresponds with the new version number:
git branch -b release/1.x.x
- Update package.json with the new version number.
- Make sure ESLint passes:
npm run eslint
- Since ESLint passing is a requirement for all PRs, this should always pass
- Run Rollup to compile the src files into the dist directory for distribution:
npm run rollup
- Sometimes rollup won't exit out the command after generating the files into dist. If this happens, just exit out of the process
- Verify the updates are seen in the dist directory:
git status
and/orgit diff
- Add, commit, and push the changes:
git add .
thengit commit -m "v1.x.x"
thengit push origin release/1.x.x
- Create a Pull Request in Azure DevOps against the main branch.
- Your Pull Request must be reviewed and approved by the lead over this repository.
- Once approved, merge your pull request into main.
- Pull down the updated main branch and run
npm publish
- Go to the Azure DevOps repo and add a new Tag
- Tag Name: v1.x.x
- Description: Add details around what was added/changed
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
10 months ago
11 months ago
12 months ago
10 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago