Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(list-item): add iconStart, iconEnd and iconFlipRtl props #11004

Merged

Conversation

aPreciado88
Copy link
Contributor

@aPreciado88 aPreciado88 commented Dec 6, 2024

Related Issue: #9175

Summary

  • Add iconStart, iconEnd and iconFlipRtl props.
  • Update default icon color to --calcite-color-text-3.
  • Update icon color to --calcite-color-text-1 when item is selected.
  • Update list.html and list.stories.ts to use icon-start and icon-end.

@aPreciado88 aPreciado88 added this to the 2024-12-17 - Dec Milestone milestone Dec 6, 2024
@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Dec 6, 2024
@aPreciado88 aPreciado88 added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Dec 6, 2024
@aPreciado88
Copy link
Contributor Author

@ashetland @SkyeSeitz Can you please take a look at the new screenshots?

@aPreciado88 aPreciado88 added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Dec 9, 2024
Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

Update list.html and list.stories.ts to use icon-start and icon-end instead of content slots.

Can we leave the examples using slots since using slots is still a valid use case and can track the ordering of content slots and icon props.

All other changes look good!

Just had a question on whether our design consistency puts content slots outside or inside icon props.

@@ -142,18 +174,6 @@ export const scales = (): string => html`
scale="s"
slot="actions-start"
></calcite-action>
<calcite-icon
Copy link
Member

Choose a reason for hiding this comment

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

@aPreciado88 lets leave these in the demo since it is still valid to use the slots.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@driskull I chatted with Aaron about this and the suggestion was to get rid of content slots in favor of iconStart and iconEnd. Should I add all of the content slots back or only add them to a couple of tests?
cc @ashetland

Copy link
Contributor

Choose a reason for hiding this comment

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

We could also use calcite-avatar in the content slots. Since we now have icon-start/end it felt best to move icons to the props, leaving the content slots open for custom content.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah we can update them to use an avatar if we want. My point is that they are still valid slots and users can use both icon props and content slots.

Copy link
Contributor

Choose a reason for hiding this comment

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

Honestly, we removed a lot of them to try to get that story to load faster, but I believe we were going to log a separate issue to clean up the List stories. This story in particular seems to always show a diff because the screenshot is taken before the page finishes loading.

@@ -919,7 +957,9 @@ export class ListItem
const content = [
this.renderContentStart(),
this.renderCustomContent(),
this.renderIconStart(),
Copy link
Member

Choose a reason for hiding this comment

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

Question: Do we always put the icons inside the custom content slots or vice versa? Just want to confirm for designs. cc @ashetland @SkyeSeitz

Copy link
Contributor

@ashetland ashetland Dec 9, 2024

Choose a reason for hiding this comment

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

Now that we have the icon props, we should be using them for Calcite icons. The content slots can be used for other custom content.

Copy link
Member

Choose a reason for hiding this comment

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

Correct. my question was whether the custom content like an avatar surrounds the icons or goes inside of them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the confusion. The content slots should be on the outside of the icons:
CleanShot 2024-12-09 at 12 41 40@2x

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Code looks correct for that 👍

@aPreciado88 aPreciado88 added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Dec 10, 2024
@aPreciado88
Copy link
Contributor Author

@driskull @ashetland I added back the content slots and updated them to use calcite-avatar.

Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@ashetland ashetland left a comment

Choose a reason for hiding this comment

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

✨🚀

@aPreciado88 aPreciado88 merged commit b7ec930 into dev Dec 10, 2024
18 checks passed
@aPreciado88 aPreciado88 deleted the aPreciado88/9175-list-item-add-icon-end-icon-start-props branch December 10, 2024 21:41
benelan pushed a commit that referenced this pull request Feb 8, 2025
**Related Issue:**
[#9175](#9175)

## Summary

- Add `iconStart`, `iconEnd` and `iconFlipRtl` props.
- Update default icon color to `--calcite-color-text-3`.
- Update icon color to `--calcite-color-text-1` when item is selected.
- Update `list.html` and `list.stories.ts` to use `icon-start` and
`icon-end`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants