0.3.9 • Published 3 years ago

cubejs-uikit v0.3.9

Weekly downloads
16
License
MIT
Repository
github
Last release
3 years ago

Cube.js UI Kit

UI Kit for Cube.js website and other projects.

UI Kit is based on Numl Design System and injects it into the project.

To learn more about Numl+React integration read the documentation.

Showcase

Showcase is a playground to see all the components in one place. Also it's used to present a design system solutions.

Install dependencies:

$ npm i

Add CeraPro font to the src/assets/fonts folder:

  • CeraPro-Regular.woff2
  • CeraPro-Medium.woff2

Run showcase:

$ npm start

Integration

Install via npm:

npm install cubejs-uikit jsx-native-events --save-dev

For Gatsby projects

Add the following code to the gatsby-ssr.js file:

import React from "react";

export const onRenderBody = ({ setHeadComponents }) => {
    if (process.env.BUILD_STAGE === `build-html`) {
        const css = `
*:not(:defined) { visibility: hidden; }
@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Regular.woff2);
    font-weight: 300;
}

@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Regular.woff2);
    font-weight: 400;
}

@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Medium.woff2);
    font-weight: 500;
}

@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Medium.woff2);
    font-weight: 600;
}

@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Medium.woff2);
    font-weight: 700;
}
`;

        setHeadComponents([<style>{css}</style>]);
    }
}

Where ./assets/fonts/CeraPro-Medium.woff2 is a public path to CeraPro font.

For other projects

Include the following CSS in your application:

*:not(:defined) { visibility: hidden; }
@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Regular.woff2);
    font-weight: 300;
}

@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Regular.woff2);
    font-weight: 400;
}

@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Medium.woff2);
    font-weight: 500;
}

@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Medium.woff2);
    font-weight: 600;
}

@font-face {
    font-family: "CeraPro";
    src: url(./assets/fonts/CeraPro-Medium.woff2);
    font-weight: 700;
}

Where ./assets/fonts/CeraPro-Medium.woff2 is your local (or public) path to CeraPro font.

Usage

Import UI Kit to your React project:

// index.js / gatsby-browser.js for Gatsby
import UIKit from 'cubejs-uikit';

UIKit.init();

Either you can pass options to the init() method or/and subscribe to it.

UIKit.init({
  scheme: 'auto' // 'light' by default
}).then(() => {
  // UI Kit is initialized
});

Use simplified

Import UI Components to your application. It's required to use Root component to wrap your application.

import Root from 'cubejs-uikit/dist/Root';
import Topbar from 'cubejs-uikit/dist/Topbar';

export default function App() {
  return <Root>
    <Topbar/>
    <nu-block>Other content</nu-block>
  </Root>;
}

Available components

  • Root - A root component to wrap your application with.
  • Section - A section component.
  • Card - A card component.
  • Grid - A card component.

Available blocks

  • Topbar - A top bar component with a row of links.
  • Hero - A card block component.
  • Footer - A footer block component with copyright, links and "get in touch" section.
  • SubscriptionBlock - A subscription block. A simple form to subscribe user to our updates.
  • CardBlock - A card block.
  • FeatureBlock - A block with feature list.
  • SmallSignUpCard - A small signup card block with dark background.
  • BigSignUpCard - A big signup card block with white background.
  • SwitchBlock - A block with button group to switch sections each with text and image.

Contribution

Add new component/block

  • Add a new file {ComponentName}.jsx in src/components folder with your component.
  • Add a new line to list.js file in the root with component name.
  • Add an example of usage to the Showcase component in src/showcase/index.jsx.
  • Add a new line to the Available components section.
  • Add a documentation docs/${ComponentName}.md file for the component.

Run showcase and test your work

$ npm start

Then navigate to https://localhost:1234/ in your browser to open Showcase.

Create pull request

Commit your work to the new branch and create pull request.

0.3.9

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.0

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.29

3 years ago

0.1.28

3 years ago

0.1.27

3 years ago

0.1.26

4 years ago

0.1.25

4 years ago

0.1.24

4 years ago

0.1.23

4 years ago

0.1.22

4 years ago

0.1.21

4 years ago

0.1.20

4 years ago

0.1.19

4 years ago

0.1.18

4 years ago

0.1.17

4 years ago

0.1.16

4 years ago

0.1.14

4 years ago

0.1.15

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.10

4 years ago

0.1.11

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.59

4 years ago

0.0.57

4 years ago

0.0.56

4 years ago

0.0.54

4 years ago

0.0.55

4 years ago

0.0.53

4 years ago

0.0.52

4 years ago

0.0.51

4 years ago

0.0.50

4 years ago

0.0.48

4 years ago

0.0.49

4 years ago

0.0.47

4 years ago

0.0.46

4 years ago

0.0.45

4 years ago

0.0.44

4 years ago

0.0.43

4 years ago

0.0.41

4 years ago

0.0.42

4 years ago

0.0.40

4 years ago

0.0.39

4 years ago

0.0.38

4 years ago

0.0.37

4 years ago

0.0.36

4 years ago

0.0.35

4 years ago

0.0.32

4 years ago

0.0.33

4 years ago

0.0.34

4 years ago

0.0.31

4 years ago

0.0.30

4 years ago

0.0.29

4 years ago

0.0.28

4 years ago

0.0.27

4 years ago

0.0.26

4 years ago

0.0.25

4 years ago

0.0.23

4 years ago

0.0.24

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.17

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago