|
|
@@ -17,45 +17,52 @@ export const CHECK_BOX_TYPE_STYLES: Record<
|
|
|
CheckBoxType,
|
|
|
{
|
|
|
containerColor: keyof NCoreUIKit.ContainerContentColors;
|
|
|
+ indicatorColor: keyof NCoreUIKit.BorderContentColors;
|
|
|
subTitleColor: keyof NCoreUIKit.TextContentColors;
|
|
|
borderColor: keyof NCoreUIKit.BorderContentColors;
|
|
|
titleColor: keyof NCoreUIKit.TextContentColors;
|
|
|
}
|
|
|
> = {
|
|
|
primary: {
|
|
|
- subTitleColor: "emphasized",
|
|
|
- containerColor: "primary",
|
|
|
+ indicatorColor: "emphasized",
|
|
|
borderColor: "emphasized",
|
|
|
- titleColor: "emphasized"
|
|
|
+ containerColor: "mid",
|
|
|
+ subTitleColor: "low",
|
|
|
+ titleColor: "mid"
|
|
|
},
|
|
|
danger: {
|
|
|
+ subTitleColor: "dangerLow",
|
|
|
+ indicatorColor: "danger",
|
|
|
containerColor: "danger",
|
|
|
- subTitleColor: "danger",
|
|
|
borderColor: "danger",
|
|
|
titleColor: "danger"
|
|
|
},
|
|
|
success: {
|
|
|
+ subTitleColor: "successLow",
|
|
|
+ indicatorColor: "success",
|
|
|
containerColor: "success",
|
|
|
- subTitleColor: "success",
|
|
|
borderColor: "success",
|
|
|
titleColor: "success"
|
|
|
},
|
|
|
warning: {
|
|
|
+ subTitleColor: "warningLow",
|
|
|
+ indicatorColor: "warning",
|
|
|
containerColor: "warning",
|
|
|
- subTitleColor: "warning",
|
|
|
borderColor: "warning",
|
|
|
titleColor: "warning"
|
|
|
},
|
|
|
info: {
|
|
|
+ subTitleColor: "infoLow",
|
|
|
+ indicatorColor: "info",
|
|
|
containerColor: "info",
|
|
|
- subTitleColor: "info",
|
|
|
borderColor: "info",
|
|
|
titleColor: "info"
|
|
|
},
|
|
|
neutral: {
|
|
|
- containerColor: "subtle",
|
|
|
+ indicatorColor: "emphasized",
|
|
|
+ containerColor: "mid",
|
|
|
borderColor: "subtle",
|
|
|
- subTitleColor: "mid",
|
|
|
+ subTitleColor: "low",
|
|
|
titleColor: "mid"
|
|
|
}
|
|
|
};
|
|
|
@@ -81,7 +88,8 @@ const stylesheet = StyleSheet.create({
|
|
|
position: "relative"
|
|
|
},
|
|
|
contentContainer: {
|
|
|
-
|
|
|
+ justifyContent: "center",
|
|
|
+ flexDirection: "column"
|
|
|
},
|
|
|
titleContainer: {
|
|
|
justifyContent: "flex-start",
|
|
|
@@ -99,10 +107,11 @@ const stylesheet = StyleSheet.create({
|
|
|
overlay: {
|
|
|
position: "absolute",
|
|
|
display: "none",
|
|
|
- bottom: 0,
|
|
|
- right: 0,
|
|
|
- left: 0,
|
|
|
- top: 0
|
|
|
+ zIndex: 999,
|
|
|
+ bottom: -2,
|
|
|
+ right: -2,
|
|
|
+ left: -2,
|
|
|
+ top: -2
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -113,7 +122,9 @@ export const useStyles = ({
|
|
|
currentType,
|
|
|
isDisabled,
|
|
|
isLoading,
|
|
|
+ isChecked,
|
|
|
radiuses,
|
|
|
+ borders,
|
|
|
colors,
|
|
|
isFlip,
|
|
|
spaces,
|
|
|
@@ -127,7 +138,9 @@ export const useStyles = ({
|
|
|
} as Mutable<ViewStyle>,
|
|
|
indicatorContainer: {
|
|
|
backgroundColor: colors.content.container[currentType.containerColor],
|
|
|
+ borderColor: colors.content.border[currentType.borderColor],
|
|
|
borderRadius: radiuses.actions,
|
|
|
+ borderWidth: borders.line,
|
|
|
padding: spaces.spacingXs
|
|
|
} as Mutable<ViewStyle>,
|
|
|
contentContainer: {
|
|
|
@@ -145,14 +158,16 @@ export const useStyles = ({
|
|
|
loading: {
|
|
|
} as Mutable<ViewStyle>,
|
|
|
overlay: {
|
|
|
- borderRadius: radiuses.actions - 2
|
|
|
+ borderRadius: radiuses.actions
|
|
|
} as Mutable<ViewStyle>,
|
|
|
optionalText: {
|
|
|
marginLeft: inlineSpaces.subTitle
|
|
|
} as Mutable<TextStyle>
|
|
|
};
|
|
|
|
|
|
- styles.indicatorContainer.borderColor = styles.indicatorContainer.backgroundColor;
|
|
|
+ if(styleType === "neutral") {
|
|
|
+ styles.indicatorContainer.borderColor = colors.content.border.default;
|
|
|
+ }
|
|
|
|
|
|
if (isLoading) {
|
|
|
if (displayBehaviourWhileLoading === "disabled") {
|
|
|
@@ -185,8 +200,20 @@ export const useStyles = ({
|
|
|
styles.container.width = "100%";
|
|
|
}
|
|
|
|
|
|
+ if(isChecked) {
|
|
|
+ if(styleType === "neutral") {
|
|
|
+ styles.indicatorContainer.backgroundColor = colors.content.container.selected;
|
|
|
+ styles.indicatorContainer.borderColor = colors.content.border.emphasized;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (isDisabled) {
|
|
|
- styles.indicatorContainer.borderColor = colors.system.state.overlay.disabled[styleType];
|
|
|
+ if(styleType === "neutral" && isChecked) {
|
|
|
+ styles.indicatorContainer.backgroundColor = colors.system.state.border.disabled.primary;
|
|
|
+ styles.indicatorContainer.borderColor = colors.system.state.border.disabled.primary;
|
|
|
+ } else {
|
|
|
+ styles.indicatorContainer.borderColor = colors.system.state.border.disabled[styleType];
|
|
|
+ }
|
|
|
|
|
|
styles.overlay.backgroundColor = colors.system.state.overlay.disabled[styleType];
|
|
|
styles.overlay.display = "flex";
|