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

svaria-toolkit-test

v0.0.30

Published

Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).

Downloads

22

Readme

create-svelte

Everything you need to build a Svelte library, powered by create-svelte.

Read more about creating a library in the docs.

Creating a project

If you're seeing this, you've probably already done this step. Congrats!

# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app

Developing

Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Everything inside src/lib is part of your library, everything inside src/routes can be used as a showcase or preview app.

Building

To build your library:

npm run package

To create a production version of your showcase app:

npm run build

You can preview the production build with npm run preview.

To deploy your app, you may need to install an adapter for your target environment.

Publishing

Go into the package.json and give your package the desired name through the "name" option. Also consider adding a "license" field and point it to a LICENSE file which you can create from a template (one popular option is the MIT license).

To publish your library to npm:

npm publish

=================> basic layout for writing the read me <=================

componenet name

anatomy of componenet:

import component from our library:

Initalize componenet:

Initalize any optional extras

Default Settings:

aria-label

explicitly lay out the aria label and how to edit it

componenet Elements:

describe element and what can be done with them -for each element

any specifics for overiding

In-line Styling

=================> starting the readme for user <=================

Navigation Bar component

anatomy of a NavBar:

typically the heading bar will have the NavBar component as the top level element. This will hold a heading and set a links that will be initalized when the componened is rendered. These are child elements inside of the NavBar component.

import NavBar from our library:

import NavBar from "SvARIA"

Initalize NavBar:

Pass the properties heading and routes your data:

  • pass links an array of objects containing name and herf properties: [{name, herf}] Example:
<NavBar heading='this is my page heading' routes={[{herf:route1, name:linktopage1} {herf:route2, name:linktopage2}]}>

Default Settings:

Each element in our components comes with a set of properties to make sure they are come ARIA complient. The default values are as listed below and can be edited by the developer to best suit their needs.

aria-label

This aria label is what will be read by a screen reader when a user highlights an element. the default aria-label is set to what ever your heading is initalized to. It can be over ridden by passing the new value to ariaLabel

<NavBar ariaLabel='my sites navigation bar'>

NavBar Elements:

each element has an id and a class.

-NavBar (parent element) id: 'navBar', class: "sv-navagation"

-Heading (child element)

id: 'navBar-heading', class: "sv-nav-heading"

-List (child elements)

id: 'navBar-link-i' (where i is the index of that list element), class: "sv-nav-link"

Overiding the default ID:

id is overidable only in the NavBar, it will be dynamically updated for all child elements.

<NavBar id="myNavBarElem">

will update:

  • heading id to: 'myNavBarElem-heading'
  • list element id to: 'myNavBarElem-link-i' (where i is the index of that list element)

In-line Styling

Access via style props: Navigation bar div's = style Heading sub elements = 'h1style' List sub elements = 'linkstyle'

Checkbox Componenet

anatomy of Checkbox:

SvAria's checkbox closly mimics any other checkbox component, some things are abstracted away. The imported component has wrapped the label and the checkbox together. When initalizing a SvARIA checkbox you specify the label at the same time.

import component from our library:

import Checkbox from 'SvARIA'

Initalize componenet:

<Checkbox content='The label for this check box'>

aria-label

When initalized the ARIA label is dynamically created with your content in mind, and changes on check.

  • aria-label, unchecked:${content}, is unchecked
  • aria-label, checked: ${content}, is checked

to overide this label to meet your needs, you can use the ariaLabel property when initalizing the checkbox:

<Checkbox ariaLabel='updated ARIA label'>

In-line Styling

To utalize in-line styling on the individual elements you can set the props inputStyle for the checkbox and labelStyle for the label.

<Checkbox inputStyle='background-color=yellow' labelStyle='color=black'>