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

@lieberweiss/react-offers

v0.0.1

Published

Downloads

1

Readme

TODO

Usage

import {Offers, OffersProvider, useOffersContext, useEventBus } from "@fasstech/react-offers";
import styles from './styles'
const App = () => {
  const {
    data, // entry data
    setData, // set data
    styles, // entry styles
    setStyles, // set styles

    setCellClassName, // setCellClassName(styleType, cellIndex, className || (classes) => {}, merge = false)
    setRowClassName, // setRowClassName(rowIndex, className || (classes) => {}, merge = false)
    setOverlayColumnClassName, // setOverlayColumnClassName(index, className || (classes) => {}, merge = false)

    showRow, // showRow(row index)
    hideRow, // hideRow(row index)
    showColumn, // showColumn(column index)
    hideColumn, // hideColumn(column index)

    offerInfo // offerInfo()
  } = useOffersContext()

  return <Offers/>;
};

const WrapperApp = () => {
  const data = fetch('/data...');
  return (
    <OffersProvider styles={offerStyles} data={data}>
      <App/>
    </OffersProvider>

  );
};

définition des styles

export const offerStyles = {
  // Required
  default: {
    containerClassName: 'relative w-full pt-5',
    hideClassName: 'hidden',
    overlayClassName: 'absolute top-0 left-0 bottom-0 right-0 min-w-max',
    tableClassName: 'relative min-w-max pb-10'
  },
  columns: {
    rowClassName: 'flex flex-row h-full relative',
    defaultCell: {
      commonClassName: 'w-48 mr-1 flex',
      className: 'border rounded-t-lg bg-yellow-500'
    },
    cells: [
      { commonClassName: 'w-64 mr-1 flex', className: '' },
      { commonClassName: 'w-44 mr-1 flex', className: 'border bg-gray-100 rounded-t-lg' },
      { commonClassName: 'w-48 mr-1 flex', className: 'border bg-gray-100 rounded-t-lg' },
      { },
      { commonClassName: 'w-48 mr-1 flex', className: 'border bg-blue-400 rounded-t-lg' } 
    ]
  },

  body: {
    rowClassName: 'flex flex-row items-stretch py-2',
    defaultCell: {
      className: 'w-full font-bold text-xs bg-green-100 border-x border-red-900 text-center'
    },
    cells: [
      { className: 'font-bold text-red-900', component: <OffersButton/> },
      { className: 'w-full font-bold text-xs bg-green-400 border border-blue-300', component: <OffersButton/> }
      
    ]
  },
  body2: {
    rowClassName: 'flex flex-row items-stretch py-2 -ml-10 pl-[calc(2.5rem-1px)] border rounded',
    defaultCell: {
      className: 'w-full font-bold text-xs bg-green-100 border-x__ border-red-900 text-center'
    },
    cells: [
      { className: 'font-bold text-red-900' },
      { className: 'w-full font-bold text-xs bg-green-400 border border-blue-300' },
      { className: 'w-full font-bold text-xs text-red-200 border-x bg-blue-200' }
    ]
  }
};

Définition de la données

export const data = [
  {
    description: 'Tarifs entête',
    styleType: 'body',
    cells: [
      { label: 'Tarifs' },
      { label: 'Tarifs' },
      { label: 'Tarifs' },
      { label: 'Tarifs' },
      { label: 'Tarifs' },
      { label: 'Tarifs' },
      { label: 'Tarifs' },
      { label: 'Tarifs' },
      { label: 'Tarifs' },
      { label: 'Tarifs fdlmfkdsmfkdslmkflmdskmdls fmldk fmldskfl mdskf kdslmfk dlsmkfmldsk fmldsklmf dksmfkdsmfk mldskfmlds kfmldskflmdsk mlfkdsmlk fmdlkf mdlskflmdskfl mdslkm ' }
    ]
  },
  {
    description: 'Structures Tarifaires ligne 1',
    styleType: 'body2',
    cells: [
      { label: 'Structures tarifaires' },
      { label: '2000€' },
      { label: 'Other' }
    ]
  },
  {
    description: 'Structures Tarifaires ligne 2',
    styleType: 'body',
    cells: [
      { label: 'Tarifs' },
      {},
      { label: '40 € / 50 €' },
      { label: '40 € / 50 €' },
      { label: '40 € / 50 €' }
    ]
  },
  {
    description: 'Tarifs ligne 1',
    styleType: 'body',
    cells: [
      { label: 'Salarié seul' },
      {},
      { label: '74,04 € / mois' },
      { label: '13,36 € / mois' },
      { label: '80,22 € / mois' }
    ]
  },
  {
    description: 'Tarifs ligne 2',
    styleType: 'body',
    cells: [
      { label: 'Salarié + conjoint' },
      {},
      { label: '157,69 € / mois' },
      { label: '145,35 € / mois' },
      { label: '158,72 € / mois' }
    ]
  },

  {
    description: 'Tarifs ligne 3',
    styleType: 'body',
    cells: [
      { label: 'Salarié + 1 enfant (sans conjoint)' },
      {},
      { label: '98,38 € / mois' },
      { label: '73,36 € / mois' },
      { label: '80,22 € / mois' }
    ]
  },

  {
    description: 'Tarifs ligne 4',
    styleType: 'body',
    cells: [
      { label: 'Salarié + 2 enfants (sans conjoint)' },
      {},
      { label: '98,38 € / mois' },
      { label: '73,36 € / mois' },
      { label: '80,22 € / mois' }
    ]
  },

  {
    description: 'Tarifs ligne 5',
    styleType: 'body',
    cells: [
      { label: 'Salarié + conjoint + 1 enfants' },
      {},
      { label: '98,38 € / mois' },
      { label: '73,36 € / mois' },
      { label: '80,22 € / mois' }
    ]
  },

  {
    description: 'Tarifs ligne 6',
    styleType: 'body',
    cells: [
      { label: 'Salarié + conjoint + 2 enfants' },
      {},
      { label: '98,38 € / mois' },
      { label: '73,36 € / mois' },
      { label: '80,22 € / mois' }
    ]
  },

  {
    description: 'Prise en charge employeur',
    styleType: 'body',
    cells: [
      { label: 'Prise en charge employeur' },
      {},
      { label: '1000 €/an' },
      { label: '1400 €/an' },
      { label: '2200 €/an' }
    ]
  },

  {
    description: 'Budget total',
    styleType: 'body',
    cells: [
      { label: 'Budget total' },
      {},
      { label: '2800 €/an' },
      { label: '2800 €/an' },
      { label: '4400 €/an' }
    ]
  }
];