2.0.21 • Published 2 months ago

@rubin-epo/epo-react-lib v2.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

epo-react-lib

React UI components for Rubin Observatory Education & Public Outreach projects

Use

Install

Install from npm.

yarn add @rubin-epo/epo-react-lib

Dependencies

EPO React Library has 5 peer dependencies required to pull it in to your application.

yarn add react react-dom styled-components i18next react-i18next

There is an additional optional peer dependency on next for components that use the Next.js router.

Styles

After installing the package library, the global styles will need to be added to the top level of your application.

import { GlobalStyles } from "@rubin-epo/epo-react-lib";

const App = () => {
  return <main><GlobalStyles></main>
}

If you use other Rubin React libraries, this step only needs to be done once from this library. Additional imports of the global styles are not necessary.

Translations

Import localeStrings from @rubin-epo/epo-react-lib, it contains individual locales that can be added to your project's i18next setup.

Build

Vite

This project uses Vite in library mode to package the contents of /packages/epo-react-lib/src into modules located in /packages/epo-react-lib/dist/epo-lib.[es|umd].js and TypeScript typings in /packages/epo-react-lib/dist/index.d.ts

To build from source:

cd packages/epo-react-lib
yarn
yarn build # production build
# yarn dev # development server

Storybook

Storybook is used to create an interactive display of the components in the EPO React Library.

Stories from component folders following the `**.stories.t|jsx will be included in the Storybook bundle.

To run Storybook:

yarn build
yarn storybook

Test

Each component EPO React Library contains a Jest unit test. Tests should be co-located with component code and their stories and follow the **.test.[t|j]sx naming format.

yarn test
# yarn test:generate-output # will save to .jest-test-results.json for Storybook

To add a unit test to it's Storybook page add the filename of the unit test to the parameters property of the story

export const Primary: ComponentStoryObj<typeof DemoButton> = {
  args: {
    disabled: false,
    children: "Hello",
  },
  parameters: {
    jest: "DemoButton.test.tsx",
  },
};
2.0.21

2 months ago

1.2.14

2 months ago

2.0.20

3 months ago

2.0.19

3 months ago

2.0.17

3 months ago

2.0.18

3 months ago

2.0.16

3 months ago

2.0.16-rc.1

4 months ago

2.0.15

4 months ago

2.0.14

4 months ago

2.0.13

5 months ago

2.0.12

5 months ago

2.0.11

5 months ago

2.0.3

9 months ago

2.0.2

9 months ago

2.0.5

6 months ago

2.0.4

6 months ago

2.0.7

6 months ago

2.0.6

6 months ago

2.0.9

6 months ago

2.0.8

6 months ago

2.0.1

9 months ago

2.0.0

10 months ago

1.2.13

10 months ago

1.2.10

10 months ago

1.2.11

10 months ago

2.0.0-beta.7

10 months ago

2.0.0-rc.1

10 months ago

2.0.10

5 months ago

2.0.0-beta.2

10 months ago

2.0.0-beta.6

10 months ago

2.0.0-beta.5

10 months ago

2.0.0-beta.4

10 months ago

2.0.0-beta.3

10 months ago

1.3.0-beta.3

10 months ago

1.3.0-beta.4

10 months ago

1.3.0-beta.5

10 months ago

1.2.0

1 year ago

1.1.1

1 year ago

1.0.19

1 year ago

1.1.0

1 year ago

1.0.18

1 year ago

1.2.8

11 months ago

1.2.6

12 months ago

1.2.5

12 months ago

1.2.4

1 year ago

1.1.5

1 year ago

1.2.3

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

1.3.0-alpha.6

11 months ago

1.3.0-beta.2

11 months ago

1.3.0-alpha.5

11 months ago

1.3.0-alpha.7

11 months ago

1.2.9

11 months ago

1.3.0-alpha.2

11 months ago

1.3.0-alpha.1

11 months ago

1.3.0-alpha.4

11 months ago

1.3.0-alpha.3

11 months ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.11

1 year ago

1.0.12

1 year ago

1.0.5

1 year ago

1.0.4-rc.0

1 year ago

1.0.4

1 year ago

1.0.3-rc.2

1 year ago

1.0.3-rc.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago