Skip to content
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

Add ListItem component #7844

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

olmoh
Copy link
Collaborator

@olmoh olmoh commented Mar 19, 2025

This change is Reviewable

Copy link

linear bot commented Mar 19, 2025

@olmoh olmoh force-pushed the create-listitem-component-des-1895 branch from 788246d to d69127e Compare March 20, 2025 07:07
@olmoh olmoh marked this pull request as ready for review March 20, 2025 07:14
@olmoh olmoh requested a review from tobias-jarvelov March 20, 2025 07:14
Comment on lines +5 to +8
export const ListItemGroup = styled(Flex).attrs({
$alignItems: 'center',
$gap: 'small',
})``;
Copy link
Contributor

@tobias-jarvelov tobias-jarvelov Mar 20, 2025

Choose a reason for hiding this comment

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

thought: I think it makes sense to ensure all components have the same public API. What I mean is that when we export the styled component as the component, we actually allow the all the usages which styled component allows, for better or worse.

This might be confusing DX if we allow some ListItem subcomponents to receive for example a forwardedAs prop, but other subcomponents can't.

suggestion: Add a function component which consumes the styled component and export that.

export const ListItemGroup = ({ children }) => {
  return <StyledFlex $alignItems="center" $gap="small">{children}</StyledFlex>
}

Comment on lines +5 to +7
export const ListItemFooter = styled(Flex).attrs({
$padding: { horizontal: 'medium' },
})``;
Copy link
Contributor

@tobias-jarvelov tobias-jarvelov Mar 20, 2025

Choose a reason for hiding this comment

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

thought: I think it makes sense to ensure all components have the same public API. What I mean is that when we export the styled component as the component, we actually allow the all the usages which styled component allows, for better or worse.

This might be confusing DX if we allow some ListItem subcomponents to receive for example a forwardedAs prop, but other subcomponents can't.

suggestion: Add a function component which consumes the styled component and export that.

export const ListItemFooter = ({ children }) => {
  return <StyledFlex $padding={{ horizontal: "medium" }}>{children}</StyledFlex>
}

Comment on lines +2 to +6
0: { enabled: 'rgba(41, 77, 115, 1)', disabled: 'rgba(31, 58, 87, 1)' },
1: { enabled: 'rgba(35, 65, 97, 1)', disabled: 'rgba(31, 58, 87, 1)' },
2: { enabled: 'rgba(31, 58, 87, 1)', disabled: 'rgba(28, 52, 78, 1)' },
3: { enabled: 'rgba(28, 52, 78, 1)', disabled: 'rgba(27, 49, 74, 1)' },
4: { enabled: 'rgba(27, 49, 74, 1)', disabled: 'rgba(27, 49, 74, 1)' },
Copy link
Contributor

Choose a reason for hiding this comment

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

question: From what I can tell, some of these colors not represented in the Colors/ColorTokens enums in foundations.

suggestion:

  1. Import and use the colors which are available in foundations.
  2. Add the missing colors to our foundations if possible. If it is not appropriate right now to do so, we might want to add a // TODO comment to replace these values later when we have added the colors.

Comment on lines +14 to +19
&:hover ${StyledFlex} {
background-color: rgba(56, 86, 116, 1);
}
&:active ${StyledFlex} {
background-color: rgba(62, 95, 129, 1);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: From what I can tell, these colors not represented in the Colors/ColorTokens enums in foundations.

suggestion: Add these colors to our foundations if possible. If it is not appropriate right now to do so, we might want to add a // TODO comment to replace these values later when we have added the colors.

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