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

sprintify-ui

v0.8.68

Published

<p align="center"> <img src="https://demo.sprintify.app/img/logo/logo-side.svg" width="190" /> </p>

Downloads

2,874

Readme

About Sprintify UI

Sprintify UI is a Vue 3 components library for Vite projects using a Laravel backend.

Storybook Documentation https://sprintify-ui.witify.io

Getting started

Install

npm i sprintify-ui --save

Peer dependencies:

sprintify-ui is highly opinionated and requires multiple dependencies :

@vueuse/core axios lodash luxon pinia qs tailwindcss vue vue-router

To install them all :

npm i @vueuse/core axios lodash luxon pinia qs tailwindcss vue vue-router --save

Basic Configuration

import { createApp } from 'vue';
import axios from "axios";
import { createPinia } from "pinia";
import { createRouter, createWebHistory } from "vue-router";
import SprintifyUI from "sprintify-ui";
import { messages as SprintifyUIMessages } from "sprintify-ui";
import App from './App.vue';

// Import your TailwindCSS *before* importing Sprintify UI CSS
import "./assets/tailwind.css";

// Import Sprintify UI CSS
import "sprintify-ui/dist/style.css";

/** Axios */

const http = axios.create({
  useCredentials: true,
});

/** Vue Router */

const router = createRouter({
  routes: [],
  history: createWebHistory("admin"),
});

const app = createApp(App);

/** Vue Plugins */

app.use(router);
app.use(createPinia());

// Import Sprintify UI plugin
app.use(SprintifyUI, {
  http, // Default axios instance for <BaseAutocompleteFetch>, <BaseDataIterator>, etc...
  upload_url: "/api/files/upload", // Default upload URL for <BaseFileUploader>
});

app.mount("#app");

TailwindCSS

Make sure you have all the required tailwindCSS plugins installed:

npm i tailwindcss @tailwindcss/forms @tailwindcss/typography @tailwindcss/aspect-ratio -D

Update tailwind.config.js

Update your content list :

{
  content: [
    //...,
    "./node_modules/sprintify-ui/src/**/*.ts",
    "./node_modules/sprintify-ui/src/**/*.js",
    "./node_modules/sprintify-ui/src/**/*.vue",
  ],
}

Update your plugin list :

plugins: [
  //...,
  require("sprintify-ui/tailwindcss"),
  require("@tailwindcss/forms"),
  require("@tailwindcss/typography"),
  require("@tailwindcss/aspect-ratio"),
],

Configure using unplugin-vue-components

Add a custom resolver

Components({
  resolvers: [
    (componentName) => {
      if (componentName.startsWith("Base"))
        return { name: componentName, from: "sprintify-ui" };
    },
  ],
}),

Notifications and Dialogs

To use notifications and dialogs, your main layout must contain the <BaseAppSnackbars> and <BaseAppDialogs> components. These components will observe the Pinia store and render dialogs and notifications.

<template>
  <RouterView></RouterView>
  <BaseAppSnackbars />
  <BaseAppDialogs />
</template>

<script lang="ts" setup>
</script>

Custom snackbars and dialogs

You may 100% customize the look and feel of dialogs and snackbars by removing <BaseApp> and instead creating your own render logic. Here's a simple example to render snackbars:

<template>
  <Teleport to="body">
    <div class="pointer-events-none fixed inset-0 flex items-end justify-end p-6 md:p-8">
      <div class="w-full max-w-sm">
        <div v-for="snackbar in snackbars" :key="snackbar.id">
          <h2>{{ snackbar.title }}</h2>
          <p>{{ snackbar.text }}</p>
        </div>
      </div>
    </div>
  </Teleport>
</template>

<script lang="ts" setup>
import { useSnackbarsStore } from 'sprintify-ui';

const snackbarsStore = useSnackbarsStore();

const snackbars = computed(() => {
  return snackbarsStore.snackbars;
});
</script>

Configure countries and regions globally

In order to make BaseAddressForm work correctly, you must import countries and regions to Sprintify UI.

Each country must adhere to the following interface:

  • code: string
  • name: string

Each region must adhere to the following interface:

  • code: string
  • name: string
  • country_id: string
app.use(SprintifyUI, {
  http,
  // Import while initializing Sprintify UI
  countries: window.yourCountryList,
  regions: window.yourRegionList,
});

Using BaseAddressForm with Google Maps Autocomplete

Add this snippet to your HTML <head>. Replace YOUR_API_KEY with you API key.

<script defer async src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>

Using components

All components are globally available, you can use them without importation:

<template>
  <BaseAlert title="Test" color="danger"></BaseAlert>
</template>

<script lang="ts" setup>
</script>  

Make changes

Git add .

git add .

Commit

For your commit you must run the following code:

npm run commit

Release

To release (only from main after review)

npm run release

Push to git

git push --follow-tags origin main

Publish to npm

npm publish