2.19.1 • Published 8 days ago

@open-condo/ui v2.19.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 days ago

@open-condo/ui NPM

A set of React UI components for developing applications inside the condo ecosystem

Table of contents

Installation\ Usage\ Including styles\ Access theme colors\ Style-variables\ Hooks

Installation

To install package simply run the following command if you're using npm as your package manager:

npm i @open-condo/ui

or it's yarn alternative

yarn add @open-condo/ui

Usage

You can import needed component with its props directly from package entry point like this:

import { Button } from '@open-condo/ui'
import type { ButtonProps } from '@open-condo/ui'

Including styles

To apply the styles, import the css file from library dist into your project root component:

import '@open-condo/ui/dist/styles.min.css'

Access theme colors

You can also directly access to all our theme colors by specifying import sub path like this:

import { colors } from '@open-condo/ui/colors'
import type { ColorPalette } from '@open-condo/ui/colors'

Style variables

Style tokens are available for import as well:

  • CSS Variables:
import '@open-condo/ui/style-vars/css'
  • Less Variables
@import (reference) "@open-condo/ui/style-vars/less";
@import (reference) "@open-condo/ui/dist/style-vars/variables.less";

Hooks

Hooks can be imported as follows:

import { useBreakpoints, useContainerSize } from '@open-condo/ui/hooks';
  • useBreakpoints - returns the breakpoint object and its current value. Breakpoint value becomes true if the window width is greater than or equal to the corresponding breakpoint. The name and width of the breakpoints:
    • MOBILE_SMALL (0px)
    • MOBILE_LARGE (360px)
    • TABLET_SMALL (480px)
    • TABLET_LARGE (768px)
    • DESKTOP_SMALL (992px)
    • DESKTOP_LARGE (1200px)
const breakpoints = useBreakpoints()

// window width >= 480px and < 992px
const isTablet = breakpoints.TABLET_SMALL && !breakpoints.DESKTOP_SMALL
  • useContainerSize provides the dimensions of a specific container.
const [{ width, height }, setRef] = useContainerSize()

console.log(width, height)

return <div ref={setRef} />
2.19.1

8 days ago

2.19.0

19 days ago

2.18.0

20 days ago

2.17.1

1 month ago

2.17.0

2 months ago

2.16.1

2 months ago

2.16.0

2 months ago

2.15.1

2 months ago

2.15.0

3 months ago

2.14.0

3 months ago

2.13.1

3 months ago

2.13.0

3 months ago

2.12.0

4 months ago

2.11.0

4 months ago

2.10.1

5 months ago

2.10.0

6 months ago

2.4.0

10 months ago

2.6.1

10 months ago

2.2.5

11 months ago

2.6.0

10 months ago

2.6.3

9 months ago

2.8.0

8 months ago

2.6.2

9 months ago

2.3.0

11 months ago

2.5.0

10 months ago

2.3.2

10 months ago

2.3.1

10 months ago

2.7.0

8 months ago

2.3.4

10 months ago

2.3.3

10 months ago

2.9.0

7 months ago

2.6.5

9 months ago

2.6.4

9 months ago

2.6.6

9 months ago

2.2.4

11 months ago

2.2.1

1 year ago

2.2.0

1 year ago

2.2.3

11 months ago

2.2.2

11 months ago

2.0.1

1 year ago

2.0.0

1 year ago

1.32.1

1 year ago

2.1.0

1 year ago

1.21.0

1 year ago

1.25.0

1 year ago

1.23.0

1 year ago

1.23.1

1 year ago

1.29.0

1 year ago

1.27.2

1 year ago

1.27.0

1 year ago

1.27.1

1 year ago

1.32.0

1 year ago

1.30.0

1 year ago

1.30.1

1 year ago

1.22.0

1 year ago

1.24.1

1 year ago

1.26.0

1 year ago

1.20.3

1 year ago

1.24.0

1 year ago

1.20.4

1 year ago

1.28.1

1 year ago

1.26.1

1 year ago

1.28.0

1 year ago

1.26.2

1 year ago

1.31.0

1 year ago

1.16.0

1 year ago

1.18.2

1 year ago

1.20.1

1 year ago

1.20.2

1 year ago

1.20.0

1 year ago

1.15.0

1 year ago

1.13.2

1 year ago

1.12.3

1 year ago

1.14.0

1 year ago

1.13.1

1 year ago

1.12.2

1 year ago

1.11.3

1 year ago

1.13.0

1 year ago

1.12.1

1 year ago

1.11.2

1 year ago

1.12.0

1 year ago

1.11.1

1 year ago

1.9.0

1 year ago

1.8.0

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.11.0

1 year ago

1.10.0

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago