Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolinisoup committed Mar 8, 2024
1 parent 784d775 commit 49784c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/react/src/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import {type SxProp} from '../sx'
import React from 'react'
import Box from '../Box'
import {defaultSxProp} from '../utils/defaultSxProp'
import type {ComponentProps} from '../utils/types'

export type ButtonGroupProps = SxProp & React.ComponentPropsWithoutRef<'div'>
export type ButtonGroupProps = React.PropsWithChildren<SxProp & ComponentProps<typeof StyledButtonGroup>>

function ButtonGroup({children, sx = defaultSxProp, ...rest}: React.PropsWithChildren<ButtonGroupProps>) {
function ButtonGroup({children, sx = defaultSxProp, ...rest}: ButtonGroupProps) {
const buttons = React.Children.map(children, (child, index) => (
<Box key={index} {...rest}>
{child}
Expand All @@ -17,7 +18,7 @@ function ButtonGroup({children, sx = defaultSxProp, ...rest}: React.PropsWithChi
return <StyledButtonGroup sx={sx}>{buttons}</StyledButtonGroup>
}

const StyledButtonGroup = styled.div`
const StyledButtonGroup = styled.div<SxProp>`
display: inline-flex;
vertical-align: middle;
isolation: isolate;
Expand Down

0 comments on commit 49784c9

Please sign in to comment.