1+ /**
2+ * @file Badge.tsx
3+ * @input Uses React, HTMLAttributes
4+ * @output Exports Badge component, BadgeProps, BadgeVariant types
5+ * @position Core implementation; consumed by index.ts
6+ *
7+ * SYNC: When modified, update these files to stay in sync:
8+ * - /packages/core/src/Badge/Badge.doc.mjs (props table, features, implementation notes)
9+ * - /packages/core/src/Badge/Badge.test.tsx (tests for new/changed behavior)
10+ * - /packages/core/src/Badge/index.ts (exports if types change)
11+ * - /apps/storybook/stories/Badge.stories.tsx (storybook stories)
12+ * - /packages/cli/templates/blocks/components/Badge/ (showcase blocks)
13+ */
14+
115import { type ComponentProps , type RenderProp , useRender } from '@clerk/headless/utils' ;
216import * as stylex from '@stylexjs/stylex' ;
317import React from 'react' ;
418
519import { mergeStyleProps , themeProps } from '../../props' ;
6- import { styles } from './badge.styles' ;
20+ import { colors , styles } from './badge.styles' ;
721
822export type BadgeProps = Omit < ComponentProps < 'span' > , 'render' > & {
923 color ?: 'primary' | 'neutral' | 'warning' | 'negative' | 'positive' ;
@@ -19,7 +33,7 @@ export const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(function Mosa
1933 render,
2034 ref,
2135 props : {
22- ...mergeStyleProps ( themeProps ( 'badge' , { color } ) , stylex . props ( styles . base , styles [ color ] ) , className , style ) ,
36+ ...mergeStyleProps ( themeProps ( 'badge' , { color } ) , stylex . props ( styles . base , colors [ color ] ) , className , style ) ,
2337 ...rest ,
2438 } ,
2539 } ) ;
0 commit comments