1.3.7 • Published 4 years ago

@unicorndesign/react v1.3.7

Weekly downloads
93
License
MIT
Repository
github
Last release
4 years ago

🦄 Unicorn React

Built With Stencil Core CI Status

Unicorn Design System is an open source design system built at UNICEF New Zealand. We've built it with web components and stencil to ensure it works between frameworks.

Getting Started

This package is a thin React layer for our web components. Each component is only responsible for passing React data & events down to the underlying element.

If you're not using React, check out the core library.

Unicorn requires a global stylesheet to be loaded (for global typography and color vars,) documentation for this is a work in progress. For now, please make sure it's loaded.

To install the library:

npm install @unicorndesign/core @unicorndesign/react

As of version 1.1, you no longer need to load Unicorn yourself, components are defined when you import them from this package.

However, you will still need to define a theme and global styles:

import '@unicorndesign/core/theming/prebuilt/default.css';

// OR
<link rel="stylesheet" href="https://unpkg.com/@unicorndesign/core@1.0.0/theming/prebuilt/default.css">

Polyfills are not included by default, but the legacy loader exposes an applyPolyfills method:

import { applyPolyfills } from '@unicorndesign/core/loader';

// Optional, depending on your browser targets 
await applyPolyfills();

Done! You're ready to use Unicorn.

import React from 'react';
import { UniButton } from '@unicorndesign/react/UniButton';

export default () => (
  <UniButton icon>🦄</UniButton>
);

Development notes

If you npm link this package into another app, you will encounter react hook errors, because your app's react is a separate instance to the one this uses. The fix:

# Link the react here to the target's react. This is
# roughly how it would behave as a peer-dependency
npm link ~/consumer-app/node_modules/react
npm link ~/consumer-app/node_modules/react-dom
1.3.7

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.1-beta.1

4 years ago

1.3.1-beta.0

4 years ago

1.3.0

4 years ago

1.3.0-beta.0

4 years ago

1.2.4

4 years ago

1.2.4-beta.1

4 years ago

1.2.4-beta.3

4 years ago

1.2.4-beta.2

4 years ago

1.2.4-beta.0

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.2-beta.4

5 years ago

1.2.2-beta.3

5 years ago

1.2.2-beta.2

5 years ago

1.2.2-beta.1

5 years ago

1.2.2-beta.0

5 years ago

1.2.1-beta.0

5 years ago

1.2.0

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6-beta.5

5 years ago

1.0.6-beta.4

5 years ago

1.0.6-beta.3

5 years ago

1.0.6-beta.2

5 years ago

1.0.6-beta.1

5 years ago

1.0.6-beta.0

5 years ago

1.0.5

5 years ago

1.0.4-beta.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago