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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pantheon-systems/p1-internal-components

v0.0.3

Published

Components and Puck blocks shared between Pantheon's internal P1 sites, built on PDS

Readme

@pantheon-systems/p1-internal-components

This package holds components and Puck blocks shared between Pantheon's internal P1 sites. They are built on PDS (@pantheon-systems/pds-toolkit-react).

It is published to npm as a public package, from this internal repo (visible to the pantheon-systems org only).

Using it in a site

1. Install it:

npm install @pantheon-systems/p1-internal-components

2. Install its peers if the site doesn't already have them. They are peer dependencies, so a site never ends up with two copies of any of them:

| Peer | Version | Why | | --- | --- | --- | | react, react-dom | 19 | | | @pantheon-systems/pds-toolkit-react | 2 (>=2.0.0-beta.14) | every component is built on PDS | | @puckeditor/core | 0.21 to 0.24 | the blocks are Puck ComponentConfigs | | next | >=16 | links go through next/link | | @pantheon-systems/p1-media | >=0.5.2 | the Image, Video and Steps blocks' media fields and rendering |

The media fields are the p1-media field type, which the site's editor registers with p1-media's createMediaPlugin. Media is served from the site's media CDN, whose origin the blocks read from NEXT_PUBLIC_MEDIA_BASE_URL. A site that does not set that variable passes the origin to the block factories instead:

import { createImageBlock } from "@pantheon-systems/p1-internal-components/content-image";

components: { ...internalBlocks, ImageBlock: createImageBlock({ mediaBaseUrl: MEDIA_ORIGIN }) },

createVideoBlock and createStepsBlock take the same option. With neither, a media value renders nothing (p1-media fails closed on an origin it cannot check), while a plain URL saved before a field became a media field still renders.

3. Register the blocks in puck.config.tsx:

import { internalBlocks, internalCategories } from "@pantheon-systems/p1-internal-components/puck";

export const config = {
  categories: { ...internalCategories /* , the site's own */ },
  components: { ...internalBlocks /* , the site's own */ },
};

Blocks

Each block is registered under the key below, in internalBlocks. The key is what Puck saves in a page's data, so it never changes. The keys are the ones p1-docs used before the blocks moved here.

| Key | Component (subpath) | What it is | | --- | --- | --- | | HeadingBlock | ContentHeading (/content-heading) | h1 to h4, edited in place; h2 and h3 get an id from their text | | ParagraphBlock | ContentParagraph (/content-paragraph) | rich-text body copy, with a link editor | | CodeSampleBlock | CodeSample (/code-sample) | PDS CodeBlock with a copy button | | NoteBlock | ContentNote (/content-note) | info, warning, critical or success callout (PDS SectionMessage) | | TableBlock | ContentTable (/content-table) | read-only table (PDS Table); cells allow a, code, strong, em | | StepsBlock | ContentSteps (/content-steps) | numbered steps (PDS StepList), each with optional code, screenshots and a note | | PrerequisitesBlock | ContentPrerequisites (/content-prerequisites) | "Before you start" list in a PDS Panel | | ImageBlock | ContentImage (/content-image) | media library image, shown whole, with a caption | | VideoBlock | ContentVideo (/content-video) | YouTube, Vimeo or Wistia (PDS VideoEmbed), or a self-hosted mp4 | | BreadcrumbsBlock | PageHeader (/page-header) | breadcrumb trail (PDS Breadcrumb), title and lede | | HeroBlock | PageHero (/page-hero) | full-bleed band with a backdrop, a nav slot and a content slot | | SectionBlock | PageSection (/page-section) | centred column with a content slot, in the hero's rhythm | | LinkCardsBlock | LinkCards (/link-cards) | a row of linked PDS Cards, plain or feature |

Every block's defaults are neutral placeholders. A site that wants its own starting copy overrides defaultProps where it registers the block: NoteBlock: { ...noteBlock, defaultProps: { ... } }.

The helpers the blocks share are exported too, from /shared, for a site's own blocks: safeHref, slugify, SmartLink, proseRichTextField and RichTextLinkControls (a Link control for Puck's rich-text menus, which ship none), mediaImageField and resolveMediaImage.

Spacing

The blocks set no margin around themselves. Where a block's element has a browser default margin (a heading, a figure), it is reset at zero specificity (:where(...)), so any rule of the site's wins whatever order the stylesheets load in. The space between blocks belongs to the site, which sets it on the blocks' root classes:

.content-heading (plus .content-heading--1 to --4)   .content-paragraph   .code-sample
.content-note   .content-table   .content-steps   .content-prerequisites
.content-image   .content-video   .page-header   .page-hero   .page-section   .link-cards

For example: .my-article > :is(.content-paragraph, .code-sample, .content-note, .content-table) { margin-block-start: var(--pds-spacing-l); }.

Two exceptions, both inside a block rather than between blocks:

  • Hero and Section stacks. What is dropped into a Hero's or a Section's slot is spaced by the stack (.page-hero__stack, .page-section__stack), with tighter spacing under a heading.
  • Inside a step. A step's code sample and note are spaced by the step, and lose any margin a site gives .code-sample or .content-note.

Two custom properties set accents: --page-hero-link-accent (the underline of links in hero copy) and --link-cards-accent (the icon disc on feature cards, PDS's highlight colour by default).

Layout

src/<name>/
  <name>.tsx            the component ("use client" — PDS ships no directives)
  <name>.block.tsx      its Puck ComponentConfig: fields, defaults, render
  <name>.css            plain CSS on PDS tokens (var(--pds-*)), classes prefixed with the component name
  <name>.stories.tsx    Storybook story
  index.ts              what the component's subpath exports
src/shared/             helpers the blocks share (links, rich text, media), exported as /shared
src/puck.ts             every block, for a site to spread into its Puck config

Each component is a subpath, for example @pantheon-systems/p1-internal-components/code-sample. A page therefore only pulls in what it uses.

npm run build compiles src/ into dist/, one module per source file, so each component keeps its "use client" directive and CSS import. Only dist/ is published. Relative imports in src/ carry a .js extension (./code-sample.js) because the published ESM needs one; TypeScript and Storybook resolve them to the source.

Developing against a site

Work on a component in this repo's Storybook. To try it in a site, install a packed copy of the package:

npm pack                                   # in this repo: writes pantheon-systems-p1-internal-components-<version>.tgz
npm i ../p1-internal-pantheon-components/pantheon-systems-p1-internal-components-<version>.tgz   # in the site

Use a packed copy, not npm link or a file: link to this folder. Turbopack does not resolve files outside the site's root. A link would also load this repo's own development copies of React and PDS next to the site's, and two copies of React break hooks.

Releasing

Releases publish from GitHub Actions (.github/workflows/publish.yml) through npm trusted publishing. There is no npm token.

  1. On a branch, bump the version: npm version patch --no-git-tag-version (or minor, or prerelease --preid=beta for a beta, which publishes under the next tag instead of latest).
  2. Add the release to CHANGELOG.md, and merge the PR.
  3. Tag the merge commit on main and push the tag: git tag v0.0.2 && git push origin v0.0.2.

The workflow checks that the tag matches package.json, then typechecks, builds, lints the package (publint, attw), scans it for internal details (scripts/check-leaks.sh), and publishes it.

Before a release, npm pack --dry-run lists exactly what will be published.

npm trusts the workflow by its filename. Renaming publish.yml breaks publishing until an npm org admin updates the package's trusted publisher.