@ornikar/kitt-universal 7.1.0 → 7.3.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 (59) hide show
  1. package/dist/definitions/Button/BaseStyledButtonPressable.d.ts +1 -0
  2. package/dist/definitions/Button/BaseStyledButtonPressable.d.ts.map +1 -1
  3. package/dist/definitions/Button/Button.d.ts +1 -0
  4. package/dist/definitions/Button/Button.d.ts.map +1 -1
  5. package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
  6. package/dist/definitions/Overlay/Overlay.d.ts +1 -2
  7. package/dist/definitions/Overlay/Overlay.d.ts.map +1 -1
  8. package/dist/definitions/PageLoader/AnimatedBackgroundCircle.d.ts +3 -0
  9. package/dist/definitions/PageLoader/AnimatedBackgroundCircle.d.ts.map +1 -0
  10. package/dist/definitions/PageLoader/AnimatedFillCircle.d.ts +3 -0
  11. package/dist/definitions/PageLoader/AnimatedFillCircle.d.ts.map +1 -0
  12. package/dist/definitions/PageLoader/AnimatedFillCircleContainer.d.ts +8 -0
  13. package/dist/definitions/PageLoader/AnimatedFillCircleContainer.d.ts.map +1 -0
  14. package/dist/definitions/PageLoader/AnimatedLoaderCircle.d.ts +10 -0
  15. package/dist/definitions/PageLoader/AnimatedLoaderCircle.d.ts.map +1 -0
  16. package/dist/definitions/PageLoader/PageLoader.d.ts.map +1 -1
  17. package/dist/definitions/PageLoader/PageLoader.web.d.ts.map +1 -1
  18. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +1 -1
  19. package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
  20. package/dist/definitions/themes/default.d.ts +2 -0
  21. package/dist/definitions/themes/default.d.ts.map +1 -1
  22. package/dist/definitions/themes/late-ocean/button.d.ts +2 -1
  23. package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
  24. package/dist/definitions/themes/late-ocean/colors.d.ts +2 -0
  25. package/dist/definitions/themes/late-ocean/colors.d.ts.map +1 -1
  26. package/dist/definitions/themes/late-ocean/input.d.ts +2 -2
  27. package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
  28. package/dist/definitions/themes/late-ocean/pageLoader.d.ts +13 -0
  29. package/dist/definitions/themes/late-ocean/pageLoader.d.ts.map +1 -1
  30. package/dist/definitions/themes/late-ocean/typography.d.ts.map +1 -1
  31. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  32. package/dist/index-browser-all.es.android.js +232 -40
  33. package/dist/index-browser-all.es.android.js.map +1 -1
  34. package/dist/index-browser-all.es.ios.js +232 -40
  35. package/dist/index-browser-all.es.ios.js.map +1 -1
  36. package/dist/index-browser-all.es.js +232 -40
  37. package/dist/index-browser-all.es.js.map +1 -1
  38. package/dist/index-browser-all.es.web.js +127 -46
  39. package/dist/index-browser-all.es.web.js.map +1 -1
  40. package/dist/index-node-14.17.cjs.js +228 -37
  41. package/dist/index-node-14.17.cjs.js.map +1 -1
  42. package/dist/index-node-14.17.cjs.web.css +1 -1
  43. package/dist/index-node-14.17.cjs.web.js +117 -42
  44. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  45. package/dist/linaria-themes-browser-all.es.android.js +37 -12
  46. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  47. package/dist/linaria-themes-browser-all.es.ios.js +37 -12
  48. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  49. package/dist/linaria-themes-browser-all.es.js +37 -12
  50. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  51. package/dist/linaria-themes-browser-all.es.web.js +37 -12
  52. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  53. package/dist/linaria-themes-node-14.17.cjs.js +37 -12
  54. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  55. package/dist/linaria-themes-node-14.17.cjs.web.js +37 -12
  56. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  57. package/dist/styles.css +1 -1
  58. package/dist/tsbuildinfo +1 -1
  59. package/package.json +9 -4
@@ -4,7 +4,7 @@ import { View, Text as Text$1, useWindowDimensions, Image, Pressable, TextInput,
4
4
  export { useWindowDimensions as useWindowSize } from 'react-native';
5
5
  import { UserIcon, CheckboxMark, EyeOffIcon, EyeIcon, ArcIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
6
6
  export * from '@ornikar/kitt-icons';
7
- import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
7
+ import styled, { css, useTheme, ThemeProvider } from 'styled-components/native';
8
8
  import { cloneElement, useContext, createContext, forwardRef, useMemo, useState, Fragment, Children, useEffect } from 'react';
9
9
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
10
10
  import { styled as styled$1 } from '@linaria/react';
@@ -144,7 +144,8 @@ var StyledTypography = /*#__PURE__*/styled(Text$1).withConfig({
144
144
  }, function (_ref2) {
145
145
  var theme = _ref2.theme,
146
146
  $color = _ref2.$color;
147
- return !$color ? '' : "\n color: ".concat(theme.kitt.typography.colors[$color], ";\n text-decoration-color: ").concat(theme.kitt.typography.colors[$color], ";\n ");
147
+ if (!$color) return '';
148
+ return css(["color:", ";text-decoration-color:", ";"], theme.kitt.typography.colors[$color], theme.kitt.typography.colors[$color]);
148
149
  });
149
150
  function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
150
151
  var _useWindowDimensions = useWindowDimensions(),
@@ -547,11 +548,14 @@ var BaseStyledButtonPressable = /*#__PURE__*/styled(View).withConfig({
547
548
  }, function (_ref7) {
548
549
  var theme = _ref7.theme,
549
550
  $isLarge = _ref7.$isLarge,
551
+ $isXLarge = _ref7.$isXLarge,
550
552
  $isDisabled = _ref7.$isDisabled;
551
553
  var _theme$kitt$button$co = theme.kitt.button.contentPadding,
552
554
  large = _theme$kitt$button$co.large,
553
555
  defaultPadding = _theme$kitt$button$co["default"],
554
- disabledPadding = _theme$kitt$button$co.disabled;
556
+ disabledPadding = _theme$kitt$button$co.disabled,
557
+ xLarge = _theme$kitt$button$co.xLarge;
558
+ if ($isXLarge) return xLarge;
555
559
  if ($isLarge) return large;
556
560
  if ($isDisabled) return disabledPadding;
557
561
  return defaultPadding;
@@ -606,6 +610,9 @@ var getTextColorByType = function (type, variant) {
606
610
  case 'subtle-dark':
607
611
  return 'black';
608
612
 
613
+ case 'default':
614
+ return variant === 'ghost' ? 'white' : 'black';
615
+
609
616
  default:
610
617
  return 'black';
611
618
  }
@@ -747,6 +754,7 @@ function ButtonContent(_ref7) {
747
754
  });
748
755
  }
749
756
 
757
+ var allowedGhostTypes = ['primary', 'default'];
750
758
  var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
751
759
  var children = _ref.children,
752
760
  _ref$type = _ref.type,
@@ -756,6 +764,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
756
764
  disabled = _ref.disabled,
757
765
  stretch = _ref.stretch,
758
766
  large = _ref.large,
767
+ xLarge = _ref.xLarge,
759
768
  icon = _ref.icon,
760
769
  _ref$iconPosition = _ref.iconPosition,
761
770
  iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
@@ -766,8 +775,8 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
766
775
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
767
776
  onPress = _ref.onPress;
768
777
 
769
- if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && type !== 'primary') {
770
- throw new Error('variant=ghost is only allowed with type=primary');
778
+ if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && !allowedGhostTypes.includes(type)) {
779
+ throw new Error('variant=ghost is only allowed with type=primary or default');
771
780
  }
772
781
 
773
782
  return /*#__PURE__*/jsx(AnimatedButtonPressable, {
@@ -786,6 +795,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
786
795
  $variant: variant,
787
796
  $isStretch: stretch,
788
797
  $isLarge: large,
798
+ $isXLarge: xLarge,
789
799
  $isDisabled: disabled,
790
800
  children: [/*#__PURE__*/jsx(ButtonContent, {
791
801
  type: type,
@@ -925,7 +935,9 @@ var colors = {
925
935
  warning: lateOceanColorPalette.goldCrayola,
926
936
  separator: lateOceanColorPalette.black100,
927
937
  hover: lateOceanColorPalette.black100,
938
+ white: lateOceanColorPalette.white,
928
939
  black: lateOceanColorPalette.black1000,
940
+ blackAnthracite: lateOceanColorPalette.black800,
929
941
  uiBackground: lateOceanColorPalette.black25,
930
942
  uiBackgroundLight: lateOceanColorPalette.white,
931
943
  transparent: lateOceanColorPalette.transparent,
@@ -972,6 +984,7 @@ var button = {
972
984
  contentPadding: {
973
985
  "default": '7px 16px 7px',
974
986
  large: '11px 24px 11px',
987
+ xLarge: '15px 24px 15px',
975
988
  disabled: '5px 14px 5px'
976
989
  },
977
990
  transition: {
@@ -984,6 +997,15 @@ var button = {
984
997
  pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
985
998
  hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
986
999
  focusBorderColor: 'rgba(0, 0, 0, 0.1)'
1000
+ },
1001
+ ghost: {
1002
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
1003
+ pressedBackgroundColor: 'rgba(255, 255, 255, 0.05)',
1004
+ hoverBackgroundColor: 'rgba(255, 255, 255, 0.05)',
1005
+ focusBorderColor: 'rgba(255, 255, 255, 0.4)',
1006
+ color: lateOceanColorPalette.white,
1007
+ hoverColor: lateOceanColorPalette.white,
1008
+ activeColor: lateOceanColorPalette.white
987
1009
  }
988
1010
  },
989
1011
  primary: {
@@ -1118,16 +1140,16 @@ var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFon
1118
1140
  };
1119
1141
  var typography = {
1120
1142
  colors: {
1121
- black: lateOceanColorPalette.black1000,
1122
- 'black-anthracite': lateOceanColorPalette.black800,
1143
+ black: colors.black,
1144
+ 'black-anthracite': colors.blackAnthracite,
1123
1145
  'black-light': lateOceanColorPalette.black555,
1124
- white: lateOceanColorPalette.white,
1125
- 'white-light': lateOceanColorPalette.white,
1126
- primary: lateOceanColorPalette.lateOcean,
1127
- 'primary-light': lateOceanColorPalette.lateOceanLight1,
1128
- accent: lateOceanColorPalette.warmEmbrace,
1129
- success: lateOceanColorPalette.viride,
1130
- danger: lateOceanColorPalette.englishVermillon
1146
+ white: colors.white,
1147
+ 'white-light': colors.white,
1148
+ primary: colors.primary,
1149
+ 'primary-light': colors.primaryLight,
1150
+ accent: colors.accent,
1151
+ success: colors.success,
1152
+ danger: colors.danger
1131
1153
  },
1132
1154
  types: {
1133
1155
  headers: {
@@ -1223,8 +1245,8 @@ var input = {
1223
1245
  size: 20
1224
1246
  },
1225
1247
  padding: {
1226
- "default": '5px 16px',
1227
- iOSSingleLine: '7px 16px'
1248
+ horizontal: 16,
1249
+ vertical: 5
1228
1250
  },
1229
1251
  transition: {
1230
1252
  property: 'border-color',
@@ -1339,7 +1361,20 @@ var listItem = {
1339
1361
  };
1340
1362
 
1341
1363
  var pageLoader = {
1342
- size: 60
1364
+ size: 60,
1365
+ strokeWidth: 3,
1366
+ colors: {
1367
+ base: colors.separator,
1368
+ fill: colors.primary
1369
+ },
1370
+ animation: {
1371
+ delay: 500,
1372
+ circleBackgroundFillDuration: 1000,
1373
+ filledCircleFillDuration: 1800,
1374
+ groupFilledCircleRotationDuration: 1800,
1375
+ filledCircleRotationDuration: 2160,
1376
+ fillEasingFunction: [0.39, 0.575, 0.565, 1]
1377
+ }
1343
1378
  };
1344
1379
 
1345
1380
  var shadows = {
@@ -1639,7 +1674,7 @@ var ViewInput = /*#__PURE__*/styled(View).withConfig({
1639
1674
  componentId: "kitt-universal__sc-11fmlmi-1"
1640
1675
  })(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, function (_ref) {
1641
1676
  var theme = _ref.theme;
1642
- return theme.kitt.forms.input.padding["default"];
1677
+ return "".concat(theme.kitt.forms.input.padding.vertical, "px ").concat(theme.kitt.forms.input.padding.horizontal, "px");
1643
1678
  }, function (_ref2) {
1644
1679
  var theme = _ref2.theme;
1645
1680
  return theme.kitt.forms.input.minHeight;
@@ -1800,20 +1835,18 @@ var StyledTextInput = /*#__PURE__*/styled(TextInput).withConfig({
1800
1835
  })(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, function (_ref) {
1801
1836
  var theme = _ref.theme,
1802
1837
  multiline = _ref.multiline;
1803
-
1804
- if (!multiline && "web" === 'ios') {
1805
- return theme.kitt.forms.input.padding.iOSSingleLine;
1806
- }
1807
-
1808
- return theme.kitt.forms.input.padding["default"];
1838
+ if (!multiline && "web" !== 'web') return "0 ".concat(theme.kitt.forms.input.padding.horizontal, "px");
1839
+ return "".concat(theme.kitt.forms.input.padding.vertical, "px ").concat(theme.kitt.forms.input.padding.horizontal, "px");
1809
1840
  }, function (_ref2) {
1810
1841
  var theme = _ref2.theme,
1811
1842
  multiline = _ref2.multiline;
1812
- if (!multiline && "web" === 'ios') return 0;
1843
+ if (!multiline && "web" !== 'web') return 0;
1813
1844
  var typeConfigKey = getTypographyTypeConfigKey(theme);
1814
1845
  return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight, "px");
1815
1846
  }, function (_ref3) {
1816
- var $minHeight = _ref3.$minHeight;
1847
+ var theme = _ref3.theme,
1848
+ _ref3$$minHeight = _ref3.$minHeight,
1849
+ $minHeight = _ref3$$minHeight === void 0 ? theme.kitt.forms.input.minHeight : _ref3$$minHeight;
1817
1850
  return $minHeight;
1818
1851
  });
1819
1852
  var RightInputContainer = /*#__PURE__*/styled(View).withConfig({
@@ -1823,8 +1856,7 @@ var RightInputContainer = /*#__PURE__*/styled(View).withConfig({
1823
1856
  var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
1824
1857
  var id = _ref4.id,
1825
1858
  right = _ref4.right,
1826
- _ref4$minHeight = _ref4.minHeight,
1827
- minHeight = _ref4$minHeight === void 0 ? 0 : _ref4$minHeight,
1859
+ minHeight = _ref4.minHeight,
1828
1860
  formState = _ref4.state,
1829
1861
  internalForceState = _ref4.internalForceState,
1830
1862
  _ref4$disabled = _ref4.disabled,
@@ -3024,38 +3056,87 @@ var PageLoaderContainer = withTheme( /*#__PURE__*/styled$1("div")({
3024
3056
  "class": "kitt-u_PageLoaderContainer_ptkwz2j",
3025
3057
  vars: {
3026
3058
  "ptkwz2j-0": [function (_ref) {
3027
- var theme = _ref.theme;
3028
- return theme.kitt.colors.separator;
3059
+ var $circlePerimeter = _ref.$circlePerimeter;
3060
+ return $circlePerimeter;
3061
+ }, "px"],
3062
+ "ptkwz2j-2": [function (_ref2) {
3063
+ var $circlePerimeter = _ref2.$circlePerimeter;
3064
+ return $circlePerimeter * 0.2;
3065
+ }, "px"],
3066
+ "ptkwz2j-3": [function (_ref3) {
3067
+ var theme = _ref3.theme;
3068
+ return theme.kitt.pageLoader.size;
3069
+ }, "px"],
3070
+ "ptkwz2j-5": [function (_ref4) {
3071
+ var theme = _ref4.theme;
3072
+ return theme.kitt.pageLoader.strokeWidth;
3073
+ }, "px"],
3074
+ "ptkwz2j-8": [function (_ref5) {
3075
+ var theme = _ref5.theme;
3076
+ return theme.kitt.pageLoader.colors.base;
3029
3077
  }],
3030
- "ptkwz2j-1": [function (_ref2) {
3031
- var theme = _ref2.theme;
3032
- return theme.kitt.colors.primary;
3078
+ "ptkwz2j-9": [function (_ref6) {
3079
+ var theme = _ref6.theme;
3080
+ var animation = theme.kitt.pageLoader.animation;
3081
+
3082
+ var _animation$fillEasing = _slicedToArray(animation.fillEasingFunction, 4),
3083
+ x1 = _animation$fillEasing[0],
3084
+ y1 = _animation$fillEasing[1],
3085
+ x2 = _animation$fillEasing[2],
3086
+ y2 = _animation$fillEasing[3];
3087
+
3088
+ return "".concat(animation.circleBackgroundFillDuration, "ms cubic-bezier(").concat(x1, ", ").concat(y1, ", ").concat(x2, ", ").concat(y2, ") ").concat(animation.delay, "ms forwards");
3089
+ }],
3090
+ "ptkwz2j-10": [function (_ref7) {
3091
+ var theme = _ref7.theme;
3092
+ var animation = theme.kitt.pageLoader.animation;
3093
+ return "".concat(animation.filledCircleFillDuration, "ms linear ").concat(animation.delay, "ms infinite");
3094
+ }],
3095
+ "ptkwz2j-11": [function (_ref8) {
3096
+ var theme = _ref8.theme;
3097
+ return theme.kitt.pageLoader.colors.fill;
3098
+ }],
3099
+ "ptkwz2j-12": [function (_ref9) {
3100
+ var theme = _ref9.theme;
3101
+ var animation = theme.kitt.pageLoader.animation;
3102
+
3103
+ var _animation$fillEasing2 = _slicedToArray(animation.fillEasingFunction, 4),
3104
+ x1 = _animation$fillEasing2[0],
3105
+ y1 = _animation$fillEasing2[1],
3106
+ x2 = _animation$fillEasing2[2],
3107
+ y2 = _animation$fillEasing2[3];
3108
+
3109
+ var fillAnimation = "".concat(animation.filledCircleFillDuration, "ms cubic-bezier(").concat(x1, ", ").concat(y1, ", ").concat(x2, ", ").concat(y2, ") ").concat(animation.delay, "ms infinite alternate");
3110
+ var rotationAnimation = "".concat(animation.filledCircleRotationDuration, "ms linear ").concat(animation.delay, "ms infinite");
3111
+ return [fillAnimation, rotationAnimation].join(',');
3033
3112
  }]
3034
3113
  }
3035
3114
  }));
3036
3115
  function PageLoader() {
3037
3116
  var theme = /*#__PURE__*/useTheme();
3038
- var size = theme.kitt.pageLoader.size;
3117
+ var _theme$kitt$pageLoade = theme.kitt.pageLoader,
3118
+ size = _theme$kitt$pageLoade.size,
3119
+ strokeWidth = _theme$kitt$pageLoade.strokeWidth;
3120
+ var center = size * 0.5;
3121
+ var radius = center - strokeWidth;
3122
+ var circlePerimeter = 2 * Math.PI * radius;
3123
+ var sharedProps = {
3124
+ cx: center,
3125
+ cy: center,
3126
+ r: radius,
3127
+ fill: 'none'
3128
+ };
3039
3129
  return /*#__PURE__*/jsx(PageLoaderContainer, {
3130
+ $circlePerimeter: circlePerimeter,
3040
3131
  children: /*#__PURE__*/jsxs("svg", {
3041
3132
  width: size,
3042
3133
  height: size,
3043
3134
  children: [/*#__PURE__*/jsx("g", {
3044
3135
  "data-large-loader": "base",
3045
- children: /*#__PURE__*/jsx("circle", {
3046
- cx: "30",
3047
- cy: "30",
3048
- r: "27",
3049
- fill: "none"
3050
- })
3136
+ children: /*#__PURE__*/jsx("circle", _objectSpread({}, sharedProps))
3051
3137
  }), /*#__PURE__*/jsx("g", {
3052
3138
  "data-large-loader": "fill",
3053
- children: /*#__PURE__*/jsx("circle", {
3054
- cx: "30",
3055
- cy: "30",
3056
- r: "27",
3057
- fill: "none"
3058
- })
3139
+ children: /*#__PURE__*/jsx("circle", _objectSpread({}, sharedProps))
3059
3140
  })]
3060
3141
  })
3061
3142
  });