0.7.93 • Published 4 years ago

@ivoryio/kogaio v0.7.93

Weekly downloads
221
License
ISC
Repository
github
Last release
4 years ago

@ivoryio/kogaio

Introduction

Kogaio is an independent open source project, designed and tailored to fit the needs of Ivory based web applications.

Its primary concern is to expose for usage a set of primitive UI components, as well as to offer an opinionated solution for building and styling responsive web applications.

Documentation

Both the documentation and the structure of Kogaio are atomic design based; i.e. the purpose is to encourage, implicitly with examples, the substance of breaking the layout down into its basic components, which are then reused throughout the app.

Kogaio provides an inbuilt, assertive and extensible style guide, along with a continuously growing set of primitives and examples of their usage. It aims for sturdy design implementation, while soothing developers' front end development experience.

There are a few indispensable libraries that act as dependencies for Kogaio; their purposes vary, from documentation to extensibility to usability and painless development of responsive design systems.

Installation

npm i styled-components @ivoryio/kogaio

or

yarn add styled-components @ivoryio/kogaio

Configuration

Step 1

Extend your web application with Kogaio's buildTheme ^1

    import React from 'react'
    import { ThemeProvider } from 'styled-components'
    import { buildTheme } from '@ivoryio/kogaio'
    import App from 'path/to/App'

    const myCustomTheme = {
      colors: {
        brand: '#66bb6a',
        'brand-hover': '#4caf50',
        'brand-disabled': '#dfe9f2',
        'outline-hover': '#43a047',
        'outline-disabled': '#a5d6a7',
        error: '#ff7043',
        'error-hover': '#ff5722',
        alert: '#fbc02d',
        info: '#64b5f6',
        success: '#66bb6a'
      }
      {...}
    }

    const MyApp = ({ children }) => (
      <ThemeProvider theme={buildTheme(myCustomTheme)}>
        <App>{children}</App>
      </ThemeProvider>
    )

NOTE

Kogaio's fallback theme kicks in when no parameters are passed to buildTheme().

^1 buildTheme merges your custom theme with Kogaio's built-in theme.

Step 2

Plug and play!

   import React from 'react'
    import { Button, Card, Flex, Space, Typography } from '@ivoryio/kogaio'

    const MyScreen = () => (
      <Flex justifyContent='center'>
        <Space px={4} py={2}>
          <Card
            alignItems="center"
            variant='white'
            width={{ xs: 1, sm: 2 / 3, md: 3 / 4, lg: 1 / 3 }}
          >
          <Typography
            color='dark-gunmetal'
            fontWeight={3}
            textAlign='center'
            variant='h2'
          >
            Hello world!
          </Typography>
          <Button
            title="Say hello"
            width={1}
          />
          </Card>
        </Space>
      </Flex>
    )
The snippet below is a peek into the default theme.

For a painless experience with Kogaio, we do not encourage overwriting the entire theme.

Seek the comments below for recommendations.

  borders = [0, '1px solid', '2px solid', '3px solid', '4px solid']
  breakpoints = {
    xs: '20em',
    sm: '30em',
    md: '48em',
    lg: '80em',
    xlg: '120em'
  }
  colors = {
    // #region recommended for overwriting
    brand,
    'brand-hover',
    'brand-disabled',
    'outline-hover',
    'outline-disabled',
    error,
    'error-hover',
    alert,
    info,
    success,
    // #endregion
    white,
    'pale-white',
    'ghost-white',
    'white-smoke',
    'ice-white',
    'azure-white',
    'pastel-blue',
    'light-gray',
    manatee,
    'paynes-gray',
    independence,
    gunmetal,
    'dark-gunmetal',
    black
  }
  // #region recommended for overwriting
  colorStyles: {
    'menu-list': {
      boxShadow,
      backgroundColor
    },
    'modal': {
      'background-color'
    },
    'button-outline-alt': {
      color,
      border,
      '&:hover': {
        border
      }
    },
    'button-outline-dark': {
      color,
      border,
      '&:hover': {
        border
      }
    },
    overlay: {
      'background-color'
    }
  }
  fonts = {
    primary:
      'Rubik, sans-serif',
    complementary:
      '"Open+Sans", sans-serif'
  }
  // #endregion
  fontSizes = [
    '0.75rem',
    '0.875rem',
    '1rem',
    '1.25rem',
    '1.5rem',
    '2rem'
  ]
  fontWeights = { 'lighter': 300, 'regular': 400, 'bold': 700 }
  lineHeights = {
    solid: 1,
    title: 1.25,
    paragraph: 1.5,
    tooltip: 1.6,
    button: 1.9,
    input: 2,
    lineHeights: 2.5
  }
  letterSpacings = {
    normal: 'normal',
    tracked: '0.1em',
    tight: '-0.05em',
    mega: '0.25em'
  }
    radii = {
    none: 0,
    '1': 1,
    '2': 2,
    '3': 3,
    '4': 4,
    '8': 8,
    '16': 16,
    round: '50%'
  }
  space = [0, 4, 8, 12, 16, 20, 24, ..., 256]
  shadows: {
    'button-shadow',
    'input-basic',
    'card-simple',
    'card-highlight',
    'menu-list'
  }

Happy coding!

0.7.93

4 years ago

0.7.92

4 years ago

0.7.91

4 years ago

0.7.88

4 years ago

0.7.87

4 years ago

0.7.86

4 years ago

0.7.85

4 years ago

0.7.84

4 years ago

0.7.83

4 years ago

0.7.82

4 years ago

0.7.81

4 years ago

0.7.80

4 years ago

0.7.72

4 years ago

0.7.71

4 years ago

0.7.70

4 years ago

0.7.69

4 years ago

0.7.68

4 years ago

0.7.67

4 years ago

0.7.66

4 years ago

0.7.65

4 years ago

0.7.64

4 years ago

0.7.63

4 years ago

0.7.62

4 years ago

0.7.61

5 years ago

0.7.60

5 years ago

0.7.59

5 years ago

0.7.58

5 years ago

0.7.57

5 years ago

0.7.56

5 years ago

0.7.55

5 years ago

0.7.54

5 years ago

0.7.53

5 years ago

0.7.52

5 years ago

0.7.51

5 years ago

0.7.50

5 years ago

0.7.40

5 years ago

0.7.39

5 years ago

0.7.38

5 years ago

0.7.37

5 years ago

0.7.36

5 years ago

0.7.35

5 years ago

0.7.33

5 years ago

0.7.32

5 years ago

0.7.31

5 years ago

0.7.30

5 years ago

0.7.25

5 years ago

0.7.24

5 years ago

0.7.23

5 years ago

0.7.22

5 years ago

0.7.21

5 years ago

0.7.20

5 years ago

0.7.16

5 years ago

0.7.15

5 years ago

0.7.14

5 years ago

0.7.13

5 years ago

0.7.12

5 years ago

0.7.11

5 years ago

0.7.10

5 years ago

0.7.9

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.7

5 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.26

5 years ago

0.3.25

5 years ago

0.3.24

5 years ago

0.3.23

5 years ago

0.3.22

5 years ago

0.3.21

5 years ago

0.3.20

5 years ago

0.3.19

5 years ago

0.3.18

5 years ago

0.3.17

5 years ago

0.3.16

5 years ago

0.3.15

5 years ago

0.3.14

5 years ago

0.3.13

5 years ago

0.3.12

5 years ago

0.3.11

5 years ago

0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.0

5 years ago

0.3.1

5 years ago

0.2.21

5 years ago

0.2.20

5 years ago

0.2.18

5 years ago

0.2.17

5 years ago

0.2.16

5 years ago

0.2.14

5 years ago

0.2.15

5 years ago

0.2.13

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.99

5 years ago