@ornikar/kitt-universal 3.6.0 → 3.7.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.web.d.ts +2 -2
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +21 -21
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/useKittTheme.d.ts +0 -2
- package/dist/definitions/useKittTheme.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 +8 -6
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.css +1 -1
- package/dist/index-browser-all.es.ios.js +8 -6
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +25 -27
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +69 -75
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.css +1 -1
- package/dist/index-node-14.17.cjs.js +8 -9
- 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 +42 -46
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
|
5
5
|
import { UserIcon, EyeIcon, EyeOffIcon, LoaderIcon, XIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon } from '@ornikar/kitt-icons';
|
|
6
6
|
export * from '@ornikar/kitt-icons';
|
|
7
7
|
import styled$1, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
8
|
-
import { cloneElement, useContext, createContext,
|
|
8
|
+
import { forwardRef, cloneElement, useContext, createContext, useMemo, useState, Fragment, Children, useEffect } from 'react';
|
|
9
9
|
import { styled } from '@linaria/react';
|
|
10
10
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
11
11
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
@@ -30,12 +30,14 @@ function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
30
30
|
// };
|
|
31
31
|
// }
|
|
32
32
|
function withTheme(WrappedComponent) {
|
|
33
|
-
|
|
33
|
+
// eslint-disable-next-line prefer-arrow-callback
|
|
34
|
+
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
35
|
var theme = /*#__PURE__*/useTheme();
|
|
35
36
|
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$h({
|
|
37
|
+
ref: ref,
|
|
36
38
|
theme: theme
|
|
37
39
|
}, props));
|
|
38
|
-
};
|
|
40
|
+
});
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
var StyledSpinningIconContainer = withTheme( /*#__PURE__*/styled("div")({
|
|
@@ -413,97 +415,93 @@ var AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/styled("div")({
|
|
|
413
415
|
var $isStretch = _ref2.$isStretch;
|
|
414
416
|
return $isStretch ? 'stretch' : 'baseline';
|
|
415
417
|
}],
|
|
416
|
-
"a1vkj3mh-
|
|
418
|
+
"a1vkj3mh-3": [function (_ref3) {
|
|
417
419
|
var theme = _ref3.theme;
|
|
418
|
-
return theme.breakpoints.min.mediumBreakpoint;
|
|
419
|
-
}],
|
|
420
|
-
"a1vkj3mh-3": [function (_ref4) {
|
|
421
|
-
var theme = _ref4.theme;
|
|
422
420
|
return theme.kitt.button.scale.medium.hover;
|
|
423
421
|
}],
|
|
424
|
-
"a1vkj3mh-4": [function (
|
|
425
|
-
var theme =
|
|
426
|
-
$isDisabled =
|
|
422
|
+
"a1vkj3mh-4": [function (_ref4) {
|
|
423
|
+
var theme = _ref4.theme,
|
|
424
|
+
$isDisabled = _ref4.$isDisabled;
|
|
427
425
|
return "scale(".concat($isDisabled ? 1 : theme.kitt.button.scale.base.active, ")");
|
|
428
426
|
}],
|
|
429
|
-
"a1vkj3mh-5": [function (
|
|
430
|
-
var theme =
|
|
431
|
-
$type =
|
|
432
|
-
$isDisabled =
|
|
427
|
+
"a1vkj3mh-5": [function (_ref5) {
|
|
428
|
+
var theme = _ref5.theme,
|
|
429
|
+
$type = _ref5.$type,
|
|
430
|
+
$isDisabled = _ref5.$isDisabled;
|
|
433
431
|
if ($isDisabled) return theme.kitt.button.disabled.hoverBackgroundColor;
|
|
434
432
|
return theme.kitt.button[$type].hoverBackgroundColor;
|
|
435
433
|
}],
|
|
436
|
-
"a1vkj3mh-6": [function (
|
|
437
|
-
var theme =
|
|
434
|
+
"a1vkj3mh-6": [function (_ref6) {
|
|
435
|
+
var theme = _ref6.theme;
|
|
438
436
|
var _theme$kitt$button$tr = theme.kitt.button.transition,
|
|
439
437
|
duration = _theme$kitt$button$tr.duration,
|
|
440
438
|
timingFunction = _theme$kitt$button$tr.timingFunction;
|
|
441
439
|
return "color, background, border-color, ".concat(duration, " ").concat(timingFunction);
|
|
442
440
|
}],
|
|
443
|
-
"a1vkj3mh-7": [function (
|
|
444
|
-
var theme =
|
|
441
|
+
"a1vkj3mh-7": [function (_ref7) {
|
|
442
|
+
var theme = _ref7.theme;
|
|
445
443
|
return theme.kitt.button.borderRadius;
|
|
446
444
|
}],
|
|
447
|
-
"a1vkj3mh-8": [function (
|
|
448
|
-
var theme =
|
|
445
|
+
"a1vkj3mh-8": [function (_ref8) {
|
|
446
|
+
var theme = _ref8.theme;
|
|
449
447
|
return "opacity ".concat(theme.kitt.button.transition.duration, " ").concat(theme.kitt.button.transition.timingFunction);
|
|
450
448
|
}],
|
|
451
|
-
"a1vkj3mh-9": [function (
|
|
452
|
-
var $isDisabled =
|
|
449
|
+
"a1vkj3mh-9": [function (_ref9) {
|
|
450
|
+
var $isDisabled = _ref9.$isDisabled;
|
|
453
451
|
return $isDisabled ? 1 : 0;
|
|
454
452
|
}],
|
|
455
|
-
"a1vkj3mh-10": [function (
|
|
456
|
-
var theme =
|
|
453
|
+
"a1vkj3mh-10": [function (_ref10) {
|
|
454
|
+
var theme = _ref10.theme;
|
|
457
455
|
return "-".concat(theme.kitt.button.borderWidth.disabled);
|
|
458
456
|
}],
|
|
459
|
-
"a1vkj3mh-12": [function (
|
|
460
|
-
var theme =
|
|
457
|
+
"a1vkj3mh-12": [function (_ref11) {
|
|
458
|
+
var theme = _ref11.theme;
|
|
461
459
|
return "calc(100% - ".concat(parseInt(theme.kitt.button.borderWidth.disabled, 10) * 0.5, "px)");
|
|
462
460
|
}],
|
|
463
|
-
"a1vkj3mh-14": [function (
|
|
464
|
-
var theme =
|
|
461
|
+
"a1vkj3mh-14": [function (_ref12) {
|
|
462
|
+
var theme = _ref12.theme;
|
|
465
463
|
return "".concat(theme.kitt.button.disabled.borderColor, " solid ").concat(theme.kitt.button.borderWidth.disabled);
|
|
466
464
|
}],
|
|
467
|
-
"a1vkj3mh-15": [function (
|
|
468
|
-
var theme =
|
|
469
|
-
$type =
|
|
465
|
+
"a1vkj3mh-15": [function (_ref13) {
|
|
466
|
+
var theme = _ref13.theme,
|
|
467
|
+
$type = _ref13.$type;
|
|
470
468
|
return "".concat(theme.kitt.button.borderWidth.focus, " solid ").concat(theme.kitt.button[$type].focusBorderColor);
|
|
471
469
|
}],
|
|
472
|
-
"a1vkj3mh-16": [function (
|
|
473
|
-
var theme =
|
|
470
|
+
"a1vkj3mh-16": [function (_ref14) {
|
|
471
|
+
var theme = _ref14.theme;
|
|
474
472
|
return "-".concat(theme.kitt.button.borderWidth.focus);
|
|
475
473
|
}],
|
|
476
|
-
"a1vkj3mh-18": [function (
|
|
474
|
+
"a1vkj3mh-18": [function (_ref15) {
|
|
475
|
+
var theme = _ref15.theme,
|
|
476
|
+
$type = _ref15.$type,
|
|
477
|
+
$isDisabled = _ref15.$isDisabled;
|
|
478
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
479
|
+
if (!isSubtle($type)) return 'inherit';
|
|
480
|
+
return theme.kitt.button[$type].color;
|
|
481
|
+
}],
|
|
482
|
+
"a1vkj3mh-19": [function (_ref16) {
|
|
477
483
|
var theme = _ref16.theme,
|
|
478
484
|
$type = _ref16.$type,
|
|
479
485
|
$isDisabled = _ref16.$isDisabled;
|
|
480
486
|
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
481
487
|
if (!isSubtle($type)) return 'inherit';
|
|
482
|
-
return theme.kitt.button[$type].
|
|
488
|
+
return theme.kitt.button[$type].hoverColor;
|
|
483
489
|
}],
|
|
484
|
-
"a1vkj3mh-
|
|
490
|
+
"a1vkj3mh-20": [function (_ref17) {
|
|
485
491
|
var theme = _ref17.theme,
|
|
486
492
|
$type = _ref17.$type,
|
|
487
493
|
$isDisabled = _ref17.$isDisabled;
|
|
488
494
|
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
489
495
|
if (!isSubtle($type)) return 'inherit';
|
|
490
|
-
return theme.kitt.button[$type].hoverColor;
|
|
491
|
-
}],
|
|
492
|
-
"a1vkj3mh-20": [function (_ref18) {
|
|
493
|
-
var theme = _ref18.theme,
|
|
494
|
-
$type = _ref18.$type,
|
|
495
|
-
$isDisabled = _ref18.$isDisabled;
|
|
496
|
-
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
497
|
-
if (!isSubtle($type)) return 'inherit';
|
|
498
496
|
return theme.kitt.button[$type].activeColor;
|
|
499
497
|
}]
|
|
500
498
|
}
|
|
501
499
|
}));
|
|
502
|
-
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (
|
|
503
|
-
var $type =
|
|
504
|
-
$isStretch =
|
|
505
|
-
disabled =
|
|
506
|
-
props = _objectWithoutProperties(
|
|
500
|
+
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref18, ref) {
|
|
501
|
+
var $type = _ref18.$type,
|
|
502
|
+
$isStretch = _ref18.$isStretch,
|
|
503
|
+
disabled = _ref18.disabled,
|
|
504
|
+
props = _objectWithoutProperties(_ref18, _excluded$c);
|
|
507
505
|
|
|
508
506
|
return /*#__PURE__*/jsx(AnimatedButtonPressableContainer, {
|
|
509
507
|
ref: ref,
|
|
@@ -1464,21 +1462,17 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled("div")({
|
|
|
1464
1462
|
var theme = _ref.theme;
|
|
1465
1463
|
return theme.kitt.iconButton.scale.base.hover;
|
|
1466
1464
|
}],
|
|
1467
|
-
"p1nlccvg-
|
|
1465
|
+
"p1nlccvg-2": [function (_ref2) {
|
|
1468
1466
|
var theme = _ref2.theme;
|
|
1469
|
-
return theme.breakpoints.min.mediumBreakpoint;
|
|
1470
|
-
}],
|
|
1471
|
-
"p1nlccvg-2": [function (_ref3) {
|
|
1472
|
-
var theme = _ref3.theme;
|
|
1473
1467
|
return theme.kitt.iconButton.scale.medium.hover;
|
|
1474
1468
|
}],
|
|
1475
|
-
"p1nlccvg-3": [function (
|
|
1476
|
-
var theme =
|
|
1469
|
+
"p1nlccvg-3": [function (_ref3) {
|
|
1470
|
+
var theme = _ref3.theme;
|
|
1477
1471
|
return theme.kitt.iconButton.scale.base.active;
|
|
1478
1472
|
}],
|
|
1479
|
-
"p1nlccvg-4": [function (
|
|
1480
|
-
var theme =
|
|
1481
|
-
$isWhite =
|
|
1473
|
+
"p1nlccvg-4": [function (_ref4) {
|
|
1474
|
+
var theme = _ref4.theme,
|
|
1475
|
+
$isWhite = _ref4.$isWhite;
|
|
1482
1476
|
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
1483
1477
|
white = _theme$kitt$iconButto.white,
|
|
1484
1478
|
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
@@ -1490,18 +1484,18 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled("div")({
|
|
|
1490
1484
|
var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
1491
1485
|
displayName: "PressableIconButton__StyledPressableIconButton",
|
|
1492
1486
|
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1493
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (
|
|
1494
|
-
var theme =
|
|
1487
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref5) {
|
|
1488
|
+
var theme = _ref5.theme;
|
|
1495
1489
|
return theme.kitt.iconButton.borderRadius;
|
|
1490
|
+
}, function (_ref6) {
|
|
1491
|
+
var theme = _ref6.theme;
|
|
1492
|
+
return theme.kitt.iconButton.width;
|
|
1496
1493
|
}, function (_ref7) {
|
|
1497
1494
|
var theme = _ref7.theme;
|
|
1498
|
-
return theme.kitt.iconButton.width;
|
|
1499
|
-
}, function (_ref8) {
|
|
1500
|
-
var theme = _ref8.theme;
|
|
1501
1495
|
return theme.kitt.iconButton.height;
|
|
1502
|
-
}, function (
|
|
1503
|
-
var theme =
|
|
1504
|
-
disabled =
|
|
1496
|
+
}, function (_ref8) {
|
|
1497
|
+
var theme = _ref8.theme,
|
|
1498
|
+
disabled = _ref8.disabled;
|
|
1505
1499
|
var iconButton = theme.kitt.iconButton;
|
|
1506
1500
|
var transition = iconButton.transition;
|
|
1507
1501
|
|
|
@@ -1511,9 +1505,9 @@ var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
|
1511
1505
|
|
|
1512
1506
|
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1513
1507
|
});
|
|
1514
|
-
function PressableIconButton(
|
|
1515
|
-
var color =
|
|
1516
|
-
props = _objectWithoutProperties(
|
|
1508
|
+
function PressableIconButton(_ref9) {
|
|
1509
|
+
var color = _ref9.color,
|
|
1510
|
+
props = _objectWithoutProperties(_ref9, _excluded$6);
|
|
1517
1511
|
|
|
1518
1512
|
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1519
1513
|
as: PressableIconButtonWebWrapper,
|
|
@@ -3030,7 +3024,7 @@ var breakpoints = {
|
|
|
3030
3024
|
wideBreakpoint: 'max-width: 1279px'
|
|
3031
3025
|
}
|
|
3032
3026
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3033
|
-
// TODO : seperate brand
|
|
3027
|
+
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
3034
3028
|
|
|
3035
3029
|
var theme = {
|
|
3036
3030
|
spacing: 4,
|
|
@@ -3050,7 +3044,8 @@ var theme = {
|
|
|
3050
3044
|
iconButton: iconButton,
|
|
3051
3045
|
listItem: listItemLateOceanTheme,
|
|
3052
3046
|
tooltip: tooltip,
|
|
3053
|
-
skeleton: skeletonTheme
|
|
3047
|
+
skeleton: skeletonTheme,
|
|
3048
|
+
breakpoints: breakpoints
|
|
3054
3049
|
};
|
|
3055
3050
|
|
|
3056
3051
|
function TimePicker() {
|
|
@@ -3438,8 +3433,7 @@ function useKittTheme() {
|
|
|
3438
3433
|
return useMemo(function () {
|
|
3439
3434
|
return {
|
|
3440
3435
|
kitt: theme,
|
|
3441
|
-
responsive: createWindowSizeHelper(dimensions)
|
|
3442
|
-
breakpoints: breakpoints
|
|
3436
|
+
responsive: createWindowSizeHelper(dimensions)
|
|
3443
3437
|
};
|
|
3444
3438
|
}, [dimensions]);
|
|
3445
3439
|
}
|