@ornikar/kitt-universal 9.3.1 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definitions/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/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/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 +1 -0
- 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/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 +896 -422
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +896 -422
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +896 -422
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +1034 -557
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +816 -371
- 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 +865 -419
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +34 -0
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +34 -0
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +34 -0
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +34 -0
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +34 -0
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +34 -0
- 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 +2 -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
|
-
lineHeight: fontSizeForNativeBase,
|
|
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);
|
|
@@ -271,262 +420,46 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
271
420
|
|
|
272
421
|
Typography.h5 = createHeading(5, 'header5');
|
|
273
422
|
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
-
};
|
|
455
|
-
|
|
456
|
-
return /*#__PURE__*/jsx(StyledPressable, {
|
|
457
|
-
ref: ref,
|
|
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
|
-
});
|
|
482
|
-
|
|
483
|
-
var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
484
|
-
displayName: "BaseStyledButtonPressable"
|
|
485
|
-
})(["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) {
|
|
486
|
-
var theme = _ref.theme;
|
|
487
|
-
return theme.kitt.button.minWidth;
|
|
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, {
|
|
@@ -777,35 +710,314 @@ var Button = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
777
710
|
xLarge: xLarge,
|
|
778
711
|
size: sizeProp
|
|
779
712
|
});
|
|
780
|
-
return /*#__PURE__*/jsx(AnimatedButtonPressable, {
|
|
781
|
-
ref: ref,
|
|
782
|
-
accessibilityRole: accessibilityRole,
|
|
783
|
-
testID: testID,
|
|
784
|
-
href: href,
|
|
785
|
-
hrefAttrs: hrefAttrs,
|
|
786
|
-
disabled: disabled,
|
|
787
|
-
$isStretch: stretch,
|
|
788
|
-
$type: type,
|
|
789
|
-
$variant: variant,
|
|
790
|
-
onPress: onPress,
|
|
791
|
-
children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
|
|
792
|
-
$type: type,
|
|
793
|
-
$variant: variant,
|
|
794
|
-
$isStretch: stretch,
|
|
795
|
-
$size: size,
|
|
796
|
-
$isDisabled: disabled,
|
|
797
|
-
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
798
|
-
type: type,
|
|
799
|
-
variant: variant,
|
|
800
|
-
$isStretch: stretch,
|
|
801
|
-
isDisabled: disabled,
|
|
802
|
-
icon: icon,
|
|
803
|
-
iconPosition: iconPosition,
|
|
804
|
-
children: children
|
|
805
|
-
}), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
|
|
806
|
-
})
|
|
713
|
+
return /*#__PURE__*/jsx(AnimatedButtonPressable, {
|
|
714
|
+
ref: ref,
|
|
715
|
+
accessibilityRole: accessibilityRole,
|
|
716
|
+
testID: testID,
|
|
717
|
+
href: href,
|
|
718
|
+
hrefAttrs: hrefAttrs,
|
|
719
|
+
disabled: disabled,
|
|
720
|
+
$isStretch: stretch,
|
|
721
|
+
$type: type,
|
|
722
|
+
$variant: variant,
|
|
723
|
+
onPress: onPress,
|
|
724
|
+
children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
|
|
725
|
+
$type: type,
|
|
726
|
+
$variant: variant,
|
|
727
|
+
$isStretch: stretch,
|
|
728
|
+
$size: size,
|
|
729
|
+
$isDisabled: disabled,
|
|
730
|
+
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
731
|
+
type: type,
|
|
732
|
+
variant: variant,
|
|
733
|
+
$isStretch: stretch,
|
|
734
|
+
isDisabled: disabled,
|
|
735
|
+
icon: icon,
|
|
736
|
+
iconPosition: iconPosition,
|
|
737
|
+
children: children
|
|
738
|
+
}), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
|
|
739
|
+
})
|
|
740
|
+
});
|
|
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))
|
|
807
1019
|
});
|
|
808
|
-
}
|
|
1020
|
+
}
|
|
809
1021
|
|
|
810
1022
|
var Container$5 = /*#__PURE__*/styled.View.withConfig({
|
|
811
1023
|
displayName: "Card__Container"
|
|
@@ -836,6 +1048,313 @@ function Card(_ref6) {
|
|
|
836
1048
|
});
|
|
837
1049
|
}
|
|
838
1050
|
|
|
1051
|
+
function getCurrentTextColor(_ref) {
|
|
1052
|
+
var isDisabled = _ref.isDisabled,
|
|
1053
|
+
isSelected = _ref.isSelected,
|
|
1054
|
+
isPressed = _ref.isPressed,
|
|
1055
|
+
isHovered = _ref.isHovered;
|
|
1056
|
+
if (isDisabled) return 'black-light';
|
|
1057
|
+
if (isSelected && isHovered) return 'white';
|
|
1058
|
+
if (isSelected || isPressed) return 'white';
|
|
1059
|
+
return 'black';
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
function getBorderRadius(defaultRadius, variant) {
|
|
1063
|
+
// The clean way to have the rounded effect would have been to know the children height since radius >= height * 0.5
|
|
1064
|
+
// We don't control over the height of the rendered children we just go with a arbitrary really high value
|
|
1065
|
+
if (variant === 'rounded') return 800;
|
|
1066
|
+
return defaultRadius;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
var DisabledBorder = /*#__PURE__*/styled(View$2).withConfig({
|
|
1070
|
+
displayName: "ChoiceItem__DisabledBorder"
|
|
1071
|
+
})(["border-radius:", "px;", ";"], function (_ref2) {
|
|
1072
|
+
var theme = _ref2.theme,
|
|
1073
|
+
$variant = _ref2.$variant;
|
|
1074
|
+
return getBorderRadius(theme.kitt.choices.item.borderRadius, $variant);
|
|
1075
|
+
}, function (_ref3) {
|
|
1076
|
+
var theme = _ref3.theme;
|
|
1077
|
+
var _theme$kitt$choices$i = theme.kitt.choices.item.disabled.border,
|
|
1078
|
+
width = _theme$kitt$choices$i.width,
|
|
1079
|
+
color = _theme$kitt$choices$i.color;
|
|
1080
|
+
return css(["border:", "px solid ", ";"], width, color);
|
|
1081
|
+
});
|
|
1082
|
+
var ChoiceItemView = /*#__PURE__*/styled(Animated.View).withConfig({
|
|
1083
|
+
displayName: "ChoiceItem__ChoiceItemView"
|
|
1084
|
+
})(["position:relative;border-radius:", "px;background-color:", ";", ";", ""], function (_ref4) {
|
|
1085
|
+
var theme = _ref4.theme,
|
|
1086
|
+
$variant = _ref4.$variant;
|
|
1087
|
+
return getBorderRadius(theme.kitt.choices.item.borderRadius, $variant);
|
|
1088
|
+
}, function (_ref5) {
|
|
1089
|
+
var theme = _ref5.theme,
|
|
1090
|
+
$isHovered = _ref5.$isHovered,
|
|
1091
|
+
$isPressed = _ref5.$isPressed,
|
|
1092
|
+
$isDisabled = _ref5.$isDisabled,
|
|
1093
|
+
$isSelected = _ref5.$isSelected;
|
|
1094
|
+
var _theme$kitt$choices$i2 = theme.kitt.choices.item.backgroundColor,
|
|
1095
|
+
hoverWhenSelected = _theme$kitt$choices$i2.hoverWhenSelected,
|
|
1096
|
+
hover = _theme$kitt$choices$i2.hover,
|
|
1097
|
+
disabled = _theme$kitt$choices$i2.disabled,
|
|
1098
|
+
selected = _theme$kitt$choices$i2.selected,
|
|
1099
|
+
pressed = _theme$kitt$choices$i2.pressed,
|
|
1100
|
+
defaultBackground = _theme$kitt$choices$i2["default"];
|
|
1101
|
+
if ($isDisabled) return disabled;
|
|
1102
|
+
if ($isSelected && $isHovered) return hoverWhenSelected;
|
|
1103
|
+
if ($isPressed) return pressed;
|
|
1104
|
+
if ($isHovered) return hover;
|
|
1105
|
+
if ($isSelected) return selected;
|
|
1106
|
+
return defaultBackground;
|
|
1107
|
+
}, function (_ref6) {
|
|
1108
|
+
var theme = _ref6.theme;
|
|
1109
|
+
var _theme$kitt$choices$i3 = theme.kitt.choices.item.padding,
|
|
1110
|
+
base = _theme$kitt$choices$i3.base,
|
|
1111
|
+
small = _theme$kitt$choices$i3.small;
|
|
1112
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
1113
|
+
minWidth: KittBreakpoints.SMALL
|
|
1114
|
+
}, css(["padding:", "px;"], small), css(["padding:", "px;"], base));
|
|
1115
|
+
}, function (_ref7) {
|
|
1116
|
+
var theme = _ref7.theme;
|
|
1117
|
+
if (Platform.OS !== 'web') return undefined;
|
|
1118
|
+
var _theme$kitt$choices$i4 = theme.kitt.choices.item.transition,
|
|
1119
|
+
property = _theme$kitt$choices$i4.property,
|
|
1120
|
+
duration = _theme$kitt$choices$i4.duration,
|
|
1121
|
+
timingFunction = _theme$kitt$choices$i4.timingFunction;
|
|
1122
|
+
return css(["transition:", " ", "ms ", ";"], property, duration, timingFunction);
|
|
1123
|
+
});
|
|
1124
|
+
function ChoiceItem(_ref8) {
|
|
1125
|
+
var _ref8$type = _ref8.type,
|
|
1126
|
+
type = _ref8$type === void 0 ? 'button' : _ref8$type,
|
|
1127
|
+
value = _ref8.value,
|
|
1128
|
+
selected = _ref8.selected,
|
|
1129
|
+
disabled = _ref8.disabled,
|
|
1130
|
+
variant = _ref8.variant,
|
|
1131
|
+
_children = _ref8.children,
|
|
1132
|
+
isPressedInternal = _ref8.isPressedInternal,
|
|
1133
|
+
isHoveredInternal = _ref8.isHoveredInternal,
|
|
1134
|
+
onPress = _ref8.onPress,
|
|
1135
|
+
onChange = _ref8.onChange,
|
|
1136
|
+
onBlur = _ref8.onBlur,
|
|
1137
|
+
onFocus = _ref8.onFocus;
|
|
1138
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1139
|
+
var pressed = useSharedValue(Boolean(isPressedInternal));
|
|
1140
|
+
var progress = useDerivedValue(function () {
|
|
1141
|
+
var _f = function () {
|
|
1142
|
+
return withTiming(pressed.value ? 1 : 0, {
|
|
1143
|
+
duration: theme.kitt.choices.item.transition.duration
|
|
1144
|
+
});
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
_f._closure = {
|
|
1148
|
+
withTiming: withTiming,
|
|
1149
|
+
pressed: pressed,
|
|
1150
|
+
theme: {
|
|
1151
|
+
kitt: {
|
|
1152
|
+
choices: {
|
|
1153
|
+
item: {
|
|
1154
|
+
transition: {
|
|
1155
|
+
duration: theme.kitt.choices.item.transition.duration
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
};
|
|
1162
|
+
_f.asString = "function _f(){const{withTiming,pressed,theme}=jsThis._closure;{return withTiming(pressed.value?1:0,{duration:theme.kitt.choices.item.transition.duration});}}";
|
|
1163
|
+
_f.__workletHash = 1120030177160;
|
|
1164
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/ChoiceItem.tsx (180:35)";
|
|
1165
|
+
return _f;
|
|
1166
|
+
}());
|
|
1167
|
+
var backgroundStyles = useAnimatedStyle(function () {
|
|
1168
|
+
var _f = function () {
|
|
1169
|
+
var _theme$kitt$choices$i5 = theme.kitt.choices.item.backgroundColor,
|
|
1170
|
+
defaultBg = _theme$kitt$choices$i5["default"],
|
|
1171
|
+
pressedBg = _theme$kitt$choices$i5.pressed,
|
|
1172
|
+
selectedBg = _theme$kitt$choices$i5.selected,
|
|
1173
|
+
disabledBg = _theme$kitt$choices$i5.disabled;
|
|
1174
|
+
if (disabled) return {
|
|
1175
|
+
backgroundColor: disabledBg
|
|
1176
|
+
};
|
|
1177
|
+
if (selected) return {
|
|
1178
|
+
backgroundColor: selectedBg
|
|
1179
|
+
};
|
|
1180
|
+
return {
|
|
1181
|
+
backgroundColor: interpolateColor(progress.value, [0, 1], [defaultBg, pressedBg])
|
|
1182
|
+
};
|
|
1183
|
+
};
|
|
1184
|
+
|
|
1185
|
+
_f._closure = {
|
|
1186
|
+
theme: {
|
|
1187
|
+
kitt: {
|
|
1188
|
+
choices: {
|
|
1189
|
+
item: {
|
|
1190
|
+
backgroundColor: theme.kitt.choices.item.backgroundColor
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
},
|
|
1195
|
+
disabled: disabled,
|
|
1196
|
+
selected: selected,
|
|
1197
|
+
interpolateColor: interpolateColor,
|
|
1198
|
+
progress: progress
|
|
1199
|
+
};
|
|
1200
|
+
_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])};}}";
|
|
1201
|
+
_f.__workletHash = 15506726129309;
|
|
1202
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/ChoiceItem.tsx (184:44)";
|
|
1203
|
+
return _f;
|
|
1204
|
+
}());
|
|
1205
|
+
|
|
1206
|
+
var handleChange = function () {
|
|
1207
|
+
if (!onChange) return; // Checkbox can be toggled
|
|
1208
|
+
|
|
1209
|
+
if (type === 'checkbox') {
|
|
1210
|
+
onChange(selected ? undefined : value);
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
onChange(value);
|
|
1215
|
+
};
|
|
1216
|
+
|
|
1217
|
+
return /*#__PURE__*/jsx(Pressable, {
|
|
1218
|
+
disabled: disabled,
|
|
1219
|
+
accessibilityRole: type,
|
|
1220
|
+
accessibilityState: {
|
|
1221
|
+
checked: selected
|
|
1222
|
+
},
|
|
1223
|
+
onBlur: onBlur,
|
|
1224
|
+
onFocus: onFocus,
|
|
1225
|
+
onPress: function handlePress(e) {
|
|
1226
|
+
if (onFocus) onFocus(e);
|
|
1227
|
+
if (onPress) onPress();
|
|
1228
|
+
handleChange();
|
|
1229
|
+
if (onBlur) onBlur(e);
|
|
1230
|
+
},
|
|
1231
|
+
onPressIn: function onPressIn() {
|
|
1232
|
+
pressed.value = true;
|
|
1233
|
+
},
|
|
1234
|
+
onPressOut: function onPressOut() {
|
|
1235
|
+
pressed.value = false;
|
|
1236
|
+
},
|
|
1237
|
+
children: function children(_ref9) {
|
|
1238
|
+
var isHovered = _ref9.isHovered,
|
|
1239
|
+
isPressed = _ref9.isPressed;
|
|
1240
|
+
return /*#__PURE__*/jsxs(ChoiceItemView, {
|
|
1241
|
+
style: Platform.OS !== 'web' ? [backgroundStyles] : undefined,
|
|
1242
|
+
$isHovered: isHovered || isHoveredInternal,
|
|
1243
|
+
$isDisabled: disabled,
|
|
1244
|
+
$isSelected: selected,
|
|
1245
|
+
$isPressed: isPressed || isPressedInternal,
|
|
1246
|
+
$variant: variant,
|
|
1247
|
+
children: [/*#__PURE__*/jsx(Typography.SetDefaultColor, {
|
|
1248
|
+
value: getCurrentTextColor({
|
|
1249
|
+
isDisabled: disabled,
|
|
1250
|
+
isSelected: selected || isPressedInternal,
|
|
1251
|
+
isPressed: isPressed,
|
|
1252
|
+
isHovered: isHovered || isHoveredInternal
|
|
1253
|
+
}),
|
|
1254
|
+
children: _children
|
|
1255
|
+
}), disabled ? /*#__PURE__*/jsx(DisabledBorder, {
|
|
1256
|
+
$variant: variant,
|
|
1257
|
+
style: StyleSheet.absoluteFillObject
|
|
1258
|
+
}) : null]
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
var ChoiceItemContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
1265
|
+
displayName: "ChoiceItemContainer"
|
|
1266
|
+
})(["", ""], function (_ref) {
|
|
1267
|
+
var theme = _ref.theme,
|
|
1268
|
+
$isLast = _ref.$isLast,
|
|
1269
|
+
$direction = _ref.$direction;
|
|
1270
|
+
var _theme$kitt$choices$s = theme.kitt.choices.spacing,
|
|
1271
|
+
row = _theme$kitt$choices$s.row,
|
|
1272
|
+
column = _theme$kitt$choices$s.column;
|
|
1273
|
+
|
|
1274
|
+
if ($direction === 'row') {
|
|
1275
|
+
return css(["margin-right:", "px;"], $isLast ? 0 : row);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
return css(["margin-bottom:", "px;"], $isLast ? 0 : column);
|
|
1279
|
+
});
|
|
1280
|
+
|
|
1281
|
+
var _excluded$h = ["direction"];
|
|
1282
|
+
|
|
1283
|
+
function ChoicesContainer(_ref) {
|
|
1284
|
+
var direction = _ref.direction,
|
|
1285
|
+
props = _objectWithoutProperties(_ref, _excluded$h);
|
|
1286
|
+
|
|
1287
|
+
if (direction === 'row') {
|
|
1288
|
+
return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
|
|
1289
|
+
horizontal: true
|
|
1290
|
+
}, props));
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
function Choices(_ref2) {
|
|
1297
|
+
var id = _ref2.id,
|
|
1298
|
+
testID = _ref2.testID,
|
|
1299
|
+
type = _ref2.type,
|
|
1300
|
+
_ref2$direction = _ref2.direction,
|
|
1301
|
+
direction = _ref2$direction === void 0 ? 'column' : _ref2$direction,
|
|
1302
|
+
disabled = _ref2.disabled,
|
|
1303
|
+
children = _ref2.children,
|
|
1304
|
+
value = _ref2.value,
|
|
1305
|
+
variant = _ref2.variant,
|
|
1306
|
+
onPress = _ref2.onPress,
|
|
1307
|
+
onChange = _ref2.onChange,
|
|
1308
|
+
onFocus = _ref2.onFocus,
|
|
1309
|
+
onBlur = _ref2.onBlur;
|
|
1310
|
+
|
|
1311
|
+
var _useState = useState(value),
|
|
1312
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1313
|
+
currentValue = _useState2[0],
|
|
1314
|
+
setCurrentValue = _useState2[1];
|
|
1315
|
+
|
|
1316
|
+
var isForm = type && ['radio', 'checkbox'].includes(type);
|
|
1317
|
+
var childrenArray = Children.toArray(children);
|
|
1318
|
+
var sharedProps = {
|
|
1319
|
+
type: type,
|
|
1320
|
+
disabled: disabled,
|
|
1321
|
+
variant: variant,
|
|
1322
|
+
onPress: !isForm ? onPress : undefined,
|
|
1323
|
+
onChange: isForm ? function handleChange(newValue) {
|
|
1324
|
+
setCurrentValue(newValue);
|
|
1325
|
+
if (onChange) onChange(newValue);
|
|
1326
|
+
} : undefined,
|
|
1327
|
+
onFocus: onFocus,
|
|
1328
|
+
onBlur: onBlur
|
|
1329
|
+
};
|
|
1330
|
+
return /*#__PURE__*/jsx(ChoicesContainer, {
|
|
1331
|
+
direction: direction,
|
|
1332
|
+
testID: testID,
|
|
1333
|
+
nativeID: id,
|
|
1334
|
+
children: childrenArray.map(function (child, index) {
|
|
1335
|
+
var element = /*#__PURE__*/cloneElement(child, _objectSpread({
|
|
1336
|
+
selected: isForm ? child.props.value === currentValue : undefined
|
|
1337
|
+
}, sharedProps));
|
|
1338
|
+
return /*#__PURE__*/jsx(ChoiceItemContainer, {
|
|
1339
|
+
$direction: direction,
|
|
1340
|
+
$isLast: index === childrenArray.length - 1,
|
|
1341
|
+
children: element
|
|
1342
|
+
}, child.key);
|
|
1343
|
+
})
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
Choices.Item = ChoiceItem;
|
|
1348
|
+
function createChoicesComponent() {
|
|
1349
|
+
return Choices;
|
|
1350
|
+
}
|
|
1351
|
+
var ButtonChoices = createChoicesComponent();
|
|
1352
|
+
Choices.ButtonChoices = ButtonChoices;
|
|
1353
|
+
var ChoicesElements = {
|
|
1354
|
+
Item: ChoiceItem,
|
|
1355
|
+
ButtonChoices: ButtonChoices
|
|
1356
|
+
};
|
|
1357
|
+
|
|
839
1358
|
function Emoji(_ref) {
|
|
840
1359
|
var emoji = _ref.emoji,
|
|
841
1360
|
size = _ref.size,
|
|
@@ -1220,6 +1739,39 @@ var card = {
|
|
|
1220
1739
|
}
|
|
1221
1740
|
};
|
|
1222
1741
|
|
|
1742
|
+
var choices = {
|
|
1743
|
+
spacing: {
|
|
1744
|
+
row: 12,
|
|
1745
|
+
column: 12
|
|
1746
|
+
},
|
|
1747
|
+
item: {
|
|
1748
|
+
borderRadius: 10,
|
|
1749
|
+
padding: {
|
|
1750
|
+
base: 16,
|
|
1751
|
+
small: 24
|
|
1752
|
+
},
|
|
1753
|
+
backgroundColor: {
|
|
1754
|
+
"default": lateOceanColorPalette.black50,
|
|
1755
|
+
disabled: colors.disabled,
|
|
1756
|
+
selected: colors.primary,
|
|
1757
|
+
pressed: lateOceanColorPalette.lateOceanLight1,
|
|
1758
|
+
hover: lateOceanColorPalette.black100,
|
|
1759
|
+
hoverWhenSelected: lateOceanColorPalette.lateOceanLight1
|
|
1760
|
+
},
|
|
1761
|
+
disabled: {
|
|
1762
|
+
border: {
|
|
1763
|
+
width: 2,
|
|
1764
|
+
color: lateOceanColorPalette.black100
|
|
1765
|
+
}
|
|
1766
|
+
},
|
|
1767
|
+
transition: {
|
|
1768
|
+
property: 'all',
|
|
1769
|
+
duration: 300,
|
|
1770
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
};
|
|
1774
|
+
|
|
1223
1775
|
var feedbackMessage = {
|
|
1224
1776
|
danger: {
|
|
1225
1777
|
backgroundColor: colors.danger
|
|
@@ -1637,6 +2189,7 @@ var theme = {
|
|
|
1637
2189
|
breakpoints: breakpoints,
|
|
1638
2190
|
button: button,
|
|
1639
2191
|
card: card,
|
|
2192
|
+
choices: choices,
|
|
1640
2193
|
feedbackMessage: feedbackMessage,
|
|
1641
2194
|
forms: forms,
|
|
1642
2195
|
fullScreenModal: fullScreenModal,
|
|
@@ -1652,28 +2205,6 @@ var theme = {
|
|
|
1652
2205
|
navigationModal: navigationModal
|
|
1653
2206
|
};
|
|
1654
2207
|
|
|
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
2208
|
function createWindowSizeHelper(dimensions) {
|
|
1678
2209
|
return {
|
|
1679
2210
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
@@ -1998,7 +2529,7 @@ function DatePickerAndroid(_ref) {
|
|
|
1998
2529
|
}
|
|
1999
2530
|
|
|
2000
2531
|
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
2001
|
-
var OverlayPressable = /*#__PURE__*/styled(Pressable$
|
|
2532
|
+
var OverlayPressable = /*#__PURE__*/styled(Pressable$2).withConfig({
|
|
2002
2533
|
displayName: "Overlay__OverlayPressable"
|
|
2003
2534
|
})(function (_ref) {
|
|
2004
2535
|
var theme = _ref.theme;
|
|
@@ -2025,7 +2556,7 @@ var BodyView = /*#__PURE__*/styled.View.withConfig({
|
|
|
2025
2556
|
});
|
|
2026
2557
|
function ModalBody(_ref3) {
|
|
2027
2558
|
var children = _ref3.children;
|
|
2028
|
-
return /*#__PURE__*/jsx(ScrollView$
|
|
2559
|
+
return /*#__PURE__*/jsx(ScrollView$2, {
|
|
2029
2560
|
children: /*#__PURE__*/jsx(BodyView, {
|
|
2030
2561
|
children: children
|
|
2031
2562
|
})
|
|
@@ -2747,7 +3278,7 @@ function InputIcon(_ref) {
|
|
|
2747
3278
|
function InputPressable(_ref) {
|
|
2748
3279
|
var props = _extends({}, _ref);
|
|
2749
3280
|
|
|
2750
|
-
return /*#__PURE__*/jsx(Pressable$
|
|
3281
|
+
return /*#__PURE__*/jsx(Pressable$2, _objectSpread({}, props));
|
|
2751
3282
|
}
|
|
2752
3283
|
|
|
2753
3284
|
var _excluded$8 = ["isPasswordDefaultVisible", "right"];
|
|
@@ -2793,7 +3324,7 @@ var getTypographyColor = function (type) {
|
|
|
2793
3324
|
return type ? 'white' : 'black';
|
|
2794
3325
|
};
|
|
2795
3326
|
|
|
2796
|
-
var InputTagContainer = /*#__PURE__*/styled(View$
|
|
3327
|
+
var InputTagContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
2797
3328
|
displayName: "InputTag__InputTagContainer"
|
|
2798
3329
|
})(["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
3330
|
var theme = _ref.theme;
|
|
@@ -2815,7 +3346,7 @@ var InputTagContainer = /*#__PURE__*/styled(View$1).withConfig({
|
|
|
2815
3346
|
var theme = _ref3.theme;
|
|
2816
3347
|
return theme.kitt.forms.inputTag.borderRadius;
|
|
2817
3348
|
});
|
|
2818
|
-
var IconContainer = /*#__PURE__*/styled(View$
|
|
3349
|
+
var IconContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
2819
3350
|
displayName: "InputTag__IconContainer"
|
|
2820
3351
|
})(["margin-right:", "px;"], function (_ref4) {
|
|
2821
3352
|
var theme = _ref4.theme;
|
|
@@ -3115,47 +3646,6 @@ function FullScreenModal(_ref2) {
|
|
|
3115
3646
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
3116
3647
|
FullScreenModal.Body = FullScreenModalBody;
|
|
3117
3648
|
|
|
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
3649
|
var _excluded$7 = ["children"];
|
|
3160
3650
|
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
3161
3651
|
displayName: "ListItemContent__ContentView"
|
|
@@ -3255,7 +3745,7 @@ function ListItem(_ref5) {
|
|
|
3255
3745
|
onPress = _ref5.onPress,
|
|
3256
3746
|
rest = _objectWithoutProperties(_ref5, _excluded$5);
|
|
3257
3747
|
|
|
3258
|
-
var Wrapper = onPress ? Pressable$
|
|
3748
|
+
var Wrapper = onPress ? Pressable$2 : Fragment$1;
|
|
3259
3749
|
var wrapperProps = onPress ? _objectSpread({
|
|
3260
3750
|
accessibilityRole: 'button',
|
|
3261
3751
|
onPress: onPress
|
|
@@ -3282,14 +3772,6 @@ ListItem.Content = ListItemContent;
|
|
|
3282
3772
|
ListItem.SideContent = ListItemSideContent;
|
|
3283
3773
|
ListItem.SideContainer = ListItemSideContainer;
|
|
3284
3774
|
|
|
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
3775
|
function IconContent(_ref) {
|
|
3294
3776
|
var type = _ref.type,
|
|
3295
3777
|
color = _ref.color;
|
|
@@ -3475,7 +3957,7 @@ function CloseButton(_ref) {
|
|
|
3475
3957
|
});
|
|
3476
3958
|
}
|
|
3477
3959
|
|
|
3478
|
-
var ModalBehaviourContainer = /*#__PURE__*/styled(View$
|
|
3960
|
+
var ModalBehaviourContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
3479
3961
|
displayName: "ModalBehaviour__ModalBehaviourContainer"
|
|
3480
3962
|
})(["", ""], function () {
|
|
3481
3963
|
if (Platform.OS !== 'web') return undefined;
|
|
@@ -3642,16 +4124,8 @@ function KittNativeBaseProvider(_ref) {
|
|
|
3642
4124
|
});
|
|
3643
4125
|
}
|
|
3644
4126
|
|
|
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
4127
|
var _excluded$4 = ["children"];
|
|
3654
|
-
var ViewWithPadding = /*#__PURE__*/styled(View$
|
|
4128
|
+
var ViewWithPadding = /*#__PURE__*/styled(View$2).withConfig({
|
|
3655
4129
|
displayName: "ContentPadding__ViewWithPadding"
|
|
3656
4130
|
})(["padding:", ";"], function (_ref) {
|
|
3657
4131
|
var theme = _ref.theme;
|
|
@@ -3757,7 +4231,7 @@ var HeaderContainer = /*#__PURE__*/styled(ContentPadding).withConfig({
|
|
|
3757
4231
|
return theme.kitt.colors.separator;
|
|
3758
4232
|
});
|
|
3759
4233
|
});
|
|
3760
|
-
var Row = /*#__PURE__*/styled(View$
|
|
4234
|
+
var Row = /*#__PURE__*/styled(View$2).withConfig({
|
|
3761
4235
|
displayName: "Header__Row"
|
|
3762
4236
|
})(["flex-direction:row;justify-content:", ";align-items:center;"], function (_ref7) {
|
|
3763
4237
|
var $hasContent = _ref7.$hasContent,
|
|
@@ -3770,7 +4244,7 @@ var ButtonContainer = /*#__PURE__*/styled.View.withConfig({
|
|
|
3770
4244
|
var theme = _ref8.theme;
|
|
3771
4245
|
return theme.kitt.iconButton.width;
|
|
3772
4246
|
});
|
|
3773
|
-
var ChildrenComponent = /*#__PURE__*/styled(View$
|
|
4247
|
+
var ChildrenComponent = /*#__PURE__*/styled(View$2).withConfig({
|
|
3774
4248
|
displayName: "Header__ChildrenComponent"
|
|
3775
4249
|
})(["flex:1;align-items:center;", ";"], function (_ref9) {
|
|
3776
4250
|
var theme = _ref9.theme,
|
|
@@ -3829,7 +4303,7 @@ function Header(_ref12) {
|
|
|
3829
4303
|
});
|
|
3830
4304
|
}
|
|
3831
4305
|
|
|
3832
|
-
var NavigationModalContainer = /*#__PURE__*/styled(View$
|
|
4306
|
+
var NavigationModalContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
3833
4307
|
displayName: "NavigationModalContainer"
|
|
3834
4308
|
})(["position:relative;background-color:", ";flex:1;", ""], function (_ref) {
|
|
3835
4309
|
var theme = _ref.theme,
|
|
@@ -3840,7 +4314,7 @@ var NavigationModalContainer = /*#__PURE__*/styled(View$1).withConfig({
|
|
|
3840
4314
|
return css(["min-height:100vh;"]);
|
|
3841
4315
|
});
|
|
3842
4316
|
|
|
3843
|
-
var ContainerWithoutHeader = /*#__PURE__*/styled(View$
|
|
4317
|
+
var ContainerWithoutHeader = /*#__PURE__*/styled(View$2).withConfig({
|
|
3844
4318
|
displayName: "NavigationModal__ContainerWithoutHeader"
|
|
3845
4319
|
})(["justify-content:space-between;flex:1;"]);
|
|
3846
4320
|
function NavigationModal(_ref) {
|
|
@@ -3850,10 +4324,10 @@ function NavigationModal(_ref) {
|
|
|
3850
4324
|
backgroundColor = _ref.backgroundColor;
|
|
3851
4325
|
return /*#__PURE__*/jsxs(NavigationModalContainer, {
|
|
3852
4326
|
$backgroundColor: backgroundColor,
|
|
3853
|
-
children: [header ? /*#__PURE__*/jsx(View$
|
|
4327
|
+
children: [header ? /*#__PURE__*/jsx(View$2, {
|
|
3854
4328
|
children: header
|
|
3855
4329
|
}) : null, /*#__PURE__*/jsxs(ContainerWithoutHeader, {
|
|
3856
|
-
children: [/*#__PURE__*/jsx(ScrollView$
|
|
4330
|
+
children: [/*#__PURE__*/jsx(ScrollView$2, {
|
|
3857
4331
|
bounces: false,
|
|
3858
4332
|
contentContainerStyle: {
|
|
3859
4333
|
flexGrow: 1,
|
|
@@ -4133,7 +4607,7 @@ function Picker(_ref) {
|
|
|
4133
4607
|
color: item.props.value === value ? theme.picker.ios.selected.color : undefined
|
|
4134
4608
|
});
|
|
4135
4609
|
})
|
|
4136
|
-
}) : /*#__PURE__*/jsx(ScrollView$
|
|
4610
|
+
}) : /*#__PURE__*/jsx(ScrollView$2, {
|
|
4137
4611
|
testID: testID,
|
|
4138
4612
|
children: React.Children.map(children, function (child) {
|
|
4139
4613
|
var item = child;
|
|
@@ -4221,7 +4695,7 @@ function SkeletonContent(_ref3) {
|
|
|
4221
4695
|
});
|
|
4222
4696
|
}
|
|
4223
4697
|
|
|
4224
|
-
var SkeletonContainer = /*#__PURE__*/styled(View$
|
|
4698
|
+
var SkeletonContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
4225
4699
|
displayName: "Skeleton__SkeletonContainer"
|
|
4226
4700
|
})(["overflow:hidden;"]);
|
|
4227
4701
|
function Skeleton(_ref) {
|
|
@@ -4725,7 +5199,7 @@ function ModalDateTimePicker(_ref2) {
|
|
|
4725
5199
|
}) : null, /*#__PURE__*/jsx(Modal.Body, {
|
|
4726
5200
|
children: /*#__PURE__*/jsx(DateTimePicker, {
|
|
4727
5201
|
is24Hour: true,
|
|
4728
|
-
testID: "
|
|
5202
|
+
testID: "timePicker.ModalDateTimePicker.dateTimeNativePicker",
|
|
4729
5203
|
value: currentValue,
|
|
4730
5204
|
mode: "time",
|
|
4731
5205
|
display: Platform.OS === 'ios' ? 'spinner' : 'default',
|
|
@@ -4832,7 +5306,7 @@ function TimePicker(_ref) {
|
|
|
4832
5306
|
children: displayedValue
|
|
4833
5307
|
}), Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsx(DateTimePicker, {
|
|
4834
5308
|
is24Hour: true,
|
|
4835
|
-
testID: "
|
|
5309
|
+
testID: "timePicker.TimePicker.dateTimeNativePicker",
|
|
4836
5310
|
value: dateTimePickerValue,
|
|
4837
5311
|
mode: "time",
|
|
4838
5312
|
display: "default",
|
|
@@ -4871,7 +5345,7 @@ var StyledTooltipContent = /*#__PURE__*/styled.View.withConfig({
|
|
|
4871
5345
|
|
|
4872
5346
|
function ArrowView(props) {
|
|
4873
5347
|
var theme = /*#__PURE__*/useTheme();
|
|
4874
|
-
return /*#__PURE__*/jsx(View$
|
|
5348
|
+
return /*#__PURE__*/jsx(View$2, _objectSpread(_objectSpread({}, props), {}, {
|
|
4875
5349
|
children: /*#__PURE__*/jsx(TooltipArrowIcon, {
|
|
4876
5350
|
color: theme.kitt.tooltip.backgroundColor
|
|
4877
5351
|
})
|
|
@@ -4977,16 +5451,16 @@ function Tooltip(_ref) {
|
|
|
4977
5451
|
});
|
|
4978
5452
|
}, [x, y, reference, floating, update, refs, middlewareData, onUpdate]);
|
|
4979
5453
|
return /*#__PURE__*/jsxs(TooltipContainer, {
|
|
4980
|
-
children: [/*#__PURE__*/jsx(View$
|
|
5454
|
+
children: [/*#__PURE__*/jsx(View$2, {
|
|
4981
5455
|
ref: reference,
|
|
4982
|
-
children: /*#__PURE__*/jsx(Pressable$
|
|
5456
|
+
children: /*#__PURE__*/jsx(Pressable$2, {
|
|
4983
5457
|
accessibilityRole: "button",
|
|
4984
5458
|
onPress: function handlePress() {
|
|
4985
5459
|
pressed.value = !pressed.value;
|
|
4986
5460
|
},
|
|
4987
5461
|
children: children
|
|
4988
5462
|
})
|
|
4989
|
-
}), /*#__PURE__*/jsx(View$
|
|
5463
|
+
}), /*#__PURE__*/jsx(View$2, {
|
|
4990
5464
|
ref: floating,
|
|
4991
5465
|
accessibilityElementsHidden: !pressed.value,
|
|
4992
5466
|
importantForAccessibility: pressed.value === true ? 'auto' : 'no-hide-descendants',
|
|
@@ -5219,5 +5693,5 @@ function withTheme(WrappedComponent) {
|
|
|
5219
5693
|
});
|
|
5220
5694
|
}
|
|
5221
5695
|
|
|
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 };
|
|
5696
|
+
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
5697
|
//# sourceMappingURL=index-browser-all.es.android.js.map
|