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

rampui

v0.24.2

Published

The UI library for effortlessly creating beatiful and responsive admin dashboards in React.

Downloads

1,081

Readme

RampUI - Randmar.io React Component Library

https://www.npmjs.com/package/rampui

What

An easy to maintain React components library that is built on top of MUI Base (for customized components) and MUI Material. It is published to npm on every push to the master branch.

Why

  1. Randmar.io uses consistent styling across all portals.
  2. DRY code across the Randmar.io.
  3. Modernize the style of Randmar.io.

Local development

Storybook

It's recommended that each UI component has at least one Story, for ease of testing during development and for creating documentation in the future. The Stories file should sit in the root directory of the component and follow the following naming convention: ComponentName.stories.tsx.

Below is a sample story that can be used as a base for most components:

const meta: Meta<typeof ComponentName> = {
  title: 'Component Name',
  component: ComponentName,
  tags: ['autodocs'],
};

export default meta;
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
  render: () => <ComponentName />
};

Testing

Each component should have at least one test to check that it renders correctly. The test file should sit in the root directory of the component and follow the following naming convention: Component.test.tsx.

Below is an example test file that can be used as a base for most components:

describe('<ComponentName />', () => {
  const children = <div data-testid="content">Content</div>;

  it('renders itself and its content correctly', () => {
    const { getByTestId } = render(
      <ComponentName data-testid="componentName">
        {children}
      </ComponentName>
    );

    const componentName = getByTestId('componentName');
    const contentElement = getByTestId('content');

    expect(componentName).toBeInTheDocument();
    expect(contentElement).toBeInTheDocument();
  });
});

Packaging

To verify that exported components work as expected, you can package and import them locally before publishing to npm. In the rampui directory, hit the npm link command and in the directory of the project where you're using rampui, hit the npm link rampui. This will update the project's package.json to use rampui from your local build. Each time you run the build command, npm run build on rampui, the library will automatically be updated in the project you're using for testing.

Migrating MUI components

When migrating components that are using the @mui/material library, ensure that:

  1. The MUI theme file in rampui is updated with any modifications made to the MUI theme in the React project the component is migrated from
  2. The MUI components use the correct colors
    • RampUI uses the main theme color as the primary color, and a black color as the secondary; this is not the case for all Randmar.io Portals

Publishing to npm

How to release a new version of rampui to npm:

  • Create a pull request into the main branch
  • Add the appropriate label to the pull request:
    • release-patch: backward compatible bug fixes
    • release-minor: backward compatible new features
    • release-major: changes that break backward compatibility
  • Merge the pull request