Skip to content

Commit

Permalink
Export composable pieces of List/Item (#1280)
Browse files Browse the repository at this point in the history
* export children in List/Item

* dangerously set inner html on Visual Containers

* only export TextContainer

* Update src/ActionList/Item.tsx

Co-authored-by: Clay Miller <clay@smockle.com>

* linter fix

* Create real-olives-brush.md

Co-authored-by: Clay Miller <clay@smockle.com>
  • Loading branch information
VanAnderson and smockle committed Jun 9, 2021
1 parent 47ce6ec commit f793ed0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/real-olives-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/components": patch
---

Export TexContainer from of ActionList/Item.
9 changes: 6 additions & 3 deletions src/ActionList/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ const StyledItem = styled.div<
${sx}
`

const StyledTextContainer = styled.div<{descriptionVariant: ItemProps['descriptionVariant']}>`
export const TextContainer = styled.div<{
dangerouslySetInnerHtml?: React.DOMAttributes<HTMLDivElement>['dangerouslySetInnerHTML']
descriptionVariant: ItemProps['descriptionVariant']
}>`
display: flex;
min-width: 0;
flex-grow: 1;
Expand Down Expand Up @@ -393,7 +396,7 @@ export function Item(itemProps: Partial<ItemProps> & {item?: ItemInput}): JSX.El
<StyledItemContent>
{children}
{(text || description) && (
<StyledTextContainer descriptionVariant={descriptionVariant}>
<TextContainer descriptionVariant={descriptionVariant}>
{text && <div>{text}</div>}
{description && (
<DescriptionContainer descriptionVariant={descriptionVariant}>
Expand All @@ -406,7 +409,7 @@ export function Item(itemProps: Partial<ItemProps> & {item?: ItemInput}): JSX.El
)}
</DescriptionContainer>
)}
</StyledTextContainer>
</TextContainer>
)}
{(TrailingIcon || trailingText) && (
<TrailingVisualContainer variant={variant} disabled={disabled}>
Expand Down

1 comment on commit f793ed0

@vercel
Copy link

@vercel vercel bot commented on f793ed0 Jun 9, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.