@ornikar/kitt-universal 4.3.0 → 4.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 (58) hide show
  1. package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +1 -1
  2. package/dist/definitions/forms/Checkbox/Checkbox.d.ts +13 -0
  3. package/dist/definitions/forms/Checkbox/Checkbox.d.ts.map +1 -0
  4. package/dist/definitions/forms/DatePicker/DatePicker.d.ts +30 -0
  5. package/dist/definitions/forms/DatePicker/DatePicker.d.ts.map +1 -0
  6. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts +11 -0
  7. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +1 -0
  8. package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts +11 -0
  9. package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts.map +1 -0
  10. package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts +14 -0
  11. package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts.map +1 -0
  12. package/dist/definitions/forms/InputPhone/InputPhone.d.ts +7 -0
  13. package/dist/definitions/forms/InputPhone/InputPhone.d.ts.map +1 -0
  14. package/dist/definitions/forms/InputTag/InputTag.d.ts +10 -0
  15. package/dist/definitions/forms/InputTag/InputTag.d.ts.map +1 -0
  16. package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
  17. package/dist/definitions/index.d.ts +8 -0
  18. package/dist/definitions/index.d.ts.map +1 -1
  19. package/dist/definitions/themes/default.d.ts +14 -0
  20. package/dist/definitions/themes/default.d.ts.map +1 -1
  21. package/dist/definitions/themes/late-ocean/checkbox.d.ts +13 -0
  22. package/dist/definitions/themes/late-ocean/checkbox.d.ts.map +1 -0
  23. package/dist/definitions/themes/late-ocean/datePicker.d.ts +11 -0
  24. package/dist/definitions/themes/late-ocean/datePicker.d.ts.map +1 -0
  25. package/dist/definitions/themes/late-ocean/forms.d.ts +14 -0
  26. package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
  27. package/dist/definitions/themes/late-ocean/input.d.ts +1 -0
  28. package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
  29. package/dist/definitions/themes/late-ocean/inputTag.d.ts +14 -0
  30. package/dist/definitions/themes/late-ocean/inputTag.d.ts.map +1 -0
  31. package/dist/index-browser-all.es.android.js +2399 -1942
  32. package/dist/index-browser-all.es.android.js.map +1 -1
  33. package/dist/index-browser-all.es.ios.js +2399 -1942
  34. package/dist/index-browser-all.es.ios.js.map +1 -1
  35. package/dist/index-browser-all.es.js +2397 -1940
  36. package/dist/index-browser-all.es.js.map +1 -1
  37. package/dist/index-browser-all.es.web.js +2477 -2015
  38. package/dist/index-browser-all.es.web.js.map +1 -1
  39. package/dist/index-node-14.17.cjs.js +1992 -1562
  40. package/dist/index-node-14.17.cjs.js.map +1 -1
  41. package/dist/index-node-14.17.cjs.web.css +1 -1
  42. package/dist/index-node-14.17.cjs.web.js +1771 -1344
  43. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  44. package/dist/linaria-themes-browser-all.es.android.js +48 -2
  45. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  46. package/dist/linaria-themes-browser-all.es.ios.js +48 -2
  47. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  48. package/dist/linaria-themes-browser-all.es.js +48 -2
  49. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  50. package/dist/linaria-themes-browser-all.es.web.js +48 -2
  51. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  52. package/dist/linaria-themes-node-14.17.cjs.js +48 -2
  53. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  54. package/dist/linaria-themes-node-14.17.cjs.web.js +48 -2
  55. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  56. package/dist/styles.css +1 -1
  57. package/dist/tsbuildinfo +1 -1
  58. package/package.json +3 -3
@@ -1,22 +1,22 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
- import { UserIcon, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
3
+ import { UserIcon, CheckboxMark, XIcon, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
4
4
  export * from '@ornikar/kitt-icons';
5
- import { Animated, Easing, useWindowDimensions, Image, Platform, Linking, TextInput, Pressable, ActivityIndicator, View, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1 } from 'react-native';
5
+ import { Animated, Easing, useWindowDimensions, Image, Platform, Linking, View, Pressable, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1, TextInput, ActivityIndicator } from 'react-native';
6
6
  export { useWindowDimensions as useWindowSize } from 'react-native';
7
7
  import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
8
- import { useRef, useEffect, cloneElement, useContext, createContext, forwardRef, useMemo, useState, Fragment, Children } from 'react';
9
- import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
8
+ import { useRef, useEffect, cloneElement, useContext, createContext, forwardRef, useMemo, useState, Fragment as Fragment$1, Children } from 'react';
9
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
10
  import Animated$1, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, withRepeat, withTiming, Easing as Easing$1, interpolate } from 'react-native-reanimated';
11
11
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
12
12
  import { parse } from 'twemoji-parser';
13
13
  import { openBrowserAsync } from 'expo-web-browser';
14
+ import { FormattedMessage } from 'react-intl';
15
+ import { styled as styled$1 } from '@linaria/react';
16
+ import DateTimePicker from '@react-native-community/datetimepicker';
14
17
  import _extends from '@babel/runtime/helpers/extends';
15
18
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
16
- import { styled as styled$1 } from '@linaria/react';
17
19
  import { LinearGradient } from 'expo-linear-gradient';
18
- import DateTimePicker from '@react-native-community/datetimepicker';
19
- import { FormattedMessage } from 'react-intl';
20
20
  import { useFloating, offset, shift, flip } from '@floating-ui/react-native';
21
21
  import { makeDecorator } from '@storybook/addons';
22
22
 
@@ -52,7 +52,7 @@ function SpinningIcon(_ref) {
52
52
  });
53
53
  }
54
54
 
55
- var IconContainer = /*#__PURE__*/styled.View.withConfig({
55
+ var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
56
56
  displayName: "Icon__IconContainer"
57
57
  })(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
58
58
  var color = _ref.color;
@@ -78,7 +78,7 @@ function Icon(_ref5) {
78
78
  var clonedIcon = /*#__PURE__*/cloneElement(icon, {
79
79
  color: color
80
80
  });
81
- return /*#__PURE__*/jsx(IconContainer, {
81
+ return /*#__PURE__*/jsx(IconContainer$1, {
82
82
  align: align,
83
83
  size: size,
84
84
  color: color,
@@ -136,11 +136,11 @@ var KittBreakpointsMax = {
136
136
  LARGE: KittBreakpoints.WIDE - 1
137
137
  };
138
138
 
139
- var _excluded$e = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
139
+ var _excluded$f = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
140
140
 
141
- function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
141
+ function ownKeys$o(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
142
142
 
143
- function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
143
+ function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$o(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$o(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
144
144
  var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
145
145
  var TypographyColorContext = /*#__PURE__*/createContext('black');
146
146
  function useTypographyColor() {
@@ -216,7 +216,7 @@ function Typography(_ref4) {
216
216
  large = _ref4.large,
217
217
  variant = _ref4.variant,
218
218
  color = _ref4.color,
219
- otherProps = _objectWithoutProperties(_ref4, _excluded$e);
219
+ otherProps = _objectWithoutProperties(_ref4, _excluded$f);
220
220
 
221
221
  var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
222
222
  var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
@@ -233,14 +233,14 @@ function Typography(_ref4) {
233
233
  var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular';
234
234
  var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
235
235
  value: isHeader,
236
- children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$k({
236
+ children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$o({
237
237
  $color: colorOrDefaultToBlack,
238
238
  $isHeader: isHeader,
239
239
  $typeForCurrentWindowSize: typeForCurrentWindowSize,
240
240
  $variant: nonNullableVariant,
241
241
  accessibilityRole: accessibilityRole || undefined
242
242
  }, otherProps))
243
- }) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$k({
243
+ }) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$o({
244
244
  $color: colorOrDefaultToBlack,
245
245
  $isHeader: isHeader,
246
246
  $variant: nonNullableVariant,
@@ -253,13 +253,13 @@ function Typography(_ref4) {
253
253
  }
254
254
 
255
255
  function TypographyText(props) {
256
- return /*#__PURE__*/jsx(Typography, _objectSpread$k({
256
+ return /*#__PURE__*/jsx(Typography, _objectSpread$o({
257
257
  accessibilityRole: null
258
258
  }, props));
259
259
  }
260
260
 
261
261
  function TypographyParagraph(props) {
262
- return /*#__PURE__*/jsx(Typography, _objectSpread$k({
262
+ return /*#__PURE__*/jsx(Typography, _objectSpread$o({
263
263
  accessibilityRole: "paragraph"
264
264
  }, props));
265
265
  }
@@ -267,7 +267,7 @@ function TypographyParagraph(props) {
267
267
  var createHeading = function (level, defaultBase) {
268
268
  // https://github.com/necolas/react-native-web/issues/401
269
269
  function TypographyHeading(props) {
270
- return /*#__PURE__*/jsx(Typography, _objectSpread$k(_objectSpread$k({
270
+ return /*#__PURE__*/jsx(Typography, _objectSpread$o(_objectSpread$o({
271
271
  accessibilityRole: "header",
272
272
  base: defaultBase
273
273
  }, props), {}, {
@@ -303,11 +303,11 @@ Typography.h4 = createHeading(4, 'header4');
303
303
 
304
304
  Typography.h5 = createHeading(5, 'header5');
305
305
 
306
- var _excluded$d = ["size", "base", "round", "light"];
306
+ var _excluded$e = ["size", "base", "round", "light"];
307
307
 
308
- function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
308
+ function ownKeys$n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
309
309
 
310
- function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
310
+ function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
311
311
 
312
312
  var getInitials = function (firstname, lastname) {
313
313
  return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
@@ -378,13 +378,13 @@ function Avatar(_ref6) {
378
378
  base = _ref6$base === void 0 ? 'body-small' : _ref6$base,
379
379
  round = _ref6.round,
380
380
  light = _ref6.light,
381
- props = _objectWithoutProperties(_ref6, _excluded$d);
381
+ props = _objectWithoutProperties(_ref6, _excluded$e);
382
382
 
383
383
  return /*#__PURE__*/jsx(StyledAvatarView, {
384
384
  $size: size,
385
385
  $isRound: round,
386
386
  $isLight: light,
387
- children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$j({
387
+ children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$n({
388
388
  size: size,
389
389
  base: base,
390
390
  isLight: light
@@ -526,26 +526,26 @@ var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
526
526
  return defaultPadding;
527
527
  });
528
528
 
529
- var _excluded$c = ["color"],
529
+ var _excluded$d = ["color"],
530
530
  _excluded2$2 = ["color"];
531
531
 
532
- function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
532
+ function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
533
533
 
534
- function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
534
+ function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
535
535
 
536
536
  function TypographyIconSpecifiedColor(_ref) {
537
537
  var color = _ref.color,
538
- props = _objectWithoutProperties(_ref, _excluded$c);
538
+ props = _objectWithoutProperties(_ref, _excluded$d);
539
539
 
540
540
  var theme = /*#__PURE__*/useTheme();
541
- return /*#__PURE__*/jsx(Icon, _objectSpread$i(_objectSpread$i({}, props), {}, {
541
+ return /*#__PURE__*/jsx(Icon, _objectSpread$m(_objectSpread$m({}, props), {}, {
542
542
  color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
543
543
  }));
544
544
  }
545
545
 
546
546
  function TypographyIconInheritColor(props) {
547
547
  var color = useTypographyColor();
548
- return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$i({
548
+ return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$m({
549
549
  color: color
550
550
  }, props));
551
551
  }
@@ -555,23 +555,23 @@ function TypographyIcon(_ref2) {
555
555
  props = _objectWithoutProperties(_ref2, _excluded2$2);
556
556
 
557
557
  if (color) {
558
- return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$i({
558
+ return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$m({
559
559
  color: color
560
560
  }, props));
561
561
  }
562
562
 
563
- return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$i({}, props));
563
+ return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$m({}, props));
564
564
  }
565
565
 
566
566
  function isSubtle(type) {
567
567
  return type.startsWith('subtle');
568
568
  }
569
569
 
570
- var _excluded$b = ["type", "isDisabled", "$isStretch", "icon", "children"];
570
+ var _excluded$c = ["type", "isDisabled", "$isStretch", "icon", "children"];
571
571
 
572
- function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
572
+ function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
573
573
 
574
- function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
574
+ function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
575
575
 
576
576
  var getTextColorByType = function (type) {
577
577
  switch (type) {
@@ -677,7 +677,7 @@ function ButtonContentChildren(_ref4) {
677
677
  color: isWebSubtle ? 'inherit' : color
678
678
  };
679
679
  return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
680
- children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$h(_objectSpread$h({}, buttonIconSharedProps), {}, {
680
+ children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$l(_objectSpread$l({}, buttonIconSharedProps), {}, {
681
681
  testID: "button-left-icon",
682
682
  icon: icon
683
683
  })) : null, /*#__PURE__*/jsx(StyledButtonText, {
@@ -688,7 +688,7 @@ function ButtonContentChildren(_ref4) {
688
688
  ,
689
689
  color: isWebSubtle ? undefined : color,
690
690
  children: children
691
- }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$h(_objectSpread$h({}, buttonIconSharedProps), {}, {
691
+ }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$l(_objectSpread$l({}, buttonIconSharedProps), {}, {
692
692
  icon: icon
693
693
  })) : null]
694
694
  });
@@ -714,14 +714,14 @@ function ButtonContent(_ref7) {
714
714
  $isStretch = _ref7.$isStretch,
715
715
  icon = _ref7.icon,
716
716
  children = _ref7.children,
717
- props = _objectWithoutProperties(_ref7, _excluded$b);
717
+ props = _objectWithoutProperties(_ref7, _excluded$c);
718
718
 
719
719
  var color = isDisabled ? 'black-light' : getTextColorByType(type);
720
720
  return /*#__PURE__*/jsx(ButtonContentContainer, {
721
721
  $isSubtle: isSubtle(type),
722
722
  $isStretch: $isStretch,
723
723
  $isIconOnly: Boolean(!children && icon),
724
- children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$h(_objectSpread$h({
724
+ children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$l(_objectSpread$l({
725
725
  icon: icon,
726
726
  type: type,
727
727
  isDisabled: isDisabled,
@@ -858,20 +858,20 @@ var defaultOpenLinkBehavior = {
858
858
  web: 'targetBlank'
859
859
  };
860
860
 
861
- var _excluded$a = ["as", "href", "openLinkBehavior", "onPress"];
861
+ var _excluded$b = ["as", "href", "openLinkBehavior", "onPress"];
862
862
 
863
- function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
863
+ function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
864
864
 
865
- function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
865
+ function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
866
866
  function ExternalLink(_ref) {
867
867
  var Component = _ref.as,
868
868
  href = _ref.href,
869
869
  _ref$openLinkBehavior = _ref.openLinkBehavior,
870
870
  openLinkBehavior = _ref$openLinkBehavior === void 0 ? defaultOpenLinkBehavior : _ref$openLinkBehavior,
871
871
  onPress = _ref.onPress,
872
- rest = _objectWithoutProperties(_ref, _excluded$a);
872
+ rest = _objectWithoutProperties(_ref, _excluded$b);
873
873
 
874
- return /*#__PURE__*/jsx(Component, _objectSpread$g(_objectSpread$g({}, rest), {}, {
874
+ return /*#__PURE__*/jsx(Component, _objectSpread$k(_objectSpread$k({}, rest), {}, {
875
875
  onPress: function handleOnPress() {
876
876
  if (onPress) onPress();
877
877
  if (!href) return;
@@ -900,577 +900,828 @@ function ExternalLink(_ref) {
900
900
  }));
901
901
  }
902
902
 
903
- var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
904
- var theme = _ref.theme,
905
- $state = _ref.$state;
906
- return $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states["default"].backgroundColor;
907
- }, function (_ref2) {
908
- var theme = _ref2.theme;
909
- return theme.kitt.forms.input.borderWidth;
910
- }, function (_ref3) {
911
- var theme = _ref3.theme;
912
- return theme.kitt.forms.input.borderRadius;
913
- }, function (_ref4) {
914
- var theme = _ref4.theme,
915
- $state = _ref4.$state;
916
- return theme.kitt.forms.input.states[$state].borderColor;
917
- }, function (_ref5) {
918
- var theme = _ref5.theme;
919
- var typeConfigKey = getTypographyTypeConfigKey(theme);
920
- return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize, "px");
921
- }, function (_ref6) {
922
- var theme = _ref6.theme,
923
- $state = _ref6.$state;
924
- return theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color];
925
- }, function (_ref7) {
926
- var theme = _ref7.theme;
927
- return theme.kitt.typography.types.bodies.fontFamily.regular;
928
- });
903
+ var lateOceanColorPalette = {
904
+ lateOcean: '#4C34E0',
905
+ lateOceanLight1: '#705DE6',
906
+ lateOceanLight2: '#9485EC',
907
+ lateOceanLight3: '#D6BAF9',
908
+ warmEmbrace: '#F4D3CE',
909
+ warmEmbraceLight1: '#FFEDE6',
910
+ black1000: '#000000',
911
+ black800: '#2C293D',
912
+ black555: '#737373',
913
+ black200: '#CCCCCC',
914
+ black100: '#E5E5E5',
915
+ black50: '#F2F2F2',
916
+ black25: '#F9F9F9',
917
+ white: '#FFFFFF',
918
+ viride: '#38836D',
919
+ englishVermillon: '#D44148',
920
+ goldCrayola: '#F8C583',
921
+ aero: '#89BDDD',
922
+ transparent: 'transparent',
923
+ moonPurple: '#DBD6F9',
924
+ moonPurpleLight1: '#EDEBFC'
925
+ };
929
926
 
930
- function getInputUIState(_ref) {
931
- var isFocused = _ref.isFocused,
932
- isDisabled = _ref.isDisabled,
933
- formState = _ref.formState;
934
- if (isDisabled) return 'disabled';
935
- if (isFocused) return 'focus';
936
- if (formState === 'invalid') return 'invalid';
937
- return 'default';
938
- }
927
+ var colors = {
928
+ primary: lateOceanColorPalette.lateOcean,
929
+ primaryLight: lateOceanColorPalette.lateOceanLight1,
930
+ accent: lateOceanColorPalette.warmEmbrace,
931
+ accentLight: lateOceanColorPalette.warmEmbraceLight1,
932
+ success: lateOceanColorPalette.viride,
933
+ correct: lateOceanColorPalette.viride,
934
+ danger: lateOceanColorPalette.englishVermillon,
935
+ info: lateOceanColorPalette.aero,
936
+ warning: lateOceanColorPalette.goldCrayola,
937
+ separator: lateOceanColorPalette.black100,
938
+ hover: lateOceanColorPalette.black100,
939
+ black: lateOceanColorPalette.black1000,
940
+ uiBackground: lateOceanColorPalette.black25,
941
+ uiBackgroundLight: lateOceanColorPalette.white,
942
+ transparent: lateOceanColorPalette.transparent,
943
+ disabled: lateOceanColorPalette.black50,
944
+ overlay: {
945
+ dark: 'rgba(41, 48, 51, 0.25)',
946
+ light: 'rgba(255, 255, 255, 0.90)',
947
+ fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
948
+ }
949
+ };
939
950
 
940
- var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
941
- displayName: "InputTextContainer"
942
- })(["position:relative;"]);
951
+ var avatar = {
952
+ borderRadius: 10,
953
+ "default": {
954
+ backgroundColor: colors.primary
955
+ },
956
+ light: {
957
+ backgroundColor: lateOceanColorPalette.black100
958
+ }
959
+ };
960
+
961
+ var button = {
962
+ borderRadius: 30,
963
+ borderWidth: {
964
+ disabled: 2,
965
+ focus: 3
966
+ },
967
+ minHeight: 40,
968
+ minWidth: 40,
969
+ maxWidth: 335,
970
+ scale: {
971
+ base: {
972
+ "default": 1,
973
+ hover: 0.95,
974
+ active: 0.95
975
+ },
976
+ medium: {
977
+ hover: 1.05
978
+ }
979
+ },
980
+ contentPadding: {
981
+ "default": '8px 16px 7px',
982
+ large: '12px 24px 11px',
983
+ disabled: '6px 14px 5px'
984
+ },
985
+ transition: {
986
+ duration: '200ms',
987
+ timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
988
+ },
989
+ "default": {
990
+ backgroundColor: 'rgba(0, 0, 0, 0.05)',
991
+ pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
992
+ hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
993
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)'
994
+ },
995
+ primary: {
996
+ backgroundColor: colors.primary,
997
+ pressedBackgroundColor: colors.primaryLight,
998
+ hoverBackgroundColor: colors.primaryLight,
999
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)'
1000
+ },
1001
+ white: {
1002
+ backgroundColor: 'rgba(255, 255, 255, 0.05)',
1003
+ pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
1004
+ hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
1005
+ focusBorderColor: 'rgba(255, 255, 255, 0.1)'
1006
+ },
1007
+ subtle: {
1008
+ backgroundColor: colors.transparent,
1009
+ pressedBackgroundColor: colors.transparent,
1010
+ hoverBackgroundColor: colors.transparent,
1011
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)',
1012
+ color: colors.primary,
1013
+ hoverColor: 'rgba(76, 52, 224, 0.8)',
1014
+ activeColor: 'rgba(76, 52, 224, 0.8)'
1015
+ },
1016
+ 'subtle-dark': {
1017
+ backgroundColor: colors.transparent,
1018
+ pressedBackgroundColor: colors.transparent,
1019
+ hoverBackgroundColor: colors.transparent,
1020
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)',
1021
+ color: colors.black,
1022
+ hoverColor: 'rgba(0, 0, 0, 0.8)',
1023
+ activeColor: 'rgba(0, 0, 0, 0.8)'
1024
+ },
1025
+ disabled: {
1026
+ backgroundColor: colors.disabled,
1027
+ pressedBackgroundColor: colors.disabled,
1028
+ hoverBackgroundColor: colors.disabled,
1029
+ focusBorderColor: lateOceanColorPalette.black100,
1030
+ borderColor: lateOceanColorPalette.black100
1031
+ }
1032
+ };
943
1033
 
944
- var _excluded$9 = ["id", "right", "minHeight", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoCompleteType", "keyboardType", "onFocus", "onBlur"];
1034
+ var card = {
1035
+ borderRadius: 20,
1036
+ borderWidth: 2,
1037
+ primary: {
1038
+ backgroundColor: colors.uiBackgroundLight,
1039
+ borderColor: colors.primary
1040
+ },
1041
+ secondary: {
1042
+ backgroundColor: colors.uiBackgroundLight,
1043
+ borderColor: colors.separator
1044
+ },
1045
+ subtle: {
1046
+ backgroundColor: lateOceanColorPalette.black50,
1047
+ borderColor: colors.separator
1048
+ }
1049
+ };
945
1050
 
946
- function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1051
+ var feedbackMessage = {
1052
+ danger: {
1053
+ backgroundColor: colors.danger
1054
+ },
1055
+ success: {
1056
+ backgroundColor: colors.success
1057
+ },
1058
+ info: {
1059
+ backgroundColor: colors.info
1060
+ },
1061
+ warning: {
1062
+ backgroundColor: colors.warning
1063
+ }
1064
+ };
947
1065
 
948
- function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
949
- var StyledTextInput = /*#__PURE__*/styled(TextInput).withConfig({
950
- displayName: "InputText__StyledTextInput"
951
- })(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, function (_ref) {
952
- var theme = _ref.theme,
953
- multiline = _ref.multiline;
1066
+ var checkbox = {
1067
+ borderWidth: 2,
1068
+ borderRadius: 5,
1069
+ height: 20,
1070
+ width: 20,
1071
+ iconSize: 14,
1072
+ borderColor: colors.separator,
1073
+ backgroundColor: colors.uiBackgroundLight,
1074
+ checkedBorderColor: colors.primary,
1075
+ checkedBackgroundColor: colors.primary,
1076
+ markColor: colors.uiBackgroundLight
1077
+ };
954
1078
 
955
- if (!multiline && Platform.OS === 'ios') {
956
- return theme.kitt.forms.input.padding.iOSSingleLine;
1079
+ var datePicker = {
1080
+ day: {
1081
+ minWidth: 64
1082
+ },
1083
+ month: {
1084
+ minWidth: 64
1085
+ },
1086
+ year: {
1087
+ minWidth: 82
957
1088
  }
1089
+ };
958
1090
 
959
- return theme.kitt.forms.input.padding["default"];
960
- }, function (_ref2) {
961
- var theme = _ref2.theme,
962
- multiline = _ref2.multiline;
963
- if (!multiline && Platform.OS === 'ios') return 0;
964
- var typeConfigKey = getTypographyTypeConfigKey(theme);
965
- return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight, "px");
966
- }, function (_ref3) {
967
- var $minHeight = _ref3.$minHeight;
968
- return $minHeight;
969
- });
970
- var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
971
- displayName: "InputText__RightInputContainer"
972
- })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
973
- var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
974
- var id = _ref4.id,
975
- right = _ref4.right,
976
- _ref4$minHeight = _ref4.minHeight,
977
- minHeight = _ref4$minHeight === void 0 ? 0 : _ref4$minHeight,
978
- formState = _ref4.state,
979
- internalForceState = _ref4.internalForceState,
980
- _ref4$disabled = _ref4.disabled,
981
- disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
982
- _ref4$autoCorrect = _ref4.autoCorrect,
983
- autoCorrect = _ref4$autoCorrect === void 0 ? true : _ref4$autoCorrect,
984
- _ref4$textContentType = _ref4.textContentType,
985
- textContentType = _ref4$textContentType === void 0 ? 'none' : _ref4$textContentType,
986
- _ref4$autoCompleteTyp = _ref4.autoCompleteType,
987
- autoCompleteType = _ref4$autoCompleteTyp === void 0 ? 'off' : _ref4$autoCompleteTyp,
988
- _ref4$keyboardType = _ref4.keyboardType,
989
- keyboardType = _ref4$keyboardType === void 0 ? 'default' : _ref4$keyboardType,
990
- _onFocus = _ref4.onFocus,
991
- _onBlur = _ref4.onBlur,
992
- props = _objectWithoutProperties(_ref4, _excluded$9);
993
-
994
- var theme = /*#__PURE__*/useTheme();
995
-
996
- var _useState = useState(false),
997
- _useState2 = _slicedToArray(_useState, 2),
998
- isFocused = _useState2[0],
999
- setIsFocused = _useState2[1];
1000
-
1001
- var state = internalForceState || getInputUIState({
1002
- isFocused: isFocused,
1003
- isDisabled: disabled,
1004
- formState: formState
1005
- });
1006
- return /*#__PURE__*/jsxs(InputTextContainer, {
1007
- $isDisabled: disabled,
1008
- children: [/*#__PURE__*/jsx(StyledTextInput, _objectSpread$f(_objectSpread$f({
1009
- ref: ref,
1010
- nativeID: id,
1011
- editable: !disabled,
1012
- keyboardType: keyboardType,
1013
- autoCompleteType: autoCompleteType,
1014
- autoCorrect: autoCorrect,
1015
- $minHeight: minHeight,
1016
- textContentType: textContentType,
1017
- placeholderTextColor: theme.kitt.forms.input.color.placeholder,
1018
- selectionColor: theme.kitt.forms.input.color.selection
1019
- }, props), {}, {
1020
- $state: state,
1021
- onFocus: function onFocus(e) {
1022
- setIsFocused(true);
1023
- if (_onFocus) _onFocus(e);
1091
+ var calcLineHeight = function (fontSize, lineHeightMultiplier) {
1092
+ return Math.round(fontSize * lineHeightMultiplier);
1093
+ };
1094
+ var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
1095
+ return {
1096
+ baseAndSmall: {
1097
+ fontSize: baseAndSmallFontSize,
1098
+ lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
1099
+ },
1100
+ mediumAndWide: {
1101
+ fontSize: mediumAndWideFontSize,
1102
+ lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
1103
+ }
1104
+ };
1105
+ };
1106
+ var typography = {
1107
+ colors: {
1108
+ black: lateOceanColorPalette.black1000,
1109
+ 'black-anthracite': lateOceanColorPalette.black800,
1110
+ 'black-light': lateOceanColorPalette.black555,
1111
+ white: lateOceanColorPalette.white,
1112
+ 'white-light': lateOceanColorPalette.white,
1113
+ primary: lateOceanColorPalette.lateOcean,
1114
+ 'primary-light': lateOceanColorPalette.lateOceanLight1,
1115
+ accent: lateOceanColorPalette.warmEmbrace,
1116
+ success: lateOceanColorPalette.viride,
1117
+ danger: lateOceanColorPalette.englishVermillon
1118
+ },
1119
+ types: {
1120
+ headers: {
1121
+ fontFamily: {
1122
+ regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
1123
+ bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
1024
1124
  },
1025
- onBlur: function onBlur(e) {
1026
- setIsFocused(false);
1027
- if (_onBlur) _onBlur(e);
1125
+ fontWeight: 400,
1126
+ fontStyle: 'normal',
1127
+ configs: {
1128
+ // also known as xxlarge
1129
+ header1: createTypographyTypeConfig(1.3, 38, 62),
1130
+ // also known as xlarge
1131
+ header2: createTypographyTypeConfig(1.3, 32, 48),
1132
+ // also known as medium
1133
+ header3: createTypographyTypeConfig(1.3, 24, 36),
1134
+ // also known as xsmall
1135
+ header4: createTypographyTypeConfig(1.3, 18, 24),
1136
+ // also known as xxsmall
1137
+ header5: createTypographyTypeConfig(1.3, 18, 18)
1028
1138
  }
1029
- })), right ? /*#__PURE__*/jsx(RightInputContainer, {
1030
- children: right
1031
- }) : null]
1032
- });
1033
- });
1139
+ },
1140
+ bodies: {
1141
+ fontFamily: {
1142
+ regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
1143
+ bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
1144
+ },
1145
+ fontWeight: {
1146
+ regular: 400,
1147
+ bold: 700
1148
+ },
1149
+ fontStyle: {
1150
+ regular: 'normal',
1151
+ bold: 'normal'
1152
+ },
1153
+ configs: {
1154
+ 'body-large': createTypographyTypeConfig(1.6, 18, 24),
1155
+ 'body-medium': createTypographyTypeConfig(1.6, 18, 18),
1156
+ body: createTypographyTypeConfig(1.6, 16, 16),
1157
+ 'body-small': createTypographyTypeConfig(1.6, 14, 14),
1158
+ 'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
1159
+ }
1160
+ }
1161
+ },
1162
+ link: {
1163
+ disabledColor: lateOceanColorPalette.black200
1164
+ }
1165
+ };
1034
1166
 
1035
- function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1167
+ var inputStatesStyle = {
1168
+ "default": {
1169
+ backgroundColor: colors.uiBackgroundLight,
1170
+ borderColor: colors.separator,
1171
+ color: 'black'
1172
+ },
1173
+ pending: {
1174
+ backgroundColor: colors.uiBackgroundLight,
1175
+ borderColor: colors.separator,
1176
+ color: 'black'
1177
+ },
1178
+ valid: {
1179
+ backgroundColor: colors.uiBackgroundLight,
1180
+ borderColor: lateOceanColorPalette.black100,
1181
+ color: 'black'
1182
+ },
1183
+ hover: {
1184
+ borderColor: lateOceanColorPalette.black200,
1185
+ color: 'black'
1186
+ },
1187
+ focus: {
1188
+ borderColor: colors.primary,
1189
+ color: 'black'
1190
+ },
1191
+ disabled: {
1192
+ backgroundColor: colors.disabled,
1193
+ borderColor: colors.separator,
1194
+ color: 'black-light'
1195
+ },
1196
+ invalid: {
1197
+ borderColor: colors.separator,
1198
+ color: 'black'
1199
+ }
1200
+ };
1201
+ var input = {
1202
+ minHeight: 40,
1203
+ color: {
1204
+ selection: colors.primary,
1205
+ placeholder: typography.colors['black-light']
1206
+ },
1207
+ borderWidth: 2,
1208
+ borderRadius: 10,
1209
+ icon: {
1210
+ size: 20
1211
+ },
1212
+ padding: {
1213
+ "default": '5px 16px',
1214
+ iOSSingleLine: '7px 16px'
1215
+ },
1216
+ transition: {
1217
+ property: 'border-color',
1218
+ duration: '200ms',
1219
+ timingFunction: 'ease-in-out'
1220
+ },
1221
+ states: inputStatesStyle
1222
+ };
1036
1223
 
1037
- function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1038
- function InputEmail(props) {
1039
- return /*#__PURE__*/jsx(InputText, _objectSpread$e({
1040
- autoCompleteType: "email",
1041
- keyboardType: "email-address",
1042
- textContentType: "emailAddress"
1043
- }, props));
1044
- }
1224
+ var inputField = {
1225
+ labelContainerPaddingBottom: 5,
1226
+ iconMarginLeft: 6
1227
+ };
1045
1228
 
1046
- var getColorFromState = function (state) {
1047
- switch (state) {
1048
- case 'invalid':
1049
- return 'danger';
1229
+ var inputTag = {
1230
+ success: {
1231
+ backgroundColor: colors.success,
1232
+ labelColor: colors.uiBackgroundLight
1233
+ },
1234
+ danger: {
1235
+ backgroundColor: colors.danger,
1236
+ labelColor: colors.uiBackgroundLight
1237
+ },
1238
+ "default": {
1239
+ backgroundColor: lateOceanColorPalette.black50,
1240
+ labelColor: colors.black
1241
+ },
1242
+ borderRadius: 10,
1243
+ iconSize: 13.5
1244
+ };
1050
1245
 
1051
- case 'valid':
1052
- default:
1053
- return 'black-light';
1246
+ var radio = {
1247
+ size: 18,
1248
+ unchecked: {
1249
+ backgroundColor: colors.uiBackgroundLight,
1250
+ borderWidth: 2,
1251
+ borderColor: lateOceanColorPalette.black200
1252
+ },
1253
+ checked: {
1254
+ backgroundColor: colors.primary,
1255
+ innerSize: 5,
1256
+ innerBackgroundColor: colors.uiBackgroundLight
1257
+ },
1258
+ disabled: {
1259
+ backgroundColor: colors.disabled,
1260
+ borderColor: colors.separator
1054
1261
  }
1055
1262
  };
1056
1263
 
1057
- function InputFeedback(_ref) {
1058
- var state = _ref.state,
1059
- testID = _ref.testID,
1060
- children = _ref.children;
1061
- return /*#__PURE__*/jsx(Typography.Text, {
1062
- base: "body-small",
1063
- color: getColorFromState(state),
1064
- testID: testID,
1065
- children: children
1066
- });
1067
- }
1264
+ var textArea = {
1265
+ minHeight: 120
1266
+ };
1068
1267
 
1069
- var FieldContainer = /*#__PURE__*/styled.View.withConfig({
1070
- displayName: "InputField__FieldContainer"
1071
- })(["padding:5px 0 10px;"]);
1072
- var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
1073
- displayName: "InputField__FeedbackContainer"
1074
- })(["", ";"], function (_ref) {
1075
- var theme = _ref.theme;
1076
- return theme.responsive.ifWindowSizeMatches({
1077
- minWidth: KittBreakpoints.SMALL
1078
- }, 'padding-top: 10px', 'padding-top: 5px');
1079
- });
1080
- var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
1081
- displayName: "InputField__FieldLabelContainer"
1082
- })(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
1083
- var theme = _ref2.theme;
1084
- return theme.kitt.forms.inputField.labelContainerPaddingBottom;
1085
- });
1086
- var LabelContainer = /*#__PURE__*/styled.View.withConfig({
1087
- displayName: "InputField__LabelContainer"
1088
- })(["margin-right:", "px;"], function (_ref3) {
1089
- var theme = _ref3.theme;
1090
- return theme.kitt.forms.inputField.iconMarginLeft;
1091
- });
1092
- function InputField(_ref4) {
1093
- var label = _ref4.label,
1094
- labelFeedback = _ref4.labelFeedback,
1095
- input = _ref4.input,
1096
- feedback = _ref4.feedback;
1097
- return /*#__PURE__*/jsxs(FieldContainer, {
1098
- children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
1099
- children: [/*#__PURE__*/jsx(LabelContainer, {
1100
- children: label
1101
- }), labelFeedback]
1102
- }) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
1103
- children: feedback
1104
- }) : null]
1105
- });
1106
- }
1268
+ var forms = {
1269
+ datePicker: datePicker,
1270
+ input: input,
1271
+ radio: radio,
1272
+ inputField: inputField,
1273
+ textArea: textArea,
1274
+ checkbox: checkbox,
1275
+ inputTag: inputTag
1276
+ };
1107
1277
 
1108
- function getIconColor(state, disabled) {
1109
- if (disabled) return 'black-light';
1278
+ var fullScreenModal = {
1279
+ header: {
1280
+ paddingVertical: 12,
1281
+ paddingHorizontal: 16,
1282
+ borderColor: lateOceanColorPalette.black100
1283
+ }
1284
+ };
1110
1285
 
1111
- switch (state) {
1112
- case 'invalid':
1113
- return 'danger';
1286
+ var iconButton = {
1287
+ backgroundColor: 'transparent',
1288
+ width: 40,
1289
+ height: 40,
1290
+ borderRadius: 20,
1291
+ borderWidth: 2,
1292
+ borderColor: 'transparent',
1293
+ transition: {
1294
+ property: 'all',
1295
+ duration: '200ms',
1296
+ timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
1297
+ },
1298
+ scale: {
1299
+ base: {
1300
+ "default": 1,
1301
+ hover: 0.95,
1302
+ active: 0.95
1303
+ },
1304
+ medium: {
1305
+ hover: 1.05
1306
+ }
1307
+ },
1308
+ disabled: {
1309
+ scale: 1,
1310
+ backgroundColor: button.disabled.backgroundColor,
1311
+ borderColor: button.disabled.borderColor
1312
+ },
1313
+ "default": {
1314
+ pressedBackgroundColor: button["default"].pressedBackgroundColor
1315
+ },
1316
+ white: {
1317
+ pressedBackgroundColor: button.white.hoverBackgroundColor
1318
+ }
1319
+ };
1114
1320
 
1115
- case 'valid':
1116
- return 'success';
1321
+ var listItem = {
1322
+ padding: '12px 16px',
1323
+ borderColor: colors.separator,
1324
+ borderWidth: 1,
1325
+ innerMargin: 8
1326
+ };
1117
1327
 
1118
- default:
1119
- return undefined;
1328
+ var shadows = {
1329
+ medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
1330
+ };
1331
+
1332
+ var skeleton = {
1333
+ backgroundColor: lateOceanColorPalette.black100,
1334
+ flareColor: lateOceanColorPalette.black200,
1335
+ animationDuration: 1000
1336
+ };
1337
+
1338
+ var tag = {
1339
+ borderRadius: 10,
1340
+ padding: '2px 12px',
1341
+ primary: {
1342
+ fill: {
1343
+ backgroundColor: lateOceanColorPalette.moonPurpleLight1,
1344
+ borderWidth: 0,
1345
+ borderColor: colors.transparent
1346
+ },
1347
+ outline: {
1348
+ backgroundColor: colors.transparent,
1349
+ borderWidth: 1,
1350
+ borderColor: colors.primary
1351
+ }
1352
+ },
1353
+ "default": {
1354
+ fill: {
1355
+ backgroundColor: lateOceanColorPalette.black50,
1356
+ borderWidth: 0,
1357
+ borderColor: colors.transparent
1358
+ },
1359
+ outline: {
1360
+ backgroundColor: colors.transparent,
1361
+ borderWidth: 1,
1362
+ borderColor: colors.black
1363
+ }
1364
+ },
1365
+ danger: {
1366
+ fill: {
1367
+ backgroundColor: lateOceanColorPalette.warmEmbrace,
1368
+ borderWidth: 0,
1369
+ borderColor: colors.transparent
1370
+ },
1371
+ outline: {
1372
+ backgroundColor: colors.transparent,
1373
+ borderWidth: 1,
1374
+ borderColor: colors.danger
1375
+ }
1120
1376
  }
1121
- }
1377
+ };
1122
1378
 
1123
- function InputIcon(_ref) {
1124
- var icon = _ref.icon,
1125
- state = _ref.state,
1126
- disabled = _ref.disabled;
1127
- var theme = /*#__PURE__*/useTheme();
1128
- var color = getIconColor(state, disabled);
1129
- return /*#__PURE__*/jsx(TypographyIcon, {
1130
- color: color,
1131
- icon: icon,
1132
- size: theme.kitt.forms.input.icon.size
1133
- });
1134
- }
1379
+ var tooltip = {
1380
+ backgroundColor: colors.black,
1381
+ borderRadius: 10,
1382
+ opacity: 0.95,
1383
+ horizontalPadding: 16,
1384
+ verticalPadding: 4,
1385
+ floatingPadding: 8
1386
+ };
1135
1387
 
1136
- function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1388
+ var breakpoints = {
1389
+ values: {
1390
+ base: 0,
1391
+ small: 480,
1392
+ medium: 768,
1393
+ large: 1024,
1394
+ wide: 1280
1395
+ },
1396
+ min: {
1397
+ smallBreakpoint: 'min-width: 480px',
1398
+ mediumBreakpoint: 'min-width: 768px',
1399
+ largeBreakpoint: 'min-width: 1024px',
1400
+ wideBreakpoint: 'min-width: 1280px'
1401
+ },
1402
+ max: {
1403
+ smallBreakpoint: 'max-width: 479px',
1404
+ mediumBreakpoint: 'max-width: 767px',
1405
+ largeBreakpoint: 'max-width: 1023px',
1406
+ wideBreakpoint: 'max-width: 1279px'
1407
+ }
1408
+ }; // eslint-disable-next-line unicorn/expiring-todo-comments
1409
+ // TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
1137
1410
 
1138
- function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1139
- function InputPressable(_ref) {
1140
- var props = _extends({}, _ref);
1411
+ var theme = {
1412
+ spacing: 4,
1413
+ colors: colors,
1414
+ palettes: {
1415
+ lateOcean: lateOceanColorPalette
1416
+ },
1417
+ avatar: avatar,
1418
+ button: button,
1419
+ card: card,
1420
+ feedbackMessage: feedbackMessage,
1421
+ forms: forms,
1422
+ typography: typography,
1423
+ tag: tag,
1424
+ shadows: shadows,
1425
+ fullScreenModal: fullScreenModal,
1426
+ iconButton: iconButton,
1427
+ listItem: listItem,
1428
+ tooltip: tooltip,
1429
+ skeleton: skeleton,
1430
+ breakpoints: breakpoints
1431
+ };
1141
1432
 
1142
- return /*#__PURE__*/jsx(Pressable, _objectSpread$d({}, props));
1433
+ function matchWindowSize(_ref, _ref2) {
1434
+ var width = _ref.width,
1435
+ height = _ref.height;
1436
+ var minWidth = _ref2.minWidth,
1437
+ maxWidth = _ref2.maxWidth,
1438
+ minHeight = _ref2.minHeight,
1439
+ maxHeight = _ref2.maxHeight;
1440
+ var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
1441
+ var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
1442
+ return hasWidthMatched && hasHeightMatched;
1143
1443
  }
1444
+ function useMatchWindowSize(options) {
1445
+ var _useWindowDimensions = useWindowDimensions(),
1446
+ width = _useWindowDimensions.width,
1447
+ height = _useWindowDimensions.height;
1144
1448
 
1145
- var _excluded$8 = ["isPasswordDefaultVisible", "right"];
1449
+ return matchWindowSize({
1450
+ width: width,
1451
+ height: height
1452
+ }, options);
1453
+ }
1146
1454
 
1147
- function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1455
+ function createWindowSizeHelper(dimensions) {
1456
+ return {
1457
+ matchWindowSize: function matchWindowSize$1(options) {
1458
+ return matchWindowSize(dimensions, options);
1459
+ },
1460
+ ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
1461
+ return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
1462
+ },
1463
+ mapWindowWidth: function mapWindowWidth() {
1464
+ for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
1465
+ widthList[_key] = arguments[_key];
1466
+ }
1148
1467
 
1149
- function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1150
- function InputPassword(_ref) {
1151
- var isPasswordDefaultVisible = _ref.isPasswordDefaultVisible,
1152
- right = _ref.right,
1153
- props = _objectWithoutProperties(_ref, _excluded$8);
1468
+ if ((process.env.NODE_ENV !== "production")) {
1469
+ widthList.slice(1).forEach(function (_ref, index) {
1470
+ var _ref2 = _slicedToArray(_ref, 1),
1471
+ minWidth = _ref2[0];
1154
1472
 
1155
- var _useState = useState(Boolean(isPasswordDefaultVisible)),
1156
- _useState2 = _slicedToArray(_useState, 2),
1157
- isVisible = _useState2[0],
1158
- setIsVisible = _useState2[1];
1473
+ var previousMinWidth = widthList[index][0];
1159
1474
 
1160
- return /*#__PURE__*/jsx(InputText, _objectSpread$c(_objectSpread$c({}, props), {}, {
1161
- textContentType: "password",
1162
- autoCompleteType: "password",
1163
- autoCorrect: false,
1164
- secureTextEntry: !isVisible,
1165
- right: right || /*#__PURE__*/jsx(InputPressable, {
1166
- accessibilityRole: "button",
1167
- onPress: function onPress() {
1168
- return setIsVisible(function (prev) {
1169
- return !prev;
1475
+ if (previousMinWidth > minWidth) {
1476
+ throw new Error("mapWindowWidth: sort your values to be mobile first. ".concat(minWidth, " is < ").concat(previousMinWidth, ", so ").concat(minWidth, " should be before ").concat(previousMinWidth, "."));
1477
+ }
1170
1478
  });
1171
- },
1172
- children: /*#__PURE__*/jsx(InputIcon, {
1173
- icon: isVisible ? /*#__PURE__*/jsx(EyeOffIcon, {}) : /*#__PURE__*/jsx(EyeIcon, {})
1174
- })
1175
- })
1176
- }));
1177
- }
1479
+ }
1178
1480
 
1179
- function Label(_ref) {
1180
- var htmlFor = _ref.htmlFor,
1181
- children = _ref.children;
1182
- return /*#__PURE__*/jsx(Typography.Text, {
1183
- base: "body",
1184
- children: Platform.OS === 'web' ? /*#__PURE__*/jsx("label", {
1185
- htmlFor: htmlFor,
1186
- children: children
1187
- }) : children
1481
+ var found = widthList.find(function (_ref3) {
1482
+ var _ref4 = _slicedToArray(_ref3, 2),
1483
+ minWidth = _ref4[0];
1484
+ _ref4[1];
1485
+
1486
+ return matchWindowSize(dimensions, {
1487
+ minWidth: Number(minWidth)
1488
+ });
1489
+ });
1490
+ if (!found) return null;
1491
+ return found[1];
1492
+ }
1493
+ };
1494
+ }
1495
+
1496
+ function useKittTheme() {
1497
+ var dimensions = useWindowDimensions();
1498
+ return useMemo(function () {
1499
+ return {
1500
+ kitt: theme,
1501
+ responsive: createWindowSizeHelper(dimensions)
1502
+ };
1503
+ }, [dimensions]);
1504
+ }
1505
+
1506
+ var CheckboxAndLabelPressableWrapper = /*#__PURE__*/styled.Pressable.withConfig({
1507
+ displayName: "Checkbox__CheckboxAndLabelPressableWrapper"
1508
+ })(["display:flex;flex-direction:row;align-items:center;"]);
1509
+ var CheckboxContainer = /*#__PURE__*/styled.View.withConfig({
1510
+ displayName: "Checkbox__CheckboxContainer"
1511
+ })(["display:flex;flex-direction:row;align-items:center;justify-content:center;height:", "px;width:", "px;position:relative;border-radius:", "px;", " margin-right:", ";"], function (_ref) {
1512
+ var theme = _ref.theme;
1513
+ return theme.kitt.forms.checkbox.height;
1514
+ }, function (_ref2) {
1515
+ var theme = _ref2.theme;
1516
+ return theme.kitt.forms.checkbox.width;
1517
+ }, function (_ref3) {
1518
+ var theme = _ref3.theme;
1519
+ return theme.kitt.forms.checkbox.borderRadius;
1520
+ }, function (_ref4) {
1521
+ var $isChecked = _ref4.$isChecked,
1522
+ theme = _ref4.theme;
1523
+ var _theme$kitt$forms$che = theme.kitt.forms.checkbox,
1524
+ checkedBackgroundColor = _theme$kitt$forms$che.checkedBackgroundColor,
1525
+ checkedBorderColor = _theme$kitt$forms$che.checkedBorderColor,
1526
+ borderColor = _theme$kitt$forms$che.borderColor,
1527
+ borderWidth = _theme$kitt$forms$che.borderWidth,
1528
+ backgroundColor = _theme$kitt$forms$che.backgroundColor;
1529
+
1530
+ if ($isChecked) {
1531
+ return css(["background-color:", ";border:", ";"], checkedBackgroundColor, "".concat(borderWidth, "px solid ").concat(checkedBorderColor));
1532
+ }
1533
+
1534
+ return css(["background-color:", ";border:", ";"], backgroundColor, "".concat(borderWidth, "px solid ").concat(borderColor));
1535
+ }, function (_ref5) {
1536
+ var theme = _ref5.theme,
1537
+ $hasLabel = _ref5.$hasLabel;
1538
+ if (!$hasLabel) return '0px';
1539
+ return "".concat(theme.kitt.spacing * 2.5, "px;");
1540
+ });
1541
+ function Checkbox(_ref6) {
1542
+ var onChange = _ref6.onChange,
1543
+ onBlur = _ref6.onBlur,
1544
+ onFocus = _ref6.onFocus,
1545
+ value = _ref6.value,
1546
+ _ref6$hitSlop = _ref6.hitSlop,
1547
+ hitSlop = _ref6$hitSlop === void 0 ? 40 : _ref6$hitSlop,
1548
+ id = _ref6.id,
1549
+ children = _ref6.children;
1550
+ var theme = useKittTheme();
1551
+ return /*#__PURE__*/jsxs(CheckboxAndLabelPressableWrapper, {
1552
+ accessibilityRole: "checkbox",
1553
+ accessibilityState: {
1554
+ checked: value
1555
+ },
1556
+ hitSlop: hitSlop,
1557
+ onPress: function handlePress(e) {
1558
+ if (onFocus) onFocus(e);
1559
+ if (onChange) onChange(e);
1560
+ if (onBlur) onBlur(e);
1561
+ },
1562
+ children: [/*#__PURE__*/jsx(CheckboxContainer, {
1563
+ $isChecked: value,
1564
+ $hasLabel: !!children,
1565
+ testID: id,
1566
+ children: value ? /*#__PURE__*/jsx(Icon, {
1567
+ align: "center",
1568
+ color: theme.kitt.forms.checkbox.markColor,
1569
+ size: theme.kitt.forms.checkbox.iconSize,
1570
+ icon: /*#__PURE__*/jsx(CheckboxMark, {})
1571
+ }) : null
1572
+ }), children]
1188
1573
  });
1189
1574
  }
1190
1575
 
1191
- var OuterRadio = /*#__PURE__*/styled.View.withConfig({
1192
- displayName: "Radio__OuterRadio"
1193
- })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], function (_ref) {
1576
+ function getInputUIState(_ref) {
1577
+ var isFocused = _ref.isFocused,
1578
+ isDisabled = _ref.isDisabled,
1579
+ formState = _ref.formState;
1580
+ if (isDisabled) return 'disabled';
1581
+ if (isFocused) return 'focus';
1582
+ if (formState === 'invalid') return 'invalid';
1583
+ return 'default';
1584
+ }
1585
+
1586
+ var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
1194
1587
  var theme = _ref.theme,
1195
- disabled = _ref.disabled;
1196
- return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor;
1588
+ $state = _ref.$state;
1589
+ return $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states["default"].backgroundColor;
1197
1590
  }, function (_ref2) {
1198
1591
  var theme = _ref2.theme;
1199
- return theme.kitt.forms.radio.size;
1592
+ return theme.kitt.forms.input.borderWidth;
1200
1593
  }, function (_ref3) {
1201
1594
  var theme = _ref3.theme;
1202
- return theme.kitt.forms.radio.size;
1595
+ return theme.kitt.forms.input.borderRadius;
1203
1596
  }, function (_ref4) {
1204
- var theme = _ref4.theme;
1205
- return theme.kitt.forms.radio.size / 2;
1597
+ var theme = _ref4.theme,
1598
+ $state = _ref4.$state;
1599
+ return theme.kitt.forms.input.states[$state].borderColor;
1206
1600
  }, function (_ref5) {
1207
1601
  var theme = _ref5.theme;
1208
- return theme.kitt.forms.radio.unchecked.borderWidth;
1602
+ var typeConfigKey = getTypographyTypeConfigKey(theme);
1603
+ return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize, "px");
1209
1604
  }, function (_ref6) {
1210
1605
  var theme = _ref6.theme,
1211
- disabled = _ref6.disabled;
1212
- return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor;
1213
- });
1214
- var SelectedOuterRadio = /*#__PURE__*/styled.View.withConfig({
1215
- displayName: "Radio__SelectedOuterRadio"
1216
- })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], function (_ref7) {
1606
+ $state = _ref6.$state;
1607
+ return theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color];
1608
+ }, function (_ref7) {
1217
1609
  var theme = _ref7.theme;
1218
- return theme.kitt.forms.radio.checked.backgroundColor;
1219
- }, function (_ref8) {
1220
- var theme = _ref8.theme;
1221
- return theme.kitt.forms.radio.size;
1222
- }, function (_ref9) {
1223
- var theme = _ref9.theme;
1224
- return theme.kitt.forms.radio.size;
1225
- }, function (_ref10) {
1226
- var theme = _ref10.theme;
1227
- return theme.kitt.forms.radio.size / 2;
1228
- });
1229
- var SelectedInnerRadio = /*#__PURE__*/styled.View.withConfig({
1230
- displayName: "Radio__SelectedInnerRadio"
1231
- })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], function (_ref11) {
1232
- var theme = _ref11.theme;
1233
- return theme.kitt.forms.radio.checked.innerBackgroundColor;
1234
- }, function (_ref12) {
1235
- var theme = _ref12.theme;
1236
- return theme.kitt.forms.radio.checked.innerSize;
1237
- }, function (_ref13) {
1238
- var theme = _ref13.theme;
1239
- return theme.kitt.forms.radio.checked.innerSize;
1240
- }, function (_ref14) {
1241
- var theme = _ref14.theme;
1242
- return theme.kitt.forms.radio.checked.innerSize / 2;
1610
+ return theme.kitt.typography.types.bodies.fontFamily.regular;
1243
1611
  });
1244
- var Container$4 = /*#__PURE__*/styled.Pressable.withConfig({
1245
- displayName: "Radio__Container"
1246
- })(["flex-direction:row;align-items:center;"]);
1247
- var Text = /*#__PURE__*/styled(Typography.Text).withConfig({
1248
- displayName: "Radio__Text"
1249
- })(["margin-left:", "px;"], function (_ref15) {
1250
- var theme = _ref15.theme;
1251
- return theme.kitt.spacing * 2;
1612
+
1613
+ var StyledTypographyText = /*#__PURE__*/styled(Typography.Text).withConfig({
1614
+ displayName: "DatePickerInputPart__StyledTypographyText"
1615
+ })(["text-align:center;"]);
1616
+ var ViewInput = /*#__PURE__*/styled.View.withConfig({
1617
+ displayName: "DatePickerInputPart__ViewInput"
1618
+ })(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, function (_ref) {
1619
+ var theme = _ref.theme;
1620
+ return theme.kitt.forms.input.padding["default"];
1621
+ }, function (_ref2) {
1622
+ var theme = _ref2.theme;
1623
+ return theme.kitt.forms.input.minHeight;
1624
+ }, function (_ref3) {
1625
+ var theme = _ref3.theme,
1626
+ $partName = _ref3.$partName;
1627
+
1628
+ if (!$partName) {
1629
+ return undefined;
1630
+ }
1631
+
1632
+ return "".concat(theme.kitt.forms.datePicker[$partName].minWidth, "px");
1252
1633
  });
1253
- function Radio(_ref16) {
1254
- var id = _ref16.id,
1255
- checked = _ref16.checked,
1256
- onChange = _ref16.onChange,
1257
- value = _ref16.value,
1258
- _ref16$disabled = _ref16.disabled,
1259
- disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
1260
- children = _ref16.children;
1261
- return /*#__PURE__*/jsxs(Container$4, {
1262
- nativeID: id,
1263
- disabled: disabled,
1264
- accessibilityRole: "radio",
1265
- "aria-checked": checked,
1266
- focusable: checked && !disabled,
1267
- onPress: function handlePress() {
1268
- onChange(value);
1269
- },
1270
- children: [checked && !disabled ? /*#__PURE__*/jsx(SelectedOuterRadio, {
1271
- children: /*#__PURE__*/jsx(SelectedInnerRadio, {})
1272
- }) : /*#__PURE__*/jsx(OuterRadio, {
1273
- disabled: disabled
1274
- }), /*#__PURE__*/jsx(Text, {
1275
- base: "body",
1276
- color: disabled ? 'black-light' : 'black',
1277
- children: children
1278
- })]
1634
+ function DatePickerInputPart(_ref4) {
1635
+ var $state = _ref4.$state,
1636
+ placeholder = _ref4.placeholder,
1637
+ value = _ref4.value,
1638
+ partName = _ref4.partName,
1639
+ disabled = _ref4.disabled;
1640
+ return /*#__PURE__*/jsx(ViewInput, {
1641
+ $state: $state,
1642
+ $partName: partName,
1643
+ children: placeholder || value ? /*#__PURE__*/jsx(StyledTypographyText, {
1644
+ color: !value || disabled ? 'black-light' : undefined,
1645
+ children: value || placeholder
1646
+ }) : null
1279
1647
  });
1280
1648
  }
1281
1649
 
1282
- function ownKeys$b(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1650
+ function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1283
1651
 
1284
- function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$b(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1285
- function TextArea(_ref) {
1286
- var props = _extends({}, _ref);
1652
+ function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1653
+ // Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
1654
+ var OverlayPressable = /*#__PURE__*/styled(Pressable).withConfig({
1655
+ displayName: "Overlay__OverlayPressable"
1656
+ })(function (_ref) {
1657
+ var theme = _ref.theme;
1658
+ return _objectSpread$j(_objectSpread$j({}, StyleSheet.absoluteFillObject), {}, {
1659
+ backgroundColor: theme.kitt.colors.overlay.dark
1660
+ });
1661
+ });
1662
+ function Overlay(_ref2) {
1663
+ var onPress = _ref2.onPress;
1664
+ return /*#__PURE__*/jsx(OverlayPressable, {
1665
+ accessibilityRole: "none",
1666
+ onPress: onPress,
1667
+ children: /*#__PURE__*/jsx(View, {})
1668
+ });
1669
+ }
1287
1670
 
1288
- var theme = /*#__PURE__*/useTheme();
1289
- return /*#__PURE__*/jsx(InputText, _objectSpread$b({
1290
- multiline: true,
1291
- textAlignVertical: "top",
1292
- minHeight: theme.kitt.forms.textArea.minHeight
1293
- }, props));
1671
+ var BodyView = /*#__PURE__*/styled.View.withConfig({
1672
+ displayName: "Body__BodyView"
1673
+ })(["padding:", "px ", "px;"], function (_ref) {
1674
+ var theme = _ref.theme;
1675
+ return theme.kitt.spacing * 6;
1676
+ }, function (_ref2) {
1677
+ var theme = _ref2.theme;
1678
+ return theme.kitt.spacing * 4;
1679
+ });
1680
+ function ModalBody(_ref3) {
1681
+ var children = _ref3.children;
1682
+ return /*#__PURE__*/jsx(ScrollView, {
1683
+ children: /*#__PURE__*/jsx(BodyView, {
1684
+ children: children
1685
+ })
1686
+ });
1294
1687
  }
1295
1688
 
1296
- var Body = /*#__PURE__*/styled.View.withConfig({
1297
- displayName: "Body"
1298
- })(["", " background-color:", ";flex:1;"], function (_ref) {
1689
+ var FooterView = /*#__PURE__*/styled.View.withConfig({
1690
+ displayName: "Footer__FooterView"
1691
+ })(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], function (_ref) {
1299
1692
  var theme = _ref.theme;
1300
- return theme.responsive.ifWindowSizeMatches({
1301
- minWidth: KittBreakpoints.MEDIUM
1302
- }, "padding-right: ".concat(theme.kitt.spacing * 12, "px;\n padding-left: ").concat(theme.kitt.spacing * 12, "px;"), "padding-right: ".concat(theme.kitt.spacing * 6, "px;\n padding-left: ").concat(theme.kitt.spacing * 6, "px;"));
1693
+ return theme.kitt.spacing * 4;
1303
1694
  }, function (_ref2) {
1304
1695
  var theme = _ref2.theme;
1305
- return theme.kitt.colors.uiBackgroundLight;
1696
+ return theme.kitt.colors.separator;
1306
1697
  });
1307
- function FullScreenModalBody(_ref3) {
1698
+ function ModalFooter(_ref3) {
1308
1699
  var children = _ref3.children;
1309
- return /*#__PURE__*/jsx(Body, {
1700
+ return /*#__PURE__*/jsx(FooterView, {
1310
1701
  children: children
1311
1702
  });
1312
1703
  }
1313
1704
 
1314
- var SideContainer = /*#__PURE__*/styled.View.withConfig({
1315
- displayName: "Header__SideContainer"
1316
- })(["", ""], function (_ref) {
1317
- var theme = _ref.theme,
1318
- _ref$side = _ref.side,
1319
- side = _ref$side === void 0 ? 'left' : _ref$side;
1320
- var padding = theme.kitt.spacing * 2;
1705
+ var _excluded$a = ["as", "children"];
1321
1706
 
1322
- if (side === 'left') {
1323
- return "padding-right: ".concat(padding, "px;");
1324
- }
1707
+ function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1325
1708
 
1326
- return "padding-left: ".concat(padding, "px;");
1327
- });
1709
+ function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1710
+ function StyleWebWrapper(_ref) {
1711
+ var as = _ref.as,
1712
+ children = _ref.children,
1713
+ props = _objectWithoutProperties(_ref, _excluded$a);
1328
1714
 
1329
- function getHeaderHorizontalMediumPadding(spacing) {
1330
- return spacing * 6;
1715
+ if (Platform.OS !== 'web') return children;
1716
+ // as or default to div. If as is undefined, T is div but typescript is not sure
1717
+ return /*#__PURE__*/jsx(as || 'div', _objectSpread$i(_objectSpread$i({}, props), {}, {
1718
+ children: children
1719
+ }));
1331
1720
  }
1332
1721
 
1333
- var Header = /*#__PURE__*/styled.View.withConfig({
1334
- displayName: "Header"
1335
- })(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], function (_ref2) {
1336
- var theme = _ref2.theme,
1337
- _ref2$insetTop = _ref2.insetTop,
1338
- insetTop = _ref2$insetTop === void 0 ? 0 : _ref2$insetTop;
1339
- var paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
1340
- var _theme$kitt$fullScree = theme.kitt.fullScreenModal.header,
1341
- paddingVertical = _theme$kitt$fullScree.paddingVertical,
1342
- paddingHorizontal = _theme$kitt$fullScree.paddingHorizontal;
1343
- return theme.responsive.ifWindowSizeMatches({
1344
- minWidth: KittBreakpoints.MEDIUM
1345
- }, "padding: ".concat(paddingTop, "px ").concat(getHeaderHorizontalMediumPadding(theme.kitt.spacing), "px ").concat(paddingVertical, "px;"), "padding: ".concat(paddingTop, "px ").concat(paddingHorizontal, "px ").concat(paddingVertical, "px;"));
1346
- }, function (_ref3) {
1347
- var theme = _ref3.theme;
1348
- return theme.kitt.fullScreenModal.header.borderColor;
1349
- });
1350
- var HeaderContent = /*#__PURE__*/styled.View.withConfig({
1351
- displayName: "Header__HeaderContent"
1352
- })(["", ";", ";justify-content:center;align-items:center;"], function (_ref4) {
1353
- var theme = _ref4.theme,
1354
- leftWidth = _ref4.leftWidth,
1355
- rightWidth = _ref4.rightWidth,
1356
- windowWidth = _ref4.windowWidth;
1357
-
1358
- /*
1359
- * Since we don't have controll over the rendered left and right elements,
1360
- * we must apply some logic to give the title all the available space
1361
- */
1362
- var sideElementMaxWidth = Math.max(leftWidth, rightWidth);
1363
- var parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
1364
- var parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
1365
-
1366
- var computeWidth = function (breakpointPadding) {
1367
- return windowWidth - breakpointPadding - sideElementMaxWidth * 2;
1368
- };
1369
-
1370
- return theme.responsive.ifWindowSizeMatches({
1371
- minWidth: KittBreakpoints.MEDIUM
1372
- }, "width: ".concat(computeWidth(parentHorizontalPaddingMedium), "px;"), "width: ".concat(computeWidth(parentHorizontalPadding), "px;"));
1373
- }, function (_ref5) {
1374
- var leftWidth = _ref5.leftWidth,
1375
- rightWidth = _ref5.rightWidth;
1376
- // Depending of the wider element, we must add a margin to fill the diff in space between elements
1377
- var deltaMargin = Math.abs(leftWidth - rightWidth);
1378
-
1379
- if (leftWidth > rightWidth) {
1380
- return "margin-right: ".concat(deltaMargin, "px;");
1381
- }
1382
-
1383
- return "margin-left: ".concat(deltaMargin, "px;");
1384
- });
1385
- function FullScreenModalHeader(_ref6) {
1386
- var children = _ref6.children,
1387
- right = _ref6.right,
1388
- left = _ref6.left;
1389
-
1390
- var _useSafeAreaInsets = useSafeAreaInsets(),
1391
- top = _useSafeAreaInsets.top;
1392
-
1393
- var dimensions = useWindowDimensions();
1394
-
1395
- var _useState = useState(0),
1396
- _useState2 = _slicedToArray(_useState, 2),
1397
- leftWidth = _useState2[0],
1398
- setLeftWidth = _useState2[1];
1399
-
1400
- var _useState3 = useState(0),
1401
- _useState4 = _slicedToArray(_useState3, 2),
1402
- rightWidth = _useState4[0],
1403
- setRightWidth = _useState4[1];
1404
-
1405
- var handleLayoutChange = function (event, side) {
1406
- // Prevents react to nullify event on rerenders
1407
- event.persist();
1408
-
1409
- if (side === 'left') {
1410
- setLeftWidth(event.nativeEvent.layout.width);
1411
- return;
1412
- }
1413
-
1414
- setRightWidth(event.nativeEvent.layout.width);
1415
- };
1416
-
1417
- return /*#__PURE__*/jsxs(Header, {
1418
- insetTop: Platform.OS === 'ios' ? undefined : top,
1419
- children: [left ? /*#__PURE__*/jsx(SideContainer, {
1420
- onLayout: function onLayout(e) {
1421
- return handleLayoutChange(e, 'left');
1422
- },
1423
- children: left
1424
- }) : null, /*#__PURE__*/jsx(HeaderContent, {
1425
- windowWidth: dimensions.width,
1426
- leftWidth: leftWidth,
1427
- rightWidth: rightWidth,
1428
- children: children
1429
- }), right ? /*#__PURE__*/jsx(SideContainer, {
1430
- side: "right",
1431
- onLayout: function onLayout(e) {
1432
- return handleLayoutChange(e, 'right');
1433
- },
1434
- children: right
1435
- }) : null]
1436
- });
1437
- }
1438
-
1439
- var Container$3 = /*#__PURE__*/styled.View.withConfig({
1440
- displayName: "FullScreenModal__Container"
1441
- })(["flex:1;background-color:", ";"], function (_ref) {
1442
- var theme = _ref.theme;
1443
- return theme.kitt.colors.uiBackground;
1444
- });
1445
- function FullScreenModal(_ref2) {
1446
- var children = _ref2.children;
1447
- return /*#__PURE__*/jsx(Container$3, {
1448
- children: children
1449
- });
1450
- }
1451
- FullScreenModal.Header = FullScreenModalHeader;
1452
- FullScreenModal.Body = FullScreenModalBody;
1453
-
1454
- var _excluded$7 = ["as", "children"];
1455
-
1456
- function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1457
-
1458
- function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$a(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1459
- function StyleWebWrapper(_ref) {
1460
- var as = _ref.as,
1461
- children = _ref.children,
1462
- props = _objectWithoutProperties(_ref, _excluded$7);
1463
-
1464
- if (Platform.OS !== 'web') return children;
1465
- // as or default to div. If as is undefined, T is div but typescript is not sure
1466
- return /*#__PURE__*/jsx(as || 'div', _objectSpread$a(_objectSpread$a({}, props), {}, {
1467
- children: children
1468
- }));
1469
- }
1470
-
1471
- function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1722
+ function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1472
1723
 
1473
- function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$9(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1724
+ function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1474
1725
  // type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
1475
1726
  // type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
1476
1727
  // export function withTheme<Props extends { theme: DefaultTheme }, C>(
@@ -1485,18 +1736,18 @@ function withTheme(WrappedComponent) {
1485
1736
  // eslint-disable-next-line prefer-arrow-callback
1486
1737
  return /*#__PURE__*/forwardRef(function (props, ref) {
1487
1738
  var theme = /*#__PURE__*/useTheme();
1488
- return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$9({
1739
+ return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$h({
1489
1740
  ref: ref,
1490
1741
  theme: theme
1491
1742
  }, props));
1492
1743
  });
1493
1744
  }
1494
1745
 
1495
- var _excluded$6 = ["color", "disabled"];
1746
+ var _excluded$9 = ["color", "disabled"];
1496
1747
 
1497
- function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1748
+ function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1498
1749
 
1499
- function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$8(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1750
+ function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1500
1751
  var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled$1("div")({
1501
1752
  name: "PressableIconButtonWebWrapper",
1502
1753
  "class": "p1nlccvg",
@@ -1560,13 +1811,13 @@ var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
1560
1811
  function PressableIconButton(_ref9) {
1561
1812
  var color = _ref9.color,
1562
1813
  disabled = _ref9.disabled,
1563
- props = _objectWithoutProperties(_ref9, _excluded$6);
1814
+ props = _objectWithoutProperties(_ref9, _excluded$9);
1564
1815
 
1565
1816
  return /*#__PURE__*/jsx(StyleWebWrapper, {
1566
1817
  as: PressableIconButtonWebWrapper,
1567
1818
  $isWhite: color === 'white',
1568
1819
  $isDisabled: Boolean(disabled),
1569
- children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$8(_objectSpread$8({}, props), {}, {
1820
+ children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$g(_objectSpread$g({}, props), {}, {
1570
1821
  disabled: disabled
1571
1822
  }))
1572
1823
  });
@@ -1747,1518 +1998,1797 @@ function IconButton(_ref7) {
1747
1998
  });
1748
1999
  }
1749
2000
 
1750
- var _excluded$5 = ["children"];
2001
+ var OnCloseContext = /*#__PURE__*/createContext(function () {});
1751
2002
 
1752
- function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2003
+ var HeaderView = /*#__PURE__*/styled.View.withConfig({
2004
+ displayName: "Header__HeaderView"
2005
+ })(["position:relative;padding:", "px;display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;align-items:center;border-bottom-width:1px;border-bottom-color:", ";min-height:57px;"], function (_ref) {
2006
+ var theme = _ref.theme;
2007
+ return theme.kitt.spacing * 2;
2008
+ }, function (_ref2) {
2009
+ var theme = _ref2.theme;
2010
+ return theme.kitt.colors.separator;
2011
+ });
2012
+ var LeftIconView = /*#__PURE__*/styled.View.withConfig({
2013
+ displayName: "Header__LeftIconView"
2014
+ })(["align-self:flex-start;margin-right:", "px;"], function (_ref3) {
2015
+ var theme = _ref3.theme;
2016
+ return theme.kitt.spacing * 2;
2017
+ });
2018
+ var RightIconView = /*#__PURE__*/styled.View.withConfig({
2019
+ displayName: "Header__RightIconView"
2020
+ })(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
2021
+ var theme = _ref4.theme;
2022
+ return theme.kitt.spacing * 2;
2023
+ });
2024
+ var TitleView = /*#__PURE__*/styled.View.withConfig({
2025
+ displayName: "Header__TitleView"
2026
+ })(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
2027
+ var theme = _ref5.theme,
2028
+ isIconLeft = _ref5.isIconLeft;
2029
+ return isIconLeft ? 0 : theme.kitt.spacing * 2;
2030
+ });
2031
+ function ModalHeader(_ref6) {
2032
+ var left = _ref6.left,
2033
+ right = _ref6.right,
2034
+ children = _ref6.children;
2035
+ var onClose = useContext(OnCloseContext);
2036
+ var isIconLeft = !!left;
2037
+ return /*#__PURE__*/jsxs(HeaderView, {
2038
+ children: [isIconLeft && /*#__PURE__*/jsx(LeftIconView, {
2039
+ children: left
2040
+ }), /*#__PURE__*/jsx(TitleView, {
2041
+ isIconLeft: isIconLeft,
2042
+ children: children
2043
+ }), right !== undefined ? right : /*#__PURE__*/jsx(RightIconView, {
2044
+ children: /*#__PURE__*/jsx(IconButton, {
2045
+ icon: /*#__PURE__*/jsx(XIcon, {}),
2046
+ onPress: onClose
2047
+ })
2048
+ })]
2049
+ });
2050
+ }
1753
2051
 
1754
- function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2052
+ var ModalView = /*#__PURE__*/styled.View.withConfig({
2053
+ displayName: "Modal__ModalView"
2054
+ })(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], function (_ref) {
2055
+ var theme = _ref.theme;
2056
+ return theme.kitt.spacing * 20;
2057
+ }, function (_ref2) {
2058
+ var theme = _ref2.theme;
2059
+ return theme.kitt.spacing * 4;
2060
+ });
1755
2061
  var ContentView$1 = /*#__PURE__*/styled.View.withConfig({
1756
- displayName: "ListItemContent__ContentView"
1757
- })(["flex:1 0 0%;align-self:center;"]);
1758
- function ListItemContent(_ref) {
1759
- var children = _ref.children,
1760
- rest = _objectWithoutProperties(_ref, _excluded$5);
2062
+ displayName: "Modal__ContentView"
2063
+ })(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], function (_ref3) {
2064
+ var theme = _ref3.theme;
2065
+ return theme.kitt.card.borderRadius;
2066
+ }, function (_ref4) {
2067
+ var theme = _ref4.theme;
2068
+ return theme.kitt.colors.uiBackgroundLight;
2069
+ });
2070
+ function Modal(_ref5) {
2071
+ var visible = _ref5.visible,
2072
+ children = _ref5.children,
2073
+ onClose = _ref5.onClose,
2074
+ onEntered = _ref5.onEntered,
2075
+ onExited = _ref5.onExited;
2076
+ return /*#__PURE__*/jsx(OnCloseContext.Provider, {
2077
+ value: onClose,
2078
+ children: /*#__PURE__*/jsx(Modal$1, {
2079
+ transparent: true,
2080
+ animationType: "fade",
2081
+ visible: visible,
2082
+ onShow: onEntered,
2083
+ onDismiss: onExited,
2084
+ onRequestClose: onClose,
2085
+ children: /*#__PURE__*/jsxs(ModalView, {
2086
+ children: [/*#__PURE__*/jsx(Overlay, {
2087
+ onPress: onClose
2088
+ }), /*#__PURE__*/jsx(ContentView$1, {
2089
+ children: children
2090
+ })]
2091
+ })
2092
+ })
2093
+ });
2094
+ }
2095
+ Modal.Header = ModalHeader;
2096
+ Modal.Body = ModalBody;
2097
+ Modal.Footer = ModalFooter;
1761
2098
 
1762
- return /*#__PURE__*/jsx(ContentView$1, _objectSpread$7(_objectSpread$7({}, rest), {}, {
1763
- children: children
2099
+ function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2100
+
2101
+ function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2102
+
2103
+ function getDatePickerDisplayMode() {
2104
+ if (Platform.OS === 'android') return 'calendar';
2105
+ if (Platform.OS === 'ios') return 'spinner';
2106
+ return 'default';
2107
+ }
2108
+
2109
+ function PlatformDateTimePicker(_ref) {
2110
+ var value = _ref.value,
2111
+ _ref$defaultDate = _ref.defaultDate,
2112
+ defaultDate = _ref$defaultDate === void 0 ? new Date() : _ref$defaultDate,
2113
+ maximumDate = _ref.maximumDate,
2114
+ minimuDate = _ref.minimuDate,
2115
+ testID = _ref.testID,
2116
+ _onChange = _ref.onChange;
2117
+ var theme = /*#__PURE__*/useTheme();
2118
+ var displayMode = getDatePickerDisplayMode();
2119
+ var iosProps = Platform.OS === 'ios' ? {
2120
+ textColor: theme.kitt.colors.primary
2121
+ } : {};
2122
+ return /*#__PURE__*/jsx(DateTimePicker, _objectSpread$f(_objectSpread$f({
2123
+ is24Hour: true,
2124
+ testID: testID,
2125
+ value: value || defaultDate,
2126
+ mode: "date",
2127
+ maximumDate: maximumDate,
2128
+ minimumDate: minimuDate,
2129
+ display: displayMode
2130
+ }, iosProps), {}, {
2131
+ onChange: function onChange(_event, date) {
2132
+ return _onChange(date);
2133
+ }
1764
2134
  }));
1765
2135
  }
1766
2136
 
1767
- var _excluded$4 = ["children", "side"],
1768
- _excluded2$1 = ["children", "align"];
2137
+ var _excluded$8 = ["title", "isVisible", "value", "validateButtonLabel", "onClose", "onChange"];
1769
2138
 
1770
- function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2139
+ function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1771
2140
 
1772
- function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1773
- var SideContainerView = /*#__PURE__*/styled.View.withConfig({
1774
- displayName: "ListItemSideContent__SideContainerView"
1775
- })(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
1776
- var theme = _ref.theme,
1777
- side = _ref.side;
1778
- return side === 'right' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
1779
- }, function (_ref2) {
1780
- var theme = _ref2.theme,
1781
- side = _ref2.side;
1782
- return side === 'left' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
1783
- }); // Handles the vertical alignment of the side elements of the list item
1784
-
1785
- function ListItemSideContainer(_ref3) {
1786
- var children = _ref3.children,
1787
- _ref3$side = _ref3.side,
1788
- side = _ref3$side === void 0 ? 'left' : _ref3$side,
1789
- rest = _objectWithoutProperties(_ref3, _excluded$4);
2141
+ function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1790
2142
 
1791
- return /*#__PURE__*/jsx(SideContainerView, _objectSpread$6(_objectSpread$6({
1792
- side: side
1793
- }, rest), {}, {
1794
- children: children
1795
- }));
2143
+ function ModalTitle(_ref) {
2144
+ var children = _ref.children;
2145
+ return /*#__PURE__*/jsx(Modal.Header, {
2146
+ children: /*#__PURE__*/jsx(Typography.Text, {
2147
+ base: "body",
2148
+ variant: "bold",
2149
+ children: children
2150
+ })
2151
+ });
1796
2152
  }
1797
- var SideContentView = /*#__PURE__*/styled.View.withConfig({
1798
- displayName: "ListItemSideContent__SideContentView"
1799
- })(["align-self:", ";"], function (_ref4) {
1800
- var align = _ref4.align;
1801
- return align;
1802
- });
1803
- function ListItemSideContent(_ref5) {
1804
- var children = _ref5.children,
1805
- _ref5$align = _ref5.align,
1806
- align = _ref5$align === void 0 ? 'auto' : _ref5$align,
1807
- rest = _objectWithoutProperties(_ref5, _excluded2$1);
1808
2153
 
1809
- return /*#__PURE__*/jsx(SideContentView, _objectSpread$6(_objectSpread$6({
1810
- align: align
1811
- }, rest), {}, {
1812
- children: children
1813
- }));
1814
- }
2154
+ function ModalPlatformDateTimePicker(_ref2) {
2155
+ var title = _ref2.title,
2156
+ isVisible = _ref2.isVisible,
2157
+ value = _ref2.value,
2158
+ validateButtonLabel = _ref2.validateButtonLabel,
2159
+ onClose = _ref2.onClose,
2160
+ onChange = _ref2.onChange,
2161
+ props = _objectWithoutProperties(_ref2, _excluded$8);
1815
2162
 
1816
- var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
2163
+ var _useState = useState(value),
2164
+ _useState2 = _slicedToArray(_useState, 2),
2165
+ currentValue = _useState2[0],
2166
+ setCurrentValue = _useState2[1]; // Prevent unsynced value between the modal and its parent state
1817
2167
 
1818
- function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1819
2168
 
1820
- function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1821
- var ContainerView = /*#__PURE__*/styled.View.withConfig({
1822
- displayName: "ListItem__ContainerView"
1823
- })(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], function (_ref) {
1824
- var withPadding = _ref.withPadding,
1825
- theme = _ref.theme;
1826
- return withPadding ? theme.kitt.listItem.padding : 0;
1827
- }, function (_ref2) {
1828
- var theme = _ref2.theme,
1829
- borders = _ref2.borders;
1830
- var borderWidth = theme.kitt.listItem.borderWidth;
2169
+ return /*#__PURE__*/jsx(Modal, {
2170
+ visible: Boolean(isVisible),
2171
+ onClose: function handleClose() {
2172
+ setCurrentValue(value);
2173
+ onClose();
2174
+ },
2175
+ children: isVisible ? /*#__PURE__*/jsxs(Fragment, {
2176
+ children: [title ? /*#__PURE__*/jsx(ModalTitle, {
2177
+ children: title
2178
+ }) : null, /*#__PURE__*/jsx(Modal.Body, {
2179
+ children: /*#__PURE__*/jsx(PlatformDateTimePicker, _objectSpread$e(_objectSpread$e({}, props), {}, {
2180
+ value: currentValue,
2181
+ onChange: function handleChange(newDate) {
2182
+ setCurrentValue(function (prev) {
2183
+ return newDate || prev;
2184
+ });
2185
+ }
2186
+ }))
2187
+ }), /*#__PURE__*/jsx(Modal.Footer, {
2188
+ children: /*#__PURE__*/jsx(Button, {
2189
+ stretch: true,
2190
+ type: "primary",
2191
+ onPress: function handleSubmit() {
2192
+ onChange(currentValue);
2193
+ },
2194
+ children: validateButtonLabel ? /*#__PURE__*/jsx(Text$1, {
2195
+ children: validateButtonLabel
2196
+ }) : /*#__PURE__*/jsx(FormattedMessage, {
2197
+ id: "kitt-universal.ModalDateTimePicker.confirm"
2198
+ })
2199
+ })
2200
+ })]
2201
+ }) : null
2202
+ });
2203
+ }
1831
2204
 
1832
- if (borders === 'top') {
1833
- return "border-top-width: ".concat(borderWidth, "px");
1834
- }
2205
+ function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1835
2206
 
1836
- if (borders === 'bottom') {
1837
- return "border-bottom-width: ".concat(borderWidth, "px");
1838
- }
2207
+ function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1839
2208
 
1840
- if (borders === 'both') {
1841
- return css(["border-top-width:", "px;border-bottom-width:", "px;"], borderWidth, borderWidth);
2209
+ function prefixWithZero(value) {
2210
+ return "".concat(value).padStart(2, '0');
2211
+ }
2212
+
2213
+ var PartContainer = /*#__PURE__*/styled.View.withConfig({
2214
+ displayName: "DatePicker__PartContainer"
2215
+ })(["margin-right:", ";", ";"], function (_ref) {
2216
+ var theme = _ref.theme,
2217
+ $isLast = _ref.$isLast;
2218
+ return !$isLast ? "".concat(theme.kitt.spacing * 2, "px") : 0;
2219
+ }, function (_ref2) {
2220
+ var $isStretch = _ref2.$isStretch;
2221
+ return $isStretch ? css(["flex:0.33;flex-grow:1;"]) : undefined;
2222
+ });
2223
+ var DatePickerPressable = /*#__PURE__*/styled.Pressable.withConfig({
2224
+ displayName: "DatePicker__DatePickerPressable"
2225
+ })(["display:flex;flex-direction:row;", ";"], function (_ref3) {
2226
+ var $isStretch = _ref3.$isStretch;
2227
+
2228
+ if ($isStretch) {
2229
+ return css(["width:100%;"]);
1842
2230
  }
1843
2231
 
1844
- return 'border: none';
1845
- }, function (_ref3) {
1846
- var theme = _ref3.theme;
1847
- return theme.kitt.listItem.borderColor;
1848
- }, function (_ref4) {
1849
- var theme = _ref4.theme;
1850
- return theme.kitt.colors.uiBackgroundLight;
2232
+ return css(["align-self:baseline;"]);
1851
2233
  });
1852
- function ListItem(_ref5) {
1853
- var children = _ref5.children,
1854
- withPadding = _ref5.withPadding,
1855
- borders = _ref5.borders,
1856
- left = _ref5.left,
1857
- right = _ref5.right,
1858
- onPress = _ref5.onPress,
1859
- rest = _objectWithoutProperties(_ref5, _excluded$3);
2234
+ function DatePicker(_ref4) {
2235
+ var value = _ref4.value,
2236
+ id = _ref4.id,
2237
+ disabled = _ref4.disabled,
2238
+ placeholder = _ref4.placeholder,
2239
+ state = _ref4.state,
2240
+ internalForceState = _ref4.internalForceState,
2241
+ testID = _ref4.testID,
2242
+ stretch = _ref4.stretch,
2243
+ pickerDefaultDate = _ref4.pickerDefaultDate,
2244
+ pickerUITestID = _ref4.pickerUITestID,
2245
+ pickerUITitle = _ref4.pickerUITitle,
2246
+ pickerUIValidateButtonLabel = _ref4.pickerUIValidateButtonLabel,
2247
+ onChange = _ref4.onChange,
2248
+ onFocus = _ref4.onFocus,
2249
+ onBlur = _ref4.onBlur;
1860
2250
 
1861
- var Wrapper = onPress ? Pressable : Fragment;
1862
- var wrapperProps = onPress ? _objectSpread$5({
1863
- accessibilityRole: 'button',
1864
- onPress: onPress
1865
- }, rest) : undefined;
1866
- var containerProps = onPress ? undefined : rest;
1867
- return /*#__PURE__*/jsx(Wrapper, _objectSpread$5(_objectSpread$5({}, wrapperProps), {}, {
1868
- children: /*#__PURE__*/jsxs(ContainerView, _objectSpread$5(_objectSpread$5({
1869
- withPadding: withPadding,
1870
- borders: borders
1871
- }, containerProps), {}, {
1872
- children: [left ? /*#__PURE__*/jsx(ListItemSideContainer, {
1873
- side: "left",
1874
- children: left
1875
- }) : null, /*#__PURE__*/jsx(ListItemContent, {
1876
- children: children
1877
- }), right ? /*#__PURE__*/jsx(ListItemSideContainer, {
1878
- side: "right",
1879
- children: right
1880
- }) : null]
1881
- }))
1882
- }));
1883
- }
1884
- ListItem.Content = ListItemContent;
1885
- ListItem.SideContent = ListItemSideContent;
1886
- ListItem.SideContainer = ListItemSideContainer;
2251
+ var _useState = useState(false),
2252
+ _useState2 = _slicedToArray(_useState, 2),
2253
+ isPickerUIVisible = _useState2[0],
2254
+ setIsPickerUIVisible = _useState2[1];
1887
2255
 
1888
- function getActivityIndicatorSize(size) {
1889
- if (Platform.OS === 'android') return size;
1890
- return size < 36 ? 'small' : 'large';
1891
- }
2256
+ var _useState3 = useState(false),
2257
+ _useState4 = _slicedToArray(_useState3, 2),
2258
+ isFocused = _useState4[0],
2259
+ setIsFocused = _useState4[1];
2260
+
2261
+ var _useState5 = useState(value),
2262
+ _useState6 = _slicedToArray(_useState5, 2),
2263
+ currentValue = _useState6[0],
2264
+ setCurrentValue = _useState6[1];
2265
+
2266
+ var handleModalClose = function () {
2267
+ if (onBlur) onBlur();
2268
+ setIsPickerUIVisible(false);
2269
+ setIsFocused(false);
2270
+ };
1892
2271
 
1893
- function Loader(_ref) {
1894
- var _ref$color = _ref.color,
1895
- color = _ref$color === void 0 ? 'primary' : _ref$color,
1896
- _ref$size = _ref.size,
1897
- size = _ref$size === void 0 ? 20 : _ref$size;
1898
- var theme = /*#__PURE__*/useTheme();
1899
- var colorHex = theme.kitt.typography.colors[color];
1900
- return /*#__PURE__*/jsx(ActivityIndicator, {
1901
- testID: "ActivityIndicator",
1902
- color: colorHex,
1903
- size: getActivityIndicatorSize(size)
1904
- });
1905
- }
2272
+ var handleChange = function (newDate) {
2273
+ setCurrentValue(newDate);
2274
+ onChange(newDate);
2275
+ handleModalClose();
2276
+ };
1906
2277
 
1907
- function LargeLoader(_ref) {
1908
- var _ref$color = _ref.color,
1909
- color = _ref$color === void 0 ? 'primary' : _ref$color;
1910
- return /*#__PURE__*/jsx(Loader, {
1911
- color: color,
1912
- size: 60
2278
+ var currentState = internalForceState || getInputUIState({
2279
+ isFocused: isFocused,
2280
+ isDisabled: Boolean(disabled),
2281
+ formState: state
2282
+ });
2283
+ var sharedPickerProps = {
2284
+ testID: pickerUITestID,
2285
+ value: currentValue,
2286
+ onChange: handleChange
2287
+ };
2288
+ var sharedPartProps = {
2289
+ disabled: disabled,
2290
+ $state: currentState,
2291
+ defaultDate: pickerDefaultDate
2292
+ };
2293
+ return /*#__PURE__*/jsxs(Fragment, {
2294
+ children: [/*#__PURE__*/jsxs(DatePickerPressable, {
2295
+ $isStretch: stretch,
2296
+ nativeID: id,
2297
+ disabled: disabled,
2298
+ testID: testID,
2299
+ onPress: function handleModalOpen() {
2300
+ if (onFocus) onFocus();
2301
+ setIsPickerUIVisible(true);
2302
+ setIsFocused(true);
2303
+ },
2304
+ children: [/*#__PURE__*/jsx(PartContainer, {
2305
+ $isStretch: stretch,
2306
+ children: /*#__PURE__*/jsx(DatePickerInputPart, _objectSpread$d(_objectSpread$d({}, sharedPartProps), {}, {
2307
+ partName: "day",
2308
+ value: currentValue ? prefixWithZero(currentValue.getDate()) : undefined,
2309
+ placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.day
2310
+ }))
2311
+ }), /*#__PURE__*/jsx(PartContainer, {
2312
+ $isStretch: stretch,
2313
+ children: /*#__PURE__*/jsx(DatePickerInputPart, _objectSpread$d(_objectSpread$d({}, sharedPartProps), {}, {
2314
+ partName: "month",
2315
+ value: currentValue ? prefixWithZero(currentValue.getMonth() + 1) : undefined,
2316
+ placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.month
2317
+ }))
2318
+ }), /*#__PURE__*/jsx(PartContainer, {
2319
+ $isLast: true,
2320
+ $isStretch: stretch,
2321
+ children: /*#__PURE__*/jsx(DatePickerInputPart, _objectSpread$d(_objectSpread$d({}, sharedPartProps), {}, {
2322
+ partName: "year",
2323
+ value: currentValue === null || currentValue === void 0 ? void 0 : currentValue.getFullYear(),
2324
+ placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.year
2325
+ }))
2326
+ })]
2327
+ }), /*#__PURE__*/jsxs(Fragment, {
2328
+ children: [Platform.OS === 'android' && isPickerUIVisible ? /*#__PURE__*/jsx(PlatformDateTimePicker, _objectSpread$d({}, sharedPickerProps)) : null, Platform.OS !== 'android' ? /*#__PURE__*/jsx(ModalPlatformDateTimePicker, _objectSpread$d(_objectSpread$d({}, sharedPickerProps), {}, {
2329
+ isVisible: isPickerUIVisible,
2330
+ title: pickerUITitle,
2331
+ validateButtonLabel: pickerUIValidateButtonLabel,
2332
+ onClose: handleModalClose,
2333
+ onChange: handleChange
2334
+ })) : null]
2335
+ })]
1913
2336
  });
1914
2337
  }
1915
2338
 
1916
- function IconContent(_ref) {
1917
- var type = _ref.type,
1918
- color = _ref.color;
1919
-
1920
- switch (type) {
1921
- case 'warning':
1922
- return /*#__PURE__*/jsx(AlertCircleIcon, {
1923
- color: color
1924
- });
1925
-
1926
- case 'success':
1927
- return /*#__PURE__*/jsx(CheckIcon, {
1928
- color: color
1929
- });
1930
-
1931
- case 'danger':
1932
- return /*#__PURE__*/jsx(AlertTriangleIcon, {
1933
- color: color
1934
- });
1935
-
1936
- default:
1937
- return /*#__PURE__*/jsx(InfoIcon, {
1938
- color: color
1939
- });
1940
- }
1941
- }
2339
+ var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
2340
+ displayName: "InputTextContainer"
2341
+ })(["position:relative;"]);
1942
2342
 
1943
- var getColorByType = function (type) {
1944
- switch (type) {
1945
- case 'success':
1946
- return 'white';
2343
+ var _excluded$7 = ["id", "right", "minHeight", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoCompleteType", "keyboardType", "onFocus", "onBlur"];
1947
2344
 
1948
- case 'danger':
1949
- return 'white';
2345
+ function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1950
2346
 
1951
- case 'warning':
1952
- default:
1953
- return 'black';
1954
- }
1955
- };
1956
- var getIconButtonColor = function (messageType) {
1957
- switch (messageType) {
1958
- case 'success':
1959
- case 'danger':
1960
- return 'white';
2347
+ function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2348
+ var StyledTextInput = /*#__PURE__*/styled(TextInput).withConfig({
2349
+ displayName: "InputText__StyledTextInput"
2350
+ })(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, function (_ref) {
2351
+ var theme = _ref.theme,
2352
+ multiline = _ref.multiline;
1961
2353
 
1962
- case 'warning':
1963
- default:
1964
- return 'black';
2354
+ if (!multiline && Platform.OS === 'ios') {
2355
+ return theme.kitt.forms.input.padding.iOSSingleLine;
1965
2356
  }
1966
- };
1967
-
1968
- var StyledMessageContainer = /*#__PURE__*/styled.View.withConfig({
1969
- displayName: "BaseMessage__StyledMessageContainer"
1970
- })(["flex-direction:row;align-items:flex-start;justify-content:space-between;min-height:60px;padding-top:", "px;border-radius:", "px;background-color:", ";"], function (_ref) {
1971
- var _$insets$top;
1972
2357
 
1973
- var $insets = _ref.$insets;
1974
- return (_$insets$top = $insets === null || $insets === void 0 ? void 0 : $insets.top) !== null && _$insets$top !== void 0 ? _$insets$top : 0;
2358
+ return theme.kitt.forms.input.padding["default"];
1975
2359
  }, function (_ref2) {
1976
2360
  var theme = _ref2.theme,
1977
- $hasNoRadius = _ref2.$hasNoRadius;
1978
- return $hasNoRadius ? 0 : theme.kitt.spacing * 5;
1979
- }, function (_ref3) {
1980
- var theme = _ref3.theme,
1981
- $type = _ref3.$type;
1982
- return theme.kitt.feedbackMessage[$type].backgroundColor;
1983
- });
1984
- var StyledDismissWrapper = /*#__PURE__*/styled.View.withConfig({
1985
- displayName: "BaseMessage__StyledDismissWrapper"
1986
- })(["align-items:center;align-items:flex-start;margin:", ";"], function (_ref4) {
1987
- var theme = _ref4.theme;
1988
- var spacing = theme.kitt.spacing;
1989
- return "".concat(spacing * 2.5, "px ").concat(spacing * 2, "px 0 ").concat(spacing * 5, "px");
1990
- });
1991
- var StyledIconContainer = /*#__PURE__*/styled.View.withConfig({
1992
- displayName: "BaseMessage__StyledIconContainer"
1993
- })(["margin:", ";"], function (_ref5) {
1994
- var theme = _ref5.theme;
1995
- var spacing = theme.kitt.spacing;
1996
- return "".concat(spacing, "px ").concat(spacing * 5, "px 0 0");
1997
- });
1998
- var StyledTextContent = /*#__PURE__*/styled(Typography.Text).withConfig({
1999
- displayName: "BaseMessage__StyledTextContent"
2000
- })(["flex:1;text-align:", ";"], function (_ref6) {
2001
- var $isCenteredText = _ref6.$isCenteredText;
2002
- return $isCenteredText ? 'center' : 'left';
2003
- });
2004
- var StyledMessageContent = /*#__PURE__*/styled.View.withConfig({
2005
- displayName: "BaseMessage__StyledMessageContent"
2006
- })(["display:flex;flex-direction:row;flex-grow:1;align-self:center;align-items:flex-start;flex-shrink:1;padding:", ";"], function (_ref7) {
2007
- var theme = _ref7.theme;
2008
- var spacing = theme.kitt.spacing;
2009
- return "".concat(spacing * 4, "px ").concat(spacing * 5, "px");
2361
+ multiline = _ref2.multiline;
2362
+ if (!multiline && Platform.OS === 'ios') return 0;
2363
+ var typeConfigKey = getTypographyTypeConfigKey(theme);
2364
+ return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight, "px");
2365
+ }, function (_ref3) {
2366
+ var $minHeight = _ref3.$minHeight;
2367
+ return $minHeight;
2010
2368
  });
2011
- function BaseMessage(_ref8) {
2012
- var _ref8$type = _ref8.type,
2013
- type = _ref8$type === void 0 ? 'info' : _ref8$type,
2014
- children = _ref8.children,
2015
- hasNoRadius = _ref8.hasNoRadius,
2016
- centeredText = _ref8.centeredText,
2017
- insets = _ref8.insets,
2018
- onDismiss = _ref8.onDismiss;
2019
- var color = getColorByType(type);
2020
- return /*#__PURE__*/jsxs(StyledMessageContainer, {
2021
- $type: type,
2022
- $hasNoRadius: hasNoRadius,
2023
- $insets: insets,
2024
- children: [/*#__PURE__*/jsxs(StyledMessageContent, {
2025
- children: [centeredText ? null : /*#__PURE__*/jsx(StyledIconContainer, {
2026
- children: /*#__PURE__*/jsx(Icon, {
2027
- color: color,
2028
- icon: /*#__PURE__*/jsx(IconContent, {
2029
- type: type,
2030
- color: color
2031
- })
2032
- })
2033
- }), /*#__PURE__*/jsx(StyledTextContent, {
2034
- $isCenteredText: centeredText,
2035
- base: "body",
2036
- color: color,
2037
- children: children
2038
- })]
2039
- }), onDismiss ? /*#__PURE__*/jsx(StyledDismissWrapper, {
2040
- children: /*#__PURE__*/jsx(IconButton, {
2041
- color: getIconButtonColor(type),
2042
- icon: /*#__PURE__*/jsx(XIcon, {}),
2043
- onPress: onDismiss
2044
- })
2045
- }) : null]
2046
- });
2047
- }
2369
+ var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
2370
+ displayName: "InputText__RightInputContainer"
2371
+ })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
2372
+ var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
2373
+ var id = _ref4.id,
2374
+ right = _ref4.right,
2375
+ _ref4$minHeight = _ref4.minHeight,
2376
+ minHeight = _ref4$minHeight === void 0 ? 0 : _ref4$minHeight,
2377
+ formState = _ref4.state,
2378
+ internalForceState = _ref4.internalForceState,
2379
+ _ref4$disabled = _ref4.disabled,
2380
+ disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
2381
+ _ref4$autoCorrect = _ref4.autoCorrect,
2382
+ autoCorrect = _ref4$autoCorrect === void 0 ? true : _ref4$autoCorrect,
2383
+ _ref4$textContentType = _ref4.textContentType,
2384
+ textContentType = _ref4$textContentType === void 0 ? 'none' : _ref4$textContentType,
2385
+ _ref4$autoCompleteTyp = _ref4.autoCompleteType,
2386
+ autoCompleteType = _ref4$autoCompleteTyp === void 0 ? 'off' : _ref4$autoCompleteTyp,
2387
+ _ref4$keyboardType = _ref4.keyboardType,
2388
+ keyboardType = _ref4$keyboardType === void 0 ? 'default' : _ref4$keyboardType,
2389
+ _onFocus = _ref4.onFocus,
2390
+ _onBlur = _ref4.onBlur,
2391
+ props = _objectWithoutProperties(_ref4, _excluded$7);
2048
2392
 
2049
- function Message(_ref) {
2050
- var _ref$type = _ref.type,
2051
- type = _ref$type === void 0 ? 'info' : _ref$type,
2052
- children = _ref.children,
2053
- hasNoRadius = _ref.hasNoRadius,
2054
- centeredText = _ref.centeredText,
2055
- insets = _ref.insets,
2056
- onDismiss = _ref.onDismiss;
2057
- return /*#__PURE__*/jsx(BaseMessage, {
2058
- insets: insets,
2059
- hasNoRadius: hasNoRadius,
2060
- type: type,
2061
- centeredText: centeredText,
2062
- onDismiss: onDismiss,
2063
- children: children
2064
- });
2065
- }
2393
+ var theme = /*#__PURE__*/useTheme();
2066
2394
 
2067
- function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2395
+ var _useState = useState(false),
2396
+ _useState2 = _slicedToArray(_useState, 2),
2397
+ isFocused = _useState2[0],
2398
+ setIsFocused = _useState2[1];
2068
2399
 
2069
- function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2070
- // Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
2071
- var OverlayPressable = /*#__PURE__*/styled(Pressable).withConfig({
2072
- displayName: "Overlay__OverlayPressable"
2073
- })(function (_ref) {
2074
- var theme = _ref.theme;
2075
- return _objectSpread$4(_objectSpread$4({}, StyleSheet.absoluteFillObject), {}, {
2076
- backgroundColor: theme.kitt.colors.overlay.dark
2400
+ var state = internalForceState || getInputUIState({
2401
+ isFocused: isFocused,
2402
+ isDisabled: disabled,
2403
+ formState: formState
2077
2404
  });
2078
- });
2079
- function Overlay(_ref2) {
2080
- var onPress = _ref2.onPress;
2081
- return /*#__PURE__*/jsx(OverlayPressable, {
2082
- accessibilityRole: "none",
2083
- onPress: onPress,
2084
- children: /*#__PURE__*/jsx(View, {})
2405
+ return /*#__PURE__*/jsxs(InputTextContainer, {
2406
+ $isDisabled: disabled,
2407
+ children: [/*#__PURE__*/jsx(StyledTextInput, _objectSpread$c(_objectSpread$c({
2408
+ ref: ref,
2409
+ nativeID: id,
2410
+ editable: !disabled,
2411
+ keyboardType: keyboardType,
2412
+ autoCompleteType: autoCompleteType,
2413
+ autoCorrect: autoCorrect,
2414
+ $minHeight: minHeight,
2415
+ textContentType: textContentType,
2416
+ placeholderTextColor: theme.kitt.forms.input.color.placeholder,
2417
+ selectionColor: theme.kitt.forms.input.color.selection
2418
+ }, props), {}, {
2419
+ $state: state,
2420
+ onFocus: function onFocus(e) {
2421
+ setIsFocused(true);
2422
+ if (_onFocus) _onFocus(e);
2423
+ },
2424
+ onBlur: function onBlur(e) {
2425
+ setIsFocused(false);
2426
+ if (_onBlur) _onBlur(e);
2427
+ }
2428
+ })), right ? /*#__PURE__*/jsx(RightInputContainer, {
2429
+ children: right
2430
+ }) : null]
2085
2431
  });
2086
- }
2087
-
2088
- var BodyView = /*#__PURE__*/styled.View.withConfig({
2089
- displayName: "Body__BodyView"
2090
- })(["padding:", "px ", "px;"], function (_ref) {
2091
- var theme = _ref.theme;
2092
- return theme.kitt.spacing * 6;
2093
- }, function (_ref2) {
2094
- var theme = _ref2.theme;
2095
- return theme.kitt.spacing * 4;
2096
2432
  });
2097
- function ModalBody(_ref3) {
2098
- var children = _ref3.children;
2099
- return /*#__PURE__*/jsx(ScrollView, {
2100
- children: /*#__PURE__*/jsx(BodyView, {
2101
- children: children
2102
- })
2103
- });
2433
+
2434
+ function ownKeys$b(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2435
+
2436
+ function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$b(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2437
+ function InputEmail(props) {
2438
+ return /*#__PURE__*/jsx(InputText, _objectSpread$b({
2439
+ autoCompleteType: "email",
2440
+ keyboardType: "email-address",
2441
+ textContentType: "emailAddress"
2442
+ }, props));
2104
2443
  }
2105
2444
 
2106
- var FooterView = /*#__PURE__*/styled.View.withConfig({
2107
- displayName: "Footer__FooterView"
2108
- })(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], function (_ref) {
2109
- var theme = _ref.theme;
2110
- return theme.kitt.spacing * 4;
2111
- }, function (_ref2) {
2112
- var theme = _ref2.theme;
2113
- return theme.kitt.colors.separator;
2114
- });
2115
- function ModalFooter(_ref3) {
2116
- var children = _ref3.children;
2117
- return /*#__PURE__*/jsx(FooterView, {
2445
+ var getColorFromState = function (state) {
2446
+ switch (state) {
2447
+ case 'invalid':
2448
+ return 'danger';
2449
+
2450
+ case 'valid':
2451
+ default:
2452
+ return 'black-light';
2453
+ }
2454
+ };
2455
+
2456
+ function InputFeedback(_ref) {
2457
+ var state = _ref.state,
2458
+ testID = _ref.testID,
2459
+ children = _ref.children;
2460
+ return /*#__PURE__*/jsx(Typography.Text, {
2461
+ base: "body-small",
2462
+ color: getColorFromState(state),
2463
+ testID: testID,
2118
2464
  children: children
2119
2465
  });
2120
2466
  }
2121
2467
 
2122
- var OnCloseContext = /*#__PURE__*/createContext(function () {});
2123
-
2124
- var HeaderView = /*#__PURE__*/styled.View.withConfig({
2125
- displayName: "Header__HeaderView"
2126
- })(["position:relative;padding:", "px;display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;align-items:center;border-bottom-width:1px;border-bottom-color:", ";min-height:57px;"], function (_ref) {
2468
+ var FieldContainer = /*#__PURE__*/styled.View.withConfig({
2469
+ displayName: "InputField__FieldContainer"
2470
+ })(["padding:5px 0 10px;"]);
2471
+ var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
2472
+ displayName: "InputField__FeedbackContainer"
2473
+ })(["", ";"], function (_ref) {
2127
2474
  var theme = _ref.theme;
2128
- return theme.kitt.spacing * 2;
2129
- }, function (_ref2) {
2475
+ return theme.responsive.ifWindowSizeMatches({
2476
+ minWidth: KittBreakpoints.SMALL
2477
+ }, 'padding-top: 10px', 'padding-top: 5px');
2478
+ });
2479
+ var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
2480
+ displayName: "InputField__FieldLabelContainer"
2481
+ })(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
2130
2482
  var theme = _ref2.theme;
2131
- return theme.kitt.colors.separator;
2483
+ return theme.kitt.forms.inputField.labelContainerPaddingBottom;
2132
2484
  });
2133
- var LeftIconView = /*#__PURE__*/styled.View.withConfig({
2134
- displayName: "Header__LeftIconView"
2135
- })(["align-self:flex-start;margin-right:", "px;"], function (_ref3) {
2485
+ var LabelContainer = /*#__PURE__*/styled.View.withConfig({
2486
+ displayName: "InputField__LabelContainer"
2487
+ })(["margin-right:", "px;"], function (_ref3) {
2136
2488
  var theme = _ref3.theme;
2137
- return theme.kitt.spacing * 2;
2138
- });
2139
- var RightIconView = /*#__PURE__*/styled.View.withConfig({
2140
- displayName: "Header__RightIconView"
2141
- })(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
2142
- var theme = _ref4.theme;
2143
- return theme.kitt.spacing * 2;
2489
+ return theme.kitt.forms.inputField.iconMarginLeft;
2144
2490
  });
2145
- var TitleView = /*#__PURE__*/styled.View.withConfig({
2146
- displayName: "Header__TitleView"
2147
- })(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
2148
- var theme = _ref5.theme,
2149
- isIconLeft = _ref5.isIconLeft;
2150
- return isIconLeft ? 0 : theme.kitt.spacing * 2;
2151
- });
2152
- function ModalHeader(_ref6) {
2153
- var left = _ref6.left,
2154
- right = _ref6.right,
2155
- children = _ref6.children;
2156
- var onClose = useContext(OnCloseContext);
2157
- var isIconLeft = !!left;
2158
- return /*#__PURE__*/jsxs(HeaderView, {
2159
- children: [isIconLeft && /*#__PURE__*/jsx(LeftIconView, {
2160
- children: left
2161
- }), /*#__PURE__*/jsx(TitleView, {
2162
- isIconLeft: isIconLeft,
2163
- children: children
2164
- }), right !== undefined ? right : /*#__PURE__*/jsx(RightIconView, {
2165
- children: /*#__PURE__*/jsx(Button, {
2166
- type: "subtle-dark",
2167
- icon: /*#__PURE__*/jsx(XIcon, {}),
2168
- onPress: onClose
2169
- })
2170
- })]
2491
+ function InputField(_ref4) {
2492
+ var label = _ref4.label,
2493
+ labelFeedback = _ref4.labelFeedback,
2494
+ input = _ref4.input,
2495
+ feedback = _ref4.feedback;
2496
+ return /*#__PURE__*/jsxs(FieldContainer, {
2497
+ children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
2498
+ children: [/*#__PURE__*/jsx(LabelContainer, {
2499
+ children: label
2500
+ }), labelFeedback]
2501
+ }) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
2502
+ children: feedback
2503
+ }) : null]
2171
2504
  });
2172
2505
  }
2173
2506
 
2174
- var ModalView = /*#__PURE__*/styled.View.withConfig({
2175
- displayName: "Modal__ModalView"
2176
- })(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], function (_ref) {
2177
- var theme = _ref.theme;
2178
- return theme.kitt.spacing * 20;
2179
- }, function (_ref2) {
2180
- var theme = _ref2.theme;
2181
- return theme.kitt.spacing * 4;
2182
- });
2183
- var ContentView = /*#__PURE__*/styled.View.withConfig({
2184
- displayName: "Modal__ContentView"
2185
- })(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], function (_ref3) {
2186
- var theme = _ref3.theme;
2187
- return theme.kitt.card.borderRadius;
2188
- }, function (_ref4) {
2189
- var theme = _ref4.theme;
2190
- return theme.kitt.colors.uiBackgroundLight;
2191
- });
2192
- function Modal(_ref5) {
2193
- var visible = _ref5.visible,
2194
- children = _ref5.children,
2195
- onClose = _ref5.onClose,
2196
- onEntered = _ref5.onEntered,
2197
- onExited = _ref5.onExited;
2198
- return /*#__PURE__*/jsx(OnCloseContext.Provider, {
2199
- value: onClose,
2200
- children: /*#__PURE__*/jsx(Modal$1, {
2201
- transparent: true,
2202
- animationType: "fade",
2203
- visible: visible,
2204
- onShow: onEntered,
2205
- onDismiss: onExited,
2206
- onRequestClose: onClose,
2207
- children: /*#__PURE__*/jsxs(ModalView, {
2208
- children: [/*#__PURE__*/jsx(Overlay, {
2209
- onPress: onClose
2210
- }), /*#__PURE__*/jsx(ContentView, {
2211
- children: children
2212
- })]
2213
- })
2214
- })
2215
- });
2216
- }
2217
- Modal.Header = ModalHeader;
2218
- Modal.Body = ModalBody;
2219
- Modal.Footer = ModalFooter;
2507
+ function getIconColor(state, disabled) {
2508
+ if (disabled) return 'black-light';
2220
2509
 
2221
- function Notification(_ref) {
2222
- var type = _ref.type,
2223
- children = _ref.children,
2224
- centeredText = _ref.centeredText,
2225
- insets = _ref.insets,
2226
- onDelete = _ref.onDelete,
2227
- onDismiss = _ref.onDismiss;
2510
+ switch (state) {
2511
+ case 'invalid':
2512
+ return 'danger';
2228
2513
 
2229
- if ((process.env.NODE_ENV !== "production")) {
2230
- if (onDelete) {
2231
- throw new Error('onDelete is deprecated us onDismiss instead');
2232
- }
2233
- }
2514
+ case 'valid':
2515
+ return 'success';
2234
2516
 
2235
- return /*#__PURE__*/jsx(BaseMessage, {
2236
- hasNoRadius: true,
2237
- type: type,
2238
- centeredText: centeredText,
2239
- insets: insets,
2240
- onDismiss: onDismiss,
2241
- children: children
2242
- });
2517
+ default:
2518
+ return undefined;
2519
+ }
2243
2520
  }
2244
2521
 
2245
- var Container$2 = /*#__PURE__*/styled.View.withConfig({
2246
- displayName: "SkeletonContent__Container"
2247
- })(["background-color:", ";border-color:", ";height:100%;width:100%;"], function (_ref) {
2248
- var theme = _ref.theme;
2249
- return theme.kitt.skeleton.backgroundColor;
2250
- }, function (_ref2) {
2251
- var theme = _ref2.theme;
2252
- return theme.kitt.skeleton.flareColor;
2253
- });
2254
- var AnimatedLinearGradient = Animated$1.createAnimatedComponent(LinearGradient);
2255
- function SkeletonContent(_ref3) {
2256
- var isLoading = _ref3.isLoading,
2257
- width = _ref3.width;
2522
+ function InputIcon(_ref) {
2523
+ var icon = _ref.icon,
2524
+ state = _ref.state,
2525
+ disabled = _ref.disabled;
2258
2526
  var theme = /*#__PURE__*/useTheme();
2259
- var sharedX = useSharedValue(0);
2260
- useEffect(function () {
2261
- if (isLoading) {
2262
- sharedX.value = withRepeat(withTiming(1, {
2263
- duration: theme.kitt.skeleton.animationDuration,
2264
- easing: Easing$1.inOut(Easing$1.ease)
2265
- }), -1);
2266
- }
2267
- }, [sharedX, width, isLoading, theme]);
2268
- var linearGradientStyle = useAnimatedStyle(function () {
2269
- var _f = function () {
2270
- return {
2271
- transform: [{
2272
- translateX: interpolate(sharedX.value, [0, 1], [-width, width])
2273
- }]
2274
- };
2275
- };
2527
+ var color = getIconColor(state, disabled);
2528
+ return /*#__PURE__*/jsx(TypographyIcon, {
2529
+ color: color,
2530
+ icon: icon,
2531
+ size: theme.kitt.forms.input.icon.size
2532
+ });
2533
+ }
2276
2534
 
2277
- _f._closure = {
2278
- interpolate: interpolate,
2279
- sharedX: sharedX,
2280
- width: width
2281
- };
2282
- _f.asString = "function _f(){const{interpolate,sharedX,width}=jsThis._closure;{return{transform:[{translateX:interpolate(sharedX.value,[0,1],[-width,width])}]};}}";
2283
- _f.__workletHash = 1670955855244;
2284
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (41:47)";
2285
- _f.__optimalization = 3;
2535
+ function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2286
2536
 
2287
- global.__reanimatedWorkletInit(_f);
2537
+ function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$a(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2538
+ function InputPressable(_ref) {
2539
+ var props = _extends({}, _ref);
2288
2540
 
2289
- return _f;
2290
- }());
2291
- return /*#__PURE__*/jsx(Container$2, {
2292
- children: /*#__PURE__*/jsx(AnimatedLinearGradient, {
2293
- colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
2294
- locations: [0.1, 0.5, 0.9],
2295
- start: {
2296
- x: 0,
2297
- y: 0
2298
- },
2299
- end: {
2300
- x: 1,
2301
- y: 0
2302
- },
2303
- style: [StyleSheet.absoluteFill, linearGradientStyle]
2304
- })
2305
- });
2541
+ return /*#__PURE__*/jsx(Pressable, _objectSpread$a({}, props));
2306
2542
  }
2307
2543
 
2308
- var SkeletonContainer = /*#__PURE__*/styled(View).withConfig({
2309
- displayName: "Skeleton__SkeletonContainer"
2310
- })(["overflow:hidden;"]);
2311
- function Skeleton(_ref) {
2312
- var isLoading = _ref.isLoading,
2313
- style = _ref.style;
2544
+ var _excluded$6 = ["isPasswordDefaultVisible", "right"];
2314
2545
 
2315
- var _useState = useState(0),
2546
+ function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2547
+
2548
+ function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$9(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2549
+ function InputPassword(_ref) {
2550
+ var isPasswordDefaultVisible = _ref.isPasswordDefaultVisible,
2551
+ right = _ref.right,
2552
+ props = _objectWithoutProperties(_ref, _excluded$6);
2553
+
2554
+ var _useState = useState(Boolean(isPasswordDefaultVisible)),
2316
2555
  _useState2 = _slicedToArray(_useState, 2),
2317
- width = _useState2[0],
2318
- setWidth = _useState2[1];
2556
+ isVisible = _useState2[0],
2557
+ setIsVisible = _useState2[1];
2319
2558
 
2320
- return /*#__PURE__*/jsx(SkeletonContainer, {
2321
- style: style,
2322
- onLayout: function onLayout(_ref2) {
2323
- var nativeEvent = _ref2.nativeEvent;
2324
- return setWidth(nativeEvent.layout.width);
2325
- },
2326
- children: /*#__PURE__*/jsx(SkeletonContent, {
2327
- isLoading: isLoading,
2328
- width: width
2559
+ return /*#__PURE__*/jsx(InputText, _objectSpread$9(_objectSpread$9({}, props), {}, {
2560
+ textContentType: "password",
2561
+ autoCompleteType: "password",
2562
+ autoCorrect: false,
2563
+ secureTextEntry: !isVisible,
2564
+ right: right || /*#__PURE__*/jsx(InputPressable, {
2565
+ accessibilityRole: "button",
2566
+ onPress: function onPress() {
2567
+ return setIsVisible(function (prev) {
2568
+ return !prev;
2569
+ });
2570
+ },
2571
+ children: /*#__PURE__*/jsx(InputIcon, {
2572
+ icon: isVisible ? /*#__PURE__*/jsx(EyeOffIcon, {}) : /*#__PURE__*/jsx(EyeIcon, {})
2573
+ })
2329
2574
  })
2330
- });
2575
+ }));
2331
2576
  }
2332
- var Bar = /*#__PURE__*/styled(Skeleton).withConfig({
2333
- displayName: "Skeleton__Bar"
2334
- })(["width:100%;height:", "px;border-radius:", "px;"], function (_ref3) {
2335
- var theme = _ref3.theme;
2577
+
2578
+ function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2579
+
2580
+ function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$8(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2581
+ function InputPhone(props) {
2582
+ return /*#__PURE__*/jsx(InputText, _objectSpread$8(_objectSpread$8({}, props), {}, {
2583
+ autoCompleteType: "tel",
2584
+ keyboardType: "number-pad",
2585
+ textContentType: "telephoneNumber"
2586
+ }));
2587
+ }
2588
+
2589
+ var getTypographyColor = function (type) {
2590
+ return type ? 'white' : 'black';
2591
+ };
2592
+
2593
+ var InputTagContainer = /*#__PURE__*/styled(View).withConfig({
2594
+ displayName: "InputTag__InputTagContainer"
2595
+ })(["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) {
2596
+ var theme = _ref.theme;
2336
2597
  return theme.kitt.spacing * 2;
2337
- }, function (_ref4) {
2598
+ }, function (_ref2) {
2599
+ var theme = _ref2.theme,
2600
+ type = _ref2.type;
2601
+
2602
+ if (type === 'success') {
2603
+ return theme.kitt.forms.inputTag.success.backgroundColor;
2604
+ }
2605
+
2606
+ if (type === 'danger') {
2607
+ return theme.kitt.forms.inputTag.danger.backgroundColor;
2608
+ }
2609
+
2610
+ return theme.kitt.forms.inputTag["default"].backgroundColor;
2611
+ }, function (_ref3) {
2612
+ var theme = _ref3.theme;
2613
+ return theme.kitt.forms.inputTag.borderRadius;
2614
+ });
2615
+ var IconContainer = /*#__PURE__*/styled(View).withConfig({
2616
+ displayName: "InputTag__IconContainer"
2617
+ })(["margin-right:", "px;"], function (_ref4) {
2338
2618
  var theme = _ref4.theme;
2339
- return theme.kitt.spacing * 2;
2619
+ return theme.kitt.spacing;
2340
2620
  });
2341
- var Circle = /*#__PURE__*/styled(Skeleton).withConfig({
2342
- displayName: "Skeleton__Circle"
2343
- })(["width:", "px;height:", "px;border-radius:", "px;"], function (_ref5) {
2344
- var theme = _ref5.theme;
2345
- return theme.kitt.spacing * 12;
2621
+ function InputTag(_ref5) {
2622
+ var children = _ref5.children,
2623
+ type = _ref5.type,
2624
+ icon = _ref5.icon;
2625
+ var typographyColor = getTypographyColor(type);
2626
+ var theme = useKittTheme();
2627
+ return /*#__PURE__*/jsxs(InputTagContainer, {
2628
+ type: type,
2629
+ children: [icon && /*#__PURE__*/jsx(IconContainer, {
2630
+ children: /*#__PURE__*/jsx(TypographyIcon, {
2631
+ icon: icon,
2632
+ size: theme.kitt.forms.inputTag.iconSize,
2633
+ color: typographyColor
2634
+ })
2635
+ }), /*#__PURE__*/jsx(Typography.Text, {
2636
+ base: "body-small",
2637
+ color: typographyColor,
2638
+ children: children
2639
+ })]
2640
+ });
2641
+ }
2642
+
2643
+ function Label(_ref) {
2644
+ var htmlFor = _ref.htmlFor,
2645
+ children = _ref.children;
2646
+ return /*#__PURE__*/jsx(Typography.Text, {
2647
+ base: "body",
2648
+ children: Platform.OS === 'web' ? /*#__PURE__*/jsx("label", {
2649
+ htmlFor: htmlFor,
2650
+ children: children
2651
+ }) : children
2652
+ });
2653
+ }
2654
+
2655
+ var OuterRadio = /*#__PURE__*/styled.View.withConfig({
2656
+ displayName: "Radio__OuterRadio"
2657
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], function (_ref) {
2658
+ var theme = _ref.theme,
2659
+ disabled = _ref.disabled;
2660
+ return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor;
2661
+ }, function (_ref2) {
2662
+ var theme = _ref2.theme;
2663
+ return theme.kitt.forms.radio.size;
2664
+ }, function (_ref3) {
2665
+ var theme = _ref3.theme;
2666
+ return theme.kitt.forms.radio.size;
2667
+ }, function (_ref4) {
2668
+ var theme = _ref4.theme;
2669
+ return theme.kitt.forms.radio.size / 2;
2670
+ }, function (_ref5) {
2671
+ var theme = _ref5.theme;
2672
+ return theme.kitt.forms.radio.unchecked.borderWidth;
2346
2673
  }, function (_ref6) {
2347
- var theme = _ref6.theme;
2348
- return theme.kitt.spacing * 12;
2349
- }, function (_ref7) {
2350
- var theme = _ref7.theme;
2351
- return theme.kitt.spacing * 6;
2674
+ var theme = _ref6.theme,
2675
+ disabled = _ref6.disabled;
2676
+ return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor;
2352
2677
  });
2353
- var Square = /*#__PURE__*/styled(Skeleton).withConfig({
2354
- displayName: "Skeleton__Square"
2355
- })(["width:", "px;height:", "px;border-radius:", "px;"], function (_ref8) {
2678
+ var SelectedOuterRadio = /*#__PURE__*/styled.View.withConfig({
2679
+ displayName: "Radio__SelectedOuterRadio"
2680
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], function (_ref7) {
2681
+ var theme = _ref7.theme;
2682
+ return theme.kitt.forms.radio.checked.backgroundColor;
2683
+ }, function (_ref8) {
2356
2684
  var theme = _ref8.theme;
2357
- return theme.kitt.spacing * 12;
2685
+ return theme.kitt.forms.radio.size;
2358
2686
  }, function (_ref9) {
2359
2687
  var theme = _ref9.theme;
2360
- return theme.kitt.spacing * 12;
2688
+ return theme.kitt.forms.radio.size;
2361
2689
  }, function (_ref10) {
2362
2690
  var theme = _ref10.theme;
2363
- return theme.kitt.spacing * 1.5;
2691
+ return theme.kitt.forms.radio.size / 2;
2364
2692
  });
2365
- Skeleton.Bar = Bar;
2366
- Skeleton.Circle = Circle;
2367
- Skeleton.Square = Square;
2693
+ var SelectedInnerRadio = /*#__PURE__*/styled.View.withConfig({
2694
+ displayName: "Radio__SelectedInnerRadio"
2695
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], function (_ref11) {
2696
+ var theme = _ref11.theme;
2697
+ return theme.kitt.forms.radio.checked.innerBackgroundColor;
2698
+ }, function (_ref12) {
2699
+ var theme = _ref12.theme;
2700
+ return theme.kitt.forms.radio.checked.innerSize;
2701
+ }, function (_ref13) {
2702
+ var theme = _ref13.theme;
2703
+ return theme.kitt.forms.radio.checked.innerSize;
2704
+ }, function (_ref14) {
2705
+ var theme = _ref14.theme;
2706
+ return theme.kitt.forms.radio.checked.innerSize / 2;
2707
+ });
2708
+ var Container$4 = /*#__PURE__*/styled.Pressable.withConfig({
2709
+ displayName: "Radio__Container"
2710
+ })(["flex-direction:row;align-items:center;"]);
2711
+ var Text = /*#__PURE__*/styled(Typography.Text).withConfig({
2712
+ displayName: "Radio__Text"
2713
+ })(["margin-left:", "px;"], function (_ref15) {
2714
+ var theme = _ref15.theme;
2715
+ return theme.kitt.spacing * 2;
2716
+ });
2717
+ function Radio(_ref16) {
2718
+ var id = _ref16.id,
2719
+ checked = _ref16.checked,
2720
+ onChange = _ref16.onChange,
2721
+ value = _ref16.value,
2722
+ _ref16$disabled = _ref16.disabled,
2723
+ disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
2724
+ children = _ref16.children;
2725
+ return /*#__PURE__*/jsxs(Container$4, {
2726
+ nativeID: id,
2727
+ disabled: disabled,
2728
+ accessibilityRole: "radio",
2729
+ "aria-checked": checked,
2730
+ focusable: checked && !disabled,
2731
+ onPress: function handlePress() {
2732
+ onChange(value);
2733
+ },
2734
+ children: [checked && !disabled ? /*#__PURE__*/jsx(SelectedOuterRadio, {
2735
+ children: /*#__PURE__*/jsx(SelectedInnerRadio, {})
2736
+ }) : /*#__PURE__*/jsx(OuterRadio, {
2737
+ disabled: disabled
2738
+ }), /*#__PURE__*/jsx(Text, {
2739
+ base: "body",
2740
+ color: disabled ? 'black-light' : 'black',
2741
+ children: children
2742
+ })]
2743
+ });
2744
+ }
2368
2745
 
2369
- var Flex = /*#__PURE__*/styled.View.withConfig({
2370
- shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
2371
- return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
2372
- }
2373
- }).withConfig({
2374
- displayName: "Flex"
2375
- })(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], function (_ref) {
2376
- var direction = _ref.direction;
2377
- return direction;
2746
+ function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2747
+
2748
+ function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2749
+ function TextArea(_ref) {
2750
+ var props = _extends({}, _ref);
2751
+
2752
+ var theme = /*#__PURE__*/useTheme();
2753
+ return /*#__PURE__*/jsx(InputText, _objectSpread$7({
2754
+ multiline: true,
2755
+ textAlignVertical: "top",
2756
+ minHeight: theme.kitt.forms.textArea.minHeight
2757
+ }, props));
2758
+ }
2759
+
2760
+ var Body = /*#__PURE__*/styled.View.withConfig({
2761
+ displayName: "Body"
2762
+ })(["", " background-color:", ";flex:1;"], function (_ref) {
2763
+ var theme = _ref.theme;
2764
+ return theme.responsive.ifWindowSizeMatches({
2765
+ minWidth: KittBreakpoints.MEDIUM
2766
+ }, "padding-right: ".concat(theme.kitt.spacing * 12, "px;\n padding-left: ").concat(theme.kitt.spacing * 12, "px;"), "padding-right: ".concat(theme.kitt.spacing * 6, "px;\n padding-left: ").concat(theme.kitt.spacing * 6, "px;"));
2378
2767
  }, function (_ref2) {
2379
- var theme = _ref2.theme,
2380
- _ref2$padding = _ref2.padding,
2381
- padding = _ref2$padding === void 0 ? 0 : _ref2$padding;
2382
- return padding * theme.kitt.spacing;
2768
+ var theme = _ref2.theme;
2769
+ return theme.kitt.colors.uiBackgroundLight;
2383
2770
  });
2771
+ function FullScreenModalBody(_ref3) {
2772
+ var children = _ref3.children;
2773
+ return /*#__PURE__*/jsx(Body, {
2774
+ children: children
2775
+ });
2776
+ }
2384
2777
 
2385
- var storyPadding = 16;
2778
+ var SideContainer = /*#__PURE__*/styled.View.withConfig({
2779
+ displayName: "Header__SideContainer"
2780
+ })(["", ""], function (_ref) {
2781
+ var theme = _ref.theme,
2782
+ _ref$side = _ref.side,
2783
+ side = _ref$side === void 0 ? 'left' : _ref$side;
2784
+ var padding = theme.kitt.spacing * 2;
2386
2785
 
2387
- var getBackgroundColorFromBlockColor = function (theme) {
2388
- var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'transparent';
2786
+ if (side === 'left') {
2787
+ return "padding-right: ".concat(padding, "px;");
2788
+ }
2389
2789
 
2390
- switch (color) {
2391
- case 'dark':
2392
- return '#293033';
2790
+ return "padding-left: ".concat(padding, "px;");
2791
+ });
2393
2792
 
2394
- case 'light':
2395
- return '#ffffff';
2793
+ function getHeaderHorizontalMediumPadding(spacing) {
2794
+ return spacing * 6;
2795
+ }
2396
2796
 
2397
- case 'primary':
2398
- return theme.kitt.palettes.lateOcean.lateOcean;
2797
+ var Header = /*#__PURE__*/styled.View.withConfig({
2798
+ displayName: "Header"
2799
+ })(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], function (_ref2) {
2800
+ var theme = _ref2.theme,
2801
+ _ref2$insetTop = _ref2.insetTop,
2802
+ insetTop = _ref2$insetTop === void 0 ? 0 : _ref2$insetTop;
2803
+ var paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
2804
+ var _theme$kitt$fullScree = theme.kitt.fullScreenModal.header,
2805
+ paddingVertical = _theme$kitt$fullScree.paddingVertical,
2806
+ paddingHorizontal = _theme$kitt$fullScree.paddingHorizontal;
2807
+ return theme.responsive.ifWindowSizeMatches({
2808
+ minWidth: KittBreakpoints.MEDIUM
2809
+ }, "padding: ".concat(paddingTop, "px ").concat(getHeaderHorizontalMediumPadding(theme.kitt.spacing), "px ").concat(paddingVertical, "px;"), "padding: ".concat(paddingTop, "px ").concat(paddingHorizontal, "px ").concat(paddingVertical, "px;"));
2810
+ }, function (_ref3) {
2811
+ var theme = _ref3.theme;
2812
+ return theme.kitt.fullScreenModal.header.borderColor;
2813
+ });
2814
+ var HeaderContent = /*#__PURE__*/styled.View.withConfig({
2815
+ displayName: "Header__HeaderContent"
2816
+ })(["", ";", ";justify-content:center;align-items:center;"], function (_ref4) {
2817
+ var theme = _ref4.theme,
2818
+ leftWidth = _ref4.leftWidth,
2819
+ rightWidth = _ref4.rightWidth,
2820
+ windowWidth = _ref4.windowWidth;
2399
2821
 
2400
- default:
2401
- return 'transparent';
2402
- }
2403
- };
2822
+ /*
2823
+ * Since we don't have controll over the rendered left and right elements,
2824
+ * we must apply some logic to give the title all the available space
2825
+ */
2826
+ var sideElementMaxWidth = Math.max(leftWidth, rightWidth);
2827
+ var parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
2828
+ var parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
2404
2829
 
2405
- var getTypographyColorFromBlockColor = function () {
2406
- var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transparent';
2830
+ var computeWidth = function (breakpointPadding) {
2831
+ return windowWidth - breakpointPadding - sideElementMaxWidth * 2;
2832
+ };
2407
2833
 
2408
- switch (color) {
2409
- case 'dark':
2410
- case 'primary':
2411
- return 'white';
2834
+ return theme.responsive.ifWindowSizeMatches({
2835
+ minWidth: KittBreakpoints.MEDIUM
2836
+ }, "width: ".concat(computeWidth(parentHorizontalPaddingMedium), "px;"), "width: ".concat(computeWidth(parentHorizontalPadding), "px;"));
2837
+ }, function (_ref5) {
2838
+ var leftWidth = _ref5.leftWidth,
2839
+ rightWidth = _ref5.rightWidth;
2840
+ // Depending of the wider element, we must add a margin to fill the diff in space between elements
2841
+ var deltaMargin = Math.abs(leftWidth - rightWidth);
2412
2842
 
2413
- case 'light':
2414
- default:
2415
- return 'black';
2843
+ if (leftWidth > rightWidth) {
2844
+ return "margin-right: ".concat(deltaMargin, "px;");
2416
2845
  }
2417
- };
2418
2846
 
2419
- var StoryBlockBackgroundContext = /*#__PURE__*/createContext('transparent');
2420
- var StoryBlockColorContext = /*#__PURE__*/createContext('black');
2421
- var useStoryBlockColor = function (color) {
2422
- var storyBlockColor = useContext(StoryBlockColorContext);
2423
- return color || storyBlockColor;
2424
- };
2425
- var StyledStoryBlockView = /*#__PURE__*/styled.View.withConfig({
2426
- displayName: "StoryBlock__StyledStoryBlockView"
2427
- })(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, function (_ref) {
2428
- var theme = _ref.theme,
2429
- background = _ref.background;
2430
- return getBackgroundColorFromBlockColor(theme, background);
2847
+ return "margin-left: ".concat(deltaMargin, "px;");
2431
2848
  });
2432
- function StoryBlock(_ref2) {
2433
- var children = _ref2.children,
2434
- background = _ref2.background;
2435
- return /*#__PURE__*/jsx(StyledStoryBlockView, {
2436
- background: background,
2437
- children: /*#__PURE__*/jsx(StoryBlockColorContext.Provider, {
2438
- value: getTypographyColorFromBlockColor(background),
2439
- children: /*#__PURE__*/jsx(StoryBlockBackgroundContext.Provider, {
2440
- value: background,
2441
- children: children
2442
- })
2443
- })
2444
- });
2445
- }
2849
+ function FullScreenModalHeader(_ref6) {
2850
+ var children = _ref6.children,
2851
+ right = _ref6.right,
2852
+ left = _ref6.left;
2446
2853
 
2447
- var StoryTitleContainer = /*#__PURE__*/styled.View.withConfig({
2448
- displayName: "StoryTitle__StoryTitleContainer"
2449
- })(["margin-bottom:30px;"]);
2450
- var StorySubTitleContainer = /*#__PURE__*/styled.View.withConfig({
2451
- displayName: "StoryTitle__StorySubTitleContainer"
2452
- })(["margin-bottom:10px;"]);
2453
- function StoryTitle(_ref) {
2454
- var color = _ref.color,
2455
- children = _ref.children,
2456
- numberOfLines = _ref.numberOfLines;
2457
- return /*#__PURE__*/jsx(StoryTitleContainer, {
2458
- children: /*#__PURE__*/jsx(Typography.Header1, {
2459
- variant: "bold",
2460
- base: "header1",
2461
- color: useStoryBlockColor(color),
2462
- numberOfLines: numberOfLines,
2463
- children: children
2464
- })
2465
- });
2466
- }
2854
+ var _useSafeAreaInsets = useSafeAreaInsets(),
2855
+ top = _useSafeAreaInsets.top;
2467
2856
 
2468
- function StoryTitleLevel2(_ref2) {
2469
- var color = _ref2.color,
2470
- children = _ref2.children,
2471
- numberOfLines = _ref2.numberOfLines;
2472
- return /*#__PURE__*/jsx(StoryTitleContainer, {
2473
- children: /*#__PURE__*/jsx(Typography.Header2, {
2474
- variant: "bold",
2475
- base: "header2",
2476
- color: useStoryBlockColor(color),
2477
- numberOfLines: numberOfLines,
2478
- children: children
2479
- })
2480
- });
2481
- }
2857
+ var dimensions = useWindowDimensions();
2482
2858
 
2483
- StoryTitleLevel2.displayName = 'StoryTitle.Level2';
2859
+ var _useState = useState(0),
2860
+ _useState2 = _slicedToArray(_useState, 2),
2861
+ leftWidth = _useState2[0],
2862
+ setLeftWidth = _useState2[1];
2484
2863
 
2485
- function StoryTitleLevel3(_ref3) {
2486
- var color = _ref3.color,
2487
- children = _ref3.children,
2488
- numberOfLines = _ref3.numberOfLines;
2489
- return /*#__PURE__*/jsx(StorySubTitleContainer, {
2490
- children: /*#__PURE__*/jsx(Typography.Header3, {
2491
- variant: "bold",
2492
- base: "header3",
2493
- medium: "header4",
2494
- color: useStoryBlockColor(color),
2495
- numberOfLines: numberOfLines,
2496
- children: children
2497
- })
2498
- });
2499
- }
2864
+ var _useState3 = useState(0),
2865
+ _useState4 = _slicedToArray(_useState3, 2),
2866
+ rightWidth = _useState4[0],
2867
+ setRightWidth = _useState4[1];
2500
2868
 
2501
- StoryTitleLevel3.displayName = 'StoryTitle.Level3';
2869
+ var handleLayoutChange = function (event, side) {
2870
+ // Prevents react to nullify event on rerenders
2871
+ event.persist();
2502
2872
 
2503
- function StoryTitleLevel4(_ref4) {
2504
- var color = _ref4.color,
2505
- children = _ref4.children,
2506
- numberOfLines = _ref4.numberOfLines;
2507
- return /*#__PURE__*/jsx(StorySubTitleContainer, {
2508
- children: /*#__PURE__*/jsx(Typography.Header4, {
2509
- variant: "bold",
2510
- base: "header4",
2511
- medium: "header5",
2512
- color: useStoryBlockColor(color),
2513
- numberOfLines: numberOfLines,
2873
+ if (side === 'left') {
2874
+ setLeftWidth(event.nativeEvent.layout.width);
2875
+ return;
2876
+ }
2877
+
2878
+ setRightWidth(event.nativeEvent.layout.width);
2879
+ };
2880
+
2881
+ return /*#__PURE__*/jsxs(Header, {
2882
+ insetTop: Platform.OS === 'ios' ? undefined : top,
2883
+ children: [left ? /*#__PURE__*/jsx(SideContainer, {
2884
+ onLayout: function onLayout(e) {
2885
+ return handleLayoutChange(e, 'left');
2886
+ },
2887
+ children: left
2888
+ }) : null, /*#__PURE__*/jsx(HeaderContent, {
2889
+ windowWidth: dimensions.width,
2890
+ leftWidth: leftWidth,
2891
+ rightWidth: rightWidth,
2514
2892
  children: children
2515
- })
2893
+ }), right ? /*#__PURE__*/jsx(SideContainer, {
2894
+ side: "right",
2895
+ onLayout: function onLayout(e) {
2896
+ return handleLayoutChange(e, 'right');
2897
+ },
2898
+ children: right
2899
+ }) : null]
2516
2900
  });
2517
2901
  }
2518
2902
 
2519
- StoryTitleLevel4.displayName = 'StoryTitle.Level3';
2520
- StoryTitle.Level2 = StoryTitleLevel2;
2521
- StoryTitle.Level3 = StoryTitleLevel3;
2522
- StoryTitle.Level4 = StoryTitleLevel4;
2523
-
2524
- var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
2525
- displayName: "Story__StoryContainer"
2526
- })(["padding:", "px;"], storyPadding);
2527
- function Story(_ref) {
2528
- var title = _ref.title,
2529
- contentContainerStyle = _ref.contentContainerStyle,
2530
- children = _ref.children;
2531
- return /*#__PURE__*/jsxs(StoryContainer$1, {
2532
- contentContainerStyle: contentContainerStyle,
2533
- children: [/*#__PURE__*/jsx(StoryTitle, {
2534
- children: title
2535
- }), children]
2903
+ var Container$3 = /*#__PURE__*/styled.View.withConfig({
2904
+ displayName: "FullScreenModal__Container"
2905
+ })(["flex:1;background-color:", ";"], function (_ref) {
2906
+ var theme = _ref.theme;
2907
+ return theme.kitt.colors.uiBackground;
2908
+ });
2909
+ function FullScreenModal(_ref2) {
2910
+ var children = _ref2.children;
2911
+ return /*#__PURE__*/jsx(Container$3, {
2912
+ children: children
2536
2913
  });
2537
2914
  }
2915
+ FullScreenModal.Header = FullScreenModalHeader;
2916
+ FullScreenModal.Body = FullScreenModalBody;
2538
2917
 
2539
- var _excluded$2 = ["title", "children", "internalIsDemoSection"],
2540
- _excluded2 = ["title", "children"],
2541
- _excluded3 = ["title", "children"];
2918
+ var _excluded$5 = ["children"];
2542
2919
 
2543
- function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2920
+ function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2544
2921
 
2545
- function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2546
- var StyledSection = /*#__PURE__*/styled.View.withConfig({
2547
- displayName: "StorySection__StyledSection"
2548
- })(["margin-bottom:32px;"]);
2549
- function StorySection(_ref) {
2550
- var title = _ref.title,
2551
- children = _ref.children,
2552
- internalIsDemoSection = _ref.internalIsDemoSection,
2553
- props = _objectWithoutProperties(_ref, _excluded$2);
2922
+ function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2923
+ var ContentView = /*#__PURE__*/styled.View.withConfig({
2924
+ displayName: "ListItemContent__ContentView"
2925
+ })(["flex:1 0 0%;align-self:center;"]);
2926
+ function ListItemContent(_ref) {
2927
+ var children = _ref.children,
2928
+ rest = _objectWithoutProperties(_ref, _excluded$5);
2554
2929
 
2555
- if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
2556
- return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
2557
- children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
2558
- children: title
2559
- }), children]
2930
+ return /*#__PURE__*/jsx(ContentView, _objectSpread$6(_objectSpread$6({}, rest), {}, {
2931
+ children: children
2560
2932
  }));
2561
2933
  }
2562
- var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
2563
- displayName: "StorySection__StyledSubSection"
2564
- })(["margin-bottom:16px;"]);
2565
2934
 
2566
- function SubSection(_ref2) {
2567
- var title = _ref2.title,
2568
- children = _ref2.children,
2569
- props = _objectWithoutProperties(_ref2, _excluded2);
2935
+ var _excluded$4 = ["children", "side"],
2936
+ _excluded2$1 = ["children", "align"];
2570
2937
 
2571
- return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
2572
- children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
2573
- children: title
2574
- }), children]
2575
- }));
2576
- }
2938
+ function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2577
2939
 
2578
- var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
2579
- displayName: "StorySection__StyledBlockSection"
2580
- })(["margin-bottom:16px;"]);
2940
+ function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2941
+ var SideContainerView = /*#__PURE__*/styled.View.withConfig({
2942
+ displayName: "ListItemSideContent__SideContainerView"
2943
+ })(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
2944
+ var theme = _ref.theme,
2945
+ side = _ref.side;
2946
+ return side === 'right' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
2947
+ }, function (_ref2) {
2948
+ var theme = _ref2.theme,
2949
+ side = _ref2.side;
2950
+ return side === 'left' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
2951
+ }); // Handles the vertical alignment of the side elements of the list item
2581
2952
 
2582
- function BlockSection(_ref3) {
2583
- var title = _ref3.title,
2584
- children = _ref3.children,
2585
- props = _objectWithoutProperties(_ref3, _excluded3);
2953
+ function ListItemSideContainer(_ref3) {
2954
+ var children = _ref3.children,
2955
+ _ref3$side = _ref3.side,
2956
+ side = _ref3$side === void 0 ? 'left' : _ref3$side,
2957
+ rest = _objectWithoutProperties(_ref3, _excluded$4);
2586
2958
 
2587
- return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
2588
- children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
2589
- children: title
2590
- }), children]
2959
+ return /*#__PURE__*/jsx(SideContainerView, _objectSpread$5(_objectSpread$5({
2960
+ side: side
2961
+ }, rest), {}, {
2962
+ children: children
2591
2963
  }));
2592
2964
  }
2965
+ var SideContentView = /*#__PURE__*/styled.View.withConfig({
2966
+ displayName: "ListItemSideContent__SideContentView"
2967
+ })(["align-self:", ";"], function (_ref4) {
2968
+ var align = _ref4.align;
2969
+ return align;
2970
+ });
2971
+ function ListItemSideContent(_ref5) {
2972
+ var children = _ref5.children,
2973
+ _ref5$align = _ref5.align,
2974
+ align = _ref5$align === void 0 ? 'auto' : _ref5$align,
2975
+ rest = _objectWithoutProperties(_ref5, _excluded2$1);
2593
2976
 
2594
- var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
2595
- displayName: "StorySection__StyledDemoSection"
2596
- })(["margin-bottom:64px;"]);
2597
-
2598
- function DemoSection(_ref4) {
2599
- var children = _ref4.children;
2600
- return /*#__PURE__*/jsx(StyledDemoSection, {
2601
- children: /*#__PURE__*/jsx(StorySection, {
2602
- internalIsDemoSection: true,
2603
- title: "Demo",
2604
- children: children
2605
- })
2606
- });
2977
+ return /*#__PURE__*/jsx(SideContentView, _objectSpread$5(_objectSpread$5({
2978
+ align: align
2979
+ }, rest), {}, {
2980
+ children: children
2981
+ }));
2607
2982
  }
2608
2983
 
2609
- StorySection.SubSection = SubSection;
2610
- StorySection.BlockSection = BlockSection;
2611
- /** @deprecated use StorySection.Demo instead */
2984
+ var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
2612
2985
 
2613
- StorySection.DemoSection = DemoSection;
2614
- StorySection.Demo = DemoSection;
2615
- /** @deprecated use StorySection instead */
2986
+ function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2616
2987
 
2617
- var DeprecatedSection = StorySection;
2988
+ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2989
+ var ContainerView = /*#__PURE__*/styled.View.withConfig({
2990
+ displayName: "ListItem__ContainerView"
2991
+ })(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], function (_ref) {
2992
+ var withPadding = _ref.withPadding,
2993
+ theme = _ref.theme;
2994
+ return withPadding ? theme.kitt.listItem.padding : 0;
2995
+ }, function (_ref2) {
2996
+ var theme = _ref2.theme,
2997
+ borders = _ref2.borders;
2998
+ var borderWidth = theme.kitt.listItem.borderWidth;
2618
2999
 
2619
- function StoryContainer(_ref) {
2620
- var children = _ref.children,
2621
- title = _ref.title,
2622
- _ref$state = _ref.state,
2623
- state = _ref$state === void 0 ? 'none' : _ref$state,
2624
- _ref$platform = _ref.platform,
2625
- platform = _ref$platform === void 0 ? 'all' : _ref$platform;
2626
- if (platform === 'web') return null;
2627
- return /*#__PURE__*/jsx(StorySection.BlockSection, {
2628
- testID: state,
2629
- title: title,
2630
- children: children
2631
- });
3000
+ if (borders === 'top') {
3001
+ return "border-top-width: ".concat(borderWidth, "px");
3002
+ }
3003
+
3004
+ if (borders === 'bottom') {
3005
+ return "border-bottom-width: ".concat(borderWidth, "px");
3006
+ }
3007
+
3008
+ if (borders === 'both') {
3009
+ return css(["border-top-width:", "px;border-bottom-width:", "px;"], borderWidth, borderWidth);
3010
+ }
3011
+
3012
+ return 'border: none';
3013
+ }, function (_ref3) {
3014
+ var theme = _ref3.theme;
3015
+ return theme.kitt.listItem.borderColor;
3016
+ }, function (_ref4) {
3017
+ var theme = _ref4.theme;
3018
+ return theme.kitt.colors.uiBackgroundLight;
3019
+ });
3020
+ function ListItem(_ref5) {
3021
+ var children = _ref5.children,
3022
+ withPadding = _ref5.withPadding,
3023
+ borders = _ref5.borders,
3024
+ left = _ref5.left,
3025
+ right = _ref5.right,
3026
+ onPress = _ref5.onPress,
3027
+ rest = _objectWithoutProperties(_ref5, _excluded$3);
3028
+
3029
+ var Wrapper = onPress ? Pressable : Fragment$1;
3030
+ var wrapperProps = onPress ? _objectSpread$4({
3031
+ accessibilityRole: 'button',
3032
+ onPress: onPress
3033
+ }, rest) : undefined;
3034
+ var containerProps = onPress ? undefined : rest;
3035
+ return /*#__PURE__*/jsx(Wrapper, _objectSpread$4(_objectSpread$4({}, wrapperProps), {}, {
3036
+ children: /*#__PURE__*/jsxs(ContainerView, _objectSpread$4(_objectSpread$4({
3037
+ withPadding: withPadding,
3038
+ borders: borders
3039
+ }, containerProps), {}, {
3040
+ children: [left ? /*#__PURE__*/jsx(ListItemSideContainer, {
3041
+ side: "left",
3042
+ children: left
3043
+ }) : null, /*#__PURE__*/jsx(ListItemContent, {
3044
+ children: children
3045
+ }), right ? /*#__PURE__*/jsx(ListItemSideContainer, {
3046
+ side: "right",
3047
+ children: right
3048
+ }) : null]
3049
+ }))
3050
+ }));
3051
+ }
3052
+ ListItem.Content = ListItemContent;
3053
+ ListItem.SideContent = ListItemSideContent;
3054
+ ListItem.SideContainer = ListItemSideContainer;
3055
+
3056
+ function getActivityIndicatorSize(size) {
3057
+ if (Platform.OS === 'android') return size;
3058
+ return size < 36 ? 'small' : 'large';
2632
3059
  }
2633
3060
 
2634
- function StoryDecorator(storyFn, context) {
2635
- return /*#__PURE__*/jsx(Story, {
2636
- title: context.name,
2637
- children: storyFn()
3061
+ function Loader(_ref) {
3062
+ var _ref$color = _ref.color,
3063
+ color = _ref$color === void 0 ? 'primary' : _ref$color,
3064
+ _ref$size = _ref.size,
3065
+ size = _ref$size === void 0 ? 20 : _ref$size;
3066
+ var theme = /*#__PURE__*/useTheme();
3067
+ var colorHex = theme.kitt.typography.colors[color];
3068
+ return /*#__PURE__*/jsx(ActivityIndicator, {
3069
+ testID: "ActivityIndicator",
3070
+ color: colorHex,
3071
+ size: getActivityIndicatorSize(size)
2638
3072
  });
2639
3073
  }
2640
3074
 
2641
- var SmallScreenRow = /*#__PURE__*/styled.View.withConfig({
2642
- displayName: "StoryGrid__SmallScreenRow"
2643
- })(["flex-direction:column;margin:0;"]);
2644
- var SmallScreenCol = /*#__PURE__*/styled.View.withConfig({
2645
- displayName: "StoryGrid__SmallScreenCol"
2646
- })(["padding:8px 0 16px;"]);
2647
- var FlexRow = /*#__PURE__*/styled.View.withConfig({
2648
- displayName: "StoryGrid__FlexRow"
2649
- })(["flex-direction:row;margin:0 -4px 16px;"]);
2650
- var FlexCol = /*#__PURE__*/styled.View.withConfig({
2651
- displayName: "StoryGrid__FlexCol"
2652
- })(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
3075
+ function LargeLoader(_ref) {
3076
+ var _ref$color = _ref.color,
3077
+ color = _ref$color === void 0 ? 'primary' : _ref$color;
3078
+ return /*#__PURE__*/jsx(Loader, {
3079
+ color: color,
3080
+ size: 60
3081
+ });
3082
+ }
2653
3083
 
2654
- function StoryGridRow(_ref) {
2655
- var children = _ref.children,
2656
- _ref$breakpoint = _ref.breakpoint,
2657
- breakpoint = _ref$breakpoint === void 0 ? 'small' : _ref$breakpoint;
3084
+ function IconContent(_ref) {
3085
+ var type = _ref.type,
3086
+ color = _ref.color;
2658
3087
 
2659
- // eslint-disable-next-line unicorn/expiring-todo-comments
2660
- // TODO use useBreakpoint instead
2661
- var _useWindowDimensions = useWindowDimensions(),
2662
- width = _useWindowDimensions.width;
3088
+ switch (type) {
3089
+ case 'warning':
3090
+ return /*#__PURE__*/jsx(AlertCircleIcon, {
3091
+ color: color
3092
+ });
2663
3093
 
2664
- var breakpointValue = breakpoint === 'small' ? 480 : 768;
3094
+ case 'success':
3095
+ return /*#__PURE__*/jsx(CheckIcon, {
3096
+ color: color
3097
+ });
2665
3098
 
2666
- if (width < breakpointValue) {
2667
- return /*#__PURE__*/jsx(SmallScreenRow, {
2668
- children: Children.map(children, function (child) {
2669
- return /*#__PURE__*/jsx(SmallScreenCol, {
2670
- children: child
2671
- });
2672
- })
2673
- });
2674
- }
3099
+ case 'danger':
3100
+ return /*#__PURE__*/jsx(AlertTriangleIcon, {
3101
+ color: color
3102
+ });
2675
3103
 
2676
- return /*#__PURE__*/jsx(FlexRow, {
2677
- children: Children.map(children, function (child) {
2678
- return /*#__PURE__*/jsx(FlexCol, {
2679
- children: child
3104
+ default:
3105
+ return /*#__PURE__*/jsx(InfoIcon, {
3106
+ color: color
2680
3107
  });
2681
- })
2682
- });
3108
+ }
2683
3109
  }
2684
3110
 
2685
- function StoryGridCol(_ref2) {
2686
- var title = _ref2.title,
2687
- titleColor = _ref2.titleColor,
2688
- children = _ref2.children,
2689
- _ref2$platform = _ref2.platform,
2690
- platform = _ref2$platform === void 0 ? 'all' : _ref2$platform;
2691
- var isNative = Platform.OS === 'ios' || Platform.OS === 'android';
3111
+ var getColorByType = function (type) {
3112
+ switch (type) {
3113
+ case 'success':
3114
+ return 'white';
2692
3115
 
2693
- if (Platform.OS === 'web' && platform === 'native') {
2694
- return null;
2695
- }
3116
+ case 'danger':
3117
+ return 'white';
2696
3118
 
2697
- if (isNative && platform === 'web') {
2698
- return null;
3119
+ case 'warning':
3120
+ default:
3121
+ return 'black';
2699
3122
  }
3123
+ };
3124
+ var getIconButtonColor = function (messageType) {
3125
+ switch (messageType) {
3126
+ case 'success':
3127
+ case 'danger':
3128
+ return 'white';
2700
3129
 
2701
- return /*#__PURE__*/jsxs(Fragment$1, {
2702
- children: [title ? /*#__PURE__*/jsx(StoryTitle.Level4, {
2703
- numberOfLines: 1,
2704
- color: titleColor,
2705
- children: title
2706
- }) : null, children]
2707
- });
2708
- }
2709
-
2710
- var StoryGrid = {
2711
- Row: StoryGridRow,
2712
- Col: StoryGridCol
3130
+ case 'warning':
3131
+ default:
3132
+ return 'black';
3133
+ }
2713
3134
  };
2714
3135
 
2715
- var Container$1 = /*#__PURE__*/styled.View.withConfig({
2716
- displayName: "Tag__Container"
2717
- })(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], function (_ref) {
2718
- var theme = _ref.theme,
2719
- type = _ref.type,
2720
- variant = _ref.variant;
2721
- return theme.kitt.tag[type][variant].backgroundColor;
3136
+ var StyledMessageContainer = /*#__PURE__*/styled.View.withConfig({
3137
+ displayName: "BaseMessage__StyledMessageContainer"
3138
+ })(["flex-direction:row;align-items:flex-start;justify-content:space-between;min-height:60px;padding-top:", "px;border-radius:", "px;background-color:", ";"], function (_ref) {
3139
+ var _$insets$top;
3140
+
3141
+ var $insets = _ref.$insets;
3142
+ return (_$insets$top = $insets === null || $insets === void 0 ? void 0 : $insets.top) !== null && _$insets$top !== void 0 ? _$insets$top : 0;
2722
3143
  }, function (_ref2) {
2723
3144
  var theme = _ref2.theme,
2724
- type = _ref2.type,
2725
- variant = _ref2.variant;
2726
- return theme.kitt.tag[type][variant].borderWidth;
3145
+ $hasNoRadius = _ref2.$hasNoRadius;
3146
+ return $hasNoRadius ? 0 : theme.kitt.spacing * 5;
2727
3147
  }, function (_ref3) {
2728
3148
  var theme = _ref3.theme,
2729
- type = _ref3.type,
2730
- variant = _ref3.variant;
2731
- return theme.kitt.tag[type][variant].borderColor;
2732
- }, function (_ref4) {
3149
+ $type = _ref3.$type;
3150
+ return theme.kitt.feedbackMessage[$type].backgroundColor;
3151
+ });
3152
+ var StyledDismissWrapper = /*#__PURE__*/styled.View.withConfig({
3153
+ displayName: "BaseMessage__StyledDismissWrapper"
3154
+ })(["align-items:center;align-items:flex-start;margin:", ";"], function (_ref4) {
2733
3155
  var theme = _ref4.theme;
2734
- return theme.kitt.tag.padding;
2735
- }, function (_ref5) {
3156
+ var spacing = theme.kitt.spacing;
3157
+ return "".concat(spacing * 2.5, "px ").concat(spacing * 2, "px 0 ").concat(spacing * 5, "px");
3158
+ });
3159
+ var StyledIconContainer = /*#__PURE__*/styled.View.withConfig({
3160
+ displayName: "BaseMessage__StyledIconContainer"
3161
+ })(["margin:", ";"], function (_ref5) {
2736
3162
  var theme = _ref5.theme;
2737
- return theme.kitt.tag.borderRadius;
3163
+ var spacing = theme.kitt.spacing;
3164
+ return "".concat(spacing, "px ").concat(spacing * 5, "px 0 0");
2738
3165
  });
2739
- var getLabelColor = function (type, variant) {
2740
- switch (type) {
2741
- case 'danger':
2742
- {
2743
- return variant === 'outline' ? 'danger' : 'black';
2744
- }
2745
-
2746
- case 'primary':
2747
- {
2748
- return 'primary';
2749
- }
3166
+ var StyledTextContent = /*#__PURE__*/styled(Typography.Text).withConfig({
3167
+ displayName: "BaseMessage__StyledTextContent"
3168
+ })(["flex:1;text-align:", ";"], function (_ref6) {
3169
+ var $isCenteredText = _ref6.$isCenteredText;
3170
+ return $isCenteredText ? 'center' : 'left';
3171
+ });
3172
+ var StyledMessageContent = /*#__PURE__*/styled.View.withConfig({
3173
+ displayName: "BaseMessage__StyledMessageContent"
3174
+ })(["display:flex;flex-direction:row;flex-grow:1;align-self:center;align-items:flex-start;flex-shrink:1;padding:", ";"], function (_ref7) {
3175
+ var theme = _ref7.theme;
3176
+ var spacing = theme.kitt.spacing;
3177
+ return "".concat(spacing * 4, "px ").concat(spacing * 5, "px");
3178
+ });
3179
+ function BaseMessage(_ref8) {
3180
+ var _ref8$type = _ref8.type,
3181
+ type = _ref8$type === void 0 ? 'info' : _ref8$type,
3182
+ children = _ref8.children,
3183
+ hasNoRadius = _ref8.hasNoRadius,
3184
+ centeredText = _ref8.centeredText,
3185
+ insets = _ref8.insets,
3186
+ onDismiss = _ref8.onDismiss;
3187
+ var color = getColorByType(type);
3188
+ return /*#__PURE__*/jsxs(StyledMessageContainer, {
3189
+ $type: type,
3190
+ $hasNoRadius: hasNoRadius,
3191
+ $insets: insets,
3192
+ children: [/*#__PURE__*/jsxs(StyledMessageContent, {
3193
+ children: [centeredText ? null : /*#__PURE__*/jsx(StyledIconContainer, {
3194
+ children: /*#__PURE__*/jsx(Icon, {
3195
+ color: color,
3196
+ icon: /*#__PURE__*/jsx(IconContent, {
3197
+ type: type,
3198
+ color: color
3199
+ })
3200
+ })
3201
+ }), /*#__PURE__*/jsx(StyledTextContent, {
3202
+ $isCenteredText: centeredText,
3203
+ base: "body",
3204
+ color: color,
3205
+ children: children
3206
+ })]
3207
+ }), onDismiss ? /*#__PURE__*/jsx(StyledDismissWrapper, {
3208
+ children: /*#__PURE__*/jsx(IconButton, {
3209
+ color: getIconButtonColor(type),
3210
+ icon: /*#__PURE__*/jsx(XIcon, {}),
3211
+ onPress: onDismiss
3212
+ })
3213
+ }) : null]
3214
+ });
3215
+ }
2750
3216
 
2751
- case 'default':
2752
- {
2753
- return 'black';
2754
- }
3217
+ function Message(_ref) {
3218
+ var _ref$type = _ref.type,
3219
+ type = _ref$type === void 0 ? 'info' : _ref$type,
3220
+ children = _ref.children,
3221
+ hasNoRadius = _ref.hasNoRadius,
3222
+ centeredText = _ref.centeredText,
3223
+ insets = _ref.insets,
3224
+ onDismiss = _ref.onDismiss;
3225
+ return /*#__PURE__*/jsx(BaseMessage, {
3226
+ insets: insets,
3227
+ hasNoRadius: hasNoRadius,
3228
+ type: type,
3229
+ centeredText: centeredText,
3230
+ onDismiss: onDismiss,
3231
+ children: children
3232
+ });
3233
+ }
2755
3234
 
2756
- default:
2757
- {
2758
- return 'black';
2759
- }
3235
+ function Notification(_ref) {
3236
+ var type = _ref.type,
3237
+ children = _ref.children,
3238
+ centeredText = _ref.centeredText,
3239
+ insets = _ref.insets,
3240
+ onDelete = _ref.onDelete,
3241
+ onDismiss = _ref.onDismiss;
3242
+
3243
+ if ((process.env.NODE_ENV !== "production")) {
3244
+ if (onDelete) {
3245
+ throw new Error('onDelete is deprecated us onDismiss instead');
3246
+ }
2760
3247
  }
2761
- };
2762
- function Tag(_ref6) {
2763
- var label = _ref6.label,
2764
- _ref6$type = _ref6.type,
2765
- type = _ref6$type === void 0 ? 'default' : _ref6$type,
2766
- _ref6$variant = _ref6.variant,
2767
- variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
2768
- return /*#__PURE__*/jsx(Container$1, {
3248
+
3249
+ return /*#__PURE__*/jsx(BaseMessage, {
3250
+ hasNoRadius: true,
2769
3251
  type: type,
2770
- variant: variant,
2771
- children: /*#__PURE__*/jsx(Typography.Text, {
2772
- base: "body-xsmall",
2773
- color: getLabelColor(type, variant),
2774
- children: label
2775
- })
3252
+ centeredText: centeredText,
3253
+ insets: insets,
3254
+ onDismiss: onDismiss,
3255
+ children: children
2776
3256
  });
2777
3257
  }
2778
3258
 
2779
- var lateOceanColorPalette = {
2780
- lateOcean: '#4C34E0',
2781
- lateOceanLight1: '#705DE6',
2782
- lateOceanLight2: '#9485EC',
2783
- lateOceanLight3: '#D6BAF9',
2784
- warmEmbrace: '#F4D3CE',
2785
- warmEmbraceLight1: '#FFEDE6',
2786
- black1000: '#000000',
2787
- black800: '#2C293D',
2788
- black555: '#737373',
2789
- black200: '#CCCCCC',
2790
- black100: '#E5E5E5',
2791
- black50: '#F2F2F2',
2792
- black25: '#F9F9F9',
2793
- white: '#FFFFFF',
2794
- viride: '#38836D',
2795
- englishVermillon: '#D44148',
2796
- goldCrayola: '#F8C583',
2797
- aero: '#89BDDD',
2798
- transparent: 'transparent',
2799
- moonPurple: '#DBD6F9',
2800
- moonPurpleLight1: '#EDEBFC'
2801
- };
3259
+ var Container$2 = /*#__PURE__*/styled.View.withConfig({
3260
+ displayName: "SkeletonContent__Container"
3261
+ })(["background-color:", ";border-color:", ";height:100%;width:100%;"], function (_ref) {
3262
+ var theme = _ref.theme;
3263
+ return theme.kitt.skeleton.backgroundColor;
3264
+ }, function (_ref2) {
3265
+ var theme = _ref2.theme;
3266
+ return theme.kitt.skeleton.flareColor;
3267
+ });
3268
+ var AnimatedLinearGradient = Animated$1.createAnimatedComponent(LinearGradient);
3269
+ function SkeletonContent(_ref3) {
3270
+ var isLoading = _ref3.isLoading,
3271
+ width = _ref3.width;
3272
+ var theme = /*#__PURE__*/useTheme();
3273
+ var sharedX = useSharedValue(0);
3274
+ useEffect(function () {
3275
+ if (isLoading) {
3276
+ sharedX.value = withRepeat(withTiming(1, {
3277
+ duration: theme.kitt.skeleton.animationDuration,
3278
+ easing: Easing$1.inOut(Easing$1.ease)
3279
+ }), -1);
3280
+ }
3281
+ }, [sharedX, width, isLoading, theme]);
3282
+ var linearGradientStyle = useAnimatedStyle(function () {
3283
+ var _f = function () {
3284
+ return {
3285
+ transform: [{
3286
+ translateX: interpolate(sharedX.value, [0, 1], [-width, width])
3287
+ }]
3288
+ };
3289
+ };
2802
3290
 
2803
- var colors = {
2804
- primary: lateOceanColorPalette.lateOcean,
2805
- primaryLight: lateOceanColorPalette.lateOceanLight1,
2806
- accent: lateOceanColorPalette.warmEmbrace,
2807
- accentLight: lateOceanColorPalette.warmEmbraceLight1,
2808
- success: lateOceanColorPalette.viride,
2809
- correct: lateOceanColorPalette.viride,
2810
- danger: lateOceanColorPalette.englishVermillon,
2811
- info: lateOceanColorPalette.aero,
2812
- warning: lateOceanColorPalette.goldCrayola,
2813
- separator: lateOceanColorPalette.black100,
2814
- hover: lateOceanColorPalette.black100,
2815
- black: lateOceanColorPalette.black1000,
2816
- uiBackground: lateOceanColorPalette.black25,
2817
- uiBackgroundLight: lateOceanColorPalette.white,
2818
- transparent: lateOceanColorPalette.transparent,
2819
- disabled: lateOceanColorPalette.black50,
2820
- overlay: {
2821
- dark: 'rgba(41, 48, 51, 0.25)',
2822
- light: 'rgba(255, 255, 255, 0.90)',
2823
- fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
2824
- }
2825
- };
3291
+ _f._closure = {
3292
+ interpolate: interpolate,
3293
+ sharedX: sharedX,
3294
+ width: width
3295
+ };
3296
+ _f.asString = "function _f(){const{interpolate,sharedX,width}=jsThis._closure;{return{transform:[{translateX:interpolate(sharedX.value,[0,1],[-width,width])}]};}}";
3297
+ _f.__workletHash = 1670955855244;
3298
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (41:47)";
3299
+ _f.__optimalization = 3;
2826
3300
 
2827
- var avatar = {
2828
- borderRadius: 10,
2829
- "default": {
2830
- backgroundColor: colors.primary
2831
- },
2832
- light: {
2833
- backgroundColor: lateOceanColorPalette.black100
2834
- }
2835
- };
3301
+ global.__reanimatedWorkletInit(_f);
2836
3302
 
2837
- var button = {
2838
- borderRadius: 30,
2839
- borderWidth: {
2840
- disabled: 2,
2841
- focus: 3
2842
- },
2843
- minHeight: 40,
2844
- minWidth: 40,
2845
- maxWidth: 335,
2846
- scale: {
2847
- base: {
2848
- "default": 1,
2849
- hover: 0.95,
2850
- active: 0.95
3303
+ return _f;
3304
+ }());
3305
+ return /*#__PURE__*/jsx(Container$2, {
3306
+ children: /*#__PURE__*/jsx(AnimatedLinearGradient, {
3307
+ colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
3308
+ locations: [0.1, 0.5, 0.9],
3309
+ start: {
3310
+ x: 0,
3311
+ y: 0
3312
+ },
3313
+ end: {
3314
+ x: 1,
3315
+ y: 0
3316
+ },
3317
+ style: [StyleSheet.absoluteFill, linearGradientStyle]
3318
+ })
3319
+ });
3320
+ }
3321
+
3322
+ var SkeletonContainer = /*#__PURE__*/styled(View).withConfig({
3323
+ displayName: "Skeleton__SkeletonContainer"
3324
+ })(["overflow:hidden;"]);
3325
+ function Skeleton(_ref) {
3326
+ var isLoading = _ref.isLoading,
3327
+ style = _ref.style;
3328
+
3329
+ var _useState = useState(0),
3330
+ _useState2 = _slicedToArray(_useState, 2),
3331
+ width = _useState2[0],
3332
+ setWidth = _useState2[1];
3333
+
3334
+ return /*#__PURE__*/jsx(SkeletonContainer, {
3335
+ style: style,
3336
+ onLayout: function onLayout(_ref2) {
3337
+ var nativeEvent = _ref2.nativeEvent;
3338
+ return setWidth(nativeEvent.layout.width);
2851
3339
  },
2852
- medium: {
2853
- hover: 1.05
2854
- }
2855
- },
2856
- contentPadding: {
2857
- "default": '8px 16px 7px',
2858
- large: '12px 24px 11px',
2859
- disabled: '6px 14px 5px'
2860
- },
2861
- transition: {
2862
- duration: '200ms',
2863
- timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
2864
- },
2865
- "default": {
2866
- backgroundColor: 'rgba(0, 0, 0, 0.05)',
2867
- pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2868
- hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2869
- focusBorderColor: 'rgba(0, 0, 0, 0.1)'
2870
- },
2871
- primary: {
2872
- backgroundColor: colors.primary,
2873
- pressedBackgroundColor: colors.primaryLight,
2874
- hoverBackgroundColor: colors.primaryLight,
2875
- focusBorderColor: 'rgba(76, 52, 224, 0.2)'
2876
- },
2877
- white: {
2878
- backgroundColor: 'rgba(255, 255, 255, 0.05)',
2879
- pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2880
- hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2881
- focusBorderColor: 'rgba(255, 255, 255, 0.1)'
2882
- },
2883
- subtle: {
2884
- backgroundColor: colors.transparent,
2885
- pressedBackgroundColor: colors.transparent,
2886
- hoverBackgroundColor: colors.transparent,
2887
- focusBorderColor: 'rgba(76, 52, 224, 0.2)',
2888
- color: colors.primary,
2889
- hoverColor: 'rgba(76, 52, 224, 0.8)',
2890
- activeColor: 'rgba(76, 52, 224, 0.8)'
2891
- },
2892
- 'subtle-dark': {
2893
- backgroundColor: colors.transparent,
2894
- pressedBackgroundColor: colors.transparent,
2895
- hoverBackgroundColor: colors.transparent,
2896
- focusBorderColor: 'rgba(0, 0, 0, 0.1)',
2897
- color: colors.black,
2898
- hoverColor: 'rgba(0, 0, 0, 0.8)',
2899
- activeColor: 'rgba(0, 0, 0, 0.8)'
2900
- },
2901
- disabled: {
2902
- backgroundColor: colors.disabled,
2903
- pressedBackgroundColor: colors.disabled,
2904
- hoverBackgroundColor: colors.disabled,
2905
- focusBorderColor: lateOceanColorPalette.black100,
2906
- borderColor: lateOceanColorPalette.black100
2907
- }
2908
- };
3340
+ children: /*#__PURE__*/jsx(SkeletonContent, {
3341
+ isLoading: isLoading,
3342
+ width: width
3343
+ })
3344
+ });
3345
+ }
3346
+ var Bar = /*#__PURE__*/styled(Skeleton).withConfig({
3347
+ displayName: "Skeleton__Bar"
3348
+ })(["width:100%;height:", "px;border-radius:", "px;"], function (_ref3) {
3349
+ var theme = _ref3.theme;
3350
+ return theme.kitt.spacing * 2;
3351
+ }, function (_ref4) {
3352
+ var theme = _ref4.theme;
3353
+ return theme.kitt.spacing * 2;
3354
+ });
3355
+ var Circle = /*#__PURE__*/styled(Skeleton).withConfig({
3356
+ displayName: "Skeleton__Circle"
3357
+ })(["width:", "px;height:", "px;border-radius:", "px;"], function (_ref5) {
3358
+ var theme = _ref5.theme;
3359
+ return theme.kitt.spacing * 12;
3360
+ }, function (_ref6) {
3361
+ var theme = _ref6.theme;
3362
+ return theme.kitt.spacing * 12;
3363
+ }, function (_ref7) {
3364
+ var theme = _ref7.theme;
3365
+ return theme.kitt.spacing * 6;
3366
+ });
3367
+ var Square = /*#__PURE__*/styled(Skeleton).withConfig({
3368
+ displayName: "Skeleton__Square"
3369
+ })(["width:", "px;height:", "px;border-radius:", "px;"], function (_ref8) {
3370
+ var theme = _ref8.theme;
3371
+ return theme.kitt.spacing * 12;
3372
+ }, function (_ref9) {
3373
+ var theme = _ref9.theme;
3374
+ return theme.kitt.spacing * 12;
3375
+ }, function (_ref10) {
3376
+ var theme = _ref10.theme;
3377
+ return theme.kitt.spacing * 1.5;
3378
+ });
3379
+ Skeleton.Bar = Bar;
3380
+ Skeleton.Circle = Circle;
3381
+ Skeleton.Square = Square;
2909
3382
 
2910
- var card = {
2911
- borderRadius: 20,
2912
- borderWidth: 2,
2913
- primary: {
2914
- backgroundColor: colors.uiBackgroundLight,
2915
- borderColor: colors.primary
2916
- },
2917
- secondary: {
2918
- backgroundColor: colors.uiBackgroundLight,
2919
- borderColor: colors.separator
2920
- },
2921
- subtle: {
2922
- backgroundColor: lateOceanColorPalette.black50,
2923
- borderColor: colors.separator
3383
+ var Flex = /*#__PURE__*/styled.View.withConfig({
3384
+ shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
3385
+ return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
2924
3386
  }
2925
- };
3387
+ }).withConfig({
3388
+ displayName: "Flex"
3389
+ })(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], function (_ref) {
3390
+ var direction = _ref.direction;
3391
+ return direction;
3392
+ }, function (_ref2) {
3393
+ var theme = _ref2.theme,
3394
+ _ref2$padding = _ref2.padding,
3395
+ padding = _ref2$padding === void 0 ? 0 : _ref2$padding;
3396
+ return padding * theme.kitt.spacing;
3397
+ });
2926
3398
 
2927
- var feedbackMessage = {
2928
- danger: {
2929
- backgroundColor: colors.danger
2930
- },
2931
- success: {
2932
- backgroundColor: colors.success
2933
- },
2934
- info: {
2935
- backgroundColor: colors.info
2936
- },
2937
- warning: {
2938
- backgroundColor: colors.warning
3399
+ var storyPadding = 16;
3400
+
3401
+ var getBackgroundColorFromBlockColor = function (theme) {
3402
+ var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'transparent';
3403
+
3404
+ switch (color) {
3405
+ case 'dark':
3406
+ return '#293033';
3407
+
3408
+ case 'light':
3409
+ return '#ffffff';
3410
+
3411
+ case 'primary':
3412
+ return theme.kitt.palettes.lateOcean.lateOcean;
3413
+
3414
+ default:
3415
+ return 'transparent';
2939
3416
  }
2940
3417
  };
2941
3418
 
2942
- var calcLineHeight = function (fontSize, lineHeightMultiplier) {
2943
- return Math.round(fontSize * lineHeightMultiplier);
2944
- };
2945
- var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
2946
- return {
2947
- baseAndSmall: {
2948
- fontSize: baseAndSmallFontSize,
2949
- lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
2950
- },
2951
- mediumAndWide: {
2952
- fontSize: mediumAndWideFontSize,
2953
- lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
2954
- }
2955
- };
2956
- };
2957
- var typography = {
2958
- colors: {
2959
- black: lateOceanColorPalette.black1000,
2960
- 'black-anthracite': lateOceanColorPalette.black800,
2961
- 'black-light': lateOceanColorPalette.black555,
2962
- white: lateOceanColorPalette.white,
2963
- 'white-light': lateOceanColorPalette.white,
2964
- primary: lateOceanColorPalette.lateOcean,
2965
- 'primary-light': lateOceanColorPalette.lateOceanLight1,
2966
- accent: lateOceanColorPalette.warmEmbrace,
2967
- success: lateOceanColorPalette.viride,
2968
- danger: lateOceanColorPalette.englishVermillon
2969
- },
2970
- types: {
2971
- headers: {
2972
- fontFamily: {
2973
- regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
2974
- bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
2975
- },
2976
- fontWeight: 400,
2977
- fontStyle: 'normal',
2978
- configs: {
2979
- // also known as xxlarge
2980
- header1: createTypographyTypeConfig(1.3, 38, 62),
2981
- // also known as xlarge
2982
- header2: createTypographyTypeConfig(1.3, 32, 48),
2983
- // also known as medium
2984
- header3: createTypographyTypeConfig(1.3, 24, 36),
2985
- // also known as xsmall
2986
- header4: createTypographyTypeConfig(1.3, 18, 24),
2987
- // also known as xxsmall
2988
- header5: createTypographyTypeConfig(1.3, 18, 18)
2989
- }
2990
- },
2991
- bodies: {
2992
- fontFamily: {
2993
- regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
2994
- bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
2995
- },
2996
- fontWeight: {
2997
- regular: 400,
2998
- bold: 700
2999
- },
3000
- fontStyle: {
3001
- regular: 'normal',
3002
- bold: 'normal'
3003
- },
3004
- configs: {
3005
- 'body-large': createTypographyTypeConfig(1.6, 18, 24),
3006
- 'body-medium': createTypographyTypeConfig(1.6, 18, 18),
3007
- body: createTypographyTypeConfig(1.6, 16, 16),
3008
- 'body-small': createTypographyTypeConfig(1.6, 14, 14),
3009
- 'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
3010
- }
3011
- }
3012
- },
3013
- link: {
3014
- disabledColor: lateOceanColorPalette.black200
3419
+ var getTypographyColorFromBlockColor = function () {
3420
+ var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transparent';
3421
+
3422
+ switch (color) {
3423
+ case 'dark':
3424
+ case 'primary':
3425
+ return 'white';
3426
+
3427
+ case 'light':
3428
+ default:
3429
+ return 'black';
3015
3430
  }
3016
3431
  };
3017
3432
 
3018
- var inputStatesStyle = {
3019
- "default": {
3020
- backgroundColor: colors.uiBackgroundLight,
3021
- borderColor: colors.separator,
3022
- color: 'black'
3023
- },
3024
- pending: {
3025
- backgroundColor: colors.uiBackgroundLight,
3026
- borderColor: colors.separator,
3027
- color: 'black'
3028
- },
3029
- valid: {
3030
- backgroundColor: colors.uiBackgroundLight,
3031
- borderColor: lateOceanColorPalette.black100,
3032
- color: 'black'
3033
- },
3034
- hover: {
3035
- borderColor: lateOceanColorPalette.black200,
3036
- color: 'black'
3037
- },
3038
- focus: {
3039
- borderColor: colors.primary,
3040
- color: 'black'
3041
- },
3042
- disabled: {
3043
- backgroundColor: colors.disabled,
3044
- borderColor: colors.separator,
3045
- color: 'black-light'
3046
- },
3047
- invalid: {
3048
- borderColor: colors.separator,
3049
- color: 'black'
3050
- }
3051
- };
3052
- var input = {
3053
- color: {
3054
- selection: colors.primary,
3055
- placeholder: typography.colors['black-light']
3056
- },
3057
- borderWidth: 2,
3058
- borderRadius: 10,
3059
- icon: {
3060
- size: 20
3061
- },
3062
- padding: {
3063
- "default": '5px 16px',
3064
- iOSSingleLine: '9px 16px'
3065
- },
3066
- transition: {
3067
- property: 'border-color',
3068
- duration: '200ms',
3069
- timingFunction: 'ease-in-out'
3070
- },
3071
- states: inputStatesStyle
3433
+ var StoryBlockBackgroundContext = /*#__PURE__*/createContext('transparent');
3434
+ var StoryBlockColorContext = /*#__PURE__*/createContext('black');
3435
+ var useStoryBlockColor = function (color) {
3436
+ var storyBlockColor = useContext(StoryBlockColorContext);
3437
+ return color || storyBlockColor;
3072
3438
  };
3439
+ var StyledStoryBlockView = /*#__PURE__*/styled.View.withConfig({
3440
+ displayName: "StoryBlock__StyledStoryBlockView"
3441
+ })(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, function (_ref) {
3442
+ var theme = _ref.theme,
3443
+ background = _ref.background;
3444
+ return getBackgroundColorFromBlockColor(theme, background);
3445
+ });
3446
+ function StoryBlock(_ref2) {
3447
+ var children = _ref2.children,
3448
+ background = _ref2.background;
3449
+ return /*#__PURE__*/jsx(StyledStoryBlockView, {
3450
+ background: background,
3451
+ children: /*#__PURE__*/jsx(StoryBlockColorContext.Provider, {
3452
+ value: getTypographyColorFromBlockColor(background),
3453
+ children: /*#__PURE__*/jsx(StoryBlockBackgroundContext.Provider, {
3454
+ value: background,
3455
+ children: children
3456
+ })
3457
+ })
3458
+ });
3459
+ }
3073
3460
 
3074
- var inputField = {
3075
- labelContainerPaddingBottom: 5,
3076
- iconMarginLeft: 6
3077
- };
3461
+ var StoryTitleContainer = /*#__PURE__*/styled.View.withConfig({
3462
+ displayName: "StoryTitle__StoryTitleContainer"
3463
+ })(["margin-bottom:30px;"]);
3464
+ var StorySubTitleContainer = /*#__PURE__*/styled.View.withConfig({
3465
+ displayName: "StoryTitle__StorySubTitleContainer"
3466
+ })(["margin-bottom:10px;"]);
3467
+ function StoryTitle(_ref) {
3468
+ var color = _ref.color,
3469
+ children = _ref.children,
3470
+ numberOfLines = _ref.numberOfLines;
3471
+ return /*#__PURE__*/jsx(StoryTitleContainer, {
3472
+ children: /*#__PURE__*/jsx(Typography.Header1, {
3473
+ variant: "bold",
3474
+ base: "header1",
3475
+ color: useStoryBlockColor(color),
3476
+ numberOfLines: numberOfLines,
3477
+ children: children
3478
+ })
3479
+ });
3480
+ }
3078
3481
 
3079
- var radio = {
3080
- size: 18,
3081
- unchecked: {
3082
- backgroundColor: colors.uiBackgroundLight,
3083
- borderWidth: 2,
3084
- borderColor: lateOceanColorPalette.black200
3085
- },
3086
- checked: {
3087
- backgroundColor: colors.primary,
3088
- innerSize: 5,
3089
- innerBackgroundColor: colors.uiBackgroundLight
3090
- },
3091
- disabled: {
3092
- backgroundColor: colors.disabled,
3093
- borderColor: colors.separator
3094
- }
3095
- };
3482
+ function StoryTitleLevel2(_ref2) {
3483
+ var color = _ref2.color,
3484
+ children = _ref2.children,
3485
+ numberOfLines = _ref2.numberOfLines;
3486
+ return /*#__PURE__*/jsx(StoryTitleContainer, {
3487
+ children: /*#__PURE__*/jsx(Typography.Header2, {
3488
+ variant: "bold",
3489
+ base: "header2",
3490
+ color: useStoryBlockColor(color),
3491
+ numberOfLines: numberOfLines,
3492
+ children: children
3493
+ })
3494
+ });
3495
+ }
3096
3496
 
3097
- var textArea = {
3098
- minHeight: 120
3099
- };
3497
+ StoryTitleLevel2.displayName = 'StoryTitle.Level2';
3100
3498
 
3101
- var forms = {
3102
- input: input,
3103
- radio: radio,
3104
- inputField: inputField,
3105
- textArea: textArea
3106
- };
3499
+ function StoryTitleLevel3(_ref3) {
3500
+ var color = _ref3.color,
3501
+ children = _ref3.children,
3502
+ numberOfLines = _ref3.numberOfLines;
3503
+ return /*#__PURE__*/jsx(StorySubTitleContainer, {
3504
+ children: /*#__PURE__*/jsx(Typography.Header3, {
3505
+ variant: "bold",
3506
+ base: "header3",
3507
+ medium: "header4",
3508
+ color: useStoryBlockColor(color),
3509
+ numberOfLines: numberOfLines,
3510
+ children: children
3511
+ })
3512
+ });
3513
+ }
3107
3514
 
3108
- var fullScreenModal = {
3109
- header: {
3110
- paddingVertical: 12,
3111
- paddingHorizontal: 16,
3112
- borderColor: lateOceanColorPalette.black100
3515
+ StoryTitleLevel3.displayName = 'StoryTitle.Level3';
3516
+
3517
+ function StoryTitleLevel4(_ref4) {
3518
+ var color = _ref4.color,
3519
+ children = _ref4.children,
3520
+ numberOfLines = _ref4.numberOfLines;
3521
+ return /*#__PURE__*/jsx(StorySubTitleContainer, {
3522
+ children: /*#__PURE__*/jsx(Typography.Header4, {
3523
+ variant: "bold",
3524
+ base: "header4",
3525
+ medium: "header5",
3526
+ color: useStoryBlockColor(color),
3527
+ numberOfLines: numberOfLines,
3528
+ children: children
3529
+ })
3530
+ });
3531
+ }
3532
+
3533
+ StoryTitleLevel4.displayName = 'StoryTitle.Level3';
3534
+ StoryTitle.Level2 = StoryTitleLevel2;
3535
+ StoryTitle.Level3 = StoryTitleLevel3;
3536
+ StoryTitle.Level4 = StoryTitleLevel4;
3537
+
3538
+ var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
3539
+ displayName: "Story__StoryContainer"
3540
+ })(["padding:", "px;"], storyPadding);
3541
+ function Story(_ref) {
3542
+ var title = _ref.title,
3543
+ contentContainerStyle = _ref.contentContainerStyle,
3544
+ children = _ref.children;
3545
+ return /*#__PURE__*/jsxs(StoryContainer$1, {
3546
+ contentContainerStyle: contentContainerStyle,
3547
+ children: [/*#__PURE__*/jsx(StoryTitle, {
3548
+ children: title
3549
+ }), children]
3550
+ });
3551
+ }
3552
+
3553
+ var _excluded$2 = ["title", "children", "internalIsDemoSection"],
3554
+ _excluded2 = ["title", "children"],
3555
+ _excluded3 = ["title", "children"];
3556
+
3557
+ function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3558
+
3559
+ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3560
+ var StyledSection = /*#__PURE__*/styled.View.withConfig({
3561
+ displayName: "StorySection__StyledSection"
3562
+ })(["margin-bottom:32px;"]);
3563
+ function StorySection(_ref) {
3564
+ var title = _ref.title,
3565
+ children = _ref.children,
3566
+ internalIsDemoSection = _ref.internalIsDemoSection,
3567
+ props = _objectWithoutProperties(_ref, _excluded$2);
3568
+
3569
+ if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
3570
+ return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
3571
+ children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
3572
+ children: title
3573
+ }), children]
3574
+ }));
3575
+ }
3576
+ var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
3577
+ displayName: "StorySection__StyledSubSection"
3578
+ })(["margin-bottom:16px;"]);
3579
+
3580
+ function SubSection(_ref2) {
3581
+ var title = _ref2.title,
3582
+ children = _ref2.children,
3583
+ props = _objectWithoutProperties(_ref2, _excluded2);
3584
+
3585
+ return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
3586
+ children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
3587
+ children: title
3588
+ }), children]
3589
+ }));
3590
+ }
3591
+
3592
+ var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
3593
+ displayName: "StorySection__StyledBlockSection"
3594
+ })(["margin-bottom:16px;"]);
3595
+
3596
+ function BlockSection(_ref3) {
3597
+ var title = _ref3.title,
3598
+ children = _ref3.children,
3599
+ props = _objectWithoutProperties(_ref3, _excluded3);
3600
+
3601
+ return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
3602
+ children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
3603
+ children: title
3604
+ }), children]
3605
+ }));
3606
+ }
3607
+
3608
+ var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
3609
+ displayName: "StorySection__StyledDemoSection"
3610
+ })(["margin-bottom:64px;"]);
3611
+
3612
+ function DemoSection(_ref4) {
3613
+ var children = _ref4.children;
3614
+ return /*#__PURE__*/jsx(StyledDemoSection, {
3615
+ children: /*#__PURE__*/jsx(StorySection, {
3616
+ internalIsDemoSection: true,
3617
+ title: "Demo",
3618
+ children: children
3619
+ })
3620
+ });
3621
+ }
3622
+
3623
+ StorySection.SubSection = SubSection;
3624
+ StorySection.BlockSection = BlockSection;
3625
+ /** @deprecated use StorySection.Demo instead */
3626
+
3627
+ StorySection.DemoSection = DemoSection;
3628
+ StorySection.Demo = DemoSection;
3629
+ /** @deprecated use StorySection instead */
3630
+
3631
+ var DeprecatedSection = StorySection;
3632
+
3633
+ function StoryContainer(_ref) {
3634
+ var children = _ref.children,
3635
+ title = _ref.title,
3636
+ _ref$state = _ref.state,
3637
+ state = _ref$state === void 0 ? 'none' : _ref$state,
3638
+ _ref$platform = _ref.platform,
3639
+ platform = _ref$platform === void 0 ? 'all' : _ref$platform;
3640
+ if (platform === 'web') return null;
3641
+ return /*#__PURE__*/jsx(StorySection.BlockSection, {
3642
+ testID: state,
3643
+ title: title,
3644
+ children: children
3645
+ });
3646
+ }
3647
+
3648
+ function StoryDecorator(storyFn, context) {
3649
+ return /*#__PURE__*/jsx(Story, {
3650
+ title: context.name,
3651
+ children: storyFn()
3652
+ });
3653
+ }
3654
+
3655
+ var SmallScreenRow = /*#__PURE__*/styled.View.withConfig({
3656
+ displayName: "StoryGrid__SmallScreenRow"
3657
+ })(["flex-direction:column;margin:0;"]);
3658
+ var SmallScreenCol = /*#__PURE__*/styled.View.withConfig({
3659
+ displayName: "StoryGrid__SmallScreenCol"
3660
+ })(["padding:8px 0 16px;"]);
3661
+ var FlexRow = /*#__PURE__*/styled.View.withConfig({
3662
+ displayName: "StoryGrid__FlexRow"
3663
+ })(["flex-direction:row;margin:0 -4px 16px;"]);
3664
+ var FlexCol = /*#__PURE__*/styled.View.withConfig({
3665
+ displayName: "StoryGrid__FlexCol"
3666
+ })(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
3667
+
3668
+ function StoryGridRow(_ref) {
3669
+ var children = _ref.children,
3670
+ _ref$breakpoint = _ref.breakpoint,
3671
+ breakpoint = _ref$breakpoint === void 0 ? 'small' : _ref$breakpoint;
3672
+
3673
+ // eslint-disable-next-line unicorn/expiring-todo-comments
3674
+ // TODO use useBreakpoint instead
3675
+ var _useWindowDimensions = useWindowDimensions(),
3676
+ width = _useWindowDimensions.width;
3677
+
3678
+ var breakpointValue = breakpoint === 'small' ? 480 : 768;
3679
+
3680
+ if (width < breakpointValue) {
3681
+ return /*#__PURE__*/jsx(SmallScreenRow, {
3682
+ children: Children.map(children, function (child) {
3683
+ return /*#__PURE__*/jsx(SmallScreenCol, {
3684
+ children: child
3685
+ });
3686
+ })
3687
+ });
3113
3688
  }
3114
- };
3115
3689
 
3116
- var iconButton = {
3117
- backgroundColor: 'transparent',
3118
- width: 40,
3119
- height: 40,
3120
- borderRadius: 20,
3121
- borderWidth: 2,
3122
- borderColor: 'transparent',
3123
- transition: {
3124
- property: 'all',
3125
- duration: '200ms',
3126
- timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
3127
- },
3128
- scale: {
3129
- base: {
3130
- "default": 1,
3131
- hover: 0.95,
3132
- active: 0.95
3133
- },
3134
- medium: {
3135
- hover: 1.05
3136
- }
3137
- },
3138
- disabled: {
3139
- scale: 1,
3140
- backgroundColor: button.disabled.backgroundColor,
3141
- borderColor: button.disabled.borderColor
3142
- },
3143
- "default": {
3144
- pressedBackgroundColor: button["default"].pressedBackgroundColor
3145
- },
3146
- white: {
3147
- pressedBackgroundColor: button.white.hoverBackgroundColor
3690
+ return /*#__PURE__*/jsx(FlexRow, {
3691
+ children: Children.map(children, function (child) {
3692
+ return /*#__PURE__*/jsx(FlexCol, {
3693
+ children: child
3694
+ });
3695
+ })
3696
+ });
3697
+ }
3698
+
3699
+ function StoryGridCol(_ref2) {
3700
+ var title = _ref2.title,
3701
+ titleColor = _ref2.titleColor,
3702
+ children = _ref2.children,
3703
+ _ref2$platform = _ref2.platform,
3704
+ platform = _ref2$platform === void 0 ? 'all' : _ref2$platform;
3705
+ var isNative = Platform.OS === 'ios' || Platform.OS === 'android';
3706
+
3707
+ if (Platform.OS === 'web' && platform === 'native') {
3708
+ return null;
3148
3709
  }
3149
- };
3150
3710
 
3151
- var listItem = {
3152
- padding: '12px 16px',
3153
- borderColor: colors.separator,
3154
- borderWidth: 1,
3155
- innerMargin: 8
3156
- };
3711
+ if (isNative && platform === 'web') {
3712
+ return null;
3713
+ }
3157
3714
 
3158
- var shadows = {
3159
- medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
3160
- };
3715
+ return /*#__PURE__*/jsxs(Fragment, {
3716
+ children: [title ? /*#__PURE__*/jsx(StoryTitle.Level4, {
3717
+ numberOfLines: 1,
3718
+ color: titleColor,
3719
+ children: title
3720
+ }) : null, children]
3721
+ });
3722
+ }
3161
3723
 
3162
- var skeleton = {
3163
- backgroundColor: lateOceanColorPalette.black100,
3164
- flareColor: lateOceanColorPalette.black200,
3165
- animationDuration: 1000
3724
+ var StoryGrid = {
3725
+ Row: StoryGridRow,
3726
+ Col: StoryGridCol
3166
3727
  };
3167
3728
 
3168
- var tag = {
3169
- borderRadius: 10,
3170
- padding: '2px 12px',
3171
- primary: {
3172
- fill: {
3173
- backgroundColor: lateOceanColorPalette.moonPurpleLight1,
3174
- borderWidth: 0,
3175
- borderColor: colors.transparent
3176
- },
3177
- outline: {
3178
- backgroundColor: colors.transparent,
3179
- borderWidth: 1,
3180
- borderColor: colors.primary
3181
- }
3182
- },
3183
- "default": {
3184
- fill: {
3185
- backgroundColor: lateOceanColorPalette.black50,
3186
- borderWidth: 0,
3187
- borderColor: colors.transparent
3188
- },
3189
- outline: {
3190
- backgroundColor: colors.transparent,
3191
- borderWidth: 1,
3192
- borderColor: colors.black
3193
- }
3194
- },
3195
- danger: {
3196
- fill: {
3197
- backgroundColor: lateOceanColorPalette.warmEmbrace,
3198
- borderWidth: 0,
3199
- borderColor: colors.transparent
3200
- },
3201
- outline: {
3202
- backgroundColor: colors.transparent,
3203
- borderWidth: 1,
3204
- borderColor: colors.danger
3205
- }
3206
- }
3207
- };
3729
+ var Container$1 = /*#__PURE__*/styled.View.withConfig({
3730
+ displayName: "Tag__Container"
3731
+ })(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], function (_ref) {
3732
+ var theme = _ref.theme,
3733
+ type = _ref.type,
3734
+ variant = _ref.variant;
3735
+ return theme.kitt.tag[type][variant].backgroundColor;
3736
+ }, function (_ref2) {
3737
+ var theme = _ref2.theme,
3738
+ type = _ref2.type,
3739
+ variant = _ref2.variant;
3740
+ return theme.kitt.tag[type][variant].borderWidth;
3741
+ }, function (_ref3) {
3742
+ var theme = _ref3.theme,
3743
+ type = _ref3.type,
3744
+ variant = _ref3.variant;
3745
+ return theme.kitt.tag[type][variant].borderColor;
3746
+ }, function (_ref4) {
3747
+ var theme = _ref4.theme;
3748
+ return theme.kitt.tag.padding;
3749
+ }, function (_ref5) {
3750
+ var theme = _ref5.theme;
3751
+ return theme.kitt.tag.borderRadius;
3752
+ });
3753
+ var getLabelColor = function (type, variant) {
3754
+ switch (type) {
3755
+ case 'danger':
3756
+ {
3757
+ return variant === 'outline' ? 'danger' : 'black';
3758
+ }
3208
3759
 
3209
- var tooltip = {
3210
- backgroundColor: colors.black,
3211
- borderRadius: 10,
3212
- opacity: 0.95,
3213
- horizontalPadding: 16,
3214
- verticalPadding: 4,
3215
- floatingPadding: 8
3216
- };
3760
+ case 'primary':
3761
+ {
3762
+ return 'primary';
3763
+ }
3217
3764
 
3218
- var breakpoints = {
3219
- values: {
3220
- base: 0,
3221
- small: 480,
3222
- medium: 768,
3223
- large: 1024,
3224
- wide: 1280
3225
- },
3226
- min: {
3227
- smallBreakpoint: 'min-width: 480px',
3228
- mediumBreakpoint: 'min-width: 768px',
3229
- largeBreakpoint: 'min-width: 1024px',
3230
- wideBreakpoint: 'min-width: 1280px'
3231
- },
3232
- max: {
3233
- smallBreakpoint: 'max-width: 479px',
3234
- mediumBreakpoint: 'max-width: 767px',
3235
- largeBreakpoint: 'max-width: 1023px',
3236
- wideBreakpoint: 'max-width: 1279px'
3237
- }
3238
- }; // eslint-disable-next-line unicorn/expiring-todo-comments
3239
- // TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
3765
+ case 'default':
3766
+ {
3767
+ return 'black';
3768
+ }
3240
3769
 
3241
- var theme = {
3242
- spacing: 4,
3243
- colors: colors,
3244
- palettes: {
3245
- lateOcean: lateOceanColorPalette
3246
- },
3247
- avatar: avatar,
3248
- button: button,
3249
- card: card,
3250
- feedbackMessage: feedbackMessage,
3251
- forms: forms,
3252
- typography: typography,
3253
- tag: tag,
3254
- shadows: shadows,
3255
- fullScreenModal: fullScreenModal,
3256
- iconButton: iconButton,
3257
- listItem: listItem,
3258
- tooltip: tooltip,
3259
- skeleton: skeleton,
3260
- breakpoints: breakpoints
3770
+ default:
3771
+ {
3772
+ return 'black';
3773
+ }
3774
+ }
3261
3775
  };
3776
+ function Tag(_ref6) {
3777
+ var label = _ref6.label,
3778
+ _ref6$type = _ref6.type,
3779
+ type = _ref6$type === void 0 ? 'default' : _ref6$type,
3780
+ _ref6$variant = _ref6.variant,
3781
+ variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
3782
+ return /*#__PURE__*/jsx(Container$1, {
3783
+ type: type,
3784
+ variant: variant,
3785
+ children: /*#__PURE__*/jsx(Typography.Text, {
3786
+ base: "body-xsmall",
3787
+ color: getLabelColor(type, variant),
3788
+ children: label
3789
+ })
3790
+ });
3791
+ }
3262
3792
 
3263
3793
  function Title(_ref) {
3264
3794
  var children = _ref.children;
@@ -3291,7 +3821,7 @@ function ModalDateTimePicker(_ref2) {
3291
3821
  setCurrentValue(value);
3292
3822
  onClose();
3293
3823
  },
3294
- children: visible ? /*#__PURE__*/jsxs(Fragment$1, {
3824
+ children: visible ? /*#__PURE__*/jsxs(Fragment, {
3295
3825
  children: [title ? /*#__PURE__*/jsx(Title, {
3296
3826
  children: title
3297
3827
  }) : null, /*#__PURE__*/jsx(Modal.Body, {
@@ -3671,79 +4201,6 @@ function TypographyLink(_ref5) {
3671
4201
  }));
3672
4202
  }
3673
4203
 
3674
- function matchWindowSize(_ref, _ref2) {
3675
- var width = _ref.width,
3676
- height = _ref.height;
3677
- var minWidth = _ref2.minWidth,
3678
- maxWidth = _ref2.maxWidth,
3679
- minHeight = _ref2.minHeight,
3680
- maxHeight = _ref2.maxHeight;
3681
- var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
3682
- var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
3683
- return hasWidthMatched && hasHeightMatched;
3684
- }
3685
- function useMatchWindowSize(options) {
3686
- var _useWindowDimensions = useWindowDimensions(),
3687
- width = _useWindowDimensions.width,
3688
- height = _useWindowDimensions.height;
3689
-
3690
- return matchWindowSize({
3691
- width: width,
3692
- height: height
3693
- }, options);
3694
- }
3695
-
3696
- function createWindowSizeHelper(dimensions) {
3697
- return {
3698
- matchWindowSize: function matchWindowSize$1(options) {
3699
- return matchWindowSize(dimensions, options);
3700
- },
3701
- ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
3702
- return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
3703
- },
3704
- mapWindowWidth: function mapWindowWidth() {
3705
- for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
3706
- widthList[_key] = arguments[_key];
3707
- }
3708
-
3709
- if ((process.env.NODE_ENV !== "production")) {
3710
- widthList.slice(1).forEach(function (_ref, index) {
3711
- var _ref2 = _slicedToArray(_ref, 1),
3712
- minWidth = _ref2[0];
3713
-
3714
- var previousMinWidth = widthList[index][0];
3715
-
3716
- if (previousMinWidth > minWidth) {
3717
- throw new Error("mapWindowWidth: sort your values to be mobile first. ".concat(minWidth, " is < ").concat(previousMinWidth, ", so ").concat(minWidth, " should be before ").concat(previousMinWidth, "."));
3718
- }
3719
- });
3720
- }
3721
-
3722
- var found = widthList.find(function (_ref3) {
3723
- var _ref4 = _slicedToArray(_ref3, 2),
3724
- minWidth = _ref4[0];
3725
- _ref4[1];
3726
-
3727
- return matchWindowSize(dimensions, {
3728
- minWidth: Number(minWidth)
3729
- });
3730
- });
3731
- if (!found) return null;
3732
- return found[1];
3733
- }
3734
- };
3735
- }
3736
-
3737
- function useKittTheme() {
3738
- var dimensions = useWindowDimensions();
3739
- return useMemo(function () {
3740
- return {
3741
- kitt: theme,
3742
- responsive: createWindowSizeHelper(dimensions)
3743
- };
3744
- }, [dimensions]);
3745
- }
3746
-
3747
4204
  var hex2rgba = function (hex) {
3748
4205
  var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
3749
4206
  var r = parseInt(hex.slice(1, 3), 16);
@@ -3782,5 +4239,5 @@ function MatchWindowSize(_ref) {
3782
4239
  return children;
3783
4240
  }
3784
4241
 
3785
- export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPressable, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
4242
+ export { Avatar, Button, Card, Checkbox, DatePicker, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
3786
4243
  //# sourceMappingURL=index-browser-all.es.js.map