feat(ipa): Add <Example> component#53
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tickets: CLOUDP-399871, CLOUDP-399872
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 withExample.CorrectandExample.Incorrectsub-components, CSS module using custom-property tokens for variants, and a sharedExampleTypeunionsrc/components/ui/Accordion/— fixes needed to support<Example>: chevron rotation bug ([data-open]→[data-open="true"]), chevron sizing, anduseId-based ARIA wiringDrive-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 importssrc/components/ipa/index.ts— re-exportsExamplesrc/hooks/useGuideline.ts— named React importspackage.json— declaredclsx(used by Accordion but missing from dependencies).prettierrc— locked quote style, semicolons, trailing-comma rules for consistency