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

@replit/ui

v0.0.53

Published

React components for Repl.it UI

Downloads

85

Readme

Repl.it UI

Run on Repl.it

React components for repl.it

Usage

npm install @replit/ui
import { ROOT_THEME_CLASS } from '@replit/ui';
import Styles from '@replit/ui/Styles';

// Include <Styles /> on every pages to apply global css variables
const Layout = () => (
  <body>
    <Styles />
    <div className={ROOT_THEME_CLASS}>{content}</div>

    {/* Add "dark" class for dark theme */}
    <div className={ROOT_THEME_CLASS + ' dark'}>{content}</div>
  </body>
);

// Use a component
import Button from '@replit/ui/Button';

const Dialog: React.FC<{ /* ... */ }> = (props) => (
  <div>
    {props.children}
    <Button onClick={props.onClick}>Ok</Button>
  </div>
);

Development

Heuristics: when do we move components into here?

  1. If there are designs for a component already and you are touching it a lot OR it’s completely new, move it in and implement. It should be there.
  2. If there are no new designs, but it’s very simple / dumb, if most of the redesign would just be CSS changes, move it into the UI lib, convert it to typescript, and Tyler (I) will go in and redesign it later.
  3. If there are no new designs and it’s complicated, don’t move it, we’ll deal with it later.

Install packages:

npm install

Running:


// For cosmos workshop
npm run dev

// For nextjs docs app
npm run dev:next

# or run inside docker
docker run -it --rm -v (pwd):/app -w /app -p 3000:3000 node:13-alpine npm run dev

Principles:

  • Generally, components are self-contained in their respective tsx files.
  • Theming is managed by changing the values of CSS variables. Individual components should have no concept of a theme.

Publishing a new version:

Generally we do this in three steps:

  1. Make a PR titled with the version number you are upgrading to, e.g. 0.0.30 or bump to 0.0.030. Make sure you increment by one from the previous version.
  2. Merge into master
  3. Go back to master and run npm run dist inside the directory. This will package everything up and publish to NPM.

This creates a special package.json file in /dist specifically for publishing to npm. Ultimately, this allows us to import components individually without adding "dist" to any component's import path. For example:

import Button from '@replit/ui/Button'

instead of:

import Button from '@replit/ui/dist/Button'

We set private: true and added an error message prepublishOnly to prevent accidentally publishing from the root using npm publish. directly.