@ornikar/kitt-universal 9.4.0 → 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.
Files changed (34) hide show
  1. package/dist/definitions/Actions/Actions.d.ts +13 -0
  2. package/dist/definitions/Actions/Actions.d.ts.map +1 -0
  3. package/dist/definitions/Actions/ActionsButton.d.ts +9 -0
  4. package/dist/definitions/Actions/ActionsButton.d.ts.map +1 -0
  5. package/dist/definitions/Actions/ActionsItem.d.ts +12 -0
  6. package/dist/definitions/Actions/ActionsItem.d.ts.map +1 -0
  7. package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
  8. package/dist/definitions/IconButton/IconButton.d.ts +1 -1
  9. package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
  10. package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts +1 -1
  11. package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts.map +1 -1
  12. package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
  13. package/dist/definitions/index.d.ts +4 -0
  14. package/dist/definitions/index.d.ts.map +1 -1
  15. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +15 -15
  16. package/dist/definitions/story-components/StoryBlock.d.ts +1 -1
  17. package/dist/definitions/typography/TypographyLink.d.ts +1 -1
  18. package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
  19. package/dist/index-browser-all.es.android.js +598 -480
  20. package/dist/index-browser-all.es.android.js.map +1 -1
  21. package/dist/index-browser-all.es.ios.js +598 -480
  22. package/dist/index-browser-all.es.ios.js.map +1 -1
  23. package/dist/index-browser-all.es.js +598 -480
  24. package/dist/index-browser-all.es.js.map +1 -1
  25. package/dist/index-browser-all.es.web.js +627 -509
  26. package/dist/index-browser-all.es.web.js.map +1 -1
  27. package/dist/index-node-14.17.cjs.js +535 -456
  28. package/dist/index-node-14.17.cjs.js.map +1 -1
  29. package/dist/index-node-14.17.cjs.web.css +1 -1
  30. package/dist/index-node-14.17.cjs.web.js +464 -385
  31. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  32. package/dist/styles.css +1 -1
  33. package/dist/tsbuildinfo +1 -1
  34. 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 { UserIcon, CheckboxMark, XIcon, EyeOffIcon, EyeIcon, ArcIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
4
- export * from '@ornikar/kitt-icons';
5
- import { Platform, Image, StyleSheet, View as View$1, ScrollView as ScrollView$1, Linking, useWindowDimensions, Pressable as Pressable$2, Modal as Modal$1, Text as Text$2, TextInput, Animated as Animated$1, Easing } from 'react-native';
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, useState, Children, useMemo, useEffect, useRef, Fragment as Fragment$1 } 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, Pressable as Pressable$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 } from 'native-base';
12
- import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, useDerivedValue, withTiming, useAnimatedProps, withDelay, 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 defaultIconSize = 20;
28
- var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
29
- displayName: "Icon__IconContainer"
30
- })(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
31
- var $color = _ref.$color;
32
- return $color;
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 $size = _ref2.$size;
35
- return $size;
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 $size = _ref3.$size;
38
- return $size;
164
+ var $isStretch = _ref3.$isStretch;
165
+ return $isStretch ? '100%' : 'auto';
39
166
  }, function (_ref4) {
40
- var _ref4$$align = _ref4.$align,
41
- $align = _ref4$$align === void 0 ? 'auto' : _ref4$$align;
42
- return $align;
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,7 +249,7 @@ var KittBreakpointNameEnum;
115
249
  KittBreakpointNameEnum["WIDE"] = "wide";
116
250
  })(KittBreakpointNameEnum || (KittBreakpointNameEnum = {}));
117
251
 
118
- var _excluded$l = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
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() {
@@ -187,7 +321,7 @@ function Typography(_ref) {
187
321
  } : _ref$type,
188
322
  variant = _ref.variant,
189
323
  color = _ref.color,
190
- otherProps = _objectWithoutProperties(_ref, _excluded$l);
324
+ otherProps = _objectWithoutProperties(_ref, _excluded$n);
191
325
 
192
326
  var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
193
327
  var defaultColor = useTypographyDefaultColor();
@@ -286,262 +420,46 @@ Typography.h4 = createHeading(4, 'header4');
286
420
 
287
421
  Typography.h5 = createHeading(5, 'header5');
288
422
 
289
- var _excluded$k = ["size", "round", "light", "sizeVariant"];
290
-
291
- var getInitials = function (firstname, lastname) {
292
- return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
293
- };
294
-
295
- var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
296
- displayName: "Avatar__StyledAvatarView"
297
- })(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
298
- var theme = _ref.theme,
299
- $isRound = _ref.$isRound,
300
- $size = _ref.$size,
301
- $sizeVariant = _ref.$sizeVariant;
302
- if ($isRound) return "".concat($size / 2, "px");
303
- return "".concat($sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius, "px");
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;
304
429
  }, function (_ref2) {
305
- var theme = _ref2.theme,
306
- $isLight = _ref2.$isLight;
307
- return $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
430
+ var $size = _ref2.$size;
431
+ return $size;
308
432
  }, function (_ref3) {
309
433
  var $size = _ref3.$size;
310
434
  return $size;
311
435
  }, function (_ref4) {
312
- var $size = _ref4.$size;
313
- return $size;
436
+ var _ref4$$align = _ref4.$align,
437
+ $align = _ref4$$align === void 0 ? 'auto' : _ref4$$align;
438
+ return $align;
314
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
+ }
315
456
 
316
- function AvatarContent(_ref5) {
317
- var size = _ref5.size,
318
- src = _ref5.src,
319
- firstname = _ref5.firstname,
320
- lastname = _ref5.lastname,
321
- alt = _ref5.alt,
322
- isLight = _ref5.isLight,
323
- sizeVariant = _ref5.sizeVariant;
324
-
325
- if (src) {
326
- return /*#__PURE__*/jsx(Image, {
327
- source: {
328
- uri: src
329
- },
330
- style: {
331
- width: size,
332
- height: size
333
- },
334
- accessibilityLabel: alt
335
- });
336
- }
337
-
338
- if (firstname && lastname) {
339
- return /*#__PURE__*/jsx(Typography.Text, {
340
- base: sizeVariant === 'large' ? 'body-large' : 'body-small',
341
- variant: sizeVariant === 'large' ? 'bold' : 'regular',
342
- color: isLight ? 'black' : 'white',
343
- children: getInitials(firstname, lastname)
344
- });
345
- }
346
-
347
- return /*#__PURE__*/jsx(Icon, {
348
- icon: /*#__PURE__*/jsx(UserIcon, {}),
349
- color: isLight ? 'black' : 'white',
350
- size: size / 2
351
- });
352
- }
353
-
354
- function Avatar(_ref6) {
355
- var _ref6$size = _ref6.size,
356
- size = _ref6$size === void 0 ? 40 : _ref6$size,
357
- round = _ref6.round,
358
- light = _ref6.light,
359
- sizeVariant = _ref6.sizeVariant,
360
- props = _objectWithoutProperties(_ref6, _excluded$k);
361
-
362
- return /*#__PURE__*/jsx(StyledAvatarView, {
363
- $size: size,
364
- $isRound: round,
365
- $isLight: light,
366
- $sizeVariant: sizeVariant,
367
- children: /*#__PURE__*/jsx(AvatarContent, _objectSpread({
368
- size: size,
369
- isLight: light,
370
- sizeVariant: sizeVariant
371
- }, props))
372
- });
373
- }
374
-
375
- function warn(message) {
376
- if (process.env.NODE_ENV !== 'production') {
377
- console.warn(message);
378
- }
379
- }
380
- function deprecatedMessage(symbol, deprecation, replaceBy) {
381
- var replaceMessage = replaceBy === undefined ? '' : ", please use ".concat(replaceBy, " instead");
382
- warn("[Deprecation] in ".concat(symbol, ": ").concat(deprecation, " is deprecated").concat(replaceMessage, "."));
383
- }
384
- function deprecatedInComponent(component, deprecation, replaceBy) {
385
- deprecatedMessage("<".concat(component, " />"), deprecation, replaceBy);
386
- }
387
-
388
- var hasVariant = function (button, variant) {
389
- return variant in button;
390
- };
391
-
392
- function getVariantValuesIfExist(theme, type, variant) {
393
- var button = theme.kitt.button[type];
394
-
395
- if (hasVariant(button, variant)) {
396
- return button[variant];
397
- }
398
-
399
- return theme.kitt.button[type]["default"];
400
- }
401
-
402
- var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
403
- displayName: "AnimatedButtonPressable__StyledPressable"
404
- })(["", ""], function (_ref) {
405
- var $isStretch = _ref.$isStretch;
406
- if ($isStretch) return undefined;
407
- return 'align-self: flex-start;';
408
- });
409
- var StyledAnimatedView = /*#__PURE__*/styled(Animated.View).withConfig({
410
- displayName: "AnimatedButtonPressable__StyledAnimatedView"
411
- })(["border-radius:", "px;"], function (_ref2) {
412
- var theme = _ref2.theme;
413
- return theme.kitt.button.borderRadius;
414
- });
415
- var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
416
- var children = _ref3.children,
417
- disabled = _ref3.disabled,
418
- accessibilityRole = _ref3.accessibilityRole,
419
- $type = _ref3.$type,
420
- $variant = _ref3.$variant,
421
- $isStretch = _ref3.$isStretch,
422
- href = _ref3.href,
423
- hrefAttrs = _ref3.hrefAttrs,
424
- testID = _ref3.testID,
425
- onPress = _ref3.onPress;
426
- var theme = /*#__PURE__*/useTheme();
427
- var pressed = useSharedValue(0);
428
- var color = useSharedValue(0);
429
-
430
- var _getVariantValuesIfEx = getVariantValuesIfExist(theme, $type, $variant),
431
- backgroundColor = _getVariantValuesIfEx.backgroundColor,
432
- pressedBackgroundColor = _getVariantValuesIfEx.pressedBackgroundColor;
433
-
434
- var scale = theme.kitt.button.scale;
435
- var scaleStyles = useAnimatedStyle(function () {
436
- var _f = function () {
437
- return {
438
- backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
439
- transform: [{
440
- scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
441
- }]
442
- };
443
- };
444
-
445
- _f._closure = {
446
- interpolateColor: interpolateColor,
447
- color: color,
448
- backgroundColor: backgroundColor,
449
- pressedBackgroundColor: pressedBackgroundColor,
450
- withSpring: withSpring,
451
- pressed: pressed,
452
- scale: {
453
- base: {
454
- active: scale.base.active,
455
- "default": scale.base["default"]
456
- }
457
- }
458
- };
459
- _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)}]};}}";
460
- _f.__workletHash = 5368461229978;
461
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (56:41)";
462
- _f.__optimalization = 2;
463
- return _f;
464
- }());
465
-
466
- var handlePressInOut = function (pressIn) {
467
- color.value = withSpring(pressIn ? 1 : 0);
468
- pressed.value = pressIn ? 1 : 0;
469
- };
470
-
471
- return /*#__PURE__*/jsx(StyledPressable, {
472
- ref: ref,
473
- disabled: disabled,
474
- accessibilityRole: accessibilityRole,
475
- testID: testID,
476
- href: href,
477
- hrefAttrs: hrefAttrs,
478
- $isStretch: $isStretch,
479
- $type: $type,
480
- onPress: onPress,
481
- onPressIn: function onPressIn() {
482
- handlePressInOut(true);
483
- },
484
- onPressOut: function onPressOut() {
485
- handlePressInOut(false);
486
- },
487
- children: /*#__PURE__*/jsx(StyledAnimatedView, {
488
- style: disabled ? [{
489
- transform: [{
490
- scale: 1
491
- }]
492
- }] : [scaleStyles],
493
- children: children
494
- })
495
- });
496
- });
497
-
498
- var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
499
- displayName: "BaseStyledButtonPressable"
500
- })(["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) {
501
- var theme = _ref.theme;
502
- return theme.kitt.button.minWidth;
503
- }, function (_ref2) {
504
- var theme = _ref2.theme,
505
- $isStretch = _ref2.$isStretch;
506
- return $isStretch ? '100%' : "".concat(theme.kitt.button.maxWidth, "px");
507
- }, function (_ref3) {
508
- var $isStretch = _ref3.$isStretch;
509
- return $isStretch ? '100%' : 'auto';
510
- }, function (_ref4) {
511
- var theme = _ref4.theme;
512
- return theme.kitt.button.minHeight;
513
- }, function (_ref5) {
514
- var theme = _ref5.theme;
515
- return theme.kitt.button.borderRadius;
516
- }, function (_ref6) {
517
- var theme = _ref6.theme,
518
- $isDisabled = _ref6.$isDisabled,
519
- $type = _ref6.$type,
520
- $variant = _ref6.$variant;
521
- if ($isDisabled) return theme.kitt.button.disabled["default"].backgroundColor;
522
- if (Platform.OS !== 'web') return 'transparent';
523
- return getVariantValuesIfExist(theme, $type, $variant).backgroundColor;
524
- }, function (_ref7) {
525
- var theme = _ref7.theme,
526
- $size = _ref7.$size,
527
- $isDisabled = _ref7.$isDisabled;
528
- var _theme$kitt$button$co = theme.kitt.button.contentPadding,
529
- large = _theme$kitt$button$co.large,
530
- defaultPadding = _theme$kitt$button$co["default"],
531
- disabledPadding = _theme$kitt$button$co.disabled,
532
- xLarge = _theme$kitt$button$co.xLarge;
533
- if ($size === 'large') return large;
534
- if ($size === 'xlarge') return xLarge;
535
- if ($isDisabled) return disabledPadding;
536
- return defaultPadding;
537
- });
538
-
539
- var _excluded$j = ["color"],
540
- _excluded2$3 = ["color"];
457
+ var _excluded$m = ["color"],
458
+ _excluded2$3 = ["color"];
541
459
 
542
460
  function TypographyIconSpecifiedColor(_ref) {
543
461
  var color = _ref.color,
544
- props = _objectWithoutProperties(_ref, _excluded$j);
462
+ props = _objectWithoutProperties(_ref, _excluded$m);
545
463
 
546
464
  var theme = /*#__PURE__*/useTheme();
547
465
  return /*#__PURE__*/jsx(Icon, _objectSpread(_objectSpread({}, props), {}, {
@@ -573,7 +491,7 @@ function isSubtle(type) {
573
491
  return type.startsWith('subtle');
574
492
  }
575
493
 
576
- var _excluded$i = ["type", "variant", "isDisabled", "$isStretch", "icon", "children"];
494
+ var _excluded$l = ["type", "variant", "isDisabled", "$isStretch", "icon", "children"];
577
495
 
578
496
  var getTextColorByType = function (type, variant) {
579
497
  switch (type) {
@@ -678,7 +596,7 @@ function ButtonContentChildren(_ref4) {
678
596
  };
679
597
  return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
680
598
  children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
681
- testID: "button-left-icon",
599
+ testID: "button.ButtonContent.leftButtonIcon",
682
600
  icon: icon
683
601
  })) : null, /*#__PURE__*/jsx(StyledButtonText, {
684
602
  base: "body",
@@ -715,112 +633,391 @@ function ButtonContent(_ref7) {
715
633
  $isStretch = _ref7.$isStretch,
716
634
  icon = _ref7.icon,
717
635
  children = _ref7.children,
718
- props = _objectWithoutProperties(_ref7, _excluded$i);
636
+ props = _objectWithoutProperties(_ref7, _excluded$l);
637
+
638
+ var color = isDisabled ? 'black-light' : getTextColorByType(type, variant);
639
+ return /*#__PURE__*/jsx(ButtonContentContainer, {
640
+ $isSubtle: isSubtle(type),
641
+ $isStretch: $isStretch,
642
+ $isIconOnly: Boolean(!children && icon),
643
+ children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread(_objectSpread({
644
+ icon: icon,
645
+ type: type,
646
+ isDisabled: isDisabled,
647
+ color: color
648
+ }, props), {}, {
649
+ children: children
650
+ }))
651
+ });
652
+ }
653
+
654
+ var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
655
+ displayName: "StyledDisabled"
656
+ })(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", "px;"], function (_ref) {
657
+ var theme = _ref.theme;
658
+ var _theme$kitt$button = theme.kitt.button,
659
+ borderWidth = _theme$kitt$button.borderWidth,
660
+ disabled = _theme$kitt$button.disabled;
661
+ return "".concat(borderWidth.disabled, "px solid ").concat(disabled["default"].borderColor);
662
+ }, function (_ref2) {
663
+ var theme = _ref2.theme;
664
+ return theme.kitt.button.borderRadius;
665
+ });
666
+
667
+ var allowedGhostTypes = ['primary', 'default'];
668
+
669
+ var getButtonSize = function (_ref) {
670
+ var large = _ref.large,
671
+ xLarge = _ref.xLarge,
672
+ size = _ref.size;
673
+ if (large) return 'large';
674
+ if (xLarge) return 'xlarge';
675
+ return size;
676
+ };
677
+
678
+ var Button = /*#__PURE__*/forwardRef(function (_ref2, ref) {
679
+ var children = _ref2.children,
680
+ _ref2$type = _ref2.type,
681
+ type = _ref2$type === void 0 ? 'default' : _ref2$type,
682
+ _ref2$variant = _ref2.variant,
683
+ variant = _ref2$variant === void 0 ? 'default' : _ref2$variant,
684
+ disabled = _ref2.disabled,
685
+ stretch = _ref2.stretch,
686
+ large = _ref2.large,
687
+ xLarge = _ref2.xLarge,
688
+ icon = _ref2.icon,
689
+ sizeProp = _ref2.size,
690
+ _ref2$iconPosition = _ref2.iconPosition,
691
+ iconPosition = _ref2$iconPosition === void 0 ? 'left' : _ref2$iconPosition,
692
+ testID = _ref2.testID,
693
+ href = _ref2.href,
694
+ hrefAttrs = _ref2.hrefAttrs,
695
+ _ref2$accessibilityRo = _ref2.accessibilityRole,
696
+ accessibilityRole = _ref2$accessibilityRo === void 0 ? 'button' : _ref2$accessibilityRo,
697
+ onPress = _ref2.onPress;
698
+
699
+ if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && !allowedGhostTypes.includes(type)) {
700
+ throw new Error('variant=ghost is only allowed with type=primary or default');
701
+ }
702
+
703
+ if (large || xLarge) {
704
+ var deprecatedProp = large ? 'large' : 'xLarge';
705
+ deprecatedInComponent('Button', "".concat(deprecatedProp, " prop"), 'size');
706
+ }
707
+
708
+ var size = getButtonSize({
709
+ large: large,
710
+ xLarge: xLarge,
711
+ size: sizeProp
712
+ });
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
+ }));
719
893
 
720
- var color = isDisabled ? 'black-light' : getTextColorByType(type, variant);
721
- return /*#__PURE__*/jsx(ButtonContentContainer, {
722
- $isSubtle: isSubtle(type),
723
- $isStretch: $isStretch,
724
- $isIconOnly: Boolean(!children && icon),
725
- children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread(_objectSpread({
726
- icon: icon,
727
- type: type,
728
- isDisabled: isDisabled,
729
- color: color
730
- }, props), {}, {
731
- children: children
894
+ return function () {
895
+ return _ref2.apply(this, arguments);
896
+ };
897
+ }();
898
+
899
+ callPressAndUpdateLoadingState();
900
+ }
732
901
  }))
733
902
  });
734
903
  }
735
904
 
736
- var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
737
- displayName: "StyledDisabled"
738
- })(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", "px;"], function (_ref) {
739
- var theme = _ref.theme;
740
- var _theme$kitt$button = theme.kitt.button,
741
- borderWidth = _theme$kitt$button.borderWidth,
742
- disabled = _theme$kitt$button.disabled;
743
- return "".concat(borderWidth.disabled, "px solid ").concat(disabled["default"].borderColor);
744
- }, function (_ref2) {
745
- var theme = _ref2.theme;
746
- return theme.kitt.button.borderRadius;
747
- });
905
+ function ActionsButton(_ref) {
906
+ var props = _extends({}, _ref);
748
907
 
749
- var allowedGhostTypes = ['primary', 'default'];
908
+ return /*#__PURE__*/jsx(ActionsItem, _objectSpread({
909
+ as: Button
910
+ }, props));
911
+ }
750
912
 
751
- var getButtonSize = function (_ref) {
752
- var large = _ref.large,
753
- xLarge = _ref.xLarge,
754
- size = _ref.size;
755
- if (large) return 'large';
756
- if (xLarge) return 'xlarge';
757
- return size;
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();
758
940
  };
759
941
 
760
- var Button = /*#__PURE__*/forwardRef(function (_ref2, ref) {
761
- var children = _ref2.children,
762
- _ref2$type = _ref2.type,
763
- type = _ref2$type === void 0 ? 'default' : _ref2$type,
764
- _ref2$variant = _ref2.variant,
765
- variant = _ref2$variant === void 0 ? 'default' : _ref2$variant,
766
- disabled = _ref2.disabled,
767
- stretch = _ref2.stretch,
768
- large = _ref2.large,
769
- xLarge = _ref2.xLarge,
770
- icon = _ref2.icon,
771
- sizeProp = _ref2.size,
772
- _ref2$iconPosition = _ref2.iconPosition,
773
- iconPosition = _ref2$iconPosition === void 0 ? 'left' : _ref2$iconPosition,
774
- testID = _ref2.testID,
775
- href = _ref2.href,
776
- hrefAttrs = _ref2.hrefAttrs,
777
- _ref2$accessibilityRo = _ref2.accessibilityRole,
778
- accessibilityRole = _ref2$accessibilityRo === void 0 ? 'button' : _ref2$accessibilityRo,
779
- onPress = _ref2.onPress;
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
+ });
780
962
 
781
- if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && !allowedGhostTypes.includes(type)) {
782
- throw new Error('variant=ghost is only allowed with type=primary or default');
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
+ });
783
983
  }
784
984
 
785
- if (large || xLarge) {
786
- var deprecatedProp = large ? 'large' : 'xLarge';
787
- deprecatedInComponent('Button', "".concat(deprecatedProp, " prop"), 'size');
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
+ });
788
992
  }
789
993
 
790
- var size = getButtonSize({
791
- large: large,
792
- xLarge: xLarge,
793
- size: sizeProp
994
+ return /*#__PURE__*/jsx(Icon, {
995
+ icon: /*#__PURE__*/jsx(UserIcon, {}),
996
+ color: isLight ? 'black' : 'white',
997
+ size: size / 2
794
998
  });
795
- return /*#__PURE__*/jsx(AnimatedButtonPressable, {
796
- ref: ref,
797
- accessibilityRole: accessibilityRole,
798
- testID: testID,
799
- href: href,
800
- hrefAttrs: hrefAttrs,
801
- disabled: disabled,
802
- $isStretch: stretch,
803
- $type: type,
804
- $variant: variant,
805
- onPress: onPress,
806
- children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
807
- $type: type,
808
- $variant: variant,
809
- $isStretch: stretch,
810
- $size: size,
811
- $isDisabled: disabled,
812
- children: [/*#__PURE__*/jsx(ButtonContent, {
813
- type: type,
814
- variant: variant,
815
- $isStretch: stretch,
816
- isDisabled: disabled,
817
- icon: icon,
818
- iconPosition: iconPosition,
819
- children: children
820
- }), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
821
- })
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))
822
1019
  });
823
- });
1020
+ }
824
1021
 
825
1022
  var Container$5 = /*#__PURE__*/styled.View.withConfig({
826
1023
  displayName: "Card__Container"
@@ -869,7 +1066,7 @@ function getBorderRadius(defaultRadius, variant) {
869
1066
  return defaultRadius;
870
1067
  }
871
1068
 
872
- var DisabledBorder = /*#__PURE__*/styled(View$1).withConfig({
1069
+ var DisabledBorder = /*#__PURE__*/styled(View$2).withConfig({
873
1070
  displayName: "ChoiceItem__DisabledBorder"
874
1071
  })(["border-radius:", "px;", ";"], function (_ref2) {
875
1072
  var theme = _ref2.theme,
@@ -1017,7 +1214,7 @@ function ChoiceItem(_ref8) {
1017
1214
  onChange(value);
1018
1215
  };
1019
1216
 
1020
- return /*#__PURE__*/jsx(Pressable$1, {
1217
+ return /*#__PURE__*/jsx(Pressable, {
1021
1218
  disabled: disabled,
1022
1219
  accessibilityRole: type,
1023
1220
  accessibilityState: {
@@ -1064,7 +1261,7 @@ function ChoiceItem(_ref8) {
1064
1261
  });
1065
1262
  }
1066
1263
 
1067
- var ChoiceItemContainer = /*#__PURE__*/styled(View$1).withConfig({
1264
+ var ChoiceItemContainer = /*#__PURE__*/styled(View$2).withConfig({
1068
1265
  displayName: "ChoiceItemContainer"
1069
1266
  })(["", ""], function (_ref) {
1070
1267
  var theme = _ref.theme,
@@ -1088,12 +1285,12 @@ function ChoicesContainer(_ref) {
1088
1285
  props = _objectWithoutProperties(_ref, _excluded$h);
1089
1286
 
1090
1287
  if (direction === 'row') {
1091
- return /*#__PURE__*/jsx(ScrollView$1, _objectSpread({
1288
+ return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
1092
1289
  horizontal: true
1093
1290
  }, props));
1094
1291
  }
1095
1292
 
1096
- return /*#__PURE__*/jsx(View$1, _objectSpread({}, props));
1293
+ return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
1097
1294
  }
1098
1295
 
1099
1296
  function Choices(_ref2) {
@@ -2008,28 +2205,6 @@ var theme = {
2008
2205
  navigationModal: navigationModal
2009
2206
  };
2010
2207
 
2011
- function matchWindowSize(_ref, _ref2) {
2012
- var width = _ref.width,
2013
- height = _ref.height;
2014
- var minWidth = _ref2.minWidth,
2015
- maxWidth = _ref2.maxWidth,
2016
- minHeight = _ref2.minHeight,
2017
- maxHeight = _ref2.maxHeight;
2018
- var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
2019
- var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
2020
- return hasWidthMatched && hasHeightMatched;
2021
- }
2022
- function useMatchWindowSize(options) {
2023
- var _useWindowDimensions = useWindowDimensions(),
2024
- width = _useWindowDimensions.width,
2025
- height = _useWindowDimensions.height;
2026
-
2027
- return matchWindowSize({
2028
- width: width,
2029
- height: height
2030
- }, options);
2031
- }
2032
-
2033
2208
  function createWindowSizeHelper(dimensions) {
2034
2209
  return {
2035
2210
  matchWindowSize: function matchWindowSize$1(options) {
@@ -2381,7 +2556,7 @@ var BodyView = /*#__PURE__*/styled.View.withConfig({
2381
2556
  });
2382
2557
  function ModalBody(_ref3) {
2383
2558
  var children = _ref3.children;
2384
- return /*#__PURE__*/jsx(ScrollView$1, {
2559
+ return /*#__PURE__*/jsx(ScrollView$2, {
2385
2560
  children: /*#__PURE__*/jsx(BodyView, {
2386
2561
  children: children
2387
2562
  })
@@ -3149,7 +3324,7 @@ var getTypographyColor = function (type) {
3149
3324
  return type ? 'white' : 'black';
3150
3325
  };
3151
3326
 
3152
- var InputTagContainer = /*#__PURE__*/styled(View$1).withConfig({
3327
+ var InputTagContainer = /*#__PURE__*/styled(View$2).withConfig({
3153
3328
  displayName: "InputTag__InputTagContainer"
3154
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) {
3155
3330
  var theme = _ref.theme;
@@ -3171,7 +3346,7 @@ var InputTagContainer = /*#__PURE__*/styled(View$1).withConfig({
3171
3346
  var theme = _ref3.theme;
3172
3347
  return theme.kitt.forms.inputTag.borderRadius;
3173
3348
  });
3174
- var IconContainer = /*#__PURE__*/styled(View$1).withConfig({
3349
+ var IconContainer = /*#__PURE__*/styled(View$2).withConfig({
3175
3350
  displayName: "InputTag__IconContainer"
3176
3351
  })(["margin-right:", "px;"], function (_ref4) {
3177
3352
  var theme = _ref4.theme;
@@ -3471,47 +3646,6 @@ function FullScreenModal(_ref2) {
3471
3646
  FullScreenModal.Header = FullScreenModalHeader;
3472
3647
  FullScreenModal.Body = FullScreenModalBody;
3473
3648
 
3474
- function SpinningIcon(_ref) {
3475
- var icon = _ref.icon,
3476
- color = _ref.color;
3477
-
3478
- if (process.env.NODE_ENV !== 'production' && !color) {
3479
- throw new Error("Invalid color passed to SpinningIcon: ".concat(String(color)));
3480
- }
3481
-
3482
- var clonedIcon = /*#__PURE__*/cloneElement(icon, {
3483
- color: color
3484
- });
3485
- var animationRef = useRef(new Animated$1.Value(0));
3486
- var rotation = animationRef.current.interpolate({
3487
- inputRange: [0, 1],
3488
- outputRange: ['0deg', '360deg']
3489
- });
3490
- useEffect(function () {
3491
- if (process.env.NODE_ENV === 'test') return undefined;
3492
- var animation = Animated$1.loop(Animated$1.timing(animationRef.current, {
3493
- toValue: 1,
3494
- duration: 1100,
3495
- easing: Easing.linear,
3496
- useNativeDriver: true
3497
- }));
3498
- animation.start();
3499
- return function () {
3500
- if (process.env.NODE_ENV === 'test') return undefined;
3501
- animation.stop();
3502
- return undefined;
3503
- };
3504
- }, []);
3505
- return /*#__PURE__*/jsx(Animated$1.View, {
3506
- style: {
3507
- transform: [{
3508
- rotate: rotation
3509
- }]
3510
- },
3511
- children: clonedIcon
3512
- });
3513
- }
3514
-
3515
3649
  var _excluded$7 = ["children"];
3516
3650
  var ContentView = /*#__PURE__*/styled.View.withConfig({
3517
3651
  displayName: "ListItemContent__ContentView"
@@ -3638,14 +3772,6 @@ ListItem.Content = ListItemContent;
3638
3772
  ListItem.SideContent = ListItemSideContent;
3639
3773
  ListItem.SideContainer = ListItemSideContainer;
3640
3774
 
3641
- function LoaderIcon(_ref) {
3642
- var color = _ref.color;
3643
- return /*#__PURE__*/jsx(SpinningIcon, {
3644
- color: color,
3645
- icon: /*#__PURE__*/jsx(ArcIcon, {})
3646
- });
3647
- }
3648
-
3649
3775
  function IconContent(_ref) {
3650
3776
  var type = _ref.type,
3651
3777
  color = _ref.color;
@@ -3831,7 +3957,7 @@ function CloseButton(_ref) {
3831
3957
  });
3832
3958
  }
3833
3959
 
3834
- var ModalBehaviourContainer = /*#__PURE__*/styled(View$1).withConfig({
3960
+ var ModalBehaviourContainer = /*#__PURE__*/styled(View$2).withConfig({
3835
3961
  displayName: "ModalBehaviour__ModalBehaviourContainer"
3836
3962
  })(["", ""], function () {
3837
3963
  if (Platform.OS !== 'web') return undefined;
@@ -3998,16 +4124,8 @@ function KittNativeBaseProvider(_ref) {
3998
4124
  });
3999
4125
  }
4000
4126
 
4001
- var Stack = Stack$1;
4002
- var VStack = VStack$1;
4003
- var HStack = HStack$1;
4004
-
4005
- var View = View$2;
4006
- var ScrollView = ScrollView$2;
4007
- var Pressable = Pressable$1;
4008
-
4009
4127
  var _excluded$4 = ["children"];
4010
- var ViewWithPadding = /*#__PURE__*/styled(View$1).withConfig({
4128
+ var ViewWithPadding = /*#__PURE__*/styled(View$2).withConfig({
4011
4129
  displayName: "ContentPadding__ViewWithPadding"
4012
4130
  })(["padding:", ";"], function (_ref) {
4013
4131
  var theme = _ref.theme;
@@ -4113,7 +4231,7 @@ var HeaderContainer = /*#__PURE__*/styled(ContentPadding).withConfig({
4113
4231
  return theme.kitt.colors.separator;
4114
4232
  });
4115
4233
  });
4116
- var Row = /*#__PURE__*/styled(View$1).withConfig({
4234
+ var Row = /*#__PURE__*/styled(View$2).withConfig({
4117
4235
  displayName: "Header__Row"
4118
4236
  })(["flex-direction:row;justify-content:", ";align-items:center;"], function (_ref7) {
4119
4237
  var $hasContent = _ref7.$hasContent,
@@ -4126,7 +4244,7 @@ var ButtonContainer = /*#__PURE__*/styled.View.withConfig({
4126
4244
  var theme = _ref8.theme;
4127
4245
  return theme.kitt.iconButton.width;
4128
4246
  });
4129
- var ChildrenComponent = /*#__PURE__*/styled(View$1).withConfig({
4247
+ var ChildrenComponent = /*#__PURE__*/styled(View$2).withConfig({
4130
4248
  displayName: "Header__ChildrenComponent"
4131
4249
  })(["flex:1;align-items:center;", ";"], function (_ref9) {
4132
4250
  var theme = _ref9.theme,
@@ -4185,7 +4303,7 @@ function Header(_ref12) {
4185
4303
  });
4186
4304
  }
4187
4305
 
4188
- var NavigationModalContainer = /*#__PURE__*/styled(View$1).withConfig({
4306
+ var NavigationModalContainer = /*#__PURE__*/styled(View$2).withConfig({
4189
4307
  displayName: "NavigationModalContainer"
4190
4308
  })(["position:relative;background-color:", ";flex:1;", ""], function (_ref) {
4191
4309
  var theme = _ref.theme,
@@ -4196,7 +4314,7 @@ var NavigationModalContainer = /*#__PURE__*/styled(View$1).withConfig({
4196
4314
  return css(["min-height:100vh;"]);
4197
4315
  });
4198
4316
 
4199
- var ContainerWithoutHeader = /*#__PURE__*/styled(View$1).withConfig({
4317
+ var ContainerWithoutHeader = /*#__PURE__*/styled(View$2).withConfig({
4200
4318
  displayName: "NavigationModal__ContainerWithoutHeader"
4201
4319
  })(["justify-content:space-between;flex:1;"]);
4202
4320
  function NavigationModal(_ref) {
@@ -4206,10 +4324,10 @@ function NavigationModal(_ref) {
4206
4324
  backgroundColor = _ref.backgroundColor;
4207
4325
  return /*#__PURE__*/jsxs(NavigationModalContainer, {
4208
4326
  $backgroundColor: backgroundColor,
4209
- children: [header ? /*#__PURE__*/jsx(View$1, {
4327
+ children: [header ? /*#__PURE__*/jsx(View$2, {
4210
4328
  children: header
4211
4329
  }) : null, /*#__PURE__*/jsxs(ContainerWithoutHeader, {
4212
- children: [/*#__PURE__*/jsx(ScrollView$1, {
4330
+ children: [/*#__PURE__*/jsx(ScrollView$2, {
4213
4331
  bounces: false,
4214
4332
  contentContainerStyle: {
4215
4333
  flexGrow: 1,
@@ -4489,7 +4607,7 @@ function Picker(_ref) {
4489
4607
  color: item.props.value === value ? theme.picker.ios.selected.color : undefined
4490
4608
  });
4491
4609
  })
4492
- }) : /*#__PURE__*/jsx(ScrollView$1, {
4610
+ }) : /*#__PURE__*/jsx(ScrollView$2, {
4493
4611
  testID: testID,
4494
4612
  children: React.Children.map(children, function (child) {
4495
4613
  var item = child;
@@ -4577,7 +4695,7 @@ function SkeletonContent(_ref3) {
4577
4695
  });
4578
4696
  }
4579
4697
 
4580
- var SkeletonContainer = /*#__PURE__*/styled(View$1).withConfig({
4698
+ var SkeletonContainer = /*#__PURE__*/styled(View$2).withConfig({
4581
4699
  displayName: "Skeleton__SkeletonContainer"
4582
4700
  })(["overflow:hidden;"]);
4583
4701
  function Skeleton(_ref) {
@@ -5081,7 +5199,7 @@ function ModalDateTimePicker(_ref2) {
5081
5199
  }) : null, /*#__PURE__*/jsx(Modal.Body, {
5082
5200
  children: /*#__PURE__*/jsx(DateTimePicker, {
5083
5201
  is24Hour: true,
5084
- testID: "date-picker-native-element",
5202
+ testID: "timePicker.ModalDateTimePicker.dateTimeNativePicker",
5085
5203
  value: currentValue,
5086
5204
  mode: "time",
5087
5205
  display: Platform.OS === 'ios' ? 'spinner' : 'default',
@@ -5188,7 +5306,7 @@ function TimePicker(_ref) {
5188
5306
  children: displayedValue
5189
5307
  }), Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsx(DateTimePicker, {
5190
5308
  is24Hour: true,
5191
- testID: "date-picker-native-element",
5309
+ testID: "timePicker.TimePicker.dateTimeNativePicker",
5192
5310
  value: dateTimePickerValue,
5193
5311
  mode: "time",
5194
5312
  display: "default",
@@ -5227,7 +5345,7 @@ var StyledTooltipContent = /*#__PURE__*/styled.View.withConfig({
5227
5345
 
5228
5346
  function ArrowView(props) {
5229
5347
  var theme = /*#__PURE__*/useTheme();
5230
- return /*#__PURE__*/jsx(View$1, _objectSpread(_objectSpread({}, props), {}, {
5348
+ return /*#__PURE__*/jsx(View$2, _objectSpread(_objectSpread({}, props), {}, {
5231
5349
  children: /*#__PURE__*/jsx(TooltipArrowIcon, {
5232
5350
  color: theme.kitt.tooltip.backgroundColor
5233
5351
  })
@@ -5333,7 +5451,7 @@ function Tooltip(_ref) {
5333
5451
  });
5334
5452
  }, [x, y, reference, floating, update, refs, middlewareData, onUpdate]);
5335
5453
  return /*#__PURE__*/jsxs(TooltipContainer, {
5336
- children: [/*#__PURE__*/jsx(View$1, {
5454
+ children: [/*#__PURE__*/jsx(View$2, {
5337
5455
  ref: reference,
5338
5456
  children: /*#__PURE__*/jsx(Pressable$2, {
5339
5457
  accessibilityRole: "button",
@@ -5342,7 +5460,7 @@ function Tooltip(_ref) {
5342
5460
  },
5343
5461
  children: children
5344
5462
  })
5345
- }), /*#__PURE__*/jsx(View$1, {
5463
+ }), /*#__PURE__*/jsx(View$2, {
5346
5464
  ref: floating,
5347
5465
  accessibilityElementsHidden: !pressed.value,
5348
5466
  importantForAccessibility: pressed.value === true ? 'auto' : 'no-hide-descendants',
@@ -5575,5 +5693,5 @@ function withTheme(WrappedComponent) {
5575
5693
  });
5576
5694
  }
5577
5695
 
5578
- export { 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 };
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 };
5579
5697
  //# sourceMappingURL=index-browser-all.es.ios.js.map