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

@elao/admin

v0.2.2

Published

Administration theme

Downloads

31

Readme

Elao admin

Demo

Installation

npm install @elao/admin

Usage

In HTML page

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="dist/elao-admin.css">
    <script src="dist/elao-admin.js" async></script>
  </head>
  <body>
    <script>
    window.addEventListener('load', function onLoad() {
      const { Collapsible, Drop, Tree, MobileSidebar } = elaoAdmin;

      Collapsible.init();
      Drop.init();
      Tree.init();
      MobileSidebar.init();
    });
    </script>
  </body>
</html>

In your app's build:

/* assets/js/app.js */
import { Collapsible, Drop, Tree, MobileSidebar } from '@elao/admin';
// Or with ADM Modules:
const { Collapsible, Drop, Tree, MobileSidebar } = require('@elao/admin');

Collapsible.init();
Drop.init();
Tree.init();
MobileSidebar.init();

Pre-built theme

If you just want to give a try and use the regular theme and component, you can use the pre-built CSS:

/* assets/style/app.scss */

// Import Work Sans font
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;600&display=swap');

// Import elao/admin main style file.
@import '@elao/admin';

// Customize style with variables
@import './variables';

Custom theme

If you want to customize the theme, and have a more complete experience to build your own components, based on the design system token and Tailwind helpers, you can install the Tailwind dependencies:

npm install -D tailwindcss postcss autoprefixer

Note: If you're using Webpack, you might need to add & configure the postcss-loader as well.

and create a tailwind.config.js file at the root of your project:

import { customize } from '@elao/admin/elao-design-system';

/** @type {import('tailwindcss').Config} */
module.exports = customize({
  content: [
    './templates/**/*.html.twig',
    './assets/**/*.js',
    // https://tailwindcss.com/docs/content-configuration#working-with-third-party-libraries
    './node_modules/@elao/admin/src/**/*.js',
  ],
  theme: {
    extend: {
      colors: {
        // primary: {
        //   DEFAULT: 'blue',
        // },
      },
      spacing: {
        // '7': '2rem',
      },
    },
  },
});

Create a postcss.config.js file at the root of your project:

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  }
}

Then, in your main SCSS file:

// Import Work Sans font
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;600&display=swap');

@import '@elao/admin/style/style.scss';

CSS Variables

These CSS variables can be used with both pre-build or custom build for simple customization of the theme colors. But you can also fine-tune the theme with the Tailwind configuration instead for more flexibility.

/* assets/style/variables.scss */
:root {
  // Primary color is expressed as HSL arguments,
  // so the color palette shades can be automatically computed:
  --color-primary: 8, 81%, 50%;
  --color-primary-hue: 8;
  // A value is auto-generated from primary color shades, 
  // but can still be overridden:
  --color-primary-dark: #353c79;
  
  // The following colors are expressed as RGB arguments,
  // so it can be used with Tailwind opacity modifier syntax:: 
  --color-success: 0, 204, 153;
  --color-warning: 255, 202, 40;
  --color-info: 33, 158, 188;
  --color-danger: 239, 64, 85;
  --color-accessibility-highlight: 237, 238, 250;

  --text: #51607a;
  --text--dark: #384257;
  --text--light: #9e9a9a;
  --text--lighter: #bcb7b7;
  
  --border: #faeded;
  --border--dark: #f2d2d2;
  
  --background: #fafaff;
  --background--dark: #e2e4f7;
  
  --primary-font: 'Work Sans';
}

Features

Contributing

To the library

Install dependencies:

make install

Build with:

make build

Watch with:

make watch

To the demo

Note: For the best experience, you can simply run make serve in the root of the project, to serve both the library and the demo application and watching for changes.

The demo application lives inside the demo folder:

cd demo

It's a Symfony application used to dynamically generate a static site with Stenope with random but realistic data.

It requires:

In order to boot the application for development purposes, you need to build the library if not already done:

cd ../ && make build && cd demo

Then, you need to start a Symfony web server to expose the application, as well as a Webpack dev-server to build assets with HMR enabled.

➡️ Run the following command in order to start both servers:

make serve

ℹ️ The Symfony server command will display the URL to access the app (usually http://127.0.0.1:8000)

Publish a new version

  1. Update the version in package.json
  2. Create a new release and tag for this version with release X.Y.Z and tag vX.Y.Z.

Fontello

  • make fontello.push will open your fontello project on http://fontello.com/.
  • Modify your font on http://fontello.com/ then click on "Save session".
  • make fontello.pull will download your modifications and update project files.
  • Commit the modifications.