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

@rotki/ui-library

v1.2.7

Published

A vue design system and component library for rotki

Downloads

739

Readme

@rotki/ui-library

A Vue component library and design system for rotki

npm (scoped) ci codecov

Getting started

Installing the library

You can start using the library after installing it from npm along with the roboto font:

pnpm install -D --save-exact @rotki/ui-library @fontsource/roboto

Importing the stylesheets

Don't forget to import the style.css file from @rotki/ui-library along with the latin roboto font, in the project root (e.g main.ts)

import '@rotki/ui-library/dist/style.css';
import '@fontsource/roboto/latin.css';

Using the plugin

To use the library you must install the library plugin:

import { createRui } from '@rotki/ui-library';

const RuiPlugin = createRui(options);
app.use(RuiPlugin);

Using the components

Then you can you the library components e.g.:

<script setup lang="ts">
import { RuiButton } from '@rotki/ui-library';
</script>

<template>
  <div>
    <RuiButton outlined>
      This is button
    </RuiButton>
  </div>
</template>

Managing the theme

To dynamically manage the theme you can use the theme manager

import { useRotkiTheme } from '@rotki/ui-library';
const { toggleThemeMode, setThemeConfig, switchThemeScheme, state, store } = useRotkiTheme();

// to change the theme (pass colors as described by `ThemeConfig`) anytime:
setThemeConfig(newTheme);

// to switch between auto|light|dark
toggleThemeMode();

// to switch to a specific theme mode
switchThemeScheme(ThemeMode.dark);

Using the icons

You need to specify which icons you want to enable, when installing the RuiPlugin.

import { Ri4kFill, Ri4kLine, createRui } from '@rotki/ui-library';

const RuiPlugin = createRui({
  theme: {
    icons: [Ri4kFill, Ri4kLine],
  },
});
app.use(RuiPlugin);
<script lang="ts" setup>
import { RuiIcon } from '@rotki/ui-library';
</script>

<template>
  <div>
    <RuiIcon name="4k-fill" />
    <RuiIcon name="4k-line" />
  </div>
</template>

Use @rotki/ui-library tailwindcss theme

You can extend @rotki/ui-library tailwind theme configuration by adding these to your tailwind config. It will provide you the classes for the colors, typography, and shadow.

// tailwind.config.js

module.exports = {
  // ... your tailwind configs,
  plugins: [require('@rotki/ui-library/theme')],
};

Development

Installation

To install the dependencies you need to run on the root of the repository

pnpm install --frozen-lockfile

Compiles and minifies for production

The following command when executed from the project root will build the @rotki/ui-library bundle. This command will create the bundle for both Vue version >=3.4.3.

pnpm run build:prod

If you want to build for specific version, you can run:

pnpm run build

Lint check

pnpm run lint

Lints and fixes files

pnpm run lint:fix

Type check

pnpm run typecheck

Storybook

In order to run the storybook, you can run:

pnpm run storybook

Testing: Unit

In order to test the components, you can run:

pnpm run test

Testing: end-to-end

In order to test the components in use in a vue 3 project, you can run:

pnpm run test:e2e

coverage results can be generated and previewed with:

pnpm run coverage
pnpm run coverage:preview

Locally testing the library

After you build the bundle, in the package.json on your main project, you can add this to the dependencies:

{
  "@rotki/ui-library": "file:...path_of_this_directory"
}

When the dependency installed on the main project, it will run the prepare script.

Generating the library icons

We use remix-icons. You need to run this script to scrap the svgs data from remix-icons. (This script runs automatically on prepare. Run this in case the icons aren't generated properly)

pnpm run generate:icons

License

AGPL-3.0 License © 2023- Rotki Solutions GmbH