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

@mayan-co/ui-components

v1.0.2

Published

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

Downloads

1

Readme

This is a Next.js project bootstrapped with create-next-app.

Contribution Guidelines

  • Avoid custom css if possible. Favor TailwindCSS utility classes instead
  • Keep components as stateless as possible. Things like onChange event handlers are the concern of the app that consumes these components.

Certain stateful behavior will be necessary, such as tracking if a modal or dropdown is open/closed.

Coding Style Rules

To help catch many of the common pitfalls that aren't compile errors, install this project's recommended extensions for VSCode.

Formatting

  • Prettier must be used to format all code.

FS Conventions

  • Component files should follow kebab case (ie. Good: text-input.tsx Bad: Button.tsx, dropDown.tsx, user_info.tsx)
  • Story files should follow kebab case case and have the extension *.stories.ts (ie. Good: select.stories.ts Bad: Table.stories.ts)

Variable/Identifier Conventions

  • Constants at the top level of a module should follow capital-snake case (ie. const INVALID_STATE: number = 0;)
  • Types and React components should follow pascal case.
  • All other variables, function identifiers and object keys should be camel case.

Enums vs Literals

  • Favor enums instead of literals. It is easier to create/perform reliable code mods that rename enums compared to find-n-replace of literals.
  • When literal strings are used (either in their own right or as part of a string enum) prefer snake case.

Named vs Default Exports

  • Favor named exports instead of a default export.

React Prop Naming

  • Boolean props should be prefixed with is (ie. isActive)
  • Function props should be:
    • prefixed with on when representing an event
    • suffixed with Renderer when supporting the render prop pattern

React Prop Performance Considerations

  • Avoid passing objects (including arrays, Set, Map, etc.) as props whenever possible. If it is a necessity, make sure they are properly memoized.
  • If you must pass a rendered React element as a prop, perform the rendering in a useMemo hook.

Getting Started

Although this project was initialized from a nextjs template, the main focus is the storybook app.

First, run the development server:

npm run storybook

This should open a new tab in your default browser and load the main page. From here you can click around to get acquainted with the layout and play with the controls for the various starter components.

Integration with Figma

The project is already configured to embed Figma files in the controls section of a Story. Add a parameters property to a Story config object like the one below.

export const Primary: Story = {
  args: {
    primary: true,
    label: 'Button',
  },
  parameters: {
    design: {
      type: 'figma',
      url: 'https://www.figma.com/file/ZruKgQ2m5Pra5OD3GRZ9L5/Design-System-WebApp-Beta?node-id=1017:3120&mode=dev',
    },
  },
};