pipesol-button 1.0.1-beta.11 → 1.0.1-beta.14

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.
@@ -0,0 +1,89 @@
1
+ import React from "react";
2
+ import { ButtonKind } from "@/types/ButtonKind";
3
+ /**
4
+ * Propriedades do ActionButton.
5
+ *
6
+ * @remarks
7
+ * - O estilo base é lido do `theme.palette.custom.{primaryButton|secondaryButton}` conforme `kind`.
8
+ * - As props `background`, `backgroundHover`, `color`, `colorHover`, `borderRadius` e `boxShadow`
9
+ * são opcionais e sobrescrevem o valor do tema quando fornecidas.
10
+ */
11
+ export interface ActionButtonProps {
12
+ /**
13
+ * Seleciona o conjunto de tokens do tema.
14
+ * @default "primary"
15
+ */
16
+ kind?: ButtonKind;
17
+ /**
18
+ * Largura CSS do botão (ex.: "200px" | "100%").
19
+ * @default "auto"
20
+ */
21
+ width?: string;
22
+ /**
23
+ * Altura CSS do botão (ex.: "44px").
24
+ * @default "auto"
25
+ */
26
+ height?: string;
27
+ /**
28
+ * Padding interno (ex.: "12px 20px").
29
+ * @default "12px 20px"
30
+ */
31
+ padding?: string;
32
+ /**
33
+ * Margin externa (ex.: "8px 0 0").
34
+ * @default "0"
35
+ */
36
+ margin?: string;
37
+ /**
38
+ * Texto exibido no botão.
39
+ * @default ""
40
+ */
41
+ text?: string;
42
+ /**
43
+ * Ícone opcional exibido à esquerda do texto.
44
+ * @default undefined
45
+ */
46
+ icon?: React.ReactNode;
47
+ /**
48
+ * Define se o botão está desabilitado.
49
+ * @default false
50
+ */
51
+ disabled?: boolean;
52
+ /**
53
+ * Sombreamento do botão. Se ausente no tema, usa "none".
54
+ * @default (valor do tema) ou "none"
55
+ */
56
+ boxShadow?: string;
57
+ /**
58
+ * Sobrescreve o background.
59
+ * @default (valor do tema)
60
+ */
61
+ background?: string;
62
+ /**
63
+ * Sobrescreve o background no hover.
64
+ * @default (valor do tema)
65
+ */
66
+ backgroundHover?: string;
67
+ /**
68
+ * Sobrescreve a cor do texto.
69
+ * @default (valor do tema)
70
+ */
71
+ color?: string;
72
+ /**
73
+ * Sobrescreve a cor do texto no hover.
74
+ * @default (valor do tema)
75
+ */
76
+ colorHover?: string;
77
+ /**
78
+ * Sobrescreve o border-radius.
79
+ * @default (valor do tema)
80
+ */
81
+ borderRadius?: string;
82
+ /**
83
+ * Função chamada no clique.
84
+ * @default undefined
85
+ */
86
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
87
+ }
88
+ declare const ActionButton: React.FC<ActionButtonProps>;
89
+ export default ActionButton;
@@ -0,0 +1,87 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Button from "@mui/material/Button";
3
+ import { styled } from "@mui/material/styles";
4
+ /**
5
+ * Botão estilizado baseado no tema custom com API controlada pela lib.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * // Uso básico
10
+ * <ActionButton text="Enviar" onClick={() => console.log("Clicou")} />
11
+ *
12
+ * // Secondary via tokens do tema
13
+ * <ActionButton kind="secondary" text="Saiba mais" />
14
+ *
15
+ * // Com ícone e dimensões
16
+ * <ActionButton
17
+ * text="Continuar"
18
+ * icon={<SomeIcon />}
19
+ * width="220px"
20
+ * height="44px"
21
+ * />
22
+ *
23
+ * // Overrides visuais
24
+ * <ActionButton
25
+ * text="Custom"
26
+ * background="#1e88e5"
27
+ * backgroundHover="#1565c0"
28
+ * color="#fff"
29
+ * colorHover="#fff"
30
+ * borderRadius="9999px"
31
+ * boxShadow="0 4px 14px rgba(0,0,0,0.12)"
32
+ * />
33
+ * ```
34
+ */
35
+ const StyledButton = styled(Button, {
36
+ shouldForwardProp: (prop) => ![
37
+ "kind",
38
+ "width",
39
+ "height",
40
+ "padding",
41
+ "margin",
42
+ "background",
43
+ "backgroundHover",
44
+ "colorText",
45
+ "colorHover",
46
+ "borderRadius",
47
+ "boxShadow",
48
+ "text",
49
+ "icon",
50
+ ].includes(prop),
51
+ })(({ theme, kind = "primary", width, height, padding, margin, background, backgroundHover, colorText, colorHover, borderRadius, boxShadow }) => {
52
+ var _a, _b, _c;
53
+ const tokens = kind === "primary"
54
+ ? theme.palette.custom.primaryButton
55
+ : theme.palette.custom.secondaryButton;
56
+ return {
57
+ // Dimensões
58
+ width: width !== null && width !== void 0 ? width : "auto",
59
+ height: height !== null && height !== void 0 ? height : "auto",
60
+ padding: padding !== null && padding !== void 0 ? padding : "12px 20px",
61
+ margin: margin !== null && margin !== void 0 ? margin : "0",
62
+ // Visual
63
+ textTransform: "none",
64
+ borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : tokens.borderRadius,
65
+ boxShadow: (_a = boxShadow !== null && boxShadow !== void 0 ? boxShadow : tokens.boxShadow) !== null && _a !== void 0 ? _a : "none",
66
+ // Cores
67
+ background: background !== null && background !== void 0 ? background : tokens.background,
68
+ color: colorText !== null && colorText !== void 0 ? colorText : tokens.color,
69
+ "&:hover": {
70
+ background: backgroundHover !== null && backgroundHover !== void 0 ? backgroundHover : tokens.backgroundHover,
71
+ color: (_b = colorHover !== null && colorHover !== void 0 ? colorHover : tokens.colorHover) !== null && _b !== void 0 ? _b : (colorText !== null && colorText !== void 0 ? colorText : tokens.color),
72
+ boxShadow: (_c = boxShadow !== null && boxShadow !== void 0 ? boxShadow : tokens.boxShadow) !== null && _c !== void 0 ? _c : "none",
73
+ },
74
+ // Estado disabled
75
+ "&.Mui-disabled": {
76
+ background: theme.palette.grey[300],
77
+ color: theme.palette.text.disabled,
78
+ boxShadow: "none",
79
+ },
80
+ };
81
+ });
82
+ const ActionButton = ({ kind = "primary", width, height, padding, margin, text = "", icon, disabled = false, onClick, background, backgroundHover, color, colorHover, borderRadius, boxShadow, }) => {
83
+ 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
+ };
85
+ ActionButton.displayName = "ActionButton";
86
+ export default ActionButton;
87
+ //# sourceMappingURL=ActionButton.js.map
@@ -0,0 +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;AAuG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,SAAS,EAAE,EAAE,EAAE;;IAC5I,MAAM,MAAM,GACV,IAAI,KAAK,SAAS;QAChB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa;QACpC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAE3C,OAAO;QACL,YAAY;QACZ,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,MAAM;QACtB,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,MAAM;QACxB,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,WAAW;QAC/B,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,GAAG;QAErB,SAAS;QACT,aA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ACZ,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"}
@@ -1,8 +1,14 @@
1
1
  import React from 'react';
2
+ import { ButtonKind } from '@/types/ButtonKind';
2
3
  /**
3
4
  * Propriedades do componente `NavigationButton`.
4
5
  */
5
6
  interface NavigationButtonProps {
7
+ /**
8
+ * Seleciona o conjunto de tokens do tema.
9
+ * @default "primary"
10
+ */
11
+ kind?: ButtonKind;
6
12
  /**
7
13
  * URL ou âncora para onde o botão deve navegar.
8
14
  * - Se começar com `http`, abre em nova aba.
@@ -12,28 +18,28 @@ interface NavigationButtonProps {
12
18
  /** Texto para acessibilidade (atributo `aria-label`). */
13
19
  aria_label: string;
14
20
  /** Cor de fundo padrão do botão (ex: `#1976d2` ou `transparent`). */
15
- background_color?: string;
21
+ backgroundColor?: string;
16
22
  /** Cor de fundo quando o botão é focado/hover. Se não informado, usa a cor padrão. */
17
- background_color_hover?: string;
23
+ backgroundColorHover?: string;
18
24
  /** Cor do texto padrão (ex: `#fff`). */
19
- color: string;
25
+ color?: string;
20
26
  /** Cor do texto no hover. Se não informado, usa a mesma cor padrão. */
21
- color_hover?: string;
27
+ colorHover?: string;
22
28
  /**
23
- * Cor da borda (ex: `#1976d2`).
24
- * @default "transparent"
29
+ * Borda do Botao (1px solid #fff)
30
+ * @default "none"
25
31
  */
26
- border_color?: string;
32
+ border?: string;
27
33
  /**
28
34
  * Raio de borda (ex: `8px`, `50%`).
29
35
  * @default "0"
30
36
  */
31
- border_radius?: string;
37
+ borderRadius?: string;
32
38
  /**
33
39
  * Sombra CSS (ex: `0 2px 4px rgba(0,0,0,0.2)`).
34
40
  * @default "none"
35
41
  */
36
- box_shadow?: string;
42
+ boxShadow?: string;
37
43
  /** Largura do botão (ex: `200px`, `100%`). */
38
44
  width: string;
39
45
  /**
@@ -3,54 +3,59 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { styled } from '@mui/material/styles';
4
4
  const ButtonStyled = styled('a', {
5
5
  shouldForwardProp: (prop) => ![
6
- 'background_color',
7
- 'background_color_hover',
8
- 'color',
9
- 'color_hover',
6
+ 'kind',
7
+ 'backgroundColor',
8
+ 'backgroundColorHover',
9
+ 'colorText',
10
+ 'colorHover',
10
11
  'padding',
11
- 'border_radius',
12
- 'border_color',
13
- 'color_hover',
12
+ 'borderRadius',
13
+ 'border',
14
14
  'width',
15
15
  'margin',
16
- 'boxshadow',
16
+ 'boxShadow',
17
17
  ].includes(prop),
18
- })(({ background_color, background_color_hover, color, color_hover, padding, border_radius, border_color, width, margin, boxshadow, }) => ({
19
- width: width,
20
- cursor: 'pointer',
21
- textDecoration: 'none',
22
- textTransform: 'none',
23
- textAlign: 'center',
24
- boxShadow: boxshadow,
25
- backgroundColor: background_color,
26
- color: color,
27
- border: `1px solid ${border_color}`,
28
- borderRadius: border_radius,
29
- padding: padding,
30
- margin: margin,
31
- '&:hover': {
32
- backgroundColor: background_color_hover,
33
- color: color_hover,
34
- },
35
- }));
18
+ })(({ theme, kind = "primary", backgroundColor, backgroundColorHover, colorText, colorHover, padding, borderRadius, border, width, margin, boxShadow, }) => {
19
+ var _a, _b;
20
+ const tokens = kind === "primary"
21
+ ? theme.palette.custom.primaryButton
22
+ : theme.palette.custom.secondaryButton;
23
+ return {
24
+ // Dimensões
25
+ width: width !== null && width !== void 0 ? width : "auto",
26
+ padding: padding !== null && padding !== void 0 ? padding : "12px 20px",
27
+ margin: margin !== null && margin !== void 0 ? margin : "0",
28
+ // Visual
29
+ borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : tokens.borderRadius,
30
+ border: border,
31
+ textDecoration: 'none',
32
+ textTransform: 'none',
33
+ cursor: 'pointer',
34
+ textAlign: 'center',
35
+ // Cores
36
+ background: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : tokens.background,
37
+ color: colorText !== null && colorText !== void 0 ? colorText : tokens.color,
38
+ boxShadow: (_a = boxShadow !== null && boxShadow !== void 0 ? boxShadow : tokens.boxShadow) !== null && _a !== void 0 ? _a : "none",
39
+ "&:hover": {
40
+ background: backgroundColorHover !== null && backgroundColorHover !== void 0 ? backgroundColorHover : tokens.backgroundHover,
41
+ color: (_b = colorHover !== null && colorHover !== void 0 ? colorHover : tokens.colorHover) !== null && _b !== void 0 ? _b : (colorText !== null && colorText !== void 0 ? colorText : tokens.color),
42
+ },
43
+ };
44
+ });
36
45
  /**
37
46
  * Botão de navegação reutilizável.
38
47
  * Cria um link estilizado que pode ser usado para redirecionar
39
48
  * para páginas externas ou seções internas.
40
49
  */
41
- const NavigationButton = ({ url, aria_label, background_color, background_color_hover, color, color_hover, border_radius = '0', border_color = 'transparent', box_shadow = 'none', width, margin = '0', padding = '8px 24px', children, }) => {
42
- const backgroundColor = background_color !== null && background_color !== void 0 ? background_color : 'transparent';
43
- const backgroundColorHover = background_color_hover !== null && background_color_hover !== void 0 ? background_color_hover : backgroundColor;
44
- const colorHover = color_hover !== null && color_hover !== void 0 ? color_hover : color;
45
- const borderRadius = border_radius;
50
+ const NavigationButton = ({ url, aria_label, backgroundColor, backgroundColorHover, color, colorHover, borderRadius = '0', border = 'none', boxShadow = 'none', width, margin = '0', padding = '8px 24px', children, }) => {
46
51
  const marginButton = margin;
47
52
  if (url.indexOf('http') !== -1) {
48
53
  // Link externo: abre em nova aba
49
- return (_jsx(ButtonStyled, { href: url, width: width, background_color: backgroundColor, background_color_hover: backgroundColorHover, color: color, color_hover: colorHover, border_radius: borderRadius, border_color: border_color, padding: padding, margin: marginButton, "aria-label": aria_label, target: "_blank", boxshadow: box_shadow, rel: "noopener noreferrer", children: children }));
54
+ return (_jsx(ButtonStyled, { href: url, width: width, backgroundColor: backgroundColor, backgroundColorHover: backgroundColorHover, color: color, colorHover: colorHover, borderRadius: borderRadius, border: border, padding: padding, margin: marginButton, "aria-label": aria_label, target: "_blank", boxShadow: boxShadow, rel: "noopener noreferrer", children: children }));
50
55
  }
51
56
  else {
52
57
  // Link interno ou âncora
53
- return (_jsx(ButtonStyled, { href: url, width: width, background_color: backgroundColor, background_color_hover: backgroundColorHover, color: color, color_hover: colorHover, border_radius: borderRadius, border_color: border_color, padding: padding, margin: marginButton, "aria-label": aria_label, boxshadow: box_shadow, children: children }));
58
+ return (_jsx(ButtonStyled, { href: url, width: width, backgroundColor: backgroundColor, backgroundColorHover: backgroundColorHover, color: color, colorHover: colorHover, borderRadius: borderRadius, border: border, padding: padding, margin: marginButton, "aria-label": aria_label, boxShadow: boxShadow, children: children }));
54
59
  }
55
60
  };
56
61
  export default NavigationButton;
@@ -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;AAE9C,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,EAAE;IAC/B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,kBAAkB;QAClB,wBAAwB;QACxB,OAAO;QACP,aAAa;QACb,SAAS;QACT,eAAe;QACf,cAAc;QACd,aAAa;QACb,OAAO;QACP,QAAQ;QACR,WAAW;KACZ,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAYA,CAAC,EACC,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,KAAK,EACL,MAAM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EACjC,sBAAsB,EAAE,oBAAoB,EAC5C,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,UAAU,EACvB,aAAa,EAAE,YAAY,EAC3B,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,gBACR,UAAU,EACtB,MAAM,EAAC,QAAQ,EACf,SAAS,EAAE,UAAU,EACrB,GAAG,EAAC,qBAAqB,YAExB,QAAQ,GACI,CAChB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,yBAAyB;QACzB,OAAO,CACL,KAAC,YAAY,IACX,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,eAAe,EACjC,sBAAsB,EAAE,oBAAoB,EAC5C,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,UAAU,EACvB,aAAa,EAAE,YAAY,EAC3B,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,gBACR,UAAU,EACtB,SAAS,EAAE,UAAU,YAEpB,QAAQ,GACI,CAChB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
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,EAC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AC"}
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ /**
3
+ * Interface das props do PrimaryButton
4
+ */
5
+ export interface PrimaryButtonProps {
6
+ /** Largura do botão */
7
+ width?: string;
8
+ /** Altura do botão */
9
+ height?: string;
10
+ /** Padding interno */
11
+ padding?: string;
12
+ /** Margin externa */
13
+ margin?: string;
14
+ /** Desabilita o botão */
15
+ disabled?: boolean;
16
+ /** Ícone opcional à esquerda */
17
+ icon?: React.ReactNode;
18
+ /** Texto do botão */
19
+ text: string;
20
+ /** Função chamada no clique */
21
+ onClick?: () => void;
22
+ }
23
+ /**
24
+ * Botão estilizado baseado no tema customizado
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * <PrimaryButton
29
+ * text="Clique Aqui"
30
+ * onClick={() => alert("Clicado!")}
31
+ * width="200px"
32
+ * icon={<SomeIcon />}
33
+ * />
34
+ * ```
35
+ */
36
+ declare const PrimaryButton: React.FC<PrimaryButtonProps>;
37
+ export default PrimaryButton;
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { styled } from "@mui/material/styles";
3
+ import Button from "@mui/material/Button";
4
+ import { useTheme } from "@mui/material/styles";
5
+ import { Typography } from "@mui/material";
6
+ const StyledButton = styled(Button, {
7
+ shouldForwardProp: (prop) => !["width", "height", "padding", "margin"].includes(prop),
8
+ })(({ theme, width, height, padding, margin }) => ({
9
+ background: theme.palette.custom.primaryButton.background,
10
+ color: theme.palette.custom.primaryButton.color,
11
+ borderRadius: theme.palette.custom.primaryButton.borderRadius,
12
+ boxShadow: theme.palette.custom.primaryButton.boxShadow || "none",
13
+ width: width || "auto",
14
+ height: height || "auto",
15
+ padding: padding || "8px 16px",
16
+ margin: margin || "0",
17
+ textTransform: "none",
18
+ fontWeight: 600,
19
+ "&:hover": {
20
+ background: theme.palette.custom.primaryButton.backgroundHover,
21
+ color: theme.palette.custom.primaryButton.colorHover,
22
+ },
23
+ "&.Mui-disabled": {
24
+ background: theme.palette.grey[300],
25
+ color: theme.palette.text.disabled,
26
+ boxShadow: "none",
27
+ },
28
+ }));
29
+ /**
30
+ * Botão estilizado baseado no tema customizado
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * <PrimaryButton
35
+ * text="Clique Aqui"
36
+ * onClick={() => alert("Clicado!")}
37
+ * width="200px"
38
+ * icon={<SomeIcon />}
39
+ * />
40
+ * ```
41
+ */
42
+ const PrimaryButton = ({ width, height, padding, margin, disabled, icon, text, onClick, }) => {
43
+ const theme = useTheme();
44
+ return (_jsx(StyledButton, { width: width, height: height, padding: padding, margin: margin, disabled: disabled, startIcon: icon, onClick: onClick, children: _jsx(Typography, { variant: "subtitle1", component: "span", children: text }) }));
45
+ };
46
+ PrimaryButton.displayName = "PrimaryButton";
47
+ export default PrimaryButton;
48
+ //# sourceMappingURL=PrimaryButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrimaryButton.js","sourceRoot":"","sources":["../../src/components/PrimaryButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAyB3C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IAClC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAc,CAAC;CACrE,CAAC,CACA,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9C,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU;IACzD,KAAK,EAAE,KAAK,CAAC,OAAO,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AAI,GAAc,GACvD,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAC5C,eAAe,aAAa,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export { default as NavigationLink } from './components/NavigationLink';
5
5
  export { default as ScrollToTopButton } from './components/ScrollToTopButton';
6
6
  export { default as WhatsAppButton } from './components/WhatsAppButton';
7
7
  export { default as WhatsAppIcon } from './components/WhatsAppIcon';
8
+ export { default as ActionButton } from "./components/ActionButton";
package/dist/index.js CHANGED
@@ -5,4 +5,5 @@ export { default as NavigationLink } from './components/NavigationLink';
5
5
  export { default as ScrollToTopButton } from './components/ScrollToTopButton';
6
6
  export { default as WhatsAppButton } from './components/WhatsAppButton';
7
7
  export { default as WhatsAppIcon } from './components/WhatsAppIcon';
8
+ export { default as ActionButton } from "./components/ActionButton";
8
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAC,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAC,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/theme.d.ts CHANGED
@@ -1,33 +1,24 @@
1
1
  declare module '@mui/material/styles' {
2
+ interface ButtonOptions {
3
+ background: string;
4
+ backgroundHover: string;
5
+ color: string;
6
+ colorHover: string;
7
+ borderRadius: string;
8
+ boxShadow?: string;
9
+ }
2
10
  interface Palette {
3
11
  custom: {
4
- transparent: string;
5
- backgroundSectionMain: string;
6
- backgroundSectionAlternative: string;
7
- backgroundSectionHighlight?: string;
8
- colorSectionMain: string;
9
- backgroundButtonCTA: string;
10
- backgroundHoverButtonCTA: string;
11
- colorButtonCTA: string;
12
- colorHoverButtonCTA: string;
13
- borderRadiusButtonCTA: string;
14
- carouselColorIndicators: string;
15
- carouselColorFocus: string;
12
+ primaryButton: ButtonOptions;
13
+ secondaryButton: ButtonOptions;
14
+ borderColor?: string;
16
15
  };
17
16
  }
18
17
  interface PaletteOptions {
19
18
  custom?: {
20
- transparent: string;
21
- backgroundSectionMain: string;
22
- backgroundSectionAlternative: string;
23
- backgroundSectionHighlight?: string;
24
- backgroundButtonCTA: string;
25
- backgroundHoverButtonCTA: string;
26
- colorButtonCTA: string;
27
- colorHoverButtonCTA: string;
28
- borderRadiusButtonCTA: string;
29
- carouselColorIndicators: string;
30
- carouselColorFocus: string;
19
+ primaryButton: ButtonOptions;
20
+ secondaryButton: ButtonOptions;
21
+ borderColor?: string;
31
22
  };
32
23
  }
33
24
  }