@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,23 +1,23 @@
|
|
|
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
20
|
import { styled as styled$1 } from '@linaria/react';
|
|
20
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
21
21
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
22
22
|
import Svg, { Circle as Circle$1 } from 'react-native-svg';
|
|
23
23
|
import { Picker as Picker$1 } from '@react-native-picker/picker';
|
|
@@ -25,39 +25,173 @@ import { LinearGradient } from 'expo-linear-gradient';
|
|
|
25
25
|
import { useFloating, offset, shift, flip } from '@floating-ui/react-native';
|
|
26
26
|
import { makeDecorator } from '@storybook/addons';
|
|
27
27
|
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
var Stack = Stack$1;
|
|
29
|
+
var VStack = VStack$1;
|
|
30
|
+
var HStack = HStack$1;
|
|
31
|
+
|
|
32
|
+
function warn(message) {
|
|
33
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
34
|
+
console.warn(message);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function deprecatedMessage(symbol, deprecation, replaceBy) {
|
|
38
|
+
var replaceMessage = replaceBy === undefined ? '' : ", please use ".concat(replaceBy, " instead");
|
|
39
|
+
warn("[Deprecation] in ".concat(symbol, ": ").concat(deprecation, " is deprecated").concat(replaceMessage, "."));
|
|
40
|
+
}
|
|
41
|
+
function deprecatedInComponent(component, deprecation, replaceBy) {
|
|
42
|
+
deprecatedMessage("<".concat(component, " />"), deprecation, replaceBy);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var hasVariant = function (button, variant) {
|
|
46
|
+
return variant in button;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
function getVariantValuesIfExist(theme, type, variant) {
|
|
50
|
+
var button = theme.kitt.button[type];
|
|
51
|
+
|
|
52
|
+
if (hasVariant(button, variant)) {
|
|
53
|
+
return button[variant];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return theme.kitt.button[type]["default"];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
60
|
+
displayName: "AnimatedButtonPressable__StyledPressable"
|
|
61
|
+
})(["", ""], function (_ref) {
|
|
62
|
+
var $isStretch = _ref.$isStretch;
|
|
63
|
+
if ($isStretch) return undefined;
|
|
64
|
+
return 'align-self: flex-start;';
|
|
65
|
+
});
|
|
66
|
+
var StyledAnimatedView = /*#__PURE__*/styled(Animated.View).withConfig({
|
|
67
|
+
displayName: "AnimatedButtonPressable__StyledAnimatedView"
|
|
68
|
+
})(["border-radius:", "px;"], function (_ref2) {
|
|
69
|
+
var theme = _ref2.theme;
|
|
70
|
+
return theme.kitt.button.borderRadius;
|
|
71
|
+
});
|
|
72
|
+
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
73
|
+
var children = _ref3.children,
|
|
74
|
+
disabled = _ref3.disabled,
|
|
75
|
+
accessibilityRole = _ref3.accessibilityRole,
|
|
76
|
+
$type = _ref3.$type,
|
|
77
|
+
$variant = _ref3.$variant,
|
|
78
|
+
$isStretch = _ref3.$isStretch,
|
|
79
|
+
href = _ref3.href,
|
|
80
|
+
hrefAttrs = _ref3.hrefAttrs,
|
|
81
|
+
testID = _ref3.testID,
|
|
82
|
+
onPress = _ref3.onPress;
|
|
83
|
+
var theme = /*#__PURE__*/useTheme();
|
|
84
|
+
var pressed = useSharedValue(0);
|
|
85
|
+
var color = useSharedValue(0);
|
|
86
|
+
|
|
87
|
+
var _getVariantValuesIfEx = getVariantValuesIfExist(theme, $type, $variant),
|
|
88
|
+
backgroundColor = _getVariantValuesIfEx.backgroundColor,
|
|
89
|
+
pressedBackgroundColor = _getVariantValuesIfEx.pressedBackgroundColor;
|
|
90
|
+
|
|
91
|
+
var scale = theme.kitt.button.scale;
|
|
92
|
+
var scaleStyles = useAnimatedStyle(function () {
|
|
93
|
+
var _f = function () {
|
|
94
|
+
return {
|
|
95
|
+
backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
96
|
+
transform: [{
|
|
97
|
+
scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
|
|
98
|
+
}]
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
_f._closure = {
|
|
103
|
+
interpolateColor: interpolateColor,
|
|
104
|
+
color: color,
|
|
105
|
+
backgroundColor: backgroundColor,
|
|
106
|
+
pressedBackgroundColor: pressedBackgroundColor,
|
|
107
|
+
withSpring: withSpring,
|
|
108
|
+
pressed: pressed,
|
|
109
|
+
scale: {
|
|
110
|
+
base: {
|
|
111
|
+
active: scale.base.active,
|
|
112
|
+
"default": scale.base["default"]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
_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)}]};}}";
|
|
117
|
+
_f.__workletHash = 5368461229978;
|
|
118
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (56:41)";
|
|
119
|
+
_f.__optimalization = 2;
|
|
120
|
+
return _f;
|
|
121
|
+
}());
|
|
122
|
+
|
|
123
|
+
var handlePressInOut = function (pressIn) {
|
|
124
|
+
color.value = withSpring(pressIn ? 1 : 0);
|
|
125
|
+
pressed.value = pressIn ? 1 : 0;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
return /*#__PURE__*/jsx(StyledPressable, {
|
|
129
|
+
ref: ref,
|
|
130
|
+
disabled: disabled,
|
|
131
|
+
accessibilityRole: accessibilityRole,
|
|
132
|
+
testID: testID,
|
|
133
|
+
href: href,
|
|
134
|
+
hrefAttrs: hrefAttrs,
|
|
135
|
+
$isStretch: $isStretch,
|
|
136
|
+
$type: $type,
|
|
137
|
+
onPress: onPress,
|
|
138
|
+
onPressIn: function onPressIn() {
|
|
139
|
+
handlePressInOut(true);
|
|
140
|
+
},
|
|
141
|
+
onPressOut: function onPressOut() {
|
|
142
|
+
handlePressInOut(false);
|
|
143
|
+
},
|
|
144
|
+
children: /*#__PURE__*/jsx(StyledAnimatedView, {
|
|
145
|
+
style: disabled ? [{
|
|
146
|
+
transform: [{
|
|
147
|
+
scale: 1
|
|
148
|
+
}]
|
|
149
|
+
}] : [scaleStyles],
|
|
150
|
+
children: children
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
156
|
+
displayName: "BaseStyledButtonPressable"
|
|
157
|
+
})(["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) {
|
|
158
|
+
var theme = _ref.theme;
|
|
159
|
+
return theme.kitt.button.minWidth;
|
|
34
160
|
}, function (_ref2) {
|
|
35
|
-
var
|
|
36
|
-
|
|
161
|
+
var theme = _ref2.theme,
|
|
162
|
+
$isStretch = _ref2.$isStretch;
|
|
163
|
+
return $isStretch ? '100%' : "".concat(theme.kitt.button.maxWidth, "px");
|
|
37
164
|
}, function (_ref3) {
|
|
38
|
-
var $
|
|
39
|
-
return $
|
|
165
|
+
var $isStretch = _ref3.$isStretch;
|
|
166
|
+
return $isStretch ? '100%' : 'auto';
|
|
40
167
|
}, function (_ref4) {
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
168
|
+
var theme = _ref4.theme;
|
|
169
|
+
return theme.kitt.button.minHeight;
|
|
170
|
+
}, function (_ref5) {
|
|
171
|
+
var theme = _ref5.theme;
|
|
172
|
+
return theme.kitt.button.borderRadius;
|
|
173
|
+
}, function (_ref6) {
|
|
174
|
+
var theme = _ref6.theme,
|
|
175
|
+
$isDisabled = _ref6.$isDisabled,
|
|
176
|
+
$type = _ref6.$type,
|
|
177
|
+
$variant = _ref6.$variant;
|
|
178
|
+
if ($isDisabled) return theme.kitt.button.disabled["default"].backgroundColor;
|
|
179
|
+
if (Platform.OS !== 'web') return 'transparent';
|
|
180
|
+
return getVariantValuesIfExist(theme, $type, $variant).backgroundColor;
|
|
181
|
+
}, function (_ref7) {
|
|
182
|
+
var theme = _ref7.theme,
|
|
183
|
+
$size = _ref7.$size,
|
|
184
|
+
$isDisabled = _ref7.$isDisabled;
|
|
185
|
+
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
186
|
+
large = _theme$kitt$button$co.large,
|
|
187
|
+
defaultPadding = _theme$kitt$button$co["default"],
|
|
188
|
+
disabledPadding = _theme$kitt$button$co.disabled,
|
|
189
|
+
xLarge = _theme$kitt$button$co.xLarge;
|
|
190
|
+
if ($size === 'large') return large;
|
|
191
|
+
if ($size === 'xlarge') return xLarge;
|
|
192
|
+
if ($isDisabled) return disabledPadding;
|
|
193
|
+
return defaultPadding;
|
|
44
194
|
});
|
|
45
|
-
function Icon(_ref5) {
|
|
46
|
-
var icon = _ref5.icon,
|
|
47
|
-
_ref5$size = _ref5.size,
|
|
48
|
-
size = _ref5$size === void 0 ? defaultIconSize : _ref5$size,
|
|
49
|
-
align = _ref5.align,
|
|
50
|
-
color = _ref5.color;
|
|
51
|
-
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
52
|
-
color: color
|
|
53
|
-
});
|
|
54
|
-
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
55
|
-
$align: align,
|
|
56
|
-
$size: size,
|
|
57
|
-
$color: color,
|
|
58
|
-
children: clonedIcon
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
195
|
|
|
62
196
|
var KittBreakpoints = {
|
|
63
197
|
/**
|
|
@@ -116,14 +250,20 @@ var KittBreakpointNameEnum;
|
|
|
116
250
|
KittBreakpointNameEnum["WIDE"] = "wide";
|
|
117
251
|
})(KittBreakpointNameEnum || (KittBreakpointNameEnum = {}));
|
|
118
252
|
|
|
119
|
-
var _excluded$
|
|
253
|
+
var _excluded$n = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
|
|
120
254
|
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
121
255
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
122
256
|
function useTypographyColor() {
|
|
123
257
|
return useContext(TypographyColorContext);
|
|
124
258
|
}
|
|
259
|
+
var TypographyDefaultColorContext = /*#__PURE__*/createContext(undefined);
|
|
260
|
+
|
|
261
|
+
function useTypographyDefaultColor() {
|
|
262
|
+
return useContext(TypographyDefaultColorContext);
|
|
263
|
+
}
|
|
125
264
|
/** @deprecated use native-base instead for SSR compatibility */
|
|
126
265
|
|
|
266
|
+
|
|
127
267
|
var getTypographyTypeConfigKey = function (theme) {
|
|
128
268
|
var isMediumOrAbove = theme.responsive.matchWindowSize({
|
|
129
269
|
minWidth: KittBreakpoints.MEDIUM
|
|
@@ -158,6 +298,11 @@ function createNativeBaseFontSize(type) {
|
|
|
158
298
|
});
|
|
159
299
|
return fontSizeForNativeBase;
|
|
160
300
|
}
|
|
301
|
+
|
|
302
|
+
function getNBThemeColorFromColorProps(colorName) {
|
|
303
|
+
return colorName ? "kitt.typography.".concat(colorName) : undefined;
|
|
304
|
+
}
|
|
305
|
+
|
|
161
306
|
function Typography(_ref) {
|
|
162
307
|
var _type$base;
|
|
163
308
|
|
|
@@ -177,9 +322,10 @@ function Typography(_ref) {
|
|
|
177
322
|
} : _ref$type,
|
|
178
323
|
variant = _ref.variant,
|
|
179
324
|
color = _ref.color,
|
|
180
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
325
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$n);
|
|
181
326
|
|
|
182
327
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
328
|
+
var defaultColor = useTypographyDefaultColor();
|
|
183
329
|
var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
184
330
|
var baseOrDefaultToBody = hasTypographyAncestor ? type.base : (_type$base = type.base) !== null && _type$base !== void 0 ? _type$base : 'body';
|
|
185
331
|
var isHeader = isTypographyHeader(baseOrDefaultToBody, isHeaderTypographyInContext);
|
|
@@ -200,14 +346,16 @@ function Typography(_ref) {
|
|
|
200
346
|
});
|
|
201
347
|
}
|
|
202
348
|
|
|
349
|
+
var currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
|
|
350
|
+
|
|
203
351
|
var text = /*#__PURE__*/jsx(Text$1, _objectSpread({
|
|
204
352
|
accessibilityRole: accessibilityRole || undefined,
|
|
205
353
|
fontSize: fontSizeForNativeBase,
|
|
206
354
|
lineHeight: hasTypographyAncestor ? undefined : fontSizeForNativeBase,
|
|
207
355
|
fontWeight: isHeader ? "headers.".concat(nonNullableVariant) : "bodies.".concat(nonNullableVariant),
|
|
208
356
|
fontFamily: isHeader ? "headers.".concat(nonNullableVariant) : "bodies.".concat(nonNullableVariant),
|
|
209
|
-
color:
|
|
210
|
-
textDecorationColor:
|
|
357
|
+
color: getNBThemeColorFromColorProps(currentColor),
|
|
358
|
+
textDecorationColor: getNBThemeColorFromColorProps(currentColor)
|
|
211
359
|
}, otherProps));
|
|
212
360
|
|
|
213
361
|
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
@@ -248,6 +396,7 @@ var createHeading = function (level, defaultBase) {
|
|
|
248
396
|
return TypographyHeading;
|
|
249
397
|
};
|
|
250
398
|
|
|
399
|
+
Typography.SetDefaultColor = TypographyDefaultColorContext.Provider;
|
|
251
400
|
Typography.Text = TypographyText;
|
|
252
401
|
Typography.Paragraph = TypographyParagraph;
|
|
253
402
|
Typography.Header1 = createHeading(1);
|
|
@@ -265,269 +414,53 @@ Typography.h2 = createHeading(2, 'header2');
|
|
|
265
414
|
/** @deprecated use Typography.Header3 */
|
|
266
415
|
|
|
267
416
|
Typography.h3 = createHeading(3, 'header3');
|
|
268
|
-
/** @deprecated use Typography.Header4 */
|
|
269
|
-
|
|
270
|
-
Typography.h4 = createHeading(4, 'header4');
|
|
271
|
-
/** @deprecated use Typography.Header6 */
|
|
272
|
-
|
|
273
|
-
Typography.h5 = createHeading(5, 'header5');
|
|
274
|
-
|
|
275
|
-
var _excluded$j = ["size", "round", "light", "sizeVariant"];
|
|
276
|
-
|
|
277
|
-
var getInitials = function (firstname, lastname) {
|
|
278
|
-
return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
|
|
282
|
-
displayName: "Avatar__StyledAvatarView"
|
|
283
|
-
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
284
|
-
var theme = _ref.theme,
|
|
285
|
-
$isRound = _ref.$isRound,
|
|
286
|
-
$size = _ref.$size,
|
|
287
|
-
$sizeVariant = _ref.$sizeVariant;
|
|
288
|
-
if ($isRound) return "".concat($size / 2, "px");
|
|
289
|
-
return "".concat($sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius, "px");
|
|
290
|
-
}, function (_ref2) {
|
|
291
|
-
var theme = _ref2.theme,
|
|
292
|
-
$isLight = _ref2.$isLight;
|
|
293
|
-
return $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
|
|
294
|
-
}, function (_ref3) {
|
|
295
|
-
var $size = _ref3.$size;
|
|
296
|
-
return $size;
|
|
297
|
-
}, function (_ref4) {
|
|
298
|
-
var $size = _ref4.$size;
|
|
299
|
-
return $size;
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
function AvatarContent(_ref5) {
|
|
303
|
-
var size = _ref5.size,
|
|
304
|
-
src = _ref5.src,
|
|
305
|
-
firstname = _ref5.firstname,
|
|
306
|
-
lastname = _ref5.lastname,
|
|
307
|
-
alt = _ref5.alt,
|
|
308
|
-
isLight = _ref5.isLight,
|
|
309
|
-
sizeVariant = _ref5.sizeVariant;
|
|
310
|
-
|
|
311
|
-
if (src) {
|
|
312
|
-
return /*#__PURE__*/jsx(Image, {
|
|
313
|
-
source: {
|
|
314
|
-
uri: src
|
|
315
|
-
},
|
|
316
|
-
style: {
|
|
317
|
-
width: size,
|
|
318
|
-
height: size
|
|
319
|
-
},
|
|
320
|
-
accessibilityLabel: alt
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
if (firstname && lastname) {
|
|
325
|
-
return /*#__PURE__*/jsx(Typography.Text, {
|
|
326
|
-
base: sizeVariant === 'large' ? 'body-large' : 'body-small',
|
|
327
|
-
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
328
|
-
color: isLight ? 'black' : 'white',
|
|
329
|
-
children: getInitials(firstname, lastname)
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
return /*#__PURE__*/jsx(Icon, {
|
|
334
|
-
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
335
|
-
color: isLight ? 'black' : 'white',
|
|
336
|
-
size: size / 2
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function Avatar(_ref6) {
|
|
341
|
-
var _ref6$size = _ref6.size,
|
|
342
|
-
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
343
|
-
round = _ref6.round,
|
|
344
|
-
light = _ref6.light,
|
|
345
|
-
sizeVariant = _ref6.sizeVariant,
|
|
346
|
-
props = _objectWithoutProperties(_ref6, _excluded$j);
|
|
347
|
-
|
|
348
|
-
return /*#__PURE__*/jsx(StyledAvatarView, {
|
|
349
|
-
$size: size,
|
|
350
|
-
$isRound: round,
|
|
351
|
-
$isLight: light,
|
|
352
|
-
$sizeVariant: sizeVariant,
|
|
353
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread({
|
|
354
|
-
size: size,
|
|
355
|
-
isLight: light,
|
|
356
|
-
sizeVariant: sizeVariant
|
|
357
|
-
}, props))
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
function warn(message) {
|
|
362
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
363
|
-
console.warn(message);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
function deprecatedMessage(symbol, deprecation, replaceBy) {
|
|
367
|
-
var replaceMessage = replaceBy === undefined ? '' : ", please use ".concat(replaceBy, " instead");
|
|
368
|
-
warn("[Deprecation] in ".concat(symbol, ": ").concat(deprecation, " is deprecated").concat(replaceMessage, "."));
|
|
369
|
-
}
|
|
370
|
-
function deprecatedInComponent(component, deprecation, replaceBy) {
|
|
371
|
-
deprecatedMessage("<".concat(component, " />"), deprecation, replaceBy);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
var hasVariant = function (button, variant) {
|
|
375
|
-
return variant in button;
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
function getVariantValuesIfExist(theme, type, variant) {
|
|
379
|
-
var button = theme.kitt.button[type];
|
|
380
|
-
|
|
381
|
-
if (hasVariant(button, variant)) {
|
|
382
|
-
return button[variant];
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
return theme.kitt.button[type]["default"];
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
389
|
-
displayName: "AnimatedButtonPressable__StyledPressable"
|
|
390
|
-
})(["", ""], function (_ref) {
|
|
391
|
-
var $isStretch = _ref.$isStretch;
|
|
392
|
-
if ($isStretch) return undefined;
|
|
393
|
-
return 'align-self: flex-start;';
|
|
394
|
-
});
|
|
395
|
-
var StyledAnimatedView = /*#__PURE__*/styled(Animated.View).withConfig({
|
|
396
|
-
displayName: "AnimatedButtonPressable__StyledAnimatedView"
|
|
397
|
-
})(["border-radius:", "px;"], function (_ref2) {
|
|
398
|
-
var theme = _ref2.theme;
|
|
399
|
-
return theme.kitt.button.borderRadius;
|
|
400
|
-
});
|
|
401
|
-
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
402
|
-
var children = _ref3.children,
|
|
403
|
-
disabled = _ref3.disabled,
|
|
404
|
-
accessibilityRole = _ref3.accessibilityRole,
|
|
405
|
-
$type = _ref3.$type,
|
|
406
|
-
$variant = _ref3.$variant,
|
|
407
|
-
$isStretch = _ref3.$isStretch,
|
|
408
|
-
href = _ref3.href,
|
|
409
|
-
hrefAttrs = _ref3.hrefAttrs,
|
|
410
|
-
testID = _ref3.testID,
|
|
411
|
-
onPress = _ref3.onPress;
|
|
412
|
-
var theme = /*#__PURE__*/useTheme();
|
|
413
|
-
var pressed = useSharedValue(0);
|
|
414
|
-
var color = useSharedValue(0);
|
|
415
|
-
|
|
416
|
-
var _getVariantValuesIfEx = getVariantValuesIfExist(theme, $type, $variant),
|
|
417
|
-
backgroundColor = _getVariantValuesIfEx.backgroundColor,
|
|
418
|
-
pressedBackgroundColor = _getVariantValuesIfEx.pressedBackgroundColor;
|
|
419
|
-
|
|
420
|
-
var scale = theme.kitt.button.scale;
|
|
421
|
-
var scaleStyles = useAnimatedStyle(function () {
|
|
422
|
-
var _f = function () {
|
|
423
|
-
return {
|
|
424
|
-
backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
425
|
-
transform: [{
|
|
426
|
-
scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
|
|
427
|
-
}]
|
|
428
|
-
};
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
_f._closure = {
|
|
432
|
-
interpolateColor: interpolateColor,
|
|
433
|
-
color: color,
|
|
434
|
-
backgroundColor: backgroundColor,
|
|
435
|
-
pressedBackgroundColor: pressedBackgroundColor,
|
|
436
|
-
withSpring: withSpring,
|
|
437
|
-
pressed: pressed,
|
|
438
|
-
scale: {
|
|
439
|
-
base: {
|
|
440
|
-
active: scale.base.active,
|
|
441
|
-
"default": scale.base["default"]
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
_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)}]};}}";
|
|
446
|
-
_f.__workletHash = 5368461229978;
|
|
447
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (56:41)";
|
|
448
|
-
_f.__optimalization = 2;
|
|
449
|
-
return _f;
|
|
450
|
-
}());
|
|
451
|
-
|
|
452
|
-
var handlePressInOut = function (pressIn) {
|
|
453
|
-
color.value = withSpring(pressIn ? 1 : 0);
|
|
454
|
-
pressed.value = pressIn ? 1 : 0;
|
|
455
|
-
};
|
|
417
|
+
/** @deprecated use Typography.Header4 */
|
|
456
418
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
disabled: disabled,
|
|
460
|
-
accessibilityRole: accessibilityRole,
|
|
461
|
-
testID: testID,
|
|
462
|
-
href: href,
|
|
463
|
-
hrefAttrs: hrefAttrs,
|
|
464
|
-
$isStretch: $isStretch,
|
|
465
|
-
$type: $type,
|
|
466
|
-
onPress: onPress,
|
|
467
|
-
onPressIn: function onPressIn() {
|
|
468
|
-
handlePressInOut(true);
|
|
469
|
-
},
|
|
470
|
-
onPressOut: function onPressOut() {
|
|
471
|
-
handlePressInOut(false);
|
|
472
|
-
},
|
|
473
|
-
children: /*#__PURE__*/jsx(StyledAnimatedView, {
|
|
474
|
-
style: disabled ? [{
|
|
475
|
-
transform: [{
|
|
476
|
-
scale: 1
|
|
477
|
-
}]
|
|
478
|
-
}] : [scaleStyles],
|
|
479
|
-
children: children
|
|
480
|
-
})
|
|
481
|
-
});
|
|
482
|
-
});
|
|
419
|
+
Typography.h4 = createHeading(4, 'header4');
|
|
420
|
+
/** @deprecated use Typography.Header6 */
|
|
483
421
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
422
|
+
Typography.h5 = createHeading(5, 'header5');
|
|
423
|
+
|
|
424
|
+
var defaultIconSize = 20;
|
|
425
|
+
var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
426
|
+
displayName: "Icon__IconContainer"
|
|
427
|
+
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
428
|
+
var $color = _ref.$color;
|
|
429
|
+
return $color;
|
|
489
430
|
}, function (_ref2) {
|
|
490
|
-
var
|
|
491
|
-
|
|
492
|
-
return $isStretch ? '100%' : "".concat(theme.kitt.button.maxWidth, "px");
|
|
431
|
+
var $size = _ref2.$size;
|
|
432
|
+
return $size;
|
|
493
433
|
}, function (_ref3) {
|
|
494
|
-
var $
|
|
495
|
-
return $
|
|
434
|
+
var $size = _ref3.$size;
|
|
435
|
+
return $size;
|
|
496
436
|
}, function (_ref4) {
|
|
497
|
-
var
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
var theme = _ref5.theme;
|
|
501
|
-
return theme.kitt.button.borderRadius;
|
|
502
|
-
}, function (_ref6) {
|
|
503
|
-
var theme = _ref6.theme,
|
|
504
|
-
$isDisabled = _ref6.$isDisabled,
|
|
505
|
-
$type = _ref6.$type,
|
|
506
|
-
$variant = _ref6.$variant;
|
|
507
|
-
if ($isDisabled) return theme.kitt.button.disabled["default"].backgroundColor;
|
|
508
|
-
if (Platform.OS !== 'web') return 'transparent';
|
|
509
|
-
return getVariantValuesIfExist(theme, $type, $variant).backgroundColor;
|
|
510
|
-
}, function (_ref7) {
|
|
511
|
-
var theme = _ref7.theme,
|
|
512
|
-
$size = _ref7.$size,
|
|
513
|
-
$isDisabled = _ref7.$isDisabled;
|
|
514
|
-
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
515
|
-
large = _theme$kitt$button$co.large,
|
|
516
|
-
defaultPadding = _theme$kitt$button$co["default"],
|
|
517
|
-
disabledPadding = _theme$kitt$button$co.disabled,
|
|
518
|
-
xLarge = _theme$kitt$button$co.xLarge;
|
|
519
|
-
if ($size === 'large') return large;
|
|
520
|
-
if ($size === 'xlarge') return xLarge;
|
|
521
|
-
if ($isDisabled) return disabledPadding;
|
|
522
|
-
return defaultPadding;
|
|
437
|
+
var _ref4$$align = _ref4.$align,
|
|
438
|
+
$align = _ref4$$align === void 0 ? 'auto' : _ref4$$align;
|
|
439
|
+
return $align;
|
|
523
440
|
});
|
|
441
|
+
function Icon(_ref5) {
|
|
442
|
+
var icon = _ref5.icon,
|
|
443
|
+
_ref5$size = _ref5.size,
|
|
444
|
+
size = _ref5$size === void 0 ? defaultIconSize : _ref5$size,
|
|
445
|
+
align = _ref5.align,
|
|
446
|
+
color = _ref5.color;
|
|
447
|
+
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
448
|
+
color: color
|
|
449
|
+
});
|
|
450
|
+
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
451
|
+
$align: align,
|
|
452
|
+
$size: size,
|
|
453
|
+
$color: color,
|
|
454
|
+
children: clonedIcon
|
|
455
|
+
});
|
|
456
|
+
}
|
|
524
457
|
|
|
525
|
-
var _excluded$
|
|
458
|
+
var _excluded$m = ["color"],
|
|
526
459
|
_excluded2$3 = ["color"];
|
|
527
460
|
|
|
528
461
|
function TypographyIconSpecifiedColor(_ref) {
|
|
529
462
|
var color = _ref.color,
|
|
530
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
463
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
531
464
|
|
|
532
465
|
var theme = /*#__PURE__*/useTheme();
|
|
533
466
|
return /*#__PURE__*/jsx(Icon, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -559,7 +492,7 @@ function isSubtle(type) {
|
|
|
559
492
|
return type.startsWith('subtle');
|
|
560
493
|
}
|
|
561
494
|
|
|
562
|
-
var _excluded$
|
|
495
|
+
var _excluded$l = ["type", "variant", "isDisabled", "$isStretch", "icon", "children"];
|
|
563
496
|
|
|
564
497
|
var getTextColorByType = function (type, variant) {
|
|
565
498
|
switch (type) {
|
|
@@ -664,7 +597,7 @@ function ButtonContentChildren(_ref4) {
|
|
|
664
597
|
};
|
|
665
598
|
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
666
599
|
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
|
|
667
|
-
testID: "button
|
|
600
|
+
testID: "button.ButtonContent.leftButtonIcon",
|
|
668
601
|
icon: icon
|
|
669
602
|
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
670
603
|
base: "body",
|
|
@@ -701,7 +634,7 @@ function ButtonContent(_ref7) {
|
|
|
701
634
|
$isStretch = _ref7.$isStretch,
|
|
702
635
|
icon = _ref7.icon,
|
|
703
636
|
children = _ref7.children,
|
|
704
|
-
props = _objectWithoutProperties(_ref7, _excluded$
|
|
637
|
+
props = _objectWithoutProperties(_ref7, _excluded$l);
|
|
705
638
|
|
|
706
639
|
var color = isDisabled ? 'black-light' : getTextColorByType(type, variant);
|
|
707
640
|
return /*#__PURE__*/jsx(ButtonContentContainer, {
|
|
@@ -806,7 +739,286 @@ var Button = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
806
739
|
}), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
|
|
807
740
|
})
|
|
808
741
|
});
|
|
809
|
-
});
|
|
742
|
+
});
|
|
743
|
+
|
|
744
|
+
function SpinningIcon(_ref) {
|
|
745
|
+
var icon = _ref.icon,
|
|
746
|
+
color = _ref.color;
|
|
747
|
+
|
|
748
|
+
if (process.env.NODE_ENV !== 'production' && !color) {
|
|
749
|
+
throw new Error("Invalid color passed to SpinningIcon: ".concat(String(color)));
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
753
|
+
color: color
|
|
754
|
+
});
|
|
755
|
+
var animationRef = useRef(new Animated$1.Value(0));
|
|
756
|
+
var rotation = animationRef.current.interpolate({
|
|
757
|
+
inputRange: [0, 1],
|
|
758
|
+
outputRange: ['0deg', '360deg']
|
|
759
|
+
});
|
|
760
|
+
useEffect(function () {
|
|
761
|
+
if (process.env.NODE_ENV === 'test') return undefined;
|
|
762
|
+
var animation = Animated$1.loop(Animated$1.timing(animationRef.current, {
|
|
763
|
+
toValue: 1,
|
|
764
|
+
duration: 1100,
|
|
765
|
+
easing: Easing.linear,
|
|
766
|
+
useNativeDriver: true
|
|
767
|
+
}));
|
|
768
|
+
animation.start();
|
|
769
|
+
return function () {
|
|
770
|
+
if (process.env.NODE_ENV === 'test') return undefined;
|
|
771
|
+
animation.stop();
|
|
772
|
+
return undefined;
|
|
773
|
+
};
|
|
774
|
+
}, []);
|
|
775
|
+
return /*#__PURE__*/jsx(Animated$1.View, {
|
|
776
|
+
style: {
|
|
777
|
+
transform: [{
|
|
778
|
+
rotate: rotation
|
|
779
|
+
}]
|
|
780
|
+
},
|
|
781
|
+
children: clonedIcon
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
function LoaderIcon(_ref) {
|
|
786
|
+
var color = _ref.color;
|
|
787
|
+
return /*#__PURE__*/jsx(SpinningIcon, {
|
|
788
|
+
color: color,
|
|
789
|
+
icon: /*#__PURE__*/jsx(ArcIcon, {})
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
var View = View$1;
|
|
794
|
+
var ScrollView = ScrollView$1;
|
|
795
|
+
var Pressable = Pressable$1;
|
|
796
|
+
|
|
797
|
+
function matchWindowSize(_ref, _ref2) {
|
|
798
|
+
var width = _ref.width,
|
|
799
|
+
height = _ref.height;
|
|
800
|
+
var minWidth = _ref2.minWidth,
|
|
801
|
+
maxWidth = _ref2.maxWidth,
|
|
802
|
+
minHeight = _ref2.minHeight,
|
|
803
|
+
maxHeight = _ref2.maxHeight;
|
|
804
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
805
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
806
|
+
return hasWidthMatched && hasHeightMatched;
|
|
807
|
+
}
|
|
808
|
+
function useMatchWindowSize(options) {
|
|
809
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
810
|
+
width = _useWindowDimensions.width,
|
|
811
|
+
height = _useWindowDimensions.height;
|
|
812
|
+
|
|
813
|
+
return matchWindowSize({
|
|
814
|
+
width: width,
|
|
815
|
+
height: height
|
|
816
|
+
}, options);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
var _excluded$k = ["as", "onPress", "disabled", "icon"];
|
|
820
|
+
function ActionsItem(_ref) {
|
|
821
|
+
var as = _ref.as,
|
|
822
|
+
onPress = _ref.onPress,
|
|
823
|
+
disabled = _ref.disabled,
|
|
824
|
+
icon = _ref.icon,
|
|
825
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
826
|
+
|
|
827
|
+
var isMedium = useMatchWindowSize({
|
|
828
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
829
|
+
});
|
|
830
|
+
|
|
831
|
+
var _useState = useState(false),
|
|
832
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
833
|
+
isLoading = _useState2[0],
|
|
834
|
+
setIsLoading = _useState2[1];
|
|
835
|
+
|
|
836
|
+
var mountedRef = useRef(false); // effect just for tracking mounted state, as onPress can unmount the ActionButton
|
|
837
|
+
|
|
838
|
+
useEffect(function () {
|
|
839
|
+
mountedRef.current = true;
|
|
840
|
+
return function () {
|
|
841
|
+
mountedRef.current = false;
|
|
842
|
+
};
|
|
843
|
+
}, []);
|
|
844
|
+
return /*#__PURE__*/jsx(View, {
|
|
845
|
+
children: /*#__PURE__*/jsx(as, _objectSpread(_objectSpread({}, props), {}, {
|
|
846
|
+
stretch: !isMedium ? true : undefined,
|
|
847
|
+
disabled: isLoading ? true : disabled,
|
|
848
|
+
icon: isLoading ? /*#__PURE__*/jsx(LoaderIcon, {}) : icon,
|
|
849
|
+
onPress: function handlePress(e) {
|
|
850
|
+
var callPressAndUpdateLoadingState = /*#__PURE__*/function () {
|
|
851
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
852
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
853
|
+
while (1) {
|
|
854
|
+
switch (_context.prev = _context.next) {
|
|
855
|
+
case 0:
|
|
856
|
+
if (onPress) {
|
|
857
|
+
_context.next = 2;
|
|
858
|
+
break;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
return _context.abrupt("return");
|
|
862
|
+
|
|
863
|
+
case 2:
|
|
864
|
+
setIsLoading(true);
|
|
865
|
+
_context.prev = 3;
|
|
866
|
+
_context.next = 6;
|
|
867
|
+
return onPress(e);
|
|
868
|
+
|
|
869
|
+
case 6:
|
|
870
|
+
if (mountedRef.current) {
|
|
871
|
+
setIsLoading(false);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
_context.next = 13;
|
|
875
|
+
break;
|
|
876
|
+
|
|
877
|
+
case 9:
|
|
878
|
+
_context.prev = 9;
|
|
879
|
+
_context.t0 = _context["catch"](3);
|
|
880
|
+
|
|
881
|
+
if (mountedRef.current) {
|
|
882
|
+
setIsLoading(false);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
throw _context.t0;
|
|
886
|
+
|
|
887
|
+
case 13:
|
|
888
|
+
case "end":
|
|
889
|
+
return _context.stop();
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}, _callee, null, [[3, 9]]);
|
|
893
|
+
}));
|
|
894
|
+
|
|
895
|
+
return function () {
|
|
896
|
+
return _ref2.apply(this, arguments);
|
|
897
|
+
};
|
|
898
|
+
}();
|
|
899
|
+
|
|
900
|
+
callPressAndUpdateLoadingState();
|
|
901
|
+
}
|
|
902
|
+
}))
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
function ActionsButton(_ref) {
|
|
907
|
+
var props = _extends({}, _ref);
|
|
908
|
+
|
|
909
|
+
return /*#__PURE__*/jsx(ActionsItem, _objectSpread({
|
|
910
|
+
as: Button
|
|
911
|
+
}, props));
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
var _excluded$j = ["children"];
|
|
915
|
+
function Actions(_ref) {
|
|
916
|
+
var children = _ref.children,
|
|
917
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
918
|
+
|
|
919
|
+
return /*#__PURE__*/jsx(Stack, _objectSpread(_objectSpread({
|
|
920
|
+
alignItems: {
|
|
921
|
+
base: 'stretch',
|
|
922
|
+
medium: 'center'
|
|
923
|
+
},
|
|
924
|
+
direction: {
|
|
925
|
+
base: 'column',
|
|
926
|
+
medium: 'row'
|
|
927
|
+
},
|
|
928
|
+
flex: 1
|
|
929
|
+
}, props), {}, {
|
|
930
|
+
space: "kitt.3",
|
|
931
|
+
children: children
|
|
932
|
+
}));
|
|
933
|
+
}
|
|
934
|
+
Actions.Button = ActionsButton;
|
|
935
|
+
Actions.Item = ActionsItem;
|
|
936
|
+
|
|
937
|
+
var _excluded$i = ["size", "round", "light", "sizeVariant"];
|
|
938
|
+
|
|
939
|
+
var getInitials = function (firstname, lastname) {
|
|
940
|
+
return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
|
|
944
|
+
displayName: "Avatar__StyledAvatarView"
|
|
945
|
+
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
946
|
+
var theme = _ref.theme,
|
|
947
|
+
$isRound = _ref.$isRound,
|
|
948
|
+
$size = _ref.$size,
|
|
949
|
+
$sizeVariant = _ref.$sizeVariant;
|
|
950
|
+
if ($isRound) return "".concat($size / 2, "px");
|
|
951
|
+
return "".concat($sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius, "px");
|
|
952
|
+
}, function (_ref2) {
|
|
953
|
+
var theme = _ref2.theme,
|
|
954
|
+
$isLight = _ref2.$isLight;
|
|
955
|
+
return $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
|
|
956
|
+
}, function (_ref3) {
|
|
957
|
+
var $size = _ref3.$size;
|
|
958
|
+
return $size;
|
|
959
|
+
}, function (_ref4) {
|
|
960
|
+
var $size = _ref4.$size;
|
|
961
|
+
return $size;
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
function AvatarContent(_ref5) {
|
|
965
|
+
var size = _ref5.size,
|
|
966
|
+
src = _ref5.src,
|
|
967
|
+
firstname = _ref5.firstname,
|
|
968
|
+
lastname = _ref5.lastname,
|
|
969
|
+
alt = _ref5.alt,
|
|
970
|
+
isLight = _ref5.isLight,
|
|
971
|
+
sizeVariant = _ref5.sizeVariant;
|
|
972
|
+
|
|
973
|
+
if (src) {
|
|
974
|
+
return /*#__PURE__*/jsx(Image, {
|
|
975
|
+
source: {
|
|
976
|
+
uri: src
|
|
977
|
+
},
|
|
978
|
+
style: {
|
|
979
|
+
width: size,
|
|
980
|
+
height: size
|
|
981
|
+
},
|
|
982
|
+
accessibilityLabel: alt
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
if (firstname && lastname) {
|
|
987
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
988
|
+
base: sizeVariant === 'large' ? 'body-large' : 'body-small',
|
|
989
|
+
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
990
|
+
color: isLight ? 'black' : 'white',
|
|
991
|
+
children: getInitials(firstname, lastname)
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
return /*#__PURE__*/jsx(Icon, {
|
|
996
|
+
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
997
|
+
color: isLight ? 'black' : 'white',
|
|
998
|
+
size: size / 2
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
function Avatar(_ref6) {
|
|
1003
|
+
var _ref6$size = _ref6.size,
|
|
1004
|
+
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
1005
|
+
round = _ref6.round,
|
|
1006
|
+
light = _ref6.light,
|
|
1007
|
+
sizeVariant = _ref6.sizeVariant,
|
|
1008
|
+
props = _objectWithoutProperties(_ref6, _excluded$i);
|
|
1009
|
+
|
|
1010
|
+
return /*#__PURE__*/jsx(StyledAvatarView, {
|
|
1011
|
+
$size: size,
|
|
1012
|
+
$isRound: round,
|
|
1013
|
+
$isLight: light,
|
|
1014
|
+
$sizeVariant: sizeVariant,
|
|
1015
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread({
|
|
1016
|
+
size: size,
|
|
1017
|
+
isLight: light,
|
|
1018
|
+
sizeVariant: sizeVariant
|
|
1019
|
+
}, props))
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
810
1022
|
|
|
811
1023
|
var Container$5 = /*#__PURE__*/styled.View.withConfig({
|
|
812
1024
|
displayName: "Card__Container"
|
|
@@ -837,6 +1049,333 @@ function Card(_ref6) {
|
|
|
837
1049
|
});
|
|
838
1050
|
}
|
|
839
1051
|
|
|
1052
|
+
var useNativeAnimation = function (_ref) {
|
|
1053
|
+
var selected = _ref.selected,
|
|
1054
|
+
disabled = _ref.disabled,
|
|
1055
|
+
isPressedInternal = _ref.isPressedInternal;
|
|
1056
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1057
|
+
var pressed = useSharedValue(Boolean(isPressedInternal));
|
|
1058
|
+
var progress = useDerivedValue(function () {
|
|
1059
|
+
var _f = function () {
|
|
1060
|
+
return withTiming(pressed.value ? 1 : 0, {
|
|
1061
|
+
duration: theme.kitt.choices.item.transition.duration
|
|
1062
|
+
});
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
_f._closure = {
|
|
1066
|
+
withTiming: withTiming,
|
|
1067
|
+
pressed: pressed,
|
|
1068
|
+
theme: {
|
|
1069
|
+
kitt: {
|
|
1070
|
+
choices: {
|
|
1071
|
+
item: {
|
|
1072
|
+
transition: {
|
|
1073
|
+
duration: theme.kitt.choices.item.transition.duration
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
};
|
|
1080
|
+
_f.asString = "function _f(){const{withTiming,pressed,theme}=jsThis._closure;{return withTiming(pressed.value?1:0,{duration:theme.kitt.choices.item.transition.duration});}}";
|
|
1081
|
+
_f.__workletHash = 1120030177160;
|
|
1082
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/hooks/useNativeAnimation.tsx (31:35)";
|
|
1083
|
+
return _f;
|
|
1084
|
+
}());
|
|
1085
|
+
var backgroundStyles = useAnimatedStyle(function () {
|
|
1086
|
+
var _f = function () {
|
|
1087
|
+
var _theme$kitt$choices$i = theme.kitt.choices.item.backgroundColor,
|
|
1088
|
+
defaultBg = _theme$kitt$choices$i["default"],
|
|
1089
|
+
pressedBg = _theme$kitt$choices$i.pressed,
|
|
1090
|
+
selectedBg = _theme$kitt$choices$i.selected,
|
|
1091
|
+
disabledBg = _theme$kitt$choices$i.disabled;
|
|
1092
|
+
if (disabled) return {
|
|
1093
|
+
backgroundColor: disabledBg
|
|
1094
|
+
};
|
|
1095
|
+
if (selected) return {
|
|
1096
|
+
backgroundColor: selectedBg
|
|
1097
|
+
};
|
|
1098
|
+
return {
|
|
1099
|
+
backgroundColor: interpolateColor(progress.value, [0, 1], [defaultBg, pressedBg])
|
|
1100
|
+
};
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
_f._closure = {
|
|
1104
|
+
theme: {
|
|
1105
|
+
kitt: {
|
|
1106
|
+
choices: {
|
|
1107
|
+
item: {
|
|
1108
|
+
backgroundColor: theme.kitt.choices.item.backgroundColor
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1113
|
+
disabled: disabled,
|
|
1114
|
+
selected: selected,
|
|
1115
|
+
interpolateColor: interpolateColor,
|
|
1116
|
+
progress: progress
|
|
1117
|
+
};
|
|
1118
|
+
_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])};}}";
|
|
1119
|
+
_f.__workletHash = 15506726129309;
|
|
1120
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/hooks/useNativeAnimation.tsx (35:44)";
|
|
1121
|
+
return _f;
|
|
1122
|
+
}());
|
|
1123
|
+
return {
|
|
1124
|
+
onPressIn: function onPressIn() {
|
|
1125
|
+
pressed.value = true;
|
|
1126
|
+
},
|
|
1127
|
+
onPressOut: function onPressOut() {
|
|
1128
|
+
pressed.value = false;
|
|
1129
|
+
},
|
|
1130
|
+
backgroundStyles: backgroundStyles
|
|
1131
|
+
};
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
function getCurrentTextColor(_ref) {
|
|
1135
|
+
var isDisabled = _ref.isDisabled,
|
|
1136
|
+
isSelected = _ref.isSelected,
|
|
1137
|
+
isPressed = _ref.isPressed,
|
|
1138
|
+
isHovered = _ref.isHovered;
|
|
1139
|
+
if (isDisabled) return 'black-light';
|
|
1140
|
+
if (isSelected && isHovered) return 'white';
|
|
1141
|
+
if (isSelected || isPressed) return 'white';
|
|
1142
|
+
return 'black';
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
function getBorderRadius(defaultRadius, variant) {
|
|
1146
|
+
// The clean way to have the rounded effect would have been to know the children height since radius >= height * 0.5
|
|
1147
|
+
// We don't control over the height of the rendered children we just go with a arbitrary really high value
|
|
1148
|
+
if (variant === 'rounded') return 800;
|
|
1149
|
+
return defaultRadius;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
var DisabledBorder = /*#__PURE__*/styled(View$2).withConfig({
|
|
1153
|
+
displayName: "ChoiceItem__DisabledBorder"
|
|
1154
|
+
})(["border-radius:", "px;", ";"], function (_ref2) {
|
|
1155
|
+
var theme = _ref2.theme,
|
|
1156
|
+
$variant = _ref2.$variant;
|
|
1157
|
+
return getBorderRadius(theme.kitt.choices.item.borderRadius, $variant);
|
|
1158
|
+
}, function (_ref3) {
|
|
1159
|
+
var theme = _ref3.theme;
|
|
1160
|
+
var _theme$kitt$choices$i = theme.kitt.choices.item.disabled.border,
|
|
1161
|
+
width = _theme$kitt$choices$i.width,
|
|
1162
|
+
color = _theme$kitt$choices$i.color;
|
|
1163
|
+
return css(["border:", "px solid ", ";"], width, color);
|
|
1164
|
+
});
|
|
1165
|
+
var ChoiceItemView = /*#__PURE__*/styled(Platform.OS === 'web' ? View$2 : Animated.View).withConfig({
|
|
1166
|
+
displayName: "ChoiceItem__ChoiceItemView"
|
|
1167
|
+
})(["position:relative;border-radius:", "px;background-color:", ";", ";", ""], function (_ref4) {
|
|
1168
|
+
var theme = _ref4.theme,
|
|
1169
|
+
$variant = _ref4.$variant;
|
|
1170
|
+
return getBorderRadius(theme.kitt.choices.item.borderRadius, $variant);
|
|
1171
|
+
}, function (_ref5) {
|
|
1172
|
+
var theme = _ref5.theme,
|
|
1173
|
+
$isHovered = _ref5.$isHovered,
|
|
1174
|
+
$isPressed = _ref5.$isPressed,
|
|
1175
|
+
$isDisabled = _ref5.$isDisabled,
|
|
1176
|
+
$isSelected = _ref5.$isSelected;
|
|
1177
|
+
var _theme$kitt$choices$i2 = theme.kitt.choices.item.backgroundColor,
|
|
1178
|
+
hoverWhenSelected = _theme$kitt$choices$i2.hoverWhenSelected,
|
|
1179
|
+
hover = _theme$kitt$choices$i2.hover,
|
|
1180
|
+
disabled = _theme$kitt$choices$i2.disabled,
|
|
1181
|
+
selected = _theme$kitt$choices$i2.selected,
|
|
1182
|
+
pressed = _theme$kitt$choices$i2.pressed,
|
|
1183
|
+
defaultBackground = _theme$kitt$choices$i2["default"];
|
|
1184
|
+
if ($isDisabled) return disabled;
|
|
1185
|
+
if ($isSelected && $isHovered) return hoverWhenSelected;
|
|
1186
|
+
if ($isPressed) return pressed;
|
|
1187
|
+
if ($isHovered) return hover;
|
|
1188
|
+
if ($isSelected) return selected;
|
|
1189
|
+
return defaultBackground;
|
|
1190
|
+
}, function (_ref6) {
|
|
1191
|
+
var theme = _ref6.theme;
|
|
1192
|
+
var _theme$kitt$choices$i3 = theme.kitt.choices.item.padding,
|
|
1193
|
+
base = _theme$kitt$choices$i3.base,
|
|
1194
|
+
small = _theme$kitt$choices$i3.small;
|
|
1195
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
1196
|
+
minWidth: KittBreakpoints.SMALL
|
|
1197
|
+
}, css(["padding:", "px;"], small), css(["padding:", "px;"], base));
|
|
1198
|
+
}, function (_ref7) {
|
|
1199
|
+
var theme = _ref7.theme;
|
|
1200
|
+
if (Platform.OS !== 'web') return undefined;
|
|
1201
|
+
var _theme$kitt$choices$i4 = theme.kitt.choices.item.transition,
|
|
1202
|
+
property = _theme$kitt$choices$i4.property,
|
|
1203
|
+
duration = _theme$kitt$choices$i4.duration,
|
|
1204
|
+
timingFunction = _theme$kitt$choices$i4.timingFunction;
|
|
1205
|
+
return css(["transition:", " ", "ms ", ";"], property, duration, timingFunction);
|
|
1206
|
+
});
|
|
1207
|
+
function ChoiceItem(_ref8) {
|
|
1208
|
+
var _ref8$type = _ref8.type,
|
|
1209
|
+
type = _ref8$type === void 0 ? 'button' : _ref8$type,
|
|
1210
|
+
value = _ref8.value,
|
|
1211
|
+
selected = _ref8.selected,
|
|
1212
|
+
disabled = _ref8.disabled,
|
|
1213
|
+
variant = _ref8.variant,
|
|
1214
|
+
_children = _ref8.children,
|
|
1215
|
+
isPressedInternal = _ref8.isPressedInternal,
|
|
1216
|
+
isHoveredInternal = _ref8.isHoveredInternal,
|
|
1217
|
+
onPress = _ref8.onPress,
|
|
1218
|
+
onChange = _ref8.onChange,
|
|
1219
|
+
onBlur = _ref8.onBlur,
|
|
1220
|
+
onFocus = _ref8.onFocus;
|
|
1221
|
+
|
|
1222
|
+
var _useNativeAnimation = useNativeAnimation({
|
|
1223
|
+
selected: selected,
|
|
1224
|
+
disabled: disabled,
|
|
1225
|
+
isPressedInternal: isPressedInternal
|
|
1226
|
+
}),
|
|
1227
|
+
onPressIn = _useNativeAnimation.onPressIn,
|
|
1228
|
+
onPressOut = _useNativeAnimation.onPressOut,
|
|
1229
|
+
backgroundStyles = _useNativeAnimation.backgroundStyles;
|
|
1230
|
+
|
|
1231
|
+
var handleChange = function () {
|
|
1232
|
+
if (!onChange) return; // Checkbox can be toggled
|
|
1233
|
+
|
|
1234
|
+
if (type === 'checkbox') {
|
|
1235
|
+
onChange(selected ? undefined : value);
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
onChange(value);
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1242
|
+
return /*#__PURE__*/jsx(Pressable, {
|
|
1243
|
+
disabled: disabled,
|
|
1244
|
+
accessibilityRole: type,
|
|
1245
|
+
accessibilityState: {
|
|
1246
|
+
checked: selected
|
|
1247
|
+
},
|
|
1248
|
+
onBlur: onBlur,
|
|
1249
|
+
onFocus: onFocus,
|
|
1250
|
+
onPress: function handlePress(e) {
|
|
1251
|
+
if (onFocus) onFocus(e);
|
|
1252
|
+
if (onPress) onPress();
|
|
1253
|
+
handleChange();
|
|
1254
|
+
if (onBlur) onBlur(e);
|
|
1255
|
+
},
|
|
1256
|
+
onPressIn: onPressIn,
|
|
1257
|
+
onPressOut: onPressOut,
|
|
1258
|
+
children: function children(_ref9) {
|
|
1259
|
+
var isHovered = _ref9.isHovered,
|
|
1260
|
+
isPressed = _ref9.isPressed;
|
|
1261
|
+
return /*#__PURE__*/jsxs(ChoiceItemView, {
|
|
1262
|
+
style: Platform.OS !== 'web' ? [backgroundStyles] : undefined,
|
|
1263
|
+
$isHovered: isHovered || isHoveredInternal,
|
|
1264
|
+
$isDisabled: disabled,
|
|
1265
|
+
$isSelected: selected,
|
|
1266
|
+
$isPressed: isPressed || isPressedInternal,
|
|
1267
|
+
$variant: variant,
|
|
1268
|
+
children: [/*#__PURE__*/jsx(Typography.SetDefaultColor, {
|
|
1269
|
+
value: getCurrentTextColor({
|
|
1270
|
+
isDisabled: disabled,
|
|
1271
|
+
isSelected: selected || isPressedInternal,
|
|
1272
|
+
isPressed: isPressed,
|
|
1273
|
+
isHovered: isHovered || isHoveredInternal
|
|
1274
|
+
}),
|
|
1275
|
+
children: _children
|
|
1276
|
+
}), disabled ? /*#__PURE__*/jsx(DisabledBorder, {
|
|
1277
|
+
$variant: variant,
|
|
1278
|
+
style: StyleSheet.absoluteFillObject
|
|
1279
|
+
}) : null]
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
var ChoiceItemContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
1286
|
+
displayName: "ChoiceItemContainer"
|
|
1287
|
+
})(["", ""], function (_ref) {
|
|
1288
|
+
var theme = _ref.theme,
|
|
1289
|
+
$isLast = _ref.$isLast,
|
|
1290
|
+
$direction = _ref.$direction;
|
|
1291
|
+
var _theme$kitt$choices$s = theme.kitt.choices.spacing,
|
|
1292
|
+
row = _theme$kitt$choices$s.row,
|
|
1293
|
+
column = _theme$kitt$choices$s.column;
|
|
1294
|
+
|
|
1295
|
+
if ($direction === 'row') {
|
|
1296
|
+
return css(["margin-right:", "px;"], $isLast ? 0 : row);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
return css(["margin-bottom:", "px;"], $isLast ? 0 : column);
|
|
1300
|
+
});
|
|
1301
|
+
|
|
1302
|
+
var _excluded$h = ["direction"];
|
|
1303
|
+
|
|
1304
|
+
function ChoicesContainer(_ref) {
|
|
1305
|
+
var direction = _ref.direction,
|
|
1306
|
+
props = _objectWithoutProperties(_ref, _excluded$h);
|
|
1307
|
+
|
|
1308
|
+
if (direction === 'row') {
|
|
1309
|
+
return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
|
|
1310
|
+
horizontal: true
|
|
1311
|
+
}, props));
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
function Choices(_ref2) {
|
|
1318
|
+
var id = _ref2.id,
|
|
1319
|
+
testID = _ref2.testID,
|
|
1320
|
+
type = _ref2.type,
|
|
1321
|
+
_ref2$direction = _ref2.direction,
|
|
1322
|
+
direction = _ref2$direction === void 0 ? 'column' : _ref2$direction,
|
|
1323
|
+
disabled = _ref2.disabled,
|
|
1324
|
+
children = _ref2.children,
|
|
1325
|
+
value = _ref2.value,
|
|
1326
|
+
variant = _ref2.variant,
|
|
1327
|
+
onPress = _ref2.onPress,
|
|
1328
|
+
onChange = _ref2.onChange,
|
|
1329
|
+
onFocus = _ref2.onFocus,
|
|
1330
|
+
onBlur = _ref2.onBlur;
|
|
1331
|
+
|
|
1332
|
+
var _useState = useState(value),
|
|
1333
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1334
|
+
currentValue = _useState2[0],
|
|
1335
|
+
setCurrentValue = _useState2[1];
|
|
1336
|
+
|
|
1337
|
+
var isForm = type && ['radio', 'checkbox'].includes(type);
|
|
1338
|
+
var childrenArray = Children.toArray(children);
|
|
1339
|
+
var sharedProps = {
|
|
1340
|
+
type: type,
|
|
1341
|
+
disabled: disabled,
|
|
1342
|
+
variant: variant,
|
|
1343
|
+
onPress: !isForm ? onPress : undefined,
|
|
1344
|
+
onChange: isForm ? function handleChange(newValue) {
|
|
1345
|
+
setCurrentValue(newValue);
|
|
1346
|
+
if (onChange) onChange(newValue);
|
|
1347
|
+
} : undefined,
|
|
1348
|
+
onFocus: onFocus,
|
|
1349
|
+
onBlur: onBlur
|
|
1350
|
+
};
|
|
1351
|
+
return /*#__PURE__*/jsx(ChoicesContainer, {
|
|
1352
|
+
direction: direction,
|
|
1353
|
+
testID: testID,
|
|
1354
|
+
nativeID: id,
|
|
1355
|
+
children: childrenArray.map(function (child, index) {
|
|
1356
|
+
var element = /*#__PURE__*/cloneElement(child, _objectSpread({
|
|
1357
|
+
selected: isForm ? child.props.value === currentValue : undefined
|
|
1358
|
+
}, sharedProps));
|
|
1359
|
+
return /*#__PURE__*/jsx(ChoiceItemContainer, {
|
|
1360
|
+
$direction: direction,
|
|
1361
|
+
$isLast: index === childrenArray.length - 1,
|
|
1362
|
+
children: element
|
|
1363
|
+
}, child.key);
|
|
1364
|
+
})
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
Choices.Item = ChoiceItem;
|
|
1369
|
+
function createChoicesComponent() {
|
|
1370
|
+
return Choices;
|
|
1371
|
+
}
|
|
1372
|
+
var ButtonChoices = createChoicesComponent();
|
|
1373
|
+
Choices.ButtonChoices = ButtonChoices;
|
|
1374
|
+
var ChoicesElements = {
|
|
1375
|
+
Item: ChoiceItem,
|
|
1376
|
+
ButtonChoices: ButtonChoices
|
|
1377
|
+
};
|
|
1378
|
+
|
|
840
1379
|
function Emoji(_ref) {
|
|
841
1380
|
var emoji = _ref.emoji,
|
|
842
1381
|
size = _ref.size,
|
|
@@ -1221,6 +1760,39 @@ var card = {
|
|
|
1221
1760
|
}
|
|
1222
1761
|
};
|
|
1223
1762
|
|
|
1763
|
+
var choices = {
|
|
1764
|
+
spacing: {
|
|
1765
|
+
row: 12,
|
|
1766
|
+
column: 12
|
|
1767
|
+
},
|
|
1768
|
+
item: {
|
|
1769
|
+
borderRadius: 10,
|
|
1770
|
+
padding: {
|
|
1771
|
+
base: 16,
|
|
1772
|
+
small: 24
|
|
1773
|
+
},
|
|
1774
|
+
backgroundColor: {
|
|
1775
|
+
"default": lateOceanColorPalette.black50,
|
|
1776
|
+
disabled: colors.disabled,
|
|
1777
|
+
selected: colors.primary,
|
|
1778
|
+
pressed: lateOceanColorPalette.lateOceanLight1,
|
|
1779
|
+
hover: lateOceanColorPalette.black100,
|
|
1780
|
+
hoverWhenSelected: lateOceanColorPalette.lateOceanLight1
|
|
1781
|
+
},
|
|
1782
|
+
disabled: {
|
|
1783
|
+
border: {
|
|
1784
|
+
width: 2,
|
|
1785
|
+
color: lateOceanColorPalette.black100
|
|
1786
|
+
}
|
|
1787
|
+
},
|
|
1788
|
+
transition: {
|
|
1789
|
+
property: 'all',
|
|
1790
|
+
duration: 300,
|
|
1791
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
};
|
|
1795
|
+
|
|
1224
1796
|
var feedbackMessage = {
|
|
1225
1797
|
danger: {
|
|
1226
1798
|
backgroundColor: colors.danger
|
|
@@ -1396,8 +1968,14 @@ var input = {
|
|
|
1396
1968
|
};
|
|
1397
1969
|
|
|
1398
1970
|
var inputField = {
|
|
1971
|
+
containerPaddingTop: 5,
|
|
1972
|
+
containerPaddingBottom: 10,
|
|
1973
|
+
feedbackPaddingTop: {
|
|
1974
|
+
base: 5,
|
|
1975
|
+
small: 10
|
|
1976
|
+
},
|
|
1399
1977
|
labelContainerPaddingBottom: 5,
|
|
1400
|
-
|
|
1978
|
+
labelFeedbackMarginLeft: 6
|
|
1401
1979
|
};
|
|
1402
1980
|
|
|
1403
1981
|
var inputTag = {
|
|
@@ -1638,6 +2216,7 @@ var theme = {
|
|
|
1638
2216
|
breakpoints: breakpoints,
|
|
1639
2217
|
button: button,
|
|
1640
2218
|
card: card,
|
|
2219
|
+
choices: choices,
|
|
1641
2220
|
feedbackMessage: feedbackMessage,
|
|
1642
2221
|
forms: forms,
|
|
1643
2222
|
fullScreenModal: fullScreenModal,
|
|
@@ -1653,28 +2232,6 @@ var theme = {
|
|
|
1653
2232
|
navigationModal: navigationModal
|
|
1654
2233
|
};
|
|
1655
2234
|
|
|
1656
|
-
function matchWindowSize(_ref, _ref2) {
|
|
1657
|
-
var width = _ref.width,
|
|
1658
|
-
height = _ref.height;
|
|
1659
|
-
var minWidth = _ref2.minWidth,
|
|
1660
|
-
maxWidth = _ref2.maxWidth,
|
|
1661
|
-
minHeight = _ref2.minHeight,
|
|
1662
|
-
maxHeight = _ref2.maxHeight;
|
|
1663
|
-
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
1664
|
-
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
1665
|
-
return hasWidthMatched && hasHeightMatched;
|
|
1666
|
-
}
|
|
1667
|
-
function useMatchWindowSize(options) {
|
|
1668
|
-
var _useWindowDimensions = useWindowDimensions(),
|
|
1669
|
-
width = _useWindowDimensions.width,
|
|
1670
|
-
height = _useWindowDimensions.height;
|
|
1671
|
-
|
|
1672
|
-
return matchWindowSize({
|
|
1673
|
-
width: width,
|
|
1674
|
-
height: height
|
|
1675
|
-
}, options);
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
2235
|
function createWindowSizeHelper(dimensions) {
|
|
1679
2236
|
return {
|
|
1680
2237
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
@@ -1999,7 +2556,7 @@ function DatePickerAndroid(_ref) {
|
|
|
1999
2556
|
}
|
|
2000
2557
|
|
|
2001
2558
|
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
2002
|
-
var OverlayPressable = /*#__PURE__*/styled(Pressable$
|
|
2559
|
+
var OverlayPressable = /*#__PURE__*/styled(Pressable$2).withConfig({
|
|
2003
2560
|
displayName: "Overlay__OverlayPressable"
|
|
2004
2561
|
})(function (_ref) {
|
|
2005
2562
|
var theme = _ref.theme;
|
|
@@ -2026,7 +2583,7 @@ var BodyView = /*#__PURE__*/styled.View.withConfig({
|
|
|
2026
2583
|
});
|
|
2027
2584
|
function ModalBody(_ref3) {
|
|
2028
2585
|
var children = _ref3.children;
|
|
2029
|
-
return /*#__PURE__*/jsx(ScrollView$
|
|
2586
|
+
return /*#__PURE__*/jsx(ScrollView$2, {
|
|
2030
2587
|
children: /*#__PURE__*/jsx(BodyView, {
|
|
2031
2588
|
children: children
|
|
2032
2589
|
})
|
|
@@ -2730,40 +3287,25 @@ function InputFeedback(_ref) {
|
|
|
2730
3287
|
});
|
|
2731
3288
|
}
|
|
2732
3289
|
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
2749
|
-
});
|
|
2750
|
-
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2751
|
-
displayName: "InputField__LabelContainer"
|
|
2752
|
-
})(["margin-right:", "px;"], function (_ref3) {
|
|
2753
|
-
var theme = _ref3.theme;
|
|
2754
|
-
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
2755
|
-
});
|
|
2756
|
-
function InputField(_ref4) {
|
|
2757
|
-
var label = _ref4.label,
|
|
2758
|
-
labelFeedback = _ref4.labelFeedback,
|
|
2759
|
-
input = _ref4.input,
|
|
2760
|
-
feedback = _ref4.feedback;
|
|
2761
|
-
return /*#__PURE__*/jsxs(FieldContainer, {
|
|
2762
|
-
children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
|
|
2763
|
-
children: [/*#__PURE__*/jsx(LabelContainer, {
|
|
3290
|
+
function InputField(_ref) {
|
|
3291
|
+
var label = _ref.label,
|
|
3292
|
+
labelFeedback = _ref.labelFeedback,
|
|
3293
|
+
input = _ref.input,
|
|
3294
|
+
feedback = _ref.feedback;
|
|
3295
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3296
|
+
return /*#__PURE__*/jsxs(View, {
|
|
3297
|
+
paddingTop: theme.kitt.forms.inputField.containerPaddingTop,
|
|
3298
|
+
paddingBottom: theme.kitt.forms.inputField.containerPaddingBottom,
|
|
3299
|
+
children: [label ? /*#__PURE__*/jsxs(View, {
|
|
3300
|
+
flexDirection: "row",
|
|
3301
|
+
alignItems: "center",
|
|
3302
|
+
paddingBottom: theme.kitt.forms.inputField.labelContainerPaddingBottom,
|
|
3303
|
+
children: [/*#__PURE__*/jsx(View, {
|
|
3304
|
+
marginRight: theme.kitt.forms.inputField.labelFeedbackMarginLeft,
|
|
2764
3305
|
children: label
|
|
2765
3306
|
}), labelFeedback]
|
|
2766
|
-
}) : null, input, feedback ? /*#__PURE__*/jsx(
|
|
3307
|
+
}) : null, input, feedback ? /*#__PURE__*/jsx(View, {
|
|
3308
|
+
paddingTop: theme.kitt.forms.inputField.feedbackPaddingTop,
|
|
2767
3309
|
children: feedback
|
|
2768
3310
|
}) : null]
|
|
2769
3311
|
});
|
|
@@ -2800,7 +3342,7 @@ function InputIcon(_ref) {
|
|
|
2800
3342
|
function InputPressable(_ref) {
|
|
2801
3343
|
var props = _extends({}, _ref);
|
|
2802
3344
|
|
|
2803
|
-
return /*#__PURE__*/jsx(Pressable$
|
|
3345
|
+
return /*#__PURE__*/jsx(Pressable$2, _objectSpread({}, props));
|
|
2804
3346
|
}
|
|
2805
3347
|
|
|
2806
3348
|
var _excluded$8 = ["isPasswordDefaultVisible", "right"];
|
|
@@ -2846,7 +3388,7 @@ var getTypographyColor = function (type) {
|
|
|
2846
3388
|
return type ? 'white' : 'black';
|
|
2847
3389
|
};
|
|
2848
3390
|
|
|
2849
|
-
var InputTagContainer = /*#__PURE__*/styled(View$
|
|
3391
|
+
var InputTagContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
2850
3392
|
displayName: "InputTag__InputTagContainer"
|
|
2851
3393
|
})(["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) {
|
|
2852
3394
|
var theme = _ref.theme;
|
|
@@ -2868,7 +3410,7 @@ var InputTagContainer = /*#__PURE__*/styled(View$1).withConfig({
|
|
|
2868
3410
|
var theme = _ref3.theme;
|
|
2869
3411
|
return theme.kitt.forms.inputTag.borderRadius;
|
|
2870
3412
|
});
|
|
2871
|
-
var IconContainer = /*#__PURE__*/styled(View$
|
|
3413
|
+
var IconContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
2872
3414
|
displayName: "InputTag__IconContainer"
|
|
2873
3415
|
})(["margin-right:", "px;"], function (_ref4) {
|
|
2874
3416
|
var theme = _ref4.theme;
|
|
@@ -3168,47 +3710,6 @@ function FullScreenModal(_ref2) {
|
|
|
3168
3710
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
3169
3711
|
FullScreenModal.Body = FullScreenModalBody;
|
|
3170
3712
|
|
|
3171
|
-
function SpinningIcon(_ref) {
|
|
3172
|
-
var icon = _ref.icon,
|
|
3173
|
-
color = _ref.color;
|
|
3174
|
-
|
|
3175
|
-
if (process.env.NODE_ENV !== 'production' && !color) {
|
|
3176
|
-
throw new Error("Invalid color passed to SpinningIcon: ".concat(String(color)));
|
|
3177
|
-
}
|
|
3178
|
-
|
|
3179
|
-
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
3180
|
-
color: color
|
|
3181
|
-
});
|
|
3182
|
-
var animationRef = useRef(new Animated$1.Value(0));
|
|
3183
|
-
var rotation = animationRef.current.interpolate({
|
|
3184
|
-
inputRange: [0, 1],
|
|
3185
|
-
outputRange: ['0deg', '360deg']
|
|
3186
|
-
});
|
|
3187
|
-
useEffect(function () {
|
|
3188
|
-
if (process.env.NODE_ENV === 'test') return undefined;
|
|
3189
|
-
var animation = Animated$1.loop(Animated$1.timing(animationRef.current, {
|
|
3190
|
-
toValue: 1,
|
|
3191
|
-
duration: 1100,
|
|
3192
|
-
easing: Easing.linear,
|
|
3193
|
-
useNativeDriver: true
|
|
3194
|
-
}));
|
|
3195
|
-
animation.start();
|
|
3196
|
-
return function () {
|
|
3197
|
-
if (process.env.NODE_ENV === 'test') return undefined;
|
|
3198
|
-
animation.stop();
|
|
3199
|
-
return undefined;
|
|
3200
|
-
};
|
|
3201
|
-
}, []);
|
|
3202
|
-
return /*#__PURE__*/jsx(Animated$1.View, {
|
|
3203
|
-
style: {
|
|
3204
|
-
transform: [{
|
|
3205
|
-
rotate: rotation
|
|
3206
|
-
}]
|
|
3207
|
-
},
|
|
3208
|
-
children: clonedIcon
|
|
3209
|
-
});
|
|
3210
|
-
}
|
|
3211
|
-
|
|
3212
3713
|
var _excluded$7 = ["children"];
|
|
3213
3714
|
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
3214
3715
|
displayName: "ListItemContent__ContentView"
|
|
@@ -3308,7 +3809,7 @@ function ListItem(_ref5) {
|
|
|
3308
3809
|
onPress = _ref5.onPress,
|
|
3309
3810
|
rest = _objectWithoutProperties(_ref5, _excluded$5);
|
|
3310
3811
|
|
|
3311
|
-
var Wrapper = onPress ? Pressable$
|
|
3812
|
+
var Wrapper = onPress ? Pressable$2 : Fragment$1;
|
|
3312
3813
|
var wrapperProps = onPress ? _objectSpread({
|
|
3313
3814
|
accessibilityRole: 'button',
|
|
3314
3815
|
onPress: onPress
|
|
@@ -3335,14 +3836,6 @@ ListItem.Content = ListItemContent;
|
|
|
3335
3836
|
ListItem.SideContent = ListItemSideContent;
|
|
3336
3837
|
ListItem.SideContainer = ListItemSideContainer;
|
|
3337
3838
|
|
|
3338
|
-
function LoaderIcon(_ref) {
|
|
3339
|
-
var color = _ref.color;
|
|
3340
|
-
return /*#__PURE__*/jsx(SpinningIcon, {
|
|
3341
|
-
color: color,
|
|
3342
|
-
icon: /*#__PURE__*/jsx(ArcIcon, {})
|
|
3343
|
-
});
|
|
3344
|
-
}
|
|
3345
|
-
|
|
3346
3839
|
function IconContent(_ref) {
|
|
3347
3840
|
var type = _ref.type,
|
|
3348
3841
|
color = _ref.color;
|
|
@@ -3528,7 +4021,7 @@ function CloseButton(_ref) {
|
|
|
3528
4021
|
});
|
|
3529
4022
|
}
|
|
3530
4023
|
|
|
3531
|
-
var ModalBehaviourContainer = /*#__PURE__*/styled(View$
|
|
4024
|
+
var ModalBehaviourContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
3532
4025
|
displayName: "ModalBehaviour__ModalBehaviourContainer"
|
|
3533
4026
|
})(["", ""], function () {
|
|
3534
4027
|
if (Platform.OS !== 'web') return undefined;
|
|
@@ -3695,16 +4188,8 @@ function KittNativeBaseProvider(_ref) {
|
|
|
3695
4188
|
});
|
|
3696
4189
|
}
|
|
3697
4190
|
|
|
3698
|
-
var Stack = Stack$1;
|
|
3699
|
-
var VStack = VStack$1;
|
|
3700
|
-
var HStack = HStack$1;
|
|
3701
|
-
|
|
3702
|
-
var View = View$2;
|
|
3703
|
-
var ScrollView = ScrollView$2;
|
|
3704
|
-
var Pressable = Pressable$2;
|
|
3705
|
-
|
|
3706
4191
|
var _excluded$4 = ["children"];
|
|
3707
|
-
var ViewWithPadding = /*#__PURE__*/styled(View$
|
|
4192
|
+
var ViewWithPadding = /*#__PURE__*/styled(View$2).withConfig({
|
|
3708
4193
|
displayName: "ContentPadding__ViewWithPadding"
|
|
3709
4194
|
})(["padding:", ";"], function (_ref) {
|
|
3710
4195
|
var theme = _ref.theme;
|
|
@@ -3810,7 +4295,7 @@ var HeaderContainer = /*#__PURE__*/styled(ContentPadding).withConfig({
|
|
|
3810
4295
|
return theme.kitt.colors.separator;
|
|
3811
4296
|
});
|
|
3812
4297
|
});
|
|
3813
|
-
var Row = /*#__PURE__*/styled(View$
|
|
4298
|
+
var Row = /*#__PURE__*/styled(View$2).withConfig({
|
|
3814
4299
|
displayName: "Header__Row"
|
|
3815
4300
|
})(["flex-direction:row;justify-content:", ";align-items:center;"], function (_ref7) {
|
|
3816
4301
|
var $hasContent = _ref7.$hasContent,
|
|
@@ -3823,7 +4308,7 @@ var ButtonContainer = /*#__PURE__*/styled.View.withConfig({
|
|
|
3823
4308
|
var theme = _ref8.theme;
|
|
3824
4309
|
return theme.kitt.iconButton.width;
|
|
3825
4310
|
});
|
|
3826
|
-
var ChildrenComponent = /*#__PURE__*/styled(View$
|
|
4311
|
+
var ChildrenComponent = /*#__PURE__*/styled(View$2).withConfig({
|
|
3827
4312
|
displayName: "Header__ChildrenComponent"
|
|
3828
4313
|
})(["flex:1;align-items:center;", ";"], function (_ref9) {
|
|
3829
4314
|
var theme = _ref9.theme,
|
|
@@ -3882,7 +4367,7 @@ function Header(_ref12) {
|
|
|
3882
4367
|
});
|
|
3883
4368
|
}
|
|
3884
4369
|
|
|
3885
|
-
var NavigationModalContainer = /*#__PURE__*/styled(View$
|
|
4370
|
+
var NavigationModalContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
3886
4371
|
displayName: "NavigationModalContainer"
|
|
3887
4372
|
})(["position:relative;background-color:", ";flex:1;", ""], function (_ref) {
|
|
3888
4373
|
var theme = _ref.theme,
|
|
@@ -3893,7 +4378,7 @@ var NavigationModalContainer = /*#__PURE__*/styled(View$1).withConfig({
|
|
|
3893
4378
|
return css(["min-height:100vh;"]);
|
|
3894
4379
|
});
|
|
3895
4380
|
|
|
3896
|
-
var ContainerWithoutHeader = /*#__PURE__*/styled(View$
|
|
4381
|
+
var ContainerWithoutHeader = /*#__PURE__*/styled(View$2).withConfig({
|
|
3897
4382
|
displayName: "NavigationModal__ContainerWithoutHeader"
|
|
3898
4383
|
})(["justify-content:space-between;flex:1;"]);
|
|
3899
4384
|
function NavigationModal(_ref) {
|
|
@@ -3903,10 +4388,10 @@ function NavigationModal(_ref) {
|
|
|
3903
4388
|
backgroundColor = _ref.backgroundColor;
|
|
3904
4389
|
return /*#__PURE__*/jsxs(NavigationModalContainer, {
|
|
3905
4390
|
$backgroundColor: backgroundColor,
|
|
3906
|
-
children: [header ? /*#__PURE__*/jsx(View$
|
|
4391
|
+
children: [header ? /*#__PURE__*/jsx(View$2, {
|
|
3907
4392
|
children: header
|
|
3908
4393
|
}) : null, /*#__PURE__*/jsxs(ContainerWithoutHeader, {
|
|
3909
|
-
children: [/*#__PURE__*/jsx(ScrollView$
|
|
4394
|
+
children: [/*#__PURE__*/jsx(ScrollView$2, {
|
|
3910
4395
|
bounces: false,
|
|
3911
4396
|
contentContainerStyle: {
|
|
3912
4397
|
flexGrow: 1,
|
|
@@ -4186,7 +4671,7 @@ function Picker(_ref) {
|
|
|
4186
4671
|
color: item.props.value === value ? theme.picker.ios.selected.color : undefined
|
|
4187
4672
|
});
|
|
4188
4673
|
})
|
|
4189
|
-
}) : /*#__PURE__*/jsx(ScrollView$
|
|
4674
|
+
}) : /*#__PURE__*/jsx(ScrollView$2, {
|
|
4190
4675
|
testID: testID,
|
|
4191
4676
|
children: React.Children.map(children, function (child) {
|
|
4192
4677
|
var item = child;
|
|
@@ -4274,7 +4759,7 @@ function SkeletonContent(_ref3) {
|
|
|
4274
4759
|
});
|
|
4275
4760
|
}
|
|
4276
4761
|
|
|
4277
|
-
var SkeletonContainer = /*#__PURE__*/styled(View$
|
|
4762
|
+
var SkeletonContainer = /*#__PURE__*/styled(View$2).withConfig({
|
|
4278
4763
|
displayName: "Skeleton__SkeletonContainer"
|
|
4279
4764
|
})(["overflow:hidden;"]);
|
|
4280
4765
|
function Skeleton(_ref) {
|
|
@@ -4778,7 +5263,7 @@ function ModalDateTimePicker(_ref2) {
|
|
|
4778
5263
|
}) : null, /*#__PURE__*/jsx(Modal.Body, {
|
|
4779
5264
|
children: /*#__PURE__*/jsx(DateTimePicker, {
|
|
4780
5265
|
is24Hour: true,
|
|
4781
|
-
testID: "
|
|
5266
|
+
testID: "timePicker.ModalDateTimePicker.dateTimeNativePicker",
|
|
4782
5267
|
value: currentValue,
|
|
4783
5268
|
mode: "time",
|
|
4784
5269
|
display: Platform.OS === 'ios' ? 'spinner' : 'default',
|
|
@@ -4885,7 +5370,7 @@ function TimePicker(_ref) {
|
|
|
4885
5370
|
children: displayedValue
|
|
4886
5371
|
}), Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsx(DateTimePicker, {
|
|
4887
5372
|
is24Hour: true,
|
|
4888
|
-
testID: "
|
|
5373
|
+
testID: "timePicker.TimePicker.dateTimeNativePicker",
|
|
4889
5374
|
value: dateTimePickerValue,
|
|
4890
5375
|
mode: "time",
|
|
4891
5376
|
display: "default",
|
|
@@ -4924,7 +5409,7 @@ var StyledTooltipContent = /*#__PURE__*/styled.View.withConfig({
|
|
|
4924
5409
|
|
|
4925
5410
|
function ArrowView(props) {
|
|
4926
5411
|
var theme = /*#__PURE__*/useTheme();
|
|
4927
|
-
return /*#__PURE__*/jsx(View$
|
|
5412
|
+
return /*#__PURE__*/jsx(View$2, _objectSpread(_objectSpread({}, props), {}, {
|
|
4928
5413
|
children: /*#__PURE__*/jsx(TooltipArrowIcon, {
|
|
4929
5414
|
color: theme.kitt.tooltip.backgroundColor
|
|
4930
5415
|
})
|
|
@@ -5030,16 +5515,16 @@ function Tooltip(_ref) {
|
|
|
5030
5515
|
});
|
|
5031
5516
|
}, [x, y, reference, floating, update, refs, middlewareData, onUpdate]);
|
|
5032
5517
|
return /*#__PURE__*/jsxs(TooltipContainer, {
|
|
5033
|
-
children: [/*#__PURE__*/jsx(View$
|
|
5518
|
+
children: [/*#__PURE__*/jsx(View$2, {
|
|
5034
5519
|
ref: reference,
|
|
5035
|
-
children: /*#__PURE__*/jsx(Pressable$
|
|
5520
|
+
children: /*#__PURE__*/jsx(Pressable$2, {
|
|
5036
5521
|
accessibilityRole: "button",
|
|
5037
5522
|
onPress: function handlePress() {
|
|
5038
5523
|
pressed.value = !pressed.value;
|
|
5039
5524
|
},
|
|
5040
5525
|
children: children
|
|
5041
5526
|
})
|
|
5042
|
-
}), /*#__PURE__*/jsx(View$
|
|
5527
|
+
}), /*#__PURE__*/jsx(View$2, {
|
|
5043
5528
|
ref: floating,
|
|
5044
5529
|
accessibilityElementsHidden: !pressed.value,
|
|
5045
5530
|
importantForAccessibility: pressed.value === true ? 'auto' : 'no-hide-descendants',
|
|
@@ -5263,5 +5748,5 @@ function MatchWindowSize(_ref) {
|
|
|
5263
5748
|
return children;
|
|
5264
5749
|
}
|
|
5265
5750
|
|
|
5266
|
-
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 };
|
|
5751
|
+
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 };
|
|
5267
5752
|
//# sourceMappingURL=index-browser-all.es.js.map
|