Skip to content

docs: add per-component lifecycle status badges#738

Merged
QuintonJason merged 6 commits into
mainfrom
docs/add-status-badges
May 29, 2026
Merged

docs: add per-component lifecycle status badges#738
QuintonJason merged 6 commits into
mainfrom
docs/add-status-badges

Conversation

@QuintonJason

@QuintonJason QuintonJason commented May 15, 2026

Copy link
Copy Markdown
Contributor

Description

Renders a Stable / Beta / Deprecated badge at the top of each component MDX page so consumers see lifecycle state without navigating to the central Resources/Component status table.

What's new

  • libs/core/src/stories/_helpers/StatusBadge.tsx (+ companion CSS) — typed React helper rendered as <StatusBadge status="stable" />. Uses Pine semantic tokens (--pine-color-text-success / -warning / -danger) for color so the badge respects current and future theming.
  • Applied to pds-button, pds-modal, pds-table as a proof-of-pattern. All three are listed as Stable in the central table.

What's not in this PR

  • Remaining ~32 components (intentional — keeping the first pass tight; a follow-up PR can bulk-apply).
  • Reading status from a structured data file. Today the badge value is hard-coded per page, and the central table remains the source of truth. A future enhancement could extract a JSON manifest both surfaces read from.

Dependency note

This PR is based on docs/foundations (#736) because the badge mirrors the lifecycle labels introduced there. Merge that first; rebase on main once it lands.

Closes a Level-3 "Component status page" surfacing gap on the maturity scorecard.

Fixes #(no-issue)

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Confirmed the helper lint-passes (ESLint + pine-colors Stylelint plugin).

  • Verified import path from each component MDX resolves under the existing _helpers re-export pattern.

  • Storybook builds and renders the badge above the component name on each affected page.

  • unit tests

  • e2e tests

  • accessibility tests (badge has role="note" + descriptive aria-label)

  • tested manually

  • other:

Test Configuration:

  • Pine versions: 3.25.1 (current main)
  • OS: macOS 25.3.0
  • Browsers: Storybook preview
  • Screen readers: n/a
  • Misc: docs-only addition

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Design has QA'ed and approved this PR

cc @Kajabi/dss-devs


Note

Low Risk
Documentation and Storybook-only helpers; no runtime component API or app behavior changes.

Overview
Introduces a shared lifecycle status system for Storybook: a component-status.json manifest, a Resources/Component status MDX page, and a reusable StatusBadge helper that reads status (and optional notes) from the manifest when you pass component="pds-…".

StatusBadge (React + CSS) renders Stable / Beta / Deprecated (and Unknown on bad/missing data) using Pine semantic color tokens, role="note", and an aria-label that can include manifest notes. It is re-exported from stories/_helpers and wired at the top of pds-button, pds-modal, and pds-table docs as the initial rollout pattern.

The central status doc duplicates the component list in a manual table; the JSON is documented as the source of truth for badges, with an expectation to keep the table in sync when statuses change.

Reviewed by Cursor Bugbot for commit 0e7daf9. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added documentation Improvements or additions to documentation package: core Changes have been made to the Core package labels May 15, 2026
Comment thread libs/core/src/stories/_helpers/StatusBadge.tsx Outdated
Comment thread libs/core/src/stories/_helpers/StatusBadge.tsx Outdated
@QuintonJason QuintonJason force-pushed the docs/add-status-badges branch from 6a83c34 to 1de0fb6 Compare May 26, 2026 17:36
Comment thread libs/core/src/stories/_helpers/StatusBadge.tsx Outdated
Comment thread libs/core/src/stories/_helpers/StatusBadge.tsx
Comment thread libs/core/src/stories/_helpers/StatusBadge.tsx
@QuintonJason QuintonJason force-pushed the docs/add-status-badges branch from 1de0fb6 to aded0ca Compare May 26, 2026 18:23
@QuintonJason QuintonJason self-assigned this May 26, 2026
…able)

Add a StatusBadge React helper at libs/core/src/stories/_helpers/ that
renders Stable / Beta / Deprecated above a component's MDX page so
consumers see lifecycle state without navigating to the central table.

Apply it to pds-button, pds-modal, and pds-table as a proof-of-pattern;
remaining components stay unbadged until follow-up PRs.

Source of truth remains the Resources/Component status table; the badge
component is documented to be kept in sync.
Address review feedback that hard-coded status props would drift from
the central Component status table. Introduce a JSON manifest as the
single source of truth:

- libs/core/src/stories/resources/component-status.json lists all 35
  Pine components with their lifecycle status and any inline notes.
- StatusBadge takes an optional `component` prop and reads the status
  from the JSON manifest, falling back to the explicit `status` prop
  when supplied.
- The three component MDX pages (pds-button, pds-modal, pds-table) now
  use the component-tag form so promotion only requires editing JSON.
- The central Component status MDX gains a callout pointing
  contributors at the JSON manifest as the source of truth.
@QuintonJason QuintonJason changed the base branch from docs/foundations to main May 26, 2026 18:44
@QuintonJason QuintonJason force-pushed the docs/add-status-badges branch from aded0ca to 25cf513 Compare May 26, 2026 18:47
@netlify

netlify Bot commented May 26, 2026

Copy link
Copy Markdown

Deploy Preview for pine-design-system ready!

Name Link
🔨 Latest commit 0e7daf9
🔍 Latest deploy log https://app.netlify.com/projects/pine-design-system/deploys/6a19f9e284c7cc000894cf8f
😎 Deploy Preview https://deploy-preview-738--pine-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Prop overrides JSON manifest, validate status values, warn on unknown
components, include notes in aria-label, and remove unused default export.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2031e57. Configure here.

Comment thread libs/core/src/stories/_helpers/StatusBadge.tsx Outdated
Comment thread libs/core/src/stories/_helpers/StatusBadge.tsx
Guard against null or malformed manifest entries and skip manifest notes
when an explicit status override is provided.
@QuintonJason QuintonJason requested a review from pixelflips May 29, 2026 14:49

@pixelflips pixelflips left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. Nothing blocking. Overall, this feels very manual, even though Storybook can handle some of it. I'll let you make the call, but I'd lean toward letting a storybook addon handle this vs. basically creating a new component. Either way is fine by me, though, just some thoughts.

Comment thread libs/core/src/stories/resources/component-status.docs.mdx
"summary": "Do not use in new UI; plan migration; removal is scheduled with notice in the changelog."
}
},
"components": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably fine, but it seems very manual to keep updated. Previously, when I was looking into this, there were quite a few addons for Storybook that, when added, just allowed you to set the badge in the component story file params. They can also be configured to show in the sidebar.

Just a thought, not a blocker. Do a search for "badges" at https://storybook.js.org/addons.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will handle in a followup

Comment thread libs/core/src/stories/_helpers/StatusBadge.css Outdated
@QuintonJason QuintonJason merged commit 60ae633 into main May 29, 2026
21 checks passed
@QuintonJason QuintonJason deleted the docs/add-status-badges branch May 29, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation package: core Changes have been made to the Core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants