refactor(shared/ui): stop deep-importing sibling config/types (C-3)
Badge and TechText reached into $shared/ui/Label/config, and SearchBar into $shared/ui/Input/types — bypassing the siblings public surface. - Label/config.ts was explicitly shared text-styling config, not Labels internals; relocate it to shared/ui/labelConfig.ts (a neutral peer module) and point Label/Badge/TechText at it relatively. - inputIconSize is a consumer-facing map; export it from Input/index.ts so SearchBar imports it through the barrel alongside Input.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Shared config.
|
||||
* Import from here in each component to keep maps DRY.
|
||||
*/
|
||||
|
||||
export type LabelFont = 'mono' | 'primary';
|
||||
|
||||
export type LabelVariant =
|
||||
| 'default'
|
||||
| 'accent'
|
||||
| 'muted'
|
||||
| 'success'
|
||||
| 'warning'
|
||||
| 'error';
|
||||
|
||||
export type LabelSize = 'xs' | 'sm' | 'md' | 'lg';
|
||||
|
||||
export const labelSizeConfig: Record<LabelSize, string> = {
|
||||
xs: 'text-4xs',
|
||||
sm: 'text-3xs md:text-2xs',
|
||||
md: 'text-2xs md:text-xs',
|
||||
lg: 'text-sm',
|
||||
};
|
||||
|
||||
export const labelVariantConfig: Record<LabelVariant, string> = {
|
||||
default: 'text-neutral-900 dark:text-neutral-100',
|
||||
accent: 'text-brand',
|
||||
/* Light mode bumped from neutral-400 (~2.7:1 contrast, barely visible)
|
||||
to neutral-600 (~7.5:1). Dark mode unchanged. */
|
||||
muted: 'text-neutral-600 dark:text-neutral-500',
|
||||
success: 'text-green-600 dark:text-green-400',
|
||||
warning: 'text-yellow-600 dark:text-yellow-400',
|
||||
error: 'text-brand',
|
||||
};
|
||||
Reference in New Issue
Block a user