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

@sorens/artist-svelte

v0.33.2

Published

an opinionated and clean UI framework for SvelteKit with theme support built-in

Downloads

763

Readme

Artist for Svelte

An opinionated and clean UI framework for SvelteKit

⚠️🚧👷‍♂️⛑️ please note that this package is still in early development stages and APIs might change in the future

license npm latest package npm downloads npm bundle size Code Inspector Code Quality Code Inspector Code Grade Maintainability codecov Testing code structures publishing to NPM FOSSA Status

Website | Documentation

Installation


The easiest way to start with Artist UI is cloning our getting-started template via degit utility

# create a new project in the current directory
npx degit sorenabedi/artist-svelte/examples/getting-started

# create a new project in my-app
npx degit sorenabedi/artist-svelte/examples/getting-started my-app

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

pnpm run dev

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

and rou are all set!

Bootstrapping From Scratch


Bootstrapping a project with Artist UI and svelteKit can be done in Four simple steps:

  • Step 1 - Installing SvelteKit

    If you already have a SvelteKit project, then skip to Step 2. For more information about this step, please refer to the official SvelteKit Documentation

    Initializing a fresh SvelteKit project :

    npm init svelte@next aui-svelte
    cd aui-svelte
    pnpm install
    pnpm run dev -- --open
  • Step 2 - Installing Artist UI

    Installing the Artist UI package with the required dependencies:

    # PNPM (recommended)
    pnpm add -D @sorens/artist-svelte dotenv
    
    # YARN
    yarn add -D @sorens/artist-svelte dotenv
    
    # NPM
    npm install @sorens/artist-svelte dotenv --save-dev
  • Step 3 - SvelteKit Configuration

    Since Artist UI intends to be compatible with Webpack, dotenv package is required for svelteKit's default bundler (ViteJs), as well as configuring the svelte-preprocess to replace process.env.* and process.env[*] to prevent ViteJs from throwing errors.

    Create svelte.config.js file in root directory of your project (if not already exists) with the following structures.

    / project_root/svelte.config.js
    import preprocess from 'svelte-preprocess';
    import dotEnv from 'dotenv';
    
    dotEnv.config();
    
    /** @type {import('@sveltejs/kit').Config} */
    const config = {
    // Consult https://github.com/sveltejs/svelte-preprocess
    // for more information about preprocessors
    preprocess: preprocess({
    	replace: [
    		 [/process.env['NODE_ENV']/g, () => `import.meta.env.MODE`],
    		 [/"process.env.NODE_ENV"/g, () => `import.meta.env.MODE`],
    		 [/process.env['(w+)']/g, (_, match) => JSON.stringify(process.env[match])],
    		 [/process.env.(w+)/g, (_, match) => JSON.stringify(process.env[match])]
    	]
    }),
    
    kit: {
    	// hydrate the <div id="svelte"> element in src/app.html
    	target: '#svelte'
    }
    };
    
    export default config;
  • Step 4 - Importing Styles

    Create a __layout.svelte in src/routes folder (if not already exists) with a global style tag with lang attribute set to scss.

    <!-- project_root/src/routes/__layout.svelte -->
    <slot />
    
    <style global>
    	/* Artist UI global styles (required) */
    	/* Normalize css (optional) */
    	@import '../../node_modules/@sorens/artist-svelte/css/GlobalStyles.css';
    	@import '../../node_modules/@sorens/artist-svelte/css/Normalize.css';
    
    	/* Any other global styles that you might need, goes here. e.g: */
    	html,
    	body {
    		margin: 0;
    		padding: 0;
    		font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    			Arial, 'Noto Sans', 'Liberation Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    			'Noto Color Emoji', Vazir;
    	}
    	html {
    		background-color: hsl(var(--bg-color));
    		color: hsl(var(--fg-color));
    		transition: color 0.3s, background-color 0.3s;
    	}
    	::-webkit-scrollbar {
    		width: 5px;
    		height: 5px;
    		display: block;
    		background: hsl(var(--bg-color));
    	}
    	::-webkit-scrollbar-thumb {
    		background: hsl(var(--fg-color));
    		border-radius: 5px;
    	}
    </style>

Component Usage


All components are exported directly from package root scope, e.g:

<script lang="ts">
	import { Checkbox, Button } from '@sorens/artist-svelte';
</script>

<button variant="fill" color="primary">Accept</button>
<Checkbox color="danger" on:change="()=>console.log('changed')">some text</Checkbox>

License

FOSSA Status