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

@wedgekit/layout

v2.2.0

Published

@wedgkit/layout exports components that should be used to generate standard screen layouts that are approved by the design system.

Downloads

41

Readme

Layout

@wedgkit/layout exports components that should be used to generate standard screen layouts that are approved by the design system.

Layout.App

Layout.App consists of a layout with optional headers, drawers and notifications that match the design system.

Example

import Layout from '@wedgekit/layout';
import color from '@wedgekit/color';
import styled from 'styled-components';

const HeaderContainer = styled.div`
  background: ${color.N700};
  color: ${color.N050};
  padding: 8px;
`;

const ResourceContainer = styled.div`
  background: ${color.N200};
  height: 50vh;
  padding: 8px;
`;

const NotificationContainer = styled.div`
  background: ${color.R100};
  padding: 8px;
`;

const Example = () => {
  return (
    <Layout.App
      header={<HeaderContainer>Header</HeaderContainer>}
      resource={<ResourceContainer>Resource</ResourceContainer>}
      notifications={<NotificationContainer>Notification</NotificationContainer>}
      resourceMounted
      resourceType="drawer"
      drawerLeft
      drawerWidth="10vw"
    >
      {() => <div style={{ padding: '40px' }}>Content</div>}
    </Layout.App>
  );
};

render(<Example />);

API

| Prop | Required | Type | Default | Description | | --------------- | -------- | ------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | header | ❌ | JSX.Element | null | An application header designed to be placed at the top of the app | | notifications | ❌ | JSX.Element | null | Notifications/Alerts components to be rendered below the header and above the rest of the content. | | resource | ❌ | JSX.Element | | A resource to be rendered when resourceMounted is true | | resourceMounted | ❌ | boolean | false | Whether or not the resource is mounted | | resourceType | ❌ | 'drawer'/'drawer-overlay'/'drawer-unstyled'/'drawer-mobile' | '' | The type of resource mounting the App will perform. The default drawer type will apply standard padding and scrolling. The overlay drawer will dim the rest of the screen act similarly to a modal. The unstyled drawer is similar to the default drawer with all styling removed (use this with render sticky action rows). The mobile drawer is best used in mobile applications. | | drawerLeft | ❌ | boolean | false | When true show the drawer on the left side of the screen | | drawerWidth | ❌ | string | | Custom size to set as the drawer width |

Layout.Grid

Layout.Grid is a dynamic grid that can resize children components relative to the view window's dimension.

Usage

import Layout from '@wedgekit/layout';
import color from '@wedgekit/color';

const Example = () => {
  return (
    <>
      <Layout.Grid
        areas={['red blue green']}
        rows={['20vh']}
        areasLg={['red blue', 'green .']}
        rowsLg={['20vh', '20vh']}
        areasMd={['red', 'blue', 'green']}
        rowsMd={['20vh', '20vh', '20vh']}
      >
        <Layout.Section area="red" style={{ background: 'red' }}>
          Red
        </Layout.Section>
        <Layout.Section area="blue" style={{ background: 'blue' }}>
          Blue
        </Layout.Section>
        <Layout.Section area="green" style={{ background: 'Green' }}>
          green
        </Layout.Section>
      </Layout.Grid>
      Shrink/Expand your browser to see the boxes arrange themselves.
    </>
  );
};

render(<Example />);

API

| Prop | Required | Type | Description | | ------------ | -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | areas | ✅ | Array<string> | An array of grid-template-areas with each entry corresponding to a row | | areasXl | ❌ | Array<string> | An array of grid-template-areas which display above 1200px | | areasLg | ❌ | Array<string> | An array of grid-template-areas to display up to 1200px | | areasMd | ❌ | Array<string> | An array of grid-template-areas up to 992px | | areasSm | ❌ | Array<string> | An array of grid-template-areas up to 768px | | areasXs | ❌ | Array<string> | An array of grid-template-areas up to 576px | | columns | ❌ | Array<string> | An array of grid-template-columns with each entry corresponding to a column. Can accept a number (N) which as a column which will result in minmax(0, Nfr). If a string is provided the string will be directly applied with nothing added to it. | | columnsXl | ❌ | Array<string> | An array of grid-template-columns which display above 1200px | | columnsLg | ❌ | Array<string> | An array of grid-template-columns to display up to 1200px | | columnsMd | ❌ | Array<string> | An array of grid-template-columns up to 992px | | columnsSm | ❌ | Array<string> | An array of grid-template-columns up to 768px | | columnsXs | ❌ | Array<string> | An array of grid-template-columns up to 576px | | rows | ❌ | Array<string> | An array of grid-template-rows with each entry corresponding to a row | | rowsXl | ❌ | Array<string> | An array of grid-template-rows which display above 1200px | | rowsLg | ❌ | Array<string> | An array of grid-template-rows to display up to 1200px | | rowsMd | ❌ | Array<string> | An array of grid-template-rows up to 992px | | rowsSm | ❌ | Array<string> | An array of grid-template-rows up to 768px | | rowsXs | ❌ | Array<string> | An array of grid-template-rows up to 576px | | justify | ❌ | string | Passes in a justify-content setting | | justifyItems | ❌ | string | Passes in a justify-items setting | | align | ❌ | string | Passes in a align-items setting | | place | ❌ | string | Passes in a place-items setting | | className | ❌ | string | A string of the className to be applied to the Grid component | | children | ✅ | JSX.Element | |

Layout.Section

Layout.Section is the dynamic child of a Layout.Grid.

API

| Prop | Required | Type | Description | | ---- | -------- | ---- | ----------- |

| children | ✅ | JSX.Element |

| area | ✅ | string | The grid-template area to which this section belongs |

| ref | ❌ | React.Ref<HTMLDivElement> | Optional ref for targeting the underlying HTML element |