@ornikar/kitt-universal 4.3.0 → 4.5.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 (58) 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/DatePicker/DatePicker.d.ts +30 -0
  5. package/dist/definitions/forms/DatePicker/DatePicker.d.ts.map +1 -0
  6. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts +11 -0
  7. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +1 -0
  8. package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts +11 -0
  9. package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts.map +1 -0
  10. package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts +14 -0
  11. package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts.map +1 -0
  12. package/dist/definitions/forms/InputPhone/InputPhone.d.ts +7 -0
  13. package/dist/definitions/forms/InputPhone/InputPhone.d.ts.map +1 -0
  14. package/dist/definitions/forms/InputTag/InputTag.d.ts +10 -0
  15. package/dist/definitions/forms/InputTag/InputTag.d.ts.map +1 -0
  16. package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
  17. package/dist/definitions/index.d.ts +8 -0
  18. package/dist/definitions/index.d.ts.map +1 -1
  19. package/dist/definitions/themes/default.d.ts +14 -0
  20. package/dist/definitions/themes/default.d.ts.map +1 -1
  21. package/dist/definitions/themes/late-ocean/checkbox.d.ts +13 -0
  22. package/dist/definitions/themes/late-ocean/checkbox.d.ts.map +1 -0
  23. package/dist/definitions/themes/late-ocean/datePicker.d.ts +11 -0
  24. package/dist/definitions/themes/late-ocean/datePicker.d.ts.map +1 -0
  25. package/dist/definitions/themes/late-ocean/forms.d.ts +14 -0
  26. package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
  27. package/dist/definitions/themes/late-ocean/input.d.ts +1 -0
  28. package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
  29. package/dist/definitions/themes/late-ocean/inputTag.d.ts +14 -0
  30. package/dist/definitions/themes/late-ocean/inputTag.d.ts.map +1 -0
  31. package/dist/index-browser-all.es.android.js +2399 -1942
  32. package/dist/index-browser-all.es.android.js.map +1 -1
  33. package/dist/index-browser-all.es.ios.js +2399 -1942
  34. package/dist/index-browser-all.es.ios.js.map +1 -1
  35. package/dist/index-browser-all.es.js +2397 -1940
  36. package/dist/index-browser-all.es.js.map +1 -1
  37. package/dist/index-browser-all.es.web.js +2477 -2015
  38. package/dist/index-browser-all.es.web.js.map +1 -1
  39. package/dist/index-node-14.17.cjs.js +1992 -1562
  40. package/dist/index-node-14.17.cjs.js.map +1 -1
  41. package/dist/index-node-14.17.cjs.web.css +1 -1
  42. package/dist/index-node-14.17.cjs.web.js +1771 -1344
  43. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  44. package/dist/linaria-themes-browser-all.es.android.js +48 -2
  45. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  46. package/dist/linaria-themes-browser-all.es.ios.js +48 -2
  47. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  48. package/dist/linaria-themes-browser-all.es.js +48 -2
  49. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  50. package/dist/linaria-themes-browser-all.es.web.js +48 -2
  51. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  52. package/dist/linaria-themes-node-14.17.cjs.js +48 -2
  53. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  54. package/dist/linaria-themes-node-14.17.cjs.web.js +48 -2
  55. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  56. package/dist/styles.css +1 -1
  57. package/dist/tsbuildinfo +1 -1
  58. package/package.json +3 -3
@@ -9,6 +9,8 @@ const react = require('react');
9
9
  const react$1 = require('@linaria/react');
10
10
  const jsxRuntime = require('react/jsx-runtime');
11
11
  const twemojiParser = require('twemoji-parser');
12
+ const reactIntl = require('react-intl');
13
+ const DateTimePicker = require('@react-native-community/datetimepicker');
12
14
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
13
15
  const reactDom = require('@floating-ui/react-dom');
14
16
  const addons = require('@storybook/addons');
@@ -16,6 +18,7 @@ const addons = require('@storybook/addons');
16
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
17
19
 
18
20
  const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
21
+ const DateTimePicker__default = /*#__PURE__*/_interopDefaultLegacy(DateTimePicker);
19
22
 
20
23
  // type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
21
24
  // type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
@@ -51,7 +54,7 @@ function SpinningIcon({
51
54
  });
52
55
  }
53
56
 
54
- const IconContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
57
+ const IconContainer$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
55
58
  displayName: "Icon__IconContainer",
56
59
  componentId: "kitt-universal__sc-usm0ol-0"
57
60
  })(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
@@ -73,7 +76,7 @@ function Icon({
73
76
  const clonedIcon = /*#__PURE__*/react.cloneElement(icon, {
74
77
  color
75
78
  });
76
- return /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
79
+ return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
77
80
  align: align,
78
81
  size: size,
79
82
  color: color,
@@ -853,215 +856,1421 @@ function ExternalLink({
853
856
  });
854
857
  }
855
858
 
856
- const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
857
- theme,
858
- $state
859
- }) => $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states.default.backgroundColor, ({
860
- theme
861
- }) => theme.kitt.forms.input.borderWidth, ({
862
- theme
863
- }) => theme.kitt.forms.input.borderRadius, ({
864
- theme,
865
- $state
866
- }) => theme.kitt.forms.input.states[$state].borderColor, ({
867
- theme
868
- }) => {
869
- const typeConfigKey = getTypographyTypeConfigKey(theme);
870
- return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize}px`;
871
- }, ({
872
- theme,
873
- $state
874
- }) => theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color], ({
875
- theme
876
- }) => theme.kitt.typography.types.bodies.fontFamily.regular);
877
-
878
- function getInputUIState({
879
- isFocused,
880
- isDisabled,
881
- formState
882
- }) {
883
- if (isDisabled) return 'disabled';
884
- if (isFocused) return 'focus';
885
- if (formState === 'invalid') return 'invalid';
886
- return 'default';
887
- }
888
-
889
- const InputTextContainer = withTheme( /*#__PURE__*/react$1.styled("div")({
890
- name: "InputTextContainer",
891
- class: "i1encr9g",
892
- vars: {
893
- "i1encr9g-0": [({
894
- $isDisabled
895
- }) => $isDisabled ? 'not-allowed' : 'inherit'],
896
- "i1encr9g-1": [({
897
- theme
898
- }) => {
899
- const {
900
- property,
901
- duration,
902
- timingFunction
903
- } = theme.kitt.forms.input.transition;
904
- return `${property} ${duration} ${timingFunction}`;
905
- }],
906
- "i1encr9g-2": [({
907
- theme,
908
- $isDisabled
909
- }) => {
910
- if ($isDisabled) return theme.kitt.forms.input.states.disabled.borderColor;
911
- return theme.kitt.forms.input.states.hover.borderColor;
912
- }],
913
- "i1encr9g-3": [({
914
- theme,
915
- $isDisabled
916
- }) => {
917
- if ($isDisabled) return theme.kitt.forms.input.states.disabled.borderColor;
918
- return theme.kitt.forms.input.states.focus.borderColor;
919
- }]
920
- }
921
- }));
859
+ const lateOceanColorPalette = {
860
+ lateOcean: '#4C34E0',
861
+ lateOceanLight1: '#705DE6',
862
+ lateOceanLight2: '#9485EC',
863
+ lateOceanLight3: '#D6BAF9',
864
+ warmEmbrace: '#F4D3CE',
865
+ warmEmbraceLight1: '#FFEDE6',
866
+ black1000: '#000000',
867
+ black800: '#2C293D',
868
+ black555: '#737373',
869
+ black200: '#CCCCCC',
870
+ black100: '#E5E5E5',
871
+ black50: '#F2F2F2',
872
+ black25: '#F9F9F9',
873
+ white: '#FFFFFF',
874
+ viride: '#38836D',
875
+ englishVermillon: '#D44148',
876
+ goldCrayola: '#F8C583',
877
+ aero: '#89BDDD',
878
+ transparent: 'transparent',
879
+ moonPurple: '#DBD6F9',
880
+ moonPurpleLight1: '#EDEBFC'
881
+ };
922
882
 
923
- const StyledTextInput = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.TextInput).withConfig({
924
- displayName: "InputText__StyledTextInput",
925
- componentId: "kitt-universal__sc-uke279-0"
926
- })(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, ({
927
- theme,
928
- multiline
929
- }) => {
930
- if (!multiline && "web" === 'ios') {
931
- return theme.kitt.forms.input.padding.iOSSingleLine;
883
+ const colors = {
884
+ primary: lateOceanColorPalette.lateOcean,
885
+ primaryLight: lateOceanColorPalette.lateOceanLight1,
886
+ accent: lateOceanColorPalette.warmEmbrace,
887
+ accentLight: lateOceanColorPalette.warmEmbraceLight1,
888
+ success: lateOceanColorPalette.viride,
889
+ correct: lateOceanColorPalette.viride,
890
+ danger: lateOceanColorPalette.englishVermillon,
891
+ info: lateOceanColorPalette.aero,
892
+ warning: lateOceanColorPalette.goldCrayola,
893
+ separator: lateOceanColorPalette.black100,
894
+ hover: lateOceanColorPalette.black100,
895
+ black: lateOceanColorPalette.black1000,
896
+ uiBackground: lateOceanColorPalette.black25,
897
+ uiBackgroundLight: lateOceanColorPalette.white,
898
+ transparent: lateOceanColorPalette.transparent,
899
+ disabled: lateOceanColorPalette.black50,
900
+ overlay: {
901
+ dark: 'rgba(41, 48, 51, 0.25)',
902
+ light: 'rgba(255, 255, 255, 0.90)',
903
+ fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
932
904
  }
905
+ };
933
906
 
934
- return theme.kitt.forms.input.padding.default;
935
- }, ({
936
- theme,
937
- multiline
938
- }) => {
939
- if (!multiline && "web" === 'ios') return 0;
940
- const typeConfigKey = getTypographyTypeConfigKey(theme);
941
- return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
942
- }, ({
943
- $minHeight
944
- }) => $minHeight);
945
- const RightInputContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
946
- displayName: "InputText__RightInputContainer",
947
- componentId: "kitt-universal__sc-uke279-1"
948
- })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
949
- const InputText = /*#__PURE__*/react.forwardRef(({
950
- id,
951
- right,
952
- minHeight = 0,
953
- state: formState,
954
- internalForceState,
955
- disabled = false,
956
- autoCorrect = true,
957
- textContentType = 'none',
958
- autoCompleteType = 'off',
959
- keyboardType = 'default',
960
- onFocus,
961
- onBlur,
962
- ...props
963
- }, ref) => {
964
- const theme = /*#__PURE__*/styled.useTheme();
965
- const [isFocused, setIsFocused] = react.useState(false);
966
- const state = internalForceState || getInputUIState({
967
- isFocused,
968
- isDisabled: disabled,
969
- formState
970
- });
971
- return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
972
- $isDisabled: disabled,
973
- children: [/*#__PURE__*/jsxRuntime.jsx(StyledTextInput, {
974
- ref: ref,
975
- nativeID: id,
976
- editable: !disabled,
977
- keyboardType: keyboardType,
978
- autoCompleteType: autoCompleteType,
979
- autoCorrect: autoCorrect,
980
- $minHeight: minHeight,
981
- textContentType: textContentType,
982
- placeholderTextColor: theme.kitt.forms.input.color.placeholder,
983
- selectionColor: theme.kitt.forms.input.color.selection,
984
- ...props,
985
- $state: state,
986
- onFocus: e => {
987
- setIsFocused(true);
988
- if (onFocus) onFocus(e);
989
- },
990
- onBlur: e => {
991
- setIsFocused(false);
992
- if (onBlur) onBlur(e);
993
- }
994
- }), right ? /*#__PURE__*/jsxRuntime.jsx(RightInputContainer, {
995
- children: right
996
- }) : null]
997
- });
998
- });
999
-
1000
- function InputEmail(props) {
1001
- return /*#__PURE__*/jsxRuntime.jsx(InputText, {
1002
- autoCompleteType: "email",
1003
- keyboardType: "email-address",
1004
- textContentType: "emailAddress",
1005
- ...props
1006
- });
1007
- }
1008
-
1009
- const getColorFromState = state => {
1010
- switch (state) {
1011
- case 'invalid':
1012
- return 'danger';
1013
-
1014
- case 'valid':
1015
- default:
1016
- return 'black-light';
907
+ const avatar = {
908
+ borderRadius: 10,
909
+ default: {
910
+ backgroundColor: colors.primary
911
+ },
912
+ light: {
913
+ backgroundColor: lateOceanColorPalette.black100
1017
914
  }
1018
915
  };
1019
916
 
1020
- function InputFeedback({
1021
- state,
1022
- testID,
1023
- children
1024
- }) {
1025
- return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
1026
- base: "body-small",
1027
- color: getColorFromState(state),
1028
- testID: testID,
1029
- children: children
1030
- });
1031
- }
1032
-
1033
- const FieldContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1034
- displayName: "InputField__FieldContainer",
1035
- componentId: "kitt-universal__sc-13fkixs-0"
1036
- })(["padding:5px 0 10px;"]);
1037
- const FeedbackContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1038
- displayName: "InputField__FeedbackContainer",
1039
- componentId: "kitt-universal__sc-13fkixs-1"
1040
- })(["", ";"], ({
1041
- theme
1042
- }) => theme.responsive.ifWindowSizeMatches({
1043
- minWidth: KittBreakpoints.SMALL
1044
- }, 'padding-top: 10px', 'padding-top: 5px'));
1045
- const FieldLabelContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1046
- displayName: "InputField__FieldLabelContainer",
1047
- componentId: "kitt-universal__sc-13fkixs-2"
1048
- })(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
1049
- theme
1050
- }) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
1051
- const LabelContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1052
- displayName: "InputField__LabelContainer",
1053
- componentId: "kitt-universal__sc-13fkixs-3"
1054
- })(["margin-right:", "px;"], ({
1055
- theme
1056
- }) => theme.kitt.forms.inputField.iconMarginLeft);
1057
- function InputField({
1058
- label,
1059
- labelFeedback,
1060
- input,
1061
- feedback
1062
- }) {
1063
- return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
1064
- children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
917
+ const button = {
918
+ borderRadius: 30,
919
+ borderWidth: {
920
+ disabled: 2,
921
+ focus: 3
922
+ },
923
+ minHeight: 40,
924
+ minWidth: 40,
925
+ maxWidth: 335,
926
+ scale: {
927
+ base: {
928
+ default: 1,
929
+ hover: 0.95,
930
+ active: 0.95
931
+ },
932
+ medium: {
933
+ hover: 1.05
934
+ }
935
+ },
936
+ contentPadding: {
937
+ default: '8px 16px 7px',
938
+ large: '12px 24px 11px',
939
+ disabled: '6px 14px 5px'
940
+ },
941
+ transition: {
942
+ duration: '200ms',
943
+ timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
944
+ },
945
+ default: {
946
+ backgroundColor: 'rgba(0, 0, 0, 0.05)',
947
+ pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
948
+ hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
949
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)'
950
+ },
951
+ primary: {
952
+ backgroundColor: colors.primary,
953
+ pressedBackgroundColor: colors.primaryLight,
954
+ hoverBackgroundColor: colors.primaryLight,
955
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)'
956
+ },
957
+ white: {
958
+ backgroundColor: 'rgba(255, 255, 255, 0.05)',
959
+ pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
960
+ hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
961
+ focusBorderColor: 'rgba(255, 255, 255, 0.1)'
962
+ },
963
+ subtle: {
964
+ backgroundColor: colors.transparent,
965
+ pressedBackgroundColor: colors.transparent,
966
+ hoverBackgroundColor: colors.transparent,
967
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)',
968
+ color: colors.primary,
969
+ hoverColor: 'rgba(76, 52, 224, 0.8)',
970
+ activeColor: 'rgba(76, 52, 224, 0.8)'
971
+ },
972
+ 'subtle-dark': {
973
+ backgroundColor: colors.transparent,
974
+ pressedBackgroundColor: colors.transparent,
975
+ hoverBackgroundColor: colors.transparent,
976
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)',
977
+ color: colors.black,
978
+ hoverColor: 'rgba(0, 0, 0, 0.8)',
979
+ activeColor: 'rgba(0, 0, 0, 0.8)'
980
+ },
981
+ disabled: {
982
+ backgroundColor: colors.disabled,
983
+ pressedBackgroundColor: colors.disabled,
984
+ hoverBackgroundColor: colors.disabled,
985
+ focusBorderColor: lateOceanColorPalette.black100,
986
+ borderColor: lateOceanColorPalette.black100
987
+ }
988
+ };
989
+
990
+ const card = {
991
+ borderRadius: 20,
992
+ borderWidth: 2,
993
+ primary: {
994
+ backgroundColor: colors.uiBackgroundLight,
995
+ borderColor: colors.primary
996
+ },
997
+ secondary: {
998
+ backgroundColor: colors.uiBackgroundLight,
999
+ borderColor: colors.separator
1000
+ },
1001
+ subtle: {
1002
+ backgroundColor: lateOceanColorPalette.black50,
1003
+ borderColor: colors.separator
1004
+ }
1005
+ };
1006
+
1007
+ const feedbackMessage = {
1008
+ danger: {
1009
+ backgroundColor: colors.danger
1010
+ },
1011
+ success: {
1012
+ backgroundColor: colors.success
1013
+ },
1014
+ info: {
1015
+ backgroundColor: colors.info
1016
+ },
1017
+ warning: {
1018
+ backgroundColor: colors.warning
1019
+ }
1020
+ };
1021
+
1022
+ const checkbox = {
1023
+ borderWidth: 2,
1024
+ borderRadius: 5,
1025
+ height: 20,
1026
+ width: 20,
1027
+ iconSize: 14,
1028
+ borderColor: colors.separator,
1029
+ backgroundColor: colors.uiBackgroundLight,
1030
+ checkedBorderColor: colors.primary,
1031
+ checkedBackgroundColor: colors.primary,
1032
+ markColor: colors.uiBackgroundLight
1033
+ };
1034
+
1035
+ const datePicker = {
1036
+ day: {
1037
+ minWidth: 64
1038
+ },
1039
+ month: {
1040
+ minWidth: 64
1041
+ },
1042
+ year: {
1043
+ minWidth: 82
1044
+ }
1045
+ };
1046
+
1047
+ const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
1048
+ const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
1049
+ baseAndSmall: {
1050
+ fontSize: baseAndSmallFontSize,
1051
+ lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
1052
+ },
1053
+ mediumAndWide: {
1054
+ fontSize: mediumAndWideFontSize,
1055
+ lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
1056
+ }
1057
+ });
1058
+ const typography = {
1059
+ colors: {
1060
+ black: lateOceanColorPalette.black1000,
1061
+ 'black-anthracite': lateOceanColorPalette.black800,
1062
+ 'black-light': lateOceanColorPalette.black555,
1063
+ white: lateOceanColorPalette.white,
1064
+ 'white-light': lateOceanColorPalette.white,
1065
+ primary: lateOceanColorPalette.lateOcean,
1066
+ 'primary-light': lateOceanColorPalette.lateOceanLight1,
1067
+ accent: lateOceanColorPalette.warmEmbrace,
1068
+ success: lateOceanColorPalette.viride,
1069
+ danger: lateOceanColorPalette.englishVermillon
1070
+ },
1071
+ types: {
1072
+ headers: {
1073
+ fontFamily: {
1074
+ regular: 'Moderat',
1075
+ bold: 'Moderat'
1076
+ },
1077
+ fontWeight: 400,
1078
+ fontStyle: 'normal',
1079
+ configs: {
1080
+ // also known as xxlarge
1081
+ header1: createTypographyTypeConfig(1.3, 38, 62),
1082
+ // also known as xlarge
1083
+ header2: createTypographyTypeConfig(1.3, 32, 48),
1084
+ // also known as medium
1085
+ header3: createTypographyTypeConfig(1.3, 24, 36),
1086
+ // also known as xsmall
1087
+ header4: createTypographyTypeConfig(1.3, 18, 24),
1088
+ // also known as xxsmall
1089
+ header5: createTypographyTypeConfig(1.3, 18, 18)
1090
+ }
1091
+ },
1092
+ bodies: {
1093
+ fontFamily: {
1094
+ regular: 'Noto Sans',
1095
+ bold: 'Noto Sans'
1096
+ },
1097
+ fontWeight: {
1098
+ regular: 400,
1099
+ bold: 700
1100
+ },
1101
+ fontStyle: {
1102
+ regular: 'normal',
1103
+ bold: 'normal'
1104
+ },
1105
+ configs: {
1106
+ 'body-large': createTypographyTypeConfig(1.6, 18, 24),
1107
+ 'body-medium': createTypographyTypeConfig(1.6, 18, 18),
1108
+ body: createTypographyTypeConfig(1.6, 16, 16),
1109
+ 'body-small': createTypographyTypeConfig(1.6, 14, 14),
1110
+ 'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
1111
+ }
1112
+ }
1113
+ },
1114
+ link: {
1115
+ disabledColor: lateOceanColorPalette.black200
1116
+ }
1117
+ };
1118
+
1119
+ const inputStatesStyle = {
1120
+ default: {
1121
+ backgroundColor: colors.uiBackgroundLight,
1122
+ borderColor: colors.separator,
1123
+ color: 'black'
1124
+ },
1125
+ pending: {
1126
+ backgroundColor: colors.uiBackgroundLight,
1127
+ borderColor: colors.separator,
1128
+ color: 'black'
1129
+ },
1130
+ valid: {
1131
+ backgroundColor: colors.uiBackgroundLight,
1132
+ borderColor: lateOceanColorPalette.black100,
1133
+ color: 'black'
1134
+ },
1135
+ hover: {
1136
+ borderColor: lateOceanColorPalette.black200,
1137
+ color: 'black'
1138
+ },
1139
+ focus: {
1140
+ borderColor: colors.primary,
1141
+ color: 'black'
1142
+ },
1143
+ disabled: {
1144
+ backgroundColor: colors.disabled,
1145
+ borderColor: colors.separator,
1146
+ color: 'black-light'
1147
+ },
1148
+ invalid: {
1149
+ borderColor: colors.separator,
1150
+ color: 'black'
1151
+ }
1152
+ };
1153
+ const input = {
1154
+ minHeight: 40,
1155
+ color: {
1156
+ selection: colors.primary,
1157
+ placeholder: typography.colors['black-light']
1158
+ },
1159
+ borderWidth: 2,
1160
+ borderRadius: 10,
1161
+ icon: {
1162
+ size: 20
1163
+ },
1164
+ padding: {
1165
+ default: '5px 16px',
1166
+ iOSSingleLine: '7px 16px'
1167
+ },
1168
+ transition: {
1169
+ property: 'border-color',
1170
+ duration: '200ms',
1171
+ timingFunction: 'ease-in-out'
1172
+ },
1173
+ states: inputStatesStyle
1174
+ };
1175
+
1176
+ const inputField = {
1177
+ labelContainerPaddingBottom: 5,
1178
+ iconMarginLeft: 6
1179
+ };
1180
+
1181
+ const inputTag = {
1182
+ success: {
1183
+ backgroundColor: colors.success,
1184
+ labelColor: colors.uiBackgroundLight
1185
+ },
1186
+ danger: {
1187
+ backgroundColor: colors.danger,
1188
+ labelColor: colors.uiBackgroundLight
1189
+ },
1190
+ default: {
1191
+ backgroundColor: lateOceanColorPalette.black50,
1192
+ labelColor: colors.black
1193
+ },
1194
+ borderRadius: 10,
1195
+ iconSize: 13.5
1196
+ };
1197
+
1198
+ const radio = {
1199
+ size: 18,
1200
+ unchecked: {
1201
+ backgroundColor: colors.uiBackgroundLight,
1202
+ borderWidth: 2,
1203
+ borderColor: lateOceanColorPalette.black200
1204
+ },
1205
+ checked: {
1206
+ backgroundColor: colors.primary,
1207
+ innerSize: 5,
1208
+ innerBackgroundColor: colors.uiBackgroundLight
1209
+ },
1210
+ disabled: {
1211
+ backgroundColor: colors.disabled,
1212
+ borderColor: colors.separator
1213
+ }
1214
+ };
1215
+
1216
+ const textArea = {
1217
+ minHeight: 120
1218
+ };
1219
+
1220
+ const forms = {
1221
+ datePicker,
1222
+ input,
1223
+ radio,
1224
+ inputField,
1225
+ textArea,
1226
+ checkbox,
1227
+ inputTag
1228
+ };
1229
+
1230
+ const fullScreenModal = {
1231
+ header: {
1232
+ paddingVertical: 12,
1233
+ paddingHorizontal: 16,
1234
+ borderColor: lateOceanColorPalette.black100
1235
+ }
1236
+ };
1237
+
1238
+ const iconButton = {
1239
+ backgroundColor: 'transparent',
1240
+ width: 40,
1241
+ height: 40,
1242
+ borderRadius: 20,
1243
+ borderWidth: 2,
1244
+ borderColor: 'transparent',
1245
+ transition: {
1246
+ property: 'all',
1247
+ duration: '200ms',
1248
+ timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
1249
+ },
1250
+ scale: {
1251
+ base: {
1252
+ default: 1,
1253
+ hover: 0.95,
1254
+ active: 0.95
1255
+ },
1256
+ medium: {
1257
+ hover: 1.05
1258
+ }
1259
+ },
1260
+ disabled: {
1261
+ scale: 1,
1262
+ backgroundColor: button.disabled.backgroundColor,
1263
+ borderColor: button.disabled.borderColor
1264
+ },
1265
+ default: {
1266
+ pressedBackgroundColor: button.default.pressedBackgroundColor
1267
+ },
1268
+ white: {
1269
+ pressedBackgroundColor: button.white.hoverBackgroundColor
1270
+ }
1271
+ };
1272
+
1273
+ const listItem = {
1274
+ padding: '12px 16px',
1275
+ borderColor: colors.separator,
1276
+ borderWidth: 1,
1277
+ innerMargin: 8
1278
+ };
1279
+
1280
+ const shadows = {
1281
+ medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
1282
+ };
1283
+
1284
+ const skeleton = {
1285
+ backgroundColor: lateOceanColorPalette.black100,
1286
+ flareColor: lateOceanColorPalette.black200,
1287
+ animationDuration: 1000
1288
+ };
1289
+
1290
+ const tag = {
1291
+ borderRadius: 10,
1292
+ padding: '2px 12px',
1293
+ primary: {
1294
+ fill: {
1295
+ backgroundColor: lateOceanColorPalette.moonPurpleLight1,
1296
+ borderWidth: 0,
1297
+ borderColor: colors.transparent
1298
+ },
1299
+ outline: {
1300
+ backgroundColor: colors.transparent,
1301
+ borderWidth: 1,
1302
+ borderColor: colors.primary
1303
+ }
1304
+ },
1305
+ default: {
1306
+ fill: {
1307
+ backgroundColor: lateOceanColorPalette.black50,
1308
+ borderWidth: 0,
1309
+ borderColor: colors.transparent
1310
+ },
1311
+ outline: {
1312
+ backgroundColor: colors.transparent,
1313
+ borderWidth: 1,
1314
+ borderColor: colors.black
1315
+ }
1316
+ },
1317
+ danger: {
1318
+ fill: {
1319
+ backgroundColor: lateOceanColorPalette.warmEmbrace,
1320
+ borderWidth: 0,
1321
+ borderColor: colors.transparent
1322
+ },
1323
+ outline: {
1324
+ backgroundColor: colors.transparent,
1325
+ borderWidth: 1,
1326
+ borderColor: colors.danger
1327
+ }
1328
+ }
1329
+ };
1330
+
1331
+ const tooltip = {
1332
+ backgroundColor: colors.black,
1333
+ borderRadius: 10,
1334
+ opacity: 0.95,
1335
+ horizontalPadding: 16,
1336
+ verticalPadding: 4,
1337
+ floatingPadding: 8
1338
+ };
1339
+
1340
+ const breakpoints = {
1341
+ values: {
1342
+ base: 0,
1343
+ small: 480,
1344
+ medium: 768,
1345
+ large: 1024,
1346
+ wide: 1280
1347
+ },
1348
+ min: {
1349
+ smallBreakpoint: 'min-width: 480px',
1350
+ mediumBreakpoint: 'min-width: 768px',
1351
+ largeBreakpoint: 'min-width: 1024px',
1352
+ wideBreakpoint: 'min-width: 1280px'
1353
+ },
1354
+ max: {
1355
+ smallBreakpoint: 'max-width: 479px',
1356
+ mediumBreakpoint: 'max-width: 767px',
1357
+ largeBreakpoint: 'max-width: 1023px',
1358
+ wideBreakpoint: 'max-width: 1279px'
1359
+ }
1360
+ }; // eslint-disable-next-line unicorn/expiring-todo-comments
1361
+ // TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
1362
+
1363
+ const theme = {
1364
+ spacing: 4,
1365
+ colors,
1366
+ palettes: {
1367
+ lateOcean: lateOceanColorPalette
1368
+ },
1369
+ avatar,
1370
+ button,
1371
+ card,
1372
+ feedbackMessage,
1373
+ forms,
1374
+ typography,
1375
+ tag,
1376
+ shadows,
1377
+ fullScreenModal,
1378
+ iconButton,
1379
+ listItem,
1380
+ tooltip,
1381
+ skeleton,
1382
+ breakpoints
1383
+ };
1384
+
1385
+ function matchWindowSize({
1386
+ width,
1387
+ height
1388
+ }, {
1389
+ minWidth,
1390
+ maxWidth,
1391
+ minHeight,
1392
+ maxHeight
1393
+ }) {
1394
+ const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
1395
+ const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
1396
+ return hasWidthMatched && hasHeightMatched;
1397
+ }
1398
+ function useMatchWindowSize(options) {
1399
+ const {
1400
+ width,
1401
+ height
1402
+ } = BabelPluginStyledComponentsReactNative.useWindowDimensions();
1403
+ return matchWindowSize({
1404
+ width,
1405
+ height
1406
+ }, options);
1407
+ }
1408
+
1409
+ // eslint-disable-next-line no-restricted-imports
1410
+ function createWindowSizeHelper(dimensions) {
1411
+ return {
1412
+ matchWindowSize: options => matchWindowSize(dimensions, options),
1413
+ ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
1414
+ mapWindowWidth: (...widthList) => {
1415
+ if ((process.env.NODE_ENV !== "production")) {
1416
+ widthList.slice(1).forEach(([minWidth], index) => {
1417
+ const previousMinWidth = widthList[index][0];
1418
+
1419
+ if (previousMinWidth > minWidth) {
1420
+ throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
1421
+ }
1422
+ });
1423
+ }
1424
+
1425
+ const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
1426
+ minWidth: Number(minWidth)
1427
+ }));
1428
+ if (!found) return null;
1429
+ return found[1];
1430
+ }
1431
+ };
1432
+ }
1433
+
1434
+ function useKittTheme() {
1435
+ const dimensions = BabelPluginStyledComponentsReactNative.useWindowDimensions();
1436
+ return react.useMemo(() => {
1437
+ return {
1438
+ kitt: theme,
1439
+ responsive: createWindowSizeHelper(dimensions)
1440
+ };
1441
+ }, [dimensions]);
1442
+ }
1443
+
1444
+ const CheckboxAndLabelPressableWrapper = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1445
+ displayName: "Checkbox__CheckboxAndLabelPressableWrapper",
1446
+ componentId: "kitt-universal__sc-1sav1n6-0"
1447
+ })(["display:flex;flex-direction:row;align-items:center;"]);
1448
+ const CheckboxContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1449
+ displayName: "Checkbox__CheckboxContainer",
1450
+ componentId: "kitt-universal__sc-1sav1n6-1"
1451
+ })(["display:flex;flex-direction:row;align-items:center;justify-content:center;height:", "px;width:", "px;position:relative;border-radius:", "px;", " margin-right:", ";"], ({
1452
+ theme
1453
+ }) => theme.kitt.forms.checkbox.height, ({
1454
+ theme
1455
+ }) => theme.kitt.forms.checkbox.width, ({
1456
+ theme
1457
+ }) => theme.kitt.forms.checkbox.borderRadius, ({
1458
+ $isChecked,
1459
+ theme
1460
+ }) => {
1461
+ const {
1462
+ checkedBackgroundColor,
1463
+ checkedBorderColor,
1464
+ borderColor,
1465
+ borderWidth,
1466
+ backgroundColor
1467
+ } = theme.kitt.forms.checkbox;
1468
+
1469
+ if ($isChecked) {
1470
+ return styled.css(["background-color:", ";border:", ";"], checkedBackgroundColor, `${borderWidth}px solid ${checkedBorderColor}`);
1471
+ }
1472
+
1473
+ return styled.css(["background-color:", ";border:", ";"], backgroundColor, `${borderWidth}px solid ${borderColor}`);
1474
+ }, ({
1475
+ theme,
1476
+ $hasLabel
1477
+ }) => {
1478
+ if (!$hasLabel) return '0px';
1479
+ return `${theme.kitt.spacing * 2.5}px;`;
1480
+ });
1481
+ function Checkbox({
1482
+ onChange,
1483
+ onBlur,
1484
+ onFocus,
1485
+ value,
1486
+ hitSlop = 40,
1487
+ id,
1488
+ children
1489
+ }) {
1490
+ const theme = useKittTheme();
1491
+ return /*#__PURE__*/jsxRuntime.jsxs(CheckboxAndLabelPressableWrapper, {
1492
+ accessibilityRole: "checkbox",
1493
+ accessibilityState: {
1494
+ checked: value
1495
+ },
1496
+ hitSlop: hitSlop,
1497
+ onPress: e => {
1498
+ if (onFocus) onFocus(e);
1499
+ if (onChange) onChange(e);
1500
+ if (onBlur) onBlur(e);
1501
+ },
1502
+ children: [/*#__PURE__*/jsxRuntime.jsx(CheckboxContainer, {
1503
+ $isChecked: value,
1504
+ $hasLabel: !!children,
1505
+ testID: id,
1506
+ children: value ? /*#__PURE__*/jsxRuntime.jsx(Icon, {
1507
+ align: "center",
1508
+ color: theme.kitt.forms.checkbox.markColor,
1509
+ size: theme.kitt.forms.checkbox.iconSize,
1510
+ icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.CheckboxMark, {})
1511
+ }) : null
1512
+ }), children]
1513
+ });
1514
+ }
1515
+
1516
+ function getInputUIState({
1517
+ isFocused,
1518
+ isDisabled,
1519
+ formState
1520
+ }) {
1521
+ if (isDisabled) return 'disabled';
1522
+ if (isFocused) return 'focus';
1523
+ if (formState === 'invalid') return 'invalid';
1524
+ return 'default';
1525
+ }
1526
+
1527
+ const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
1528
+ theme,
1529
+ $state
1530
+ }) => $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states.default.backgroundColor, ({
1531
+ theme
1532
+ }) => theme.kitt.forms.input.borderWidth, ({
1533
+ theme
1534
+ }) => theme.kitt.forms.input.borderRadius, ({
1535
+ theme,
1536
+ $state
1537
+ }) => theme.kitt.forms.input.states[$state].borderColor, ({
1538
+ theme
1539
+ }) => {
1540
+ const typeConfigKey = getTypographyTypeConfigKey(theme);
1541
+ return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize}px`;
1542
+ }, ({
1543
+ theme,
1544
+ $state
1545
+ }) => theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color], ({
1546
+ theme
1547
+ }) => theme.kitt.typography.types.bodies.fontFamily.regular);
1548
+
1549
+ const StyledTypographyText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
1550
+ displayName: "DatePickerInputPart__StyledTypographyText",
1551
+ componentId: "kitt-universal__sc-11fmlmi-0"
1552
+ })(["text-align:center;"]);
1553
+ const ViewInput = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1554
+ displayName: "DatePickerInputPart__ViewInput",
1555
+ componentId: "kitt-universal__sc-11fmlmi-1"
1556
+ })(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, ({
1557
+ theme
1558
+ }) => theme.kitt.forms.input.padding.default, ({
1559
+ theme
1560
+ }) => theme.kitt.forms.input.minHeight, ({
1561
+ theme,
1562
+ $partName
1563
+ }) => {
1564
+ if (!$partName) {
1565
+ return undefined;
1566
+ }
1567
+
1568
+ return `${theme.kitt.forms.datePicker[$partName].minWidth}px`;
1569
+ });
1570
+ function DatePickerInputPart({
1571
+ $state,
1572
+ placeholder,
1573
+ value,
1574
+ partName,
1575
+ disabled
1576
+ }) {
1577
+ return /*#__PURE__*/jsxRuntime.jsx(ViewInput, {
1578
+ $state: $state,
1579
+ $partName: partName,
1580
+ children: placeholder || value ? /*#__PURE__*/jsxRuntime.jsx(StyledTypographyText, {
1581
+ color: !value || disabled ? 'black-light' : undefined,
1582
+ children: value || placeholder
1583
+ }) : null
1584
+ });
1585
+ }
1586
+
1587
+ // Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
1588
+ const OverlayPressable = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1589
+ displayName: "Overlay__OverlayPressable",
1590
+ componentId: "kitt-universal__sc-1cz1gbr-0"
1591
+ })(({
1592
+ theme
1593
+ }) => ({ ...BabelPluginStyledComponentsReactNative.StyleSheet.absoluteFillObject,
1594
+ backgroundColor: theme.kitt.colors.overlay.dark
1595
+ }));
1596
+ function Overlay({
1597
+ onPress
1598
+ }) {
1599
+ return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
1600
+ accessibilityRole: "none",
1601
+ onPress: onPress,
1602
+ children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.View, {})
1603
+ });
1604
+ }
1605
+
1606
+ const BodyView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1607
+ displayName: "Body__BodyView",
1608
+ componentId: "kitt-universal__sc-17fwpo4-0"
1609
+ })(["padding:", "px ", "px;"], ({
1610
+ theme
1611
+ }) => theme.kitt.spacing * 6, ({
1612
+ theme
1613
+ }) => theme.kitt.spacing * 4);
1614
+ function ModalBody({
1615
+ children
1616
+ }) {
1617
+ return /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.ScrollView, {
1618
+ children: /*#__PURE__*/jsxRuntime.jsx(BodyView, {
1619
+ children: children
1620
+ })
1621
+ });
1622
+ }
1623
+
1624
+ const FooterView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1625
+ displayName: "Footer__FooterView",
1626
+ componentId: "kitt-universal__sc-1ujq2dc-0"
1627
+ })(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
1628
+ theme
1629
+ }) => theme.kitt.spacing * 4, ({
1630
+ theme
1631
+ }) => theme.kitt.colors.separator);
1632
+ function ModalFooter({
1633
+ children
1634
+ }) {
1635
+ return /*#__PURE__*/jsxRuntime.jsx(FooterView, {
1636
+ children: children
1637
+ });
1638
+ }
1639
+
1640
+ function StyleWebWrapper({
1641
+ as,
1642
+ children,
1643
+ ...props
1644
+ }) {
1645
+ // as or default to div. If as is undefined, T is div but typescript is not sure
1646
+ return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
1647
+ children: children
1648
+ });
1649
+ }
1650
+
1651
+ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
1652
+ name: "PressableIconButtonWebWrapper",
1653
+ class: "p1nlccvg",
1654
+ vars: {
1655
+ "p1nlccvg-0": [({
1656
+ theme,
1657
+ $isDisabled
1658
+ }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.hover],
1659
+ "p1nlccvg-2": [({
1660
+ theme,
1661
+ $isDisabled
1662
+ }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.medium.hover],
1663
+ "p1nlccvg-3": [({
1664
+ theme,
1665
+ $isDisabled
1666
+ }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.active],
1667
+ "p1nlccvg-4": [({
1668
+ theme,
1669
+ $isWhite,
1670
+ $isDisabled
1671
+ }) => {
1672
+ if ($isDisabled) return theme.kitt.iconButton.disabled.backgroundColor;
1673
+ const {
1674
+ white,
1675
+ default: defaultIconButton
1676
+ } = theme.kitt.iconButton;
1677
+ if ($isWhite) return white.pressedBackgroundColor;
1678
+ return defaultIconButton.pressedBackgroundColor;
1679
+ }]
1680
+ }
1681
+ }));
1682
+ const StyledPressableIconButton = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1683
+ displayName: "PressableIconButton__StyledPressableIconButton",
1684
+ componentId: "kitt-universal__sc-1m6jo3s-0"
1685
+ })(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], ({
1686
+ theme
1687
+ }) => theme.kitt.iconButton.borderRadius, ({
1688
+ theme
1689
+ }) => theme.kitt.iconButton.width, ({
1690
+ theme
1691
+ }) => theme.kitt.iconButton.height, ({
1692
+ theme,
1693
+ disabled
1694
+ }) => {
1695
+ const {
1696
+ iconButton
1697
+ } = theme.kitt;
1698
+ const {
1699
+ transition
1700
+ } = iconButton;
1701
+
1702
+ if (disabled) {
1703
+ return `
1704
+ background-color: ${iconButton.disabled.backgroundColor};
1705
+ `;
1706
+ }
1707
+
1708
+ return `
1709
+ transition: ${transition.property} ${transition.duration} ${transition.timingFunction};
1710
+ `;
1711
+ });
1712
+ function PressableIconButton({
1713
+ color,
1714
+ disabled,
1715
+ ...props
1716
+ }) {
1717
+ return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
1718
+ as: PressableIconButtonWebWrapper,
1719
+ $isWhite: color === 'white',
1720
+ $isDisabled: Boolean(disabled),
1721
+ children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props,
1722
+ disabled: disabled
1723
+ })
1724
+ });
1725
+ }
1726
+
1727
+ function PressableAnimatedContainer({
1728
+ children,
1729
+ color,
1730
+ disabled,
1731
+ onPress
1732
+ }) {
1733
+ return /*#__PURE__*/jsxRuntime.jsx(PressableIconButton, {
1734
+ accessibilityRole: "button",
1735
+ color: color,
1736
+ disabled: disabled,
1737
+ onPress: onPress,
1738
+ children: children
1739
+ });
1740
+ }
1741
+
1742
+ const IconButtonContentBorder = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1743
+ displayName: "IconButton__IconButtonContentBorder",
1744
+ componentId: "kitt-universal__sc-swelbf-0"
1745
+ })(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], ({
1746
+ theme
1747
+ }) => `${theme.kitt.iconButton.borderWidth}px solid`, ({
1748
+ theme,
1749
+ disabled
1750
+ }) => disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor, ({
1751
+ theme
1752
+ }) => theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth, ({
1753
+ theme
1754
+ }) => theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth, ({
1755
+ theme
1756
+ }) => theme.kitt.iconButton.borderRadius);
1757
+
1758
+ function IconButtonContent({
1759
+ disabled,
1760
+ color,
1761
+ icon
1762
+ }) {
1763
+ return /*#__PURE__*/jsxRuntime.jsx(IconButtonContentBorder, {
1764
+ disabled: disabled,
1765
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
1766
+ color: disabled ? 'black-light' : color,
1767
+ icon: icon
1768
+ })
1769
+ });
1770
+ }
1771
+
1772
+ function IconButton({
1773
+ icon,
1774
+ color,
1775
+ disabled,
1776
+ testID,
1777
+ accessibilityLabel,
1778
+ accessibilityRole,
1779
+ onPress
1780
+ }) {
1781
+ return /*#__PURE__*/jsxRuntime.jsx(PressableAnimatedContainer, {
1782
+ color: color,
1783
+ disabled: disabled,
1784
+ testID: testID,
1785
+ accessibilityLabel: accessibilityLabel,
1786
+ accessibilityRole: accessibilityRole,
1787
+ onPress: onPress,
1788
+ children: /*#__PURE__*/jsxRuntime.jsx(IconButtonContent, {
1789
+ disabled: disabled,
1790
+ color: color,
1791
+ icon: icon
1792
+ })
1793
+ });
1794
+ }
1795
+
1796
+ const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
1797
+
1798
+ const HeaderView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1799
+ displayName: "Header__HeaderView",
1800
+ componentId: "kitt-universal__sc-1iwabch-0"
1801
+ })(["position:relative;padding:", "px;display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;align-items:center;border-bottom-width:1px;border-bottom-color:", ";min-height:57px;"], ({
1802
+ theme
1803
+ }) => theme.kitt.spacing * 2, ({
1804
+ theme
1805
+ }) => theme.kitt.colors.separator);
1806
+ const LeftIconView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1807
+ displayName: "Header__LeftIconView",
1808
+ componentId: "kitt-universal__sc-1iwabch-1"
1809
+ })(["align-self:flex-start;margin-right:", "px;"], ({
1810
+ theme
1811
+ }) => theme.kitt.spacing * 2);
1812
+ const RightIconView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1813
+ displayName: "Header__RightIconView",
1814
+ componentId: "kitt-universal__sc-1iwabch-2"
1815
+ })(["align-self:flex-start;margin-left:", "px;"], ({
1816
+ theme
1817
+ }) => theme.kitt.spacing * 2);
1818
+ const TitleView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1819
+ displayName: "Header__TitleView",
1820
+ componentId: "kitt-universal__sc-1iwabch-3"
1821
+ })(["padding-left:", "px;flex-shrink:1;"], ({
1822
+ theme,
1823
+ isIconLeft
1824
+ }) => isIconLeft ? 0 : theme.kitt.spacing * 2);
1825
+ function ModalHeader({
1826
+ left,
1827
+ right,
1828
+ children
1829
+ }) {
1830
+ const onClose = react.useContext(OnCloseContext);
1831
+ const isIconLeft = !!left;
1832
+ return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
1833
+ children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
1834
+ children: left
1835
+ }), /*#__PURE__*/jsxRuntime.jsx(TitleView, {
1836
+ isIconLeft: isIconLeft,
1837
+ children: children
1838
+ }), right !== undefined ? right : /*#__PURE__*/jsxRuntime.jsx(RightIconView, {
1839
+ children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
1840
+ icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
1841
+ onPress: onClose
1842
+ })
1843
+ })]
1844
+ });
1845
+ }
1846
+
1847
+ const ModalView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1848
+ displayName: "Modal__ModalView",
1849
+ componentId: "kitt-universal__sc-1xy2w5u-0"
1850
+ })(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
1851
+ theme
1852
+ }) => theme.kitt.spacing * 20, ({
1853
+ theme
1854
+ }) => theme.kitt.spacing * 4);
1855
+ const ContentView$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1856
+ displayName: "Modal__ContentView",
1857
+ componentId: "kitt-universal__sc-1xy2w5u-1"
1858
+ })(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], ({
1859
+ theme
1860
+ }) => theme.kitt.card.borderRadius, ({
1861
+ theme
1862
+ }) => theme.kitt.colors.uiBackgroundLight);
1863
+ function Modal({
1864
+ visible,
1865
+ children,
1866
+ onClose,
1867
+ onEntered,
1868
+ onExited
1869
+ }) {
1870
+ return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
1871
+ value: onClose,
1872
+ children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Modal, {
1873
+ transparent: true,
1874
+ animationType: "fade",
1875
+ visible: visible,
1876
+ onShow: onEntered,
1877
+ onDismiss: onExited,
1878
+ onRequestClose: onClose,
1879
+ children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
1880
+ children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
1881
+ onPress: onClose
1882
+ }), /*#__PURE__*/jsxRuntime.jsx(ContentView$1, {
1883
+ children: children
1884
+ })]
1885
+ })
1886
+ })
1887
+ });
1888
+ }
1889
+ Modal.Header = ModalHeader;
1890
+ Modal.Body = ModalBody;
1891
+ Modal.Footer = ModalFooter;
1892
+
1893
+ function getDatePickerDisplayMode() {
1894
+ return 'default';
1895
+ }
1896
+
1897
+ function PlatformDateTimePicker({
1898
+ value,
1899
+ defaultDate = new Date(),
1900
+ maximumDate,
1901
+ minimuDate,
1902
+ testID,
1903
+ onChange
1904
+ }) {
1905
+ const displayMode = getDatePickerDisplayMode();
1906
+ const iosProps = {};
1907
+ return /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
1908
+ is24Hour: true,
1909
+ testID: testID,
1910
+ value: value || defaultDate,
1911
+ mode: "date",
1912
+ maximumDate: maximumDate,
1913
+ minimumDate: minimuDate,
1914
+ display: displayMode,
1915
+ ...iosProps,
1916
+ onChange: (_event, date) => onChange(date)
1917
+ });
1918
+ }
1919
+
1920
+ function ModalTitle({
1921
+ children
1922
+ }) {
1923
+ return /*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
1924
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
1925
+ base: "body",
1926
+ variant: "bold",
1927
+ children: children
1928
+ })
1929
+ });
1930
+ }
1931
+
1932
+ function ModalPlatformDateTimePicker({
1933
+ title,
1934
+ isVisible,
1935
+ value,
1936
+ validateButtonLabel,
1937
+ onClose,
1938
+ onChange,
1939
+ ...props
1940
+ }) {
1941
+ const [currentValue, setCurrentValue] = react.useState(value); // Prevent unsynced value between the modal and its parent state
1942
+
1943
+ return /*#__PURE__*/jsxRuntime.jsx(Modal, {
1944
+ visible: Boolean(isVisible),
1945
+ onClose: () => {
1946
+ setCurrentValue(value);
1947
+ onClose();
1948
+ },
1949
+ children: isVisible ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1950
+ children: [title ? /*#__PURE__*/jsxRuntime.jsx(ModalTitle, {
1951
+ children: title
1952
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
1953
+ children: /*#__PURE__*/jsxRuntime.jsx(PlatformDateTimePicker, { ...props,
1954
+ value: currentValue,
1955
+ onChange: newDate => {
1956
+ setCurrentValue(prev => {
1957
+ return newDate || prev;
1958
+ });
1959
+ }
1960
+ })
1961
+ }), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
1962
+ children: /*#__PURE__*/jsxRuntime.jsx(Button, {
1963
+ stretch: true,
1964
+ type: "primary",
1965
+ onPress: () => {
1966
+ onChange(currentValue);
1967
+ },
1968
+ children: validateButtonLabel ? /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Text, {
1969
+ children: validateButtonLabel
1970
+ }) : /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
1971
+ id: "kitt-universal.ModalDateTimePicker.confirm"
1972
+ })
1973
+ })
1974
+ })]
1975
+ }) : null
1976
+ });
1977
+ }
1978
+
1979
+ function prefixWithZero(value) {
1980
+ return `${value}`.padStart(2, '0');
1981
+ }
1982
+
1983
+ const PartContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1984
+ displayName: "DatePicker__PartContainer",
1985
+ componentId: "kitt-universal__sc-ebllsn-0"
1986
+ })(["margin-right:", ";", ";"], ({
1987
+ theme,
1988
+ $isLast
1989
+ }) => !$isLast ? `${theme.kitt.spacing * 2}px` : 0, ({
1990
+ $isStretch
1991
+ }) => $isStretch ? styled.css(["flex:0.33;flex-grow:1;"]) : undefined);
1992
+ const DatePickerPressable = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1993
+ displayName: "DatePicker__DatePickerPressable",
1994
+ componentId: "kitt-universal__sc-ebllsn-1"
1995
+ })(["display:flex;flex-direction:row;", ";"], ({
1996
+ $isStretch
1997
+ }) => {
1998
+ if ($isStretch) {
1999
+ return styled.css(["width:100%;"]);
2000
+ }
2001
+
2002
+ return styled.css(["align-self:baseline;"]);
2003
+ });
2004
+ function DatePicker({
2005
+ value,
2006
+ id,
2007
+ disabled,
2008
+ placeholder,
2009
+ state,
2010
+ internalForceState,
2011
+ testID,
2012
+ stretch,
2013
+ pickerDefaultDate,
2014
+ pickerUITestID,
2015
+ pickerUITitle,
2016
+ pickerUIValidateButtonLabel,
2017
+ onChange,
2018
+ onFocus,
2019
+ onBlur
2020
+ }) {
2021
+ const [isPickerUIVisible, setIsPickerUIVisible] = react.useState(false);
2022
+ const [isFocused, setIsFocused] = react.useState(false);
2023
+ const [currentValue, setCurrentValue] = react.useState(value);
2024
+
2025
+ const handleModalClose = () => {
2026
+ if (onBlur) onBlur();
2027
+ setIsPickerUIVisible(false);
2028
+ setIsFocused(false);
2029
+ };
2030
+
2031
+ const handleChange = newDate => {
2032
+ setCurrentValue(newDate);
2033
+ onChange(newDate);
2034
+ handleModalClose();
2035
+ };
2036
+
2037
+ const currentState = internalForceState || getInputUIState({
2038
+ isFocused,
2039
+ isDisabled: Boolean(disabled),
2040
+ formState: state
2041
+ });
2042
+ const sharedPickerProps = {
2043
+ testID: pickerUITestID,
2044
+ value: currentValue,
2045
+ onChange: handleChange
2046
+ };
2047
+ const sharedPartProps = {
2048
+ disabled,
2049
+ $state: currentState,
2050
+ defaultDate: pickerDefaultDate
2051
+ };
2052
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2053
+ children: [/*#__PURE__*/jsxRuntime.jsxs(DatePickerPressable, {
2054
+ $isStretch: stretch,
2055
+ nativeID: id,
2056
+ disabled: disabled,
2057
+ testID: testID,
2058
+ onPress: () => {
2059
+ if (onFocus) onFocus();
2060
+ setIsPickerUIVisible(true);
2061
+ setIsFocused(true);
2062
+ },
2063
+ children: [/*#__PURE__*/jsxRuntime.jsx(PartContainer, {
2064
+ $isStretch: stretch,
2065
+ children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
2066
+ partName: "day",
2067
+ value: currentValue ? prefixWithZero(currentValue.getDate()) : undefined,
2068
+ placeholder: placeholder?.day
2069
+ })
2070
+ }), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
2071
+ $isStretch: stretch,
2072
+ children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
2073
+ partName: "month",
2074
+ value: currentValue ? prefixWithZero(currentValue.getMonth() + 1) : undefined,
2075
+ placeholder: placeholder?.month
2076
+ })
2077
+ }), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
2078
+ $isLast: true,
2079
+ $isStretch: stretch,
2080
+ children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
2081
+ partName: "year",
2082
+ value: currentValue?.getFullYear(),
2083
+ placeholder: placeholder?.year
2084
+ })
2085
+ })]
2086
+ }), /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2087
+ children: [null, /*#__PURE__*/jsxRuntime.jsx(ModalPlatformDateTimePicker, { ...sharedPickerProps,
2088
+ isVisible: isPickerUIVisible,
2089
+ title: pickerUITitle,
2090
+ validateButtonLabel: pickerUIValidateButtonLabel,
2091
+ onClose: handleModalClose,
2092
+ onChange: handleChange
2093
+ })]
2094
+ })]
2095
+ });
2096
+ }
2097
+
2098
+ const InputTextContainer = withTheme( /*#__PURE__*/react$1.styled("div")({
2099
+ name: "InputTextContainer",
2100
+ class: "i1encr9g",
2101
+ vars: {
2102
+ "i1encr9g-0": [({
2103
+ $isDisabled
2104
+ }) => $isDisabled ? 'not-allowed' : 'inherit'],
2105
+ "i1encr9g-1": [({
2106
+ theme
2107
+ }) => {
2108
+ const {
2109
+ property,
2110
+ duration,
2111
+ timingFunction
2112
+ } = theme.kitt.forms.input.transition;
2113
+ return `${property} ${duration} ${timingFunction}`;
2114
+ }],
2115
+ "i1encr9g-2": [({
2116
+ theme,
2117
+ $isDisabled
2118
+ }) => {
2119
+ if ($isDisabled) return theme.kitt.forms.input.states.disabled.borderColor;
2120
+ return theme.kitt.forms.input.states.hover.borderColor;
2121
+ }],
2122
+ "i1encr9g-3": [({
2123
+ theme,
2124
+ $isDisabled
2125
+ }) => {
2126
+ if ($isDisabled) return theme.kitt.forms.input.states.disabled.borderColor;
2127
+ return theme.kitt.forms.input.states.focus.borderColor;
2128
+ }]
2129
+ }
2130
+ }));
2131
+
2132
+ const StyledTextInput = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.TextInput).withConfig({
2133
+ displayName: "InputText__StyledTextInput",
2134
+ componentId: "kitt-universal__sc-uke279-0"
2135
+ })(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, ({
2136
+ theme,
2137
+ multiline
2138
+ }) => {
2139
+ if (!multiline && "web" === 'ios') {
2140
+ return theme.kitt.forms.input.padding.iOSSingleLine;
2141
+ }
2142
+
2143
+ return theme.kitt.forms.input.padding.default;
2144
+ }, ({
2145
+ theme,
2146
+ multiline
2147
+ }) => {
2148
+ if (!multiline && "web" === 'ios') return 0;
2149
+ const typeConfigKey = getTypographyTypeConfigKey(theme);
2150
+ return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
2151
+ }, ({
2152
+ $minHeight
2153
+ }) => $minHeight);
2154
+ const RightInputContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2155
+ displayName: "InputText__RightInputContainer",
2156
+ componentId: "kitt-universal__sc-uke279-1"
2157
+ })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
2158
+ const InputText = /*#__PURE__*/react.forwardRef(({
2159
+ id,
2160
+ right,
2161
+ minHeight = 0,
2162
+ state: formState,
2163
+ internalForceState,
2164
+ disabled = false,
2165
+ autoCorrect = true,
2166
+ textContentType = 'none',
2167
+ autoCompleteType = 'off',
2168
+ keyboardType = 'default',
2169
+ onFocus,
2170
+ onBlur,
2171
+ ...props
2172
+ }, ref) => {
2173
+ const theme = /*#__PURE__*/styled.useTheme();
2174
+ const [isFocused, setIsFocused] = react.useState(false);
2175
+ const state = internalForceState || getInputUIState({
2176
+ isFocused,
2177
+ isDisabled: disabled,
2178
+ formState
2179
+ });
2180
+ return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
2181
+ $isDisabled: disabled,
2182
+ children: [/*#__PURE__*/jsxRuntime.jsx(StyledTextInput, {
2183
+ ref: ref,
2184
+ nativeID: id,
2185
+ editable: !disabled,
2186
+ keyboardType: keyboardType,
2187
+ autoCompleteType: autoCompleteType,
2188
+ autoCorrect: autoCorrect,
2189
+ $minHeight: minHeight,
2190
+ textContentType: textContentType,
2191
+ placeholderTextColor: theme.kitt.forms.input.color.placeholder,
2192
+ selectionColor: theme.kitt.forms.input.color.selection,
2193
+ ...props,
2194
+ $state: state,
2195
+ onFocus: e => {
2196
+ setIsFocused(true);
2197
+ if (onFocus) onFocus(e);
2198
+ },
2199
+ onBlur: e => {
2200
+ setIsFocused(false);
2201
+ if (onBlur) onBlur(e);
2202
+ }
2203
+ }), right ? /*#__PURE__*/jsxRuntime.jsx(RightInputContainer, {
2204
+ children: right
2205
+ }) : null]
2206
+ });
2207
+ });
2208
+
2209
+ function InputEmail(props) {
2210
+ return /*#__PURE__*/jsxRuntime.jsx(InputText, {
2211
+ autoCompleteType: "email",
2212
+ keyboardType: "email-address",
2213
+ textContentType: "emailAddress",
2214
+ ...props
2215
+ });
2216
+ }
2217
+
2218
+ const getColorFromState = state => {
2219
+ switch (state) {
2220
+ case 'invalid':
2221
+ return 'danger';
2222
+
2223
+ case 'valid':
2224
+ default:
2225
+ return 'black-light';
2226
+ }
2227
+ };
2228
+
2229
+ function InputFeedback({
2230
+ state,
2231
+ testID,
2232
+ children
2233
+ }) {
2234
+ return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2235
+ base: "body-small",
2236
+ color: getColorFromState(state),
2237
+ testID: testID,
2238
+ children: children
2239
+ });
2240
+ }
2241
+
2242
+ const FieldContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2243
+ displayName: "InputField__FieldContainer",
2244
+ componentId: "kitt-universal__sc-13fkixs-0"
2245
+ })(["padding:5px 0 10px;"]);
2246
+ const FeedbackContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2247
+ displayName: "InputField__FeedbackContainer",
2248
+ componentId: "kitt-universal__sc-13fkixs-1"
2249
+ })(["", ";"], ({
2250
+ theme
2251
+ }) => theme.responsive.ifWindowSizeMatches({
2252
+ minWidth: KittBreakpoints.SMALL
2253
+ }, 'padding-top: 10px', 'padding-top: 5px'));
2254
+ const FieldLabelContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2255
+ displayName: "InputField__FieldLabelContainer",
2256
+ componentId: "kitt-universal__sc-13fkixs-2"
2257
+ })(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
2258
+ theme
2259
+ }) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
2260
+ const LabelContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2261
+ displayName: "InputField__LabelContainer",
2262
+ componentId: "kitt-universal__sc-13fkixs-3"
2263
+ })(["margin-right:", "px;"], ({
2264
+ theme
2265
+ }) => theme.kitt.forms.inputField.iconMarginLeft);
2266
+ function InputField({
2267
+ label,
2268
+ labelFeedback,
2269
+ input,
2270
+ feedback
2271
+ }) {
2272
+ return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
2273
+ children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
1065
2274
  children: [/*#__PURE__*/jsxRuntime.jsx(LabelContainer, {
1066
2275
  children: label
1067
2276
  }), labelFeedback]
@@ -1127,6 +2336,66 @@ function InputPassword({
1127
2336
  });
1128
2337
  }
1129
2338
 
2339
+ function InputPhone(props) {
2340
+ return /*#__PURE__*/jsxRuntime.jsx(InputText, { ...props,
2341
+ autoCompleteType: "tel",
2342
+ keyboardType: "number-pad",
2343
+ textContentType: "telephoneNumber"
2344
+ });
2345
+ }
2346
+
2347
+ const getTypographyColor = type => type ? 'white' : 'black';
2348
+
2349
+ const InputTagContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2350
+ displayName: "InputTag__InputTagContainer",
2351
+ componentId: "kitt-universal__sc-1511dsf-0"
2352
+ })(["align-items:center;justify-content:center;flex-direction:row;align-self:flex-start;overflow:hidden;padding-horizontal:", "px;background-color:", ";border-radius:", "px;"], ({
2353
+ theme
2354
+ }) => theme.kitt.spacing * 2, ({
2355
+ theme,
2356
+ type
2357
+ }) => {
2358
+ if (type === 'success') {
2359
+ return theme.kitt.forms.inputTag.success.backgroundColor;
2360
+ }
2361
+
2362
+ if (type === 'danger') {
2363
+ return theme.kitt.forms.inputTag.danger.backgroundColor;
2364
+ }
2365
+
2366
+ return theme.kitt.forms.inputTag.default.backgroundColor;
2367
+ }, ({
2368
+ theme
2369
+ }) => theme.kitt.forms.inputTag.borderRadius);
2370
+ const IconContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2371
+ displayName: "InputTag__IconContainer",
2372
+ componentId: "kitt-universal__sc-1511dsf-1"
2373
+ })(["margin-right:", "px;"], ({
2374
+ theme
2375
+ }) => theme.kitt.spacing);
2376
+ function InputTag({
2377
+ children,
2378
+ type,
2379
+ icon
2380
+ }) {
2381
+ const typographyColor = getTypographyColor(type);
2382
+ const theme = useKittTheme();
2383
+ return /*#__PURE__*/jsxRuntime.jsxs(InputTagContainer, {
2384
+ type: type,
2385
+ children: [icon && /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
2386
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
2387
+ icon: icon,
2388
+ size: theme.kitt.forms.inputTag.iconSize,
2389
+ color: typographyColor
2390
+ })
2391
+ }), /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2392
+ base: "body-small",
2393
+ color: typographyColor,
2394
+ children: children
2395
+ })]
2396
+ });
2397
+ }
2398
+
1130
2399
  function Label({
1131
2400
  htmlFor,
1132
2401
  children
@@ -1327,219 +2596,63 @@ const HeaderContent = /*#__PURE__*/styled__default(BabelPluginStyledComponentsRe
1327
2596
  });
1328
2597
  function FullScreenModalHeader({
1329
2598
  children,
1330
- right,
1331
- left
1332
- }) {
1333
- const {
1334
- top
1335
- } = reactNativeSafeAreaContext.useSafeAreaInsets();
1336
- const dimensions = BabelPluginStyledComponentsReactNative.useWindowDimensions();
1337
- const [leftWidth, setLeftWidth] = react.useState(0);
1338
- const [rightWidth, setRightWidth] = react.useState(0);
1339
-
1340
- const handleLayoutChange = (event, side) => {
1341
- // Prevents react to nullify event on rerenders
1342
- event.persist();
1343
-
1344
- if (side === 'left') {
1345
- setLeftWidth(event.nativeEvent.layout.width);
1346
- return;
1347
- }
1348
-
1349
- setRightWidth(event.nativeEvent.layout.width);
1350
- };
1351
-
1352
- return /*#__PURE__*/jsxRuntime.jsxs(Header, {
1353
- insetTop: top,
1354
- children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
1355
- onLayout: e => handleLayoutChange(e, 'left'),
1356
- children: left
1357
- }) : null, /*#__PURE__*/jsxRuntime.jsx(HeaderContent, {
1358
- windowWidth: dimensions.width,
1359
- leftWidth: leftWidth,
1360
- rightWidth: rightWidth,
1361
- children: children
1362
- }), right ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
1363
- side: "right",
1364
- onLayout: e => handleLayoutChange(e, 'right'),
1365
- children: right
1366
- }) : null]
1367
- });
1368
- }
1369
-
1370
- const Container$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1371
- displayName: "FullScreenModal__Container",
1372
- componentId: "kitt-universal__sc-11qpbe3-0"
1373
- })(["flex:1;background-color:", ";"], ({
1374
- theme
1375
- }) => theme.kitt.colors.uiBackground);
1376
- function FullScreenModal({
1377
- children
1378
- }) {
1379
- return /*#__PURE__*/jsxRuntime.jsx(Container$1, {
1380
- children: children
1381
- });
1382
- }
1383
- FullScreenModal.Header = FullScreenModalHeader;
1384
- FullScreenModal.Body = FullScreenModalBody;
1385
-
1386
- function StyleWebWrapper({
1387
- as,
1388
- children,
1389
- ...props
1390
- }) {
1391
- // as or default to div. If as is undefined, T is div but typescript is not sure
1392
- return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
1393
- children: children
1394
- });
1395
- }
1396
-
1397
- const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
1398
- name: "PressableIconButtonWebWrapper",
1399
- class: "p1nlccvg",
1400
- vars: {
1401
- "p1nlccvg-0": [({
1402
- theme,
1403
- $isDisabled
1404
- }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.hover],
1405
- "p1nlccvg-2": [({
1406
- theme,
1407
- $isDisabled
1408
- }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.medium.hover],
1409
- "p1nlccvg-3": [({
1410
- theme,
1411
- $isDisabled
1412
- }) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.active],
1413
- "p1nlccvg-4": [({
1414
- theme,
1415
- $isWhite,
1416
- $isDisabled
1417
- }) => {
1418
- if ($isDisabled) return theme.kitt.iconButton.disabled.backgroundColor;
1419
- const {
1420
- white,
1421
- default: defaultIconButton
1422
- } = theme.kitt.iconButton;
1423
- if ($isWhite) return white.pressedBackgroundColor;
1424
- return defaultIconButton.pressedBackgroundColor;
1425
- }]
1426
- }
1427
- }));
1428
- const StyledPressableIconButton = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1429
- displayName: "PressableIconButton__StyledPressableIconButton",
1430
- componentId: "kitt-universal__sc-1m6jo3s-0"
1431
- })(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], ({
1432
- theme
1433
- }) => theme.kitt.iconButton.borderRadius, ({
1434
- theme
1435
- }) => theme.kitt.iconButton.width, ({
1436
- theme
1437
- }) => theme.kitt.iconButton.height, ({
1438
- theme,
1439
- disabled
1440
- }) => {
1441
- const {
1442
- iconButton
1443
- } = theme.kitt;
1444
- const {
1445
- transition
1446
- } = iconButton;
1447
-
1448
- if (disabled) {
1449
- return `
1450
- background-color: ${iconButton.disabled.backgroundColor};
1451
- `;
1452
- }
1453
-
1454
- return `
1455
- transition: ${transition.property} ${transition.duration} ${transition.timingFunction};
1456
- `;
1457
- });
1458
- function PressableIconButton({
1459
- color,
1460
- disabled,
1461
- ...props
1462
- }) {
1463
- return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
1464
- as: PressableIconButtonWebWrapper,
1465
- $isWhite: color === 'white',
1466
- $isDisabled: Boolean(disabled),
1467
- children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props,
1468
- disabled: disabled
1469
- })
1470
- });
1471
- }
1472
-
1473
- function PressableAnimatedContainer({
1474
- children,
1475
- color,
1476
- disabled,
1477
- onPress
2599
+ right,
2600
+ left
1478
2601
  }) {
1479
- return /*#__PURE__*/jsxRuntime.jsx(PressableIconButton, {
1480
- accessibilityRole: "button",
1481
- color: color,
1482
- disabled: disabled,
1483
- onPress: onPress,
1484
- children: children
1485
- });
1486
- }
2602
+ const {
2603
+ top
2604
+ } = reactNativeSafeAreaContext.useSafeAreaInsets();
2605
+ const dimensions = BabelPluginStyledComponentsReactNative.useWindowDimensions();
2606
+ const [leftWidth, setLeftWidth] = react.useState(0);
2607
+ const [rightWidth, setRightWidth] = react.useState(0);
1487
2608
 
1488
- const IconButtonContentBorder = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1489
- displayName: "IconButton__IconButtonContentBorder",
1490
- componentId: "kitt-universal__sc-swelbf-0"
1491
- })(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], ({
1492
- theme
1493
- }) => `${theme.kitt.iconButton.borderWidth}px solid`, ({
1494
- theme,
1495
- disabled
1496
- }) => disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor, ({
1497
- theme
1498
- }) => theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth, ({
1499
- theme
1500
- }) => theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth, ({
1501
- theme
1502
- }) => theme.kitt.iconButton.borderRadius);
2609
+ const handleLayoutChange = (event, side) => {
2610
+ // Prevents react to nullify event on rerenders
2611
+ event.persist();
1503
2612
 
1504
- function IconButtonContent({
1505
- disabled,
1506
- color,
1507
- icon
1508
- }) {
1509
- return /*#__PURE__*/jsxRuntime.jsx(IconButtonContentBorder, {
1510
- disabled: disabled,
1511
- children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
1512
- color: disabled ? 'black-light' : color,
1513
- icon: icon
1514
- })
2613
+ if (side === 'left') {
2614
+ setLeftWidth(event.nativeEvent.layout.width);
2615
+ return;
2616
+ }
2617
+
2618
+ setRightWidth(event.nativeEvent.layout.width);
2619
+ };
2620
+
2621
+ return /*#__PURE__*/jsxRuntime.jsxs(Header, {
2622
+ insetTop: top,
2623
+ children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
2624
+ onLayout: e => handleLayoutChange(e, 'left'),
2625
+ children: left
2626
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(HeaderContent, {
2627
+ windowWidth: dimensions.width,
2628
+ leftWidth: leftWidth,
2629
+ rightWidth: rightWidth,
2630
+ children: children
2631
+ }), right ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
2632
+ side: "right",
2633
+ onLayout: e => handleLayoutChange(e, 'right'),
2634
+ children: right
2635
+ }) : null]
1515
2636
  });
1516
2637
  }
1517
2638
 
1518
- function IconButton({
1519
- icon,
1520
- color,
1521
- disabled,
1522
- testID,
1523
- accessibilityLabel,
1524
- accessibilityRole,
1525
- onPress
2639
+ const Container$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2640
+ displayName: "FullScreenModal__Container",
2641
+ componentId: "kitt-universal__sc-11qpbe3-0"
2642
+ })(["flex:1;background-color:", ";"], ({
2643
+ theme
2644
+ }) => theme.kitt.colors.uiBackground);
2645
+ function FullScreenModal({
2646
+ children
1526
2647
  }) {
1527
- return /*#__PURE__*/jsxRuntime.jsx(PressableAnimatedContainer, {
1528
- color: color,
1529
- disabled: disabled,
1530
- testID: testID,
1531
- accessibilityLabel: accessibilityLabel,
1532
- accessibilityRole: accessibilityRole,
1533
- onPress: onPress,
1534
- children: /*#__PURE__*/jsxRuntime.jsx(IconButtonContent, {
1535
- disabled: disabled,
1536
- color: color,
1537
- icon: icon
1538
- })
2648
+ return /*#__PURE__*/jsxRuntime.jsx(Container$1, {
2649
+ children: children
1539
2650
  });
1540
2651
  }
2652
+ FullScreenModal.Header = FullScreenModalHeader;
2653
+ FullScreenModal.Body = FullScreenModalBody;
1541
2654
 
1542
- const ContentView$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2655
+ const ContentView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1543
2656
  displayName: "ListItemContent__ContentView",
1544
2657
  componentId: "kitt-universal__sc-57q0u9-0"
1545
2658
  })(["flex:1 0 0%;align-self:center;"]);
@@ -1547,7 +2660,7 @@ function ListItemContent({
1547
2660
  children,
1548
2661
  ...rest
1549
2662
  }) {
1550
- return /*#__PURE__*/jsxRuntime.jsx(ContentView$1, { ...rest,
2663
+ return /*#__PURE__*/jsxRuntime.jsx(ContentView, { ...rest,
1551
2664
  children: children
1552
2665
  });
1553
2666
  }
@@ -1792,234 +2905,83 @@ const StyledIconContainer = /*#__PURE__*/styled__default(BabelPluginStyledCompon
1792
2905
  })(["margin:", ";"], ({
1793
2906
  theme
1794
2907
  }) => {
1795
- const {
1796
- spacing
1797
- } = theme.kitt;
1798
- return `${spacing}px ${spacing * 5}px 0 0`;
1799
- });
1800
- const StyledTextContent = /*#__PURE__*/styled__default(Typography.Text).withConfig({
1801
- displayName: "BaseMessage__StyledTextContent",
1802
- componentId: "kitt-universal__sc-eepeiz-3"
1803
- })(["flex:1;text-align:", ";"], ({
1804
- $isCenteredText
1805
- }) => $isCenteredText ? 'center' : 'left');
1806
- const StyledMessageContent = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1807
- displayName: "BaseMessage__StyledMessageContent",
1808
- componentId: "kitt-universal__sc-eepeiz-4"
1809
- })(["display:flex;flex-direction:row;flex-grow:1;align-self:center;align-items:flex-start;flex-shrink:1;padding:", ";"], ({
1810
- theme
1811
- }) => {
1812
- const {
1813
- spacing
1814
- } = theme.kitt;
1815
- return `${spacing * 4}px ${spacing * 5}px`;
1816
- });
1817
- function BaseMessage({
1818
- type = 'info',
1819
- children,
1820
- hasNoRadius,
1821
- centeredText,
1822
- insets,
1823
- onDismiss
1824
- }) {
1825
- const color = getColorByType(type);
1826
- return /*#__PURE__*/jsxRuntime.jsxs(StyledMessageContainer, {
1827
- $type: type,
1828
- $hasNoRadius: hasNoRadius,
1829
- $insets: insets,
1830
- children: [/*#__PURE__*/jsxRuntime.jsxs(StyledMessageContent, {
1831
- children: [centeredText ? null : /*#__PURE__*/jsxRuntime.jsx(StyledIconContainer, {
1832
- children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
1833
- color: color,
1834
- icon: /*#__PURE__*/jsxRuntime.jsx(IconContent, {
1835
- type: type,
1836
- color: color
1837
- })
1838
- })
1839
- }), /*#__PURE__*/jsxRuntime.jsx(StyledTextContent, {
1840
- $isCenteredText: centeredText,
1841
- base: "body",
1842
- color: color,
1843
- children: children
1844
- })]
1845
- }), onDismiss ? /*#__PURE__*/jsxRuntime.jsx(StyledDismissWrapper, {
1846
- children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
1847
- color: getIconButtonColor(type),
1848
- icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
1849
- onPress: onDismiss
1850
- })
1851
- }) : null]
1852
- });
1853
- }
1854
-
1855
- function Message({
1856
- type = 'info',
1857
- children,
1858
- hasNoRadius,
1859
- centeredText,
1860
- insets,
1861
- onDismiss
1862
- }) {
1863
- return /*#__PURE__*/jsxRuntime.jsx(BaseMessage, {
1864
- insets: insets,
1865
- hasNoRadius: hasNoRadius,
1866
- type: type,
1867
- centeredText: centeredText,
1868
- onDismiss: onDismiss,
1869
- children: children
1870
- });
1871
- }
1872
-
1873
- // Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
1874
- const OverlayPressable = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1875
- displayName: "Overlay__OverlayPressable",
1876
- componentId: "kitt-universal__sc-1cz1gbr-0"
1877
- })(({
1878
- theme
1879
- }) => ({ ...BabelPluginStyledComponentsReactNative.StyleSheet.absoluteFillObject,
1880
- backgroundColor: theme.kitt.colors.overlay.dark
1881
- }));
1882
- function Overlay({
1883
- onPress
1884
- }) {
1885
- return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
1886
- accessibilityRole: "none",
1887
- onPress: onPress,
1888
- children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.View, {})
1889
- });
1890
- }
1891
-
1892
- const BodyView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1893
- displayName: "Body__BodyView",
1894
- componentId: "kitt-universal__sc-17fwpo4-0"
1895
- })(["padding:", "px ", "px;"], ({
1896
- theme
1897
- }) => theme.kitt.spacing * 6, ({
1898
- theme
1899
- }) => theme.kitt.spacing * 4);
1900
- function ModalBody({
1901
- children
1902
- }) {
1903
- return /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.ScrollView, {
1904
- children: /*#__PURE__*/jsxRuntime.jsx(BodyView, {
1905
- children: children
1906
- })
1907
- });
1908
- }
1909
-
1910
- const FooterView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1911
- displayName: "Footer__FooterView",
1912
- componentId: "kitt-universal__sc-1ujq2dc-0"
1913
- })(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
1914
- theme
1915
- }) => theme.kitt.spacing * 4, ({
1916
- theme
1917
- }) => theme.kitt.colors.separator);
1918
- function ModalFooter({
1919
- children
1920
- }) {
1921
- return /*#__PURE__*/jsxRuntime.jsx(FooterView, {
1922
- children: children
1923
- });
1924
- }
1925
-
1926
- const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
1927
-
1928
- const HeaderView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1929
- displayName: "Header__HeaderView",
1930
- componentId: "kitt-universal__sc-1iwabch-0"
1931
- })(["position:relative;padding:", "px;display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;align-items:center;border-bottom-width:1px;border-bottom-color:", ";min-height:57px;"], ({
1932
- theme
1933
- }) => theme.kitt.spacing * 2, ({
1934
- theme
1935
- }) => theme.kitt.colors.separator);
1936
- const LeftIconView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1937
- displayName: "Header__LeftIconView",
1938
- componentId: "kitt-universal__sc-1iwabch-1"
1939
- })(["align-self:flex-start;margin-right:", "px;"], ({
1940
- theme
1941
- }) => theme.kitt.spacing * 2);
1942
- const RightIconView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1943
- displayName: "Header__RightIconView",
1944
- componentId: "kitt-universal__sc-1iwabch-2"
1945
- })(["align-self:flex-start;margin-left:", "px;"], ({
2908
+ const {
2909
+ spacing
2910
+ } = theme.kitt;
2911
+ return `${spacing}px ${spacing * 5}px 0 0`;
2912
+ });
2913
+ const StyledTextContent = /*#__PURE__*/styled__default(Typography.Text).withConfig({
2914
+ displayName: "BaseMessage__StyledTextContent",
2915
+ componentId: "kitt-universal__sc-eepeiz-3"
2916
+ })(["flex:1;text-align:", ";"], ({
2917
+ $isCenteredText
2918
+ }) => $isCenteredText ? 'center' : 'left');
2919
+ const StyledMessageContent = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2920
+ displayName: "BaseMessage__StyledMessageContent",
2921
+ componentId: "kitt-universal__sc-eepeiz-4"
2922
+ })(["display:flex;flex-direction:row;flex-grow:1;align-self:center;align-items:flex-start;flex-shrink:1;padding:", ";"], ({
1946
2923
  theme
1947
- }) => theme.kitt.spacing * 2);
1948
- const TitleView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1949
- displayName: "Header__TitleView",
1950
- componentId: "kitt-universal__sc-1iwabch-3"
1951
- })(["padding-left:", "px;flex-shrink:1;"], ({
1952
- theme,
1953
- isIconLeft
1954
- }) => isIconLeft ? 0 : theme.kitt.spacing * 2);
1955
- function ModalHeader({
1956
- left,
1957
- right,
1958
- children
2924
+ }) => {
2925
+ const {
2926
+ spacing
2927
+ } = theme.kitt;
2928
+ return `${spacing * 4}px ${spacing * 5}px`;
2929
+ });
2930
+ function BaseMessage({
2931
+ type = 'info',
2932
+ children,
2933
+ hasNoRadius,
2934
+ centeredText,
2935
+ insets,
2936
+ onDismiss
1959
2937
  }) {
1960
- const onClose = react.useContext(OnCloseContext);
1961
- const isIconLeft = !!left;
1962
- return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
1963
- children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
1964
- children: left
1965
- }), /*#__PURE__*/jsxRuntime.jsx(TitleView, {
1966
- isIconLeft: isIconLeft,
1967
- children: children
1968
- }), right !== undefined ? right : /*#__PURE__*/jsxRuntime.jsx(RightIconView, {
1969
- children: /*#__PURE__*/jsxRuntime.jsx(Button, {
1970
- type: "subtle-dark",
2938
+ const color = getColorByType(type);
2939
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledMessageContainer, {
2940
+ $type: type,
2941
+ $hasNoRadius: hasNoRadius,
2942
+ $insets: insets,
2943
+ children: [/*#__PURE__*/jsxRuntime.jsxs(StyledMessageContent, {
2944
+ children: [centeredText ? null : /*#__PURE__*/jsxRuntime.jsx(StyledIconContainer, {
2945
+ children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
2946
+ color: color,
2947
+ icon: /*#__PURE__*/jsxRuntime.jsx(IconContent, {
2948
+ type: type,
2949
+ color: color
2950
+ })
2951
+ })
2952
+ }), /*#__PURE__*/jsxRuntime.jsx(StyledTextContent, {
2953
+ $isCenteredText: centeredText,
2954
+ base: "body",
2955
+ color: color,
2956
+ children: children
2957
+ })]
2958
+ }), onDismiss ? /*#__PURE__*/jsxRuntime.jsx(StyledDismissWrapper, {
2959
+ children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
2960
+ color: getIconButtonColor(type),
1971
2961
  icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
1972
- onPress: onClose
2962
+ onPress: onDismiss
1973
2963
  })
1974
- })]
2964
+ }) : null]
1975
2965
  });
1976
2966
  }
1977
2967
 
1978
- const ModalView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1979
- displayName: "Modal__ModalView",
1980
- componentId: "kitt-universal__sc-1xy2w5u-0"
1981
- })(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
1982
- theme
1983
- }) => theme.kitt.spacing * 20, ({
1984
- theme
1985
- }) => theme.kitt.spacing * 4);
1986
- const ContentView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1987
- displayName: "Modal__ContentView",
1988
- componentId: "kitt-universal__sc-1xy2w5u-1"
1989
- })(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], ({
1990
- theme
1991
- }) => theme.kitt.card.borderRadius, ({
1992
- theme
1993
- }) => theme.kitt.colors.uiBackgroundLight);
1994
- function Modal({
1995
- visible,
2968
+ function Message({
2969
+ type = 'info',
1996
2970
  children,
1997
- onClose,
1998
- onEntered,
1999
- onExited
2971
+ hasNoRadius,
2972
+ centeredText,
2973
+ insets,
2974
+ onDismiss
2000
2975
  }) {
2001
- return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
2002
- value: onClose,
2003
- children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Modal, {
2004
- transparent: true,
2005
- animationType: "fade",
2006
- visible: visible,
2007
- onShow: onEntered,
2008
- onDismiss: onExited,
2009
- onRequestClose: onClose,
2010
- children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
2011
- children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
2012
- onPress: onClose
2013
- }), /*#__PURE__*/jsxRuntime.jsx(ContentView, {
2014
- children: children
2015
- })]
2016
- })
2017
- })
2976
+ return /*#__PURE__*/jsxRuntime.jsx(BaseMessage, {
2977
+ insets: insets,
2978
+ hasNoRadius: hasNoRadius,
2979
+ type: type,
2980
+ centeredText: centeredText,
2981
+ onDismiss: onDismiss,
2982
+ children: children
2018
2983
  });
2019
2984
  }
2020
- Modal.Header = ModalHeader;
2021
- Modal.Body = ModalBody;
2022
- Modal.Footer = ModalFooter;
2023
2985
 
2024
2986
  function Notification({
2025
2987
  type,
@@ -2314,696 +3276,216 @@ function StorySection({
2314
3276
  }), children]
2315
3277
  });
2316
3278
  }
2317
- 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
- }
3279
+ const StyledSubSection = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3280
+ displayName: "StorySection__StyledSubSection",
3281
+ componentId: "kitt-universal__sc-1b3liv5-1"
3282
+ })(["margin-bottom:16px;"]);
2444
3283
 
2445
- function StoryGridCol({
3284
+ function SubSection({
2446
3285
  title,
2447
- titleColor,
2448
3286
  children,
2449
- platform = 'all'
3287
+ ...props
2450
3288
  }) {
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,
3289
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledSubSection, { ...props,
3290
+ children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level3, {
2459
3291
  children: title
2460
- }) : null, children]
3292
+ }), children]
2461
3293
  });
2462
3294
  }
2463
3295
 
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
- }
3296
+ const StyledBlockSection = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3297
+ displayName: "StorySection__StyledBlockSection",
3298
+ componentId: "kitt-universal__sc-1b3liv5-2"
3299
+ })(["margin-bottom:16px;"]);
2505
3300
 
2506
- default:
2507
- {
2508
- return 'black';
2509
- }
2510
- }
2511
- };
2512
- function Tag({
2513
- label,
2514
- type = 'default',
2515
- variant = 'fill'
3301
+ function BlockSection({
3302
+ title,
3303
+ children,
3304
+ ...props
2516
3305
  }) {
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
- })
3306
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledBlockSection, { ...props,
3307
+ children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
3308
+ children: title
3309
+ }), children]
2525
3310
  });
2526
3311
  }
2527
3312
 
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
- };
3313
+ const StyledDemoSection = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3314
+ displayName: "StorySection__StyledDemoSection",
3315
+ componentId: "kitt-universal__sc-1b3liv5-3"
3316
+ })(["margin-bottom:64px;"]);
2690
3317
 
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
- };
3318
+ function DemoSection({
3319
+ children
3320
+ }) {
3321
+ return /*#__PURE__*/jsxRuntime.jsx(StyledDemoSection, {
3322
+ children: /*#__PURE__*/jsxRuntime.jsx(StorySection, {
3323
+ internalIsDemoSection: true,
3324
+ title: "Demo",
3325
+ children: children
3326
+ })
3327
+ });
3328
+ }
2762
3329
 
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: '9px 16px'
2810
- },
2811
- transition: {
2812
- property: 'border-color',
2813
- duration: '200ms',
2814
- timingFunction: 'ease-in-out'
2815
- },
2816
- states: inputStatesStyle
2817
- };
3330
+ StorySection.SubSection = SubSection;
3331
+ StorySection.BlockSection = BlockSection;
3332
+ /** @deprecated use StorySection.Demo instead */
2818
3333
 
2819
- const inputField = {
2820
- labelContainerPaddingBottom: 5,
2821
- iconMarginLeft: 6
2822
- };
3334
+ StorySection.DemoSection = DemoSection;
3335
+ StorySection.Demo = DemoSection;
3336
+ /** @deprecated use StorySection instead */
2823
3337
 
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
- };
3338
+ const DeprecatedSection = StorySection;
2841
3339
 
2842
- const textArea = {
2843
- minHeight: 120
2844
- };
3340
+ function StoryContainer({
3341
+ children,
3342
+ state,
3343
+ title,
3344
+ platform
3345
+ }) {
3346
+ if (platform === 'native') return null;
3347
+ return /*#__PURE__*/jsxRuntime.jsx(StorySection.BlockSection, {
3348
+ testID: state,
3349
+ title: title,
3350
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
3351
+ className: state ? `kitt-${state}` : undefined,
3352
+ children: children
3353
+ })
3354
+ });
3355
+ }
2845
3356
 
2846
- const forms = {
2847
- input,
2848
- radio,
2849
- inputField,
2850
- textArea
2851
- };
3357
+ function StoryDecorator(storyFn, context) {
3358
+ return /*#__PURE__*/jsxRuntime.jsx(Story, {
3359
+ title: context.name,
3360
+ children: storyFn()
3361
+ });
3362
+ }
2852
3363
 
2853
- const fullScreenModal = {
2854
- header: {
2855
- paddingVertical: 12,
2856
- paddingHorizontal: 16,
2857
- borderColor: lateOceanColorPalette.black100
2858
- }
2859
- };
3364
+ const SmallScreenRow = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3365
+ displayName: "StoryGrid__SmallScreenRow",
3366
+ componentId: "kitt-universal__sc-4z5new-0"
3367
+ })(["flex-direction:column;margin:0;"]);
3368
+ const SmallScreenCol = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3369
+ displayName: "StoryGrid__SmallScreenCol",
3370
+ componentId: "kitt-universal__sc-4z5new-1"
3371
+ })(["padding:8px 0 16px;"]);
3372
+ const FlexRow = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3373
+ displayName: "StoryGrid__FlexRow",
3374
+ componentId: "kitt-universal__sc-4z5new-2"
3375
+ })(["flex-direction:row;margin:0 -4px 16px;"]);
3376
+ const FlexCol = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3377
+ displayName: "StoryGrid__FlexCol",
3378
+ componentId: "kitt-universal__sc-4z5new-3"
3379
+ })(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
2860
3380
 
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
3381
+ function StoryGridRow({
3382
+ children,
3383
+ breakpoint = 'small'
3384
+ }) {
3385
+ // eslint-disable-next-line unicorn/expiring-todo-comments
3386
+ // TODO use useBreakpoint instead
3387
+ const {
3388
+ width
3389
+ } = BabelPluginStyledComponentsReactNative.useWindowDimensions();
3390
+ const breakpointValue = breakpoint === 'small' ? 480 : 768;
3391
+
3392
+ if (width < breakpointValue) {
3393
+ return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
3394
+ children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
3395
+ children: child
3396
+ }))
3397
+ });
2893
3398
  }
2894
- };
2895
3399
 
2896
- const listItem = {
2897
- padding: '12px 16px',
2898
- borderColor: colors.separator,
2899
- borderWidth: 1,
2900
- innerMargin: 8
2901
- };
3400
+ return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
3401
+ children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
3402
+ children: child
3403
+ }))
3404
+ });
3405
+ }
2902
3406
 
2903
- const shadows = {
2904
- medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
2905
- };
3407
+ function StoryGridCol({
3408
+ title,
3409
+ titleColor,
3410
+ children,
3411
+ platform = 'all'
3412
+ }) {
3413
+ if (platform === 'native') {
3414
+ return null;
3415
+ }
2906
3416
 
2907
- const skeleton = {
2908
- backgroundColor: lateOceanColorPalette.black100,
2909
- flareColor: lateOceanColorPalette.black200,
2910
- animationDuration: 1000
2911
- };
3417
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
3418
+ children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
3419
+ numberOfLines: 1,
3420
+ color: titleColor,
3421
+ children: title
3422
+ }) : null, children]
3423
+ });
3424
+ }
2912
3425
 
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
- }
3426
+ const StoryGrid = {
3427
+ Row: StoryGridRow,
3428
+ Col: StoryGridCol
2952
3429
  };
2953
3430
 
2954
- const tooltip = {
2955
- backgroundColor: colors.black,
2956
- borderRadius: 10,
2957
- opacity: 0.95,
2958
- horizontalPadding: 16,
2959
- verticalPadding: 4,
2960
- floatingPadding: 8
2961
- };
3431
+ const Container = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3432
+ displayName: "Tag__Container",
3433
+ componentId: "kitt-universal__sc-19jmowi-0"
3434
+ })(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], ({
3435
+ theme,
3436
+ type,
3437
+ variant
3438
+ }) => theme.kitt.tag[type][variant].backgroundColor, ({
3439
+ theme,
3440
+ type,
3441
+ variant
3442
+ }) => theme.kitt.tag[type][variant].borderWidth, ({
3443
+ theme,
3444
+ type,
3445
+ variant
3446
+ }) => theme.kitt.tag[type][variant].borderColor, ({
3447
+ theme
3448
+ }) => theme.kitt.tag.padding, ({
3449
+ theme
3450
+ }) => theme.kitt.tag.borderRadius);
3451
+ const getLabelColor = (type, variant) => {
3452
+ switch (type) {
3453
+ case 'danger':
3454
+ {
3455
+ return variant === 'outline' ? 'danger' : 'black';
3456
+ }
2962
3457
 
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
3458
+ case 'primary':
3459
+ {
3460
+ return 'primary';
3461
+ }
2985
3462
 
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
3463
+ case 'default':
3464
+ {
3465
+ return 'black';
3466
+ }
3467
+
3468
+ default:
3469
+ {
3470
+ return 'black';
3471
+ }
3472
+ }
3006
3473
  };
3474
+ function Tag({
3475
+ label,
3476
+ type = 'default',
3477
+ variant = 'fill'
3478
+ }) {
3479
+ return /*#__PURE__*/jsxRuntime.jsx(Container, {
3480
+ type: type,
3481
+ variant: variant,
3482
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
3483
+ base: "body-xsmall",
3484
+ color: getLabelColor(type, variant),
3485
+ children: label
3486
+ })
3487
+ });
3488
+ }
3007
3489
 
3008
3490
  function TimePicker() {
3009
3491
  return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
@@ -3281,65 +3763,6 @@ function TypographyLink({
3281
3763
  });
3282
3764
  }
3283
3765
 
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
3766
  const hex2rgba = (hex, alpha = 1) => {
3344
3767
  const r = parseInt(hex.slice(1, 3), 16);
3345
3768
  const g = parseInt(hex.slice(3, 5), 16);
@@ -3382,6 +3805,8 @@ exports.useWindowSize = BabelPluginStyledComponentsReactNative.useWindowDimensio
3382
3805
  exports.Avatar = Avatar;
3383
3806
  exports.Button = Button;
3384
3807
  exports.Card = Card;
3808
+ exports.Checkbox = Checkbox;
3809
+ exports.DatePicker = DatePicker;
3385
3810
  exports.Emoji = Emoji;
3386
3811
  exports.ExternalLink = ExternalLink;
3387
3812
  exports.Flex = Flex;
@@ -3393,7 +3818,9 @@ exports.InputFeedback = InputFeedback;
3393
3818
  exports.InputField = InputField;
3394
3819
  exports.InputIcon = InputIcon;
3395
3820
  exports.InputPassword = InputPassword;
3821
+ exports.InputPhone = InputPhone;
3396
3822
  exports.InputPressable = InputPressable;
3823
+ exports.InputTag = InputTag;
3397
3824
  exports.InputText = InputText;
3398
3825
  exports.KittBreakpoints = KittBreakpoints;
3399
3826
  exports.KittBreakpointsMax = KittBreakpointsMax;