0.3.30 • Published 1 day ago

opub-ui v0.3.30

Weekly downloads
-
License
MIT
Repository
github
Last release
1 day ago

OPub UI

OPub UI component library based on a React, designed to provide a collection of reusable UI components for Open Data Platforms.

Getting Started

To get started with the component library, install the package via npm:

npm install opub-ui@latest

Usage

The following steps are required before you can start using components:

  1. Import the CSS in the global stylesheet of the project.
@import url('opub-ui/dist/assets/styles.css');
  1. Once you complete the initial setup, you can import components into your project as needed:
import { Badge, Button, Menu } from 'opub-ui';
  1. To use visualisation components, you can import them from the opub-ui/viz package:
import { BarChart } from 'opub-ui/viz';

For MapChart, you will need to lazy load the component. Example on Data Exchange

  1. There are helpful utilities and hooks that you can import from the opub-ui/utils package:
import { copyToClipboard, downloadFile } from 'opub-ui/utils';

When using with NextJs you will need to transpile the packages More Info, add this inside next.config.js :

transpilePackages: ['opub-ui']

Components

You can view the complete list of available components on Storybook. The list will grow, and there can be breaking changes at this stage of development.

Development

The source code is under the src directory. The structure is as follows:

src/
┣ components/
┣ types/
┣ utils/
┣ index.ts

Components

All components reside in this directory. This is the structure we follow for components, e.g., Checkbox:

Checkbox/
┣ Checkbox.tsx/
┣ Checkbox.module.scss/
┣ Checkbox.stories.tsx/
┣ index.ts

We rely on Sass Modules and Tailwind for styling and Storybook for developing components in isolation.

Types

In this directory, we store the type files of components that aid in type checking and other helpful typescript features.

Utils

This directory stores helpers, custom hooks, and other utility functions to aid development. These functions are also exposed to the end-user.

Bundling

We use Rollup to bundle the src for publishing on npm. We also copy the assets into the bundled dist directory during this step. You can check out the config file at ./rollup.config.mjs.

We only bundle into ESM Modules.

Contributing

Pull requests are welcome. See the contribution guidelines for more information.

Credits

Thanks to the following projects for developing in the open and sharing their work with the community:

  1. Shopify Polaris
  2. Radix UI
  3. React Spectrum
  4. React Hook Form
  5. AriaKit
  6. Tabler Icons

Licenses

The source code is under MIT License unless otherwise stated. This project uses multiple open-source libraries and projects. You can review the dependencies in the package.json file and check their Licenses from their GitHub repo.

0.3.30

1 day ago

0.3.29

6 days ago

0.3.28

6 days ago

0.3.27

6 days ago

0.3.26

15 days ago

0.3.25

15 days ago

0.3.24

15 days ago

0.3.23

15 days ago

0.3.22

15 days ago

0.3.20

21 days ago

0.3.21

21 days ago

0.3.19

29 days ago

0.3.18

1 month ago

0.3.17

1 month ago

0.3.16

1 month ago

0.3.15

1 month ago

0.3.14

1 month ago

0.3.9

1 month ago

0.3.13

1 month ago

0.3.12

1 month ago

0.3.11

1 month ago

0.3.10

1 month ago

0.3.8

2 months ago

0.3.6

2 months ago

0.3.5

2 months ago

0.3.7

2 months ago

0.3.4

2 months ago

0.3.2

2 months ago

0.3.3

2 months ago

0.3.0

2 months ago

0.2.9

2 months ago

0.2.8

2 months ago

0.3.1

2 months ago

0.2.7

2 months ago

0.2.6

2 months ago

0.2.5

2 months ago

0.2.4

2 months ago

0.2.3

2 months ago

0.2.2

3 months ago

0.2.1

3 months ago

0.2.0

3 months ago

0.1.8

3 months ago

0.1.9

3 months ago

0.1.7

3 months ago

0.1.6

3 months ago

0.1.5

3 months ago

0.1.4

3 months ago

0.1.0

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.0.99

4 months ago

0.0.96

4 months ago

0.0.97

4 months ago

0.0.98

4 months ago

0.0.95

7 months ago

0.0.94

7 months ago

0.0.93

8 months ago

0.0.92

9 months ago

0.0.91

9 months ago

0.0.90

10 months ago