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

guilherme-test-lib

v0.0.65

Published

### The base components for the design system of FIBR Bank

Downloads

46

Readme

UI Library

The base components for the design system of FIBR Bank

Install

npm install @material-ui/core @atbankio/ui-library

Getting Started

Welcome to this community-supported project! :wave:. This library is the React implementation of the FIBR's Design Language. This library has a peer dependency on @material-ui/core since it uses Material UI components as core.

Usage

Setup

For a no hassle setup and compatibility with Create React App, transpiled ES6 and CommonJS module versions have been included within the NPM package. If using this setup, please re-write the import statement in the documentation site examples. Use the following named import syntax to access the transpiled components from /src/index.ts:

import { ThemeProvider, Button } from '@atbankio/ui-library';

// Add `ThemeProvider` to the list of providers for your app
<ThemeProvider>
  <Button>Hello world</Button>
</ThemeProvider>;

Next.js Setup

The steps below are based on:

In order to have a proper SSR setup for the styles you need to follow the steps below:

Install styled-components

yarn add styled-components

Add SSR config to _document.tsx

import { ServerStyleSheets as MaterialSSRStyles } from '@material-ui/core/styles';
import { ServerStyleSheet as StyledSSRStyles } from 'styled-components';

// ...

static async getInitialProps(ctx: DocumentContext) {
  const materialSheets = new MaterialSSRStyles();
  const styledComponentsSheet = new StyledSSRStyles();

  const originalRenderPage = ctx.renderPage;

  try {
    ctx.renderPage = () =>
      originalRenderPage({
        enhanceApp: (App) => (props) =>
          styledComponentsSheet.collectStyles(materialSheets.collect(<App {...props} />)),
      });

    const initialProps = await Document.getInitialProps(ctx);

    return {
      ...initialProps,
      styles: (
        <>
          {initialProps.styles}
          {materialSheets.getStyleElement()}
          {styledComponentsSheet.getStyleElement()}
        </>
      ),
    };
  } finally {
    styledComponentsSheet.seal();
  }
}

Add remove the generated SSR styles from the client side:

React.useEffect(() => {
  const jssStyles = document.querySelector("#jss-server-side");

  if (jssStyles) {
    jssStyles?.parentElement?.removeChild(jssStyles);
  }
}, []);

Setting up the project

git clone [email protected]:atbankio/channels-ui-library.git
cd channels-ui-library
yarn && yarn storybook
open http://localhost:3001

Structure

Tech stack

Project structure

Component structure

How to

How to style

We use styled-components for the styling, together with Material UI base theme. We follow these patterns:

  • CSS based styled components
  • Named exports
  • Use transient props to prevent props going to the DOM
  • From the components import all as S (styled) and use like <S.Button />

How to test

We use testing-library to test the components, there is no exact pattern, but we try to follow the testing-library principles:

  • https://testing-library.com/docs/guiding-principles
If it relates to rendering components, then it should deal with DOM nodes rather than component instances, and it should not encourage dealing with component instances.
  1. It should be generally useful for testing the application components in the way the user would use it. We are making some trade-offs here because we're using a computer and often a simulated browser environment, but in general, utilities should encourage tests that use the components the way they're intended to be used.
  2. Utility implementations and APIs should be simple and flexible.
  3. At the end of the day, what we want is for this library to be pretty light-weight, simple, and understandable.

How to document

@TODO

How to release

@TODO

Release strategy

@TODO

Manually deploy

@TODO

Test your release

@TODO

Accessibility

We use Storybook's accessibiliy plugin that uses aXe as testing engine to detect accessibility issues, please be aware of it when developing.


© Amsterdam Trade Bank