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

react-matecu

v0.0.4

Published

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) Libreria con complementos y utilidades para el desarrollo de aps

Downloads

32

Readme

React-Matecu

License: MIT Libreria con complementos y utilidades para el desarrollo de aps

Instalar

npm install react-matecu

Agregar estilos para la fuente de los iconos

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200"/>

MatecuTopbarLayout

Crea la estructura para una página que contiene un topbar en posición fija a la que se le pueden agregar botones de acciones, titulo y buscador.

El contenido de la página tiene una función que se puede llamar para realizar un desplazamiento hacia arriba.

Ejemplo básico

import { useRef, useState } from "react";
import { MatecuTopbarLayout } from "react-matecu";
import { MatecuTopbarHeaderRow } from "react-matecu";
import { MatecuTopbarHeaderColumn } from "react-matecu";
import { MatecuTopbarAction } from "react-matecu";
import { MatecuTopbarFab } from "react-matecu";
import { MatecuTopbarSearch } from "react-matecu";
import { MatecuTopbarTitle } from "react-matecu";
import { MatecuTopbarBody } from "react-matecu";

function MatecuLayout() {
  const searchValueChangesHandler = (value) => {
    console.log("Buscando valor", value);
  };
  const tobarLayout = useRef();
  const [mobileStyle, setMobileStyle] = useState(false);
  const resize = (width) => {
    console.log("resizing", width);
  };
  return (
    <>
      <MatecuTopbarLayout
        resizeHandler={resize}
        ref={tobarLayout}
        prominent={false}
        mobileStyleHandler={setMobileStyle}
        firstRow={
          <MatecuTopbarHeaderRow
            leftColumn={
              <MatecuTopbarHeaderColumn>
                <MatecuTopbarAction>
                  <small>NAV</small>
                </MatecuTopbarAction>
                <MatecuTopbarFab mobileStyle={mobileStyle}>
                  <button
                    className="fabbtn"
                    style={{
                      width: "50px",
                      height: "50px",
                      borderRadius: "50%",
                    }}
                  >
                    ADD
                  </button>
                </MatecuTopbarFab>
                <MatecuTopbarTitle>Título de la página</MatecuTopbarTitle>
              </MatecuTopbarHeaderColumn>
            }
            rightColumn={
              <MatecuTopbarHeaderColumn>
                <MatecuTopbarSearch
                  mobileStyle={mobileStyle}
                  placeholder="Buscar..."
                  valueChangesHandler={searchValueChangesHandler}
                  clearIcon={"X"}
                  searchIcon={"O\\"}
                />
                <MatecuTopbarAction>
                  <small>MENU</small>
                </MatecuTopbarAction>
              </MatecuTopbarHeaderColumn>
            }
          />
        }
        body={
          <MatecuTopbarBody>
            Contenido de la página...
            <button onClick={() => tobarLayout.current.scrollTop()}>
              Scroll
            </button>
          </MatecuTopbarBody>
        }
      ></MatecuTopbarLayout>
    </>
  );
}
export default MatecuLayout;

Componentes

MatecuTopbarLayout:

Componente principal

Variables de estilos

  • --mtb-border : Borde
  • --mtb-margin : Margen
  • --mtb-width : Ancho
  • --mtb-height : Alto
  • --mtb-primary-color : Color principal (Color de la barra)
  • --mtb-bar-height : Alto de la barra
  • --mtb-bar-prominent-height : Alto de la barra en modo prominente

Properties

  • prominent : Valor boolean que indica si la barra es prominente
  • mobileWidth: Valor numérico que indica el ancho máximo que debe considerarse para aplicar estilos para dispositivos móviles
  • mobileStyle: Indica si se deben aplicar estilos para dispositivos móviles

Forwards Functions

  • scrollTop : Funcion que se puede llamar desde el componente padre y hace scroll del contenido hacia la parte superior

handlers

  • resizeHandler: Evento que se emite cuando se redimenciona el componente y retorna el nuevo valor del ancho.
  • mobileStyleHandler: Evento que se emite cuando se redimenciona el componente e indica si se deben aplicar estilos para dispositivos móviles.

MatecuTopbarHeaderRow

Crea una fila para agregar contenido en el encabezado, pueden agregarse hasta 2 filas y es necesario agregarlos en MatecuTopLayout con las propiedades firstRow o secondRow

Variables de estilos

  • --mtb-row-padding
  • --mtb-row-margin
  • --mtb-row-width

MatecuTopbarHeaderColumn

Crea una columna para agregar contenido a una fila del encabezado es necesario agregar en el componente MatecuTopbarHeaderRow con las propiedades leftColumn o rightColumn

MatecuTopbarAction

Crea un contenedor para agregar acciones como links o botones preferentemente en formato de iconos

Variables de estilos

  • --mtb-action-padding
  • --mtb-action-margin

MatecuTopbarFab

Crea un contenedor para agregar un boton (FAB)

Variables de estilos

  • --mtb-fab-mobile-bottom-position : Posición relativa a la parte inferior del componente pricipal que se aplica cuando estan activos los estilos para dispositivos móviles.

  • --mtb-fab-mobile-right-position: Posición relativa a la parte inferior del componente MatecuTopbarLayout

Propiedades

  • mobileStyle: Valor boolaneo que indica si se ajustan los estilos para dispositivos móviles
  • display: Valor boolean que indica si se debe mostrar el componente

MatecuTopbarSearch

Crea un campo de texto para hacer búsquedas

Handlers

  • valueChangesHandler: Emite un evento con el valor del texto ingresado en el campo de búsqueda

Propiedades

  • mobileStyle: Valor boolaneo que indica si se ajustan los estilos para dispositivos móviles
  • placeholder: Valor del Placeholder del campo de búsqueda
  • value: Especifica el valor de la búsqueda
  • display: Valor boolean que indica si se debe mostrar el componente

Iconos

Se pueden reemplazar los iconos por unos personalizados usando las propiedades "searchIcon" y "clearIcon" para agregar los componentes que los van a sustituir

MatecuTopbarTitle

Crea un contenedor para agregar un título a la página.

Variables de estilos

  • --mtb-title-padding
  • --mtb-title-margin

MatecuTopbarBody

Crea un contenedor para agregar el contenido de la página

Variables de estilos

--mtb-body-padding: Padding para el contenido --mtb-body-background: Fondo del contenido; --mtb-body-padding-button: Padding inferior (Es utilizado para asignar un espacio al Botón principal (FAB) cuando tiene asignados los estilos para dispositivos móviles)