@cdek-it/react-native-ui-kit 0.6.8 → 1.0.0-beta.0
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/README.md +9 -0
- package/dist/components/Accordion/Accordion.js +9 -10
- package/dist/components/Avatar/Avatar.js +7 -9
- package/dist/components/Badge/Badge.js +28 -20
- package/dist/components/Button/BaseButton.d.ts +3 -3
- package/dist/components/Button/BaseButton.js +12 -41
- package/dist/components/Button/Button.js +6 -4
- package/dist/components/Button/ButtonBadge.js +13 -12
- package/dist/components/Button/ButtonSeverity.js +6 -4
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/types.d.ts +2 -25
- package/dist/components/Button/utils/ButtonActivityIndicator.d.ts +3 -3
- package/dist/components/Button/utils/ButtonActivityIndicator.js +16 -12
- package/dist/components/Button/utils/ButtonContainer.d.ts +15 -6
- package/dist/components/Button/utils/ButtonContainer.js +424 -4
- package/dist/components/Button/utils/ButtonIcon.d.ts +8 -4
- package/dist/components/Button/utils/ButtonIcon.js +147 -4
- package/dist/components/Button/utils/ButtonLabel.d.ts +9 -4
- package/dist/components/Button/utils/ButtonLabel.js +139 -4
- package/dist/components/Button/utils/ButtonLeftArea.d.ts +9 -4
- package/dist/components/Button/utils/ButtonLeftArea.js +3 -3
- package/dist/components/Button/utils/ButtonPressedContext.d.ts +1 -0
- package/dist/components/Button/utils/ButtonPressedContext.js +2 -0
- package/dist/components/Button/utils/ButtonRightArea.d.ts +9 -3
- package/dist/components/Button/utils/ButtonRightArea.js +3 -3
- package/dist/components/Button/utils/ButtonVariantContext.d.ts +6 -0
- package/dist/components/Button/utils/ButtonVariantContext.js +4 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -7
- package/dist/components/Checkbox/Checkbox.js +74 -22
- package/dist/components/Chip/Chip.js +13 -7
- package/dist/components/Dialog/DialogComponent.js +2 -3
- package/dist/components/Dialog/DialogHeader.js +17 -13
- package/dist/components/Divider/Divider.js +6 -6
- package/dist/components/Input/InputGroup.js +6 -13
- package/dist/components/Input/InputGroupAddon.js +5 -5
- package/dist/components/Input/InputOtp/InputOtp.js +2 -3
- package/dist/components/Input/InputOtp/InputOtpItem.js +2 -3
- package/dist/components/Input/InputSwitch/InputSwitch.js +2 -2
- package/dist/components/Input/InputSwitch/styles/useHandleStyles.js +13 -11
- package/dist/components/Input/InputSwitch/styles/useSliderStyles.d.ts +6 -5
- package/dist/components/Input/InputSwitch/styles/useSliderStyles.js +36 -29
- package/dist/components/Input/InputTextBase/InputTextBase.d.ts +0 -5
- package/dist/components/Input/InputTextBase/InputTextBase.js +41 -26
- package/dist/components/Input/InputTextBase/useInputStyles.d.ts +6 -5
- package/dist/components/Input/InputTextBase/useInputStyles.js +6 -9
- package/dist/components/Input/index.d.ts +0 -1
- package/dist/components/Input/index.js +0 -1
- package/dist/components/List/Base/ListBase.js +17 -14
- package/dist/components/MenuItem/MenuItemAccessory.js +5 -5
- package/dist/components/MenuItem/MenuItemIcon.js +4 -5
- package/dist/components/MenuItem/Template/MenuItemTemplate.js +8 -5
- package/dist/components/Message/Message.js +54 -38
- package/dist/components/ProgressBar/ProgressBar.js +2 -3
- package/dist/components/ProgressSpinner/ProgressSpinner.js +3 -4
- package/dist/components/RadioButton/RadioButton.js +87 -104
- package/dist/components/Rating/Rating.js +2 -3
- package/dist/components/Rating/RatingClear.js +10 -11
- package/dist/components/Rating/RatingItem.js +23 -24
- package/dist/components/Rating/RatingItemContainer.js +2 -3
- package/dist/components/SelectButton/SelectButton.js +2 -3
- package/dist/components/SelectButton/SelectButtonItem.js +22 -49
- package/dist/components/Skeleton/Skeleton.js +2 -3
- package/dist/components/Slider/Slider.js +4 -6
- package/dist/components/Tabs/TabItem/TabItem.js +12 -21
- package/dist/components/Tabs/Tabs.js +2 -3
- package/dist/components/Tag/Tag.js +44 -29
- package/dist/components/Timer/Timer.js +2 -3
- package/dist/components/Timer/TimerFlip.js +2 -3
- package/dist/components/ToggleButton/ToggleButton.js +159 -35
- package/dist/components/Typography/Anchor.js +11 -7
- package/dist/components/Typography/Body.js +3 -4
- package/dist/components/Typography/Caption.js +11 -5
- package/dist/components/Typography/Service.js +13 -7
- package/dist/components/Typography/Subtitle.js +3 -6
- package/dist/components/Typography/Title.js +3 -6
- package/dist/hooks/useChangeTheme.d.ts +2 -1
- package/dist/hooks/useChangeTheme.js +10 -3
- package/dist/hooks/useFonts.d.ts +2 -1
- package/dist/hooks/useFonts.js +3 -3
- package/dist/hooks/useTheme.d.ts +2 -1
- package/dist/hooks/useTheme.js +6 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/theme/ThemeContext.d.ts +9 -7
- package/dist/theme/ThemeContext.js +21 -14
- package/dist/theme/darkTheme.js +1 -0
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/lightTheme.js +1 -0
- package/dist/theme/types.d.ts +1 -0
- package/dist/utils/SvgUniversal.d.ts +9 -14
- package/dist/utils/SvgUniversal.js +10 -2
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +18 -8
- package/dist/components/Button/styles/index.d.ts +0 -2
- package/dist/components/Button/styles/index.js +0 -2
- package/dist/components/Button/styles/useBasicButtonStyles.d.ts +0 -98
- package/dist/components/Button/styles/useBasicButtonStyles.js +0 -81
- package/dist/components/Button/styles/useDangerButtonStyles.d.ts +0 -63
- package/dist/components/Button/styles/useDangerButtonStyles.js +0 -57
- package/dist/components/Button/styles/useInfoButtonStyles.d.ts +0 -63
- package/dist/components/Button/styles/useInfoButtonStyles.js +0 -56
- package/dist/components/Button/styles/useSeverityButtonStyles.d.ts +0 -64
- package/dist/components/Button/styles/useSeverityButtonStyles.js +0 -29
- package/dist/components/Button/styles/useSuccessButtonStyles.d.ts +0 -63
- package/dist/components/Button/styles/useSuccessButtonStyles.js +0 -61
- package/dist/components/Button/styles/useWarningButtonStyles.d.ts +0 -63
- package/dist/components/Button/styles/useWarningButtonStyles.js +0 -61
- package/dist/components/Button/utils/useButtonContainerCallbackStyle.d.ts +0 -3
- package/dist/components/Button/utils/useButtonContainerCallbackStyle.js +0 -141
- package/dist/components/Button/utils/useButtonLabelStyle.d.ts +0 -3
- package/dist/components/Button/utils/useButtonLabelStyle.js +0 -40
- package/dist/components/Button/utils/useIconStyle.d.ts +0 -7
- package/dist/components/Button/utils/useIconStyle.js +0 -35
- package/dist/components/Button/utils/useTypeBasedStyle.d.ts +0 -2
- package/dist/components/Button/utils/useTypeBasedStyle.js +0 -4
- package/dist/components/Checkbox/hooks/usePressableStyles.d.ts +0 -15
- package/dist/components/Checkbox/hooks/usePressableStyles.js +0 -91
- package/dist/components/Input/FloatLabel.d.ts +0 -22
- package/dist/components/Input/FloatLabel.js +0 -19
- package/dist/components/ToggleButton/hooks/useIconSize.d.ts +0 -14
- package/dist/components/ToggleButton/hooks/useIconSize.js +0 -26
- package/dist/components/ToggleButton/hooks/useLabelSize.d.ts +0 -8
- package/dist/components/ToggleButton/hooks/useLabelSize.js +0 -19
- package/dist/components/ToggleButton/hooks/useStateStyles.d.ts +0 -11
- package/dist/components/ToggleButton/hooks/useStateStyles.js +0 -92
- package/dist/utils/makeStyles.d.ts +0 -11
- package/dist/utils/makeStyles.js +0 -19
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { makeStyles } from '../../../utils/makeStyles';
|
|
2
|
-
export const useBasicButtonStyles = () => {
|
|
3
|
-
const labelVariantStyles = useLabelVariantStyles();
|
|
4
|
-
const pressedVariantStyles = usePressedVariantStyles();
|
|
5
|
-
const containerVariantStyles = useContainerVariantStyles();
|
|
6
|
-
const iconVariantStyles = useIconVariantStyles();
|
|
7
|
-
const pressedLabelVariantStyles = usePressedLabelVariantStyles();
|
|
8
|
-
return {
|
|
9
|
-
containerVariantStyles,
|
|
10
|
-
labelVariantStyles,
|
|
11
|
-
pressedVariantStyles,
|
|
12
|
-
iconVariantStyles,
|
|
13
|
-
pressedLabelVariantStyles,
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
const useLabelVariantStyles = makeStyles(({ theme }) => ({
|
|
17
|
-
primary: { color: theme.Button.Brand.buttonTextColor },
|
|
18
|
-
secondary: { color: theme.Button.Primary.secondaryButtonTextColor },
|
|
19
|
-
tertiary: { color: theme.Button.Secondary.helpButtonTextColor },
|
|
20
|
-
text: { color: theme.Button.Text.textButtonTextColor },
|
|
21
|
-
link: { color: theme.Button.Text.textButtonTextColor },
|
|
22
|
-
}));
|
|
23
|
-
const usePressedVariantStyles = makeStyles(({ theme }) => ({
|
|
24
|
-
primary: {
|
|
25
|
-
borderColor: theme.Button.Brand.buttonBorderColor,
|
|
26
|
-
backgroundColor: theme.Button.Brand.buttonHoverBg,
|
|
27
|
-
},
|
|
28
|
-
secondary: {
|
|
29
|
-
borderColor: theme.Button.Primary.secondaryButtonHoverBorderColor,
|
|
30
|
-
backgroundColor: theme.Button.Primary.secondaryButtonHoverBg,
|
|
31
|
-
},
|
|
32
|
-
tertiary: {
|
|
33
|
-
borderColor: theme.Button.Secondary.helpButtonHoverBorderColor,
|
|
34
|
-
backgroundColor: theme.Button.Secondary.helpButtonHoverBg,
|
|
35
|
-
},
|
|
36
|
-
text: {
|
|
37
|
-
borderColor: theme.Button.Brand.buttonBorderColor,
|
|
38
|
-
backgroundColor: theme.Button.Text.textButtonHoverBg,
|
|
39
|
-
},
|
|
40
|
-
link: {},
|
|
41
|
-
}));
|
|
42
|
-
const useContainerVariantStyles = makeStyles(({ theme, spacing }) => ({
|
|
43
|
-
primary: {
|
|
44
|
-
borderColor: theme.Button.Brand.buttonBorderColor,
|
|
45
|
-
backgroundColor: theme.Button.Brand.buttonBg,
|
|
46
|
-
},
|
|
47
|
-
secondary: {
|
|
48
|
-
borderColor: theme.Button.Primary.secondaryButtonBorderColor,
|
|
49
|
-
backgroundColor: theme.Button.Primary.secondaryButtonBg,
|
|
50
|
-
},
|
|
51
|
-
tertiary: {
|
|
52
|
-
borderColor: theme.Button.Secondary.helpButtonBorderColor,
|
|
53
|
-
backgroundColor: theme.Button.Secondary.helpButtonBg,
|
|
54
|
-
},
|
|
55
|
-
text: {
|
|
56
|
-
borderColor: theme.Button.Brand.buttonBorderColor,
|
|
57
|
-
backgroundColor: theme.Button.Text.textButtonBg,
|
|
58
|
-
},
|
|
59
|
-
link: {
|
|
60
|
-
paddingHorizontal: 0,
|
|
61
|
-
paddingVertical: spacing.Padding['p-1'],
|
|
62
|
-
height: 'auto',
|
|
63
|
-
minHeight: 'auto',
|
|
64
|
-
borderColor: theme.Button.Brand.buttonBorderColor,
|
|
65
|
-
backgroundColor: theme.Button.Text.textButtonBg,
|
|
66
|
-
},
|
|
67
|
-
}));
|
|
68
|
-
const useIconVariantStyles = makeStyles(({ theme }) => ({
|
|
69
|
-
primary: { color: theme.Button.Brand.buttonTextColor },
|
|
70
|
-
secondary: { color: theme.Button.Primary.secondaryButtonTextColor },
|
|
71
|
-
tertiary: { color: theme.Button.Secondary.helpButtonTextColor },
|
|
72
|
-
text: { color: theme.Button.Text.textButtonTextColor },
|
|
73
|
-
link: { color: theme.Button.Text.textButtonTextColor },
|
|
74
|
-
}));
|
|
75
|
-
const usePressedLabelVariantStyles = makeStyles(({ theme, typography }) => ({
|
|
76
|
-
primary: { color: theme.Button.Brand.buttonTextColor },
|
|
77
|
-
secondary: { color: theme.Button.Primary.secondaryButtonTextColor },
|
|
78
|
-
tertiary: { color: theme.Button.Secondary.helpButtonTextColor },
|
|
79
|
-
text: { color: theme.Button.Text.textButtonTextColor },
|
|
80
|
-
link: { color: typography.Color.Common['text-color-secondary'] },
|
|
81
|
-
}));
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export declare const useDangerButtonStyles: () => {
|
|
2
|
-
containerVariantStyles: {
|
|
3
|
-
basic: {
|
|
4
|
-
borderColor: string;
|
|
5
|
-
backgroundColor: string;
|
|
6
|
-
};
|
|
7
|
-
outlined: {
|
|
8
|
-
borderColor: string;
|
|
9
|
-
backgroundColor: string;
|
|
10
|
-
};
|
|
11
|
-
text: {
|
|
12
|
-
borderColor: string;
|
|
13
|
-
backgroundColor: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
labelVariantStyles: {
|
|
17
|
-
basic: {
|
|
18
|
-
color: string;
|
|
19
|
-
};
|
|
20
|
-
outlined: {
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
text: {
|
|
24
|
-
color: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
pressedVariantStyles: {
|
|
28
|
-
basic: {
|
|
29
|
-
borderColor: string;
|
|
30
|
-
backgroundColor: string;
|
|
31
|
-
};
|
|
32
|
-
outlined: {
|
|
33
|
-
borderColor: string;
|
|
34
|
-
backgroundColor: string;
|
|
35
|
-
};
|
|
36
|
-
text: {
|
|
37
|
-
borderColor: string;
|
|
38
|
-
backgroundColor: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
iconVariantStyles: {
|
|
42
|
-
basic: {
|
|
43
|
-
color: string;
|
|
44
|
-
};
|
|
45
|
-
outlined: {
|
|
46
|
-
color: string;
|
|
47
|
-
};
|
|
48
|
-
text: {
|
|
49
|
-
color: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
pressedLabelVariantStyles: {
|
|
53
|
-
basic: {
|
|
54
|
-
color: string;
|
|
55
|
-
};
|
|
56
|
-
outlined: {
|
|
57
|
-
color: string;
|
|
58
|
-
};
|
|
59
|
-
text: {
|
|
60
|
-
color: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { makeStyles } from '../../../utils/makeStyles';
|
|
2
|
-
export const useDangerButtonStyles = () => {
|
|
3
|
-
const labelVariantStyles = useLabelVariantStyles();
|
|
4
|
-
const pressedVariantStyles = usePressedVariantStyles();
|
|
5
|
-
const containerVariantStyles = useContainerVariantStyles();
|
|
6
|
-
const iconVariantStyles = useIconVariantStyles();
|
|
7
|
-
return {
|
|
8
|
-
containerVariantStyles,
|
|
9
|
-
labelVariantStyles,
|
|
10
|
-
pressedVariantStyles,
|
|
11
|
-
iconVariantStyles,
|
|
12
|
-
pressedLabelVariantStyles: labelVariantStyles,
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
const useLabelVariantStyles = makeStyles(({ theme }) => ({
|
|
16
|
-
basic: { color: theme.Button.Severity.Danger.Basic.dangerButtonTextColor },
|
|
17
|
-
outlined: {
|
|
18
|
-
color: theme.Button.Severity.Danger.Outlined.dangerOutlinedButtonTextColor,
|
|
19
|
-
},
|
|
20
|
-
text: { color: theme.Button.Severity.Danger.Text.dangerTextButtonTextColor },
|
|
21
|
-
}));
|
|
22
|
-
const usePressedVariantStyles = makeStyles(({ theme }) => ({
|
|
23
|
-
basic: {
|
|
24
|
-
borderColor: theme.Button.Severity.Danger.Basic.dangerButtonBorderColor,
|
|
25
|
-
backgroundColor: theme.Button.Severity.Danger.Basic.dangerButtonHoverBg,
|
|
26
|
-
},
|
|
27
|
-
outlined: {
|
|
28
|
-
borderColor: theme.Button.Severity.Danger.Outlined
|
|
29
|
-
.dangerOutlinedButtonHoverBorderColor,
|
|
30
|
-
backgroundColor: theme.Button.Severity.Danger.Outlined.dangerOutlinedButtonHoverBg,
|
|
31
|
-
},
|
|
32
|
-
text: {
|
|
33
|
-
borderColor: theme.Surface['surface-transparent'],
|
|
34
|
-
backgroundColor: theme.Button.Severity.Danger.Text.dangerTextButtonHoverBg,
|
|
35
|
-
},
|
|
36
|
-
}));
|
|
37
|
-
const useContainerVariantStyles = makeStyles(({ theme }) => ({
|
|
38
|
-
basic: {
|
|
39
|
-
borderColor: theme.Button.Severity.Danger.Basic.dangerButtonBorderColor,
|
|
40
|
-
backgroundColor: theme.Button.Severity.Danger.Basic.dangerButtonBg,
|
|
41
|
-
},
|
|
42
|
-
outlined: {
|
|
43
|
-
borderColor: theme.Button.Severity.Danger.Outlined.dangerOutlinedButtonBorderColor,
|
|
44
|
-
backgroundColor: theme.Button.Severity.Danger.Outlined.dangerOutlinedButtonBg,
|
|
45
|
-
},
|
|
46
|
-
text: {
|
|
47
|
-
borderColor: theme.Button.Severity.Danger.Basic.dangerButtonBorderColor,
|
|
48
|
-
backgroundColor: theme.Button.Severity.Danger.Text.dangerTextButtonBg,
|
|
49
|
-
},
|
|
50
|
-
}));
|
|
51
|
-
const useIconVariantStyles = makeStyles(({ theme }) => ({
|
|
52
|
-
basic: { color: theme.Button.Severity.Danger.Basic.dangerButtonTextColor },
|
|
53
|
-
outlined: {
|
|
54
|
-
color: theme.Button.Severity.Danger.Outlined.dangerOutlinedButtonTextColor,
|
|
55
|
-
},
|
|
56
|
-
text: { color: theme.Button.Severity.Danger.Text.dangerTextButtonTextColor },
|
|
57
|
-
}));
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export declare const useInfoButtonStyles: () => {
|
|
2
|
-
containerVariantStyles: {
|
|
3
|
-
basic: {
|
|
4
|
-
borderColor: string;
|
|
5
|
-
backgroundColor: string;
|
|
6
|
-
};
|
|
7
|
-
outlined: {
|
|
8
|
-
borderColor: string;
|
|
9
|
-
backgroundColor: string;
|
|
10
|
-
};
|
|
11
|
-
text: {
|
|
12
|
-
borderColor: string;
|
|
13
|
-
backgroundColor: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
labelVariantStyles: {
|
|
17
|
-
basic: {
|
|
18
|
-
color: string;
|
|
19
|
-
};
|
|
20
|
-
outlined: {
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
text: {
|
|
24
|
-
color: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
pressedVariantStyles: {
|
|
28
|
-
basic: {
|
|
29
|
-
borderColor: string;
|
|
30
|
-
backgroundColor: string;
|
|
31
|
-
};
|
|
32
|
-
outlined: {
|
|
33
|
-
borderColor: string;
|
|
34
|
-
backgroundColor: string;
|
|
35
|
-
};
|
|
36
|
-
text: {
|
|
37
|
-
borderColor: string;
|
|
38
|
-
backgroundColor: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
iconVariantStyles: {
|
|
42
|
-
basic: {
|
|
43
|
-
color: string;
|
|
44
|
-
};
|
|
45
|
-
outlined: {
|
|
46
|
-
color: string;
|
|
47
|
-
};
|
|
48
|
-
text: {
|
|
49
|
-
color: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
pressedLabelVariantStyles: {
|
|
53
|
-
basic: {
|
|
54
|
-
color: string;
|
|
55
|
-
};
|
|
56
|
-
outlined: {
|
|
57
|
-
color: string;
|
|
58
|
-
};
|
|
59
|
-
text: {
|
|
60
|
-
color: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { makeStyles } from '../../../utils/makeStyles';
|
|
2
|
-
export const useInfoButtonStyles = () => {
|
|
3
|
-
const labelVariantStyles = useLabelVariantStyles();
|
|
4
|
-
const pressedVariantStyles = usePressedVariantStyles();
|
|
5
|
-
const containerVariantStyles = useContainerVariantStyles();
|
|
6
|
-
const iconVariantStyles = useIconVariantStyles();
|
|
7
|
-
return {
|
|
8
|
-
containerVariantStyles,
|
|
9
|
-
labelVariantStyles,
|
|
10
|
-
pressedVariantStyles,
|
|
11
|
-
iconVariantStyles,
|
|
12
|
-
pressedLabelVariantStyles: labelVariantStyles,
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
const useLabelVariantStyles = makeStyles(({ theme }) => ({
|
|
16
|
-
basic: { color: theme.Button.Severity.Info.Basic.infoButtonTextColor },
|
|
17
|
-
outlined: {
|
|
18
|
-
color: theme.Button.Severity.Info.Outlined.infoOutlinedButtonTextColor,
|
|
19
|
-
},
|
|
20
|
-
text: { color: theme.Button.Severity.Info.Text.infoTextButtonTextColor },
|
|
21
|
-
}));
|
|
22
|
-
const usePressedVariantStyles = makeStyles(({ theme }) => ({
|
|
23
|
-
basic: {
|
|
24
|
-
borderColor: theme.Button.Severity.Info.Basic.infoButtonBorderColor,
|
|
25
|
-
backgroundColor: theme.Button.Severity.Info.Basic.infoButtonHoverBg,
|
|
26
|
-
},
|
|
27
|
-
outlined: {
|
|
28
|
-
borderColor: theme.Button.Severity.Info.Outlined.infoOutlinedButtonHoverBorderColor,
|
|
29
|
-
backgroundColor: theme.Button.Severity.Info.Outlined.infoOutlinedButtonHoverBg,
|
|
30
|
-
},
|
|
31
|
-
text: {
|
|
32
|
-
borderColor: theme.Surface['surface-transparent'],
|
|
33
|
-
backgroundColor: theme.Button.Severity.Info.Text.infoTextButtonHoverBg,
|
|
34
|
-
},
|
|
35
|
-
}));
|
|
36
|
-
const useContainerVariantStyles = makeStyles(({ theme }) => ({
|
|
37
|
-
basic: {
|
|
38
|
-
borderColor: theme.Button.Severity.Info.Basic.infoButtonBorderColor,
|
|
39
|
-
backgroundColor: theme.Button.Severity.Info.Basic.infoButtonBg,
|
|
40
|
-
},
|
|
41
|
-
outlined: {
|
|
42
|
-
borderColor: theme.Button.Severity.Info.Outlined.infoOutlinedButtonBorderColor,
|
|
43
|
-
backgroundColor: theme.Button.Severity.Info.Outlined.infoOutlinedButtonBg,
|
|
44
|
-
},
|
|
45
|
-
text: {
|
|
46
|
-
borderColor: theme.Button.Severity.Info.Basic.infoButtonBorderColor,
|
|
47
|
-
backgroundColor: theme.Button.Severity.Info.Text.infoTextButtonBg,
|
|
48
|
-
},
|
|
49
|
-
}));
|
|
50
|
-
const useIconVariantStyles = makeStyles(({ theme }) => ({
|
|
51
|
-
basic: { color: theme.Button.Severity.Info.Basic.infoButtonTextColor },
|
|
52
|
-
outlined: {
|
|
53
|
-
color: theme.Button.Severity.Info.Outlined.infoOutlinedButtonTextColor,
|
|
54
|
-
},
|
|
55
|
-
text: { color: theme.Button.Severity.Info.Text.infoTextButtonTextColor },
|
|
56
|
-
}));
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { ButtonSeverityProps } from '../types';
|
|
2
|
-
export declare const useSeverityButtonStyles: (severity: ButtonSeverityProps["severity"]) => {
|
|
3
|
-
containerVariantStyles: {
|
|
4
|
-
basic: {
|
|
5
|
-
borderColor: string;
|
|
6
|
-
backgroundColor: string;
|
|
7
|
-
};
|
|
8
|
-
outlined: {
|
|
9
|
-
borderColor: string;
|
|
10
|
-
backgroundColor: string;
|
|
11
|
-
};
|
|
12
|
-
text: {
|
|
13
|
-
borderColor: string;
|
|
14
|
-
backgroundColor: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
labelVariantStyles: {
|
|
18
|
-
basic: {
|
|
19
|
-
color: string;
|
|
20
|
-
};
|
|
21
|
-
outlined: {
|
|
22
|
-
color: string;
|
|
23
|
-
};
|
|
24
|
-
text: {
|
|
25
|
-
color: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
pressedVariantStyles: {
|
|
29
|
-
basic: {
|
|
30
|
-
borderColor: string;
|
|
31
|
-
backgroundColor: string;
|
|
32
|
-
};
|
|
33
|
-
outlined: {
|
|
34
|
-
borderColor: string;
|
|
35
|
-
backgroundColor: string;
|
|
36
|
-
};
|
|
37
|
-
text: {
|
|
38
|
-
borderColor: string;
|
|
39
|
-
backgroundColor: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
iconVariantStyles: {
|
|
43
|
-
basic: {
|
|
44
|
-
color: string;
|
|
45
|
-
};
|
|
46
|
-
outlined: {
|
|
47
|
-
color: string;
|
|
48
|
-
};
|
|
49
|
-
text: {
|
|
50
|
-
color: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
pressedLabelVariantStyles: {
|
|
54
|
-
basic: {
|
|
55
|
-
color: string;
|
|
56
|
-
};
|
|
57
|
-
outlined: {
|
|
58
|
-
color: string;
|
|
59
|
-
};
|
|
60
|
-
text: {
|
|
61
|
-
color: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { useDangerButtonStyles } from './useDangerButtonStyles';
|
|
3
|
-
import { useInfoButtonStyles } from './useInfoButtonStyles';
|
|
4
|
-
import { useSuccessButtonStyles } from './useSuccessButtonStyles';
|
|
5
|
-
import { useWarningButtonStyles } from './useWarningButtonStyles';
|
|
6
|
-
export const useSeverityButtonStyles = (severity) => {
|
|
7
|
-
const dangerButtonStyles = useDangerButtonStyles();
|
|
8
|
-
const warningButtonStyles = useWarningButtonStyles();
|
|
9
|
-
const infoButtonStyles = useInfoButtonStyles();
|
|
10
|
-
const successButtonStyles = useSuccessButtonStyles();
|
|
11
|
-
return useMemo(() => {
|
|
12
|
-
switch (severity) {
|
|
13
|
-
case 'danger':
|
|
14
|
-
return dangerButtonStyles;
|
|
15
|
-
case 'warning':
|
|
16
|
-
return warningButtonStyles;
|
|
17
|
-
case 'info':
|
|
18
|
-
return infoButtonStyles;
|
|
19
|
-
case 'success':
|
|
20
|
-
return successButtonStyles;
|
|
21
|
-
}
|
|
22
|
-
}, [
|
|
23
|
-
dangerButtonStyles,
|
|
24
|
-
infoButtonStyles,
|
|
25
|
-
severity,
|
|
26
|
-
successButtonStyles,
|
|
27
|
-
warningButtonStyles,
|
|
28
|
-
]);
|
|
29
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export declare const useSuccessButtonStyles: () => {
|
|
2
|
-
containerVariantStyles: {
|
|
3
|
-
basic: {
|
|
4
|
-
borderColor: string;
|
|
5
|
-
backgroundColor: string;
|
|
6
|
-
};
|
|
7
|
-
outlined: {
|
|
8
|
-
borderColor: string;
|
|
9
|
-
backgroundColor: string;
|
|
10
|
-
};
|
|
11
|
-
text: {
|
|
12
|
-
borderColor: string;
|
|
13
|
-
backgroundColor: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
labelVariantStyles: {
|
|
17
|
-
basic: {
|
|
18
|
-
color: string;
|
|
19
|
-
};
|
|
20
|
-
outlined: {
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
text: {
|
|
24
|
-
color: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
pressedVariantStyles: {
|
|
28
|
-
basic: {
|
|
29
|
-
borderColor: string;
|
|
30
|
-
backgroundColor: string;
|
|
31
|
-
};
|
|
32
|
-
outlined: {
|
|
33
|
-
borderColor: string;
|
|
34
|
-
backgroundColor: string;
|
|
35
|
-
};
|
|
36
|
-
text: {
|
|
37
|
-
borderColor: string;
|
|
38
|
-
backgroundColor: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
iconVariantStyles: {
|
|
42
|
-
basic: {
|
|
43
|
-
color: string;
|
|
44
|
-
};
|
|
45
|
-
outlined: {
|
|
46
|
-
color: string;
|
|
47
|
-
};
|
|
48
|
-
text: {
|
|
49
|
-
color: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
pressedLabelVariantStyles: {
|
|
53
|
-
basic: {
|
|
54
|
-
color: string;
|
|
55
|
-
};
|
|
56
|
-
outlined: {
|
|
57
|
-
color: string;
|
|
58
|
-
};
|
|
59
|
-
text: {
|
|
60
|
-
color: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { makeStyles } from '../../../utils/makeStyles';
|
|
2
|
-
export const useSuccessButtonStyles = () => {
|
|
3
|
-
const labelVariantStyles = useLabelVariantStyles();
|
|
4
|
-
const pressedVariantStyles = usePressedVariantStyles();
|
|
5
|
-
const containerVariantStyles = useContainerVariantStyles();
|
|
6
|
-
const iconVariantStyles = useIconVariantStyles();
|
|
7
|
-
return {
|
|
8
|
-
containerVariantStyles,
|
|
9
|
-
labelVariantStyles,
|
|
10
|
-
pressedVariantStyles,
|
|
11
|
-
iconVariantStyles,
|
|
12
|
-
pressedLabelVariantStyles: labelVariantStyles,
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
const useLabelVariantStyles = makeStyles(({ theme }) => ({
|
|
16
|
-
basic: { color: theme.Button.Severity.Success.Basic.successButtonTextColor },
|
|
17
|
-
outlined: {
|
|
18
|
-
color: theme.Button.Severity.Success.Outlined.successOutlinedButtonTextColor,
|
|
19
|
-
},
|
|
20
|
-
text: {
|
|
21
|
-
color: theme.Button.Severity.Success.Text.successTextButtonTextColor,
|
|
22
|
-
},
|
|
23
|
-
}));
|
|
24
|
-
const usePressedVariantStyles = makeStyles(({ theme }) => ({
|
|
25
|
-
basic: {
|
|
26
|
-
borderColor: theme.Button.Severity.Success.Basic.successButtonBorderColor,
|
|
27
|
-
backgroundColor: theme.Button.Severity.Success.Basic.successButtonHoverBg,
|
|
28
|
-
},
|
|
29
|
-
outlined: {
|
|
30
|
-
borderColor: theme.Button.Severity.Success.Outlined
|
|
31
|
-
.successOutlinedButtonHoverBorderColor,
|
|
32
|
-
backgroundColor: theme.Button.Severity.Success.Outlined.successOutlinedButtonHoverBg,
|
|
33
|
-
},
|
|
34
|
-
text: {
|
|
35
|
-
borderColor: theme.Surface['surface-transparent'],
|
|
36
|
-
backgroundColor: theme.Button.Severity.Success.Text.successTextButtonHoverBg,
|
|
37
|
-
},
|
|
38
|
-
}));
|
|
39
|
-
const useContainerVariantStyles = makeStyles(({ theme }) => ({
|
|
40
|
-
basic: {
|
|
41
|
-
borderColor: theme.Button.Severity.Success.Basic.successButtonBorderColor,
|
|
42
|
-
backgroundColor: theme.Button.Severity.Success.Basic.successButtonBg,
|
|
43
|
-
},
|
|
44
|
-
outlined: {
|
|
45
|
-
borderColor: theme.Button.Severity.Success.Outlined.successOutlinedButtonBorderColor,
|
|
46
|
-
backgroundColor: theme.Button.Severity.Success.Outlined.successOutlinedButtonBg,
|
|
47
|
-
},
|
|
48
|
-
text: {
|
|
49
|
-
borderColor: theme.Button.Severity.Success.Basic.successButtonBorderColor,
|
|
50
|
-
backgroundColor: theme.Button.Severity.Success.Text.successTextButtonBg,
|
|
51
|
-
},
|
|
52
|
-
}));
|
|
53
|
-
const useIconVariantStyles = makeStyles(({ theme }) => ({
|
|
54
|
-
basic: { color: theme.Button.Severity.Success.Basic.successButtonTextColor },
|
|
55
|
-
outlined: {
|
|
56
|
-
color: theme.Button.Severity.Success.Outlined.successOutlinedButtonTextColor,
|
|
57
|
-
},
|
|
58
|
-
text: {
|
|
59
|
-
color: theme.Button.Severity.Success.Text.successTextButtonTextColor,
|
|
60
|
-
},
|
|
61
|
-
}));
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export declare const useWarningButtonStyles: () => {
|
|
2
|
-
containerVariantStyles: {
|
|
3
|
-
basic: {
|
|
4
|
-
borderColor: string;
|
|
5
|
-
backgroundColor: string;
|
|
6
|
-
};
|
|
7
|
-
outlined: {
|
|
8
|
-
borderColor: string;
|
|
9
|
-
backgroundColor: string;
|
|
10
|
-
};
|
|
11
|
-
text: {
|
|
12
|
-
borderColor: string;
|
|
13
|
-
backgroundColor: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
labelVariantStyles: {
|
|
17
|
-
basic: {
|
|
18
|
-
color: string;
|
|
19
|
-
};
|
|
20
|
-
outlined: {
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
text: {
|
|
24
|
-
color: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
pressedVariantStyles: {
|
|
28
|
-
basic: {
|
|
29
|
-
borderColor: string;
|
|
30
|
-
backgroundColor: string;
|
|
31
|
-
};
|
|
32
|
-
outlined: {
|
|
33
|
-
borderColor: string;
|
|
34
|
-
backgroundColor: string;
|
|
35
|
-
};
|
|
36
|
-
text: {
|
|
37
|
-
borderColor: string;
|
|
38
|
-
backgroundColor: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
iconVariantStyles: {
|
|
42
|
-
basic: {
|
|
43
|
-
color: string;
|
|
44
|
-
};
|
|
45
|
-
outlined: {
|
|
46
|
-
color: string;
|
|
47
|
-
};
|
|
48
|
-
text: {
|
|
49
|
-
color: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
pressedLabelVariantStyles: {
|
|
53
|
-
basic: {
|
|
54
|
-
color: string;
|
|
55
|
-
};
|
|
56
|
-
outlined: {
|
|
57
|
-
color: string;
|
|
58
|
-
};
|
|
59
|
-
text: {
|
|
60
|
-
color: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { makeStyles } from '../../../utils/makeStyles';
|
|
2
|
-
export const useWarningButtonStyles = () => {
|
|
3
|
-
const labelVariantStyles = useLabelVariantStyles();
|
|
4
|
-
const pressedVariantStyles = usePressedVariantStyles();
|
|
5
|
-
const containerVariantStyles = useContainerVariantStyles();
|
|
6
|
-
const iconVariantStyles = useIconVariantStyles();
|
|
7
|
-
return {
|
|
8
|
-
containerVariantStyles,
|
|
9
|
-
labelVariantStyles,
|
|
10
|
-
pressedVariantStyles,
|
|
11
|
-
iconVariantStyles,
|
|
12
|
-
pressedLabelVariantStyles: labelVariantStyles,
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
const useLabelVariantStyles = makeStyles(({ theme }) => ({
|
|
16
|
-
basic: { color: theme.Button.Severity.Warning.Basic.warningButtonTextColor },
|
|
17
|
-
outlined: {
|
|
18
|
-
color: theme.Button.Severity.Warning.Outlined.warningOutlinedButtonTextColor,
|
|
19
|
-
},
|
|
20
|
-
text: {
|
|
21
|
-
color: theme.Button.Severity.Warning.Text.warningTextButtonTextColor,
|
|
22
|
-
},
|
|
23
|
-
}));
|
|
24
|
-
const usePressedVariantStyles = makeStyles(({ theme }) => ({
|
|
25
|
-
basic: {
|
|
26
|
-
borderColor: theme.Button.Severity.Warning.Basic.warningButtonBorderColor,
|
|
27
|
-
backgroundColor: theme.Button.Severity.Warning.Basic.warningButtonHoverBg,
|
|
28
|
-
},
|
|
29
|
-
outlined: {
|
|
30
|
-
borderColor: theme.Button.Severity.Warning.Outlined
|
|
31
|
-
.warningOutlinedButtonHoverBorderColor,
|
|
32
|
-
backgroundColor: theme.Button.Severity.Warning.Outlined.warningOutlinedButtonHoverBg,
|
|
33
|
-
},
|
|
34
|
-
text: {
|
|
35
|
-
borderColor: theme.Surface['surface-transparent'],
|
|
36
|
-
backgroundColor: theme.Button.Severity.Warning.Text.warningTextButtonHoverBg,
|
|
37
|
-
},
|
|
38
|
-
}));
|
|
39
|
-
const useContainerVariantStyles = makeStyles(({ theme }) => ({
|
|
40
|
-
basic: {
|
|
41
|
-
borderColor: theme.Button.Severity.Warning.Basic.warningButtonBorderColor,
|
|
42
|
-
backgroundColor: theme.Button.Severity.Warning.Basic.warningButtonBg,
|
|
43
|
-
},
|
|
44
|
-
outlined: {
|
|
45
|
-
borderColor: theme.Button.Severity.Warning.Outlined.warningOutlinedButtonBorderColor,
|
|
46
|
-
backgroundColor: theme.Button.Severity.Warning.Outlined.warningOutlinedButtonBg,
|
|
47
|
-
},
|
|
48
|
-
text: {
|
|
49
|
-
borderColor: theme.Button.Severity.Warning.Basic.warningButtonBorderColor,
|
|
50
|
-
backgroundColor: theme.Button.Severity.Warning.Text.warningTextButtonBg,
|
|
51
|
-
},
|
|
52
|
-
}));
|
|
53
|
-
const useIconVariantStyles = makeStyles(({ theme }) => ({
|
|
54
|
-
basic: { color: theme.Button.Severity.Warning.Basic.warningButtonTextColor },
|
|
55
|
-
outlined: {
|
|
56
|
-
color: theme.Button.Severity.Warning.Outlined.warningOutlinedButtonTextColor,
|
|
57
|
-
},
|
|
58
|
-
text: {
|
|
59
|
-
color: theme.Button.Severity.Warning.Text.warningTextButtonTextColor,
|
|
60
|
-
},
|
|
61
|
-
}));
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type PressableStateCallbackType, type ViewStyle } from 'react-native';
|
|
2
|
-
import type { BaseButtonProps, ButtonVariant, ContainerVariantStyles, PressedVariantStyles } from '../types';
|
|
3
|
-
export declare const useButtonContainerCallbackStyle: <Variant extends ButtonVariant>(size: Required<BaseButtonProps<Variant>>["size"], variant: Required<BaseButtonProps<Variant>>["variant"], shape: Required<BaseButtonProps<Variant>>["shape"], disabled: Required<BaseButtonProps<Variant>>["disabled"], loading: Required<BaseButtonProps<Variant>>["loading"], iconOnly: Required<BaseButtonProps<Variant>>["iconOnly"], style: BaseButtonProps<Variant>["style"], containerVariantStyles: ContainerVariantStyles<Variant>, pressedVariantStyles: PressedVariantStyles<Variant>) => ({ pressed }: PressableStateCallbackType) => ViewStyle;
|