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

@surge-studio/spark

v0.3.3

Published

Surge Studio Design System.

Downloads

7

Readme

Spark

Surge Studio Design System.

Usage

Install the package.

pnpm add @surge-studio/spark

Setup tailwind.config.ts using presets and content.

Use extend to update the colour scheme or any other properties.

import type { Config } from 'tailwindcss';
import colors from 'tailwindcss/colors';
import { tailwindConfig } from '@surge-studio/spark';

const config: Config = {
  presets: [tailwindConfig],
  content: tailwindConfig.content,
  theme: {
    extend: {
      colors: {
        primary: colors.purple,
        gray: colors.zinc,
      },
    },
  },
};

export default config;

Apply global styles.

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  html {
    @apply bg-white text-gray-900;
  }

  .dark {
    @apply bg-gray-950 text-white;
  }
}

Add the ThemeProvider and Inter font.

App directory

// app/layout.jsx

import { ThemeProvider } from '@surge-studio/spark';
import { Inter } from 'next/font/google';

const inter = Inter({ subsets: ['latin'] });

export default function Layout({ children }) {
  return (
    <html suppressHydrationWarning>
      <head />
      <body className={inter.className}>
        <ThemeProvider>{children}</ThemeProvider>
      </body>
    </html>
  );
}

As per next-themes if you do not add suppressHydrationWarning to your <html> you will get warnings because next-themes updates that element. This property only applies one level deep, so it won't block hydration warnings on other elements.

Pages directory

// pages/_app.tsx

import type { AppProps } from 'next/app';
import type { FC } from 'react';
import { ThemeProvider } from '@surge-studio/spark';
import { Inter } from 'next/font/google';

const inter = Inter({ subsets: ['latin'] });

const App: FC<AppProps> = ({ Component, pageProps }) => (
  <ThemeProvider>
    <main className={inter.className}>
      <Component {...pageProps} />
    </main>
  </ThemeProvider>
);

export default App;

Ready to go!

import { Button } from '@surge-studio/spark';

Development

Install packages with pnpm install

Run Storybook with pnpm dev:storybook and navigate to localhost:6006

Run Next.js landing page with pnpm dev:next and navigate to localhost:3000

Run concurrently with pnpm dev

Release workflow

Releases are created manually at this stage in the project.

  • Prepare build with pnpm package

  • Test locally with pnpm pack --pack-destination ../

  • Include in a test project with "@surge-studio/spark": "file:../surge-studio-spark-0.3.0-rc1.tgz"

  • Publish with npm publish