npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dt-tokens

v1.0.6

Published

A CLI for converting Figma designs into React components with Material UI.

Downloads

55

Readme

DT-Tokens

start Version Downloads/week

App Overview

  • This CLI tool allows for components in Figma to be translated into design tokens.
  • These tokens can then be used to generate components in React for different UI libraries. Currently, Material UI is the only supported library.
  • This app currently generates a theme.ts, colors.ts, palette.ts, buttons.ts, typography.ts, and a React component for each icon.

Figma Setup

  • In order to run the app, you must have a personal access token for the Figma API. Click Here to generate a token.

  • Along with an access token, you will also need the unique file key for the Figma file you are using.

    • This key is provided in the file URL.
      • Example: https://www.figma.com/file/<File Key>/<File Name>
  • Duplicate the DeveloperTown template file from the Figma community.

  • The only page that is going to be read is the _tokens page. This is where you will fill out the "form" with styles used by the entire app.

  • Naming conventions are the key to the styles being transferred correctly.

    • Color naming: The naming standards come from Material UI and are in the form of Colors/[Palette Color]/[Color Variant]/[Color Name].
      • Options for Palette Color include Primary, Secondary, Global, Error, Success, Info, Warning, Grey, CTA
      • Example Color - Colors/Primary/Light/SkyBlue
    • Typography: The naming for typography follows Material UI standards.
      • Options for typography: h1, h2, h3, h4, h5, h6, subtitle1, subtitle2, body1, body2, caption, button, overline
    • Icons: Icons can be instances of a component or a frame inside Figma. Icons can have any name.
      • Example: help-circle-outline, pdf icon, download
    • Buttons: There are two types of buttons that are supported. The contained and outlined buttons from Material UI. The styles from the buttons will be places in the overrides section of the theme.ts file.

Usage

$ npm install -g dt-tokens
$ figma COMMAND
running command...
$ figma (-v|--version|version)
dt-tokens/1.0.5 darwin-x64 node-v14.15.0
$ figma --help [COMMAND]
USAGE
  $ figma COMMAND
...

Commands

figma start

EXAMPLE COMMAND
  $ figma start -k <Figma File Key> -t <Figma Access Token> --stylesPath <MUI file directory> --iconsPath <Icons file directory>

OPTIONS
  -h, --help                               show CLI help
  -i, --createIcons                        Use this flag to create React components for each icon
  -k, --figmaKey=figmaKey                  (required) Figma file key
  -m, --createMaterial                     Use this flag to create material files
  -n, --name=name                          name to print
  -t, --figmaAccessToken=figmaAccessToken  (required) Figma access token
  --iconsPath=iconsPath                    [default: /src/icons] File path for icons directory
  --stylesPath=stylesPath                  [default: /src/components/icons] File path for material styles directory