@tdcerhverv/parrotfish

3.3.9 • Public • Published

Parrotfish

IMPORTANT NOTE: dist is part of the repo to have control over what icons are being build with what version of parrotfish, see 2. Versioning strategy

Builds ready-to-use react components and svg files directly from figma.

Uses figma api: https://www.figma.com/developers/docs.

Build assets using npm run generate-all - will auto-generate svg files and react component from figma.

Pushing to master is not allowed; please create a branch.

Be sure to follow steps

  1. UI Upgrades
  2. Versioning strategy for any new additions and create a pull-request on github against the master branch.

Questions? Reach out to:

UI Upgrades (for adding new icons / colors, or changing existing)

In case of UI Upgrades started in UX Chapter (such as new CVI), the following describe the process for bumping new versions of design tokens:

  • Make sure the Figma page ids are passed correctly in all necessary generateDesignToken(SourceFigmaPages, DesignTokens); the parameters are controlled by enums found in ./enums/*.enums.ts
  • npm run generate-all or npm run generate-colors or npm run generate-icons
  • npm version major, commit and push in order to trigger auto-publish; then npm install @tdc-packages/parrotfish@x.x.x the new version you just created in your project.

Need help debugging? See debug section

Versioning strategy

This package is NOT using semver conventions, due to the need of versioning both code & assets. Therefore, use these guidelines when applying npm version <versionType>:

  • major: UX chapter specifically names a CVI-version (optional) and changes all assets entirely
  • minor: breaking code changes
  • patch: new icon added / new color added in Figma

!! Please update the ./packages/parrotfish/CHANGELOG.md with all changes referred above.

Debug

PREREQUISITES: follow Figma's authentication guide and once you've got a developer access token, add it to your environment variables, mapped to FIGMA_TOKEN

  • npm run generate-all if all design-tokens have changed and check if the generated assets look correct.
  • Fragmented approach: (see package.json/scripts)
    • npm run generate-colors for fetching new colors from figma;
    • npm run generate-icons for fetching new icons from figma;
    • npm run generate-react-icons for generating react components from icons from figma;

Usage

Install via npm i @tdcerhverv/parrotfish;

Please note using the SVG icons requires you to have something like @svgr/parcel-plugin-svgr (>= 4.x) installed, if you are using Parceljs of course. 😉

React Component Icon example:

import AccountNumber from '@tdcerhverv/parrotfish/icons/AccountNumber';

SVG icon example

import Account_number from '@tdcerhverv/parrotfish/dist/icons/Icons/Account_number.svg';

Design tokens

  • SCSS color variables:
    • using GET: https://api.figma.com/v1/files/FIGMA-COLOR-FILE-ID
    • color pages:
      • master 1.5: CWDhhHgxEb7AEQFKl56RHGvt
      • developer + ux signoff color page ID: Xx1z0Lcl7j8JhXwFLTU3sdbB << currently in use
    • should be imported from dist/colors-design-token.scss
    • format: $color-cerulean-blue-40: rgba(255, 0, 130, 1);
    • theme format (recommended): map-get('primary', $theme);
  • TS color variables:
    • using GET: https://api.figma.com/v1/files/FIGMA-COLOR-FILE-ID
    • color pages:
      • master 1.5: CWDhhHgxEb7AEQFKl56RHGvt
      • developer + ux signoff color page ID: Xx1z0Lcl7j8JhXwFLTU3sdbB << currently in use
    • should be imported from dist/colors-design-token.ts
    • format: theme.primaryLight: '#2d80d3'
    • colorsMap exported as default. keys are formatted with camelCase (example: primary-light -> primaryLight)
  • Icon SVG:

Package Sidebar

Install

npm i @tdcerhverv/parrotfish

Weekly Downloads

306

Version

3.3.9

License

MIT

Unpacked Size

1.85 MB

Total Files

1282

Last publish

Collaborators

  • antongb
  • dev_jonas
  • jeppebenjaminsen
  • ahhah
  • abdok
  • mikkv
  • clausr1990
  • tdc-sigbe
  • mdige
  • nuudaybot
  • tdc-olila
  • jeroen.dk.nl
  • renand
  • stegr
  • m84100
  • m92212
  • m87979
  • vertic
  • rasladev
  • muddz
  • tajsonik
  • linnt
  • molg