Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Conversation

@agliga
Copy link
Contributor

@agliga agliga commented Apr 3, 2025

Description

  • Added item-tile
  • Added item-tile-group
  • Added layout-grid
  • Modified file-preview-card to allow custom icon-button actions and href

Context

  • I added a requirement for marko 5 for these new components. Since marko 4 is deprecated and adding support for it would be extra tech debt, any new components will be marko 5 or greater. (This is why we dont have a marko-tag.json)
  • Formatter for marko files is broken currently. Even if we merge as is, when we do the final release, we run prettier on the whole project, so those will be fixed.
  • Added a new layout section in storybook where item-tile and item-tile-group as well as layout-grid is located

Structure

The structure I ended up going with (seemed the simpliest but also offering the most flexibility) was:

<ebay-item-tile on-action("emit", "action") href="https://ebay.com"
        file={
            name: "file-name.jpg",
            type: "image/jpeg",
            src: "https://ir.ebaystatic.com/cr/v/c01/skin/docs/tb-real-square-pic.jpg",
          }
          ...input
>
    <@action aria-label="Add to watchlist">
        <ebay-heart-16-icon/>
    </@action>
    <@supertitle>
      <ebay-signal status="time-sensitive">
        Time Sensitive
      </ebay-signal>
    </@supertitle>
      <@title>
          Apple iPhone 11 Pro Max
      </@title>
      <@subtitle>
          256GB Space Gray
      </@subtitle>
    <@description>
        <div class="price">
        $29.99
        <span class="clipped"> Was: </span>
        <s class="list-price"> $68.99 </s>
      </div>
    </@description>
</ebay-item-tile>

Happy to change it around as needed, but please offer suggestions if you do not like it (and rationale)

References

eBay/evo-web#70

Screenshots

Screenshot 2025-04-03 at 10 07 43 AM
Screenshot 2025-04-03 at 10 11 24 AM
Screenshot 2025-04-03 at 10 12 44 AM

@agliga agliga self-assigned this Apr 3, 2025
@changeset-bot
Copy link

changeset-bot bot commented Apr 3, 2025

🦋 Changeset detected

Latest commit: 76048d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ebay/ebayui-core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@ArtBlue ArtBlue left a comment

Choose a reason for hiding this comment

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

Some things need to be adjusted, but overall looks good. I don't mind the flatter and more generic structure here. 👍

@@ -0,0 +1,219 @@
class {}
<ebay-item-tile-group on-action("emit", "action") ...input>
Copy link
Contributor

Choose a reason for hiding this comment

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

item-tile-group is actually supposed to have predefined display rules for both gallery and list views. We should set those here and remove them from the options. Also, the <ul> inside the component needs to have a11y text, so we should add that option.

image

Refer to the Skin component for the predefined display rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm this seems like something skin should be taking care of on its end if its predetermined
If its customizable then yeah we can default to these. But if these are fixed shouldn't these be direct styles in item-tile-group? In order to not duplicate the styles they can be referenced as mixins.

Copy link
Contributor

Choose a reason for hiding this comment

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

So, we used layout-grid for this as we had planned. If we added more styling in itel-tile-group, we'd be duplicating the styles in lyout-grid. The default styling in layout-grid won't work, so we need the attributes for custom overrides. The plan all along has been to remove responsive layout styling from the components themselves and have layout-grid be the only thing that handles those. The more we duplicate the styling already present in layout-grid in other components, the less value we will see from it, and we'd needlessly increase the bundle size.

We simply need those breakpoint attributes set on .layout-grid to achieve that. One of the reasons why originally I had a separate distinct level in item-tile-group was to make this a bit clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I agree with that, but shouldn't those attributes just be set by item-tile-group? layout-grid handles all the layout part, but item-tile-group simply defines what happens at what breakpoint.

It could simply be:

.item-tile-group {
    --layout-grid-columns-min: 1;
    --layout-grid-columns-xs: 2;
    // etc
}

And then it should work automatically correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see. Yea, we can do that too. I wish we'd done the Skin part like that. As it stands now though, if we went with this option, there will need to be sweeping changes in Skin and this PR will be blocked until that's done. I'm fine if that's what we do, but will take longer.

description:
"Item to be rendered inside the group. Arguments used are the same as for item-tile. See item-tile for more information.",
},
columns: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Per my previous comment, we can remove this. We just need to impose the layout rules directly in the markup on our own side.

<@subtitle>
256GB Space Gray
</@subtitle>
<@description>
Copy link
Contributor

Choose a reason for hiding this comment

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

The various subgroups in this section need to use <p> instead of <div> because Skin has built in relative line spacing DS wanted. The current spacing is incorrect.

image

It may be a good idea to actually use <@attribute> to do the <p> wrapping on our end so teams can't use something that will result in spacing issues. There's a possibility for any host of attributes. That will probably also help business objects components so more brand-specific attributes continue to retain that spacing as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Will adjust

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One comment, we should adjust skin since some examples have <div>
Screenshot 2025-04-04 at 9 20 54 AM

Copy link
Contributor

@ArtBlue ArtBlue left a comment

Choose a reason for hiding this comment

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

It looks to be mostly there. It seems to still be missing the a11y label. See Skin.
image

Copy link
Contributor

@ArtBlue ArtBlue left a comment

Choose a reason for hiding this comment

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

Looks good.

@ArtBlue
Copy link
Contributor

ArtBlue commented Apr 7, 2025

It looks to be mostly there. It seems to still be missing the a11y label.

Ok, we spoke offline about this. Looks good. Approved the PR.

@agliga agliga merged commit ef18727 into 15.3.0 Apr 8, 2025
5 checks passed
@agliga agliga deleted the item-tile branch April 8, 2025 15:14
@github-actions github-actions bot mentioned this pull request Apr 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants