@ornikar/kitt-universal 9.3.2 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definitions/Actions/Actions.d.ts +13 -0
- package/dist/definitions/Actions/Actions.d.ts.map +1 -0
- package/dist/definitions/Actions/ActionsButton.d.ts +9 -0
- package/dist/definitions/Actions/ActionsButton.d.ts.map +1 -0
- package/dist/definitions/Actions/ActionsItem.d.ts +12 -0
- package/dist/definitions/Actions/ActionsItem.d.ts.map +1 -0
- package/dist/definitions/Choices/ChoiceItem.d.ts +38 -0
- package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -0
- package/dist/definitions/Choices/ChoiceItemContainer.d.ts +10 -0
- package/dist/definitions/Choices/ChoiceItemContainer.d.ts.map +1 -0
- package/dist/definitions/Choices/Choices.d.ts +33 -0
- package/dist/definitions/Choices/Choices.d.ts.map +1 -0
- package/dist/definitions/Choices/hooks/useNativeAnimation.d.ts +14 -0
- package/dist/definitions/Choices/hooks/useNativeAnimation.d.ts.map +1 -0
- package/dist/definitions/Choices/hooks/useNativeAnimation.web.d.ts +7 -0
- package/dist/definitions/Choices/hooks/useNativeAnimation.web.d.ts.map +1 -0
- package/dist/definitions/IconButton/IconButton.d.ts +1 -1
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts +1 -1
- package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts.map +1 -1
- package/dist/definitions/forms/InputField/InputField.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
- package/dist/definitions/index.d.ts +7 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +15 -15
- package/dist/definitions/story-components/StoryBlock.d.ts +1 -1
- package/dist/definitions/test-utils/TestWrapper.d.ts +7 -0
- package/dist/definitions/test-utils/TestWrapper.d.ts.map +1 -0
- package/dist/definitions/themes/default.d.ts +8 -1
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/choices.d.ts +35 -0
- package/dist/definitions/themes/late-ocean/choices.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts +7 -1
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/inputField.d.ts +7 -1
- package/dist/definitions/themes/late-ocean/inputField.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +1 -0
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +917 -432
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +917 -432
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +917 -432
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +995 -591
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +933 -477
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -1
- package/dist/index-node-14.17.cjs.web.js +824 -449
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +41 -1
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +41 -1
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +41 -1
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +41 -1
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +41 -1
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +41 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +27 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import
|
|
3
|
+
import { Stack as Stack$1, VStack as VStack$1, HStack as HStack$1, Text as Text$1, View as View$1, ScrollView as ScrollView$1, Pressable as Pressable$1, Image as Image$1, NativeBaseProvider, extendTheme } from 'native-base';
|
|
4
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
5
|
+
import React, { forwardRef, useContext, createContext, cloneElement, useRef, useEffect, useState, Children, useMemo, Fragment as Fragment$1 } from 'react';
|
|
6
|
+
import { Platform, Animated as Animated$1, Easing, useWindowDimensions, Image, StyleSheet, View as View$2, ScrollView as ScrollView$2, Linking, Pressable as Pressable$2, Modal as Modal$1, Text as Text$2, TextInput } from 'react-native';
|
|
6
7
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
8
|
+
import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, useDerivedValue, withTiming, useAnimatedProps, withDelay, Easing as Easing$1, withRepeat, interpolate } from 'react-native-reanimated';
|
|
7
9
|
import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
8
|
-
import React, { cloneElement, useContext, createContext, forwardRef, useMemo, useEffect, useState, useRef, Fragment as Fragment$1, Children } from 'react';
|
|
9
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
11
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
11
|
-
import { Text as Text$1, Image as Image$1, NativeBaseProvider, extendTheme, Stack as Stack$1, VStack as VStack$1, HStack as HStack$1, View as View$2, ScrollView as ScrollView$2, Pressable as Pressable$2 } from 'native-base';
|
|
12
|
-
import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, useAnimatedProps, withDelay, withTiming, Easing as Easing$1, withRepeat, interpolate } from 'react-native-reanimated';
|
|
13
|
-
import { parse } from 'twemoji-parser';
|
|
14
12
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
15
13
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
14
|
+
import { ArcIcon, UserIcon, CheckboxMark, XIcon, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
|
|
15
|
+
export * from '@ornikar/kitt-icons';
|
|
16
|
+
import { parse } from 'twemoji-parser';
|
|
16
17
|
import { openBrowserAsync } from 'expo-web-browser';
|
|
17
18
|
import DateTimePicker, { DateTimePickerAndroid } from '@react-native-community/datetimepicker';
|
|
18
19
|
import { FormattedMessage } from 'react-intl';
|
|
19
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
20
20
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
21
21
|
import Svg, { Circle as Circle$1 } from 'react-native-svg';
|
|
22
22
|
import { Picker as Picker$1 } from '@react-native-picker/picker';
|
|
@@ -24,39 +24,173 @@ import { LinearGradient } from 'expo-linear-gradient';
|
|
|
24
24
|
import { useFloating, offset, shift, flip } from '@floating-ui/react-native';
|
|
25
25
|
import { makeDecorator } from '@storybook/addons';
|
|
26
26
|
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
var Stack = Stack$1;
|
|
28
|
+
var VStack = VStack$1;
|
|
29
|
+
var HStack = HStack$1;
|
|
30
|
+
|
|
31
|
+
function warn(message) {
|
|
32
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
33
|
+
console.warn(message);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function deprecatedMessage(symbol, deprecation, replaceBy) {
|
|
37
|
+
var replaceMessage = replaceBy === undefined ? '' : ", please use ".concat(replaceBy, " instead");
|
|
38
|
+
warn("[Deprecation] in ".concat(symbol, ": ").concat(deprecation, " is deprecated").concat(replaceMessage, "."));
|
|
39
|
+
}
|
|
40
|
+
function deprecatedInComponent(component, deprecation, replaceBy) {
|
|
41
|
+
deprecatedMessage("<".concat(component, " />"), deprecation, replaceBy);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var hasVariant = function (button, variant) {
|
|
45
|
+
return variant in button;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
function getVariantValuesIfExist(theme, type, variant) {
|
|
49
|
+
var button = theme.kitt.button[type];
|
|
50
|
+
|
|
51
|
+
if (hasVariant(button, variant)) {
|
|
52
|
+
return button[variant];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return theme.kitt.button[type]["default"];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
59
|
+
displayName: "AnimatedButtonPressable__StyledPressable"
|
|
60
|
+
})(["", ""], function (_ref) {
|
|
61
|
+
var $isStretch = _ref.$isStretch;
|
|
62
|
+
if ($isStretch) return undefined;
|
|
63
|
+
return 'align-self: flex-start;';
|
|
64
|
+
});
|
|
65
|
+
var StyledAnimatedView = /*#__PURE__*/styled(Animated.View).withConfig({
|
|
66
|
+
displayName: "AnimatedButtonPressable__StyledAnimatedView"
|
|
67
|
+
})(["border-radius:", "px;"], function (_ref2) {
|
|
68
|
+
var theme = _ref2.theme;
|
|
69
|
+
return theme.kitt.button.borderRadius;
|
|
70
|
+
});
|
|
71
|
+
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
72
|
+
var children = _ref3.children,
|
|
73
|
+
disabled = _ref3.disabled,
|
|
74
|
+
accessibilityRole = _ref3.accessibilityRole,
|
|
75
|
+
$type = _ref3.$type,
|
|
76
|
+
$variant = _ref3.$variant,
|
|
77
|
+
$isStretch = _ref3.$isStretch,
|
|
78
|
+
href = _ref3.href,
|
|
79
|
+
hrefAttrs = _ref3.hrefAttrs,
|
|
80
|
+
testID = _ref3.testID,
|
|
81
|
+
onPress = _ref3.onPress;
|
|
82
|
+
var theme = /*#__PURE__*/useTheme();
|
|
83
|
+
var pressed = useSharedValue(0);
|
|
84
|
+
var color = useSharedValue(0);
|
|
85
|
+
|
|
86
|
+
var _getVariantValuesIfEx = getVariantValuesIfExist(theme, $type, $variant),
|
|
87
|
+
backgroundColor = _getVariantValuesIfEx.backgroundColor,
|
|
88
|
+
pressedBackgroundColor = _getVariantValuesIfEx.pressedBackgroundColor;
|
|
89
|
+
|
|
90
|
+
var scale = theme.kitt.button.scale;
|
|
91
|
+
var scaleStyles = useAnimatedStyle(function () {
|
|
92
|
+
var _f = function () {
|
|
93
|
+
return {
|
|
94
|
+
backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
95
|
+
transform: [{
|
|
96
|
+
scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
|
|
97
|
+
}]
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
_f._closure = {
|
|
102
|
+
interpolateColor: interpolateColor,
|
|
103
|
+
color: color,
|
|
104
|
+
backgroundColor: backgroundColor,
|
|
105
|
+
pressedBackgroundColor: pressedBackgroundColor,
|
|
106
|
+
withSpring: withSpring,
|
|
107
|
+
pressed: pressed,
|
|
108
|
+
scale: {
|
|
109
|
+
base: {
|
|
110
|
+
active: scale.base.active,
|
|
111
|
+
"default": scale.base["default"]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
_f.asString = "function _f(){const{interpolateColor,color,backgroundColor,pressedBackgroundColor,withSpring,pressed,scale}=jsThis._closure;{return{backgroundColor:interpolateColor(color.value,[0,1],[backgroundColor,pressedBackgroundColor]),transform:[{scale:withSpring(pressed.value?scale.base.active:scale.base.default)}]};}}";
|
|
116
|
+
_f.__workletHash = 5368461229978;
|
|
117
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (56:41)";
|
|
118
|
+
_f.__optimalization = 2;
|
|
119
|
+
return _f;
|
|
120
|
+
}());
|
|
121
|
+
|
|
122
|
+
var handlePressInOut = function (pressIn) {
|
|
123
|
+
color.value = withSpring(pressIn ? 1 : 0);
|
|
124
|
+
pressed.value = pressIn ? 1 : 0;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
return /*#__PURE__*/jsx(StyledPressable, {
|
|
128
|
+
ref: ref,
|
|
129
|
+
disabled: disabled,
|
|
130
|
+
accessibilityRole: accessibilityRole,
|
|
131
|
+
testID: testID,
|
|
132
|
+
href: href,
|
|
133
|
+
hrefAttrs: hrefAttrs,
|
|
134
|
+
$isStretch: $isStretch,
|
|
135
|
+
$type: $type,
|
|
136
|
+
onPress: onPress,
|
|
137
|
+
onPressIn: function onPressIn() {
|
|
138
|
+
handlePressInOut(true);
|
|
139
|
+
},
|
|
140
|
+
onPressOut: function onPressOut() {
|
|
141
|
+
handlePressInOut(false);
|
|
142
|
+
},
|
|
143
|
+
children: /*#__PURE__*/jsx(StyledAnimatedView, {
|
|
144
|
+
style: disabled ? [{
|
|
145
|
+
transform: [{
|
|
146
|
+
scale: 1
|
|
147
|
+
}]
|
|
148
|
+
}] : [scaleStyles],
|
|
149
|
+
children: children
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
155
|
+
displayName: "BaseStyledButtonPressable"
|
|
156
|
+
})(["position:relative;min-width:", "px;max-width:", ";width:", ";min-height:", "px;border-radius:", "px;flex-direction:row;align-items:center;justify-content:center;align-self:flex-start;background-color:", ";padding:", ";"], function (_ref) {
|
|
157
|
+
var theme = _ref.theme;
|
|
158
|
+
return theme.kitt.button.minWidth;
|
|
33
159
|
}, function (_ref2) {
|
|
34
|
-
var
|
|
35
|
-
|
|
160
|
+
var theme = _ref2.theme,
|
|
161
|
+
$isStretch = _ref2.$isStretch;
|
|
162
|
+
return $isStretch ? '100%' : "".concat(theme.kitt.button.maxWidth, "px");
|
|
36
163
|
}, function (_ref3) {
|
|
37
|
-
var $
|
|
38
|
-
return $
|
|
164
|
+
var $isStretch = _ref3.$isStretch;
|
|
165
|
+
return $isStretch ? '100%' : 'auto';
|
|
39
166
|
}, function (_ref4) {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
167
|
+
var theme = _ref4.theme;
|
|
168
|
+
return theme.kitt.button.minHeight;
|
|
169
|
+
}, function (_ref5) {
|
|
170
|
+
var theme = _ref5.theme;
|
|
171
|
+
return theme.kitt.button.borderRadius;
|
|
172
|
+
}, function (_ref6) {
|
|
173
|
+
var theme = _ref6.theme,
|
|
174
|
+
$isDisabled = _ref6.$isDisabled,
|
|
175
|
+
$type = _ref6.$type,
|
|
176
|
+
$variant = _ref6.$variant;
|
|
177
|
+
if ($isDisabled) return theme.kitt.button.disabled["default"].backgroundColor;
|
|
178
|
+
if (Platform.OS !== 'web') return 'transparent';
|
|
179
|
+
return getVariantValuesIfExist(theme, $type, $variant).backgroundColor;
|
|
180
|
+
}, function (_ref7) {
|
|
181
|
+
var theme = _ref7.theme,
|
|
182
|
+
$size = _ref7.$size,
|
|
183
|
+
$isDisabled = _ref7.$isDisabled;
|
|
184
|
+
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
185
|
+
large = _theme$kitt$button$co.large,
|
|
186
|
+
defaultPadding = _theme$kitt$button$co["default"],
|
|
187
|
+
disabledPadding = _theme$kitt$button$co.disabled,
|
|
188
|
+
xLarge = _theme$kitt$button$co.xLarge;
|
|
189
|
+
if ($size === 'large') return large;
|
|
190
|
+
if ($size === 'xlarge') return xLarge;
|
|
191
|
+
if ($isDisabled) return disabledPadding;
|
|
192
|
+
return defaultPadding;
|
|
43
193
|
});
|
|
44
|
-
function Icon(_ref5) {
|
|
45
|
-
var icon = _ref5.icon,
|
|
46
|
-
_ref5$size = _ref5.size,
|
|
47
|
-
size = _ref5$size === void 0 ? defaultIconSize : _ref5$size,
|
|
48
|
-
align = _ref5.align,
|
|
49
|
-
color = _ref5.color;
|
|
50
|
-
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
51
|
-
color: color
|
|
52
|
-
});
|
|
53
|
-
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
54
|
-
$align: align,
|
|
55
|
-
$size: size,
|
|
56
|
-
$color: color,
|
|
57
|
-
children: clonedIcon
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
194
|
|
|
61
195
|
var KittBreakpoints = {
|
|
62
196
|
/**
|
|
@@ -115,14 +249,20 @@ var KittBreakpointNameEnum;
|
|
|
115
249
|
KittBreakpointNameEnum["WIDE"] = "wide";
|
|
116
250
|
})(KittBreakpointNameEnum || (KittBreakpointNameEnum = {}));
|
|
117
251
|
|
|
118
|
-
var _excluded$
|
|
252
|
+
var _excluded$n = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
|
|
119
253
|
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
120
254
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
121
255
|
function useTypographyColor() {
|
|
122
256
|
return useContext(TypographyColorContext);
|
|
123
257
|
}
|
|
258
|
+
var TypographyDefaultColorContext = /*#__PURE__*/createContext(undefined);
|
|
259
|
+
|
|
260
|
+
function useTypographyDefaultColor() {
|
|
261
|
+
return useContext(TypographyDefaultColorContext);
|
|
262
|
+
}
|
|
124
263
|
/** @deprecated use native-base instead for SSR compatibility */
|
|
125
264
|
|
|
265
|
+
|
|
126
266
|
var getTypographyTypeConfigKey = function (theme) {
|
|
127
267
|
var isMediumOrAbove = theme.responsive.matchWindowSize({
|
|
128
268
|
minWidth: KittBreakpoints.MEDIUM
|
|
@@ -157,6 +297,11 @@ function createNativeBaseFontSize(type) {
|
|
|
157
297
|
});
|
|
158
298
|
return fontSizeForNativeBase;
|
|
159
299
|
}
|
|
300
|
+
|
|
301
|
+
function getNBThemeColorFromColorProps(colorName) {
|
|
302
|
+
return colorName ? "kitt.typography.".concat(colorName) : undefined;
|
|
303
|
+
}
|
|
304
|
+
|
|
160
305
|
function Typography(_ref) {
|
|
161
306
|
var _type$base;
|
|
162
307
|
|
|
@@ -176,9 +321,10 @@ function Typography(_ref) {
|
|
|
176
321
|
} : _ref$type,
|
|
177
322
|
variant = _ref.variant,
|
|
178
323
|
color = _ref.color,
|
|
179
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
324
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$n);
|
|
180
325
|
|
|
181
326
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
327
|
+
var defaultColor = useTypographyDefaultColor();
|
|
182
328
|
var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
183
329
|
var baseOrDefaultToBody = hasTypographyAncestor ? type.base : (_type$base = type.base) !== null && _type$base !== void 0 ? _type$base : 'body';
|
|
184
330
|
var isHeader = isTypographyHeader(baseOrDefaultToBody, isHeaderTypographyInContext);
|
|
@@ -199,14 +345,16 @@ function Typography(_ref) {
|
|
|
199
345
|
});
|
|
200
346
|
}
|
|
201
347
|
|
|
348
|
+
var currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
|
|
349
|
+
|
|
202
350
|
var text = /*#__PURE__*/jsx(Text$1, _objectSpread({
|
|
203
351
|
accessibilityRole: accessibilityRole || undefined,
|
|
204
352
|
fontSize: fontSizeForNativeBase,
|
|
205
353
|
lineHeight: hasTypographyAncestor ? undefined : fontSizeForNativeBase,
|
|
206
354
|
fontWeight: isHeader ? "headers.".concat(nonNullableVariant) : "bodies.".concat(nonNullableVariant),
|
|
207
355
|
fontFamily: isHeader ? "headers.".concat(nonNullableVariant) : "bodies.".concat(nonNullableVariant),
|
|
208
|
-
color:
|
|
209
|
-
textDecorationColor:
|
|
356
|
+
color: getNBThemeColorFromColorProps(currentColor),
|
|
357
|
+
textDecorationColor: getNBThemeColorFromColorProps(currentColor)
|
|
210
358
|
}, otherProps));
|
|
211
359
|
|
|
212
360
|
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
@@ -247,6 +395,7 @@ var createHeading = function (level, defaultBase) {
|
|
|
247
395
|
return TypographyHeading;
|
|
248
396
|
};
|
|
249
397
|
|
|
398
|
+
Typography.SetDefaultColor = TypographyDefaultColorContext.Provider;
|
|
250
399
|
Typography.Text = TypographyText;
|
|
251
400
|
Typography.Paragraph = TypographyParagraph;
|
|
252
401
|
Typography.Header1 = createHeading(1);
|
|
@@ -264,269 +413,53 @@ Typography.h2 = createHeading(2, 'header2');
|
|
|
264
413
|
/** @deprecated use Typography.Header3 */
|
|
265
414
|
|
|
266
415
|
Typography.h3 = createHeading(3, 'header3');
|
|
267
|
-
/** @deprecated use Typography.Header4 */
|
|
268
|
-
|
|
269
|
-
Typography.h4 = createHeading(4, 'header4');
|
|
270
|
-
/** @deprecated use Typography.Header6 */
|
|
271
|
-
|
|
272
|
-
Typography.h5 = createHeading(5, 'header5');
|
|
273
|
-
|
|
274
|
-
var _excluded$j = ["size", "round", "light", "sizeVariant"];
|
|
275
|
-
|
|
276
|
-
var getInitials = function (firstname, lastname) {
|
|
277
|
-
return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
|
|
281
|
-
displayName: "Avatar__StyledAvatarView"
|
|
282
|
-
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
283
|
-
var theme = _ref.theme,
|
|
284
|
-
$isRound = _ref.$isRound,
|
|
285
|
-
$size = _ref.$size,
|
|
286
|
-
$sizeVariant = _ref.$sizeVariant;
|
|
287
|
-
if ($isRound) return "".concat($size / 2, "px");
|
|
288
|
-
return "".concat($sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius, "px");
|
|
289
|
-
}, function (_ref2) {
|
|
290
|
-
var theme = _ref2.theme,
|
|
291
|
-
$isLight = _ref2.$isLight;
|
|
292
|
-
return $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
|
|
293
|
-
}, function (_ref3) {
|
|
294
|
-
var $size = _ref3.$size;
|
|
295
|
-
return $size;
|
|
296
|
-
}, function (_ref4) {
|
|
297
|
-
var $size = _ref4.$size;
|
|
298
|
-
return $size;
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
function AvatarContent(_ref5) {
|
|
302
|
-
var size = _ref5.size,
|
|
303
|
-
src = _ref5.src,
|
|
304
|
-
firstname = _ref5.firstname,
|
|
305
|
-
lastname = _ref5.lastname,
|
|
306
|
-
alt = _ref5.alt,
|
|
307
|
-
isLight = _ref5.isLight,
|
|
308
|
-
sizeVariant = _ref5.sizeVariant;
|
|
309
|
-
|
|
310
|
-
if (src) {
|
|
311
|
-
return /*#__PURE__*/jsx(Image, {
|
|
312
|
-
source: {
|
|
313
|
-
uri: src
|
|
314
|
-
},
|
|
315
|
-
style: {
|
|
316
|
-
width: size,
|
|
317
|
-
height: size
|
|
318
|
-
},
|
|
319
|
-
accessibilityLabel: alt
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
if (firstname && lastname) {
|
|
324
|
-
return /*#__PURE__*/jsx(Typography.Text, {
|
|
325
|
-
base: sizeVariant === 'large' ? 'body-large' : 'body-small',
|
|
326
|
-
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
327
|
-
color: isLight ? 'black' : 'white',
|
|
328
|
-
children: getInitials(firstname, lastname)
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
return /*#__PURE__*/jsx(Icon, {
|
|
333
|
-
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
334
|
-
color: isLight ? 'black' : 'white',
|
|
335
|
-
size: size / 2
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
function Avatar(_ref6) {
|
|
340
|
-
var _ref6$size = _ref6.size,
|
|
341
|
-
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
342
|
-
round = _ref6.round,
|
|
343
|
-
light = _ref6.light,
|
|
344
|
-
sizeVariant = _ref6.sizeVariant,
|
|
345
|
-
props = _objectWithoutProperties(_ref6, _excluded$j);
|
|
346
|
-
|
|
347
|
-
return /*#__PURE__*/jsx(StyledAvatarView, {
|
|
348
|
-
$size: size,
|
|
349
|
-
$isRound: round,
|
|
350
|
-
$isLight: light,
|
|
351
|
-
$sizeVariant: sizeVariant,
|
|
352
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread({
|
|
353
|
-
size: size,
|
|
354
|
-
isLight: light,
|
|
355
|
-
sizeVariant: sizeVariant
|
|
356
|
-
}, props))
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
function warn(message) {
|
|
361
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
362
|
-
console.warn(message);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
function deprecatedMessage(symbol, deprecation, replaceBy) {
|
|
366
|
-
var replaceMessage = replaceBy === undefined ? '' : ", please use ".concat(replaceBy, " instead");
|
|
367
|
-
warn("[Deprecation] in ".concat(symbol, ": ").concat(deprecation, " is deprecated").concat(replaceMessage, "."));
|
|
368
|
-
}
|
|
369
|
-
function deprecatedInComponent(component, deprecation, replaceBy) {
|
|
370
|
-
deprecatedMessage("<".concat(component, " />"), deprecation, replaceBy);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
var hasVariant = function (button, variant) {
|
|
374
|
-
return variant in button;
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
function getVariantValuesIfExist(theme, type, variant) {
|
|
378
|
-
var button = theme.kitt.button[type];
|
|
379
|
-
|
|
380
|
-
if (hasVariant(button, variant)) {
|
|
381
|
-
return button[variant];
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
return theme.kitt.button[type]["default"];
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
388
|
-
displayName: "AnimatedButtonPressable__StyledPressable"
|
|
389
|
-
})(["", ""], function (_ref) {
|
|
390
|
-
var $isStretch = _ref.$isStretch;
|
|
391
|
-
if ($isStretch) return undefined;
|
|
392
|
-
return 'align-self: flex-start;';
|
|
393
|
-
});
|
|
394
|
-
var StyledAnimatedView = /*#__PURE__*/styled(Animated.View).withConfig({
|
|
395
|
-
displayName: "AnimatedButtonPressable__StyledAnimatedView"
|
|
396
|
-
})(["border-radius:", "px;"], function (_ref2) {
|
|
397
|
-
var theme = _ref2.theme;
|
|
398
|
-
return theme.kitt.button.borderRadius;
|
|
399
|
-
});
|
|
400
|
-
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
401
|
-
var children = _ref3.children,
|
|
402
|
-
disabled = _ref3.disabled,
|
|
403
|
-
accessibilityRole = _ref3.accessibilityRole,
|
|
404
|
-
$type = _ref3.$type,
|
|
405
|
-
$variant = _ref3.$variant,
|
|
406
|
-
$isStretch = _ref3.$isStretch,
|
|
407
|
-
href = _ref3.href,
|
|
408
|
-
hrefAttrs = _ref3.hrefAttrs,
|
|
409
|
-
testID = _ref3.testID,
|
|
410
|
-
onPress = _ref3.onPress;
|
|
411
|
-
var theme = /*#__PURE__*/useTheme();
|
|
412
|
-
var pressed = useSharedValue(0);
|
|
413
|
-
var color = useSharedValue(0);
|
|
414
|
-
|
|
415
|
-
var _getVariantValuesIfEx = getVariantValuesIfExist(theme, $type, $variant),
|
|
416
|
-
backgroundColor = _getVariantValuesIfEx.backgroundColor,
|
|
417
|
-
pressedBackgroundColor = _getVariantValuesIfEx.pressedBackgroundColor;
|
|
418
|
-
|
|
419
|
-
var scale = theme.kitt.button.scale;
|
|
420
|
-
var scaleStyles = useAnimatedStyle(function () {
|
|
421
|
-
var _f = function () {
|
|
422
|
-
return {
|
|
423
|
-
backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
424
|
-
transform: [{
|
|
425
|
-
scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
|
|
426
|
-
}]
|
|
427
|
-
};
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
_f._closure = {
|
|
431
|
-
interpolateColor: interpolateColor,
|
|
432
|
-
color: color,
|
|
433
|
-
backgroundColor: backgroundColor,
|
|
434
|
-
pressedBackgroundColor: pressedBackgroundColor,
|
|
435
|
-
withSpring: withSpring,
|
|
436
|
-
pressed: pressed,
|
|
437
|
-
scale: {
|
|
438
|
-
base: {
|
|
439
|
-
active: scale.base.active,
|
|
440
|
-
"default": scale.base["default"]
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
_f.asString = "function _f(){const{interpolateColor,color,backgroundColor,pressedBackgroundColor,withSpring,pressed,scale}=jsThis._closure;{return{backgroundColor:interpolateColor(color.value,[0,1],[backgroundColor,pressedBackgroundColor]),transform:[{scale:withSpring(pressed.value?scale.base.active:scale.base.default)}]};}}";
|
|
445
|
-
_f.__workletHash = 5368461229978;
|
|
446
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (56:41)";
|
|
447
|
-
_f.__optimalization = 2;
|
|
448
|
-
return _f;
|
|
449
|
-
}());
|
|
450
|
-
|
|
451
|
-
var handlePressInOut = function (pressIn) {
|
|
452
|
-
color.value = withSpring(pressIn ? 1 : 0);
|
|
453
|
-
pressed.value = pressIn ? 1 : 0;
|
|
454
|
-
};
|
|
416
|
+
/** @deprecated use Typography.Header4 */
|
|
455
417
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
disabled: disabled,
|
|
459
|
-
accessibilityRole: accessibilityRole,
|
|
460
|
-
testID: testID,
|
|
461
|
-
href: href,
|
|
462
|
-
hrefAttrs: hrefAttrs,
|
|
463
|
-
$isStretch: $isStretch,
|
|
464
|
-
$type: $type,
|
|
465
|
-
onPress: onPress,
|
|
466
|
-
onPressIn: function onPressIn() {
|
|
467
|
-
handlePressInOut(true);
|
|
468
|
-
},
|
|
469
|
-
onPressOut: function onPressOut() {
|
|
470
|
-
handlePressInOut(false);
|
|
471
|
-
},
|
|
472
|
-
children: /*#__PURE__*/jsx(StyledAnimatedView, {
|
|
473
|
-
style: disabled ? [{
|
|
474
|
-
transform: [{
|
|
475
|
-
scale: 1
|
|
476
|
-
}]
|
|
477
|
-
}] : [scaleStyles],
|
|
478
|
-
children: children
|
|
479
|
-
})
|
|
480
|
-
});
|
|
481
|
-
});
|
|
418
|
+
Typography.h4 = createHeading(4, 'header4');
|
|
419
|
+
/** @deprecated use Typography.Header6 */
|
|
482
420
|
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
421
|
+
Typography.h5 = createHeading(5, 'header5');
|
|
422
|
+
|
|
423
|
+
var defaultIconSize = 20;
|
|
424
|
+
var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
425
|
+
displayName: "Icon__IconContainer"
|
|
426
|
+
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
427
|
+
var $color = _ref.$color;
|
|
428
|
+
return $color;
|
|
488
429
|
}, function (_ref2) {
|
|
489
|
-
var
|
|
490
|
-
|
|
491
|
-
return $isStretch ? '100%' : "".concat(theme.kitt.button.maxWidth, "px");
|
|
430
|
+
var $size = _ref2.$size;
|
|
431
|
+
return $size;
|
|
492
432
|
}, function (_ref3) {
|
|
493
|
-
var $
|
|
494
|
-
return $
|
|
433
|
+
var $size = _ref3.$size;
|
|
434
|
+
return $size;
|
|
495
435
|
}, function (_ref4) {
|
|
496
|
-
var
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
var theme = _ref5.theme;
|
|
500
|
-
return theme.kitt.button.borderRadius;
|
|
501
|
-
}, function (_ref6) {
|
|
502
|
-
var theme = _ref6.theme,
|
|
503
|
-
$isDisabled = _ref6.$isDisabled,
|
|
504
|
-
$type = _ref6.$type,
|
|
505
|
-
$variant = _ref6.$variant;
|
|
506
|
-
if ($isDisabled) return theme.kitt.button.disabled["default"].backgroundColor;
|
|
507
|
-
if (Platform.OS !== 'web') return 'transparent';
|
|
508
|
-
return getVariantValuesIfExist(theme, $type, $variant).backgroundColor;
|
|
509
|
-
}, function (_ref7) {
|
|
510
|
-
var theme = _ref7.theme,
|
|
511
|
-
$size = _ref7.$size,
|
|
512
|
-
$isDisabled = _ref7.$isDisabled;
|
|
513
|
-
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
514
|
-
large = _theme$kitt$button$co.large,
|
|
515
|
-
defaultPadding = _theme$kitt$button$co["default"],
|
|
516
|
-
disabledPadding = _theme$kitt$button$co.disabled,
|
|
517
|
-
xLarge = _theme$kitt$button$co.xLarge;
|
|
518
|
-
if ($size === 'large') return large;
|
|
519
|
-
if ($size === 'xlarge') return xLarge;
|
|
520
|
-
if ($isDisabled) return disabledPadding;
|
|
521
|
-
return defaultPadding;
|
|
436
|
+
var _ref4$$align = _ref4.$align,
|
|
437
|
+
$align = _ref4$$align === void 0 ? 'auto' : _ref4$$align;
|
|
438
|
+
return $align;
|
|
522
439
|
});
|
|
440
|
+
function Icon(_ref5) {
|
|
441
|
+
var icon = _ref5.icon,
|
|
442
|
+
_ref5$size = _ref5.size,
|
|
443
|
+
size = _ref5$size === void 0 ? defaultIconSize : _ref5$size,
|
|
444
|
+
align = _ref5.align,
|
|
445
|
+
color = _ref5.color;
|
|
446
|
+
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
447
|
+
color: color
|
|
448
|
+
});
|
|
449
|
+
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
450
|
+
$align: align,
|
|
451
|
+
$size: size,
|
|
452
|
+
$color: color,
|
|
453
|
+
children: clonedIcon
|
|
454
|
+
});
|
|
455
|
+
}
|
|
523
456
|
|
|
524
|
-
var _excluded$
|
|
457
|
+
var _excluded$m = ["color"],
|
|
525
458
|
_excluded2$3 = ["color"];
|
|
526
459
|
|
|
527
460
|
function TypographyIconSpecifiedColor(_ref) {
|
|
528
461
|
var color = _ref.color,
|
|
529
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
462
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
530
463
|
|
|
531
464
|
var theme = /*#__PURE__*/useTheme();
|
|
532
465
|
return /*#__PURE__*/jsx(Icon, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -558,7 +491,7 @@ function isSubtle(type) {
|
|
|
558
491
|
return type.startsWith('subtle');
|
|
559
492
|
}
|
|
560
493
|
|
|
561
|
-
var _excluded$
|
|
494
|
+
var _excluded$l = ["type", "variant", "isDisabled", "$isStretch", "icon", "children"];
|
|
562
495
|
|
|
563
496
|
var getTextColorByType = function (type, variant) {
|
|
564
497
|
switch (type) {
|
|
@@ -663,7 +596,7 @@ function ButtonContentChildren(_ref4) {
|
|
|
663
596
|
};
|
|
664
597
|
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
665
598
|
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
|
|
666
|
-
testID: "button
|
|
599
|
+
testID: "button.ButtonContent.leftButtonIcon",
|
|
667
600
|
icon: icon
|
|
668
601
|
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
669
602
|
base: "body",
|
|
@@ -700,7 +633,7 @@ function ButtonContent(_ref7) {
|
|
|
700
633
|
$isStretch = _ref7.$isStretch,
|
|
701
634
|
icon = _ref7.icon,
|
|
702
635
|
children = _ref7.children,
|
|
703
|
-
props = _objectWithoutProperties(_ref7, _excluded$
|
|
636
|
+
props = _objectWithoutProperties(_ref7, _excluded$l);
|
|
704
637
|
|
|
705
638
|
var color = isDisabled ? 'black-light' : getTextColorByType(type, variant);
|
|
706
639
|
return /*#__PURE__*/jsx(ButtonContentContainer, {
|
|
@@ -805,7 +738,286 @@ var Button = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
805
738
|
}), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
|
|
806
739
|
})
|
|
807
740
|
});
|
|
808
|
-
});
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
function SpinningIcon(_ref) {
|
|
744
|
+
var icon = _ref.icon,
|
|
745
|
+
color = _ref.color;
|
|
746
|
+
|
|
747
|
+
if (process.env.NODE_ENV !== 'production' && !color) {
|
|
748
|
+
throw new Error("Invalid color passed to SpinningIcon: ".concat(String(color)));
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
752
|
+
color: color
|
|
753
|
+
});
|
|
754
|
+
var animationRef = useRef(new Animated$1.Value(0));
|
|
755
|
+
var rotation = animationRef.current.interpolate({
|
|
756
|
+
inputRange: [0, 1],
|
|
757
|
+
outputRange: ['0deg', '360deg']
|
|
758
|
+
});
|
|
759
|
+
useEffect(function () {
|
|
760
|
+
if (process.env.NODE_ENV === 'test') return undefined;
|
|
761
|
+
var animation = Animated$1.loop(Animated$1.timing(animationRef.current, {
|
|
762
|
+
toValue: 1,
|
|
763
|
+
duration: 1100,
|
|
764
|
+
easing: Easing.linear,
|
|
765
|
+
useNativeDriver: true
|
|
766
|
+
}));
|
|
767
|
+
animation.start();
|
|
768
|
+
return function () {
|
|
769
|
+
if (process.env.NODE_ENV === 'test') return undefined;
|
|
770
|
+
animation.stop();
|
|
771
|
+
return undefined;
|
|
772
|
+
};
|
|
773
|
+
}, []);
|
|
774
|
+
return /*#__PURE__*/jsx(Animated$1.View, {
|
|
775
|
+
style: {
|
|
776
|
+
transform: [{
|
|
777
|
+
rotate: rotation
|
|
778
|
+
}]
|
|
779
|
+
},
|
|
780
|
+
children: clonedIcon
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
function LoaderIcon(_ref) {
|
|
785
|
+
var color = _ref.color;
|
|
786
|
+
return /*#__PURE__*/jsx(SpinningIcon, {
|
|
787
|
+
color: color,
|
|
788
|
+
icon: /*#__PURE__*/jsx(ArcIcon, {})
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
var View = View$1;
|
|
793
|
+
var ScrollView = ScrollView$1;
|
|
794
|
+
var Pressable = Pressable$1;
|
|
795
|
+
|
|
796
|
+
function matchWindowSize(_ref, _ref2) {
|
|
797
|
+
var width = _ref.width,
|
|
798
|
+
height = _ref.height;
|
|
799
|
+
var minWidth = _ref2.minWidth,
|
|
800
|
+
maxWidth = _ref2.maxWidth,
|
|
801
|
+
minHeight = _ref2.minHeight,
|
|
802
|
+
maxHeight = _ref2.maxHeight;
|
|
803
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
804
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
805
|
+
return hasWidthMatched && hasHeightMatched;
|
|
806
|
+
}
|
|
807
|
+
function useMatchWindowSize(options) {
|
|
808
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
809
|
+
width = _useWindowDimensions.width,
|
|
810
|
+
height = _useWindowDimensions.height;
|
|
811
|
+
|
|
812
|
+
return matchWindowSize({
|
|
813
|
+
width: width,
|
|
814
|
+
height: height
|
|
815
|
+
}, options);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
var _excluded$k = ["as", "onPress", "disabled", "icon"];
|
|
819
|
+
function ActionsItem(_ref) {
|
|
820
|
+
var as = _ref.as,
|
|
821
|
+
onPress = _ref.onPress,
|
|
822
|
+
disabled = _ref.disabled,
|
|
823
|
+
icon = _ref.icon,
|
|
824
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
825
|
+
|
|
826
|
+
var isMedium = useMatchWindowSize({
|
|
827
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
var _useState = useState(false),
|
|
831
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
832
|
+
isLoading = _useState2[0],
|
|
833
|
+
setIsLoading = _useState2[1];
|
|
834
|
+
|
|
835
|
+
var mountedRef = useRef(false); // effect just for tracking mounted state, as onPress can unmount the ActionButton
|
|
836
|
+
|
|
837
|
+
useEffect(function () {
|
|
838
|
+
mountedRef.current = true;
|
|
839
|
+
return function () {
|
|
840
|
+
mountedRef.current = false;
|
|
841
|
+
};
|
|
842
|
+
}, []);
|
|
843
|
+
return /*#__PURE__*/jsx(View, {
|
|
844
|
+
children: /*#__PURE__*/jsx(as, _objectSpread(_objectSpread({}, props), {}, {
|
|
845
|
+
stretch: !isMedium ? true : undefined,
|
|
846
|
+
disabled: isLoading ? true : disabled,
|
|
847
|
+
icon: isLoading ? /*#__PURE__*/jsx(LoaderIcon, {}) : icon,
|
|
848
|
+
onPress: function handlePress(e) {
|
|
849
|
+
var callPressAndUpdateLoadingState = /*#__PURE__*/function () {
|
|
850
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
851
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
852
|
+
while (1) {
|
|
853
|
+
switch (_context.prev = _context.next) {
|
|
854
|
+
case 0:
|
|
855
|
+
if (onPress) {
|
|
856
|
+
_context.next = 2;
|
|
857
|
+
break;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
return _context.abrupt("return");
|
|
861
|
+
|
|
862
|
+
case 2:
|
|
863
|
+
setIsLoading(true);
|
|
864
|
+
_context.prev = 3;
|
|
865
|
+
_context.next = 6;
|
|
866
|
+
return onPress(e);
|
|
867
|
+
|
|
868
|
+
case 6:
|
|
869
|
+
if (mountedRef.current) {
|
|
870
|
+
setIsLoading(false);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
_context.next = 13;
|
|
874
|
+
break;
|
|
875
|
+
|
|
876
|
+
case 9:
|
|
877
|
+
_context.prev = 9;
|
|
878
|
+
_context.t0 = _context["catch"](3);
|
|
879
|
+
|
|
880
|
+
if (mountedRef.current) {
|
|
881
|
+
setIsLoading(false);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
throw _context.t0;
|
|
885
|
+
|
|
886
|
+
case 13:
|
|
887
|
+
case "end":
|
|
888
|
+
return _context.stop();
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}, _callee, null, [[3, 9]]);
|
|
892
|
+
}));
|
|
893
|
+
|
|
894
|
+
return function () {
|
|
895
|
+
return _ref2.apply(this, arguments);
|
|
896
|
+
};
|
|
897
|
+
}();
|
|
898
|
+
|
|
899
|
+
callPressAndUpdateLoadingState();
|
|
900
|
+
}
|
|
901
|
+
}))
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
function ActionsButton(_ref) {
|
|
906
|
+
var props = _extends({}, _ref);
|
|
907
|
+
|
|
908
|
+
return /*#__PURE__*/jsx(ActionsItem, _objectSpread({
|
|
909
|
+
as: Button
|
|
910
|
+
}, props));
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
var _excluded$j = ["children"];
|
|
914
|
+
function Actions(_ref) {
|
|
915
|
+
var children = _ref.children,
|
|
916
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
917
|
+
|
|
918
|
+
return /*#__PURE__*/jsx(Stack, _objectSpread(_objectSpread({
|
|
919
|
+
alignItems: {
|
|
920
|
+
base: 'stretch',
|
|
921
|
+
medium: 'center'
|
|
922
|
+
},
|
|
923
|
+
direction: {
|
|
924
|
+
base: 'column',
|
|
925
|
+
medium: 'row'
|
|
926
|
+
},
|
|
927
|
+
flex: 1
|
|
928
|
+
}, props), {}, {
|
|
929
|
+
space: "kitt.3",
|
|
930
|
+
children: children
|
|
931
|
+
}));
|
|
932
|
+
}
|
|
933
|
+
Actions.Button = ActionsButton;
|
|
934
|
+
Actions.Item = ActionsItem;
|
|
935
|
+
|
|
936
|
+
var _excluded$i = ["size", "round", "light", "sizeVariant"];
|
|
937
|
+
|
|
938
|
+
var getInitials = function (firstname, lastname) {
|
|
939
|
+
return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
|
|
943
|
+
displayName: "Avatar__StyledAvatarView"
|
|
944
|
+
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
945
|
+
var theme = _ref.theme,
|
|
946
|
+
$isRound = _ref.$isRound,
|
|
947
|
+
$size = _ref.$size,
|
|
948
|
+
$sizeVariant = _ref.$sizeVariant;
|
|
949
|
+
if ($isRound) return "".concat($size / 2, "px");
|
|
950
|
+
return "".concat($sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius, "px");
|
|
951
|
+
}, function (_ref2) {
|
|
952
|
+
var theme = _ref2.theme,
|
|
953
|
+
$isLight = _ref2.$isLight;
|
|
954
|
+
return $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
|
|
955
|
+
}, function (_ref3) {
|
|
956
|
+
var $size = _ref3.$size;
|
|
957
|
+
return $size;
|
|
958
|
+
}, function (_ref4) {
|
|
959
|
+
var $size = _ref4.$size;
|
|
960
|
+
return $size;
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
function AvatarContent(_ref5) {
|
|
964
|
+
var size = _ref5.size,
|
|
965
|
+
src = _ref5.src,
|
|
966
|
+
firstname = _ref5.firstname,
|
|
967
|
+
lastname = _ref5.lastname,
|
|
968
|
+
alt = _ref5.alt,
|
|
969
|
+
isLight = _ref5.isLight,
|
|
970
|
+
sizeVariant = _ref5.sizeVariant;
|
|
971
|
+
|
|
972
|
+
if (src) {
|
|
973
|
+
return /*#__PURE__*/jsx(Image, {
|
|
974
|
+
source: {
|
|
975
|
+
uri: src
|
|
976
|
+
},
|
|
977
|
+
style: {
|
|
978
|
+
width: size,
|
|
979
|
+
height: size
|
|
980
|
+
},
|
|
981
|
+
accessibilityLabel: alt
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
if (firstname && lastname) {
|
|
986
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
987
|
+
base: sizeVariant === 'large' ? 'body-large' : 'body-small',
|
|
988
|
+
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
989
|
+
color: isLight ? 'black' : 'white',
|
|
990
|
+
children: getInitials(firstname, lastname)
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
return /*#__PURE__*/jsx(Icon, {
|
|
995
|
+
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
996
|
+
color: isLight ? 'black' : 'white',
|
|
997
|
+
size: size / 2
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
function Avatar(_ref6) {
|
|
1002
|
+
var _ref6$size = _ref6.size,
|
|
1003
|
+
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
1004
|
+
round = _ref6.round,
|
|
1005
|
+
light = _ref6.light,
|
|
1006
|
+
sizeVariant = _ref6.sizeVariant,
|
|
1007
|
+
props = _objectWithoutProperties(_ref6, _excluded$i);
|
|
1008
|
+
|
|
1009
|
+
return /*#__PURE__*/jsx(StyledAvatarView, {
|
|
1010
|
+
$size: size,
|
|
1011
|
+
$isRound: round,
|
|
1012
|
+
$isLight: light,
|
|
1013
|
+
$sizeVariant: sizeVariant,
|
|
1014
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread({
|
|
1015
|
+
size: size,
|
|
1016
|
+
isLight: light,
|
|
1017
|
+
sizeVariant: sizeVariant
|
|
1018
|
+
}, props))
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
809
1021
|
|
|
810
1022
|
var Container$5 = /*#__PURE__*/styled.View.withConfig({
|
|
811
1023
|
displayName: "Card__Container"
|
|
@@ -836,6 +1048,333 @@ function Card(_ref6) {
|
|
|
836
1048
|
});
|
|
837
1049
|
}
|
|
838
1050
|
|
|
1051
|
+
var useNativeAnimation = function (_ref) {
|
|
1052
|
+
var selected = _ref.selected,
|
|
1053
|
+
disabled = _ref.disabled,
|
|
1054
|
+
isPressedInternal = _ref.isPressedInternal;
|
|
1055
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1056
|
+
var pressed = useSharedValue(Boolean(isPressedInternal));
|
|
1057
|
+
var progress = useDerivedValue(function () {
|
|
1058
|
+
var _f = function () {
|
|
1059
|
+
return withTiming(pressed.value ? 1 : 0, {
|
|
1060
|
+
duration: theme.kitt.choices.item.transition.duration
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
_f._closure = {
|
|
1065
|
+
withTiming: withTiming,
|
|
1066
|
+
pressed: pressed,
|
|
1067
|
+
theme: {
|
|
1068
|
+
kitt: {
|
|
1069
|
+
choices: {
|
|
1070
|
+
item: {
|
|
1071
|
+
transition: {
|
|
1072
|
+
duration: theme.kitt.choices.item.transition.duration
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
_f.asString = "function _f(){const{withTiming,pressed,theme}=jsThis._closure;{return withTiming(pressed.value?1:0,{duration:theme.kitt.choices.item.transition.duration});}}";
|
|
1080
|
+
_f.__workletHash = 1120030177160;
|
|
1081
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/hooks/useNativeAnimation.tsx (31:35)";
|
|
1082
|
+
return _f;
|
|
1083
|
+
}());
|
|
1084
|
+
var backgroundStyles = useAnimatedStyle(function () {
|
|
1085
|
+
var _f = function () {
|
|
1086
|
+
var _theme$kitt$choices$i = theme.kitt.choices.item.backgroundColor,
|
|
1087
|
+
defaultBg = _theme$kitt$choices$i["default"],
|
|
1088
|
+
pressedBg = _theme$kitt$choices$i.pressed,
|
|
1089
|
+
selectedBg = _theme$kitt$choices$i.selected,
|
|
1090
|
+
disabledBg = _theme$kitt$choices$i.disabled;
|
|
1091
|
+
if (disabled) return {
|
|
1092
|
+
backgroundColor: disabledBg
|
|
1093
|
+
};
|
|
1094
|
+
if (selected) return {
|
|
1095
|
+
backgroundColor: selectedBg
|
|
1096
|
+
};
|
|
1097
|
+
return {
|
|
1098
|
+
backgroundColor: interpolateColor(progress.value, [0, 1], [defaultBg, pressedBg])
|
|
1099
|
+
};
|
|
1100
|
+
};
|
|
1101
|
+
|
|
1102
|
+
_f._closure = {
|
|
1103
|
+
theme: {
|
|
1104
|
+
kitt: {
|
|
1105
|
+
choices: {
|
|
1106
|
+
item: {
|
|
1107
|
+
backgroundColor: theme.kitt.choices.item.backgroundColor
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
disabled: disabled,
|
|
1113
|
+
selected: selected,
|
|
1114
|
+
interpolateColor: interpolateColor,
|
|
1115
|
+
progress: progress
|
|
1116
|
+
};
|
|
1117
|
+
_f.asString = "function _f(){const{theme,disabled,selected,interpolateColor,progress}=jsThis._closure;{const{default:defaultBg,pressed:pressedBg,selected:selectedBg,disabled:disabledBg}=theme.kitt.choices.item.backgroundColor;if(disabled)return{backgroundColor:disabledBg};if(selected)return{backgroundColor:selectedBg};return{backgroundColor:interpolateColor(progress.value,[0,1],[defaultBg,pressedBg])};}}";
|
|
1118
|
+
_f.__workletHash = 15506726129309;
|
|
1119
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/hooks/useNativeAnimation.tsx (35:44)";
|
|
1120
|
+
return _f;
|
|
1121
|
+
}());
|
|
1122
|
+
return {
|
|
1123
|
+
onPressIn: function onPressIn() {
|
|
1124
|
+
pressed.value = true;
|
|
1125
|
+
},
|
|
1126
|
+
onPressOut: function onPressOut() {
|
|
1127
|
+
pressed.value = false;
|
|
1128
|
+
},
|
|
1129
|
+
backgroundStyles: backgroundStyles
|
|
1130
|
+
};
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
function getCurrentTextColor(_ref) {
|
|
1134
|
+
var isDisabled = _ref.isDisabled,
|
|
1135
|
+
isSelected = _ref.isSelected,
|
|
1136
|
+
isPressed = _ref.isPressed,
|
|
1137
|
+
isHovered = _ref.isHovered;
|
|
1138
|
+
if (isDisabled) return 'black-light';
|
|
1139
|
+
if (isSelected && isHovered) return 'white';
|
|
1140
|
+
if (isSelected || isPressed) return 'white';
|
|
1141
|
+
return 'black';
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
function getBorderRadius(defaultRadius, variant) {
|
|
1145
|
+
// The clean way to have the rounded effect would have been to know the children height since radius >= height * 0.5
|
|
1146
|
+
// We don't control over the height of the rendered children we just go with a arbitrary really high value
|
|
1147
|
+
if (variant === 'rounded') return 800;
|
|
1148
|
+
return defaultRadius;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
var DisabledBorder = /*#__PURE__*/styled(View$2).withConfig({
|
|
1152
|
+
displayName: "ChoiceItem__DisabledBorder"
|
|
1153
|
+
})(["border-radius:", "px;", ";"], function (_ref2) {
|
|
1154
|
+
var theme = _ref2.theme,
|
|
1155
|
+
$variant = _ref2.$variant;
|
|
1156
|
+
return getBorderRadius(theme.kitt.choices.item.borderRadius, $variant);
|
|
1157
|
+
}, function (_ref3) {
|
|
1158
|
+
var theme = _ref3.theme;
|
|
1159
|
+
var _theme$kitt$choices$i = theme.kitt.choices.item.disabled.border,
|
|
1160
|
+
width = _theme$kitt$choices$i.width,
|
|
1161
|
+
color = _theme$kitt$choices$i.color;
|
|
1162
|
+
return css(["border:", "px solid ", ";"], width, color);
|
|
1163
|
+
});
|
|
1164
|
+
var ChoiceItemView = /*#__PURE__*/styled(Platform.OS === 'web' ? View$2 : Animated.View).withConfig({
|
|
1165
|
+
displayName: "ChoiceItem__ChoiceItemView"
|
|
1166
|
+
})(["position:relative;border-radius:", "px;background-color:", ";", ";", ""], function (_ref4) {
|
|
1167
|
+
var theme = _ref4.theme,
|
|
1168
|
+
$variant = _ref4.$variant;
|
|
1169
|
+
return getBorderRadius(theme.kitt.choices.item.borderRadius, $variant);
|
|
1170
|
+
}, function (_ref5) {
|
|
1171
|
+
var theme = _ref5.theme,
|
|
1172
|
+
$isHovered = _ref5.$isHovered,
|
|
1173
|
+
$isPressed = _ref5.$isPressed,
|
|
1174
|
+
$isDisabled = _ref5.$isDisabled,
|
|
1175
|
+
$isSelected = _ref5.$isSelected;
|
|
1176
|
+
var _theme$kitt$choices$i2 = theme.kitt.choices.item.backgroundColor,
|
|
1177
|
+
hoverWhenSelected = _theme$kitt$choices$i2.hoverWhenSelected,
|
|
1178
|
+
hover = _theme$kitt$choices$i2.hover,
|
|
1179
|
+
disabled = _theme$kitt$choices$i2.disabled,
|
|
1180
|
+
selected = _theme$kitt$choices$i2.selected,
|
|
1181
|
+
pressed = _theme$kitt$choices$i2.pressed,
|
|
1182
|
+
defaultBackground = _theme$kitt$choices$i2["default"];
|
|
1183
|
+
if ($isDisabled) return disabled;
|
|
1184
|
+
if ($isSelected && $isHovered) return hoverWhenSelected;
|
|
1185
|
+
if ($isPressed) return pressed;
|
|
1186
|
+
if ($isHovered) return hover;
|
|
1187
|
+
if ($isSelected) return selected;
|
|
1188
|
+
return defaultBackground;
|
|
1189
|
+
}, function (_ref6) {
|
|
1190
|
+
var theme = _ref6.theme;
|
|
1191
|
+
var _theme$kitt$choices$i3 = theme.kitt.choices.item.padding,
|
|
1192
|
+
base = _theme$kitt$choices$i3.base,
|
|
1193
|
+
small = _theme$kitt$choices$i3.small;
|
|
1194
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
1195
|
+
minWidth: KittBreakpoints.SMALL
|
|
1196
|
+
}, css(["padding:", "px;"], small), css(["padding:", "px;"], base));
|
|
1197
|
+
}, function (_ref7) {
|
|
1198
|
+
var theme = _ref7.theme;
|
|
1199
|
+
if (Platform.OS !== 'web') return undefined;
|
|
1200
|
+
var _theme$kitt$choices$i4 = theme.kitt.choices.item.transition,
|
|
1201
|
+
property = _theme$kitt$choices$i4.property,
|
|
1202
|
+
duration = _theme$kitt$choices$i4.duration,
|
|
1203
|
+
timingFunction = _theme$kitt$choices$i4.timingFunction;
|
|
1204
|
+
return css(["transition:", " ", "ms ", ";"], property, duration, timingFunction);
|
|
1205
|
+
});
|
|
1206
|
+
function ChoiceItem(_ref8) {
|
|
1207
|
+
var _ref8$type = _ref8.type,
|
|
1208
|
+
type = _ref8$type === void 0 ? 'button' : _ref8$type,
|
|
1209
|
+
value = _ref8.value,
|
|
1210
|
+
selected = _ref8.selected,
|
|
1211
|
+
disabled = _ref8.disabled,
|
|
1212
|
+
variant = _ref8.variant,
|
|
1213
|
+
_children = _ref8.children,
|
|
1214
|
+
isPressedInternal = _ref8.isPressedInternal,
|
|
1215
|
+
isHoveredInternal = _ref8.isHoveredInternal,
|
|
1216
|
+
onPress = _ref8.onPress,
|
|
1217
|
+
onChange = _ref8.onChange,
|
|
1218
|
+
onBlur = _ref8.onBlur,
|
|
1219
|
+
onFocus = _ref8.onFocus;
|
|
1220
|
+
|
|
1221
|
+
var _useNativeAnimation = useNativeAnimation({
|
|
1222
|
+
selected: selected,
|
|
1223
|
+
disabled: disabled,
|
|
1224
|
+
isPressedInternal: isPressedInternal
|
|
1225
|
+
}),
|
|
1226
|
+
onPressIn = _useNativeAnimation.onPressIn,
|
|
1227
|
+
onPressOut = _useNativeAnimation.onPressOut,
|
|
1228
|
+
backgroundStyles = _useNativeAnimation.backgroundStyles;
|
|
1229
|
+
|
|
1230
|
+
var handleChange = function () {
|
|
1231
|
+
if (!onChange) return; // Checkbox can be toggled
|
|
1232
|
+
|
|
1233
|
+
if (type === 'checkbox') {
|
|
1234
|
+
onChange(selected ? undefined : value);
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
onChange(value);
|
|
1239
|
+
};
|
|
1240
|
+
|
|
1241
|
+
return /*#__PURE__*/jsx(Pressable, {
|
|
1242
|
+
disabled: disabled,
|
|
1243
|
+
accessibilityRole: type,
|
|
1244
|
+
accessibilityState: {
|
|
1245
|
+
checked: selected
|
|
1246
|
+
},
|
|
1247
|
+
onBlur: onBlur,
|
|
1248
|
+
onFocus: onFocus,
|
|
1249
|
+
onPress: function handlePress(e) {
|
|
1250
|
+
if (onFocus) onFocus(e);
|
|
1251
|
+
if (onPress) onPress();
|
|
1252
|
+
handleChange();
|
|
1253
|
+
if (onBlur) onBlur(e);
|
|
1254
|
+
},
|
|
1255
|
+
onPressIn: onPressIn,
|
|
1256
|
+
onPressOut: onPressOut,
|
|
1257
|
+
children: function children(_ref9) {
|
|
1258
|
+
var isHovered = _ref9.isHovered,
|
|
1259
|
+
isPressed = _ref9.isPressed;
|
|
1260
|
+
return /*#__PURE__*/jsxs(ChoiceItemView, {
|
|
1261
|
+
style: Platform.OS !== 'web' ? [backgroundStyles] : undefined,
|
|
1262
|
+
$isHovered: isHovered || isHoveredInternal,
|
|
1263
|
+
$isDisabled: disabled,
|
|
1264
|
+
$isSelected: selected,
|
|
1265
|
+
$isPressed: isPressed || isPressedInternal,
|
|
1266
|
+
$variant: variant,
|
|
1267
|
+
children: [/*#__PURE__*/jsx(Typography.SetDefaultColor, {
|
|
1268
|
+
value: getCurrentTextColor({
|
|
1269
|
+
isDisabled: disabled,
|
|
1270
|
+
isSelected: selected || isPressedInternal,
|
|
1271
|
+
isPressed: isPressed,
|
|
1272
|
+
isHovered: isHovered || isHoveredInternal
|
|
1273
|
+
}),
|
|
1274
|
+
children: _children
|
|
1275
|
+
}), disabled ? /*#__PURE__*/jsx(DisabledBorder, {
|
|
1276
|
+
$variant: variant,
|
|
1277
|
+
style: StyleSheet.absoluteFillObject
|
|
1278
|
+
}) : null]
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
var ChoiceItemContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
1285
|
+
displayName: "ChoiceItemContainer"
|
|
1286
|
+
})(["", ""], function (_ref) {
|
|
1287
|
+
var theme = _ref.theme,
|
|
1288
|
+
$isLast = _ref.$isLast,
|
|
1289
|
+
$direction = _ref.$direction;
|
|
1290
|
+
var _theme$kitt$choices$s = theme.kitt.choices.spacing,
|
|
1291
|
+
row = _theme$kitt$choices$s.row,
|
|
1292
|
+
column = _theme$kitt$choices$s.column;
|
|
1293
|
+
|
|
1294
|
+
if ($direction === 'row') {
|
|
1295
|
+
return css(["margin-right:", "px;"], $isLast ? 0 : row);
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
return css(["margin-bottom:", "px;"], $isLast ? 0 : column);
|
|
1299
|
+
});
|
|
1300
|
+
|
|
1301
|
+
var _excluded$h = ["direction"];
|
|
1302
|
+
|
|
1303
|
+
function ChoicesContainer(_ref) {
|
|
1304
|
+
var direction = _ref.direction,
|
|
1305
|
+
props = _objectWithoutProperties(_ref, _excluded$h);
|
|
1306
|
+
|
|
1307
|
+
if (direction === 'row') {
|
|
1308
|
+
return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
|
|
1309
|
+
horizontal: true
|
|
1310
|
+
}, props));
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
function Choices(_ref2) {
|
|
1317
|
+
var id = _ref2.id,
|
|
1318
|
+
testID = _ref2.testID,
|
|
1319
|
+
type = _ref2.type,
|
|
1320
|
+
_ref2$direction = _ref2.direction,
|
|
1321
|
+
direction = _ref2$direction === void 0 ? 'column' : _ref2$direction,
|
|
1322
|
+
disabled = _ref2.disabled,
|
|
1323
|
+
children = _ref2.children,
|
|
1324
|
+
value = _ref2.value,
|
|
1325
|
+
variant = _ref2.variant,
|
|
1326
|
+
onPress = _ref2.onPress,
|
|
1327
|
+
onChange = _ref2.onChange,
|
|
1328
|
+
onFocus = _ref2.onFocus,
|
|
1329
|
+
onBlur = _ref2.onBlur;
|
|
1330
|
+
|
|
1331
|
+
var _useState = useState(value),
|
|
1332
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1333
|
+
currentValue = _useState2[0],
|
|
1334
|
+
setCurrentValue = _useState2[1];
|
|
1335
|
+
|
|
1336
|
+
var isForm = type && ['radio', 'checkbox'].includes(type);
|
|
1337
|
+
var childrenArray = Children.toArray(children);
|
|
1338
|
+
var sharedProps = {
|
|
1339
|
+
type: type,
|
|
1340
|
+
disabled: disabled,
|
|
1341
|
+
variant: variant,
|
|
1342
|
+
onPress: !isForm ? onPress : undefined,
|
|
1343
|
+
onChange: isForm ? function handleChange(newValue) {
|
|
1344
|
+
setCurrentValue(newValue);
|
|
1345
|
+
if (onChange) onChange(newValue);
|
|
1346
|
+
} : undefined,
|
|
1347
|
+
onFocus: onFocus,
|
|
1348
|
+
onBlur: onBlur
|
|
1349
|
+
};
|
|
1350
|
+
return /*#__PURE__*/jsx(ChoicesContainer, {
|
|
1351
|
+
direction: direction,
|
|
1352
|
+
testID: testID,
|
|
1353
|
+
nativeID: id,
|
|
1354
|
+
children: childrenArray.map(function (child, index) {
|
|
1355
|
+
var element = /*#__PURE__*/cloneElement(child, _objectSpread({
|
|
1356
|
+
selected: isForm ? child.props.value === currentValue : undefined
|
|
1357
|
+
}, sharedProps));
|
|
1358
|
+
return /*#__PURE__*/jsx(ChoiceItemContainer, {
|
|
1359
|
+
$direction: direction,
|
|
1360
|
+
$isLast: index === childrenArray.length - 1,
|
|
1361
|
+
children: element
|
|
1362
|
+
}, child.key);
|
|
1363
|
+
})
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
Choices.Item = ChoiceItem;
|
|
1368
|
+
function createChoicesComponent() {
|
|
1369
|
+
return Choices;
|
|
1370
|
+
}
|
|
1371
|
+
var ButtonChoices = createChoicesComponent();
|
|
1372
|
+
Choices.ButtonChoices = ButtonChoices;
|
|
1373
|
+
var ChoicesElements = {
|
|
1374
|
+
Item: ChoiceItem,
|
|
1375
|
+
ButtonChoices: ButtonChoices
|
|
1376
|
+
};
|
|
1377
|
+
|
|
839
1378
|
function Emoji(_ref) {
|
|
840
1379
|
var emoji = _ref.emoji,
|
|
841
1380
|
size = _ref.size,
|
|
@@ -1220,6 +1759,39 @@ var card = {
|
|
|
1220
1759
|
}
|
|
1221
1760
|
};
|
|
1222
1761
|
|
|
1762
|
+
var choices = {
|
|
1763
|
+
spacing: {
|
|
1764
|
+
row: 12,
|
|
1765
|
+
column: 12
|
|
1766
|
+
},
|
|
1767
|
+
item: {
|
|
1768
|
+
borderRadius: 10,
|
|
1769
|
+
padding: {
|
|
1770
|
+
base: 16,
|
|
1771
|
+
small: 24
|
|
1772
|
+
},
|
|
1773
|
+
backgroundColor: {
|
|
1774
|
+
"default": lateOceanColorPalette.black50,
|
|
1775
|
+
disabled: colors.disabled,
|
|
1776
|
+
selected: colors.primary,
|
|
1777
|
+
pressed: lateOceanColorPalette.lateOceanLight1,
|
|
1778
|
+
hover: lateOceanColorPalette.black100,
|
|
1779
|
+
hoverWhenSelected: lateOceanColorPalette.lateOceanLight1
|
|
1780
|
+
},
|
|
1781
|
+
disabled: {
|
|
1782
|
+
border: {
|
|
1783
|
+
width: 2,
|
|
1784
|
+
color: lateOceanColorPalette.black100
|
|
1785
|
+
}
|
|
1786
|
+
},
|
|
1787
|
+
transition: {
|
|
1788
|
+
property: 'all',
|
|
1789
|
+
duration: 300,
|
|
1790
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
};
|
|
1794
|
+
|
|
1223
1795
|
var feedbackMessage = {
|
|
1224
1796
|
danger: {
|
|
1225
1797
|
backgroundColor: colors.danger
|
|
@@ -1395,8 +1967,14 @@ var input = {
|
|
|
1395
1967
|
};
|
|
1396
1968
|
|
|
1397
1969
|
var inputField = {
|
|
1970
|
+
containerPaddingTop: 5,
|
|
1971
|
+
containerPaddingBottom: 10,
|
|
1972
|
+
feedbackPaddingTop: {
|
|
1973
|
+
base: 5,
|
|
1974
|
+
small: 10
|
|
1975
|
+
},
|
|
1398
1976
|
labelContainerPaddingBottom: 5,
|
|
1399
|
-
|
|
1977
|
+
labelFeedbackMarginLeft: 6
|
|
1400
1978
|
};
|
|
1401
1979
|
|
|
1402
1980
|
var inputTag = {
|
|
@@ -1637,6 +2215,7 @@ var theme = {
|
|
|
1637
2215
|
breakpoints: breakpoints,
|
|
1638
2216
|
button: button,
|
|
1639
2217
|
card: card,
|
|
2218
|
+
choices: choices,
|
|
1640
2219
|
feedbackMessage: feedbackMessage,
|
|
1641
2220
|
forms: forms,
|
|
1642
2221
|
fullScreenModal: fullScreenModal,
|
|
@@ -1652,28 +2231,6 @@ var theme = {
|
|
|
1652
2231
|
navigationModal: navigationModal
|
|
1653
2232
|
};
|
|
1654
2233
|
|
|
1655
|
-
function matchWindowSize(_ref, _ref2) {
|
|
1656
|
-
var width = _ref.width,
|
|
1657
|
-
height = _ref.height;
|
|
1658
|
-
var minWidth = _ref2.minWidth,
|
|
1659
|
-
maxWidth = _ref2.maxWidth,
|
|
1660
|
-
minHeight = _ref2.minHeight,
|
|
1661
|
-
maxHeight = _ref2.maxHeight;
|
|
1662
|
-
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
1663
|
-
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
1664
|
-
return hasWidthMatched && hasHeightMatched;
|
|
1665
|
-
}
|
|
1666
|
-
function useMatchWindowSize(options) {
|
|
1667
|
-
var _useWindowDimensions = useWindowDimensions(),
|
|
1668
|
-
width = _useWindowDimensions.width,
|
|
1669
|
-
height = _useWindowDimensions.height;
|
|
1670
|
-
|
|
1671
|
-
return matchWindowSize({
|
|
1672
|
-
width: width,
|
|
1673
|
-
height: height
|
|
1674
|
-
}, options);
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
2234
|
function createWindowSizeHelper(dimensions) {
|
|
1678
2235
|
return {
|
|
1679
2236
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
@@ -1998,7 +2555,7 @@ function DatePickerAndroid(_ref) {
|
|
|
1998
2555
|
}
|
|
1999
2556
|
|
|
2000
2557
|
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
2001
|
-
var OverlayPressable = /*#__PURE__*/styled(Pressable$
|
|
2558
|
+
var OverlayPressable = /*#__PURE__*/styled(Pressable$2).withConfig({
|
|
2002
2559
|
displayName: "Overlay__OverlayPressable"
|
|
2003
2560
|
})(function (_ref) {
|
|
2004
2561
|
var theme = _ref.theme;
|
|
@@ -2025,7 +2582,7 @@ var BodyView = /*#__PURE__*/styled.View.withConfig({
|
|
|
2025
2582
|
});
|
|
2026
2583
|
function ModalBody(_ref3) {
|
|
2027
2584
|
var children = _ref3.children;
|
|
2028
|
-
return /*#__PURE__*/jsx(ScrollView$
|
|
2585
|
+
return /*#__PURE__*/jsx(ScrollView$2, {
|
|
2029
2586
|
children: /*#__PURE__*/jsx(BodyView, {
|
|
2030
2587
|
children: children
|
|
2031
2588
|
})
|
|
@@ -2677,40 +3234,25 @@ function InputFeedback(_ref) {
|
|
|
2677
3234
|
});
|
|
2678
3235
|
}
|
|
2679
3236
|
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
2696
|
-
});
|
|
2697
|
-
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2698
|
-
displayName: "InputField__LabelContainer"
|
|
2699
|
-
})(["margin-right:", "px;"], function (_ref3) {
|
|
2700
|
-
var theme = _ref3.theme;
|
|
2701
|
-
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
2702
|
-
});
|
|
2703
|
-
function InputField(_ref4) {
|
|
2704
|
-
var label = _ref4.label,
|
|
2705
|
-
labelFeedback = _ref4.labelFeedback,
|
|
2706
|
-
input = _ref4.input,
|
|
2707
|
-
feedback = _ref4.feedback;
|
|
2708
|
-
return /*#__PURE__*/jsxs(FieldContainer, {
|
|
2709
|
-
children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
|
|
2710
|
-
children: [/*#__PURE__*/jsx(LabelContainer, {
|
|
3237
|
+
function InputField(_ref) {
|
|
3238
|
+
var label = _ref.label,
|
|
3239
|
+
labelFeedback = _ref.labelFeedback,
|
|
3240
|
+
input = _ref.input,
|
|
3241
|
+
feedback = _ref.feedback;
|
|
3242
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3243
|
+
return /*#__PURE__*/jsxs(View, {
|
|
3244
|
+
paddingTop: theme.kitt.forms.inputField.containerPaddingTop,
|
|
3245
|
+
paddingBottom: theme.kitt.forms.inputField.containerPaddingBottom,
|
|
3246
|
+
children: [label ? /*#__PURE__*/jsxs(View, {
|
|
3247
|
+
flexDirection: "row",
|
|
3248
|
+
alignItems: "center",
|
|
3249
|
+
paddingBottom: theme.kitt.forms.inputField.labelContainerPaddingBottom,
|
|
3250
|
+
children: [/*#__PURE__*/jsx(View, {
|
|
3251
|
+
marginRight: theme.kitt.forms.inputField.labelFeedbackMarginLeft,
|
|
2711
3252
|
children: label
|
|
2712
3253
|
}), labelFeedback]
|
|
2713
|
-
}) : null, input, feedback ? /*#__PURE__*/jsx(
|
|
3254
|
+
}) : null, input, feedback ? /*#__PURE__*/jsx(View, {
|
|
3255
|
+
paddingTop: theme.kitt.forms.inputField.feedbackPaddingTop,
|
|
2714
3256
|
children: feedback
|
|
2715
3257
|
}) : null]
|
|
2716
3258
|
});
|
|
@@ -2747,7 +3289,7 @@ function InputIcon(_ref) {
|
|
|
2747
3289
|
function InputPressable(_ref) {
|
|
2748
3290
|
var props = _extends({}, _ref);
|
|
2749
3291
|
|
|
2750
|
-
return /*#__PURE__*/jsx(Pressable$
|
|
3292
|
+
return /*#__PURE__*/jsx(Pressable$2, _objectSpread({}, props));
|
|
2751
3293
|
}
|
|
2752
3294
|
|
|
2753
3295
|
var _excluded$8 = ["isPasswordDefaultVisible", "right"];
|
|
@@ -2793,7 +3335,7 @@ var getTypographyColor = function (type) {
|
|
|
2793
3335
|
return type ? 'white' : 'black';
|
|
2794
3336
|
};
|
|
2795
3337
|
|
|
2796
|
-
var InputTagContainer = /*#__PURE__*/styled(View$
|
|
3338
|
+
var InputTagContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
2797
3339
|
displayName: "InputTag__InputTagContainer"
|
|
2798
3340
|
})(["align-items:center;justify-content:center;flex-direction:row;align-self:flex-start;overflow:hidden;padding-horizontal:", "px;background-color:", ";border-radius:", "px;"], function (_ref) {
|
|
2799
3341
|
var theme = _ref.theme;
|
|
@@ -2815,7 +3357,7 @@ var InputTagContainer = /*#__PURE__*/styled(View$1).withConfig({
|
|
|
2815
3357
|
var theme = _ref3.theme;
|
|
2816
3358
|
return theme.kitt.forms.inputTag.borderRadius;
|
|
2817
3359
|
});
|
|
2818
|
-
var IconContainer = /*#__PURE__*/styled(View$
|
|
3360
|
+
var IconContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
2819
3361
|
displayName: "InputTag__IconContainer"
|
|
2820
3362
|
})(["margin-right:", "px;"], function (_ref4) {
|
|
2821
3363
|
var theme = _ref4.theme;
|
|
@@ -3115,47 +3657,6 @@ function FullScreenModal(_ref2) {
|
|
|
3115
3657
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
3116
3658
|
FullScreenModal.Body = FullScreenModalBody;
|
|
3117
3659
|
|
|
3118
|
-
function SpinningIcon(_ref) {
|
|
3119
|
-
var icon = _ref.icon,
|
|
3120
|
-
color = _ref.color;
|
|
3121
|
-
|
|
3122
|
-
if (process.env.NODE_ENV !== 'production' && !color) {
|
|
3123
|
-
throw new Error("Invalid color passed to SpinningIcon: ".concat(String(color)));
|
|
3124
|
-
}
|
|
3125
|
-
|
|
3126
|
-
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
3127
|
-
color: color
|
|
3128
|
-
});
|
|
3129
|
-
var animationRef = useRef(new Animated$1.Value(0));
|
|
3130
|
-
var rotation = animationRef.current.interpolate({
|
|
3131
|
-
inputRange: [0, 1],
|
|
3132
|
-
outputRange: ['0deg', '360deg']
|
|
3133
|
-
});
|
|
3134
|
-
useEffect(function () {
|
|
3135
|
-
if (process.env.NODE_ENV === 'test') return undefined;
|
|
3136
|
-
var animation = Animated$1.loop(Animated$1.timing(animationRef.current, {
|
|
3137
|
-
toValue: 1,
|
|
3138
|
-
duration: 1100,
|
|
3139
|
-
easing: Easing.linear,
|
|
3140
|
-
useNativeDriver: true
|
|
3141
|
-
}));
|
|
3142
|
-
animation.start();
|
|
3143
|
-
return function () {
|
|
3144
|
-
if (process.env.NODE_ENV === 'test') return undefined;
|
|
3145
|
-
animation.stop();
|
|
3146
|
-
return undefined;
|
|
3147
|
-
};
|
|
3148
|
-
}, []);
|
|
3149
|
-
return /*#__PURE__*/jsx(Animated$1.View, {
|
|
3150
|
-
style: {
|
|
3151
|
-
transform: [{
|
|
3152
|
-
rotate: rotation
|
|
3153
|
-
}]
|
|
3154
|
-
},
|
|
3155
|
-
children: clonedIcon
|
|
3156
|
-
});
|
|
3157
|
-
}
|
|
3158
|
-
|
|
3159
3660
|
var _excluded$7 = ["children"];
|
|
3160
3661
|
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
3161
3662
|
displayName: "ListItemContent__ContentView"
|
|
@@ -3255,7 +3756,7 @@ function ListItem(_ref5) {
|
|
|
3255
3756
|
onPress = _ref5.onPress,
|
|
3256
3757
|
rest = _objectWithoutProperties(_ref5, _excluded$5);
|
|
3257
3758
|
|
|
3258
|
-
var Wrapper = onPress ? Pressable$
|
|
3759
|
+
var Wrapper = onPress ? Pressable$2 : Fragment$1;
|
|
3259
3760
|
var wrapperProps = onPress ? _objectSpread({
|
|
3260
3761
|
accessibilityRole: 'button',
|
|
3261
3762
|
onPress: onPress
|
|
@@ -3282,14 +3783,6 @@ ListItem.Content = ListItemContent;
|
|
|
3282
3783
|
ListItem.SideContent = ListItemSideContent;
|
|
3283
3784
|
ListItem.SideContainer = ListItemSideContainer;
|
|
3284
3785
|
|
|
3285
|
-
function LoaderIcon(_ref) {
|
|
3286
|
-
var color = _ref.color;
|
|
3287
|
-
return /*#__PURE__*/jsx(SpinningIcon, {
|
|
3288
|
-
color: color,
|
|
3289
|
-
icon: /*#__PURE__*/jsx(ArcIcon, {})
|
|
3290
|
-
});
|
|
3291
|
-
}
|
|
3292
|
-
|
|
3293
3786
|
function IconContent(_ref) {
|
|
3294
3787
|
var type = _ref.type,
|
|
3295
3788
|
color = _ref.color;
|
|
@@ -3475,7 +3968,7 @@ function CloseButton(_ref) {
|
|
|
3475
3968
|
});
|
|
3476
3969
|
}
|
|
3477
3970
|
|
|
3478
|
-
var ModalBehaviourContainer = /*#__PURE__*/styled(View$
|
|
3971
|
+
var ModalBehaviourContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
3479
3972
|
displayName: "ModalBehaviour__ModalBehaviourContainer"
|
|
3480
3973
|
})(["", ""], function () {
|
|
3481
3974
|
if (Platform.OS !== 'web') return undefined;
|
|
@@ -3642,16 +4135,8 @@ function KittNativeBaseProvider(_ref) {
|
|
|
3642
4135
|
});
|
|
3643
4136
|
}
|
|
3644
4137
|
|
|
3645
|
-
var Stack = Stack$1;
|
|
3646
|
-
var VStack = VStack$1;
|
|
3647
|
-
var HStack = HStack$1;
|
|
3648
|
-
|
|
3649
|
-
var View = View$2;
|
|
3650
|
-
var ScrollView = ScrollView$2;
|
|
3651
|
-
var Pressable = Pressable$2;
|
|
3652
|
-
|
|
3653
4138
|
var _excluded$4 = ["children"];
|
|
3654
|
-
var ViewWithPadding = /*#__PURE__*/styled(View$
|
|
4139
|
+
var ViewWithPadding = /*#__PURE__*/styled(View$2).withConfig({
|
|
3655
4140
|
displayName: "ContentPadding__ViewWithPadding"
|
|
3656
4141
|
})(["padding:", ";"], function (_ref) {
|
|
3657
4142
|
var theme = _ref.theme;
|
|
@@ -3757,7 +4242,7 @@ var HeaderContainer = /*#__PURE__*/styled(ContentPadding).withConfig({
|
|
|
3757
4242
|
return theme.kitt.colors.separator;
|
|
3758
4243
|
});
|
|
3759
4244
|
});
|
|
3760
|
-
var Row = /*#__PURE__*/styled(View$
|
|
4245
|
+
var Row = /*#__PURE__*/styled(View$2).withConfig({
|
|
3761
4246
|
displayName: "Header__Row"
|
|
3762
4247
|
})(["flex-direction:row;justify-content:", ";align-items:center;"], function (_ref7) {
|
|
3763
4248
|
var $hasContent = _ref7.$hasContent,
|
|
@@ -3770,7 +4255,7 @@ var ButtonContainer = /*#__PURE__*/styled.View.withConfig({
|
|
|
3770
4255
|
var theme = _ref8.theme;
|
|
3771
4256
|
return theme.kitt.iconButton.width;
|
|
3772
4257
|
});
|
|
3773
|
-
var ChildrenComponent = /*#__PURE__*/styled(View$
|
|
4258
|
+
var ChildrenComponent = /*#__PURE__*/styled(View$2).withConfig({
|
|
3774
4259
|
displayName: "Header__ChildrenComponent"
|
|
3775
4260
|
})(["flex:1;align-items:center;", ";"], function (_ref9) {
|
|
3776
4261
|
var theme = _ref9.theme,
|
|
@@ -3829,7 +4314,7 @@ function Header(_ref12) {
|
|
|
3829
4314
|
});
|
|
3830
4315
|
}
|
|
3831
4316
|
|
|
3832
|
-
var NavigationModalContainer = /*#__PURE__*/styled(View$
|
|
4317
|
+
var NavigationModalContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
3833
4318
|
displayName: "NavigationModalContainer"
|
|
3834
4319
|
})(["position:relative;background-color:", ";flex:1;", ""], function (_ref) {
|
|
3835
4320
|
var theme = _ref.theme,
|
|
@@ -3840,7 +4325,7 @@ var NavigationModalContainer = /*#__PURE__*/styled(View$1).withConfig({
|
|
|
3840
4325
|
return css(["min-height:100vh;"]);
|
|
3841
4326
|
});
|
|
3842
4327
|
|
|
3843
|
-
var ContainerWithoutHeader = /*#__PURE__*/styled(View$
|
|
4328
|
+
var ContainerWithoutHeader = /*#__PURE__*/styled(View$2).withConfig({
|
|
3844
4329
|
displayName: "NavigationModal__ContainerWithoutHeader"
|
|
3845
4330
|
})(["justify-content:space-between;flex:1;"]);
|
|
3846
4331
|
function NavigationModal(_ref) {
|
|
@@ -3850,10 +4335,10 @@ function NavigationModal(_ref) {
|
|
|
3850
4335
|
backgroundColor = _ref.backgroundColor;
|
|
3851
4336
|
return /*#__PURE__*/jsxs(NavigationModalContainer, {
|
|
3852
4337
|
$backgroundColor: backgroundColor,
|
|
3853
|
-
children: [header ? /*#__PURE__*/jsx(View$
|
|
4338
|
+
children: [header ? /*#__PURE__*/jsx(View$2, {
|
|
3854
4339
|
children: header
|
|
3855
4340
|
}) : null, /*#__PURE__*/jsxs(ContainerWithoutHeader, {
|
|
3856
|
-
children: [/*#__PURE__*/jsx(ScrollView$
|
|
4341
|
+
children: [/*#__PURE__*/jsx(ScrollView$2, {
|
|
3857
4342
|
bounces: false,
|
|
3858
4343
|
contentContainerStyle: {
|
|
3859
4344
|
flexGrow: 1,
|
|
@@ -4133,7 +4618,7 @@ function Picker(_ref) {
|
|
|
4133
4618
|
color: item.props.value === value ? theme.picker.ios.selected.color : undefined
|
|
4134
4619
|
});
|
|
4135
4620
|
})
|
|
4136
|
-
}) : /*#__PURE__*/jsx(ScrollView$
|
|
4621
|
+
}) : /*#__PURE__*/jsx(ScrollView$2, {
|
|
4137
4622
|
testID: testID,
|
|
4138
4623
|
children: React.Children.map(children, function (child) {
|
|
4139
4624
|
var item = child;
|
|
@@ -4221,7 +4706,7 @@ function SkeletonContent(_ref3) {
|
|
|
4221
4706
|
});
|
|
4222
4707
|
}
|
|
4223
4708
|
|
|
4224
|
-
var SkeletonContainer = /*#__PURE__*/styled(View$
|
|
4709
|
+
var SkeletonContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
4225
4710
|
displayName: "Skeleton__SkeletonContainer"
|
|
4226
4711
|
})(["overflow:hidden;"]);
|
|
4227
4712
|
function Skeleton(_ref) {
|
|
@@ -4725,7 +5210,7 @@ function ModalDateTimePicker(_ref2) {
|
|
|
4725
5210
|
}) : null, /*#__PURE__*/jsx(Modal.Body, {
|
|
4726
5211
|
children: /*#__PURE__*/jsx(DateTimePicker, {
|
|
4727
5212
|
is24Hour: true,
|
|
4728
|
-
testID: "
|
|
5213
|
+
testID: "timePicker.ModalDateTimePicker.dateTimeNativePicker",
|
|
4729
5214
|
value: currentValue,
|
|
4730
5215
|
mode: "time",
|
|
4731
5216
|
display: Platform.OS === 'ios' ? 'spinner' : 'default',
|
|
@@ -4832,7 +5317,7 @@ function TimePicker(_ref) {
|
|
|
4832
5317
|
children: displayedValue
|
|
4833
5318
|
}), Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsx(DateTimePicker, {
|
|
4834
5319
|
is24Hour: true,
|
|
4835
|
-
testID: "
|
|
5320
|
+
testID: "timePicker.TimePicker.dateTimeNativePicker",
|
|
4836
5321
|
value: dateTimePickerValue,
|
|
4837
5322
|
mode: "time",
|
|
4838
5323
|
display: "default",
|
|
@@ -4871,7 +5356,7 @@ var StyledTooltipContent = /*#__PURE__*/styled.View.withConfig({
|
|
|
4871
5356
|
|
|
4872
5357
|
function ArrowView(props) {
|
|
4873
5358
|
var theme = /*#__PURE__*/useTheme();
|
|
4874
|
-
return /*#__PURE__*/jsx(View$
|
|
5359
|
+
return /*#__PURE__*/jsx(View$2, _objectSpread(_objectSpread({}, props), {}, {
|
|
4875
5360
|
children: /*#__PURE__*/jsx(TooltipArrowIcon, {
|
|
4876
5361
|
color: theme.kitt.tooltip.backgroundColor
|
|
4877
5362
|
})
|
|
@@ -4977,16 +5462,16 @@ function Tooltip(_ref) {
|
|
|
4977
5462
|
});
|
|
4978
5463
|
}, [x, y, reference, floating, update, refs, middlewareData, onUpdate]);
|
|
4979
5464
|
return /*#__PURE__*/jsxs(TooltipContainer, {
|
|
4980
|
-
children: [/*#__PURE__*/jsx(View$
|
|
5465
|
+
children: [/*#__PURE__*/jsx(View$2, {
|
|
4981
5466
|
ref: reference,
|
|
4982
|
-
children: /*#__PURE__*/jsx(Pressable$
|
|
5467
|
+
children: /*#__PURE__*/jsx(Pressable$2, {
|
|
4983
5468
|
accessibilityRole: "button",
|
|
4984
5469
|
onPress: function handlePress() {
|
|
4985
5470
|
pressed.value = !pressed.value;
|
|
4986
5471
|
},
|
|
4987
5472
|
children: children
|
|
4988
5473
|
})
|
|
4989
|
-
}), /*#__PURE__*/jsx(View$
|
|
5474
|
+
}), /*#__PURE__*/jsx(View$2, {
|
|
4990
5475
|
ref: floating,
|
|
4991
5476
|
accessibilityElementsHidden: !pressed.value,
|
|
4992
5477
|
importantForAccessibility: pressed.value === true ? 'auto' : 'no-hide-descendants',
|
|
@@ -5219,5 +5704,5 @@ function withTheme(WrappedComponent) {
|
|
|
5219
5704
|
});
|
|
5220
5705
|
}
|
|
5221
5706
|
|
|
5222
|
-
export { Avatar, Button, Card, Checkbox, DatePicker, Emoji, ExternalAppLink, ExternalLink, Flex, FullScreenModal, HStack, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpoints, KittBreakpointsMax, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MatchWindowSize, Message, Modal, ModalBehaviour, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, Radio, ScrollView, DeprecatedSection as Section, Skeleton, SpinningIcon, Stack, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, View, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
|
|
5707
|
+
export { Actions, Avatar, Button, Card, Checkbox, ChoicesElements, DatePicker, Emoji, ExternalAppLink, ExternalLink, Flex, FullScreenModal, HStack, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpoints, KittBreakpointsMax, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MatchWindowSize, Message, Modal, ModalBehaviour, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, Radio, ScrollView, DeprecatedSection as Section, Skeleton, SpinningIcon, Stack, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, View, createChoicesComponent, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
|
|
5223
5708
|
//# sourceMappingURL=index-browser-all.es.ios.js.map
|