Skip to content

[Groundwork] [OSS-Components] Create an OSS::FeatureCard component & OSS::FeatureCardsContainer#662

Merged
edouardmisset merged 11 commits into
masterfrom
em/dra-4999
Apr 29, 2026
Merged

[Groundwork] [OSS-Components] Create an OSS::FeatureCard component & OSS::FeatureCardsContainer#662
edouardmisset merged 11 commits into
masterfrom
em/dra-4999

Conversation

@edouardmisset
Copy link
Copy Markdown
Contributor

@edouardmisset edouardmisset commented Apr 27, 2026

What does this PR do?

Implements DRA-4999 by introducing:

  • OSS::FeatureCard component
  • OSS::FeatureCardsContainer component that composes 2 or 3 cards with automatic colors, shadows, angles, overlap, and z-index

Related to: #4999

What are the observable changes?

Frontend:

  • New single card component with title, description, image, color variant, and shadow variant.
  • New cards container that accepts two or three cards and applies layout rules
  • Added visual examples in Storybook:
    • Components/OSS::FeatureCard
    • Components/OSS::FeatureCardsContainer
  • Added visual examples in the dummy app visual page.
image

Figma design:
https://www.figma.com/design/xd32CWO1lHvIfbJ7ZTZJxq/%E2%9A%99%EF%B8%8F-Provide-OAuth-Client-Credentials-Authentication-for-API-Customers?node-id=6304-44946&t=bbpU8LxBAMqvodAV-4

Developers heads up

N/A

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation with Figma design link. Don't forget to replace "design" by "file" in the URL. For example https://www.figma.com/file/example
  • Migrated touched components to Glimmer Components
  • Properly labeled

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 27, 2026

Co-authored-by: Copilot <copilot@github.com>
Comment thread app/styles/molecules/feature-card.less
Comment thread app/styles/molecules/feature-card.less Outdated
border: 1px solid;
border-radius: var(--border-radius-md);
font-family: var(--font-family-base);
line-height: 1.6;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Defined like this in figma?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Figma uses 160% if memory serves. In the web, I've usually seen it as a dimensionless number (1, 1.5, etc.)
If you prefer I can set it like in Figma.
For reference, both are accepted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is actually the default on the platform so i think you can skip it:

Copy link
Copy Markdown
Contributor Author

@edouardmisset edouardmisset Apr 27, 2026

Choose a reason for hiding this comment

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

Apparently the h3 header is set to 1.1 in type.less

image

Comment thread app/styles/molecules/feature-card.less Outdated
Comment thread tests/dummy/app/controllers/visual.ts Outdated
Comment on lines +55 to +61
get colorVariant(): OSSFeatureCardColorVariant {
return this.args.colorVariant ?? DEFAULT_COLOR_VARIANT;
}

get shadowVariant(): OSSFeatureCardShadowVariant {
return this.args.shadowVariant ?? DEFAULT_SHADOW_VARIANT;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happened if the set a wrong color or shadow value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From my understanding, if that happens we fail one of the asserts above (L. 42, L. 48). It seems to be the way other components do it (see empty-state or dialog components).

Comment thread addon/components/o-s-s/feature-cards-container.hbs Outdated
Comment thread addon/components/o-s-s/feature-cards-container.ts Outdated
Comment thread addon/components/o-s-s/feature-card.hbs Outdated
Comment thread addon/components/o-s-s/feature-card.hbs Outdated
Comment thread addon/components/o-s-s/feature-card.stories.js Outdated
Comment thread addon/components/o-s-s/feature-card.hbs Outdated
Comment thread addon/components/o-s-s/feature-cards-container.hbs Outdated
Comment on lines +19 to +53
const CARDS_LAYOUT = {
2: [
{
colorVariant: 'blue',
shadowVariant: 'sm',
rotation: -ROTATION_ANGLE,
offsetX: `-${TWO_CARDS_OFFSET_X}`,
isCenter: false
},
{
colorVariant: 'yellow',
shadowVariant: 'sm',
rotation: ROTATION_ANGLE,
offsetX: TWO_CARDS_OFFSET_X,
isCenter: false
}
],
3: [
{
colorVariant: 'blue',
shadowVariant: 'sm',
rotation: -ROTATION_ANGLE,
offsetX: `-${THREE_CARD_OFFSET_X}`,
isCenter: false
},
{ colorVariant: 'violet', shadowVariant: 'lg', rotation: 0, offsetX: '0', isCenter: true },
{
colorVariant: 'yellow',
shadowVariant: 'sm',
rotation: ROTATION_ANGLE,
offsetX: THREE_CARD_OFFSET_X,
isCenter: false
}
]
} as const satisfies Record<
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this component should be responsible of setting the card colors.

I feel like the cards array parameter should just take the exact same parameter set as the FeatureCard component.

Only Rotation should be handled by this container component and eventually have defaults for the shadows

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While we are now handling the single card use case (thank you 🙏), we still have this component dictate shadows etc

I know we often use config-based approaches in our WoW, but here it seems to me like the code would be better off with a couple of helpers for the rotation and the offset ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Disclaimer: you know my affinity w/ CSS 😅
But there is no way this is done w/ pure CSS ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Implemented the layout logic in CSS as proposed by @phndiaye and created a couple of helpers to set fallback colors and shadows. @Miexil

Comment thread addon/components/o-s-s/feature-cards-container.ts
Comment thread app/styles/molecules/feature-card.less Outdated
Comment thread tests/integration/components/o-s-s/feature-card-test.ts Outdated
Comment thread tests/integration/components/o-s-s/feature-card-test.ts
Co-authored-by: Copilot <copilot@github.com>
…w variants, refactor, update tests

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@edouardmisset edouardmisset merged commit a75fac3 into master Apr 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants