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

@jp-olvera/jp-viaducto-components

v7.3.8

Published

Los componentes de este repositorio están diseñados particular de los proyectos de viaducto

Downloads

5

Readme

jp-viaducto-components

status

Codacy Badge

Installation

  npm install @jp-olvera/jp-viaducto-components

Use

In order to use our components you need to wrap your application with our ConfigProvider.

import React from 'react';
import ReactDOM from 'react-dom';
import { ConfigProvider } from '@jp-olvera/jp-viaducto-components';

import App from './App';

ReactDOM.render(
  <React.StrictMode>
    <ConfigProvider>
      <App />
    </ConfigProvider>
  </React.StrictMode>,
  document.getElementById('app')
);

Overwrite configurations

Through our ConfigContext, you can get access to the default configurations and to the updateConfig function. You can find all the available configurations here

Note: There are configurations that are objects, if you want to overwrite some the keys, you need to provide the rest of them, for example iy you want to overwrite the xs breakpoint, you also need to provide the sm,md,lg andxl breakpoints, check the example below.

import React, { useContext, useEffect } from 'react';
import { ConfigContext } from '@jp-olvera/jp-viaducto-components';

const App = () => {
  const { updateConfig } = useContext(ConfigContext);

  const myConfig = {
    breakpoints: {
      xs: '20rem', //'320px'
      sm: '36rem', //'576px'
      md: '48rem', //'768px'
      lg: '62rem', //'992px'
      xl: '90rem', //'1440px'
      //... or any sizes
    },
  };
  useEffect(() => {
    updateConfig(myConfig);
  }, [myConfig]);

  return <div></div>;
};

Storybook

Find all about our components in the Storybook Project

Modal

The active and inactive states must be managed manually, you should provide the active state and a function to mutate it handleActive. By default the modal will call the handleActive after someone clicks on the overlay, unless you set the allowClickOutside property to false.

...
import { ConfigProvider, Modal } from '@jp-olvera/jp-viaducto-components';

export const SomeComponent = () => {
  const [active, setActive] = useState(false);
  const handleActive = () => {
    setActive(!active);
  }
  return (
    <Modal active handleActive = {handleActive}>
      {% Your modal content %}
    </Modal>
  )
}

Table

As a design system we are not providing extra functionality in the tables like filtering and ordering, although you can use our WrapperTable component to wrap your table, and add that extra functionality you want with React Table.

You can use our WrapperTable with the hooks provided by React Table because both are meant to use with semantic HTML.


import { WrapperTable } from '@jp-olvera/jp-viaducto-components';

const Component () => (
  <WrapperTable>
    <table>
      <tbody>
        <tr>
          <th scope="col">Header 1</th>
          <th scope="col">Header 2</th>
        </tr>
        <tr>
          <td>Data 1</td>
          <td>Data 2</td>
        </tr>
      </tbody>
    </table>
  </WrapperTable>
);