Skip to content

Commit

Permalink
fix(SelectableCard): support tooltip (#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthprost committed Aug 16, 2022
1 parent fd3f783 commit aca579e
Show file tree
Hide file tree
Showing 5 changed files with 484 additions and 17 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions src/components/SelectableCard/__stories__/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,42 @@ isError.decorators = [
),
]

export const Tooltip = Template.bind({})
Tooltip.decorators = [
() => (
<ControlValue value="label-7">
{({ value, onChange }) => (
<div style={{ display: 'flex', gap: '16px' }}>
<SelectableCard
name="label-14"
checked={value === 'label-14'}
value="label-41"
type="radio"
tooltip="Click on me!"
onChange={(event: ChangeEvent<HTMLInputElement>) =>
onChange(event.currentTarget.value)
}
>
Left Radio
</SelectableCard>
<SelectableCard
name="label-15"
checked={value === 'label-15'}
value="label-15"
type="radio"
tooltip="No! Click on me instead!"
onChange={(event: ChangeEvent<HTMLInputElement>) =>
onChange(event.currentTarget.value)
}
>
Right Radio
</SelectableCard>
</div>
)}
</ControlValue>
),
]

export const ComplexChildren = Template.bind({})
ComplexChildren.parameters = {
docs: {
Expand Down

0 comments on commit aca579e

Please sign in to comment.