-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Popover): implement dynamin colors and new props
- Loading branch information
Showing
5 changed files
with
157 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Popover component All positions Should match the snapshot when place is top 1`] = `"<div class=\\"Popover__Wrapper-sc-94rrmp-2 iOyUpv\\"><div class=\\"Popover__Tip-sc-94rrmp-0 htsiya\\"><span class=\\"Popover__TipText-sc-94rrmp-1 hlIzeT\\">This is a hint </span></div>Hover Me</div>"`; | ||
exports[`Popover component All positions Should match the snapshot when place is top 1`] = `"<div class=\\"Popover__Wrapper-sc-94rrmp-2 iOyUpv\\"><div class=\\"Popover__PopoverContent-sc-94rrmp-0 kbrGrh\\"><span class=\\"Popover__PopoverText-sc-94rrmp-1 gJnVIa\\">This is a hint</span><button class=\\"Button__IconButton-sc-1ovnfsw-2 Popover__CloseButton-sc-94rrmp-3 hUtXpz Button__StyledButton-sc-1ovnfsw-1 hNpWHy\\" type=\\"button\\"><span class=\\"material-icons MuiIcon-root-1 Button__ButtonIcon-sc-1ovnfsw-0 hvLbao\\" aria-hidden=\\"true\\">close</span></button></div><div class=\\"Popover__ChildrenBlock-sc-94rrmp-4 bQgubP\\">popover here</div></div>"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,59 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { AutoExample } from '@catho/quantum-storybook-ui'; | ||
import { | ||
TabbedView, | ||
Tab, | ||
AutoPropsApi, | ||
Heading, | ||
StoryContainer, | ||
Title, | ||
SimpleHighlight, | ||
AutoExample, | ||
} from '@catho/quantum-storybook-ui'; | ||
import { Row, Col } from '../../components'; | ||
import Popover from '../../components/Popover'; | ||
|
||
const description = `Popovers provide additional information upon hover or focus. | ||
They often contain helper text that is contextual to an element.`; | ||
import PopoverExample from './examples/PopoverExample'; | ||
|
||
storiesOf('Popover', module).add('Popover', () => ( | ||
<AutoExample | ||
description={description} | ||
component={Popover} | ||
componentProps={{ | ||
children: 'Popover me', | ||
text: 'This is a Popover.', | ||
}} | ||
/> | ||
<> | ||
<Heading name="Popover"> | ||
A Popover can be used to display some content on top of another | ||
</Heading> | ||
<TabbedView> | ||
<Tab title="Usage"> | ||
<AutoExample | ||
component={Popover} | ||
componentProps={{ | ||
children: <p>Popover me</p>, | ||
text: | ||
'Lorem ipsum dolor avec Lorem ipsum dolor avec Lorem ipsum dolor avec Lorem ipsum dolor avec.', | ||
}} | ||
/> | ||
</Tab> | ||
|
||
<Tab title="API"> | ||
<AutoPropsApi component={Popover} /> | ||
</Tab> | ||
|
||
<Tab title="Example"> | ||
<StoryContainer> | ||
<Title as="h3">Popover</Title> | ||
<p> | ||
Here you can check a simple implamentation using SnackBar component. | ||
</p> | ||
|
||
<Row> | ||
<Col xsmall={4} small={4} medium={6}> | ||
<SimpleHighlight>{PopoverExample.code}</SimpleHighlight> | ||
</Col> | ||
<Col xsmall={4} small={4} medium={6}> | ||
<PopoverExample text="Popover text"> | ||
Popover action | ||
</PopoverExample> | ||
</Col> | ||
</Row> | ||
</StoryContainer> | ||
</Tab> | ||
</TabbedView> | ||
</> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import Popover from '../../../components/Popover'; | ||
|
||
class PopoverExample extends React.Component { | ||
constructor() { | ||
super(); | ||
|
||
this.state = { | ||
// showSnackBar: false, | ||
}; | ||
} | ||
|
||
// openSnackBar = () => this.setState({ showSnackBar: true }); | ||
|
||
// closeSnackBar = () => this.setState({ showSnackBar: false }); | ||
|
||
// actionCallback = () => this.closeSnackBar(); | ||
|
||
render() { | ||
return ( | ||
<> | ||
<Popover text="Popover text">popover here</Popover> | ||
</> | ||
); | ||
} | ||
} | ||
|
||
PopoverExample.code = ` | ||
`; | ||
|
||
export default PopoverExample; |