@@ -11,7 +11,7 @@ import {
11
11
Body ,
12
12
} from ".." ;
13
13
import { BentoSprinkles } from "../internal" ;
14
- import { chip , ellipsedLabel , maxWidth } from "./Chip.css" ;
14
+ import { chipRecipe , ellipsedLabel , maxWidth } from "./Chip.css" ;
15
15
import { useDefaultMessages } from "../util/useDefaultMessages" ;
16
16
import { assignInlineVars } from "@vanilla-extract/dynamic" ;
17
17
import { useBentoConfig } from "../BentoConfigContext" ;
@@ -46,6 +46,7 @@ type Props = {
46
46
icon ?: FunctionComponent < IconProps > ;
47
47
/** Truncate and show ellipsis after a number of characters */
48
48
maxCharacters ?: number ;
49
+ uppercase ?: boolean ;
49
50
} & DismissProps ;
50
51
51
52
const defaultColorsMapping : Record < DefaultColor , BentoSprinkles [ "background" ] > = {
@@ -61,7 +62,14 @@ const defaultColorsMapping: Record<DefaultColor, BentoSprinkles["background"]> =
61
62
pink : "softPink" ,
62
63
} ;
63
64
64
- export function Chip ( { color, label : _label , icon, maxCharacters, ...dismissProps } : Props ) {
65
+ export function Chip ( {
66
+ color,
67
+ label : _label ,
68
+ icon,
69
+ maxCharacters,
70
+ uppercase,
71
+ ...dismissProps
72
+ } : Props ) {
65
73
const config = useBentoConfig ( ) . chip ;
66
74
const colorsMapping = { ...defaultColorsMapping , ...config . customColors } ;
67
75
@@ -87,7 +95,7 @@ export function Chip({ color, label: _label, icon, maxCharacters, ...dismissProp
87
95
< Box
88
96
paddingX = { config . paddingX }
89
97
paddingY = { config . paddingY }
90
- className = { chip }
98
+ className = { chipRecipe ( { uppercase : uppercase ?? config . uppercase } ) }
91
99
background = { colorsMapping [ color ] }
92
100
borderRadius = { config . radius }
93
101
>
0 commit comments