Skip to content

feat(ipa): Add <Example> component#53

Merged
andmatei merged 4 commits into
mainfrom
feat/ipa-example-component
Jun 8, 2026
Merged

feat(ipa): Add <Example> component#53
andmatei merged 4 commits into
mainfrom
feat/ipa-example-component

Conversation

@andmatei

@andmatei andmatei commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Tickets: CLOUDP-399871, CLOUDP-399872

Screenshot 2026-06-05 at 19 11 25

Adds the <Example> compound component (<Example.Correct> and <Example.Incorrect>) backed by the existing <Accordion> UI primitive. Each variant renders a colored border and background (green / red) with a matching header bar, check/cross unicode icon, and dark-mode support via CSS custom properties.

Main additions

  • src/components/ipa/Example/ — compound component with Example.Correct and Example.Incorrect sub-components, CSS module using custom-property tokens for variants, and a shared ExampleType union
  • src/components/ui/Accordion/ — fixes needed to support <Example>: chevron rotation bug ([data-open][data-open="true"]), chevron sizing, and useId-based ARIA wiring

Drive-bys

  • src/components/ui/index.ts — added missing barrel export (Accordion + Badge were not re-exported)
  • src/components/ui/Badge/index.tsx — named export; named React imports
  • src/components/ipa/index.ts — re-exports Example
  • src/hooks/useGuideline.ts — named React imports
  • package.json — declared clsx (used by Accordion but missing from dependencies)
  • .prettierrc — locked quote style, semicolons, trailing-comma rules for consistency

andmatei added 3 commits June 5, 2026 17:36
- Migrate all React imports to named imports
- Add explicit ReactElement return types
- Convert Badge to named export
- Add Example component with icon prop, collapsed wrapper div, CSS module
- Add hand-written CheckIcon/CrossIcon SVGs
- Add ui/index.ts barrel
- Add Example fixture to dev page
Revert to simple unicode characters (✓/✗) with aria-hidden for the
Example component. Remove CheckIcon/CrossIcon SVG files and the icons
barrel — no external icon dependency needed.
…istency

- Full green/red border + tinted background for correct/incorrect variants
- CSS custom properties collapse dark mode from 38 lines to 8
- Remove wrapper div — styles applied directly to Accordion
- Fix chevron always-rotated bug ([data-open] matched false value)
- Increase chevron size to 1.25rem
- Header padding 0.5rem 0.75rem for horizontal consistency
- Fix title || → ?? regression
@andmatei andmatei requested a review from a team as a code owner June 5, 2026 18:01
@andmatei andmatei changed the title feat(ipa): add <Example> compound component (CLOUDP-399871, CLOUDP-399872) feat(ipa): Add <Example> compound component Jun 5, 2026
@andmatei andmatei changed the title feat(ipa): Add <Example> compound component feat(ipa): Add <Example> component Jun 8, 2026

@yelizhenden-mdb yelizhenden-mdb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@andmatei andmatei merged commit fbb411a into main Jun 8, 2026
10 checks passed
@andmatei andmatei deleted the feat/ipa-example-component branch June 8, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants