@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.
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +1 -1
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts +13 -0
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/DatePicker.d.ts +30 -0
- package/dist/definitions/forms/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts +11 -0
- package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts +11 -0
- package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts +14 -0
- package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts.map +1 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts +7 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts.map +1 -0
- package/dist/definitions/forms/InputTag/InputTag.d.ts +10 -0
- package/dist/definitions/forms/InputTag/InputTag.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
- package/dist/definitions/index.d.ts +8 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +14 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/checkbox.d.ts +13 -0
- package/dist/definitions/themes/late-ocean/checkbox.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/datePicker.d.ts +11 -0
- package/dist/definitions/themes/late-ocean/datePicker.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts +14 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/input.d.ts +1 -0
- package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/inputTag.d.ts +14 -0
- package/dist/definitions/themes/late-ocean/inputTag.d.ts.map +1 -0
- package/dist/index-browser-all.es.android.js +2399 -1942
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +2399 -1942
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +2397 -1940
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +2477 -2015
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +1992 -1562
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -1
- package/dist/index-node-14.17.cjs.web.js +1771 -1344
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +48 -2
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +48 -2
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +48 -2
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +48 -2
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +48 -2
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +48 -2
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -10,11 +10,11 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
10
10
|
const Animated = require('react-native-reanimated');
|
|
11
11
|
const twemojiParser = require('twemoji-parser');
|
|
12
12
|
const WebBrowser = require('expo-web-browser');
|
|
13
|
-
const
|
|
13
|
+
const reactIntl = require('react-intl');
|
|
14
14
|
const react$1 = require('@linaria/react');
|
|
15
|
-
const expoLinearGradient = require('expo-linear-gradient');
|
|
16
15
|
const DateTimePicker = require('@react-native-community/datetimepicker');
|
|
17
|
-
const
|
|
16
|
+
const reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
17
|
+
const expoLinearGradient = require('expo-linear-gradient');
|
|
18
18
|
const reactNative$1 = require('@floating-ui/react-native');
|
|
19
19
|
const addons = require('@storybook/addons');
|
|
20
20
|
|
|
@@ -57,7 +57,7 @@ function SpinningIcon({
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const IconContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
60
|
+
const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
61
61
|
displayName: "Icon__IconContainer",
|
|
62
62
|
componentId: "kitt-universal__sc-usm0ol-0"
|
|
63
63
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
|
|
@@ -79,7 +79,7 @@ function Icon({
|
|
|
79
79
|
const clonedIcon = /*#__PURE__*/react.cloneElement(icon, {
|
|
80
80
|
color
|
|
81
81
|
});
|
|
82
|
-
return /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
|
|
82
|
+
return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
|
|
83
83
|
align: align,
|
|
84
84
|
size: size,
|
|
85
85
|
color: color,
|
|
@@ -896,209 +896,1554 @@ function ExternalLink({
|
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
isFocused,
|
|
923
|
-
isDisabled,
|
|
924
|
-
formState
|
|
925
|
-
}) {
|
|
926
|
-
if (isDisabled) return 'disabled';
|
|
927
|
-
if (isFocused) return 'focus';
|
|
928
|
-
if (formState === 'invalid') return 'invalid';
|
|
929
|
-
return 'default';
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
const InputTextContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
933
|
-
displayName: "InputTextContainer",
|
|
934
|
-
componentId: "kitt-universal__sc-8j6fjq-0"
|
|
935
|
-
})(["position:relative;"]);
|
|
936
|
-
|
|
937
|
-
const StyledTextInput = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
|
|
938
|
-
displayName: "InputText__StyledTextInput",
|
|
939
|
-
componentId: "kitt-universal__sc-uke279-0"
|
|
940
|
-
})(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, ({
|
|
941
|
-
theme,
|
|
942
|
-
multiline
|
|
943
|
-
}) => {
|
|
944
|
-
if (!multiline && reactNative.Platform.OS === 'ios') {
|
|
945
|
-
return theme.kitt.forms.input.padding.iOSSingleLine;
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
return theme.kitt.forms.input.padding.default;
|
|
949
|
-
}, ({
|
|
950
|
-
theme,
|
|
951
|
-
multiline
|
|
952
|
-
}) => {
|
|
953
|
-
if (!multiline && reactNative.Platform.OS === 'ios') return 0;
|
|
954
|
-
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
955
|
-
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
|
|
956
|
-
}, ({
|
|
957
|
-
$minHeight
|
|
958
|
-
}) => $minHeight);
|
|
959
|
-
const RightInputContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
960
|
-
displayName: "InputText__RightInputContainer",
|
|
961
|
-
componentId: "kitt-universal__sc-uke279-1"
|
|
962
|
-
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
963
|
-
const InputText = /*#__PURE__*/react.forwardRef(({
|
|
964
|
-
id,
|
|
965
|
-
right,
|
|
966
|
-
minHeight = 0,
|
|
967
|
-
state: formState,
|
|
968
|
-
internalForceState,
|
|
969
|
-
disabled = false,
|
|
970
|
-
autoCorrect = true,
|
|
971
|
-
textContentType = 'none',
|
|
972
|
-
autoCompleteType = 'off',
|
|
973
|
-
keyboardType = 'default',
|
|
974
|
-
onFocus,
|
|
975
|
-
onBlur,
|
|
976
|
-
...props
|
|
977
|
-
}, ref) => {
|
|
978
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
979
|
-
const [isFocused, setIsFocused] = react.useState(false);
|
|
980
|
-
const state = internalForceState || getInputUIState({
|
|
981
|
-
isFocused,
|
|
982
|
-
isDisabled: disabled,
|
|
983
|
-
formState
|
|
984
|
-
});
|
|
985
|
-
return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
|
|
986
|
-
$isDisabled: disabled,
|
|
987
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(StyledTextInput, {
|
|
988
|
-
ref: ref,
|
|
989
|
-
nativeID: id,
|
|
990
|
-
editable: !disabled,
|
|
991
|
-
keyboardType: keyboardType,
|
|
992
|
-
autoCompleteType: autoCompleteType,
|
|
993
|
-
autoCorrect: autoCorrect,
|
|
994
|
-
$minHeight: minHeight,
|
|
995
|
-
textContentType: textContentType,
|
|
996
|
-
placeholderTextColor: theme.kitt.forms.input.color.placeholder,
|
|
997
|
-
selectionColor: theme.kitt.forms.input.color.selection,
|
|
998
|
-
...props,
|
|
999
|
-
$state: state,
|
|
1000
|
-
onFocus: e => {
|
|
1001
|
-
setIsFocused(true);
|
|
1002
|
-
if (onFocus) onFocus(e);
|
|
1003
|
-
},
|
|
1004
|
-
onBlur: e => {
|
|
1005
|
-
setIsFocused(false);
|
|
1006
|
-
if (onBlur) onBlur(e);
|
|
1007
|
-
}
|
|
1008
|
-
}), right ? /*#__PURE__*/jsxRuntime.jsx(RightInputContainer, {
|
|
1009
|
-
children: right
|
|
1010
|
-
}) : null]
|
|
1011
|
-
});
|
|
1012
|
-
});
|
|
1013
|
-
|
|
1014
|
-
function InputEmail(props) {
|
|
1015
|
-
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
1016
|
-
autoCompleteType: "email",
|
|
1017
|
-
keyboardType: "email-address",
|
|
1018
|
-
textContentType: "emailAddress",
|
|
1019
|
-
...props
|
|
1020
|
-
});
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
const getColorFromState = state => {
|
|
1024
|
-
switch (state) {
|
|
1025
|
-
case 'invalid':
|
|
1026
|
-
return 'danger';
|
|
899
|
+
const lateOceanColorPalette = {
|
|
900
|
+
lateOcean: '#4C34E0',
|
|
901
|
+
lateOceanLight1: '#705DE6',
|
|
902
|
+
lateOceanLight2: '#9485EC',
|
|
903
|
+
lateOceanLight3: '#D6BAF9',
|
|
904
|
+
warmEmbrace: '#F4D3CE',
|
|
905
|
+
warmEmbraceLight1: '#FFEDE6',
|
|
906
|
+
black1000: '#000000',
|
|
907
|
+
black800: '#2C293D',
|
|
908
|
+
black555: '#737373',
|
|
909
|
+
black200: '#CCCCCC',
|
|
910
|
+
black100: '#E5E5E5',
|
|
911
|
+
black50: '#F2F2F2',
|
|
912
|
+
black25: '#F9F9F9',
|
|
913
|
+
white: '#FFFFFF',
|
|
914
|
+
viride: '#38836D',
|
|
915
|
+
englishVermillon: '#D44148',
|
|
916
|
+
goldCrayola: '#F8C583',
|
|
917
|
+
aero: '#89BDDD',
|
|
918
|
+
transparent: 'transparent',
|
|
919
|
+
moonPurple: '#DBD6F9',
|
|
920
|
+
moonPurpleLight1: '#EDEBFC'
|
|
921
|
+
};
|
|
1027
922
|
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
923
|
+
const colors = {
|
|
924
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
925
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
926
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
927
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
928
|
+
success: lateOceanColorPalette.viride,
|
|
929
|
+
correct: lateOceanColorPalette.viride,
|
|
930
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
931
|
+
info: lateOceanColorPalette.aero,
|
|
932
|
+
warning: lateOceanColorPalette.goldCrayola,
|
|
933
|
+
separator: lateOceanColorPalette.black100,
|
|
934
|
+
hover: lateOceanColorPalette.black100,
|
|
935
|
+
black: lateOceanColorPalette.black1000,
|
|
936
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
937
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
938
|
+
transparent: lateOceanColorPalette.transparent,
|
|
939
|
+
disabled: lateOceanColorPalette.black50,
|
|
940
|
+
overlay: {
|
|
941
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
942
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
943
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
1031
944
|
}
|
|
1032
945
|
};
|
|
1033
946
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
color: getColorFromState(state),
|
|
1042
|
-
testID: testID,
|
|
1043
|
-
children: children
|
|
1044
|
-
});
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
const FieldContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1048
|
-
displayName: "InputField__FieldContainer",
|
|
1049
|
-
componentId: "kitt-universal__sc-13fkixs-0"
|
|
1050
|
-
})(["padding:5px 0 10px;"]);
|
|
1051
|
-
const FeedbackContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1052
|
-
displayName: "InputField__FeedbackContainer",
|
|
1053
|
-
componentId: "kitt-universal__sc-13fkixs-1"
|
|
1054
|
-
})(["", ";"], ({
|
|
1055
|
-
theme
|
|
1056
|
-
}) => theme.responsive.ifWindowSizeMatches({
|
|
1057
|
-
minWidth: KittBreakpoints.SMALL
|
|
1058
|
-
}, 'padding-top: 10px', 'padding-top: 5px'));
|
|
1059
|
-
const FieldLabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1060
|
-
displayName: "InputField__FieldLabelContainer",
|
|
1061
|
-
componentId: "kitt-universal__sc-13fkixs-2"
|
|
1062
|
-
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
|
|
1063
|
-
theme
|
|
1064
|
-
}) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
|
|
1065
|
-
const LabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1066
|
-
displayName: "InputField__LabelContainer",
|
|
1067
|
-
componentId: "kitt-universal__sc-13fkixs-3"
|
|
1068
|
-
})(["margin-right:", "px;"], ({
|
|
1069
|
-
theme
|
|
1070
|
-
}) => theme.kitt.forms.inputField.iconMarginLeft);
|
|
1071
|
-
function InputField({
|
|
1072
|
-
label,
|
|
1073
|
-
labelFeedback,
|
|
1074
|
-
input,
|
|
1075
|
-
feedback
|
|
1076
|
-
}) {
|
|
1077
|
-
return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
|
|
1078
|
-
children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
|
|
1079
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(LabelContainer, {
|
|
1080
|
-
children: label
|
|
1081
|
-
}), labelFeedback]
|
|
1082
|
-
}) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(FeedbackContainer, {
|
|
1083
|
-
children: feedback
|
|
1084
|
-
}) : null]
|
|
1085
|
-
});
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
function getIconColor(state, disabled) {
|
|
1089
|
-
if (disabled) return 'black-light';
|
|
1090
|
-
|
|
1091
|
-
switch (state) {
|
|
1092
|
-
case 'invalid':
|
|
1093
|
-
return 'danger';
|
|
1094
|
-
|
|
1095
|
-
case 'valid':
|
|
1096
|
-
return 'success';
|
|
1097
|
-
|
|
1098
|
-
default:
|
|
1099
|
-
return undefined;
|
|
947
|
+
const avatar = {
|
|
948
|
+
borderRadius: 10,
|
|
949
|
+
default: {
|
|
950
|
+
backgroundColor: colors.primary
|
|
951
|
+
},
|
|
952
|
+
light: {
|
|
953
|
+
backgroundColor: lateOceanColorPalette.black100
|
|
1100
954
|
}
|
|
1101
|
-
}
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
const button = {
|
|
958
|
+
borderRadius: 30,
|
|
959
|
+
borderWidth: {
|
|
960
|
+
disabled: 2,
|
|
961
|
+
focus: 3
|
|
962
|
+
},
|
|
963
|
+
minHeight: 40,
|
|
964
|
+
minWidth: 40,
|
|
965
|
+
maxWidth: 335,
|
|
966
|
+
scale: {
|
|
967
|
+
base: {
|
|
968
|
+
default: 1,
|
|
969
|
+
hover: 0.95,
|
|
970
|
+
active: 0.95
|
|
971
|
+
},
|
|
972
|
+
medium: {
|
|
973
|
+
hover: 1.05
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
contentPadding: {
|
|
977
|
+
default: '8px 16px 7px',
|
|
978
|
+
large: '12px 24px 11px',
|
|
979
|
+
disabled: '6px 14px 5px'
|
|
980
|
+
},
|
|
981
|
+
transition: {
|
|
982
|
+
duration: '200ms',
|
|
983
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
984
|
+
},
|
|
985
|
+
default: {
|
|
986
|
+
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
987
|
+
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
988
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
989
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
990
|
+
},
|
|
991
|
+
primary: {
|
|
992
|
+
backgroundColor: colors.primary,
|
|
993
|
+
pressedBackgroundColor: colors.primaryLight,
|
|
994
|
+
hoverBackgroundColor: colors.primaryLight,
|
|
995
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
996
|
+
},
|
|
997
|
+
white: {
|
|
998
|
+
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
999
|
+
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1000
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1001
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
1002
|
+
},
|
|
1003
|
+
subtle: {
|
|
1004
|
+
backgroundColor: colors.transparent,
|
|
1005
|
+
pressedBackgroundColor: colors.transparent,
|
|
1006
|
+
hoverBackgroundColor: colors.transparent,
|
|
1007
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
1008
|
+
color: colors.primary,
|
|
1009
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
1010
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
1011
|
+
},
|
|
1012
|
+
'subtle-dark': {
|
|
1013
|
+
backgroundColor: colors.transparent,
|
|
1014
|
+
pressedBackgroundColor: colors.transparent,
|
|
1015
|
+
hoverBackgroundColor: colors.transparent,
|
|
1016
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
1017
|
+
color: colors.black,
|
|
1018
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
1019
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
1020
|
+
},
|
|
1021
|
+
disabled: {
|
|
1022
|
+
backgroundColor: colors.disabled,
|
|
1023
|
+
pressedBackgroundColor: colors.disabled,
|
|
1024
|
+
hoverBackgroundColor: colors.disabled,
|
|
1025
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
1026
|
+
borderColor: lateOceanColorPalette.black100
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
const card = {
|
|
1031
|
+
borderRadius: 20,
|
|
1032
|
+
borderWidth: 2,
|
|
1033
|
+
primary: {
|
|
1034
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1035
|
+
borderColor: colors.primary
|
|
1036
|
+
},
|
|
1037
|
+
secondary: {
|
|
1038
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1039
|
+
borderColor: colors.separator
|
|
1040
|
+
},
|
|
1041
|
+
subtle: {
|
|
1042
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1043
|
+
borderColor: colors.separator
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
const feedbackMessage = {
|
|
1048
|
+
danger: {
|
|
1049
|
+
backgroundColor: colors.danger
|
|
1050
|
+
},
|
|
1051
|
+
success: {
|
|
1052
|
+
backgroundColor: colors.success
|
|
1053
|
+
},
|
|
1054
|
+
info: {
|
|
1055
|
+
backgroundColor: colors.info
|
|
1056
|
+
},
|
|
1057
|
+
warning: {
|
|
1058
|
+
backgroundColor: colors.warning
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
const checkbox = {
|
|
1063
|
+
borderWidth: 2,
|
|
1064
|
+
borderRadius: 5,
|
|
1065
|
+
height: 20,
|
|
1066
|
+
width: 20,
|
|
1067
|
+
iconSize: 14,
|
|
1068
|
+
borderColor: colors.separator,
|
|
1069
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1070
|
+
checkedBorderColor: colors.primary,
|
|
1071
|
+
checkedBackgroundColor: colors.primary,
|
|
1072
|
+
markColor: colors.uiBackgroundLight
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
const datePicker = {
|
|
1076
|
+
day: {
|
|
1077
|
+
minWidth: 64
|
|
1078
|
+
},
|
|
1079
|
+
month: {
|
|
1080
|
+
minWidth: 64
|
|
1081
|
+
},
|
|
1082
|
+
year: {
|
|
1083
|
+
minWidth: 82
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
|
|
1088
|
+
const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
|
|
1089
|
+
baseAndSmall: {
|
|
1090
|
+
fontSize: baseAndSmallFontSize,
|
|
1091
|
+
lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
|
|
1092
|
+
},
|
|
1093
|
+
mediumAndWide: {
|
|
1094
|
+
fontSize: mediumAndWideFontSize,
|
|
1095
|
+
lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
|
|
1096
|
+
}
|
|
1097
|
+
});
|
|
1098
|
+
const typography = {
|
|
1099
|
+
colors: {
|
|
1100
|
+
black: lateOceanColorPalette.black1000,
|
|
1101
|
+
'black-anthracite': lateOceanColorPalette.black800,
|
|
1102
|
+
'black-light': lateOceanColorPalette.black555,
|
|
1103
|
+
white: lateOceanColorPalette.white,
|
|
1104
|
+
'white-light': lateOceanColorPalette.white,
|
|
1105
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
1106
|
+
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
1107
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
1108
|
+
success: lateOceanColorPalette.viride,
|
|
1109
|
+
danger: lateOceanColorPalette.englishVermillon
|
|
1110
|
+
},
|
|
1111
|
+
types: {
|
|
1112
|
+
headers: {
|
|
1113
|
+
fontFamily: {
|
|
1114
|
+
regular: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
1115
|
+
bold: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
1116
|
+
},
|
|
1117
|
+
fontWeight: 400,
|
|
1118
|
+
fontStyle: 'normal',
|
|
1119
|
+
configs: {
|
|
1120
|
+
// also known as xxlarge
|
|
1121
|
+
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
1122
|
+
// also known as xlarge
|
|
1123
|
+
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
1124
|
+
// also known as medium
|
|
1125
|
+
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
1126
|
+
// also known as xsmall
|
|
1127
|
+
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
1128
|
+
// also known as xxsmall
|
|
1129
|
+
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
bodies: {
|
|
1133
|
+
fontFamily: {
|
|
1134
|
+
regular: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
1135
|
+
bold: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
1136
|
+
},
|
|
1137
|
+
fontWeight: {
|
|
1138
|
+
regular: 400,
|
|
1139
|
+
bold: 700
|
|
1140
|
+
},
|
|
1141
|
+
fontStyle: {
|
|
1142
|
+
regular: 'normal',
|
|
1143
|
+
bold: 'normal'
|
|
1144
|
+
},
|
|
1145
|
+
configs: {
|
|
1146
|
+
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
1147
|
+
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
1148
|
+
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
1149
|
+
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
1150
|
+
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
},
|
|
1154
|
+
link: {
|
|
1155
|
+
disabledColor: lateOceanColorPalette.black200
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
const inputStatesStyle = {
|
|
1160
|
+
default: {
|
|
1161
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1162
|
+
borderColor: colors.separator,
|
|
1163
|
+
color: 'black'
|
|
1164
|
+
},
|
|
1165
|
+
pending: {
|
|
1166
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1167
|
+
borderColor: colors.separator,
|
|
1168
|
+
color: 'black'
|
|
1169
|
+
},
|
|
1170
|
+
valid: {
|
|
1171
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1172
|
+
borderColor: lateOceanColorPalette.black100,
|
|
1173
|
+
color: 'black'
|
|
1174
|
+
},
|
|
1175
|
+
hover: {
|
|
1176
|
+
borderColor: lateOceanColorPalette.black200,
|
|
1177
|
+
color: 'black'
|
|
1178
|
+
},
|
|
1179
|
+
focus: {
|
|
1180
|
+
borderColor: colors.primary,
|
|
1181
|
+
color: 'black'
|
|
1182
|
+
},
|
|
1183
|
+
disabled: {
|
|
1184
|
+
backgroundColor: colors.disabled,
|
|
1185
|
+
borderColor: colors.separator,
|
|
1186
|
+
color: 'black-light'
|
|
1187
|
+
},
|
|
1188
|
+
invalid: {
|
|
1189
|
+
borderColor: colors.separator,
|
|
1190
|
+
color: 'black'
|
|
1191
|
+
}
|
|
1192
|
+
};
|
|
1193
|
+
const input = {
|
|
1194
|
+
minHeight: 40,
|
|
1195
|
+
color: {
|
|
1196
|
+
selection: colors.primary,
|
|
1197
|
+
placeholder: typography.colors['black-light']
|
|
1198
|
+
},
|
|
1199
|
+
borderWidth: 2,
|
|
1200
|
+
borderRadius: 10,
|
|
1201
|
+
icon: {
|
|
1202
|
+
size: 20
|
|
1203
|
+
},
|
|
1204
|
+
padding: {
|
|
1205
|
+
default: '5px 16px',
|
|
1206
|
+
iOSSingleLine: '7px 16px'
|
|
1207
|
+
},
|
|
1208
|
+
transition: {
|
|
1209
|
+
property: 'border-color',
|
|
1210
|
+
duration: '200ms',
|
|
1211
|
+
timingFunction: 'ease-in-out'
|
|
1212
|
+
},
|
|
1213
|
+
states: inputStatesStyle
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
const inputField = {
|
|
1217
|
+
labelContainerPaddingBottom: 5,
|
|
1218
|
+
iconMarginLeft: 6
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
const inputTag = {
|
|
1222
|
+
success: {
|
|
1223
|
+
backgroundColor: colors.success,
|
|
1224
|
+
labelColor: colors.uiBackgroundLight
|
|
1225
|
+
},
|
|
1226
|
+
danger: {
|
|
1227
|
+
backgroundColor: colors.danger,
|
|
1228
|
+
labelColor: colors.uiBackgroundLight
|
|
1229
|
+
},
|
|
1230
|
+
default: {
|
|
1231
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1232
|
+
labelColor: colors.black
|
|
1233
|
+
},
|
|
1234
|
+
borderRadius: 10,
|
|
1235
|
+
iconSize: 13.5
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
const radio = {
|
|
1239
|
+
size: 18,
|
|
1240
|
+
unchecked: {
|
|
1241
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1242
|
+
borderWidth: 2,
|
|
1243
|
+
borderColor: lateOceanColorPalette.black200
|
|
1244
|
+
},
|
|
1245
|
+
checked: {
|
|
1246
|
+
backgroundColor: colors.primary,
|
|
1247
|
+
innerSize: 5,
|
|
1248
|
+
innerBackgroundColor: colors.uiBackgroundLight
|
|
1249
|
+
},
|
|
1250
|
+
disabled: {
|
|
1251
|
+
backgroundColor: colors.disabled,
|
|
1252
|
+
borderColor: colors.separator
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
const textArea = {
|
|
1257
|
+
minHeight: 120
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
const forms = {
|
|
1261
|
+
datePicker,
|
|
1262
|
+
input,
|
|
1263
|
+
radio,
|
|
1264
|
+
inputField,
|
|
1265
|
+
textArea,
|
|
1266
|
+
checkbox,
|
|
1267
|
+
inputTag
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
const fullScreenModal = {
|
|
1271
|
+
header: {
|
|
1272
|
+
paddingVertical: 12,
|
|
1273
|
+
paddingHorizontal: 16,
|
|
1274
|
+
borderColor: lateOceanColorPalette.black100
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
const iconButton = {
|
|
1279
|
+
backgroundColor: 'transparent',
|
|
1280
|
+
width: 40,
|
|
1281
|
+
height: 40,
|
|
1282
|
+
borderRadius: 20,
|
|
1283
|
+
borderWidth: 2,
|
|
1284
|
+
borderColor: 'transparent',
|
|
1285
|
+
transition: {
|
|
1286
|
+
property: 'all',
|
|
1287
|
+
duration: '200ms',
|
|
1288
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
|
|
1289
|
+
},
|
|
1290
|
+
scale: {
|
|
1291
|
+
base: {
|
|
1292
|
+
default: 1,
|
|
1293
|
+
hover: 0.95,
|
|
1294
|
+
active: 0.95
|
|
1295
|
+
},
|
|
1296
|
+
medium: {
|
|
1297
|
+
hover: 1.05
|
|
1298
|
+
}
|
|
1299
|
+
},
|
|
1300
|
+
disabled: {
|
|
1301
|
+
scale: 1,
|
|
1302
|
+
backgroundColor: button.disabled.backgroundColor,
|
|
1303
|
+
borderColor: button.disabled.borderColor
|
|
1304
|
+
},
|
|
1305
|
+
default: {
|
|
1306
|
+
pressedBackgroundColor: button.default.pressedBackgroundColor
|
|
1307
|
+
},
|
|
1308
|
+
white: {
|
|
1309
|
+
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
|
|
1313
|
+
const listItem = {
|
|
1314
|
+
padding: '12px 16px',
|
|
1315
|
+
borderColor: colors.separator,
|
|
1316
|
+
borderWidth: 1,
|
|
1317
|
+
innerMargin: 8
|
|
1318
|
+
};
|
|
1319
|
+
|
|
1320
|
+
const shadows = {
|
|
1321
|
+
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1324
|
+
const skeleton = {
|
|
1325
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
1326
|
+
flareColor: lateOceanColorPalette.black200,
|
|
1327
|
+
animationDuration: 1000
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
const tag = {
|
|
1331
|
+
borderRadius: 10,
|
|
1332
|
+
padding: '2px 12px',
|
|
1333
|
+
primary: {
|
|
1334
|
+
fill: {
|
|
1335
|
+
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
1336
|
+
borderWidth: 0,
|
|
1337
|
+
borderColor: colors.transparent
|
|
1338
|
+
},
|
|
1339
|
+
outline: {
|
|
1340
|
+
backgroundColor: colors.transparent,
|
|
1341
|
+
borderWidth: 1,
|
|
1342
|
+
borderColor: colors.primary
|
|
1343
|
+
}
|
|
1344
|
+
},
|
|
1345
|
+
default: {
|
|
1346
|
+
fill: {
|
|
1347
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1348
|
+
borderWidth: 0,
|
|
1349
|
+
borderColor: colors.transparent
|
|
1350
|
+
},
|
|
1351
|
+
outline: {
|
|
1352
|
+
backgroundColor: colors.transparent,
|
|
1353
|
+
borderWidth: 1,
|
|
1354
|
+
borderColor: colors.black
|
|
1355
|
+
}
|
|
1356
|
+
},
|
|
1357
|
+
danger: {
|
|
1358
|
+
fill: {
|
|
1359
|
+
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
1360
|
+
borderWidth: 0,
|
|
1361
|
+
borderColor: colors.transparent
|
|
1362
|
+
},
|
|
1363
|
+
outline: {
|
|
1364
|
+
backgroundColor: colors.transparent,
|
|
1365
|
+
borderWidth: 1,
|
|
1366
|
+
borderColor: colors.danger
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
const tooltip = {
|
|
1372
|
+
backgroundColor: colors.black,
|
|
1373
|
+
borderRadius: 10,
|
|
1374
|
+
opacity: 0.95,
|
|
1375
|
+
horizontalPadding: 16,
|
|
1376
|
+
verticalPadding: 4,
|
|
1377
|
+
floatingPadding: 8
|
|
1378
|
+
};
|
|
1379
|
+
|
|
1380
|
+
const breakpoints = {
|
|
1381
|
+
values: {
|
|
1382
|
+
base: 0,
|
|
1383
|
+
small: 480,
|
|
1384
|
+
medium: 768,
|
|
1385
|
+
large: 1024,
|
|
1386
|
+
wide: 1280
|
|
1387
|
+
},
|
|
1388
|
+
min: {
|
|
1389
|
+
smallBreakpoint: 'min-width: 480px',
|
|
1390
|
+
mediumBreakpoint: 'min-width: 768px',
|
|
1391
|
+
largeBreakpoint: 'min-width: 1024px',
|
|
1392
|
+
wideBreakpoint: 'min-width: 1280px'
|
|
1393
|
+
},
|
|
1394
|
+
max: {
|
|
1395
|
+
smallBreakpoint: 'max-width: 479px',
|
|
1396
|
+
mediumBreakpoint: 'max-width: 767px',
|
|
1397
|
+
largeBreakpoint: 'max-width: 1023px',
|
|
1398
|
+
wideBreakpoint: 'max-width: 1279px'
|
|
1399
|
+
}
|
|
1400
|
+
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
1401
|
+
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
1402
|
+
|
|
1403
|
+
const theme = {
|
|
1404
|
+
spacing: 4,
|
|
1405
|
+
colors,
|
|
1406
|
+
palettes: {
|
|
1407
|
+
lateOcean: lateOceanColorPalette
|
|
1408
|
+
},
|
|
1409
|
+
avatar,
|
|
1410
|
+
button,
|
|
1411
|
+
card,
|
|
1412
|
+
feedbackMessage,
|
|
1413
|
+
forms,
|
|
1414
|
+
typography,
|
|
1415
|
+
tag,
|
|
1416
|
+
shadows,
|
|
1417
|
+
fullScreenModal,
|
|
1418
|
+
iconButton,
|
|
1419
|
+
listItem,
|
|
1420
|
+
tooltip,
|
|
1421
|
+
skeleton,
|
|
1422
|
+
breakpoints
|
|
1423
|
+
};
|
|
1424
|
+
|
|
1425
|
+
function matchWindowSize({
|
|
1426
|
+
width,
|
|
1427
|
+
height
|
|
1428
|
+
}, {
|
|
1429
|
+
minWidth,
|
|
1430
|
+
maxWidth,
|
|
1431
|
+
minHeight,
|
|
1432
|
+
maxHeight
|
|
1433
|
+
}) {
|
|
1434
|
+
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
1435
|
+
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
1436
|
+
return hasWidthMatched && hasHeightMatched;
|
|
1437
|
+
}
|
|
1438
|
+
function useMatchWindowSize(options) {
|
|
1439
|
+
const {
|
|
1440
|
+
width,
|
|
1441
|
+
height
|
|
1442
|
+
} = reactNative.useWindowDimensions();
|
|
1443
|
+
return matchWindowSize({
|
|
1444
|
+
width,
|
|
1445
|
+
height
|
|
1446
|
+
}, options);
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
// eslint-disable-next-line no-restricted-imports
|
|
1450
|
+
function createWindowSizeHelper(dimensions) {
|
|
1451
|
+
return {
|
|
1452
|
+
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
1453
|
+
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
1454
|
+
mapWindowWidth: (...widthList) => {
|
|
1455
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
1456
|
+
widthList.slice(1).forEach(([minWidth], index) => {
|
|
1457
|
+
const previousMinWidth = widthList[index][0];
|
|
1458
|
+
|
|
1459
|
+
if (previousMinWidth > minWidth) {
|
|
1460
|
+
throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
|
|
1461
|
+
}
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
1466
|
+
minWidth: Number(minWidth)
|
|
1467
|
+
}));
|
|
1468
|
+
if (!found) return null;
|
|
1469
|
+
return found[1];
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
function useKittTheme() {
|
|
1475
|
+
const dimensions = reactNative.useWindowDimensions();
|
|
1476
|
+
return react.useMemo(() => {
|
|
1477
|
+
return {
|
|
1478
|
+
kitt: theme,
|
|
1479
|
+
responsive: createWindowSizeHelper(dimensions)
|
|
1480
|
+
};
|
|
1481
|
+
}, [dimensions]);
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
const CheckboxAndLabelPressableWrapper = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
1485
|
+
displayName: "Checkbox__CheckboxAndLabelPressableWrapper",
|
|
1486
|
+
componentId: "kitt-universal__sc-1sav1n6-0"
|
|
1487
|
+
})(["display:flex;flex-direction:row;align-items:center;"]);
|
|
1488
|
+
const CheckboxContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1489
|
+
displayName: "Checkbox__CheckboxContainer",
|
|
1490
|
+
componentId: "kitt-universal__sc-1sav1n6-1"
|
|
1491
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:center;height:", "px;width:", "px;position:relative;border-radius:", "px;", " margin-right:", ";"], ({
|
|
1492
|
+
theme
|
|
1493
|
+
}) => theme.kitt.forms.checkbox.height, ({
|
|
1494
|
+
theme
|
|
1495
|
+
}) => theme.kitt.forms.checkbox.width, ({
|
|
1496
|
+
theme
|
|
1497
|
+
}) => theme.kitt.forms.checkbox.borderRadius, ({
|
|
1498
|
+
$isChecked,
|
|
1499
|
+
theme
|
|
1500
|
+
}) => {
|
|
1501
|
+
const {
|
|
1502
|
+
checkedBackgroundColor,
|
|
1503
|
+
checkedBorderColor,
|
|
1504
|
+
borderColor,
|
|
1505
|
+
borderWidth,
|
|
1506
|
+
backgroundColor
|
|
1507
|
+
} = theme.kitt.forms.checkbox;
|
|
1508
|
+
|
|
1509
|
+
if ($isChecked) {
|
|
1510
|
+
return styled.css(["background-color:", ";border:", ";"], checkedBackgroundColor, `${borderWidth}px solid ${checkedBorderColor}`);
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
return styled.css(["background-color:", ";border:", ";"], backgroundColor, `${borderWidth}px solid ${borderColor}`);
|
|
1514
|
+
}, ({
|
|
1515
|
+
theme,
|
|
1516
|
+
$hasLabel
|
|
1517
|
+
}) => {
|
|
1518
|
+
if (!$hasLabel) return '0px';
|
|
1519
|
+
return `${theme.kitt.spacing * 2.5}px;`;
|
|
1520
|
+
});
|
|
1521
|
+
function Checkbox({
|
|
1522
|
+
onChange,
|
|
1523
|
+
onBlur,
|
|
1524
|
+
onFocus,
|
|
1525
|
+
value,
|
|
1526
|
+
hitSlop = 40,
|
|
1527
|
+
id,
|
|
1528
|
+
children
|
|
1529
|
+
}) {
|
|
1530
|
+
const theme = useKittTheme();
|
|
1531
|
+
return /*#__PURE__*/jsxRuntime.jsxs(CheckboxAndLabelPressableWrapper, {
|
|
1532
|
+
accessibilityRole: "checkbox",
|
|
1533
|
+
accessibilityState: {
|
|
1534
|
+
checked: value
|
|
1535
|
+
},
|
|
1536
|
+
hitSlop: hitSlop,
|
|
1537
|
+
onPress: e => {
|
|
1538
|
+
if (onFocus) onFocus(e);
|
|
1539
|
+
if (onChange) onChange(e);
|
|
1540
|
+
if (onBlur) onBlur(e);
|
|
1541
|
+
},
|
|
1542
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(CheckboxContainer, {
|
|
1543
|
+
$isChecked: value,
|
|
1544
|
+
$hasLabel: !!children,
|
|
1545
|
+
testID: id,
|
|
1546
|
+
children: value ? /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1547
|
+
align: "center",
|
|
1548
|
+
color: theme.kitt.forms.checkbox.markColor,
|
|
1549
|
+
size: theme.kitt.forms.checkbox.iconSize,
|
|
1550
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.CheckboxMark, {})
|
|
1551
|
+
}) : null
|
|
1552
|
+
}), children]
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
function getInputUIState({
|
|
1557
|
+
isFocused,
|
|
1558
|
+
isDisabled,
|
|
1559
|
+
formState
|
|
1560
|
+
}) {
|
|
1561
|
+
if (isDisabled) return 'disabled';
|
|
1562
|
+
if (isFocused) return 'focus';
|
|
1563
|
+
if (formState === 'invalid') return 'invalid';
|
|
1564
|
+
return 'default';
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
|
|
1568
|
+
theme,
|
|
1569
|
+
$state
|
|
1570
|
+
}) => $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states.default.backgroundColor, ({
|
|
1571
|
+
theme
|
|
1572
|
+
}) => theme.kitt.forms.input.borderWidth, ({
|
|
1573
|
+
theme
|
|
1574
|
+
}) => theme.kitt.forms.input.borderRadius, ({
|
|
1575
|
+
theme,
|
|
1576
|
+
$state
|
|
1577
|
+
}) => theme.kitt.forms.input.states[$state].borderColor, ({
|
|
1578
|
+
theme
|
|
1579
|
+
}) => {
|
|
1580
|
+
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
1581
|
+
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize}px`;
|
|
1582
|
+
}, ({
|
|
1583
|
+
theme,
|
|
1584
|
+
$state
|
|
1585
|
+
}) => theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color], ({
|
|
1586
|
+
theme
|
|
1587
|
+
}) => theme.kitt.typography.types.bodies.fontFamily.regular);
|
|
1588
|
+
|
|
1589
|
+
const StyledTypographyText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
|
|
1590
|
+
displayName: "DatePickerInputPart__StyledTypographyText",
|
|
1591
|
+
componentId: "kitt-universal__sc-11fmlmi-0"
|
|
1592
|
+
})(["text-align:center;"]);
|
|
1593
|
+
const ViewInput = /*#__PURE__*/styled__default.View.withConfig({
|
|
1594
|
+
displayName: "DatePickerInputPart__ViewInput",
|
|
1595
|
+
componentId: "kitt-universal__sc-11fmlmi-1"
|
|
1596
|
+
})(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, ({
|
|
1597
|
+
theme
|
|
1598
|
+
}) => theme.kitt.forms.input.padding.default, ({
|
|
1599
|
+
theme
|
|
1600
|
+
}) => theme.kitt.forms.input.minHeight, ({
|
|
1601
|
+
theme,
|
|
1602
|
+
$partName
|
|
1603
|
+
}) => {
|
|
1604
|
+
if (!$partName) {
|
|
1605
|
+
return undefined;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
return `${theme.kitt.forms.datePicker[$partName].minWidth}px`;
|
|
1609
|
+
});
|
|
1610
|
+
function DatePickerInputPart({
|
|
1611
|
+
$state,
|
|
1612
|
+
placeholder,
|
|
1613
|
+
value,
|
|
1614
|
+
partName,
|
|
1615
|
+
disabled
|
|
1616
|
+
}) {
|
|
1617
|
+
return /*#__PURE__*/jsxRuntime.jsx(ViewInput, {
|
|
1618
|
+
$state: $state,
|
|
1619
|
+
$partName: partName,
|
|
1620
|
+
children: placeholder || value ? /*#__PURE__*/jsxRuntime.jsx(StyledTypographyText, {
|
|
1621
|
+
color: !value || disabled ? 'black-light' : undefined,
|
|
1622
|
+
children: value || placeholder
|
|
1623
|
+
}) : null
|
|
1624
|
+
});
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
1628
|
+
const OverlayPressable = /*#__PURE__*/styled__default(reactNative.Pressable).withConfig({
|
|
1629
|
+
displayName: "Overlay__OverlayPressable",
|
|
1630
|
+
componentId: "kitt-universal__sc-1cz1gbr-0"
|
|
1631
|
+
})(({
|
|
1632
|
+
theme
|
|
1633
|
+
}) => ({ ...reactNative.StyleSheet.absoluteFillObject,
|
|
1634
|
+
backgroundColor: theme.kitt.colors.overlay.dark
|
|
1635
|
+
}));
|
|
1636
|
+
function Overlay({
|
|
1637
|
+
onPress
|
|
1638
|
+
}) {
|
|
1639
|
+
return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
|
|
1640
|
+
accessibilityRole: "none",
|
|
1641
|
+
onPress: onPress,
|
|
1642
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {})
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
const BodyView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1647
|
+
displayName: "Body__BodyView",
|
|
1648
|
+
componentId: "kitt-universal__sc-17fwpo4-0"
|
|
1649
|
+
})(["padding:", "px ", "px;"], ({
|
|
1650
|
+
theme
|
|
1651
|
+
}) => theme.kitt.spacing * 6, ({
|
|
1652
|
+
theme
|
|
1653
|
+
}) => theme.kitt.spacing * 4);
|
|
1654
|
+
function ModalBody({
|
|
1655
|
+
children
|
|
1656
|
+
}) {
|
|
1657
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
1658
|
+
children: /*#__PURE__*/jsxRuntime.jsx(BodyView, {
|
|
1659
|
+
children: children
|
|
1660
|
+
})
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
const FooterView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1665
|
+
displayName: "Footer__FooterView",
|
|
1666
|
+
componentId: "kitt-universal__sc-1ujq2dc-0"
|
|
1667
|
+
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
|
|
1668
|
+
theme
|
|
1669
|
+
}) => theme.kitt.spacing * 4, ({
|
|
1670
|
+
theme
|
|
1671
|
+
}) => theme.kitt.colors.separator);
|
|
1672
|
+
function ModalFooter({
|
|
1673
|
+
children
|
|
1674
|
+
}) {
|
|
1675
|
+
return /*#__PURE__*/jsxRuntime.jsx(FooterView, {
|
|
1676
|
+
children: children
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
function StyleWebWrapper({
|
|
1681
|
+
as,
|
|
1682
|
+
children,
|
|
1683
|
+
...props
|
|
1684
|
+
}) {
|
|
1685
|
+
if (reactNative.Platform.OS !== 'web') return children;
|
|
1686
|
+
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
1687
|
+
return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
|
|
1688
|
+
children: children
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
// type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
|
|
1693
|
+
// type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
|
|
1694
|
+
// export function withTheme<Props extends { theme: DefaultTheme }, C>(
|
|
1695
|
+
// WrappedComponent: ComponentType<Props> & C,
|
|
1696
|
+
// ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
|
|
1697
|
+
// return function ThemedComponent(props) {
|
|
1698
|
+
// const theme = useTheme();
|
|
1699
|
+
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
1700
|
+
// };
|
|
1701
|
+
// }
|
|
1702
|
+
function withTheme(WrappedComponent) {
|
|
1703
|
+
// eslint-disable-next-line prefer-arrow-callback
|
|
1704
|
+
return /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
1705
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
1706
|
+
return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
|
|
1707
|
+
ref: ref,
|
|
1708
|
+
theme: theme,
|
|
1709
|
+
...props
|
|
1710
|
+
});
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
|
|
1715
|
+
name: "PressableIconButtonWebWrapper",
|
|
1716
|
+
class: "p1nlccvg",
|
|
1717
|
+
vars: {
|
|
1718
|
+
"p1nlccvg-0": [({
|
|
1719
|
+
theme,
|
|
1720
|
+
$isDisabled
|
|
1721
|
+
}) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.hover],
|
|
1722
|
+
"p1nlccvg-2": [({
|
|
1723
|
+
theme,
|
|
1724
|
+
$isDisabled
|
|
1725
|
+
}) => $isDisabled ? 1 : theme.kitt.iconButton.scale.medium.hover],
|
|
1726
|
+
"p1nlccvg-3": [({
|
|
1727
|
+
theme,
|
|
1728
|
+
$isDisabled
|
|
1729
|
+
}) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.active],
|
|
1730
|
+
"p1nlccvg-4": [({
|
|
1731
|
+
theme,
|
|
1732
|
+
$isWhite,
|
|
1733
|
+
$isDisabled
|
|
1734
|
+
}) => {
|
|
1735
|
+
if ($isDisabled) return theme.kitt.iconButton.disabled.backgroundColor;
|
|
1736
|
+
const {
|
|
1737
|
+
white,
|
|
1738
|
+
default: defaultIconButton
|
|
1739
|
+
} = theme.kitt.iconButton;
|
|
1740
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1741
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1742
|
+
}]
|
|
1743
|
+
}
|
|
1744
|
+
}));
|
|
1745
|
+
const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
1746
|
+
displayName: "PressableIconButton__StyledPressableIconButton",
|
|
1747
|
+
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1748
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], ({
|
|
1749
|
+
theme
|
|
1750
|
+
}) => theme.kitt.iconButton.borderRadius, ({
|
|
1751
|
+
theme
|
|
1752
|
+
}) => theme.kitt.iconButton.width, ({
|
|
1753
|
+
theme
|
|
1754
|
+
}) => theme.kitt.iconButton.height, ({
|
|
1755
|
+
theme,
|
|
1756
|
+
disabled
|
|
1757
|
+
}) => {
|
|
1758
|
+
const {
|
|
1759
|
+
iconButton
|
|
1760
|
+
} = theme.kitt;
|
|
1761
|
+
|
|
1762
|
+
if (reactNative.Platform.OS !== 'web') {
|
|
1763
|
+
return undefined;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
const {
|
|
1767
|
+
transition
|
|
1768
|
+
} = iconButton;
|
|
1769
|
+
|
|
1770
|
+
if (disabled) {
|
|
1771
|
+
return `
|
|
1772
|
+
background-color: ${iconButton.disabled.backgroundColor};
|
|
1773
|
+
`;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
return `
|
|
1777
|
+
transition: ${transition.property} ${transition.duration} ${transition.timingFunction};
|
|
1778
|
+
`;
|
|
1779
|
+
});
|
|
1780
|
+
function PressableIconButton({
|
|
1781
|
+
color,
|
|
1782
|
+
disabled,
|
|
1783
|
+
...props
|
|
1784
|
+
}) {
|
|
1785
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
1786
|
+
as: PressableIconButtonWebWrapper,
|
|
1787
|
+
$isWhite: color === 'white',
|
|
1788
|
+
$isDisabled: Boolean(disabled),
|
|
1789
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props,
|
|
1790
|
+
disabled: disabled
|
|
1791
|
+
})
|
|
1792
|
+
});
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
const AnimatedIconButtonBackground = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
|
|
1796
|
+
displayName: "PressableAnimatedContainer__AnimatedIconButtonBackground",
|
|
1797
|
+
componentId: "kitt-universal__sc-xl9ll5-0"
|
|
1798
|
+
})(["background-color:", ";border-radius:", "px;width:", "px;height:", "px;position:absolute;bottom:0;left:0;"], ({
|
|
1799
|
+
theme,
|
|
1800
|
+
color,
|
|
1801
|
+
disabled
|
|
1802
|
+
}) => {
|
|
1803
|
+
const {
|
|
1804
|
+
iconButton
|
|
1805
|
+
} = theme.kitt;
|
|
1806
|
+
if (disabled) return iconButton.disabled.backgroundColor;
|
|
1807
|
+
if (color === 'white') return iconButton.white.pressedBackgroundColor;
|
|
1808
|
+
return iconButton.default.pressedBackgroundColor;
|
|
1809
|
+
}, ({
|
|
1810
|
+
theme
|
|
1811
|
+
}) => theme.kitt.iconButton.borderRadius, ({
|
|
1812
|
+
theme
|
|
1813
|
+
}) => theme.kitt.iconButton.width, ({
|
|
1814
|
+
theme
|
|
1815
|
+
}) => theme.kitt.iconButton.height);
|
|
1816
|
+
const AnimatedViewContainer = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
|
|
1817
|
+
displayName: "PressableAnimatedContainer__AnimatedViewContainer",
|
|
1818
|
+
componentId: "kitt-universal__sc-xl9ll5-1"
|
|
1819
|
+
})(["position:relative;align-items:center;justify-content:center;width:100%;height:100%;"]);
|
|
1820
|
+
function PressableAnimatedContainer({
|
|
1821
|
+
disabled,
|
|
1822
|
+
color = 'black',
|
|
1823
|
+
testID,
|
|
1824
|
+
accessibilityRole = 'button',
|
|
1825
|
+
accessibilityLabel,
|
|
1826
|
+
children,
|
|
1827
|
+
onPress
|
|
1828
|
+
}) {
|
|
1829
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
1830
|
+
const pressed = Animated.useSharedValue(false);
|
|
1831
|
+
const opacityStyles = Animated.useAnimatedStyle(function () {
|
|
1832
|
+
const _f = function () {
|
|
1833
|
+
return {
|
|
1834
|
+
opacity: Animated.withSpring(pressed.value ? 1 : 0)
|
|
1835
|
+
};
|
|
1836
|
+
};
|
|
1837
|
+
|
|
1838
|
+
_f._closure = {
|
|
1839
|
+
withSpring: Animated.withSpring,
|
|
1840
|
+
pressed
|
|
1841
|
+
};
|
|
1842
|
+
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
1843
|
+
_f.__workletHash = 10645190329247;
|
|
1844
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:41)";
|
|
1845
|
+
_f.__optimalization = 2;
|
|
1846
|
+
|
|
1847
|
+
global.__reanimatedWorkletInit(_f);
|
|
1848
|
+
|
|
1849
|
+
return _f;
|
|
1850
|
+
}());
|
|
1851
|
+
const scaleStyles = Animated.useAnimatedStyle(function () {
|
|
1852
|
+
const _f = function () {
|
|
1853
|
+
return {
|
|
1854
|
+
transform: [{
|
|
1855
|
+
scale: Animated.withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base.default)
|
|
1856
|
+
}]
|
|
1857
|
+
};
|
|
1858
|
+
};
|
|
1859
|
+
|
|
1860
|
+
_f._closure = {
|
|
1861
|
+
withSpring: Animated.withSpring,
|
|
1862
|
+
pressed,
|
|
1863
|
+
theme: {
|
|
1864
|
+
kitt: {
|
|
1865
|
+
iconButton: {
|
|
1866
|
+
scale: {
|
|
1867
|
+
base: {
|
|
1868
|
+
active: theme.kitt.iconButton.scale.base.active,
|
|
1869
|
+
default: theme.kitt.iconButton.scale.base.default
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
};
|
|
1876
|
+
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{transform:[{scale:withSpring(pressed.value?theme.kitt.iconButton.scale.base.active:theme.kitt.iconButton.scale.base.default)}]};}}";
|
|
1877
|
+
_f.__workletHash = 13861998831411;
|
|
1878
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (66:39)";
|
|
1879
|
+
_f.__optimalization = 2;
|
|
1880
|
+
|
|
1881
|
+
global.__reanimatedWorkletInit(_f);
|
|
1882
|
+
|
|
1883
|
+
return _f;
|
|
1884
|
+
}());
|
|
1885
|
+
return /*#__PURE__*/jsxRuntime.jsx(PressableIconButton, {
|
|
1886
|
+
accessibilityRole: accessibilityRole,
|
|
1887
|
+
disabled: disabled,
|
|
1888
|
+
color: color,
|
|
1889
|
+
testID: testID,
|
|
1890
|
+
accessibilityLabel: accessibilityLabel,
|
|
1891
|
+
onPress: onPress,
|
|
1892
|
+
onPressIn: () => {
|
|
1893
|
+
pressed.value = true;
|
|
1894
|
+
},
|
|
1895
|
+
onPressOut: () => {
|
|
1896
|
+
pressed.value = false;
|
|
1897
|
+
},
|
|
1898
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(AnimatedViewContainer, {
|
|
1899
|
+
style: disabled ? [{
|
|
1900
|
+
transform: [{
|
|
1901
|
+
scale: 1
|
|
1902
|
+
}]
|
|
1903
|
+
}] : [scaleStyles],
|
|
1904
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedIconButtonBackground, {
|
|
1905
|
+
disabled: disabled,
|
|
1906
|
+
color: color,
|
|
1907
|
+
style: disabled ? [{
|
|
1908
|
+
opacity: 1
|
|
1909
|
+
}] : [opacityStyles]
|
|
1910
|
+
}), children]
|
|
1911
|
+
})
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
const IconButtonContentBorder = /*#__PURE__*/styled__default.View.withConfig({
|
|
1916
|
+
displayName: "IconButton__IconButtonContentBorder",
|
|
1917
|
+
componentId: "kitt-universal__sc-swelbf-0"
|
|
1918
|
+
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], ({
|
|
1919
|
+
theme
|
|
1920
|
+
}) => `${theme.kitt.iconButton.borderWidth}px solid`, ({
|
|
1921
|
+
theme,
|
|
1922
|
+
disabled
|
|
1923
|
+
}) => disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor, ({
|
|
1924
|
+
theme
|
|
1925
|
+
}) => theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth, ({
|
|
1926
|
+
theme
|
|
1927
|
+
}) => theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth, ({
|
|
1928
|
+
theme
|
|
1929
|
+
}) => theme.kitt.iconButton.borderRadius);
|
|
1930
|
+
|
|
1931
|
+
function IconButtonContent({
|
|
1932
|
+
disabled,
|
|
1933
|
+
color,
|
|
1934
|
+
icon
|
|
1935
|
+
}) {
|
|
1936
|
+
return /*#__PURE__*/jsxRuntime.jsx(IconButtonContentBorder, {
|
|
1937
|
+
disabled: disabled,
|
|
1938
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
1939
|
+
color: disabled ? 'black-light' : color,
|
|
1940
|
+
icon: icon
|
|
1941
|
+
})
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
function IconButton({
|
|
1946
|
+
icon,
|
|
1947
|
+
color,
|
|
1948
|
+
disabled,
|
|
1949
|
+
testID,
|
|
1950
|
+
accessibilityLabel,
|
|
1951
|
+
accessibilityRole,
|
|
1952
|
+
onPress
|
|
1953
|
+
}) {
|
|
1954
|
+
return /*#__PURE__*/jsxRuntime.jsx(PressableAnimatedContainer, {
|
|
1955
|
+
color: color,
|
|
1956
|
+
disabled: disabled,
|
|
1957
|
+
testID: testID,
|
|
1958
|
+
accessibilityLabel: accessibilityLabel,
|
|
1959
|
+
accessibilityRole: accessibilityRole,
|
|
1960
|
+
onPress: onPress,
|
|
1961
|
+
children: /*#__PURE__*/jsxRuntime.jsx(IconButtonContent, {
|
|
1962
|
+
disabled: disabled,
|
|
1963
|
+
color: color,
|
|
1964
|
+
icon: icon
|
|
1965
|
+
})
|
|
1966
|
+
});
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
|
|
1970
|
+
|
|
1971
|
+
const HeaderView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1972
|
+
displayName: "Header__HeaderView",
|
|
1973
|
+
componentId: "kitt-universal__sc-1iwabch-0"
|
|
1974
|
+
})(["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;"], ({
|
|
1975
|
+
theme
|
|
1976
|
+
}) => theme.kitt.spacing * 2, ({
|
|
1977
|
+
theme
|
|
1978
|
+
}) => theme.kitt.colors.separator);
|
|
1979
|
+
const LeftIconView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1980
|
+
displayName: "Header__LeftIconView",
|
|
1981
|
+
componentId: "kitt-universal__sc-1iwabch-1"
|
|
1982
|
+
})(["align-self:flex-start;margin-right:", "px;"], ({
|
|
1983
|
+
theme
|
|
1984
|
+
}) => theme.kitt.spacing * 2);
|
|
1985
|
+
const RightIconView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1986
|
+
displayName: "Header__RightIconView",
|
|
1987
|
+
componentId: "kitt-universal__sc-1iwabch-2"
|
|
1988
|
+
})(["align-self:flex-start;margin-left:", "px;"], ({
|
|
1989
|
+
theme
|
|
1990
|
+
}) => theme.kitt.spacing * 2);
|
|
1991
|
+
const TitleView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1992
|
+
displayName: "Header__TitleView",
|
|
1993
|
+
componentId: "kitt-universal__sc-1iwabch-3"
|
|
1994
|
+
})(["padding-left:", "px;flex-shrink:1;"], ({
|
|
1995
|
+
theme,
|
|
1996
|
+
isIconLeft
|
|
1997
|
+
}) => isIconLeft ? 0 : theme.kitt.spacing * 2);
|
|
1998
|
+
function ModalHeader({
|
|
1999
|
+
left,
|
|
2000
|
+
right,
|
|
2001
|
+
children
|
|
2002
|
+
}) {
|
|
2003
|
+
const onClose = react.useContext(OnCloseContext);
|
|
2004
|
+
const isIconLeft = !!left;
|
|
2005
|
+
return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
|
|
2006
|
+
children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
|
|
2007
|
+
children: left
|
|
2008
|
+
}), /*#__PURE__*/jsxRuntime.jsx(TitleView, {
|
|
2009
|
+
isIconLeft: isIconLeft,
|
|
2010
|
+
children: children
|
|
2011
|
+
}), right !== undefined ? right : /*#__PURE__*/jsxRuntime.jsx(RightIconView, {
|
|
2012
|
+
children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
|
|
2013
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
|
|
2014
|
+
onPress: onClose
|
|
2015
|
+
})
|
|
2016
|
+
})]
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
const ModalView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2021
|
+
displayName: "Modal__ModalView",
|
|
2022
|
+
componentId: "kitt-universal__sc-1xy2w5u-0"
|
|
2023
|
+
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
|
|
2024
|
+
theme
|
|
2025
|
+
}) => theme.kitt.spacing * 20, ({
|
|
2026
|
+
theme
|
|
2027
|
+
}) => theme.kitt.spacing * 4);
|
|
2028
|
+
const ContentView$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
2029
|
+
displayName: "Modal__ContentView",
|
|
2030
|
+
componentId: "kitt-universal__sc-1xy2w5u-1"
|
|
2031
|
+
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], ({
|
|
2032
|
+
theme
|
|
2033
|
+
}) => theme.kitt.card.borderRadius, ({
|
|
2034
|
+
theme
|
|
2035
|
+
}) => theme.kitt.colors.uiBackgroundLight);
|
|
2036
|
+
function Modal({
|
|
2037
|
+
visible,
|
|
2038
|
+
children,
|
|
2039
|
+
onClose,
|
|
2040
|
+
onEntered,
|
|
2041
|
+
onExited
|
|
2042
|
+
}) {
|
|
2043
|
+
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
|
|
2044
|
+
value: onClose,
|
|
2045
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Modal, {
|
|
2046
|
+
transparent: true,
|
|
2047
|
+
animationType: "fade",
|
|
2048
|
+
visible: visible,
|
|
2049
|
+
onShow: onEntered,
|
|
2050
|
+
onDismiss: onExited,
|
|
2051
|
+
onRequestClose: onClose,
|
|
2052
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
|
|
2053
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
|
|
2054
|
+
onPress: onClose
|
|
2055
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ContentView$1, {
|
|
2056
|
+
children: children
|
|
2057
|
+
})]
|
|
2058
|
+
})
|
|
2059
|
+
})
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
Modal.Header = ModalHeader;
|
|
2063
|
+
Modal.Body = ModalBody;
|
|
2064
|
+
Modal.Footer = ModalFooter;
|
|
2065
|
+
|
|
2066
|
+
function getDatePickerDisplayMode() {
|
|
2067
|
+
if (reactNative.Platform.OS === 'android') return 'calendar';
|
|
2068
|
+
if (reactNative.Platform.OS === 'ios') return 'spinner';
|
|
2069
|
+
return 'default';
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
function PlatformDateTimePicker({
|
|
2073
|
+
value,
|
|
2074
|
+
defaultDate = new Date(),
|
|
2075
|
+
maximumDate,
|
|
2076
|
+
minimuDate,
|
|
2077
|
+
testID,
|
|
2078
|
+
onChange
|
|
2079
|
+
}) {
|
|
2080
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
2081
|
+
const displayMode = getDatePickerDisplayMode();
|
|
2082
|
+
const iosProps = reactNative.Platform.OS === 'ios' ? {
|
|
2083
|
+
textColor: theme.kitt.colors.primary
|
|
2084
|
+
} : {};
|
|
2085
|
+
return /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
2086
|
+
is24Hour: true,
|
|
2087
|
+
testID: testID,
|
|
2088
|
+
value: value || defaultDate,
|
|
2089
|
+
mode: "date",
|
|
2090
|
+
maximumDate: maximumDate,
|
|
2091
|
+
minimumDate: minimuDate,
|
|
2092
|
+
display: displayMode,
|
|
2093
|
+
...iosProps,
|
|
2094
|
+
onChange: (_event, date) => onChange(date)
|
|
2095
|
+
});
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
function ModalTitle({
|
|
2099
|
+
children
|
|
2100
|
+
}) {
|
|
2101
|
+
return /*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
|
|
2102
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
2103
|
+
base: "body",
|
|
2104
|
+
variant: "bold",
|
|
2105
|
+
children: children
|
|
2106
|
+
})
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
function ModalPlatformDateTimePicker({
|
|
2111
|
+
title,
|
|
2112
|
+
isVisible,
|
|
2113
|
+
value,
|
|
2114
|
+
validateButtonLabel,
|
|
2115
|
+
onClose,
|
|
2116
|
+
onChange,
|
|
2117
|
+
...props
|
|
2118
|
+
}) {
|
|
2119
|
+
const [currentValue, setCurrentValue] = react.useState(value); // Prevent unsynced value between the modal and its parent state
|
|
2120
|
+
|
|
2121
|
+
return /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
2122
|
+
visible: Boolean(isVisible),
|
|
2123
|
+
onClose: () => {
|
|
2124
|
+
setCurrentValue(value);
|
|
2125
|
+
onClose();
|
|
2126
|
+
},
|
|
2127
|
+
children: isVisible ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2128
|
+
children: [title ? /*#__PURE__*/jsxRuntime.jsx(ModalTitle, {
|
|
2129
|
+
children: title
|
|
2130
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
|
|
2131
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PlatformDateTimePicker, { ...props,
|
|
2132
|
+
value: currentValue,
|
|
2133
|
+
onChange: newDate => {
|
|
2134
|
+
setCurrentValue(prev => {
|
|
2135
|
+
return newDate || prev;
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
})
|
|
2139
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
|
|
2140
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2141
|
+
stretch: true,
|
|
2142
|
+
type: "primary",
|
|
2143
|
+
onPress: () => {
|
|
2144
|
+
onChange(currentValue);
|
|
2145
|
+
},
|
|
2146
|
+
children: validateButtonLabel ? /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
2147
|
+
children: validateButtonLabel
|
|
2148
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
|
|
2149
|
+
id: "kitt-universal.ModalDateTimePicker.confirm"
|
|
2150
|
+
})
|
|
2151
|
+
})
|
|
2152
|
+
})]
|
|
2153
|
+
}) : null
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
function prefixWithZero(value) {
|
|
2158
|
+
return `${value}`.padStart(2, '0');
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
const PartContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2162
|
+
displayName: "DatePicker__PartContainer",
|
|
2163
|
+
componentId: "kitt-universal__sc-ebllsn-0"
|
|
2164
|
+
})(["margin-right:", ";", ";"], ({
|
|
2165
|
+
theme,
|
|
2166
|
+
$isLast
|
|
2167
|
+
}) => !$isLast ? `${theme.kitt.spacing * 2}px` : 0, ({
|
|
2168
|
+
$isStretch
|
|
2169
|
+
}) => $isStretch ? styled.css(["flex:0.33;flex-grow:1;"]) : undefined);
|
|
2170
|
+
const DatePickerPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
2171
|
+
displayName: "DatePicker__DatePickerPressable",
|
|
2172
|
+
componentId: "kitt-universal__sc-ebllsn-1"
|
|
2173
|
+
})(["display:flex;flex-direction:row;", ";"], ({
|
|
2174
|
+
$isStretch
|
|
2175
|
+
}) => {
|
|
2176
|
+
if ($isStretch) {
|
|
2177
|
+
return styled.css(["width:100%;"]);
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
return styled.css(["align-self:baseline;"]);
|
|
2181
|
+
});
|
|
2182
|
+
function DatePicker({
|
|
2183
|
+
value,
|
|
2184
|
+
id,
|
|
2185
|
+
disabled,
|
|
2186
|
+
placeholder,
|
|
2187
|
+
state,
|
|
2188
|
+
internalForceState,
|
|
2189
|
+
testID,
|
|
2190
|
+
stretch,
|
|
2191
|
+
pickerDefaultDate,
|
|
2192
|
+
pickerUITestID,
|
|
2193
|
+
pickerUITitle,
|
|
2194
|
+
pickerUIValidateButtonLabel,
|
|
2195
|
+
onChange,
|
|
2196
|
+
onFocus,
|
|
2197
|
+
onBlur
|
|
2198
|
+
}) {
|
|
2199
|
+
const [isPickerUIVisible, setIsPickerUIVisible] = react.useState(false);
|
|
2200
|
+
const [isFocused, setIsFocused] = react.useState(false);
|
|
2201
|
+
const [currentValue, setCurrentValue] = react.useState(value);
|
|
2202
|
+
|
|
2203
|
+
const handleModalClose = () => {
|
|
2204
|
+
if (onBlur) onBlur();
|
|
2205
|
+
setIsPickerUIVisible(false);
|
|
2206
|
+
setIsFocused(false);
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2209
|
+
const handleChange = newDate => {
|
|
2210
|
+
setCurrentValue(newDate);
|
|
2211
|
+
onChange(newDate);
|
|
2212
|
+
handleModalClose();
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
const currentState = internalForceState || getInputUIState({
|
|
2216
|
+
isFocused,
|
|
2217
|
+
isDisabled: Boolean(disabled),
|
|
2218
|
+
formState: state
|
|
2219
|
+
});
|
|
2220
|
+
const sharedPickerProps = {
|
|
2221
|
+
testID: pickerUITestID,
|
|
2222
|
+
value: currentValue,
|
|
2223
|
+
onChange: handleChange
|
|
2224
|
+
};
|
|
2225
|
+
const sharedPartProps = {
|
|
2226
|
+
disabled,
|
|
2227
|
+
$state: currentState,
|
|
2228
|
+
defaultDate: pickerDefaultDate
|
|
2229
|
+
};
|
|
2230
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2231
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(DatePickerPressable, {
|
|
2232
|
+
$isStretch: stretch,
|
|
2233
|
+
nativeID: id,
|
|
2234
|
+
disabled: disabled,
|
|
2235
|
+
testID: testID,
|
|
2236
|
+
onPress: () => {
|
|
2237
|
+
if (onFocus) onFocus();
|
|
2238
|
+
setIsPickerUIVisible(true);
|
|
2239
|
+
setIsFocused(true);
|
|
2240
|
+
},
|
|
2241
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
2242
|
+
$isStretch: stretch,
|
|
2243
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
|
|
2244
|
+
partName: "day",
|
|
2245
|
+
value: currentValue ? prefixWithZero(currentValue.getDate()) : undefined,
|
|
2246
|
+
placeholder: placeholder?.day
|
|
2247
|
+
})
|
|
2248
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
2249
|
+
$isStretch: stretch,
|
|
2250
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
|
|
2251
|
+
partName: "month",
|
|
2252
|
+
value: currentValue ? prefixWithZero(currentValue.getMonth() + 1) : undefined,
|
|
2253
|
+
placeholder: placeholder?.month
|
|
2254
|
+
})
|
|
2255
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
2256
|
+
$isLast: true,
|
|
2257
|
+
$isStretch: stretch,
|
|
2258
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
|
|
2259
|
+
partName: "year",
|
|
2260
|
+
value: currentValue?.getFullYear(),
|
|
2261
|
+
placeholder: placeholder?.year
|
|
2262
|
+
})
|
|
2263
|
+
})]
|
|
2264
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2265
|
+
children: [reactNative.Platform.OS === 'android' && isPickerUIVisible ? /*#__PURE__*/jsxRuntime.jsx(PlatformDateTimePicker, { ...sharedPickerProps
|
|
2266
|
+
}) : null, reactNative.Platform.OS !== 'android' ? /*#__PURE__*/jsxRuntime.jsx(ModalPlatformDateTimePicker, { ...sharedPickerProps,
|
|
2267
|
+
isVisible: isPickerUIVisible,
|
|
2268
|
+
title: pickerUITitle,
|
|
2269
|
+
validateButtonLabel: pickerUIValidateButtonLabel,
|
|
2270
|
+
onClose: handleModalClose,
|
|
2271
|
+
onChange: handleChange
|
|
2272
|
+
}) : null]
|
|
2273
|
+
})]
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
const InputTextContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2278
|
+
displayName: "InputTextContainer",
|
|
2279
|
+
componentId: "kitt-universal__sc-8j6fjq-0"
|
|
2280
|
+
})(["position:relative;"]);
|
|
2281
|
+
|
|
2282
|
+
const StyledTextInput = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
|
|
2283
|
+
displayName: "InputText__StyledTextInput",
|
|
2284
|
+
componentId: "kitt-universal__sc-uke279-0"
|
|
2285
|
+
})(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, ({
|
|
2286
|
+
theme,
|
|
2287
|
+
multiline
|
|
2288
|
+
}) => {
|
|
2289
|
+
if (!multiline && reactNative.Platform.OS === 'ios') {
|
|
2290
|
+
return theme.kitt.forms.input.padding.iOSSingleLine;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
return theme.kitt.forms.input.padding.default;
|
|
2294
|
+
}, ({
|
|
2295
|
+
theme,
|
|
2296
|
+
multiline
|
|
2297
|
+
}) => {
|
|
2298
|
+
if (!multiline && reactNative.Platform.OS === 'ios') return 0;
|
|
2299
|
+
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
2300
|
+
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
|
|
2301
|
+
}, ({
|
|
2302
|
+
$minHeight
|
|
2303
|
+
}) => $minHeight);
|
|
2304
|
+
const RightInputContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2305
|
+
displayName: "InputText__RightInputContainer",
|
|
2306
|
+
componentId: "kitt-universal__sc-uke279-1"
|
|
2307
|
+
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
2308
|
+
const InputText = /*#__PURE__*/react.forwardRef(({
|
|
2309
|
+
id,
|
|
2310
|
+
right,
|
|
2311
|
+
minHeight = 0,
|
|
2312
|
+
state: formState,
|
|
2313
|
+
internalForceState,
|
|
2314
|
+
disabled = false,
|
|
2315
|
+
autoCorrect = true,
|
|
2316
|
+
textContentType = 'none',
|
|
2317
|
+
autoCompleteType = 'off',
|
|
2318
|
+
keyboardType = 'default',
|
|
2319
|
+
onFocus,
|
|
2320
|
+
onBlur,
|
|
2321
|
+
...props
|
|
2322
|
+
}, ref) => {
|
|
2323
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
2324
|
+
const [isFocused, setIsFocused] = react.useState(false);
|
|
2325
|
+
const state = internalForceState || getInputUIState({
|
|
2326
|
+
isFocused,
|
|
2327
|
+
isDisabled: disabled,
|
|
2328
|
+
formState
|
|
2329
|
+
});
|
|
2330
|
+
return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
|
|
2331
|
+
$isDisabled: disabled,
|
|
2332
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StyledTextInput, {
|
|
2333
|
+
ref: ref,
|
|
2334
|
+
nativeID: id,
|
|
2335
|
+
editable: !disabled,
|
|
2336
|
+
keyboardType: keyboardType,
|
|
2337
|
+
autoCompleteType: autoCompleteType,
|
|
2338
|
+
autoCorrect: autoCorrect,
|
|
2339
|
+
$minHeight: minHeight,
|
|
2340
|
+
textContentType: textContentType,
|
|
2341
|
+
placeholderTextColor: theme.kitt.forms.input.color.placeholder,
|
|
2342
|
+
selectionColor: theme.kitt.forms.input.color.selection,
|
|
2343
|
+
...props,
|
|
2344
|
+
$state: state,
|
|
2345
|
+
onFocus: e => {
|
|
2346
|
+
setIsFocused(true);
|
|
2347
|
+
if (onFocus) onFocus(e);
|
|
2348
|
+
},
|
|
2349
|
+
onBlur: e => {
|
|
2350
|
+
setIsFocused(false);
|
|
2351
|
+
if (onBlur) onBlur(e);
|
|
2352
|
+
}
|
|
2353
|
+
}), right ? /*#__PURE__*/jsxRuntime.jsx(RightInputContainer, {
|
|
2354
|
+
children: right
|
|
2355
|
+
}) : null]
|
|
2356
|
+
});
|
|
2357
|
+
});
|
|
2358
|
+
|
|
2359
|
+
function InputEmail(props) {
|
|
2360
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
2361
|
+
autoCompleteType: "email",
|
|
2362
|
+
keyboardType: "email-address",
|
|
2363
|
+
textContentType: "emailAddress",
|
|
2364
|
+
...props
|
|
2365
|
+
});
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
const getColorFromState = state => {
|
|
2369
|
+
switch (state) {
|
|
2370
|
+
case 'invalid':
|
|
2371
|
+
return 'danger';
|
|
2372
|
+
|
|
2373
|
+
case 'valid':
|
|
2374
|
+
default:
|
|
2375
|
+
return 'black-light';
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
|
|
2379
|
+
function InputFeedback({
|
|
2380
|
+
state,
|
|
2381
|
+
testID,
|
|
2382
|
+
children
|
|
2383
|
+
}) {
|
|
2384
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
2385
|
+
base: "body-small",
|
|
2386
|
+
color: getColorFromState(state),
|
|
2387
|
+
testID: testID,
|
|
2388
|
+
children: children
|
|
2389
|
+
});
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
const FieldContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2393
|
+
displayName: "InputField__FieldContainer",
|
|
2394
|
+
componentId: "kitt-universal__sc-13fkixs-0"
|
|
2395
|
+
})(["padding:5px 0 10px;"]);
|
|
2396
|
+
const FeedbackContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2397
|
+
displayName: "InputField__FeedbackContainer",
|
|
2398
|
+
componentId: "kitt-universal__sc-13fkixs-1"
|
|
2399
|
+
})(["", ";"], ({
|
|
2400
|
+
theme
|
|
2401
|
+
}) => theme.responsive.ifWindowSizeMatches({
|
|
2402
|
+
minWidth: KittBreakpoints.SMALL
|
|
2403
|
+
}, 'padding-top: 10px', 'padding-top: 5px'));
|
|
2404
|
+
const FieldLabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2405
|
+
displayName: "InputField__FieldLabelContainer",
|
|
2406
|
+
componentId: "kitt-universal__sc-13fkixs-2"
|
|
2407
|
+
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
|
|
2408
|
+
theme
|
|
2409
|
+
}) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
|
|
2410
|
+
const LabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2411
|
+
displayName: "InputField__LabelContainer",
|
|
2412
|
+
componentId: "kitt-universal__sc-13fkixs-3"
|
|
2413
|
+
})(["margin-right:", "px;"], ({
|
|
2414
|
+
theme
|
|
2415
|
+
}) => theme.kitt.forms.inputField.iconMarginLeft);
|
|
2416
|
+
function InputField({
|
|
2417
|
+
label,
|
|
2418
|
+
labelFeedback,
|
|
2419
|
+
input,
|
|
2420
|
+
feedback
|
|
2421
|
+
}) {
|
|
2422
|
+
return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
|
|
2423
|
+
children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
|
|
2424
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(LabelContainer, {
|
|
2425
|
+
children: label
|
|
2426
|
+
}), labelFeedback]
|
|
2427
|
+
}) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(FeedbackContainer, {
|
|
2428
|
+
children: feedback
|
|
2429
|
+
}) : null]
|
|
2430
|
+
});
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
function getIconColor(state, disabled) {
|
|
2434
|
+
if (disabled) return 'black-light';
|
|
2435
|
+
|
|
2436
|
+
switch (state) {
|
|
2437
|
+
case 'invalid':
|
|
2438
|
+
return 'danger';
|
|
2439
|
+
|
|
2440
|
+
case 'valid':
|
|
2441
|
+
return 'success';
|
|
2442
|
+
|
|
2443
|
+
default:
|
|
2444
|
+
return undefined;
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
1102
2447
|
|
|
1103
2448
|
function InputIcon({
|
|
1104
2449
|
icon,
|
|
@@ -1141,6 +2486,66 @@ function InputPassword({
|
|
|
1141
2486
|
});
|
|
1142
2487
|
}
|
|
1143
2488
|
|
|
2489
|
+
function InputPhone(props) {
|
|
2490
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputText, { ...props,
|
|
2491
|
+
autoCompleteType: "tel",
|
|
2492
|
+
keyboardType: "number-pad",
|
|
2493
|
+
textContentType: "telephoneNumber"
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
const getTypographyColor = type => type ? 'white' : 'black';
|
|
2498
|
+
|
|
2499
|
+
const InputTagContainer = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
2500
|
+
displayName: "InputTag__InputTagContainer",
|
|
2501
|
+
componentId: "kitt-universal__sc-1511dsf-0"
|
|
2502
|
+
})(["align-items:center;justify-content:center;flex-direction:row;align-self:flex-start;overflow:hidden;padding-horizontal:", "px;background-color:", ";border-radius:", "px;"], ({
|
|
2503
|
+
theme
|
|
2504
|
+
}) => theme.kitt.spacing * 2, ({
|
|
2505
|
+
theme,
|
|
2506
|
+
type
|
|
2507
|
+
}) => {
|
|
2508
|
+
if (type === 'success') {
|
|
2509
|
+
return theme.kitt.forms.inputTag.success.backgroundColor;
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
if (type === 'danger') {
|
|
2513
|
+
return theme.kitt.forms.inputTag.danger.backgroundColor;
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
return theme.kitt.forms.inputTag.default.backgroundColor;
|
|
2517
|
+
}, ({
|
|
2518
|
+
theme
|
|
2519
|
+
}) => theme.kitt.forms.inputTag.borderRadius);
|
|
2520
|
+
const IconContainer = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
2521
|
+
displayName: "InputTag__IconContainer",
|
|
2522
|
+
componentId: "kitt-universal__sc-1511dsf-1"
|
|
2523
|
+
})(["margin-right:", "px;"], ({
|
|
2524
|
+
theme
|
|
2525
|
+
}) => theme.kitt.spacing);
|
|
2526
|
+
function InputTag({
|
|
2527
|
+
children,
|
|
2528
|
+
type,
|
|
2529
|
+
icon
|
|
2530
|
+
}) {
|
|
2531
|
+
const typographyColor = getTypographyColor(type);
|
|
2532
|
+
const theme = useKittTheme();
|
|
2533
|
+
return /*#__PURE__*/jsxRuntime.jsxs(InputTagContainer, {
|
|
2534
|
+
type: type,
|
|
2535
|
+
children: [icon && /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
|
|
2536
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
2537
|
+
icon: icon,
|
|
2538
|
+
size: theme.kitt.forms.inputTag.iconSize,
|
|
2539
|
+
color: typographyColor
|
|
2540
|
+
})
|
|
2541
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
2542
|
+
base: "body-small",
|
|
2543
|
+
color: typographyColor,
|
|
2544
|
+
children: children
|
|
2545
|
+
})]
|
|
2546
|
+
});
|
|
2547
|
+
}
|
|
2548
|
+
|
|
1144
2549
|
function Label({
|
|
1145
2550
|
htmlFor,
|
|
1146
2551
|
children
|
|
@@ -1235,458 +2640,169 @@ function Radio({
|
|
|
1235
2640
|
});
|
|
1236
2641
|
}
|
|
1237
2642
|
|
|
1238
|
-
function TextArea({ ...props
|
|
1239
|
-
}) {
|
|
1240
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
1241
|
-
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
1242
|
-
multiline: true,
|
|
1243
|
-
textAlignVertical: "top",
|
|
1244
|
-
minHeight: theme.kitt.forms.textArea.minHeight,
|
|
1245
|
-
...props
|
|
1246
|
-
});
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
const Body = /*#__PURE__*/styled__default.View.withConfig({
|
|
1250
|
-
displayName: "Body",
|
|
1251
|
-
componentId: "kitt-universal__sc-1ofncfn-0"
|
|
1252
|
-
})(["", " background-color:", ";flex:1;"], ({
|
|
1253
|
-
theme
|
|
1254
|
-
}) => theme.responsive.ifWindowSizeMatches({
|
|
1255
|
-
minWidth: KittBreakpoints.MEDIUM
|
|
1256
|
-
}, `padding-right: ${theme.kitt.spacing * 12}px;
|
|
1257
|
-
padding-left: ${theme.kitt.spacing * 12}px;`, `padding-right: ${theme.kitt.spacing * 6}px;
|
|
1258
|
-
padding-left: ${theme.kitt.spacing * 6}px;`), ({
|
|
1259
|
-
theme
|
|
1260
|
-
}) => theme.kitt.colors.uiBackgroundLight);
|
|
1261
|
-
function FullScreenModalBody({
|
|
1262
|
-
children
|
|
1263
|
-
}) {
|
|
1264
|
-
return /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
1265
|
-
children: children
|
|
1266
|
-
});
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
const SideContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1270
|
-
displayName: "Header__SideContainer",
|
|
1271
|
-
componentId: "kitt-universal__sc-dfmxi1-0"
|
|
1272
|
-
})(["", ""], ({
|
|
1273
|
-
theme,
|
|
1274
|
-
side = 'left'
|
|
1275
|
-
}) => {
|
|
1276
|
-
const padding = theme.kitt.spacing * 2;
|
|
1277
|
-
|
|
1278
|
-
if (side === 'left') {
|
|
1279
|
-
return `padding-right: ${padding}px;`;
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
return `padding-left: ${padding}px;`;
|
|
1283
|
-
});
|
|
1284
|
-
|
|
1285
|
-
function getHeaderHorizontalMediumPadding(spacing) {
|
|
1286
|
-
return spacing * 6;
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
const Header = /*#__PURE__*/styled__default.View.withConfig({
|
|
1290
|
-
displayName: "Header",
|
|
1291
|
-
componentId: "kitt-universal__sc-dfmxi1-1"
|
|
1292
|
-
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
|
|
1293
|
-
theme,
|
|
1294
|
-
insetTop = 0
|
|
1295
|
-
}) => {
|
|
1296
|
-
const paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
|
|
1297
|
-
const {
|
|
1298
|
-
paddingVertical,
|
|
1299
|
-
paddingHorizontal
|
|
1300
|
-
} = theme.kitt.fullScreenModal.header;
|
|
1301
|
-
return theme.responsive.ifWindowSizeMatches({
|
|
1302
|
-
minWidth: KittBreakpoints.MEDIUM
|
|
1303
|
-
}, `padding: ${paddingTop}px ${getHeaderHorizontalMediumPadding(theme.kitt.spacing)}px ${paddingVertical}px;`, `padding: ${paddingTop}px ${paddingHorizontal}px ${paddingVertical}px;`);
|
|
1304
|
-
}, ({
|
|
1305
|
-
theme
|
|
1306
|
-
}) => theme.kitt.fullScreenModal.header.borderColor);
|
|
1307
|
-
const HeaderContent = /*#__PURE__*/styled__default.View.withConfig({
|
|
1308
|
-
displayName: "Header__HeaderContent",
|
|
1309
|
-
componentId: "kitt-universal__sc-dfmxi1-2"
|
|
1310
|
-
})(["", ";", ";justify-content:center;align-items:center;"], ({
|
|
1311
|
-
theme,
|
|
1312
|
-
leftWidth,
|
|
1313
|
-
rightWidth,
|
|
1314
|
-
windowWidth
|
|
1315
|
-
}) => {
|
|
1316
|
-
/*
|
|
1317
|
-
* Since we don't have controll over the rendered left and right elements,
|
|
1318
|
-
* we must apply some logic to give the title all the available space
|
|
1319
|
-
*/
|
|
1320
|
-
const sideElementMaxWidth = Math.max(leftWidth, rightWidth);
|
|
1321
|
-
const parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
|
|
1322
|
-
const parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
|
|
1323
|
-
|
|
1324
|
-
const computeWidth = breakpointPadding => windowWidth - breakpointPadding - sideElementMaxWidth * 2;
|
|
1325
|
-
|
|
1326
|
-
return theme.responsive.ifWindowSizeMatches({
|
|
1327
|
-
minWidth: KittBreakpoints.MEDIUM
|
|
1328
|
-
}, `width: ${computeWidth(parentHorizontalPaddingMedium)}px;`, `width: ${computeWidth(parentHorizontalPadding)}px;`);
|
|
1329
|
-
}, ({
|
|
1330
|
-
leftWidth,
|
|
1331
|
-
rightWidth
|
|
1332
|
-
}) => {
|
|
1333
|
-
// Depending of the wider element, we must add a margin to fill the diff in space between elements
|
|
1334
|
-
const deltaMargin = Math.abs(leftWidth - rightWidth);
|
|
1335
|
-
|
|
1336
|
-
if (leftWidth > rightWidth) {
|
|
1337
|
-
return `margin-right: ${deltaMargin}px;`;
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
return `margin-left: ${deltaMargin}px;`;
|
|
1341
|
-
});
|
|
1342
|
-
function FullScreenModalHeader({
|
|
1343
|
-
children,
|
|
1344
|
-
right,
|
|
1345
|
-
left
|
|
1346
|
-
}) {
|
|
1347
|
-
const {
|
|
1348
|
-
top
|
|
1349
|
-
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
1350
|
-
const dimensions = reactNative.useWindowDimensions();
|
|
1351
|
-
const [leftWidth, setLeftWidth] = react.useState(0);
|
|
1352
|
-
const [rightWidth, setRightWidth] = react.useState(0);
|
|
1353
|
-
|
|
1354
|
-
const handleLayoutChange = (event, side) => {
|
|
1355
|
-
// Prevents react to nullify event on rerenders
|
|
1356
|
-
event.persist();
|
|
1357
|
-
|
|
1358
|
-
if (side === 'left') {
|
|
1359
|
-
setLeftWidth(event.nativeEvent.layout.width);
|
|
1360
|
-
return;
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
setRightWidth(event.nativeEvent.layout.width);
|
|
1364
|
-
};
|
|
1365
|
-
|
|
1366
|
-
return /*#__PURE__*/jsxRuntime.jsxs(Header, {
|
|
1367
|
-
insetTop: reactNative.Platform.OS === 'ios' ? undefined : top,
|
|
1368
|
-
children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
1369
|
-
onLayout: e => handleLayoutChange(e, 'left'),
|
|
1370
|
-
children: left
|
|
1371
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsx(HeaderContent, {
|
|
1372
|
-
windowWidth: dimensions.width,
|
|
1373
|
-
leftWidth: leftWidth,
|
|
1374
|
-
rightWidth: rightWidth,
|
|
1375
|
-
children: children
|
|
1376
|
-
}), right ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
1377
|
-
side: "right",
|
|
1378
|
-
onLayout: e => handleLayoutChange(e, 'right'),
|
|
1379
|
-
children: right
|
|
1380
|
-
}) : null]
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
|
|
1385
|
-
displayName: "FullScreenModal__Container",
|
|
1386
|
-
componentId: "kitt-universal__sc-11qpbe3-0"
|
|
1387
|
-
})(["flex:1;background-color:", ";"], ({
|
|
1388
|
-
theme
|
|
1389
|
-
}) => theme.kitt.colors.uiBackground);
|
|
1390
|
-
function FullScreenModal({
|
|
1391
|
-
children
|
|
1392
|
-
}) {
|
|
1393
|
-
return /*#__PURE__*/jsxRuntime.jsx(Container$3, {
|
|
1394
|
-
children: children
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
FullScreenModal.Header = FullScreenModalHeader;
|
|
1398
|
-
FullScreenModal.Body = FullScreenModalBody;
|
|
1399
|
-
|
|
1400
|
-
function StyleWebWrapper({
|
|
1401
|
-
as,
|
|
1402
|
-
children,
|
|
1403
|
-
...props
|
|
1404
|
-
}) {
|
|
1405
|
-
if (reactNative.Platform.OS !== 'web') return children;
|
|
1406
|
-
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
1407
|
-
return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
|
|
1408
|
-
children: children
|
|
1409
|
-
});
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
// type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
|
|
1413
|
-
// type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
|
|
1414
|
-
// export function withTheme<Props extends { theme: DefaultTheme }, C>(
|
|
1415
|
-
// WrappedComponent: ComponentType<Props> & C,
|
|
1416
|
-
// ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
|
|
1417
|
-
// return function ThemedComponent(props) {
|
|
1418
|
-
// const theme = useTheme();
|
|
1419
|
-
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
1420
|
-
// };
|
|
1421
|
-
// }
|
|
1422
|
-
function withTheme(WrappedComponent) {
|
|
1423
|
-
// eslint-disable-next-line prefer-arrow-callback
|
|
1424
|
-
return /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
1425
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
1426
|
-
return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
|
|
1427
|
-
ref: ref,
|
|
1428
|
-
theme: theme,
|
|
1429
|
-
...props
|
|
1430
|
-
});
|
|
1431
|
-
});
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
|
|
1435
|
-
name: "PressableIconButtonWebWrapper",
|
|
1436
|
-
class: "p1nlccvg",
|
|
1437
|
-
vars: {
|
|
1438
|
-
"p1nlccvg-0": [({
|
|
1439
|
-
theme,
|
|
1440
|
-
$isDisabled
|
|
1441
|
-
}) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.hover],
|
|
1442
|
-
"p1nlccvg-2": [({
|
|
1443
|
-
theme,
|
|
1444
|
-
$isDisabled
|
|
1445
|
-
}) => $isDisabled ? 1 : theme.kitt.iconButton.scale.medium.hover],
|
|
1446
|
-
"p1nlccvg-3": [({
|
|
1447
|
-
theme,
|
|
1448
|
-
$isDisabled
|
|
1449
|
-
}) => $isDisabled ? 1 : theme.kitt.iconButton.scale.base.active],
|
|
1450
|
-
"p1nlccvg-4": [({
|
|
1451
|
-
theme,
|
|
1452
|
-
$isWhite,
|
|
1453
|
-
$isDisabled
|
|
1454
|
-
}) => {
|
|
1455
|
-
if ($isDisabled) return theme.kitt.iconButton.disabled.backgroundColor;
|
|
1456
|
-
const {
|
|
1457
|
-
white,
|
|
1458
|
-
default: defaultIconButton
|
|
1459
|
-
} = theme.kitt.iconButton;
|
|
1460
|
-
if ($isWhite) return white.pressedBackgroundColor;
|
|
1461
|
-
return defaultIconButton.pressedBackgroundColor;
|
|
1462
|
-
}]
|
|
1463
|
-
}
|
|
1464
|
-
}));
|
|
1465
|
-
const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
1466
|
-
displayName: "PressableIconButton__StyledPressableIconButton",
|
|
1467
|
-
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1468
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], ({
|
|
1469
|
-
theme
|
|
1470
|
-
}) => theme.kitt.iconButton.borderRadius, ({
|
|
2643
|
+
function TextArea({ ...props
|
|
2644
|
+
}) {
|
|
2645
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
2646
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
2647
|
+
multiline: true,
|
|
2648
|
+
textAlignVertical: "top",
|
|
2649
|
+
minHeight: theme.kitt.forms.textArea.minHeight,
|
|
2650
|
+
...props
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2654
|
+
const Body = /*#__PURE__*/styled__default.View.withConfig({
|
|
2655
|
+
displayName: "Body",
|
|
2656
|
+
componentId: "kitt-universal__sc-1ofncfn-0"
|
|
2657
|
+
})(["", " background-color:", ";flex:1;"], ({
|
|
1471
2658
|
theme
|
|
1472
|
-
}) => theme.
|
|
2659
|
+
}) => theme.responsive.ifWindowSizeMatches({
|
|
2660
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
2661
|
+
}, `padding-right: ${theme.kitt.spacing * 12}px;
|
|
2662
|
+
padding-left: ${theme.kitt.spacing * 12}px;`, `padding-right: ${theme.kitt.spacing * 6}px;
|
|
2663
|
+
padding-left: ${theme.kitt.spacing * 6}px;`), ({
|
|
1473
2664
|
theme
|
|
1474
|
-
}) => theme.kitt.
|
|
2665
|
+
}) => theme.kitt.colors.uiBackgroundLight);
|
|
2666
|
+
function FullScreenModalBody({
|
|
2667
|
+
children
|
|
2668
|
+
}) {
|
|
2669
|
+
return /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
2670
|
+
children: children
|
|
2671
|
+
});
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
const SideContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2675
|
+
displayName: "Header__SideContainer",
|
|
2676
|
+
componentId: "kitt-universal__sc-dfmxi1-0"
|
|
2677
|
+
})(["", ""], ({
|
|
1475
2678
|
theme,
|
|
1476
|
-
|
|
2679
|
+
side = 'left'
|
|
1477
2680
|
}) => {
|
|
1478
|
-
const
|
|
1479
|
-
iconButton
|
|
1480
|
-
} = theme.kitt;
|
|
1481
|
-
|
|
1482
|
-
if (reactNative.Platform.OS !== 'web') {
|
|
1483
|
-
return undefined;
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
const {
|
|
1487
|
-
transition
|
|
1488
|
-
} = iconButton;
|
|
2681
|
+
const padding = theme.kitt.spacing * 2;
|
|
1489
2682
|
|
|
1490
|
-
if (
|
|
1491
|
-
return `
|
|
1492
|
-
background-color: ${iconButton.disabled.backgroundColor};
|
|
1493
|
-
`;
|
|
2683
|
+
if (side === 'left') {
|
|
2684
|
+
return `padding-right: ${padding}px;`;
|
|
1494
2685
|
}
|
|
1495
2686
|
|
|
1496
|
-
return `
|
|
1497
|
-
transition: ${transition.property} ${transition.duration} ${transition.timingFunction};
|
|
1498
|
-
`;
|
|
2687
|
+
return `padding-left: ${padding}px;`;
|
|
1499
2688
|
});
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
...props
|
|
1504
|
-
}) {
|
|
1505
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
1506
|
-
as: PressableIconButtonWebWrapper,
|
|
1507
|
-
$isWhite: color === 'white',
|
|
1508
|
-
$isDisabled: Boolean(disabled),
|
|
1509
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props,
|
|
1510
|
-
disabled: disabled
|
|
1511
|
-
})
|
|
1512
|
-
});
|
|
2689
|
+
|
|
2690
|
+
function getHeaderHorizontalMediumPadding(spacing) {
|
|
2691
|
+
return spacing * 6;
|
|
1513
2692
|
}
|
|
1514
2693
|
|
|
1515
|
-
const
|
|
1516
|
-
displayName: "
|
|
1517
|
-
componentId: "kitt-universal__sc-
|
|
1518
|
-
})(["
|
|
2694
|
+
const Header = /*#__PURE__*/styled__default.View.withConfig({
|
|
2695
|
+
displayName: "Header",
|
|
2696
|
+
componentId: "kitt-universal__sc-dfmxi1-1"
|
|
2697
|
+
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
|
|
1519
2698
|
theme,
|
|
1520
|
-
|
|
1521
|
-
disabled
|
|
2699
|
+
insetTop = 0
|
|
1522
2700
|
}) => {
|
|
2701
|
+
const paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
|
|
1523
2702
|
const {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
2703
|
+
paddingVertical,
|
|
2704
|
+
paddingHorizontal
|
|
2705
|
+
} = theme.kitt.fullScreenModal.header;
|
|
2706
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
2707
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
2708
|
+
}, `padding: ${paddingTop}px ${getHeaderHorizontalMediumPadding(theme.kitt.spacing)}px ${paddingVertical}px;`, `padding: ${paddingTop}px ${paddingHorizontal}px ${paddingVertical}px;`);
|
|
1529
2709
|
}, ({
|
|
1530
2710
|
theme
|
|
1531
|
-
}) => theme.kitt.
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
})
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
}) {
|
|
1549
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
1550
|
-
const pressed = Animated.useSharedValue(false);
|
|
1551
|
-
const opacityStyles = Animated.useAnimatedStyle(function () {
|
|
1552
|
-
const _f = function () {
|
|
1553
|
-
return {
|
|
1554
|
-
opacity: Animated.withSpring(pressed.value ? 1 : 0)
|
|
1555
|
-
};
|
|
1556
|
-
};
|
|
1557
|
-
|
|
1558
|
-
_f._closure = {
|
|
1559
|
-
withSpring: Animated.withSpring,
|
|
1560
|
-
pressed
|
|
1561
|
-
};
|
|
1562
|
-
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
1563
|
-
_f.__workletHash = 10645190329247;
|
|
1564
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:41)";
|
|
1565
|
-
_f.__optimalization = 2;
|
|
1566
|
-
|
|
1567
|
-
global.__reanimatedWorkletInit(_f);
|
|
1568
|
-
|
|
1569
|
-
return _f;
|
|
1570
|
-
}());
|
|
1571
|
-
const scaleStyles = Animated.useAnimatedStyle(function () {
|
|
1572
|
-
const _f = function () {
|
|
1573
|
-
return {
|
|
1574
|
-
transform: [{
|
|
1575
|
-
scale: Animated.withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base.default)
|
|
1576
|
-
}]
|
|
1577
|
-
};
|
|
1578
|
-
};
|
|
1579
|
-
|
|
1580
|
-
_f._closure = {
|
|
1581
|
-
withSpring: Animated.withSpring,
|
|
1582
|
-
pressed,
|
|
1583
|
-
theme: {
|
|
1584
|
-
kitt: {
|
|
1585
|
-
iconButton: {
|
|
1586
|
-
scale: {
|
|
1587
|
-
base: {
|
|
1588
|
-
active: theme.kitt.iconButton.scale.base.active,
|
|
1589
|
-
default: theme.kitt.iconButton.scale.base.default
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
};
|
|
1596
|
-
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{transform:[{scale:withSpring(pressed.value?theme.kitt.iconButton.scale.base.active:theme.kitt.iconButton.scale.base.default)}]};}}";
|
|
1597
|
-
_f.__workletHash = 13861998831411;
|
|
1598
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (66:39)";
|
|
1599
|
-
_f.__optimalization = 2;
|
|
2711
|
+
}) => theme.kitt.fullScreenModal.header.borderColor);
|
|
2712
|
+
const HeaderContent = /*#__PURE__*/styled__default.View.withConfig({
|
|
2713
|
+
displayName: "Header__HeaderContent",
|
|
2714
|
+
componentId: "kitt-universal__sc-dfmxi1-2"
|
|
2715
|
+
})(["", ";", ";justify-content:center;align-items:center;"], ({
|
|
2716
|
+
theme,
|
|
2717
|
+
leftWidth,
|
|
2718
|
+
rightWidth,
|
|
2719
|
+
windowWidth
|
|
2720
|
+
}) => {
|
|
2721
|
+
/*
|
|
2722
|
+
* Since we don't have controll over the rendered left and right elements,
|
|
2723
|
+
* we must apply some logic to give the title all the available space
|
|
2724
|
+
*/
|
|
2725
|
+
const sideElementMaxWidth = Math.max(leftWidth, rightWidth);
|
|
2726
|
+
const parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
|
|
2727
|
+
const parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
|
|
1600
2728
|
|
|
1601
|
-
|
|
2729
|
+
const computeWidth = breakpointPadding => windowWidth - breakpointPadding - sideElementMaxWidth * 2;
|
|
1602
2730
|
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
onPressIn: () => {
|
|
1613
|
-
pressed.value = true;
|
|
1614
|
-
},
|
|
1615
|
-
onPressOut: () => {
|
|
1616
|
-
pressed.value = false;
|
|
1617
|
-
},
|
|
1618
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(AnimatedViewContainer, {
|
|
1619
|
-
style: disabled ? [{
|
|
1620
|
-
transform: [{
|
|
1621
|
-
scale: 1
|
|
1622
|
-
}]
|
|
1623
|
-
}] : [scaleStyles],
|
|
1624
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedIconButtonBackground, {
|
|
1625
|
-
disabled: disabled,
|
|
1626
|
-
color: color,
|
|
1627
|
-
style: disabled ? [{
|
|
1628
|
-
opacity: 1
|
|
1629
|
-
}] : [opacityStyles]
|
|
1630
|
-
}), children]
|
|
1631
|
-
})
|
|
1632
|
-
});
|
|
1633
|
-
}
|
|
2731
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
2732
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
2733
|
+
}, `width: ${computeWidth(parentHorizontalPaddingMedium)}px;`, `width: ${computeWidth(parentHorizontalPadding)}px;`);
|
|
2734
|
+
}, ({
|
|
2735
|
+
leftWidth,
|
|
2736
|
+
rightWidth
|
|
2737
|
+
}) => {
|
|
2738
|
+
// Depending of the wider element, we must add a margin to fill the diff in space between elements
|
|
2739
|
+
const deltaMargin = Math.abs(leftWidth - rightWidth);
|
|
1634
2740
|
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], ({
|
|
1639
|
-
theme
|
|
1640
|
-
}) => `${theme.kitt.iconButton.borderWidth}px solid`, ({
|
|
1641
|
-
theme,
|
|
1642
|
-
disabled
|
|
1643
|
-
}) => disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor, ({
|
|
1644
|
-
theme
|
|
1645
|
-
}) => theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth, ({
|
|
1646
|
-
theme
|
|
1647
|
-
}) => theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth, ({
|
|
1648
|
-
theme
|
|
1649
|
-
}) => theme.kitt.iconButton.borderRadius);
|
|
2741
|
+
if (leftWidth > rightWidth) {
|
|
2742
|
+
return `margin-right: ${deltaMargin}px;`;
|
|
2743
|
+
}
|
|
1650
2744
|
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
2745
|
+
return `margin-left: ${deltaMargin}px;`;
|
|
2746
|
+
});
|
|
2747
|
+
function FullScreenModalHeader({
|
|
2748
|
+
children,
|
|
2749
|
+
right,
|
|
2750
|
+
left
|
|
1655
2751
|
}) {
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
2752
|
+
const {
|
|
2753
|
+
top
|
|
2754
|
+
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
2755
|
+
const dimensions = reactNative.useWindowDimensions();
|
|
2756
|
+
const [leftWidth, setLeftWidth] = react.useState(0);
|
|
2757
|
+
const [rightWidth, setRightWidth] = react.useState(0);
|
|
2758
|
+
|
|
2759
|
+
const handleLayoutChange = (event, side) => {
|
|
2760
|
+
// Prevents react to nullify event on rerenders
|
|
2761
|
+
event.persist();
|
|
2762
|
+
|
|
2763
|
+
if (side === 'left') {
|
|
2764
|
+
setLeftWidth(event.nativeEvent.layout.width);
|
|
2765
|
+
return;
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
setRightWidth(event.nativeEvent.layout.width);
|
|
2769
|
+
};
|
|
2770
|
+
|
|
2771
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Header, {
|
|
2772
|
+
insetTop: reactNative.Platform.OS === 'ios' ? undefined : top,
|
|
2773
|
+
children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
2774
|
+
onLayout: e => handleLayoutChange(e, 'left'),
|
|
2775
|
+
children: left
|
|
2776
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(HeaderContent, {
|
|
2777
|
+
windowWidth: dimensions.width,
|
|
2778
|
+
leftWidth: leftWidth,
|
|
2779
|
+
rightWidth: rightWidth,
|
|
2780
|
+
children: children
|
|
2781
|
+
}), right ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
2782
|
+
side: "right",
|
|
2783
|
+
onLayout: e => handleLayoutChange(e, 'right'),
|
|
2784
|
+
children: right
|
|
2785
|
+
}) : null]
|
|
1662
2786
|
});
|
|
1663
2787
|
}
|
|
1664
2788
|
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
2789
|
+
const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
|
|
2790
|
+
displayName: "FullScreenModal__Container",
|
|
2791
|
+
componentId: "kitt-universal__sc-11qpbe3-0"
|
|
2792
|
+
})(["flex:1;background-color:", ";"], ({
|
|
2793
|
+
theme
|
|
2794
|
+
}) => theme.kitt.colors.uiBackground);
|
|
2795
|
+
function FullScreenModal({
|
|
2796
|
+
children
|
|
1673
2797
|
}) {
|
|
1674
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1675
|
-
|
|
1676
|
-
disabled: disabled,
|
|
1677
|
-
testID: testID,
|
|
1678
|
-
accessibilityLabel: accessibilityLabel,
|
|
1679
|
-
accessibilityRole: accessibilityRole,
|
|
1680
|
-
onPress: onPress,
|
|
1681
|
-
children: /*#__PURE__*/jsxRuntime.jsx(IconButtonContent, {
|
|
1682
|
-
disabled: disabled,
|
|
1683
|
-
color: color,
|
|
1684
|
-
icon: icon
|
|
1685
|
-
})
|
|
2798
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container$3, {
|
|
2799
|
+
children: children
|
|
1686
2800
|
});
|
|
1687
2801
|
}
|
|
2802
|
+
FullScreenModal.Header = FullScreenModalHeader;
|
|
2803
|
+
FullScreenModal.Body = FullScreenModalBody;
|
|
1688
2804
|
|
|
1689
|
-
const ContentView
|
|
2805
|
+
const ContentView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1690
2806
|
displayName: "ListItemContent__ContentView",
|
|
1691
2807
|
componentId: "kitt-universal__sc-57q0u9-0"
|
|
1692
2808
|
})(["flex:1 0 0%;align-self:center;"]);
|
|
@@ -1694,7 +2810,7 @@ function ListItemContent({
|
|
|
1694
2810
|
children,
|
|
1695
2811
|
...rest
|
|
1696
2812
|
}) {
|
|
1697
|
-
return /*#__PURE__*/jsxRuntime.jsx(ContentView
|
|
2813
|
+
return /*#__PURE__*/jsxRuntime.jsx(ContentView, { ...rest,
|
|
1698
2814
|
children: children
|
|
1699
2815
|
});
|
|
1700
2816
|
}
|
|
@@ -1915,235 +3031,84 @@ const StyledIconContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
1915
3031
|
componentId: "kitt-universal__sc-eepeiz-2"
|
|
1916
3032
|
})(["margin:", ";"], ({
|
|
1917
3033
|
theme
|
|
1918
|
-
}) => {
|
|
1919
|
-
const {
|
|
1920
|
-
spacing
|
|
1921
|
-
} = theme.kitt;
|
|
1922
|
-
return `${spacing}px ${spacing * 5}px 0 0`;
|
|
1923
|
-
});
|
|
1924
|
-
const StyledTextContent = /*#__PURE__*/styled__default(Typography.Text).withConfig({
|
|
1925
|
-
displayName: "BaseMessage__StyledTextContent",
|
|
1926
|
-
componentId: "kitt-universal__sc-eepeiz-3"
|
|
1927
|
-
})(["flex:1;text-align:", ";"], ({
|
|
1928
|
-
$isCenteredText
|
|
1929
|
-
}) => $isCenteredText ? 'center' : 'left');
|
|
1930
|
-
const StyledMessageContent = /*#__PURE__*/styled__default.View.withConfig({
|
|
1931
|
-
displayName: "BaseMessage__StyledMessageContent",
|
|
1932
|
-
componentId: "kitt-universal__sc-eepeiz-4"
|
|
1933
|
-
})(["display:flex;flex-direction:row;flex-grow:1;align-self:center;align-items:flex-start;flex-shrink:1;padding:", ";"], ({
|
|
1934
|
-
theme
|
|
1935
|
-
}) => {
|
|
1936
|
-
const {
|
|
1937
|
-
spacing
|
|
1938
|
-
} = theme.kitt;
|
|
1939
|
-
return `${spacing * 4}px ${spacing * 5}px`;
|
|
1940
|
-
});
|
|
1941
|
-
function BaseMessage({
|
|
1942
|
-
type = 'info',
|
|
1943
|
-
children,
|
|
1944
|
-
hasNoRadius,
|
|
1945
|
-
centeredText,
|
|
1946
|
-
insets,
|
|
1947
|
-
onDismiss
|
|
1948
|
-
}) {
|
|
1949
|
-
const color = getColorByType(type);
|
|
1950
|
-
return /*#__PURE__*/jsxRuntime.jsxs(StyledMessageContainer, {
|
|
1951
|
-
$type: type,
|
|
1952
|
-
$hasNoRadius: hasNoRadius,
|
|
1953
|
-
$insets: insets,
|
|
1954
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs(StyledMessageContent, {
|
|
1955
|
-
children: [centeredText ? null : /*#__PURE__*/jsxRuntime.jsx(StyledIconContainer, {
|
|
1956
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1957
|
-
color: color,
|
|
1958
|
-
icon: /*#__PURE__*/jsxRuntime.jsx(IconContent, {
|
|
1959
|
-
type: type,
|
|
1960
|
-
color: color
|
|
1961
|
-
})
|
|
1962
|
-
})
|
|
1963
|
-
}), /*#__PURE__*/jsxRuntime.jsx(StyledTextContent, {
|
|
1964
|
-
$isCenteredText: centeredText,
|
|
1965
|
-
base: "body",
|
|
1966
|
-
color: color,
|
|
1967
|
-
children: children
|
|
1968
|
-
})]
|
|
1969
|
-
}), onDismiss ? /*#__PURE__*/jsxRuntime.jsx(StyledDismissWrapper, {
|
|
1970
|
-
children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
|
|
1971
|
-
color: getIconButtonColor(type),
|
|
1972
|
-
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
|
|
1973
|
-
onPress: onDismiss
|
|
1974
|
-
})
|
|
1975
|
-
}) : null]
|
|
1976
|
-
});
|
|
1977
|
-
}
|
|
1978
|
-
|
|
1979
|
-
function Message({
|
|
1980
|
-
type = 'info',
|
|
1981
|
-
children,
|
|
1982
|
-
hasNoRadius,
|
|
1983
|
-
centeredText,
|
|
1984
|
-
insets,
|
|
1985
|
-
onDismiss
|
|
1986
|
-
}) {
|
|
1987
|
-
return /*#__PURE__*/jsxRuntime.jsx(BaseMessage, {
|
|
1988
|
-
insets: insets,
|
|
1989
|
-
hasNoRadius: hasNoRadius,
|
|
1990
|
-
type: type,
|
|
1991
|
-
centeredText: centeredText,
|
|
1992
|
-
onDismiss: onDismiss,
|
|
1993
|
-
children: children
|
|
1994
|
-
});
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
|
-
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
1998
|
-
const OverlayPressable = /*#__PURE__*/styled__default(reactNative.Pressable).withConfig({
|
|
1999
|
-
displayName: "Overlay__OverlayPressable",
|
|
2000
|
-
componentId: "kitt-universal__sc-1cz1gbr-0"
|
|
2001
|
-
})(({
|
|
2002
|
-
theme
|
|
2003
|
-
}) => ({ ...reactNative.StyleSheet.absoluteFillObject,
|
|
2004
|
-
backgroundColor: theme.kitt.colors.overlay.dark
|
|
2005
|
-
}));
|
|
2006
|
-
function Overlay({
|
|
2007
|
-
onPress
|
|
2008
|
-
}) {
|
|
2009
|
-
return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
|
|
2010
|
-
accessibilityRole: "none",
|
|
2011
|
-
onPress: onPress,
|
|
2012
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {})
|
|
2013
|
-
});
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
const BodyView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2017
|
-
displayName: "Body__BodyView",
|
|
2018
|
-
componentId: "kitt-universal__sc-17fwpo4-0"
|
|
2019
|
-
})(["padding:", "px ", "px;"], ({
|
|
2020
|
-
theme
|
|
2021
|
-
}) => theme.kitt.spacing * 6, ({
|
|
2022
|
-
theme
|
|
2023
|
-
}) => theme.kitt.spacing * 4);
|
|
2024
|
-
function ModalBody({
|
|
2025
|
-
children
|
|
2026
|
-
}) {
|
|
2027
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
2028
|
-
children: /*#__PURE__*/jsxRuntime.jsx(BodyView, {
|
|
2029
|
-
children: children
|
|
2030
|
-
})
|
|
2031
|
-
});
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
const FooterView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2035
|
-
displayName: "Footer__FooterView",
|
|
2036
|
-
componentId: "kitt-universal__sc-1ujq2dc-0"
|
|
2037
|
-
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
|
|
2038
|
-
theme
|
|
2039
|
-
}) => theme.kitt.spacing * 4, ({
|
|
2040
|
-
theme
|
|
2041
|
-
}) => theme.kitt.colors.separator);
|
|
2042
|
-
function ModalFooter({
|
|
2043
|
-
children
|
|
2044
|
-
}) {
|
|
2045
|
-
return /*#__PURE__*/jsxRuntime.jsx(FooterView, {
|
|
2046
|
-
children: children
|
|
2047
|
-
});
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
|
|
2051
|
-
|
|
2052
|
-
const HeaderView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2053
|
-
displayName: "Header__HeaderView",
|
|
2054
|
-
componentId: "kitt-universal__sc-1iwabch-0"
|
|
2055
|
-
})(["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;"], ({
|
|
2056
|
-
theme
|
|
2057
|
-
}) => theme.kitt.spacing * 2, ({
|
|
2058
|
-
theme
|
|
2059
|
-
}) => theme.kitt.colors.separator);
|
|
2060
|
-
const LeftIconView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2061
|
-
displayName: "Header__LeftIconView",
|
|
2062
|
-
componentId: "kitt-universal__sc-1iwabch-1"
|
|
2063
|
-
})(["align-self:flex-start;margin-right:", "px;"], ({
|
|
2064
|
-
theme
|
|
2065
|
-
}) => theme.kitt.spacing * 2);
|
|
2066
|
-
const RightIconView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2067
|
-
displayName: "Header__RightIconView",
|
|
2068
|
-
componentId: "kitt-universal__sc-1iwabch-2"
|
|
2069
|
-
})(["align-self:flex-start;margin-left:", "px;"], ({
|
|
3034
|
+
}) => {
|
|
3035
|
+
const {
|
|
3036
|
+
spacing
|
|
3037
|
+
} = theme.kitt;
|
|
3038
|
+
return `${spacing}px ${spacing * 5}px 0 0`;
|
|
3039
|
+
});
|
|
3040
|
+
const StyledTextContent = /*#__PURE__*/styled__default(Typography.Text).withConfig({
|
|
3041
|
+
displayName: "BaseMessage__StyledTextContent",
|
|
3042
|
+
componentId: "kitt-universal__sc-eepeiz-3"
|
|
3043
|
+
})(["flex:1;text-align:", ";"], ({
|
|
3044
|
+
$isCenteredText
|
|
3045
|
+
}) => $isCenteredText ? 'center' : 'left');
|
|
3046
|
+
const StyledMessageContent = /*#__PURE__*/styled__default.View.withConfig({
|
|
3047
|
+
displayName: "BaseMessage__StyledMessageContent",
|
|
3048
|
+
componentId: "kitt-universal__sc-eepeiz-4"
|
|
3049
|
+
})(["display:flex;flex-direction:row;flex-grow:1;align-self:center;align-items:flex-start;flex-shrink:1;padding:", ";"], ({
|
|
2070
3050
|
theme
|
|
2071
|
-
}) =>
|
|
2072
|
-
const
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
3051
|
+
}) => {
|
|
3052
|
+
const {
|
|
3053
|
+
spacing
|
|
3054
|
+
} = theme.kitt;
|
|
3055
|
+
return `${spacing * 4}px ${spacing * 5}px`;
|
|
3056
|
+
});
|
|
3057
|
+
function BaseMessage({
|
|
3058
|
+
type = 'info',
|
|
3059
|
+
children,
|
|
3060
|
+
hasNoRadius,
|
|
3061
|
+
centeredText,
|
|
3062
|
+
insets,
|
|
3063
|
+
onDismiss
|
|
2083
3064
|
}) {
|
|
2084
|
-
const
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
3065
|
+
const color = getColorByType(type);
|
|
3066
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledMessageContainer, {
|
|
3067
|
+
$type: type,
|
|
3068
|
+
$hasNoRadius: hasNoRadius,
|
|
3069
|
+
$insets: insets,
|
|
3070
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(StyledMessageContent, {
|
|
3071
|
+
children: [centeredText ? null : /*#__PURE__*/jsxRuntime.jsx(StyledIconContainer, {
|
|
3072
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
3073
|
+
color: color,
|
|
3074
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(IconContent, {
|
|
3075
|
+
type: type,
|
|
3076
|
+
color: color
|
|
3077
|
+
})
|
|
3078
|
+
})
|
|
3079
|
+
}), /*#__PURE__*/jsxRuntime.jsx(StyledTextContent, {
|
|
3080
|
+
$isCenteredText: centeredText,
|
|
3081
|
+
base: "body",
|
|
3082
|
+
color: color,
|
|
3083
|
+
children: children
|
|
3084
|
+
})]
|
|
3085
|
+
}), onDismiss ? /*#__PURE__*/jsxRuntime.jsx(StyledDismissWrapper, {
|
|
3086
|
+
children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
|
|
3087
|
+
color: getIconButtonColor(type),
|
|
2095
3088
|
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
|
|
2096
|
-
onPress:
|
|
3089
|
+
onPress: onDismiss
|
|
2097
3090
|
})
|
|
2098
|
-
})]
|
|
3091
|
+
}) : null]
|
|
2099
3092
|
});
|
|
2100
3093
|
}
|
|
2101
3094
|
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
componentId: "kitt-universal__sc-1xy2w5u-0"
|
|
2105
|
-
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
|
|
2106
|
-
theme
|
|
2107
|
-
}) => theme.kitt.spacing * 20, ({
|
|
2108
|
-
theme
|
|
2109
|
-
}) => theme.kitt.spacing * 4);
|
|
2110
|
-
const ContentView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2111
|
-
displayName: "Modal__ContentView",
|
|
2112
|
-
componentId: "kitt-universal__sc-1xy2w5u-1"
|
|
2113
|
-
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], ({
|
|
2114
|
-
theme
|
|
2115
|
-
}) => theme.kitt.card.borderRadius, ({
|
|
2116
|
-
theme
|
|
2117
|
-
}) => theme.kitt.colors.uiBackgroundLight);
|
|
2118
|
-
function Modal({
|
|
2119
|
-
visible,
|
|
3095
|
+
function Message({
|
|
3096
|
+
type = 'info',
|
|
2120
3097
|
children,
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
3098
|
+
hasNoRadius,
|
|
3099
|
+
centeredText,
|
|
3100
|
+
insets,
|
|
3101
|
+
onDismiss
|
|
2124
3102
|
}) {
|
|
2125
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
onDismiss: onExited,
|
|
2133
|
-
onRequestClose: onClose,
|
|
2134
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
|
|
2135
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
|
|
2136
|
-
onPress: onClose
|
|
2137
|
-
}), /*#__PURE__*/jsxRuntime.jsx(ContentView, {
|
|
2138
|
-
children: children
|
|
2139
|
-
})]
|
|
2140
|
-
})
|
|
2141
|
-
})
|
|
3103
|
+
return /*#__PURE__*/jsxRuntime.jsx(BaseMessage, {
|
|
3104
|
+
insets: insets,
|
|
3105
|
+
hasNoRadius: hasNoRadius,
|
|
3106
|
+
type: type,
|
|
3107
|
+
centeredText: centeredText,
|
|
3108
|
+
onDismiss: onDismiss,
|
|
3109
|
+
children: children
|
|
2142
3110
|
});
|
|
2143
3111
|
}
|
|
2144
|
-
Modal.Header = ModalHeader;
|
|
2145
|
-
Modal.Body = ModalBody;
|
|
2146
|
-
Modal.Footer = ModalFooter;
|
|
2147
3112
|
|
|
2148
3113
|
function Notification({
|
|
2149
3114
|
type,
|
|
@@ -2480,691 +3445,211 @@ const StyledSubSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
2480
3445
|
function SubSection({
|
|
2481
3446
|
title,
|
|
2482
3447
|
children,
|
|
2483
|
-
...props
|
|
2484
|
-
}) {
|
|
2485
|
-
return /*#__PURE__*/jsxRuntime.jsxs(StyledSubSection, { ...props,
|
|
2486
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level3, {
|
|
2487
|
-
children: title
|
|
2488
|
-
}), children]
|
|
2489
|
-
});
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2492
|
-
const StyledBlockSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
2493
|
-
displayName: "StorySection__StyledBlockSection",
|
|
2494
|
-
componentId: "kitt-universal__sc-1b3liv5-2"
|
|
2495
|
-
})(["margin-bottom:16px;"]);
|
|
2496
|
-
|
|
2497
|
-
function BlockSection({
|
|
2498
|
-
title,
|
|
2499
|
-
children,
|
|
2500
|
-
...props
|
|
2501
|
-
}) {
|
|
2502
|
-
return /*#__PURE__*/jsxRuntime.jsxs(StyledBlockSection, { ...props,
|
|
2503
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
2504
|
-
children: title
|
|
2505
|
-
}), children]
|
|
2506
|
-
});
|
|
2507
|
-
}
|
|
2508
|
-
|
|
2509
|
-
const StyledDemoSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
2510
|
-
displayName: "StorySection__StyledDemoSection",
|
|
2511
|
-
componentId: "kitt-universal__sc-1b3liv5-3"
|
|
2512
|
-
})(["margin-bottom:64px;"]);
|
|
2513
|
-
|
|
2514
|
-
function DemoSection({
|
|
2515
|
-
children
|
|
2516
|
-
}) {
|
|
2517
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledDemoSection, {
|
|
2518
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StorySection, {
|
|
2519
|
-
internalIsDemoSection: true,
|
|
2520
|
-
title: "Demo",
|
|
2521
|
-
children: children
|
|
2522
|
-
})
|
|
2523
|
-
});
|
|
2524
|
-
}
|
|
2525
|
-
|
|
2526
|
-
StorySection.SubSection = SubSection;
|
|
2527
|
-
StorySection.BlockSection = BlockSection;
|
|
2528
|
-
/** @deprecated use StorySection.Demo instead */
|
|
2529
|
-
|
|
2530
|
-
StorySection.DemoSection = DemoSection;
|
|
2531
|
-
StorySection.Demo = DemoSection;
|
|
2532
|
-
/** @deprecated use StorySection instead */
|
|
2533
|
-
|
|
2534
|
-
const DeprecatedSection = StorySection;
|
|
2535
|
-
|
|
2536
|
-
function StoryContainer({
|
|
2537
|
-
children,
|
|
2538
|
-
title,
|
|
2539
|
-
state = 'none',
|
|
2540
|
-
platform = 'all'
|
|
2541
|
-
}) {
|
|
2542
|
-
if (platform === 'web') return null;
|
|
2543
|
-
return /*#__PURE__*/jsxRuntime.jsx(StorySection.BlockSection, {
|
|
2544
|
-
testID: state,
|
|
2545
|
-
title: title,
|
|
2546
|
-
children: children
|
|
2547
|
-
});
|
|
2548
|
-
}
|
|
2549
|
-
|
|
2550
|
-
function StoryDecorator(storyFn, context) {
|
|
2551
|
-
return /*#__PURE__*/jsxRuntime.jsx(Story, {
|
|
2552
|
-
title: context.name,
|
|
2553
|
-
children: storyFn()
|
|
2554
|
-
});
|
|
2555
|
-
}
|
|
2556
|
-
|
|
2557
|
-
const SmallScreenRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
2558
|
-
displayName: "StoryGrid__SmallScreenRow",
|
|
2559
|
-
componentId: "kitt-universal__sc-4z5new-0"
|
|
2560
|
-
})(["flex-direction:column;margin:0;"]);
|
|
2561
|
-
const SmallScreenCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
2562
|
-
displayName: "StoryGrid__SmallScreenCol",
|
|
2563
|
-
componentId: "kitt-universal__sc-4z5new-1"
|
|
2564
|
-
})(["padding:8px 0 16px;"]);
|
|
2565
|
-
const FlexRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
2566
|
-
displayName: "StoryGrid__FlexRow",
|
|
2567
|
-
componentId: "kitt-universal__sc-4z5new-2"
|
|
2568
|
-
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
2569
|
-
const FlexCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
2570
|
-
displayName: "StoryGrid__FlexCol",
|
|
2571
|
-
componentId: "kitt-universal__sc-4z5new-3"
|
|
2572
|
-
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
2573
|
-
|
|
2574
|
-
function StoryGridRow({
|
|
2575
|
-
children,
|
|
2576
|
-
breakpoint = 'small'
|
|
2577
|
-
}) {
|
|
2578
|
-
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2579
|
-
// TODO use useBreakpoint instead
|
|
2580
|
-
const {
|
|
2581
|
-
width
|
|
2582
|
-
} = reactNative.useWindowDimensions();
|
|
2583
|
-
const breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
2584
|
-
|
|
2585
|
-
if (width < breakpointValue) {
|
|
2586
|
-
return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
|
|
2587
|
-
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
|
|
2588
|
-
children: child
|
|
2589
|
-
}))
|
|
2590
|
-
});
|
|
2591
|
-
}
|
|
2592
|
-
|
|
2593
|
-
return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
|
|
2594
|
-
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
|
|
2595
|
-
children: child
|
|
2596
|
-
}))
|
|
2597
|
-
});
|
|
2598
|
-
}
|
|
2599
|
-
|
|
2600
|
-
function StoryGridCol({
|
|
2601
|
-
title,
|
|
2602
|
-
titleColor,
|
|
2603
|
-
children,
|
|
2604
|
-
platform = 'all'
|
|
3448
|
+
...props
|
|
2605
3449
|
}) {
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
if (reactNative.Platform.OS === 'web' && platform === 'native') {
|
|
2609
|
-
return null;
|
|
2610
|
-
}
|
|
2611
|
-
|
|
2612
|
-
if (isNative && platform === 'web') {
|
|
2613
|
-
return null;
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2617
|
-
children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
2618
|
-
numberOfLines: 1,
|
|
2619
|
-
color: titleColor,
|
|
3450
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledSubSection, { ...props,
|
|
3451
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level3, {
|
|
2620
3452
|
children: title
|
|
2621
|
-
})
|
|
3453
|
+
}), children]
|
|
2622
3454
|
});
|
|
2623
3455
|
}
|
|
2624
3456
|
|
|
2625
|
-
const
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
};
|
|
2629
|
-
|
|
2630
|
-
const Container$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
2631
|
-
displayName: "Tag__Container",
|
|
2632
|
-
componentId: "kitt-universal__sc-19jmowi-0"
|
|
2633
|
-
})(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], ({
|
|
2634
|
-
theme,
|
|
2635
|
-
type,
|
|
2636
|
-
variant
|
|
2637
|
-
}) => theme.kitt.tag[type][variant].backgroundColor, ({
|
|
2638
|
-
theme,
|
|
2639
|
-
type,
|
|
2640
|
-
variant
|
|
2641
|
-
}) => theme.kitt.tag[type][variant].borderWidth, ({
|
|
2642
|
-
theme,
|
|
2643
|
-
type,
|
|
2644
|
-
variant
|
|
2645
|
-
}) => theme.kitt.tag[type][variant].borderColor, ({
|
|
2646
|
-
theme
|
|
2647
|
-
}) => theme.kitt.tag.padding, ({
|
|
2648
|
-
theme
|
|
2649
|
-
}) => theme.kitt.tag.borderRadius);
|
|
2650
|
-
const getLabelColor = (type, variant) => {
|
|
2651
|
-
switch (type) {
|
|
2652
|
-
case 'danger':
|
|
2653
|
-
{
|
|
2654
|
-
return variant === 'outline' ? 'danger' : 'black';
|
|
2655
|
-
}
|
|
2656
|
-
|
|
2657
|
-
case 'primary':
|
|
2658
|
-
{
|
|
2659
|
-
return 'primary';
|
|
2660
|
-
}
|
|
2661
|
-
|
|
2662
|
-
case 'default':
|
|
2663
|
-
{
|
|
2664
|
-
return 'black';
|
|
2665
|
-
}
|
|
3457
|
+
const StyledBlockSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
3458
|
+
displayName: "StorySection__StyledBlockSection",
|
|
3459
|
+
componentId: "kitt-universal__sc-1b3liv5-2"
|
|
3460
|
+
})(["margin-bottom:16px;"]);
|
|
2666
3461
|
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
}
|
|
2672
|
-
};
|
|
2673
|
-
function Tag({
|
|
2674
|
-
label,
|
|
2675
|
-
type = 'default',
|
|
2676
|
-
variant = 'fill'
|
|
3462
|
+
function BlockSection({
|
|
3463
|
+
title,
|
|
3464
|
+
children,
|
|
3465
|
+
...props
|
|
2677
3466
|
}) {
|
|
2678
|
-
return /*#__PURE__*/jsxRuntime.
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
base: "body-xsmall",
|
|
2683
|
-
color: getLabelColor(type, variant),
|
|
2684
|
-
children: label
|
|
2685
|
-
})
|
|
3467
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledBlockSection, { ...props,
|
|
3468
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
3469
|
+
children: title
|
|
3470
|
+
}), children]
|
|
2686
3471
|
});
|
|
2687
3472
|
}
|
|
2688
3473
|
|
|
2689
|
-
const
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
lateOceanLight3: '#D6BAF9',
|
|
2694
|
-
warmEmbrace: '#F4D3CE',
|
|
2695
|
-
warmEmbraceLight1: '#FFEDE6',
|
|
2696
|
-
black1000: '#000000',
|
|
2697
|
-
black800: '#2C293D',
|
|
2698
|
-
black555: '#737373',
|
|
2699
|
-
black200: '#CCCCCC',
|
|
2700
|
-
black100: '#E5E5E5',
|
|
2701
|
-
black50: '#F2F2F2',
|
|
2702
|
-
black25: '#F9F9F9',
|
|
2703
|
-
white: '#FFFFFF',
|
|
2704
|
-
viride: '#38836D',
|
|
2705
|
-
englishVermillon: '#D44148',
|
|
2706
|
-
goldCrayola: '#F8C583',
|
|
2707
|
-
aero: '#89BDDD',
|
|
2708
|
-
transparent: 'transparent',
|
|
2709
|
-
moonPurple: '#DBD6F9',
|
|
2710
|
-
moonPurpleLight1: '#EDEBFC'
|
|
2711
|
-
};
|
|
2712
|
-
|
|
2713
|
-
const colors = {
|
|
2714
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2715
|
-
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2716
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2717
|
-
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2718
|
-
success: lateOceanColorPalette.viride,
|
|
2719
|
-
correct: lateOceanColorPalette.viride,
|
|
2720
|
-
danger: lateOceanColorPalette.englishVermillon,
|
|
2721
|
-
info: lateOceanColorPalette.aero,
|
|
2722
|
-
warning: lateOceanColorPalette.goldCrayola,
|
|
2723
|
-
separator: lateOceanColorPalette.black100,
|
|
2724
|
-
hover: lateOceanColorPalette.black100,
|
|
2725
|
-
black: lateOceanColorPalette.black1000,
|
|
2726
|
-
uiBackground: lateOceanColorPalette.black25,
|
|
2727
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2728
|
-
transparent: lateOceanColorPalette.transparent,
|
|
2729
|
-
disabled: lateOceanColorPalette.black50,
|
|
2730
|
-
overlay: {
|
|
2731
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2732
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2733
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2734
|
-
}
|
|
2735
|
-
};
|
|
2736
|
-
|
|
2737
|
-
const avatar = {
|
|
2738
|
-
borderRadius: 10,
|
|
2739
|
-
default: {
|
|
2740
|
-
backgroundColor: colors.primary
|
|
2741
|
-
},
|
|
2742
|
-
light: {
|
|
2743
|
-
backgroundColor: lateOceanColorPalette.black100
|
|
2744
|
-
}
|
|
2745
|
-
};
|
|
2746
|
-
|
|
2747
|
-
const button = {
|
|
2748
|
-
borderRadius: 30,
|
|
2749
|
-
borderWidth: {
|
|
2750
|
-
disabled: 2,
|
|
2751
|
-
focus: 3
|
|
2752
|
-
},
|
|
2753
|
-
minHeight: 40,
|
|
2754
|
-
minWidth: 40,
|
|
2755
|
-
maxWidth: 335,
|
|
2756
|
-
scale: {
|
|
2757
|
-
base: {
|
|
2758
|
-
default: 1,
|
|
2759
|
-
hover: 0.95,
|
|
2760
|
-
active: 0.95
|
|
2761
|
-
},
|
|
2762
|
-
medium: {
|
|
2763
|
-
hover: 1.05
|
|
2764
|
-
}
|
|
2765
|
-
},
|
|
2766
|
-
contentPadding: {
|
|
2767
|
-
default: '8px 16px 7px',
|
|
2768
|
-
large: '12px 24px 11px',
|
|
2769
|
-
disabled: '6px 14px 5px'
|
|
2770
|
-
},
|
|
2771
|
-
transition: {
|
|
2772
|
-
duration: '200ms',
|
|
2773
|
-
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2774
|
-
},
|
|
2775
|
-
default: {
|
|
2776
|
-
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2777
|
-
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2778
|
-
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2779
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2780
|
-
},
|
|
2781
|
-
primary: {
|
|
2782
|
-
backgroundColor: colors.primary,
|
|
2783
|
-
pressedBackgroundColor: colors.primaryLight,
|
|
2784
|
-
hoverBackgroundColor: colors.primaryLight,
|
|
2785
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2786
|
-
},
|
|
2787
|
-
white: {
|
|
2788
|
-
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2789
|
-
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2790
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2791
|
-
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2792
|
-
},
|
|
2793
|
-
subtle: {
|
|
2794
|
-
backgroundColor: colors.transparent,
|
|
2795
|
-
pressedBackgroundColor: colors.transparent,
|
|
2796
|
-
hoverBackgroundColor: colors.transparent,
|
|
2797
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2798
|
-
color: colors.primary,
|
|
2799
|
-
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2800
|
-
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2801
|
-
},
|
|
2802
|
-
'subtle-dark': {
|
|
2803
|
-
backgroundColor: colors.transparent,
|
|
2804
|
-
pressedBackgroundColor: colors.transparent,
|
|
2805
|
-
hoverBackgroundColor: colors.transparent,
|
|
2806
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2807
|
-
color: colors.black,
|
|
2808
|
-
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2809
|
-
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2810
|
-
},
|
|
2811
|
-
disabled: {
|
|
2812
|
-
backgroundColor: colors.disabled,
|
|
2813
|
-
pressedBackgroundColor: colors.disabled,
|
|
2814
|
-
hoverBackgroundColor: colors.disabled,
|
|
2815
|
-
focusBorderColor: lateOceanColorPalette.black100,
|
|
2816
|
-
borderColor: lateOceanColorPalette.black100
|
|
2817
|
-
}
|
|
2818
|
-
};
|
|
2819
|
-
|
|
2820
|
-
const card = {
|
|
2821
|
-
borderRadius: 20,
|
|
2822
|
-
borderWidth: 2,
|
|
2823
|
-
primary: {
|
|
2824
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2825
|
-
borderColor: colors.primary
|
|
2826
|
-
},
|
|
2827
|
-
secondary: {
|
|
2828
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2829
|
-
borderColor: colors.separator
|
|
2830
|
-
},
|
|
2831
|
-
subtle: {
|
|
2832
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
2833
|
-
borderColor: colors.separator
|
|
2834
|
-
}
|
|
2835
|
-
};
|
|
2836
|
-
|
|
2837
|
-
const feedbackMessage = {
|
|
2838
|
-
danger: {
|
|
2839
|
-
backgroundColor: colors.danger
|
|
2840
|
-
},
|
|
2841
|
-
success: {
|
|
2842
|
-
backgroundColor: colors.success
|
|
2843
|
-
},
|
|
2844
|
-
info: {
|
|
2845
|
-
backgroundColor: colors.info
|
|
2846
|
-
},
|
|
2847
|
-
warning: {
|
|
2848
|
-
backgroundColor: colors.warning
|
|
2849
|
-
}
|
|
2850
|
-
};
|
|
3474
|
+
const StyledDemoSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
3475
|
+
displayName: "StorySection__StyledDemoSection",
|
|
3476
|
+
componentId: "kitt-universal__sc-1b3liv5-3"
|
|
3477
|
+
})(["margin-bottom:64px;"]);
|
|
2851
3478
|
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
}
|
|
2862
|
-
}
|
|
2863
|
-
const typography = {
|
|
2864
|
-
colors: {
|
|
2865
|
-
black: lateOceanColorPalette.black1000,
|
|
2866
|
-
'black-anthracite': lateOceanColorPalette.black800,
|
|
2867
|
-
'black-light': lateOceanColorPalette.black555,
|
|
2868
|
-
white: lateOceanColorPalette.white,
|
|
2869
|
-
'white-light': lateOceanColorPalette.white,
|
|
2870
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2871
|
-
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
2872
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2873
|
-
success: lateOceanColorPalette.viride,
|
|
2874
|
-
danger: lateOceanColorPalette.englishVermillon
|
|
2875
|
-
},
|
|
2876
|
-
types: {
|
|
2877
|
-
headers: {
|
|
2878
|
-
fontFamily: {
|
|
2879
|
-
regular: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
2880
|
-
bold: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
2881
|
-
},
|
|
2882
|
-
fontWeight: 400,
|
|
2883
|
-
fontStyle: 'normal',
|
|
2884
|
-
configs: {
|
|
2885
|
-
// also known as xxlarge
|
|
2886
|
-
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
2887
|
-
// also known as xlarge
|
|
2888
|
-
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
2889
|
-
// also known as medium
|
|
2890
|
-
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
2891
|
-
// also known as xsmall
|
|
2892
|
-
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
2893
|
-
// also known as xxsmall
|
|
2894
|
-
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
2895
|
-
}
|
|
2896
|
-
},
|
|
2897
|
-
bodies: {
|
|
2898
|
-
fontFamily: {
|
|
2899
|
-
regular: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
2900
|
-
bold: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
2901
|
-
},
|
|
2902
|
-
fontWeight: {
|
|
2903
|
-
regular: 400,
|
|
2904
|
-
bold: 700
|
|
2905
|
-
},
|
|
2906
|
-
fontStyle: {
|
|
2907
|
-
regular: 'normal',
|
|
2908
|
-
bold: 'normal'
|
|
2909
|
-
},
|
|
2910
|
-
configs: {
|
|
2911
|
-
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
2912
|
-
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
2913
|
-
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
2914
|
-
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
2915
|
-
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2918
|
-
},
|
|
2919
|
-
link: {
|
|
2920
|
-
disabledColor: lateOceanColorPalette.black200
|
|
2921
|
-
}
|
|
2922
|
-
};
|
|
3479
|
+
function DemoSection({
|
|
3480
|
+
children
|
|
3481
|
+
}) {
|
|
3482
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledDemoSection, {
|
|
3483
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StorySection, {
|
|
3484
|
+
internalIsDemoSection: true,
|
|
3485
|
+
title: "Demo",
|
|
3486
|
+
children: children
|
|
3487
|
+
})
|
|
3488
|
+
});
|
|
3489
|
+
}
|
|
2923
3490
|
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
borderColor: colors.separator,
|
|
2928
|
-
color: 'black'
|
|
2929
|
-
},
|
|
2930
|
-
pending: {
|
|
2931
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2932
|
-
borderColor: colors.separator,
|
|
2933
|
-
color: 'black'
|
|
2934
|
-
},
|
|
2935
|
-
valid: {
|
|
2936
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2937
|
-
borderColor: lateOceanColorPalette.black100,
|
|
2938
|
-
color: 'black'
|
|
2939
|
-
},
|
|
2940
|
-
hover: {
|
|
2941
|
-
borderColor: lateOceanColorPalette.black200,
|
|
2942
|
-
color: 'black'
|
|
2943
|
-
},
|
|
2944
|
-
focus: {
|
|
2945
|
-
borderColor: colors.primary,
|
|
2946
|
-
color: 'black'
|
|
2947
|
-
},
|
|
2948
|
-
disabled: {
|
|
2949
|
-
backgroundColor: colors.disabled,
|
|
2950
|
-
borderColor: colors.separator,
|
|
2951
|
-
color: 'black-light'
|
|
2952
|
-
},
|
|
2953
|
-
invalid: {
|
|
2954
|
-
borderColor: colors.separator,
|
|
2955
|
-
color: 'black'
|
|
2956
|
-
}
|
|
2957
|
-
};
|
|
2958
|
-
const input = {
|
|
2959
|
-
color: {
|
|
2960
|
-
selection: colors.primary,
|
|
2961
|
-
placeholder: typography.colors['black-light']
|
|
2962
|
-
},
|
|
2963
|
-
borderWidth: 2,
|
|
2964
|
-
borderRadius: 10,
|
|
2965
|
-
icon: {
|
|
2966
|
-
size: 20
|
|
2967
|
-
},
|
|
2968
|
-
padding: {
|
|
2969
|
-
default: '5px 16px',
|
|
2970
|
-
iOSSingleLine: '9px 16px'
|
|
2971
|
-
},
|
|
2972
|
-
transition: {
|
|
2973
|
-
property: 'border-color',
|
|
2974
|
-
duration: '200ms',
|
|
2975
|
-
timingFunction: 'ease-in-out'
|
|
2976
|
-
},
|
|
2977
|
-
states: inputStatesStyle
|
|
2978
|
-
};
|
|
3491
|
+
StorySection.SubSection = SubSection;
|
|
3492
|
+
StorySection.BlockSection = BlockSection;
|
|
3493
|
+
/** @deprecated use StorySection.Demo instead */
|
|
2979
3494
|
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
};
|
|
3495
|
+
StorySection.DemoSection = DemoSection;
|
|
3496
|
+
StorySection.Demo = DemoSection;
|
|
3497
|
+
/** @deprecated use StorySection instead */
|
|
2984
3498
|
|
|
2985
|
-
const
|
|
2986
|
-
size: 18,
|
|
2987
|
-
unchecked: {
|
|
2988
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2989
|
-
borderWidth: 2,
|
|
2990
|
-
borderColor: lateOceanColorPalette.black200
|
|
2991
|
-
},
|
|
2992
|
-
checked: {
|
|
2993
|
-
backgroundColor: colors.primary,
|
|
2994
|
-
innerSize: 5,
|
|
2995
|
-
innerBackgroundColor: colors.uiBackgroundLight
|
|
2996
|
-
},
|
|
2997
|
-
disabled: {
|
|
2998
|
-
backgroundColor: colors.disabled,
|
|
2999
|
-
borderColor: colors.separator
|
|
3000
|
-
}
|
|
3001
|
-
};
|
|
3499
|
+
const DeprecatedSection = StorySection;
|
|
3002
3500
|
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3501
|
+
function StoryContainer({
|
|
3502
|
+
children,
|
|
3503
|
+
title,
|
|
3504
|
+
state = 'none',
|
|
3505
|
+
platform = 'all'
|
|
3506
|
+
}) {
|
|
3507
|
+
if (platform === 'web') return null;
|
|
3508
|
+
return /*#__PURE__*/jsxRuntime.jsx(StorySection.BlockSection, {
|
|
3509
|
+
testID: state,
|
|
3510
|
+
title: title,
|
|
3511
|
+
children: children
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3006
3514
|
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
}
|
|
3515
|
+
function StoryDecorator(storyFn, context) {
|
|
3516
|
+
return /*#__PURE__*/jsxRuntime.jsx(Story, {
|
|
3517
|
+
title: context.name,
|
|
3518
|
+
children: storyFn()
|
|
3519
|
+
});
|
|
3520
|
+
}
|
|
3013
3521
|
|
|
3014
|
-
const
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3522
|
+
const SmallScreenRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
3523
|
+
displayName: "StoryGrid__SmallScreenRow",
|
|
3524
|
+
componentId: "kitt-universal__sc-4z5new-0"
|
|
3525
|
+
})(["flex-direction:column;margin:0;"]);
|
|
3526
|
+
const SmallScreenCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
3527
|
+
displayName: "StoryGrid__SmallScreenCol",
|
|
3528
|
+
componentId: "kitt-universal__sc-4z5new-1"
|
|
3529
|
+
})(["padding:8px 0 16px;"]);
|
|
3530
|
+
const FlexRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
3531
|
+
displayName: "StoryGrid__FlexRow",
|
|
3532
|
+
componentId: "kitt-universal__sc-4z5new-2"
|
|
3533
|
+
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
3534
|
+
const FlexCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
3535
|
+
displayName: "StoryGrid__FlexCol",
|
|
3536
|
+
componentId: "kitt-universal__sc-4z5new-3"
|
|
3537
|
+
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
3021
3538
|
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
},
|
|
3040
|
-
medium: {
|
|
3041
|
-
hover: 1.05
|
|
3042
|
-
}
|
|
3043
|
-
},
|
|
3044
|
-
disabled: {
|
|
3045
|
-
scale: 1,
|
|
3046
|
-
backgroundColor: button.disabled.backgroundColor,
|
|
3047
|
-
borderColor: button.disabled.borderColor
|
|
3048
|
-
},
|
|
3049
|
-
default: {
|
|
3050
|
-
pressedBackgroundColor: button.default.pressedBackgroundColor
|
|
3051
|
-
},
|
|
3052
|
-
white: {
|
|
3053
|
-
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
3539
|
+
function StoryGridRow({
|
|
3540
|
+
children,
|
|
3541
|
+
breakpoint = 'small'
|
|
3542
|
+
}) {
|
|
3543
|
+
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3544
|
+
// TODO use useBreakpoint instead
|
|
3545
|
+
const {
|
|
3546
|
+
width
|
|
3547
|
+
} = reactNative.useWindowDimensions();
|
|
3548
|
+
const breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
3549
|
+
|
|
3550
|
+
if (width < breakpointValue) {
|
|
3551
|
+
return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
|
|
3552
|
+
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
|
|
3553
|
+
children: child
|
|
3554
|
+
}))
|
|
3555
|
+
});
|
|
3054
3556
|
}
|
|
3055
|
-
};
|
|
3056
3557
|
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
}
|
|
3558
|
+
return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
|
|
3559
|
+
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
|
|
3560
|
+
children: child
|
|
3561
|
+
}))
|
|
3562
|
+
});
|
|
3563
|
+
}
|
|
3063
3564
|
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3565
|
+
function StoryGridCol({
|
|
3566
|
+
title,
|
|
3567
|
+
titleColor,
|
|
3568
|
+
children,
|
|
3569
|
+
platform = 'all'
|
|
3570
|
+
}) {
|
|
3571
|
+
const isNative = reactNative.Platform.OS === 'ios' || reactNative.Platform.OS === 'android';
|
|
3067
3572
|
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
animationDuration: 1000
|
|
3072
|
-
};
|
|
3573
|
+
if (reactNative.Platform.OS === 'web' && platform === 'native') {
|
|
3574
|
+
return null;
|
|
3575
|
+
}
|
|
3073
3576
|
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
padding: '2px 12px',
|
|
3077
|
-
primary: {
|
|
3078
|
-
fill: {
|
|
3079
|
-
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
3080
|
-
borderWidth: 0,
|
|
3081
|
-
borderColor: colors.transparent
|
|
3082
|
-
},
|
|
3083
|
-
outline: {
|
|
3084
|
-
backgroundColor: colors.transparent,
|
|
3085
|
-
borderWidth: 1,
|
|
3086
|
-
borderColor: colors.primary
|
|
3087
|
-
}
|
|
3088
|
-
},
|
|
3089
|
-
default: {
|
|
3090
|
-
fill: {
|
|
3091
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
3092
|
-
borderWidth: 0,
|
|
3093
|
-
borderColor: colors.transparent
|
|
3094
|
-
},
|
|
3095
|
-
outline: {
|
|
3096
|
-
backgroundColor: colors.transparent,
|
|
3097
|
-
borderWidth: 1,
|
|
3098
|
-
borderColor: colors.black
|
|
3099
|
-
}
|
|
3100
|
-
},
|
|
3101
|
-
danger: {
|
|
3102
|
-
fill: {
|
|
3103
|
-
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
3104
|
-
borderWidth: 0,
|
|
3105
|
-
borderColor: colors.transparent
|
|
3106
|
-
},
|
|
3107
|
-
outline: {
|
|
3108
|
-
backgroundColor: colors.transparent,
|
|
3109
|
-
borderWidth: 1,
|
|
3110
|
-
borderColor: colors.danger
|
|
3111
|
-
}
|
|
3577
|
+
if (isNative && platform === 'web') {
|
|
3578
|
+
return null;
|
|
3112
3579
|
}
|
|
3113
|
-
};
|
|
3114
3580
|
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3581
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3582
|
+
children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
3583
|
+
numberOfLines: 1,
|
|
3584
|
+
color: titleColor,
|
|
3585
|
+
children: title
|
|
3586
|
+
}) : null, children]
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3589
|
+
|
|
3590
|
+
const StoryGrid = {
|
|
3591
|
+
Row: StoryGridRow,
|
|
3592
|
+
Col: StoryGridCol
|
|
3122
3593
|
};
|
|
3123
3594
|
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3595
|
+
const Container$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
3596
|
+
displayName: "Tag__Container",
|
|
3597
|
+
componentId: "kitt-universal__sc-19jmowi-0"
|
|
3598
|
+
})(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], ({
|
|
3599
|
+
theme,
|
|
3600
|
+
type,
|
|
3601
|
+
variant
|
|
3602
|
+
}) => theme.kitt.tag[type][variant].backgroundColor, ({
|
|
3603
|
+
theme,
|
|
3604
|
+
type,
|
|
3605
|
+
variant
|
|
3606
|
+
}) => theme.kitt.tag[type][variant].borderWidth, ({
|
|
3607
|
+
theme,
|
|
3608
|
+
type,
|
|
3609
|
+
variant
|
|
3610
|
+
}) => theme.kitt.tag[type][variant].borderColor, ({
|
|
3611
|
+
theme
|
|
3612
|
+
}) => theme.kitt.tag.padding, ({
|
|
3613
|
+
theme
|
|
3614
|
+
}) => theme.kitt.tag.borderRadius);
|
|
3615
|
+
const getLabelColor = (type, variant) => {
|
|
3616
|
+
switch (type) {
|
|
3617
|
+
case 'danger':
|
|
3618
|
+
{
|
|
3619
|
+
return variant === 'outline' ? 'danger' : 'black';
|
|
3620
|
+
}
|
|
3146
3621
|
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
iconButton,
|
|
3163
|
-
listItem,
|
|
3164
|
-
tooltip,
|
|
3165
|
-
skeleton,
|
|
3166
|
-
breakpoints
|
|
3622
|
+
case 'primary':
|
|
3623
|
+
{
|
|
3624
|
+
return 'primary';
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3627
|
+
case 'default':
|
|
3628
|
+
{
|
|
3629
|
+
return 'black';
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
default:
|
|
3633
|
+
{
|
|
3634
|
+
return 'black';
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3167
3637
|
};
|
|
3638
|
+
function Tag({
|
|
3639
|
+
label,
|
|
3640
|
+
type = 'default',
|
|
3641
|
+
variant = 'fill'
|
|
3642
|
+
}) {
|
|
3643
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container$1, {
|
|
3644
|
+
type: type,
|
|
3645
|
+
variant: variant,
|
|
3646
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
3647
|
+
base: "body-xsmall",
|
|
3648
|
+
color: getLabelColor(type, variant),
|
|
3649
|
+
children: label
|
|
3650
|
+
})
|
|
3651
|
+
});
|
|
3652
|
+
}
|
|
3168
3653
|
|
|
3169
3654
|
function Title({
|
|
3170
3655
|
children
|
|
@@ -3563,65 +4048,6 @@ function TypographyLink({
|
|
|
3563
4048
|
});
|
|
3564
4049
|
}
|
|
3565
4050
|
|
|
3566
|
-
function matchWindowSize({
|
|
3567
|
-
width,
|
|
3568
|
-
height
|
|
3569
|
-
}, {
|
|
3570
|
-
minWidth,
|
|
3571
|
-
maxWidth,
|
|
3572
|
-
minHeight,
|
|
3573
|
-
maxHeight
|
|
3574
|
-
}) {
|
|
3575
|
-
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3576
|
-
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3577
|
-
return hasWidthMatched && hasHeightMatched;
|
|
3578
|
-
}
|
|
3579
|
-
function useMatchWindowSize(options) {
|
|
3580
|
-
const {
|
|
3581
|
-
width,
|
|
3582
|
-
height
|
|
3583
|
-
} = reactNative.useWindowDimensions();
|
|
3584
|
-
return matchWindowSize({
|
|
3585
|
-
width,
|
|
3586
|
-
height
|
|
3587
|
-
}, options);
|
|
3588
|
-
}
|
|
3589
|
-
|
|
3590
|
-
// eslint-disable-next-line no-restricted-imports
|
|
3591
|
-
function createWindowSizeHelper(dimensions) {
|
|
3592
|
-
return {
|
|
3593
|
-
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
3594
|
-
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
3595
|
-
mapWindowWidth: (...widthList) => {
|
|
3596
|
-
if ((process.env.NODE_ENV !== "production")) {
|
|
3597
|
-
widthList.slice(1).forEach(([minWidth], index) => {
|
|
3598
|
-
const previousMinWidth = widthList[index][0];
|
|
3599
|
-
|
|
3600
|
-
if (previousMinWidth > minWidth) {
|
|
3601
|
-
throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
|
|
3602
|
-
}
|
|
3603
|
-
});
|
|
3604
|
-
}
|
|
3605
|
-
|
|
3606
|
-
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
3607
|
-
minWidth: Number(minWidth)
|
|
3608
|
-
}));
|
|
3609
|
-
if (!found) return null;
|
|
3610
|
-
return found[1];
|
|
3611
|
-
}
|
|
3612
|
-
};
|
|
3613
|
-
}
|
|
3614
|
-
|
|
3615
|
-
function useKittTheme() {
|
|
3616
|
-
const dimensions = reactNative.useWindowDimensions();
|
|
3617
|
-
return react.useMemo(() => {
|
|
3618
|
-
return {
|
|
3619
|
-
kitt: theme,
|
|
3620
|
-
responsive: createWindowSizeHelper(dimensions)
|
|
3621
|
-
};
|
|
3622
|
-
}, [dimensions]);
|
|
3623
|
-
}
|
|
3624
|
-
|
|
3625
4051
|
const hex2rgba = (hex, alpha = 1) => {
|
|
3626
4052
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
3627
4053
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
@@ -3664,6 +4090,8 @@ exports.useWindowSize = reactNative.useWindowDimensions;
|
|
|
3664
4090
|
exports.Avatar = Avatar;
|
|
3665
4091
|
exports.Button = Button;
|
|
3666
4092
|
exports.Card = Card;
|
|
4093
|
+
exports.Checkbox = Checkbox;
|
|
4094
|
+
exports.DatePicker = DatePicker;
|
|
3667
4095
|
exports.Emoji = Emoji;
|
|
3668
4096
|
exports.ExternalLink = ExternalLink;
|
|
3669
4097
|
exports.Flex = Flex;
|
|
@@ -3675,7 +4103,9 @@ exports.InputFeedback = InputFeedback;
|
|
|
3675
4103
|
exports.InputField = InputField;
|
|
3676
4104
|
exports.InputIcon = InputIcon;
|
|
3677
4105
|
exports.InputPassword = InputPassword;
|
|
4106
|
+
exports.InputPhone = InputPhone;
|
|
3678
4107
|
exports.InputPressable = InputPressable;
|
|
4108
|
+
exports.InputTag = InputTag;
|
|
3679
4109
|
exports.InputText = InputText;
|
|
3680
4110
|
exports.KittBreakpoints = KittBreakpoints;
|
|
3681
4111
|
exports.KittBreakpointsMax = KittBreakpointsMax;
|