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

@lifeondesk/stone-ui

v1.8.4

Published

A React UI component library made by lifeondesk

Downloads

4

Readme

🎋 Stone-UI

Stone-UI is a component library built with TypeScript, React, CSS modules, and Feather icons.
Inspired by: Bamboo-UI
Practices from: Good npm library practices

Table of Contents

Quick start

To add Stone UI to your project, run the following command:

npm add @lifeondesk/stone-ui
# or using npm
npm install @lifeondesk/stone-ui

Stone UI is built using React, so react and react-dom are required peer dependencies. If you don't have them installed yet, run the following command in your project:

npm add react react-dom
# or using npm
npm install react react-dom

Usage

CSS module loader

Stone UI uses CSS modules for styling which are imported into the JavaScript files. A custom loader is needed to make this work.

Popular React frameworks such as Next.js and Create React App support CSS modules out of the box, though you might need additional configuration to enable this for node modules (e.g. next-transpile-modules).

If you are not using a framework or starter kit with CSS module support, you need to add and configure the css-loader for Webpack or find a similar loader for your bundler of choice.

Import base styles

Stone UI's components rely on a two global stylesheet to work properly.

  • theme.css contains the default CSS variables for both light and dark mode. You can override individual variables or create a custom theme.
  • base.css contains a small CSS reset and a handful of other global styles such as font-face declarations and custom ::selection styles.

Import the stylesheets in your application globally and before any other imports from Stone UI. For example, in Next.js you should import the stylesheets in the _app.js file:

// ./pages/_app.js
import '@lifeondesk/stone-ui/base.css';
import '@lifeondesk/stone-ui/components.css';
import '@lifeondesk/stone-ui/theme.css';

export default function MyApp({ Component, pageProps }) {
  return <Component {...pageProps} />;
}

Import components

Once the initial setup is done, importing and using the components is straightforward:

import { Button } from '@lifeondesk/stone-ui';

function App() {
  return (
    <Button variant="primary" onClick={() => alert('Hello')}>
      Say hello
    </Button>
  );
}

You can add custom styles to a component by passing in a className prop:

import { Button } from '@lifeondesk/stone-ui';

function App() {
  return (
    <Button className="spacing-bottom" onClick={() => alert('Hello')}>
      Say hello
    </Button>
  );
}

Contributing

If you have ideas for how I could improve this README or the project in general, let me know. Below are some tips how to make changes to the project:

Installing dependencies

This project uses npm to manage its dependencies. Once you've cloned the repository, navigate to the project folder in your terminal and run the following command to install all dependencies:

npm

Running Storybook

I use Storybook as a development workbench and to document the components. To start Storybook and open it in your browser, run the following command:

npm start

Linting and formatting

I use stone-toolkit, SumUp's toolkit for building JavaScript & TypeScript applications, to manage the linting and formatting configs. The linter and TypeScript run on every commit to ensure high code quality. You can also lint manually by running the following commands:

# Lint and report issues
npm lint
# Same as above, but also tries to fix issues automatically
npm lint:fix

Testing

The majority of the components are purely visual and TypeScript gives me a high level of confidence in the code. For these reasons and since this is only a personal project, I've opted to keep the number of tests to a minimum. You can run the tests using the following command:

npm test