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

@ndlib/component-library

v1.0.15

Published

This is the repo for The Hesburgh Component Library, a set of React components that escapsulate the design patterns used by the Hesburgh Library IT department.

Downloads

215

Readme

Hesburgh Component Library

This is the repo for The Hesburgh Component Library, a set of React components that escapsulate the design patterns used by the Hesburgh Library IT department.

Using the library

Installation

To install the library in your project, run

yarn install @ndlib/component-library

Setup

UiProvider

In order for styles to be applied correctly, the UiProvider component must be included at the top of your project.

<UiProvider>
  <App>
</UiProvider>

For frameworks that split application code by pages, it is recommended to add this provider at the root level rather than at the page level. In Gatsby, this can be done using the wrapRootElement browser API.

exports.wrapRootElement = ({ element }) => {
  return (
    <UiProvider>
      {element}
    </UiProvider>
  )
}

Configuring Link

By default, the Link component in this library will use a native HTML <a> component in its implementation. This behavior can be overriden by setting the link.internalLink and/or link.externalLink property on the components prop of the UiProvider component. If a custom component is provided, the custom component will be rendered by when the component is used. It will receive the same props the receives, as well as an sx object with default link styles from the theme and any custom styles provided.

Note that the theme-ui jsx transform is needed in order to convert the sx prop into a stylesheet definition.

/** @jsxImportSource theme-ui */
import { Link } from 'gatsby'

const CustomInternalLink = ({ sx, ...rest}) => ()
  return <Link sx={sx} {...rest} />
)

const WrappedApp = () => {
  <UiProvider components={{
    link: {
      internalLink: CustomInternalLink
    }
  }}>
    <App />
  </UiProvider>
}

Running locally

Dependencies must be installed before storybook can be started. Dependencies can be installed with: yarn install.

To build and deploy your storybook locally for development, run yarn start

Deploying Storybook

Whenever a commit is added to the main branch, the contents of the /docs folder will be deployed to our Github pages site.

To build a new version of the storybook to be deployed, run yarn build-storybook. Our storybook build uses vite.

Running tests

Tests are run using vitest, a test-runner built for vite that is similar to jest. Test suite can be run with: yarn test

Linting

Changes should be linted before commits. Run our linter with yarn lint. Failed linting will block builds and deploys. Our lint process uses eslint and prettier. Running yarn lint:fix will fix any issues that can be automatically fixed.

Building for npm

The build process for the npm module for this library uses tsc. ESM exports are used to better support tree-shaking. When adding new code to this library, be careful to ensure than importing the module do not cause side-effects. In other words, don't execute any process or do any state management outside of exported properties or functions because this code might be removed by tree-shaker. See examples below:

Wrong

// This code may get removed by tree-shaker
setTimeout(() => {
  console.log('hello world')
})

Right

export const myFunction = () => {
  setTimeout(() => {
    console.log('hello world')
  })
}