Skip to content

feat: modernize List-related components to the latest MD3 specs - #5143

Draft
roksanaz wants to merge 24 commits into
callstack:mainfrom
roksanaz:feat/modernize-list-md3
Draft

roksanaz wants to merge 24 commits into
callstack:mainfrom
roksanaz:feat/modernize-list-md3

Conversation

@roksanaz

Copy link
Copy Markdown

Motivation

Brings List.Item and List.Accordion in line with the latest MD3 list spec:

  • Tokens, spacing and typography: padding, type and colour follow the spec instead of hardcoded sizes and the old expanded primary tint.
  • Selected state: MD3 selected colors on List.Item and List.Accordion.
  • Accordion motion: expand/collapse animation on the chevron and content.
  • Typed slots: new leading and trailing props on List.Item. They take a node, so List.Item owns the layout instead of trusting the caller to apply the style and color passed to the left and right render props. They take precedence over left and right when both are passed.

This combines #5041, #5057 and #5042, which were stacked on each other.

Related issue

Related to #4976, #4930

Screenshots / Videos

Test plan

Open the List example and:

  1. Compare one, two and three line rows against the spec.
  2. Expand and collapse an accordion and check the chevron and content animate.
  3. Check a selected row uses the primary container colors.
  4. Check the leading and trailing slots render and pick up the item color, including in a selected row.

…s-spacing

# Conflicts:
#	src/components/List/ListItem.tsx
#	src/components/__tests__/ListAccordion.test.tsx
#	src/components/__tests__/ListImage.test.tsx
…ist-typed-slots

# Conflicts:
#	src/components/List/ListItem.tsx
…s-spacing

# Conflicts:
#	src/components/List/ListAccordion.tsx
#	src/components/List/ListItem.tsx
#	src/components/__tests__/ListAccordion.test.tsx
…nd-accordion-animation

# Conflicts:
#	src/components/List/ListAccordion.tsx
#	src/components/List/ListItem.tsx
#	src/components/__tests__/__snapshots__/ListAccordion.test.tsx.snap
#	src/components/__tests__/__snapshots__/ListItem.test.tsx.snap
#	src/components/__tests__/__snapshots__/ListSection.test.tsx.snap
…ist-typed-slots

# Conflicts:
#	src/components/List/ListItem.tsx
@github-actions

Copy link
Copy Markdown

Found potential problems with the pull request:

  • The description is too long. Please keep it under 1000 characters.
  • Screenshot or video evidence is missing. Make sure to include one if it affects the UI.

This branch has not been deployed

No deployments
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