@ornikar/kitt-universal 11.2.0 → 13.0.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/.vscode/settings.json +3 -0
- package/babel-plugin-csf-to-jest.js +15 -1
- package/dist/definitions/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts +15 -0
- package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts.map +1 -0
- package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts +4 -0
- package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts.map +1 -0
- package/dist/definitions/Choices/ChoiceItem.d.ts +2 -3
- package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
- package/dist/definitions/Choices/ChoiceItemContainer.d.ts +5 -5
- package/dist/definitions/Choices/ChoiceItemContainer.d.ts.map +1 -1
- package/dist/definitions/Choices/utils/getBackgroundColor.d.ts +9 -0
- package/dist/definitions/Choices/utils/getBackgroundColor.d.ts.map +1 -0
- package/dist/definitions/Choices/utils/getBorderRadius.d.ts +3 -0
- package/dist/definitions/Choices/utils/getBorderRadius.d.ts.map +1 -0
- package/dist/definitions/Choices/utils/getCurrentTextColor.d.ts +10 -0
- package/dist/definitions/Choices/utils/getCurrentTextColor.d.ts.map +1 -0
- package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItem.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItemContent.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItemSideContent.d.ts.map +1 -1
- package/dist/definitions/Overlay/Overlay.d.ts.map +1 -1
- package/dist/definitions/PageLoader/PageLoader.d.ts.map +1 -1
- package/dist/definitions/PageLoader/PageLoader.web.d.ts.map +1 -1
- package/dist/definitions/Picker/Picker.d.ts.map +1 -1
- package/dist/definitions/Picker/PickerItem.d.ts.map +1 -1
- package/dist/definitions/Skeleton/SkeletonContent.d.ts.map +1 -1
- package/dist/definitions/Skeleton/SkeletonContent.web.d.ts.map +1 -1
- package/dist/definitions/Tag/Tag.d.ts.map +1 -1
- package/dist/definitions/TimePicker/ModalDateTimePicker.d.ts +7 -3
- package/dist/definitions/TimePicker/ModalDateTimePicker.d.ts.map +1 -1
- package/dist/definitions/TimePicker/TimePicker.d.ts +19 -8
- package/dist/definitions/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/definitions/TimePicker/TimePicker.web.d.ts +2 -1
- package/dist/definitions/TimePicker/TimePicker.web.d.ts.map +1 -1
- package/dist/definitions/TimePicker/TimePickerPressable.d.ts +20 -0
- package/dist/definitions/TimePicker/TimePickerPressable.d.ts.map +1 -0
- package/dist/definitions/TimePicker/utils/formatDateToTimeString.d.ts +2 -0
- package/dist/definitions/TimePicker/utils/formatDateToTimeString.d.ts.map +1 -0
- package/dist/definitions/TimePicker/utils/getCurrentInternalForcedState.d.ts +10 -0
- package/dist/definitions/TimePicker/utils/getCurrentInternalForcedState.d.ts.map +1 -0
- package/dist/definitions/VerticalSteps/Step.d.ts +16 -0
- package/dist/definitions/VerticalSteps/Step.d.ts.map +1 -0
- package/dist/definitions/VerticalSteps/StepIcon.d.ts +13 -0
- package/dist/definitions/VerticalSteps/StepIcon.d.ts.map +1 -0
- package/dist/definitions/VerticalSteps/VerticalSteps.d.ts +12 -0
- package/dist/definitions/VerticalSteps/VerticalSteps.d.ts.map +1 -0
- package/dist/definitions/VerticalSteps/utils/getStepState.d.ts +3 -0
- package/dist/definitions/VerticalSteps/utils/getStepState.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/components/NativeUIDatePicker/ModalPlatformDateTimePicker.d.ts.map +1 -1
- package/dist/definitions/forms/InputTag/InputTag.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.d.ts +2 -4
- package/dist/definitions/forms/InputText/InputTextContainer.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +2 -9
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts.map +1 -1
- package/dist/definitions/forms/RadioButtonGroup/AnimatedContainer/AnimatedContainer.d.ts +1 -1
- package/dist/definitions/forms/RadioButtonGroup/AnimatedContainer/AnimatedContainer.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +1 -6
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +190 -0
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/story-components/Flex.d.ts +6 -4
- package/dist/definitions/story-components/Flex.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +2 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/choices.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/choices.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/forms.d.ts +1 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/input.d.ts +3 -0
- package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/listItem.d.ts +3 -0
- package/dist/definitions/themes/late-ocean/listItem.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/pageLoader.d.ts +7 -0
- package/dist/definitions/themes/late-ocean/pageLoader.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/picker.d.ts +3 -0
- package/dist/definitions/themes/late-ocean/picker.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/skeleton.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/skeleton.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/tag.d.ts +3 -0
- package/dist/definitions/themes/late-ocean/tag.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/timePicker.d.ts +5 -0
- package/dist/definitions/themes/late-ocean/timePicker.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/verticalSteps.d.ts +14 -0
- package/dist/definitions/themes/late-ocean/verticalSteps.d.ts.map +1 -0
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLinkWebWrapper.d.ts +7 -0
- package/dist/definitions/typography/TypographyLinkWebWrapper.d.ts.map +1 -0
- package/dist/definitions/typography/TypographyLinkWebWrapper.web.d.ts +4 -0
- package/dist/definitions/typography/TypographyLinkWebWrapper.web.d.ts.map +1 -0
- package/dist/definitions/useKittTheme.d.ts +0 -3
- package/dist/definitions/useKittTheme.d.ts.map +1 -1
- package/dist/definitions/utils/StyleWebWrapper.d.ts +3 -0
- package/dist/definitions/utils/StyleWebWrapper.d.ts.map +1 -1
- package/dist/definitions/utils/storybook/KittThemeDecorator.d.ts +0 -5
- package/dist/definitions/utils/storybook/KittThemeDecorator.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts +4 -1
- package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +1278 -1181
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +1278 -1181
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +1285 -1209
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +819 -791
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +1143 -1041
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +7 -5
- package/dist/index-node-14.17.cjs.web.js +693 -619
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +59 -14
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +59 -14
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +59 -14
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +59 -14
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +59 -14
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +59 -14
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +7 -5
- package/dist/tsbuildinfo +1 -1
- package/package.json +7 -11
- package/typings/react-native-web.d.ts +2 -0
- package/.stylelintrc +0 -3
- package/dist/definitions/Modal/Body.d.ts +0 -6
- package/dist/definitions/Modal/Body.d.ts.map +0 -1
- package/dist/definitions/Modal/Footer.d.ts +0 -6
- package/dist/definitions/Modal/Footer.d.ts.map +0 -1
- package/dist/definitions/Modal/Header.d.ts +0 -8
- package/dist/definitions/Modal/Header.d.ts.map +0 -1
- package/dist/definitions/Modal/Modal.d.ts +0 -21
- package/dist/definitions/Modal/Modal.d.ts.map +0 -1
- package/dist/definitions/Modal/OnCloseContext.d.ts +0 -3
- package/dist/definitions/Modal/OnCloseContext.d.ts.map +0 -1
- package/dist/definitions/TimePicker/useTimePicker.d.ts +0 -14
- package/dist/definitions/TimePicker/useTimePicker.d.ts.map +0 -1
- package/dist/definitions/forms/styledTextInputMixin.d.ts +0 -8
- package/dist/definitions/forms/styledTextInputMixin.d.ts.map +0 -1
- package/dist/definitions/utils/tests/styled-component-typing-test.d.ts +0 -19
- package/dist/definitions/utils/tests/styled-component-typing-test.d.ts.map +0 -1
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts +0 -50
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts.map +0 -1
- package/dist/definitions/utils/withTheme.d.ts +0 -7
- package/dist/definitions/utils/withTheme.d.ts.map +0 -1
- package/dist/index-browser-all.es.css +0 -1
- package/dist/index-node-14.17.cjs.css +0 -1
|
@@ -10,7 +10,6 @@ const reactNative = require('react-native');
|
|
|
10
10
|
const kittIcons = require('@ornikar/kitt-icons');
|
|
11
11
|
const bottomSheet$1 = require('@gorhom/bottom-sheet');
|
|
12
12
|
const reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
13
|
-
const styled = require('styled-components/native');
|
|
14
13
|
const twemojiParser = require('twemoji-parser');
|
|
15
14
|
const WebBrowser = require('expo-web-browser');
|
|
16
15
|
const DateTimePicker = require('@react-native-community/datetimepicker');
|
|
@@ -20,7 +19,6 @@ const Svg = require('react-native-svg');
|
|
|
20
19
|
const picker$1 = require('@react-native-picker/picker');
|
|
21
20
|
const expoLinearGradient = require('expo-linear-gradient');
|
|
22
21
|
const reactNative$1 = require('@floating-ui/react-native');
|
|
23
|
-
const react = require('@linaria/react');
|
|
24
22
|
const addons = require('@storybook/addons');
|
|
25
23
|
|
|
26
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
|
|
@@ -39,7 +37,6 @@ function _interopNamespace(e) {
|
|
|
39
37
|
|
|
40
38
|
const React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
39
|
const Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
|
|
42
|
-
const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
43
40
|
const WebBrowser__namespace = /*#__PURE__*/_interopNamespace(WebBrowser);
|
|
44
41
|
const DateTimePicker__default = /*#__PURE__*/_interopDefaultLegacy(DateTimePicker);
|
|
45
42
|
const Svg__default = /*#__PURE__*/_interopDefaultLegacy(Svg);
|
|
@@ -932,6 +929,9 @@ const inputStatesStyle = {
|
|
|
932
929
|
color: colors.black
|
|
933
930
|
}
|
|
934
931
|
};
|
|
932
|
+
const webAnimationDuration = '200ms';
|
|
933
|
+
const webAnimationTimingFunction = 'ease-in-out';
|
|
934
|
+
const webAnimationProperty = 'border-color';
|
|
935
935
|
const input = {
|
|
936
936
|
minHeight: 40,
|
|
937
937
|
color: {
|
|
@@ -951,9 +951,9 @@ const input = {
|
|
|
951
951
|
vertical: 5
|
|
952
952
|
},
|
|
953
953
|
transition: {
|
|
954
|
-
property:
|
|
955
|
-
duration:
|
|
956
|
-
timingFunction:
|
|
954
|
+
property: webAnimationProperty,
|
|
955
|
+
duration: webAnimationDuration,
|
|
956
|
+
timingFunction: webAnimationTimingFunction
|
|
957
957
|
},
|
|
958
958
|
states: inputStatesStyle
|
|
959
959
|
};
|
|
@@ -1052,6 +1052,10 @@ const textArea = {
|
|
|
1052
1052
|
minHeight: 120
|
|
1053
1053
|
};
|
|
1054
1054
|
|
|
1055
|
+
const timePicker = {
|
|
1056
|
+
minWidth: 100
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1055
1059
|
const forms = {
|
|
1056
1060
|
datePicker,
|
|
1057
1061
|
input,
|
|
@@ -1060,7 +1064,8 @@ const forms = {
|
|
|
1060
1064
|
textArea,
|
|
1061
1065
|
checkbox,
|
|
1062
1066
|
inputTag,
|
|
1063
|
-
radioButtonGroup
|
|
1067
|
+
radioButtonGroup,
|
|
1068
|
+
timePicker
|
|
1064
1069
|
};
|
|
1065
1070
|
|
|
1066
1071
|
const webAnimationContentDuration = 600;
|
|
@@ -1150,25 +1155,34 @@ const iconButton = {
|
|
|
1150
1155
|
|
|
1151
1156
|
const listItem = {
|
|
1152
1157
|
padding: '12px 16px',
|
|
1158
|
+
verticalPadding: 12,
|
|
1159
|
+
horizontalPadding: 16,
|
|
1153
1160
|
borderColor: colors.separator,
|
|
1154
1161
|
borderWidth: 1,
|
|
1155
1162
|
innerMargin: 8
|
|
1156
1163
|
};
|
|
1157
1164
|
|
|
1165
|
+
const pageLoaderSize = 60;
|
|
1166
|
+
const pageLoaderStrokeWidth = 3;
|
|
1167
|
+
const webAnimationDelay = 500;
|
|
1168
|
+
const webAnimationCircleBackgroundFillDuration = 1000;
|
|
1169
|
+
const webAnimationFilledCircleFillDuration = 1800;
|
|
1170
|
+
const webAnimationFilledCircleRotationDuration = 2160;
|
|
1171
|
+
const fillEasingFunction = [0.39, 0.575, 0.565, 1];
|
|
1158
1172
|
const pageLoader = {
|
|
1159
|
-
size:
|
|
1160
|
-
strokeWidth:
|
|
1173
|
+
size: pageLoaderSize,
|
|
1174
|
+
strokeWidth: pageLoaderStrokeWidth,
|
|
1161
1175
|
colors: {
|
|
1162
1176
|
base: colors.separator,
|
|
1163
1177
|
fill: colors.primary
|
|
1164
1178
|
},
|
|
1165
1179
|
animation: {
|
|
1166
|
-
delay:
|
|
1167
|
-
circleBackgroundFillDuration:
|
|
1168
|
-
filledCircleFillDuration:
|
|
1180
|
+
delay: webAnimationDelay,
|
|
1181
|
+
circleBackgroundFillDuration: webAnimationCircleBackgroundFillDuration,
|
|
1182
|
+
filledCircleFillDuration: webAnimationFilledCircleFillDuration,
|
|
1169
1183
|
groupFilledCircleRotationDuration: 1800,
|
|
1170
|
-
filledCircleRotationDuration:
|
|
1171
|
-
fillEasingFunction
|
|
1184
|
+
filledCircleRotationDuration: webAnimationFilledCircleRotationDuration,
|
|
1185
|
+
fillEasingFunction
|
|
1172
1186
|
}
|
|
1173
1187
|
};
|
|
1174
1188
|
|
|
@@ -1191,6 +1205,8 @@ const picker = {
|
|
|
1191
1205
|
},
|
|
1192
1206
|
android: {
|
|
1193
1207
|
padding: '12px 24px',
|
|
1208
|
+
verticalPadding: 12,
|
|
1209
|
+
horizontalPadding: 24,
|
|
1194
1210
|
default: {
|
|
1195
1211
|
backgroundColor: colors.transparent
|
|
1196
1212
|
},
|
|
@@ -1266,9 +1282,11 @@ const shadows = {
|
|
|
1266
1282
|
}
|
|
1267
1283
|
};
|
|
1268
1284
|
|
|
1285
|
+
const skeletonBackgroundColor = lateOceanColorPalette.black100;
|
|
1286
|
+
const skeletonFlareColor = lateOceanColorPalette.black200;
|
|
1269
1287
|
const skeleton = {
|
|
1270
|
-
backgroundColor:
|
|
1271
|
-
flareColor:
|
|
1288
|
+
backgroundColor: skeletonBackgroundColor,
|
|
1289
|
+
flareColor: skeletonFlareColor,
|
|
1272
1290
|
animationDuration: 1000,
|
|
1273
1291
|
shape: {
|
|
1274
1292
|
bar: {
|
|
@@ -1289,6 +1307,8 @@ const skeleton = {
|
|
|
1289
1307
|
const tag = {
|
|
1290
1308
|
borderRadius: 10,
|
|
1291
1309
|
padding: '2px 12px',
|
|
1310
|
+
verticalPadding: 2,
|
|
1311
|
+
horizontalPadding: 12,
|
|
1292
1312
|
primary: {
|
|
1293
1313
|
fill: {
|
|
1294
1314
|
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
@@ -1365,6 +1385,27 @@ const tooltip = {
|
|
|
1365
1385
|
}
|
|
1366
1386
|
};
|
|
1367
1387
|
|
|
1388
|
+
const verticalSteps = {
|
|
1389
|
+
active: {
|
|
1390
|
+
icon: {
|
|
1391
|
+
backgroundColor: colors.primary,
|
|
1392
|
+
textColor: colors.white
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
done: {
|
|
1396
|
+
icon: {
|
|
1397
|
+
backgroundColor: lateOceanColorPalette.moonPurple,
|
|
1398
|
+
textColor: colors.primary
|
|
1399
|
+
}
|
|
1400
|
+
},
|
|
1401
|
+
default: {
|
|
1402
|
+
icon: {
|
|
1403
|
+
backgroundColor: colors.disabled,
|
|
1404
|
+
textColor: colors.blackDisabled
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1368
1409
|
const breakpoints = {
|
|
1369
1410
|
values: {
|
|
1370
1411
|
base: 0,
|
|
@@ -1416,7 +1457,8 @@ const theme = {
|
|
|
1416
1457
|
tooltip,
|
|
1417
1458
|
typography,
|
|
1418
1459
|
fullscreenModal,
|
|
1419
|
-
actionCard
|
|
1460
|
+
actionCard,
|
|
1461
|
+
verticalSteps
|
|
1420
1462
|
};
|
|
1421
1463
|
|
|
1422
1464
|
const KittThemeContext = /*#__PURE__*/React.createContext({
|
|
@@ -2058,7 +2100,7 @@ function ButtonPadding({
|
|
|
2058
2100
|
});
|
|
2059
2101
|
}
|
|
2060
2102
|
|
|
2061
|
-
function DisabledBorder
|
|
2103
|
+
function DisabledBorder() {
|
|
2062
2104
|
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
2063
2105
|
position: "absolute",
|
|
2064
2106
|
top: 0,
|
|
@@ -2262,7 +2304,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
2262
2304
|
isPressed: isPressed,
|
|
2263
2305
|
isFocused: isFocused,
|
|
2264
2306
|
children: children
|
|
2265
|
-
}), disabled ? /*#__PURE__*/jsxRuntime.jsx(DisabledBorder
|
|
2307
|
+
}), disabled ? /*#__PURE__*/jsxRuntime.jsx(DisabledBorder, {}) : null, /*#__PURE__*/jsxRuntime.jsx(FocusBorder, {
|
|
2266
2308
|
type: type,
|
|
2267
2309
|
variant: variant,
|
|
2268
2310
|
isFocused: isFocused || isFocusedInternal,
|
|
@@ -2644,18 +2686,18 @@ function ModalBehaviourPortal({
|
|
|
2644
2686
|
});
|
|
2645
2687
|
}
|
|
2646
2688
|
|
|
2647
|
-
const OnCloseContext
|
|
2689
|
+
const OnCloseContext = /*#__PURE__*/React.createContext(() => {});
|
|
2648
2690
|
function OnCloseProvider({
|
|
2649
2691
|
children,
|
|
2650
2692
|
onClose
|
|
2651
2693
|
}) {
|
|
2652
|
-
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext
|
|
2694
|
+
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
|
|
2653
2695
|
value: onClose,
|
|
2654
2696
|
children: children
|
|
2655
2697
|
});
|
|
2656
2698
|
}
|
|
2657
2699
|
function useOnCloseModalBehaviour() {
|
|
2658
|
-
const onClose = React.useContext(OnCloseContext
|
|
2700
|
+
const onClose = React.useContext(OnCloseContext);
|
|
2659
2701
|
return onClose;
|
|
2660
2702
|
}
|
|
2661
2703
|
|
|
@@ -2695,21 +2737,17 @@ function ModalBehaviour({
|
|
|
2695
2737
|
}
|
|
2696
2738
|
ModalBehaviour.CloseButton = CloseButton;
|
|
2697
2739
|
|
|
2698
|
-
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
2699
|
-
const OverlayPressable = /*#__PURE__*/styled__default(reactNative.Pressable).withConfig({
|
|
2700
|
-
displayName: "Overlay__OverlayPressable",
|
|
2701
|
-
componentId: "kitt-universal__sc-1cz1gbr-0"
|
|
2702
|
-
})(({
|
|
2703
|
-
theme
|
|
2704
|
-
}) => ({
|
|
2705
|
-
...reactNative.StyleSheet.absoluteFillObject,
|
|
2706
|
-
backgroundColor: theme.kitt.colors.overlay.dark
|
|
2707
|
-
}));
|
|
2708
2740
|
function Overlay({
|
|
2709
2741
|
onPress
|
|
2710
2742
|
}) {
|
|
2711
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
2743
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
|
|
2712
2744
|
accessibilityRole: "none",
|
|
2745
|
+
position: "absolute",
|
|
2746
|
+
top: "0",
|
|
2747
|
+
left: "0",
|
|
2748
|
+
right: "0",
|
|
2749
|
+
bottom: "0",
|
|
2750
|
+
backgroundColor: "kitt.overlay.dark",
|
|
2713
2751
|
onPress: onPress
|
|
2714
2752
|
});
|
|
2715
2753
|
}
|
|
@@ -3108,6 +3146,61 @@ CardModal.Header = CardModalHeader;
|
|
|
3108
3146
|
CardModal.Footer = CardModalFooter;
|
|
3109
3147
|
CardModal.ModalBehaviour = CardModalBehaviour;
|
|
3110
3148
|
|
|
3149
|
+
function getBackgroundColor$3({
|
|
3150
|
+
isDisabled,
|
|
3151
|
+
isSelected,
|
|
3152
|
+
isHovered,
|
|
3153
|
+
isPressed
|
|
3154
|
+
}) {
|
|
3155
|
+
if (isDisabled) return 'kitt.choices.item.disabled.backgroundColor';
|
|
3156
|
+
if (isSelected && isHovered) return 'kitt.choices.item.hoverWhenSelected.backgroundColor';
|
|
3157
|
+
if (isPressed) return 'kitt.choices.item.pressed.backgroundColor';
|
|
3158
|
+
if (isHovered) return 'kitt.choices.item.hover.backgroundColor';
|
|
3159
|
+
if (isSelected) return 'kitt.choices.item.selected.backgroundColor';
|
|
3160
|
+
return 'kitt.choices.item.default.backgroundColor';
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3163
|
+
function getBorderRadius(variant) {
|
|
3164
|
+
// The clean way to have the rounded effect would have been to know the children height since radius >= height * 0.5
|
|
3165
|
+
// We don't control over the height of the rendered children we just go with a arbitrary really high value
|
|
3166
|
+
return variant === 'rounded' ? Number.MAX_SAFE_INTEGER : 'kitt.choices.item.borderRadius';
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
function AnimatedChoiceItemView({
|
|
3170
|
+
children,
|
|
3171
|
+
variant,
|
|
3172
|
+
size,
|
|
3173
|
+
isHovered,
|
|
3174
|
+
isPressed,
|
|
3175
|
+
isDisabled,
|
|
3176
|
+
isSelected,
|
|
3177
|
+
animatedStyles
|
|
3178
|
+
}) {
|
|
3179
|
+
const sx = nativeBase.useSx();
|
|
3180
|
+
const style = sx({
|
|
3181
|
+
position: 'relative',
|
|
3182
|
+
borderRadius: getBorderRadius(variant),
|
|
3183
|
+
backgroundColor: getBackgroundColor$3({
|
|
3184
|
+
isDisabled,
|
|
3185
|
+
isSelected,
|
|
3186
|
+
isHovered,
|
|
3187
|
+
isPressed
|
|
3188
|
+
}),
|
|
3189
|
+
paddingX: size === 'small' ? 'kitt.4' : {
|
|
3190
|
+
base: 'kitt.4',
|
|
3191
|
+
small: 'kitt.6'
|
|
3192
|
+
},
|
|
3193
|
+
paddingY: size === 'small' ? 'kitt.2' : {
|
|
3194
|
+
base: 'kitt.4',
|
|
3195
|
+
small: 'kitt.6'
|
|
3196
|
+
}
|
|
3197
|
+
});
|
|
3198
|
+
return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
|
|
3199
|
+
style: [style, animatedStyles],
|
|
3200
|
+
children: children
|
|
3201
|
+
});
|
|
3202
|
+
}
|
|
3203
|
+
|
|
3111
3204
|
const useNativeAnimation$2 = ({
|
|
3112
3205
|
selected,
|
|
3113
3206
|
disabled,
|
|
@@ -3201,80 +3294,7 @@ function getCurrentTextColor$1({
|
|
|
3201
3294
|
if (isSelected || isPressed) return 'white';
|
|
3202
3295
|
return 'black';
|
|
3203
3296
|
}
|
|
3204
|
-
function getBorderRadius(defaultRadius, variant) {
|
|
3205
|
-
// The clean way to have the rounded effect would have been to know the children height since radius >= height * 0.5
|
|
3206
|
-
// We don't control over the height of the rendered children we just go with a arbitrary really high value
|
|
3207
3297
|
|
|
3208
|
-
if (variant === 'rounded') return 800;
|
|
3209
|
-
return defaultRadius;
|
|
3210
|
-
}
|
|
3211
|
-
const DisabledBorder = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
3212
|
-
displayName: "ChoiceItem__DisabledBorder",
|
|
3213
|
-
componentId: "kitt-universal__sc-wuv3y6-0"
|
|
3214
|
-
})(["border-radius:", "px;", ";"], ({
|
|
3215
|
-
theme,
|
|
3216
|
-
$variant
|
|
3217
|
-
}) => getBorderRadius(theme.kitt.choices.item.borderRadius, $variant), ({
|
|
3218
|
-
theme
|
|
3219
|
-
}) => {
|
|
3220
|
-
const {
|
|
3221
|
-
width,
|
|
3222
|
-
color
|
|
3223
|
-
} = theme.kitt.choices.item.disabled.border;
|
|
3224
|
-
return styled.css(["border:", "px solid ", ";"], width, color);
|
|
3225
|
-
});
|
|
3226
|
-
const ChoiceItemView = /*#__PURE__*/styled__default(reactNative.Platform.OS === 'web' ? reactNative.View : Animated__default.View).withConfig({
|
|
3227
|
-
displayName: "ChoiceItem__ChoiceItemView",
|
|
3228
|
-
componentId: "kitt-universal__sc-wuv3y6-1"
|
|
3229
|
-
})(["position:relative;border-radius:", "px;background-color:", ";", ";", ""], ({
|
|
3230
|
-
theme,
|
|
3231
|
-
$variant
|
|
3232
|
-
}) => getBorderRadius(theme.kitt.choices.item.borderRadius, $variant), ({
|
|
3233
|
-
theme,
|
|
3234
|
-
$isHovered,
|
|
3235
|
-
$isPressed,
|
|
3236
|
-
$isDisabled,
|
|
3237
|
-
$isSelected
|
|
3238
|
-
}) => {
|
|
3239
|
-
const {
|
|
3240
|
-
hoverWhenSelected,
|
|
3241
|
-
hover,
|
|
3242
|
-
disabled,
|
|
3243
|
-
selected,
|
|
3244
|
-
pressed,
|
|
3245
|
-
default: defaultBackground
|
|
3246
|
-
} = theme.kitt.choices.item.backgroundColor;
|
|
3247
|
-
if ($isDisabled) return disabled;
|
|
3248
|
-
if ($isSelected && $isHovered) return hoverWhenSelected;
|
|
3249
|
-
if ($isPressed) return pressed;
|
|
3250
|
-
if ($isHovered) return hover;
|
|
3251
|
-
if ($isSelected) return selected;
|
|
3252
|
-
return defaultBackground;
|
|
3253
|
-
}, ({
|
|
3254
|
-
theme,
|
|
3255
|
-
$size
|
|
3256
|
-
}) => {
|
|
3257
|
-
const {
|
|
3258
|
-
base,
|
|
3259
|
-
small
|
|
3260
|
-
} = theme.kitt.choices.item.padding;
|
|
3261
|
-
if ($size === 'small') {
|
|
3262
|
-
return styled.css(["padding:", "px ", "px;"], base / 2, base);
|
|
3263
|
-
}
|
|
3264
|
-
return theme.responsive.ifWindowSizeMatches({
|
|
3265
|
-
minWidth: KittBreakpoints.SMALL
|
|
3266
|
-
}, styled.css(["padding:", "px;"], small), styled.css(["padding:", "px;"], base));
|
|
3267
|
-
}, ({
|
|
3268
|
-
theme
|
|
3269
|
-
}) => {
|
|
3270
|
-
if (reactNative.Platform.OS !== 'web') return undefined;
|
|
3271
|
-
const {
|
|
3272
|
-
property,
|
|
3273
|
-
duration,
|
|
3274
|
-
timingFunction
|
|
3275
|
-
} = theme.kitt.choices.item.transition;
|
|
3276
|
-
return styled.css(["transition:", " ", "ms ", ";"], property, duration, timingFunction);
|
|
3277
|
-
});
|
|
3278
3298
|
function ChoiceItem({
|
|
3279
3299
|
type = 'button',
|
|
3280
3300
|
value,
|
|
@@ -3328,14 +3348,14 @@ function ChoiceItem({
|
|
|
3328
3348
|
children: ({
|
|
3329
3349
|
isHovered,
|
|
3330
3350
|
isPressed
|
|
3331
|
-
}) => /*#__PURE__*/jsxRuntime.jsxs(
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3351
|
+
}) => /*#__PURE__*/jsxRuntime.jsxs(AnimatedChoiceItemView, {
|
|
3352
|
+
animatedStyles: backgroundStyles,
|
|
3353
|
+
isHovered: isHovered || isHoveredInternal,
|
|
3354
|
+
isDisabled: disabled,
|
|
3355
|
+
isSelected: selected,
|
|
3356
|
+
isPressed: isPressed || isPressedInternal,
|
|
3357
|
+
variant: variant,
|
|
3358
|
+
size: size,
|
|
3339
3359
|
children: [/*#__PURE__*/jsxRuntime.jsx(Typography.SetDefaultColor, {
|
|
3340
3360
|
value: getCurrentTextColor$1({
|
|
3341
3361
|
isDisabled: disabled,
|
|
@@ -3344,31 +3364,32 @@ function ChoiceItem({
|
|
|
3344
3364
|
isHovered: isHovered || isHoveredInternal
|
|
3345
3365
|
}),
|
|
3346
3366
|
children: children
|
|
3347
|
-
}), disabled ? /*#__PURE__*/jsxRuntime.jsx(
|
|
3348
|
-
|
|
3349
|
-
|
|
3367
|
+
}), disabled ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3368
|
+
borderRadius: getBorderRadius(variant),
|
|
3369
|
+
borderWidth: "kitt.choices.item.disabled.borderWidth",
|
|
3370
|
+
borderColor: "kitt.choices.item.disabled.borderColor",
|
|
3371
|
+
position: "absolute",
|
|
3372
|
+
top: "0",
|
|
3373
|
+
right: "0",
|
|
3374
|
+
left: "0",
|
|
3375
|
+
bottom: "0"
|
|
3350
3376
|
}) : null]
|
|
3351
3377
|
})
|
|
3352
3378
|
});
|
|
3353
3379
|
}
|
|
3354
3380
|
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
if ($direction === 'row') {
|
|
3368
|
-
return styled.css(["margin-right:", "px;"], $isLast ? 0 : row);
|
|
3369
|
-
}
|
|
3370
|
-
return styled.css(["margin-bottom:", "px;"], $isLast ? 0 : column);
|
|
3371
|
-
});
|
|
3381
|
+
function ChoiceItemContainer({
|
|
3382
|
+
children,
|
|
3383
|
+
direction,
|
|
3384
|
+
isLast
|
|
3385
|
+
}) {
|
|
3386
|
+
const currentItemMarginValue = isLast ? undefined : 'kitt.3';
|
|
3387
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3388
|
+
marginRight: direction === 'row' ? currentItemMarginValue : undefined,
|
|
3389
|
+
marginBottom: direction === 'column' ? currentItemMarginValue : undefined,
|
|
3390
|
+
children: children
|
|
3391
|
+
});
|
|
3392
|
+
}
|
|
3372
3393
|
|
|
3373
3394
|
function ChoicesContainer({
|
|
3374
3395
|
direction,
|
|
@@ -3428,8 +3449,8 @@ function Choices({
|
|
|
3428
3449
|
...sharedProps
|
|
3429
3450
|
});
|
|
3430
3451
|
return /*#__PURE__*/jsxRuntime.jsx(ChoiceItemContainer, {
|
|
3431
|
-
|
|
3432
|
-
|
|
3452
|
+
direction: direction,
|
|
3453
|
+
isLast: index === childrenArray.length - 1,
|
|
3433
3454
|
children: element
|
|
3434
3455
|
}, child.key);
|
|
3435
3456
|
})
|
|
@@ -4193,10 +4214,14 @@ function stringToNumber(text) {
|
|
|
4193
4214
|
return parseInt(text, 10);
|
|
4194
4215
|
}
|
|
4195
4216
|
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4217
|
+
function InputTextContainer({
|
|
4218
|
+
children
|
|
4219
|
+
}) {
|
|
4220
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
4221
|
+
position: "relative",
|
|
4222
|
+
children: children
|
|
4223
|
+
});
|
|
4224
|
+
}
|
|
4200
4225
|
|
|
4201
4226
|
const InputText = /*#__PURE__*/React.forwardRef(({
|
|
4202
4227
|
id,
|
|
@@ -4219,7 +4244,6 @@ const InputText = /*#__PURE__*/React.forwardRef(({
|
|
|
4219
4244
|
});
|
|
4220
4245
|
const shouldHandleSingleLineOnIOS = reactNative.Platform.OS === 'ios' && !multiline;
|
|
4221
4246
|
return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
|
|
4222
|
-
$isDisabled: disabled,
|
|
4223
4247
|
children: [/*#__PURE__*/jsxRuntime.jsx(nativeBase.Input, {
|
|
4224
4248
|
ref: ref,
|
|
4225
4249
|
multiline: multiline,
|
|
@@ -4254,7 +4278,7 @@ const InputText = /*#__PURE__*/React.forwardRef(({
|
|
|
4254
4278
|
});
|
|
4255
4279
|
});
|
|
4256
4280
|
|
|
4257
|
-
function getCurrentInternalForcedState({
|
|
4281
|
+
function getCurrentInternalForcedState$1({
|
|
4258
4282
|
isDisabled,
|
|
4259
4283
|
isHoveredInternal,
|
|
4260
4284
|
isFocusedInternal,
|
|
@@ -4280,7 +4304,7 @@ const InputPart = /*#__PURE__*/React.forwardRef(({
|
|
|
4280
4304
|
}, ref) => {
|
|
4281
4305
|
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
4282
4306
|
ref: ref,
|
|
4283
|
-
internalForceState: getCurrentInternalForcedState({
|
|
4307
|
+
internalForceState: getCurrentInternalForcedState$1({
|
|
4284
4308
|
isDisabled: disabled,
|
|
4285
4309
|
isHoveredInternal,
|
|
4286
4310
|
isFocusedInternal,
|
|
@@ -4578,445 +4602,97 @@ const DatePickerAndroid = /*#__PURE__*/React.forwardRef(({
|
|
|
4578
4602
|
});
|
|
4579
4603
|
});
|
|
4580
4604
|
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4605
|
+
function getDatePickerDisplayMode() {
|
|
4606
|
+
if (reactNative.Platform.OS === 'android') return 'calendar';
|
|
4607
|
+
if (reactNative.Platform.OS === 'ios') return 'spinner';
|
|
4608
|
+
return 'default';
|
|
4609
|
+
}
|
|
4610
|
+
function PlatformDateTimePicker({
|
|
4611
|
+
value,
|
|
4612
|
+
defaultDate = new Date(),
|
|
4613
|
+
maximumDate,
|
|
4614
|
+
minimuDate,
|
|
4615
|
+
testID,
|
|
4616
|
+
onChange
|
|
4591
4617
|
}) {
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4618
|
+
const theme = useTheme();
|
|
4619
|
+
const displayMode = getDatePickerDisplayMode();
|
|
4620
|
+
const iosProps = reactNative.Platform.OS === 'ios' ? {
|
|
4621
|
+
textColor: theme.kitt.colors.primary
|
|
4622
|
+
} : {};
|
|
4623
|
+
return /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
4624
|
+
is24Hour: true,
|
|
4625
|
+
testID: testID,
|
|
4626
|
+
value: value || defaultDate,
|
|
4627
|
+
mode: "date",
|
|
4628
|
+
maximumDate: maximumDate,
|
|
4629
|
+
minimumDate: minimuDate,
|
|
4630
|
+
display: displayMode,
|
|
4631
|
+
...iosProps,
|
|
4632
|
+
onChange: (_event, date) => onChange(date)
|
|
4596
4633
|
});
|
|
4597
4634
|
}
|
|
4598
4635
|
|
|
4599
|
-
|
|
4600
|
-
displayName: "Footer__FooterView",
|
|
4601
|
-
componentId: "kitt-universal__sc-1ujq2dc-0"
|
|
4602
|
-
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
|
|
4603
|
-
theme
|
|
4604
|
-
}) => theme.kitt.spacing * 4, ({
|
|
4605
|
-
theme
|
|
4606
|
-
}) => theme.kitt.colors.separator);
|
|
4607
|
-
function ModalFooter({
|
|
4636
|
+
function ModalTitle({
|
|
4608
4637
|
children
|
|
4609
4638
|
}) {
|
|
4610
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
4611
|
-
children:
|
|
4639
|
+
return /*#__PURE__*/jsxRuntime.jsx(CardModal.Header, {
|
|
4640
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
4641
|
+
base: "body",
|
|
4642
|
+
variant: "bold",
|
|
4643
|
+
children: children
|
|
4644
|
+
})
|
|
4612
4645
|
});
|
|
4613
4646
|
}
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
return 'kitt.iconButton.primary.pressed.backgroundColor';
|
|
4622
|
-
case 'white':
|
|
4623
|
-
return 'kitt.iconButton.white.pressed.backgroundColor';
|
|
4624
|
-
case 'black':
|
|
4625
|
-
default:
|
|
4626
|
-
return 'kitt.iconButton.black.pressed.backgroundColor';
|
|
4627
|
-
}
|
|
4628
|
-
}
|
|
4629
|
-
function Background({
|
|
4630
|
-
color,
|
|
4631
|
-
isDisabled,
|
|
4647
|
+
function ModalPlatformDateTimePicker({
|
|
4648
|
+
title,
|
|
4649
|
+
isVisible,
|
|
4650
|
+
value,
|
|
4651
|
+
validateButtonLabel,
|
|
4652
|
+
onClose,
|
|
4653
|
+
onChange,
|
|
4632
4654
|
...props
|
|
4633
4655
|
}) {
|
|
4634
|
-
|
|
4635
|
-
...props,
|
|
4636
|
-
width: "100%",
|
|
4637
|
-
height: "100%",
|
|
4638
|
-
borderRadius: "kitt.iconButton.borderRadius",
|
|
4639
|
-
backgroundColor: getBackgroundColor$1(color, isDisabled)
|
|
4640
|
-
});
|
|
4641
|
-
}
|
|
4656
|
+
const [currentValue, setCurrentValue] = React.useState(value);
|
|
4642
4657
|
|
|
4643
|
-
|
|
4644
|
-
color,
|
|
4645
|
-
isDisabled,
|
|
4646
|
-
opacityStyles
|
|
4647
|
-
}) {
|
|
4648
|
-
const sx = nativeBase.useSx();
|
|
4649
|
-
const currentOpacityStyles = isDisabled ? {
|
|
4650
|
-
opacity: 1
|
|
4651
|
-
} : opacityStyles;
|
|
4652
|
-
const styles = sx({
|
|
4653
|
-
position: 'absolute',
|
|
4654
|
-
top: 0,
|
|
4655
|
-
left: 0,
|
|
4656
|
-
width: '100%',
|
|
4657
|
-
height: '100%'
|
|
4658
|
-
});
|
|
4659
|
-
return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
|
|
4660
|
-
style: [styles, currentOpacityStyles],
|
|
4661
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Background, {
|
|
4662
|
-
color: color,
|
|
4663
|
-
isDisabled: isDisabled
|
|
4664
|
-
})
|
|
4665
|
-
});
|
|
4666
|
-
}
|
|
4658
|
+
// Prevent unsynced value between the modal and its parent state
|
|
4667
4659
|
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
}
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
withSpring: Animated.withSpring,
|
|
4705
|
-
pressed
|
|
4706
|
-
};
|
|
4707
|
-
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
4708
|
-
_f.__workletHash = 10645190329247;
|
|
4709
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/hooks/useNativeAnimation.ts (24:41)";
|
|
4710
|
-
_f.__optimalization = 2;
|
|
4711
|
-
return _f;
|
|
4712
|
-
}());
|
|
4713
|
-
const scaleStyles = Animated.useAnimatedStyle(function () {
|
|
4714
|
-
const _f = function () {
|
|
4715
|
-
return {
|
|
4716
|
-
transform: [{
|
|
4717
|
-
scale: Animated.withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base.default)
|
|
4718
|
-
}]
|
|
4719
|
-
};
|
|
4720
|
-
};
|
|
4721
|
-
_f._closure = {
|
|
4722
|
-
withSpring: Animated.withSpring,
|
|
4723
|
-
pressed,
|
|
4724
|
-
theme: {
|
|
4725
|
-
kitt: {
|
|
4726
|
-
iconButton: {
|
|
4727
|
-
scale: {
|
|
4728
|
-
base: {
|
|
4729
|
-
active: theme.kitt.iconButton.scale.base.active,
|
|
4730
|
-
default: theme.kitt.iconButton.scale.base.default
|
|
4731
|
-
}
|
|
4732
|
-
}
|
|
4733
|
-
}
|
|
4734
|
-
}
|
|
4735
|
-
}
|
|
4736
|
-
};
|
|
4737
|
-
_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)}]};}}";
|
|
4738
|
-
_f.__workletHash = 13861998831411;
|
|
4739
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/hooks/useNativeAnimation.ts (30:39)";
|
|
4740
|
-
_f.__optimalization = 2;
|
|
4741
|
-
return _f;
|
|
4742
|
-
}());
|
|
4743
|
-
return {
|
|
4744
|
-
opacityStyles,
|
|
4745
|
-
scaleStyles,
|
|
4746
|
-
onPressIn: () => {
|
|
4747
|
-
pressed.value = true;
|
|
4748
|
-
},
|
|
4749
|
-
onPressOut: () => {
|
|
4750
|
-
pressed.value = false;
|
|
4751
|
-
}
|
|
4752
|
-
};
|
|
4753
|
-
}
|
|
4754
|
-
|
|
4755
|
-
function IconButton({
|
|
4756
|
-
icon,
|
|
4757
|
-
color = 'black',
|
|
4758
|
-
disabled,
|
|
4759
|
-
testID,
|
|
4760
|
-
accessibilityLabel,
|
|
4761
|
-
accessibilityRole = 'button',
|
|
4762
|
-
isHoveredInternal,
|
|
4763
|
-
isPressedInternal,
|
|
4764
|
-
isFocusedInternal,
|
|
4765
|
-
onPress
|
|
4766
|
-
}) {
|
|
4767
|
-
const {
|
|
4768
|
-
onPressIn,
|
|
4769
|
-
onPressOut,
|
|
4770
|
-
opacityStyles,
|
|
4771
|
-
scaleStyles
|
|
4772
|
-
} = useNativeAnimation$1({
|
|
4773
|
-
isDisabled: disabled,
|
|
4774
|
-
isPressed: isPressedInternal
|
|
4775
|
-
});
|
|
4776
|
-
return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
|
|
4777
|
-
testID: testID,
|
|
4778
|
-
disabled: disabled,
|
|
4779
|
-
width: "kitt.iconButton.width",
|
|
4780
|
-
height: "kitt.iconButton.height",
|
|
4781
|
-
accessibilityLabel: accessibilityLabel,
|
|
4782
|
-
accessibilityRole: accessibilityRole,
|
|
4783
|
-
_web: {
|
|
4784
|
-
style: {
|
|
4785
|
-
backfaceVisibility: 'hidden',
|
|
4786
|
-
transform: [{
|
|
4787
|
-
translate3d: '0'
|
|
4788
|
-
}]
|
|
4789
|
-
}
|
|
4790
|
-
},
|
|
4791
|
-
borderRadius: "kitt.iconButton.borderRadius",
|
|
4792
|
-
borderColor: disabled ? 'kitt.iconButton.disabled.borderColor' : 'kitt.iconButton.borderColor',
|
|
4793
|
-
borderWidth: disabled ? 'kitt.iconButton.borderWidth' : 0,
|
|
4794
|
-
onPress: onPress,
|
|
4795
|
-
onPressIn: onPressIn,
|
|
4796
|
-
onPressOut: onPressOut,
|
|
4797
|
-
children: ({
|
|
4798
|
-
isHovered,
|
|
4799
|
-
isPressed,
|
|
4800
|
-
isFocused
|
|
4801
|
-
}) => {
|
|
4802
|
-
const isCurrentHovered = isHovered || isHoveredInternal;
|
|
4803
|
-
const isCurrentPressed = isPressed || isPressedInternal;
|
|
4804
|
-
return /*#__PURE__*/jsxRuntime.jsxs(AnimatedScale, {
|
|
4805
|
-
isDisabled: disabled,
|
|
4806
|
-
isHovered: isCurrentHovered,
|
|
4807
|
-
isPressed: isCurrentPressed,
|
|
4808
|
-
scaleStyles: scaleStyles,
|
|
4809
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedBackground, {
|
|
4810
|
-
color: color,
|
|
4811
|
-
isDisabled: disabled,
|
|
4812
|
-
isHovered: isCurrentHovered,
|
|
4813
|
-
isPressed: isCurrentPressed,
|
|
4814
|
-
isFocused: isFocused || isFocusedInternal,
|
|
4815
|
-
opacityStyles: opacityStyles
|
|
4816
|
-
}), /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
4817
|
-
alignItems: "center",
|
|
4818
|
-
justifyContent: "center",
|
|
4819
|
-
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
4820
|
-
color: disabled ? 'black-light' : color,
|
|
4821
|
-
icon: icon
|
|
4822
|
-
})
|
|
4823
|
-
})]
|
|
4824
|
-
});
|
|
4825
|
-
}
|
|
4826
|
-
});
|
|
4827
|
-
}
|
|
4828
|
-
|
|
4829
|
-
const OnCloseContext = /*#__PURE__*/React.createContext(() => {});
|
|
4830
|
-
|
|
4831
|
-
const HeaderView = /*#__PURE__*/styled__default.View.withConfig({
|
|
4832
|
-
displayName: "Header__HeaderView",
|
|
4833
|
-
componentId: "kitt-universal__sc-1iwabch-0"
|
|
4834
|
-
})(["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;"], ({
|
|
4835
|
-
theme
|
|
4836
|
-
}) => theme.kitt.spacing * 2, ({
|
|
4837
|
-
theme
|
|
4838
|
-
}) => theme.kitt.colors.separator);
|
|
4839
|
-
const LeftIconView = /*#__PURE__*/styled__default.View.withConfig({
|
|
4840
|
-
displayName: "Header__LeftIconView",
|
|
4841
|
-
componentId: "kitt-universal__sc-1iwabch-1"
|
|
4842
|
-
})(["align-self:flex-start;margin-right:", "px;"], ({
|
|
4843
|
-
theme
|
|
4844
|
-
}) => theme.kitt.spacing * 2);
|
|
4845
|
-
const RightIconView = /*#__PURE__*/styled__default.View.withConfig({
|
|
4846
|
-
displayName: "Header__RightIconView",
|
|
4847
|
-
componentId: "kitt-universal__sc-1iwabch-2"
|
|
4848
|
-
})(["align-self:flex-start;margin-left:", "px;"], ({
|
|
4849
|
-
theme
|
|
4850
|
-
}) => theme.kitt.spacing * 2);
|
|
4851
|
-
const TitleView = /*#__PURE__*/styled__default.View.withConfig({
|
|
4852
|
-
displayName: "Header__TitleView",
|
|
4853
|
-
componentId: "kitt-universal__sc-1iwabch-3"
|
|
4854
|
-
})(["padding-left:", "px;flex-shrink:1;"], ({
|
|
4855
|
-
theme,
|
|
4856
|
-
isIconLeft
|
|
4857
|
-
}) => isIconLeft ? 0 : theme.kitt.spacing * 2);
|
|
4858
|
-
function ModalHeader({
|
|
4859
|
-
left,
|
|
4860
|
-
right,
|
|
4861
|
-
children
|
|
4862
|
-
}) {
|
|
4863
|
-
const onClose = React.useContext(OnCloseContext);
|
|
4864
|
-
const isIconLeft = !!left;
|
|
4865
|
-
return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
|
|
4866
|
-
children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
|
|
4867
|
-
children: left
|
|
4868
|
-
}), /*#__PURE__*/jsxRuntime.jsx(TitleView, {
|
|
4869
|
-
isIconLeft: isIconLeft,
|
|
4870
|
-
children: children
|
|
4871
|
-
}), right !== undefined ? right : /*#__PURE__*/jsxRuntime.jsx(RightIconView, {
|
|
4872
|
-
children: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
|
|
4873
|
-
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
|
|
4874
|
-
onPress: onClose
|
|
4875
|
-
})
|
|
4876
|
-
})]
|
|
4877
|
-
});
|
|
4878
|
-
}
|
|
4879
|
-
|
|
4880
|
-
const ModalView = /*#__PURE__*/styled__default.View.withConfig({
|
|
4881
|
-
displayName: "Modal__ModalView",
|
|
4882
|
-
componentId: "kitt-universal__sc-1xy2w5u-0"
|
|
4883
|
-
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
|
|
4884
|
-
theme
|
|
4885
|
-
}) => theme.kitt.spacing * 20, ({
|
|
4886
|
-
theme
|
|
4887
|
-
}) => theme.kitt.spacing * 4);
|
|
4888
|
-
const ContentView$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
4889
|
-
displayName: "Modal__ContentView",
|
|
4890
|
-
componentId: "kitt-universal__sc-1xy2w5u-1"
|
|
4891
|
-
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], ({
|
|
4892
|
-
theme
|
|
4893
|
-
}) => theme.kitt.card.borderRadius, ({
|
|
4894
|
-
theme
|
|
4895
|
-
}) => theme.kitt.colors.uiBackgroundLight);
|
|
4896
|
-
|
|
4897
|
-
/**
|
|
4898
|
-
* @deprecated This component will be deleted in a later Kitt Universal version. Use CardModal instead
|
|
4899
|
-
*/
|
|
4900
|
-
function Modal({
|
|
4901
|
-
visible,
|
|
4902
|
-
children,
|
|
4903
|
-
onClose,
|
|
4904
|
-
onEntered,
|
|
4905
|
-
onExited
|
|
4906
|
-
}) {
|
|
4907
|
-
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
|
|
4908
|
-
value: onClose,
|
|
4909
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Modal, {
|
|
4910
|
-
transparent: true,
|
|
4911
|
-
animationType: "fade",
|
|
4912
|
-
supportedOrientations: ['landscape', 'portrait'],
|
|
4913
|
-
visible: visible,
|
|
4914
|
-
onShow: onEntered,
|
|
4915
|
-
onDismiss: onExited,
|
|
4916
|
-
onRequestClose: onClose,
|
|
4917
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
|
|
4918
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
|
|
4919
|
-
onPress: onClose
|
|
4920
|
-
}), /*#__PURE__*/jsxRuntime.jsx(ContentView$1, {
|
|
4921
|
-
children: children
|
|
4922
|
-
})]
|
|
4923
|
-
})
|
|
4924
|
-
})
|
|
4925
|
-
});
|
|
4926
|
-
}
|
|
4927
|
-
Modal.Header = ModalHeader;
|
|
4928
|
-
Modal.Body = ModalBody;
|
|
4929
|
-
Modal.Footer = ModalFooter;
|
|
4930
|
-
|
|
4931
|
-
function getDatePickerDisplayMode() {
|
|
4932
|
-
if (reactNative.Platform.OS === 'android') return 'calendar';
|
|
4933
|
-
if (reactNative.Platform.OS === 'ios') return 'spinner';
|
|
4934
|
-
return 'default';
|
|
4935
|
-
}
|
|
4936
|
-
function PlatformDateTimePicker({
|
|
4937
|
-
value,
|
|
4938
|
-
defaultDate = new Date(),
|
|
4939
|
-
maximumDate,
|
|
4940
|
-
minimuDate,
|
|
4941
|
-
testID,
|
|
4942
|
-
onChange
|
|
4943
|
-
}) {
|
|
4944
|
-
const theme = useTheme();
|
|
4945
|
-
const displayMode = getDatePickerDisplayMode();
|
|
4946
|
-
const iosProps = reactNative.Platform.OS === 'ios' ? {
|
|
4947
|
-
textColor: theme.kitt.colors.primary
|
|
4948
|
-
} : {};
|
|
4949
|
-
return /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
4950
|
-
is24Hour: true,
|
|
4951
|
-
testID: testID,
|
|
4952
|
-
value: value || defaultDate,
|
|
4953
|
-
mode: "date",
|
|
4954
|
-
maximumDate: maximumDate,
|
|
4955
|
-
minimumDate: minimuDate,
|
|
4956
|
-
display: displayMode,
|
|
4957
|
-
...iosProps,
|
|
4958
|
-
onChange: (_event, date) => onChange(date)
|
|
4959
|
-
});
|
|
4960
|
-
}
|
|
4961
|
-
|
|
4962
|
-
function ModalTitle({
|
|
4963
|
-
children
|
|
4964
|
-
}) {
|
|
4965
|
-
return /*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
|
|
4966
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
4967
|
-
base: "body",
|
|
4968
|
-
variant: "bold",
|
|
4969
|
-
children: children
|
|
4970
|
-
})
|
|
4971
|
-
});
|
|
4972
|
-
}
|
|
4973
|
-
function ModalPlatformDateTimePicker({
|
|
4974
|
-
title,
|
|
4975
|
-
isVisible,
|
|
4976
|
-
value,
|
|
4977
|
-
validateButtonLabel,
|
|
4978
|
-
onClose,
|
|
4979
|
-
onChange,
|
|
4980
|
-
...props
|
|
4981
|
-
}) {
|
|
4982
|
-
const [currentValue, setCurrentValue] = React.useState(value);
|
|
4983
|
-
|
|
4984
|
-
// Prevent unsynced value between the modal and its parent state
|
|
4985
|
-
|
|
4986
|
-
return /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
4987
|
-
visible: Boolean(isVisible),
|
|
4988
|
-
onClose: () => {
|
|
4989
|
-
setCurrentValue(value);
|
|
4990
|
-
onClose();
|
|
4991
|
-
},
|
|
4992
|
-
children: isVisible ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4993
|
-
children: [title ? /*#__PURE__*/jsxRuntime.jsx(ModalTitle, {
|
|
4994
|
-
children: title
|
|
4995
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
|
|
4996
|
-
children: /*#__PURE__*/jsxRuntime.jsx(PlatformDateTimePicker, {
|
|
4997
|
-
...props,
|
|
4998
|
-
value: currentValue,
|
|
4999
|
-
onChange: newDate => {
|
|
5000
|
-
setCurrentValue(prev => {
|
|
5001
|
-
return newDate || prev;
|
|
5002
|
-
});
|
|
5003
|
-
}
|
|
5004
|
-
})
|
|
5005
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
|
|
5006
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
5007
|
-
stretch: true,
|
|
5008
|
-
type: "primary",
|
|
5009
|
-
onPress: () => {
|
|
5010
|
-
onChange(currentValue);
|
|
5011
|
-
},
|
|
5012
|
-
children: validateButtonLabel ? /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
5013
|
-
children: validateButtonLabel
|
|
5014
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
|
|
5015
|
-
id: "kitt-universal.ModalPlatformDateTimePicker.confirm"
|
|
5016
|
-
})
|
|
5017
|
-
})
|
|
5018
|
-
})]
|
|
5019
|
-
}) : null
|
|
4660
|
+
return /*#__PURE__*/jsxRuntime.jsx(CardModal.ModalBehaviour, {
|
|
4661
|
+
visible: Boolean(isVisible),
|
|
4662
|
+
onClose: () => {
|
|
4663
|
+
setCurrentValue(value);
|
|
4664
|
+
onClose();
|
|
4665
|
+
},
|
|
4666
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CardModal, {
|
|
4667
|
+
children: isVisible ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4668
|
+
children: [title ? /*#__PURE__*/jsxRuntime.jsx(ModalTitle, {
|
|
4669
|
+
children: title
|
|
4670
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(CardModal.Body, {
|
|
4671
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PlatformDateTimePicker, {
|
|
4672
|
+
...props,
|
|
4673
|
+
value: currentValue,
|
|
4674
|
+
onChange: newDate => {
|
|
4675
|
+
setCurrentValue(prev => {
|
|
4676
|
+
return newDate || prev;
|
|
4677
|
+
});
|
|
4678
|
+
}
|
|
4679
|
+
})
|
|
4680
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CardModal.Footer, {
|
|
4681
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4682
|
+
stretch: true,
|
|
4683
|
+
type: "primary",
|
|
4684
|
+
onPress: () => {
|
|
4685
|
+
onChange(currentValue);
|
|
4686
|
+
},
|
|
4687
|
+
children: validateButtonLabel ? /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
4688
|
+
children: validateButtonLabel
|
|
4689
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
|
|
4690
|
+
id: "kitt-universal.ModalPlatformDateTimePicker.confirm"
|
|
4691
|
+
})
|
|
4692
|
+
})
|
|
4693
|
+
})]
|
|
4694
|
+
}) : null
|
|
4695
|
+
})
|
|
5020
4696
|
});
|
|
5021
4697
|
}
|
|
5022
4698
|
|
|
@@ -5307,31 +4983,6 @@ const InputPhone = /*#__PURE__*/React.forwardRef(({
|
|
|
5307
4983
|
});
|
|
5308
4984
|
|
|
5309
4985
|
const getTypographyColor = type => type ? 'white' : 'black';
|
|
5310
|
-
const InputTagContainer = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
5311
|
-
displayName: "InputTag__InputTagContainer",
|
|
5312
|
-
componentId: "kitt-universal__sc-1511dsf-0"
|
|
5313
|
-
})(["align-items:center;justify-content:center;flex-direction:row;align-self:flex-start;overflow:hidden;padding-horizontal:", "px;background-color:", ";border-radius:", "px;"], ({
|
|
5314
|
-
theme
|
|
5315
|
-
}) => theme.kitt.spacing * 2, ({
|
|
5316
|
-
theme,
|
|
5317
|
-
type
|
|
5318
|
-
}) => {
|
|
5319
|
-
if (type === 'success') {
|
|
5320
|
-
return theme.kitt.forms.inputTag.success.backgroundColor;
|
|
5321
|
-
}
|
|
5322
|
-
if (type === 'danger') {
|
|
5323
|
-
return theme.kitt.forms.inputTag.danger.backgroundColor;
|
|
5324
|
-
}
|
|
5325
|
-
return theme.kitt.forms.inputTag.default.backgroundColor;
|
|
5326
|
-
}, ({
|
|
5327
|
-
theme
|
|
5328
|
-
}) => theme.kitt.forms.inputTag.borderRadius);
|
|
5329
|
-
const IconContainer = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
5330
|
-
displayName: "InputTag__IconContainer",
|
|
5331
|
-
componentId: "kitt-universal__sc-1511dsf-1"
|
|
5332
|
-
})(["margin-right:", "px;"], ({
|
|
5333
|
-
theme
|
|
5334
|
-
}) => theme.kitt.spacing);
|
|
5335
4986
|
function InputTag({
|
|
5336
4987
|
children,
|
|
5337
4988
|
type,
|
|
@@ -5339,15 +4990,23 @@ function InputTag({
|
|
|
5339
4990
|
}) {
|
|
5340
4991
|
const typographyColor = getTypographyColor(type);
|
|
5341
4992
|
const theme = useTheme();
|
|
5342
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
5343
|
-
|
|
5344
|
-
|
|
4993
|
+
return /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
4994
|
+
alignItems: "center",
|
|
4995
|
+
justifyContent: "center",
|
|
4996
|
+
flexDirection: "row",
|
|
4997
|
+
alignSelf: "flex-start",
|
|
4998
|
+
overflow: "hidden",
|
|
4999
|
+
paddingX: "kitt.2",
|
|
5000
|
+
backgroundColor: `kitt.forms.inputTag.${type || 'default'}.backgroundColor`,
|
|
5001
|
+
borderRadius: "kitt.forms.inputTag.borderRadius",
|
|
5002
|
+
children: [icon ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
5003
|
+
marginRight: "kitt.1",
|
|
5345
5004
|
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
5346
5005
|
icon: icon,
|
|
5347
5006
|
size: theme.kitt.forms.inputTag.iconSize,
|
|
5348
5007
|
color: typographyColor
|
|
5349
5008
|
})
|
|
5350
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
5009
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
5351
5010
|
base: "body-small",
|
|
5352
5011
|
color: typographyColor,
|
|
5353
5012
|
children: children
|
|
@@ -5401,7 +5060,7 @@ function InnerCircle({
|
|
|
5401
5060
|
});
|
|
5402
5061
|
}
|
|
5403
5062
|
|
|
5404
|
-
function getBackgroundColor({
|
|
5063
|
+
function getBackgroundColor$1({
|
|
5405
5064
|
isDisabled,
|
|
5406
5065
|
isPressed,
|
|
5407
5066
|
isHovered,
|
|
@@ -5447,7 +5106,7 @@ function OuterCircle({
|
|
|
5447
5106
|
width: "kitt.forms.radio.size",
|
|
5448
5107
|
height: "kitt.forms.radio.size",
|
|
5449
5108
|
borderRadius: "kitt.forms.radio.borderRadius",
|
|
5450
|
-
backgroundColor: getBackgroundColor({
|
|
5109
|
+
backgroundColor: getBackgroundColor$1({
|
|
5451
5110
|
isChecked,
|
|
5452
5111
|
isDisabled,
|
|
5453
5112
|
isFocused,
|
|
@@ -5527,45 +5186,23 @@ const Radio = /*#__PURE__*/React.forwardRef(({
|
|
|
5527
5186
|
});
|
|
5528
5187
|
});
|
|
5529
5188
|
|
|
5530
|
-
const StyledAnimatedView = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
|
|
5531
|
-
displayName: "AnimatedContainer__StyledAnimatedView",
|
|
5532
|
-
componentId: "kitt-universal__sc-qzh0y7-0"
|
|
5533
|
-
})(["border-width:", "px;border-top-left-radius:", "px;border-bottom-left-radius:", "px;border-top-right-radius:", "px;border-bottom-right-radius:", "px;border-left-width:", "px;"], ({
|
|
5534
|
-
theme
|
|
5535
|
-
}) => theme.kitt.forms.radioButtonGroup.item.borderWidth, ({
|
|
5536
|
-
theme,
|
|
5537
|
-
$isFirst
|
|
5538
|
-
}) => $isFirst ? theme.kitt.forms.radioButtonGroup.item.borderRadius : 0, ({
|
|
5539
|
-
theme,
|
|
5540
|
-
$isFirst
|
|
5541
|
-
}) => $isFirst ? theme.kitt.forms.radioButtonGroup.item.borderRadius : 0, ({
|
|
5542
|
-
theme,
|
|
5543
|
-
$isLast
|
|
5544
|
-
}) => $isLast ? theme.kitt.forms.radioButtonGroup.item.borderRadius : 0, ({
|
|
5545
|
-
theme,
|
|
5546
|
-
$isLast
|
|
5547
|
-
}) => $isLast ? theme.kitt.forms.radioButtonGroup.item.borderRadius : 0, ({
|
|
5548
|
-
theme,
|
|
5549
|
-
$isFirst
|
|
5550
|
-
}) => $isFirst ? theme.kitt.forms.radioButtonGroup.item.borderWidth : 0);
|
|
5551
5189
|
function AnimatedContainer({
|
|
5552
5190
|
children,
|
|
5553
|
-
isFocused,
|
|
5554
|
-
isPressed,
|
|
5555
|
-
isSelected,
|
|
5556
|
-
isDisabled,
|
|
5557
5191
|
isFirst,
|
|
5558
5192
|
isLast,
|
|
5559
5193
|
animatedStyles
|
|
5560
5194
|
}) {
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5195
|
+
const sx = nativeBase.useSx();
|
|
5196
|
+
const styles = sx({
|
|
5197
|
+
borderWidth: 'kitt.forms.radioButtonGroup.item.borderWidth',
|
|
5198
|
+
borderTopLeftRadius: isFirst ? 'kitt.forms.radioButtonGroup.item.borderRadius' : 0,
|
|
5199
|
+
borderBottomLeftRadius: isFirst ? 'kitt.forms.radioButtonGroup.item.borderRadius' : 0,
|
|
5200
|
+
borderTopRightRadius: isLast ? 'kitt.forms.radioButtonGroup.item.borderRadius' : 0,
|
|
5201
|
+
borderBottomRightRadius: isLast ? 'kitt.forms.radioButtonGroup.item.borderRadius' : 0,
|
|
5202
|
+
borderLeftWidth: isFirst ? 'kitt.forms.radioButtonGroup.item.borderWidth' : 0
|
|
5203
|
+
});
|
|
5204
|
+
return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
|
|
5205
|
+
style: [styles, animatedStyles],
|
|
5569
5206
|
children: children
|
|
5570
5207
|
});
|
|
5571
5208
|
}
|
|
@@ -5604,7 +5241,7 @@ function HoverBorder({
|
|
|
5604
5241
|
});
|
|
5605
5242
|
}
|
|
5606
5243
|
|
|
5607
|
-
const useNativeAnimation = ({
|
|
5244
|
+
const useNativeAnimation$1 = ({
|
|
5608
5245
|
isDisabled,
|
|
5609
5246
|
isSelected,
|
|
5610
5247
|
isPressedInternal
|
|
@@ -5717,7 +5354,7 @@ function RadioButton({
|
|
|
5717
5354
|
onPressIn,
|
|
5718
5355
|
onPressOut,
|
|
5719
5356
|
animatedStyles
|
|
5720
|
-
} = useNativeAnimation({
|
|
5357
|
+
} = useNativeAnimation$1({
|
|
5721
5358
|
isDisabled: disabled,
|
|
5722
5359
|
isSelected: selected,
|
|
5723
5360
|
isPressedInternal
|
|
@@ -6185,45 +5822,259 @@ function FullscreenModalHeader({
|
|
|
6185
5822
|
});
|
|
6186
5823
|
}
|
|
6187
5824
|
|
|
6188
|
-
function FullscreenModal({
|
|
6189
|
-
body,
|
|
6190
|
-
header,
|
|
6191
|
-
footer,
|
|
6192
|
-
backgroundColor
|
|
5825
|
+
function FullscreenModal({
|
|
5826
|
+
body,
|
|
5827
|
+
header,
|
|
5828
|
+
footer,
|
|
5829
|
+
backgroundColor
|
|
5830
|
+
}) {
|
|
5831
|
+
return /*#__PURE__*/jsxRuntime.jsxs(FullscreenModalContainer, {
|
|
5832
|
+
backgroundColor: backgroundColor,
|
|
5833
|
+
children: [header ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
5834
|
+
children: header
|
|
5835
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
5836
|
+
flexGrow: 1,
|
|
5837
|
+
flexShrink: 1,
|
|
5838
|
+
justifyContent: "space-between",
|
|
5839
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
5840
|
+
bounces: false,
|
|
5841
|
+
contentContainerStyle: {
|
|
5842
|
+
flexGrow: 1,
|
|
5843
|
+
position: 'relative'
|
|
5844
|
+
},
|
|
5845
|
+
children: body
|
|
5846
|
+
}), footer || null]
|
|
5847
|
+
})]
|
|
5848
|
+
});
|
|
5849
|
+
}
|
|
5850
|
+
FullscreenModal.Header = FullscreenModalHeader;
|
|
5851
|
+
FullscreenModal.Footer = FullscreenModalFooter;
|
|
5852
|
+
FullscreenModal.Body = FullscreenModalBody;
|
|
5853
|
+
FullscreenModal.ModalBehaviour = FullscreenModalBehaviour;
|
|
5854
|
+
|
|
5855
|
+
function Highlight({
|
|
5856
|
+
variant = 'regular',
|
|
5857
|
+
children
|
|
5858
|
+
}) {
|
|
5859
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
5860
|
+
borderRadius: "kitt.highlight.borderRadius",
|
|
5861
|
+
padding: "kitt.highlight.padding",
|
|
5862
|
+
backgroundColor: `kitt.highlight.${variant}.backgroundColor`,
|
|
5863
|
+
children: children
|
|
5864
|
+
});
|
|
5865
|
+
}
|
|
5866
|
+
|
|
5867
|
+
function getBackgroundColor(color, isDisabled) {
|
|
5868
|
+
if (isDisabled) {
|
|
5869
|
+
return 'kitt.iconButton.disabled.backgroundColor';
|
|
5870
|
+
}
|
|
5871
|
+
switch (color) {
|
|
5872
|
+
case 'primary':
|
|
5873
|
+
return 'kitt.iconButton.primary.pressed.backgroundColor';
|
|
5874
|
+
case 'white':
|
|
5875
|
+
return 'kitt.iconButton.white.pressed.backgroundColor';
|
|
5876
|
+
case 'black':
|
|
5877
|
+
default:
|
|
5878
|
+
return 'kitt.iconButton.black.pressed.backgroundColor';
|
|
5879
|
+
}
|
|
5880
|
+
}
|
|
5881
|
+
function Background({
|
|
5882
|
+
color,
|
|
5883
|
+
isDisabled,
|
|
5884
|
+
...props
|
|
5885
|
+
}) {
|
|
5886
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
5887
|
+
...props,
|
|
5888
|
+
width: "100%",
|
|
5889
|
+
height: "100%",
|
|
5890
|
+
borderRadius: "kitt.iconButton.borderRadius",
|
|
5891
|
+
backgroundColor: getBackgroundColor(color, isDisabled)
|
|
5892
|
+
});
|
|
5893
|
+
}
|
|
5894
|
+
|
|
5895
|
+
function AnimatedBackground({
|
|
5896
|
+
color,
|
|
5897
|
+
isDisabled,
|
|
5898
|
+
opacityStyles
|
|
5899
|
+
}) {
|
|
5900
|
+
const sx = nativeBase.useSx();
|
|
5901
|
+
const currentOpacityStyles = isDisabled ? {
|
|
5902
|
+
opacity: 1
|
|
5903
|
+
} : opacityStyles;
|
|
5904
|
+
const styles = sx({
|
|
5905
|
+
position: 'absolute',
|
|
5906
|
+
top: 0,
|
|
5907
|
+
left: 0,
|
|
5908
|
+
width: '100%',
|
|
5909
|
+
height: '100%'
|
|
5910
|
+
});
|
|
5911
|
+
return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
|
|
5912
|
+
style: [styles, currentOpacityStyles],
|
|
5913
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Background, {
|
|
5914
|
+
color: color,
|
|
5915
|
+
isDisabled: isDisabled
|
|
5916
|
+
})
|
|
5917
|
+
});
|
|
5918
|
+
}
|
|
5919
|
+
|
|
5920
|
+
function AnimatedScale({
|
|
5921
|
+
isDisabled,
|
|
5922
|
+
scaleStyles,
|
|
5923
|
+
children
|
|
5924
|
+
}) {
|
|
5925
|
+
const sx = nativeBase.useSx();
|
|
5926
|
+
const currentOpacityStyles = isDisabled ? {
|
|
5927
|
+
transform: [{
|
|
5928
|
+
scale: 1
|
|
5929
|
+
}]
|
|
5930
|
+
} : scaleStyles;
|
|
5931
|
+
const styles = sx({
|
|
5932
|
+
position: 'relative',
|
|
5933
|
+
alignItems: 'center',
|
|
5934
|
+
justifyContent: 'center',
|
|
5935
|
+
width: '100%',
|
|
5936
|
+
height: '100%'
|
|
5937
|
+
});
|
|
5938
|
+
return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
|
|
5939
|
+
style: [styles, currentOpacityStyles],
|
|
5940
|
+
children: children
|
|
5941
|
+
});
|
|
5942
|
+
}
|
|
5943
|
+
|
|
5944
|
+
function useNativeAnimation({
|
|
5945
|
+
isPressed
|
|
5946
|
+
}) {
|
|
5947
|
+
const theme = useTheme();
|
|
5948
|
+
const pressed = Animated.useSharedValue(!!isPressed);
|
|
5949
|
+
const opacityStyles = Animated.useAnimatedStyle(function () {
|
|
5950
|
+
const _f = function () {
|
|
5951
|
+
return {
|
|
5952
|
+
opacity: Animated.withSpring(pressed.value ? 1 : 0)
|
|
5953
|
+
};
|
|
5954
|
+
};
|
|
5955
|
+
_f._closure = {
|
|
5956
|
+
withSpring: Animated.withSpring,
|
|
5957
|
+
pressed
|
|
5958
|
+
};
|
|
5959
|
+
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
5960
|
+
_f.__workletHash = 10645190329247;
|
|
5961
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/hooks/useNativeAnimation.ts (24:41)";
|
|
5962
|
+
_f.__optimalization = 2;
|
|
5963
|
+
return _f;
|
|
5964
|
+
}());
|
|
5965
|
+
const scaleStyles = Animated.useAnimatedStyle(function () {
|
|
5966
|
+
const _f = function () {
|
|
5967
|
+
return {
|
|
5968
|
+
transform: [{
|
|
5969
|
+
scale: Animated.withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base.default)
|
|
5970
|
+
}]
|
|
5971
|
+
};
|
|
5972
|
+
};
|
|
5973
|
+
_f._closure = {
|
|
5974
|
+
withSpring: Animated.withSpring,
|
|
5975
|
+
pressed,
|
|
5976
|
+
theme: {
|
|
5977
|
+
kitt: {
|
|
5978
|
+
iconButton: {
|
|
5979
|
+
scale: {
|
|
5980
|
+
base: {
|
|
5981
|
+
active: theme.kitt.iconButton.scale.base.active,
|
|
5982
|
+
default: theme.kitt.iconButton.scale.base.default
|
|
5983
|
+
}
|
|
5984
|
+
}
|
|
5985
|
+
}
|
|
5986
|
+
}
|
|
5987
|
+
}
|
|
5988
|
+
};
|
|
5989
|
+
_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)}]};}}";
|
|
5990
|
+
_f.__workletHash = 13861998831411;
|
|
5991
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/hooks/useNativeAnimation.ts (30:39)";
|
|
5992
|
+
_f.__optimalization = 2;
|
|
5993
|
+
return _f;
|
|
5994
|
+
}());
|
|
5995
|
+
return {
|
|
5996
|
+
opacityStyles,
|
|
5997
|
+
scaleStyles,
|
|
5998
|
+
onPressIn: () => {
|
|
5999
|
+
pressed.value = true;
|
|
6000
|
+
},
|
|
6001
|
+
onPressOut: () => {
|
|
6002
|
+
pressed.value = false;
|
|
6003
|
+
}
|
|
6004
|
+
};
|
|
6005
|
+
}
|
|
6006
|
+
|
|
6007
|
+
function IconButton({
|
|
6008
|
+
icon,
|
|
6009
|
+
color = 'black',
|
|
6010
|
+
disabled,
|
|
6011
|
+
testID,
|
|
6012
|
+
accessibilityLabel,
|
|
6013
|
+
accessibilityRole = 'button',
|
|
6014
|
+
isHoveredInternal,
|
|
6015
|
+
isPressedInternal,
|
|
6016
|
+
isFocusedInternal,
|
|
6017
|
+
onPress
|
|
6193
6018
|
}) {
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
6203
|
-
bounces: false,
|
|
6204
|
-
contentContainerStyle: {
|
|
6205
|
-
flexGrow: 1,
|
|
6206
|
-
position: 'relative'
|
|
6207
|
-
},
|
|
6208
|
-
children: body
|
|
6209
|
-
}), footer || null]
|
|
6210
|
-
})]
|
|
6019
|
+
const {
|
|
6020
|
+
onPressIn,
|
|
6021
|
+
onPressOut,
|
|
6022
|
+
opacityStyles,
|
|
6023
|
+
scaleStyles
|
|
6024
|
+
} = useNativeAnimation({
|
|
6025
|
+
isDisabled: disabled,
|
|
6026
|
+
isPressed: isPressedInternal
|
|
6211
6027
|
});
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6028
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
|
|
6029
|
+
testID: testID,
|
|
6030
|
+
disabled: disabled,
|
|
6031
|
+
width: "kitt.iconButton.width",
|
|
6032
|
+
height: "kitt.iconButton.height",
|
|
6033
|
+
accessibilityLabel: accessibilityLabel,
|
|
6034
|
+
accessibilityRole: accessibilityRole,
|
|
6035
|
+
_web: {
|
|
6036
|
+
style: {
|
|
6037
|
+
backfaceVisibility: 'hidden',
|
|
6038
|
+
transform: [{
|
|
6039
|
+
translate3d: '0'
|
|
6040
|
+
}]
|
|
6041
|
+
}
|
|
6042
|
+
},
|
|
6043
|
+
borderRadius: "kitt.iconButton.borderRadius",
|
|
6044
|
+
borderColor: disabled ? 'kitt.iconButton.disabled.borderColor' : 'kitt.iconButton.borderColor',
|
|
6045
|
+
borderWidth: disabled ? 'kitt.iconButton.borderWidth' : 0,
|
|
6046
|
+
onPress: onPress,
|
|
6047
|
+
onPressIn: onPressIn,
|
|
6048
|
+
onPressOut: onPressOut,
|
|
6049
|
+
children: ({
|
|
6050
|
+
isHovered,
|
|
6051
|
+
isPressed,
|
|
6052
|
+
isFocused
|
|
6053
|
+
}) => {
|
|
6054
|
+
const isCurrentHovered = isHovered || isHoveredInternal;
|
|
6055
|
+
const isCurrentPressed = isPressed || isPressedInternal;
|
|
6056
|
+
return /*#__PURE__*/jsxRuntime.jsxs(AnimatedScale, {
|
|
6057
|
+
isDisabled: disabled,
|
|
6058
|
+
isHovered: isCurrentHovered,
|
|
6059
|
+
isPressed: isCurrentPressed,
|
|
6060
|
+
scaleStyles: scaleStyles,
|
|
6061
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedBackground, {
|
|
6062
|
+
color: color,
|
|
6063
|
+
isDisabled: disabled,
|
|
6064
|
+
isHovered: isCurrentHovered,
|
|
6065
|
+
isPressed: isCurrentPressed,
|
|
6066
|
+
isFocused: isFocused || isFocusedInternal,
|
|
6067
|
+
opacityStyles: opacityStyles
|
|
6068
|
+
}), /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
6069
|
+
alignItems: "center",
|
|
6070
|
+
justifyContent: "center",
|
|
6071
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
6072
|
+
color: disabled ? 'black-light' : color,
|
|
6073
|
+
icon: icon
|
|
6074
|
+
})
|
|
6075
|
+
})]
|
|
6076
|
+
});
|
|
6077
|
+
}
|
|
6227
6078
|
});
|
|
6228
6079
|
}
|
|
6229
6080
|
|
|
@@ -6251,89 +6102,46 @@ function useKittMapConfig() {
|
|
|
6251
6102
|
return context;
|
|
6252
6103
|
}
|
|
6253
6104
|
|
|
6254
|
-
const ContentView = /*#__PURE__*/styled__default.View.withConfig({
|
|
6255
|
-
displayName: "ListItemContent__ContentView",
|
|
6256
|
-
componentId: "kitt-universal__sc-57q0u9-0"
|
|
6257
|
-
})(["flex:1 0 0%;align-self:center;"]);
|
|
6258
6105
|
function ListItemContent({
|
|
6259
6106
|
children,
|
|
6260
6107
|
...rest
|
|
6261
6108
|
}) {
|
|
6262
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
6109
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
6110
|
+
alignSelf: "center",
|
|
6111
|
+
flexBasis: "0%",
|
|
6112
|
+
flexGrow: 1,
|
|
6113
|
+
flexShrink: 0,
|
|
6263
6114
|
...rest,
|
|
6264
6115
|
children: children
|
|
6265
6116
|
});
|
|
6266
6117
|
}
|
|
6267
6118
|
|
|
6268
|
-
const SideContainerView = /*#__PURE__*/styled__default.View.withConfig({
|
|
6269
|
-
displayName: "ListItemSideContent__SideContainerView",
|
|
6270
|
-
componentId: "kitt-universal__sc-1vajiw-0"
|
|
6271
|
-
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], ({
|
|
6272
|
-
theme,
|
|
6273
|
-
side
|
|
6274
|
-
}) => side === 'right' ? `${theme.kitt.listItem.innerMargin}px` : 0, ({
|
|
6275
|
-
theme,
|
|
6276
|
-
side
|
|
6277
|
-
}) => side === 'left' ? `${theme.kitt.listItem.innerMargin}px` : 0);
|
|
6278
|
-
|
|
6279
6119
|
// Handles the vertical alignment of the side elements of the list item
|
|
6280
6120
|
function ListItemSideContainer({
|
|
6281
6121
|
children,
|
|
6282
6122
|
side = 'left',
|
|
6283
6123
|
...rest
|
|
6284
6124
|
}) {
|
|
6285
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
6286
|
-
|
|
6125
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
6126
|
+
flexDirection: "row",
|
|
6127
|
+
marginLeft: side === 'right' ? 'kitt.2' : undefined,
|
|
6128
|
+
marginRight: side === 'left' ? 'kitt.2' : undefined,
|
|
6287
6129
|
...rest,
|
|
6288
6130
|
children: children
|
|
6289
6131
|
});
|
|
6290
6132
|
}
|
|
6291
|
-
const SideContentView = /*#__PURE__*/styled__default.View.withConfig({
|
|
6292
|
-
displayName: "ListItemSideContent__SideContentView",
|
|
6293
|
-
componentId: "kitt-universal__sc-1vajiw-1"
|
|
6294
|
-
})(["align-self:", ";"], ({
|
|
6295
|
-
align
|
|
6296
|
-
}) => align);
|
|
6297
6133
|
function ListItemSideContent({
|
|
6298
6134
|
children,
|
|
6299
6135
|
align = 'auto',
|
|
6300
6136
|
...rest
|
|
6301
6137
|
}) {
|
|
6302
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
6303
|
-
|
|
6138
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
6139
|
+
alignSelf: align,
|
|
6304
6140
|
...rest,
|
|
6305
6141
|
children: children
|
|
6306
6142
|
});
|
|
6307
6143
|
}
|
|
6308
6144
|
|
|
6309
|
-
const ContainerView = /*#__PURE__*/styled__default.View.withConfig({
|
|
6310
|
-
displayName: "ListItem__ContainerView",
|
|
6311
|
-
componentId: "kitt-universal__sc-2afp9s-0"
|
|
6312
|
-
})(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], ({
|
|
6313
|
-
withPadding,
|
|
6314
|
-
theme
|
|
6315
|
-
}) => withPadding ? theme.kitt.listItem.padding : 0, ({
|
|
6316
|
-
theme,
|
|
6317
|
-
borders
|
|
6318
|
-
}) => {
|
|
6319
|
-
const {
|
|
6320
|
-
borderWidth
|
|
6321
|
-
} = theme.kitt.listItem;
|
|
6322
|
-
if (borders === 'top') {
|
|
6323
|
-
return `border-top-width: ${borderWidth}px`;
|
|
6324
|
-
}
|
|
6325
|
-
if (borders === 'bottom') {
|
|
6326
|
-
return `border-bottom-width: ${borderWidth}px`;
|
|
6327
|
-
}
|
|
6328
|
-
if (borders === 'both') {
|
|
6329
|
-
return styled.css(["border-top-width:", "px;border-bottom-width:", "px;"], borderWidth, borderWidth);
|
|
6330
|
-
}
|
|
6331
|
-
return 'border: none';
|
|
6332
|
-
}, ({
|
|
6333
|
-
theme
|
|
6334
|
-
}) => theme.kitt.listItem.borderColor, ({
|
|
6335
|
-
theme
|
|
6336
|
-
}) => theme.kitt.colors.uiBackgroundLight);
|
|
6337
6145
|
function ListItem({
|
|
6338
6146
|
children,
|
|
6339
6147
|
withPadding,
|
|
@@ -6352,9 +6160,14 @@ function ListItem({
|
|
|
6352
6160
|
const containerProps = onPress ? undefined : rest;
|
|
6353
6161
|
return /*#__PURE__*/jsxRuntime.jsx(Wrapper, {
|
|
6354
6162
|
...wrapperProps,
|
|
6355
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(
|
|
6356
|
-
|
|
6357
|
-
|
|
6163
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
6164
|
+
flexDirection: "row",
|
|
6165
|
+
paddingX: withPadding ? 'kitt.listItem.horizontalPadding' : undefined,
|
|
6166
|
+
paddingY: withPadding ? 'kitt.listItem.verticalPadding' : undefined,
|
|
6167
|
+
borderColor: "kitt.listItem.borderColor",
|
|
6168
|
+
backgroundColor: "kitt.uiBackgroundLight",
|
|
6169
|
+
borderTopWidth: borders === 'top' || borders === 'both' ? 'kitt.listItem.borderWidth' : undefined,
|
|
6170
|
+
borderBottomWidth: borders === 'bottom' || borders === 'both' ? 'kitt.listItem.borderWidth' : undefined,
|
|
6358
6171
|
...containerProps,
|
|
6359
6172
|
children: [left ? /*#__PURE__*/jsxRuntime.jsx(ListItemSideContainer, {
|
|
6360
6173
|
side: "left",
|
|
@@ -6871,6 +6684,71 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
6871
6684
|
'subtle-dark': theme.button['subtle-dark'],
|
|
6872
6685
|
disabled: theme.button.disabled
|
|
6873
6686
|
},
|
|
6687
|
+
choices: {
|
|
6688
|
+
item: {
|
|
6689
|
+
default: {
|
|
6690
|
+
backgroundColor: theme.choices.item.backgroundColor.default
|
|
6691
|
+
},
|
|
6692
|
+
disabled: {
|
|
6693
|
+
backgroundColor: theme.choices.item.backgroundColor.disabled,
|
|
6694
|
+
borderColor: theme.choices.item.disabled.border.color
|
|
6695
|
+
},
|
|
6696
|
+
selected: {
|
|
6697
|
+
backgroundColor: theme.choices.item.backgroundColor.selected
|
|
6698
|
+
},
|
|
6699
|
+
pressed: {
|
|
6700
|
+
backgroundColor: theme.choices.item.backgroundColor.pressed
|
|
6701
|
+
},
|
|
6702
|
+
hover: {
|
|
6703
|
+
backgroundColor: theme.choices.item.backgroundColor.hover
|
|
6704
|
+
},
|
|
6705
|
+
hoverWhenSelected: {
|
|
6706
|
+
backgroundColor: theme.choices.item.backgroundColor.hoverWhenSelected
|
|
6707
|
+
}
|
|
6708
|
+
}
|
|
6709
|
+
},
|
|
6710
|
+
tag: {
|
|
6711
|
+
primary: {
|
|
6712
|
+
fill: {
|
|
6713
|
+
backgroundColor: theme.tag.primary.fill.backgroundColor,
|
|
6714
|
+
borderColor: theme.tag.primary.fill.borderColor
|
|
6715
|
+
},
|
|
6716
|
+
outline: {
|
|
6717
|
+
backgroundColor: theme.tag.primary.outline.backgroundColor,
|
|
6718
|
+
borderColor: theme.tag.primary.outline.borderColor
|
|
6719
|
+
}
|
|
6720
|
+
},
|
|
6721
|
+
default: {
|
|
6722
|
+
fill: {
|
|
6723
|
+
backgroundColor: theme.tag.default.fill.backgroundColor,
|
|
6724
|
+
borderColor: theme.tag.default.fill.borderColor
|
|
6725
|
+
},
|
|
6726
|
+
outline: {
|
|
6727
|
+
backgroundColor: theme.tag.default.outline.backgroundColor,
|
|
6728
|
+
borderColor: theme.tag.default.outline.borderColor
|
|
6729
|
+
}
|
|
6730
|
+
},
|
|
6731
|
+
danger: {
|
|
6732
|
+
fill: {
|
|
6733
|
+
backgroundColor: theme.tag.danger.fill.backgroundColor,
|
|
6734
|
+
borderColor: theme.tag.danger.fill.borderColor
|
|
6735
|
+
},
|
|
6736
|
+
outline: {
|
|
6737
|
+
backgroundColor: theme.tag.danger.outline.backgroundColor,
|
|
6738
|
+
borderColor: theme.tag.danger.outline.borderColor
|
|
6739
|
+
}
|
|
6740
|
+
},
|
|
6741
|
+
warn: {
|
|
6742
|
+
fill: {
|
|
6743
|
+
backgroundColor: theme.tag.warn.fill.backgroundColor,
|
|
6744
|
+
borderColor: theme.tag.warn.fill.borderColor
|
|
6745
|
+
},
|
|
6746
|
+
outline: {
|
|
6747
|
+
backgroundColor: theme.tag.warn.outline.backgroundColor,
|
|
6748
|
+
borderColor: theme.tag.warn.outline.borderColor
|
|
6749
|
+
}
|
|
6750
|
+
}
|
|
6751
|
+
},
|
|
6874
6752
|
tooltip: {
|
|
6875
6753
|
backgroundColor: theme.tooltip.backgroundColor
|
|
6876
6754
|
},
|
|
@@ -6894,6 +6772,17 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
6894
6772
|
input: {
|
|
6895
6773
|
states: theme.forms.input.states
|
|
6896
6774
|
},
|
|
6775
|
+
inputTag: {
|
|
6776
|
+
danger: {
|
|
6777
|
+
backgroundColor: theme.forms.inputTag.danger.backgroundColor
|
|
6778
|
+
},
|
|
6779
|
+
default: {
|
|
6780
|
+
backgroundColor: theme.forms.inputTag.default.backgroundColor
|
|
6781
|
+
},
|
|
6782
|
+
success: {
|
|
6783
|
+
backgroundColor: theme.forms.inputTag.success.backgroundColor
|
|
6784
|
+
}
|
|
6785
|
+
},
|
|
6897
6786
|
radioButtonGroup: {
|
|
6898
6787
|
item: {
|
|
6899
6788
|
borderColor: theme.forms.radioButtonGroup.item.borderColor,
|
|
@@ -6992,6 +6881,49 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
6992
6881
|
dark: {
|
|
6993
6882
|
backgroundColor: theme.highlight.dark.backgroundColor
|
|
6994
6883
|
}
|
|
6884
|
+
},
|
|
6885
|
+
verticalSteps: {
|
|
6886
|
+
active: {
|
|
6887
|
+
icon: {
|
|
6888
|
+
backgroundColor: theme.verticalSteps.active.icon.backgroundColor,
|
|
6889
|
+
textColor: theme.verticalSteps.active.icon.textColor
|
|
6890
|
+
}
|
|
6891
|
+
},
|
|
6892
|
+
done: {
|
|
6893
|
+
icon: {
|
|
6894
|
+
backgroundColor: theme.verticalSteps.done.icon.backgroundColor,
|
|
6895
|
+
textColor: theme.verticalSteps.done.icon.textColor
|
|
6896
|
+
}
|
|
6897
|
+
},
|
|
6898
|
+
default: {
|
|
6899
|
+
icon: {
|
|
6900
|
+
backgroundColor: theme.verticalSteps.default.icon.backgroundColor,
|
|
6901
|
+
textColor: theme.verticalSteps.default.icon.textColor
|
|
6902
|
+
}
|
|
6903
|
+
}
|
|
6904
|
+
},
|
|
6905
|
+
listItem: {
|
|
6906
|
+
borderColor: theme.listItem.borderColor
|
|
6907
|
+
},
|
|
6908
|
+
picker: {
|
|
6909
|
+
ios: {
|
|
6910
|
+
item: {
|
|
6911
|
+
selected: {
|
|
6912
|
+
color: theme.picker.ios.selected.color
|
|
6913
|
+
}
|
|
6914
|
+
}
|
|
6915
|
+
},
|
|
6916
|
+
android: {
|
|
6917
|
+
item: {
|
|
6918
|
+
default: {
|
|
6919
|
+
backgroundColor: theme.picker.android.default.backgroundColor
|
|
6920
|
+
},
|
|
6921
|
+
selected: {
|
|
6922
|
+
color: theme.picker.android.selected.color,
|
|
6923
|
+
backgroundColor: theme.picker.android.selected.backgroundColor
|
|
6924
|
+
}
|
|
6925
|
+
}
|
|
6926
|
+
}
|
|
6995
6927
|
}
|
|
6996
6928
|
},
|
|
6997
6929
|
app: appTheme?.colors
|
|
@@ -7027,6 +6959,11 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7027
6959
|
cardModal: {
|
|
7028
6960
|
borderRadius: theme.cardModal.borderRadius
|
|
7029
6961
|
},
|
|
6962
|
+
choices: {
|
|
6963
|
+
item: {
|
|
6964
|
+
borderRadius: theme.choices.item.borderRadius
|
|
6965
|
+
}
|
|
6966
|
+
},
|
|
7030
6967
|
dialogModal: {
|
|
7031
6968
|
borderRadius: theme.dialogModal.borderRadius
|
|
7032
6969
|
},
|
|
@@ -7034,6 +6971,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7034
6971
|
input: {
|
|
7035
6972
|
borderRadius: theme.forms.input.borderRadius
|
|
7036
6973
|
},
|
|
6974
|
+
inputTag: {
|
|
6975
|
+
borderRadius: theme.forms.inputTag.borderRadius
|
|
6976
|
+
},
|
|
7037
6977
|
radioButtonGroup: {
|
|
7038
6978
|
item: {
|
|
7039
6979
|
borderRadius: theme.forms.radioButtonGroup.item.borderRadius
|
|
@@ -7055,6 +6995,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7055
6995
|
iconButton: {
|
|
7056
6996
|
borderRadius: theme.iconButton.borderRadius
|
|
7057
6997
|
},
|
|
6998
|
+
tag: {
|
|
6999
|
+
borderRadius: theme.tag.borderRadius
|
|
7000
|
+
},
|
|
7058
7001
|
tooltip: {
|
|
7059
7002
|
borderRadius: theme.tooltip.borderRadius
|
|
7060
7003
|
},
|
|
@@ -7166,6 +7109,13 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7166
7109
|
button: {
|
|
7167
7110
|
borderWidth: theme.button.borderWidth
|
|
7168
7111
|
},
|
|
7112
|
+
choices: {
|
|
7113
|
+
item: {
|
|
7114
|
+
disabled: {
|
|
7115
|
+
borderWidth: theme.choices.item.disabled.border.width
|
|
7116
|
+
}
|
|
7117
|
+
}
|
|
7118
|
+
},
|
|
7169
7119
|
iconButton: {
|
|
7170
7120
|
borderWidth: theme.iconButton.borderWidth
|
|
7171
7121
|
},
|
|
@@ -7192,6 +7142,43 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7192
7142
|
footer: {
|
|
7193
7143
|
borderWidth: theme.cardModal.footer.borderWidth
|
|
7194
7144
|
}
|
|
7145
|
+
},
|
|
7146
|
+
listItem: {
|
|
7147
|
+
borderWidth: theme.listItem.borderWidth
|
|
7148
|
+
},
|
|
7149
|
+
tag: {
|
|
7150
|
+
primary: {
|
|
7151
|
+
fill: {
|
|
7152
|
+
borderWidth: theme.tag.primary.fill.borderWidth
|
|
7153
|
+
},
|
|
7154
|
+
outline: {
|
|
7155
|
+
borderWidth: theme.tag.primary.outline.borderWidth
|
|
7156
|
+
}
|
|
7157
|
+
},
|
|
7158
|
+
default: {
|
|
7159
|
+
fill: {
|
|
7160
|
+
borderWidth: theme.tag.default.fill.borderWidth
|
|
7161
|
+
},
|
|
7162
|
+
outline: {
|
|
7163
|
+
borderWidth: theme.tag.default.outline.borderWidth
|
|
7164
|
+
}
|
|
7165
|
+
},
|
|
7166
|
+
danger: {
|
|
7167
|
+
fill: {
|
|
7168
|
+
borderWidth: theme.tag.danger.fill.borderWidth
|
|
7169
|
+
},
|
|
7170
|
+
outline: {
|
|
7171
|
+
borderWidth: theme.tag.danger.outline.borderWidth
|
|
7172
|
+
}
|
|
7173
|
+
},
|
|
7174
|
+
warn: {
|
|
7175
|
+
fill: {
|
|
7176
|
+
borderWidth: theme.tag.warn.fill.borderWidth
|
|
7177
|
+
},
|
|
7178
|
+
outline: {
|
|
7179
|
+
borderWidth: theme.tag.warn.outline.borderWidth
|
|
7180
|
+
}
|
|
7181
|
+
}
|
|
7195
7182
|
}
|
|
7196
7183
|
},
|
|
7197
7184
|
app: appTheme?.borderWidths
|
|
@@ -7266,6 +7253,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7266
7253
|
},
|
|
7267
7254
|
textArea: {
|
|
7268
7255
|
minHeight: theme.forms.textArea.minHeight
|
|
7256
|
+
},
|
|
7257
|
+
timePicker: {
|
|
7258
|
+
minWidth: theme.forms.timePicker.minWidth
|
|
7269
7259
|
}
|
|
7270
7260
|
},
|
|
7271
7261
|
iconButton: {
|
|
@@ -7278,6 +7268,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7278
7268
|
height: theme.fullscreenModal.header.height
|
|
7279
7269
|
}
|
|
7280
7270
|
},
|
|
7271
|
+
pageLoader: {
|
|
7272
|
+
size: theme.pageLoader.size
|
|
7273
|
+
},
|
|
7281
7274
|
tooltip: {
|
|
7282
7275
|
maxWidth: theme.tooltip.maxWidth,
|
|
7283
7276
|
arrow: {
|
|
@@ -7297,6 +7290,16 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7297
7290
|
size: theme.skeleton.shape.square.size
|
|
7298
7291
|
}
|
|
7299
7292
|
}
|
|
7293
|
+
},
|
|
7294
|
+
picker: {
|
|
7295
|
+
ios: {
|
|
7296
|
+
default: {
|
|
7297
|
+
height: theme.picker.ios.default.height
|
|
7298
|
+
},
|
|
7299
|
+
landscape: {
|
|
7300
|
+
height: theme.picker.ios.landscape.height
|
|
7301
|
+
}
|
|
7302
|
+
}
|
|
7300
7303
|
}
|
|
7301
7304
|
},
|
|
7302
7305
|
app: appTheme?.sizes
|
|
@@ -7345,10 +7348,26 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7345
7348
|
highlight: {
|
|
7346
7349
|
padding: theme.highlight.padding
|
|
7347
7350
|
},
|
|
7351
|
+
listItem: {
|
|
7352
|
+
verticalPadding: theme.listItem.verticalPadding,
|
|
7353
|
+
horizontalPadding: theme.listItem.horizontalPadding
|
|
7354
|
+
},
|
|
7355
|
+
tag: {
|
|
7356
|
+
verticalPadding: theme.tag.verticalPadding,
|
|
7357
|
+
horizontalPadding: theme.tag.horizontalPadding
|
|
7358
|
+
},
|
|
7348
7359
|
tooltip: {
|
|
7349
7360
|
horizontalPadding: theme.tooltip.horizontalPadding,
|
|
7350
7361
|
verticalPadding: theme.tooltip.verticalPadding,
|
|
7351
7362
|
floatingPadding: theme.tooltip.floatingPadding
|
|
7363
|
+
},
|
|
7364
|
+
picker: {
|
|
7365
|
+
android: {
|
|
7366
|
+
item: {
|
|
7367
|
+
verticalPadding: theme.picker.android.verticalPadding,
|
|
7368
|
+
horizontalPadding: theme.picker.android.horizontalPadding
|
|
7369
|
+
}
|
|
7370
|
+
}
|
|
7352
7371
|
}
|
|
7353
7372
|
},
|
|
7354
7373
|
app: appTheme?.space
|
|
@@ -8208,30 +8227,27 @@ function AnimatedFilledCircle() {
|
|
|
8208
8227
|
});
|
|
8209
8228
|
}
|
|
8210
8229
|
|
|
8211
|
-
const PageLoaderContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
8212
|
-
displayName: "PageLoader__PageLoaderContainer",
|
|
8213
|
-
componentId: "kitt-universal__sc-1l9zwqg-0"
|
|
8214
|
-
})(["transform:scale(-1) rotate(90deg);position:relative;width:", "px;height:", "px;"], ({
|
|
8215
|
-
theme
|
|
8216
|
-
}) => theme.kitt.pageLoader.size, ({
|
|
8217
|
-
theme
|
|
8218
|
-
}) => theme.kitt.pageLoader.size);
|
|
8219
8230
|
function PageLoader() {
|
|
8220
|
-
|
|
8231
|
+
const sharedTransformStyle = {
|
|
8232
|
+
style: {
|
|
8233
|
+
/* Needed to make the animation starting from the top of the circles */
|
|
8234
|
+
transform: [{
|
|
8235
|
+
rotate: '90deg'
|
|
8236
|
+
}, {
|
|
8237
|
+
scale: -1
|
|
8238
|
+
}]
|
|
8239
|
+
}
|
|
8240
|
+
};
|
|
8241
|
+
return /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
8242
|
+
position: "relative",
|
|
8243
|
+
height: "kitt.pageLoader.size",
|
|
8244
|
+
width: "kitt.pageLoader.size",
|
|
8245
|
+
_ios: sharedTransformStyle,
|
|
8246
|
+
_android: sharedTransformStyle,
|
|
8221
8247
|
children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedBackgroundCircle, {}), /*#__PURE__*/jsxRuntime.jsx(AnimatedFilledCircle, {})]
|
|
8222
8248
|
});
|
|
8223
8249
|
}
|
|
8224
8250
|
|
|
8225
|
-
const ContainerPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
8226
|
-
displayName: "PickerItem__ContainerPressable",
|
|
8227
|
-
componentId: "kitt-universal__sc-w7n3sn-0"
|
|
8228
|
-
})(["padding:", ";background-color:", ";"], ({
|
|
8229
|
-
theme
|
|
8230
|
-
}) => theme.kitt.picker.android.padding, ({
|
|
8231
|
-
theme,
|
|
8232
|
-
$isSelected
|
|
8233
|
-
}) => $isSelected ? theme.kitt.picker.android.selected.backgroundColor : theme.kitt.picker.android.default.backgroundColor);
|
|
8234
|
-
|
|
8235
8251
|
// This item is for Android only, iOS uses its own implementation and web is not supported yet
|
|
8236
8252
|
function PickerItem({
|
|
8237
8253
|
label,
|
|
@@ -8239,13 +8255,19 @@ function PickerItem({
|
|
|
8239
8255
|
isSelected,
|
|
8240
8256
|
onPress
|
|
8241
8257
|
}) {
|
|
8242
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
8258
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
|
|
8243
8259
|
accessibilityRole: "button",
|
|
8244
8260
|
accessibilityState: {
|
|
8245
8261
|
selected: isSelected
|
|
8246
8262
|
},
|
|
8247
|
-
|
|
8248
|
-
|
|
8263
|
+
backgroundColor: isSelected ? 'kitt.picker.android.item.selected.backgroundColor' : 'kitt.picker.android.item.default.backgroundColor',
|
|
8264
|
+
paddingX: "kitt.picker.android.horizontalPadding",
|
|
8265
|
+
paddingY: "kitt.picker.android.verticalPadding",
|
|
8266
|
+
onPress: () => {
|
|
8267
|
+
if (onPress) {
|
|
8268
|
+
onPress(value);
|
|
8269
|
+
}
|
|
8270
|
+
},
|
|
8249
8271
|
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
8250
8272
|
base: "body",
|
|
8251
8273
|
color: isSelected ? 'white' : undefined,
|
|
@@ -8264,61 +8286,77 @@ function Picker({
|
|
|
8264
8286
|
onValueSelected,
|
|
8265
8287
|
onClose
|
|
8266
8288
|
}) {
|
|
8289
|
+
const sx = nativeBase.useSx();
|
|
8290
|
+
|
|
8267
8291
|
// Max height is based on base Modal sizes (which are not themified): padding (4*20*2) + footer (58) + header (58) + default iOS picker height (216)
|
|
8268
8292
|
const [isMatchingMaxHeight] = nativeBase.useMediaQuery({
|
|
8269
8293
|
maxHeight: 492
|
|
8270
8294
|
});
|
|
8295
|
+
const iosItemStyle = sx({
|
|
8296
|
+
fontSize: 'baseAndSmall.body',
|
|
8297
|
+
lineHeight: 'baseAndSmall.body',
|
|
8298
|
+
fontFamily: 'bodies.regular',
|
|
8299
|
+
color: 'kitt.typography.black-light',
|
|
8300
|
+
// As it is displayed in a modal, we must hard code an height to ensure that the picker doesn't bleed out of it
|
|
8301
|
+
// We can't set a percentage as it will be computed based on the page height
|
|
8302
|
+
height: isMatchingMaxHeight ? 'kitt.picker.ios.landscape.height' : 'kitt.picker.ios.default.height'
|
|
8303
|
+
});
|
|
8304
|
+
const getIosTextStyle = isSelected => {
|
|
8305
|
+
return sx({
|
|
8306
|
+
color: isSelected ? 'kitt.picker.ios.selected.color' : undefined
|
|
8307
|
+
});
|
|
8308
|
+
};
|
|
8271
8309
|
const [value, setValue] = React.useState(initialValue);
|
|
8272
|
-
return /*#__PURE__*/jsxRuntime.
|
|
8310
|
+
return /*#__PURE__*/jsxRuntime.jsx(CardModal.ModalBehaviour, {
|
|
8273
8311
|
visible: isVisible,
|
|
8274
8312
|
onClose: onClose,
|
|
8275
|
-
children:
|
|
8276
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
// We can't set a percentage as it will be computed based on the page height
|
|
8286
|
-
,
|
|
8287
|
-
itemStyle: {
|
|
8288
|
-
...theme.picker.ios.default,
|
|
8289
|
-
height: isMatchingMaxHeight ? theme.picker.ios.landscape.height : theme.picker.ios.default.height
|
|
8290
|
-
},
|
|
8291
|
-
onValueChange: itemValue => setValue(itemValue),
|
|
8292
|
-
children: React__default.Children.map(children, child => {
|
|
8293
|
-
const item = child;
|
|
8294
|
-
|
|
8295
|
-
// iOS Picker doesn't support a custom Item component, we need to override its props manually for the selected one
|
|
8296
|
-
return /*#__PURE__*/React.cloneElement(item, {
|
|
8297
|
-
color: item.props.value === value ? theme.picker.ios.selected.color : undefined
|
|
8298
|
-
});
|
|
8299
|
-
})
|
|
8300
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
8301
|
-
testID: testID,
|
|
8302
|
-
children: React__default.Children.map(children, child => {
|
|
8303
|
-
const item = child;
|
|
8304
|
-
return /*#__PURE__*/React.cloneElement(item, {
|
|
8305
|
-
onPress: newValue => setValue(newValue),
|
|
8306
|
-
isSelected: item.props.value === value
|
|
8307
|
-
});
|
|
8308
|
-
})
|
|
8309
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
|
|
8310
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
8311
|
-
stretch: true,
|
|
8312
|
-
type: "primary",
|
|
8313
|
-
onPress: () => {
|
|
8314
|
-
onValueSelected(value);
|
|
8315
|
-
onClose();
|
|
8316
|
-
},
|
|
8317
|
-
children: validateButtonLabel || /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
|
|
8318
|
-
id: "kitt-universal.Picker.validate"
|
|
8313
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(CardModal, {
|
|
8314
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(CardModal.Header, {
|
|
8315
|
+
right: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
|
|
8316
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
|
|
8317
|
+
onPress: onClose
|
|
8318
|
+
}),
|
|
8319
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
8320
|
+
base: "body",
|
|
8321
|
+
variant: "bold",
|
|
8322
|
+
children: title
|
|
8319
8323
|
})
|
|
8320
|
-
})
|
|
8321
|
-
|
|
8324
|
+
}), reactNative.Platform.OS === 'ios' ? /*#__PURE__*/jsxRuntime.jsx(picker$1.Picker, {
|
|
8325
|
+
testID: testID,
|
|
8326
|
+
selectedValue: value,
|
|
8327
|
+
itemStyle: iosItemStyle,
|
|
8328
|
+
onValueChange: itemValue => setValue(itemValue),
|
|
8329
|
+
children: React__default.Children.map(children, child => {
|
|
8330
|
+
const item = child;
|
|
8331
|
+
|
|
8332
|
+
// iOS Picker doesn't support a custom Item component, we need to override its props manually for the selected one
|
|
8333
|
+
return /*#__PURE__*/React.cloneElement(item, {
|
|
8334
|
+
color: getIosTextStyle(item.props.value === value).color
|
|
8335
|
+
});
|
|
8336
|
+
})
|
|
8337
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
8338
|
+
testID: testID,
|
|
8339
|
+
children: React__default.Children.map(children, child => {
|
|
8340
|
+
const item = child;
|
|
8341
|
+
return /*#__PURE__*/React.cloneElement(item, {
|
|
8342
|
+
onPress: newValue => setValue(newValue),
|
|
8343
|
+
isSelected: item.props.value === value
|
|
8344
|
+
});
|
|
8345
|
+
})
|
|
8346
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CardModal.Footer, {
|
|
8347
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
8348
|
+
stretch: true,
|
|
8349
|
+
type: "primary",
|
|
8350
|
+
onPress: () => {
|
|
8351
|
+
onValueSelected(value);
|
|
8352
|
+
onClose();
|
|
8353
|
+
},
|
|
8354
|
+
children: validateButtonLabel || /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
|
|
8355
|
+
id: "kitt-universal.Picker.validate"
|
|
8356
|
+
})
|
|
8357
|
+
})
|
|
8358
|
+
})]
|
|
8359
|
+
})
|
|
8322
8360
|
});
|
|
8323
8361
|
}
|
|
8324
8362
|
Picker.Item = PickerItem;
|
|
@@ -8372,14 +8410,6 @@ function SegmentedProgressBar({
|
|
|
8372
8410
|
});
|
|
8373
8411
|
}
|
|
8374
8412
|
|
|
8375
|
-
const Container$2 = /*#__PURE__*/styled__default.View.withConfig({
|
|
8376
|
-
displayName: "SkeletonContent__Container",
|
|
8377
|
-
componentId: "kitt-universal__sc-1u3chjb-0"
|
|
8378
|
-
})(["background-color:", ";border-color:", ";height:100%;width:100%;"], ({
|
|
8379
|
-
theme
|
|
8380
|
-
}) => theme.kitt.skeleton.backgroundColor, ({
|
|
8381
|
-
theme
|
|
8382
|
-
}) => theme.kitt.skeleton.flareColor);
|
|
8383
8413
|
const AnimatedLinearGradient = Animated__default.createAnimatedComponent(expoLinearGradient.LinearGradient);
|
|
8384
8414
|
function SkeletonContent({
|
|
8385
8415
|
isLoading,
|
|
@@ -8410,11 +8440,15 @@ function SkeletonContent({
|
|
|
8410
8440
|
};
|
|
8411
8441
|
_f.asString = "function _f(){const{interpolate,sharedX,width}=jsThis._closure;{return{transform:[{translateX:interpolate(sharedX.value,[0,1],[-width,width])}]};}}";
|
|
8412
8442
|
_f.__workletHash = 1670955855244;
|
|
8413
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (
|
|
8443
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (36:47)";
|
|
8414
8444
|
_f.__optimalization = 3;
|
|
8415
8445
|
return _f;
|
|
8416
8446
|
}());
|
|
8417
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
8447
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
8448
|
+
height: "100%",
|
|
8449
|
+
width: "100%",
|
|
8450
|
+
backgroundColor: "kitt.skeleton.backgroundColor",
|
|
8451
|
+
borderColor: "kitt.skeleton.flareColor",
|
|
8418
8452
|
children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLinearGradient, {
|
|
8419
8453
|
colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
|
|
8420
8454
|
locations: [0.1, 0.5, 0.9],
|
|
@@ -8729,17 +8763,17 @@ StaticMap.Loader = StaticMapLoader;
|
|
|
8729
8763
|
StaticMap.Error = StaticMapError;
|
|
8730
8764
|
StaticMap.Marker = StaticMapMarker;
|
|
8731
8765
|
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
}
|
|
8766
|
+
function Flex({
|
|
8767
|
+
direction,
|
|
8768
|
+
wrap = 'wrap',
|
|
8769
|
+
...props
|
|
8770
|
+
}) {
|
|
8771
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
8772
|
+
...props,
|
|
8773
|
+
flexDirection: direction,
|
|
8774
|
+
flexWrap: wrap
|
|
8775
|
+
});
|
|
8776
|
+
}
|
|
8743
8777
|
|
|
8744
8778
|
const storyPadding = 'kitt.4';
|
|
8745
8779
|
|
|
@@ -9024,26 +9058,6 @@ const StoryGrid = {
|
|
|
9024
9058
|
Col: StoryGridCol
|
|
9025
9059
|
};
|
|
9026
9060
|
|
|
9027
|
-
const Container$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
9028
|
-
displayName: "Tag__Container",
|
|
9029
|
-
componentId: "kitt-universal__sc-19jmowi-0"
|
|
9030
|
-
})(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], ({
|
|
9031
|
-
theme,
|
|
9032
|
-
type,
|
|
9033
|
-
variant
|
|
9034
|
-
}) => theme.kitt.tag[type][variant].backgroundColor, ({
|
|
9035
|
-
theme,
|
|
9036
|
-
type,
|
|
9037
|
-
variant
|
|
9038
|
-
}) => theme.kitt.tag[type][variant].borderWidth, ({
|
|
9039
|
-
theme,
|
|
9040
|
-
type,
|
|
9041
|
-
variant
|
|
9042
|
-
}) => theme.kitt.tag[type][variant].borderColor, ({
|
|
9043
|
-
theme
|
|
9044
|
-
}) => theme.kitt.tag.padding, ({
|
|
9045
|
-
theme
|
|
9046
|
-
}) => theme.kitt.tag.borderRadius);
|
|
9047
9061
|
const getLabelColor = (type, variant) => {
|
|
9048
9062
|
switch (type) {
|
|
9049
9063
|
case 'danger':
|
|
@@ -9073,9 +9087,14 @@ function Tag({
|
|
|
9073
9087
|
type = 'default',
|
|
9074
9088
|
variant = 'fill'
|
|
9075
9089
|
}) {
|
|
9076
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
9077
|
-
|
|
9078
|
-
|
|
9090
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
9091
|
+
alignSelf: "flex-start",
|
|
9092
|
+
borderRadius: "kitt.tag.borderRadius",
|
|
9093
|
+
paddingX: "kitt.tag.horizontalPadding",
|
|
9094
|
+
paddingY: "kitt.tag.verticalPadding",
|
|
9095
|
+
backgroundColor: `kitt.tag.${type}.${variant}.backgroundColor`,
|
|
9096
|
+
borderColor: `kitt.tag.${type}.${variant}.borderColor`,
|
|
9097
|
+
borderWidth: `kitt.tag.${type}.${variant}.borderWidth`,
|
|
9079
9098
|
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
9080
9099
|
base: "body-xsmall",
|
|
9081
9100
|
color: getLabelColor(type, variant),
|
|
@@ -9084,176 +9103,187 @@ function Tag({
|
|
|
9084
9103
|
});
|
|
9085
9104
|
}
|
|
9086
9105
|
|
|
9087
|
-
/** @deprecated use native-base instead for SSR compatibility */
|
|
9088
|
-
const getTypographyTypeConfigKey = theme => {
|
|
9089
|
-
const isMediumOrAbove = theme.responsive.matchWindowSize({
|
|
9090
|
-
minWidth: KittBreakpoints.MEDIUM
|
|
9091
|
-
});
|
|
9092
|
-
return isMediumOrAbove ? 'mediumAndWide' : 'baseAndSmall';
|
|
9093
|
-
};
|
|
9094
|
-
/** @deprecated this mixin is not SSR compatible */
|
|
9095
|
-
const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
|
|
9096
|
-
theme,
|
|
9097
|
-
$state
|
|
9098
|
-
}) => $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states.default.backgroundColor, ({
|
|
9099
|
-
theme
|
|
9100
|
-
}) => theme.kitt.forms.input.borderWidth, ({
|
|
9101
|
-
theme
|
|
9102
|
-
}) => theme.kitt.forms.input.borderRadius, ({
|
|
9103
|
-
theme,
|
|
9104
|
-
$state
|
|
9105
|
-
}) => theme.kitt.forms.input.states[$state].borderColor, ({
|
|
9106
|
-
theme
|
|
9107
|
-
}) => {
|
|
9108
|
-
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
9109
|
-
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize}px`;
|
|
9110
|
-
}, ({
|
|
9111
|
-
theme,
|
|
9112
|
-
$state
|
|
9113
|
-
}) => theme.kitt.forms.input.states[$state].color || theme.kitt.forms.input.states.default.color, ({
|
|
9114
|
-
theme
|
|
9115
|
-
}) => reactNative.Platform.OS === 'web' ? theme.kitt.typography.types.bodies.fontFamily.web.regular : theme.kitt.typography.types.bodies.fontFamily.native.regular);
|
|
9116
|
-
|
|
9117
|
-
function Title({
|
|
9118
|
-
children
|
|
9119
|
-
}) {
|
|
9120
|
-
return /*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
|
|
9121
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
9122
|
-
base: "body",
|
|
9123
|
-
variant: "bold",
|
|
9124
|
-
children: children
|
|
9125
|
-
})
|
|
9126
|
-
});
|
|
9127
|
-
}
|
|
9128
9106
|
function ModalDateTimePicker({
|
|
9129
9107
|
title,
|
|
9130
9108
|
visible,
|
|
9131
9109
|
value,
|
|
9132
9110
|
validateButtonLabel,
|
|
9111
|
+
testID,
|
|
9112
|
+
pickerTestID,
|
|
9133
9113
|
onChange,
|
|
9134
9114
|
onClose
|
|
9135
9115
|
}) {
|
|
9136
9116
|
const [currentValue, setCurrentValue] = React.useState(value);
|
|
9137
9117
|
|
|
9138
9118
|
// Prevent unsynced value between the modal and its parent state
|
|
9139
|
-
|
|
9140
|
-
|
|
9119
|
+
const handleClose = () => {
|
|
9120
|
+
setCurrentValue(value);
|
|
9121
|
+
onClose();
|
|
9122
|
+
};
|
|
9123
|
+
const handleChange = nextDate => {
|
|
9124
|
+
if (nextDate) setCurrentValue(nextDate);
|
|
9125
|
+
};
|
|
9126
|
+
const buttonContent = validateButtonLabel || /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
|
|
9127
|
+
id: "kitt-universal.ModalDateTimePicker.confirm"
|
|
9128
|
+
});
|
|
9129
|
+
return /*#__PURE__*/jsxRuntime.jsx(CardModal.ModalBehaviour, {
|
|
9141
9130
|
visible: Boolean(visible),
|
|
9142
|
-
onClose:
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9131
|
+
onClose: handleClose,
|
|
9132
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(CardModal, {
|
|
9133
|
+
testID: testID,
|
|
9134
|
+
children: [title ? /*#__PURE__*/jsxRuntime.jsx(CardModal.Header, {
|
|
9135
|
+
title: title,
|
|
9136
|
+
right: /*#__PURE__*/jsxRuntime.jsx(IconButton, {
|
|
9137
|
+
testID: "timePicker.ModalDateTimePicker.closeButton",
|
|
9138
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
|
|
9139
|
+
onPress: handleClose
|
|
9140
|
+
})
|
|
9141
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(CardModal.Body, {
|
|
9150
9142
|
children: /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
9151
9143
|
is24Hour: true,
|
|
9152
|
-
testID:
|
|
9144
|
+
testID: pickerTestID,
|
|
9153
9145
|
value: currentValue,
|
|
9154
9146
|
mode: "time",
|
|
9155
9147
|
display: reactNative.Platform.OS === 'ios' ? 'spinner' : 'default',
|
|
9156
|
-
onChange: (
|
|
9157
|
-
return date || prev;
|
|
9158
|
-
})
|
|
9148
|
+
onChange: (event, date) => handleChange(date)
|
|
9159
9149
|
})
|
|
9160
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
9150
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CardModal.Footer, {
|
|
9161
9151
|
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
9162
9152
|
stretch: true,
|
|
9153
|
+
testID: "timePicker.ModalDateTimePicker.submitButton",
|
|
9163
9154
|
type: "primary",
|
|
9164
9155
|
onPress: () => {
|
|
9165
9156
|
onChange(currentValue);
|
|
9166
9157
|
},
|
|
9167
|
-
children:
|
|
9168
|
-
children: validateButtonLabel
|
|
9169
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
|
|
9170
|
-
id: "kitt-universal.ModalDateTimePicker.confirm"
|
|
9171
|
-
})
|
|
9158
|
+
children: buttonContent
|
|
9172
9159
|
})
|
|
9173
9160
|
})]
|
|
9174
|
-
})
|
|
9161
|
+
})
|
|
9175
9162
|
});
|
|
9176
9163
|
}
|
|
9177
9164
|
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
return
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9165
|
+
function formatNumberToTimeString(time) {
|
|
9166
|
+
return `${String(time).padStart(2, '0')}`;
|
|
9167
|
+
}
|
|
9168
|
+
function formatDateToTimeString(date) {
|
|
9169
|
+
return `${formatNumberToTimeString(date.getHours())}:${formatNumberToTimeString(date.getMinutes())}`;
|
|
9170
|
+
}
|
|
9171
|
+
|
|
9172
|
+
function getCurrentInternalForcedState({
|
|
9173
|
+
isDisabled,
|
|
9174
|
+
isHoveredInternal,
|
|
9175
|
+
isFocusedInternal,
|
|
9176
|
+
isPressedInternal
|
|
9177
|
+
}) {
|
|
9178
|
+
if (isDisabled) return 'disabled';
|
|
9179
|
+
if (isHoveredInternal) return 'hover';
|
|
9180
|
+
if (isFocusedInternal) return 'focus';
|
|
9181
|
+
if (isPressedInternal) return 'hover';
|
|
9182
|
+
return 'default';
|
|
9183
|
+
}
|
|
9184
|
+
|
|
9185
|
+
function TimePickerPressable({
|
|
9186
|
+
testID,
|
|
9187
|
+
disabled,
|
|
9188
|
+
stretch,
|
|
9189
|
+
value,
|
|
9190
|
+
placeholder,
|
|
9191
|
+
isHoveredInternal,
|
|
9192
|
+
isFocusedInternal,
|
|
9193
|
+
isPressedInternal,
|
|
9194
|
+
onPress
|
|
9195
|
+
}) {
|
|
9196
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
|
|
9197
|
+
testID: testID,
|
|
9198
|
+
disabled: disabled,
|
|
9199
|
+
accessibilityRole: "button",
|
|
9200
|
+
width: createResponsiveStyleFromProp(stretch, '100%', 'kitt.forms.timePicker.minWidth'),
|
|
9201
|
+
onPress: onPress,
|
|
9202
|
+
children: ({
|
|
9203
|
+
isHovered,
|
|
9204
|
+
isFocused,
|
|
9205
|
+
isPressed
|
|
9206
|
+
}) => /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
9207
|
+
position: "relative",
|
|
9208
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
9209
|
+
internalForceState: getCurrentInternalForcedState({
|
|
9210
|
+
isDisabled: disabled,
|
|
9211
|
+
isHoveredInternal: isHovered || isHoveredInternal,
|
|
9212
|
+
isFocusedInternal: isFocused || isFocusedInternal,
|
|
9213
|
+
isPressedInternal: isPressed || isPressedInternal
|
|
9214
|
+
}),
|
|
9215
|
+
value: value ? formatDateToTimeString(value) : undefined,
|
|
9216
|
+
placeholder: placeholder,
|
|
9217
|
+
disabled: disabled,
|
|
9218
|
+
textAlign: "center"
|
|
9219
|
+
}), /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
9220
|
+
position: "absolute",
|
|
9221
|
+
top: "0",
|
|
9222
|
+
left: "0",
|
|
9223
|
+
height: "100%",
|
|
9224
|
+
width: "100%"
|
|
9225
|
+
})]
|
|
9226
|
+
})
|
|
9227
|
+
});
|
|
9228
|
+
}
|
|
9210
9229
|
|
|
9211
|
-
const Container = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
9212
|
-
displayName: "TimePicker__Container",
|
|
9213
|
-
componentId: "kitt-universal__sc-18zhpwp-0"
|
|
9214
|
-
})(["", " width:100px;height:40px;justify-content:center;align-items:center;"], styledTextInputMixin);
|
|
9215
9230
|
function TimePicker({
|
|
9216
9231
|
title,
|
|
9217
|
-
state = 'default',
|
|
9218
9232
|
disabled = false,
|
|
9219
|
-
|
|
9233
|
+
stretch,
|
|
9220
9234
|
value,
|
|
9221
9235
|
validateButtonLabel,
|
|
9222
9236
|
isDefaultVisible,
|
|
9237
|
+
placeholder = '--:--',
|
|
9238
|
+
testID,
|
|
9239
|
+
modalTestID,
|
|
9240
|
+
pickerTestID = 'timePicker.ModalDateTimePicker.dateTimeNativePicker',
|
|
9241
|
+
isHoveredInternal,
|
|
9242
|
+
isFocusedInternal,
|
|
9243
|
+
isPressedInternal,
|
|
9223
9244
|
onChange,
|
|
9224
9245
|
onBlur
|
|
9225
9246
|
}) {
|
|
9226
|
-
const
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9247
|
+
const [currentValue, setCurrentValue] = React.useState(value);
|
|
9248
|
+
const [isPickerVisible, setIsPickerVisible] = React.useState(isDefaultVisible);
|
|
9249
|
+
const handleChange = nextDate => {
|
|
9250
|
+
setCurrentValue(nextDate);
|
|
9251
|
+
setIsPickerVisible(false);
|
|
9252
|
+
if (onChange) onChange(nextDate);
|
|
9253
|
+
if (onBlur) onBlur();
|
|
9254
|
+
};
|
|
9255
|
+
const pickerValue = currentValue || new Date();
|
|
9256
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9257
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(TimePickerPressable, {
|
|
9258
|
+
testID: testID,
|
|
9259
|
+
disabled: disabled,
|
|
9260
|
+
stretch: stretch,
|
|
9261
|
+
value: currentValue,
|
|
9262
|
+
placeholder: placeholder,
|
|
9263
|
+
isHoveredInternal: isHoveredInternal,
|
|
9264
|
+
isFocusedInternal: isFocusedInternal,
|
|
9265
|
+
isPressedInternal: isPressedInternal,
|
|
9266
|
+
onPress: () => {
|
|
9267
|
+
setIsPickerVisible(true);
|
|
9268
|
+
}
|
|
9269
|
+
}), reactNative.Platform.OS === 'android' && isPickerVisible ? /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
9244
9270
|
is24Hour: true,
|
|
9245
|
-
testID:
|
|
9246
|
-
value:
|
|
9271
|
+
testID: pickerTestID,
|
|
9272
|
+
value: pickerValue,
|
|
9247
9273
|
mode: "time",
|
|
9248
9274
|
display: "default",
|
|
9249
|
-
onChange: (
|
|
9275
|
+
onChange: (event, date) => handleChange(date)
|
|
9250
9276
|
}) : null, reactNative.Platform.OS !== 'android' ? /*#__PURE__*/jsxRuntime.jsx(ModalDateTimePicker, {
|
|
9277
|
+
visible: isPickerVisible,
|
|
9251
9278
|
title: title,
|
|
9252
|
-
|
|
9253
|
-
|
|
9279
|
+
testID: modalTestID,
|
|
9280
|
+
pickerTestID: pickerTestID,
|
|
9281
|
+
value: pickerValue,
|
|
9254
9282
|
validateButtonLabel: validateButtonLabel,
|
|
9255
|
-
onChange:
|
|
9256
|
-
onClose:
|
|
9283
|
+
onChange: handleChange,
|
|
9284
|
+
onClose: () => {
|
|
9285
|
+
setIsPickerVisible(false);
|
|
9286
|
+
}
|
|
9257
9287
|
}) : null]
|
|
9258
9288
|
});
|
|
9259
9289
|
}
|
|
@@ -9584,35 +9614,13 @@ function TypographyEmoji({
|
|
|
9584
9614
|
});
|
|
9585
9615
|
}
|
|
9586
9616
|
|
|
9587
|
-
function
|
|
9588
|
-
as,
|
|
9617
|
+
function TypographyLinkWebWrapper({
|
|
9589
9618
|
children,
|
|
9590
9619
|
...props
|
|
9591
9620
|
}) {
|
|
9592
|
-
|
|
9593
|
-
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
9594
|
-
return /*#__PURE__*/jsxRuntime.jsx(as || 'div', {
|
|
9595
|
-
...props,
|
|
9596
|
-
children: children
|
|
9597
|
-
});
|
|
9621
|
+
return children;
|
|
9598
9622
|
}
|
|
9599
9623
|
|
|
9600
|
-
// overrides :global(a) in Link styles.module.css
|
|
9601
|
-
const _exp = () => ({
|
|
9602
|
-
$hasNoUnderline
|
|
9603
|
-
}) => $hasNoUnderline ? 'none' : 'underline';
|
|
9604
|
-
const _exp2 = () => ({
|
|
9605
|
-
$hasNoUnderline
|
|
9606
|
-
}) => $hasNoUnderline ? 'underline' : 'none';
|
|
9607
|
-
const TypographyLinkWebWrapper = /*#__PURE__*/react.styled('span')({
|
|
9608
|
-
name: "TypographyLinkWebWrapper",
|
|
9609
|
-
class: "kitt-u_TypographyLinkWebWrapper_tcwz3nt",
|
|
9610
|
-
propsAsIs: false,
|
|
9611
|
-
vars: {
|
|
9612
|
-
"tcwz3nt-0": [_exp()],
|
|
9613
|
-
"tcwz3nt-1": [_exp2()]
|
|
9614
|
-
}
|
|
9615
|
-
});
|
|
9616
9624
|
function TypographyLink({
|
|
9617
9625
|
children,
|
|
9618
9626
|
disabled,
|
|
@@ -9622,9 +9630,8 @@ function TypographyLink({
|
|
|
9622
9630
|
onPress,
|
|
9623
9631
|
...otherProps
|
|
9624
9632
|
}) {
|
|
9625
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
9626
|
-
|
|
9627
|
-
$hasNoUnderline: noUnderline,
|
|
9633
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyLinkWebWrapper, {
|
|
9634
|
+
hasNoUnderline: noUnderline,
|
|
9628
9635
|
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
9629
9636
|
underline: !noUnderline,
|
|
9630
9637
|
color: disabled ? 'black-disabled' : undefined,
|
|
@@ -9656,38 +9663,12 @@ function TypographyLink({
|
|
|
9656
9663
|
});
|
|
9657
9664
|
}
|
|
9658
9665
|
|
|
9659
|
-
// eslint-disable-next-line no-restricted-imports
|
|
9660
|
-
/** @deprecated use native-base responsive props or `useBreakpointValue` or `useMatchWindowSize` instead */
|
|
9661
|
-
function createWindowSizeHelper(dimensions) {
|
|
9662
|
-
return {
|
|
9663
|
-
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
9664
|
-
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
9665
|
-
mapWindowWidth: (...widthList) => {
|
|
9666
|
-
if ((process.env.NODE_ENV !== "production")) {
|
|
9667
|
-
widthList.slice(1).forEach(([minWidth], index) => {
|
|
9668
|
-
const previousMinWidth = widthList[index][0];
|
|
9669
|
-
if (previousMinWidth > minWidth) {
|
|
9670
|
-
throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
|
|
9671
|
-
}
|
|
9672
|
-
});
|
|
9673
|
-
}
|
|
9674
|
-
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
9675
|
-
minWidth: Number(minWidth)
|
|
9676
|
-
}));
|
|
9677
|
-
if (!found) return null;
|
|
9678
|
-
return found[1];
|
|
9679
|
-
}
|
|
9680
|
-
};
|
|
9681
|
-
}
|
|
9682
|
-
|
|
9683
9666
|
function useKittTheme() {
|
|
9684
|
-
const dimensions = reactNative.useWindowDimensions();
|
|
9685
9667
|
return React.useMemo(() => {
|
|
9686
9668
|
return {
|
|
9687
|
-
kitt: theme
|
|
9688
|
-
responsive: createWindowSizeHelper(dimensions)
|
|
9669
|
+
kitt: theme
|
|
9689
9670
|
};
|
|
9690
|
-
}, [
|
|
9671
|
+
}, []);
|
|
9691
9672
|
}
|
|
9692
9673
|
|
|
9693
9674
|
function KittThemeProvider({
|
|
@@ -9696,14 +9677,11 @@ function KittThemeProvider({
|
|
|
9696
9677
|
appTheme
|
|
9697
9678
|
}) {
|
|
9698
9679
|
const theme = useKittTheme();
|
|
9699
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
9680
|
+
return /*#__PURE__*/jsxRuntime.jsx(KittNativeBaseProvider, {
|
|
9700
9681
|
theme: theme,
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
appTheme: appTheme,
|
|
9705
|
-
children: children
|
|
9706
|
-
})
|
|
9682
|
+
isSSR: isSSR,
|
|
9683
|
+
appTheme: appTheme,
|
|
9684
|
+
children: children
|
|
9707
9685
|
});
|
|
9708
9686
|
}
|
|
9709
9687
|
const KittThemeDecorator = addons.makeDecorator({
|
|
@@ -9720,6 +9698,22 @@ const KittThemeDecorator = addons.makeDecorator({
|
|
|
9720
9698
|
}
|
|
9721
9699
|
});
|
|
9722
9700
|
|
|
9701
|
+
/**
|
|
9702
|
+
* @deprecated Use react-native Platform instead
|
|
9703
|
+
*/
|
|
9704
|
+
function StyleWebWrapper({
|
|
9705
|
+
as,
|
|
9706
|
+
children,
|
|
9707
|
+
...props
|
|
9708
|
+
}) {
|
|
9709
|
+
if (reactNative.Platform.OS !== 'web') return children;
|
|
9710
|
+
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
9711
|
+
return /*#__PURE__*/jsxRuntime.jsx(as || 'div', {
|
|
9712
|
+
...props,
|
|
9713
|
+
children: children
|
|
9714
|
+
});
|
|
9715
|
+
}
|
|
9716
|
+
|
|
9723
9717
|
/**
|
|
9724
9718
|
* Display children if match window size options
|
|
9725
9719
|
*
|
|
@@ -9744,17 +9738,127 @@ function useCurrentBreakpointName() {
|
|
|
9744
9738
|
});
|
|
9745
9739
|
}
|
|
9746
9740
|
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9741
|
+
const backgroundColors = {
|
|
9742
|
+
done: 'kitt.verticalSteps.done.icon.backgroundColor',
|
|
9743
|
+
active: 'kitt.verticalSteps.active.icon.backgroundColor',
|
|
9744
|
+
default: 'kitt.verticalSteps.default.icon.backgroundColor'
|
|
9745
|
+
};
|
|
9746
|
+
function IconStatus({
|
|
9747
|
+
state,
|
|
9748
|
+
index
|
|
9749
|
+
}) {
|
|
9750
|
+
if (state === 'done') {
|
|
9751
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
9752
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.CheckIcon, {}),
|
|
9753
|
+
color: "kitt.verticalSteps.done.icon.textColor"
|
|
9754
|
+
});
|
|
9755
|
+
}
|
|
9756
|
+
if (state === 'active') {
|
|
9757
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
9758
|
+
textAlign: "center",
|
|
9759
|
+
variant: "bold",
|
|
9760
|
+
color: "kitt.verticalSteps.active.icon.textColor",
|
|
9761
|
+
children: index + 1
|
|
9755
9762
|
});
|
|
9763
|
+
}
|
|
9764
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
9765
|
+
textAlign: "center",
|
|
9766
|
+
variant: "bold",
|
|
9767
|
+
color: "kitt.verticalSteps.default.icon.textColor",
|
|
9768
|
+
children: index + 1
|
|
9769
|
+
});
|
|
9770
|
+
}
|
|
9771
|
+
function StepIcon({
|
|
9772
|
+
index,
|
|
9773
|
+
state = 'default'
|
|
9774
|
+
}) {
|
|
9775
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
9776
|
+
justifyContent: "center",
|
|
9777
|
+
alignItems: "center",
|
|
9778
|
+
width: 30,
|
|
9779
|
+
height: 30,
|
|
9780
|
+
borderRadius: 15,
|
|
9781
|
+
backgroundColor: backgroundColors[state],
|
|
9782
|
+
children: /*#__PURE__*/jsxRuntime.jsx(IconStatus, {
|
|
9783
|
+
state: state,
|
|
9784
|
+
index: index
|
|
9785
|
+
})
|
|
9786
|
+
});
|
|
9787
|
+
}
|
|
9788
|
+
|
|
9789
|
+
function ExternalStep() {
|
|
9790
|
+
return null;
|
|
9791
|
+
}
|
|
9792
|
+
function Step({
|
|
9793
|
+
index = 0,
|
|
9794
|
+
children,
|
|
9795
|
+
state = 'default',
|
|
9796
|
+
isLast = false,
|
|
9797
|
+
shouldDisableNextLink = false
|
|
9798
|
+
}) {
|
|
9799
|
+
return /*#__PURE__*/jsxRuntime.jsxs(nativeBase.HStack, {
|
|
9800
|
+
space: "kitt.2",
|
|
9801
|
+
flexGrow: 1,
|
|
9802
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
9803
|
+
marginTop: "kitt.2",
|
|
9804
|
+
paddingY: "kitt.2",
|
|
9805
|
+
backgroundColor: "kitt.white",
|
|
9806
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StepIcon, {
|
|
9807
|
+
state: state,
|
|
9808
|
+
index: index
|
|
9809
|
+
}), !isLast ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
9810
|
+
backgroundColor: shouldDisableNextLink ? 'kitt.palettes.lateOcean.black100' : 'kitt.palettes.lateOcean.moonPurple',
|
|
9811
|
+
width: 1,
|
|
9812
|
+
position: "absolute",
|
|
9813
|
+
top: 46,
|
|
9814
|
+
left: 15,
|
|
9815
|
+
zIndex: -1,
|
|
9816
|
+
height: "100%"
|
|
9817
|
+
}) : null]
|
|
9818
|
+
}), /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
9819
|
+
flexGrow: 1,
|
|
9820
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionCard, {
|
|
9821
|
+
variant: "primary",
|
|
9822
|
+
children: children
|
|
9823
|
+
})
|
|
9824
|
+
})]
|
|
9825
|
+
});
|
|
9826
|
+
}
|
|
9827
|
+
|
|
9828
|
+
function getStepState(index, activeIndex) {
|
|
9829
|
+
if (index === activeIndex) {
|
|
9830
|
+
return 'active';
|
|
9831
|
+
}
|
|
9832
|
+
if (index < activeIndex) {
|
|
9833
|
+
return 'done';
|
|
9834
|
+
}
|
|
9835
|
+
return 'default';
|
|
9836
|
+
}
|
|
9837
|
+
|
|
9838
|
+
function VerticalSteps({
|
|
9839
|
+
children,
|
|
9840
|
+
activeIndex,
|
|
9841
|
+
...props
|
|
9842
|
+
}) {
|
|
9843
|
+
return /*#__PURE__*/jsxRuntime.jsx(nativeBase.VStack, {
|
|
9844
|
+
space: "kitt.4",
|
|
9845
|
+
width: "100%",
|
|
9846
|
+
...props,
|
|
9847
|
+
children: React.Children.map(children, (child, index) => {
|
|
9848
|
+
if ((process.env.NODE_ENV !== "production") && child.type !== ExternalStep) {
|
|
9849
|
+
throw new Error('VerticalSteps only accepts VerticalSteps.Step as children');
|
|
9850
|
+
}
|
|
9851
|
+
const isLast = index === React.Children.count(children) - 1;
|
|
9852
|
+
return /*#__PURE__*/React.createElement(Step, {
|
|
9853
|
+
...child.props,
|
|
9854
|
+
index,
|
|
9855
|
+
isLast,
|
|
9856
|
+
state: getStepState(index, activeIndex)
|
|
9857
|
+
}, child.props.children);
|
|
9858
|
+
})
|
|
9756
9859
|
});
|
|
9757
9860
|
}
|
|
9861
|
+
VerticalSteps.Step = ExternalStep;
|
|
9758
9862
|
|
|
9759
9863
|
exports.useBreakpointValue = nativeBase.useBreakpointValue;
|
|
9760
9864
|
exports.useClipboard = nativeBase.useClipboard;
|
|
@@ -9807,7 +9911,6 @@ exports.MapMarkerPosition = MapMarkerPosition;
|
|
|
9807
9911
|
exports.MapMarkerSimple = MapMarkerSimple;
|
|
9808
9912
|
exports.MatchWindowSize = MatchWindowSize;
|
|
9809
9913
|
exports.Message = Message;
|
|
9810
|
-
exports.Modal = Modal;
|
|
9811
9914
|
exports.ModalBehaviour = ModalBehaviour;
|
|
9812
9915
|
exports.NavigationModal = NavigationModal;
|
|
9813
9916
|
exports.Notification = Notification;
|
|
@@ -9842,10 +9945,10 @@ exports.TypographyEmoji = TypographyEmoji;
|
|
|
9842
9945
|
exports.TypographyIcon = TypographyIcon;
|
|
9843
9946
|
exports.TypographyLink = TypographyLink;
|
|
9844
9947
|
exports.VStack = VStack;
|
|
9948
|
+
exports.VerticalSteps = VerticalSteps;
|
|
9845
9949
|
exports.View = View;
|
|
9846
9950
|
exports.createChoicesComponent = createChoicesComponent;
|
|
9847
9951
|
exports.createResponsiveStyleFromProp = createResponsiveStyleFromProp;
|
|
9848
|
-
exports.createWindowSizeHelper = createWindowSizeHelper;
|
|
9849
9952
|
exports.getStaticMapImageUrl = getStaticMapImageUrl;
|
|
9850
9953
|
exports.hex2rgba = hex2rgba;
|
|
9851
9954
|
exports.matchWindowSize = matchWindowSize;
|
|
@@ -9859,7 +9962,6 @@ exports.useMatchWindowSize = useMatchWindowSize;
|
|
|
9859
9962
|
exports.useStaticBottomSheet = useStaticBottomSheet;
|
|
9860
9963
|
exports.useStoryBlockColor = useStoryBlockColor;
|
|
9861
9964
|
exports.useTheme = useTheme;
|
|
9862
|
-
exports.withTheme = withTheme;
|
|
9863
9965
|
for (const k in kittIcons) {
|
|
9864
9966
|
if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = kittIcons[k];
|
|
9865
9967
|
}
|