@ornikar/kitt-universal 3.0.1 → 3.4.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/themes/default.d.ts +3 -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/typography/Typography.d.ts +13 -11
- 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/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 +461 -255
- 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 +461 -255
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +504 -291
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +500 -281
- 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 +462 -213
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +3 -2
- package/dist/index-node-14.17.cjs.web.js +448 -215
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +3 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -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",
|
|
@@ -1165,11 +1347,16 @@ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react.styled("div"
|
|
|
1165
1347
|
theme
|
|
1166
1348
|
}) => theme.kitt.iconButton.scale.base.active],
|
|
1167
1349
|
"p1nlccvg-4": [({
|
|
1168
|
-
theme
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1350
|
+
theme,
|
|
1351
|
+
$isWhite
|
|
1352
|
+
}) => {
|
|
1353
|
+
const {
|
|
1354
|
+
white,
|
|
1355
|
+
default: defaultIconButton
|
|
1356
|
+
} = theme.kitt.iconButton;
|
|
1357
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1358
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1359
|
+
}]
|
|
1173
1360
|
}
|
|
1174
1361
|
}));
|
|
1175
1362
|
const StyledPressableIconButton = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
|
|
@@ -1208,7 +1395,7 @@ function PressableIconButton({
|
|
|
1208
1395
|
}) {
|
|
1209
1396
|
return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
1210
1397
|
as: PressableIconButtonWebWrapper,
|
|
1211
|
-
|
|
1398
|
+
$isWhite: color === 'white',
|
|
1212
1399
|
children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props
|
|
1213
1400
|
})
|
|
1214
1401
|
});
|
|
@@ -2164,47 +2351,98 @@ const avatarLateOceanTheme = {
|
|
|
2164
2351
|
}
|
|
2165
2352
|
};
|
|
2166
2353
|
|
|
2354
|
+
const colorsLateOceanTheme = {
|
|
2355
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
2356
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2357
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
2358
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2359
|
+
success: lateOceanColorPalette.viride,
|
|
2360
|
+
correct: lateOceanColorPalette.viride,
|
|
2361
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
2362
|
+
separator: lateOceanColorPalette.black100,
|
|
2363
|
+
hover: lateOceanColorPalette.black100,
|
|
2364
|
+
black: lateOceanColorPalette.black1000,
|
|
2365
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
2366
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2367
|
+
transparent: lateOceanColorPalette.transparent,
|
|
2368
|
+
disabled: lateOceanColorPalette.black50,
|
|
2369
|
+
overlay: {
|
|
2370
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2371
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
2372
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2373
|
+
}
|
|
2374
|
+
};
|
|
2375
|
+
|
|
2167
2376
|
const buttonLateOceanTheme = {
|
|
2168
2377
|
borderRadius: '30px',
|
|
2169
|
-
borderWidth:
|
|
2170
|
-
|
|
2378
|
+
borderWidth: {
|
|
2379
|
+
disabled: '2px',
|
|
2380
|
+
focus: '3px'
|
|
2381
|
+
},
|
|
2382
|
+
minHeight: '40px',
|
|
2171
2383
|
minWidth: '40px',
|
|
2172
2384
|
maxWidth: '335px',
|
|
2173
|
-
|
|
2385
|
+
scale: {
|
|
2386
|
+
base: {
|
|
2387
|
+
default: 1,
|
|
2388
|
+
hover: 0.95,
|
|
2389
|
+
active: 0.95
|
|
2390
|
+
},
|
|
2391
|
+
medium: {
|
|
2392
|
+
hover: 1.05
|
|
2393
|
+
}
|
|
2394
|
+
},
|
|
2174
2395
|
contentPadding: {
|
|
2175
|
-
default: '8px 16px'
|
|
2396
|
+
default: '8px 16px 7px',
|
|
2397
|
+
large: '12px 24px 11px',
|
|
2398
|
+
disabled: '6px 14px 5px'
|
|
2176
2399
|
},
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
|
|
2181
|
-
disabledBorderColor: lateOceanColorPalette.black100
|
|
2400
|
+
transition: {
|
|
2401
|
+
duration: '200ms',
|
|
2402
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2182
2403
|
},
|
|
2183
|
-
|
|
2404
|
+
default: {
|
|
2184
2405
|
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2185
|
-
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
2186
2406
|
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
subtle: {
|
|
2190
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
2191
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2192
|
-
pressedBackgroundColor: lateOceanColorPalette.transparent,
|
|
2193
|
-
disabledBorderColor: lateOceanColorPalette.transparent
|
|
2407
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2408
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2194
2409
|
},
|
|
2195
|
-
|
|
2196
|
-
backgroundColor:
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2410
|
+
primary: {
|
|
2411
|
+
backgroundColor: colorsLateOceanTheme.primary,
|
|
2412
|
+
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2413
|
+
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2414
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2200
2415
|
},
|
|
2201
2416
|
white: {
|
|
2202
2417
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2203
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2204
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2205
2418
|
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2206
|
-
|
|
2207
|
-
|
|
2419
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2420
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2421
|
+
},
|
|
2422
|
+
subtle: {
|
|
2423
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2424
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2425
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2426
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2427
|
+
color: colorsLateOceanTheme.primary,
|
|
2428
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2429
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2430
|
+
},
|
|
2431
|
+
'subtle-dark': {
|
|
2432
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2433
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2434
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2435
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2436
|
+
color: colorsLateOceanTheme.black,
|
|
2437
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2438
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2439
|
+
},
|
|
2440
|
+
disabled: {
|
|
2441
|
+
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2442
|
+
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2443
|
+
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2444
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
2445
|
+
borderColor: lateOceanColorPalette.black100
|
|
2208
2446
|
}
|
|
2209
2447
|
};
|
|
2210
2448
|
|
|
@@ -2226,26 +2464,6 @@ const cardLateOceanTheme = {
|
|
|
2226
2464
|
}
|
|
2227
2465
|
};
|
|
2228
2466
|
|
|
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
2467
|
const feedbackMessageLateOceanTheme = {
|
|
2250
2468
|
backgroundColors: {
|
|
2251
2469
|
success: lateOceanColorPalette.viride,
|
|
@@ -2359,11 +2577,11 @@ const iconButton = {
|
|
|
2359
2577
|
},
|
|
2360
2578
|
disabled: {
|
|
2361
2579
|
scale: 1,
|
|
2362
|
-
backgroundColor: buttonLateOceanTheme.
|
|
2363
|
-
borderColor: buttonLateOceanTheme.
|
|
2580
|
+
backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
|
|
2581
|
+
borderColor: buttonLateOceanTheme.disabled.borderColor
|
|
2364
2582
|
},
|
|
2365
2583
|
default: {
|
|
2366
|
-
pressedBackgroundColor: buttonLateOceanTheme.
|
|
2584
|
+
pressedBackgroundColor: buttonLateOceanTheme.default.pressedBackgroundColor
|
|
2367
2585
|
},
|
|
2368
2586
|
white: {
|
|
2369
2587
|
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
@@ -2525,7 +2743,7 @@ const breakpoints = {
|
|
|
2525
2743
|
wideBreakpoint: 'max-width: 1279px'
|
|
2526
2744
|
}
|
|
2527
2745
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2528
|
-
// TODO : seperate brand
|
|
2746
|
+
// TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
|
|
2529
2747
|
|
|
2530
2748
|
const theme = {
|
|
2531
2749
|
spacing: 4,
|
|
@@ -2788,14 +3006,19 @@ function TypographyEmoji({
|
|
|
2788
3006
|
|
|
2789
3007
|
const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/react.styled("span")({
|
|
2790
3008
|
name: "TypographyLinkWebWrapper",
|
|
2791
|
-
class: "tcwz3nt"
|
|
3009
|
+
class: "tcwz3nt",
|
|
3010
|
+
vars: {
|
|
3011
|
+
"tcwz3nt-0": [({
|
|
3012
|
+
$hasNoUnderline
|
|
3013
|
+
}) => $hasNoUnderline ? 'underline' : 'none']
|
|
3014
|
+
}
|
|
2792
3015
|
}));
|
|
2793
3016
|
const StyledLink = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Text).withConfig({
|
|
2794
3017
|
displayName: "TypographyLink__StyledLink",
|
|
2795
3018
|
componentId: "kitt-universal__sc-1o1zy30-0"
|
|
2796
3019
|
})(["text-decoration:", ";", ";", ";"], ({
|
|
2797
|
-
$
|
|
2798
|
-
}) => $
|
|
3020
|
+
$hasNoUnderline
|
|
3021
|
+
}) => $hasNoUnderline ? 'none' : 'underline', ({
|
|
2799
3022
|
$disabled
|
|
2800
3023
|
}) => {
|
|
2801
3024
|
return `
|
|
@@ -2823,10 +3046,10 @@ function TypographyLink({
|
|
|
2823
3046
|
accessibilityRole: "none",
|
|
2824
3047
|
children: /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
2825
3048
|
as: TypographyLinkWebWrapper,
|
|
2826
|
-
|
|
3049
|
+
$hasNoUnderline: noUnderline,
|
|
2827
3050
|
children: /*#__PURE__*/jsxRuntime.jsx(StyledLink, {
|
|
2828
3051
|
$disabled: disabled,
|
|
2829
|
-
$
|
|
3052
|
+
$hasNoUnderline: noUnderline,
|
|
2830
3053
|
href: href,
|
|
2831
3054
|
hrefAttrs: hrefAttrs,
|
|
2832
3055
|
accessibilityRole: "link",
|
|
@@ -2841,23 +3064,35 @@ function TypographyLink({
|
|
|
2841
3064
|
});
|
|
2842
3065
|
}
|
|
2843
3066
|
|
|
2844
|
-
function matchWindowSize(
|
|
3067
|
+
function matchWindowSize({
|
|
3068
|
+
width,
|
|
3069
|
+
height
|
|
3070
|
+
}, {
|
|
2845
3071
|
minWidth,
|
|
2846
|
-
maxWidth
|
|
3072
|
+
maxWidth,
|
|
3073
|
+
minHeight,
|
|
3074
|
+
maxHeight
|
|
2847
3075
|
}) {
|
|
2848
|
-
|
|
3076
|
+
const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3077
|
+
const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3078
|
+
return hasWidthMatched && hasHeightMatched;
|
|
2849
3079
|
}
|
|
2850
3080
|
function useMatchWindowSize(options) {
|
|
2851
3081
|
const {
|
|
2852
|
-
width
|
|
3082
|
+
width,
|
|
3083
|
+
height
|
|
2853
3084
|
} = BabelPluginStyledComponentsReactNative.useWindowDimensions();
|
|
2854
|
-
return matchWindowSize(
|
|
3085
|
+
return matchWindowSize({
|
|
3086
|
+
width,
|
|
3087
|
+
height
|
|
3088
|
+
}, options);
|
|
2855
3089
|
}
|
|
2856
3090
|
|
|
2857
|
-
|
|
3091
|
+
// eslint-disable-next-line no-restricted-imports
|
|
3092
|
+
function createWindowSizeHelper(dimensions) {
|
|
2858
3093
|
return {
|
|
2859
|
-
matchWindowSize: options => matchWindowSize(
|
|
2860
|
-
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(
|
|
3094
|
+
matchWindowSize: options => matchWindowSize(dimensions, options),
|
|
3095
|
+
ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
|
|
2861
3096
|
mapWindowWidth: (...widthList) => {
|
|
2862
3097
|
if ((process.env.NODE_ENV !== "production")) {
|
|
2863
3098
|
widthList.slice(1).forEach(([minWidth], index) => {
|
|
@@ -2869,7 +3104,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
2869
3104
|
});
|
|
2870
3105
|
}
|
|
2871
3106
|
|
|
2872
|
-
const found = widthList.find(([minWidth, value]) => matchWindowSize(
|
|
3107
|
+
const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
|
|
2873
3108
|
minWidth: Number(minWidth)
|
|
2874
3109
|
}));
|
|
2875
3110
|
if (!found) return null;
|
|
@@ -2879,16 +3114,14 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
2879
3114
|
}
|
|
2880
3115
|
|
|
2881
3116
|
function useKittTheme() {
|
|
2882
|
-
const
|
|
2883
|
-
width
|
|
2884
|
-
} = BabelPluginStyledComponentsReactNative.useWindowDimensions();
|
|
3117
|
+
const dimensions = BabelPluginStyledComponentsReactNative.useWindowDimensions();
|
|
2885
3118
|
return react$1.useMemo(() => {
|
|
2886
3119
|
return {
|
|
2887
3120
|
kitt: theme,
|
|
2888
|
-
responsive: createWindowSizeHelper(
|
|
3121
|
+
responsive: createWindowSizeHelper(dimensions),
|
|
2889
3122
|
breakpoints
|
|
2890
3123
|
};
|
|
2891
|
-
}, [
|
|
3124
|
+
}, [dimensions]);
|
|
2892
3125
|
}
|
|
2893
3126
|
|
|
2894
3127
|
function KittThemeProvider({
|