2.0.0 • Published 7 years ago

jaak-primitives v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Primitives 🏗

UI primitives with predictable, unopinionated defaults and HTML-based semantics for scalable application architecture

Install

npm install jaak-primitives

Usage

import { Text } from 'jaak-primitives'

const Component = () => (
  <Text>Hello primitives!</Text>
)

Composition

Primitives can be extended at application-level and composed into React components.

import { Button, Text, View } from 'jaak-primitives'

// Extend primitives with custom attributes
const PrimaryButton = Button.extend`
  box-shadow: ${({ boxShadow }) => boxShadow};
`

// Change the HTML tag used to render a primitive
const AnchorButton = Button.withComponent('a')

// Compose library and application-level primitives
const Component = () => (
  <View>
    <Text color='primary'>
      I 💖 Primitives!
    </Text>

    <AnchorButton>
      I want to be an ⚓️
    </AnchorButton>

    <PrimaryButton boxShadow='4px 2px 4px black'>
      🏗
    </PrimaryButton>
  </View>
)

Theming

Generate a theme that can be used with styled-components <ThemeProvider>:

import { theme } from 'jaak-primitives'
import { ThemeProvider } from 'styled-components'

// Theme values can be customised - this is optional
const customTheme = {
  palette: {
    primary: '#AAAAAA',
  }
}

const Component = () => (
  <ThemeProvider theme={theme(customTheme)}>
    ...
  </ThemeProvider>
)

Contributing

Preview

npm run styleguide:start

Build

npm run build

Test

npm test
2.0.0

7 years ago

1.0.0-beta.11

7 years ago

1.0.0-beta.10

7 years ago

1.0.0-beta.9

7 years ago

1.0.0-beta.8

7 years ago

1.0.0-beta.7

7 years ago

1.0.0-beta.6

7 years ago

1.0.0-beta.5

7 years ago

1.0.0-beta.4

7 years ago

1.0.0-beta.3

7 years ago

1.0.0-beta.2

7 years ago

1.0.0-beta.1

7 years ago

1.0.0-beta

7 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago