@ornikar/kitt-universal 2.1.1 → 2.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/Button.d.ts +6 -3
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/{ButtonContainer.d.ts → ButtonPressable.d.ts} +3 -3
- package/dist/definitions/Button/{ButtonContainer.d.ts.map → ButtonPressable.d.ts.map} +1 -1
- package/dist/definitions/Emoji/Emoji.d.ts +8 -0
- package/dist/definitions/Emoji/Emoji.d.ts.map +1 -0
- package/dist/definitions/ExternalLink/ExternalLink.d.ts +18 -0
- package/dist/definitions/ExternalLink/ExternalLink.d.ts.map +1 -0
- package/dist/definitions/ExternalLink/ExternalLink.web.d.ts +4 -0
- package/dist/definitions/ExternalLink/ExternalLink.web.d.ts.map +1 -0
- package/dist/definitions/ExternalLink/ExternalLinkOpenLinkBehavior.d.ts +24 -0
- package/dist/definitions/ExternalLink/ExternalLinkOpenLinkBehavior.d.ts.map +1 -0
- package/dist/definitions/Tag/Tag.d.ts +6 -3
- package/dist/definitions/Tag/Tag.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +9 -1
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveImage.d.ts +13 -0
- package/dist/definitions/primitives/PrimitiveImage.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveImage.web.d.ts +4 -0
- package/dist/definitions/primitives/PrimitiveImage.web.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveLink.d.ts +3 -1
- package/dist/definitions/primitives/PrimitiveLink.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveLink.web.d.ts +1 -1
- package/dist/definitions/primitives/PrimitiveLink.web.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitivePressable.d.ts +3 -0
- package/dist/definitions/primitives/PrimitivePressable.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitivePressable.web.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveScrollView.d.ts +1 -0
- package/dist/definitions/primitives/PrimitiveScrollView.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveView.d.ts +3 -0
- package/dist/definitions/primitives/PrimitiveView.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveView.web.d.ts +6 -2
- package/dist/definitions/primitives/PrimitiveView.web.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryDecorator.d.ts +3 -3
- package/dist/definitions/story-components/StoryDecorator.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +30 -3
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts +30 -3
- package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +3 -3
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyEmoji.d.ts +8 -0
- package/dist/definitions/typography/TypographyEmoji.d.ts.map +1 -0
- package/dist/definitions/typography/TypographyLink.d.ts +7 -4
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/definitions/utils/storybook/decorators/SafeAreaProviderDecorator.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +329 -151
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +329 -151
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +279 -96
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +387 -167
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +250 -66
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +5 -2
- package/dist/definitions/Button/useButton.d.ts +0 -6
- package/dist/definitions/Button/useButton.d.ts.map +0 -1
|
@@ -3,11 +3,13 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
4
4
|
import { UserIcon, EyeIcon, EyeOffIcon, XIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon } from '@ornikar/kitt-icons';
|
|
5
5
|
export * from '@ornikar/kitt-icons';
|
|
6
|
-
import React, { useRef, useEffect, useContext, createContext, useState, forwardRef, Fragment
|
|
7
|
-
import { View, Animated, Easing, Text as Text$1, Image, Pressable, TextInput, useWindowDimensions, ActivityIndicator, TouchableOpacity, StyleSheet, ScrollView, Modal as Modal$1 } from 'react-native';
|
|
6
|
+
import React, { useRef, useEffect, useContext, createContext, useState, useMemo, forwardRef, Fragment } from 'react';
|
|
7
|
+
import { View, Animated, Easing, Text as Text$1, Image, Pressable, Linking, TextInput, useWindowDimensions, ActivityIndicator, TouchableOpacity, StyleSheet, ScrollView, Modal as Modal$1 } from 'react-native';
|
|
8
8
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
9
9
|
import styled, { useTheme, css, ThemeProvider } from 'styled-components';
|
|
10
10
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
11
|
+
import { parse } from 'twemoji-parser';
|
|
12
|
+
import { openBrowserAsync } from 'expo-web-browser';
|
|
11
13
|
import { useSafeAreaInsets, SafeAreaProvider } from 'react-native-safe-area-context';
|
|
12
14
|
import Animated$1, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
13
15
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
@@ -46,8 +48,8 @@ function SpinningIcon(_ref) {
|
|
|
46
48
|
}, children);
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
var _templateObject$
|
|
50
|
-
var IconContainer$2 = styled(PrimitiveView)(_templateObject$
|
|
51
|
+
var _templateObject$w;
|
|
52
|
+
var IconContainer$2 = styled(PrimitiveView)(_templateObject$w || (_templateObject$w = _taggedTemplateLiteral(["\n color: ", ";\n width: ", "px;\n height: ", "px;\n align-self: ", ";\n"])), function (_ref) {
|
|
51
53
|
var color = _ref.color;
|
|
52
54
|
return color;
|
|
53
55
|
}, function (_ref2) {
|
|
@@ -80,15 +82,15 @@ function Icon(_ref5) {
|
|
|
80
82
|
|
|
81
83
|
var PrimitiveText = Text$1;
|
|
82
84
|
|
|
83
|
-
var _excluded$
|
|
85
|
+
var _excluded$a = ["accessibilityRole", "base", "variant", "color"];
|
|
84
86
|
|
|
85
|
-
var _templateObject$
|
|
87
|
+
var _templateObject$v;
|
|
86
88
|
var TypographyTypeContext = /*#__PURE__*/createContext(undefined);
|
|
87
89
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
88
90
|
function useTypographyColor() {
|
|
89
91
|
return useContext(TypographyColorContext);
|
|
90
92
|
}
|
|
91
|
-
var StyledTypography = styled(PrimitiveText)(_templateObject$
|
|
93
|
+
var StyledTypography = styled(PrimitiveText)(_templateObject$v || (_templateObject$v = _taggedTemplateLiteral(["\n /* font */\n ", "\n\n /* color */\n ", "\n"])), function (_ref) {
|
|
92
94
|
var theme = _ref.theme,
|
|
93
95
|
isHeader = _ref.isHeader,
|
|
94
96
|
type = _ref.type,
|
|
@@ -118,7 +120,7 @@ function Typography(_ref3) {
|
|
|
118
120
|
base = _ref3.base,
|
|
119
121
|
variant = _ref3.variant,
|
|
120
122
|
color = _ref3.color,
|
|
121
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded$
|
|
123
|
+
otherProps = _objectWithoutProperties(_ref3, _excluded$a);
|
|
122
124
|
|
|
123
125
|
var typeInContext = useContext(TypographyTypeContext);
|
|
124
126
|
var isHeader = isTypographyHeader(base, typeInContext);
|
|
@@ -197,9 +199,9 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
197
199
|
|
|
198
200
|
Typography.h5 = createHeading(5, 'header5');
|
|
199
201
|
|
|
200
|
-
var _excluded$
|
|
202
|
+
var _excluded$9 = ["size"];
|
|
201
203
|
|
|
202
|
-
var _templateObject$
|
|
204
|
+
var _templateObject$u;
|
|
203
205
|
|
|
204
206
|
var getFirstCharacter = function (string) {
|
|
205
207
|
return string ? string[0] : '';
|
|
@@ -209,7 +211,7 @@ var getInitials = function (firstname, lastname) {
|
|
|
209
211
|
return (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
|
|
210
212
|
};
|
|
211
213
|
|
|
212
|
-
var StyledAvatarView = styled(PrimitiveView)(_templateObject$
|
|
214
|
+
var StyledAvatarView = styled(PrimitiveView)(_templateObject$u || (_templateObject$u = _taggedTemplateLiteral(["\n border-radius: ", "px;\n background-color: ", ";\n height: ", "px;\n width: ", "px;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n"])), function (_ref) {
|
|
213
215
|
var round = _ref.round,
|
|
214
216
|
size = _ref.size;
|
|
215
217
|
return round ? size / 2 : 10;
|
|
@@ -263,7 +265,7 @@ function AvatarContent(_ref5) {
|
|
|
263
265
|
function Avatar(_ref6) {
|
|
264
266
|
var _ref6$size = _ref6.size,
|
|
265
267
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
266
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
268
|
+
rest = _objectWithoutProperties(_ref6, _excluded$9);
|
|
267
269
|
|
|
268
270
|
return /*#__PURE__*/React.createElement(StyledAvatarView, _extends({}, rest, {
|
|
269
271
|
size: size
|
|
@@ -272,50 +274,7 @@ function Avatar(_ref6) {
|
|
|
272
274
|
})));
|
|
273
275
|
}
|
|
274
276
|
|
|
275
|
-
var
|
|
276
|
-
|
|
277
|
-
var _templateObject$r;
|
|
278
|
-
var ButtonContainer = styled(PrimitivePressable)(_templateObject$r || (_templateObject$r = _taggedTemplateLiteral(["\n min-width: ", ";\n max-width: ", ";\n width: ", ";\n min-height: ", ";\n background-color: ", ";\n padding: ", ";\n flex-direction: row;\n\n /* Emulate inline-* css display by making the button taking only its necessary space */\n align-self: flex-start;\n border-radius: ", ";\n border-color: ", ";\n border-width: ", ";\n"])), function (_ref) {
|
|
279
|
-
var theme = _ref.theme;
|
|
280
|
-
return theme.kitt.button.minWidth;
|
|
281
|
-
}, function (_ref2) {
|
|
282
|
-
var theme = _ref2.theme,
|
|
283
|
-
stretch = _ref2.stretch;
|
|
284
|
-
return stretch ? 'auto' : theme.kitt.button.maxWidth;
|
|
285
|
-
}, function (_ref3) {
|
|
286
|
-
var stretch = _ref3.stretch;
|
|
287
|
-
return stretch ? '100%' : 'auto';
|
|
288
|
-
}, function (_ref4) {
|
|
289
|
-
var theme = _ref4.theme;
|
|
290
|
-
return theme.kitt.button.minHeight;
|
|
291
|
-
}, function (_ref5) {
|
|
292
|
-
var theme = _ref5.theme,
|
|
293
|
-
isPressed = _ref5.isPressed,
|
|
294
|
-
disabled = _ref5.disabled,
|
|
295
|
-
type = _ref5.type;
|
|
296
|
-
|
|
297
|
-
if (disabled) {
|
|
298
|
-
return theme.kitt.button[type].disabledBackgroundColor;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
|
|
302
|
-
}, function (_ref6) {
|
|
303
|
-
var theme = _ref6.theme;
|
|
304
|
-
return theme.kitt.button.contentPadding["default"];
|
|
305
|
-
}, function (_ref7) {
|
|
306
|
-
var theme = _ref7.theme;
|
|
307
|
-
return theme.kitt.button.borderRadius;
|
|
308
|
-
}, function (_ref8) {
|
|
309
|
-
var theme = _ref8.theme,
|
|
310
|
-
disabled = _ref8.disabled,
|
|
311
|
-
type = _ref8.type;
|
|
312
|
-
return disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent';
|
|
313
|
-
}, function (_ref9) {
|
|
314
|
-
var theme = _ref9.theme;
|
|
315
|
-
return theme.kitt.button.borderWidth;
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
var _excluded$7 = ["color"],
|
|
277
|
+
var _excluded$8 = ["color"],
|
|
319
278
|
_excluded2$2 = ["color"];
|
|
320
279
|
|
|
321
280
|
function TypographyIconInheritColor(props) {
|
|
@@ -328,7 +287,7 @@ function TypographyIconInheritColor(props) {
|
|
|
328
287
|
|
|
329
288
|
function TypographyIconSpecifiedColor(_ref) {
|
|
330
289
|
var color = _ref.color,
|
|
331
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
290
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$8);
|
|
332
291
|
|
|
333
292
|
var theme = useTheme();
|
|
334
293
|
return /*#__PURE__*/React.createElement(Icon, _extends({}, otherProps, {
|
|
@@ -349,7 +308,7 @@ function TypographyIcon(_ref2) {
|
|
|
349
308
|
return /*#__PURE__*/React.createElement(TypographyIconInheritColor, otherProps);
|
|
350
309
|
}
|
|
351
310
|
|
|
352
|
-
var _templateObject$
|
|
311
|
+
var _templateObject$t, _templateObject2$c, _templateObject3$8;
|
|
353
312
|
|
|
354
313
|
var getTextColorByType = function (type, isPressed, disabled) {
|
|
355
314
|
if (disabled) return 'black-light';
|
|
@@ -370,7 +329,7 @@ var getTextColorByType = function (type, isPressed, disabled) {
|
|
|
370
329
|
}
|
|
371
330
|
};
|
|
372
331
|
|
|
373
|
-
var ButtonText = styled(Typography.Text)(_templateObject$
|
|
332
|
+
var ButtonText = styled(Typography.Text)(_templateObject$t || (_templateObject$t = _taggedTemplateLiteral(["\n /* On native code, this is the only way to ensure that the text is centered */\n text-align: center;\n"])));
|
|
374
333
|
var Content$1 = styled(PrimitiveView)(_templateObject2$c || (_templateObject2$c = _taggedTemplateLiteral(["\n flex-direction: row;\n align-items: center;\n justify-content: center;\n\n /*\n On native code flex grow does not work as expected which cause an issue with the flex props.\n In order to occupy only the needed space, we enable flex grow only when stretched\n */\n flex: ", ";\n"])), function (_ref) {
|
|
375
334
|
var stretch = _ref.stretch,
|
|
376
335
|
iconOnly = _ref.iconOnly;
|
|
@@ -454,22 +413,48 @@ function ButtonContent(_ref4) {
|
|
|
454
413
|
})) : null);
|
|
455
414
|
}
|
|
456
415
|
|
|
457
|
-
var
|
|
458
|
-
var _useState = useState(false),
|
|
459
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
460
|
-
isPressed = _useState2[0],
|
|
461
|
-
setIsPressed = _useState2[1];
|
|
416
|
+
var PrimitivePressable = Pressable;
|
|
462
417
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
418
|
+
var _templateObject$s;
|
|
419
|
+
var ButtonPressable = styled(PrimitivePressable)(_templateObject$s || (_templateObject$s = _taggedTemplateLiteral(["\n min-width: ", ";\n max-width: ", ";\n width: ", ";\n min-height: ", ";\n background-color: ", ";\n padding: ", ";\n flex-direction: row;\n\n /* Emulate inline-* css display by making the button taking only its necessary space */\n align-self: flex-start;\n border-radius: ", ";\n border-color: ", ";\n border-width: ", ";\n"])), function (_ref) {
|
|
420
|
+
var theme = _ref.theme;
|
|
421
|
+
return theme.kitt.button.minWidth;
|
|
422
|
+
}, function (_ref2) {
|
|
423
|
+
var theme = _ref2.theme,
|
|
424
|
+
stretch = _ref2.stretch;
|
|
425
|
+
return stretch ? 'auto' : theme.kitt.button.maxWidth;
|
|
426
|
+
}, function (_ref3) {
|
|
427
|
+
var stretch = _ref3.stretch;
|
|
428
|
+
return stretch ? '100%' : 'auto';
|
|
429
|
+
}, function (_ref4) {
|
|
430
|
+
var theme = _ref4.theme;
|
|
431
|
+
return theme.kitt.button.minHeight;
|
|
432
|
+
}, function (_ref5) {
|
|
433
|
+
var theme = _ref5.theme,
|
|
434
|
+
isPressed = _ref5.isPressed,
|
|
435
|
+
disabled = _ref5.disabled,
|
|
436
|
+
type = _ref5.type;
|
|
437
|
+
|
|
438
|
+
if (disabled) {
|
|
439
|
+
return theme.kitt.button[type].disabledBackgroundColor;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
|
|
443
|
+
}, function (_ref6) {
|
|
444
|
+
var theme = _ref6.theme;
|
|
445
|
+
return theme.kitt.button.contentPadding["default"];
|
|
446
|
+
}, function (_ref7) {
|
|
447
|
+
var theme = _ref7.theme;
|
|
448
|
+
return theme.kitt.button.borderRadius;
|
|
449
|
+
}, function (_ref8) {
|
|
450
|
+
var theme = _ref8.theme,
|
|
451
|
+
disabled = _ref8.disabled,
|
|
452
|
+
type = _ref8.type;
|
|
453
|
+
return disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent';
|
|
454
|
+
}, function (_ref9) {
|
|
455
|
+
var theme = _ref9.theme;
|
|
456
|
+
return theme.kitt.button.borderWidth;
|
|
457
|
+
});
|
|
473
458
|
|
|
474
459
|
function Button(_ref) {
|
|
475
460
|
var children = _ref.children,
|
|
@@ -481,29 +466,37 @@ function Button(_ref) {
|
|
|
481
466
|
iconSpin = _ref.iconSpin,
|
|
482
467
|
stretch = _ref.stretch,
|
|
483
468
|
disabled = _ref.disabled,
|
|
484
|
-
|
|
485
|
-
|
|
469
|
+
testID = _ref.testID,
|
|
470
|
+
href = _ref.href,
|
|
471
|
+
hrefAttrs = _ref.hrefAttrs,
|
|
472
|
+
onPress = _ref.onPress;
|
|
486
473
|
|
|
487
|
-
var
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
474
|
+
var _useState = useState(false),
|
|
475
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
476
|
+
isPressed = _useState2[0],
|
|
477
|
+
setIsPressed = _useState2[1];
|
|
491
478
|
|
|
492
479
|
var sharedProps = {
|
|
493
480
|
type: type,
|
|
494
481
|
stretch: stretch,
|
|
495
482
|
disabled: disabled
|
|
496
483
|
};
|
|
497
|
-
return /*#__PURE__*/React.createElement(
|
|
484
|
+
return /*#__PURE__*/React.createElement(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
498
485
|
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
499
486
|
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
500
487
|
, _extends({}, sharedProps, {
|
|
501
488
|
isPressed: isPressed,
|
|
502
489
|
accessibilityRole: "button",
|
|
503
490
|
testID: testID,
|
|
491
|
+
href: href,
|
|
492
|
+
hrefAttrs: hrefAttrs,
|
|
504
493
|
onPress: onPress,
|
|
505
|
-
onPressIn: handleButtonPressIn
|
|
506
|
-
|
|
494
|
+
onPressIn: function handleButtonPressIn() {
|
|
495
|
+
return setIsPressed(true);
|
|
496
|
+
},
|
|
497
|
+
onPressOut: function handleButtonPressOut() {
|
|
498
|
+
return setIsPressed(false);
|
|
499
|
+
}
|
|
507
500
|
}), /*#__PURE__*/React.createElement(ButtonContent, _extends({}, sharedProps, {
|
|
508
501
|
icon: icon,
|
|
509
502
|
iconPosition: iconPosition,
|
|
@@ -511,8 +504,8 @@ function Button(_ref) {
|
|
|
511
504
|
}), children));
|
|
512
505
|
}
|
|
513
506
|
|
|
514
|
-
var _templateObject$
|
|
515
|
-
var Container$5 = styled(PrimitiveView)(_templateObject$
|
|
507
|
+
var _templateObject$r;
|
|
508
|
+
var Container$5 = styled(PrimitiveView)(_templateObject$r || (_templateObject$r = _taggedTemplateLiteral(["\n background-color: ", ";\n padding: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-color: ", ";\n"])), function (_ref) {
|
|
516
509
|
var theme = _ref.theme,
|
|
517
510
|
type = _ref.type;
|
|
518
511
|
return theme.kitt.card[type].backgroundColor;
|
|
@@ -538,6 +531,86 @@ function Card(_ref6) {
|
|
|
538
531
|
}, children);
|
|
539
532
|
}
|
|
540
533
|
|
|
534
|
+
var PrimitiveImage = Image;
|
|
535
|
+
|
|
536
|
+
var _templateObject$q;
|
|
537
|
+
var StyledEmoji = styled(PrimitiveImage)(_templateObject$q || (_templateObject$q = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n"])), function (_ref) {
|
|
538
|
+
var size = _ref.size;
|
|
539
|
+
return size;
|
|
540
|
+
}, function (_ref2) {
|
|
541
|
+
var size = _ref2.size;
|
|
542
|
+
return size;
|
|
543
|
+
});
|
|
544
|
+
function Emoji(_ref3) {
|
|
545
|
+
var emoji = _ref3.emoji,
|
|
546
|
+
size = _ref3.size,
|
|
547
|
+
style = _ref3.style,
|
|
548
|
+
className = _ref3.className;
|
|
549
|
+
|
|
550
|
+
var _useMemo = useMemo(function () {
|
|
551
|
+
return parse(emoji, {
|
|
552
|
+
// on native plaforms, you can't display svg as Image
|
|
553
|
+
assetType: 'png'
|
|
554
|
+
});
|
|
555
|
+
}, [emoji]),
|
|
556
|
+
_useMemo2 = _slicedToArray(_useMemo, 1),
|
|
557
|
+
emojiData = _useMemo2[0];
|
|
558
|
+
|
|
559
|
+
if (!emojiData) return null;
|
|
560
|
+
return /*#__PURE__*/React.createElement(StyledEmoji, {
|
|
561
|
+
size: size,
|
|
562
|
+
accessibilityLabel: emojiData.text,
|
|
563
|
+
source: {
|
|
564
|
+
uri: emojiData.url
|
|
565
|
+
},
|
|
566
|
+
style: style,
|
|
567
|
+
className: className
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
var defaultOpenLinkBehavior = {
|
|
572
|
+
"native": 'openInModal',
|
|
573
|
+
web: 'targetBlank'
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
var _excluded$7 = ["as", "href", "openLinkBehavior", "onPress"];
|
|
577
|
+
function ExternalLink(_ref) {
|
|
578
|
+
var Component = _ref.as,
|
|
579
|
+
href = _ref.href,
|
|
580
|
+
_ref$openLinkBehavior = _ref.openLinkBehavior,
|
|
581
|
+
openLinkBehavior = _ref$openLinkBehavior === void 0 ? defaultOpenLinkBehavior : _ref$openLinkBehavior,
|
|
582
|
+
onPress = _ref.onPress,
|
|
583
|
+
rest = _objectWithoutProperties(_ref, _excluded$7);
|
|
584
|
+
|
|
585
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
586
|
+
onPress: function handleOnPress() {
|
|
587
|
+
if (onPress) onPress();
|
|
588
|
+
if (!href) return;
|
|
589
|
+
|
|
590
|
+
switch (openLinkBehavior["native"]) {
|
|
591
|
+
case 'openInModal':
|
|
592
|
+
case undefined:
|
|
593
|
+
Linking.openURL(href)["catch"](function (err) {
|
|
594
|
+
console.error("An error occurred while opening ".concat(href), err);
|
|
595
|
+
});
|
|
596
|
+
break;
|
|
597
|
+
|
|
598
|
+
case 'openBrowserApp':
|
|
599
|
+
openBrowserAsync(href)["catch"](function (err) {
|
|
600
|
+
console.error("An error occurred while opening ".concat(href), err);
|
|
601
|
+
});
|
|
602
|
+
break;
|
|
603
|
+
|
|
604
|
+
default:
|
|
605
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
606
|
+
throw new Error("Invalid ExternalLink native behavior: ".concat(openLinkBehavior["native"]));
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}));
|
|
612
|
+
}
|
|
613
|
+
|
|
541
614
|
var getColorFromState = function (state) {
|
|
542
615
|
switch (state) {
|
|
543
616
|
case 'invalid':
|
|
@@ -607,8 +680,8 @@ var KittBreakpointsMax = {
|
|
|
607
680
|
LARGE: KittBreakpoints.WIDE - 1
|
|
608
681
|
};
|
|
609
682
|
|
|
610
|
-
var _templateObject$
|
|
611
|
-
var FieldContainer = styled(PrimitiveView)(_templateObject$
|
|
683
|
+
var _templateObject$p, _templateObject2$b, _templateObject3$7, _templateObject4$6;
|
|
684
|
+
var FieldContainer = styled(PrimitiveView)(_templateObject$p || (_templateObject$p = _taggedTemplateLiteral(["\n padding: 5px 0 10px;\n"])));
|
|
612
685
|
var FeedbackContainer = styled(PrimitiveView)(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteral(["\n ", ";\n"])), function (_ref) {
|
|
613
686
|
var theme = _ref.theme;
|
|
614
687
|
return theme.responsive.ifWindowSizeMatches({
|
|
@@ -661,8 +734,8 @@ var useInputText = function () {
|
|
|
661
734
|
|
|
662
735
|
var _excluded$6 = ["id", "minHeight", "type", "state", "internalForceState", "disabled", "onFocus", "onBlur"];
|
|
663
736
|
|
|
664
|
-
var _templateObject$
|
|
665
|
-
var styledTextInputMixin = css(_templateObject$
|
|
737
|
+
var _templateObject$o, _templateObject2$a, _templateObject3$6, _templateObject4$5;
|
|
738
|
+
var styledTextInputMixin = css(_templateObject$o || (_templateObject$o = _taggedTemplateLiteral(["\n /* stylelint-disable declaration-property-value-allowed-list */\n background-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n border-color: ", ";\n font-size: ", ";\n color: ", ";\n font-family: ", ";\n"])), function (_ref) {
|
|
666
739
|
var theme = _ref.theme,
|
|
667
740
|
state = _ref.state;
|
|
668
741
|
return state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states["default"].backgroundColor;
|
|
@@ -811,8 +884,8 @@ function Label(_ref) {
|
|
|
811
884
|
}, children);
|
|
812
885
|
}
|
|
813
886
|
|
|
814
|
-
var _templateObject$
|
|
815
|
-
var OuterRadio = styled(PrimitiveView)(_templateObject$
|
|
887
|
+
var _templateObject$n, _templateObject2$9, _templateObject3$5, _templateObject4$4, _templateObject5;
|
|
888
|
+
var OuterRadio = styled(PrimitiveView)(_templateObject$n || (_templateObject$n = _taggedTemplateLiteral(["\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n border-radius: ", "px;\n border-width: ", ";\n border-color: ", ";\n"])), function (_ref) {
|
|
816
889
|
var theme = _ref.theme,
|
|
817
890
|
disabled = _ref.disabled;
|
|
818
891
|
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor;
|
|
@@ -901,8 +974,8 @@ function TextArea(_ref) {
|
|
|
901
974
|
}));
|
|
902
975
|
}
|
|
903
976
|
|
|
904
|
-
var _templateObject$
|
|
905
|
-
var Body = styled(PrimitiveView)(_templateObject$
|
|
977
|
+
var _templateObject$m;
|
|
978
|
+
var Body = styled(PrimitiveView)(_templateObject$m || (_templateObject$m = _taggedTemplateLiteral(["\n ", "\n background-color: ", ";\n flex: 1;\n"])), function (_ref) {
|
|
906
979
|
var theme = _ref.theme;
|
|
907
980
|
return theme.responsive.ifWindowSizeMatches({
|
|
908
981
|
minWidth: KittBreakpoints.MEDIUM
|
|
@@ -916,8 +989,8 @@ function FullScreenModalBody(_ref3) {
|
|
|
916
989
|
return /*#__PURE__*/React.createElement(Body, null, children);
|
|
917
990
|
}
|
|
918
991
|
|
|
919
|
-
var _templateObject$
|
|
920
|
-
var SideContainer = styled(PrimitiveView)(_templateObject$
|
|
992
|
+
var _templateObject$l, _templateObject2$8, _templateObject3$4;
|
|
993
|
+
var SideContainer = styled(PrimitiveView)(_templateObject$l || (_templateObject$l = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref) {
|
|
921
994
|
var theme = _ref.theme,
|
|
922
995
|
_ref$side = _ref.side,
|
|
923
996
|
side = _ref$side === void 0 ? 'left' : _ref$side;
|
|
@@ -1032,8 +1105,8 @@ function FullScreenModalHeader(_ref6) {
|
|
|
1032
1105
|
}, right) : null);
|
|
1033
1106
|
}
|
|
1034
1107
|
|
|
1035
|
-
var _templateObject$
|
|
1036
|
-
var Container$2 = styled(PrimitiveView)(_templateObject$
|
|
1108
|
+
var _templateObject$k;
|
|
1109
|
+
var Container$2 = styled(PrimitiveView)(_templateObject$k || (_templateObject$k = _taggedTemplateLiteral(["\n flex: 1;\n background-color: ", ";\n"])), function (_ref) {
|
|
1037
1110
|
var theme = _ref.theme;
|
|
1038
1111
|
return theme.kitt.colors.uiBackground;
|
|
1039
1112
|
});
|
|
@@ -1044,8 +1117,8 @@ function FullScreenModal(_ref2) {
|
|
|
1044
1117
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
1045
1118
|
FullScreenModal.Body = FullScreenModalBody;
|
|
1046
1119
|
|
|
1047
|
-
var _templateObject$
|
|
1048
|
-
var PressableIconButton = styled(PrimitivePressable)(_templateObject$
|
|
1120
|
+
var _templateObject$j;
|
|
1121
|
+
var PressableIconButton = styled(PrimitivePressable)(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n border-radius: ", "px;\n width: ", "px;\n height: ", "px;\n align-items: center;\n justify-content: center;\n position: relative;\n background-color: transparent;\n\n ", ";\n"])), function (_ref) {
|
|
1049
1122
|
var theme = _ref.theme;
|
|
1050
1123
|
return theme.kitt.iconButton.borderRadius;
|
|
1051
1124
|
}, function (_ref2) {
|
|
@@ -1062,8 +1135,8 @@ var PressableIconButton = styled(PrimitivePressable)(_templateObject$i || (_temp
|
|
|
1062
1135
|
return undefined;
|
|
1063
1136
|
});
|
|
1064
1137
|
|
|
1065
|
-
var _templateObject$
|
|
1066
|
-
var AnimatedIconButtonBackground = styled(Animated$1.View)(_templateObject$
|
|
1138
|
+
var _templateObject$i, _templateObject2$7;
|
|
1139
|
+
var AnimatedIconButtonBackground = styled(Animated$1.View)(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n width: ", "px;\n height: ", "px;\n position: absolute;\n bottom: 0;\n left: 0;\n"])), function (_ref) {
|
|
1067
1140
|
var theme = _ref.theme,
|
|
1068
1141
|
color = _ref.color,
|
|
1069
1142
|
disabled = _ref.disabled;
|
|
@@ -1170,8 +1243,8 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1170
1243
|
}), children));
|
|
1171
1244
|
}
|
|
1172
1245
|
|
|
1173
|
-
var _templateObject$
|
|
1174
|
-
var IconButtonContentBorder = styled(PrimitiveView)(_templateObject$
|
|
1246
|
+
var _templateObject$h;
|
|
1247
|
+
var IconButtonContentBorder = styled(PrimitiveView)(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral(["\n border: ", ";\n border-color: ", ";\n width: ", "px;\n height: ", "px;\n align-items: center;\n justify-content: center;\n border-radius: ", "px;\n"])), function (_ref) {
|
|
1175
1248
|
var theme = _ref.theme;
|
|
1176
1249
|
return "".concat(theme.kitt.iconButton.borderWidth, "px solid");
|
|
1177
1250
|
}, function (_ref2) {
|
|
@@ -1219,8 +1292,8 @@ function IconButton(_ref7) {
|
|
|
1219
1292
|
|
|
1220
1293
|
var _excluded$5 = ["children"];
|
|
1221
1294
|
|
|
1222
|
-
var _templateObject$
|
|
1223
|
-
var ContentView$1 = styled(PrimitiveView)(_templateObject$
|
|
1295
|
+
var _templateObject$g;
|
|
1296
|
+
var ContentView$1 = styled(PrimitiveView)(_templateObject$g || (_templateObject$g = _taggedTemplateLiteral(["\n flex: 1 0 0%;\n align-self: center;\n"])));
|
|
1224
1297
|
function ListItemContent(_ref) {
|
|
1225
1298
|
var children = _ref.children,
|
|
1226
1299
|
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
@@ -1231,8 +1304,8 @@ function ListItemContent(_ref) {
|
|
|
1231
1304
|
var _excluded$4 = ["children", "side"],
|
|
1232
1305
|
_excluded2$1 = ["children", "align"];
|
|
1233
1306
|
|
|
1234
|
-
var _templateObject$
|
|
1235
|
-
var SideContainerView = styled(PrimitiveView)(_templateObject$
|
|
1307
|
+
var _templateObject$f, _templateObject2$6;
|
|
1308
|
+
var SideContainerView = styled(PrimitiveView)(_templateObject$f || (_templateObject$f = _taggedTemplateLiteral(["\n flex-direction: row;\n margin-left: ", ";\n margin-right: ", ";\n"])), function (_ref) {
|
|
1236
1309
|
var theme = _ref.theme,
|
|
1237
1310
|
side = _ref.side;
|
|
1238
1311
|
return side === 'right' ? theme.kitt.listItem.innerMargin : 0;
|
|
@@ -1269,12 +1342,12 @@ function ListItemSideContent(_ref5) {
|
|
|
1269
1342
|
|
|
1270
1343
|
var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
|
|
1271
1344
|
|
|
1272
|
-
var _templateObject$
|
|
1345
|
+
var _templateObject$e;
|
|
1273
1346
|
|
|
1274
1347
|
function ownKeys$1(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; }
|
|
1275
1348
|
|
|
1276
1349
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1277
|
-
var ContainerView = styled(PrimitiveView)(_templateObject$
|
|
1350
|
+
var ContainerView = styled(PrimitiveView)(_templateObject$e || (_templateObject$e = _taggedTemplateLiteral(["\n flex-direction: row;\n padding: ", ";\n ", ";\n border-color: ", ";\n background-color: ", ";\n"])), function (_ref) {
|
|
1278
1351
|
var withPadding = _ref.withPadding,
|
|
1279
1352
|
theme = _ref.theme;
|
|
1280
1353
|
return withPadding ? theme.kitt.listItem.padding : 0;
|
|
@@ -1358,10 +1431,10 @@ function LargeLoader(_ref) {
|
|
|
1358
1431
|
});
|
|
1359
1432
|
}
|
|
1360
1433
|
|
|
1361
|
-
var _templateObject$
|
|
1434
|
+
var _templateObject$d, _templateObject2$5, _templateObject3$3, _templateObject4$3;
|
|
1362
1435
|
var xIconSize = 14;
|
|
1363
1436
|
var mainIconSize = 20;
|
|
1364
|
-
var Container$1 = styled(PrimitiveView)(_templateObject$
|
|
1437
|
+
var Container$1 = styled(PrimitiveView)(_templateObject$d || (_templateObject$d = _taggedTemplateLiteral(["\n border-radius: ", "px;\n background-color: ", ";\n padding-bottom: ", "px;\n padding-left: ", "px;\n padding-right: ", "px;\n padding-top: ", "px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n"])), function (_ref) {
|
|
1365
1438
|
var theme = _ref.theme,
|
|
1366
1439
|
noRadius = _ref.noRadius;
|
|
1367
1440
|
return noRadius ? 0 : theme.kitt.spacing * 5;
|
|
@@ -1484,8 +1557,8 @@ function Overlay(_ref2) {
|
|
|
1484
1557
|
|
|
1485
1558
|
var PrimitiveScrollView = ScrollView;
|
|
1486
1559
|
|
|
1487
|
-
var _templateObject$
|
|
1488
|
-
var BodyView = styled(PrimitiveView)(_templateObject$
|
|
1560
|
+
var _templateObject$c;
|
|
1561
|
+
var BodyView = styled(PrimitiveView)(_templateObject$c || (_templateObject$c = _taggedTemplateLiteral(["\n padding: ", "px ", "px;\n"])), function (_ref) {
|
|
1489
1562
|
var theme = _ref.theme;
|
|
1490
1563
|
return theme.kitt.spacing * 6;
|
|
1491
1564
|
}, function (_ref2) {
|
|
@@ -1497,8 +1570,8 @@ function ModalBody(_ref3) {
|
|
|
1497
1570
|
return /*#__PURE__*/React.createElement(PrimitiveScrollView, null, /*#__PURE__*/React.createElement(BodyView, null, children));
|
|
1498
1571
|
}
|
|
1499
1572
|
|
|
1500
|
-
var _templateObject$
|
|
1501
|
-
var FooterView = styled(PrimitiveView)(_templateObject$
|
|
1573
|
+
var _templateObject$b;
|
|
1574
|
+
var FooterView = styled(PrimitiveView)(_templateObject$b || (_templateObject$b = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n padding: ", "px;\n border-top-width: 1px;\n border-top-color: ", ";\n"])), function (_ref) {
|
|
1502
1575
|
var theme = _ref.theme;
|
|
1503
1576
|
return theme.kitt.spacing * 4;
|
|
1504
1577
|
}, function (_ref2) {
|
|
@@ -1512,8 +1585,8 @@ function ModalFooter(_ref3) {
|
|
|
1512
1585
|
|
|
1513
1586
|
var OnCloseContext = /*#__PURE__*/createContext(function () {});
|
|
1514
1587
|
|
|
1515
|
-
var _templateObject$
|
|
1516
|
-
var HeaderView = styled(PrimitiveView)(_templateObject$
|
|
1588
|
+
var _templateObject$a, _templateObject2$4, _templateObject3$2, _templateObject4$2;
|
|
1589
|
+
var HeaderView = styled(PrimitiveView)(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n position: relative;\n padding: ", "px;\n display: flex;\n flex: 0 0 auto;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n border-bottom-width: 1px;\n border-bottom-color: ", ";\n min-height: 57px;\n"])), function (_ref) {
|
|
1517
1590
|
var theme = _ref.theme;
|
|
1518
1591
|
return theme.kitt.spacing * 2;
|
|
1519
1592
|
}, function (_ref2) {
|
|
@@ -1548,8 +1621,8 @@ function ModalHeader(_ref6) {
|
|
|
1548
1621
|
})));
|
|
1549
1622
|
}
|
|
1550
1623
|
|
|
1551
|
-
var _templateObject$
|
|
1552
|
-
var ModalView = styled(PrimitiveView)(_templateObject$
|
|
1624
|
+
var _templateObject$9, _templateObject2$3;
|
|
1625
|
+
var ModalView = styled(PrimitiveView)(_templateObject$9 || (_templateObject$9 = _taggedTemplateLiteral(["\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ", "px ", "px;\n"])), function (_ref) {
|
|
1553
1626
|
var theme = _ref.theme;
|
|
1554
1627
|
return theme.kitt.spacing * 20;
|
|
1555
1628
|
}, function (_ref2) {
|
|
@@ -1608,12 +1681,12 @@ function Notification(_ref) {
|
|
|
1608
1681
|
|
|
1609
1682
|
var PrimitiveLink = Text$1;
|
|
1610
1683
|
|
|
1611
|
-
var _templateObject$
|
|
1684
|
+
var _templateObject$8;
|
|
1612
1685
|
var Flex = styled(PrimitiveView).withConfig({
|
|
1613
1686
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
1614
1687
|
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
1615
1688
|
}
|
|
1616
|
-
})(_templateObject$
|
|
1689
|
+
})(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n flex-wrap: wrap;\n padding: ", "px;\n"])), function (_ref) {
|
|
1617
1690
|
var direction = _ref.direction;
|
|
1618
1691
|
return direction;
|
|
1619
1692
|
}, function (_ref2) {
|
|
@@ -1625,7 +1698,7 @@ var Flex = styled(PrimitiveView).withConfig({
|
|
|
1625
1698
|
|
|
1626
1699
|
var storyPadding = 16;
|
|
1627
1700
|
|
|
1628
|
-
var _templateObject$
|
|
1701
|
+
var _templateObject$7;
|
|
1629
1702
|
|
|
1630
1703
|
var getBackgroundColorFromBlockColor = function (theme) {
|
|
1631
1704
|
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'transparent';
|
|
@@ -1665,7 +1738,7 @@ var useStoryBlockColor = function (color) {
|
|
|
1665
1738
|
var storyBlockColor = useContext(StoryBlockColorContext);
|
|
1666
1739
|
return color || storyBlockColor;
|
|
1667
1740
|
};
|
|
1668
|
-
var StyledStoryBlockView = styled(PrimitiveView)(_templateObject$
|
|
1741
|
+
var StyledStoryBlockView = styled(PrimitiveView)(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n padding: 16px ", "px 0;\n margin: 0 -", "px;\n background: ", ";\n"])), storyPadding, storyPadding, function (_ref) {
|
|
1669
1742
|
var theme = _ref.theme,
|
|
1670
1743
|
background = _ref.background;
|
|
1671
1744
|
return getBackgroundColorFromBlockColor(theme, background);
|
|
@@ -1682,8 +1755,8 @@ function StoryBlock(_ref2) {
|
|
|
1682
1755
|
}, children)));
|
|
1683
1756
|
}
|
|
1684
1757
|
|
|
1685
|
-
var _templateObject$
|
|
1686
|
-
var StoryTitleContainer = styled(PrimitiveView)(_templateObject$
|
|
1758
|
+
var _templateObject$6, _templateObject2$2;
|
|
1759
|
+
var StoryTitleContainer = styled(PrimitiveView)(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n margin-bottom: 30px;\n"])));
|
|
1687
1760
|
var StorySubTitleContainer = styled(PrimitiveView)(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n margin-bottom: 10px;\n"])));
|
|
1688
1761
|
function StoryTitle(_ref) {
|
|
1689
1762
|
var color = _ref.color,
|
|
@@ -1744,8 +1817,8 @@ StoryTitle.Level2 = StoryTitleLevel2;
|
|
|
1744
1817
|
StoryTitle.Level3 = StoryTitleLevel3;
|
|
1745
1818
|
StoryTitle.Level4 = StoryTitleLevel4;
|
|
1746
1819
|
|
|
1747
|
-
var _templateObject$
|
|
1748
|
-
var StoryContainer$1 = styled(PrimitiveScrollView)(_templateObject$
|
|
1820
|
+
var _templateObject$5;
|
|
1821
|
+
var StoryContainer$1 = styled(PrimitiveScrollView)(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n padding: ", "px;\n"])), storyPadding);
|
|
1749
1822
|
function Story(_ref) {
|
|
1750
1823
|
var title = _ref.title,
|
|
1751
1824
|
contentContainerStyle = _ref.contentContainerStyle,
|
|
@@ -1759,8 +1832,8 @@ var _excluded$2 = ["title", "className", "children", "internalIsDemoSection"],
|
|
|
1759
1832
|
_excluded2 = ["title", "className", "children"],
|
|
1760
1833
|
_excluded3 = ["title", "className", "children"];
|
|
1761
1834
|
|
|
1762
|
-
var _templateObject$
|
|
1763
|
-
var StyledSection = styled(PrimitiveView)(_templateObject$
|
|
1835
|
+
var _templateObject$4, _templateObject2$1, _templateObject3$1, _templateObject4$1;
|
|
1836
|
+
var StyledSection = styled(PrimitiveView)(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n margin-bottom: 32px;\n"])));
|
|
1764
1837
|
function StorySection(_ref) {
|
|
1765
1838
|
var title = _ref.title;
|
|
1766
1839
|
_ref.className;
|
|
@@ -1833,8 +1906,8 @@ function StoryDecorator(storyFn, context) {
|
|
|
1833
1906
|
}, storyFn());
|
|
1834
1907
|
}
|
|
1835
1908
|
|
|
1836
|
-
var _templateObject$
|
|
1837
|
-
var SmallScreenRow = styled(PrimitiveView)(_templateObject$
|
|
1909
|
+
var _templateObject$3, _templateObject2, _templateObject3, _templateObject4;
|
|
1910
|
+
var SmallScreenRow = styled(PrimitiveView)(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n flex-direction: column;\n margin: 0;\n"])));
|
|
1838
1911
|
var SmallScreenCol = styled(PrimitiveView)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 8px 0 16px;\n"])));
|
|
1839
1912
|
var FlexRow = styled(PrimitiveView)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex-direction: row;\n margin: 0 -4px 16px;\n"])));
|
|
1840
1913
|
var FlexCol = styled(PrimitiveView)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex-grow: 1;\n flex-basis: 0;\n margin: 0 8px;\n"])));
|
|
@@ -1884,27 +1957,64 @@ var StoryGrid = {
|
|
|
1884
1957
|
Col: StoryGridCol
|
|
1885
1958
|
};
|
|
1886
1959
|
|
|
1887
|
-
var _templateObject$
|
|
1888
|
-
var Container = styled(PrimitiveView)(_templateObject$
|
|
1960
|
+
var _templateObject$2;
|
|
1961
|
+
var Container = styled(PrimitiveView)(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-width: ", ";\n border-color: ", ";\n padding: ", ";\n border-radius: ", ";\n align-self: flex-start;\n"])), function (_ref) {
|
|
1889
1962
|
var theme = _ref.theme,
|
|
1890
|
-
type = _ref.type
|
|
1891
|
-
|
|
1963
|
+
type = _ref.type,
|
|
1964
|
+
variant = _ref.variant;
|
|
1965
|
+
return theme.kitt.tag[type][variant].backgroundColor;
|
|
1892
1966
|
}, function (_ref2) {
|
|
1893
|
-
var theme = _ref2.theme
|
|
1894
|
-
|
|
1967
|
+
var theme = _ref2.theme,
|
|
1968
|
+
type = _ref2.type,
|
|
1969
|
+
variant = _ref2.variant;
|
|
1970
|
+
return theme.kitt.tag[type][variant].borderWidth;
|
|
1895
1971
|
}, function (_ref3) {
|
|
1896
|
-
var theme = _ref3.theme
|
|
1972
|
+
var theme = _ref3.theme,
|
|
1973
|
+
type = _ref3.type,
|
|
1974
|
+
variant = _ref3.variant;
|
|
1975
|
+
return theme.kitt.tag[type][variant].borderColor;
|
|
1976
|
+
}, function (_ref4) {
|
|
1977
|
+
var theme = _ref4.theme;
|
|
1978
|
+
return theme.kitt.tag.padding;
|
|
1979
|
+
}, function (_ref5) {
|
|
1980
|
+
var theme = _ref5.theme;
|
|
1897
1981
|
return theme.kitt.tag.borderRadius;
|
|
1898
1982
|
});
|
|
1899
|
-
function
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1983
|
+
var getLabelColor = function (type, variant) {
|
|
1984
|
+
switch (type) {
|
|
1985
|
+
case 'danger':
|
|
1986
|
+
{
|
|
1987
|
+
return variant === 'outline' ? 'danger' : 'black';
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
case 'primary':
|
|
1991
|
+
{
|
|
1992
|
+
return 'primary';
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
case 'default':
|
|
1996
|
+
{
|
|
1997
|
+
return 'black';
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
default:
|
|
2001
|
+
{
|
|
2002
|
+
return 'black';
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
};
|
|
2006
|
+
function Tag(_ref6) {
|
|
2007
|
+
var label = _ref6.label,
|
|
2008
|
+
_ref6$type = _ref6.type,
|
|
2009
|
+
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
2010
|
+
_ref6$variant = _ref6.variant,
|
|
2011
|
+
variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
|
|
1903
2012
|
return /*#__PURE__*/React.createElement(Container, {
|
|
1904
|
-
type: type
|
|
2013
|
+
type: type,
|
|
2014
|
+
variant: variant
|
|
1905
2015
|
}, /*#__PURE__*/React.createElement(Typography.Text, {
|
|
1906
2016
|
base: "body-xsmall",
|
|
1907
|
-
color: type
|
|
2017
|
+
color: getLabelColor(type, variant)
|
|
1908
2018
|
}, label));
|
|
1909
2019
|
}
|
|
1910
2020
|
|
|
@@ -1959,9 +2069,9 @@ var buttonLateOceanTheme = {
|
|
|
1959
2069
|
disabledBorderColor: lateOceanColorPalette.black100
|
|
1960
2070
|
},
|
|
1961
2071
|
secondary: {
|
|
1962
|
-
backgroundColor:
|
|
2072
|
+
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
1963
2073
|
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
1964
|
-
pressedBackgroundColor:
|
|
2074
|
+
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
1965
2075
|
disabledBorderColor: lateOceanColorPalette.black100
|
|
1966
2076
|
},
|
|
1967
2077
|
subtle: {
|
|
@@ -2162,13 +2272,40 @@ var tagLateOceanTheme = {
|
|
|
2162
2272
|
borderRadius: '10px',
|
|
2163
2273
|
padding: '2px 12px',
|
|
2164
2274
|
primary: {
|
|
2165
|
-
|
|
2275
|
+
fill: {
|
|
2276
|
+
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
2277
|
+
borderWidth: '0',
|
|
2278
|
+
borderColor: lateOceanColorPalette.transparent
|
|
2279
|
+
},
|
|
2280
|
+
outline: {
|
|
2281
|
+
backgroundColor: lateOceanColorPalette.transparent,
|
|
2282
|
+
borderWidth: '1px',
|
|
2283
|
+
borderColor: lateOceanColorPalette.lateOcean
|
|
2284
|
+
}
|
|
2166
2285
|
},
|
|
2167
2286
|
"default": {
|
|
2168
|
-
|
|
2287
|
+
fill: {
|
|
2288
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
2289
|
+
borderWidth: '0',
|
|
2290
|
+
borderColor: lateOceanColorPalette.transparent
|
|
2291
|
+
},
|
|
2292
|
+
outline: {
|
|
2293
|
+
backgroundColor: lateOceanColorPalette.transparent,
|
|
2294
|
+
borderWidth: '1px',
|
|
2295
|
+
borderColor: lateOceanColorPalette.black1000
|
|
2296
|
+
}
|
|
2169
2297
|
},
|
|
2170
2298
|
danger: {
|
|
2171
|
-
|
|
2299
|
+
fill: {
|
|
2300
|
+
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
2301
|
+
borderWidth: '0',
|
|
2302
|
+
borderColor: lateOceanColorPalette.transparent
|
|
2303
|
+
},
|
|
2304
|
+
outline: {
|
|
2305
|
+
backgroundColor: lateOceanColorPalette.transparent,
|
|
2306
|
+
borderWidth: '1px',
|
|
2307
|
+
borderColor: colorsLateOceanTheme.danger
|
|
2308
|
+
}
|
|
2172
2309
|
}
|
|
2173
2310
|
};
|
|
2174
2311
|
|
|
@@ -2296,7 +2433,44 @@ function Tooltip(_ref) {
|
|
|
2296
2433
|
return /*#__PURE__*/React.createElement(PrimitiveView, null, children);
|
|
2297
2434
|
}
|
|
2298
2435
|
|
|
2299
|
-
var
|
|
2436
|
+
var _templateObject$1;
|
|
2437
|
+
|
|
2438
|
+
var isBody = function (value) {
|
|
2439
|
+
return ['body-large', 'body-medium', 'body', 'body-small', 'body-xsmall'].includes(value);
|
|
2440
|
+
};
|
|
2441
|
+
|
|
2442
|
+
function getDimensions(base, theme) {
|
|
2443
|
+
if (isBody(base)) {
|
|
2444
|
+
return theme.kitt.typography.types.bodies.configs[base];
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
return theme.kitt.typography.types.headers.configs[base];
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
var StyledTypographyEmoji = styled(Emoji)(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n align-self: center;\n\n ", "\n"])), function (_ref) {
|
|
2451
|
+
_ref.size;
|
|
2452
|
+
return undefined;
|
|
2453
|
+
/* Style Twemoji: https://github.com/twitter/twemoji#inline-styles */
|
|
2454
|
+
});
|
|
2455
|
+
function TypographyEmoji(_ref2) {
|
|
2456
|
+
var emoji = _ref2.emoji,
|
|
2457
|
+
_ref2$base = _ref2.base,
|
|
2458
|
+
base = _ref2$base === void 0 ? 'body' : _ref2$base;
|
|
2459
|
+
var theme = useTheme();
|
|
2460
|
+
var dimensions = getDimensions(base, theme);
|
|
2461
|
+
var fontSize = dimensions.baseAndSmall.fontSize;
|
|
2462
|
+
|
|
2463
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
2464
|
+
if (!fontSize.endsWith('px')) throw new Error("Unexpected font-size value: ".concat(fontSize));
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
return /*#__PURE__*/React.createElement(StyledTypographyEmoji, {
|
|
2468
|
+
size: parseInt(fontSize.slice(0, -2), 10),
|
|
2469
|
+
emoji: emoji
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
var _excluded$1 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
|
|
2300
2474
|
|
|
2301
2475
|
var _templateObject;
|
|
2302
2476
|
var StyledLink = styled(PrimitiveLink).withConfig({
|
|
@@ -2316,6 +2490,8 @@ function TypographyLink(_ref3) {
|
|
|
2316
2490
|
var children = _ref3.children,
|
|
2317
2491
|
disabled = _ref3.disabled,
|
|
2318
2492
|
noUnderline = _ref3.noUnderline,
|
|
2493
|
+
href = _ref3.href,
|
|
2494
|
+
hrefAttrs = _ref3.hrefAttrs,
|
|
2319
2495
|
onPress = _ref3.onPress,
|
|
2320
2496
|
otherProps = _objectWithoutProperties(_ref3, _excluded$1);
|
|
2321
2497
|
|
|
@@ -2324,6 +2500,8 @@ function TypographyLink(_ref3) {
|
|
|
2324
2500
|
}), /*#__PURE__*/React.createElement(StyledLink, {
|
|
2325
2501
|
disabled: disabled,
|
|
2326
2502
|
noUnderline: noUnderline,
|
|
2503
|
+
href: href,
|
|
2504
|
+
hrefAttrs: hrefAttrs,
|
|
2327
2505
|
accessibilityRole: "link",
|
|
2328
2506
|
onPress: disabled ? undefined : onPress
|
|
2329
2507
|
}, children));
|
|
@@ -2432,5 +2610,5 @@ function MatchWindowSize(_ref) {
|
|
|
2432
2610
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
2433
2611
|
}
|
|
2434
2612
|
|
|
2435
|
-
export { Avatar, Button, Card, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, PrimitiveLink, PrimitivePressable, PrimitiveScrollView, PrimitiveText, PrimitiveView, Radio, SafeAreaProviderDecorator, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, Tooltip, Typography, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
2613
|
+
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, PrimitiveImage, PrimitiveLink, PrimitivePressable, PrimitiveScrollView, PrimitiveText, PrimitiveView, Radio, SafeAreaProviderDecorator, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
2436
2614
|
//# sourceMappingURL=index-browser-all.es.android.js.map
|