Skip to content

Commit da113a2

Browse files
(Icon): replace circleContainer with container
1 parent 49a0628 commit da113a2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/scripts/Icon.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export type IconCategory =
148148
| 'standard'
149149
| 'utility';
150150
export type IconSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';
151+
export type IconContainer = 'circle';
151152
export type IconTextColor =
152153
| 'default'
153154
| 'success'
@@ -166,7 +167,7 @@ export type IconProps = {
166167
icon: string;
167168
size?: IconSize;
168169
align?: 'left' | 'right';
169-
circleContainer?: boolean;
170+
container?: IconContainer;
170171
color?: string;
171172
textColor?: IconTextColor;
172173
tabIndex?: number;
@@ -241,8 +242,8 @@ export const SvgIcon = forwardRef(
241242
export const Icon = createFC<IconProps, { ICONS: typeof ICONS }>(
242243
(props) => {
243244
const {
245+
container,
244246
label,
245-
circleContainer,
246247
containerClassName: containerClassName_,
247248
fillColor,
248249
title,
@@ -279,7 +280,7 @@ export const Icon = createFC<IconProps, { ICONS: typeof ICONS }>(
279280
const containerClassName = classnames(
280281
containerClassName_,
281282
'slds-icon_container',
282-
circleContainer ? 'slds-icon_container_circle' : null,
283+
container === 'circle' ? 'slds-icon_container_circle' : null,
283284
category === 'utility'
284285
? `slds-icon-utility-${icon.replace(/_/g, '-')}`
285286
: null,

stories/Icon.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const ActionIcons: StoryObj<StoryProps> = {
155155
icons: Icon.ICONS.ACTION_ICONS.map((icon) => ({
156156
icon,
157157
category: 'action',
158-
circleContainer: true,
158+
container: 'circle',
159159
size: 'small',
160160
})),
161161
},

0 commit comments

Comments
 (0)