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

@getprovi/fizz-components

v1.2.0

Published

This is the package for the Fizz Component Library `@getprovi/fizz-components`. It is designed to be used with the [Fizz Styles](https://www.npmjs.com/package/@getprovi/fizz) package and the [Fizz Icons](https://www.npmjs.com/package/@getprovi/fizz-icons)

Downloads

151

Readme

Fizz Component Library

This is the package for the Fizz Component Library @getprovi/fizz-components. It is designed to be used with the Fizz Styles package and the Fizz Icons package.

Creating a new component

To start creating a new component, create a new directory named for component in the packages/components/src/dev directory. Inside of the new directory, create a new file named Component.svelte and any other files that are needed for the component. Utility files should go under packages/components/dev/utils. These components live in the dev directory while they are being developed. Once they are ready to be published, they will be moved to the packages/components/src/lib/components directory. To build out the component, you can use the main SvelteKit application or the Storybook application.

SvelteKit

To use the SvelteKit application, run the pnpm components script from the root of the project. This will start the Vite server and you can view the component in the browser at localhost:5173. You can edit the packages/components/src/routes/+page.svelte file to add the component you are building to the page. There is an alias set up for the src/dev - $dev, src/lib/components - $components, and the src/lib/utils - $utils directories.

Storybook

To use the Storybook application, run the pnpm sb script from the root of the project. Start creating the component story under the src/stories/components directory. Create a new folder named after your component and add a Component.stories.ts file. If your component does not use slots, you can create a simple story using the following template:

import type { Meta, StoryObj } from '@storybook/svelte'

import ComponentName from './ComponentName.svelte'

// More on how to set up stories at: https://storybook.js.org/docs/7.0/svelte/writing-stories/introduction
const meta = {
	title: 'Storybook/Example/ComponentName',
	component: ComponentName,
	// autodocs will automatically generate the props table for the component and any stories
	// More on autodocs: https://storybook.js.org/blog/storybook-7-docs/
	tags: ['autodocs'],
	// More on argTypes: https://storybook.js.org/docs/7.0/svelte/writing-stories/args#argtypes
	argTypes: {
		// Storybook handles these props and controls better if they are explicitly defined here
	}
} satisfies Meta<ComponentName>

export default meta
type Story = StoryObj<typeof meta>

// More on writing stories with args: https://storybook.js.org/docs/7.0/svelte/writing-stories/args
export const Primary: Story = {
	args: {
		// Add any props here
	}
}

However, if your component uses slots, you will need to create a svelte file for the component to use in the story. This is because Storybook does not support slots in the ts file. Create your component for the story under the component's folder and name it Component.story.svelte. You can then import the component into the Component.stories.ts file and use it in the story.

The downside to this method is that Storybook will not autogenerate the correct code for the component. You will need to manually add the documentation to the story.

Publishing a component

To make Jest and Vite happy in the Provi app the src/lib folder needs to be published along with the dist directory generated by the package command. This publishes the uncompiled Svelte files as is to NPM. In the Provi app, the aliases for the component library need to be up to date in the svelte.config.js file. These are the current aliases from the component library:

      $dev: './src/dev',
      $components: './src/lib/components',
      $utils: './src/lib/utils',
      $types: './src/lib/types',