@ornikar/kitt-universal 3.1.0 → 3.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.
- package/dist/definitions/Button/AnimatedButtonPressable.d.ts +14 -0
- package/dist/definitions/Button/AnimatedButtonPressable.d.ts.map +1 -0
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +17 -0
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts.map +1 -0
- package/dist/definitions/Button/BaseStyledButtonPressable.d.ts +11 -0
- package/dist/definitions/Button/BaseStyledButtonPressable.d.ts.map +1 -0
- package/dist/definitions/Button/Button.d.ts +9 -4
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts +11 -3
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/Button/StyledDisabled.d.ts +3 -0
- package/dist/definitions/Button/StyledDisabled.d.ts.map +1 -0
- package/dist/definitions/Button/isSubtle.d.ts +3 -0
- package/dist/definitions/Button/isSubtle.d.ts.map +1 -0
- package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
- package/dist/definitions/Loader/LargeLoader.web.d.ts.map +1 -1
- package/dist/definitions/Loader/Loader.d.ts +1 -1
- package/dist/definitions/Loader/Loader.d.ts.map +1 -1
- package/dist/definitions/Skeleton/Skeleton.d.ts +14 -0
- package/dist/definitions/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/definitions/Skeleton/SkeletonContent.d.ts +8 -0
- package/dist/definitions/Skeleton/SkeletonContent.d.ts.map +1 -0
- package/dist/definitions/Skeleton/SkeletonContent.web.d.ts +7 -0
- package/dist/definitions/Skeleton/SkeletonContent.web.d.ts.map +1 -0
- package/dist/definitions/forms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +4 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +4 -43
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts +42 -35
- package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts +7 -0
- package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +2 -0
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyIcon.d.ts +2 -2
- package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/definitions/utils/hexToRgba.d.ts +2 -0
- package/dist/definitions/utils/hexToRgba.d.ts.map +1 -0
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts +7 -2
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts +5 -2
- package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts.map +1 -1
- package/dist/definitions/utils/withTheme.d.ts +2 -2
- package/dist/definitions/utils/withTheme.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +614 -272
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.css +2 -2
- package/dist/index-browser-all.es.ios.js +614 -272
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +654 -306
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +608 -288
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.css +2 -2
- package/dist/index-node-14.17.cjs.js +602 -226
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +4 -2
- package/dist/index-node-14.17.cjs.web.js +546 -220
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +4 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -3
- package/dist/definitions/Button/ButtonPressable.d.ts +0 -13
- package/dist/definitions/Button/ButtonPressable.d.ts.map +0 -1
|
@@ -27,8 +27,7 @@ const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
|
27
27
|
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
28
28
|
// };
|
|
29
29
|
// }
|
|
30
|
-
function withTheme(
|
|
31
|
-
WrappedComponent) {
|
|
30
|
+
function withTheme(WrappedComponent) {
|
|
32
31
|
return function (props) {
|
|
33
32
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
34
33
|
return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
|
|
@@ -50,7 +49,7 @@ function SpinningIcon({
|
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
const IconContainer$
|
|
52
|
+
const IconContainer$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
54
53
|
displayName: "Icon__IconContainer",
|
|
55
54
|
componentId: "kitt-universal__sc-usm0ol-0"
|
|
56
55
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
|
|
@@ -72,7 +71,7 @@ function Icon({
|
|
|
72
71
|
const clonedIcon = /*#__PURE__*/react$1.cloneElement(icon, {
|
|
73
72
|
color
|
|
74
73
|
});
|
|
75
|
-
return /*#__PURE__*/jsxRuntime.jsx(IconContainer$
|
|
74
|
+
return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
|
|
76
75
|
align: align,
|
|
77
76
|
size: size,
|
|
78
77
|
color: color,
|
|
@@ -198,6 +197,20 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
|
198
197
|
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
199
198
|
return base;
|
|
200
199
|
}
|
|
200
|
+
function getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
|
|
201
|
+
base,
|
|
202
|
+
color
|
|
203
|
+
}) {
|
|
204
|
+
// return the props set or undefined. In case of undefined, the value will be inherited from its parents.
|
|
205
|
+
if (hasTypographyAncestor) return {
|
|
206
|
+
base,
|
|
207
|
+
color
|
|
208
|
+
};
|
|
209
|
+
return {
|
|
210
|
+
base: base ?? 'body',
|
|
211
|
+
color: color ?? 'black'
|
|
212
|
+
};
|
|
213
|
+
}
|
|
201
214
|
function Typography({
|
|
202
215
|
accessibilityRole,
|
|
203
216
|
base,
|
|
@@ -209,16 +222,21 @@ function Typography({
|
|
|
209
222
|
...otherProps
|
|
210
223
|
}) {
|
|
211
224
|
const isHeaderTypographyInContext = react$1.useContext(IsHeaderTypographyContext);
|
|
212
|
-
const
|
|
225
|
+
const hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
226
|
+
const {
|
|
227
|
+
base: baseOrDefaultToBody,
|
|
228
|
+
color: colorOrDefaultToBlack
|
|
229
|
+
} = getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
|
|
230
|
+
base,
|
|
231
|
+
color
|
|
232
|
+
});
|
|
233
|
+
const typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(baseOrDefaultToBody, small, medium, large);
|
|
213
234
|
const isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
214
|
-
const nonNullableVariant = variant ?? (isHeader ? 'bold' : 'regular');
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
const colorWithDefaultToBlack = color ?? (isHeaderTypographyInContext !== undefined ? undefined : 'black');
|
|
218
|
-
const content = base ? /*#__PURE__*/jsxRuntime.jsx(IsHeaderTypographyContext.Provider, {
|
|
235
|
+
const nonNullableVariant = variant ?? (isHeader ? 'bold' : 'regular');
|
|
236
|
+
const content = baseOrDefaultToBody ? /*#__PURE__*/jsxRuntime.jsx(IsHeaderTypographyContext.Provider, {
|
|
219
237
|
value: isHeader,
|
|
220
238
|
children: /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
|
|
221
|
-
$color:
|
|
239
|
+
$color: colorOrDefaultToBlack,
|
|
222
240
|
$isHeader: isHeader,
|
|
223
241
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
224
242
|
$variant: nonNullableVariant,
|
|
@@ -226,7 +244,7 @@ function Typography({
|
|
|
226
244
|
...otherProps
|
|
227
245
|
})
|
|
228
246
|
}) : /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
|
|
229
|
-
$color:
|
|
247
|
+
$color: colorOrDefaultToBlack,
|
|
230
248
|
$isHeader: isHeader,
|
|
231
249
|
$variant: nonNullableVariant,
|
|
232
250
|
accessibilityRole: accessibilityRole || undefined,
|
|
@@ -357,79 +375,235 @@ function Avatar({
|
|
|
357
375
|
});
|
|
358
376
|
}
|
|
359
377
|
|
|
360
|
-
function
|
|
361
|
-
|
|
362
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
363
|
-
return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...props,
|
|
364
|
-
color: theme.kitt.typography.colors[color]
|
|
365
|
-
});
|
|
378
|
+
function isSubtle(type) {
|
|
379
|
+
return type.startsWith('subtle');
|
|
366
380
|
}
|
|
367
381
|
|
|
382
|
+
const AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/react.styled("div")({
|
|
383
|
+
name: "AnimatedButtonPressableContainer",
|
|
384
|
+
class: "a1vkj3mh",
|
|
385
|
+
vars: {
|
|
386
|
+
"a1vkj3mh-0": [({
|
|
387
|
+
$isStretch
|
|
388
|
+
}) => $isStretch ? 'inherit' : 'inline-flex'],
|
|
389
|
+
"a1vkj3mh-1": [({
|
|
390
|
+
$isStretch
|
|
391
|
+
}) => $isStretch ? 'stretch' : 'baseline'],
|
|
392
|
+
"a1vkj3mh-2": [({
|
|
393
|
+
theme
|
|
394
|
+
}) => theme.breakpoints.min.mediumBreakpoint],
|
|
395
|
+
"a1vkj3mh-3": [({
|
|
396
|
+
theme
|
|
397
|
+
}) => theme.kitt.button.scale.medium.hover],
|
|
398
|
+
"a1vkj3mh-4": [({
|
|
399
|
+
theme,
|
|
400
|
+
$isDisabled
|
|
401
|
+
}) => `scale(${$isDisabled ? 1 : theme.kitt.button.scale.base.active})`],
|
|
402
|
+
"a1vkj3mh-5": [({
|
|
403
|
+
theme,
|
|
404
|
+
$type,
|
|
405
|
+
$isDisabled
|
|
406
|
+
}) => {
|
|
407
|
+
if ($isDisabled) return theme.kitt.button.disabled.hoverBackgroundColor;
|
|
408
|
+
return theme.kitt.button[$type].hoverBackgroundColor;
|
|
409
|
+
}],
|
|
410
|
+
"a1vkj3mh-6": [({
|
|
411
|
+
theme
|
|
412
|
+
}) => {
|
|
413
|
+
const {
|
|
414
|
+
duration,
|
|
415
|
+
timingFunction
|
|
416
|
+
} = theme.kitt.button.transition;
|
|
417
|
+
return `color, background, border-color, ${duration} ${timingFunction}`;
|
|
418
|
+
}],
|
|
419
|
+
"a1vkj3mh-7": [({
|
|
420
|
+
theme
|
|
421
|
+
}) => theme.kitt.button.borderRadius],
|
|
422
|
+
"a1vkj3mh-8": [({
|
|
423
|
+
theme
|
|
424
|
+
}) => `opacity ${theme.kitt.button.transition.duration} ${theme.kitt.button.transition.timingFunction}`],
|
|
425
|
+
"a1vkj3mh-9": [({
|
|
426
|
+
$isDisabled
|
|
427
|
+
}) => $isDisabled ? 1 : 0],
|
|
428
|
+
"a1vkj3mh-10": [({
|
|
429
|
+
theme
|
|
430
|
+
}) => `-${theme.kitt.button.borderWidth.disabled}`],
|
|
431
|
+
"a1vkj3mh-12": [({
|
|
432
|
+
theme
|
|
433
|
+
}) => `calc(100% - ${parseInt(theme.kitt.button.borderWidth.disabled, 10) * 0.5}px)`],
|
|
434
|
+
"a1vkj3mh-14": [({
|
|
435
|
+
theme
|
|
436
|
+
}) => `${theme.kitt.button.disabled.borderColor} solid ${theme.kitt.button.borderWidth.disabled}`],
|
|
437
|
+
"a1vkj3mh-15": [({
|
|
438
|
+
theme,
|
|
439
|
+
$type
|
|
440
|
+
}) => `${theme.kitt.button.borderWidth.focus} solid ${theme.kitt.button[$type].focusBorderColor}`],
|
|
441
|
+
"a1vkj3mh-16": [({
|
|
442
|
+
theme
|
|
443
|
+
}) => `-${theme.kitt.button.borderWidth.focus}`],
|
|
444
|
+
"a1vkj3mh-18": [({
|
|
445
|
+
theme,
|
|
446
|
+
$type,
|
|
447
|
+
$isDisabled
|
|
448
|
+
}) => {
|
|
449
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
450
|
+
if (!isSubtle($type)) return 'inherit';
|
|
451
|
+
return theme.kitt.button[$type].color;
|
|
452
|
+
}],
|
|
453
|
+
"a1vkj3mh-19": [({
|
|
454
|
+
theme,
|
|
455
|
+
$type,
|
|
456
|
+
$isDisabled
|
|
457
|
+
}) => {
|
|
458
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
459
|
+
if (!isSubtle($type)) return 'inherit';
|
|
460
|
+
return theme.kitt.button[$type].hoverColor;
|
|
461
|
+
}],
|
|
462
|
+
"a1vkj3mh-20": [({
|
|
463
|
+
theme,
|
|
464
|
+
$type,
|
|
465
|
+
$isDisabled
|
|
466
|
+
}) => {
|
|
467
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
468
|
+
if (!isSubtle($type)) return 'inherit';
|
|
469
|
+
return theme.kitt.button[$type].activeColor;
|
|
470
|
+
}]
|
|
471
|
+
}
|
|
472
|
+
}));
|
|
473
|
+
const AnimatedButtonPressable = /*#__PURE__*/react$1.forwardRef(({
|
|
474
|
+
$type,
|
|
475
|
+
$isStretch,
|
|
476
|
+
disabled,
|
|
477
|
+
...props
|
|
478
|
+
}, ref) => {
|
|
479
|
+
return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressableContainer, {
|
|
480
|
+
ref: ref,
|
|
481
|
+
$type: $type,
|
|
482
|
+
$isDisabled: !!disabled,
|
|
483
|
+
$isStretch: $isStretch,
|
|
484
|
+
children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Pressable, {
|
|
485
|
+
disabled: disabled,
|
|
486
|
+
...props
|
|
487
|
+
})
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
const BaseStyledButtonPressable = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
492
|
+
displayName: "BaseStyledButtonPressable",
|
|
493
|
+
componentId: "kitt-universal__sc-4k8lse-0"
|
|
494
|
+
})(["position:relative;min-width:", ";max-width:", ";width:", ";min-height:", ";border-radius:", ";flex-direction:row;align-items:center;justify-content:center;align-self:flex-start;background-color:", ";padding:", ";"], ({
|
|
495
|
+
theme
|
|
496
|
+
}) => theme.kitt.button.minWidth, ({
|
|
497
|
+
theme,
|
|
498
|
+
$isStretch
|
|
499
|
+
}) => $isStretch ? '100%' : theme.kitt.button.maxWidth, ({
|
|
500
|
+
$isStretch
|
|
501
|
+
}) => $isStretch ? '100%' : 'auto', ({
|
|
502
|
+
theme
|
|
503
|
+
}) => theme.kitt.button.minHeight, ({
|
|
504
|
+
theme
|
|
505
|
+
}) => theme.kitt.button.borderRadius, ({
|
|
506
|
+
theme,
|
|
507
|
+
$isDisabled,
|
|
508
|
+
$type
|
|
509
|
+
}) => {
|
|
510
|
+
if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
|
|
511
|
+
return theme.kitt.button[$type].backgroundColor;
|
|
512
|
+
}, ({
|
|
513
|
+
theme,
|
|
514
|
+
$isLarge,
|
|
515
|
+
$isDisabled
|
|
516
|
+
}) => {
|
|
517
|
+
const {
|
|
518
|
+
large,
|
|
519
|
+
default: defaultPadding,
|
|
520
|
+
disabled: disabledPadding
|
|
521
|
+
} = theme.kitt.button.contentPadding;
|
|
522
|
+
if ($isLarge) return large;
|
|
523
|
+
if ($isDisabled) return disabledPadding;
|
|
524
|
+
return defaultPadding;
|
|
525
|
+
});
|
|
526
|
+
|
|
368
527
|
function TypographyIconSpecifiedColor({
|
|
369
528
|
color,
|
|
370
|
-
...
|
|
529
|
+
...props
|
|
371
530
|
}) {
|
|
372
531
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
373
|
-
return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...
|
|
374
|
-
color: theme.kitt.typography.colors[color]
|
|
532
|
+
return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...props,
|
|
533
|
+
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
function TypographyIconInheritColor(props) {
|
|
538
|
+
const color = useTypographyColor();
|
|
539
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
|
|
540
|
+
color: color,
|
|
541
|
+
...props
|
|
375
542
|
});
|
|
376
543
|
}
|
|
377
544
|
|
|
378
545
|
function TypographyIcon({
|
|
379
546
|
color,
|
|
380
|
-
...
|
|
547
|
+
...props
|
|
381
548
|
}) {
|
|
382
549
|
if (color) {
|
|
383
550
|
return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
|
|
384
551
|
color: color,
|
|
385
|
-
...
|
|
552
|
+
...props
|
|
386
553
|
});
|
|
387
554
|
}
|
|
388
555
|
|
|
389
|
-
return /*#__PURE__*/jsxRuntime.jsx(TypographyIconInheritColor, { ...
|
|
556
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyIconInheritColor, { ...props
|
|
390
557
|
});
|
|
391
558
|
}
|
|
392
559
|
|
|
393
|
-
const getTextColorByType =
|
|
394
|
-
if (disabled) return 'black-light';
|
|
395
|
-
|
|
560
|
+
const getTextColorByType = type => {
|
|
396
561
|
switch (type) {
|
|
397
562
|
case 'primary':
|
|
398
563
|
return 'white';
|
|
399
564
|
|
|
565
|
+
case 'white':
|
|
566
|
+
return 'white';
|
|
567
|
+
|
|
400
568
|
case 'subtle':
|
|
401
|
-
return
|
|
569
|
+
return 'primary';
|
|
402
570
|
|
|
403
571
|
case 'subtle-dark':
|
|
404
|
-
return
|
|
572
|
+
return 'black';
|
|
405
573
|
|
|
406
|
-
case 'secondary':
|
|
407
574
|
default:
|
|
408
575
|
return 'black';
|
|
409
576
|
}
|
|
410
577
|
};
|
|
411
578
|
|
|
412
|
-
const
|
|
413
|
-
displayName: "
|
|
579
|
+
const StyledButtonText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
|
|
580
|
+
displayName: "ButtonContent__StyledButtonText",
|
|
414
581
|
componentId: "kitt-universal__sc-dnyw3n-0"
|
|
415
|
-
})(["text-align:center;"])
|
|
416
|
-
|
|
417
|
-
|
|
582
|
+
})(["text-align:center;", " ", ""], () => {
|
|
583
|
+
// Make the multilines case work properly on native
|
|
584
|
+
// Breaks the web implem
|
|
585
|
+
return undefined;
|
|
586
|
+
}, ({
|
|
587
|
+
$type,
|
|
588
|
+
$isDisabled
|
|
589
|
+
}) => {
|
|
590
|
+
/* For subltes button, color changes when hovered.
|
|
591
|
+
* We don't want to use a mouse event handler with a react state to handle it
|
|
592
|
+
* For this precise case, we've decided to work outside the typography logic
|
|
593
|
+
*/
|
|
594
|
+
if ($isDisabled || !isSubtle($type)) return undefined;
|
|
595
|
+
return 'color: inherit';
|
|
596
|
+
});
|
|
597
|
+
const StyledIconContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
598
|
+
displayName: "ButtonContent__StyledIconContainer",
|
|
418
599
|
componentId: "kitt-universal__sc-dnyw3n-1"
|
|
419
|
-
})(["flex-direction:row;align-items:center;justify-content:center;flex:", ";"], ({
|
|
420
|
-
stretch,
|
|
421
|
-
iconOnly
|
|
422
|
-
}) => `${stretch || iconOnly ? 1 : 0} 1 auto`);
|
|
423
|
-
const IconContainer$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
424
|
-
displayName: "ButtonContent__IconContainer",
|
|
425
|
-
componentId: "kitt-universal__sc-dnyw3n-2"
|
|
426
600
|
})(["", ""], ({
|
|
427
601
|
theme,
|
|
428
|
-
iconPosition
|
|
602
|
+
$iconPosition
|
|
429
603
|
}) => {
|
|
430
|
-
const value = theme.kitt.spacing *
|
|
604
|
+
const value = theme.kitt.spacing * 2;
|
|
431
605
|
|
|
432
|
-
if (iconPosition === 'left') {
|
|
606
|
+
if ($iconPosition === 'left') {
|
|
433
607
|
return `margin: 0 ${value}px 0 0;`;
|
|
434
608
|
}
|
|
435
609
|
|
|
@@ -438,150 +612,158 @@ const IconContainer$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponents
|
|
|
438
612
|
|
|
439
613
|
function ButtonIcon({
|
|
440
614
|
icon,
|
|
441
|
-
spin,
|
|
442
615
|
color,
|
|
443
|
-
|
|
616
|
+
spin,
|
|
444
617
|
iconPosition,
|
|
445
618
|
testID
|
|
446
619
|
}) {
|
|
447
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
448
|
-
iconPosition: iconPosition,
|
|
620
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledIconContainer, {
|
|
621
|
+
$iconPosition: iconPosition,
|
|
449
622
|
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
450
623
|
icon: icon,
|
|
451
624
|
spin: spin,
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
testID: testID
|
|
625
|
+
testID: testID,
|
|
626
|
+
color: color
|
|
455
627
|
})
|
|
456
628
|
});
|
|
457
629
|
}
|
|
458
630
|
|
|
459
|
-
|
|
631
|
+
const StyledChildrenWithIcon = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
632
|
+
displayName: "ButtonContent__StyledChildrenWithIcon",
|
|
633
|
+
componentId: "kitt-universal__sc-dnyw3n-2"
|
|
634
|
+
})(["align-items:center;justify-content:center;flex-direction:row;"]);
|
|
635
|
+
function ButtonContentChildren({
|
|
460
636
|
type,
|
|
461
|
-
isPressed,
|
|
462
|
-
stretch,
|
|
463
637
|
icon,
|
|
464
638
|
iconPosition,
|
|
465
639
|
iconSpin,
|
|
466
|
-
|
|
640
|
+
isDisabled,
|
|
641
|
+
color,
|
|
467
642
|
children
|
|
468
643
|
}) {
|
|
469
|
-
const color = getTextColorByType(type, Boolean(isPressed), Boolean(disabled));
|
|
470
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
471
|
-
const sharedIconProps = {
|
|
472
|
-
spin: iconSpin,
|
|
473
|
-
color,
|
|
474
|
-
size: theme.kitt.button.iconSize
|
|
475
|
-
};
|
|
476
|
-
|
|
477
644
|
if ((process.env.NODE_ENV !== "production")) {
|
|
478
645
|
if (!(children || icon)) {
|
|
479
646
|
throw new Error('kitt(Button): You should provide at least a children or a icon');
|
|
480
647
|
}
|
|
481
648
|
}
|
|
482
649
|
|
|
650
|
+
const isWebSubtle = isSubtle(type) && "web" === 'web' && !isDisabled;
|
|
651
|
+
|
|
483
652
|
if (!children) {
|
|
484
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
})
|
|
653
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
654
|
+
spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
655
|
+
,
|
|
656
|
+
icon: icon,
|
|
657
|
+
color: isWebSubtle ? 'inherit' : color
|
|
490
658
|
});
|
|
491
659
|
}
|
|
492
660
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
661
|
+
const buttonIconSharedProps = {
|
|
662
|
+
type,
|
|
663
|
+
spin: iconSpin,
|
|
664
|
+
iconPosition,
|
|
665
|
+
color: isWebSubtle ? 'inherit' : color
|
|
666
|
+
};
|
|
667
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledChildrenWithIcon, {
|
|
668
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
|
|
669
|
+
testID: "button-left-icon",
|
|
670
|
+
icon: icon
|
|
671
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(StyledButtonText, {
|
|
500
672
|
base: "body",
|
|
501
|
-
color: color,
|
|
502
673
|
variant: "bold",
|
|
674
|
+
$type: type,
|
|
675
|
+
$isDisabled: isDisabled // set to color: inherit via styled components
|
|
676
|
+
,
|
|
677
|
+
color: isWebSubtle ? undefined : color,
|
|
503
678
|
children: children
|
|
504
|
-
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...
|
|
505
|
-
icon: icon
|
|
506
|
-
iconPosition: iconPosition
|
|
679
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
|
|
680
|
+
icon: icon
|
|
507
681
|
}) : null]
|
|
508
682
|
});
|
|
509
683
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}) => theme.kitt.button.minWidth, ({
|
|
517
|
-
theme,
|
|
518
|
-
stretch
|
|
519
|
-
}) => stretch ? 'auto' : theme.kitt.button.maxWidth, ({
|
|
520
|
-
stretch
|
|
521
|
-
}) => stretch ? '100%' : 'auto', ({
|
|
522
|
-
theme
|
|
523
|
-
}) => theme.kitt.button.minHeight, ({
|
|
524
|
-
theme,
|
|
525
|
-
isPressed,
|
|
526
|
-
disabled,
|
|
527
|
-
type
|
|
684
|
+
const ButtonContentContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
685
|
+
displayName: "ButtonContent__ButtonContentContainer",
|
|
686
|
+
componentId: "kitt-universal__sc-dnyw3n-3"
|
|
687
|
+
})(["line-height:16px;", " ", ";"], ({
|
|
688
|
+
$isStretch,
|
|
689
|
+
$isIconOnly
|
|
528
690
|
}) => {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
|
|
691
|
+
return `
|
|
692
|
+
flex: ${$isStretch || $isIconOnly ? 1 : 0} 1 auto;
|
|
693
|
+
`;
|
|
534
694
|
}, ({
|
|
535
|
-
|
|
536
|
-
}) =>
|
|
537
|
-
|
|
538
|
-
}) => theme.kitt.button.borderRadius, ({
|
|
539
|
-
theme,
|
|
540
|
-
disabled,
|
|
541
|
-
type
|
|
542
|
-
}) => disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent', ({
|
|
543
|
-
theme
|
|
544
|
-
}) => theme.kitt.button.borderWidth);
|
|
695
|
+
$isSubtle
|
|
696
|
+
}) => {
|
|
697
|
+
if (!$isSubtle) return undefined; // Needed for subtle type
|
|
545
698
|
|
|
546
|
-
|
|
699
|
+
return 'color: inherit';
|
|
700
|
+
});
|
|
701
|
+
function ButtonContent({
|
|
702
|
+
type,
|
|
703
|
+
isDisabled,
|
|
704
|
+
$isStretch,
|
|
705
|
+
icon,
|
|
547
706
|
children,
|
|
548
|
-
|
|
707
|
+
...props
|
|
708
|
+
}) {
|
|
709
|
+
const color = isDisabled ? 'black-light' : getTextColorByType(type);
|
|
710
|
+
return /*#__PURE__*/jsxRuntime.jsx(ButtonContentContainer, {
|
|
711
|
+
$isSubtle: isSubtle(type),
|
|
712
|
+
$isStretch: $isStretch,
|
|
713
|
+
$isIconOnly: Boolean(!children && icon),
|
|
714
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ButtonContentChildren, {
|
|
715
|
+
icon: icon,
|
|
716
|
+
type: type,
|
|
717
|
+
isDisabled: isDisabled,
|
|
718
|
+
color: color,
|
|
719
|
+
...props,
|
|
720
|
+
children: children
|
|
721
|
+
})
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
const Button = /*#__PURE__*/react$1.forwardRef(({
|
|
726
|
+
children,
|
|
727
|
+
type = 'default',
|
|
728
|
+
disabled,
|
|
729
|
+
stretch,
|
|
730
|
+
large,
|
|
549
731
|
icon,
|
|
550
732
|
iconPosition = 'left',
|
|
551
733
|
iconSpin,
|
|
552
|
-
stretch,
|
|
553
|
-
disabled,
|
|
554
734
|
testID,
|
|
555
735
|
href,
|
|
556
736
|
hrefAttrs,
|
|
737
|
+
accessibilityRole = 'button',
|
|
557
738
|
onPress
|
|
558
|
-
}) {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
stretch,
|
|
563
|
-
disabled
|
|
564
|
-
};
|
|
565
|
-
return /*#__PURE__*/jsxRuntime.jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
566
|
-
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
567
|
-
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
568
|
-
, { ...sharedProps,
|
|
569
|
-
isPressed: isPressed,
|
|
570
|
-
accessibilityRole: "button",
|
|
739
|
+
}, ref) => {
|
|
740
|
+
return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressable, {
|
|
741
|
+
ref: ref,
|
|
742
|
+
accessibilityRole: accessibilityRole,
|
|
571
743
|
testID: testID,
|
|
572
744
|
href: href,
|
|
573
745
|
hrefAttrs: hrefAttrs,
|
|
746
|
+
disabled: disabled,
|
|
747
|
+
$isStretch: stretch,
|
|
748
|
+
$type: type,
|
|
574
749
|
onPress: onPress,
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
750
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(BaseStyledButtonPressable, {
|
|
751
|
+
$type: type,
|
|
752
|
+
$isStretch: stretch,
|
|
753
|
+
$isLarge: large,
|
|
754
|
+
$isDisabled: disabled,
|
|
755
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
|
|
756
|
+
type: type,
|
|
757
|
+
$isStretch: stretch,
|
|
758
|
+
isDisabled: disabled,
|
|
759
|
+
icon: icon,
|
|
760
|
+
iconPosition: iconPosition,
|
|
761
|
+
iconSpin: iconSpin,
|
|
762
|
+
children: children
|
|
763
|
+
}), null]
|
|
582
764
|
})
|
|
583
765
|
});
|
|
584
|
-
}
|
|
766
|
+
});
|
|
585
767
|
|
|
586
768
|
const Container$5 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
587
769
|
displayName: "Card__Container",
|
|
@@ -980,6 +1162,7 @@ function TextArea({ ...props
|
|
|
980
1162
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
981
1163
|
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
982
1164
|
multiline: true,
|
|
1165
|
+
textAlignVertical: "top",
|
|
983
1166
|
...props,
|
|
984
1167
|
type: "text",
|
|
985
1168
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
@@ -1165,11 +1348,16 @@ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react.styled("div"
|
|
|
1165
1348
|
theme
|
|
1166
1349
|
}) => theme.kitt.iconButton.scale.base.active],
|
|
1167
1350
|
"p1nlccvg-4": [({
|
|
1168
|
-
theme
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1351
|
+
theme,
|
|
1352
|
+
$isWhite
|
|
1353
|
+
}) => {
|
|
1354
|
+
const {
|
|
1355
|
+
white,
|
|
1356
|
+
default: defaultIconButton
|
|
1357
|
+
} = theme.kitt.iconButton;
|
|
1358
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1359
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1360
|
+
}]
|
|
1173
1361
|
}
|
|
1174
1362
|
}));
|
|
1175
1363
|
const StyledPressableIconButton = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
|
|
@@ -1208,7 +1396,7 @@ function PressableIconButton({
|
|
|
1208
1396
|
}) {
|
|
1209
1397
|
return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
1210
1398
|
as: PressableIconButtonWebWrapper,
|
|
1211
|
-
|
|
1399
|
+
$isWhite: color === 'white',
|
|
1212
1400
|
children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props
|
|
1213
1401
|
})
|
|
1214
1402
|
});
|
|
@@ -1731,6 +1919,83 @@ function Notification({
|
|
|
1731
1919
|
});
|
|
1732
1920
|
}
|
|
1733
1921
|
|
|
1922
|
+
const StyledSkeleton = withTheme( /*#__PURE__*/react.styled("div")({
|
|
1923
|
+
name: "StyledSkeleton",
|
|
1924
|
+
class: "sc3upcl",
|
|
1925
|
+
vars: {
|
|
1926
|
+
"sc3upcl-0": [({
|
|
1927
|
+
theme
|
|
1928
|
+
}) => theme.kitt.skeleton.backgroundColor],
|
|
1929
|
+
"sc3upcl-1": [({
|
|
1930
|
+
$isLoading,
|
|
1931
|
+
theme
|
|
1932
|
+
}) => $isLoading ? `linear-gradient(
|
|
1933
|
+
-90deg,
|
|
1934
|
+
${theme.kitt.skeleton.backgroundColor},
|
|
1935
|
+
${theme.kitt.skeleton.flareColor} 50%,
|
|
1936
|
+
${theme.kitt.skeleton.backgroundColor} 100%
|
|
1937
|
+
)` : 'none'],
|
|
1938
|
+
"sc3upcl-2": [({
|
|
1939
|
+
$isLoading
|
|
1940
|
+
}) => $isLoading ? '1s ease-in-out infinite' : 'none']
|
|
1941
|
+
}
|
|
1942
|
+
}));
|
|
1943
|
+
function SkeletonContent({
|
|
1944
|
+
isLoading
|
|
1945
|
+
}) {
|
|
1946
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledSkeleton, {
|
|
1947
|
+
$isLoading: isLoading
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
function Skeleton({
|
|
1952
|
+
isLoading,
|
|
1953
|
+
style
|
|
1954
|
+
}) {
|
|
1955
|
+
const [width, setWidth] = react$1.useState(0);
|
|
1956
|
+
return /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.View, {
|
|
1957
|
+
style: style,
|
|
1958
|
+
onLayout: ({
|
|
1959
|
+
nativeEvent
|
|
1960
|
+
}) => setWidth(nativeEvent.layout.width),
|
|
1961
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SkeletonContent, {
|
|
1962
|
+
isLoading: isLoading,
|
|
1963
|
+
width: width
|
|
1964
|
+
})
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
const Bar = /*#__PURE__*/styled__default(Skeleton).withConfig({
|
|
1968
|
+
displayName: "Skeleton__Bar",
|
|
1969
|
+
componentId: "kitt-universal__sc-1w5cm3i-0"
|
|
1970
|
+
})(["width:100%;height:", "px;border-radius:", "px;overflow:hidden;"], ({
|
|
1971
|
+
theme
|
|
1972
|
+
}) => theme.kitt.spacing * 2, ({
|
|
1973
|
+
theme
|
|
1974
|
+
}) => theme.kitt.spacing * 2);
|
|
1975
|
+
const Circle = /*#__PURE__*/styled__default(Skeleton).withConfig({
|
|
1976
|
+
displayName: "Skeleton__Circle",
|
|
1977
|
+
componentId: "kitt-universal__sc-1w5cm3i-1"
|
|
1978
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], ({
|
|
1979
|
+
theme
|
|
1980
|
+
}) => theme.kitt.spacing * 12, ({
|
|
1981
|
+
theme
|
|
1982
|
+
}) => theme.kitt.spacing * 12, ({
|
|
1983
|
+
theme
|
|
1984
|
+
}) => theme.kitt.spacing * 6);
|
|
1985
|
+
const Square = /*#__PURE__*/styled__default(Skeleton).withConfig({
|
|
1986
|
+
displayName: "Skeleton__Square",
|
|
1987
|
+
componentId: "kitt-universal__sc-1w5cm3i-2"
|
|
1988
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], ({
|
|
1989
|
+
theme
|
|
1990
|
+
}) => theme.kitt.spacing * 12, ({
|
|
1991
|
+
theme
|
|
1992
|
+
}) => theme.kitt.spacing * 12, ({
|
|
1993
|
+
theme
|
|
1994
|
+
}) => theme.kitt.spacing * 1.5);
|
|
1995
|
+
Skeleton.Bar = Bar;
|
|
1996
|
+
Skeleton.Circle = Circle;
|
|
1997
|
+
Skeleton.Square = Square;
|
|
1998
|
+
|
|
1734
1999
|
const Flex = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
1735
2000
|
shouldForwardProp: (prop, defaultValidatorFn) => !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop)
|
|
1736
2001
|
}).withConfig({
|
|
@@ -2164,47 +2429,98 @@ const avatarLateOceanTheme = {
|
|
|
2164
2429
|
}
|
|
2165
2430
|
};
|
|
2166
2431
|
|
|
2432
|
+
const colorsLateOceanTheme = {
|
|
2433
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
2434
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2435
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
2436
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2437
|
+
success: lateOceanColorPalette.viride,
|
|
2438
|
+
correct: lateOceanColorPalette.viride,
|
|
2439
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
2440
|
+
separator: lateOceanColorPalette.black100,
|
|
2441
|
+
hover: lateOceanColorPalette.black100,
|
|
2442
|
+
black: lateOceanColorPalette.black1000,
|
|
2443
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
2444
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2445
|
+
transparent: lateOceanColorPalette.transparent,
|
|
2446
|
+
disabled: lateOceanColorPalette.black50,
|
|
2447
|
+
overlay: {
|
|
2448
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2449
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
2450
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2451
|
+
}
|
|
2452
|
+
};
|
|
2453
|
+
|
|
2167
2454
|
const buttonLateOceanTheme = {
|
|
2168
2455
|
borderRadius: '30px',
|
|
2169
|
-
borderWidth:
|
|
2170
|
-
|
|
2456
|
+
borderWidth: {
|
|
2457
|
+
disabled: '2px',
|
|
2458
|
+
focus: '3px'
|
|
2459
|
+
},
|
|
2460
|
+
minHeight: '40px',
|
|
2171
2461
|
minWidth: '40px',
|
|
2172
2462
|
maxWidth: '335px',
|
|
2173
|
-
|
|
2463
|
+
scale: {
|
|
2464
|
+
base: {
|
|
2465
|
+
default: 1,
|
|
2466
|
+
hover: 0.95,
|
|
2467
|
+
active: 0.95
|
|
2468
|
+
},
|
|
2469
|
+
medium: {
|
|
2470
|
+
hover: 1.05
|
|
2471
|
+
}
|
|
2472
|
+
},
|
|
2174
2473
|
contentPadding: {
|
|
2175
|
-
default: '8px 16px'
|
|
2474
|
+
default: '8px 16px 7px',
|
|
2475
|
+
large: '12px 24px 11px',
|
|
2476
|
+
disabled: '6px 14px 5px'
|
|
2176
2477
|
},
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
|
|
2181
|
-
disabledBorderColor: lateOceanColorPalette.black100
|
|
2478
|
+
transition: {
|
|
2479
|
+
duration: '200ms',
|
|
2480
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2182
2481
|
},
|
|
2183
|
-
|
|
2482
|
+
default: {
|
|
2184
2483
|
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2185
|
-
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
2186
2484
|
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2187
|
-
|
|
2485
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2486
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2188
2487
|
},
|
|
2189
|
-
|
|
2190
|
-
backgroundColor:
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
},
|
|
2195
|
-
'subtle-dark': {
|
|
2196
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
2197
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2198
|
-
pressedBackgroundColor: lateOceanColorPalette.transparent,
|
|
2199
|
-
disabledBorderColor: lateOceanColorPalette.transparent
|
|
2488
|
+
primary: {
|
|
2489
|
+
backgroundColor: colorsLateOceanTheme.primary,
|
|
2490
|
+
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2491
|
+
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2492
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2200
2493
|
},
|
|
2201
2494
|
white: {
|
|
2202
2495
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2203
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2204
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2205
2496
|
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2206
|
-
|
|
2207
|
-
|
|
2497
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2498
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2499
|
+
},
|
|
2500
|
+
subtle: {
|
|
2501
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2502
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2503
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2504
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2505
|
+
color: colorsLateOceanTheme.primary,
|
|
2506
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2507
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2508
|
+
},
|
|
2509
|
+
'subtle-dark': {
|
|
2510
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2511
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2512
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2513
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2514
|
+
color: colorsLateOceanTheme.black,
|
|
2515
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2516
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2517
|
+
},
|
|
2518
|
+
disabled: {
|
|
2519
|
+
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2520
|
+
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2521
|
+
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2522
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
2523
|
+
borderColor: lateOceanColorPalette.black100
|
|
2208
2524
|
}
|
|
2209
2525
|
};
|
|
2210
2526
|
|
|
@@ -2226,26 +2542,6 @@ const cardLateOceanTheme = {
|
|
|
2226
2542
|
}
|
|
2227
2543
|
};
|
|
2228
2544
|
|
|
2229
|
-
const colorsLateOceanTheme = {
|
|
2230
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2231
|
-
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2232
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2233
|
-
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2234
|
-
success: lateOceanColorPalette.viride,
|
|
2235
|
-
correct: lateOceanColorPalette.viride,
|
|
2236
|
-
danger: lateOceanColorPalette.englishVermillon,
|
|
2237
|
-
separator: lateOceanColorPalette.black100,
|
|
2238
|
-
hover: lateOceanColorPalette.black100,
|
|
2239
|
-
black: lateOceanColorPalette.black1000,
|
|
2240
|
-
uiBackground: lateOceanColorPalette.black25,
|
|
2241
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2242
|
-
overlay: {
|
|
2243
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2244
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2245
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2246
|
-
}
|
|
2247
|
-
};
|
|
2248
|
-
|
|
2249
2545
|
const feedbackMessageLateOceanTheme = {
|
|
2250
2546
|
backgroundColors: {
|
|
2251
2547
|
success: lateOceanColorPalette.viride,
|
|
@@ -2359,11 +2655,11 @@ const iconButton = {
|
|
|
2359
2655
|
},
|
|
2360
2656
|
disabled: {
|
|
2361
2657
|
scale: 1,
|
|
2362
|
-
backgroundColor: buttonLateOceanTheme.
|
|
2363
|
-
borderColor: buttonLateOceanTheme.
|
|
2658
|
+
backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
|
|
2659
|
+
borderColor: buttonLateOceanTheme.disabled.borderColor
|
|
2364
2660
|
},
|
|
2365
2661
|
default: {
|
|
2366
|
-
pressedBackgroundColor: buttonLateOceanTheme.
|
|
2662
|
+
pressedBackgroundColor: buttonLateOceanTheme.default.pressedBackgroundColor
|
|
2367
2663
|
},
|
|
2368
2664
|
white: {
|
|
2369
2665
|
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
@@ -2381,6 +2677,12 @@ const shadowsLateOceanTheme = {
|
|
|
2381
2677
|
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
2382
2678
|
};
|
|
2383
2679
|
|
|
2680
|
+
const skeletonTheme = {
|
|
2681
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
2682
|
+
flareColor: lateOceanColorPalette.black200,
|
|
2683
|
+
animationDuration: 1000
|
|
2684
|
+
};
|
|
2685
|
+
|
|
2384
2686
|
const tagLateOceanTheme = {
|
|
2385
2687
|
borderRadius: '10px',
|
|
2386
2688
|
padding: '2px 12px',
|
|
@@ -2432,18 +2734,16 @@ const tooltip = {
|
|
|
2432
2734
|
};
|
|
2433
2735
|
|
|
2434
2736
|
const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
|
|
2435
|
-
|
|
2436
2737
|
const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
|
|
2437
2738
|
baseAndSmall: {
|
|
2438
2739
|
fontSize: `${baseAndSmallFontSize}px`,
|
|
2439
|
-
lineHeight: `${calcLineHeight(
|
|
2740
|
+
lineHeight: `${calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)}px`
|
|
2440
2741
|
},
|
|
2441
2742
|
mediumAndWide: {
|
|
2442
2743
|
fontSize: `${mediumAndWideFontSize}px`,
|
|
2443
|
-
lineHeight: `${calcLineHeight(
|
|
2744
|
+
lineHeight: `${calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)}px`
|
|
2444
2745
|
}
|
|
2445
2746
|
});
|
|
2446
|
-
|
|
2447
2747
|
const typographyLateOceanTheme = {
|
|
2448
2748
|
colors: {
|
|
2449
2749
|
black: lateOceanColorPalette.black1000,
|
|
@@ -2525,7 +2825,7 @@ const breakpoints = {
|
|
|
2525
2825
|
wideBreakpoint: 'max-width: 1279px'
|
|
2526
2826
|
}
|
|
2527
2827
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2528
|
-
// TODO : seperate brand
|
|
2828
|
+
// TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
|
|
2529
2829
|
|
|
2530
2830
|
const theme = {
|
|
2531
2831
|
spacing: 4,
|
|
@@ -2544,7 +2844,8 @@ const theme = {
|
|
|
2544
2844
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2545
2845
|
iconButton,
|
|
2546
2846
|
listItem: listItemLateOceanTheme,
|
|
2547
|
-
tooltip
|
|
2847
|
+
tooltip,
|
|
2848
|
+
skeleton: skeletonTheme
|
|
2548
2849
|
};
|
|
2549
2850
|
|
|
2550
2851
|
function TimePicker() {
|
|
@@ -2788,14 +3089,19 @@ function TypographyEmoji({
|
|
|
2788
3089
|
|
|
2789
3090
|
const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/react.styled("span")({
|
|
2790
3091
|
name: "TypographyLinkWebWrapper",
|
|
2791
|
-
class: "tcwz3nt"
|
|
3092
|
+
class: "tcwz3nt",
|
|
3093
|
+
vars: {
|
|
3094
|
+
"tcwz3nt-0": [({
|
|
3095
|
+
$hasNoUnderline
|
|
3096
|
+
}) => $hasNoUnderline ? 'underline' : 'none']
|
|
3097
|
+
}
|
|
2792
3098
|
}));
|
|
2793
3099
|
const StyledLink = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Text).withConfig({
|
|
2794
3100
|
displayName: "TypographyLink__StyledLink",
|
|
2795
3101
|
componentId: "kitt-universal__sc-1o1zy30-0"
|
|
2796
3102
|
})(["text-decoration:", ";", ";", ";"], ({
|
|
2797
|
-
$
|
|
2798
|
-
}) => $
|
|
3103
|
+
$hasNoUnderline
|
|
3104
|
+
}) => $hasNoUnderline ? 'none' : 'underline', ({
|
|
2799
3105
|
$disabled
|
|
2800
3106
|
}) => {
|
|
2801
3107
|
return `
|
|
@@ -2823,10 +3129,10 @@ function TypographyLink({
|
|
|
2823
3129
|
accessibilityRole: "none",
|
|
2824
3130
|
children: /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
2825
3131
|
as: TypographyLinkWebWrapper,
|
|
2826
|
-
|
|
3132
|
+
$hasNoUnderline: noUnderline,
|
|
2827
3133
|
children: /*#__PURE__*/jsxRuntime.jsx(StyledLink, {
|
|
2828
3134
|
$disabled: disabled,
|
|
2829
|
-
$
|
|
3135
|
+
$hasNoUnderline: noUnderline,
|
|
2830
3136
|
href: href,
|
|
2831
3137
|
hrefAttrs: hrefAttrs,
|
|
2832
3138
|
accessibilityRole: "link",
|
|
@@ -2841,23 +3147,35 @@ function TypographyLink({
|
|
|
2841
3147
|
});
|
|
2842
3148
|
}
|
|
2843
3149
|
|
|
2844
|
-
function matchWindowSize(
|
|
3150
|
+
function matchWindowSize({
|
|
3151
|
+
width,
|
|
3152
|
+
height
|
|
3153
|
+
}, {
|
|
2845
3154
|
minWidth,
|
|
2846
|
-
maxWidth
|
|
3155
|
+
maxWidth,
|
|
3156
|
+
minHeight,
|
|
3157
|
+
maxHeight
|
|
2847
3158
|
}) {
|
|
2848
|
-
|
|
3159
|
+
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3160
|
+
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3161
|
+
return hasWidthMatched && hasHeightMatched;
|
|
2849
3162
|
}
|
|
2850
3163
|
function useMatchWindowSize(options) {
|
|
2851
3164
|
const {
|
|
2852
|
-
width
|
|
3165
|
+
width,
|
|
3166
|
+
height
|
|
2853
3167
|
} = BabelPluginStyledComponentsReactNative.useWindowDimensions();
|
|
2854
|
-
return matchWindowSize(
|
|
3168
|
+
return matchWindowSize({
|
|
3169
|
+
width,
|
|
3170
|
+
height
|
|
3171
|
+
}, options);
|
|
2855
3172
|
}
|
|
2856
3173
|
|
|
2857
|
-
|
|
3174
|
+
// eslint-disable-next-line no-restricted-imports
|
|
3175
|
+
function createWindowSizeHelper(dimensions) {
|
|
2858
3176
|
return {
|
|
2859
|
-
matchWindowSize: options => matchWindowSize(
|
|
2860
|
-
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(
|
|
3177
|
+
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
3178
|
+
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
2861
3179
|
mapWindowWidth: (...widthList) => {
|
|
2862
3180
|
if ((process.env.NODE_ENV !== "production")) {
|
|
2863
3181
|
widthList.slice(1).forEach(([minWidth], index) => {
|
|
@@ -2869,7 +3187,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
2869
3187
|
});
|
|
2870
3188
|
}
|
|
2871
3189
|
|
|
2872
|
-
const found = widthList.find(([minWidth, value]) => matchWindowSize(
|
|
3190
|
+
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
2873
3191
|
minWidth: Number(minWidth)
|
|
2874
3192
|
}));
|
|
2875
3193
|
if (!found) return null;
|
|
@@ -2879,18 +3197,23 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
2879
3197
|
}
|
|
2880
3198
|
|
|
2881
3199
|
function useKittTheme() {
|
|
2882
|
-
const
|
|
2883
|
-
width
|
|
2884
|
-
} = BabelPluginStyledComponentsReactNative.useWindowDimensions();
|
|
3200
|
+
const dimensions = BabelPluginStyledComponentsReactNative.useWindowDimensions();
|
|
2885
3201
|
return react$1.useMemo(() => {
|
|
2886
3202
|
return {
|
|
2887
3203
|
kitt: theme,
|
|
2888
|
-
responsive: createWindowSizeHelper(
|
|
3204
|
+
responsive: createWindowSizeHelper(dimensions),
|
|
2889
3205
|
breakpoints
|
|
2890
3206
|
};
|
|
2891
|
-
}, [
|
|
3207
|
+
}, [dimensions]);
|
|
2892
3208
|
}
|
|
2893
3209
|
|
|
3210
|
+
const hex2rgba = (hex, alpha = 1) => {
|
|
3211
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
3212
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
3213
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
3214
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
3215
|
+
};
|
|
3216
|
+
|
|
2894
3217
|
function KittThemeProvider({
|
|
2895
3218
|
children
|
|
2896
3219
|
}) {
|
|
@@ -2951,6 +3274,7 @@ exports.Modal = Modal;
|
|
|
2951
3274
|
exports.Notification = Notification;
|
|
2952
3275
|
exports.Radio = Radio;
|
|
2953
3276
|
exports.Section = DeprecatedSection;
|
|
3277
|
+
exports.Skeleton = Skeleton;
|
|
2954
3278
|
exports.Story = Story;
|
|
2955
3279
|
exports.StoryBlock = StoryBlock;
|
|
2956
3280
|
exports.StoryContainer = StoryContainer;
|
|
@@ -2958,6 +3282,7 @@ exports.StoryDecorator = StoryDecorator;
|
|
|
2958
3282
|
exports.StoryGrid = StoryGrid;
|
|
2959
3283
|
exports.StorySection = StorySection;
|
|
2960
3284
|
exports.StoryTitle = StoryTitle;
|
|
3285
|
+
exports.StyleWebWrapper = StyleWebWrapper;
|
|
2961
3286
|
exports.Tag = Tag;
|
|
2962
3287
|
exports.TextArea = TextArea;
|
|
2963
3288
|
exports.TimePicker = TimePicker;
|
|
@@ -2967,6 +3292,7 @@ exports.TypographyEmoji = TypographyEmoji;
|
|
|
2967
3292
|
exports.TypographyIcon = TypographyIcon;
|
|
2968
3293
|
exports.TypographyLink = TypographyLink;
|
|
2969
3294
|
exports.createWindowSizeHelper = createWindowSizeHelper;
|
|
3295
|
+
exports.hex2rgba = hex2rgba;
|
|
2970
3296
|
exports.matchWindowSize = matchWindowSize;
|
|
2971
3297
|
exports.styledTextInputMixin = styledTextInputMixin;
|
|
2972
3298
|
exports.theme = theme;
|