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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gratio/ui

v0.0.15

Published

Пакет с простыми гибко кастомизируемыми компонентами.

Readme

Gratio UI Copmponents

Пакет с простыми гибко кастомизируемыми компонентами.

Разработка

Установите зависимости и запустите StyleGuide локально:

npm i
npm run dev

Откроется стайлгайд в котором можно сразу видеть изменения, которые вы внесёте в код. При необходимости правьте файл guide.tsx если хотите проверить как будет выглядеть тот или иной пропс компонентов.

После внесения изменений выполните build:

npm run build

Как использовать компоненты в проектах

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

Компоненты можно использовать напрямую без темы:

import { Button, Spinner } from '@gratio/ui';

const App = () => (
  <div>
    <Button onClick={() => {}}>Click me</Button>
    <Spinner size={30} />
  </div>
)

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

Все компоненты используют semantic colors из ThemeProvider. Оберните приложение в ThemeProvider для кастомизации:

import React from 'react';
import { ThemeProvider, Button } from '@gratio/ui';

// Светлая тема
const lightTheme = {
  background: {
    primary: '#83ec4a',    // Основной цвет (кнопки, активные элементы)
    secondary: '#f0f0f0',  // Вторичный фон
    tertiary: '#ffffff'    // Фон контейнеров
  },
  text: {
    primary: '#000000',    // Основной текст
    secondary: '#606060',  // Вторичный текст
    tertiary: '#999999'    // Tertiary текст (placeholders)
  },
  border: {
    primary: '#cccccc',    // Основные границы
    secondary: '#e0e0e0'   // Вторичные границы
  }
};

// Тёмная тема
const darkTheme = {
  background: {
    primary: '#2b67d1',
    secondary: '#1a3d5c',
    tertiary: '#0f2942'
  },
  text: {
    primary: '#ffffff',
    secondary: '#b8dcff',
    tertiary: '#8ab4db'
  },
  border: {
    primary: '#5ab0ff',
    secondary: '#3a5f7d'
  }
};

export function App() {
  return (
    <ThemeProvider theme={darkTheme}>
      <Button onClick={() => {}}>Themed Button</Button>
    </ThemeProvider>
  );
}

Как работают semantic colors

Каждый компонент использует семантические цвета из темы:

  • Button: background.primary + text.primary
  • Input: border.primary + text.primary
  • Checkbox: border.primary (unchecked), background.primary (checked)
  • Spinner: background.primary
  • Steps: активный - background.primary, неактивный - border.secondary
  • Tags: фон - background.secondary, выбранный - background.primary

Все свойства темы опциональны - если не указаны, используются дефолтные значения.