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

@panenco/ui

v16.1.1

Published

Panenco UI

Downloads

882

Readme

⚠️ DEPRECATED ⚠️

Support for this package will be discontinued in the near future. Consider migrating to Material UI.

Panenco UI

Panenco UI is our React component library created to unify how we create user interfaces.

Installation

Run one of the following commands to add Panenco UI to your project:

yarn add @panenco/ui

Peer dependencies:

  • classnames
  • react
  • react-dom
  • react-router-dom
  • styled-components

Usage

To start importing and using components in your project, you need the following:

  • Import css of Panenco UI from @panenco/ui/lib/styles.css. It could be any way of global import of styles into your project. For instance, using import in js with a proper loader or using @import in your css.
  • Wrap your application with the ThemeProvider component from styled-components and pass the theme to it.
import React from 'react';
import { render } from 'react-dom';
import AppContainers from 'containers';
import { ThemeProvider } from 'styled-components';
import { theme } from './theme';

import '@panenco/ui/lib/styles.css';

const App = () => (
  <ThemeProvider theme={theme}>
    <AppContainers />
  </ThemeProvider>
);

render(<App />, document.getElementById('root'));

Theme definition

A theme is just a nested object with properties defining the appearance of your UI. It's passed to the ThemeProvider component from styled-components, and then it's available in all components of Panenco UI. The theme is defined as:

type PUITheme = {
  colors: PUIColors;
  typography: {
    sizes: PUISizes;
    weights: PUIWeights;
  };
};

There are two properties: colors and typography.

colors definition

Colors that are defined within a theme are represented with the following type:

export type PUIColors = {
  alert: string;
  error: string;
  success: string;
  primary200: string;
  primary500: string;
  primary700: string;
  primary900: string;
  base100: string;
  base200: string;
  base300: string;
  base400: string;
  base500: string;
  base600: string;
  base700: string;
  base800: string;
  base900: string;
};

Also, you can override theme colors:

colors: PUIColors;

typography definition

Typography consists of two properties: sizes and weights. They are used as a base for the Text component. The setting of these properties impacts all text sizes in all components around Panenco UI. Also, when using custom fonts, it's highly recommended to set the proper weights of the font you use.

export type PUIWeights = {
  thin: number;
  light: number;
  regular: number;
  medium: number;
  bold: number;
  black: number;
};

export type TextSize = { textSize: string; lineHeight: string | number };

export type PUISizes = {
  xs: TextSize;
  s: TextSize;
  m: TextSize;
  l: TextSize;
  xl: TextSize;
  h3: TextSize;
  h2: TextSize;
  h1: TextSize;
};

Styles injection order

Note: styled-components inject their styles at the bottom of the HTML <head>, which gives @panenco/ui precedence over your custom styles. To remove the need for !important, you need to change the CSS injection order using useInjectStylesFirst hook imported from @panenco/ui

import { useInjectStylesFirst } from '@panenco/ui';

const App = () => {
  useInjectStylesFirst();

Exported external modules (deprecated)

  • react-focus-lock: https://github.com/theKashey/react-focus-lock