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