Skip to content

Commit

Permalink
Merge fc116d6 into 8c75088
Browse files Browse the repository at this point in the history
  • Loading branch information
heyjul3s committed Mar 29, 2021
2 parents 8c75088 + fc116d6 commit 4459ef8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/artifak/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"dependencies": {
"@artifak/component-generator": "^2.0.1",
"@artifak/container": "^1.0.0",
"@artifak/flex": "^1.1.7",
"@artifak/fluidsizing": "^1.0.1",
"@artifak/grid": "^1.1.5",
Expand All @@ -53,7 +54,10 @@
"@artifak/media": "^1.0.2",
"@artifak/pxtoem": "^1.0.1",
"@artifak/pxtorem": "^1.0.1",
"@artifak/text-input": "^1.0.2",
"@artifak/typography": "^2.0.0",
"@artifak/useclickaway": "^1.0.0",
"@artifak/usedebouncedfn": "^1.0.0",
"@artifak/usematchmedia": "^1.0.2",
"@artifak/usewindowsize": "^1.0.2"
},
Expand Down
1 change: 0 additions & 1 deletion packages/bundler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const baseOutputOptions = {
'styled-components': 'StyledComponents',
'styled-system': 'StyledSystem'
},
sourcemap: true,
exports: 'named'
};

Expand Down
26 changes: 22 additions & 4 deletions packages/useclickaway/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
# `@artifak/useclickaway`

> TODO: description
A React hook to trigger a callback when a click event occurs on a target that is not the specified ref HTML element.

## Usage

```
const useclickaway = require('@artifak/useclickaway');
```ts
import React from 'react';
import { useClickAway } from '@artifak/useclickaway;

const Dummy = () => {
const ref: React.RefObject<HTMLDivElement> = React.createRef();

const onClickAway = () => {
console.log('Clicked');
};

useClickAway(ref, onClickAway);

// TODO: DEMONSTRATE API
return (
<div>
Wrapper
<div ref={ref}>
Click Me
</div>
</div>
);
};
```

0 comments on commit 4459ef8

Please sign in to comment.