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

@gn-as/icons-svelte

v1.4.5

Published

Gina Design System SVG icons as Svelte components

Downloads

529

Readme

Overview

This zero dependency icon library builds Gina icons as Svelte components.

Icon Index

Installation

Install [@gn-as/icons-svelte] as a development dependency.

## Yarn
yarn add -D @gn-as/icons-svelte

## npm
npm i -D @gn-as/icons-svelte

## pnpm
pnpm i -D @gn-as/icons-svelte

Usage

Basic

Import the icon from the @gn-as/icons-svelte/lib folder. See the Icon Index for a list of supported icons.

<script>
  import Apps from "@gn-as/icons-svelte/lib/Apps.svelte";
</script>

<Apps />

Custom size

Use the size prop to specify the icon size.

Supported icon sizes include 16, 20, 24, and 32.

The default size is 16.

<Apps size={16} />
<Apps size={20} />
<Apps size={24} />
<Apps size={32} />

Custom props

$$restProps are forwarded to the svg element.

You can use fill to customize the color or pass any other valid svg attribute to the component.

<Apps fill="red" class="icon" />

Labelled

<Apps aria-label="Apps" />

Labeled icon that can have focus

<Apps aria-label="Apps" tabindex="0" />

Labelled by

<label id="apps-list">Apps</label>

<Apps aria-labelledby="apps-list" />

API

Props

All props are optional.

| Name | Type | Default value | | :---- | :-------------------------------------------- | :------------ | | size | 16 | 20 | 24 | 32 | 16 | | title | string | undefined |

Releasing

This library is dependent on the @gn-as/icons library and updates are generally driven by a new release of that package bringing in new icons. Therefore, generally you only need to:

  1. Bump the version of the @gn-as/icons package in package.json.
  2. Run npm install to update the package-lock.json file.
  3. [If icons have been added] Update the tests to reflect expected changes from new icons being added.
    • There are a couple of tests that verify the output of the Svelte components and verify that the quantity of icons has not changed in an unexpected way. These tests need to be updated.
    • First, you can run the tests by running npm run test. If new icons were added and no tests are broken, something is likely not published correctly in the @gn-as/icons package.
    • You'll need to update the quantity of icons: increment the number on the failing test to the correct value, confirming the number "makes sense" relative to your expectations.
    • A snapshot is compared as well and will likely fail. To fix this, delete the contents of tests/snapshots/index.test.ts.snap and run the tests again to update the snapshot file.
    • Verify all tests pass successfully.
  4. Run npm run prepack to update the ICON_INDEX.md file.
  5. Commit changes following the Conventional Commits specification
    • New icons coming in would be a feat type, as it's bringing in a new icon; the equivalent of a "feature" in this package.
    • Otherwise, it would be a type of fix.

Regardless of the changes published, the overall release process is the same:

  1. Make changes and commit following the Conventional Commits specification.
  2. Create a new merge request with the main as the "Source" branch and release being "Target" branch.
  3. Wait for the CI pipeline to succeed.
  4. Merge.

This publishes a new tagged release and NPM package automatically via the CI pipeline.

Changelog

The CHANGELOG is only visible on the release branch.

Contributing

License

Apache 2.0