@ornikar/kitt-universal 3.4.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definitions/Avatar/Avatar.d.ts +9 -4
- package/dist/definitions/Avatar/Avatar.d.ts.map +1 -1
- 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/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 +5 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +23 -31
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/avatarLateOceanTheme.d.ts +9 -10
- package/dist/definitions/themes/late-ocean/avatarLateOceanTheme.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/useKittTheme.d.ts +0 -2
- package/dist/definitions/useKittTheme.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/withTheme.d.ts +2 -2
- package/dist/definitions/utils/withTheme.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +296 -129
- 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 +296 -129
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +228 -87
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +226 -124
- 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 +199 -59
- 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 +186 -84
- 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 +6 -5
- package/tsconfig.eslint.json +6 -0
|
@@ -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")({
|
|
@@ -302,46 +304,45 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
302
304
|
|
|
303
305
|
Typography.h5 = createHeading(5, 'header5');
|
|
304
306
|
|
|
305
|
-
var _excluded$d = ["size"];
|
|
307
|
+
var _excluded$d = ["size", "base", "round", "light"];
|
|
306
308
|
|
|
307
309
|
function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
308
310
|
|
|
309
311
|
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
310
312
|
|
|
311
|
-
var getFirstCharacter = function (string) {
|
|
312
|
-
return string ? string[0] : '';
|
|
313
|
-
};
|
|
314
|
-
|
|
315
313
|
var getInitials = function (firstname, lastname) {
|
|
316
|
-
return (
|
|
314
|
+
return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
|
|
317
315
|
};
|
|
318
316
|
|
|
319
317
|
var StyledAvatarView = /*#__PURE__*/styled$1(View).withConfig({
|
|
320
318
|
displayName: "Avatar__StyledAvatarView",
|
|
321
319
|
componentId: "kitt-universal__sc-9miubv-0"
|
|
322
|
-
})(["border-radius:", "
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
321
|
+
var theme = _ref.theme,
|
|
322
|
+
$isRound = _ref.$isRound,
|
|
323
|
+
$size = _ref.$size;
|
|
324
|
+
if ($isRound) return "".concat($size / 2, "px");
|
|
325
|
+
return theme.kitt.avatar.borderRadius;
|
|
326
326
|
}, function (_ref2) {
|
|
327
327
|
var theme = _ref2.theme,
|
|
328
|
-
|
|
329
|
-
return
|
|
328
|
+
$isLight = _ref2.$isLight;
|
|
329
|
+
return $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
|
|
330
330
|
}, function (_ref3) {
|
|
331
|
-
var size = _ref3
|
|
332
|
-
return size;
|
|
331
|
+
var $size = _ref3.$size;
|
|
332
|
+
return $size;
|
|
333
333
|
}, function (_ref4) {
|
|
334
|
-
var size = _ref4
|
|
335
|
-
return size;
|
|
334
|
+
var $size = _ref4.$size;
|
|
335
|
+
return $size;
|
|
336
336
|
});
|
|
337
337
|
|
|
338
338
|
function AvatarContent(_ref5) {
|
|
339
|
-
var
|
|
340
|
-
size = _ref5$size === void 0 ? 40 : _ref5$size,
|
|
339
|
+
var size = _ref5.size,
|
|
341
340
|
src = _ref5.src,
|
|
342
341
|
firstname = _ref5.firstname,
|
|
343
342
|
lastname = _ref5.lastname,
|
|
344
|
-
|
|
343
|
+
alt = _ref5.alt,
|
|
344
|
+
base = _ref5.base,
|
|
345
|
+
isLight = _ref5.isLight;
|
|
345
346
|
|
|
346
347
|
if (src) {
|
|
347
348
|
return /*#__PURE__*/jsx(Image, {
|
|
@@ -351,22 +352,23 @@ function AvatarContent(_ref5) {
|
|
|
351
352
|
style: {
|
|
352
353
|
width: size,
|
|
353
354
|
height: size
|
|
354
|
-
}
|
|
355
|
+
},
|
|
356
|
+
accessibilityLabel: alt
|
|
355
357
|
});
|
|
356
358
|
}
|
|
357
359
|
|
|
358
360
|
if (firstname && lastname) {
|
|
359
361
|
return /*#__PURE__*/jsx(Typography.Text, {
|
|
360
|
-
base:
|
|
362
|
+
base: base,
|
|
361
363
|
variant: "bold",
|
|
362
|
-
color:
|
|
364
|
+
color: isLight ? 'black' : 'white',
|
|
363
365
|
children: getInitials(firstname, lastname)
|
|
364
366
|
});
|
|
365
367
|
}
|
|
366
368
|
|
|
367
369
|
return /*#__PURE__*/jsx(Icon, {
|
|
368
370
|
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
369
|
-
color:
|
|
371
|
+
color: isLight ? 'black' : 'white',
|
|
370
372
|
size: size / 2
|
|
371
373
|
});
|
|
372
374
|
}
|
|
@@ -374,14 +376,22 @@ function AvatarContent(_ref5) {
|
|
|
374
376
|
function Avatar(_ref6) {
|
|
375
377
|
var _ref6$size = _ref6.size,
|
|
376
378
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
379
|
+
_ref6$base = _ref6.base,
|
|
380
|
+
base = _ref6$base === void 0 ? 'body-small' : _ref6$base,
|
|
381
|
+
round = _ref6.round,
|
|
382
|
+
light = _ref6.light,
|
|
383
|
+
props = _objectWithoutProperties(_ref6, _excluded$d);
|
|
384
|
+
|
|
385
|
+
return /*#__PURE__*/jsx(StyledAvatarView, {
|
|
386
|
+
$size: size,
|
|
387
|
+
$isRound: round,
|
|
388
|
+
$isLight: light,
|
|
389
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$f({
|
|
390
|
+
size: size,
|
|
391
|
+
base: base,
|
|
392
|
+
isLight: light
|
|
393
|
+
}, props))
|
|
394
|
+
});
|
|
385
395
|
}
|
|
386
396
|
|
|
387
397
|
function isSubtle(type) {
|
|
@@ -405,97 +415,93 @@ var AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/styled("div")({
|
|
|
405
415
|
var $isStretch = _ref2.$isStretch;
|
|
406
416
|
return $isStretch ? 'stretch' : 'baseline';
|
|
407
417
|
}],
|
|
408
|
-
"a1vkj3mh-
|
|
418
|
+
"a1vkj3mh-3": [function (_ref3) {
|
|
409
419
|
var theme = _ref3.theme;
|
|
410
|
-
return theme.breakpoints.min.mediumBreakpoint;
|
|
411
|
-
}],
|
|
412
|
-
"a1vkj3mh-3": [function (_ref4) {
|
|
413
|
-
var theme = _ref4.theme;
|
|
414
420
|
return theme.kitt.button.scale.medium.hover;
|
|
415
421
|
}],
|
|
416
|
-
"a1vkj3mh-4": [function (
|
|
417
|
-
var theme =
|
|
418
|
-
$isDisabled =
|
|
422
|
+
"a1vkj3mh-4": [function (_ref4) {
|
|
423
|
+
var theme = _ref4.theme,
|
|
424
|
+
$isDisabled = _ref4.$isDisabled;
|
|
419
425
|
return "scale(".concat($isDisabled ? 1 : theme.kitt.button.scale.base.active, ")");
|
|
420
426
|
}],
|
|
421
|
-
"a1vkj3mh-5": [function (
|
|
422
|
-
var theme =
|
|
423
|
-
$type =
|
|
424
|
-
$isDisabled =
|
|
427
|
+
"a1vkj3mh-5": [function (_ref5) {
|
|
428
|
+
var theme = _ref5.theme,
|
|
429
|
+
$type = _ref5.$type,
|
|
430
|
+
$isDisabled = _ref5.$isDisabled;
|
|
425
431
|
if ($isDisabled) return theme.kitt.button.disabled.hoverBackgroundColor;
|
|
426
432
|
return theme.kitt.button[$type].hoverBackgroundColor;
|
|
427
433
|
}],
|
|
428
|
-
"a1vkj3mh-6": [function (
|
|
429
|
-
var theme =
|
|
434
|
+
"a1vkj3mh-6": [function (_ref6) {
|
|
435
|
+
var theme = _ref6.theme;
|
|
430
436
|
var _theme$kitt$button$tr = theme.kitt.button.transition,
|
|
431
437
|
duration = _theme$kitt$button$tr.duration,
|
|
432
438
|
timingFunction = _theme$kitt$button$tr.timingFunction;
|
|
433
439
|
return "color, background, border-color, ".concat(duration, " ").concat(timingFunction);
|
|
434
440
|
}],
|
|
435
|
-
"a1vkj3mh-7": [function (
|
|
436
|
-
var theme =
|
|
441
|
+
"a1vkj3mh-7": [function (_ref7) {
|
|
442
|
+
var theme = _ref7.theme;
|
|
437
443
|
return theme.kitt.button.borderRadius;
|
|
438
444
|
}],
|
|
439
|
-
"a1vkj3mh-8": [function (
|
|
440
|
-
var theme =
|
|
445
|
+
"a1vkj3mh-8": [function (_ref8) {
|
|
446
|
+
var theme = _ref8.theme;
|
|
441
447
|
return "opacity ".concat(theme.kitt.button.transition.duration, " ").concat(theme.kitt.button.transition.timingFunction);
|
|
442
448
|
}],
|
|
443
|
-
"a1vkj3mh-9": [function (
|
|
444
|
-
var $isDisabled =
|
|
449
|
+
"a1vkj3mh-9": [function (_ref9) {
|
|
450
|
+
var $isDisabled = _ref9.$isDisabled;
|
|
445
451
|
return $isDisabled ? 1 : 0;
|
|
446
452
|
}],
|
|
447
|
-
"a1vkj3mh-10": [function (
|
|
448
|
-
var theme =
|
|
453
|
+
"a1vkj3mh-10": [function (_ref10) {
|
|
454
|
+
var theme = _ref10.theme;
|
|
449
455
|
return "-".concat(theme.kitt.button.borderWidth.disabled);
|
|
450
456
|
}],
|
|
451
|
-
"a1vkj3mh-12": [function (
|
|
452
|
-
var theme =
|
|
457
|
+
"a1vkj3mh-12": [function (_ref11) {
|
|
458
|
+
var theme = _ref11.theme;
|
|
453
459
|
return "calc(100% - ".concat(parseInt(theme.kitt.button.borderWidth.disabled, 10) * 0.5, "px)");
|
|
454
460
|
}],
|
|
455
|
-
"a1vkj3mh-14": [function (
|
|
456
|
-
var theme =
|
|
461
|
+
"a1vkj3mh-14": [function (_ref12) {
|
|
462
|
+
var theme = _ref12.theme;
|
|
457
463
|
return "".concat(theme.kitt.button.disabled.borderColor, " solid ").concat(theme.kitt.button.borderWidth.disabled);
|
|
458
464
|
}],
|
|
459
|
-
"a1vkj3mh-15": [function (
|
|
460
|
-
var theme =
|
|
461
|
-
$type =
|
|
465
|
+
"a1vkj3mh-15": [function (_ref13) {
|
|
466
|
+
var theme = _ref13.theme,
|
|
467
|
+
$type = _ref13.$type;
|
|
462
468
|
return "".concat(theme.kitt.button.borderWidth.focus, " solid ").concat(theme.kitt.button[$type].focusBorderColor);
|
|
463
469
|
}],
|
|
464
|
-
"a1vkj3mh-16": [function (
|
|
465
|
-
var theme =
|
|
470
|
+
"a1vkj3mh-16": [function (_ref14) {
|
|
471
|
+
var theme = _ref14.theme;
|
|
466
472
|
return "-".concat(theme.kitt.button.borderWidth.focus);
|
|
467
473
|
}],
|
|
468
|
-
"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) {
|
|
469
483
|
var theme = _ref16.theme,
|
|
470
484
|
$type = _ref16.$type,
|
|
471
485
|
$isDisabled = _ref16.$isDisabled;
|
|
472
486
|
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
473
487
|
if (!isSubtle($type)) return 'inherit';
|
|
474
|
-
return theme.kitt.button[$type].
|
|
488
|
+
return theme.kitt.button[$type].hoverColor;
|
|
475
489
|
}],
|
|
476
|
-
"a1vkj3mh-
|
|
490
|
+
"a1vkj3mh-20": [function (_ref17) {
|
|
477
491
|
var theme = _ref17.theme,
|
|
478
492
|
$type = _ref17.$type,
|
|
479
493
|
$isDisabled = _ref17.$isDisabled;
|
|
480
494
|
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
481
495
|
if (!isSubtle($type)) return 'inherit';
|
|
482
|
-
return theme.kitt.button[$type].hoverColor;
|
|
483
|
-
}],
|
|
484
|
-
"a1vkj3mh-20": [function (_ref18) {
|
|
485
|
-
var theme = _ref18.theme,
|
|
486
|
-
$type = _ref18.$type,
|
|
487
|
-
$isDisabled = _ref18.$isDisabled;
|
|
488
|
-
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
489
|
-
if (!isSubtle($type)) return 'inherit';
|
|
490
496
|
return theme.kitt.button[$type].activeColor;
|
|
491
497
|
}]
|
|
492
498
|
}
|
|
493
499
|
}));
|
|
494
|
-
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (
|
|
495
|
-
var $type =
|
|
496
|
-
$isStretch =
|
|
497
|
-
disabled =
|
|
498
|
-
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);
|
|
499
505
|
|
|
500
506
|
return /*#__PURE__*/jsx(AnimatedButtonPressableContainer, {
|
|
501
507
|
ref: ref,
|
|
@@ -1256,7 +1262,8 @@ function TextArea(_ref) {
|
|
|
1256
1262
|
|
|
1257
1263
|
var theme = /*#__PURE__*/useTheme();
|
|
1258
1264
|
return /*#__PURE__*/jsx(InputText, _objectSpread$9(_objectSpread$9({
|
|
1259
|
-
multiline: true
|
|
1265
|
+
multiline: true,
|
|
1266
|
+
textAlignVertical: "top"
|
|
1260
1267
|
}, props), {}, {
|
|
1261
1268
|
type: "text",
|
|
1262
1269
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
@@ -1455,21 +1462,17 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled("div")({
|
|
|
1455
1462
|
var theme = _ref.theme;
|
|
1456
1463
|
return theme.kitt.iconButton.scale.base.hover;
|
|
1457
1464
|
}],
|
|
1458
|
-
"p1nlccvg-
|
|
1465
|
+
"p1nlccvg-2": [function (_ref2) {
|
|
1459
1466
|
var theme = _ref2.theme;
|
|
1460
|
-
return theme.breakpoints.min.mediumBreakpoint;
|
|
1461
|
-
}],
|
|
1462
|
-
"p1nlccvg-2": [function (_ref3) {
|
|
1463
|
-
var theme = _ref3.theme;
|
|
1464
1467
|
return theme.kitt.iconButton.scale.medium.hover;
|
|
1465
1468
|
}],
|
|
1466
|
-
"p1nlccvg-3": [function (
|
|
1467
|
-
var theme =
|
|
1469
|
+
"p1nlccvg-3": [function (_ref3) {
|
|
1470
|
+
var theme = _ref3.theme;
|
|
1468
1471
|
return theme.kitt.iconButton.scale.base.active;
|
|
1469
1472
|
}],
|
|
1470
|
-
"p1nlccvg-4": [function (
|
|
1471
|
-
var theme =
|
|
1472
|
-
$isWhite =
|
|
1473
|
+
"p1nlccvg-4": [function (_ref4) {
|
|
1474
|
+
var theme = _ref4.theme,
|
|
1475
|
+
$isWhite = _ref4.$isWhite;
|
|
1473
1476
|
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
1474
1477
|
white = _theme$kitt$iconButto.white,
|
|
1475
1478
|
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
@@ -1481,18 +1484,18 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled("div")({
|
|
|
1481
1484
|
var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
1482
1485
|
displayName: "PressableIconButton__StyledPressableIconButton",
|
|
1483
1486
|
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1484
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (
|
|
1485
|
-
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;
|
|
1486
1489
|
return theme.kitt.iconButton.borderRadius;
|
|
1490
|
+
}, function (_ref6) {
|
|
1491
|
+
var theme = _ref6.theme;
|
|
1492
|
+
return theme.kitt.iconButton.width;
|
|
1487
1493
|
}, function (_ref7) {
|
|
1488
1494
|
var theme = _ref7.theme;
|
|
1489
|
-
return theme.kitt.iconButton.width;
|
|
1490
|
-
}, function (_ref8) {
|
|
1491
|
-
var theme = _ref8.theme;
|
|
1492
1495
|
return theme.kitt.iconButton.height;
|
|
1493
|
-
}, function (
|
|
1494
|
-
var theme =
|
|
1495
|
-
disabled =
|
|
1496
|
+
}, function (_ref8) {
|
|
1497
|
+
var theme = _ref8.theme,
|
|
1498
|
+
disabled = _ref8.disabled;
|
|
1496
1499
|
var iconButton = theme.kitt.iconButton;
|
|
1497
1500
|
var transition = iconButton.transition;
|
|
1498
1501
|
|
|
@@ -1502,9 +1505,9 @@ var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
|
1502
1505
|
|
|
1503
1506
|
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1504
1507
|
});
|
|
1505
|
-
function PressableIconButton(
|
|
1506
|
-
var color =
|
|
1507
|
-
props = _objectWithoutProperties(
|
|
1508
|
+
function PressableIconButton(_ref9) {
|
|
1509
|
+
var color = _ref9.color,
|
|
1510
|
+
props = _objectWithoutProperties(_ref9, _excluded$6);
|
|
1508
1511
|
|
|
1509
1512
|
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1510
1513
|
as: PressableIconButtonWebWrapper,
|
|
@@ -2081,6 +2084,93 @@ function Notification(_ref) {
|
|
|
2081
2084
|
});
|
|
2082
2085
|
}
|
|
2083
2086
|
|
|
2087
|
+
var StyledSkeleton = withTheme( /*#__PURE__*/styled("div")({
|
|
2088
|
+
name: "StyledSkeleton",
|
|
2089
|
+
"class": "sc3upcl",
|
|
2090
|
+
vars: {
|
|
2091
|
+
"sc3upcl-0": [function (_ref) {
|
|
2092
|
+
var theme = _ref.theme;
|
|
2093
|
+
return theme.kitt.skeleton.backgroundColor;
|
|
2094
|
+
}],
|
|
2095
|
+
"sc3upcl-1": [function (_ref2) {
|
|
2096
|
+
var $isLoading = _ref2.$isLoading,
|
|
2097
|
+
theme = _ref2.theme;
|
|
2098
|
+
return $isLoading ? "linear-gradient(\n -90deg,\n ".concat(theme.kitt.skeleton.backgroundColor, ",\n ").concat(theme.kitt.skeleton.flareColor, " 50%,\n ").concat(theme.kitt.skeleton.backgroundColor, " 100%\n )") : 'none';
|
|
2099
|
+
}],
|
|
2100
|
+
"sc3upcl-2": [function (_ref3) {
|
|
2101
|
+
var $isLoading = _ref3.$isLoading;
|
|
2102
|
+
return $isLoading ? '1s ease-in-out infinite' : 'none';
|
|
2103
|
+
}]
|
|
2104
|
+
}
|
|
2105
|
+
}));
|
|
2106
|
+
function SkeletonContent(_ref4) {
|
|
2107
|
+
var isLoading = _ref4.isLoading;
|
|
2108
|
+
return /*#__PURE__*/jsx(StyledSkeleton, {
|
|
2109
|
+
$isLoading: isLoading
|
|
2110
|
+
});
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
function Skeleton(_ref) {
|
|
2114
|
+
var isLoading = _ref.isLoading,
|
|
2115
|
+
style = _ref.style;
|
|
2116
|
+
|
|
2117
|
+
var _useState = useState(0),
|
|
2118
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2119
|
+
width = _useState2[0],
|
|
2120
|
+
setWidth = _useState2[1];
|
|
2121
|
+
|
|
2122
|
+
return /*#__PURE__*/jsx(View, {
|
|
2123
|
+
style: style,
|
|
2124
|
+
onLayout: function onLayout(_ref2) {
|
|
2125
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
2126
|
+
return setWidth(nativeEvent.layout.width);
|
|
2127
|
+
},
|
|
2128
|
+
children: /*#__PURE__*/jsx(SkeletonContent, {
|
|
2129
|
+
isLoading: isLoading,
|
|
2130
|
+
width: width
|
|
2131
|
+
})
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
var Bar = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2135
|
+
displayName: "Skeleton__Bar",
|
|
2136
|
+
componentId: "kitt-universal__sc-1w5cm3i-0"
|
|
2137
|
+
})(["width:100%;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref3) {
|
|
2138
|
+
var theme = _ref3.theme;
|
|
2139
|
+
return theme.kitt.spacing * 2;
|
|
2140
|
+
}, function (_ref4) {
|
|
2141
|
+
var theme = _ref4.theme;
|
|
2142
|
+
return theme.kitt.spacing * 2;
|
|
2143
|
+
});
|
|
2144
|
+
var Circle = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2145
|
+
displayName: "Skeleton__Circle",
|
|
2146
|
+
componentId: "kitt-universal__sc-1w5cm3i-1"
|
|
2147
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref5) {
|
|
2148
|
+
var theme = _ref5.theme;
|
|
2149
|
+
return theme.kitt.spacing * 12;
|
|
2150
|
+
}, function (_ref6) {
|
|
2151
|
+
var theme = _ref6.theme;
|
|
2152
|
+
return theme.kitt.spacing * 12;
|
|
2153
|
+
}, function (_ref7) {
|
|
2154
|
+
var theme = _ref7.theme;
|
|
2155
|
+
return theme.kitt.spacing * 6;
|
|
2156
|
+
});
|
|
2157
|
+
var Square = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2158
|
+
displayName: "Skeleton__Square",
|
|
2159
|
+
componentId: "kitt-universal__sc-1w5cm3i-2"
|
|
2160
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref8) {
|
|
2161
|
+
var theme = _ref8.theme;
|
|
2162
|
+
return theme.kitt.spacing * 12;
|
|
2163
|
+
}, function (_ref9) {
|
|
2164
|
+
var theme = _ref9.theme;
|
|
2165
|
+
return theme.kitt.spacing * 12;
|
|
2166
|
+
}, function (_ref10) {
|
|
2167
|
+
var theme = _ref10.theme;
|
|
2168
|
+
return theme.kitt.spacing * 1.5;
|
|
2169
|
+
});
|
|
2170
|
+
Skeleton.Bar = Bar;
|
|
2171
|
+
Skeleton.Circle = Circle;
|
|
2172
|
+
Skeleton.Square = Square;
|
|
2173
|
+
|
|
2084
2174
|
var Flex = /*#__PURE__*/styled$1(View).withConfig({
|
|
2085
2175
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
2086
2176
|
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
@@ -2524,17 +2614,6 @@ var lateOceanColorPalette = {
|
|
|
2524
2614
|
moonPurpleLight1: '#EDEBFC'
|
|
2525
2615
|
};
|
|
2526
2616
|
|
|
2527
|
-
var avatarLateOceanTheme = {
|
|
2528
|
-
"default": {
|
|
2529
|
-
color: lateOceanColorPalette.white,
|
|
2530
|
-
backgroundColor: lateOceanColorPalette.lateOcean
|
|
2531
|
-
},
|
|
2532
|
-
light: {
|
|
2533
|
-
color: lateOceanColorPalette.black1000,
|
|
2534
|
-
backgroundColor: lateOceanColorPalette.black100
|
|
2535
|
-
}
|
|
2536
|
-
};
|
|
2537
|
-
|
|
2538
2617
|
var colorsLateOceanTheme = {
|
|
2539
2618
|
primary: lateOceanColorPalette.lateOcean,
|
|
2540
2619
|
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
@@ -2557,6 +2636,16 @@ var colorsLateOceanTheme = {
|
|
|
2557
2636
|
}
|
|
2558
2637
|
};
|
|
2559
2638
|
|
|
2639
|
+
var avatar = {
|
|
2640
|
+
borderRadius: '10px',
|
|
2641
|
+
"default": {
|
|
2642
|
+
backgroundColor: colorsLateOceanTheme.primary
|
|
2643
|
+
},
|
|
2644
|
+
light: {
|
|
2645
|
+
backgroundColor: lateOceanColorPalette.black100
|
|
2646
|
+
}
|
|
2647
|
+
};
|
|
2648
|
+
|
|
2560
2649
|
var buttonLateOceanTheme = {
|
|
2561
2650
|
borderRadius: '30px',
|
|
2562
2651
|
borderWidth: {
|
|
@@ -2783,6 +2872,12 @@ var shadowsLateOceanTheme = {
|
|
|
2783
2872
|
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
2784
2873
|
};
|
|
2785
2874
|
|
|
2875
|
+
var skeletonTheme = {
|
|
2876
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
2877
|
+
flareColor: lateOceanColorPalette.black200,
|
|
2878
|
+
animationDuration: 1000
|
|
2879
|
+
};
|
|
2880
|
+
|
|
2786
2881
|
var tagLateOceanTheme = {
|
|
2787
2882
|
borderRadius: '10px',
|
|
2788
2883
|
padding: '2px 12px',
|
|
@@ -2836,20 +2931,18 @@ var tooltip = {
|
|
|
2836
2931
|
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
2837
2932
|
return Math.round(fontSize * lineHeightMultiplier);
|
|
2838
2933
|
};
|
|
2839
|
-
|
|
2840
2934
|
var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
|
|
2841
2935
|
return {
|
|
2842
2936
|
baseAndSmall: {
|
|
2843
2937
|
fontSize: "".concat(baseAndSmallFontSize, "px"),
|
|
2844
|
-
lineHeight: "".concat(calcLineHeight(
|
|
2938
|
+
lineHeight: "".concat(calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier), "px")
|
|
2845
2939
|
},
|
|
2846
2940
|
mediumAndWide: {
|
|
2847
2941
|
fontSize: "".concat(mediumAndWideFontSize, "px"),
|
|
2848
|
-
lineHeight: "".concat(calcLineHeight(
|
|
2942
|
+
lineHeight: "".concat(calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier), "px")
|
|
2849
2943
|
}
|
|
2850
2944
|
};
|
|
2851
2945
|
};
|
|
2852
|
-
|
|
2853
2946
|
var typographyLateOceanTheme = {
|
|
2854
2947
|
colors: {
|
|
2855
2948
|
black: lateOceanColorPalette.black1000,
|
|
@@ -2931,7 +3024,7 @@ var breakpoints = {
|
|
|
2931
3024
|
wideBreakpoint: 'max-width: 1279px'
|
|
2932
3025
|
}
|
|
2933
3026
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2934
|
-
// TODO : seperate brand
|
|
3027
|
+
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
2935
3028
|
|
|
2936
3029
|
var theme = {
|
|
2937
3030
|
spacing: 4,
|
|
@@ -2939,7 +3032,7 @@ var theme = {
|
|
|
2939
3032
|
palettes: {
|
|
2940
3033
|
lateOcean: lateOceanColorPalette
|
|
2941
3034
|
},
|
|
2942
|
-
avatar:
|
|
3035
|
+
avatar: avatar,
|
|
2943
3036
|
button: buttonLateOceanTheme,
|
|
2944
3037
|
card: cardLateOceanTheme,
|
|
2945
3038
|
feedbackMessage: feedbackMessageLateOceanTheme,
|
|
@@ -2950,7 +3043,9 @@ var theme = {
|
|
|
2950
3043
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2951
3044
|
iconButton: iconButton,
|
|
2952
3045
|
listItem: listItemLateOceanTheme,
|
|
2953
|
-
tooltip: tooltip
|
|
3046
|
+
tooltip: tooltip,
|
|
3047
|
+
skeleton: skeletonTheme,
|
|
3048
|
+
breakpoints: breakpoints
|
|
2954
3049
|
};
|
|
2955
3050
|
|
|
2956
3051
|
function TimePicker() {
|
|
@@ -3338,12 +3433,19 @@ function useKittTheme() {
|
|
|
3338
3433
|
return useMemo(function () {
|
|
3339
3434
|
return {
|
|
3340
3435
|
kitt: theme,
|
|
3341
|
-
responsive: createWindowSizeHelper(dimensions)
|
|
3342
|
-
breakpoints: breakpoints
|
|
3436
|
+
responsive: createWindowSizeHelper(dimensions)
|
|
3343
3437
|
};
|
|
3344
3438
|
}, [dimensions]);
|
|
3345
3439
|
}
|
|
3346
3440
|
|
|
3441
|
+
var hex2rgba = function (hex) {
|
|
3442
|
+
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
3443
|
+
var r = parseInt(hex.slice(1, 3), 16);
|
|
3444
|
+
var g = parseInt(hex.slice(3, 5), 16);
|
|
3445
|
+
var b = parseInt(hex.slice(5, 7), 16);
|
|
3446
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
|
3447
|
+
};
|
|
3448
|
+
|
|
3347
3449
|
function KittThemeProvider(_ref) {
|
|
3348
3450
|
var children = _ref.children;
|
|
3349
3451
|
var theme = useKittTheme();
|
|
@@ -3376,5 +3478,5 @@ function MatchWindowSize(_ref) {
|
|
|
3376
3478
|
});
|
|
3377
3479
|
}
|
|
3378
3480
|
|
|
3379
|
-
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
3481
|
+
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
|
|
3380
3482
|
//# sourceMappingURL=index-browser-all.es.web.js.map
|