@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.
- package/dist/definitions/Button/BaseStyledButtonPressable.d.ts +1 -0
- package/dist/definitions/Button/BaseStyledButtonPressable.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts +1 -0
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/Overlay/Overlay.d.ts +1 -2
- package/dist/definitions/Overlay/Overlay.d.ts.map +1 -1
- package/dist/definitions/PageLoader/AnimatedBackgroundCircle.d.ts +3 -0
- package/dist/definitions/PageLoader/AnimatedBackgroundCircle.d.ts.map +1 -0
- package/dist/definitions/PageLoader/AnimatedFillCircle.d.ts +3 -0
- package/dist/definitions/PageLoader/AnimatedFillCircle.d.ts.map +1 -0
- package/dist/definitions/PageLoader/AnimatedFillCircleContainer.d.ts +8 -0
- package/dist/definitions/PageLoader/AnimatedFillCircleContainer.d.ts.map +1 -0
- package/dist/definitions/PageLoader/AnimatedLoaderCircle.d.ts +10 -0
- package/dist/definitions/PageLoader/AnimatedLoaderCircle.d.ts.map +1 -0
- package/dist/definitions/PageLoader/PageLoader.d.ts.map +1 -1
- package/dist/definitions/PageLoader/PageLoader.web.d.ts.map +1 -1
- package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +2 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/button.d.ts +2 -1
- package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/colors.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/colors.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/input.d.ts +2 -2
- package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/pageLoader.d.ts +13 -0
- package/dist/definitions/themes/late-ocean/pageLoader.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/typography.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +232 -40
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +232 -40
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +232 -40
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +127 -46
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +228 -37
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -1
- package/dist/index-node-14.17.cjs.web.js +117 -42
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +37 -12
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +37 -12
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +37 -12
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +37 -12
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +37 -12
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +37 -12
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +9 -4
|
@@ -2,12 +2,12 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import { UserIcon, CheckboxMark, XIcon, EyeOffIcon, EyeIcon, ArcIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
|
|
4
4
|
export * from '@ornikar/kitt-icons';
|
|
5
|
-
import { useWindowDimensions, Platform, Image, Linking, Pressable, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1, TextInput, View, Animated as Animated$1, Easing
|
|
5
|
+
import { useWindowDimensions, Platform, Image, Linking, Pressable, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1, TextInput, View, Animated as Animated$1, Easing } from 'react-native';
|
|
6
6
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
7
|
-
import styled, {
|
|
7
|
+
import styled, { css, useTheme, ThemeProvider } from 'styled-components/native';
|
|
8
8
|
import { cloneElement, useContext, createContext, forwardRef, useMemo, useState, useRef, useEffect, Fragment as Fragment$1, Children } from 'react';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
|
-
import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring,
|
|
10
|
+
import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, useAnimatedProps, withDelay, withTiming, Easing as Easing$1, withRepeat, 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';
|
|
@@ -15,6 +15,7 @@ import DateTimePicker, { DateTimePickerAndroid } from '@react-native-community/d
|
|
|
15
15
|
import { FormattedMessage } from 'react-intl';
|
|
16
16
|
import _extends from '@babel/runtime/helpers/extends';
|
|
17
17
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
18
|
+
import Svg, { Circle as Circle$1 } from 'react-native-svg';
|
|
18
19
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
19
20
|
import { useFloating, offset, shift, flip } from '@floating-ui/react-native';
|
|
20
21
|
import { makeDecorator } from '@storybook/addons';
|
|
@@ -145,7 +146,8 @@ var StyledTypography = /*#__PURE__*/styled.Text.withConfig({
|
|
|
145
146
|
}, function (_ref2) {
|
|
146
147
|
var theme = _ref2.theme,
|
|
147
148
|
$color = _ref2.$color;
|
|
148
|
-
|
|
149
|
+
if (!$color) return '';
|
|
150
|
+
return css(["color:", ";text-decoration-color:", ";"], theme.kitt.typography.colors[$color], theme.kitt.typography.colors[$color]);
|
|
149
151
|
});
|
|
150
152
|
function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
151
153
|
var _useWindowDimensions = useWindowDimensions(),
|
|
@@ -493,11 +495,14 @@ var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
|
493
495
|
}, function (_ref7) {
|
|
494
496
|
var theme = _ref7.theme,
|
|
495
497
|
$isLarge = _ref7.$isLarge,
|
|
498
|
+
$isXLarge = _ref7.$isXLarge,
|
|
496
499
|
$isDisabled = _ref7.$isDisabled;
|
|
497
500
|
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
498
501
|
large = _theme$kitt$button$co.large,
|
|
499
502
|
defaultPadding = _theme$kitt$button$co["default"],
|
|
500
|
-
disabledPadding = _theme$kitt$button$co.disabled
|
|
503
|
+
disabledPadding = _theme$kitt$button$co.disabled,
|
|
504
|
+
xLarge = _theme$kitt$button$co.xLarge;
|
|
505
|
+
if ($isXLarge) return xLarge;
|
|
501
506
|
if ($isLarge) return large;
|
|
502
507
|
if ($isDisabled) return disabledPadding;
|
|
503
508
|
return defaultPadding;
|
|
@@ -556,6 +561,9 @@ var getTextColorByType = function (type, variant) {
|
|
|
556
561
|
case 'subtle-dark':
|
|
557
562
|
return 'black';
|
|
558
563
|
|
|
564
|
+
case 'default':
|
|
565
|
+
return variant === 'ghost' ? 'white' : 'black';
|
|
566
|
+
|
|
559
567
|
default:
|
|
560
568
|
return 'black';
|
|
561
569
|
}
|
|
@@ -710,6 +718,7 @@ var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
|
|
|
710
718
|
return theme.kitt.button.borderRadius;
|
|
711
719
|
});
|
|
712
720
|
|
|
721
|
+
var allowedGhostTypes = ['primary', 'default'];
|
|
713
722
|
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
714
723
|
var children = _ref.children,
|
|
715
724
|
_ref$type = _ref.type,
|
|
@@ -719,6 +728,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
719
728
|
disabled = _ref.disabled,
|
|
720
729
|
stretch = _ref.stretch,
|
|
721
730
|
large = _ref.large,
|
|
731
|
+
xLarge = _ref.xLarge,
|
|
722
732
|
icon = _ref.icon,
|
|
723
733
|
_ref$iconPosition = _ref.iconPosition,
|
|
724
734
|
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
@@ -729,8 +739,8 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
729
739
|
accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
|
|
730
740
|
onPress = _ref.onPress;
|
|
731
741
|
|
|
732
|
-
if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && type
|
|
733
|
-
throw new Error('variant=ghost is only allowed with type=primary');
|
|
742
|
+
if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && !allowedGhostTypes.includes(type)) {
|
|
743
|
+
throw new Error('variant=ghost is only allowed with type=primary or default');
|
|
734
744
|
}
|
|
735
745
|
|
|
736
746
|
return /*#__PURE__*/jsx(AnimatedButtonPressable, {
|
|
@@ -749,6 +759,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
749
759
|
$variant: variant,
|
|
750
760
|
$isStretch: stretch,
|
|
751
761
|
$isLarge: large,
|
|
762
|
+
$isXLarge: xLarge,
|
|
752
763
|
$isDisabled: disabled,
|
|
753
764
|
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
754
765
|
type: type,
|
|
@@ -909,7 +920,9 @@ var colors = {
|
|
|
909
920
|
warning: lateOceanColorPalette.goldCrayola,
|
|
910
921
|
separator: lateOceanColorPalette.black100,
|
|
911
922
|
hover: lateOceanColorPalette.black100,
|
|
923
|
+
white: lateOceanColorPalette.white,
|
|
912
924
|
black: lateOceanColorPalette.black1000,
|
|
925
|
+
blackAnthracite: lateOceanColorPalette.black800,
|
|
913
926
|
uiBackground: lateOceanColorPalette.black25,
|
|
914
927
|
uiBackgroundLight: lateOceanColorPalette.white,
|
|
915
928
|
transparent: lateOceanColorPalette.transparent,
|
|
@@ -956,6 +969,7 @@ var button = {
|
|
|
956
969
|
contentPadding: {
|
|
957
970
|
"default": '7px 16px 7px',
|
|
958
971
|
large: '11px 24px 11px',
|
|
972
|
+
xLarge: '15px 24px 15px',
|
|
959
973
|
disabled: '5px 14px 5px'
|
|
960
974
|
},
|
|
961
975
|
transition: {
|
|
@@ -968,6 +982,15 @@ var button = {
|
|
|
968
982
|
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
969
983
|
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
970
984
|
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
985
|
+
},
|
|
986
|
+
ghost: {
|
|
987
|
+
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
988
|
+
pressedBackgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
989
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
990
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.4)',
|
|
991
|
+
color: lateOceanColorPalette.white,
|
|
992
|
+
hoverColor: lateOceanColorPalette.white,
|
|
993
|
+
activeColor: lateOceanColorPalette.white
|
|
971
994
|
}
|
|
972
995
|
},
|
|
973
996
|
primary: {
|
|
@@ -1102,16 +1125,16 @@ var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFon
|
|
|
1102
1125
|
};
|
|
1103
1126
|
var typography = {
|
|
1104
1127
|
colors: {
|
|
1105
|
-
black:
|
|
1106
|
-
'black-anthracite':
|
|
1128
|
+
black: colors.black,
|
|
1129
|
+
'black-anthracite': colors.blackAnthracite,
|
|
1107
1130
|
'black-light': lateOceanColorPalette.black555,
|
|
1108
|
-
white:
|
|
1109
|
-
'white-light':
|
|
1110
|
-
primary:
|
|
1111
|
-
'primary-light':
|
|
1112
|
-
accent:
|
|
1113
|
-
success:
|
|
1114
|
-
danger:
|
|
1131
|
+
white: colors.white,
|
|
1132
|
+
'white-light': colors.white,
|
|
1133
|
+
primary: colors.primary,
|
|
1134
|
+
'primary-light': colors.primaryLight,
|
|
1135
|
+
accent: colors.accent,
|
|
1136
|
+
success: colors.success,
|
|
1137
|
+
danger: colors.danger
|
|
1115
1138
|
},
|
|
1116
1139
|
types: {
|
|
1117
1140
|
headers: {
|
|
@@ -1207,8 +1230,8 @@ var input = {
|
|
|
1207
1230
|
size: 20
|
|
1208
1231
|
},
|
|
1209
1232
|
padding: {
|
|
1210
|
-
|
|
1211
|
-
|
|
1233
|
+
horizontal: 16,
|
|
1234
|
+
vertical: 5
|
|
1212
1235
|
},
|
|
1213
1236
|
transition: {
|
|
1214
1237
|
property: 'border-color',
|
|
@@ -1323,7 +1346,20 @@ var listItem = {
|
|
|
1323
1346
|
};
|
|
1324
1347
|
|
|
1325
1348
|
var pageLoader = {
|
|
1326
|
-
size: 60
|
|
1349
|
+
size: 60,
|
|
1350
|
+
strokeWidth: 3,
|
|
1351
|
+
colors: {
|
|
1352
|
+
base: colors.separator,
|
|
1353
|
+
fill: colors.primary
|
|
1354
|
+
},
|
|
1355
|
+
animation: {
|
|
1356
|
+
delay: 500,
|
|
1357
|
+
circleBackgroundFillDuration: 1000,
|
|
1358
|
+
filledCircleFillDuration: 1800,
|
|
1359
|
+
groupFilledCircleRotationDuration: 1800,
|
|
1360
|
+
filledCircleRotationDuration: 2160,
|
|
1361
|
+
fillEasingFunction: [0.39, 0.575, 0.565, 1]
|
|
1362
|
+
}
|
|
1327
1363
|
};
|
|
1328
1364
|
|
|
1329
1365
|
var shadows = {
|
|
@@ -1619,7 +1655,7 @@ var ViewInput = /*#__PURE__*/styled.View.withConfig({
|
|
|
1619
1655
|
displayName: "DatePickerInputPart__ViewInput"
|
|
1620
1656
|
})(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, function (_ref) {
|
|
1621
1657
|
var theme = _ref.theme;
|
|
1622
|
-
return theme.kitt.forms.input.padding
|
|
1658
|
+
return "".concat(theme.kitt.forms.input.padding.vertical, "px ").concat(theme.kitt.forms.input.padding.horizontal, "px");
|
|
1623
1659
|
}, function (_ref2) {
|
|
1624
1660
|
var theme = _ref2.theme;
|
|
1625
1661
|
return theme.kitt.forms.input.minHeight;
|
|
@@ -2333,20 +2369,18 @@ var StyledTextInput = /*#__PURE__*/styled(TextInput).withConfig({
|
|
|
2333
2369
|
})(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, function (_ref) {
|
|
2334
2370
|
var theme = _ref.theme,
|
|
2335
2371
|
multiline = _ref.multiline;
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
return theme.kitt.forms.input.padding.iOSSingleLine;
|
|
2339
|
-
}
|
|
2340
|
-
|
|
2341
|
-
return theme.kitt.forms.input.padding["default"];
|
|
2372
|
+
if (!multiline && Platform.OS !== 'web') return "0 ".concat(theme.kitt.forms.input.padding.horizontal, "px");
|
|
2373
|
+
return "".concat(theme.kitt.forms.input.padding.vertical, "px ").concat(theme.kitt.forms.input.padding.horizontal, "px");
|
|
2342
2374
|
}, function (_ref2) {
|
|
2343
2375
|
var theme = _ref2.theme,
|
|
2344
2376
|
multiline = _ref2.multiline;
|
|
2345
|
-
if (!multiline && Platform.OS
|
|
2377
|
+
if (!multiline && Platform.OS !== 'web') return 0;
|
|
2346
2378
|
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
2347
2379
|
return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight, "px");
|
|
2348
2380
|
}, function (_ref3) {
|
|
2349
|
-
var
|
|
2381
|
+
var theme = _ref3.theme,
|
|
2382
|
+
_ref3$$minHeight = _ref3.$minHeight,
|
|
2383
|
+
$minHeight = _ref3$$minHeight === void 0 ? theme.kitt.forms.input.minHeight : _ref3$$minHeight;
|
|
2350
2384
|
return $minHeight;
|
|
2351
2385
|
});
|
|
2352
2386
|
var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
|
|
@@ -2355,8 +2389,7 @@ var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
|
|
|
2355
2389
|
var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
2356
2390
|
var id = _ref4.id,
|
|
2357
2391
|
right = _ref4.right,
|
|
2358
|
-
|
|
2359
|
-
minHeight = _ref4$minHeight === void 0 ? 0 : _ref4$minHeight,
|
|
2392
|
+
minHeight = _ref4.minHeight,
|
|
2360
2393
|
formState = _ref4.state,
|
|
2361
2394
|
internalForceState = _ref4.internalForceState,
|
|
2362
2395
|
_ref4$disabled = _ref4.disabled,
|
|
@@ -3239,19 +3272,178 @@ function Notification(_ref) {
|
|
|
3239
3272
|
});
|
|
3240
3273
|
}
|
|
3241
3274
|
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3275
|
+
var AnimatedCircle = Animated.createAnimatedComponent(Circle$1);
|
|
3276
|
+
function AnimatedLoaderCircle(_ref) {
|
|
3277
|
+
var color = _ref.color,
|
|
3278
|
+
progress = _ref.progress;
|
|
3279
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3280
|
+
var _theme$kitt$pageLoade = theme.kitt.pageLoader,
|
|
3281
|
+
strokeWidth = _theme$kitt$pageLoade.strokeWidth,
|
|
3282
|
+
size = _theme$kitt$pageLoade.size;
|
|
3283
|
+
var centerCoord = size * 0.5;
|
|
3284
|
+
var circlePerimeter = 2 * Math.PI * (size * 0.5 - strokeWidth);
|
|
3285
|
+
var strokeAnimation = useAnimatedProps(function () {
|
|
3286
|
+
var _f = function () {
|
|
3287
|
+
return {
|
|
3288
|
+
strokeDashoffset: circlePerimeter - circlePerimeter * progress.value
|
|
3289
|
+
};
|
|
3290
|
+
};
|
|
3291
|
+
|
|
3292
|
+
_f._closure = {
|
|
3293
|
+
circlePerimeter: circlePerimeter,
|
|
3294
|
+
progress: progress
|
|
3295
|
+
};
|
|
3296
|
+
_f.asString = "function _f(){const{circlePerimeter,progress}=jsThis._closure;{return{strokeDashoffset:circlePerimeter-circlePerimeter*progress.value};}}";
|
|
3297
|
+
_f.__workletHash = 1345639818356;
|
|
3298
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/PageLoader/AnimatedLoaderCircle.tsx (23:43)";
|
|
3299
|
+
|
|
3300
|
+
global.__reanimatedWorkletInit(_f);
|
|
3301
|
+
|
|
3302
|
+
return _f;
|
|
3303
|
+
}());
|
|
3304
|
+
return /*#__PURE__*/jsx(AnimatedCircle, {
|
|
3305
|
+
"transform-origin": "center center",
|
|
3306
|
+
strokeWidth: strokeWidth,
|
|
3307
|
+
stroke: color,
|
|
3308
|
+
strokeLinecap: "round",
|
|
3309
|
+
cx: centerCoord,
|
|
3310
|
+
cy: centerCoord,
|
|
3311
|
+
r: centerCoord - strokeWidth,
|
|
3312
|
+
fill: "none",
|
|
3313
|
+
strokeDasharray: circlePerimeter,
|
|
3314
|
+
animatedProps: strokeAnimation
|
|
3315
|
+
});
|
|
3245
3316
|
}
|
|
3246
3317
|
|
|
3247
|
-
function
|
|
3318
|
+
function AnimatedBackgroundCircle() {
|
|
3319
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3320
|
+
var progress = useSharedValue(0);
|
|
3321
|
+
var _theme$kitt$pageLoade = theme.kitt.pageLoader,
|
|
3322
|
+
animation = _theme$kitt$pageLoade.animation,
|
|
3323
|
+
colors = _theme$kitt$pageLoade.colors,
|
|
3324
|
+
size = _theme$kitt$pageLoade.size;
|
|
3325
|
+
useEffect(function () {
|
|
3326
|
+
var delay = animation.delay,
|
|
3327
|
+
circleBackgroundFillDuration = animation.circleBackgroundFillDuration,
|
|
3328
|
+
fillEasingFunction = animation.fillEasingFunction;
|
|
3329
|
+
|
|
3330
|
+
var _fillEasingFunction = _slicedToArray(fillEasingFunction, 4),
|
|
3331
|
+
x1 = _fillEasingFunction[0],
|
|
3332
|
+
y1 = _fillEasingFunction[1],
|
|
3333
|
+
x2 = _fillEasingFunction[2],
|
|
3334
|
+
y2 = _fillEasingFunction[3];
|
|
3335
|
+
|
|
3336
|
+
progress.value = withDelay(delay, withTiming(1, {
|
|
3337
|
+
duration: circleBackgroundFillDuration,
|
|
3338
|
+
easing: Easing$1.bezier(x1, y1, x2, y2)
|
|
3339
|
+
}));
|
|
3340
|
+
}, [progress, animation]);
|
|
3341
|
+
return /*#__PURE__*/jsx(Svg, {
|
|
3342
|
+
width: size,
|
|
3343
|
+
height: size,
|
|
3344
|
+
viewBox: "0 0 ".concat(size, " ").concat(size),
|
|
3345
|
+
children: /*#__PURE__*/jsx(AnimatedLoaderCircle, {
|
|
3346
|
+
color: colors.base,
|
|
3347
|
+
progress: progress
|
|
3348
|
+
})
|
|
3349
|
+
});
|
|
3350
|
+
}
|
|
3351
|
+
|
|
3352
|
+
var isInfinitAnimation$1 = -1;
|
|
3353
|
+
function AnimatedFillCircleContainer(_ref) {
|
|
3354
|
+
var children = _ref.children,
|
|
3355
|
+
duration = _ref.duration;
|
|
3248
3356
|
var theme = /*#__PURE__*/useTheme();
|
|
3249
|
-
var
|
|
3250
|
-
var
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3357
|
+
var progress = useSharedValue(0);
|
|
3358
|
+
var animation = theme.kitt.pageLoader.animation;
|
|
3359
|
+
useEffect(function () {
|
|
3360
|
+
var delay = animation.delay;
|
|
3361
|
+
progress.value = withDelay(delay, withRepeat(withTiming(1, {
|
|
3362
|
+
duration: duration,
|
|
3363
|
+
easing: Easing$1.linear
|
|
3364
|
+
}), isInfinitAnimation$1));
|
|
3365
|
+
}, [progress, animation, duration]);
|
|
3366
|
+
var rotationStyles = useAnimatedStyle(function () {
|
|
3367
|
+
var _f = function () {
|
|
3368
|
+
return {
|
|
3369
|
+
transform: [{
|
|
3370
|
+
rotate: "".concat(360 * progress.value, "deg")
|
|
3371
|
+
}]
|
|
3372
|
+
};
|
|
3373
|
+
};
|
|
3374
|
+
|
|
3375
|
+
_f._closure = {
|
|
3376
|
+
progress: progress
|
|
3377
|
+
};
|
|
3378
|
+
_f.asString = "function _f(){const{progress}=jsThis._closure;{return{transform:[{rotate:360*progress.value+\"deg\"}]};}}";
|
|
3379
|
+
_f.__workletHash = 16553090406738;
|
|
3380
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/PageLoader/AnimatedFillCircleContainer.tsx (36:42)";
|
|
3381
|
+
_f.__optimalization = 3;
|
|
3382
|
+
|
|
3383
|
+
global.__reanimatedWorkletInit(_f);
|
|
3384
|
+
|
|
3385
|
+
return _f;
|
|
3386
|
+
}());
|
|
3387
|
+
return /*#__PURE__*/jsx(Animated.View, {
|
|
3388
|
+
style: [StyleSheet.absoluteFill, rotationStyles],
|
|
3389
|
+
children: children
|
|
3390
|
+
});
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3393
|
+
var isInfinitAnimation = -1;
|
|
3394
|
+
var shouldReverse = true;
|
|
3395
|
+
function AnimatedFilledCircle() {
|
|
3396
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3397
|
+
var progress = useSharedValue(0);
|
|
3398
|
+
var _theme$kitt$pageLoade = theme.kitt.pageLoader,
|
|
3399
|
+
size = _theme$kitt$pageLoade.size,
|
|
3400
|
+
animation = _theme$kitt$pageLoade.animation,
|
|
3401
|
+
colors = _theme$kitt$pageLoade.colors;
|
|
3402
|
+
useEffect(function () {
|
|
3403
|
+
var delay = animation.delay,
|
|
3404
|
+
filledCircleFillDuration = animation.filledCircleFillDuration,
|
|
3405
|
+
fillEasingFunction = animation.fillEasingFunction;
|
|
3406
|
+
|
|
3407
|
+
var _fillEasingFunction = _slicedToArray(fillEasingFunction, 4),
|
|
3408
|
+
x1 = _fillEasingFunction[0],
|
|
3409
|
+
y1 = _fillEasingFunction[1],
|
|
3410
|
+
x2 = _fillEasingFunction[2],
|
|
3411
|
+
y2 = _fillEasingFunction[3];
|
|
3412
|
+
|
|
3413
|
+
progress.value = withDelay(delay, withRepeat(withTiming(0.8, {
|
|
3414
|
+
duration: filledCircleFillDuration,
|
|
3415
|
+
easing: Easing$1.bezier(x1, y1, x2, y2)
|
|
3416
|
+
}), isInfinitAnimation, shouldReverse));
|
|
3417
|
+
}, [progress, animation]);
|
|
3418
|
+
return /*#__PURE__*/jsx(AnimatedFillCircleContainer, {
|
|
3419
|
+
duration: animation.groupFilledCircleRotationDuration,
|
|
3420
|
+
children: /*#__PURE__*/jsx(AnimatedFillCircleContainer, {
|
|
3421
|
+
duration: animation.filledCircleRotationDuration,
|
|
3422
|
+
children: /*#__PURE__*/jsx(Svg, {
|
|
3423
|
+
width: size,
|
|
3424
|
+
height: size,
|
|
3425
|
+
viewBox: "0 0 ".concat(size, " ").concat(size),
|
|
3426
|
+
children: /*#__PURE__*/jsx(AnimatedLoaderCircle, {
|
|
3427
|
+
color: colors.fill,
|
|
3428
|
+
progress: progress
|
|
3429
|
+
})
|
|
3430
|
+
})
|
|
3431
|
+
})
|
|
3432
|
+
});
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
var PageLoaderContainer = /*#__PURE__*/styled.View.withConfig({
|
|
3436
|
+
displayName: "PageLoader__PageLoaderContainer"
|
|
3437
|
+
})(["transform:scale(-1) rotate(90deg);position:relative;width:", "px;height:", "px;"], function (_ref) {
|
|
3438
|
+
var theme = _ref.theme;
|
|
3439
|
+
return theme.kitt.pageLoader.size;
|
|
3440
|
+
}, function (_ref2) {
|
|
3441
|
+
var theme = _ref2.theme;
|
|
3442
|
+
return theme.kitt.pageLoader.size;
|
|
3443
|
+
});
|
|
3444
|
+
function PageLoader() {
|
|
3445
|
+
return /*#__PURE__*/jsxs(PageLoaderContainer, {
|
|
3446
|
+
children: [/*#__PURE__*/jsx(AnimatedBackgroundCircle, {}), /*#__PURE__*/jsx(AnimatedFilledCircle, {})]
|
|
3255
3447
|
});
|
|
3256
3448
|
}
|
|
3257
3449
|
|