nypl-design-system icon indicating copy to clipboard operation
nypl-design-system copied to clipboard

DSD-1729: Adding showRowDividers prop to hide List description list dividers

Open EdwinGuzman opened this issue 9 months ago • 1 comments

Fixes JIRA ticket DSD-1729

This PR does the following:

  • Adds the showRowDividers prop to be able to hide horizontal row dividers for the "dl" List variant.
  • The underlying style functions that were updated are also used in StructuredContent but this update does not apply to the StructuredContent component. So there is no change and does not need to be included in the changelog.
  • Try it out in the "Controls" tab.

Question: @bigfishdesign13 I removed the Heading's top border as well. Let me know if it should not be removed as it's technically not a row divider, but it's still a border that is part of the List component.

How has this been tested?

Storybook

Accessibility concerns or updates

  • N/A

Checklist:

  • [ ] I have updated the Storybook documentation accordingly.
  • [ ] I have added relevant accessibility documentation for this pull request.
  • [ ] All new and existing tests passed.

Front End Review:

  • [ ] Review the Vercel preview deployment once it is ready.

EdwinGuzman avatar May 13 '24 21:05 EdwinGuzman

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nypl-design-system ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:06pm

vercel[bot] avatar May 13 '24 21:05 vercel[bot]

Ah yes, I forgot to bring that up. Since the default is already set to true, it's hard to know when it is explicitly passed by the consumer. So we can do more logic checks to log the message but I'm not sure if it's worth it. I would know that devs read the documentation and figure out that it's only for the dl variant. I'll give it another shot but if it's too much, I'll say we cut it and make it a new ticket for a better pattern (since this might also be used in other components).

EdwinGuzman avatar May 16 '24 17:05 EdwinGuzman

Yes, I figured it might take some odd logic to properly generate the warning. Like you said, if it requires a lot of code, then skip it.

I've often thought that we chose the wrong pattern for toggling the visibility of elements. More often than not, our visibility props default to true and the props need to be set explicitly to false to hide something. Rather than a showElement pattern, I often feel we should have used a hideElement pattern with the prop being false by default.

bigfishdesign13 avatar May 16 '24 21:05 bigfishdesign13

The logic is not straightforward and I prefer to make that a new ticket if we really want it. In my opinion, the dev should use the doc to know that the prop is only applicable to the dl variant.

EdwinGuzman avatar May 21 '24 20:05 EdwinGuzman