Repository navigation
Feature/feature panel - #583
Bhoomi-Pipalia wants to merge 15 commits into
Conversation
troychaplin
left a comment
There was a problem hiding this comment.
A few minor changes. I forgot to note in the original issue that when an image is used there's be a supported way to display the image on the left or the right. Let's also add this support along with a story example.
| <ButtonGroup> | ||
| <Button color="red" icon="arrow-right" title="Upload Your Transcript" type="button" iconPosition="right" /> | ||
| </ButtonGroup> |
There was a problem hiding this comment.
Test with long text. What would the button look like with 2 lines? Maybe this with a line-clamp and a vertically aligned icon might work? This is a tough one responsively.
There was a problem hiding this comment.
@troychaplin
Please take a look and let me know, what we can do to improve?
troychaplin
left a comment
There was a problem hiding this comment.
There's a disconnect between the 2 ways to use the component and with some simple changes that can be better aligned and easier to expand upon in the future.
There was a problem hiding this comment.
I would rearrange them to be:
- Primary (we do not have this, but it would be the Image version, but without the image column, just text, full width of the block)
- With Image
- Image on Left
- With Call to Action
- With Long Call to Action
There was a problem hiding this comment.
On closer review, I am wondering why there's a difference in markup between image and cta. The image approach uses a clean two column approach that reflects how other components work, while the CTA uses an approach to grid that I believe is new to this version of RDS.
I think the Image approach is better, we could use a FeaturePanel.Content and FeaturePanel.Aside. The aside could have a width prop that would provide flexibility for image, button or something else in the future.
I don't think we should hardcode image in the Aside either, that gives us more flexibility on how we can build this out in WordPress. Unless we change the approach to be a background image, which might be better, as we gain controls over focal points and more.
| @screen md { | ||
| .cu-feature-panel-text-only { | ||
| @apply grid-cols-[minmax(0,7fr)_minmax(0,3fr)]; | ||
| } | ||
|
|
||
| .cu-feature-panel-text-only > .cu-feature-panel-content { | ||
| @apply col-start-1; | ||
| } | ||
|
|
||
| .cu-feature-panel-text-only > .cu-feature-panel-cta { | ||
| @apply col-start-2 row-start-1 row-span-2 self-center; | ||
| } | ||
|
|
||
| .cu-feature-panel-text-only .cu-buttongroup { | ||
| justify-content: end; | ||
| } | ||
| } |
There was a problem hiding this comment.
Most, if not all, of this will be removed with a change to a two column inner component approach. I don't believe we've taken this approach in other components and grid.
|
|
||
| return ( | ||
| <div | ||
| className={`cu-feature-panel mx-auto w-full ${maxWidthClasses[maxWidth]} ${backgroundClass} ${image ? '' : 'border-l-4 border-solid rounded-md fill-red-600 border-red-600 '} overflow-hidden rounded-lg md:flex ${image && imagePosition === 'left' ? 'md:flex-row-reverse' : ''}`} |
There was a problem hiding this comment.
The border doesn't match stat cards, but I find that to be too large as well (uses 8px instead of 4). I think a sweet spot for both of these (as well as the expanded state in a new description component accordion style variation) is around 5px.
Let's update all 3 areas. I can't think of others that use this single border style.
| .cu-feature-panel-cta .cu-button-label { | ||
| display: -webkit-box; | ||
| -webkit-box-orient: vertical; | ||
| -webkit-line-clamp: 2; | ||
| min-width: 0; | ||
| overflow: hidden; | ||
| overflow-wrap: anywhere; | ||
| } |

PR Checklist & Notes
What type of PR is this? (check all applicable)
Is this a breaking change?
If yes, please note which project will be impacted.
Have you made an entry in the Changelog?
If not, please make an entry or your PR will be declined. Add new entries under the "Unreleased" section of the changelog.
Have you made changes to dependencies?
If you've made changes to dependencies please note them here, adding if they've been added, removed or updated, including packages version where applicable.
QA Instructions, Screenshots, Recordings
Please visit this url after running storybook from the local. http://127.0.0.1:6006/?path=/docs/components-feature-panel--docs
UI accessibility concerns?