@corva/ui 0.51.0-2 → 0.51.0-3

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.
@@ -1,19 +1,21 @@
1
1
  export default CopyToClipboard;
2
- declare function CopyToClipboard({ children, classes, dataTestId, tooltipProps }: {
2
+ declare function CopyToClipboard({ children, classes, dataTestId, IconComponent, tooltipProps }: {
3
3
  children: any;
4
4
  classes: any;
5
5
  dataTestId: any;
6
+ IconComponent: any;
6
7
  tooltipProps: any;
7
8
  }): JSX.Element;
8
9
  declare namespace CopyToClipboard {
9
10
  namespace propTypes {
10
11
  const children: PropTypes.Validator<string>;
11
12
  const dataTestId: PropTypes.Requireable<string>;
12
- namespace tooltipProps {
13
- const title: PropTypes.Requireable<string>;
14
- const placement: PropTypes.Requireable<string>;
15
- const delay: PropTypes.Requireable<number>;
16
- }
13
+ const IconComponent: PropTypes.Requireable<PropTypes.InferProps<{}>>;
14
+ const tooltipProps: PropTypes.Requireable<PropTypes.InferProps<{
15
+ title: PropTypes.Requireable<string>;
16
+ placement: PropTypes.Requireable<string>;
17
+ delay: PropTypes.Requireable<number>;
18
+ }>>;
17
19
  const classes: PropTypes.Requireable<PropTypes.InferProps<{
18
20
  icon: PropTypes.Requireable<string>;
19
21
  tooltip: PropTypes.Requireable<string>;
@@ -23,13 +25,11 @@ declare namespace CopyToClipboard {
23
25
  namespace defaultProps {
24
26
  const dataTestId_1: any;
25
27
  export { dataTestId_1 as dataTestId };
28
+ export { FileCopyIcon as IconComponent };
26
29
  export namespace tooltipProps_1 {
27
- const title_1: string;
28
- export { title_1 as title };
29
- const placement_1: string;
30
- export { placement_1 as placement };
31
- const delay_1: number;
32
- export { delay_1 as delay };
30
+ const title: string;
31
+ const placement: string;
32
+ const delay: number;
33
33
  }
34
34
  export { tooltipProps_1 as tooltipProps };
35
35
  const classes_1: {};
@@ -37,4 +37,5 @@ declare namespace CopyToClipboard {
37
37
  }
38
38
  }
39
39
  import PropTypes from "prop-types";
40
+ import FileCopyIcon from "@material-ui/icons/FileCopy";
40
41
  //# sourceMappingURL=CopyToClipboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CopyToClipboard.d.ts","sourceRoot":"","sources":["../../../src/components/CopyToClipboard/CopyToClipboard.js"],"names":[],"mappings":";AAkBA;;;;;gBAoCC"}
1
+ {"version":3,"file":"CopyToClipboard.d.ts","sourceRoot":"","sources":["../../../src/components/CopyToClipboard/CopyToClipboard.js"],"names":[],"mappings":";AAkBA;;;;;;gBAoCC"}
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/slicedToArray";import{useState as o,useEffect as e}from"react";import r from"classnames";import i from"prop-types";import{makeStyles as p,Tooltip as l}from"@material-ui/core";import s from"@material-ui/icons/FileCopy";import a from"../../utils/main.js";import{jsx as n}from"react/jsx-runtime";var c=p((function(t){return{icon:{cursor:"pointer"},tooltip:{color:t.palette.primary.text6,backgroundColor:"rgba(20, 20, 20, 0.5)"}}})),m=function(i){var p=i.children,m=i.classes,u=i.dataTestId,d=i.tooltipProps,f=o(!1),g=t(f,2),y=g[0],b=g[1],T=c();return e((function(){var t=setTimeout((function(){b(!1)}),d.delay);return function(){return clearTimeout(t)}}),[y]),n(l,{classes:{tooltip:r(T.tooltip,m.tooltip),popper:r(T.tooltipPopper,m.tooltipPopper)},title:d.title,open:y,disableFocusListener:!0,disableHoverListener:!0,placement:d.placement,children:n(s,{className:r(T.icon,m.icon),"data-testid":u,onClick:function(){b(!0),a.copyToClipboard(p)}})})};m.propTypes={children:i.string.isRequired,dataTestId:i.string,tooltipProps:{title:i.string,placement:i.string,delay:i.number},classes:i.shape({icon:i.string,tooltip:i.string,tooltipPopper:i.string})},m.defaultProps={dataTestId:null,tooltipProps:{title:"Copied",placement:"top",delay:1500},classes:{}};export{m as default};
1
+ import t from"@babel/runtime/helpers/slicedToArray";import{useState as o,useEffect as e}from"react";import r from"classnames";import i from"prop-types";import{makeStyles as p,Tooltip as n}from"@material-ui/core";import s from"@material-ui/icons/FileCopy";import l from"../../utils/main.js";import{jsx as a}from"react/jsx-runtime";var c=p((function(t){return{icon:{cursor:"pointer"},tooltip:{color:t.palette.primary.text6,backgroundColor:"rgba(20, 20, 20, 0.5)"}}})),m=function(i){var p=i.children,s=i.classes,m=i.dataTestId,u=i.IconComponent,d=i.tooltipProps,f=o(!1),g=t(f,2),y=g[0],b=g[1],C=c();return e((function(){var t=setTimeout((function(){b(!1)}),d.delay);return function(){return clearTimeout(t)}}),[y]),a(n,{classes:{tooltip:r(C.tooltip,s.tooltip),popper:r(C.tooltipPopper,s.tooltipPopper)},title:d.title,open:y,disableFocusListener:!0,disableHoverListener:!0,placement:d.placement,children:a(u,{className:r(C.icon,s.icon),"data-testid":m,onClick:function(){b(!0),l.copyToClipboard(p)}})})};m.propTypes={children:i.string.isRequired,dataTestId:i.string,IconComponent:i.shape({}),tooltipProps:i.shape({title:i.string,placement:i.string,delay:i.number}),classes:i.shape({icon:i.string,tooltip:i.string,tooltipPopper:i.string})},m.defaultProps={dataTestId:null,IconComponent:s,tooltipProps:{title:"Copied",placement:"top",delay:1500},classes:{}};export{m as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.51.0-2",
3
+ "version": "0.51.0-3",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"