@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,23 +1,23 @@
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
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 defaultIconSize = 20;
29
- var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
30
- displayName: "Icon__IconContainer"
31
- })(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
32
- var $color = _ref.$color;
33
- return $color;
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 $size = _ref2.$size;
36
- return $size;
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 $size = _ref3.$size;
39
- return $size;
165
+ var $isStretch = _ref3.$isStretch;
166
+ return $isStretch ? '100%' : 'auto';
40
167
  }, function (_ref4) {
41
- var _ref4$$align = _ref4.$align,
42
- $align = _ref4$$align === void 0 ? 'auto' : _ref4$$align;
43
- return $align;
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,7 +250,7 @@ var KittBreakpointNameEnum;
116
250
  KittBreakpointNameEnum["WIDE"] = "wide";
117
251
  })(KittBreakpointNameEnum || (KittBreakpointNameEnum = {}));
118
252
 
119
- var _excluded$l = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
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() {
@@ -188,7 +322,7 @@ function Typography(_ref) {
188
322
  } : _ref$type,
189
323
  variant = _ref.variant,
190
324
  color = _ref.color,
191
- otherProps = _objectWithoutProperties(_ref, _excluded$l);
325
+ otherProps = _objectWithoutProperties(_ref, _excluded$n);
192
326
 
193
327
  var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
194
328
  var defaultColor = useTypographyDefaultColor();
@@ -287,262 +421,46 @@ Typography.h4 = createHeading(4, 'header4');
287
421
 
288
422
  Typography.h5 = createHeading(5, 'header5');
289
423
 
290
- var _excluded$k = ["size", "round", "light", "sizeVariant"];
291
-
292
- var getInitials = function (firstname, lastname) {
293
- return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
294
- };
295
-
296
- var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
297
- displayName: "Avatar__StyledAvatarView"
298
- })(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
299
- var theme = _ref.theme,
300
- $isRound = _ref.$isRound,
301
- $size = _ref.$size,
302
- $sizeVariant = _ref.$sizeVariant;
303
- if ($isRound) return "".concat($size / 2, "px");
304
- return "".concat($sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius, "px");
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;
305
430
  }, function (_ref2) {
306
- var theme = _ref2.theme,
307
- $isLight = _ref2.$isLight;
308
- return $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
431
+ var $size = _ref2.$size;
432
+ return $size;
309
433
  }, function (_ref3) {
310
434
  var $size = _ref3.$size;
311
435
  return $size;
312
436
  }, function (_ref4) {
313
- var $size = _ref4.$size;
314
- return $size;
437
+ var _ref4$$align = _ref4.$align,
438
+ $align = _ref4$$align === void 0 ? 'auto' : _ref4$$align;
439
+ return $align;
315
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
+ }
316
457
 
317
- function AvatarContent(_ref5) {
318
- var size = _ref5.size,
319
- src = _ref5.src,
320
- firstname = _ref5.firstname,
321
- lastname = _ref5.lastname,
322
- alt = _ref5.alt,
323
- isLight = _ref5.isLight,
324
- sizeVariant = _ref5.sizeVariant;
325
-
326
- if (src) {
327
- return /*#__PURE__*/jsx(Image, {
328
- source: {
329
- uri: src
330
- },
331
- style: {
332
- width: size,
333
- height: size
334
- },
335
- accessibilityLabel: alt
336
- });
337
- }
338
-
339
- if (firstname && lastname) {
340
- return /*#__PURE__*/jsx(Typography.Text, {
341
- base: sizeVariant === 'large' ? 'body-large' : 'body-small',
342
- variant: sizeVariant === 'large' ? 'bold' : 'regular',
343
- color: isLight ? 'black' : 'white',
344
- children: getInitials(firstname, lastname)
345
- });
346
- }
347
-
348
- return /*#__PURE__*/jsx(Icon, {
349
- icon: /*#__PURE__*/jsx(UserIcon, {}),
350
- color: isLight ? 'black' : 'white',
351
- size: size / 2
352
- });
353
- }
354
-
355
- function Avatar(_ref6) {
356
- var _ref6$size = _ref6.size,
357
- size = _ref6$size === void 0 ? 40 : _ref6$size,
358
- round = _ref6.round,
359
- light = _ref6.light,
360
- sizeVariant = _ref6.sizeVariant,
361
- props = _objectWithoutProperties(_ref6, _excluded$k);
362
-
363
- return /*#__PURE__*/jsx(StyledAvatarView, {
364
- $size: size,
365
- $isRound: round,
366
- $isLight: light,
367
- $sizeVariant: sizeVariant,
368
- children: /*#__PURE__*/jsx(AvatarContent, _objectSpread({
369
- size: size,
370
- isLight: light,
371
- sizeVariant: sizeVariant
372
- }, props))
373
- });
374
- }
375
-
376
- function warn(message) {
377
- if (process.env.NODE_ENV !== 'production') {
378
- console.warn(message);
379
- }
380
- }
381
- function deprecatedMessage(symbol, deprecation, replaceBy) {
382
- var replaceMessage = replaceBy === undefined ? '' : ", please use ".concat(replaceBy, " instead");
383
- warn("[Deprecation] in ".concat(symbol, ": ").concat(deprecation, " is deprecated").concat(replaceMessage, "."));
384
- }
385
- function deprecatedInComponent(component, deprecation, replaceBy) {
386
- deprecatedMessage("<".concat(component, " />"), deprecation, replaceBy);
387
- }
388
-
389
- var hasVariant = function (button, variant) {
390
- return variant in button;
391
- };
392
-
393
- function getVariantValuesIfExist(theme, type, variant) {
394
- var button = theme.kitt.button[type];
395
-
396
- if (hasVariant(button, variant)) {
397
- return button[variant];
398
- }
399
-
400
- return theme.kitt.button[type]["default"];
401
- }
402
-
403
- var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
404
- displayName: "AnimatedButtonPressable__StyledPressable"
405
- })(["", ""], function (_ref) {
406
- var $isStretch = _ref.$isStretch;
407
- if ($isStretch) return undefined;
408
- return 'align-self: flex-start;';
409
- });
410
- var StyledAnimatedView = /*#__PURE__*/styled(Animated.View).withConfig({
411
- displayName: "AnimatedButtonPressable__StyledAnimatedView"
412
- })(["border-radius:", "px;"], function (_ref2) {
413
- var theme = _ref2.theme;
414
- return theme.kitt.button.borderRadius;
415
- });
416
- var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
417
- var children = _ref3.children,
418
- disabled = _ref3.disabled,
419
- accessibilityRole = _ref3.accessibilityRole,
420
- $type = _ref3.$type,
421
- $variant = _ref3.$variant,
422
- $isStretch = _ref3.$isStretch,
423
- href = _ref3.href,
424
- hrefAttrs = _ref3.hrefAttrs,
425
- testID = _ref3.testID,
426
- onPress = _ref3.onPress;
427
- var theme = /*#__PURE__*/useTheme();
428
- var pressed = useSharedValue(0);
429
- var color = useSharedValue(0);
430
-
431
- var _getVariantValuesIfEx = getVariantValuesIfExist(theme, $type, $variant),
432
- backgroundColor = _getVariantValuesIfEx.backgroundColor,
433
- pressedBackgroundColor = _getVariantValuesIfEx.pressedBackgroundColor;
434
-
435
- var scale = theme.kitt.button.scale;
436
- var scaleStyles = useAnimatedStyle(function () {
437
- var _f = function () {
438
- return {
439
- backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
440
- transform: [{
441
- scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
442
- }]
443
- };
444
- };
445
-
446
- _f._closure = {
447
- interpolateColor: interpolateColor,
448
- color: color,
449
- backgroundColor: backgroundColor,
450
- pressedBackgroundColor: pressedBackgroundColor,
451
- withSpring: withSpring,
452
- pressed: pressed,
453
- scale: {
454
- base: {
455
- active: scale.base.active,
456
- "default": scale.base["default"]
457
- }
458
- }
459
- };
460
- _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)}]};}}";
461
- _f.__workletHash = 5368461229978;
462
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (56:41)";
463
- _f.__optimalization = 2;
464
- return _f;
465
- }());
466
-
467
- var handlePressInOut = function (pressIn) {
468
- color.value = withSpring(pressIn ? 1 : 0);
469
- pressed.value = pressIn ? 1 : 0;
470
- };
471
-
472
- return /*#__PURE__*/jsx(StyledPressable, {
473
- ref: ref,
474
- disabled: disabled,
475
- accessibilityRole: accessibilityRole,
476
- testID: testID,
477
- href: href,
478
- hrefAttrs: hrefAttrs,
479
- $isStretch: $isStretch,
480
- $type: $type,
481
- onPress: onPress,
482
- onPressIn: function onPressIn() {
483
- handlePressInOut(true);
484
- },
485
- onPressOut: function onPressOut() {
486
- handlePressInOut(false);
487
- },
488
- children: /*#__PURE__*/jsx(StyledAnimatedView, {
489
- style: disabled ? [{
490
- transform: [{
491
- scale: 1
492
- }]
493
- }] : [scaleStyles],
494
- children: children
495
- })
496
- });
497
- });
498
-
499
- var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
500
- displayName: "BaseStyledButtonPressable"
501
- })(["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) {
502
- var theme = _ref.theme;
503
- return theme.kitt.button.minWidth;
504
- }, function (_ref2) {
505
- var theme = _ref2.theme,
506
- $isStretch = _ref2.$isStretch;
507
- return $isStretch ? '100%' : "".concat(theme.kitt.button.maxWidth, "px");
508
- }, function (_ref3) {
509
- var $isStretch = _ref3.$isStretch;
510
- return $isStretch ? '100%' : 'auto';
511
- }, function (_ref4) {
512
- var theme = _ref4.theme;
513
- return theme.kitt.button.minHeight;
514
- }, function (_ref5) {
515
- var theme = _ref5.theme;
516
- return theme.kitt.button.borderRadius;
517
- }, function (_ref6) {
518
- var theme = _ref6.theme,
519
- $isDisabled = _ref6.$isDisabled,
520
- $type = _ref6.$type,
521
- $variant = _ref6.$variant;
522
- if ($isDisabled) return theme.kitt.button.disabled["default"].backgroundColor;
523
- if (Platform.OS !== 'web') return 'transparent';
524
- return getVariantValuesIfExist(theme, $type, $variant).backgroundColor;
525
- }, function (_ref7) {
526
- var theme = _ref7.theme,
527
- $size = _ref7.$size,
528
- $isDisabled = _ref7.$isDisabled;
529
- var _theme$kitt$button$co = theme.kitt.button.contentPadding,
530
- large = _theme$kitt$button$co.large,
531
- defaultPadding = _theme$kitt$button$co["default"],
532
- disabledPadding = _theme$kitt$button$co.disabled,
533
- xLarge = _theme$kitt$button$co.xLarge;
534
- if ($size === 'large') return large;
535
- if ($size === 'xlarge') return xLarge;
536
- if ($isDisabled) return disabledPadding;
537
- return defaultPadding;
538
- });
539
-
540
- var _excluded$j = ["color"],
541
- _excluded2$3 = ["color"];
458
+ var _excluded$m = ["color"],
459
+ _excluded2$3 = ["color"];
542
460
 
543
461
  function TypographyIconSpecifiedColor(_ref) {
544
462
  var color = _ref.color,
545
- props = _objectWithoutProperties(_ref, _excluded$j);
463
+ props = _objectWithoutProperties(_ref, _excluded$m);
546
464
 
547
465
  var theme = /*#__PURE__*/useTheme();
548
466
  return /*#__PURE__*/jsx(Icon, _objectSpread(_objectSpread({}, props), {}, {
@@ -574,7 +492,7 @@ function isSubtle(type) {
574
492
  return type.startsWith('subtle');
575
493
  }
576
494
 
577
- var _excluded$i = ["type", "variant", "isDisabled", "$isStretch", "icon", "children"];
495
+ var _excluded$l = ["type", "variant", "isDisabled", "$isStretch", "icon", "children"];
578
496
 
579
497
  var getTextColorByType = function (type, variant) {
580
498
  switch (type) {
@@ -679,7 +597,7 @@ function ButtonContentChildren(_ref4) {
679
597
  };
680
598
  return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
681
599
  children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
682
- testID: "button-left-icon",
600
+ testID: "button.ButtonContent.leftButtonIcon",
683
601
  icon: icon
684
602
  })) : null, /*#__PURE__*/jsx(StyledButtonText, {
685
603
  base: "body",
@@ -716,112 +634,391 @@ function ButtonContent(_ref7) {
716
634
  $isStretch = _ref7.$isStretch,
717
635
  icon = _ref7.icon,
718
636
  children = _ref7.children,
719
- props = _objectWithoutProperties(_ref7, _excluded$i);
637
+ props = _objectWithoutProperties(_ref7, _excluded$l);
638
+
639
+ var color = isDisabled ? 'black-light' : getTextColorByType(type, variant);
640
+ return /*#__PURE__*/jsx(ButtonContentContainer, {
641
+ $isSubtle: isSubtle(type),
642
+ $isStretch: $isStretch,
643
+ $isIconOnly: Boolean(!children && icon),
644
+ children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread(_objectSpread({
645
+ icon: icon,
646
+ type: type,
647
+ isDisabled: isDisabled,
648
+ color: color
649
+ }, props), {}, {
650
+ children: children
651
+ }))
652
+ });
653
+ }
654
+
655
+ var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
656
+ displayName: "StyledDisabled"
657
+ })(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", "px;"], function (_ref) {
658
+ var theme = _ref.theme;
659
+ var _theme$kitt$button = theme.kitt.button,
660
+ borderWidth = _theme$kitt$button.borderWidth,
661
+ disabled = _theme$kitt$button.disabled;
662
+ return "".concat(borderWidth.disabled, "px solid ").concat(disabled["default"].borderColor);
663
+ }, function (_ref2) {
664
+ var theme = _ref2.theme;
665
+ return theme.kitt.button.borderRadius;
666
+ });
667
+
668
+ var allowedGhostTypes = ['primary', 'default'];
669
+
670
+ var getButtonSize = function (_ref) {
671
+ var large = _ref.large,
672
+ xLarge = _ref.xLarge,
673
+ size = _ref.size;
674
+ if (large) return 'large';
675
+ if (xLarge) return 'xlarge';
676
+ return size;
677
+ };
678
+
679
+ var Button = /*#__PURE__*/forwardRef(function (_ref2, ref) {
680
+ var children = _ref2.children,
681
+ _ref2$type = _ref2.type,
682
+ type = _ref2$type === void 0 ? 'default' : _ref2$type,
683
+ _ref2$variant = _ref2.variant,
684
+ variant = _ref2$variant === void 0 ? 'default' : _ref2$variant,
685
+ disabled = _ref2.disabled,
686
+ stretch = _ref2.stretch,
687
+ large = _ref2.large,
688
+ xLarge = _ref2.xLarge,
689
+ icon = _ref2.icon,
690
+ sizeProp = _ref2.size,
691
+ _ref2$iconPosition = _ref2.iconPosition,
692
+ iconPosition = _ref2$iconPosition === void 0 ? 'left' : _ref2$iconPosition,
693
+ testID = _ref2.testID,
694
+ href = _ref2.href,
695
+ hrefAttrs = _ref2.hrefAttrs,
696
+ _ref2$accessibilityRo = _ref2.accessibilityRole,
697
+ accessibilityRole = _ref2$accessibilityRo === void 0 ? 'button' : _ref2$accessibilityRo,
698
+ onPress = _ref2.onPress;
699
+
700
+ if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && !allowedGhostTypes.includes(type)) {
701
+ throw new Error('variant=ghost is only allowed with type=primary or default');
702
+ }
703
+
704
+ if (large || xLarge) {
705
+ var deprecatedProp = large ? 'large' : 'xLarge';
706
+ deprecatedInComponent('Button', "".concat(deprecatedProp, " prop"), 'size');
707
+ }
708
+
709
+ var size = getButtonSize({
710
+ large: large,
711
+ xLarge: xLarge,
712
+ size: sizeProp
713
+ });
714
+ return /*#__PURE__*/jsx(AnimatedButtonPressable, {
715
+ ref: ref,
716
+ accessibilityRole: accessibilityRole,
717
+ testID: testID,
718
+ href: href,
719
+ hrefAttrs: hrefAttrs,
720
+ disabled: disabled,
721
+ $isStretch: stretch,
722
+ $type: type,
723
+ $variant: variant,
724
+ onPress: onPress,
725
+ children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
726
+ $type: type,
727
+ $variant: variant,
728
+ $isStretch: stretch,
729
+ $size: size,
730
+ $isDisabled: disabled,
731
+ children: [/*#__PURE__*/jsx(ButtonContent, {
732
+ type: type,
733
+ variant: variant,
734
+ $isStretch: stretch,
735
+ isDisabled: disabled,
736
+ icon: icon,
737
+ iconPosition: iconPosition,
738
+ children: children
739
+ }), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
740
+ })
741
+ });
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
+ }));
720
894
 
721
- var color = isDisabled ? 'black-light' : getTextColorByType(type, variant);
722
- return /*#__PURE__*/jsx(ButtonContentContainer, {
723
- $isSubtle: isSubtle(type),
724
- $isStretch: $isStretch,
725
- $isIconOnly: Boolean(!children && icon),
726
- children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread(_objectSpread({
727
- icon: icon,
728
- type: type,
729
- isDisabled: isDisabled,
730
- color: color
731
- }, props), {}, {
732
- children: children
895
+ return function () {
896
+ return _ref2.apply(this, arguments);
897
+ };
898
+ }();
899
+
900
+ callPressAndUpdateLoadingState();
901
+ }
733
902
  }))
734
903
  });
735
904
  }
736
905
 
737
- var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
738
- displayName: "StyledDisabled"
739
- })(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", "px;"], function (_ref) {
740
- var theme = _ref.theme;
741
- var _theme$kitt$button = theme.kitt.button,
742
- borderWidth = _theme$kitt$button.borderWidth,
743
- disabled = _theme$kitt$button.disabled;
744
- return "".concat(borderWidth.disabled, "px solid ").concat(disabled["default"].borderColor);
745
- }, function (_ref2) {
746
- var theme = _ref2.theme;
747
- return theme.kitt.button.borderRadius;
748
- });
906
+ function ActionsButton(_ref) {
907
+ var props = _extends({}, _ref);
749
908
 
750
- var allowedGhostTypes = ['primary', 'default'];
909
+ return /*#__PURE__*/jsx(ActionsItem, _objectSpread({
910
+ as: Button
911
+ }, props));
912
+ }
751
913
 
752
- var getButtonSize = function (_ref) {
753
- var large = _ref.large,
754
- xLarge = _ref.xLarge,
755
- size = _ref.size;
756
- if (large) return 'large';
757
- if (xLarge) return 'xlarge';
758
- return size;
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();
759
941
  };
760
942
 
761
- var Button = /*#__PURE__*/forwardRef(function (_ref2, ref) {
762
- var children = _ref2.children,
763
- _ref2$type = _ref2.type,
764
- type = _ref2$type === void 0 ? 'default' : _ref2$type,
765
- _ref2$variant = _ref2.variant,
766
- variant = _ref2$variant === void 0 ? 'default' : _ref2$variant,
767
- disabled = _ref2.disabled,
768
- stretch = _ref2.stretch,
769
- large = _ref2.large,
770
- xLarge = _ref2.xLarge,
771
- icon = _ref2.icon,
772
- sizeProp = _ref2.size,
773
- _ref2$iconPosition = _ref2.iconPosition,
774
- iconPosition = _ref2$iconPosition === void 0 ? 'left' : _ref2$iconPosition,
775
- testID = _ref2.testID,
776
- href = _ref2.href,
777
- hrefAttrs = _ref2.hrefAttrs,
778
- _ref2$accessibilityRo = _ref2.accessibilityRole,
779
- accessibilityRole = _ref2$accessibilityRo === void 0 ? 'button' : _ref2$accessibilityRo,
780
- onPress = _ref2.onPress;
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
+ });
781
963
 
782
- if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && !allowedGhostTypes.includes(type)) {
783
- throw new Error('variant=ghost is only allowed with type=primary or default');
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
+ });
784
984
  }
785
985
 
786
- if (large || xLarge) {
787
- var deprecatedProp = large ? 'large' : 'xLarge';
788
- deprecatedInComponent('Button', "".concat(deprecatedProp, " prop"), 'size');
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
+ });
789
993
  }
790
994
 
791
- var size = getButtonSize({
792
- large: large,
793
- xLarge: xLarge,
794
- size: sizeProp
995
+ return /*#__PURE__*/jsx(Icon, {
996
+ icon: /*#__PURE__*/jsx(UserIcon, {}),
997
+ color: isLight ? 'black' : 'white',
998
+ size: size / 2
795
999
  });
796
- return /*#__PURE__*/jsx(AnimatedButtonPressable, {
797
- ref: ref,
798
- accessibilityRole: accessibilityRole,
799
- testID: testID,
800
- href: href,
801
- hrefAttrs: hrefAttrs,
802
- disabled: disabled,
803
- $isStretch: stretch,
804
- $type: type,
805
- $variant: variant,
806
- onPress: onPress,
807
- children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
808
- $type: type,
809
- $variant: variant,
810
- $isStretch: stretch,
811
- $size: size,
812
- $isDisabled: disabled,
813
- children: [/*#__PURE__*/jsx(ButtonContent, {
814
- type: type,
815
- variant: variant,
816
- $isStretch: stretch,
817
- isDisabled: disabled,
818
- icon: icon,
819
- iconPosition: iconPosition,
820
- children: children
821
- }), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
822
- })
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))
823
1020
  });
824
- });
1021
+ }
825
1022
 
826
1023
  var Container$5 = /*#__PURE__*/styled.View.withConfig({
827
1024
  displayName: "Card__Container"
@@ -870,7 +1067,7 @@ function getBorderRadius(defaultRadius, variant) {
870
1067
  return defaultRadius;
871
1068
  }
872
1069
 
873
- var DisabledBorder = /*#__PURE__*/styled(View$1).withConfig({
1070
+ var DisabledBorder = /*#__PURE__*/styled(View$2).withConfig({
874
1071
  displayName: "ChoiceItem__DisabledBorder"
875
1072
  })(["border-radius:", "px;", ";"], function (_ref2) {
876
1073
  var theme = _ref2.theme,
@@ -1018,7 +1215,7 @@ function ChoiceItem(_ref8) {
1018
1215
  onChange(value);
1019
1216
  };
1020
1217
 
1021
- return /*#__PURE__*/jsx(Pressable$1, {
1218
+ return /*#__PURE__*/jsx(Pressable, {
1022
1219
  disabled: disabled,
1023
1220
  accessibilityRole: type,
1024
1221
  accessibilityState: {
@@ -1065,7 +1262,7 @@ function ChoiceItem(_ref8) {
1065
1262
  });
1066
1263
  }
1067
1264
 
1068
- var ChoiceItemContainer = /*#__PURE__*/styled(View$1).withConfig({
1265
+ var ChoiceItemContainer = /*#__PURE__*/styled(View$2).withConfig({
1069
1266
  displayName: "ChoiceItemContainer"
1070
1267
  })(["", ""], function (_ref) {
1071
1268
  var theme = _ref.theme,
@@ -1089,12 +1286,12 @@ function ChoicesContainer(_ref) {
1089
1286
  props = _objectWithoutProperties(_ref, _excluded$h);
1090
1287
 
1091
1288
  if (direction === 'row') {
1092
- return /*#__PURE__*/jsx(ScrollView$1, _objectSpread({
1289
+ return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
1093
1290
  horizontal: true
1094
1291
  }, props));
1095
1292
  }
1096
1293
 
1097
- return /*#__PURE__*/jsx(View$1, _objectSpread({}, props));
1294
+ return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
1098
1295
  }
1099
1296
 
1100
1297
  function Choices(_ref2) {
@@ -2009,28 +2206,6 @@ var theme = {
2009
2206
  navigationModal: navigationModal
2010
2207
  };
2011
2208
 
2012
- function matchWindowSize(_ref, _ref2) {
2013
- var width = _ref.width,
2014
- height = _ref.height;
2015
- var minWidth = _ref2.minWidth,
2016
- maxWidth = _ref2.maxWidth,
2017
- minHeight = _ref2.minHeight,
2018
- maxHeight = _ref2.maxHeight;
2019
- var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
2020
- var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
2021
- return hasWidthMatched && hasHeightMatched;
2022
- }
2023
- function useMatchWindowSize(options) {
2024
- var _useWindowDimensions = useWindowDimensions(),
2025
- width = _useWindowDimensions.width,
2026
- height = _useWindowDimensions.height;
2027
-
2028
- return matchWindowSize({
2029
- width: width,
2030
- height: height
2031
- }, options);
2032
- }
2033
-
2034
2209
  function createWindowSizeHelper(dimensions) {
2035
2210
  return {
2036
2211
  matchWindowSize: function matchWindowSize$1(options) {
@@ -2382,7 +2557,7 @@ var BodyView = /*#__PURE__*/styled.View.withConfig({
2382
2557
  });
2383
2558
  function ModalBody(_ref3) {
2384
2559
  var children = _ref3.children;
2385
- return /*#__PURE__*/jsx(ScrollView$1, {
2560
+ return /*#__PURE__*/jsx(ScrollView$2, {
2386
2561
  children: /*#__PURE__*/jsx(BodyView, {
2387
2562
  children: children
2388
2563
  })
@@ -3202,7 +3377,7 @@ var getTypographyColor = function (type) {
3202
3377
  return type ? 'white' : 'black';
3203
3378
  };
3204
3379
 
3205
- var InputTagContainer = /*#__PURE__*/styled(View$1).withConfig({
3380
+ var InputTagContainer = /*#__PURE__*/styled(View$2).withConfig({
3206
3381
  displayName: "InputTag__InputTagContainer"
3207
3382
  })(["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) {
3208
3383
  var theme = _ref.theme;
@@ -3224,7 +3399,7 @@ var InputTagContainer = /*#__PURE__*/styled(View$1).withConfig({
3224
3399
  var theme = _ref3.theme;
3225
3400
  return theme.kitt.forms.inputTag.borderRadius;
3226
3401
  });
3227
- var IconContainer = /*#__PURE__*/styled(View$1).withConfig({
3402
+ var IconContainer = /*#__PURE__*/styled(View$2).withConfig({
3228
3403
  displayName: "InputTag__IconContainer"
3229
3404
  })(["margin-right:", "px;"], function (_ref4) {
3230
3405
  var theme = _ref4.theme;
@@ -3524,47 +3699,6 @@ function FullScreenModal(_ref2) {
3524
3699
  FullScreenModal.Header = FullScreenModalHeader;
3525
3700
  FullScreenModal.Body = FullScreenModalBody;
3526
3701
 
3527
- function SpinningIcon(_ref) {
3528
- var icon = _ref.icon,
3529
- color = _ref.color;
3530
-
3531
- if (process.env.NODE_ENV !== 'production' && !color) {
3532
- throw new Error("Invalid color passed to SpinningIcon: ".concat(String(color)));
3533
- }
3534
-
3535
- var clonedIcon = /*#__PURE__*/cloneElement(icon, {
3536
- color: color
3537
- });
3538
- var animationRef = useRef(new Animated$1.Value(0));
3539
- var rotation = animationRef.current.interpolate({
3540
- inputRange: [0, 1],
3541
- outputRange: ['0deg', '360deg']
3542
- });
3543
- useEffect(function () {
3544
- if (process.env.NODE_ENV === 'test') return undefined;
3545
- var animation = Animated$1.loop(Animated$1.timing(animationRef.current, {
3546
- toValue: 1,
3547
- duration: 1100,
3548
- easing: Easing.linear,
3549
- useNativeDriver: true
3550
- }));
3551
- animation.start();
3552
- return function () {
3553
- if (process.env.NODE_ENV === 'test') return undefined;
3554
- animation.stop();
3555
- return undefined;
3556
- };
3557
- }, []);
3558
- return /*#__PURE__*/jsx(Animated$1.View, {
3559
- style: {
3560
- transform: [{
3561
- rotate: rotation
3562
- }]
3563
- },
3564
- children: clonedIcon
3565
- });
3566
- }
3567
-
3568
3702
  var _excluded$7 = ["children"];
3569
3703
  var ContentView = /*#__PURE__*/styled.View.withConfig({
3570
3704
  displayName: "ListItemContent__ContentView"
@@ -3691,14 +3825,6 @@ ListItem.Content = ListItemContent;
3691
3825
  ListItem.SideContent = ListItemSideContent;
3692
3826
  ListItem.SideContainer = ListItemSideContainer;
3693
3827
 
3694
- function LoaderIcon(_ref) {
3695
- var color = _ref.color;
3696
- return /*#__PURE__*/jsx(SpinningIcon, {
3697
- color: color,
3698
- icon: /*#__PURE__*/jsx(ArcIcon, {})
3699
- });
3700
- }
3701
-
3702
3828
  function IconContent(_ref) {
3703
3829
  var type = _ref.type,
3704
3830
  color = _ref.color;
@@ -3884,7 +4010,7 @@ function CloseButton(_ref) {
3884
4010
  });
3885
4011
  }
3886
4012
 
3887
- var ModalBehaviourContainer = /*#__PURE__*/styled(View$1).withConfig({
4013
+ var ModalBehaviourContainer = /*#__PURE__*/styled(View$2).withConfig({
3888
4014
  displayName: "ModalBehaviour__ModalBehaviourContainer"
3889
4015
  })(["", ""], function () {
3890
4016
  if (Platform.OS !== 'web') return undefined;
@@ -4051,16 +4177,8 @@ function KittNativeBaseProvider(_ref) {
4051
4177
  });
4052
4178
  }
4053
4179
 
4054
- var Stack = Stack$1;
4055
- var VStack = VStack$1;
4056
- var HStack = HStack$1;
4057
-
4058
- var View = View$2;
4059
- var ScrollView = ScrollView$2;
4060
- var Pressable = Pressable$1;
4061
-
4062
4180
  var _excluded$4 = ["children"];
4063
- var ViewWithPadding = /*#__PURE__*/styled(View$1).withConfig({
4181
+ var ViewWithPadding = /*#__PURE__*/styled(View$2).withConfig({
4064
4182
  displayName: "ContentPadding__ViewWithPadding"
4065
4183
  })(["padding:", ";"], function (_ref) {
4066
4184
  var theme = _ref.theme;
@@ -4166,7 +4284,7 @@ var HeaderContainer = /*#__PURE__*/styled(ContentPadding).withConfig({
4166
4284
  return theme.kitt.colors.separator;
4167
4285
  });
4168
4286
  });
4169
- var Row = /*#__PURE__*/styled(View$1).withConfig({
4287
+ var Row = /*#__PURE__*/styled(View$2).withConfig({
4170
4288
  displayName: "Header__Row"
4171
4289
  })(["flex-direction:row;justify-content:", ";align-items:center;"], function (_ref7) {
4172
4290
  var $hasContent = _ref7.$hasContent,
@@ -4179,7 +4297,7 @@ var ButtonContainer = /*#__PURE__*/styled.View.withConfig({
4179
4297
  var theme = _ref8.theme;
4180
4298
  return theme.kitt.iconButton.width;
4181
4299
  });
4182
- var ChildrenComponent = /*#__PURE__*/styled(View$1).withConfig({
4300
+ var ChildrenComponent = /*#__PURE__*/styled(View$2).withConfig({
4183
4301
  displayName: "Header__ChildrenComponent"
4184
4302
  })(["flex:1;align-items:center;", ";"], function (_ref9) {
4185
4303
  var theme = _ref9.theme,
@@ -4238,7 +4356,7 @@ function Header(_ref12) {
4238
4356
  });
4239
4357
  }
4240
4358
 
4241
- var NavigationModalContainer = /*#__PURE__*/styled(View$1).withConfig({
4359
+ var NavigationModalContainer = /*#__PURE__*/styled(View$2).withConfig({
4242
4360
  displayName: "NavigationModalContainer"
4243
4361
  })(["position:relative;background-color:", ";flex:1;", ""], function (_ref) {
4244
4362
  var theme = _ref.theme,
@@ -4249,7 +4367,7 @@ var NavigationModalContainer = /*#__PURE__*/styled(View$1).withConfig({
4249
4367
  return css(["min-height:100vh;"]);
4250
4368
  });
4251
4369
 
4252
- var ContainerWithoutHeader = /*#__PURE__*/styled(View$1).withConfig({
4370
+ var ContainerWithoutHeader = /*#__PURE__*/styled(View$2).withConfig({
4253
4371
  displayName: "NavigationModal__ContainerWithoutHeader"
4254
4372
  })(["justify-content:space-between;flex:1;"]);
4255
4373
  function NavigationModal(_ref) {
@@ -4259,10 +4377,10 @@ function NavigationModal(_ref) {
4259
4377
  backgroundColor = _ref.backgroundColor;
4260
4378
  return /*#__PURE__*/jsxs(NavigationModalContainer, {
4261
4379
  $backgroundColor: backgroundColor,
4262
- children: [header ? /*#__PURE__*/jsx(View$1, {
4380
+ children: [header ? /*#__PURE__*/jsx(View$2, {
4263
4381
  children: header
4264
4382
  }) : null, /*#__PURE__*/jsxs(ContainerWithoutHeader, {
4265
- children: [/*#__PURE__*/jsx(ScrollView$1, {
4383
+ children: [/*#__PURE__*/jsx(ScrollView$2, {
4266
4384
  bounces: false,
4267
4385
  contentContainerStyle: {
4268
4386
  flexGrow: 1,
@@ -4542,7 +4660,7 @@ function Picker(_ref) {
4542
4660
  color: item.props.value === value ? theme.picker.ios.selected.color : undefined
4543
4661
  });
4544
4662
  })
4545
- }) : /*#__PURE__*/jsx(ScrollView$1, {
4663
+ }) : /*#__PURE__*/jsx(ScrollView$2, {
4546
4664
  testID: testID,
4547
4665
  children: React.Children.map(children, function (child) {
4548
4666
  var item = child;
@@ -4630,7 +4748,7 @@ function SkeletonContent(_ref3) {
4630
4748
  });
4631
4749
  }
4632
4750
 
4633
- var SkeletonContainer = /*#__PURE__*/styled(View$1).withConfig({
4751
+ var SkeletonContainer = /*#__PURE__*/styled(View$2).withConfig({
4634
4752
  displayName: "Skeleton__SkeletonContainer"
4635
4753
  })(["overflow:hidden;"]);
4636
4754
  function Skeleton(_ref) {
@@ -5134,7 +5252,7 @@ function ModalDateTimePicker(_ref2) {
5134
5252
  }) : null, /*#__PURE__*/jsx(Modal.Body, {
5135
5253
  children: /*#__PURE__*/jsx(DateTimePicker, {
5136
5254
  is24Hour: true,
5137
- testID: "date-picker-native-element",
5255
+ testID: "timePicker.ModalDateTimePicker.dateTimeNativePicker",
5138
5256
  value: currentValue,
5139
5257
  mode: "time",
5140
5258
  display: Platform.OS === 'ios' ? 'spinner' : 'default',
@@ -5241,7 +5359,7 @@ function TimePicker(_ref) {
5241
5359
  children: displayedValue
5242
5360
  }), Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsx(DateTimePicker, {
5243
5361
  is24Hour: true,
5244
- testID: "date-picker-native-element",
5362
+ testID: "timePicker.TimePicker.dateTimeNativePicker",
5245
5363
  value: dateTimePickerValue,
5246
5364
  mode: "time",
5247
5365
  display: "default",
@@ -5280,7 +5398,7 @@ var StyledTooltipContent = /*#__PURE__*/styled.View.withConfig({
5280
5398
 
5281
5399
  function ArrowView(props) {
5282
5400
  var theme = /*#__PURE__*/useTheme();
5283
- return /*#__PURE__*/jsx(View$1, _objectSpread(_objectSpread({}, props), {}, {
5401
+ return /*#__PURE__*/jsx(View$2, _objectSpread(_objectSpread({}, props), {}, {
5284
5402
  children: /*#__PURE__*/jsx(TooltipArrowIcon, {
5285
5403
  color: theme.kitt.tooltip.backgroundColor
5286
5404
  })
@@ -5386,7 +5504,7 @@ function Tooltip(_ref) {
5386
5504
  });
5387
5505
  }, [x, y, reference, floating, update, refs, middlewareData, onUpdate]);
5388
5506
  return /*#__PURE__*/jsxs(TooltipContainer, {
5389
- children: [/*#__PURE__*/jsx(View$1, {
5507
+ children: [/*#__PURE__*/jsx(View$2, {
5390
5508
  ref: reference,
5391
5509
  children: /*#__PURE__*/jsx(Pressable$2, {
5392
5510
  accessibilityRole: "button",
@@ -5395,7 +5513,7 @@ function Tooltip(_ref) {
5395
5513
  },
5396
5514
  children: children
5397
5515
  })
5398
- }), /*#__PURE__*/jsx(View$1, {
5516
+ }), /*#__PURE__*/jsx(View$2, {
5399
5517
  ref: floating,
5400
5518
  accessibilityElementsHidden: !pressed.value,
5401
5519
  importantForAccessibility: pressed.value === true ? 'auto' : 'no-hide-descendants',
@@ -5619,5 +5737,5 @@ function MatchWindowSize(_ref) {
5619
5737
  return children;
5620
5738
  }
5621
5739
 
5622
- 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 };
5740
+ 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 };
5623
5741
  //# sourceMappingURL=index-browser-all.es.js.map