@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
|
@@ -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 { cloneElement, useContext, createContext, forwardRef, 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';
|
|
@@ -29,8 +29,7 @@ function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
29
29
|
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
30
30
|
// };
|
|
31
31
|
// }
|
|
32
|
-
function withTheme(
|
|
33
|
-
WrappedComponent) {
|
|
32
|
+
function withTheme(WrappedComponent) {
|
|
34
33
|
return function (props) {
|
|
35
34
|
var theme = /*#__PURE__*/useTheme();
|
|
36
35
|
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$h({
|
|
@@ -50,7 +49,7 @@ function SpinningIcon(_ref) {
|
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
var IconContainer$
|
|
52
|
+
var IconContainer$1 = /*#__PURE__*/styled$1(View).withConfig({
|
|
54
53
|
displayName: "Icon__IconContainer",
|
|
55
54
|
componentId: "kitt-universal__sc-usm0ol-0"
|
|
56
55
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
@@ -77,7 +76,7 @@ function Icon(_ref5) {
|
|
|
77
76
|
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
78
77
|
color: color
|
|
79
78
|
});
|
|
80
|
-
return /*#__PURE__*/jsx(IconContainer$
|
|
79
|
+
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
81
80
|
align: align,
|
|
82
81
|
size: size,
|
|
83
82
|
color: color,
|
|
@@ -135,7 +134,7 @@ var KittBreakpointsMax = {
|
|
|
135
134
|
LARGE: KittBreakpoints.WIDE - 1
|
|
136
135
|
};
|
|
137
136
|
|
|
138
|
-
var _excluded$
|
|
137
|
+
var _excluded$e = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
|
|
139
138
|
|
|
140
139
|
function ownKeys$g(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; }
|
|
141
140
|
|
|
@@ -195,34 +194,53 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
|
195
194
|
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
196
195
|
return base;
|
|
197
196
|
}
|
|
198
|
-
function
|
|
199
|
-
var
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
197
|
+
function getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, _ref3) {
|
|
198
|
+
var base = _ref3.base,
|
|
199
|
+
color = _ref3.color;
|
|
200
|
+
// return the props set or undefined. In case of undefined, the value will be inherited from its parents.
|
|
201
|
+
if (hasTypographyAncestor) return {
|
|
202
|
+
base: base,
|
|
203
|
+
color: color
|
|
204
|
+
};
|
|
205
|
+
return {
|
|
206
|
+
base: base !== null && base !== void 0 ? base : 'body',
|
|
207
|
+
color: color !== null && color !== void 0 ? color : 'black'
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function Typography(_ref4) {
|
|
211
|
+
var accessibilityRole = _ref4.accessibilityRole,
|
|
212
|
+
base = _ref4.base,
|
|
213
|
+
small = _ref4.small,
|
|
214
|
+
medium = _ref4.medium,
|
|
215
|
+
large = _ref4.large,
|
|
216
|
+
variant = _ref4.variant,
|
|
217
|
+
color = _ref4.color,
|
|
218
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded$e);
|
|
207
219
|
|
|
208
220
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
209
|
-
var
|
|
210
|
-
var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
211
|
-
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular'; // if isHeaderTypographyInContext exists, it means we are inside another typography so we don't want to
|
|
212
|
-
// redefine the color, just inherit from it
|
|
221
|
+
var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
213
222
|
|
|
214
|
-
var
|
|
215
|
-
|
|
223
|
+
var _getTypographyInherit = getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
|
|
224
|
+
base: base,
|
|
225
|
+
color: color
|
|
226
|
+
}),
|
|
227
|
+
baseOrDefaultToBody = _getTypographyInherit.base,
|
|
228
|
+
colorOrDefaultToBlack = _getTypographyInherit.color;
|
|
229
|
+
|
|
230
|
+
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(baseOrDefaultToBody, small, medium, large);
|
|
231
|
+
var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
232
|
+
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular';
|
|
233
|
+
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
216
234
|
value: isHeader,
|
|
217
235
|
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
218
|
-
$color:
|
|
236
|
+
$color: colorOrDefaultToBlack,
|
|
219
237
|
$isHeader: isHeader,
|
|
220
238
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
221
239
|
$variant: nonNullableVariant,
|
|
222
240
|
accessibilityRole: accessibilityRole || undefined
|
|
223
241
|
}, otherProps))
|
|
224
242
|
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
225
|
-
$color:
|
|
243
|
+
$color: colorOrDefaultToBlack,
|
|
226
244
|
$isHeader: isHeader,
|
|
227
245
|
$variant: nonNullableVariant,
|
|
228
246
|
accessibilityRole: accessibilityRole || undefined
|
|
@@ -284,7 +302,7 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
284
302
|
|
|
285
303
|
Typography.h5 = createHeading(5, 'header5');
|
|
286
304
|
|
|
287
|
-
var _excluded$
|
|
305
|
+
var _excluded$d = ["size"];
|
|
288
306
|
|
|
289
307
|
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; }
|
|
290
308
|
|
|
@@ -356,7 +374,7 @@ function AvatarContent(_ref5) {
|
|
|
356
374
|
function Avatar(_ref6) {
|
|
357
375
|
var _ref6$size = _ref6.size,
|
|
358
376
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
359
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
377
|
+
rest = _objectWithoutProperties(_ref6, _excluded$d);
|
|
360
378
|
|
|
361
379
|
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$f(_objectSpread$f({}, rest), {}, {
|
|
362
380
|
size: size,
|
|
@@ -366,88 +384,257 @@ function Avatar(_ref6) {
|
|
|
366
384
|
}));
|
|
367
385
|
}
|
|
368
386
|
|
|
369
|
-
|
|
370
|
-
|
|
387
|
+
function isSubtle(type) {
|
|
388
|
+
return type.startsWith('subtle');
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
var _excluded$c = ["$type", "$isStretch", "disabled"];
|
|
371
392
|
|
|
372
393
|
function ownKeys$e(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; }
|
|
373
394
|
|
|
374
395
|
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
396
|
+
var AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/styled("div")({
|
|
397
|
+
name: "AnimatedButtonPressableContainer",
|
|
398
|
+
"class": "a1vkj3mh",
|
|
399
|
+
vars: {
|
|
400
|
+
"a1vkj3mh-0": [function (_ref) {
|
|
401
|
+
var $isStretch = _ref.$isStretch;
|
|
402
|
+
return $isStretch ? 'inherit' : 'inline-flex';
|
|
403
|
+
}],
|
|
404
|
+
"a1vkj3mh-1": [function (_ref2) {
|
|
405
|
+
var $isStretch = _ref2.$isStretch;
|
|
406
|
+
return $isStretch ? 'stretch' : 'baseline';
|
|
407
|
+
}],
|
|
408
|
+
"a1vkj3mh-2": [function (_ref3) {
|
|
409
|
+
var theme = _ref3.theme;
|
|
410
|
+
return theme.breakpoints.min.mediumBreakpoint;
|
|
411
|
+
}],
|
|
412
|
+
"a1vkj3mh-3": [function (_ref4) {
|
|
413
|
+
var theme = _ref4.theme;
|
|
414
|
+
return theme.kitt.button.scale.medium.hover;
|
|
415
|
+
}],
|
|
416
|
+
"a1vkj3mh-4": [function (_ref5) {
|
|
417
|
+
var theme = _ref5.theme,
|
|
418
|
+
$isDisabled = _ref5.$isDisabled;
|
|
419
|
+
return "scale(".concat($isDisabled ? 1 : theme.kitt.button.scale.base.active, ")");
|
|
420
|
+
}],
|
|
421
|
+
"a1vkj3mh-5": [function (_ref6) {
|
|
422
|
+
var theme = _ref6.theme,
|
|
423
|
+
$type = _ref6.$type,
|
|
424
|
+
$isDisabled = _ref6.$isDisabled;
|
|
425
|
+
if ($isDisabled) return theme.kitt.button.disabled.hoverBackgroundColor;
|
|
426
|
+
return theme.kitt.button[$type].hoverBackgroundColor;
|
|
427
|
+
}],
|
|
428
|
+
"a1vkj3mh-6": [function (_ref7) {
|
|
429
|
+
var theme = _ref7.theme;
|
|
430
|
+
var _theme$kitt$button$tr = theme.kitt.button.transition,
|
|
431
|
+
duration = _theme$kitt$button$tr.duration,
|
|
432
|
+
timingFunction = _theme$kitt$button$tr.timingFunction;
|
|
433
|
+
return "color, background, border-color, ".concat(duration, " ").concat(timingFunction);
|
|
434
|
+
}],
|
|
435
|
+
"a1vkj3mh-7": [function (_ref8) {
|
|
436
|
+
var theme = _ref8.theme;
|
|
437
|
+
return theme.kitt.button.borderRadius;
|
|
438
|
+
}],
|
|
439
|
+
"a1vkj3mh-8": [function (_ref9) {
|
|
440
|
+
var theme = _ref9.theme;
|
|
441
|
+
return "opacity ".concat(theme.kitt.button.transition.duration, " ").concat(theme.kitt.button.transition.timingFunction);
|
|
442
|
+
}],
|
|
443
|
+
"a1vkj3mh-9": [function (_ref10) {
|
|
444
|
+
var $isDisabled = _ref10.$isDisabled;
|
|
445
|
+
return $isDisabled ? 1 : 0;
|
|
446
|
+
}],
|
|
447
|
+
"a1vkj3mh-10": [function (_ref11) {
|
|
448
|
+
var theme = _ref11.theme;
|
|
449
|
+
return "-".concat(theme.kitt.button.borderWidth.disabled);
|
|
450
|
+
}],
|
|
451
|
+
"a1vkj3mh-12": [function (_ref12) {
|
|
452
|
+
var theme = _ref12.theme;
|
|
453
|
+
return "calc(100% - ".concat(parseInt(theme.kitt.button.borderWidth.disabled, 10) * 0.5, "px)");
|
|
454
|
+
}],
|
|
455
|
+
"a1vkj3mh-14": [function (_ref13) {
|
|
456
|
+
var theme = _ref13.theme;
|
|
457
|
+
return "".concat(theme.kitt.button.disabled.borderColor, " solid ").concat(theme.kitt.button.borderWidth.disabled);
|
|
458
|
+
}],
|
|
459
|
+
"a1vkj3mh-15": [function (_ref14) {
|
|
460
|
+
var theme = _ref14.theme,
|
|
461
|
+
$type = _ref14.$type;
|
|
462
|
+
return "".concat(theme.kitt.button.borderWidth.focus, " solid ").concat(theme.kitt.button[$type].focusBorderColor);
|
|
463
|
+
}],
|
|
464
|
+
"a1vkj3mh-16": [function (_ref15) {
|
|
465
|
+
var theme = _ref15.theme;
|
|
466
|
+
return "-".concat(theme.kitt.button.borderWidth.focus);
|
|
467
|
+
}],
|
|
468
|
+
"a1vkj3mh-18": [function (_ref16) {
|
|
469
|
+
var theme = _ref16.theme,
|
|
470
|
+
$type = _ref16.$type,
|
|
471
|
+
$isDisabled = _ref16.$isDisabled;
|
|
472
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
473
|
+
if (!isSubtle($type)) return 'inherit';
|
|
474
|
+
return theme.kitt.button[$type].color;
|
|
475
|
+
}],
|
|
476
|
+
"a1vkj3mh-19": [function (_ref17) {
|
|
477
|
+
var theme = _ref17.theme,
|
|
478
|
+
$type = _ref17.$type,
|
|
479
|
+
$isDisabled = _ref17.$isDisabled;
|
|
480
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
481
|
+
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
|
+
return theme.kitt.button[$type].activeColor;
|
|
491
|
+
}]
|
|
492
|
+
}
|
|
493
|
+
}));
|
|
494
|
+
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref19, ref) {
|
|
495
|
+
var $type = _ref19.$type,
|
|
496
|
+
$isStretch = _ref19.$isStretch,
|
|
497
|
+
disabled = _ref19.disabled,
|
|
498
|
+
props = _objectWithoutProperties(_ref19, _excluded$c);
|
|
499
|
+
|
|
500
|
+
return /*#__PURE__*/jsx(AnimatedButtonPressableContainer, {
|
|
501
|
+
ref: ref,
|
|
502
|
+
$type: $type,
|
|
503
|
+
$isDisabled: !!disabled,
|
|
504
|
+
$isStretch: $isStretch,
|
|
505
|
+
children: /*#__PURE__*/jsx(Pressable, _objectSpread$e({
|
|
506
|
+
disabled: disabled
|
|
507
|
+
}, props))
|
|
508
|
+
});
|
|
509
|
+
});
|
|
375
510
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
511
|
+
var BaseStyledButtonPressable = /*#__PURE__*/styled$1(View).withConfig({
|
|
512
|
+
displayName: "BaseStyledButtonPressable",
|
|
513
|
+
componentId: "kitt-universal__sc-4k8lse-0"
|
|
514
|
+
})(["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:", ";"], function (_ref) {
|
|
515
|
+
var theme = _ref.theme;
|
|
516
|
+
return theme.kitt.button.minWidth;
|
|
517
|
+
}, function (_ref2) {
|
|
518
|
+
var theme = _ref2.theme,
|
|
519
|
+
$isStretch = _ref2.$isStretch;
|
|
520
|
+
return $isStretch ? '100%' : theme.kitt.button.maxWidth;
|
|
521
|
+
}, function (_ref3) {
|
|
522
|
+
var $isStretch = _ref3.$isStretch;
|
|
523
|
+
return $isStretch ? '100%' : 'auto';
|
|
524
|
+
}, function (_ref4) {
|
|
525
|
+
var theme = _ref4.theme;
|
|
526
|
+
return theme.kitt.button.minHeight;
|
|
527
|
+
}, function (_ref5) {
|
|
528
|
+
var theme = _ref5.theme;
|
|
529
|
+
return theme.kitt.button.borderRadius;
|
|
530
|
+
}, function (_ref6) {
|
|
531
|
+
var theme = _ref6.theme,
|
|
532
|
+
$isDisabled = _ref6.$isDisabled,
|
|
533
|
+
$type = _ref6.$type;
|
|
534
|
+
if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
|
|
535
|
+
return theme.kitt.button[$type].backgroundColor;
|
|
536
|
+
}, function (_ref7) {
|
|
537
|
+
var theme = _ref7.theme,
|
|
538
|
+
$isLarge = _ref7.$isLarge,
|
|
539
|
+
$isDisabled = _ref7.$isDisabled;
|
|
540
|
+
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
541
|
+
large = _theme$kitt$button$co.large,
|
|
542
|
+
defaultPadding = _theme$kitt$button$co["default"],
|
|
543
|
+
disabledPadding = _theme$kitt$button$co.disabled;
|
|
544
|
+
if ($isLarge) return large;
|
|
545
|
+
if ($isDisabled) return disabledPadding;
|
|
546
|
+
return defaultPadding;
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
var _excluded$b = ["color"],
|
|
550
|
+
_excluded2$2 = ["color"];
|
|
551
|
+
|
|
552
|
+
function ownKeys$d(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; }
|
|
553
|
+
|
|
554
|
+
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
383
555
|
|
|
384
556
|
function TypographyIconSpecifiedColor(_ref) {
|
|
385
557
|
var color = _ref.color,
|
|
386
|
-
|
|
558
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
387
559
|
|
|
388
560
|
var theme = /*#__PURE__*/useTheme();
|
|
389
|
-
return /*#__PURE__*/jsx(Icon, _objectSpread$
|
|
390
|
-
color: theme.kitt.typography.colors[color]
|
|
561
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$d(_objectSpread$d({}, props), {}, {
|
|
562
|
+
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
391
563
|
}));
|
|
392
564
|
}
|
|
393
565
|
|
|
566
|
+
function TypographyIconInheritColor(props) {
|
|
567
|
+
var color = useTypographyColor();
|
|
568
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$d({
|
|
569
|
+
color: color
|
|
570
|
+
}, props));
|
|
571
|
+
}
|
|
572
|
+
|
|
394
573
|
function TypographyIcon(_ref2) {
|
|
395
574
|
var color = _ref2.color,
|
|
396
|
-
|
|
575
|
+
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
397
576
|
|
|
398
577
|
if (color) {
|
|
399
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
578
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$d({
|
|
400
579
|
color: color
|
|
401
|
-
},
|
|
580
|
+
}, props));
|
|
402
581
|
}
|
|
403
582
|
|
|
404
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
583
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$d({}, props));
|
|
405
584
|
}
|
|
406
585
|
|
|
407
|
-
|
|
586
|
+
var _excluded$a = ["type", "isDisabled", "$isStretch", "icon", "children"];
|
|
408
587
|
|
|
409
|
-
function
|
|
588
|
+
function ownKeys$c(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; }
|
|
410
589
|
|
|
411
|
-
var
|
|
412
|
-
if (disabled) return 'black-light';
|
|
590
|
+
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
413
591
|
|
|
592
|
+
var getTextColorByType = function (type) {
|
|
414
593
|
switch (type) {
|
|
415
594
|
case 'primary':
|
|
416
595
|
return 'white';
|
|
417
596
|
|
|
597
|
+
case 'white':
|
|
598
|
+
return 'white';
|
|
599
|
+
|
|
418
600
|
case 'subtle':
|
|
419
|
-
return
|
|
601
|
+
return 'primary';
|
|
420
602
|
|
|
421
603
|
case 'subtle-dark':
|
|
422
|
-
return
|
|
604
|
+
return 'black';
|
|
423
605
|
|
|
424
|
-
case 'secondary':
|
|
425
606
|
default:
|
|
426
607
|
return 'black';
|
|
427
608
|
}
|
|
428
609
|
};
|
|
429
610
|
|
|
430
|
-
var
|
|
431
|
-
displayName: "
|
|
611
|
+
var StyledButtonText = /*#__PURE__*/styled$1(Typography.Text).withConfig({
|
|
612
|
+
displayName: "ButtonContent__StyledButtonText",
|
|
432
613
|
componentId: "kitt-universal__sc-dnyw3n-0"
|
|
433
|
-
})(["text-align:center;"])
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
var
|
|
439
|
-
|
|
440
|
-
|
|
614
|
+
})(["text-align:center;", " ", ""], function () {
|
|
615
|
+
// Make the multilines case work properly on native
|
|
616
|
+
// Breaks the web implem
|
|
617
|
+
return undefined;
|
|
618
|
+
}, function (_ref) {
|
|
619
|
+
var $type = _ref.$type,
|
|
620
|
+
$isDisabled = _ref.$isDisabled;
|
|
621
|
+
|
|
622
|
+
/* For subltes button, color changes when hovered.
|
|
623
|
+
* We don't want to use a mouse event handler with a react state to handle it
|
|
624
|
+
* For this precise case, we've decided to work outside the typography logic
|
|
625
|
+
*/
|
|
626
|
+
if ($isDisabled || !isSubtle($type)) return undefined;
|
|
627
|
+
return 'color: inherit';
|
|
441
628
|
});
|
|
442
|
-
var
|
|
443
|
-
displayName: "
|
|
444
|
-
componentId: "kitt-universal__sc-dnyw3n-
|
|
629
|
+
var StyledIconContainer = /*#__PURE__*/styled$1(View).withConfig({
|
|
630
|
+
displayName: "ButtonContent__StyledIconContainer",
|
|
631
|
+
componentId: "kitt-universal__sc-dnyw3n-1"
|
|
445
632
|
})(["", ""], function (_ref2) {
|
|
446
633
|
var theme = _ref2.theme,
|
|
447
|
-
iconPosition = _ref2
|
|
448
|
-
var value = theme.kitt.spacing *
|
|
634
|
+
$iconPosition = _ref2.$iconPosition;
|
|
635
|
+
var value = theme.kitt.spacing * 2;
|
|
449
636
|
|
|
450
|
-
if (iconPosition === 'left') {
|
|
637
|
+
if ($iconPosition === 'left') {
|
|
451
638
|
return "margin: 0 ".concat(value, "px 0 0;");
|
|
452
639
|
}
|
|
453
640
|
|
|
@@ -456,39 +643,33 @@ var IconContainer$1 = /*#__PURE__*/styled$1(View).withConfig({
|
|
|
456
643
|
|
|
457
644
|
function ButtonIcon(_ref3) {
|
|
458
645
|
var icon = _ref3.icon,
|
|
459
|
-
spin = _ref3.spin,
|
|
460
646
|
color = _ref3.color,
|
|
461
|
-
|
|
647
|
+
spin = _ref3.spin,
|
|
462
648
|
iconPosition = _ref3.iconPosition,
|
|
463
649
|
testID = _ref3.testID;
|
|
464
|
-
return /*#__PURE__*/jsx(
|
|
465
|
-
iconPosition: iconPosition,
|
|
650
|
+
return /*#__PURE__*/jsx(StyledIconContainer, {
|
|
651
|
+
$iconPosition: iconPosition,
|
|
466
652
|
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
467
653
|
icon: icon,
|
|
468
654
|
spin: spin,
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
testID: testID
|
|
655
|
+
testID: testID,
|
|
656
|
+
color: color
|
|
472
657
|
})
|
|
473
658
|
});
|
|
474
659
|
}
|
|
475
660
|
|
|
476
|
-
|
|
661
|
+
var StyledChildrenWithIcon = /*#__PURE__*/styled$1(View).withConfig({
|
|
662
|
+
displayName: "ButtonContent__StyledChildrenWithIcon",
|
|
663
|
+
componentId: "kitt-universal__sc-dnyw3n-2"
|
|
664
|
+
})(["align-items:center;justify-content:center;flex-direction:row;"]);
|
|
665
|
+
function ButtonContentChildren(_ref4) {
|
|
477
666
|
var type = _ref4.type,
|
|
478
|
-
isPressed = _ref4.isPressed,
|
|
479
|
-
stretch = _ref4.stretch,
|
|
480
667
|
icon = _ref4.icon,
|
|
481
668
|
iconPosition = _ref4.iconPosition,
|
|
482
669
|
iconSpin = _ref4.iconSpin,
|
|
483
|
-
|
|
670
|
+
isDisabled = _ref4.isDisabled,
|
|
671
|
+
color = _ref4.color,
|
|
484
672
|
children = _ref4.children;
|
|
485
|
-
var color = getTextColorByType(type, Boolean(isPressed), Boolean(disabled));
|
|
486
|
-
var theme = /*#__PURE__*/useTheme();
|
|
487
|
-
var sharedIconProps = {
|
|
488
|
-
spin: iconSpin,
|
|
489
|
-
color: color,
|
|
490
|
-
size: theme.kitt.button.iconSize
|
|
491
|
-
};
|
|
492
673
|
|
|
493
674
|
if ((process.env.NODE_ENV !== "production")) {
|
|
494
675
|
if (!(children || icon)) {
|
|
@@ -496,129 +677,121 @@ function ButtonContent(_ref4) {
|
|
|
496
677
|
}
|
|
497
678
|
}
|
|
498
679
|
|
|
680
|
+
var isWebSubtle = isSubtle(type) && "web" === 'web' && !isDisabled;
|
|
681
|
+
|
|
499
682
|
if (!children) {
|
|
500
|
-
return /*#__PURE__*/jsx(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
}))
|
|
683
|
+
return /*#__PURE__*/jsx(TypographyIcon, {
|
|
684
|
+
spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
685
|
+
,
|
|
686
|
+
icon: icon,
|
|
687
|
+
color: isWebSubtle ? 'inherit' : color
|
|
506
688
|
});
|
|
507
689
|
}
|
|
508
690
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
691
|
+
var buttonIconSharedProps = {
|
|
692
|
+
type: type,
|
|
693
|
+
spin: iconSpin,
|
|
694
|
+
iconPosition: iconPosition,
|
|
695
|
+
color: isWebSubtle ? 'inherit' : color
|
|
696
|
+
};
|
|
697
|
+
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
698
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$c(_objectSpread$c({}, buttonIconSharedProps), {}, {
|
|
699
|
+
testID: "button-left-icon",
|
|
700
|
+
icon: icon
|
|
701
|
+
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
516
702
|
base: "body",
|
|
517
|
-
color: color,
|
|
518
703
|
variant: "bold",
|
|
704
|
+
$type: type,
|
|
705
|
+
$isDisabled: isDisabled // set to color: inherit via styled components
|
|
706
|
+
,
|
|
707
|
+
color: isWebSubtle ? undefined : color,
|
|
519
708
|
children: children
|
|
520
|
-
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
521
|
-
icon: icon
|
|
522
|
-
iconPosition: iconPosition
|
|
709
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$c(_objectSpread$c({}, buttonIconSharedProps), {}, {
|
|
710
|
+
icon: icon
|
|
523
711
|
})) : null]
|
|
524
712
|
});
|
|
525
713
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return
|
|
533
|
-
}, function (_ref2) {
|
|
534
|
-
var theme = _ref2.theme,
|
|
535
|
-
stretch = _ref2.stretch;
|
|
536
|
-
return stretch ? 'auto' : theme.kitt.button.maxWidth;
|
|
537
|
-
}, function (_ref3) {
|
|
538
|
-
var stretch = _ref3.stretch;
|
|
539
|
-
return stretch ? '100%' : 'auto';
|
|
540
|
-
}, function (_ref4) {
|
|
541
|
-
var theme = _ref4.theme;
|
|
542
|
-
return theme.kitt.button.minHeight;
|
|
543
|
-
}, function (_ref5) {
|
|
544
|
-
var theme = _ref5.theme,
|
|
545
|
-
isPressed = _ref5.isPressed,
|
|
546
|
-
disabled = _ref5.disabled,
|
|
547
|
-
type = _ref5.type;
|
|
548
|
-
|
|
549
|
-
if (disabled) {
|
|
550
|
-
return theme.kitt.button[type].disabledBackgroundColor;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
|
|
714
|
+
var ButtonContentContainer = /*#__PURE__*/styled$1(View).withConfig({
|
|
715
|
+
displayName: "ButtonContent__ButtonContentContainer",
|
|
716
|
+
componentId: "kitt-universal__sc-dnyw3n-3"
|
|
717
|
+
})(["line-height:16px;", " ", ";"], function (_ref5) {
|
|
718
|
+
var $isStretch = _ref5.$isStretch,
|
|
719
|
+
$isIconOnly = _ref5.$isIconOnly;
|
|
720
|
+
return "\n flex: ".concat($isStretch || $isIconOnly ? 1 : 0, " 1 auto;\n ");
|
|
554
721
|
}, function (_ref6) {
|
|
555
|
-
var
|
|
556
|
-
return
|
|
557
|
-
}, function (_ref7) {
|
|
558
|
-
var theme = _ref7.theme;
|
|
559
|
-
return theme.kitt.button.borderRadius;
|
|
560
|
-
}, function (_ref8) {
|
|
561
|
-
var theme = _ref8.theme,
|
|
562
|
-
disabled = _ref8.disabled,
|
|
563
|
-
type = _ref8.type;
|
|
564
|
-
return disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent';
|
|
565
|
-
}, function (_ref9) {
|
|
566
|
-
var theme = _ref9.theme;
|
|
567
|
-
return theme.kitt.button.borderWidth;
|
|
568
|
-
});
|
|
722
|
+
var $isSubtle = _ref6.$isSubtle;
|
|
723
|
+
if (!$isSubtle) return undefined; // Needed for subtle type
|
|
569
724
|
|
|
570
|
-
|
|
725
|
+
return 'color: inherit';
|
|
726
|
+
});
|
|
727
|
+
function ButtonContent(_ref7) {
|
|
728
|
+
var type = _ref7.type,
|
|
729
|
+
isDisabled = _ref7.isDisabled,
|
|
730
|
+
$isStretch = _ref7.$isStretch,
|
|
731
|
+
icon = _ref7.icon,
|
|
732
|
+
children = _ref7.children,
|
|
733
|
+
props = _objectWithoutProperties(_ref7, _excluded$a);
|
|
734
|
+
|
|
735
|
+
var color = isDisabled ? 'black-light' : getTextColorByType(type);
|
|
736
|
+
return /*#__PURE__*/jsx(ButtonContentContainer, {
|
|
737
|
+
$isSubtle: isSubtle(type),
|
|
738
|
+
$isStretch: $isStretch,
|
|
739
|
+
$isIconOnly: Boolean(!children && icon),
|
|
740
|
+
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$c(_objectSpread$c({
|
|
741
|
+
icon: icon,
|
|
742
|
+
type: type,
|
|
743
|
+
isDisabled: isDisabled,
|
|
744
|
+
color: color
|
|
745
|
+
}, props), {}, {
|
|
746
|
+
children: children
|
|
747
|
+
}))
|
|
748
|
+
});
|
|
749
|
+
}
|
|
571
750
|
|
|
572
|
-
|
|
573
|
-
function Button(_ref) {
|
|
751
|
+
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
574
752
|
var children = _ref.children,
|
|
575
753
|
_ref$type = _ref.type,
|
|
576
|
-
type = _ref$type === void 0 ? '
|
|
754
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
755
|
+
disabled = _ref.disabled,
|
|
756
|
+
stretch = _ref.stretch,
|
|
757
|
+
large = _ref.large,
|
|
577
758
|
icon = _ref.icon,
|
|
578
759
|
_ref$iconPosition = _ref.iconPosition,
|
|
579
760
|
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
580
761
|
iconSpin = _ref.iconSpin,
|
|
581
|
-
stretch = _ref.stretch,
|
|
582
|
-
disabled = _ref.disabled,
|
|
583
762
|
testID = _ref.testID,
|
|
584
763
|
href = _ref.href,
|
|
585
764
|
hrefAttrs = _ref.hrefAttrs,
|
|
765
|
+
_ref$accessibilityRol = _ref.accessibilityRole,
|
|
766
|
+
accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
|
|
586
767
|
onPress = _ref.onPress;
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
isPressed = _useState2[0],
|
|
591
|
-
setIsPressed = _useState2[1];
|
|
592
|
-
|
|
593
|
-
var sharedProps = {
|
|
594
|
-
type: type,
|
|
595
|
-
stretch: stretch,
|
|
596
|
-
disabled: disabled
|
|
597
|
-
};
|
|
598
|
-
return /*#__PURE__*/jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
599
|
-
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
600
|
-
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
601
|
-
, _objectSpread$c(_objectSpread$c({}, sharedProps), {}, {
|
|
602
|
-
isPressed: isPressed,
|
|
603
|
-
accessibilityRole: "button",
|
|
768
|
+
return /*#__PURE__*/jsx(AnimatedButtonPressable, {
|
|
769
|
+
ref: ref,
|
|
770
|
+
accessibilityRole: accessibilityRole,
|
|
604
771
|
testID: testID,
|
|
605
772
|
href: href,
|
|
606
773
|
hrefAttrs: hrefAttrs,
|
|
774
|
+
disabled: disabled,
|
|
775
|
+
$isStretch: stretch,
|
|
776
|
+
$type: type,
|
|
607
777
|
onPress: onPress,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
778
|
+
children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
|
|
779
|
+
$type: type,
|
|
780
|
+
$isStretch: stretch,
|
|
781
|
+
$isLarge: large,
|
|
782
|
+
$isDisabled: disabled,
|
|
783
|
+
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
784
|
+
type: type,
|
|
785
|
+
$isStretch: stretch,
|
|
786
|
+
isDisabled: disabled,
|
|
787
|
+
icon: icon,
|
|
788
|
+
iconPosition: iconPosition,
|
|
789
|
+
iconSpin: iconSpin,
|
|
790
|
+
children: children
|
|
791
|
+
}), null]
|
|
792
|
+
})
|
|
793
|
+
});
|
|
794
|
+
});
|
|
622
795
|
|
|
623
796
|
var Container$5 = /*#__PURE__*/styled$1(View).withConfig({
|
|
624
797
|
displayName: "Card__Container",
|
|
@@ -1083,7 +1256,8 @@ function TextArea(_ref) {
|
|
|
1083
1256
|
|
|
1084
1257
|
var theme = /*#__PURE__*/useTheme();
|
|
1085
1258
|
return /*#__PURE__*/jsx(InputText, _objectSpread$9(_objectSpread$9({
|
|
1086
|
-
multiline: true
|
|
1259
|
+
multiline: true,
|
|
1260
|
+
textAlignVertical: "top"
|
|
1087
1261
|
}, props), {}, {
|
|
1088
1262
|
type: "text",
|
|
1089
1263
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
@@ -1295,30 +1469,31 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled("div")({
|
|
|
1295
1469
|
return theme.kitt.iconButton.scale.base.active;
|
|
1296
1470
|
}],
|
|
1297
1471
|
"p1nlccvg-4": [function (_ref5) {
|
|
1298
|
-
var theme = _ref5.theme
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
return
|
|
1472
|
+
var theme = _ref5.theme,
|
|
1473
|
+
$isWhite = _ref5.$isWhite;
|
|
1474
|
+
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
1475
|
+
white = _theme$kitt$iconButto.white,
|
|
1476
|
+
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
1477
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1478
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1304
1479
|
}]
|
|
1305
1480
|
}
|
|
1306
1481
|
}));
|
|
1307
1482
|
var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
1308
1483
|
displayName: "PressableIconButton__StyledPressableIconButton",
|
|
1309
1484
|
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1310
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (
|
|
1311
|
-
var theme =
|
|
1485
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref6) {
|
|
1486
|
+
var theme = _ref6.theme;
|
|
1312
1487
|
return theme.kitt.iconButton.borderRadius;
|
|
1488
|
+
}, function (_ref7) {
|
|
1489
|
+
var theme = _ref7.theme;
|
|
1490
|
+
return theme.kitt.iconButton.width;
|
|
1313
1491
|
}, function (_ref8) {
|
|
1314
1492
|
var theme = _ref8.theme;
|
|
1315
|
-
return theme.kitt.iconButton.width;
|
|
1316
|
-
}, function (_ref9) {
|
|
1317
|
-
var theme = _ref9.theme;
|
|
1318
1493
|
return theme.kitt.iconButton.height;
|
|
1319
|
-
}, function (
|
|
1320
|
-
var theme =
|
|
1321
|
-
disabled =
|
|
1494
|
+
}, function (_ref9) {
|
|
1495
|
+
var theme = _ref9.theme,
|
|
1496
|
+
disabled = _ref9.disabled;
|
|
1322
1497
|
var iconButton = theme.kitt.iconButton;
|
|
1323
1498
|
var transition = iconButton.transition;
|
|
1324
1499
|
|
|
@@ -1328,13 +1503,13 @@ var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
|
1328
1503
|
|
|
1329
1504
|
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1330
1505
|
});
|
|
1331
|
-
function PressableIconButton(
|
|
1332
|
-
var color =
|
|
1333
|
-
props = _objectWithoutProperties(
|
|
1506
|
+
function PressableIconButton(_ref10) {
|
|
1507
|
+
var color = _ref10.color,
|
|
1508
|
+
props = _objectWithoutProperties(_ref10, _excluded$6);
|
|
1334
1509
|
|
|
1335
1510
|
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1336
1511
|
as: PressableIconButtonWebWrapper,
|
|
1337
|
-
|
|
1512
|
+
$isWhite: color === 'white',
|
|
1338
1513
|
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$7({}, props))
|
|
1339
1514
|
});
|
|
1340
1515
|
}
|
|
@@ -1907,6 +2082,93 @@ function Notification(_ref) {
|
|
|
1907
2082
|
});
|
|
1908
2083
|
}
|
|
1909
2084
|
|
|
2085
|
+
var StyledSkeleton = withTheme( /*#__PURE__*/styled("div")({
|
|
2086
|
+
name: "StyledSkeleton",
|
|
2087
|
+
"class": "sc3upcl",
|
|
2088
|
+
vars: {
|
|
2089
|
+
"sc3upcl-0": [function (_ref) {
|
|
2090
|
+
var theme = _ref.theme;
|
|
2091
|
+
return theme.kitt.skeleton.backgroundColor;
|
|
2092
|
+
}],
|
|
2093
|
+
"sc3upcl-1": [function (_ref2) {
|
|
2094
|
+
var $isLoading = _ref2.$isLoading,
|
|
2095
|
+
theme = _ref2.theme;
|
|
2096
|
+
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';
|
|
2097
|
+
}],
|
|
2098
|
+
"sc3upcl-2": [function (_ref3) {
|
|
2099
|
+
var $isLoading = _ref3.$isLoading;
|
|
2100
|
+
return $isLoading ? '1s ease-in-out infinite' : 'none';
|
|
2101
|
+
}]
|
|
2102
|
+
}
|
|
2103
|
+
}));
|
|
2104
|
+
function SkeletonContent(_ref4) {
|
|
2105
|
+
var isLoading = _ref4.isLoading;
|
|
2106
|
+
return /*#__PURE__*/jsx(StyledSkeleton, {
|
|
2107
|
+
$isLoading: isLoading
|
|
2108
|
+
});
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
function Skeleton(_ref) {
|
|
2112
|
+
var isLoading = _ref.isLoading,
|
|
2113
|
+
style = _ref.style;
|
|
2114
|
+
|
|
2115
|
+
var _useState = useState(0),
|
|
2116
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2117
|
+
width = _useState2[0],
|
|
2118
|
+
setWidth = _useState2[1];
|
|
2119
|
+
|
|
2120
|
+
return /*#__PURE__*/jsx(View, {
|
|
2121
|
+
style: style,
|
|
2122
|
+
onLayout: function onLayout(_ref2) {
|
|
2123
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
2124
|
+
return setWidth(nativeEvent.layout.width);
|
|
2125
|
+
},
|
|
2126
|
+
children: /*#__PURE__*/jsx(SkeletonContent, {
|
|
2127
|
+
isLoading: isLoading,
|
|
2128
|
+
width: width
|
|
2129
|
+
})
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
var Bar = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2133
|
+
displayName: "Skeleton__Bar",
|
|
2134
|
+
componentId: "kitt-universal__sc-1w5cm3i-0"
|
|
2135
|
+
})(["width:100%;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref3) {
|
|
2136
|
+
var theme = _ref3.theme;
|
|
2137
|
+
return theme.kitt.spacing * 2;
|
|
2138
|
+
}, function (_ref4) {
|
|
2139
|
+
var theme = _ref4.theme;
|
|
2140
|
+
return theme.kitt.spacing * 2;
|
|
2141
|
+
});
|
|
2142
|
+
var Circle = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2143
|
+
displayName: "Skeleton__Circle",
|
|
2144
|
+
componentId: "kitt-universal__sc-1w5cm3i-1"
|
|
2145
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref5) {
|
|
2146
|
+
var theme = _ref5.theme;
|
|
2147
|
+
return theme.kitt.spacing * 12;
|
|
2148
|
+
}, function (_ref6) {
|
|
2149
|
+
var theme = _ref6.theme;
|
|
2150
|
+
return theme.kitt.spacing * 12;
|
|
2151
|
+
}, function (_ref7) {
|
|
2152
|
+
var theme = _ref7.theme;
|
|
2153
|
+
return theme.kitt.spacing * 6;
|
|
2154
|
+
});
|
|
2155
|
+
var Square = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2156
|
+
displayName: "Skeleton__Square",
|
|
2157
|
+
componentId: "kitt-universal__sc-1w5cm3i-2"
|
|
2158
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref8) {
|
|
2159
|
+
var theme = _ref8.theme;
|
|
2160
|
+
return theme.kitt.spacing * 12;
|
|
2161
|
+
}, function (_ref9) {
|
|
2162
|
+
var theme = _ref9.theme;
|
|
2163
|
+
return theme.kitt.spacing * 12;
|
|
2164
|
+
}, function (_ref10) {
|
|
2165
|
+
var theme = _ref10.theme;
|
|
2166
|
+
return theme.kitt.spacing * 1.5;
|
|
2167
|
+
});
|
|
2168
|
+
Skeleton.Bar = Bar;
|
|
2169
|
+
Skeleton.Circle = Circle;
|
|
2170
|
+
Skeleton.Square = Square;
|
|
2171
|
+
|
|
1910
2172
|
var Flex = /*#__PURE__*/styled$1(View).withConfig({
|
|
1911
2173
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
1912
2174
|
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
@@ -2361,47 +2623,98 @@ var avatarLateOceanTheme = {
|
|
|
2361
2623
|
}
|
|
2362
2624
|
};
|
|
2363
2625
|
|
|
2626
|
+
var colorsLateOceanTheme = {
|
|
2627
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
2628
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2629
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
2630
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2631
|
+
success: lateOceanColorPalette.viride,
|
|
2632
|
+
correct: lateOceanColorPalette.viride,
|
|
2633
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
2634
|
+
separator: lateOceanColorPalette.black100,
|
|
2635
|
+
hover: lateOceanColorPalette.black100,
|
|
2636
|
+
black: lateOceanColorPalette.black1000,
|
|
2637
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
2638
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2639
|
+
transparent: lateOceanColorPalette.transparent,
|
|
2640
|
+
disabled: lateOceanColorPalette.black50,
|
|
2641
|
+
overlay: {
|
|
2642
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2643
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
2644
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2645
|
+
}
|
|
2646
|
+
};
|
|
2647
|
+
|
|
2364
2648
|
var buttonLateOceanTheme = {
|
|
2365
2649
|
borderRadius: '30px',
|
|
2366
|
-
borderWidth:
|
|
2367
|
-
|
|
2650
|
+
borderWidth: {
|
|
2651
|
+
disabled: '2px',
|
|
2652
|
+
focus: '3px'
|
|
2653
|
+
},
|
|
2654
|
+
minHeight: '40px',
|
|
2368
2655
|
minWidth: '40px',
|
|
2369
2656
|
maxWidth: '335px',
|
|
2370
|
-
|
|
2657
|
+
scale: {
|
|
2658
|
+
base: {
|
|
2659
|
+
"default": 1,
|
|
2660
|
+
hover: 0.95,
|
|
2661
|
+
active: 0.95
|
|
2662
|
+
},
|
|
2663
|
+
medium: {
|
|
2664
|
+
hover: 1.05
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2371
2667
|
contentPadding: {
|
|
2372
|
-
"default": '8px 16px'
|
|
2668
|
+
"default": '8px 16px 7px',
|
|
2669
|
+
large: '12px 24px 11px',
|
|
2670
|
+
disabled: '6px 14px 5px'
|
|
2373
2671
|
},
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
|
|
2378
|
-
disabledBorderColor: lateOceanColorPalette.black100
|
|
2672
|
+
transition: {
|
|
2673
|
+
duration: '200ms',
|
|
2674
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2379
2675
|
},
|
|
2380
|
-
|
|
2676
|
+
"default": {
|
|
2381
2677
|
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2382
|
-
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
2383
2678
|
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2384
|
-
|
|
2679
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2680
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2385
2681
|
},
|
|
2386
|
-
|
|
2387
|
-
backgroundColor:
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
},
|
|
2392
|
-
'subtle-dark': {
|
|
2393
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
2394
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2395
|
-
pressedBackgroundColor: lateOceanColorPalette.transparent,
|
|
2396
|
-
disabledBorderColor: lateOceanColorPalette.transparent
|
|
2682
|
+
primary: {
|
|
2683
|
+
backgroundColor: colorsLateOceanTheme.primary,
|
|
2684
|
+
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2685
|
+
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2686
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2397
2687
|
},
|
|
2398
2688
|
white: {
|
|
2399
2689
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2400
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2401
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2402
2690
|
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2403
|
-
|
|
2404
|
-
|
|
2691
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2692
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2693
|
+
},
|
|
2694
|
+
subtle: {
|
|
2695
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2696
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2697
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2698
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2699
|
+
color: colorsLateOceanTheme.primary,
|
|
2700
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2701
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2702
|
+
},
|
|
2703
|
+
'subtle-dark': {
|
|
2704
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2705
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2706
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2707
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2708
|
+
color: colorsLateOceanTheme.black,
|
|
2709
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2710
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2711
|
+
},
|
|
2712
|
+
disabled: {
|
|
2713
|
+
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2714
|
+
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2715
|
+
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2716
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
2717
|
+
borderColor: lateOceanColorPalette.black100
|
|
2405
2718
|
}
|
|
2406
2719
|
};
|
|
2407
2720
|
|
|
@@ -2423,26 +2736,6 @@ var cardLateOceanTheme = {
|
|
|
2423
2736
|
}
|
|
2424
2737
|
};
|
|
2425
2738
|
|
|
2426
|
-
var colorsLateOceanTheme = {
|
|
2427
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2428
|
-
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2429
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2430
|
-
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2431
|
-
success: lateOceanColorPalette.viride,
|
|
2432
|
-
correct: lateOceanColorPalette.viride,
|
|
2433
|
-
danger: lateOceanColorPalette.englishVermillon,
|
|
2434
|
-
separator: lateOceanColorPalette.black100,
|
|
2435
|
-
hover: lateOceanColorPalette.black100,
|
|
2436
|
-
black: lateOceanColorPalette.black1000,
|
|
2437
|
-
uiBackground: lateOceanColorPalette.black25,
|
|
2438
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2439
|
-
overlay: {
|
|
2440
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2441
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2442
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2443
|
-
}
|
|
2444
|
-
};
|
|
2445
|
-
|
|
2446
2739
|
var feedbackMessageLateOceanTheme = {
|
|
2447
2740
|
backgroundColors: {
|
|
2448
2741
|
success: lateOceanColorPalette.viride,
|
|
@@ -2556,11 +2849,11 @@ var iconButton = {
|
|
|
2556
2849
|
},
|
|
2557
2850
|
disabled: {
|
|
2558
2851
|
scale: 1,
|
|
2559
|
-
backgroundColor: buttonLateOceanTheme.
|
|
2560
|
-
borderColor: buttonLateOceanTheme.
|
|
2852
|
+
backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
|
|
2853
|
+
borderColor: buttonLateOceanTheme.disabled.borderColor
|
|
2561
2854
|
},
|
|
2562
2855
|
"default": {
|
|
2563
|
-
pressedBackgroundColor: buttonLateOceanTheme.
|
|
2856
|
+
pressedBackgroundColor: buttonLateOceanTheme["default"].pressedBackgroundColor
|
|
2564
2857
|
},
|
|
2565
2858
|
white: {
|
|
2566
2859
|
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
@@ -2578,6 +2871,12 @@ var shadowsLateOceanTheme = {
|
|
|
2578
2871
|
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
2579
2872
|
};
|
|
2580
2873
|
|
|
2874
|
+
var skeletonTheme = {
|
|
2875
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
2876
|
+
flareColor: lateOceanColorPalette.black200,
|
|
2877
|
+
animationDuration: 1000
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2581
2880
|
var tagLateOceanTheme = {
|
|
2582
2881
|
borderRadius: '10px',
|
|
2583
2882
|
padding: '2px 12px',
|
|
@@ -2631,20 +2930,18 @@ var tooltip = {
|
|
|
2631
2930
|
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
2632
2931
|
return Math.round(fontSize * lineHeightMultiplier);
|
|
2633
2932
|
};
|
|
2634
|
-
|
|
2635
2933
|
var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
|
|
2636
2934
|
return {
|
|
2637
2935
|
baseAndSmall: {
|
|
2638
2936
|
fontSize: "".concat(baseAndSmallFontSize, "px"),
|
|
2639
|
-
lineHeight: "".concat(calcLineHeight(
|
|
2937
|
+
lineHeight: "".concat(calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier), "px")
|
|
2640
2938
|
},
|
|
2641
2939
|
mediumAndWide: {
|
|
2642
2940
|
fontSize: "".concat(mediumAndWideFontSize, "px"),
|
|
2643
|
-
lineHeight: "".concat(calcLineHeight(
|
|
2941
|
+
lineHeight: "".concat(calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier), "px")
|
|
2644
2942
|
}
|
|
2645
2943
|
};
|
|
2646
2944
|
};
|
|
2647
|
-
|
|
2648
2945
|
var typographyLateOceanTheme = {
|
|
2649
2946
|
colors: {
|
|
2650
2947
|
black: lateOceanColorPalette.black1000,
|
|
@@ -2726,7 +3023,7 @@ var breakpoints = {
|
|
|
2726
3023
|
wideBreakpoint: 'max-width: 1279px'
|
|
2727
3024
|
}
|
|
2728
3025
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2729
|
-
// TODO : seperate brand
|
|
3026
|
+
// TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
|
|
2730
3027
|
|
|
2731
3028
|
var theme = {
|
|
2732
3029
|
spacing: 4,
|
|
@@ -2745,7 +3042,8 @@ var theme = {
|
|
|
2745
3042
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2746
3043
|
iconButton: iconButton,
|
|
2747
3044
|
listItem: listItemLateOceanTheme,
|
|
2748
|
-
tooltip: tooltip
|
|
3045
|
+
tooltip: tooltip,
|
|
3046
|
+
skeleton: skeletonTheme
|
|
2749
3047
|
};
|
|
2750
3048
|
|
|
2751
3049
|
function TimePicker() {
|
|
@@ -3011,40 +3309,46 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3011
3309
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3012
3310
|
var TypographyLinkWebWrapper = withTheme( /*#__PURE__*/styled("span")({
|
|
3013
3311
|
name: "TypographyLinkWebWrapper",
|
|
3014
|
-
"class": "tcwz3nt"
|
|
3312
|
+
"class": "tcwz3nt",
|
|
3313
|
+
vars: {
|
|
3314
|
+
"tcwz3nt-0": [function (_ref) {
|
|
3315
|
+
var $hasNoUnderline = _ref.$hasNoUnderline;
|
|
3316
|
+
return $hasNoUnderline ? 'underline' : 'none';
|
|
3317
|
+
}]
|
|
3318
|
+
}
|
|
3015
3319
|
}));
|
|
3016
3320
|
var StyledLink = /*#__PURE__*/styled$1(Text$1).withConfig({
|
|
3017
3321
|
displayName: "TypographyLink__StyledLink",
|
|
3018
3322
|
componentId: "kitt-universal__sc-1o1zy30-0"
|
|
3019
|
-
})(["text-decoration:", ";", ";", ";"], function (
|
|
3020
|
-
var $
|
|
3021
|
-
return $
|
|
3022
|
-
}, function (_ref2) {
|
|
3023
|
-
var $disabled = _ref2.$disabled;
|
|
3024
|
-
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3323
|
+
})(["text-decoration:", ";", ";", ";"], function (_ref2) {
|
|
3324
|
+
var $hasNoUnderline = _ref2.$hasNoUnderline;
|
|
3325
|
+
return $hasNoUnderline ? 'none' : 'underline';
|
|
3025
3326
|
}, function (_ref3) {
|
|
3026
|
-
var $disabled = _ref3.$disabled
|
|
3027
|
-
|
|
3327
|
+
var $disabled = _ref3.$disabled;
|
|
3328
|
+
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3329
|
+
}, function (_ref4) {
|
|
3330
|
+
var $disabled = _ref4.$disabled,
|
|
3331
|
+
theme = _ref4.theme;
|
|
3028
3332
|
if (!$disabled) return undefined;
|
|
3029
3333
|
return "color: ".concat(theme.kitt.typography.link.disabledColor, ";");
|
|
3030
3334
|
});
|
|
3031
|
-
function TypographyLink(
|
|
3032
|
-
var children =
|
|
3033
|
-
disabled =
|
|
3034
|
-
noUnderline =
|
|
3035
|
-
href =
|
|
3036
|
-
hrefAttrs =
|
|
3037
|
-
onPress =
|
|
3038
|
-
otherProps = _objectWithoutProperties(
|
|
3335
|
+
function TypographyLink(_ref5) {
|
|
3336
|
+
var children = _ref5.children,
|
|
3337
|
+
disabled = _ref5.disabled,
|
|
3338
|
+
noUnderline = _ref5.noUnderline,
|
|
3339
|
+
href = _ref5.href,
|
|
3340
|
+
hrefAttrs = _ref5.hrefAttrs,
|
|
3341
|
+
onPress = _ref5.onPress,
|
|
3342
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$1);
|
|
3039
3343
|
|
|
3040
3344
|
return /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
3041
3345
|
accessibilityRole: "none",
|
|
3042
3346
|
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3043
3347
|
as: TypographyLinkWebWrapper,
|
|
3044
|
-
|
|
3348
|
+
$hasNoUnderline: noUnderline,
|
|
3045
3349
|
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3046
3350
|
$disabled: disabled,
|
|
3047
|
-
$
|
|
3351
|
+
$hasNoUnderline: noUnderline,
|
|
3048
3352
|
href: href,
|
|
3049
3353
|
hrefAttrs: hrefAttrs,
|
|
3050
3354
|
accessibilityRole: "link",
|
|
@@ -3059,25 +3363,35 @@ function TypographyLink(_ref4) {
|
|
|
3059
3363
|
}));
|
|
3060
3364
|
}
|
|
3061
3365
|
|
|
3062
|
-
function matchWindowSize(
|
|
3063
|
-
var
|
|
3064
|
-
|
|
3065
|
-
|
|
3366
|
+
function matchWindowSize(_ref, _ref2) {
|
|
3367
|
+
var width = _ref.width,
|
|
3368
|
+
height = _ref.height;
|
|
3369
|
+
var minWidth = _ref2.minWidth,
|
|
3370
|
+
maxWidth = _ref2.maxWidth,
|
|
3371
|
+
minHeight = _ref2.minHeight,
|
|
3372
|
+
maxHeight = _ref2.maxHeight;
|
|
3373
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3374
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3375
|
+
return hasWidthMatched && hasHeightMatched;
|
|
3066
3376
|
}
|
|
3067
3377
|
function useMatchWindowSize(options) {
|
|
3068
3378
|
var _useWindowDimensions = useWindowDimensions(),
|
|
3069
|
-
width = _useWindowDimensions.width
|
|
3379
|
+
width = _useWindowDimensions.width,
|
|
3380
|
+
height = _useWindowDimensions.height;
|
|
3070
3381
|
|
|
3071
|
-
return matchWindowSize(
|
|
3382
|
+
return matchWindowSize({
|
|
3383
|
+
width: width,
|
|
3384
|
+
height: height
|
|
3385
|
+
}, options);
|
|
3072
3386
|
}
|
|
3073
3387
|
|
|
3074
|
-
function createWindowSizeHelper(
|
|
3388
|
+
function createWindowSizeHelper(dimensions) {
|
|
3075
3389
|
return {
|
|
3076
3390
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
3077
|
-
return matchWindowSize(
|
|
3391
|
+
return matchWindowSize(dimensions, options);
|
|
3078
3392
|
},
|
|
3079
3393
|
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
3080
|
-
return matchWindowSize(
|
|
3394
|
+
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
3081
3395
|
},
|
|
3082
3396
|
mapWindowWidth: function mapWindowWidth() {
|
|
3083
3397
|
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3102,7 +3416,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3102
3416
|
minWidth = _ref4[0];
|
|
3103
3417
|
_ref4[1];
|
|
3104
3418
|
|
|
3105
|
-
return matchWindowSize(
|
|
3419
|
+
return matchWindowSize(dimensions, {
|
|
3106
3420
|
minWidth: Number(minWidth)
|
|
3107
3421
|
});
|
|
3108
3422
|
});
|
|
@@ -3113,18 +3427,24 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3113
3427
|
}
|
|
3114
3428
|
|
|
3115
3429
|
function useKittTheme() {
|
|
3116
|
-
var
|
|
3117
|
-
width = _useWindowSize.width;
|
|
3118
|
-
|
|
3430
|
+
var dimensions = useWindowDimensions();
|
|
3119
3431
|
return useMemo(function () {
|
|
3120
3432
|
return {
|
|
3121
3433
|
kitt: theme,
|
|
3122
|
-
responsive: createWindowSizeHelper(
|
|
3434
|
+
responsive: createWindowSizeHelper(dimensions),
|
|
3123
3435
|
breakpoints: breakpoints
|
|
3124
3436
|
};
|
|
3125
|
-
}, [
|
|
3437
|
+
}, [dimensions]);
|
|
3126
3438
|
}
|
|
3127
3439
|
|
|
3440
|
+
var hex2rgba = function (hex) {
|
|
3441
|
+
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
3442
|
+
var r = parseInt(hex.slice(1, 3), 16);
|
|
3443
|
+
var g = parseInt(hex.slice(3, 5), 16);
|
|
3444
|
+
var b = parseInt(hex.slice(5, 7), 16);
|
|
3445
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
|
3446
|
+
};
|
|
3447
|
+
|
|
3128
3448
|
function KittThemeProvider(_ref) {
|
|
3129
3449
|
var children = _ref.children;
|
|
3130
3450
|
var theme = useKittTheme();
|
|
@@ -3157,5 +3477,5 @@ function MatchWindowSize(_ref) {
|
|
|
3157
3477
|
});
|
|
3158
3478
|
}
|
|
3159
3479
|
|
|
3160
|
-
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 };
|
|
3480
|
+
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 };
|
|
3161
3481
|
//# sourceMappingURL=index-browser-all.es.web.js.map
|