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

@maany_shr/rage-ui-kit

v1.2.0

Published

<div style="text-align:center;">

Downloads

679

Readme

PRADA RAge UI Kit

Usage

Installation and Configuration

The component library built with this template can be used in any project that supports TailwindCSS. After publishing your component library to NPM, you can install it in your project by running:

npm install @maany_shr/rage-ui-kit

You should then configure the tailwind.config.js file in your project to include the styles from the component library.

First, import the tailwind config exported from the component library:

import { defaultTheme } from "@maany_shr/rage-ui-kit";

Then, include the theme in your project's tailwind.config.js file:

export default {
  theme: {
    ...defaultTheme,
    // other theme configurations, be careful not to override the default theme or provide a merged theme object here
  },
  plugins: [],
};

Then, include the plugins from the component library in your project's tailwind.config.js file:

import { defaultPlugins } from "@maany_shr/rage-ui-kit";

export default {
  plugins: [defaultPlugins.map((plugin) => require(plugin))].extend([
    // other plugins
  ]),
};

Additionally, modify the content array in the Tailwind Config to include the components from the component library:

export default {
  content: [
    "@maany_shr/rage-ui-kit/dist/**/*.js",
    ...other sources
  ],
  theme: {
    ...defaultTheme,
    // other theme configurations
  },
}

An example of a tailwind.config.ts file that includes the component library is shown below:

import type { Config } from "tailwindcss"
import { defaultTheme, defaultPlugins } from "@maany_shr/rage-ui-kit"

const config = {
  darkMode: ["class"],
  content: [
    './node_modules/@maany_shr/rage-ui-kit/dist/**/*.js',
    ...your content sources
  ],
  prefix: "",
  theme: {
    extend: {
      ...defaultTheme.extend
    },
  },
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument
  plugins: [defaultPlugins.map((plugin: string) => require(plugin))],
  // plugins: [require("tailwindcss-animate")],
} satisfies Config

export default config

The corresponding tailwind.config.js file is shown below:

/** @type {import('tailwindcss').Config} */
import {
  defaultTheme,
  defaultContent,
  defaultPlugins,
} from "./lib/tailwind/config";
module.exports = {
  content: [
    "/node_modules/@maany_shr/rage-ui-kit/dist/**/*.js",
    ...defaultContent,
  ],
  prefix: "",

  theme: {
    ...defaultTheme,
  },
  plugins: [defaultPlugins.map((plugin) => require(plugin))],
};

Then you can import and use the components in your project:

import { Button } from "@maany_shr/rage-ui-kit";

Additional TaiwindCSS Configuration

Your project's TailwindCSS configuration might need additional configurations. Please check the lib/tailwind/config.ts file and the tailwind.config.js file in this ui kit to see if you need to include any other configurations in your project.

For example, if you want to enable dark mode in your project, you can add the following configuration to your tailwind.config.js file:

module.exports = {
  darkMode: "class",
  // other configurations
};

Theme Configuration

Please install the next-themes package and create a ThemeProvider component in your project with the following code:

"use client";

import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { type ThemeProviderProps } from "next-themes/dist/types";

export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
  return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}

You can then wrap your application with the ThemeProvider component:

<ThemeProvider
            defaultTheme="system"
            attribute="class"
            enableSystem
            disableTransitionOnChange
>
  {your app component}
</ThemeProvider>

Read More: https://ui.shadcn.com/docs/dark-mode/next

Development

Local Development

To start the development server, run:


npm run dev

This will start the Storybook server at http://localhost:6006.

Development against a project

Setup

To develop against a project, you can link the component library to the project. First, build the component library:


npm run build

Then, link the component library to the project:


cd dist
npm link

In the project, link the component library:


npm link @maany_shr/rage-ui-kit

Then, start the development server in the component library:


npm run build:watch

After that configure TailwindCSS as desribed in the Usage section.

Cleanup

To unlink the component library from the project, run:


npm unlink @maany_shr/rage-ui-kit

Then, unlink the component library:


cd dist
npm unlink

In case you forgot to unlink the component library,


npm rm --global "@maany_shr/rage-ui-kit"

Verify the global package is removed:


npm list -g --depth=0

Then, in the project, do a clean install:


npm ci