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

@47nordmedia/k2-systems-web-components

v0.4.18

Published

Shared react components for the K2 Systems EcoSystem

Downloads

173

Readme

K2 Systems Web Components

Publish to NPM Run tests and bump version


Deploy Storybook Container to Azure Container Registry & deploy to AKS (DEV) Update UI lib version

Code

Dev

Run yarn storybook to start the storybook server to develop the individual react components

Build

Run yarn run build to execute the rollup.js script which builds the components into esm and cjs versions

Publish

Storybook is available at https://account-dev.k2-systems.com/web-components/

with:

user: webcomponents
pw: webcomponents

Building new components & naming conventions

To be able to use the web-components throughout differen tech-stacks, we first have to define the simple css classes and the html structure of the different components.

Below you'll find examples on how to define that structure.

After this strucuture is defined, the ReactJS components can be build, based on the css classes and HTML structure.

Sizing

All core elements (e.g. button, input, ...) should have the following sizes:

  • sm -sm
  • md -md
  • lg -lg

If no size class is provided to the element it should default to md

e.g.

<button class="bttn bttn-primary bttn-lg">hello world!</button>

Simple components (e.g. buttons, inputs, chips)

Most of the components are build as simple html elemnts without any nesting.

To use the button component you simple add the wanted classes to the used html element.

e.g.

<button class="bttn bttn-primary">hello world!</button>

corresponding css class definition:

.bttn {
  @apply px-5 py-2 rounded-full bg-red text-white leading-[24px] inline-flex items-center;
}

.bttn-primary {
  @apply bg-red text-white hover:bg-black transition-all;
}

ReactJS (TSX) implementation:

import React, { FC } from 'react';

import { ButtonProps } from './Button.types';

const Button: FC<ButtonProps> = ({ name }) => {
  return <button className="bttn bttn-primary">{name}</span>;
};

export default Button;

nested components (e.g. switch)

Simple nested components should only consist of elements that can be accessed relatively simple with standard element selectors or if needed use the BEM naming convention, to structure said components.

<span class="switch">
  <span class="switch__thumb"></span>
  <span></span>
  <input class="switch__input" type="checkbox" />
</span>

corresponding css class definition:

/* switch/components.css */
@layer components {
  .switch {
    @apply relative inline-flex items-center h-6 rounded-full w-11 bg-red/70;

    &__thumb {
      @apply transition ease-in-out duration-200 inline-block w-4 h-4 transform bg-white rounded-full translate-x-1;
    }

    &__input {
      @apply absolute opacity-0 w-full h-full top-0 left-0 m-0 z-0 cursor-pointer;
    }
  }
}
/* switch/utilities.css */
@layer utilities {
  .switch {
    &.active {
      @apply bg-green-400;

      .switch__thumb {
        @apply translate-x-6;
      }
    }

    &.disabled {
      @apply bg-lightGrey;
    }
  }
}

ReactJS (TSX) implementation:

import React, { FC } from 'react';

import { SwitchProps } from './Switch.types';

const Switch: FC<SwitchProps> = ({ name }) => {
  return (
    <span className="switch">
      <span className="switch__thumb"></span>
      <span></span>
      <input className="switch__input" type="checkbox" />
    </span>
  );
};

export default Switch;

Higher order components (tbd)

This needs to be defined once HOCs will be introduced.