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

@2dine/framework-ui

v2.1.91

Published

2Dine framework UI design

Downloads

427

Readme

This is a Tailwind CSS wrapper for react.

Getting Started

First, run the development server:

npm install @2dine/framework-ui
# or
yarn add @2dine/framework-ui

Usage Sidebar

Here is a quick example to get you started, it's all you need:

import { Sidebar } from "../src/components";
import "../styles/globals.css";

function App({ Component, pageProps }) {
  const primaryLinks = [
    {
      href: `/`,
      label: "Inicio",
      // exact: true,
      // icon: (
      //   <Home className="mr-4 h-6 w-6 text-primary-200 group-hover:text-primary-200 group-focus:text-primary-200 transition ease-in-out duration-150" />
      // ),
    },
    {
      href: `/contracts`,
      label: "Contratos",
      // exact: true,
      // icon: (
      //   <Scale className="mr-4 text-primary-200 transition ease-in-out duration-150" />
      // ),
    },
    {
      href: `/consumptions`,
      label: "Lecturas",
      // exact: true,
      // icon: (
      //   <Calculator className="mr-4 text-primary-200 transition ease-in-out duration-150" />
      // ),
    },
    {
      href: `/payments`,
      label: "Ingresos",
      // exact: true,
      // icon: (
      //   <Cash className="mr-4 text-primary-200 transition ease-in-out duration-150" />
      // ),
    },
  ];

  const secondaryLinks = [
    {
      href: `/settings`,
      label: "Configuración",
      // icon: (
      //   <Cog className="mr-4 text-primary-200 transition ease-in-out duration-150" />
      // ),
    },
    { href: `/help`, label: "Ayuda" },
    {
      href: `/about`,
      label: "Acerca de",
      // icon: (
      //   <ShieldCheck className="mr-4 text-primary-200 transition ease-in-out duration-150" />
      // ),
    },
  ];

  return (
    <div className="relative h-screen flex overflow-hidden bg-gray-100">
      <Sidebar
        logo={{
          src:
            "https://tailwindui.com/img/logos/workflow-logo-indigo-500-mark-white-text.svg",
          alt: "Workflow",
        }}
        withHeader
        primaryLinks={primaryLinks}
        secondaryLinks={secondaryLinks}
        footer={
          <div className="flex-shrink-0 flex border-t border-primary-800 p-4">
            <a href="#" className="flex-shrink-0 group block">
              <div className="flex items-center">
                <div>
                  <img
                    className="inline-block h-9 w-9 rounded-full"
                    src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
                    alt=""
                  />
                </div>
                <div className="ml-3">
                  <p className="text-base md:text-sm font-medium text-white">
                    Tom Cook
                  </p>
                  <p className="text-sm md:text-xs font-medium text-primary-200 group-hover:text-white">
                    View profile
                  </p>
                </div>
              </div>
            </a>
          </div>
        }
      />
      <div className="flex-1 overflow-auto focus:outline-none" tabIndex="0">
        <main className="flex-1 relative pb-8 z-0 overflow-y-auto">
          <Component {...pageProps} />
        </main>
      </div>
    </div>
  );
}

ReactDOM.render(<App />, document.querySelector("#app"));

Yes, it's really all you need to get started.

Usage DynamoFilter

Here is a quick example to get you started, it's all you need:

import { DynamoFilter } from "../src/components";

  const onResolveOptions = () => {
    return new Promise((resolve) => {
      setTimeout(
        () =>
          resolve([
            { label: "Opción 1", value: "key_1" },
            { label: "Opción 2", value: "key_2" },
          ]),
        3000
      );
    });
  };

  return (
    <div className="relative h-screen flex overflow-hidden bg-gray-100">
      <DynamoFilter
        fields={{
          serie: {
            label: "Serie",
            inputType: "input",
            operand: "eq",
          },
          derivativeSerie: {
            label: "Derivada",
            placeholder: "Ingresa el número de serie",
            inputType: "input",
            operand: "eq",
          },
          rutaID: {
              label: "Ruta",
              inputType: "select",
              operand: "eq",
              placeholder: "Selecciona una opción",
              onResolveOptions, /* Regresa un arreglo de options */
          },
          consumo: {
            label: "Consumo",
            inputType: "range",
            type: "volume",
            max: 10000,
            step: 100,
            dependsOn: {
              availableRange: {
                inputType: "switch",
                label: "Habilitar rango",
                description: "",
                parseValue: (value) => value && "between",
              },
            },
          },
          createdAt: {
            label: "Fecha",
            inputType: "date",
            dependsOn: {
              dateType: {
                inputType: "select",
                options: [
                  { label: "Antes de", value: "lt" },
                  { label: "Despues de", value: "gt" },
                  { label: "Entre", value: "between" },
                ],
                label: "Rango de fecha",
                placeholder: "Todos",
              },
            },
          },
        }}
        initialValues={{
          serie: "",
          derivativeSerie: "",
          status: "",
          consumo: [0, 1000000],
          availableRange: false,
          createdAt: new Date().toISOString(),
        }}
        onCancel={() => }
        onSubmit={(values) => console.log("values", values)}
      />
      <div className="flex-1 overflow-auto focus:outline-none" tabIndex="0">
        <main className="flex-1 relative pb-8 z-0 overflow-y-auto">
          <Component {...pageProps} />
        </main>
      </div>
    </div>
  );
}

ReactDOM.render(<App />, document.querySelector("#app"));

Yes, it's really all you need to get started.