-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add DescriptionList component with flexible term/description support #710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new DescriptionList component that provides a structured, reusable way to render HTML <dl> elements with flexible support for various term-description patterns. The component follows established SDK patterns and replaces raw <dl> usage in the codebase.
Key Changes:
- Created
DescriptionListcomponent with support for 1:1, many:1, 1:many, and mixed term-description patterns - Refactored
AccountView.tsxto use the new component instead of raw HTML - Migrated global
dlstyles from_Base.scssto component-scoped styles
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/styles/_Base.scss |
Removed global dl styles |
src/contexts/ComponentAdapter/useComponentContext.ts |
Added DescriptionList type to context interface |
src/contexts/ComponentAdapter/componentAdapterTypes.ts |
Exported DescriptionListProps type |
src/contexts/ComponentAdapter/adapters/defaultComponentAdapter.tsx |
Registered DescriptionList in default adapter |
src/components/Company/BankAccount/BankAccountList/AccountView.tsx |
Refactored to use new DescriptionList component |
src/components/Common/UI/DescriptionList/index.ts |
Component barrel export |
src/components/Common/UI/DescriptionList/DescriptionListTypes.ts |
Type definitions for the component |
src/components/Common/UI/DescriptionList/DescriptionList.tsx |
Component implementation |
src/components/Common/UI/DescriptionList/DescriptionList.test.tsx |
Comprehensive test coverage |
src/components/Common/UI/DescriptionList/DescriptionList.stories.tsx |
Storybook examples |
src/components/Common/UI/DescriptionList/DescriptionList.module.scss |
Component-scoped styles |
.ladle/adapters/PlainComponentAdapter.tsx |
Plain adapter implementation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| @@ -0,0 +1,13 @@ | |||
| @use '@/styles/Helpers' as *; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this can be removed, cursor likes to add in the import but it is already globally made available with vite at build time
| @use '@/styles/Helpers' as *; |
…pport - Create DescriptionList component in Common/UI directory - Support single or multiple terms per description - Support single or multiple descriptions per term - Add component to adapter system (default and plain adapters) - Replace dl usage in AccountView with DescriptionList component - Remove global dl styles from Base.scss - Add comprehensive tests and Ladle stories
ffee6ec to
036eb38
Compare
Overview
This PR creates a new DescriptionList component following the patterns established in the SDK and removes global dl styles from _Base.scss.
Changes
New DescriptionList Component
src/components/Common/UI/DescriptionList/<dl>patterns per MDN spec:Refactoring
<dl>usage inAccountView.tsxwithComponents.DescriptionListdlstyles from_Base.scss(lines 17-24)Usage Examples
Simple key-value pairs
Multiple terms, one description
One term, multiple descriptions
Screenshots