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

@vchasno/ui-kit

v0.4.30

Published

React UI components for Vchasno applications

Downloads

849

Readme

UI-Kit library for Vchasno web applications

📦 Install

npm install @vchasno/ui-kit
yarn add @vchasno/ui-kit

🔨 Usage

  1. Before consuming components, you need to import required CSS into your project. Preferable way is to use global css import or postcss imports:
  • import directly into your project if your bundler supports it
// index.tsx
// optional reset styles
import '@vchasno/ui-kit/dist/css/_base.css';
import '@vchasno/ui-kit/dist/css/_reset.css';
// required main css which includes variables and styles
import '@vchasno/ui-kit/dist/css/vchasno-ui.css';
// override theme if needed (more info in "Styling and customization" section)
import 'src/styles/_theme-override.css';
  • using postcss @import statement
/* globals.css */
// optional reset styles
@import '@vchasno/ui-kit/dist/css/_base.css';
@import '@vchasno/ui-kit/dist/css/_reset.css';
// required main css which includes variables and styles
@import '@vchasno/ui-kit/dist/css/vchasno-ui.css';
// override theme if needed (more info in "Styling and customization" section)
@import './styles/_theme-override.css';

Configure webpack to import vchasno-ui.css file in global mode if needed. For example:

module.exports = {
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [
                    MiniCssExtractPlugin.loader,
                    {
                        loader: 'css-loader',
                        options: {
                            import: true,
                            modules: {
                                mode: (resourcePath) => {
                                    if (/\/node_modules\//i.test(resourcePath)) {
                                        return 'global';
                                    }

                                    return 'local';
                                },
                                localIdentName: '[name]__[local]__[hash:base64:5]',
                            },
                            importLoaders: 2,
                        },
                    },
                ],
            },
        ],
    },
};
  1. Now you can import react components based on your needs
import React from 'react';

import { Button } from '@vchasno/ui-kit';

const App = () => (
    <>
        <Button type="primary">PRESS ME</Button>
    </>
);

Styling and customization

vchasno-ui is using global styles with prefix vchasno-ui- css variables start with the prefix --vchasno-ui-

To customize styles you can use CSS variables and override them

/* theme-override.css */
:root {
  --vchasno-ui-transition-duration-sec: 0.5s; // default 0.3s
}

... or more specific styles

/* button-override.css */
:global(.vchasno-ui-button.--sm) {
  padding: 0 20px; // default 0 15px
}

TypeScript

vchasno-ui is written in TypeScript with complete definitions

🌍 Internationalization

Supports only Ukrainian language

🔗 Links

Development

Install dependencies

npm install

Add new component

npm run storybook
npm run generate-component <ComponentName>

Go to http://localhost:6006/ and start developing

To create story see Storybook docs or other components

Build storybook

npm run build-storybook

Build

npm run build

Publish new version

0.2 versions

Should develop in v0.2 branch. All merge requests should be merged to v0.2 branch

0.3 version

Should develop in v0.3 branch. All merge requests should be merged to v0.3 branch

0.4 version - latest

Should develop in master branch. All merge requests should be merged to master branch

Publish version to npm registry

Publish new version to npm registry can only be done with CI/CD

To publish new version:

  1. Make changes in new branch (e.g. feature/new-component)
  2. Add changes to CHANGELOG.md (see Keep a Changelog)
  3. Commit changes
  4. Create tag with version (e.g. v0.1.2) run npm version patch|minor|major
  5. Push tag to remote repository
  6. Publish job will be started in CI/CD pipeline (only for master branch or version tag)
  7. Confirm (CI/CD prepared manual stage) publish - new version will be published to npm registry