pipesol-button 1.0.1-beta.15 → 1.0.1-beta.16
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/dist/components/ActionButton.d.ts +3 -6
- package/dist/components/ActionButton.js +13 -14
- package/dist/components/ActionButton.js.map +1 -1
- package/dist/components/NavigationButton.js +7 -8
- package/dist/components/NavigationButton.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -51,32 +51,29 @@ export interface ActionButtonProps {
|
|
|
51
51
|
disabled?: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* Sombreamento do botão. Se ausente no tema, usa "none".
|
|
54
|
-
* @default
|
|
54
|
+
* @default "none"
|
|
55
55
|
*/
|
|
56
56
|
boxShadow?: string;
|
|
57
57
|
/**
|
|
58
58
|
* Sobrescreve o background.
|
|
59
|
-
* @default
|
|
59
|
+
* @default "transparent"
|
|
60
60
|
*/
|
|
61
61
|
background?: string;
|
|
62
62
|
/**
|
|
63
63
|
* Sobrescreve o background no hover.
|
|
64
|
-
* @default (valor do tema)
|
|
65
64
|
*/
|
|
66
65
|
backgroundHover?: string;
|
|
67
66
|
/**
|
|
68
67
|
* Sobrescreve a cor do texto.
|
|
69
|
-
* @default (valor do tema)
|
|
70
68
|
*/
|
|
71
69
|
color?: string;
|
|
72
70
|
/**
|
|
73
71
|
* Sobrescreve a cor do texto no hover.
|
|
74
|
-
* @default (valor do tema)
|
|
75
72
|
*/
|
|
76
73
|
colorHover?: string;
|
|
77
74
|
/**
|
|
78
75
|
* Sobrescreve o border-radius.
|
|
79
|
-
* @default
|
|
76
|
+
* @default '0'
|
|
80
77
|
*/
|
|
81
78
|
borderRadius?: string;
|
|
82
79
|
/**
|
|
@@ -49,27 +49,26 @@ const StyledButton = styled(Button, {
|
|
|
49
49
|
"icon",
|
|
50
50
|
].includes(prop),
|
|
51
51
|
})(({ theme, kind = "primary", width, height, padding, margin, background, backgroundHover, colorText, colorHover, borderRadius, boxShadow }) => {
|
|
52
|
-
var _a, _b, _c;
|
|
53
52
|
const tokens = kind === "primary"
|
|
54
53
|
? theme.palette.custom.primaryButton
|
|
55
|
-
: theme.palette.custom.secondaryButton;
|
|
54
|
+
: (kind === "secondary" ? theme.palette.custom.secondaryButton : undefined);
|
|
56
55
|
return {
|
|
57
56
|
// Dimensões
|
|
58
|
-
width: width
|
|
59
|
-
height: height
|
|
60
|
-
padding: padding
|
|
61
|
-
margin: margin
|
|
57
|
+
width: width,
|
|
58
|
+
height: height,
|
|
59
|
+
padding: padding,
|
|
60
|
+
margin: margin,
|
|
62
61
|
// Visual
|
|
63
62
|
textTransform: "none",
|
|
64
|
-
borderRadius:
|
|
65
|
-
boxShadow:
|
|
63
|
+
borderRadius: tokens ? tokens.borderRadius : borderRadius,
|
|
64
|
+
boxShadow: tokens ? tokens.boxShadow : boxShadow,
|
|
66
65
|
// Cores
|
|
67
|
-
background:
|
|
68
|
-
color:
|
|
66
|
+
background: tokens ? tokens.background : background,
|
|
67
|
+
color: tokens ? tokens.color : colorText,
|
|
69
68
|
"&:hover": {
|
|
70
|
-
background: backgroundHover !== null && backgroundHover !== void 0 ? backgroundHover :
|
|
71
|
-
color:
|
|
72
|
-
boxShadow:
|
|
69
|
+
background: tokens ? tokens.backgroundHover : (backgroundHover !== null && backgroundHover !== void 0 ? backgroundHover : background),
|
|
70
|
+
color: tokens ? tokens.colorHover : (colorHover !== null && colorHover !== void 0 ? colorHover : colorText),
|
|
71
|
+
boxShadow: tokens ? tokens.boxShadow : boxShadow,
|
|
73
72
|
},
|
|
74
73
|
// Estado disabled
|
|
75
74
|
"&.Mui-disabled": {
|
|
@@ -79,7 +78,7 @@ const StyledButton = styled(Button, {
|
|
|
79
78
|
},
|
|
80
79
|
};
|
|
81
80
|
});
|
|
82
|
-
const ActionButton = ({ kind = "primary", width, height, padding, margin, text = "", icon, disabled = false, onClick, background, backgroundHover, color, colorHover, borderRadius, boxShadow, }) => {
|
|
81
|
+
const ActionButton = ({ kind = "primary", width = "auto", height = "auto", padding = "12px 20px", margin = "0", text = "", icon, disabled = false, onClick, background = 'transparent', backgroundHover, color, colorHover, borderRadius = '0', boxShadow = 'none', }) => {
|
|
83
82
|
return (_jsx(StyledButton, { kind: kind, width: width, height: height, padding: padding, margin: margin, disabled: disabled, startIcon: icon, onClick: onClick, background: background, backgroundHover: backgroundHover, colorText: color, colorHover: colorHover, borderRadius: borderRadius, boxShadow: boxShadow, children: text }));
|
|
84
83
|
};
|
|
85
84
|
ActionButton.displayName = "ActionButton";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.js","sourceRoot":"","sources":["../../src/components/ActionButton.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionButton.js","sourceRoot":"","sources":["../../src/components/ActionButton.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAoG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IAClC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,MAAM;QACN,OAAO;QACP,QAAQ;QACR,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,iBAAiB;QACjB,WAAW;QACX,YAAY;QACZ,cAAc;QACd,WAAW;QACX,MAAM;QACN,MAAM;KACP,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC5B,CAAC,CAcA,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,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AAG,CAAC;YACnC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ;YAClC,SAAS,EAAE,MAAM;SAClB;KACF,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAgC,CAAC,EACjD,IAAI,GAAG,SAAS,EAChB,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,MAAM,EACf,OAAO,GAAG,WAAW,EACrB,MAAM,GAAG,GAAG,EACZ,IAAI,GAAG,EAAE,EACT,IAAI,EACJ,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,UAAU,GAAG,aAAa,EAC1B,eAAe,EACf,KAAK,EACL,UAAU,EACV,YAAY,GAAE,GAAG,EACjB,SAAS,GAAG,MAAM,GACnB,EAAE,EAAE;IACH,OAAO,CACL,KAAC,YAAY,IACX,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,YAEnB,IAAI,GACQ,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAC1C,eAAe,YAAY,CAAC"}
|
|
@@ -16,29 +16,28 @@ const ButtonStyled = styled('a', {
|
|
|
16
16
|
'boxShadow',
|
|
17
17
|
].includes(prop),
|
|
18
18
|
})(({ theme, kind = "primary", backgroundColor, backgroundColorHover, colorText, colorHover, padding, borderRadius, border, width, margin, boxShadow, }) => {
|
|
19
|
-
var _a, _b;
|
|
20
19
|
const tokens = kind === "primary"
|
|
21
20
|
? theme.palette.custom.primaryButton
|
|
22
|
-
: theme.palette.custom.secondaryButton;
|
|
21
|
+
: (kind === "secondary" ? theme.palette.custom.secondaryButton : undefined);
|
|
23
22
|
return {
|
|
24
23
|
// Dimensões
|
|
25
24
|
width: width !== null && width !== void 0 ? width : "auto",
|
|
26
25
|
padding: padding !== null && padding !== void 0 ? padding : "12px 20px",
|
|
27
26
|
margin: margin !== null && margin !== void 0 ? margin : "0",
|
|
28
27
|
// Visual
|
|
29
|
-
borderRadius:
|
|
28
|
+
borderRadius: tokens ? tokens.borderRadius : borderRadius,
|
|
29
|
+
boxShadow: tokens ? tokens.boxShadow : boxShadow,
|
|
30
30
|
border: border,
|
|
31
31
|
textDecoration: 'none',
|
|
32
32
|
textTransform: 'none',
|
|
33
33
|
cursor: 'pointer',
|
|
34
34
|
textAlign: 'center',
|
|
35
35
|
// Cores
|
|
36
|
-
background:
|
|
37
|
-
color:
|
|
38
|
-
boxShadow: (_a = boxShadow !== null && boxShadow !== void 0 ? boxShadow : tokens.boxShadow) !== null && _a !== void 0 ? _a : "none",
|
|
36
|
+
background: tokens ? tokens.background : backgroundColor,
|
|
37
|
+
color: tokens ? tokens.color : colorText,
|
|
39
38
|
"&:hover": {
|
|
40
|
-
background: backgroundColorHover !== null && backgroundColorHover !== void 0 ? backgroundColorHover :
|
|
41
|
-
color:
|
|
39
|
+
background: tokens ? tokens.backgroundHover : (backgroundColorHover !== null && backgroundColorHover !== void 0 ? backgroundColorHover : backgroundColor),
|
|
40
|
+
color: tokens ? tokens.colorHover : (colorHover !== null && colorHover !== void 0 ? colorHover : colorText),
|
|
42
41
|
},
|
|
43
42
|
};
|
|
44
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationButton.js","sourceRoot":"","sources":["../../src/components/NavigationButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,EAAE;IAC/B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,MAAM;QACN,iBAAiB;QACjB,sBAAsB;QACtB,WAAW;QACX,YAAY;QACZ,SAAS;QACT,cAAc;QACd,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,WAAW;KACZ,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAaA,CAAC,EACC,KAAK,EAAE,IAAI,GAAG,SAAS,EACvB,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,OAAO,EACP,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"NavigationButton.js","sourceRoot":"","sources":["../../src/components/NavigationButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,EAAE;IAC/B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,MAAM;QACN,iBAAiB;QACjB,sBAAsB;QACtB,WAAW;QACX,YAAY;QACZ,SAAS;QACT,cAAc;QACd,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,WAAW;KACZ,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAaA,CAAC,EACC,KAAK,EAAE,IAAI,GAAG,SAAS,EACvB,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,OAAO,EACP,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE,EAAE;IAEH,MAAM,MAAM,GACV,IAAI,KAAK,SAAS;QAChB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa;QACpC,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAA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