Skip to content

Commit

Permalink
fix docs examples & add focus state
Browse files Browse the repository at this point in the history
  • Loading branch information
yjose committed Sep 7, 2020
1 parent 8d2456c commit eed4e72
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
10 changes: 6 additions & 4 deletions docs/docs/modal-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ hide_title: true
sidebar_label: Modal
title: React Modal
description: Create React Modal using reactjs-popup
---import SimpleModal from './../examples/SimpleModal.js';
---

import SimpleModal from './../examples/SimpleModal.js';

import CustomModal from './../examples/CustomModal.js';

Expand All @@ -15,7 +17,7 @@ import CustomModal from './../examples/CustomModal.js';

To create a simple modal with reactjs-popup you just need to add the 'modal' attribute to your popup component.

```jsx live=true
```jsx
const Modal = () => (
<Popup trigger={<button className="button"> Open Modal </button>} modal>
<span> Modal content </span>
Expand All @@ -41,9 +43,9 @@ export default () => (
>
{close => (
<div className="modal">
<a className="close" onClick={close}>
<button className="close" onClick={close}>
&times;
</a>
</button>
<div className="header"> Modal Title </div>
<div className="content">
{' '}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tooltip-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const ToolTipPositions = () => (
</button>
}
position={position}
on="hover"
on={['hover', 'focus']}
arrow={position !== 'center center'}
>
<Card title={position} />
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/CustomModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const CustomModal = () => (
>
{close => (
<div className="modal">
<a className="close" onClick={close}>
<button className="close" onClick={close}>
&times;
</a>
</button>
<div className="header"> Modal Title </div>
<div className="content">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Atque, a
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const CustomModal = () => (
>
{close => (
<div className="modal">
<a className="close" onClick={close}>
<button className="close" onClick={close}>
&times;
</a>
</button>
<div className="header"> Modal Title </div>
<div className="content">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Atque, a
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/ToolTipPositions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const ToolTipPositions = () => (
</button>
}
position={position}
on="hover"
on={['hover', 'focus']}
arrow={position !== 'center center'}
>
<Card title={position} />
Expand Down
10 changes: 10 additions & 0 deletions docs/examples/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ html[data-theme='dark'] .menu-item:not(:first-child) {
padding: 0.5rem;
}

/* a[href],
area[href],
input:not([disabled]),
select:not([disabled]),
textarea:not([disabled]), */

button:not([disabled]):focus-within {
border: 2px solid #2196f3;
}

html[data-theme='dark'] .popup-content {
background-color: rgb(41, 45, 62);
color: #fff;
Expand Down

0 comments on commit eed4e72

Please sign in to comment.