@ornikar/kitt-universal 7.2.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 (51) 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/PageLoader/AnimatedBackgroundCircle.d.ts +3 -0
  7. package/dist/definitions/PageLoader/AnimatedBackgroundCircle.d.ts.map +1 -0
  8. package/dist/definitions/PageLoader/AnimatedFillCircle.d.ts +3 -0
  9. package/dist/definitions/PageLoader/AnimatedFillCircle.d.ts.map +1 -0
  10. package/dist/definitions/PageLoader/AnimatedFillCircleContainer.d.ts +8 -0
  11. package/dist/definitions/PageLoader/AnimatedFillCircleContainer.d.ts.map +1 -0
  12. package/dist/definitions/PageLoader/AnimatedLoaderCircle.d.ts +10 -0
  13. package/dist/definitions/PageLoader/AnimatedLoaderCircle.d.ts.map +1 -0
  14. package/dist/definitions/PageLoader/PageLoader.d.ts.map +1 -1
  15. package/dist/definitions/PageLoader/PageLoader.web.d.ts.map +1 -1
  16. package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +1 -1
  17. package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
  18. package/dist/definitions/themes/late-ocean/button.d.ts +2 -1
  19. package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
  20. package/dist/definitions/themes/late-ocean/input.d.ts +2 -2
  21. package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
  22. package/dist/definitions/themes/late-ocean/pageLoader.d.ts +13 -0
  23. package/dist/definitions/themes/late-ocean/pageLoader.d.ts.map +1 -1
  24. package/dist/index-browser-all.es.android.js +218 -29
  25. package/dist/index-browser-all.es.android.js.map +1 -1
  26. package/dist/index-browser-all.es.ios.js +218 -29
  27. package/dist/index-browser-all.es.ios.js.map +1 -1
  28. package/dist/index-browser-all.es.js +218 -29
  29. package/dist/index-browser-all.es.js.map +1 -1
  30. package/dist/index-browser-all.es.web.js +113 -35
  31. package/dist/index-browser-all.es.web.js.map +1 -1
  32. package/dist/index-node-14.17.cjs.js +213 -24
  33. package/dist/index-node-14.17.cjs.js.map +1 -1
  34. package/dist/index-node-14.17.cjs.web.css +1 -1
  35. package/dist/index-node-14.17.cjs.web.js +102 -29
  36. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  37. package/dist/linaria-themes-browser-all.es.android.js +26 -3
  38. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  39. package/dist/linaria-themes-browser-all.es.ios.js +26 -3
  40. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  41. package/dist/linaria-themes-browser-all.es.js +26 -3
  42. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  43. package/dist/linaria-themes-browser-all.es.web.js +26 -3
  44. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  45. package/dist/linaria-themes-node-14.17.cjs.js +26 -3
  46. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  47. package/dist/linaria-themes-node-14.17.cjs.web.js +26 -3
  48. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  49. package/dist/styles.css +1 -1
  50. package/dist/tsbuildinfo +1 -1
  51. package/package.json +9 -4
@@ -14,6 +14,7 @@ const DateTimePicker = require('@react-native-community/datetimepicker');
14
14
  const reactIntl = require('react-intl');
15
15
  const react$1 = require('@linaria/react');
16
16
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
17
+ const Svg = require('react-native-svg');
17
18
  const expoLinearGradient = require('expo-linear-gradient');
18
19
  const reactNative$1 = require('@floating-ui/react-native');
19
20
  const addons = require('@storybook/addons');
@@ -23,6 +24,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
23
24
  const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
24
25
  const Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
25
26
  const DateTimePicker__default = /*#__PURE__*/_interopDefaultLegacy(DateTimePicker);
27
+ const Svg__default = /*#__PURE__*/_interopDefaultLegacy(Svg);
26
28
 
27
29
  const defaultIconSize = 20;
28
30
  const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
@@ -507,13 +509,16 @@ const BaseStyledButtonPressable = /*#__PURE__*/styled__default.View.withConfig({
507
509
  }, ({
508
510
  theme,
509
511
  $isLarge,
512
+ $isXLarge,
510
513
  $isDisabled
511
514
  }) => {
512
515
  const {
513
516
  large,
514
517
  default: defaultPadding,
515
- disabled: disabledPadding
518
+ disabled: disabledPadding,
519
+ xLarge
516
520
  } = theme.kitt.button.contentPadding;
521
+ if ($isXLarge) return xLarge;
517
522
  if ($isLarge) return large;
518
523
  if ($isDisabled) return disabledPadding;
519
524
  return defaultPadding;
@@ -570,6 +575,9 @@ const getTextColorByType = (type, variant) => {
570
575
  case 'subtle-dark':
571
576
  return 'black';
572
577
 
578
+ case 'default':
579
+ return variant === 'ghost' ? 'white' : 'black';
580
+
573
581
  default:
574
582
  return 'black';
575
583
  }
@@ -738,6 +746,7 @@ const StyledDisabled = /*#__PURE__*/styled__default.View.withConfig({
738
746
  theme
739
747
  }) => theme.kitt.button.borderRadius);
740
748
 
749
+ const allowedGhostTypes = ['primary', 'default'];
741
750
  const Button = /*#__PURE__*/react.forwardRef(({
742
751
  children,
743
752
  type = 'default',
@@ -745,6 +754,7 @@ const Button = /*#__PURE__*/react.forwardRef(({
745
754
  disabled,
746
755
  stretch,
747
756
  large,
757
+ xLarge,
748
758
  icon,
749
759
  iconPosition = 'left',
750
760
  testID,
@@ -753,8 +763,8 @@ const Button = /*#__PURE__*/react.forwardRef(({
753
763
  accessibilityRole = 'button',
754
764
  onPress
755
765
  }, ref) => {
756
- if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && type !== 'primary') {
757
- throw new Error('variant=ghost is only allowed with type=primary');
766
+ if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && !allowedGhostTypes.includes(type)) {
767
+ throw new Error('variant=ghost is only allowed with type=primary or default');
758
768
  }
759
769
 
760
770
  return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressable, {
@@ -773,6 +783,7 @@ const Button = /*#__PURE__*/react.forwardRef(({
773
783
  $variant: variant,
774
784
  $isStretch: stretch,
775
785
  $isLarge: large,
786
+ $isXLarge: xLarge,
776
787
  $isDisabled: disabled,
777
788
  children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
778
789
  type: type,
@@ -971,6 +982,7 @@ const button = {
971
982
  contentPadding: {
972
983
  default: '7px 16px 7px',
973
984
  large: '11px 24px 11px',
985
+ xLarge: '15px 24px 15px',
974
986
  disabled: '5px 14px 5px'
975
987
  },
976
988
  transition: {
@@ -983,6 +995,15 @@ const button = {
983
995
  pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
984
996
  hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
985
997
  focusBorderColor: 'rgba(0, 0, 0, 0.1)'
998
+ },
999
+ ghost: {
1000
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
1001
+ pressedBackgroundColor: 'rgba(255, 255, 255, 0.05)',
1002
+ hoverBackgroundColor: 'rgba(255, 255, 255, 0.05)',
1003
+ focusBorderColor: 'rgba(255, 255, 255, 0.4)',
1004
+ color: lateOceanColorPalette.white,
1005
+ hoverColor: lateOceanColorPalette.white,
1006
+ activeColor: lateOceanColorPalette.white
986
1007
  }
987
1008
  },
988
1009
  primary: {
@@ -1218,8 +1239,8 @@ const input = {
1218
1239
  size: 20
1219
1240
  },
1220
1241
  padding: {
1221
- default: '5px 16px',
1222
- iOSSingleLine: '7px 16px'
1242
+ horizontal: 16,
1243
+ vertical: 5
1223
1244
  },
1224
1245
  transition: {
1225
1246
  property: 'border-color',
@@ -1334,7 +1355,20 @@ const listItem = {
1334
1355
  };
1335
1356
 
1336
1357
  const pageLoader = {
1337
- size: 60
1358
+ size: 60,
1359
+ strokeWidth: 3,
1360
+ colors: {
1361
+ base: colors.separator,
1362
+ fill: colors.primary
1363
+ },
1364
+ animation: {
1365
+ delay: 500,
1366
+ circleBackgroundFillDuration: 1000,
1367
+ filledCircleFillDuration: 1800,
1368
+ groupFilledCircleRotationDuration: 1800,
1369
+ filledCircleRotationDuration: 2160,
1370
+ fillEasingFunction: [0.39, 0.575, 0.565, 1]
1371
+ }
1338
1372
  };
1339
1373
 
1340
1374
  const shadows = {
@@ -1616,7 +1650,7 @@ const ViewInput = /*#__PURE__*/styled__default.View.withConfig({
1616
1650
  componentId: "kitt-universal__sc-11fmlmi-1"
1617
1651
  })(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, ({
1618
1652
  theme
1619
- }) => theme.kitt.forms.input.padding.default, ({
1653
+ }) => `${theme.kitt.forms.input.padding.vertical}px ${theme.kitt.forms.input.padding.horizontal}px`, ({
1620
1654
  theme
1621
1655
  }) => theme.kitt.forms.input.minHeight, ({
1622
1656
  theme,
@@ -2371,20 +2405,18 @@ const StyledTextInput = /*#__PURE__*/styled__default(reactNative.TextInput).with
2371
2405
  theme,
2372
2406
  multiline
2373
2407
  }) => {
2374
- if (!multiline && reactNative.Platform.OS === 'ios') {
2375
- return theme.kitt.forms.input.padding.iOSSingleLine;
2376
- }
2377
-
2378
- return theme.kitt.forms.input.padding.default;
2408
+ if (!multiline && reactNative.Platform.OS !== 'web') return `0 ${theme.kitt.forms.input.padding.horizontal}px`;
2409
+ return `${theme.kitt.forms.input.padding.vertical}px ${theme.kitt.forms.input.padding.horizontal}px`;
2379
2410
  }, ({
2380
2411
  theme,
2381
2412
  multiline
2382
2413
  }) => {
2383
- if (!multiline && reactNative.Platform.OS === 'ios') return 0;
2414
+ if (!multiline && reactNative.Platform.OS !== 'web') return 0;
2384
2415
  const typeConfigKey = getTypographyTypeConfigKey(theme);
2385
2416
  return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
2386
2417
  }, ({
2387
- $minHeight
2418
+ theme,
2419
+ $minHeight = theme.kitt.forms.input.minHeight
2388
2420
  }) => $minHeight);
2389
2421
  const RightInputContainer = /*#__PURE__*/styled__default.View.withConfig({
2390
2422
  displayName: "InputText__RightInputContainer",
@@ -2393,7 +2425,7 @@ const RightInputContainer = /*#__PURE__*/styled__default.View.withConfig({
2393
2425
  const InputText = /*#__PURE__*/react.forwardRef(({
2394
2426
  id,
2395
2427
  right,
2396
- minHeight = 0,
2428
+ minHeight,
2397
2429
  state: formState,
2398
2430
  internalForceState,
2399
2431
  disabled = false,
@@ -3247,21 +3279,178 @@ function Notification({
3247
3279
  });
3248
3280
  }
3249
3281
 
3250
- function getActivityIndicatorSize(size) {
3251
- if (reactNative.Platform.OS === 'android') return size;
3252
- return size < 36 ? 'small' : 'large';
3282
+ const AnimatedCircle = Animated__default.createAnimatedComponent(Svg.Circle);
3283
+ function AnimatedLoaderCircle({
3284
+ color,
3285
+ progress
3286
+ }) {
3287
+ const theme = /*#__PURE__*/styled.useTheme();
3288
+ const {
3289
+ strokeWidth,
3290
+ size
3291
+ } = theme.kitt.pageLoader;
3292
+ const centerCoord = size * 0.5;
3293
+ const circlePerimeter = 2 * Math.PI * (size * 0.5 - strokeWidth);
3294
+ const strokeAnimation = Animated.useAnimatedProps(function () {
3295
+ const _f = function () {
3296
+ return {
3297
+ strokeDashoffset: circlePerimeter - circlePerimeter * progress.value
3298
+ };
3299
+ };
3300
+
3301
+ _f._closure = {
3302
+ circlePerimeter,
3303
+ progress
3304
+ };
3305
+ _f.asString = "function _f(){const{circlePerimeter,progress}=jsThis._closure;{return{strokeDashoffset:circlePerimeter-circlePerimeter*progress.value};}}";
3306
+ _f.__workletHash = 1345639818356;
3307
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/PageLoader/AnimatedLoaderCircle.tsx (23:43)";
3308
+
3309
+ global.__reanimatedWorkletInit(_f);
3310
+
3311
+ return _f;
3312
+ }());
3313
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedCircle, {
3314
+ "transform-origin": "center center",
3315
+ strokeWidth: strokeWidth,
3316
+ stroke: color,
3317
+ strokeLinecap: "round",
3318
+ cx: centerCoord,
3319
+ cy: centerCoord,
3320
+ r: centerCoord - strokeWidth,
3321
+ fill: "none",
3322
+ strokeDasharray: circlePerimeter,
3323
+ animatedProps: strokeAnimation
3324
+ });
3253
3325
  }
3254
3326
 
3255
- function PageLoader() {
3327
+ function AnimatedBackgroundCircle() {
3256
3328
  const theme = /*#__PURE__*/styled.useTheme();
3329
+ const progress = Animated.useSharedValue(0);
3257
3330
  const {
3331
+ animation,
3332
+ colors,
3258
3333
  size
3259
3334
  } = theme.kitt.pageLoader;
3260
- const colorHex = theme.kitt.typography.colors.primary;
3261
- return /*#__PURE__*/jsxRuntime.jsx(reactNative.ActivityIndicator, {
3262
- testID: "ActivityIndicator",
3263
- color: colorHex,
3264
- size: getActivityIndicatorSize(size)
3335
+ react.useEffect(() => {
3336
+ const {
3337
+ delay,
3338
+ circleBackgroundFillDuration,
3339
+ fillEasingFunction
3340
+ } = animation;
3341
+ const [x1, y1, x2, y2] = fillEasingFunction;
3342
+ progress.value = Animated.withDelay(delay, Animated.withTiming(1, {
3343
+ duration: circleBackgroundFillDuration,
3344
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
3345
+ }));
3346
+ }, [progress, animation]);
3347
+ return /*#__PURE__*/jsxRuntime.jsx(Svg__default, {
3348
+ width: size,
3349
+ height: size,
3350
+ viewBox: `0 0 ${size} ${size}`,
3351
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLoaderCircle, {
3352
+ color: colors.base,
3353
+ progress: progress
3354
+ })
3355
+ });
3356
+ }
3357
+
3358
+ const isInfinitAnimation$1 = -1;
3359
+ function AnimatedFillCircleContainer({
3360
+ children,
3361
+ duration
3362
+ }) {
3363
+ const theme = /*#__PURE__*/styled.useTheme();
3364
+ const progress = Animated.useSharedValue(0);
3365
+ const {
3366
+ animation
3367
+ } = theme.kitt.pageLoader;
3368
+ react.useEffect(() => {
3369
+ const {
3370
+ delay
3371
+ } = animation;
3372
+ progress.value = Animated.withDelay(delay, Animated.withRepeat(Animated.withTiming(1, {
3373
+ duration,
3374
+ easing: Animated.Easing.linear
3375
+ }), isInfinitAnimation$1));
3376
+ }, [progress, animation, duration]);
3377
+ const rotationStyles = Animated.useAnimatedStyle(function () {
3378
+ const _f = function () {
3379
+ return {
3380
+ transform: [{
3381
+ rotate: `${360 * progress.value}deg`
3382
+ }]
3383
+ };
3384
+ };
3385
+
3386
+ _f._closure = {
3387
+ progress
3388
+ };
3389
+ _f.asString = "function _f(){const{progress}=jsThis._closure;{return{transform:[{rotate:360*progress.value+\"deg\"}]};}}";
3390
+ _f.__workletHash = 16553090406738;
3391
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/PageLoader/AnimatedFillCircleContainer.tsx (36:42)";
3392
+ _f.__optimalization = 3;
3393
+
3394
+ global.__reanimatedWorkletInit(_f);
3395
+
3396
+ return _f;
3397
+ }());
3398
+ return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
3399
+ style: [reactNative.StyleSheet.absoluteFill, rotationStyles],
3400
+ children: children
3401
+ });
3402
+ }
3403
+
3404
+ const isInfinitAnimation = -1;
3405
+ const shouldReverse = true;
3406
+ function AnimatedFilledCircle() {
3407
+ const theme = /*#__PURE__*/styled.useTheme();
3408
+ const progress = Animated.useSharedValue(0);
3409
+ const {
3410
+ size,
3411
+ animation,
3412
+ colors
3413
+ } = theme.kitt.pageLoader;
3414
+ react.useEffect(() => {
3415
+ const {
3416
+ delay,
3417
+ filledCircleFillDuration,
3418
+ fillEasingFunction
3419
+ } = animation;
3420
+ const [x1, y1, x2, y2] = fillEasingFunction;
3421
+ progress.value = Animated.withDelay(delay, Animated.withRepeat(Animated.withTiming(0.8, {
3422
+ duration: filledCircleFillDuration,
3423
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
3424
+ }), isInfinitAnimation, shouldReverse));
3425
+ }, [progress, animation]);
3426
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedFillCircleContainer, {
3427
+ duration: animation.groupFilledCircleRotationDuration,
3428
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedFillCircleContainer, {
3429
+ duration: animation.filledCircleRotationDuration,
3430
+ children: /*#__PURE__*/jsxRuntime.jsx(Svg__default, {
3431
+ width: size,
3432
+ height: size,
3433
+ viewBox: `0 0 ${size} ${size}`,
3434
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLoaderCircle, {
3435
+ color: colors.fill,
3436
+ progress: progress
3437
+ })
3438
+ })
3439
+ })
3440
+ });
3441
+ }
3442
+
3443
+ const PageLoaderContainer = /*#__PURE__*/styled__default.View.withConfig({
3444
+ displayName: "PageLoader__PageLoaderContainer",
3445
+ componentId: "kitt-universal__sc-1l9zwqg-0"
3446
+ })(["transform:scale(-1) rotate(90deg);position:relative;width:", "px;height:", "px;"], ({
3447
+ theme
3448
+ }) => theme.kitt.pageLoader.size, ({
3449
+ theme
3450
+ }) => theme.kitt.pageLoader.size);
3451
+ function PageLoader() {
3452
+ return /*#__PURE__*/jsxRuntime.jsxs(PageLoaderContainer, {
3453
+ children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedBackgroundCircle, {}), /*#__PURE__*/jsxRuntime.jsx(AnimatedFilledCircle, {})]
3265
3454
  });
3266
3455
  }
3267
3456