# ⛔ DEPRECATED ⛔
## Use [Foundation UI](https://github.com/extenda/react-foundation-ui) instead
# Synergy-Ui

Synergy-ui is a component library that implements extendas synergy design system. The components can be seen in [Storybook](https://storybooks.retailsvc.dev/synergy-ui/refs/heads/master/index.html)

## Installation

Synergy-Ui is available as an [npm package](https://www.npmjs.com/package/@hiiretail/synergy-ui)

`npm install @hiiretail/synergy-ui`

## Getting started

To start working with the library create a theme using the `createTheme()` function.

Parameter `spacingUnit` is used as a minimal measure in pixels for spacing in the application. By default, it's set to 4px

```react
const myTheme = createTheme({spacingUnit: 2});
```

Theme object contains the following fields:

- `spacing` is a function that takes a `multiplier` param and returns the actual spacing by multiplying `spacingUnit` and `multiplier`
- `breakpoints` - an object containing a set of breakpoints to handle responsiveness
- `media` - an object containing 3 helper functions: `between`, `greaterThan` and `lessThan`. These functions take breakpoints as parameters and return a media query.

```react
const SyledDiv = styled.div`
  border-radius: ${(props) => props.theme.spacing(1)}px;
`;
```

## Our approach to CSS

Synergy-Ui is aimed at reducing the amount of CSS code needed to build an application. We use [styled-components](https://styled-components.com/) to provide isolated CSS styling for components.
For that purpose, the library provides layout components (`Flexbox`, `CssGrid` and `Box`) with intuitive APIs to avoid a scenario when developers implement their layouts using `div`s and CSS classes, keeping the code clean and readable.
All components are still **customizable** via `ClassName`, allowing changing of look and feel.

## Responsiveness

[`Media`](https://storybooks.retailsvc.dev/synergy-ui/refs/heads/master/index.html?path=/story/utilities-media--basic-usage) component and [`useMedia`](https://storybooks.retailsvc.dev/synergy-ui/refs/heads/master/index.html?path=/story/utilities-media--hook-usage) hook handle responsiveness. Use `theme.breakpoints` and `theme.media` to simplify your work.

## Contributing

The source code is available on [GitHub](https://github.com/extenda/synergy-ui).

If you found a bug or see some space for improvement feel free to submit a pull request.

## Docs

You can find docs for each component in the docs tab in [Storybook](https://storybooks.retailsvc.dev/synergy-ui/refs/heads/master/index.html).
