@corva/ui 0.52.0-0 → 0.52.0-1
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.
|
@@ -7,6 +7,7 @@ interface IconButtonProps extends Omit<MuiIconButtonProps, 'size' | 'variant' |
|
|
|
7
7
|
declare const IconButton: {
|
|
8
8
|
({ tooltipProps, ...otherProps }: IconButtonProps): JSX.Element;
|
|
9
9
|
propTypes: {
|
|
10
|
+
isActive: PropTypes.Requireable<boolean>;
|
|
10
11
|
size: PropTypes.Requireable<string>;
|
|
11
12
|
variant: PropTypes.Requireable<string>;
|
|
12
13
|
tooltipProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -22,6 +23,7 @@ declare const IconButton: {
|
|
|
22
23
|
'data-testid': PropTypes.Requireable<string>;
|
|
23
24
|
};
|
|
24
25
|
defaultProps: {
|
|
26
|
+
isActive: boolean;
|
|
25
27
|
size: string;
|
|
26
28
|
variant: string;
|
|
27
29
|
tooltipProps: {
|
|
@@ -32,6 +34,7 @@ declare const IconButton: {
|
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
declare const iconButtonPropTypes: {
|
|
37
|
+
isActive: PropTypes.Requireable<boolean>;
|
|
35
38
|
size: PropTypes.Requireable<string>;
|
|
36
39
|
variant: PropTypes.Requireable<string>;
|
|
37
40
|
tooltipProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAkE,eAAe,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAkE,eAAe,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAiE1I,UAAU,eAAgB,SACxB,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC,EACxD,SAAS,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC;IAChD,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACnC;AAED,QAAA,MAAM,UAAU;sCAA4D,eAAe,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCxG,CAAC;AAEF,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;CAaxB,CAAC;AAaF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o,__assign as t}from"../../_virtual/_tslib.js";import{jsx as r}from"react/jsx-runtime";import i from"prop-types";import a from"classnames";import{makeStyles as e,Tooltip as
|
|
1
|
+
import{__rest as o,__assign as t}from"../../_virtual/_tslib.js";import{jsx as r}from"react/jsx-runtime";import i from"prop-types";import a from"classnames";import{makeStyles as e,Tooltip as l,IconButton as n}from"@material-ui/core";import{useState as s}from"react";var c=e((function(o){return{root:{color:o.palette.primary.text6,padding:6,"&:hover":{color:"#FFFFFF",backgroundColor:o.palette.background.b7,"&.MuiIconButton-colorPrimary":{color:o.palette.primary.main}},"&:active":{color:"#FFFFFF","&.MuiIconButton-colorPrimary":{color:o.palette.primary.main}},"&.Mui-disabled":{pointerEvents:"all",opacity:.4,color:"#FFFFFF","&.MuiIconButton-colorPrimary":{color:o.palette.primary.main}},"& .MuiSvgIcon-root":{color:"inherit",fontSize:"inherit"}},colorPrimary:{color:o.palette.primary.main},sizeSmall:{fontSize:16,padding:7},sizeLarge:{"&.MuiButtonBase-root":{padding:8}},contained:{backgroundColor:o.palette.background.b9},containedDisabled:{"&.MuiButtonBase-root":{backgroundColor:o.palette.background.b9}},tooltip:{top:"-10px !important"},active:{"&.MuiButtonBase-root":{color:o.palette.primary.text1,backgroundColor:o.palette.background.b9,"&.MuiIconButton-colorPrimary":{color:o.palette.primary.main}}}}})),d=function(i){var e,d,p,m,u=i.tooltipProps,b=void 0===u?{title:void 0}:u,g=o(i,["tooltipProps"]),v=g.isActive,y=g.size,f=g.variant,F=g.classes,P=void 0===F?{}:F,z=g["data-testid"],B=c(),M=s(!1),k=M[0],S=M[1],I=t(t({},P),{root:a(P.root,B.root,(e={},e[B.sizeLarge]="large"===y,e[B.contained]="contained"===f,e)),disabled:a(P.disabled,(d={},d[B.containedDisabled]="contained"===f,d)),colorPrimary:a(P.colorPrimary,B.colorPrimary),sizeSmall:a(P.sizeSmall,B.sizeSmall)});return b.title?r(l,t({open:k},b,{children:r(n,t({"data-testid":z,classes:I,className:a((p={},p[B.active]=v,p)),onMouseOver:function(){return S(!0)},onMouseOut:function(){return S(!1)}},g))})):r(n,t({"data-testid":z,classes:I,className:a((m={},m[B.active]=v,m))},g))},p={isActive:i.bool,size:i.oneOf(["small","medium","large"]),variant:i.oneOf(["default","contained"]),tooltipProps:i.shape({title:i.string}),classes:i.shape({root:i.string,disabled:i.string,colorPrimary:i.string,sizeSmall:i.string}),disabled:i.bool,"data-testid":i.string};d.propTypes=p,d.defaultProps={isActive:!1,size:"medium",variant:"default",tooltipProps:{title:void 0},disabled:!1,"data-testid":"IconButton"};export{d as default};
|