0.0.84 • Published 1 year ago

@benepass/icons v0.0.84

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@benepass/icons package

Icons library supported for mobile and web. NPM Package

Setup

# Install all dependencies
> yarn # or yarn workspace @benepass/icons install
# Generate icons
> yarn workspace @benepass/icons generate

Installation

Install the package from npm:

> yarn add @benepass/icons

Note: for web since we're using a monorepo you can use this directly importing from source code

Using react Native

For react-native there's some extra steps you'll need to follow:

  • Add @benepass/icons fonts folder
"assets": ["./path/to/lib/assets/fonts/"]

# Example
"assets": ["./node_modules/@benepass/icons/assets/fonts/"]
  • Link new benepass-font-icon font family
> npx react-native link # or just react-native link

Usage

For Mobile and Web the library will work, since react-native doesn't render SVG directly, there's a file (Icon.native.js) that will help and will render it.

:warning: Warning The import will change once we've the build process (now we're installing it directly from the source code, but in a future a "dist" folder will exist or something similar so the import will change.

From NPM

import { ArrowLeft } from '@benepass/icons'

const BestComponent = () => (
  <div>
	<ArrowLeft color="red" size="200px" />
  </div>
)

From workspace

import { ArrowLeft } from 'icons/src/components/Icon'

const BestComponent = () => (
  <div>
	<ArrowLeft color="red" size="200px" />
  </div>
)

Generate

Inside the scripts folder the generate-system.mjs file is the one in charge of generating the icons system this will generate everything for Mobile and Web.

To execute that file you can just run:

> yarn workspace @benepass/icons generate

This will map every icon inside the /assets/icons folder and create the font family for mobile and the icons-map file for web.

Publish

To publish a new version of the NPM package there's a github action that will run on a new tag creation if the new tag has this format: icons@x.x.x (example: icons@0.0.5). Don't forget to update the package.json version to match the new version before deploying, otherwise the script will break.

Design-Development

The main idea of this icon system is to have a single source of truth for both platforms (web and mobile) and to reduce design-development gap.

Flow

  1. Design Team publish new version on Figma
  2. Development Team export SVG from Figma
  3. Development Team upload SVGs into /assets folder
  4. New release on Github
  5. Upgrade @benepass/icons package on client

To Do

  • Create build script - Update github action - Update documentation - Import from build folder
  • Separate generate scripts (for mobile and web) - Create separated scripts
0.0.84

1 year ago

0.0.80

1 year ago

0.0.81

1 year ago

0.0.82

1 year ago

0.0.83

1 year ago

0.0.73

1 year ago

0.0.74

1 year ago

0.0.75

1 year ago

0.0.76

1 year ago

0.0.77

1 year ago

0.0.78

1 year ago

0.0.79

1 year ago

0.0.71

1 year ago

0.0.72

1 year ago

0.0.62

1 year ago

0.0.63

1 year ago

0.0.64

1 year ago

0.0.60

1 year ago

0.0.61

1 year ago

0.0.59

1 year ago

0.0.58

1 year ago

0.0.57

1 year ago

0.0.56

1 year ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.49

2 years ago

0.0.46

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.45

2 years ago

0.0.41

2 years ago

0.0.40

3 years ago

0.0.38

3 years ago

0.0.39

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.23

3 years ago

0.0.27

3 years ago

0.0.29

3 years ago

0.0.18

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.16

4 years ago

0.0.8

4 years ago

0.0.17

4 years ago

0.0.5

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago