Skip to content

Conversation

msmx-mnakagawa
Copy link
Collaborator

@msmx-mnakagawa msmx-mnakagawa commented Jun 6, 2025

What I did

  • Icon
    • update icon types
    • update markups and classnames
    • update an interface about container
    • improve a category icon classname
    • add title, currentColor, and flip props
  • Button
    • update markups and classnames
    • add new button types
    • reflect iconSize to ButtonIcon
    • remove unused classnames

References

@msmx-mnakagawa msmx-mnakagawa self-assigned this Jun 6, 2025
@msmx-mnakagawa msmx-mnakagawa mentioned this pull request Jun 6, 2025
44 tasks
@reg-suit
Copy link

reg-suit bot commented Jun 6, 2025

reg-suit detected visual differences.

Check this report, and review them.

🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵

What do the circles mean? The number of circles represent the number of changed images.
🔴 : Changed items, ⚪ : New items, ⚫ : Deleted items, and 🔵 Passed items

How can I change the check status? If reviewers approve this PR, the reg context status will be green automatically.

@msmx-mnakagawa msmx-mnakagawa force-pushed the support-slds-2-icon-button branch 3 times, most recently from 82e31be to 4c04ff7 Compare June 20, 2025 02:12
@msmx-mnakagawa msmx-mnakagawa force-pushed the support-slds-2-icon-button branch 2 times, most recently from ef12184 to ea7c2fa Compare July 1, 2025 07:52
@msmx-mnakagawa msmx-mnakagawa force-pushed the support-slds-2-icon-button branch from ea7c2fa to 7041867 Compare July 1, 2025 09:38
@msmx-mnakagawa msmx-mnakagawa force-pushed the support-slds-2-icon-button branch from 7041867 to 73109a9 Compare July 1, 2025 09:49
@msmx-mnakagawa msmx-mnakagawa requested a review from stomita July 1, 2025 09:55
@msmx-mnakagawa msmx-mnakagawa marked this pull request as ready for review July 1, 2025 09:55
Copy link
Collaborator

@stomita stomita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared_folder icon is not shown.

CleanShot 2025-07-02 at 15 55 38@2x

}
);

export const SvgButtonIcon = (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any special reason why SvgIcon can't be reused for button icons? Does it require a different treatment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
Yes, there is.
SvgButtonIcon differs from SvgIcon in its logic for generating classnames, and, above all, in the context where it is used.

When I decided to define SvgButtonIcon separately, I judged it was too much to treat it as DRY.

However, it's also acceptable to unify them into a single component, so I did it in 288d955.

const { assetRoot = getAssetRoot() } = useContext(ComponentSettingsContext);

// icon and category prop should not include chars other than alphanumerics, underscore, and hyphen
const icon = (icon_ ?? '').replace(/[^\w-]/g, ''); // eslint-disable-line no-param-reassign
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint-disable- comment might not be needed (as the line now using new const for assignment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
I got it.
I've removed such comments in 1d538cc.

In addition, I've removed similar comments in other components as well in #490.

iconColor: fillIconColor,
}}
/>
const ccontainerClassName = classnames(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

containerClassName

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
Well..., I just followed the original naming convention in the current master branch though...
However, I updated it in 9ea3e18.

Copy link
Collaborator

@stomita stomita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several icons in utility are not shown. If the SLDS ver in story is old, it must be synced with the lib update and adding new icon support.

CleanShot 2025-07-02 at 15 58 22@2x

@msmx-mnakagawa
Copy link
Collaborator Author

@stomita

If the SLDS ver in story is old, it must be synced with the lib update and adding new icon support.

I got it.
I moved the commit fdc4e0d, which updates icon types, to #484.

@msmx-mnakagawa msmx-mnakagawa requested a review from stomita July 3, 2025 02:45
Copy link
Collaborator

@stomita stomita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shows differently in VRT for new_custom action icons

CleanShot 2025-07-03 at 12 00 09@2x

@msmx-mnakagawa msmx-mnakagawa force-pushed the support-slds-2-icon-button branch from 9b0c467 to 5a141a3 Compare July 3, 2025 03:57
@msmx-mnakagawa
Copy link
Collaborator Author

@stomita
Thank you for noticing that..

I removed the VRT unexpected diff in 5a141a3.

@msmx-mnakagawa msmx-mnakagawa requested a review from stomita July 3, 2025 04:17
size?: IconSize;
align?: 'left' | 'right';
container?: IconContainer;
circleContainer?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the container variance may not be limited to just circle, it's better to keep it as the current container property rather than making it a boolean.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
As far as confirming CSS classes in the spec, for now, only the variant of the container would be just a .slds-icon_container_circle.
https://v1.lightningdesignsystem.com/components/icons/#CSS-Class-Overview

Thus, I think currently it's enough to define this prop as a boolean.
However, at the same time, I understand your opinion, if we consider changes in the future.

Therefore, I've tried to revert it to the container prop in da113a2.

tabIndex?: number;
fillColor?: string;
title?: string;
currentColor?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the textColor and currentColor props are intended to be mutually exclusive and will not be used simultaneously, setting the textColor prop to "currentColor" can accurately reflect the intent of developers.

Copy link
Collaborator Author

@msmx-mnakagawa msmx-mnakagawa Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
As you pointed, indeed, the spec says that the currentColor and the other color settings (default, success etc) are mutually exclusive.
https://v1.lightningdesignsystem.com/components/icons/#Color

Therefore, I've tried including currentColor as one of variants of the textColor prop in 8235e6f.
Additionally, I added a story that we can confirm the currentColor behavior in 9bef3e3.

Do you think this solution would be fine?

align?: 'left' | 'right';
container?: IconContainer;
circleContainer?: boolean;
color?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe color is not used, right ?

Copy link
Collaborator Author

@msmx-mnakagawa msmx-mnakagawa Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
The color prop is used as rprops.
This usage is as the same as before this PR.

<svg
ref={ref}
className={iconClassNames}
aria-hidden
style={style}
{...rprops}
>
<use xlinkHref={iconUrl} />
</svg>

Although we can remove the color prop because it's also declared in SVGAttributes<SVGElement>, I decided to keep it on purpose because I thought it was more explicitly declared as documentation.

export type IconProps = {
label?: string;
containerClassName?: string;
category?: IconCategory;
icon: string;
size?: IconSize;
align?: 'left' | 'right';
container?: IconContainer;
color?: string;
textColor?: IconTextColor;
tabIndex?: number;
fillColor?: string;
title?: string;
flip?: boolean;
} & SVGAttributes<SVGElement>;

Which do you think is better: to keep it or to remove it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is included in SVGAttributes<SVGElement> type and just passing to <svg>, it might not be necessary in the props definition.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
I got it. 👍
I removed duplicated declarations in 893d631.

(props) => {
const { container, containerClassName, fillColor, ...rprops } = props;
const {
label,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the label prop is only used for assistive text, it may be misleading, as label typically refers to something visible to users in other components. It might be better to share it with the title prop, unless there's a strong need to differentiate between the title and the assistive text.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
I can agree with your opinion.
Therefore, I unified the label prop to the title prop in f57f21b.

@msmx-mnakagawa msmx-mnakagawa force-pushed the support-slds-2-icon-button branch from 61e9ded to f57f21b Compare July 7, 2025 02:40
@msmx-mnakagawa msmx-mnakagawa requested a review from stomita July 7, 2025 02:45
@stomita stomita merged commit bf49d8d into support-slds-2 Jul 10, 2025
2 checks passed
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