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

isp-admin-ui-kit

v1.6.0

Published

`isp-admin-ui-kit` — это компонент базовой админ-панели для использования в других проектах.

Downloads

751

Readme

isp-admin-ui-kit

isp-admin-ui-kit — это компонент базовой админ-панели для использования в других проектах.


📆 Установка и сборка

Установка зависимостей

npm install

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

npm run build

🚀 Установка библиотеки в проект

npm install isp-admin-ui-kit

Дополнительные библиотеки, необходимые для работы

npm install @monaco-editor/react antd axios dayjs monaco-editor react react-dom react-hook-form react-router-dom react-redux @reduxjs/toolkit

Версии зависимостей:

@monaco-editor/react ^4.6.0
antd >=5.12.2
axios ^1.7.7
dayjs ^1.11.10
monaco-editor ^0.52.0
react >=18.2.0
react-dom >=18.2.0
react-hook-form ^7.54.0
react-router-dom ^6.22.3
react-redux ^9.1.0
@reduxjs/toolkit ^2.2.3

🧹 Подключение базового хранилища (store)

import { baseSetupStore } from 'isp-admin-ui-kit';
import { Provider } from 'react-redux';
import AdminBase from 'isp-admin-ui-kit';

const store = baseSetupStore();

<Provider store={store}>
  <AdminBase/>
</Provider>;

Интеграция с кастомным стором

baseSetupStore принимает параметр apiServices для подключения пользовательских редьюсеров и RTK Query сервисов:

const apiServices = {
  modulesServiceApi,
  UIReducer,
};

const store = baseSetupStore(apiServices);

🎨 Подключение темы

Библиотека использует тему Ant Design. Вы можете передать дополнительные параметры в ConfigProvider через проп configProviderProps:

<AdminBase configProviderProps={{ theme: lightTheme, locale: eng }}/>

🗺 Настройка маршрутов (роутеров)

Компонент AdminBase поддерживает кастомную маршрутизацию через параметр customRouters.

⚠️ Для корректной работы пунктов меню route и key должны совпадать!

Структура объекта маршрута (customRouters)

| Название | Тип | Описание | |-----------------|-------------|------------------------------------------------| | route * | string | Путь маршрута | | element * | ReactNode | Компонент, отображаемый по маршруту | | label | string | Название маршрута (текст в меню) | | key | string | Уникальный ключ маршрута (используется в меню) | | permissions | string[] | Список разрешений для доступа к маршруту | | icon * | ReactNode | Иконка маршрута | | children * | Array | Вложенные маршруты | | className * | string | Класс для оформления пункта меню |

Пример:

const customRouters = [
  {
    route: '/dashboard',
    element: <Dashboard/>,
    label: 'Dashboard',
    key: 'dashboard',
    permissions: ['admin', 'user'],
    icon: <DashboardIcon/>,
    className: 'red-menu',
  },
];

🗺 Скрытие базовых страниц

Компонент AdminBase поддерживает параметр excludePermissions: массив с пермишенами, страницы по которым необходимо скрыть, сами пермишены можно получить через импорт PermissionKeysType из библиотеки

Пример использования:

import { PermissionKeysType } from 'isp-admin-ui-kit'
const excludePermissions = [PermissionKeysType.user_view, PermissionKeysType.session_view]

  < AdminBase
excludePermissions = { excludePermissions }
/>;

🧱 Параметры компонента AdminBase

Вы можете использовать AdminBase с разными параметрами:

| Название | Описание | Пример | |-----------------------|---------------------------------------------------------------------|----------------------------------------------------------| | customRouters | Массив объектов маршрутов | customRouters={[{ route, element, label, key, ... }]} | | configProviderProps | Пропсы для ConfigProvider из библиотеки antd | configProviderProps={{ theme: lightTheme, locale: ru }} | | defaultRoutePath | Путь, на который будет редирект при открытии / (главной страницы) | defaultRoutePath="/modules" | | excludePermissions | Массив пермишенов (PermissionKeysType) для сокрытия | excludePermissions={[PermissionKeysType.user_view, ...]} |

Пример использования:

<AdminBase
  customRouters={customRouters}
  configProviderProps={{ theme: lightTheme, locale: ru }}
  defaultRoutePath="/dashboard"
  excludePermissions={excludePermissions}
/>;

📋 Обновление версии

Чтобы обновить версию пакета:

  1. Обновите значение version в package.json.
  2. Добавьте соответствующую запись в CHANGELOG.md.