1.1.0 • Published 5 years ago

@nib-components/prototype v1.1.0

Weekly downloads
3
License
-
Repository
-
Last release
5 years ago

@nib-components/prototype

A single script and style bundle for rapid prototyping. Includes react, react-dom and almost all our components.

Caution: NEVER use it in a real application!

Using it in production will add a lot of unnecessary bloat to your app and result in sub-optimal page-load times.

Usage

CodePen

Create a new CodePen from our template CodePen.

Roll-your-own

<html class="flexbox">
  <head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>nib Prototype</title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,800|Roboto:300,400,700"/>
  </head>
  <body>
    <div id="app"/>
    <script src="https://unpkg.com/@nib-components/prototype/dist/prototype.js"></script>
    <script type="text/babel">
      ReactDOM.render(
        <Padding all={6}>
          <Heading size={1}>Hello World!</Heading>
          <Margin top={3}>
            <PrimaryButton>Click me!</Button>
          </Margin>
        </Padding>,
        document.getElementById('app')
      );
    </script>
  </body>
</html>

Packages that have a single default export will be accessible on the window using their display name e.g. @nib-components/heading will be accessible via window.Heading (or just Heading)

Packages that do not have a single default export will be accessible on the window using their package name and will require a little extra effort to use with react e.g. @nib-components/table will be accessible via window.table (or just table and usable like:

const {Table, Row, Cell} = table;
<Table>...</Table>

Updating

When changes have been made to any of the components in the DLS, or a new component has been added to the DLS, this repo will require updating. To update this repo:

  1. Install the latest versions of all the DLS components

    npm-check -u is a helpful utility for updating package versions

    Make sure you save the updated versions in package.json

  2. Edit the version in package.json and increase the minor version

    Bumping the minor version also means resetting the patch version e.g. 0.2.3 to 0.3.0

  3. Commit and push your changes
  4. Run npm publish
  5. Update the template CodePen to use the most recently published version of this package from unpkg.com
  • Settings > JavaScript and update the version number in the URL

    Use the exact version number so existing CodePens will continue working regardless of recent breaking changes.

Change log

1.1.0

  • update - bump all components to use monorepo components.

1.0.0

  • update - remove css dependency and bump all components to use styled-components versions.