@ornikar/kitt-universal 5.0.2 → 7.0.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/Avatar/Avatar.d.ts +5 -4
- package/dist/definitions/Avatar/Avatar.d.ts.map +1 -1
- package/dist/definitions/Button/AnimatedButtonPressable.d.ts +2 -1
- package/dist/definitions/Button/AnimatedButtonPressable.d.ts.map +1 -1
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +2 -1
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts.map +1 -1
- package/dist/definitions/Button/BaseStyledButtonPressable.d.ts +2 -1
- package/dist/definitions/Button/BaseStyledButtonPressable.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts +2 -1
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts +4 -3
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/Button/getVariantValuesIfExist.d.ts +5 -0
- package/dist/definitions/Button/getVariantValuesIfExist.d.ts.map +1 -0
- package/dist/definitions/ExternalLink/ExternalLink.d.ts +3 -3
- package/dist/definitions/ExternalLink/ExternalLink.d.ts.map +1 -1
- package/dist/definitions/Icon/Icon.d.ts +10 -2
- package/dist/definitions/Icon/Icon.d.ts.map +1 -1
- package/dist/definitions/Icon/SpinningIcon.d.ts +4 -3
- package/dist/definitions/Icon/SpinningIcon.d.ts.map +1 -1
- package/dist/definitions/Icon/SpinningIcon.web.d.ts +1 -1
- package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
- package/dist/definitions/LoaderIcon/LoaderIcon.d.ts +7 -0
- package/dist/definitions/LoaderIcon/LoaderIcon.d.ts.map +1 -0
- package/dist/definitions/Overlay/Overlay.d.ts +4 -3
- package/dist/definitions/Overlay/Overlay.d.ts.map +1 -1
- package/dist/definitions/PageLoader/PageLoader.d.ts +4 -0
- package/dist/definitions/PageLoader/PageLoader.d.ts.map +1 -0
- package/dist/definitions/PageLoader/PageLoader.web.d.ts +3 -0
- package/dist/definitions/PageLoader/PageLoader.web.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
- package/dist/definitions/index.d.ts +7 -4
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +37 -36
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/avatar.d.ts +7 -3
- package/dist/definitions/themes/late-ocean/avatar.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/button.d.ts +26 -9
- package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/pageLoader.d.ts +5 -0
- package/dist/definitions/themes/late-ocean/pageLoader.d.ts.map +1 -0
- package/dist/definitions/utils/tests/renderWithProvidersUtils.d.ts +4 -2
- package/dist/definitions/utils/tests/renderWithProvidersUtils.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +265 -305
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +265 -305
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +265 -305
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +375 -399
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +208 -146
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +2 -2
- package/dist/index-node-14.17.cjs.web.js +247 -177
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +72 -43
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +72 -43
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +72 -43
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +72 -43
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +72 -43
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +72 -43
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +9 -8
- package/dist/definitions/Loader/LargeLoader.d.ts +0 -7
- package/dist/definitions/Loader/LargeLoader.d.ts.map +0 -1
- package/dist/definitions/Loader/LargeLoader.web.d.ts +0 -3
- package/dist/definitions/Loader/LargeLoader.web.d.ts.map +0 -1
- package/dist/definitions/Loader/Loader.d.ts +0 -8
- package/dist/definitions/Loader/Loader.d.ts.map +0 -1
- package/dist/definitions/Loader/Loader.web.d.ts +0 -8
- package/dist/definitions/Loader/Loader.web.d.ts.map +0 -1
|
@@ -6,8 +6,8 @@ const BabelPluginStyledComponentsReactNative = require('react-native');
|
|
|
6
6
|
const kittIcons = require('@ornikar/kitt-icons');
|
|
7
7
|
const styled = require('styled-components/native');
|
|
8
8
|
const react = require('react');
|
|
9
|
-
const react$1 = require('@linaria/react');
|
|
10
9
|
const jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
const react$1 = require('@linaria/react');
|
|
11
11
|
const twemojiParser = require('twemoji-parser');
|
|
12
12
|
const reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
13
13
|
const reactDom = require('@floating-ui/react-dom');
|
|
@@ -17,56 +17,22 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
17
17
|
|
|
18
18
|
const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
// type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
|
|
22
|
-
// export function withTheme<Props extends { theme: DefaultTheme }, C>(
|
|
23
|
-
// WrappedComponent: ComponentType<Props> & C,
|
|
24
|
-
// ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
|
|
25
|
-
// return function ThemedComponent(props) {
|
|
26
|
-
// const theme = useTheme();
|
|
27
|
-
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
28
|
-
// };
|
|
29
|
-
// }
|
|
30
|
-
function withTheme(WrappedComponent) {
|
|
31
|
-
// eslint-disable-next-line prefer-arrow-callback
|
|
32
|
-
return /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
33
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
34
|
-
return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
|
|
35
|
-
ref: ref,
|
|
36
|
-
theme: theme,
|
|
37
|
-
...props
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const StyledSpinningIconContainer = withTheme( /*#__PURE__*/react$1.styled("div")({
|
|
43
|
-
name: "StyledSpinningIconContainer",
|
|
44
|
-
class: "kitt-u_StyledSpinningIconContainer_ssn8o83"
|
|
45
|
-
}));
|
|
46
|
-
function SpinningIcon({
|
|
47
|
-
children
|
|
48
|
-
}) {
|
|
49
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledSpinningIconContainer, {
|
|
50
|
-
children: children
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
20
|
+
const defaultIconSize = 20;
|
|
54
21
|
const IconContainer$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
55
22
|
displayName: "Icon__IconContainer",
|
|
56
23
|
componentId: "kitt-universal__sc-usm0ol-0"
|
|
57
24
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
|
|
58
|
-
color
|
|
59
|
-
}) => color, ({
|
|
60
|
-
size
|
|
61
|
-
}) => size, ({
|
|
62
|
-
size
|
|
63
|
-
}) => size, ({
|
|
64
|
-
align = 'auto'
|
|
65
|
-
}) => align);
|
|
25
|
+
$color
|
|
26
|
+
}) => $color, ({
|
|
27
|
+
$size
|
|
28
|
+
}) => $size, ({
|
|
29
|
+
$size
|
|
30
|
+
}) => $size, ({
|
|
31
|
+
$align = 'auto'
|
|
32
|
+
}) => $align);
|
|
66
33
|
function Icon({
|
|
67
34
|
icon,
|
|
68
|
-
size =
|
|
69
|
-
spin,
|
|
35
|
+
size = defaultIconSize,
|
|
70
36
|
align,
|
|
71
37
|
color
|
|
72
38
|
}) {
|
|
@@ -74,12 +40,10 @@ function Icon({
|
|
|
74
40
|
color
|
|
75
41
|
});
|
|
76
42
|
return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
|
|
77
|
-
align: align,
|
|
78
|
-
size: size,
|
|
79
|
-
color: color,
|
|
80
|
-
children:
|
|
81
|
-
children: clonedIcon
|
|
82
|
-
}) : clonedIcon
|
|
43
|
+
$align: align,
|
|
44
|
+
$size: size,
|
|
45
|
+
$color: color,
|
|
46
|
+
children: clonedIcon
|
|
83
47
|
});
|
|
84
48
|
}
|
|
85
49
|
|
|
@@ -319,10 +283,11 @@ const StyledAvatarView = /*#__PURE__*/styled__default(BabelPluginStyledComponent
|
|
|
319
283
|
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], ({
|
|
320
284
|
theme,
|
|
321
285
|
$isRound,
|
|
322
|
-
$size
|
|
286
|
+
$size,
|
|
287
|
+
$sizeVariant
|
|
323
288
|
}) => {
|
|
324
289
|
if ($isRound) return `${$size / 2}px`;
|
|
325
|
-
return `${theme.kitt.avatar.borderRadius}px`;
|
|
290
|
+
return `${$sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius}px`;
|
|
326
291
|
}, ({
|
|
327
292
|
theme,
|
|
328
293
|
$isLight
|
|
@@ -338,8 +303,8 @@ function AvatarContent({
|
|
|
338
303
|
firstname,
|
|
339
304
|
lastname,
|
|
340
305
|
alt,
|
|
341
|
-
|
|
342
|
-
|
|
306
|
+
isLight,
|
|
307
|
+
sizeVariant
|
|
343
308
|
}) {
|
|
344
309
|
if (src) {
|
|
345
310
|
return /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Image, {
|
|
@@ -356,8 +321,8 @@ function AvatarContent({
|
|
|
356
321
|
|
|
357
322
|
if (firstname && lastname) {
|
|
358
323
|
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
359
|
-
base:
|
|
360
|
-
variant:
|
|
324
|
+
base: sizeVariant === 'large' ? 'body-large' : 'body',
|
|
325
|
+
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
361
326
|
color: isLight ? 'black' : 'white',
|
|
362
327
|
children: getInitials(firstname, lastname)
|
|
363
328
|
});
|
|
@@ -372,24 +337,61 @@ function AvatarContent({
|
|
|
372
337
|
|
|
373
338
|
function Avatar({
|
|
374
339
|
size = 40,
|
|
375
|
-
base = 'body-small',
|
|
376
340
|
round,
|
|
377
341
|
light,
|
|
342
|
+
sizeVariant,
|
|
378
343
|
...props
|
|
379
344
|
}) {
|
|
380
345
|
return /*#__PURE__*/jsxRuntime.jsx(StyledAvatarView, {
|
|
381
346
|
$size: size,
|
|
382
347
|
$isRound: round,
|
|
383
348
|
$isLight: light,
|
|
349
|
+
$sizeVariant: sizeVariant,
|
|
384
350
|
children: /*#__PURE__*/jsxRuntime.jsx(AvatarContent, {
|
|
385
351
|
size: size,
|
|
386
|
-
base: base,
|
|
387
352
|
isLight: light,
|
|
353
|
+
sizeVariant: sizeVariant,
|
|
388
354
|
...props
|
|
389
355
|
})
|
|
390
356
|
});
|
|
391
357
|
}
|
|
392
358
|
|
|
359
|
+
// type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
|
|
360
|
+
// type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
|
|
361
|
+
// export function withTheme<Props extends { theme: DefaultTheme }, C>(
|
|
362
|
+
// WrappedComponent: ComponentType<Props> & C,
|
|
363
|
+
// ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
|
|
364
|
+
// return function ThemedComponent(props) {
|
|
365
|
+
// const theme = useTheme();
|
|
366
|
+
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
367
|
+
// };
|
|
368
|
+
// }
|
|
369
|
+
function withTheme(WrappedComponent) {
|
|
370
|
+
// eslint-disable-next-line prefer-arrow-callback
|
|
371
|
+
return /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
372
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
373
|
+
return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
|
|
374
|
+
ref: ref,
|
|
375
|
+
theme: theme,
|
|
376
|
+
...props
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const hasVariant = (button, variant) => {
|
|
382
|
+
return variant in button;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
function getVariantValuesIfExist(theme, type, variant) {
|
|
386
|
+
const button = theme.kitt.button[type];
|
|
387
|
+
|
|
388
|
+
if (hasVariant(button, variant)) {
|
|
389
|
+
return button[variant];
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return theme.kitt.button[type].default;
|
|
393
|
+
}
|
|
394
|
+
|
|
393
395
|
function isSubtle(type) {
|
|
394
396
|
return type.startsWith('subtle');
|
|
395
397
|
}
|
|
@@ -414,10 +416,11 @@ const AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/react$1.styled(
|
|
|
414
416
|
"a1vkj3mh-5": [({
|
|
415
417
|
theme,
|
|
416
418
|
$type,
|
|
419
|
+
$variant,
|
|
417
420
|
$isDisabled
|
|
418
421
|
}) => {
|
|
419
|
-
if ($isDisabled) return theme.kitt.button.disabled.hoverBackgroundColor;
|
|
420
|
-
return theme
|
|
422
|
+
if ($isDisabled) return theme.kitt.button.disabled.default.hoverBackgroundColor;
|
|
423
|
+
return getVariantValuesIfExist(theme, $type, $variant).hoverBackgroundColor;
|
|
421
424
|
}],
|
|
422
425
|
"a1vkj3mh-6": [({
|
|
423
426
|
theme
|
|
@@ -445,11 +448,12 @@ const AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/react$1.styled(
|
|
|
445
448
|
}) => `calc(100% - ${theme.kitt.button.borderWidth.disabled * 0.5}px)`],
|
|
446
449
|
"a1vkj3mh-14": [({
|
|
447
450
|
theme
|
|
448
|
-
}) => `${theme.kitt.button.borderWidth.disabled}px solid ${theme.kitt.button.disabled.borderColor}`],
|
|
451
|
+
}) => `${theme.kitt.button.borderWidth.disabled}px solid ${theme.kitt.button.disabled.default.borderColor}`],
|
|
449
452
|
"a1vkj3mh-15": [({
|
|
450
453
|
theme,
|
|
451
|
-
$type
|
|
452
|
-
|
|
454
|
+
$type,
|
|
455
|
+
$variant
|
|
456
|
+
}) => `${theme.kitt.button.borderWidth.focus}px solid ${getVariantValuesIfExist(theme, $type, $variant).focusBorderColor}`],
|
|
453
457
|
"a1vkj3mh-16": [({
|
|
454
458
|
theme
|
|
455
459
|
}) => `-${theme.kitt.button.borderWidth.focus}px`],
|
|
@@ -459,8 +463,12 @@ const AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/react$1.styled(
|
|
|
459
463
|
$isDisabled
|
|
460
464
|
}) => {
|
|
461
465
|
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
462
|
-
|
|
463
|
-
|
|
466
|
+
|
|
467
|
+
if (isSubtle($type)) {
|
|
468
|
+
return theme.kitt.button[$type].default.color;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return 'inherit';
|
|
464
472
|
}],
|
|
465
473
|
"a1vkj3mh-19": [({
|
|
466
474
|
theme,
|
|
@@ -468,8 +476,12 @@ const AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/react$1.styled(
|
|
|
468
476
|
$isDisabled
|
|
469
477
|
}) => {
|
|
470
478
|
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
471
|
-
|
|
472
|
-
|
|
479
|
+
|
|
480
|
+
if (isSubtle($type)) {
|
|
481
|
+
return theme.kitt.button[$type].default.hoverColor;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return 'inherit';
|
|
473
485
|
}],
|
|
474
486
|
"a1vkj3mh-20": [({
|
|
475
487
|
theme,
|
|
@@ -477,13 +489,18 @@ const AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/react$1.styled(
|
|
|
477
489
|
$isDisabled
|
|
478
490
|
}) => {
|
|
479
491
|
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
480
|
-
|
|
481
|
-
|
|
492
|
+
|
|
493
|
+
if (isSubtle($type)) {
|
|
494
|
+
return theme.kitt.button[$type].default.activeColor;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
return 'inherit';
|
|
482
498
|
}]
|
|
483
499
|
}
|
|
484
500
|
}));
|
|
485
501
|
const AnimatedButtonPressable = /*#__PURE__*/react.forwardRef(({
|
|
486
502
|
$type,
|
|
503
|
+
$variant,
|
|
487
504
|
$isStretch,
|
|
488
505
|
disabled,
|
|
489
506
|
...props
|
|
@@ -491,6 +508,7 @@ const AnimatedButtonPressable = /*#__PURE__*/react.forwardRef(({
|
|
|
491
508
|
return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressableContainer, {
|
|
492
509
|
ref: ref,
|
|
493
510
|
$type: $type,
|
|
511
|
+
$variant: $variant,
|
|
494
512
|
$isDisabled: !!disabled,
|
|
495
513
|
$isStretch: $isStretch,
|
|
496
514
|
children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Pressable, {
|
|
@@ -517,10 +535,11 @@ const BaseStyledButtonPressable = /*#__PURE__*/styled__default(BabelPluginStyled
|
|
|
517
535
|
}) => theme.kitt.button.borderRadius, ({
|
|
518
536
|
theme,
|
|
519
537
|
$isDisabled,
|
|
520
|
-
$type
|
|
538
|
+
$type,
|
|
539
|
+
$variant
|
|
521
540
|
}) => {
|
|
522
|
-
if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
|
|
523
|
-
return theme
|
|
541
|
+
if ($isDisabled) return theme.kitt.button.disabled.default.backgroundColor;
|
|
542
|
+
return getVariantValuesIfExist(theme, $type, $variant).backgroundColor;
|
|
524
543
|
}, ({
|
|
525
544
|
theme,
|
|
526
545
|
$isLarge,
|
|
@@ -569,10 +588,10 @@ function TypographyIcon({
|
|
|
569
588
|
});
|
|
570
589
|
}
|
|
571
590
|
|
|
572
|
-
const getTextColorByType = type => {
|
|
591
|
+
const getTextColorByType = (type, variant) => {
|
|
573
592
|
switch (type) {
|
|
574
593
|
case 'primary':
|
|
575
|
-
return 'white';
|
|
594
|
+
return variant === 'ghost' ? 'primary' : 'white';
|
|
576
595
|
|
|
577
596
|
case 'white':
|
|
578
597
|
return 'white';
|
|
@@ -625,7 +644,6 @@ const StyledIconContainer$1 = /*#__PURE__*/styled__default(BabelPluginStyledComp
|
|
|
625
644
|
function ButtonIcon({
|
|
626
645
|
icon,
|
|
627
646
|
color,
|
|
628
|
-
spin,
|
|
629
647
|
iconPosition,
|
|
630
648
|
testID
|
|
631
649
|
}) {
|
|
@@ -633,7 +651,6 @@ function ButtonIcon({
|
|
|
633
651
|
$iconPosition: iconPosition,
|
|
634
652
|
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
635
653
|
icon: icon,
|
|
636
|
-
spin: spin,
|
|
637
654
|
testID: testID,
|
|
638
655
|
color: color
|
|
639
656
|
})
|
|
@@ -648,7 +665,6 @@ function ButtonContentChildren({
|
|
|
648
665
|
type,
|
|
649
666
|
icon,
|
|
650
667
|
iconPosition,
|
|
651
|
-
iconSpin,
|
|
652
668
|
isDisabled,
|
|
653
669
|
color,
|
|
654
670
|
children
|
|
@@ -662,9 +678,8 @@ function ButtonContentChildren({
|
|
|
662
678
|
const isWebSubtle = isSubtle(type) && "web" === 'web' && !isDisabled;
|
|
663
679
|
|
|
664
680
|
if (!children) {
|
|
665
|
-
return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon
|
|
666
|
-
|
|
667
|
-
,
|
|
681
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
682
|
+
, {
|
|
668
683
|
icon: icon,
|
|
669
684
|
color: isWebSubtle ? 'inherit' : color
|
|
670
685
|
});
|
|
@@ -672,7 +687,6 @@ function ButtonContentChildren({
|
|
|
672
687
|
|
|
673
688
|
const buttonIconSharedProps = {
|
|
674
689
|
type,
|
|
675
|
-
spin: iconSpin,
|
|
676
690
|
iconPosition,
|
|
677
691
|
color: isWebSubtle ? 'inherit' : color
|
|
678
692
|
};
|
|
@@ -712,13 +726,14 @@ const ButtonContentContainer = /*#__PURE__*/styled__default(BabelPluginStyledCom
|
|
|
712
726
|
});
|
|
713
727
|
function ButtonContent({
|
|
714
728
|
type,
|
|
729
|
+
variant,
|
|
715
730
|
isDisabled,
|
|
716
731
|
$isStretch,
|
|
717
732
|
icon,
|
|
718
733
|
children,
|
|
719
734
|
...props
|
|
720
735
|
}) {
|
|
721
|
-
const color = isDisabled ? 'black-light' : getTextColorByType(type);
|
|
736
|
+
const color = isDisabled ? 'black-light' : getTextColorByType(type, variant);
|
|
722
737
|
return /*#__PURE__*/jsxRuntime.jsx(ButtonContentContainer, {
|
|
723
738
|
$isSubtle: isSubtle(type),
|
|
724
739
|
$isStretch: $isStretch,
|
|
@@ -737,18 +752,22 @@ function ButtonContent({
|
|
|
737
752
|
const Button = /*#__PURE__*/react.forwardRef(({
|
|
738
753
|
children,
|
|
739
754
|
type = 'default',
|
|
755
|
+
variant = 'default',
|
|
740
756
|
disabled,
|
|
741
757
|
stretch,
|
|
742
758
|
large,
|
|
743
759
|
icon,
|
|
744
760
|
iconPosition = 'left',
|
|
745
|
-
iconSpin,
|
|
746
761
|
testID,
|
|
747
762
|
href,
|
|
748
763
|
hrefAttrs,
|
|
749
764
|
accessibilityRole = 'button',
|
|
750
765
|
onPress
|
|
751
766
|
}, ref) => {
|
|
767
|
+
if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && type !== 'primary') {
|
|
768
|
+
throw new Error('variant=ghost is only allowed with type=primary');
|
|
769
|
+
}
|
|
770
|
+
|
|
752
771
|
return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressable, {
|
|
753
772
|
ref: ref,
|
|
754
773
|
accessibilityRole: accessibilityRole,
|
|
@@ -758,19 +777,21 @@ const Button = /*#__PURE__*/react.forwardRef(({
|
|
|
758
777
|
disabled: disabled,
|
|
759
778
|
$isStretch: stretch,
|
|
760
779
|
$type: type,
|
|
780
|
+
$variant: variant,
|
|
761
781
|
onPress: onPress,
|
|
762
782
|
children: /*#__PURE__*/jsxRuntime.jsxs(BaseStyledButtonPressable, {
|
|
763
783
|
$type: type,
|
|
784
|
+
$variant: variant,
|
|
764
785
|
$isStretch: stretch,
|
|
765
786
|
$isLarge: large,
|
|
766
787
|
$isDisabled: disabled,
|
|
767
788
|
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
|
|
768
789
|
type: type,
|
|
790
|
+
variant: variant,
|
|
769
791
|
$isStretch: stretch,
|
|
770
792
|
isDisabled: disabled,
|
|
771
793
|
icon: icon,
|
|
772
794
|
iconPosition: iconPosition,
|
|
773
|
-
iconSpin: iconSpin,
|
|
774
795
|
children: children
|
|
775
796
|
}), null]
|
|
776
797
|
})
|
|
@@ -908,6 +929,9 @@ const avatar = {
|
|
|
908
929
|
},
|
|
909
930
|
light: {
|
|
910
931
|
backgroundColor: lateOceanColorPalette.black100
|
|
932
|
+
},
|
|
933
|
+
large: {
|
|
934
|
+
borderRadius: 30
|
|
911
935
|
}
|
|
912
936
|
};
|
|
913
937
|
|
|
@@ -931,56 +955,77 @@ const button = {
|
|
|
931
955
|
}
|
|
932
956
|
},
|
|
933
957
|
contentPadding: {
|
|
934
|
-
default: '
|
|
935
|
-
large: '
|
|
936
|
-
disabled: '
|
|
958
|
+
default: '7px 16px 7px',
|
|
959
|
+
large: '11px 24px 11px',
|
|
960
|
+
disabled: '5px 14px 5px'
|
|
937
961
|
},
|
|
938
962
|
transition: {
|
|
939
963
|
duration: '200ms',
|
|
940
964
|
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
941
965
|
},
|
|
942
966
|
default: {
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
967
|
+
default: {
|
|
968
|
+
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
969
|
+
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
970
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
971
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
972
|
+
}
|
|
947
973
|
},
|
|
948
974
|
primary: {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
975
|
+
default: {
|
|
976
|
+
backgroundColor: colors.primary,
|
|
977
|
+
pressedBackgroundColor: colors.primaryLight,
|
|
978
|
+
hoverBackgroundColor: colors.primaryLight,
|
|
979
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
980
|
+
},
|
|
981
|
+
ghost: {
|
|
982
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
983
|
+
pressedBackgroundColor: colors.uiBackground,
|
|
984
|
+
hoverBackgroundColor: colors.hover,
|
|
985
|
+
focusBorderColor: 'rgba(255,255,255, 0.4)',
|
|
986
|
+
color: colors.primary,
|
|
987
|
+
hoverColor: colors.hover,
|
|
988
|
+
activeColor: colors.hover
|
|
989
|
+
}
|
|
953
990
|
},
|
|
954
991
|
white: {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
992
|
+
default: {
|
|
993
|
+
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
994
|
+
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
995
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
996
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
997
|
+
}
|
|
959
998
|
},
|
|
960
999
|
subtle: {
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1000
|
+
default: {
|
|
1001
|
+
backgroundColor: colors.transparent,
|
|
1002
|
+
pressedBackgroundColor: colors.transparent,
|
|
1003
|
+
hoverBackgroundColor: colors.transparent,
|
|
1004
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
1005
|
+
color: colors.primary,
|
|
1006
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
1007
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
1008
|
+
}
|
|
968
1009
|
},
|
|
969
1010
|
'subtle-dark': {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1011
|
+
default: {
|
|
1012
|
+
backgroundColor: colors.transparent,
|
|
1013
|
+
pressedBackgroundColor: colors.transparent,
|
|
1014
|
+
hoverBackgroundColor: colors.transparent,
|
|
1015
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
1016
|
+
color: colors.black,
|
|
1017
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
1018
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
1019
|
+
}
|
|
977
1020
|
},
|
|
978
1021
|
disabled: {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1022
|
+
default: {
|
|
1023
|
+
backgroundColor: colors.disabled,
|
|
1024
|
+
pressedBackgroundColor: colors.disabled,
|
|
1025
|
+
hoverBackgroundColor: colors.disabled,
|
|
1026
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
1027
|
+
borderColor: lateOceanColorPalette.black100
|
|
1028
|
+
}
|
|
984
1029
|
}
|
|
985
1030
|
};
|
|
986
1031
|
|
|
@@ -1256,14 +1301,14 @@ const iconButton = {
|
|
|
1256
1301
|
},
|
|
1257
1302
|
disabled: {
|
|
1258
1303
|
scale: 1,
|
|
1259
|
-
backgroundColor: button.disabled.backgroundColor,
|
|
1260
|
-
borderColor: button.disabled.borderColor
|
|
1304
|
+
backgroundColor: button.disabled.default.backgroundColor,
|
|
1305
|
+
borderColor: button.disabled.default.borderColor
|
|
1261
1306
|
},
|
|
1262
1307
|
default: {
|
|
1263
|
-
pressedBackgroundColor: button.default.pressedBackgroundColor
|
|
1308
|
+
pressedBackgroundColor: button.default.default.pressedBackgroundColor
|
|
1264
1309
|
},
|
|
1265
1310
|
white: {
|
|
1266
|
-
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
1311
|
+
pressedBackgroundColor: button.white.default.hoverBackgroundColor
|
|
1267
1312
|
}
|
|
1268
1313
|
};
|
|
1269
1314
|
|
|
@@ -1274,6 +1319,10 @@ const listItem = {
|
|
|
1274
1319
|
innerMargin: 8
|
|
1275
1320
|
};
|
|
1276
1321
|
|
|
1322
|
+
const pageLoader = {
|
|
1323
|
+
size: 60
|
|
1324
|
+
};
|
|
1325
|
+
|
|
1277
1326
|
const shadows = {
|
|
1278
1327
|
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
1279
1328
|
};
|
|
@@ -1364,19 +1413,20 @@ const theme = {
|
|
|
1364
1413
|
lateOcean: lateOceanColorPalette
|
|
1365
1414
|
},
|
|
1366
1415
|
avatar,
|
|
1416
|
+
breakpoints,
|
|
1367
1417
|
button,
|
|
1368
1418
|
card,
|
|
1369
1419
|
feedbackMessage,
|
|
1370
1420
|
forms,
|
|
1371
|
-
typography,
|
|
1372
|
-
tag,
|
|
1373
|
-
shadows,
|
|
1374
1421
|
fullScreenModal,
|
|
1375
1422
|
iconButton,
|
|
1376
1423
|
listItem,
|
|
1377
|
-
|
|
1424
|
+
pageLoader,
|
|
1425
|
+
shadows,
|
|
1378
1426
|
skeleton,
|
|
1379
|
-
|
|
1427
|
+
tag,
|
|
1428
|
+
tooltip,
|
|
1429
|
+
typography
|
|
1380
1430
|
};
|
|
1381
1431
|
|
|
1382
1432
|
function matchWindowSize({
|
|
@@ -2231,6 +2281,22 @@ function FullScreenModal({
|
|
|
2231
2281
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
2232
2282
|
FullScreenModal.Body = FullScreenModalBody;
|
|
2233
2283
|
|
|
2284
|
+
const StyledSpinningIconContainer = withTheme( /*#__PURE__*/react$1.styled("div")({
|
|
2285
|
+
name: "StyledSpinningIconContainer",
|
|
2286
|
+
class: "kitt-u_StyledSpinningIconContainer_ssn8o83"
|
|
2287
|
+
}));
|
|
2288
|
+
function SpinningIcon({
|
|
2289
|
+
icon,
|
|
2290
|
+
color
|
|
2291
|
+
}) {
|
|
2292
|
+
const clonedIcon = /*#__PURE__*/react.cloneElement(icon, {
|
|
2293
|
+
color
|
|
2294
|
+
});
|
|
2295
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledSpinningIconContainer, {
|
|
2296
|
+
children: clonedIcon
|
|
2297
|
+
});
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2234
2300
|
function StyleWebWrapper({
|
|
2235
2301
|
as,
|
|
2236
2302
|
children,
|
|
@@ -2509,53 +2575,12 @@ ListItem.Content = ListItemContent;
|
|
|
2509
2575
|
ListItem.SideContent = ListItemSideContent;
|
|
2510
2576
|
ListItem.SideContainer = ListItemSideContainer;
|
|
2511
2577
|
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
class: "kitt-u_LargeLoaderContainer_l2im3sa",
|
|
2515
|
-
vars: {
|
|
2516
|
-
"l2im3sa-0": [({
|
|
2517
|
-
theme
|
|
2518
|
-
}) => theme.kitt.colors.separator],
|
|
2519
|
-
"l2im3sa-1": [({
|
|
2520
|
-
theme
|
|
2521
|
-
}) => theme.kitt.colors.primary]
|
|
2522
|
-
}
|
|
2523
|
-
}));
|
|
2524
|
-
function LargeLoader() {
|
|
2525
|
-
return /*#__PURE__*/jsxRuntime.jsx(LargeLoaderContainer, {
|
|
2526
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
2527
|
-
width: "60",
|
|
2528
|
-
height: "60",
|
|
2529
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("g", {
|
|
2530
|
-
"data-large-loader": "base",
|
|
2531
|
-
children: /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
2532
|
-
cx: "30",
|
|
2533
|
-
cy: "30",
|
|
2534
|
-
r: "27",
|
|
2535
|
-
fill: "none"
|
|
2536
|
-
})
|
|
2537
|
-
}), /*#__PURE__*/jsxRuntime.jsx("g", {
|
|
2538
|
-
"data-large-loader": "fill",
|
|
2539
|
-
children: /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
2540
|
-
cx: "30",
|
|
2541
|
-
cy: "30",
|
|
2542
|
-
r: "27",
|
|
2543
|
-
fill: "none"
|
|
2544
|
-
})
|
|
2545
|
-
})]
|
|
2546
|
-
})
|
|
2547
|
-
});
|
|
2548
|
-
}
|
|
2549
|
-
|
|
2550
|
-
function Loader({
|
|
2551
|
-
color = 'primary',
|
|
2552
|
-
size = 20
|
|
2578
|
+
function LoaderIcon({
|
|
2579
|
+
color
|
|
2553
2580
|
}) {
|
|
2554
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
2555
|
-
spin: true,
|
|
2581
|
+
return /*#__PURE__*/jsxRuntime.jsx(SpinningIcon, {
|
|
2556
2582
|
color: color,
|
|
2557
|
-
|
|
2558
|
-
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.LoaderIcon, {})
|
|
2583
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.ArcIcon, {})
|
|
2559
2584
|
});
|
|
2560
2585
|
}
|
|
2561
2586
|
|
|
@@ -2728,12 +2753,13 @@ const OverlayPressable = /*#__PURE__*/styled__default(BabelPluginStyledComponent
|
|
|
2728
2753
|
backgroundColor: theme.kitt.colors.overlay.dark
|
|
2729
2754
|
}));
|
|
2730
2755
|
function Overlay({
|
|
2731
|
-
onPress
|
|
2756
|
+
onPress,
|
|
2757
|
+
children
|
|
2732
2758
|
}) {
|
|
2733
2759
|
return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
|
|
2734
2760
|
accessibilityRole: "none",
|
|
2735
2761
|
onPress: onPress,
|
|
2736
|
-
children:
|
|
2762
|
+
children: children
|
|
2737
2763
|
});
|
|
2738
2764
|
}
|
|
2739
2765
|
|
|
@@ -2892,6 +2918,48 @@ function Notification({
|
|
|
2892
2918
|
});
|
|
2893
2919
|
}
|
|
2894
2920
|
|
|
2921
|
+
const PageLoaderContainer = withTheme( /*#__PURE__*/react$1.styled("div")({
|
|
2922
|
+
name: "PageLoaderContainer",
|
|
2923
|
+
class: "kitt-u_PageLoaderContainer_ptkwz2j",
|
|
2924
|
+
vars: {
|
|
2925
|
+
"ptkwz2j-0": [({
|
|
2926
|
+
theme
|
|
2927
|
+
}) => theme.kitt.colors.separator],
|
|
2928
|
+
"ptkwz2j-1": [({
|
|
2929
|
+
theme
|
|
2930
|
+
}) => theme.kitt.colors.primary]
|
|
2931
|
+
}
|
|
2932
|
+
}));
|
|
2933
|
+
function PageLoader() {
|
|
2934
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
2935
|
+
const {
|
|
2936
|
+
size
|
|
2937
|
+
} = theme.kitt.pageLoader;
|
|
2938
|
+
return /*#__PURE__*/jsxRuntime.jsx(PageLoaderContainer, {
|
|
2939
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
2940
|
+
width: size,
|
|
2941
|
+
height: size,
|
|
2942
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("g", {
|
|
2943
|
+
"data-large-loader": "base",
|
|
2944
|
+
children: /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
2945
|
+
cx: "30",
|
|
2946
|
+
cy: "30",
|
|
2947
|
+
r: "27",
|
|
2948
|
+
fill: "none"
|
|
2949
|
+
})
|
|
2950
|
+
}), /*#__PURE__*/jsxRuntime.jsx("g", {
|
|
2951
|
+
"data-large-loader": "fill",
|
|
2952
|
+
children: /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
2953
|
+
cx: "30",
|
|
2954
|
+
cy: "30",
|
|
2955
|
+
r: "27",
|
|
2956
|
+
fill: "none"
|
|
2957
|
+
})
|
|
2958
|
+
})]
|
|
2959
|
+
})
|
|
2960
|
+
});
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2895
2963
|
const StyledSkeleton = withTheme( /*#__PURE__*/react$1.styled("div")({
|
|
2896
2964
|
name: "StyledSkeleton",
|
|
2897
2965
|
class: "kitt-u_StyledSkeleton_sc3upcl",
|
|
@@ -3712,16 +3780,18 @@ exports.KittBreakpointsMax = KittBreakpointsMax;
|
|
|
3712
3780
|
exports.KittThemeDecorator = KittThemeDecorator;
|
|
3713
3781
|
exports.KittThemeProvider = KittThemeProvider;
|
|
3714
3782
|
exports.Label = Label;
|
|
3715
|
-
exports.LargeLoader = LargeLoader;
|
|
3716
3783
|
exports.ListItem = ListItem;
|
|
3717
|
-
exports.
|
|
3784
|
+
exports.LoaderIcon = LoaderIcon;
|
|
3718
3785
|
exports.MatchWindowSize = MatchWindowSize;
|
|
3719
3786
|
exports.Message = Message;
|
|
3720
3787
|
exports.Modal = Modal;
|
|
3721
3788
|
exports.Notification = Notification;
|
|
3789
|
+
exports.Overlay = Overlay;
|
|
3790
|
+
exports.PageLoader = PageLoader;
|
|
3722
3791
|
exports.Radio = Radio;
|
|
3723
3792
|
exports.Section = DeprecatedSection;
|
|
3724
3793
|
exports.Skeleton = Skeleton;
|
|
3794
|
+
exports.SpinningIcon = SpinningIcon;
|
|
3725
3795
|
exports.Story = Story;
|
|
3726
3796
|
exports.StoryBlock = StoryBlock;
|
|
3727
3797
|
exports.StoryContainer = StoryContainer;
|