# tv-shopping-lib-npm

> In order to include a new icon we have a script to process the icons that removes unnecesary attrs and creates a React Component from svgs.

Latest version **3.1.4** (published 2023-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install tv-shopping-lib-npm
pnpm add tv-shopping-lib-npm
yarn add tv-shopping-lib-npm
bun add tv-shopping-lib-npm
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.4 |
| Published | 2023-05-24 |
| First published | 2022-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.8 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | pacorampas, mancas, mirframai, arnaumarch |

## Links

- npm: https://www.npmjs.com/package/tv-shopping-lib-npm
- npm.io page: https://npm.io/package/tv-shopping-lib-npm

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) ^9.0.0
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.7
- [polished](https://npm.io/package/polished.md) ^4.2.2
- [classnames](https://npm.io/package/classnames.md) ^2.3.1

## Recent versions

- 3.1.4 (latest) — 2023-05-24
- 3.1.3 — 2023-05-24
- 3.1.2 — 2023-05-23
- 3.1.1 — 2023-05-22
- 3.1.0 — 2023-05-18
- 3.0.8 — 2023-05-16
- 3.0.7 — 2023-05-11
- 3.0.6 — 2023-04-10
- 3.0.5 — 2023-03-21
- 3.0.4 — 2023-03-21
- 3.0.3 — 2023-03-21
- 3.0.2 — 2023-03-21
- 3.0.1 — 2023-03-16
- 3.0.0 — 2023-03-14
- 2.1.7 — 2023-03-09
- … 52 more at https://npm.io/package/tv-shopping-lib-npm/versions

## README

# Adding icons

In order to include a new icon we have a script to process the icons that removes unnecesary attrs and creates a React Component from svgs.

The steps to add a new icons are:
0- Name your iconName.svg with a short and descriptive file name and remember to prefix it with `icon`. The file name is used to create the icons as React Components. So, later will be use to invoque the icon: `<IconName />` or `<Icon name="name">`
1- Add the new iconName.svg into /iconsRaw
2- Execute the script yarn icons
3- Now you are able to use the icon as:

```
import { Icon } from 'tv-shopping-lib-npm'
import { IconCart } from 'tv-shopping-lib-npm'

const Example = () => {
  return <>
    <Icon name="cart" />
    <IconCart />
  </>
}
```

# Components creation tips

- Naming interfaces convention: I(interface) + _name_(component, function, ...) + Props(optional in case of input function parameters). For instance:

```
interface IButtonProps {
  focused: boolean
  variant: keyof IVariants
  ...
}
```

- Naming Types convention: T(type) + _name_(component, function, prop name, ...).
  For example:

```
  type TSize = number | 'auto'
```

- To style a focused component, use in styles ':focus' selector like this:

```
const componentExample = styled.div`
  ...
  &:focus {
    background-color: red;
  }
`
```

or the class name '.la-focused' like this:

```
const componentExample = styled.div`
  ...
  &.la-focused {
    background-color: red;
  }
`
```

- Typescript + styled-components:

```
  interface TitleProps {
    readonly isActive: boolean;
  }

  const Title = styled.h1<TitleProps>`
    color: red;
  `;
```

---
_Source: https://npm.io/package/tv-shopping-lib-npm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
