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

@belray-ventec/geslub-platform-react-ui

v2.4.5

Published

### Instalar libreria

Downloads

264

Readme

geslub-platform-react-ui

Instalar libreria

npm i @belray-ventec/geslub-platform-react-ui

Modo de uso

Table

import { Table } from 'geslub-platform-react-ui';

export default function Component(): {

	return (
			<Table
			data={[{id: 1, name: 'ProductName', price. 21},
			{id: 2, name: 	'ProductName2', price. 50}
			]}
			columns={[{label: 'name', getValue: (item) => item.name}, {label: 'price', getValue: (item) => item.price}]}
			getRowKey={(item) => item.id}
			onDelete={(items) = {console.log(items)}}
			/>
	)

}

| Propiedad | Tipo | Descripción | Requerida | | ----------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | --------- | | data | T[] | | si | | columns | { label: string; getValue: (item: T) => React.ReactNode, isCentered?: boolean; hiddenSort?: boolean }[] | | si | | getRowKey | (d: T) => string number | | si | | onDelete | (d: T[]) => void | | no | | itemsPerPage | number | | no | | actions | label: string; callback: (d: T) => void }[] | | no | | themeColor | string | | no | | showPages | boolean | | no | | showHeaderButtons | boolean | | no | | showAdminOptions | boolean | | no | | showInfo | boolean | | no | | showShare | boolean | | no | | showDownload | boolean | | no | | showDisabled | boolean | Muestra el boton de deshabilitar/habilitar registro | no | | showSee | boolean | | no | | caption | string | | no | | add | () => void | | no | | share | () => void | | no | | onEdit | (d: T) => void | | no | | onDeleteItem | (d: T) => void | | no | | onSee | (d: T) => void | | no | | onDownload | (d: T) => void | | no | | onInfo | (d: T) => void | | no | | onShare | (d: T) => void | | no | | onDisabled | (d: T) => void | Callback que regresa el item para ser deshabilitado | no | | onEnabled | (d: T) => void | Callback que regresa el item para ser habilitado | no | | getRowIsEnabled | (d: T) => boolean | Callback para especificar que propiedad es la que definira el estado de habilitado/deshabilitado de la fila | no | | isLoading | boolean | | no |

Search

import { Search } from 'geslub-platform-react-ui';

export default function Component(): {

	const onSearchFn = (search: string) => { console.log(search) }

	return (
            <Search
                handleSearch={(search: string) => onSearchFn(search)}
                timeDebounce={500}
            />
	)

}

| Propiedad | Tipo | Requerida | | ------------ | -------------------------- | --------- | | handleSearch | (search: string) => void | si | | timeDebounce | number | no |

Tag

import { Tag } from 'geslub-platform-react-ui';

export default function Component(): {

	const onClickFn = () => {}

	return (
            <Tag color='#fff' backgroundColor='#00a65a' onClick={() => onClickFn()}>Editar</Tag>
	)

}

| Propiedad | Tipo | Requerida | | --------------- | ------------------------ | --------- | | color | string | no | | backgroundColor | number | no | | onClick | (text: string) => void | no |

TagList

import { TagList } from 'geslub-platform-react-ui';

export default function Component(): {

	const tags = [{id:1, name: 'Tag 1'}, {id:1, name: 'Tag 2'}]

	return (
            <TagList
			data={tags}
			getRowKey={(tag) => tag.id}
		    getValue={(tag) => tag.name}
			align='left'
			rounded
			 />
	)

}

| Propiedad | Tipo | Requerida | | --------------- | ------------------------- | --------- | | data | T[] | si | | getRowKey | (d: T) => string number | si | | getValue | (d: T) => string number | si | | backgroundColor | number | no | | color | string | no | | onClick | (item: string) => void | no | | rounded | boolean | no | | align | 'left' 'center' 'right' | no |

Drawer

import React, { useState } from 'react';
import { Link } from "react-router-dom";
import { Drawer, DrawerItem, DrawerSubItem } from 'geslub-platform-react-ui';

export default function Component(): {

  const [isOpen, setIsOpen] = useState(false);

  const SUB_MENU = [{
                      label: 'Home',
                      icon: <Icon icon="Home" size={25} color='#fff' /> ,
                      to: '/'
                    },
                    {
                      label: "Lubricantes Especiales",
                      icon: <Icon icon='Document' size={25} color='#fff'/>,
                      sub: [
                        { label: "Información técnica", to: '/informacion-tecnica' },
                        { label: "Certificados", to: '/certificados' },
                        { label: "Marketing", to: '/marketing' },
                        { label: "Testimoniales", to: '/testimoniales' },
                        { label: "OEM", to: '/oem' },
                        ],
                      }]

	return (
                <Drawer
                    title="Geslub Platform"
                    isOpen={isOpen}

                    onStateChange={() => setIsOpen(!isOpen)}
                />

                {SUB_MENU.map((listItem) =>
                  listItem.sub ? (
                    <DrawerSubItem
                      title={listItem.label}
                      isOpen={isOpen}
                      onStateChange={() => setIsOpen(!isOpen)}
                      key={listItem.label}
                      icon={listItem.icon}
                    >
                    {listItem.sub.map((subItem) => (
                      <Link to={subItem.to}>
                          <DrawerItem
                            isOpen={isOpen}
                            key={subItem.label}
                            icon={subItem.icon}
                          >
                            {subItem.label}
                          </DrawerItem>
                      </Link>
                    ))}
                    </DrawerSubItem>
                  ) : (
                    <Link to={listItem.to}>
                        <DrawerItem
                          isOpen={isOpen}
                          key={listItem.label}
                          icon={listItem.icon}
                          isActive={listItem.isActive}
                        >
                          {listItem.label}
                        </DrawerItem>
                    </Link>
                  )

                </Drawer>
				<App />
	)

}

| Propiedad | Tipo | Descripcion | Requerida | | ------------- | ------------ | ---------------------------------------------------------------------------------- | --------- | | isOpen | boolean | | si | | onStateChange | () => void | Maneja el estado del Drawer (setState(!state)) | si | | title | ReactNode | | no | | logo | string | | no | | themeColor | string | | no | | children | ReactNode | Contenido del Drawer se suguiere utilizar el componente DrawerItem o DrawerSubItem | si | | onLogoClick | () => void | | no |

DrawerItem

| Propiedad | Tipo | Descripcion | Requerida | | --------- | ----------- | ---------------------------------------------- | --------- | | isOpen | boolean | | si | | icon | ReactNode | Maneja el estado del Drawer (setState(!state)) | no | | isActive | boolean | Establece de color el item activo | no | | children | string | Titulo | no |

Modal

import React, { useState } from 'react';
import { Modal } from 'geslub-platform-react-ui';

export default function Component(): {

	const [isModalOpen, setIsModalOpen] = useState(false);

    const closeModal = () => {
    setIsModalOpen(false);
  };

	return (
                <div>
      <button
      onClick={() => setIsModalOpen(true)}
      />
      <Modal
        title={'Modal Title'}
        isOpen={isModalOpen}
        onRequestClose={closeModal}
        position={'top'}
        size={'medium'}
        show
        okText={'Guardar'}
        cancelText={'Cancelar'}
        onOk={() => console.log('ok')}
        onCancel={() => console.log('cancel')}
      >
        <h2>Modal Title H2</h2>
        <p>
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi, culpa,
          odio doloribus ratione sed soluta explicabo id nam ea quas cumque. Odio
          non accusamus dignissimos praesentium deleniti nulla, perferendis illum.
          Aut consequatur culpa sequi odio sunt voluptatem explicabo, labore
        </p>
      </Modal>
    </div>

| Propiedad | Tipo | Requerida | | -------------- | --------------------------------------------------- | --------- | | isOpen | boolean | si | | onRequestClose | () => void | si | | title | string | si | | position | 'top'\|'center'\|'bottom' | no | | size | 'small'\|'medium'\|'large'\|'extra_large'\|'full' | no | | okText | string | no | | cancelText | string | no | | onOk | () => void | no | | showOk | boolean | no | | onCancel | () => void | no | | themeColor | string | no | | children | ReactNode | no |