Skip to content

feat: DR-6919 Statistic component#7553

Open
carlagn wants to merge 1 commit intomainfrom
feat/DR-6919-statistic
Open

feat: DR-6919 Statistic component#7553
carlagn wants to merge 1 commit intomainfrom
feat/DR-6919-statistic

Conversation

@carlagn
Copy link
Contributor

@carlagn carlagn commented Feb 24, 2026

Add statistic component
Add doc for statistic component

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced Statistic component for displaying numeric and string values with optional badge support and customizable styling.
    • Added Mona Sans font family to the design system typography stack.
  • Documentation

    • Added comprehensive documentation for the Statistic component, including usage examples, best practices, accessibility guidelines, and responsive layout patterns.

Add statistic component
Add doc for statistic component
@vercel
Copy link

vercel bot commented Feb 24, 2026

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

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Feb 24, 2026 2:21pm
docs Ready Ready Preview, Comment Feb 24, 2026 2:21pm
eclipse Ready Ready Preview, Comment Feb 24, 2026 2:21pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

Walkthrough

This PR introduces a new Statistic component to the Eclipse design system, including React component implementation with configurable props (title, value, measure, badge, badgeColor), comprehensive MDX documentation with usage examples, catalog registration, font assets setup with @font-face declarations, and export path configuration.

Changes

Cohort / File(s) Summary
Statistic Component Addition
packages/eclipse/src/components/statistic.tsx, apps/eclipse/content/design-system/molecules/statistic.mdx, apps/eclipse/content/design-system/molecules/meta.json
New Statistic component with interface defining optional title, value, measure, badge, and badgeColor props; defaults provided. MDX documentation covers usage examples, props, features, best practices, accessibility, and design tokens. Component registered in molecules catalog.
Badge Type Enhancement
packages/eclipse/src/components/badge.tsx
BadgeProps interface updated to accept any type for label property, broadening flexibility beyond string values.
Font Infrastructure Setup
packages/eclipse/src/styles/fonts.css, packages/eclipse/src/styles/globals.css, packages/eclipse/package.json
Added Mona Sans @font-face rules covering weights 400–800, imported fonts.css into globals.css, introduced --font-mona-sans CSS variable, and exported fonts directory path via package.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: introduction of a new Statistic component with supporting documentation, fonts, and configuration updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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

@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

3664 links: ✅ 2742 OK | 🚫 0 errors | 🔀 256 redirects | 👻 664 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 2742
🔀 Redirected 256
👻 Excluded 664
🚫 Errors 0
⛔ Unsupported 2
⏳ Timeouts 0
❓ Unknown 0

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: 6

🧹 Nitpick comments (3)
packages/eclipse/src/styles/globals.css (1)

74-76: --font-mona-sans is misplaced under the Blur section — move it to Typography.

The variable belongs logically with --font-family-display and its siblings. As written, it sits directly under --blur-background-high with no section comment separating it, making the @theme block harder to scan.

♻️ Proposed move
     /* Blur */
     --blur-background-low: 16px;
     --blur-background: 24px;
     --blur-background-high: 40px;
-    --font-mona-sans:
-        "Mona Sans", -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto",
-        "Helvetica Neue", "Arial", sans-serif;
     /* Typography - Font Families */
+    --font-mona-sans:
+        "Mona Sans", -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto",
+        "Helvetica Neue", "Arial", sans-serif;
     --font-family-display: var(--font-mona-sans), Inter, sans-serif;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eclipse/src/styles/globals.css` around lines 74 - 76, The CSS custom
property --font-mona-sans is placed under the Blur section (near
--blur-background-high) but logically belongs with the Typography variables;
move the --font-mona-sans declaration out from beneath --blur-background-high
into the Typography group alongside --font-family-display and related font
variables so the `@theme` block remains organized and easy to scan. Ensure you
preserve the exact variable name and value and keep any surrounding indentation
and comments consistent with the Typography section.
packages/eclipse/src/styles/fonts.css (1)

1-41: Consider adding WOFF2 format for better load performance.

All declarations use only TTF, which is 2–4× larger than WOFF2. WOFF2 is supported across all browsers the design system targets (Chrome 111+, Safari 16.4+, Firefox 128+ per Tailwind v4's requirements). Adding WOFF2 with TTF as a fallback is the modern standard.

🚀 Proposed format additions (pattern for each weight)
 `@font-face` {
     font-family: "Mona Sans";
-    src: url("../static/fonts/MonaSans-Regular.ttf") format("truetype");
+    src: url("../static/fonts/MonaSans-Regular.woff2") format("woff2"),
+         url("../static/fonts/MonaSans-Regular.ttf") format("truetype");
     font-weight: 400;
     font-style: normal;
     font-display: swap;
 }

Apply the same pattern to each of the remaining four weights.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eclipse/src/styles/fonts.css` around lines 1 - 41, The font-face
blocks for font-family "Mona Sans" currently only load TTFs which are large; add
WOFF2 sources before the existing TTF sources in each `@font-face` so browsers
load the smaller WOFF2 when supported and fall back to TTF otherwise, keeping
the existing font-weight (400, 500, 600, 700, 800), font-style and font-display
values; update each `@font-face` block (the ones that reference
MonaSans-Regular.ttf, MonaSans-Medium.ttf, MonaSans-SemiBold.ttf,
MonaSans-Bold.ttf, MonaSans-ExtraBold.ttf) to include a src entry for the
corresponding .woff2 file (same basename) followed by the existing .ttf entry.
packages/eclipse/src/components/statistic.tsx (1)

11-17: Prefer a named export to stay consistent with the rest of the component library.

Badge, badgeVariants, and every other component in packages/eclipse/src/components use named exports. A default export breaks the consistent pattern and makes tree-shaking and re-exporting slightly more cumbersome.

♻️ Proposed change
-export default function Statistic({
+export function Statistic({
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eclipse/src/components/statistic.tsx` around lines 11 - 17, The
component is currently exported as a default export; change it to a named export
to match the library pattern by replacing "export default function
Statistic(...)" with "export function Statistic(...)" (keep the same Statistic
function signature and props), and then update any local re-exports/consumers to
import { Statistic } instead of default — ensure the named export is used
consistently with other components like Badge and badgeVariants.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/eclipse/content/design-system/molecules/statistic.mdx`:
- Around line 187-252: The Typography & Spacing and Design Tokens sections in
statistic.mdx are inconsistent with the shipped Statistic component; update the
MDX to reflect the actual classes used in the implementation (check the
Statistic React component in statistic.tsx) — change Title to text-2xs with
tracking-[1.1px] and the appropriate Eclipse token (e.g.,
text-foreground-neutral-weak), Value to text-2xl font-bold with its token,
Measure to text-sm with its token, remove any px-6 py-5 and border-2
border-dashed rounded-lg entries (document "no padding" and "no border"), and
replace the doc color names (text-gray-*) with the actual token names used by
the component so consumers can rely on correct tokens and sizes.
- Around line 133-138: The MDX checklist incorrectly claims a "Dashed border
design" feature that doesn't exist; remove the "✅ Dashed border design for
visual emphasis" line from
apps/eclipse/content/design-system/molecules/statistic.mdx, or if the dashed
border is intended, add appropriate border classes (e.g., border, border-dashed,
rounded-*) to the Statistic component in statistic.tsx (the Statistic component)
and update its docs to reflect the new prop/styling—pick one action and apply it
so the docs and the Statistic implementation stay in sync.
- Around line 205-232: Update the three section headings that are compound
adjectives by adding hyphens: change the strings "Two Column Grid", "Three
Column Grid", and "Four Column Grid" to "Two-Column Grid", "Three-Column Grid",
and "Four-Column Grid" respectively in the statistic.mdx file so static analysis
no longer flags them.

In `@packages/eclipse/src/components/badge.tsx`:
- Around line 38-42: The prop type for label is currently declared as any;
change it to React.ReactNode in the badge props interface so the label can
accept text, elements, or fragments safely (replace the type for the label
property from any to React.ReactNode). Update the JSDoc above label (and any
description that says "label text") to reflect that it can be any renderable
React node. Ensure you import React types if needed (e.g., add React import or
use the global JSX namespace) and keep the prop name label in the Badge
component signature unchanged.

In `@packages/eclipse/src/components/statistic.tsx`:
- Around line 1-9: The file uses React.ReactNode in the StatisticProps interface
but never imports React, causing a TypeScript error; add an import for React (or
import the React type only) at the top of the component file so the React
namespace is in scope; update the imports in
packages/eclipse/src/components/statistic.tsx so the StatisticProps interface
(which references React.ReactNode) compiles correctly (mirror how other
components like badge.tsx import React).

In `@packages/eclipse/src/styles/globals.css`:
- Around line 74-76: The CSS custom property --font-mona-sans contains unquoted
font family identifiers that fail Stylelint (BlinkMacSystemFont, Roboto, Arial);
update the value of --font-mona-sans so those font names are quoted (e.g.,
"BlinkMacSystemFont", "Roboto", "Arial") to match the existing quoted entries
("Segoe UI", "Helvetica Neue") and satisfy the value-keyword-case rule in the
styles/globals.css declaration.

---

Nitpick comments:
In `@packages/eclipse/src/components/statistic.tsx`:
- Around line 11-17: The component is currently exported as a default export;
change it to a named export to match the library pattern by replacing "export
default function Statistic(...)" with "export function Statistic(...)" (keep the
same Statistic function signature and props), and then update any local
re-exports/consumers to import { Statistic } instead of default — ensure the
named export is used consistently with other components like Badge and
badgeVariants.

In `@packages/eclipse/src/styles/fonts.css`:
- Around line 1-41: The font-face blocks for font-family "Mona Sans" currently
only load TTFs which are large; add WOFF2 sources before the existing TTF
sources in each `@font-face` so browsers load the smaller WOFF2 when supported and
fall back to TTF otherwise, keeping the existing font-weight (400, 500, 600,
700, 800), font-style and font-display values; update each `@font-face` block (the
ones that reference MonaSans-Regular.ttf, MonaSans-Medium.ttf,
MonaSans-SemiBold.ttf, MonaSans-Bold.ttf, MonaSans-ExtraBold.ttf) to include a
src entry for the corresponding .woff2 file (same basename) followed by the
existing .ttf entry.

In `@packages/eclipse/src/styles/globals.css`:
- Around line 74-76: The CSS custom property --font-mona-sans is placed under
the Blur section (near --blur-background-high) but logically belongs with the
Typography variables; move the --font-mona-sans declaration out from beneath
--blur-background-high into the Typography group alongside --font-family-display
and related font variables so the `@theme` block remains organized and easy to
scan. Ensure you preserve the exact variable name and value and keep any
surrounding indentation and comments consistent with the Typography section.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c125bab and bd402dc.

⛔ Files ignored due to path filters (5)
  • packages/eclipse/src/static/fonts/MonaSans-Bold.ttf is excluded by !**/*.ttf
  • packages/eclipse/src/static/fonts/MonaSans-ExtraBold.ttf is excluded by !**/*.ttf
  • packages/eclipse/src/static/fonts/MonaSans-Medium.ttf is excluded by !**/*.ttf
  • packages/eclipse/src/static/fonts/MonaSans-Regular.ttf is excluded by !**/*.ttf
  • packages/eclipse/src/static/fonts/MonaSans-SemiBold.ttf is excluded by !**/*.ttf
📒 Files selected for processing (7)
  • apps/eclipse/content/design-system/molecules/meta.json
  • apps/eclipse/content/design-system/molecules/statistic.mdx
  • packages/eclipse/package.json
  • packages/eclipse/src/components/badge.tsx
  • packages/eclipse/src/components/statistic.tsx
  • packages/eclipse/src/styles/fonts.css
  • packages/eclipse/src/styles/globals.css

Comment on lines +133 to +138
- ✅ Optional measurement units
- ✅ Integrated badge support with color variants
- ✅ Dashed border design for visual emphasis
- ✅ Responsive and flexible layout
- ✅ Eclipse design system tokens
- ✅ Supports both numeric and string values
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

"Dashed border design" feature doesn't exist in the component.

Line 135 lists ✅ Dashed border design for visual emphasis as a feature. The actual Statistic component (statistic.tsx) has no border styling whatsoever — no border-*, border-dashed, or rounded-* classes. This appears to be a leftover from an earlier design iteration.

🔧 Proposed fix
-  - ✅ Dashed border design for visual emphasis
📝 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
- ✅ Optional measurement units
- ✅ Integrated badge support with color variants
- ✅ Dashed border design for visual emphasis
- ✅ Responsive and flexible layout
- ✅ Eclipse design system tokens
- ✅ Supports both numeric and string values
- ✅ Optional measurement units
- ✅ Integrated badge support with color variants
- ✅ Responsive and flexible layout
- ✅ Eclipse design system tokens
- ✅ Supports both numeric and string values
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/eclipse/content/design-system/molecules/statistic.mdx` around lines 133
- 138, The MDX checklist incorrectly claims a "Dashed border design" feature
that doesn't exist; remove the "✅ Dashed border design for visual emphasis" line
from apps/eclipse/content/design-system/molecules/statistic.mdx, or if the
dashed border is intended, add appropriate border classes (e.g., border,
border-dashed, rounded-*) to the Statistic component in statistic.tsx (the
Statistic component) and update its docs to reflect the new prop/styling—pick
one action and apply it so the docs and the Statistic implementation stay in
sync.

Comment on lines +187 to +252
### Typography & Spacing

The Statistic component uses:
- **Title**: Uppercase, extra-small font (text-xs), gray-400 color
- **Value**: Extra-large, bold font (text-4xl font-black)
- **Measure**: Large font (text-lg), gray-500 color
- **Spacing**: 6px horizontal, 5px vertical padding
- **Border**: 2px dashed purple-400 border with rounded corners

### Layout Tips

**Single Column (Mobile)**
```tsx
<div className="space-y-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
</div>
```

**Two Column Grid**
```tsx
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
<Statistic title="Metric 4" value={400} />
</div>
```

**Three Column Grid**
```tsx
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
</div>
```

**Four Column Grid**
```tsx
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
<Statistic title="Metric 4" value={400} />
</div>
```

### Accessibility

- Clear visual hierarchy with distinct typography sizes
- High contrast text colors for readability
- Semantic HTML structure
- Badge colors provide both visual and textual information
- Responsive design works across all screen sizes
- Title text is uppercase with tracking for improved legibility

### Design Tokens

The component uses Eclipse design tokens:
- Border: `border-purple-400` with `border-2 border-dashed`
- Radius: `rounded-lg`
- Title: `text-xs font-semibold tracking-widest text-gray-400 uppercase`
- Value: `text-4xl font-black text-gray-900`
- Measure: `text-lg text-gray-500`
- Spacing: `px-6 py-5`
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 | 🟠 Major

Typography & Spacing and Design Tokens sections don't match the actual component.

These sections describe a component that was never shipped. The actual statistic.tsx is simpler — no border, no padding, and different font sizes. Key mismatches:

Doc says Actual
text-xs (title) text-2xs
text-4xl font-black (value) text-2xl font-bold
text-lg (measure) text-sm
px-6 py-5 spacing no padding
border-2 border-dashed border-purple-400 rounded-lg no border
tracking-widest tracking-[1.1px]
text-gray-400 / text-gray-500 / text-gray-900 Eclipse tokens (text-foreground-neutral-weak, etc.)

Consumers who rely on the Design Tokens section to customise or override the component will be working from incorrect information.

🧰 Tools
🪛 LanguageTool

[grammar] ~206-~206: Use a hyphen to join words.
Context: ...tric 2" value={200} /> **Two Column Grid**tsx <div className="gri...

(QB_NEW_EN_HYPHEN)


[grammar] ~216-~216: Use a hyphen to join words.
Context: ...ic 4" value={400} /> **Three Column Grid**tsx <div className="gri...

(QB_NEW_EN_HYPHEN)


[grammar] ~225-~225: Use a hyphen to join words.
Context: ...ric 3" value={300} /> **Four Column Grid**tsx <div className="gri...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/eclipse/content/design-system/molecules/statistic.mdx` around lines 187
- 252, The Typography & Spacing and Design Tokens sections in statistic.mdx are
inconsistent with the shipped Statistic component; update the MDX to reflect the
actual classes used in the implementation (check the Statistic React component
in statistic.tsx) — change Title to text-2xs with tracking-[1.1px] and the
appropriate Eclipse token (e.g., text-foreground-neutral-weak), Value to
text-2xl font-bold with its token, Measure to text-sm with its token, remove any
px-6 py-5 and border-2 border-dashed rounded-lg entries (document "no padding"
and "no border"), and replace the doc color names (text-gray-*) with the actual
token names used by the component so consumers can rely on correct tokens and
sizes.

Comment on lines +205 to +232

**Two Column Grid**
```tsx
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
<Statistic title="Metric 4" value={400} />
</div>
```

**Three Column Grid**
```tsx
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
</div>
```

**Four Column Grid**
```tsx
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
<Statistic title="Metric 4" value={400} />
</div>
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

Hyphenate the compound-adjective section headings.

Static analysis flags "Two Column Grid", "Three Column Grid", and "Four Column Grid" as needing hyphens when used as compound adjectives modifying a noun.

🔧 Proposed fix
-**Two Column Grid**
+**Two-Column Grid**
 ...
-**Three Column Grid**
+**Three-Column Grid**
 ...
-**Four Column Grid**
+**Four-Column Grid**
📝 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
**Two Column Grid**
```tsx
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
<Statistic title="Metric 4" value={400} />
</div>
```
**Three Column Grid**
```tsx
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
</div>
```
**Four Column Grid**
```tsx
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<Statistic title="Metric 1" value={100} />
<Statistic title="Metric 2" value={200} />
<Statistic title="Metric 3" value={300} />
<Statistic title="Metric 4" value={400} />
</div>
**Two-Column Grid**
🧰 Tools
🪛 LanguageTool

[grammar] ~206-~206: Use a hyphen to join words.
Context: ...tric 2" value={200} /> **Two Column Grid**tsx <div className="gri...

(QB_NEW_EN_HYPHEN)


[grammar] ~216-~216: Use a hyphen to join words.
Context: ...ic 4" value={400} /> **Three Column Grid**tsx <div className="gri...

(QB_NEW_EN_HYPHEN)


[grammar] ~225-~225: Use a hyphen to join words.
Context: ...ric 3" value={300} /> **Four Column Grid**tsx <div className="gri...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/eclipse/content/design-system/molecules/statistic.mdx` around lines 205
- 232, Update the three section headings that are compound adjectives by adding
hyphens: change the strings "Two Column Grid", "Three Column Grid", and "Four
Column Grid" to "Two-Column Grid", "Three-Column Grid", and "Four-Column Grid"
respectively in the statistic.mdx file so static analysis no longer flags them.

Comment on lines 38 to 42
/**
* The label text to display inside the badge
*/
label: string;
label: any;
}
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 | 🟠 Major

Replace any with React.ReactNode for label.

Using any bypasses TypeScript entirely — at this call site the label renders inside a <span>, so React.ReactNode is the accurate, safe type. The JSDoc comment still says "label text", which is now doubly misleading.

🔧 Proposed fix
  /**
-  * The label text to display inside the badge
+  * The content to display inside the badge
   */
-  label: any;
+  label: React.ReactNode;
📝 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
/**
* The label text to display inside the badge
*/
label: string;
label: any;
}
/**
* The content to display inside the badge
*/
label: React.ReactNode;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eclipse/src/components/badge.tsx` around lines 38 - 42, The prop
type for label is currently declared as any; change it to React.ReactNode in the
badge props interface so the label can accept text, elements, or fragments
safely (replace the type for the label property from any to React.ReactNode).
Update the JSDoc above label (and any description that says "label text") to
reflect that it can be any renderable React node. Ensure you import React types
if needed (e.g., add React import or use the global JSX namespace) and keep the
prop name label in the Badge component signature unchanged.

Comment on lines +1 to +9
import { Badge } from "./badge";

interface StatisticProps {
title?: string;
value?: string | number;
measure?: string;
badge?: React.ReactNode;
badgeColor?: "neutral" | "ppg" | "orm" | "error" | "success" | "warning";
}
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 | 🔴 Critical

Missing React import — React.ReactNode will fail TypeScript compilation.

React is not in scope. React.ReactNode on line 7 references the React namespace, which is not automatically available even with the new JSX transform (it only removes the JSX runtime import, not the namespace). Every other component in this package (e.g., badge.tsx) explicitly imports React. This will cause a Cannot find name 'React' compile error.

🐛 Proposed fix
+import * as React from "react";
 import { Badge } from "./badge";

Alternatively, import only the type you need:

+import type { ReactNode } from "react";
 import { Badge } from "./badge";

 interface StatisticProps {
   ...
-  badge?: React.ReactNode;
+  badge?: ReactNode;
   ...
 }
📝 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
import { Badge } from "./badge";
interface StatisticProps {
title?: string;
value?: string | number;
measure?: string;
badge?: React.ReactNode;
badgeColor?: "neutral" | "ppg" | "orm" | "error" | "success" | "warning";
}
import * as React from "react";
import { Badge } from "./badge";
interface StatisticProps {
title?: string;
value?: string | number;
measure?: string;
badge?: React.ReactNode;
badgeColor?: "neutral" | "ppg" | "orm" | "error" | "success" | "warning";
}
Suggested change
import { Badge } from "./badge";
interface StatisticProps {
title?: string;
value?: string | number;
measure?: string;
badge?: React.ReactNode;
badgeColor?: "neutral" | "ppg" | "orm" | "error" | "success" | "warning";
}
import type { ReactNode } from "react";
import { Badge } from "./badge";
interface StatisticProps {
title?: string;
value?: string | number;
measure?: string;
badge?: ReactNode;
badgeColor?: "neutral" | "ppg" | "orm" | "error" | "success" | "warning";
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eclipse/src/components/statistic.tsx` around lines 1 - 9, The file
uses React.ReactNode in the StatisticProps interface but never imports React,
causing a TypeScript error; add an import for React (or import the React type
only) at the top of the component file so the React namespace is in scope;
update the imports in packages/eclipse/src/components/statistic.tsx so the
StatisticProps interface (which references React.ReactNode) compiles correctly
(mirror how other components like badge.tsx import React).

Comment on lines +74 to +76
--font-mona-sans:
"Mona Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
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 | 🟠 Major

Unquoted font names will fail Stylelint — quote BlinkMacSystemFont, Roboto, and Arial.

Stylelint's value-keyword-case rule treats unquoted font-family identifiers as CSS keywords and requires lowercase. The simple fix is quoting them — note that "Segoe UI" and "Helvetica Neue" in the same line are already quoted. The rule flags these as hard errors, which will fail linting in CI.

🔧 Proposed fix
-    --font-mona-sans:
-        "Mona Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
-        "Helvetica Neue", Arial, sans-serif;
+    --font-mona-sans:
+        "Mona Sans", -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto",
+        "Helvetica Neue", "Arial", sans-serif;
📝 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
--font-mona-sans:
"Mona Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
--font-mona-sans:
"Mona Sans", -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto",
"Helvetica Neue", "Arial", sans-serif;
🧰 Tools
🪛 Stylelint (17.3.0)

[error] 75-75: Expected "BlinkMacSystemFont" to be "blinkmacsystemfont" (value-keyword-case)

(value-keyword-case)


[error] 75-75: Expected "Roboto" to be "roboto" (value-keyword-case)

(value-keyword-case)


[error] 76-76: Expected "Arial" to be "arial" (value-keyword-case)

(value-keyword-case)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eclipse/src/styles/globals.css` around lines 74 - 76, The CSS custom
property --font-mona-sans contains unquoted font family identifiers that fail
Stylelint (BlinkMacSystemFont, Roboto, Arial); update the value of
--font-mona-sans so those font names are quoted (e.g., "BlinkMacSystemFont",
"Roboto", "Arial") to match the existing quoted entries ("Segoe UI", "Helvetica
Neue") and satisfy the value-keyword-case rule in the styles/globals.css
declaration.

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