@ornikar/kitt-universal 4.3.1 → 4.4.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/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +1 -1
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts +13 -0
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts +7 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
- package/dist/definitions/index.d.ts +4 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +12 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/checkbox.d.ts +13 -0
- package/dist/definitions/themes/late-ocean/checkbox.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts +12 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +2210 -2115
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +2210 -2115
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +2266 -2171
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +2231 -2134
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +977 -881
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.js +813 -717
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +15 -1
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +15 -1
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +15 -1
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +15 -1
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +15 -1
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +15 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -896,6 +896,631 @@ function ExternalLink({
|
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
+
const lateOceanColorPalette = {
|
|
900
|
+
lateOcean: '#4C34E0',
|
|
901
|
+
lateOceanLight1: '#705DE6',
|
|
902
|
+
lateOceanLight2: '#9485EC',
|
|
903
|
+
lateOceanLight3: '#D6BAF9',
|
|
904
|
+
warmEmbrace: '#F4D3CE',
|
|
905
|
+
warmEmbraceLight1: '#FFEDE6',
|
|
906
|
+
black1000: '#000000',
|
|
907
|
+
black800: '#2C293D',
|
|
908
|
+
black555: '#737373',
|
|
909
|
+
black200: '#CCCCCC',
|
|
910
|
+
black100: '#E5E5E5',
|
|
911
|
+
black50: '#F2F2F2',
|
|
912
|
+
black25: '#F9F9F9',
|
|
913
|
+
white: '#FFFFFF',
|
|
914
|
+
viride: '#38836D',
|
|
915
|
+
englishVermillon: '#D44148',
|
|
916
|
+
goldCrayola: '#F8C583',
|
|
917
|
+
aero: '#89BDDD',
|
|
918
|
+
transparent: 'transparent',
|
|
919
|
+
moonPurple: '#DBD6F9',
|
|
920
|
+
moonPurpleLight1: '#EDEBFC'
|
|
921
|
+
};
|
|
922
|
+
|
|
923
|
+
const colors = {
|
|
924
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
925
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
926
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
927
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
928
|
+
success: lateOceanColorPalette.viride,
|
|
929
|
+
correct: lateOceanColorPalette.viride,
|
|
930
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
931
|
+
info: lateOceanColorPalette.aero,
|
|
932
|
+
warning: lateOceanColorPalette.goldCrayola,
|
|
933
|
+
separator: lateOceanColorPalette.black100,
|
|
934
|
+
hover: lateOceanColorPalette.black100,
|
|
935
|
+
black: lateOceanColorPalette.black1000,
|
|
936
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
937
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
938
|
+
transparent: lateOceanColorPalette.transparent,
|
|
939
|
+
disabled: lateOceanColorPalette.black50,
|
|
940
|
+
overlay: {
|
|
941
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
942
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
943
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
const avatar = {
|
|
948
|
+
borderRadius: 10,
|
|
949
|
+
default: {
|
|
950
|
+
backgroundColor: colors.primary
|
|
951
|
+
},
|
|
952
|
+
light: {
|
|
953
|
+
backgroundColor: lateOceanColorPalette.black100
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
const button = {
|
|
958
|
+
borderRadius: 30,
|
|
959
|
+
borderWidth: {
|
|
960
|
+
disabled: 2,
|
|
961
|
+
focus: 3
|
|
962
|
+
},
|
|
963
|
+
minHeight: 40,
|
|
964
|
+
minWidth: 40,
|
|
965
|
+
maxWidth: 335,
|
|
966
|
+
scale: {
|
|
967
|
+
base: {
|
|
968
|
+
default: 1,
|
|
969
|
+
hover: 0.95,
|
|
970
|
+
active: 0.95
|
|
971
|
+
},
|
|
972
|
+
medium: {
|
|
973
|
+
hover: 1.05
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
contentPadding: {
|
|
977
|
+
default: '8px 16px 7px',
|
|
978
|
+
large: '12px 24px 11px',
|
|
979
|
+
disabled: '6px 14px 5px'
|
|
980
|
+
},
|
|
981
|
+
transition: {
|
|
982
|
+
duration: '200ms',
|
|
983
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
984
|
+
},
|
|
985
|
+
default: {
|
|
986
|
+
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
987
|
+
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
988
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
989
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
990
|
+
},
|
|
991
|
+
primary: {
|
|
992
|
+
backgroundColor: colors.primary,
|
|
993
|
+
pressedBackgroundColor: colors.primaryLight,
|
|
994
|
+
hoverBackgroundColor: colors.primaryLight,
|
|
995
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
996
|
+
},
|
|
997
|
+
white: {
|
|
998
|
+
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
999
|
+
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1000
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1001
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
1002
|
+
},
|
|
1003
|
+
subtle: {
|
|
1004
|
+
backgroundColor: colors.transparent,
|
|
1005
|
+
pressedBackgroundColor: colors.transparent,
|
|
1006
|
+
hoverBackgroundColor: colors.transparent,
|
|
1007
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
1008
|
+
color: colors.primary,
|
|
1009
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
1010
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
1011
|
+
},
|
|
1012
|
+
'subtle-dark': {
|
|
1013
|
+
backgroundColor: colors.transparent,
|
|
1014
|
+
pressedBackgroundColor: colors.transparent,
|
|
1015
|
+
hoverBackgroundColor: colors.transparent,
|
|
1016
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
1017
|
+
color: colors.black,
|
|
1018
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
1019
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
1020
|
+
},
|
|
1021
|
+
disabled: {
|
|
1022
|
+
backgroundColor: colors.disabled,
|
|
1023
|
+
pressedBackgroundColor: colors.disabled,
|
|
1024
|
+
hoverBackgroundColor: colors.disabled,
|
|
1025
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
1026
|
+
borderColor: lateOceanColorPalette.black100
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
const card = {
|
|
1031
|
+
borderRadius: 20,
|
|
1032
|
+
borderWidth: 2,
|
|
1033
|
+
primary: {
|
|
1034
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1035
|
+
borderColor: colors.primary
|
|
1036
|
+
},
|
|
1037
|
+
secondary: {
|
|
1038
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1039
|
+
borderColor: colors.separator
|
|
1040
|
+
},
|
|
1041
|
+
subtle: {
|
|
1042
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1043
|
+
borderColor: colors.separator
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
const feedbackMessage = {
|
|
1048
|
+
danger: {
|
|
1049
|
+
backgroundColor: colors.danger
|
|
1050
|
+
},
|
|
1051
|
+
success: {
|
|
1052
|
+
backgroundColor: colors.success
|
|
1053
|
+
},
|
|
1054
|
+
info: {
|
|
1055
|
+
backgroundColor: colors.info
|
|
1056
|
+
},
|
|
1057
|
+
warning: {
|
|
1058
|
+
backgroundColor: colors.warning
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
const checkbox = {
|
|
1063
|
+
borderWidth: 2,
|
|
1064
|
+
borderRadius: 5,
|
|
1065
|
+
height: 20,
|
|
1066
|
+
width: 20,
|
|
1067
|
+
iconSize: 14,
|
|
1068
|
+
borderColor: colors.separator,
|
|
1069
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1070
|
+
checkedBorderColor: colors.primary,
|
|
1071
|
+
checkedBackgroundColor: colors.primary,
|
|
1072
|
+
markColor: colors.uiBackgroundLight
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
|
|
1076
|
+
const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
|
|
1077
|
+
baseAndSmall: {
|
|
1078
|
+
fontSize: baseAndSmallFontSize,
|
|
1079
|
+
lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
|
|
1080
|
+
},
|
|
1081
|
+
mediumAndWide: {
|
|
1082
|
+
fontSize: mediumAndWideFontSize,
|
|
1083
|
+
lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
const typography = {
|
|
1087
|
+
colors: {
|
|
1088
|
+
black: lateOceanColorPalette.black1000,
|
|
1089
|
+
'black-anthracite': lateOceanColorPalette.black800,
|
|
1090
|
+
'black-light': lateOceanColorPalette.black555,
|
|
1091
|
+
white: lateOceanColorPalette.white,
|
|
1092
|
+
'white-light': lateOceanColorPalette.white,
|
|
1093
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
1094
|
+
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
1095
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
1096
|
+
success: lateOceanColorPalette.viride,
|
|
1097
|
+
danger: lateOceanColorPalette.englishVermillon
|
|
1098
|
+
},
|
|
1099
|
+
types: {
|
|
1100
|
+
headers: {
|
|
1101
|
+
fontFamily: {
|
|
1102
|
+
regular: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
1103
|
+
bold: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
1104
|
+
},
|
|
1105
|
+
fontWeight: 400,
|
|
1106
|
+
fontStyle: 'normal',
|
|
1107
|
+
configs: {
|
|
1108
|
+
// also known as xxlarge
|
|
1109
|
+
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
1110
|
+
// also known as xlarge
|
|
1111
|
+
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
1112
|
+
// also known as medium
|
|
1113
|
+
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
1114
|
+
// also known as xsmall
|
|
1115
|
+
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
1116
|
+
// also known as xxsmall
|
|
1117
|
+
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
1118
|
+
}
|
|
1119
|
+
},
|
|
1120
|
+
bodies: {
|
|
1121
|
+
fontFamily: {
|
|
1122
|
+
regular: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
1123
|
+
bold: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
1124
|
+
},
|
|
1125
|
+
fontWeight: {
|
|
1126
|
+
regular: 400,
|
|
1127
|
+
bold: 700
|
|
1128
|
+
},
|
|
1129
|
+
fontStyle: {
|
|
1130
|
+
regular: 'normal',
|
|
1131
|
+
bold: 'normal'
|
|
1132
|
+
},
|
|
1133
|
+
configs: {
|
|
1134
|
+
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
1135
|
+
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
1136
|
+
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
1137
|
+
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
1138
|
+
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
},
|
|
1142
|
+
link: {
|
|
1143
|
+
disabledColor: lateOceanColorPalette.black200
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
const inputStatesStyle = {
|
|
1148
|
+
default: {
|
|
1149
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1150
|
+
borderColor: colors.separator,
|
|
1151
|
+
color: 'black'
|
|
1152
|
+
},
|
|
1153
|
+
pending: {
|
|
1154
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1155
|
+
borderColor: colors.separator,
|
|
1156
|
+
color: 'black'
|
|
1157
|
+
},
|
|
1158
|
+
valid: {
|
|
1159
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1160
|
+
borderColor: lateOceanColorPalette.black100,
|
|
1161
|
+
color: 'black'
|
|
1162
|
+
},
|
|
1163
|
+
hover: {
|
|
1164
|
+
borderColor: lateOceanColorPalette.black200,
|
|
1165
|
+
color: 'black'
|
|
1166
|
+
},
|
|
1167
|
+
focus: {
|
|
1168
|
+
borderColor: colors.primary,
|
|
1169
|
+
color: 'black'
|
|
1170
|
+
},
|
|
1171
|
+
disabled: {
|
|
1172
|
+
backgroundColor: colors.disabled,
|
|
1173
|
+
borderColor: colors.separator,
|
|
1174
|
+
color: 'black-light'
|
|
1175
|
+
},
|
|
1176
|
+
invalid: {
|
|
1177
|
+
borderColor: colors.separator,
|
|
1178
|
+
color: 'black'
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
const input = {
|
|
1182
|
+
color: {
|
|
1183
|
+
selection: colors.primary,
|
|
1184
|
+
placeholder: typography.colors['black-light']
|
|
1185
|
+
},
|
|
1186
|
+
borderWidth: 2,
|
|
1187
|
+
borderRadius: 10,
|
|
1188
|
+
icon: {
|
|
1189
|
+
size: 20
|
|
1190
|
+
},
|
|
1191
|
+
padding: {
|
|
1192
|
+
default: '5px 16px',
|
|
1193
|
+
iOSSingleLine: '7px 16px'
|
|
1194
|
+
},
|
|
1195
|
+
transition: {
|
|
1196
|
+
property: 'border-color',
|
|
1197
|
+
duration: '200ms',
|
|
1198
|
+
timingFunction: 'ease-in-out'
|
|
1199
|
+
},
|
|
1200
|
+
states: inputStatesStyle
|
|
1201
|
+
};
|
|
1202
|
+
|
|
1203
|
+
const inputField = {
|
|
1204
|
+
labelContainerPaddingBottom: 5,
|
|
1205
|
+
iconMarginLeft: 6
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
const radio = {
|
|
1209
|
+
size: 18,
|
|
1210
|
+
unchecked: {
|
|
1211
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1212
|
+
borderWidth: 2,
|
|
1213
|
+
borderColor: lateOceanColorPalette.black200
|
|
1214
|
+
},
|
|
1215
|
+
checked: {
|
|
1216
|
+
backgroundColor: colors.primary,
|
|
1217
|
+
innerSize: 5,
|
|
1218
|
+
innerBackgroundColor: colors.uiBackgroundLight
|
|
1219
|
+
},
|
|
1220
|
+
disabled: {
|
|
1221
|
+
backgroundColor: colors.disabled,
|
|
1222
|
+
borderColor: colors.separator
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1226
|
+
const textArea = {
|
|
1227
|
+
minHeight: 120
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
const forms = {
|
|
1231
|
+
input,
|
|
1232
|
+
radio,
|
|
1233
|
+
inputField,
|
|
1234
|
+
textArea,
|
|
1235
|
+
checkbox
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
const fullScreenModal = {
|
|
1239
|
+
header: {
|
|
1240
|
+
paddingVertical: 12,
|
|
1241
|
+
paddingHorizontal: 16,
|
|
1242
|
+
borderColor: lateOceanColorPalette.black100
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
const iconButton = {
|
|
1247
|
+
backgroundColor: 'transparent',
|
|
1248
|
+
width: 40,
|
|
1249
|
+
height: 40,
|
|
1250
|
+
borderRadius: 20,
|
|
1251
|
+
borderWidth: 2,
|
|
1252
|
+
borderColor: 'transparent',
|
|
1253
|
+
transition: {
|
|
1254
|
+
property: 'all',
|
|
1255
|
+
duration: '200ms',
|
|
1256
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
|
|
1257
|
+
},
|
|
1258
|
+
scale: {
|
|
1259
|
+
base: {
|
|
1260
|
+
default: 1,
|
|
1261
|
+
hover: 0.95,
|
|
1262
|
+
active: 0.95
|
|
1263
|
+
},
|
|
1264
|
+
medium: {
|
|
1265
|
+
hover: 1.05
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1268
|
+
disabled: {
|
|
1269
|
+
scale: 1,
|
|
1270
|
+
backgroundColor: button.disabled.backgroundColor,
|
|
1271
|
+
borderColor: button.disabled.borderColor
|
|
1272
|
+
},
|
|
1273
|
+
default: {
|
|
1274
|
+
pressedBackgroundColor: button.default.pressedBackgroundColor
|
|
1275
|
+
},
|
|
1276
|
+
white: {
|
|
1277
|
+
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
const listItem = {
|
|
1282
|
+
padding: '12px 16px',
|
|
1283
|
+
borderColor: colors.separator,
|
|
1284
|
+
borderWidth: 1,
|
|
1285
|
+
innerMargin: 8
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
const shadows = {
|
|
1289
|
+
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
const skeleton = {
|
|
1293
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
1294
|
+
flareColor: lateOceanColorPalette.black200,
|
|
1295
|
+
animationDuration: 1000
|
|
1296
|
+
};
|
|
1297
|
+
|
|
1298
|
+
const tag = {
|
|
1299
|
+
borderRadius: 10,
|
|
1300
|
+
padding: '2px 12px',
|
|
1301
|
+
primary: {
|
|
1302
|
+
fill: {
|
|
1303
|
+
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
1304
|
+
borderWidth: 0,
|
|
1305
|
+
borderColor: colors.transparent
|
|
1306
|
+
},
|
|
1307
|
+
outline: {
|
|
1308
|
+
backgroundColor: colors.transparent,
|
|
1309
|
+
borderWidth: 1,
|
|
1310
|
+
borderColor: colors.primary
|
|
1311
|
+
}
|
|
1312
|
+
},
|
|
1313
|
+
default: {
|
|
1314
|
+
fill: {
|
|
1315
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1316
|
+
borderWidth: 0,
|
|
1317
|
+
borderColor: colors.transparent
|
|
1318
|
+
},
|
|
1319
|
+
outline: {
|
|
1320
|
+
backgroundColor: colors.transparent,
|
|
1321
|
+
borderWidth: 1,
|
|
1322
|
+
borderColor: colors.black
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
danger: {
|
|
1326
|
+
fill: {
|
|
1327
|
+
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
1328
|
+
borderWidth: 0,
|
|
1329
|
+
borderColor: colors.transparent
|
|
1330
|
+
},
|
|
1331
|
+
outline: {
|
|
1332
|
+
backgroundColor: colors.transparent,
|
|
1333
|
+
borderWidth: 1,
|
|
1334
|
+
borderColor: colors.danger
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
const tooltip = {
|
|
1340
|
+
backgroundColor: colors.black,
|
|
1341
|
+
borderRadius: 10,
|
|
1342
|
+
opacity: 0.95,
|
|
1343
|
+
horizontalPadding: 16,
|
|
1344
|
+
verticalPadding: 4,
|
|
1345
|
+
floatingPadding: 8
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
const breakpoints = {
|
|
1349
|
+
values: {
|
|
1350
|
+
base: 0,
|
|
1351
|
+
small: 480,
|
|
1352
|
+
medium: 768,
|
|
1353
|
+
large: 1024,
|
|
1354
|
+
wide: 1280
|
|
1355
|
+
},
|
|
1356
|
+
min: {
|
|
1357
|
+
smallBreakpoint: 'min-width: 480px',
|
|
1358
|
+
mediumBreakpoint: 'min-width: 768px',
|
|
1359
|
+
largeBreakpoint: 'min-width: 1024px',
|
|
1360
|
+
wideBreakpoint: 'min-width: 1280px'
|
|
1361
|
+
},
|
|
1362
|
+
max: {
|
|
1363
|
+
smallBreakpoint: 'max-width: 479px',
|
|
1364
|
+
mediumBreakpoint: 'max-width: 767px',
|
|
1365
|
+
largeBreakpoint: 'max-width: 1023px',
|
|
1366
|
+
wideBreakpoint: 'max-width: 1279px'
|
|
1367
|
+
}
|
|
1368
|
+
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
1369
|
+
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
1370
|
+
|
|
1371
|
+
const theme = {
|
|
1372
|
+
spacing: 4,
|
|
1373
|
+
colors,
|
|
1374
|
+
palettes: {
|
|
1375
|
+
lateOcean: lateOceanColorPalette
|
|
1376
|
+
},
|
|
1377
|
+
avatar,
|
|
1378
|
+
button,
|
|
1379
|
+
card,
|
|
1380
|
+
feedbackMessage,
|
|
1381
|
+
forms,
|
|
1382
|
+
typography,
|
|
1383
|
+
tag,
|
|
1384
|
+
shadows,
|
|
1385
|
+
fullScreenModal,
|
|
1386
|
+
iconButton,
|
|
1387
|
+
listItem,
|
|
1388
|
+
tooltip,
|
|
1389
|
+
skeleton,
|
|
1390
|
+
breakpoints
|
|
1391
|
+
};
|
|
1392
|
+
|
|
1393
|
+
function matchWindowSize({
|
|
1394
|
+
width,
|
|
1395
|
+
height
|
|
1396
|
+
}, {
|
|
1397
|
+
minWidth,
|
|
1398
|
+
maxWidth,
|
|
1399
|
+
minHeight,
|
|
1400
|
+
maxHeight
|
|
1401
|
+
}) {
|
|
1402
|
+
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
1403
|
+
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
1404
|
+
return hasWidthMatched && hasHeightMatched;
|
|
1405
|
+
}
|
|
1406
|
+
function useMatchWindowSize(options) {
|
|
1407
|
+
const {
|
|
1408
|
+
width,
|
|
1409
|
+
height
|
|
1410
|
+
} = reactNative.useWindowDimensions();
|
|
1411
|
+
return matchWindowSize({
|
|
1412
|
+
width,
|
|
1413
|
+
height
|
|
1414
|
+
}, options);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
// eslint-disable-next-line no-restricted-imports
|
|
1418
|
+
function createWindowSizeHelper(dimensions) {
|
|
1419
|
+
return {
|
|
1420
|
+
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
1421
|
+
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
1422
|
+
mapWindowWidth: (...widthList) => {
|
|
1423
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
1424
|
+
widthList.slice(1).forEach(([minWidth], index) => {
|
|
1425
|
+
const previousMinWidth = widthList[index][0];
|
|
1426
|
+
|
|
1427
|
+
if (previousMinWidth > minWidth) {
|
|
1428
|
+
throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
1434
|
+
minWidth: Number(minWidth)
|
|
1435
|
+
}));
|
|
1436
|
+
if (!found) return null;
|
|
1437
|
+
return found[1];
|
|
1438
|
+
}
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
function useKittTheme() {
|
|
1443
|
+
const dimensions = reactNative.useWindowDimensions();
|
|
1444
|
+
return react.useMemo(() => {
|
|
1445
|
+
return {
|
|
1446
|
+
kitt: theme,
|
|
1447
|
+
responsive: createWindowSizeHelper(dimensions)
|
|
1448
|
+
};
|
|
1449
|
+
}, [dimensions]);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
const CheckboxAndLabelPressableWrapper = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
1453
|
+
displayName: "Checkbox__CheckboxAndLabelPressableWrapper",
|
|
1454
|
+
componentId: "kitt-universal__sc-1sav1n6-0"
|
|
1455
|
+
})(["display:flex;flex-direction:row;align-items:center;"]);
|
|
1456
|
+
const CheckboxContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1457
|
+
displayName: "Checkbox__CheckboxContainer",
|
|
1458
|
+
componentId: "kitt-universal__sc-1sav1n6-1"
|
|
1459
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:center;height:", "px;width:", "px;position:relative;border-radius:", "px;", " margin-right:", ";"], ({
|
|
1460
|
+
theme
|
|
1461
|
+
}) => theme.kitt.forms.checkbox.height, ({
|
|
1462
|
+
theme
|
|
1463
|
+
}) => theme.kitt.forms.checkbox.width, ({
|
|
1464
|
+
theme
|
|
1465
|
+
}) => theme.kitt.forms.checkbox.borderRadius, ({
|
|
1466
|
+
$isChecked,
|
|
1467
|
+
theme
|
|
1468
|
+
}) => {
|
|
1469
|
+
const {
|
|
1470
|
+
checkedBackgroundColor,
|
|
1471
|
+
checkedBorderColor,
|
|
1472
|
+
borderColor,
|
|
1473
|
+
borderWidth,
|
|
1474
|
+
backgroundColor
|
|
1475
|
+
} = theme.kitt.forms.checkbox;
|
|
1476
|
+
|
|
1477
|
+
if ($isChecked) {
|
|
1478
|
+
return styled.css(["background-color:", ";border:", ";"], checkedBackgroundColor, `${borderWidth}px solid ${checkedBorderColor}`);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
return styled.css(["background-color:", ";border:", ";"], backgroundColor, `${borderWidth}px solid ${borderColor}`);
|
|
1482
|
+
}, ({
|
|
1483
|
+
theme,
|
|
1484
|
+
$hasLabel
|
|
1485
|
+
}) => {
|
|
1486
|
+
if (!$hasLabel) return '0px';
|
|
1487
|
+
return `${theme.kitt.spacing * 2.5}px;`;
|
|
1488
|
+
});
|
|
1489
|
+
function Checkbox({
|
|
1490
|
+
onChange,
|
|
1491
|
+
onBlur,
|
|
1492
|
+
onFocus,
|
|
1493
|
+
value,
|
|
1494
|
+
hitSlop = 40,
|
|
1495
|
+
id,
|
|
1496
|
+
children
|
|
1497
|
+
}) {
|
|
1498
|
+
const theme = useKittTheme();
|
|
1499
|
+
return /*#__PURE__*/jsxRuntime.jsxs(CheckboxAndLabelPressableWrapper, {
|
|
1500
|
+
accessibilityRole: "checkbox",
|
|
1501
|
+
accessibilityState: {
|
|
1502
|
+
checked: value
|
|
1503
|
+
},
|
|
1504
|
+
hitSlop: hitSlop,
|
|
1505
|
+
onPress: e => {
|
|
1506
|
+
if (onFocus) onFocus(e);
|
|
1507
|
+
if (onChange) onChange(e);
|
|
1508
|
+
if (onBlur) onBlur(e);
|
|
1509
|
+
},
|
|
1510
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(CheckboxContainer, {
|
|
1511
|
+
$isChecked: value,
|
|
1512
|
+
$hasLabel: !!children,
|
|
1513
|
+
testID: id,
|
|
1514
|
+
children: value ? /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1515
|
+
align: "center",
|
|
1516
|
+
color: theme.kitt.forms.checkbox.markColor,
|
|
1517
|
+
size: theme.kitt.forms.checkbox.iconSize,
|
|
1518
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.CheckboxMark, {})
|
|
1519
|
+
}) : null
|
|
1520
|
+
}), children]
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
|
|
899
1524
|
const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
|
|
900
1525
|
theme,
|
|
901
1526
|
$state
|
|
@@ -1141,6 +1766,14 @@ function InputPassword({
|
|
|
1141
1766
|
});
|
|
1142
1767
|
}
|
|
1143
1768
|
|
|
1769
|
+
function InputPhone(props) {
|
|
1770
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputText, { ...props,
|
|
1771
|
+
autoCompleteType: "tel",
|
|
1772
|
+
keyboardType: "number-pad",
|
|
1773
|
+
textContentType: "telephoneNumber"
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1144
1777
|
function Label({
|
|
1145
1778
|
htmlFor,
|
|
1146
1779
|
children
|
|
@@ -2290,881 +2923,401 @@ const Flex = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
2290
2923
|
displayName: "Flex",
|
|
2291
2924
|
componentId: "kitt-universal__sc-15q3v3h-0"
|
|
2292
2925
|
})(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], ({
|
|
2293
|
-
direction
|
|
2294
|
-
}) => direction, ({
|
|
2295
|
-
theme,
|
|
2296
|
-
padding = 0
|
|
2297
|
-
}) => padding * theme.kitt.spacing);
|
|
2298
|
-
|
|
2299
|
-
const storyPadding = 16;
|
|
2300
|
-
|
|
2301
|
-
const getBackgroundColorFromBlockColor = (theme, color = 'transparent') => {
|
|
2302
|
-
switch (color) {
|
|
2303
|
-
case 'dark':
|
|
2304
|
-
return '#293033';
|
|
2305
|
-
|
|
2306
|
-
case 'light':
|
|
2307
|
-
return '#ffffff';
|
|
2308
|
-
|
|
2309
|
-
case 'primary':
|
|
2310
|
-
return theme.kitt.palettes.lateOcean.lateOcean;
|
|
2311
|
-
|
|
2312
|
-
default:
|
|
2313
|
-
return 'transparent';
|
|
2314
|
-
}
|
|
2315
|
-
};
|
|
2316
|
-
|
|
2317
|
-
const getTypographyColorFromBlockColor = (color = 'transparent') => {
|
|
2318
|
-
switch (color) {
|
|
2319
|
-
case 'dark':
|
|
2320
|
-
case 'primary':
|
|
2321
|
-
return 'white';
|
|
2322
|
-
|
|
2323
|
-
case 'light':
|
|
2324
|
-
default:
|
|
2325
|
-
return 'black';
|
|
2326
|
-
}
|
|
2327
|
-
};
|
|
2328
|
-
|
|
2329
|
-
const StoryBlockBackgroundContext = /*#__PURE__*/react.createContext('transparent');
|
|
2330
|
-
const StoryBlockColorContext = /*#__PURE__*/react.createContext('black');
|
|
2331
|
-
const useStoryBlockColor = color => {
|
|
2332
|
-
const storyBlockColor = react.useContext(StoryBlockColorContext);
|
|
2333
|
-
return color || storyBlockColor;
|
|
2334
|
-
};
|
|
2335
|
-
const StyledStoryBlockView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2336
|
-
displayName: "StoryBlock__StyledStoryBlockView",
|
|
2337
|
-
componentId: "kitt-universal__sc-3w4hdm-0"
|
|
2338
|
-
})(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, ({
|
|
2339
|
-
theme,
|
|
2340
|
-
background
|
|
2341
|
-
}) => getBackgroundColorFromBlockColor(theme, background));
|
|
2342
|
-
function StoryBlock({
|
|
2343
|
-
children,
|
|
2344
|
-
background
|
|
2345
|
-
}) {
|
|
2346
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledStoryBlockView, {
|
|
2347
|
-
background: background,
|
|
2348
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StoryBlockColorContext.Provider, {
|
|
2349
|
-
value: getTypographyColorFromBlockColor(background),
|
|
2350
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StoryBlockBackgroundContext.Provider, {
|
|
2351
|
-
value: background,
|
|
2352
|
-
children: children
|
|
2353
|
-
})
|
|
2354
|
-
})
|
|
2355
|
-
});
|
|
2356
|
-
}
|
|
2357
|
-
|
|
2358
|
-
const StoryTitleContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2359
|
-
displayName: "StoryTitle__StoryTitleContainer",
|
|
2360
|
-
componentId: "kitt-universal__sc-sic7hb-0"
|
|
2361
|
-
})(["margin-bottom:30px;"]);
|
|
2362
|
-
const StorySubTitleContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2363
|
-
displayName: "StoryTitle__StorySubTitleContainer",
|
|
2364
|
-
componentId: "kitt-universal__sc-sic7hb-1"
|
|
2365
|
-
})(["margin-bottom:10px;"]);
|
|
2366
|
-
function StoryTitle({
|
|
2367
|
-
color,
|
|
2368
|
-
children,
|
|
2369
|
-
numberOfLines
|
|
2370
|
-
}) {
|
|
2371
|
-
return /*#__PURE__*/jsxRuntime.jsx(StoryTitleContainer, {
|
|
2372
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header1, {
|
|
2373
|
-
variant: "bold",
|
|
2374
|
-
base: "header1",
|
|
2375
|
-
color: useStoryBlockColor(color),
|
|
2376
|
-
numberOfLines: numberOfLines,
|
|
2377
|
-
children: children
|
|
2378
|
-
})
|
|
2379
|
-
});
|
|
2380
|
-
}
|
|
2381
|
-
|
|
2382
|
-
function StoryTitleLevel2({
|
|
2383
|
-
color,
|
|
2384
|
-
children,
|
|
2385
|
-
numberOfLines
|
|
2386
|
-
}) {
|
|
2387
|
-
return /*#__PURE__*/jsxRuntime.jsx(StoryTitleContainer, {
|
|
2388
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header2, {
|
|
2389
|
-
variant: "bold",
|
|
2390
|
-
base: "header2",
|
|
2391
|
-
color: useStoryBlockColor(color),
|
|
2392
|
-
numberOfLines: numberOfLines,
|
|
2393
|
-
children: children
|
|
2394
|
-
})
|
|
2395
|
-
});
|
|
2396
|
-
}
|
|
2397
|
-
|
|
2398
|
-
StoryTitleLevel2.displayName = 'StoryTitle.Level2';
|
|
2399
|
-
|
|
2400
|
-
function StoryTitleLevel3({
|
|
2401
|
-
color,
|
|
2402
|
-
children,
|
|
2403
|
-
numberOfLines
|
|
2404
|
-
}) {
|
|
2405
|
-
return /*#__PURE__*/jsxRuntime.jsx(StorySubTitleContainer, {
|
|
2406
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header3, {
|
|
2407
|
-
variant: "bold",
|
|
2408
|
-
base: "header3",
|
|
2409
|
-
medium: "header4",
|
|
2410
|
-
color: useStoryBlockColor(color),
|
|
2411
|
-
numberOfLines: numberOfLines,
|
|
2412
|
-
children: children
|
|
2413
|
-
})
|
|
2414
|
-
});
|
|
2415
|
-
}
|
|
2416
|
-
|
|
2417
|
-
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
2418
|
-
|
|
2419
|
-
function StoryTitleLevel4({
|
|
2420
|
-
color,
|
|
2421
|
-
children,
|
|
2422
|
-
numberOfLines
|
|
2423
|
-
}) {
|
|
2424
|
-
return /*#__PURE__*/jsxRuntime.jsx(StorySubTitleContainer, {
|
|
2425
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header4, {
|
|
2426
|
-
variant: "bold",
|
|
2427
|
-
base: "header4",
|
|
2428
|
-
medium: "header5",
|
|
2429
|
-
color: useStoryBlockColor(color),
|
|
2430
|
-
numberOfLines: numberOfLines,
|
|
2431
|
-
children: children
|
|
2432
|
-
})
|
|
2433
|
-
});
|
|
2434
|
-
}
|
|
2435
|
-
|
|
2436
|
-
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
2437
|
-
StoryTitle.Level2 = StoryTitleLevel2;
|
|
2438
|
-
StoryTitle.Level3 = StoryTitleLevel3;
|
|
2439
|
-
StoryTitle.Level4 = StoryTitleLevel4;
|
|
2440
|
-
|
|
2441
|
-
const StoryContainer$1 = /*#__PURE__*/styled__default.ScrollView.withConfig({
|
|
2442
|
-
displayName: "Story__StoryContainer",
|
|
2443
|
-
componentId: "kitt-universal__sc-1kwdg2p-0"
|
|
2444
|
-
})(["padding:", "px;"], storyPadding);
|
|
2445
|
-
function Story({
|
|
2446
|
-
title,
|
|
2447
|
-
contentContainerStyle,
|
|
2448
|
-
children
|
|
2449
|
-
}) {
|
|
2450
|
-
return /*#__PURE__*/jsxRuntime.jsxs(StoryContainer$1, {
|
|
2451
|
-
contentContainerStyle: contentContainerStyle,
|
|
2452
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle, {
|
|
2453
|
-
children: title
|
|
2454
|
-
}), children]
|
|
2455
|
-
});
|
|
2456
|
-
}
|
|
2457
|
-
|
|
2458
|
-
const StyledSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
2459
|
-
displayName: "StorySection__StyledSection",
|
|
2460
|
-
componentId: "kitt-universal__sc-1b3liv5-0"
|
|
2461
|
-
})(["margin-bottom:32px;"]);
|
|
2462
|
-
function StorySection({
|
|
2463
|
-
title,
|
|
2464
|
-
children,
|
|
2465
|
-
internalIsDemoSection,
|
|
2466
|
-
...props
|
|
2467
|
-
}) {
|
|
2468
|
-
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
2469
|
-
return /*#__PURE__*/jsxRuntime.jsxs(StyledSection, { ...props,
|
|
2470
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level2, {
|
|
2471
|
-
children: title
|
|
2472
|
-
}), children]
|
|
2473
|
-
});
|
|
2474
|
-
}
|
|
2475
|
-
const StyledSubSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
2476
|
-
displayName: "StorySection__StyledSubSection",
|
|
2477
|
-
componentId: "kitt-universal__sc-1b3liv5-1"
|
|
2478
|
-
})(["margin-bottom:16px;"]);
|
|
2479
|
-
|
|
2480
|
-
function SubSection({
|
|
2481
|
-
title,
|
|
2482
|
-
children,
|
|
2483
|
-
...props
|
|
2484
|
-
}) {
|
|
2485
|
-
return /*#__PURE__*/jsxRuntime.jsxs(StyledSubSection, { ...props,
|
|
2486
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level3, {
|
|
2487
|
-
children: title
|
|
2488
|
-
}), children]
|
|
2489
|
-
});
|
|
2490
|
-
}
|
|
2926
|
+
direction
|
|
2927
|
+
}) => direction, ({
|
|
2928
|
+
theme,
|
|
2929
|
+
padding = 0
|
|
2930
|
+
}) => padding * theme.kitt.spacing);
|
|
2491
2931
|
|
|
2492
|
-
const
|
|
2493
|
-
displayName: "StorySection__StyledBlockSection",
|
|
2494
|
-
componentId: "kitt-universal__sc-1b3liv5-2"
|
|
2495
|
-
})(["margin-bottom:16px;"]);
|
|
2932
|
+
const storyPadding = 16;
|
|
2496
2933
|
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
}) {
|
|
2502
|
-
return /*#__PURE__*/jsxRuntime.jsxs(StyledBlockSection, { ...props,
|
|
2503
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
2504
|
-
children: title
|
|
2505
|
-
}), children]
|
|
2506
|
-
});
|
|
2507
|
-
}
|
|
2934
|
+
const getBackgroundColorFromBlockColor = (theme, color = 'transparent') => {
|
|
2935
|
+
switch (color) {
|
|
2936
|
+
case 'dark':
|
|
2937
|
+
return '#293033';
|
|
2508
2938
|
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
componentId: "kitt-universal__sc-1b3liv5-3"
|
|
2512
|
-
})(["margin-bottom:64px;"]);
|
|
2939
|
+
case 'light':
|
|
2940
|
+
return '#ffffff';
|
|
2513
2941
|
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
}) {
|
|
2517
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledDemoSection, {
|
|
2518
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StorySection, {
|
|
2519
|
-
internalIsDemoSection: true,
|
|
2520
|
-
title: "Demo",
|
|
2521
|
-
children: children
|
|
2522
|
-
})
|
|
2523
|
-
});
|
|
2524
|
-
}
|
|
2942
|
+
case 'primary':
|
|
2943
|
+
return theme.kitt.palettes.lateOcean.lateOcean;
|
|
2525
2944
|
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2945
|
+
default:
|
|
2946
|
+
return 'transparent';
|
|
2947
|
+
}
|
|
2948
|
+
};
|
|
2529
2949
|
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2950
|
+
const getTypographyColorFromBlockColor = (color = 'transparent') => {
|
|
2951
|
+
switch (color) {
|
|
2952
|
+
case 'dark':
|
|
2953
|
+
case 'primary':
|
|
2954
|
+
return 'white';
|
|
2533
2955
|
|
|
2534
|
-
|
|
2956
|
+
case 'light':
|
|
2957
|
+
default:
|
|
2958
|
+
return 'black';
|
|
2959
|
+
}
|
|
2960
|
+
};
|
|
2535
2961
|
|
|
2536
|
-
|
|
2962
|
+
const StoryBlockBackgroundContext = /*#__PURE__*/react.createContext('transparent');
|
|
2963
|
+
const StoryBlockColorContext = /*#__PURE__*/react.createContext('black');
|
|
2964
|
+
const useStoryBlockColor = color => {
|
|
2965
|
+
const storyBlockColor = react.useContext(StoryBlockColorContext);
|
|
2966
|
+
return color || storyBlockColor;
|
|
2967
|
+
};
|
|
2968
|
+
const StyledStoryBlockView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2969
|
+
displayName: "StoryBlock__StyledStoryBlockView",
|
|
2970
|
+
componentId: "kitt-universal__sc-3w4hdm-0"
|
|
2971
|
+
})(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, ({
|
|
2972
|
+
theme,
|
|
2973
|
+
background
|
|
2974
|
+
}) => getBackgroundColorFromBlockColor(theme, background));
|
|
2975
|
+
function StoryBlock({
|
|
2537
2976
|
children,
|
|
2538
|
-
|
|
2539
|
-
state = 'none',
|
|
2540
|
-
platform = 'all'
|
|
2977
|
+
background
|
|
2541
2978
|
}) {
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
return /*#__PURE__*/jsxRuntime.jsx(Story, {
|
|
2552
|
-
title: context.name,
|
|
2553
|
-
children: storyFn()
|
|
2979
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledStoryBlockView, {
|
|
2980
|
+
background: background,
|
|
2981
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StoryBlockColorContext.Provider, {
|
|
2982
|
+
value: getTypographyColorFromBlockColor(background),
|
|
2983
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StoryBlockBackgroundContext.Provider, {
|
|
2984
|
+
value: background,
|
|
2985
|
+
children: children
|
|
2986
|
+
})
|
|
2987
|
+
})
|
|
2554
2988
|
});
|
|
2555
2989
|
}
|
|
2556
2990
|
|
|
2557
|
-
const
|
|
2558
|
-
displayName: "
|
|
2559
|
-
componentId: "kitt-universal__sc-
|
|
2560
|
-
})(["
|
|
2561
|
-
const
|
|
2562
|
-
displayName: "
|
|
2563
|
-
componentId: "kitt-universal__sc-
|
|
2564
|
-
})(["
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
componentId: "kitt-universal__sc-4z5new-2"
|
|
2568
|
-
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
2569
|
-
const FlexCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
2570
|
-
displayName: "StoryGrid__FlexCol",
|
|
2571
|
-
componentId: "kitt-universal__sc-4z5new-3"
|
|
2572
|
-
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
2573
|
-
|
|
2574
|
-
function StoryGridRow({
|
|
2991
|
+
const StoryTitleContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2992
|
+
displayName: "StoryTitle__StoryTitleContainer",
|
|
2993
|
+
componentId: "kitt-universal__sc-sic7hb-0"
|
|
2994
|
+
})(["margin-bottom:30px;"]);
|
|
2995
|
+
const StorySubTitleContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2996
|
+
displayName: "StoryTitle__StorySubTitleContainer",
|
|
2997
|
+
componentId: "kitt-universal__sc-sic7hb-1"
|
|
2998
|
+
})(["margin-bottom:10px;"]);
|
|
2999
|
+
function StoryTitle({
|
|
3000
|
+
color,
|
|
2575
3001
|
children,
|
|
2576
|
-
|
|
3002
|
+
numberOfLines
|
|
2577
3003
|
}) {
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
|
|
2587
|
-
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
|
|
2588
|
-
children: child
|
|
2589
|
-
}))
|
|
2590
|
-
});
|
|
2591
|
-
}
|
|
2592
|
-
|
|
2593
|
-
return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
|
|
2594
|
-
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
|
|
2595
|
-
children: child
|
|
2596
|
-
}))
|
|
3004
|
+
return /*#__PURE__*/jsxRuntime.jsx(StoryTitleContainer, {
|
|
3005
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header1, {
|
|
3006
|
+
variant: "bold",
|
|
3007
|
+
base: "header1",
|
|
3008
|
+
color: useStoryBlockColor(color),
|
|
3009
|
+
numberOfLines: numberOfLines,
|
|
3010
|
+
children: children
|
|
3011
|
+
})
|
|
2597
3012
|
});
|
|
2598
3013
|
}
|
|
2599
3014
|
|
|
2600
|
-
function
|
|
2601
|
-
|
|
2602
|
-
titleColor,
|
|
3015
|
+
function StoryTitleLevel2({
|
|
3016
|
+
color,
|
|
2603
3017
|
children,
|
|
2604
|
-
|
|
3018
|
+
numberOfLines
|
|
2605
3019
|
}) {
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2617
|
-
children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
2618
|
-
numberOfLines: 1,
|
|
2619
|
-
color: titleColor,
|
|
2620
|
-
children: title
|
|
2621
|
-
}) : null, children]
|
|
3020
|
+
return /*#__PURE__*/jsxRuntime.jsx(StoryTitleContainer, {
|
|
3021
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header2, {
|
|
3022
|
+
variant: "bold",
|
|
3023
|
+
base: "header2",
|
|
3024
|
+
color: useStoryBlockColor(color),
|
|
3025
|
+
numberOfLines: numberOfLines,
|
|
3026
|
+
children: children
|
|
3027
|
+
})
|
|
2622
3028
|
});
|
|
2623
3029
|
}
|
|
2624
3030
|
|
|
2625
|
-
|
|
2626
|
-
Row: StoryGridRow,
|
|
2627
|
-
Col: StoryGridCol
|
|
2628
|
-
};
|
|
2629
|
-
|
|
2630
|
-
const Container$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
2631
|
-
displayName: "Tag__Container",
|
|
2632
|
-
componentId: "kitt-universal__sc-19jmowi-0"
|
|
2633
|
-
})(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], ({
|
|
2634
|
-
theme,
|
|
2635
|
-
type,
|
|
2636
|
-
variant
|
|
2637
|
-
}) => theme.kitt.tag[type][variant].backgroundColor, ({
|
|
2638
|
-
theme,
|
|
2639
|
-
type,
|
|
2640
|
-
variant
|
|
2641
|
-
}) => theme.kitt.tag[type][variant].borderWidth, ({
|
|
2642
|
-
theme,
|
|
2643
|
-
type,
|
|
2644
|
-
variant
|
|
2645
|
-
}) => theme.kitt.tag[type][variant].borderColor, ({
|
|
2646
|
-
theme
|
|
2647
|
-
}) => theme.kitt.tag.padding, ({
|
|
2648
|
-
theme
|
|
2649
|
-
}) => theme.kitt.tag.borderRadius);
|
|
2650
|
-
const getLabelColor = (type, variant) => {
|
|
2651
|
-
switch (type) {
|
|
2652
|
-
case 'danger':
|
|
2653
|
-
{
|
|
2654
|
-
return variant === 'outline' ? 'danger' : 'black';
|
|
2655
|
-
}
|
|
2656
|
-
|
|
2657
|
-
case 'primary':
|
|
2658
|
-
{
|
|
2659
|
-
return 'primary';
|
|
2660
|
-
}
|
|
2661
|
-
|
|
2662
|
-
case 'default':
|
|
2663
|
-
{
|
|
2664
|
-
return 'black';
|
|
2665
|
-
}
|
|
3031
|
+
StoryTitleLevel2.displayName = 'StoryTitle.Level2';
|
|
2666
3032
|
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
3033
|
+
function StoryTitleLevel3({
|
|
3034
|
+
color,
|
|
3035
|
+
children,
|
|
3036
|
+
numberOfLines
|
|
3037
|
+
}) {
|
|
3038
|
+
return /*#__PURE__*/jsxRuntime.jsx(StorySubTitleContainer, {
|
|
3039
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header3, {
|
|
3040
|
+
variant: "bold",
|
|
3041
|
+
base: "header3",
|
|
3042
|
+
medium: "header4",
|
|
3043
|
+
color: useStoryBlockColor(color),
|
|
3044
|
+
numberOfLines: numberOfLines,
|
|
3045
|
+
children: children
|
|
3046
|
+
})
|
|
3047
|
+
});
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
3051
|
+
|
|
3052
|
+
function StoryTitleLevel4({
|
|
3053
|
+
color,
|
|
3054
|
+
children,
|
|
3055
|
+
numberOfLines
|
|
2677
3056
|
}) {
|
|
2678
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
color:
|
|
2684
|
-
|
|
3057
|
+
return /*#__PURE__*/jsxRuntime.jsx(StorySubTitleContainer, {
|
|
3058
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header4, {
|
|
3059
|
+
variant: "bold",
|
|
3060
|
+
base: "header4",
|
|
3061
|
+
medium: "header5",
|
|
3062
|
+
color: useStoryBlockColor(color),
|
|
3063
|
+
numberOfLines: numberOfLines,
|
|
3064
|
+
children: children
|
|
2685
3065
|
})
|
|
2686
3066
|
});
|
|
2687
3067
|
}
|
|
2688
3068
|
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
lateOceanLight3: '#D6BAF9',
|
|
2694
|
-
warmEmbrace: '#F4D3CE',
|
|
2695
|
-
warmEmbraceLight1: '#FFEDE6',
|
|
2696
|
-
black1000: '#000000',
|
|
2697
|
-
black800: '#2C293D',
|
|
2698
|
-
black555: '#737373',
|
|
2699
|
-
black200: '#CCCCCC',
|
|
2700
|
-
black100: '#E5E5E5',
|
|
2701
|
-
black50: '#F2F2F2',
|
|
2702
|
-
black25: '#F9F9F9',
|
|
2703
|
-
white: '#FFFFFF',
|
|
2704
|
-
viride: '#38836D',
|
|
2705
|
-
englishVermillon: '#D44148',
|
|
2706
|
-
goldCrayola: '#F8C583',
|
|
2707
|
-
aero: '#89BDDD',
|
|
2708
|
-
transparent: 'transparent',
|
|
2709
|
-
moonPurple: '#DBD6F9',
|
|
2710
|
-
moonPurpleLight1: '#EDEBFC'
|
|
2711
|
-
};
|
|
3069
|
+
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
3070
|
+
StoryTitle.Level2 = StoryTitleLevel2;
|
|
3071
|
+
StoryTitle.Level3 = StoryTitleLevel3;
|
|
3072
|
+
StoryTitle.Level4 = StoryTitleLevel4;
|
|
2712
3073
|
|
|
2713
|
-
const
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
disabled: lateOceanColorPalette.black50,
|
|
2730
|
-
overlay: {
|
|
2731
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2732
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2733
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2734
|
-
}
|
|
2735
|
-
};
|
|
3074
|
+
const StoryContainer$1 = /*#__PURE__*/styled__default.ScrollView.withConfig({
|
|
3075
|
+
displayName: "Story__StoryContainer",
|
|
3076
|
+
componentId: "kitt-universal__sc-1kwdg2p-0"
|
|
3077
|
+
})(["padding:", "px;"], storyPadding);
|
|
3078
|
+
function Story({
|
|
3079
|
+
title,
|
|
3080
|
+
contentContainerStyle,
|
|
3081
|
+
children
|
|
3082
|
+
}) {
|
|
3083
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StoryContainer$1, {
|
|
3084
|
+
contentContainerStyle: contentContainerStyle,
|
|
3085
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle, {
|
|
3086
|
+
children: title
|
|
3087
|
+
}), children]
|
|
3088
|
+
});
|
|
3089
|
+
}
|
|
2736
3090
|
|
|
2737
|
-
const
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
3091
|
+
const StyledSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
3092
|
+
displayName: "StorySection__StyledSection",
|
|
3093
|
+
componentId: "kitt-universal__sc-1b3liv5-0"
|
|
3094
|
+
})(["margin-bottom:32px;"]);
|
|
3095
|
+
function StorySection({
|
|
3096
|
+
title,
|
|
3097
|
+
children,
|
|
3098
|
+
internalIsDemoSection,
|
|
3099
|
+
...props
|
|
3100
|
+
}) {
|
|
3101
|
+
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
3102
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledSection, { ...props,
|
|
3103
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level2, {
|
|
3104
|
+
children: title
|
|
3105
|
+
}), children]
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
const StyledSubSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
3109
|
+
displayName: "StorySection__StyledSubSection",
|
|
3110
|
+
componentId: "kitt-universal__sc-1b3liv5-1"
|
|
3111
|
+
})(["margin-bottom:16px;"]);
|
|
2746
3112
|
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
default: 1,
|
|
2759
|
-
hover: 0.95,
|
|
2760
|
-
active: 0.95
|
|
2761
|
-
},
|
|
2762
|
-
medium: {
|
|
2763
|
-
hover: 1.05
|
|
2764
|
-
}
|
|
2765
|
-
},
|
|
2766
|
-
contentPadding: {
|
|
2767
|
-
default: '8px 16px 7px',
|
|
2768
|
-
large: '12px 24px 11px',
|
|
2769
|
-
disabled: '6px 14px 5px'
|
|
2770
|
-
},
|
|
2771
|
-
transition: {
|
|
2772
|
-
duration: '200ms',
|
|
2773
|
-
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2774
|
-
},
|
|
2775
|
-
default: {
|
|
2776
|
-
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2777
|
-
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2778
|
-
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2779
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2780
|
-
},
|
|
2781
|
-
primary: {
|
|
2782
|
-
backgroundColor: colors.primary,
|
|
2783
|
-
pressedBackgroundColor: colors.primaryLight,
|
|
2784
|
-
hoverBackgroundColor: colors.primaryLight,
|
|
2785
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2786
|
-
},
|
|
2787
|
-
white: {
|
|
2788
|
-
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2789
|
-
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2790
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2791
|
-
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2792
|
-
},
|
|
2793
|
-
subtle: {
|
|
2794
|
-
backgroundColor: colors.transparent,
|
|
2795
|
-
pressedBackgroundColor: colors.transparent,
|
|
2796
|
-
hoverBackgroundColor: colors.transparent,
|
|
2797
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2798
|
-
color: colors.primary,
|
|
2799
|
-
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2800
|
-
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2801
|
-
},
|
|
2802
|
-
'subtle-dark': {
|
|
2803
|
-
backgroundColor: colors.transparent,
|
|
2804
|
-
pressedBackgroundColor: colors.transparent,
|
|
2805
|
-
hoverBackgroundColor: colors.transparent,
|
|
2806
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2807
|
-
color: colors.black,
|
|
2808
|
-
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2809
|
-
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2810
|
-
},
|
|
2811
|
-
disabled: {
|
|
2812
|
-
backgroundColor: colors.disabled,
|
|
2813
|
-
pressedBackgroundColor: colors.disabled,
|
|
2814
|
-
hoverBackgroundColor: colors.disabled,
|
|
2815
|
-
focusBorderColor: lateOceanColorPalette.black100,
|
|
2816
|
-
borderColor: lateOceanColorPalette.black100
|
|
2817
|
-
}
|
|
2818
|
-
};
|
|
3113
|
+
function SubSection({
|
|
3114
|
+
title,
|
|
3115
|
+
children,
|
|
3116
|
+
...props
|
|
3117
|
+
}) {
|
|
3118
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledSubSection, { ...props,
|
|
3119
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level3, {
|
|
3120
|
+
children: title
|
|
3121
|
+
}), children]
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
2819
3124
|
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2825
|
-
borderColor: colors.primary
|
|
2826
|
-
},
|
|
2827
|
-
secondary: {
|
|
2828
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2829
|
-
borderColor: colors.separator
|
|
2830
|
-
},
|
|
2831
|
-
subtle: {
|
|
2832
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
2833
|
-
borderColor: colors.separator
|
|
2834
|
-
}
|
|
2835
|
-
};
|
|
3125
|
+
const StyledBlockSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
3126
|
+
displayName: "StorySection__StyledBlockSection",
|
|
3127
|
+
componentId: "kitt-universal__sc-1b3liv5-2"
|
|
3128
|
+
})(["margin-bottom:16px;"]);
|
|
2836
3129
|
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
}
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
3130
|
+
function BlockSection({
|
|
3131
|
+
title,
|
|
3132
|
+
children,
|
|
3133
|
+
...props
|
|
3134
|
+
}) {
|
|
3135
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledBlockSection, { ...props,
|
|
3136
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
3137
|
+
children: title
|
|
3138
|
+
}), children]
|
|
3139
|
+
});
|
|
3140
|
+
}
|
|
3141
|
+
|
|
3142
|
+
const StyledDemoSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
3143
|
+
displayName: "StorySection__StyledDemoSection",
|
|
3144
|
+
componentId: "kitt-universal__sc-1b3liv5-3"
|
|
3145
|
+
})(["margin-bottom:64px;"]);
|
|
2851
3146
|
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
}
|
|
2862
|
-
}
|
|
2863
|
-
const typography = {
|
|
2864
|
-
colors: {
|
|
2865
|
-
black: lateOceanColorPalette.black1000,
|
|
2866
|
-
'black-anthracite': lateOceanColorPalette.black800,
|
|
2867
|
-
'black-light': lateOceanColorPalette.black555,
|
|
2868
|
-
white: lateOceanColorPalette.white,
|
|
2869
|
-
'white-light': lateOceanColorPalette.white,
|
|
2870
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2871
|
-
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
2872
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2873
|
-
success: lateOceanColorPalette.viride,
|
|
2874
|
-
danger: lateOceanColorPalette.englishVermillon
|
|
2875
|
-
},
|
|
2876
|
-
types: {
|
|
2877
|
-
headers: {
|
|
2878
|
-
fontFamily: {
|
|
2879
|
-
regular: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
2880
|
-
bold: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
2881
|
-
},
|
|
2882
|
-
fontWeight: 400,
|
|
2883
|
-
fontStyle: 'normal',
|
|
2884
|
-
configs: {
|
|
2885
|
-
// also known as xxlarge
|
|
2886
|
-
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
2887
|
-
// also known as xlarge
|
|
2888
|
-
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
2889
|
-
// also known as medium
|
|
2890
|
-
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
2891
|
-
// also known as xsmall
|
|
2892
|
-
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
2893
|
-
// also known as xxsmall
|
|
2894
|
-
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
2895
|
-
}
|
|
2896
|
-
},
|
|
2897
|
-
bodies: {
|
|
2898
|
-
fontFamily: {
|
|
2899
|
-
regular: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
2900
|
-
bold: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
2901
|
-
},
|
|
2902
|
-
fontWeight: {
|
|
2903
|
-
regular: 400,
|
|
2904
|
-
bold: 700
|
|
2905
|
-
},
|
|
2906
|
-
fontStyle: {
|
|
2907
|
-
regular: 'normal',
|
|
2908
|
-
bold: 'normal'
|
|
2909
|
-
},
|
|
2910
|
-
configs: {
|
|
2911
|
-
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
2912
|
-
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
2913
|
-
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
2914
|
-
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
2915
|
-
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2918
|
-
},
|
|
2919
|
-
link: {
|
|
2920
|
-
disabledColor: lateOceanColorPalette.black200
|
|
2921
|
-
}
|
|
2922
|
-
};
|
|
3147
|
+
function DemoSection({
|
|
3148
|
+
children
|
|
3149
|
+
}) {
|
|
3150
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledDemoSection, {
|
|
3151
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StorySection, {
|
|
3152
|
+
internalIsDemoSection: true,
|
|
3153
|
+
title: "Demo",
|
|
3154
|
+
children: children
|
|
3155
|
+
})
|
|
3156
|
+
});
|
|
3157
|
+
}
|
|
2923
3158
|
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
borderColor: colors.separator,
|
|
2928
|
-
color: 'black'
|
|
2929
|
-
},
|
|
2930
|
-
pending: {
|
|
2931
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2932
|
-
borderColor: colors.separator,
|
|
2933
|
-
color: 'black'
|
|
2934
|
-
},
|
|
2935
|
-
valid: {
|
|
2936
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2937
|
-
borderColor: lateOceanColorPalette.black100,
|
|
2938
|
-
color: 'black'
|
|
2939
|
-
},
|
|
2940
|
-
hover: {
|
|
2941
|
-
borderColor: lateOceanColorPalette.black200,
|
|
2942
|
-
color: 'black'
|
|
2943
|
-
},
|
|
2944
|
-
focus: {
|
|
2945
|
-
borderColor: colors.primary,
|
|
2946
|
-
color: 'black'
|
|
2947
|
-
},
|
|
2948
|
-
disabled: {
|
|
2949
|
-
backgroundColor: colors.disabled,
|
|
2950
|
-
borderColor: colors.separator,
|
|
2951
|
-
color: 'black-light'
|
|
2952
|
-
},
|
|
2953
|
-
invalid: {
|
|
2954
|
-
borderColor: colors.separator,
|
|
2955
|
-
color: 'black'
|
|
2956
|
-
}
|
|
2957
|
-
};
|
|
2958
|
-
const input = {
|
|
2959
|
-
color: {
|
|
2960
|
-
selection: colors.primary,
|
|
2961
|
-
placeholder: typography.colors['black-light']
|
|
2962
|
-
},
|
|
2963
|
-
borderWidth: 2,
|
|
2964
|
-
borderRadius: 10,
|
|
2965
|
-
icon: {
|
|
2966
|
-
size: 20
|
|
2967
|
-
},
|
|
2968
|
-
padding: {
|
|
2969
|
-
default: '5px 16px',
|
|
2970
|
-
iOSSingleLine: '7px 16px'
|
|
2971
|
-
},
|
|
2972
|
-
transition: {
|
|
2973
|
-
property: 'border-color',
|
|
2974
|
-
duration: '200ms',
|
|
2975
|
-
timingFunction: 'ease-in-out'
|
|
2976
|
-
},
|
|
2977
|
-
states: inputStatesStyle
|
|
2978
|
-
};
|
|
3159
|
+
StorySection.SubSection = SubSection;
|
|
3160
|
+
StorySection.BlockSection = BlockSection;
|
|
3161
|
+
/** @deprecated use StorySection.Demo instead */
|
|
2979
3162
|
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
};
|
|
3163
|
+
StorySection.DemoSection = DemoSection;
|
|
3164
|
+
StorySection.Demo = DemoSection;
|
|
3165
|
+
/** @deprecated use StorySection instead */
|
|
2984
3166
|
|
|
2985
|
-
const
|
|
2986
|
-
size: 18,
|
|
2987
|
-
unchecked: {
|
|
2988
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2989
|
-
borderWidth: 2,
|
|
2990
|
-
borderColor: lateOceanColorPalette.black200
|
|
2991
|
-
},
|
|
2992
|
-
checked: {
|
|
2993
|
-
backgroundColor: colors.primary,
|
|
2994
|
-
innerSize: 5,
|
|
2995
|
-
innerBackgroundColor: colors.uiBackgroundLight
|
|
2996
|
-
},
|
|
2997
|
-
disabled: {
|
|
2998
|
-
backgroundColor: colors.disabled,
|
|
2999
|
-
borderColor: colors.separator
|
|
3000
|
-
}
|
|
3001
|
-
};
|
|
3167
|
+
const DeprecatedSection = StorySection;
|
|
3002
3168
|
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3169
|
+
function StoryContainer({
|
|
3170
|
+
children,
|
|
3171
|
+
title,
|
|
3172
|
+
state = 'none',
|
|
3173
|
+
platform = 'all'
|
|
3174
|
+
}) {
|
|
3175
|
+
if (platform === 'web') return null;
|
|
3176
|
+
return /*#__PURE__*/jsxRuntime.jsx(StorySection.BlockSection, {
|
|
3177
|
+
testID: state,
|
|
3178
|
+
title: title,
|
|
3179
|
+
children: children
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
3006
3182
|
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
}
|
|
3183
|
+
function StoryDecorator(storyFn, context) {
|
|
3184
|
+
return /*#__PURE__*/jsxRuntime.jsx(Story, {
|
|
3185
|
+
title: context.name,
|
|
3186
|
+
children: storyFn()
|
|
3187
|
+
});
|
|
3188
|
+
}
|
|
3013
3189
|
|
|
3014
|
-
const
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3190
|
+
const SmallScreenRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
3191
|
+
displayName: "StoryGrid__SmallScreenRow",
|
|
3192
|
+
componentId: "kitt-universal__sc-4z5new-0"
|
|
3193
|
+
})(["flex-direction:column;margin:0;"]);
|
|
3194
|
+
const SmallScreenCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
3195
|
+
displayName: "StoryGrid__SmallScreenCol",
|
|
3196
|
+
componentId: "kitt-universal__sc-4z5new-1"
|
|
3197
|
+
})(["padding:8px 0 16px;"]);
|
|
3198
|
+
const FlexRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
3199
|
+
displayName: "StoryGrid__FlexRow",
|
|
3200
|
+
componentId: "kitt-universal__sc-4z5new-2"
|
|
3201
|
+
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
3202
|
+
const FlexCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
3203
|
+
displayName: "StoryGrid__FlexCol",
|
|
3204
|
+
componentId: "kitt-universal__sc-4z5new-3"
|
|
3205
|
+
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
3021
3206
|
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
},
|
|
3040
|
-
medium: {
|
|
3041
|
-
hover: 1.05
|
|
3042
|
-
}
|
|
3043
|
-
},
|
|
3044
|
-
disabled: {
|
|
3045
|
-
scale: 1,
|
|
3046
|
-
backgroundColor: button.disabled.backgroundColor,
|
|
3047
|
-
borderColor: button.disabled.borderColor
|
|
3048
|
-
},
|
|
3049
|
-
default: {
|
|
3050
|
-
pressedBackgroundColor: button.default.pressedBackgroundColor
|
|
3051
|
-
},
|
|
3052
|
-
white: {
|
|
3053
|
-
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
3207
|
+
function StoryGridRow({
|
|
3208
|
+
children,
|
|
3209
|
+
breakpoint = 'small'
|
|
3210
|
+
}) {
|
|
3211
|
+
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3212
|
+
// TODO use useBreakpoint instead
|
|
3213
|
+
const {
|
|
3214
|
+
width
|
|
3215
|
+
} = reactNative.useWindowDimensions();
|
|
3216
|
+
const breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
3217
|
+
|
|
3218
|
+
if (width < breakpointValue) {
|
|
3219
|
+
return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
|
|
3220
|
+
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
|
|
3221
|
+
children: child
|
|
3222
|
+
}))
|
|
3223
|
+
});
|
|
3054
3224
|
}
|
|
3055
|
-
};
|
|
3056
3225
|
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
}
|
|
3226
|
+
return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
|
|
3227
|
+
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
|
|
3228
|
+
children: child
|
|
3229
|
+
}))
|
|
3230
|
+
});
|
|
3231
|
+
}
|
|
3063
3232
|
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3233
|
+
function StoryGridCol({
|
|
3234
|
+
title,
|
|
3235
|
+
titleColor,
|
|
3236
|
+
children,
|
|
3237
|
+
platform = 'all'
|
|
3238
|
+
}) {
|
|
3239
|
+
const isNative = reactNative.Platform.OS === 'ios' || reactNative.Platform.OS === 'android';
|
|
3067
3240
|
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
animationDuration: 1000
|
|
3072
|
-
};
|
|
3241
|
+
if (reactNative.Platform.OS === 'web' && platform === 'native') {
|
|
3242
|
+
return null;
|
|
3243
|
+
}
|
|
3073
3244
|
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
padding: '2px 12px',
|
|
3077
|
-
primary: {
|
|
3078
|
-
fill: {
|
|
3079
|
-
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
3080
|
-
borderWidth: 0,
|
|
3081
|
-
borderColor: colors.transparent
|
|
3082
|
-
},
|
|
3083
|
-
outline: {
|
|
3084
|
-
backgroundColor: colors.transparent,
|
|
3085
|
-
borderWidth: 1,
|
|
3086
|
-
borderColor: colors.primary
|
|
3087
|
-
}
|
|
3088
|
-
},
|
|
3089
|
-
default: {
|
|
3090
|
-
fill: {
|
|
3091
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
3092
|
-
borderWidth: 0,
|
|
3093
|
-
borderColor: colors.transparent
|
|
3094
|
-
},
|
|
3095
|
-
outline: {
|
|
3096
|
-
backgroundColor: colors.transparent,
|
|
3097
|
-
borderWidth: 1,
|
|
3098
|
-
borderColor: colors.black
|
|
3099
|
-
}
|
|
3100
|
-
},
|
|
3101
|
-
danger: {
|
|
3102
|
-
fill: {
|
|
3103
|
-
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
3104
|
-
borderWidth: 0,
|
|
3105
|
-
borderColor: colors.transparent
|
|
3106
|
-
},
|
|
3107
|
-
outline: {
|
|
3108
|
-
backgroundColor: colors.transparent,
|
|
3109
|
-
borderWidth: 1,
|
|
3110
|
-
borderColor: colors.danger
|
|
3111
|
-
}
|
|
3245
|
+
if (isNative && platform === 'web') {
|
|
3246
|
+
return null;
|
|
3112
3247
|
}
|
|
3113
|
-
};
|
|
3114
3248
|
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3249
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3250
|
+
children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
3251
|
+
numberOfLines: 1,
|
|
3252
|
+
color: titleColor,
|
|
3253
|
+
children: title
|
|
3254
|
+
}) : null, children]
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3257
|
+
|
|
3258
|
+
const StoryGrid = {
|
|
3259
|
+
Row: StoryGridRow,
|
|
3260
|
+
Col: StoryGridCol
|
|
3122
3261
|
};
|
|
3123
3262
|
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3263
|
+
const Container$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
3264
|
+
displayName: "Tag__Container",
|
|
3265
|
+
componentId: "kitt-universal__sc-19jmowi-0"
|
|
3266
|
+
})(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], ({
|
|
3267
|
+
theme,
|
|
3268
|
+
type,
|
|
3269
|
+
variant
|
|
3270
|
+
}) => theme.kitt.tag[type][variant].backgroundColor, ({
|
|
3271
|
+
theme,
|
|
3272
|
+
type,
|
|
3273
|
+
variant
|
|
3274
|
+
}) => theme.kitt.tag[type][variant].borderWidth, ({
|
|
3275
|
+
theme,
|
|
3276
|
+
type,
|
|
3277
|
+
variant
|
|
3278
|
+
}) => theme.kitt.tag[type][variant].borderColor, ({
|
|
3279
|
+
theme
|
|
3280
|
+
}) => theme.kitt.tag.padding, ({
|
|
3281
|
+
theme
|
|
3282
|
+
}) => theme.kitt.tag.borderRadius);
|
|
3283
|
+
const getLabelColor = (type, variant) => {
|
|
3284
|
+
switch (type) {
|
|
3285
|
+
case 'danger':
|
|
3286
|
+
{
|
|
3287
|
+
return variant === 'outline' ? 'danger' : 'black';
|
|
3288
|
+
}
|
|
3146
3289
|
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
iconButton,
|
|
3163
|
-
listItem,
|
|
3164
|
-
tooltip,
|
|
3165
|
-
skeleton,
|
|
3166
|
-
breakpoints
|
|
3290
|
+
case 'primary':
|
|
3291
|
+
{
|
|
3292
|
+
return 'primary';
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
case 'default':
|
|
3296
|
+
{
|
|
3297
|
+
return 'black';
|
|
3298
|
+
}
|
|
3299
|
+
|
|
3300
|
+
default:
|
|
3301
|
+
{
|
|
3302
|
+
return 'black';
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3167
3305
|
};
|
|
3306
|
+
function Tag({
|
|
3307
|
+
label,
|
|
3308
|
+
type = 'default',
|
|
3309
|
+
variant = 'fill'
|
|
3310
|
+
}) {
|
|
3311
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container$1, {
|
|
3312
|
+
type: type,
|
|
3313
|
+
variant: variant,
|
|
3314
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
3315
|
+
base: "body-xsmall",
|
|
3316
|
+
color: getLabelColor(type, variant),
|
|
3317
|
+
children: label
|
|
3318
|
+
})
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3168
3321
|
|
|
3169
3322
|
function Title({
|
|
3170
3323
|
children
|
|
@@ -3563,65 +3716,6 @@ function TypographyLink({
|
|
|
3563
3716
|
});
|
|
3564
3717
|
}
|
|
3565
3718
|
|
|
3566
|
-
function matchWindowSize({
|
|
3567
|
-
width,
|
|
3568
|
-
height
|
|
3569
|
-
}, {
|
|
3570
|
-
minWidth,
|
|
3571
|
-
maxWidth,
|
|
3572
|
-
minHeight,
|
|
3573
|
-
maxHeight
|
|
3574
|
-
}) {
|
|
3575
|
-
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3576
|
-
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3577
|
-
return hasWidthMatched && hasHeightMatched;
|
|
3578
|
-
}
|
|
3579
|
-
function useMatchWindowSize(options) {
|
|
3580
|
-
const {
|
|
3581
|
-
width,
|
|
3582
|
-
height
|
|
3583
|
-
} = reactNative.useWindowDimensions();
|
|
3584
|
-
return matchWindowSize({
|
|
3585
|
-
width,
|
|
3586
|
-
height
|
|
3587
|
-
}, options);
|
|
3588
|
-
}
|
|
3589
|
-
|
|
3590
|
-
// eslint-disable-next-line no-restricted-imports
|
|
3591
|
-
function createWindowSizeHelper(dimensions) {
|
|
3592
|
-
return {
|
|
3593
|
-
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
3594
|
-
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
3595
|
-
mapWindowWidth: (...widthList) => {
|
|
3596
|
-
if ((process.env.NODE_ENV !== "production")) {
|
|
3597
|
-
widthList.slice(1).forEach(([minWidth], index) => {
|
|
3598
|
-
const previousMinWidth = widthList[index][0];
|
|
3599
|
-
|
|
3600
|
-
if (previousMinWidth > minWidth) {
|
|
3601
|
-
throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
|
|
3602
|
-
}
|
|
3603
|
-
});
|
|
3604
|
-
}
|
|
3605
|
-
|
|
3606
|
-
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
3607
|
-
minWidth: Number(minWidth)
|
|
3608
|
-
}));
|
|
3609
|
-
if (!found) return null;
|
|
3610
|
-
return found[1];
|
|
3611
|
-
}
|
|
3612
|
-
};
|
|
3613
|
-
}
|
|
3614
|
-
|
|
3615
|
-
function useKittTheme() {
|
|
3616
|
-
const dimensions = reactNative.useWindowDimensions();
|
|
3617
|
-
return react.useMemo(() => {
|
|
3618
|
-
return {
|
|
3619
|
-
kitt: theme,
|
|
3620
|
-
responsive: createWindowSizeHelper(dimensions)
|
|
3621
|
-
};
|
|
3622
|
-
}, [dimensions]);
|
|
3623
|
-
}
|
|
3624
|
-
|
|
3625
3719
|
const hex2rgba = (hex, alpha = 1) => {
|
|
3626
3720
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
3627
3721
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
@@ -3664,6 +3758,7 @@ exports.useWindowSize = reactNative.useWindowDimensions;
|
|
|
3664
3758
|
exports.Avatar = Avatar;
|
|
3665
3759
|
exports.Button = Button;
|
|
3666
3760
|
exports.Card = Card;
|
|
3761
|
+
exports.Checkbox = Checkbox;
|
|
3667
3762
|
exports.Emoji = Emoji;
|
|
3668
3763
|
exports.ExternalLink = ExternalLink;
|
|
3669
3764
|
exports.Flex = Flex;
|
|
@@ -3675,6 +3770,7 @@ exports.InputFeedback = InputFeedback;
|
|
|
3675
3770
|
exports.InputField = InputField;
|
|
3676
3771
|
exports.InputIcon = InputIcon;
|
|
3677
3772
|
exports.InputPassword = InputPassword;
|
|
3773
|
+
exports.InputPhone = InputPhone;
|
|
3678
3774
|
exports.InputPressable = InputPressable;
|
|
3679
3775
|
exports.InputText = InputText;
|
|
3680
3776
|
exports.KittBreakpoints = KittBreakpoints;
|