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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kaspersky/hexa-ui-core

v0.9.12

Published

Tokens for Kaspersky Hexa UI Design system: colors, fonts and typography

Readme

Hexa UI Core

Пакет дизайн-системы Hexa UI. Разделен на три домена: шрифты, токены типографии, токены цветов.



Установка

npm install @kaspersky/hexa-ui-core

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

Шрифты

import '@kaspersky/hexa-ui-core/fonts'

На странице создается элемент <style class="hexa-ui-fonts"></style>, в котором определены источники шрифтов.

При SSR подключение шрифтов происходит следующим образом:

import '@kaspersky/hexa-ui-core/fonts/tokens.css'

Токены типографии

import '@kaspersky/hexa-ui-core/typography/css'

На странице создается элемент <style class="hexa-ui-typography"></style>, в котором определены css-variables для токенов типографии.

import { typography }  from '@kaspersky/hexa-ui-core/typography/js'

Экспортируемые объекты и типы:

  • typography - объект с токенами типографии
  • Typography - тип токенов типографии

При SSR подключение токенов типографии происходит следующим образом:

import '@kaspersky/hexa-ui-core/typography/tokens.css'

Токены цветов

import '@kaspersky/hexa-ui-core/colors/css'

На странице создается элемент <style class="hexa-ui-colors"></style>, в котором определены css-variables для токенов цветов.

import '@kaspersky/hexa-ui-core/colors/css/components/static'
import '@kaspersky/hexa-ui-core/colors/css/components/button'

На странице создается элемент <style class="hexa-ui-colors-static"></style>, в котором определены css-variables для токенов цветов из статической палитры, а также элемент <style class="hexa-ui-colors-button"></style>, в котором определены css-variables для токенов цветов конкретного компонента (в примере - button).

ВАЖНО

Возможность подключать токены цветов конкретного компонента уменьшает итоговый размер бандла, но при таком подходе важно всегда импортировать статические цвета, так как переменные для компонентов на них ссылаются.

import { colors }  from '@kaspersky/hexa-ui-core/colors/js'

Экспортируемые объекты:

  • colors - цвета из статической базовой палитры (в том числе устаревшей)
  • productColors - цвета, имеющие пару в темной теме, предназначены для продуктовых команд для раскраски некоторых компонентов (например, иконок) и всего, что не является компонентом
  • componentColors - цвета, имеющие пару в темной теме, предназначены для раскраски компонентов библиотеки
  • themeColors - устаревшие цвета, имеющие пару в темной теме
  • allColors - colors + themeColors + productColors + componentColors
  • shortcutsV6 (устаревшие), productColorsShortcuts, componentColorsShortcuts - цвета, имеющие пару в темной теме (другая структура объекта)
  • shortcuts - productColorsShortcuts + componentColorsShortcuts + shortcutsV6

При SSR подключение токенов цветов происходит следующим образом:

import '@kaspersky/hexa-ui-core/colors/tokens.css'

Сборка пакета

npm run build

В корне пакета создается директория /dist со сборкой пакета в двух основных форматах: CommonJS и ESM.

Обновление токенов (for maintainers)

npm run update-colors
npm run update-typography

Команда update-colors обновляет токены цветов в пакете: создает новую палитру цветов по импортированным токенам из Figma в формате JSON, генерирует css-variables для токенов.

Команда update-typography обновляет токены типографии в пакете: генерирует JSON-файл с токенами типографии, генерирует css-variables для токенов.

Ресурсы

Hexa UI Core в Figma