@ornikar/kitt-universal 7.2.0 → 7.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 (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 +219 -29
  25. package/dist/index-browser-all.es.android.js.map +1 -1
  26. package/dist/index-browser-all.es.ios.js +219 -29
  27. package/dist/index-browser-all.es.ios.js.map +1 -1
  28. package/dist/index-browser-all.es.js +219 -29
  29. package/dist/index-browser-all.es.js.map +1 -1
  30. package/dist/index-browser-all.es.web.js +114 -35
  31. package/dist/index-browser-all.es.web.js.map +1 -1
  32. package/dist/index-node-14.17.cjs.js +214 -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 +103 -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 +10 -5
@@ -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,
@@ -2567,6 +2599,7 @@ function InputPassword({
2567
2599
  autoCorrect: false,
2568
2600
  secureTextEntry: !isVisible,
2569
2601
  right: right || /*#__PURE__*/jsxRuntime.jsx(InputPressable, {
2602
+ hitSlop: 20,
2570
2603
  accessibilityRole: "button",
2571
2604
  onPress: () => setIsVisible(prev => !prev),
2572
2605
  children: /*#__PURE__*/jsxRuntime.jsx(InputIcon, {
@@ -3247,21 +3280,178 @@ function Notification({
3247
3280
  });
3248
3281
  }
3249
3282
 
3250
- function getActivityIndicatorSize(size) {
3251
- if (reactNative.Platform.OS === 'android') return size;
3252
- return size < 36 ? 'small' : 'large';
3283
+ const AnimatedCircle = Animated__default.createAnimatedComponent(Svg.Circle);
3284
+ function AnimatedLoaderCircle({
3285
+ color,
3286
+ progress
3287
+ }) {
3288
+ const theme = /*#__PURE__*/styled.useTheme();
3289
+ const {
3290
+ strokeWidth,
3291
+ size
3292
+ } = theme.kitt.pageLoader;
3293
+ const centerCoord = size * 0.5;
3294
+ const circlePerimeter = 2 * Math.PI * (size * 0.5 - strokeWidth);
3295
+ const strokeAnimation = Animated.useAnimatedProps(function () {
3296
+ const _f = function () {
3297
+ return {
3298
+ strokeDashoffset: circlePerimeter - circlePerimeter * progress.value
3299
+ };
3300
+ };
3301
+
3302
+ _f._closure = {
3303
+ circlePerimeter,
3304
+ progress
3305
+ };
3306
+ _f.asString = "function _f(){const{circlePerimeter,progress}=jsThis._closure;{return{strokeDashoffset:circlePerimeter-circlePerimeter*progress.value};}}";
3307
+ _f.__workletHash = 1345639818356;
3308
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/PageLoader/AnimatedLoaderCircle.tsx (23:43)";
3309
+
3310
+ global.__reanimatedWorkletInit(_f);
3311
+
3312
+ return _f;
3313
+ }());
3314
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedCircle, {
3315
+ "transform-origin": "center center",
3316
+ strokeWidth: strokeWidth,
3317
+ stroke: color,
3318
+ strokeLinecap: "round",
3319
+ cx: centerCoord,
3320
+ cy: centerCoord,
3321
+ r: centerCoord - strokeWidth,
3322
+ fill: "none",
3323
+ strokeDasharray: circlePerimeter,
3324
+ animatedProps: strokeAnimation
3325
+ });
3253
3326
  }
3254
3327
 
3255
- function PageLoader() {
3328
+ function AnimatedBackgroundCircle() {
3256
3329
  const theme = /*#__PURE__*/styled.useTheme();
3330
+ const progress = Animated.useSharedValue(0);
3257
3331
  const {
3332
+ animation,
3333
+ colors,
3258
3334
  size
3259
3335
  } = 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)
3336
+ react.useEffect(() => {
3337
+ const {
3338
+ delay,
3339
+ circleBackgroundFillDuration,
3340
+ fillEasingFunction
3341
+ } = animation;
3342
+ const [x1, y1, x2, y2] = fillEasingFunction;
3343
+ progress.value = Animated.withDelay(delay, Animated.withTiming(1, {
3344
+ duration: circleBackgroundFillDuration,
3345
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
3346
+ }));
3347
+ }, [progress, animation]);
3348
+ return /*#__PURE__*/jsxRuntime.jsx(Svg__default, {
3349
+ width: size,
3350
+ height: size,
3351
+ viewBox: `0 0 ${size} ${size}`,
3352
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLoaderCircle, {
3353
+ color: colors.base,
3354
+ progress: progress
3355
+ })
3356
+ });
3357
+ }
3358
+
3359
+ const isInfinitAnimation$1 = -1;
3360
+ function AnimatedFillCircleContainer({
3361
+ children,
3362
+ duration
3363
+ }) {
3364
+ const theme = /*#__PURE__*/styled.useTheme();
3365
+ const progress = Animated.useSharedValue(0);
3366
+ const {
3367
+ animation
3368
+ } = theme.kitt.pageLoader;
3369
+ react.useEffect(() => {
3370
+ const {
3371
+ delay
3372
+ } = animation;
3373
+ progress.value = Animated.withDelay(delay, Animated.withRepeat(Animated.withTiming(1, {
3374
+ duration,
3375
+ easing: Animated.Easing.linear
3376
+ }), isInfinitAnimation$1));
3377
+ }, [progress, animation, duration]);
3378
+ const rotationStyles = Animated.useAnimatedStyle(function () {
3379
+ const _f = function () {
3380
+ return {
3381
+ transform: [{
3382
+ rotate: `${360 * progress.value}deg`
3383
+ }]
3384
+ };
3385
+ };
3386
+
3387
+ _f._closure = {
3388
+ progress
3389
+ };
3390
+ _f.asString = "function _f(){const{progress}=jsThis._closure;{return{transform:[{rotate:360*progress.value+\"deg\"}]};}}";
3391
+ _f.__workletHash = 16553090406738;
3392
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/PageLoader/AnimatedFillCircleContainer.tsx (36:42)";
3393
+ _f.__optimalization = 3;
3394
+
3395
+ global.__reanimatedWorkletInit(_f);
3396
+
3397
+ return _f;
3398
+ }());
3399
+ return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
3400
+ style: [reactNative.StyleSheet.absoluteFill, rotationStyles],
3401
+ children: children
3402
+ });
3403
+ }
3404
+
3405
+ const isInfinitAnimation = -1;
3406
+ const shouldReverse = true;
3407
+ function AnimatedFilledCircle() {
3408
+ const theme = /*#__PURE__*/styled.useTheme();
3409
+ const progress = Animated.useSharedValue(0);
3410
+ const {
3411
+ size,
3412
+ animation,
3413
+ colors
3414
+ } = theme.kitt.pageLoader;
3415
+ react.useEffect(() => {
3416
+ const {
3417
+ delay,
3418
+ filledCircleFillDuration,
3419
+ fillEasingFunction
3420
+ } = animation;
3421
+ const [x1, y1, x2, y2] = fillEasingFunction;
3422
+ progress.value = Animated.withDelay(delay, Animated.withRepeat(Animated.withTiming(0.8, {
3423
+ duration: filledCircleFillDuration,
3424
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
3425
+ }), isInfinitAnimation, shouldReverse));
3426
+ }, [progress, animation]);
3427
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedFillCircleContainer, {
3428
+ duration: animation.groupFilledCircleRotationDuration,
3429
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedFillCircleContainer, {
3430
+ duration: animation.filledCircleRotationDuration,
3431
+ children: /*#__PURE__*/jsxRuntime.jsx(Svg__default, {
3432
+ width: size,
3433
+ height: size,
3434
+ viewBox: `0 0 ${size} ${size}`,
3435
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLoaderCircle, {
3436
+ color: colors.fill,
3437
+ progress: progress
3438
+ })
3439
+ })
3440
+ })
3441
+ });
3442
+ }
3443
+
3444
+ const PageLoaderContainer = /*#__PURE__*/styled__default.View.withConfig({
3445
+ displayName: "PageLoader__PageLoaderContainer",
3446
+ componentId: "kitt-universal__sc-1l9zwqg-0"
3447
+ })(["transform:scale(-1) rotate(90deg);position:relative;width:", "px;height:", "px;"], ({
3448
+ theme
3449
+ }) => theme.kitt.pageLoader.size, ({
3450
+ theme
3451
+ }) => theme.kitt.pageLoader.size);
3452
+ function PageLoader() {
3453
+ return /*#__PURE__*/jsxRuntime.jsxs(PageLoaderContainer, {
3454
+ children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedBackgroundCircle, {}), /*#__PURE__*/jsxRuntime.jsx(AnimatedFilledCircle, {})]
3265
3455
  });
3266
3456
  }
3267
3457