react-restyle-components 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  import './color-picker-modal.css';
3
3
  import '../../../tc.css';
4
- export declare const ColorPickerModal: ({ color, onChange }: {
5
- color: any;
6
- onChange: any;
7
- }) => React.JSX.Element;
4
+ interface ColorPickerModalProps {
5
+ color: string;
6
+ onChange: (string: any) => void;
7
+ onClose?: () => void;
8
+ }
9
+ export declare const ColorPickerModal: ({ color, onChange, onClose, }: ColorPickerModalProps) => React.JSX.Element;
10
+ export {};
@@ -3,10 +3,13 @@ import { HexColorPicker } from 'react-colorful';
3
3
  import { useClickOutside } from '../../../hooks';
4
4
  import './color-picker-modal.css';
5
5
  import '../../../tc.css';
6
- export const ColorPickerModal = ({ color, onChange }) => {
6
+ export const ColorPickerModal = ({ color, onChange, onClose, }) => {
7
7
  const popover = useRef();
8
8
  const [isOpen, toggle] = useState(false);
9
- const close = useCallback(() => toggle(false), []);
9
+ const close = useCallback(() => {
10
+ toggle(false);
11
+ onClose && onClose();
12
+ }, []);
10
13
  useClickOutside(popover, close);
11
14
  return (React.createElement("div", { className: "picker-modal" },
12
15
  React.createElement("div", { className: "swatch-modal", style: { backgroundColor: color }, onClick: () => toggle(true) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {