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

rbs-react-ui-components

v1.1.8

Published

React component set for develope inner system

Downloads

18

Readme

Набор React-компонентов для внутренней разработки РБС

Установка

npm install --save-dev rbs-react-ui-components

Использование

Для использования иконок нужно подключить шрифты с иконками из библиотеки.

import icomoonTtf from 'rbs-react-ui-components/Icon/icomoon/icomoon.ttf';
import icomoonWoff from 'rbs-react-ui-components/Icon/icomoon/icomoon.woff';
import icomoonSvg from 'rbs-react-ui-components/Icon/icomoon/icomoon.svg';

Для компонентов предусмотрена частичная темизация (изменение базовых цветов, обводок, размеров), основанная на ThemeProvider из библиотеки styled-components https://www.styled-components.com/docs/advanced#theming. Основные параметры описаны в src/components/core/themes/base.js. Свойствами темы является обычный объект, его можно расширять и изменять, перезаписывая текущие значения. Например, изменение базовой палитры и частичное изменение размеров тултипа:

const theme = {
  global: {
    accentColors: {
      default: 'blue',
      action: 'orange',
      negative: 'red',
      positive: 'green',
    },
  },
  tooltip: {
    sizes: {
      s: {
        fontSize: '10px',
        padding: '6px 10px',
      },
      m: {
        fontSize: '16px',
        padding: '12px 14px',
      },
    },
  },
}
import React, { Fragment } from 'react'
import { createGlobalStyle } from 'styled-components'

import { Theme } from 'rbs-react-ui-components'
import Button from 'rbs-react-ui-components/Button'

import robotoRegular from '*/fonts/font_roboto_regular.ttf'
import robotoThin from '*/fonts/font_roboto_thin.ttf'
import robotoLight from '*/fonts/font_roboto_light.ttf'
import robotoMedium from '*/fonts/font_roboto_medium.ttf'

import icomoonTtf from 'rbs-react-ui-components/Icon/icomoon/icomoon.ttf';
import icomoonWoff from 'rbs-react-ui-components/Icon/icomoon/icomoon.woff';
import icomoonSvg from 'rbs-react-ui-components/Icon/icomoon/icomoon.svg';

const GlobalStyle = createGlobalStyle`
  @font-face {
    font-family: 'rbsOldIcons';
    src:
      url('${icomoonTtf}?yct89m') format('truetype'),
      url('${icomoonWoff}?yct89m') format('woff'),
      url('${icomoonSvg}?yct89m#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
  }

  @font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100;
    src: url(${robotoThin});
  }

  @font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    src: url(${robotoLight});
  }

  @font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    src: url(${robotoRegular});
  }

  @font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    src: url(${robotoMedium});
  }
`

const theme = {
  global: {
    accentColors: {
      default: 'blue',
      action: 'orange',
      negative: 'red',
      positive: 'green',
    },
  },
  tooltip: {
    sizes: {
      s: {
        fontSize: '10px',
        padding: '6px 10px',
      },
      m: {
        fontSize: '16px',
        padding: '12px 14px',
      },
    },
  },
};

export const App = () => (
  <Theme theme={theme}>
    <Fragment>
      <GlobalStyle />
      <div>
        <h2>Welcome to React</h2>
        <Button />
      </div>
    </Fragment>
  </Theme>
)