Skip to content

docs(ui): add design system guidelines#2252

Open
cylewaitforit wants to merge 2 commits intonpmx-dev:mainfrom
cylewaitforit:sb-design-guidelines
Open

docs(ui): add design system guidelines#2252
cylewaitforit wants to merge 2 commits intonpmx-dev:mainfrom
cylewaitforit:sb-design-guidelines

Conversation

@cylewaitforit
Copy link
Contributor

@cylewaitforit cylewaitforit commented Mar 23, 2026

🔗 Linked issue

🧭 Context

Codifies design system guidelines from @alexdln into the storybook docs.

📚 Description

Adds storybook doc pages for:

  • Design System Guidelines
  • Colors
  • Typography

Moves theme from uno.config.ts into uno.theme.ts in order for it to be consumed in the storybook docs.

@vercel
Copy link

vercel bot commented Mar 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 24, 2026 1:04am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 24, 2026 1:04am
npmx-lunaria Ignored Ignored Mar 24, 2026 1:04am

Request Review

@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Co-authored-by: Alex Savelyev <91429106+alexdln@users.noreply.github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

📝 Walkthrough

Walkthrough

Extracted the Unocss theme from uno.config.ts into a new uno.theme.ts export and wired it into uno.config.ts. Updated Storybook’s story discovery in .storybook/main.ts to include MDX documentation alongside JS/TS stories. Added three Storybook MDX pages under app/: colors.mdx, design-system-guidelines.mdx, and typography.mdx documenting colour tokens, design guidelines, and typography scales respectively. No exported/public JS/TS APIs were changed.

Possibly related PRs

  • npmx-dev/npmx.dev PR 2172: Modifies .storybook/main.ts story discovery patterns (same file and concern).
  • npmx-dev/npmx.dev PR 1270: Adjusts Storybook stories glob patterns for component/story discovery.
  • npmx-dev/npmx.dev PR 2149: Adds story files discoverable by the expanded Storybook glob (relies on the same .storybook/main.ts change).

Suggested reviewers

  • ghostdevv
  • JReinhold
  • alexdln
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description clearly explains the changes: it codifies design system guidelines into Storybook documentation by adding three new doc pages (Guidelines, Colors, Typography) and moves the theme configuration to enable reuse in Storybook docs.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
app/design-system-guidelines.mdx (1)

19-19: Minor: Missing period at end of sentence.

📝 Suggested fix
-Text and input fields should not exceed **768px** in width
+Text and input fields should not exceed **768px** in width.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 903b1231-571d-4bfb-bcbc-c29d267176b3

📥 Commits

Reviewing files that changed from the base of the PR and between 1fd2d53 and 0bd8a72.

📒 Files selected for processing (6)
  • .storybook/main.ts
  • app/colors.mdx
  • app/design-system-guidelines.mdx
  • app/typography.mdx
  • uno.config.ts
  • uno.theme.ts


## Colors

- Primary surfaces: **white** (`fg-fg`)
Copy link
Contributor

@coderabbitai coderabbitai bot Mar 24, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Likely typo: fg-fg should be fg.

The theme defines fg.DEFAULT which generates the utility class fg, not fg-fg. This appears to be a documentation error.

📝 Suggested fix
-- Primary surfaces: **white** (`fg-fg`)
+- Primary surfaces: **white** (`fg`)

Copy link
Contributor Author

@cylewaitforit cylewaitforit Mar 24, 2026

Choose a reason for hiding this comment

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

Seems like coderabbit could be right. @alexdln Should this just be fg ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think so since we do stuff like text-fg and bg-fg - although I thought I'd saw fg-fg somewhere but now I can't find it

@@ -0,0 +1,110 @@
import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs/blocks'
Copy link
Contributor

Choose a reason for hiding this comment

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

is it common to put the story inside the file? Like should we have a colors.stories.ts?

Copy link
Contributor Author

@cylewaitforit cylewaitforit Mar 24, 2026

Choose a reason for hiding this comment

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

Good question.

For files that use Component Story Format(CSF) it should use the *.stories.* naming pattern.

For related or unattached mdx doc files they generally don't use that pattern. As can be seen in examples of the storybook docs on mdx.

If at some point we need to make sure some other tool doesn't load the mdx files we could probably switch to a *.stories.mdx naming pattern but that was historically a custom mdx with CSF type file that storybook removed in SB7.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/typography.mdx (1)

37-56: Deduplicate the repeated typography scale array.

The fontSizes list is duplicated in both large Typeset blocks, which makes future token updates easy to miss in one place.

♻️ Suggested refactor
 export const wind4FontSizes = {
   'xs': '0.75rem',
   'sm': '0.875rem',
   'base': '1rem',
   'lg': '1.125rem',
   'xl': '1.25rem',
   '2xl': '1.5rem',
   '3xl': '1.875rem',
   '4xl': '2.25rem',
   '5xl': '3rem',
 }
+
+export const fullTypographyScale = [
+  wind4FontSizes['5xl'], // 48px
+  wind4FontSizes['4xl'], // 36px
+  wind4FontSizes['3xl'], // 30px
+  wind4FontSizes['2xl'], // 24px
+  wind4FontSizes['xl'], // 20px
+  wind4FontSizes['lg'], // 18px
+  wind4FontSizes['base'], // 16px
+  wind4FontSizes['sm'], // 14px
+  wind4FontSizes['xs'], // 12px
+  theme.text['2xs'].fontSize, // 11px
+  theme.text['3xs'].fontSize, // 10px
+  theme.text['4xs'].fontSize, // 9px
+  theme.text['5xs'].fontSize, // 8px
+]
@@
 <Typeset
   fontFamily={theme.font.sans}
-  fontSizes={[
-    wind4FontSizes['5xl'], // 48px
-    wind4FontSizes['4xl'], // 36px
-    wind4FontSizes['3xl'], // 30px
-    wind4FontSizes['2xl'], // 24px
-    wind4FontSizes['xl'], // 20px
-    wind4FontSizes['lg'], // 18px
-    wind4FontSizes['base'], // 16px
-    wind4FontSizes['sm'], // 14px
-    wind4FontSizes['xs'], // 12px
-    theme.text['2xs'].fontSize, // 11px
-    theme.text['3xs'].fontSize, // 10px
-    theme.text['4xs'].fontSize, // 9px
-    theme.text['5xs'].fontSize, // 8px
-  ]}
+  fontSizes={fullTypographyScale}
   fontWeight={400}
   sampleText="The quick brown fox jumps over the lazy dog"
 />
@@
 <Typeset
   fontFamily={theme.font.mono}
-  fontSizes={[
-    wind4FontSizes['5xl'], // 48px
-    wind4FontSizes['4xl'], // 36px
-    wind4FontSizes['3xl'], // 30px
-    wind4FontSizes['2xl'], // 24px
-    wind4FontSizes['xl'], // 20px
-    wind4FontSizes['lg'], // 18px
-    wind4FontSizes['base'], // 16px
-    wind4FontSizes['sm'], // 14px
-    wind4FontSizes['xs'], // 12px
-    theme.text['2xs'].fontSize, // 11px
-    theme.text['3xs'].fontSize, // 10px
-    theme.text['4xs'].fontSize, // 9px
-    theme.text['5xs'].fontSize, // 8px
-  ]}
+  fontSizes={fullTypographyScale}
   fontWeight={400}
   sampleText="const greeting = 'Hello, World!';"
 />

Also applies to: 71-90


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 899474df-53e9-4d95-9dea-6f0b170fcd24

📥 Commits

Reviewing files that changed from the base of the PR and between 0bd8a72 and 94f190e.

📒 Files selected for processing (1)
  • app/typography.mdx


## Line Height

Base line height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use the standard hyphenated term “line-height”.

At Line 154, “Base line height” reads better as “Base line-height” in typography docs.

📝 Suggested wording tweak
-Base line height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.
+Base line-height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Base line height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.
Base line-height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants