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

@adilhammad/el-magico-ui

v1.0.6

Published

El Magico UI - A powerful multi-brand theming system for React applications, built on Chakra UI v3.

Readme

XLP-UI

XLP-UI is a multi-brand React component library and theming system built on Chakra UI v3.

It is designed for white-label and microfrontend use cases where each host application can switch brands, inject token overrides, and consume a shared set of themed UI primitives without coupling components to raw design values.

Features

  • Multi-brand token architecture: BrandTokens -> Semantic Tokens -> Component Recipes
  • React 19 and strict TypeScript support
  • Chakra UI v3 system-based theme generation
  • Runtime brand registration with registerBrand()
  • Provider-based theme isolation for microfrontends
  • Prebuilt themed components for common form and action patterns

Package

  • Package name: @adil-hammad-xelops/el-magico-ui
  • Module output: ESM and CJS
  • Types: bundled in dist/index.d.ts

Installation

npm install @adil-hammad-xelops/el-magico-ui

Peer dependencies:

  • react >= 19
  • react-dom >= 19
  • @chakra-ui/react >= 3
  • @emotion/react >= 11
  • @tanstack/react-query >= 5

Quick Start

Wrap your app with RootProvider when you want both theming and React Query wiring:

import { createRoot } from "react-dom/client"
import { RootProvider, XlpButton } from "@adil-hammad-xelops/el-magico-ui"

function App() {
  return <XlpButton>Click me</XlpButton>
}

createRoot(document.getElementById("root")!).render(
  <RootProvider brandId="default">
    <App />
  </RootProvider>,
)

If you only want the theme layer, use AppThemeProvider directly:

import { AppThemeProvider } from "@adil-hammad-xelops/el-magico-ui"

export function AppShell() {
  return <AppThemeProvider brandId="meridian">...</AppThemeProvider>
}

Built-in Brands

The library currently exposes these built-in token sets:

  • default
  • brandA
  • brandB
  • meridian

You can inspect the current registry through getRegisteredBrands().

Public API

Main exports from src/index.ts:

  • Providers: RootProvider, AppThemeProvider
  • Theme utilities: useTheme, registerBrand, resolveBrandTokens, getRegisteredBrands, createTheme
  • Built-in token sets: defaultTokens, brandATokens, brandBTokens, meridianTokens
  • Components: XlpButton, XlpInput, XlpTextarea, XlpSelect, XlpSwitch, XlpRadioGroup
  • Theme/domain types: BrandTokens, ThemeContextValue, ColorScale, and shared app types from src/types

Theme Architecture

This repository enforces a strict separation of concerns:

  1. src/theme/brands/*/tokens.ts Raw brand values only.
  2. src/theme/semantic/* Stable semantic abstractions generated from brand tokens.
  3. src/theme/components/* Chakra recipes that consume semantic tokens only.

Rules:

  • Do not hardcode colors, spacing, radii, or border widths in components.
  • Do not bypass semantic tokens from component recipes.
  • Brand-specific changes should happen in token files first.

Custom Brands

Register a custom brand before mounting the provider:

import {
  registerBrand,
  RootProvider,
  type BrandTokens,
} from "@adil-hammad-xelops/xelops-ui"

const acmeTokens: BrandTokens = {
  // full token object
} as const

registerBrand("acme", acmeTokens)

export function Root() {
  return <RootProvider brandId="acme">...</RootProvider>
}

You can also supply partial runtime overrides:

import { useMemo } from "react"
import { RootProvider, type BrandTokens } from "@adil-hammad-xelops/el-magico-ui"

export function Root() {
  const tokenOverrides = useMemo<Partial<BrandTokens>>(
    () => ({
      radii: { md: "1rem" },
    }),
    [],
  )

  return (
    <RootProvider brandId="default" tokenOverrides={tokenOverrides}>
      ...
    </RootProvider>
  )
}

Components

Available base components:

  • XlpButton
  • XlpInput
  • XlpTextarea
  • XlpSelect
  • XlpSwitch
  • XlpRadioGroup

These components are theme-aware and intended to be consumed instead of raw Chakra components in feature code.

Development

Scripts:

  • npm run dev - start the Vite dev server
  • npm run build - build types and library bundles
  • npm run build:types - emit declaration files only
  • npm run preview - preview the Vite build locally

Project Structure

src/
  components/
  providers/
  theme/
    brands/
    components/
    semantic/
    context.tsx
    createTheme.ts
    index.ts
    provider.tsx
    registry.ts
    types.ts
  types/

Design Token Translation

This repo also contains internal agent/skill workflows for translating Figma token exports into the BrandTokens model.

Relevant repo assets:

  • .github/skills/figma-token-theme-translator/
  • .github/agents/figma-token-architect.agent.md

Those are internal workflow helpers and are not part of the published runtime package.

Build Output

The package publishes from dist/:

  • dist/el-magico-ui.es.js
  • dist/el-magico-ui.cjs.js
  • dist/index.d.ts

License

ISC