@stigg/react-sdk 4.4.0-beta.7 → 4.4.0-beta.8

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.4.0-beta.7",
2
+ "version": "4.4.0-beta.8",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
3
  import styled from '@emotion/styled/macro';
4
- import { Button as MuiButton, ButtonProps, css } from '@mui/material';
4
+ import { Button as MuiButton, ButtonProps } from '@mui/material';
5
5
 
6
6
  export type StyledButtonProps = { $success?: boolean; $error?: boolean };
7
7
 
@@ -9,30 +9,25 @@ const StyledButton = styled(MuiButton, { shouldForwardProp: (prop) => !prop.star
9
9
  border-radius: 10px;
10
10
  text-transform: none;
11
11
 
12
- ${({ theme, $success, $error }) => {
12
+ background-color: ${({ theme, $success, $error }) => {
13
13
  if ($success) {
14
- return css`
15
- background-color: ${theme.stigg.palette.success};
16
- cursor: 'default';
17
-
18
- &:hover {
19
- background-color: ${theme.stigg.palette.successDark};
20
- }
21
- `;
14
+ return theme.stigg.palette.success;
15
+ } else if ($error) {
16
+ return theme.stigg.palette.error;
22
17
  }
23
-
24
- if ($error) {
25
- return css`
26
- background-color: ${theme.stigg.palette.error};
27
-
28
- &:hover {
29
- background-color: ${theme.stigg.palette.errorDark};
30
- }
31
- `;
32
- }
33
-
34
18
  return '';
35
- }}
19
+ }};
20
+
21
+ &:hover {
22
+ background-color: ${({ theme, $success, $error }) => {
23
+ if ($success) {
24
+ return theme.stigg.palette.successDark;
25
+ } else if ($error) {
26
+ return theme.stigg.palette.errorDark;
27
+ }
28
+ return '';
29
+ }};
30
+ }
36
31
  `;
37
32
 
38
33
  export const Button = ({ variant = 'outlined', ...props }: ButtonProps & StyledButtonProps) => {