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

segel-ui

v2.1.87

Published

## Sumary

Downloads

17

Readme

Segel UI

Sumary

UI component library for the pages from Serturner Institut.

The library es built using React and TailwindCSS.

In order to get the maximum compatibility, we opted to use the rollup library to make the bundle instead webpack. This allows us to create a bundle that can be used in projects that don't use typescript without sacrificing the new ecmascript features. The complete project is written in typescript with a lintern like ESLint to ensure that all the team follows the same code style.

The tool Storybook is used to write a documentation and develop without create a pet project.

Motivation

UNDER CONSTRUCTION

Get started

  1. install library
yarn add segel-ui
  1. import specific css for tailwind
@import 'ui/src/styles/index.css';
  1. configure tailwindcss

Modify the file tailwind.config.js with next code:

module.exports = require('segel-ui').getDefaultConfig() 

You can pass your own configuration to modify the default from the library (NOT READY)

Development Notes

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.

In order to develop new components we need to setup the project with the command

yarn install

All components are located in src folder. The components that we want to expose on the library MUST be exported to outside on the index.ts file.

Folder Structure

  • src On this folder we can found all components that are available.

  • stories Here are located the component stories with some visual examples and how to use

Styling the components

In order to add styles to the components we MUST use the tailwindCSS style, that means use all utility classes defined by tailwind. When the property className is too long and becomes complicated to read or tailwind does not offer a specific solution you can add specific css in the index.css file. (RECOMMEND GUIDELINE)

Example:

/**
 *  Component using styles defined in tailwindcss. It's no necesary create css files unless the class name becomes unreadable or the style is not available
 */
function MyComponent () {
	return <div className="m-4 p-4 border border-blue-600 rounded text-gray-800 hover:bg-blue-100 w-full h-10">
		Hello world!
	</div>
}

Working with the theme

In order to mantain a standart with paddings, margings, etc. We MUST to style the component using the theme methods.

Example:

function MyComponent({ theme }) {
	const padding = theme.padding.sm;
	const maring = theme.margin.sm;
	return <div className={`${padding} ${margin} border border-blue-600 rounded text-gray-800 hover:bg-blue-100 w-full h-10`}>
		Hello world!
	</div>
}
export default withTheme(MyComponent);

ESLint

We use ESLint with the rules provided by airbnb with some modifications that makes sense for us. In order to keep the same style on the coding phase, pull requests are enforced to check the lint rules. If the ESLint rejects the checks you MUST fix it to make the merge with the main branch. You can check any time if you have any errors in ESLint using the command prompt with yarn lint. Or use the ESLint extension for Visual Studio Code.

Typescript

All components SHOULD be exported providing the types for its props and its references. The types MUST be named first with the name of the component and adding either Props or Ref at the end (e.g. BoxProbs view Box.tsx). In the event that you want to use all generic props for an HTML element in React, you SHOULD use the strategy outlined here: React Typescript Cheatsheet

Example with theme:

interface MyComponentProps extends ComponentTheme;

function MyComponent({ theme }: MyComponentProps) {
	const padding = theme.padding.sm;
	const maring = theme.margin.sm;
	return <div className={`${padding} ${margin} border border-blue-600 rounded text-gray-800 hover:bg-blue-100 w-full h-10`}>
		Hello world!
	</div>
}
export default withTheme<MyComponentProps>(MyComponent);

Use StoryBook to create the components

Storybook is an open source tool for building UI components and pages in isolation. So running the command

yarn storybook

you open the storybook panel to develop the components and its edge cases.

Manual Link to a project

Under construction