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

@partslogic/pages

v0.0.32-pre-alpha.0

Published

React components for SunHammer

Downloads

73

Readme

Deprecation notice

This library is deprecated, all components and logic was moved to @partslogic/ui repository.


Partslogic

@partslogic/pages is a library of React components that helps you build e-commerce sites faster and easier.

This library privides fully functional pages, like a SearchPage.

At this moment we don't support customization via properties, if you want to build your page using our components, please have a look at sunhammer library.

Installation

@partslogic/pages is available as an npm package.

// with npm
npm i @partslogic/pages

// with yarn
yarn add @partslogic/pages

Please note that react >= 17.0.1 and react-dom >= 17.0.1 are peer dependencies. So you need to install those libraries as well.

  • If you are using a bundler like webpack you can install react in this way:
// with npm
npm i react react-dom

// with yarn
yarn add react react-dom

You can also use the react CDN to add react to your application if you are not using a bundler:

<script src="https://unpkg.com/react@17/umd/react.production.min.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js" crossorigin></script>

Usage

IMPORTANT: To use the SearchPage component, you will need a FitmentSelector groupId.

ESM modules

As early as possible in your application, require and configure your API_KEY:

import { config } from @partslogic/pages;
config({APY_KEY: "Your api key"})

Then you can import pages and styles:

// Import pages using absolute path
import { SearchPage } from @partslogic/pages;
// Using relative path per page
import SearchPage from @partslogic/pages/build/SearchPage';

// Import all styles
import '@partslogic/pages/build/index.css';
// Import styles per page
import '@partslogic/pages/build/SearchPage/index.css';
import React from 'react';
import ReactDOM from 'react-dom';
import SearchPage from '@partslogic/pages/build/SearchPage';

function App() {
  return (
    <SearchPage groupId="{FITMENT_SELECTOR_GROUP_ID}" />);
}

ReactDOM.render(<App />, document.querySelector('#app'));

CDN

You can add @partslogic/pages as a <script> tags:

<!-- All pages and all styles -->
<script crossorigin src="https://unpkg.com/@partslogic/[email protected]/build/index.umd.js" />
<link href="https://unpkg.com/@partslogic/[email protected]/build/index.css" rel="stylesheet" type="text/css" />
<!--  Add a specific page -->
<script crossorigin src="https://unpkg.com/@partslogic/[email protected]/build/[COMPONENT]/index.umd.js" />
<link href="https://unpkg.com/@partslogic/[email protected]/build/[COMPONENT]/index.css" rel="stylesheet" type="text/css" />

As early as possible in your application, require and configure your API_KEY:

window.PartslogicPages.config({ API_KEY: 'YOUR_API_KEY' });

Add a div with the id you want to use as container for your component, in this example is #search-page.


const searchPageContainer = document.querySelector('#search-page');
const SearchPage = window.PartslogicPages.SearchPage;
ReactDOM.render(
React.createElement(SearchPage, {
  groupId: "{FITMENT_SELECTOR_GROUP_ID}"
}),
searchPageContainer
);

Styles (css)

You can customize styles using classes with the prefix Pl- and Sui-. Example:

.Pl-SearchPage--container
.Pl-filter-results--button
.Sui-ListControls--container

List of pages

  • SearchBar

  • SearchPage

Customization

You can customize components using CSS.