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