@ornikar/kitt-universal 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +1 -1
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts +13 -0
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts +7 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +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 +12 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/checkbox.d.ts +13 -0
- package/dist/definitions/themes/late-ocean/checkbox.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts +12 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +2210 -2115
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +2210 -2115
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +2266 -2171
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +2231 -2134
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +977 -881
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.js +813 -717
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +15 -1
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +15 -1
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +15 -1
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +15 -1
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +15 -1
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +15 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import { UserIcon, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
|
|
3
|
+
import { UserIcon, CheckboxMark, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
|
|
4
4
|
export * from '@ornikar/kitt-icons';
|
|
5
5
|
import { Animated, Easing, useWindowDimensions, Image, Platform, Linking, TextInput, Pressable, ActivityIndicator, View, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1 } from 'react-native';
|
|
6
6
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
@@ -138,9 +138,9 @@ var KittBreakpointsMax = {
|
|
|
138
138
|
|
|
139
139
|
var _excluded$e = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
|
|
140
140
|
|
|
141
|
-
function ownKeys$
|
|
141
|
+
function ownKeys$l(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; }
|
|
142
142
|
|
|
143
|
-
function _objectSpread$
|
|
143
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
144
144
|
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
145
145
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
146
146
|
function useTypographyColor() {
|
|
@@ -233,14 +233,14 @@ function Typography(_ref4) {
|
|
|
233
233
|
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular';
|
|
234
234
|
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
235
235
|
value: isHeader,
|
|
236
|
-
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
236
|
+
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$l({
|
|
237
237
|
$color: colorOrDefaultToBlack,
|
|
238
238
|
$isHeader: isHeader,
|
|
239
239
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
240
240
|
$variant: nonNullableVariant,
|
|
241
241
|
accessibilityRole: accessibilityRole || undefined
|
|
242
242
|
}, otherProps))
|
|
243
|
-
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
243
|
+
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$l({
|
|
244
244
|
$color: colorOrDefaultToBlack,
|
|
245
245
|
$isHeader: isHeader,
|
|
246
246
|
$variant: nonNullableVariant,
|
|
@@ -253,13 +253,13 @@ function Typography(_ref4) {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
function TypographyText(props) {
|
|
256
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
256
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$l({
|
|
257
257
|
accessibilityRole: null
|
|
258
258
|
}, props));
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
function TypographyParagraph(props) {
|
|
262
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
262
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$l({
|
|
263
263
|
accessibilityRole: "paragraph"
|
|
264
264
|
}, props));
|
|
265
265
|
}
|
|
@@ -267,7 +267,7 @@ function TypographyParagraph(props) {
|
|
|
267
267
|
var createHeading = function (level, defaultBase) {
|
|
268
268
|
// https://github.com/necolas/react-native-web/issues/401
|
|
269
269
|
function TypographyHeading(props) {
|
|
270
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
270
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$l(_objectSpread$l({
|
|
271
271
|
accessibilityRole: "header",
|
|
272
272
|
base: defaultBase
|
|
273
273
|
}, props), {}, {
|
|
@@ -305,9 +305,9 @@ Typography.h5 = createHeading(5, 'header5');
|
|
|
305
305
|
|
|
306
306
|
var _excluded$d = ["size", "base", "round", "light"];
|
|
307
307
|
|
|
308
|
-
function ownKeys$
|
|
308
|
+
function ownKeys$k(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; }
|
|
309
309
|
|
|
310
|
-
function _objectSpread$
|
|
310
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
311
311
|
|
|
312
312
|
var getInitials = function (firstname, lastname) {
|
|
313
313
|
return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
|
|
@@ -384,7 +384,7 @@ function Avatar(_ref6) {
|
|
|
384
384
|
$size: size,
|
|
385
385
|
$isRound: round,
|
|
386
386
|
$isLight: light,
|
|
387
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$
|
|
387
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$k({
|
|
388
388
|
size: size,
|
|
389
389
|
base: base,
|
|
390
390
|
isLight: light
|
|
@@ -529,23 +529,23 @@ var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
|
529
529
|
var _excluded$c = ["color"],
|
|
530
530
|
_excluded2$2 = ["color"];
|
|
531
531
|
|
|
532
|
-
function ownKeys$
|
|
532
|
+
function ownKeys$j(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; }
|
|
533
533
|
|
|
534
|
-
function _objectSpread$
|
|
534
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
535
535
|
|
|
536
536
|
function TypographyIconSpecifiedColor(_ref) {
|
|
537
537
|
var color = _ref.color,
|
|
538
538
|
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
539
539
|
|
|
540
540
|
var theme = /*#__PURE__*/useTheme();
|
|
541
|
-
return /*#__PURE__*/jsx(Icon, _objectSpread$
|
|
541
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$j(_objectSpread$j({}, props), {}, {
|
|
542
542
|
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
543
543
|
}));
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
function TypographyIconInheritColor(props) {
|
|
547
547
|
var color = useTypographyColor();
|
|
548
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
548
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$j({
|
|
549
549
|
color: color
|
|
550
550
|
}, props));
|
|
551
551
|
}
|
|
@@ -555,12 +555,12 @@ function TypographyIcon(_ref2) {
|
|
|
555
555
|
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
556
556
|
|
|
557
557
|
if (color) {
|
|
558
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
558
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$j({
|
|
559
559
|
color: color
|
|
560
560
|
}, props));
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
563
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$j({}, props));
|
|
564
564
|
}
|
|
565
565
|
|
|
566
566
|
function isSubtle(type) {
|
|
@@ -569,9 +569,9 @@ function isSubtle(type) {
|
|
|
569
569
|
|
|
570
570
|
var _excluded$b = ["type", "isDisabled", "$isStretch", "icon", "children"];
|
|
571
571
|
|
|
572
|
-
function ownKeys$
|
|
572
|
+
function ownKeys$i(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; }
|
|
573
573
|
|
|
574
|
-
function _objectSpread$
|
|
574
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
575
575
|
|
|
576
576
|
var getTextColorByType = function (type) {
|
|
577
577
|
switch (type) {
|
|
@@ -677,7 +677,7 @@ function ButtonContentChildren(_ref4) {
|
|
|
677
677
|
color: isWebSubtle ? 'inherit' : color
|
|
678
678
|
};
|
|
679
679
|
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
680
|
-
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
680
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$i(_objectSpread$i({}, buttonIconSharedProps), {}, {
|
|
681
681
|
testID: "button-left-icon",
|
|
682
682
|
icon: icon
|
|
683
683
|
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
@@ -688,7 +688,7 @@ function ButtonContentChildren(_ref4) {
|
|
|
688
688
|
,
|
|
689
689
|
color: isWebSubtle ? undefined : color,
|
|
690
690
|
children: children
|
|
691
|
-
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
691
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$i(_objectSpread$i({}, buttonIconSharedProps), {}, {
|
|
692
692
|
icon: icon
|
|
693
693
|
})) : null]
|
|
694
694
|
});
|
|
@@ -721,7 +721,7 @@ function ButtonContent(_ref7) {
|
|
|
721
721
|
$isSubtle: isSubtle(type),
|
|
722
722
|
$isStretch: $isStretch,
|
|
723
723
|
$isIconOnly: Boolean(!children && icon),
|
|
724
|
-
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$
|
|
724
|
+
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$i(_objectSpread$i({
|
|
725
725
|
icon: icon,
|
|
726
726
|
type: type,
|
|
727
727
|
isDisabled: isDisabled,
|
|
@@ -860,9 +860,9 @@ var defaultOpenLinkBehavior = {
|
|
|
860
860
|
|
|
861
861
|
var _excluded$a = ["as", "href", "openLinkBehavior", "onPress"];
|
|
862
862
|
|
|
863
|
-
function ownKeys$
|
|
863
|
+
function ownKeys$h(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; }
|
|
864
864
|
|
|
865
|
-
function _objectSpread$
|
|
865
|
+
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
866
866
|
function ExternalLink(_ref) {
|
|
867
867
|
var Component = _ref.as,
|
|
868
868
|
href = _ref.href,
|
|
@@ -871,7 +871,7 @@ function ExternalLink(_ref) {
|
|
|
871
871
|
onPress = _ref.onPress,
|
|
872
872
|
rest = _objectWithoutProperties(_ref, _excluded$a);
|
|
873
873
|
|
|
874
|
-
return /*#__PURE__*/jsx(Component, _objectSpread$
|
|
874
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$h(_objectSpread$h({}, rest), {}, {
|
|
875
875
|
onPress: function handleOnPress() {
|
|
876
876
|
if (onPress) onPress();
|
|
877
877
|
if (!href) return;
|
|
@@ -900,2365 +900,2533 @@ function ExternalLink(_ref) {
|
|
|
900
900
|
}));
|
|
901
901
|
}
|
|
902
902
|
|
|
903
|
-
var
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}
|
|
926
|
-
var theme = _ref7.theme;
|
|
927
|
-
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
928
|
-
});
|
|
929
|
-
|
|
930
|
-
function getInputUIState(_ref) {
|
|
931
|
-
var isFocused = _ref.isFocused,
|
|
932
|
-
isDisabled = _ref.isDisabled,
|
|
933
|
-
formState = _ref.formState;
|
|
934
|
-
if (isDisabled) return 'disabled';
|
|
935
|
-
if (isFocused) return 'focus';
|
|
936
|
-
if (formState === 'invalid') return 'invalid';
|
|
937
|
-
return 'default';
|
|
938
|
-
}
|
|
903
|
+
var lateOceanColorPalette = {
|
|
904
|
+
lateOcean: '#4C34E0',
|
|
905
|
+
lateOceanLight1: '#705DE6',
|
|
906
|
+
lateOceanLight2: '#9485EC',
|
|
907
|
+
lateOceanLight3: '#D6BAF9',
|
|
908
|
+
warmEmbrace: '#F4D3CE',
|
|
909
|
+
warmEmbraceLight1: '#FFEDE6',
|
|
910
|
+
black1000: '#000000',
|
|
911
|
+
black800: '#2C293D',
|
|
912
|
+
black555: '#737373',
|
|
913
|
+
black200: '#CCCCCC',
|
|
914
|
+
black100: '#E5E5E5',
|
|
915
|
+
black50: '#F2F2F2',
|
|
916
|
+
black25: '#F9F9F9',
|
|
917
|
+
white: '#FFFFFF',
|
|
918
|
+
viride: '#38836D',
|
|
919
|
+
englishVermillon: '#D44148',
|
|
920
|
+
goldCrayola: '#F8C583',
|
|
921
|
+
aero: '#89BDDD',
|
|
922
|
+
transparent: 'transparent',
|
|
923
|
+
moonPurple: '#DBD6F9',
|
|
924
|
+
moonPurpleLight1: '#EDEBFC'
|
|
925
|
+
};
|
|
939
926
|
|
|
940
|
-
var
|
|
941
|
-
|
|
942
|
-
|
|
927
|
+
var colors = {
|
|
928
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
929
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
930
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
931
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
932
|
+
success: lateOceanColorPalette.viride,
|
|
933
|
+
correct: lateOceanColorPalette.viride,
|
|
934
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
935
|
+
info: lateOceanColorPalette.aero,
|
|
936
|
+
warning: lateOceanColorPalette.goldCrayola,
|
|
937
|
+
separator: lateOceanColorPalette.black100,
|
|
938
|
+
hover: lateOceanColorPalette.black100,
|
|
939
|
+
black: lateOceanColorPalette.black1000,
|
|
940
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
941
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
942
|
+
transparent: lateOceanColorPalette.transparent,
|
|
943
|
+
disabled: lateOceanColorPalette.black50,
|
|
944
|
+
overlay: {
|
|
945
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
946
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
947
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
948
|
+
}
|
|
949
|
+
};
|
|
943
950
|
|
|
944
|
-
var
|
|
951
|
+
var avatar = {
|
|
952
|
+
borderRadius: 10,
|
|
953
|
+
"default": {
|
|
954
|
+
backgroundColor: colors.primary
|
|
955
|
+
},
|
|
956
|
+
light: {
|
|
957
|
+
backgroundColor: lateOceanColorPalette.black100
|
|
958
|
+
}
|
|
959
|
+
};
|
|
945
960
|
|
|
946
|
-
|
|
961
|
+
var button = {
|
|
962
|
+
borderRadius: 30,
|
|
963
|
+
borderWidth: {
|
|
964
|
+
disabled: 2,
|
|
965
|
+
focus: 3
|
|
966
|
+
},
|
|
967
|
+
minHeight: 40,
|
|
968
|
+
minWidth: 40,
|
|
969
|
+
maxWidth: 335,
|
|
970
|
+
scale: {
|
|
971
|
+
base: {
|
|
972
|
+
"default": 1,
|
|
973
|
+
hover: 0.95,
|
|
974
|
+
active: 0.95
|
|
975
|
+
},
|
|
976
|
+
medium: {
|
|
977
|
+
hover: 1.05
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
contentPadding: {
|
|
981
|
+
"default": '8px 16px 7px',
|
|
982
|
+
large: '12px 24px 11px',
|
|
983
|
+
disabled: '6px 14px 5px'
|
|
984
|
+
},
|
|
985
|
+
transition: {
|
|
986
|
+
duration: '200ms',
|
|
987
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
988
|
+
},
|
|
989
|
+
"default": {
|
|
990
|
+
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
991
|
+
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
992
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
993
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
994
|
+
},
|
|
995
|
+
primary: {
|
|
996
|
+
backgroundColor: colors.primary,
|
|
997
|
+
pressedBackgroundColor: colors.primaryLight,
|
|
998
|
+
hoverBackgroundColor: colors.primaryLight,
|
|
999
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
1000
|
+
},
|
|
1001
|
+
white: {
|
|
1002
|
+
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
1003
|
+
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1004
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1005
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
1006
|
+
},
|
|
1007
|
+
subtle: {
|
|
1008
|
+
backgroundColor: colors.transparent,
|
|
1009
|
+
pressedBackgroundColor: colors.transparent,
|
|
1010
|
+
hoverBackgroundColor: colors.transparent,
|
|
1011
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
1012
|
+
color: colors.primary,
|
|
1013
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
1014
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
1015
|
+
},
|
|
1016
|
+
'subtle-dark': {
|
|
1017
|
+
backgroundColor: colors.transparent,
|
|
1018
|
+
pressedBackgroundColor: colors.transparent,
|
|
1019
|
+
hoverBackgroundColor: colors.transparent,
|
|
1020
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
1021
|
+
color: colors.black,
|
|
1022
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
1023
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
1024
|
+
},
|
|
1025
|
+
disabled: {
|
|
1026
|
+
backgroundColor: colors.disabled,
|
|
1027
|
+
pressedBackgroundColor: colors.disabled,
|
|
1028
|
+
hoverBackgroundColor: colors.disabled,
|
|
1029
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
1030
|
+
borderColor: lateOceanColorPalette.black100
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
947
1033
|
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1034
|
+
var card = {
|
|
1035
|
+
borderRadius: 20,
|
|
1036
|
+
borderWidth: 2,
|
|
1037
|
+
primary: {
|
|
1038
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1039
|
+
borderColor: colors.primary
|
|
1040
|
+
},
|
|
1041
|
+
secondary: {
|
|
1042
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1043
|
+
borderColor: colors.separator
|
|
1044
|
+
},
|
|
1045
|
+
subtle: {
|
|
1046
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1047
|
+
borderColor: colors.separator
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
954
1050
|
|
|
955
|
-
|
|
956
|
-
|
|
1051
|
+
var feedbackMessage = {
|
|
1052
|
+
danger: {
|
|
1053
|
+
backgroundColor: colors.danger
|
|
1054
|
+
},
|
|
1055
|
+
success: {
|
|
1056
|
+
backgroundColor: colors.success
|
|
1057
|
+
},
|
|
1058
|
+
info: {
|
|
1059
|
+
backgroundColor: colors.info
|
|
1060
|
+
},
|
|
1061
|
+
warning: {
|
|
1062
|
+
backgroundColor: colors.warning
|
|
957
1063
|
}
|
|
1064
|
+
};
|
|
958
1065
|
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
displayName: "InputText__RightInputContainer"
|
|
972
|
-
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
973
|
-
var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
974
|
-
var id = _ref4.id,
|
|
975
|
-
right = _ref4.right,
|
|
976
|
-
_ref4$minHeight = _ref4.minHeight,
|
|
977
|
-
minHeight = _ref4$minHeight === void 0 ? 0 : _ref4$minHeight,
|
|
978
|
-
formState = _ref4.state,
|
|
979
|
-
internalForceState = _ref4.internalForceState,
|
|
980
|
-
_ref4$disabled = _ref4.disabled,
|
|
981
|
-
disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
|
|
982
|
-
_ref4$autoCorrect = _ref4.autoCorrect,
|
|
983
|
-
autoCorrect = _ref4$autoCorrect === void 0 ? true : _ref4$autoCorrect,
|
|
984
|
-
_ref4$textContentType = _ref4.textContentType,
|
|
985
|
-
textContentType = _ref4$textContentType === void 0 ? 'none' : _ref4$textContentType,
|
|
986
|
-
_ref4$autoCompleteTyp = _ref4.autoCompleteType,
|
|
987
|
-
autoCompleteType = _ref4$autoCompleteTyp === void 0 ? 'off' : _ref4$autoCompleteTyp,
|
|
988
|
-
_ref4$keyboardType = _ref4.keyboardType,
|
|
989
|
-
keyboardType = _ref4$keyboardType === void 0 ? 'default' : _ref4$keyboardType,
|
|
990
|
-
_onFocus = _ref4.onFocus,
|
|
991
|
-
_onBlur = _ref4.onBlur,
|
|
992
|
-
props = _objectWithoutProperties(_ref4, _excluded$9);
|
|
993
|
-
|
|
994
|
-
var theme = /*#__PURE__*/useTheme();
|
|
995
|
-
|
|
996
|
-
var _useState = useState(false),
|
|
997
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
998
|
-
isFocused = _useState2[0],
|
|
999
|
-
setIsFocused = _useState2[1];
|
|
1066
|
+
var checkbox = {
|
|
1067
|
+
borderWidth: 2,
|
|
1068
|
+
borderRadius: 5,
|
|
1069
|
+
height: 20,
|
|
1070
|
+
width: 20,
|
|
1071
|
+
iconSize: 14,
|
|
1072
|
+
borderColor: colors.separator,
|
|
1073
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1074
|
+
checkedBorderColor: colors.primary,
|
|
1075
|
+
checkedBackgroundColor: colors.primary,
|
|
1076
|
+
markColor: colors.uiBackgroundLight
|
|
1077
|
+
};
|
|
1000
1078
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1079
|
+
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
1080
|
+
return Math.round(fontSize * lineHeightMultiplier);
|
|
1081
|
+
};
|
|
1082
|
+
var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
|
|
1083
|
+
return {
|
|
1084
|
+
baseAndSmall: {
|
|
1085
|
+
fontSize: baseAndSmallFontSize,
|
|
1086
|
+
lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
|
|
1087
|
+
},
|
|
1088
|
+
mediumAndWide: {
|
|
1089
|
+
fontSize: mediumAndWideFontSize,
|
|
1090
|
+
lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
};
|
|
1094
|
+
var typography = {
|
|
1095
|
+
colors: {
|
|
1096
|
+
black: lateOceanColorPalette.black1000,
|
|
1097
|
+
'black-anthracite': lateOceanColorPalette.black800,
|
|
1098
|
+
'black-light': lateOceanColorPalette.black555,
|
|
1099
|
+
white: lateOceanColorPalette.white,
|
|
1100
|
+
'white-light': lateOceanColorPalette.white,
|
|
1101
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
1102
|
+
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
1103
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
1104
|
+
success: lateOceanColorPalette.viride,
|
|
1105
|
+
danger: lateOceanColorPalette.englishVermillon
|
|
1106
|
+
},
|
|
1107
|
+
types: {
|
|
1108
|
+
headers: {
|
|
1109
|
+
fontFamily: {
|
|
1110
|
+
regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
1111
|
+
bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
1024
1112
|
},
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1113
|
+
fontWeight: 400,
|
|
1114
|
+
fontStyle: 'normal',
|
|
1115
|
+
configs: {
|
|
1116
|
+
// also known as xxlarge
|
|
1117
|
+
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
1118
|
+
// also known as xlarge
|
|
1119
|
+
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
1120
|
+
// also known as medium
|
|
1121
|
+
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
1122
|
+
// also known as xsmall
|
|
1123
|
+
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
1124
|
+
// also known as xxsmall
|
|
1125
|
+
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
1028
1126
|
}
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1127
|
+
},
|
|
1128
|
+
bodies: {
|
|
1129
|
+
fontFamily: {
|
|
1130
|
+
regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
1131
|
+
bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
1132
|
+
},
|
|
1133
|
+
fontWeight: {
|
|
1134
|
+
regular: 400,
|
|
1135
|
+
bold: 700
|
|
1136
|
+
},
|
|
1137
|
+
fontStyle: {
|
|
1138
|
+
regular: 'normal',
|
|
1139
|
+
bold: 'normal'
|
|
1140
|
+
},
|
|
1141
|
+
configs: {
|
|
1142
|
+
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
1143
|
+
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
1144
|
+
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
1145
|
+
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
1146
|
+
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
link: {
|
|
1151
|
+
disabledColor: lateOceanColorPalette.black200
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1036
1154
|
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1155
|
+
var inputStatesStyle = {
|
|
1156
|
+
"default": {
|
|
1157
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1158
|
+
borderColor: colors.separator,
|
|
1159
|
+
color: 'black'
|
|
1160
|
+
},
|
|
1161
|
+
pending: {
|
|
1162
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1163
|
+
borderColor: colors.separator,
|
|
1164
|
+
color: 'black'
|
|
1165
|
+
},
|
|
1166
|
+
valid: {
|
|
1167
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1168
|
+
borderColor: lateOceanColorPalette.black100,
|
|
1169
|
+
color: 'black'
|
|
1170
|
+
},
|
|
1171
|
+
hover: {
|
|
1172
|
+
borderColor: lateOceanColorPalette.black200,
|
|
1173
|
+
color: 'black'
|
|
1174
|
+
},
|
|
1175
|
+
focus: {
|
|
1176
|
+
borderColor: colors.primary,
|
|
1177
|
+
color: 'black'
|
|
1178
|
+
},
|
|
1179
|
+
disabled: {
|
|
1180
|
+
backgroundColor: colors.disabled,
|
|
1181
|
+
borderColor: colors.separator,
|
|
1182
|
+
color: 'black-light'
|
|
1183
|
+
},
|
|
1184
|
+
invalid: {
|
|
1185
|
+
borderColor: colors.separator,
|
|
1186
|
+
color: 'black'
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
var input = {
|
|
1190
|
+
color: {
|
|
1191
|
+
selection: colors.primary,
|
|
1192
|
+
placeholder: typography.colors['black-light']
|
|
1193
|
+
},
|
|
1194
|
+
borderWidth: 2,
|
|
1195
|
+
borderRadius: 10,
|
|
1196
|
+
icon: {
|
|
1197
|
+
size: 20
|
|
1198
|
+
},
|
|
1199
|
+
padding: {
|
|
1200
|
+
"default": '5px 16px',
|
|
1201
|
+
iOSSingleLine: '7px 16px'
|
|
1202
|
+
},
|
|
1203
|
+
transition: {
|
|
1204
|
+
property: 'border-color',
|
|
1205
|
+
duration: '200ms',
|
|
1206
|
+
timingFunction: 'ease-in-out'
|
|
1207
|
+
},
|
|
1208
|
+
states: inputStatesStyle
|
|
1209
|
+
};
|
|
1045
1210
|
|
|
1046
|
-
var
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1211
|
+
var inputField = {
|
|
1212
|
+
labelContainerPaddingBottom: 5,
|
|
1213
|
+
iconMarginLeft: 6
|
|
1214
|
+
};
|
|
1050
1215
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1216
|
+
var radio = {
|
|
1217
|
+
size: 18,
|
|
1218
|
+
unchecked: {
|
|
1219
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1220
|
+
borderWidth: 2,
|
|
1221
|
+
borderColor: lateOceanColorPalette.black200
|
|
1222
|
+
},
|
|
1223
|
+
checked: {
|
|
1224
|
+
backgroundColor: colors.primary,
|
|
1225
|
+
innerSize: 5,
|
|
1226
|
+
innerBackgroundColor: colors.uiBackgroundLight
|
|
1227
|
+
},
|
|
1228
|
+
disabled: {
|
|
1229
|
+
backgroundColor: colors.disabled,
|
|
1230
|
+
borderColor: colors.separator
|
|
1054
1231
|
}
|
|
1055
1232
|
};
|
|
1056
1233
|
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
children = _ref.children;
|
|
1061
|
-
return /*#__PURE__*/jsx(Typography.Text, {
|
|
1062
|
-
base: "body-small",
|
|
1063
|
-
color: getColorFromState(state),
|
|
1064
|
-
testID: testID,
|
|
1065
|
-
children: children
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1234
|
+
var textArea = {
|
|
1235
|
+
minHeight: 120
|
|
1236
|
+
};
|
|
1068
1237
|
|
|
1069
|
-
var
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
return theme.responsive.ifWindowSizeMatches({
|
|
1077
|
-
minWidth: KittBreakpoints.SMALL
|
|
1078
|
-
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
1079
|
-
});
|
|
1080
|
-
var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1081
|
-
displayName: "InputField__FieldLabelContainer"
|
|
1082
|
-
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
1083
|
-
var theme = _ref2.theme;
|
|
1084
|
-
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
1085
|
-
});
|
|
1086
|
-
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1087
|
-
displayName: "InputField__LabelContainer"
|
|
1088
|
-
})(["margin-right:", "px;"], function (_ref3) {
|
|
1089
|
-
var theme = _ref3.theme;
|
|
1090
|
-
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
1091
|
-
});
|
|
1092
|
-
function InputField(_ref4) {
|
|
1093
|
-
var label = _ref4.label,
|
|
1094
|
-
labelFeedback = _ref4.labelFeedback,
|
|
1095
|
-
input = _ref4.input,
|
|
1096
|
-
feedback = _ref4.feedback;
|
|
1097
|
-
return /*#__PURE__*/jsxs(FieldContainer, {
|
|
1098
|
-
children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
|
|
1099
|
-
children: [/*#__PURE__*/jsx(LabelContainer, {
|
|
1100
|
-
children: label
|
|
1101
|
-
}), labelFeedback]
|
|
1102
|
-
}) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
|
|
1103
|
-
children: feedback
|
|
1104
|
-
}) : null]
|
|
1105
|
-
});
|
|
1106
|
-
}
|
|
1238
|
+
var forms = {
|
|
1239
|
+
input: input,
|
|
1240
|
+
radio: radio,
|
|
1241
|
+
inputField: inputField,
|
|
1242
|
+
textArea: textArea,
|
|
1243
|
+
checkbox: checkbox
|
|
1244
|
+
};
|
|
1107
1245
|
|
|
1108
|
-
|
|
1109
|
-
|
|
1246
|
+
var fullScreenModal = {
|
|
1247
|
+
header: {
|
|
1248
|
+
paddingVertical: 12,
|
|
1249
|
+
paddingHorizontal: 16,
|
|
1250
|
+
borderColor: lateOceanColorPalette.black100
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1110
1253
|
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1254
|
+
var iconButton = {
|
|
1255
|
+
backgroundColor: 'transparent',
|
|
1256
|
+
width: 40,
|
|
1257
|
+
height: 40,
|
|
1258
|
+
borderRadius: 20,
|
|
1259
|
+
borderWidth: 2,
|
|
1260
|
+
borderColor: 'transparent',
|
|
1261
|
+
transition: {
|
|
1262
|
+
property: 'all',
|
|
1263
|
+
duration: '200ms',
|
|
1264
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
|
|
1265
|
+
},
|
|
1266
|
+
scale: {
|
|
1267
|
+
base: {
|
|
1268
|
+
"default": 1,
|
|
1269
|
+
hover: 0.95,
|
|
1270
|
+
active: 0.95
|
|
1271
|
+
},
|
|
1272
|
+
medium: {
|
|
1273
|
+
hover: 1.05
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
disabled: {
|
|
1277
|
+
scale: 1,
|
|
1278
|
+
backgroundColor: button.disabled.backgroundColor,
|
|
1279
|
+
borderColor: button.disabled.borderColor
|
|
1280
|
+
},
|
|
1281
|
+
"default": {
|
|
1282
|
+
pressedBackgroundColor: button["default"].pressedBackgroundColor
|
|
1283
|
+
},
|
|
1284
|
+
white: {
|
|
1285
|
+
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1114
1288
|
|
|
1115
|
-
|
|
1116
|
-
|
|
1289
|
+
var listItem = {
|
|
1290
|
+
padding: '12px 16px',
|
|
1291
|
+
borderColor: colors.separator,
|
|
1292
|
+
borderWidth: 1,
|
|
1293
|
+
innerMargin: 8
|
|
1294
|
+
};
|
|
1117
1295
|
|
|
1118
|
-
|
|
1119
|
-
|
|
1296
|
+
var shadows = {
|
|
1297
|
+
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
var skeleton = {
|
|
1301
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
1302
|
+
flareColor: lateOceanColorPalette.black200,
|
|
1303
|
+
animationDuration: 1000
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1306
|
+
var tag = {
|
|
1307
|
+
borderRadius: 10,
|
|
1308
|
+
padding: '2px 12px',
|
|
1309
|
+
primary: {
|
|
1310
|
+
fill: {
|
|
1311
|
+
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
1312
|
+
borderWidth: 0,
|
|
1313
|
+
borderColor: colors.transparent
|
|
1314
|
+
},
|
|
1315
|
+
outline: {
|
|
1316
|
+
backgroundColor: colors.transparent,
|
|
1317
|
+
borderWidth: 1,
|
|
1318
|
+
borderColor: colors.primary
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
"default": {
|
|
1322
|
+
fill: {
|
|
1323
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1324
|
+
borderWidth: 0,
|
|
1325
|
+
borderColor: colors.transparent
|
|
1326
|
+
},
|
|
1327
|
+
outline: {
|
|
1328
|
+
backgroundColor: colors.transparent,
|
|
1329
|
+
borderWidth: 1,
|
|
1330
|
+
borderColor: colors.black
|
|
1331
|
+
}
|
|
1332
|
+
},
|
|
1333
|
+
danger: {
|
|
1334
|
+
fill: {
|
|
1335
|
+
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
1336
|
+
borderWidth: 0,
|
|
1337
|
+
borderColor: colors.transparent
|
|
1338
|
+
},
|
|
1339
|
+
outline: {
|
|
1340
|
+
backgroundColor: colors.transparent,
|
|
1341
|
+
borderWidth: 1,
|
|
1342
|
+
borderColor: colors.danger
|
|
1343
|
+
}
|
|
1120
1344
|
}
|
|
1121
|
-
}
|
|
1345
|
+
};
|
|
1122
1346
|
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
icon: icon,
|
|
1132
|
-
size: theme.kitt.forms.input.icon.size
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1347
|
+
var tooltip = {
|
|
1348
|
+
backgroundColor: colors.black,
|
|
1349
|
+
borderRadius: 10,
|
|
1350
|
+
opacity: 0.95,
|
|
1351
|
+
horizontalPadding: 16,
|
|
1352
|
+
verticalPadding: 4,
|
|
1353
|
+
floatingPadding: 8
|
|
1354
|
+
};
|
|
1135
1355
|
|
|
1136
|
-
|
|
1356
|
+
var breakpoints = {
|
|
1357
|
+
values: {
|
|
1358
|
+
base: 0,
|
|
1359
|
+
small: 480,
|
|
1360
|
+
medium: 768,
|
|
1361
|
+
large: 1024,
|
|
1362
|
+
wide: 1280
|
|
1363
|
+
},
|
|
1364
|
+
min: {
|
|
1365
|
+
smallBreakpoint: 'min-width: 480px',
|
|
1366
|
+
mediumBreakpoint: 'min-width: 768px',
|
|
1367
|
+
largeBreakpoint: 'min-width: 1024px',
|
|
1368
|
+
wideBreakpoint: 'min-width: 1280px'
|
|
1369
|
+
},
|
|
1370
|
+
max: {
|
|
1371
|
+
smallBreakpoint: 'max-width: 479px',
|
|
1372
|
+
mediumBreakpoint: 'max-width: 767px',
|
|
1373
|
+
largeBreakpoint: 'max-width: 1023px',
|
|
1374
|
+
wideBreakpoint: 'max-width: 1279px'
|
|
1375
|
+
}
|
|
1376
|
+
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
1377
|
+
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
1137
1378
|
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1379
|
+
var theme = {
|
|
1380
|
+
spacing: 4,
|
|
1381
|
+
colors: colors,
|
|
1382
|
+
palettes: {
|
|
1383
|
+
lateOcean: lateOceanColorPalette
|
|
1384
|
+
},
|
|
1385
|
+
avatar: avatar,
|
|
1386
|
+
button: button,
|
|
1387
|
+
card: card,
|
|
1388
|
+
feedbackMessage: feedbackMessage,
|
|
1389
|
+
forms: forms,
|
|
1390
|
+
typography: typography,
|
|
1391
|
+
tag: tag,
|
|
1392
|
+
shadows: shadows,
|
|
1393
|
+
fullScreenModal: fullScreenModal,
|
|
1394
|
+
iconButton: iconButton,
|
|
1395
|
+
listItem: listItem,
|
|
1396
|
+
tooltip: tooltip,
|
|
1397
|
+
skeleton: skeleton,
|
|
1398
|
+
breakpoints: breakpoints
|
|
1399
|
+
};
|
|
1141
1400
|
|
|
1142
|
-
|
|
1401
|
+
function matchWindowSize(_ref, _ref2) {
|
|
1402
|
+
var width = _ref.width,
|
|
1403
|
+
height = _ref.height;
|
|
1404
|
+
var minWidth = _ref2.minWidth,
|
|
1405
|
+
maxWidth = _ref2.maxWidth,
|
|
1406
|
+
minHeight = _ref2.minHeight,
|
|
1407
|
+
maxHeight = _ref2.maxHeight;
|
|
1408
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
1409
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
1410
|
+
return hasWidthMatched && hasHeightMatched;
|
|
1143
1411
|
}
|
|
1412
|
+
function useMatchWindowSize(options) {
|
|
1413
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
1414
|
+
width = _useWindowDimensions.width,
|
|
1415
|
+
height = _useWindowDimensions.height;
|
|
1144
1416
|
|
|
1145
|
-
|
|
1417
|
+
return matchWindowSize({
|
|
1418
|
+
width: width,
|
|
1419
|
+
height: height
|
|
1420
|
+
}, options);
|
|
1421
|
+
}
|
|
1146
1422
|
|
|
1147
|
-
function
|
|
1423
|
+
function createWindowSizeHelper(dimensions) {
|
|
1424
|
+
return {
|
|
1425
|
+
matchWindowSize: function matchWindowSize$1(options) {
|
|
1426
|
+
return matchWindowSize(dimensions, options);
|
|
1427
|
+
},
|
|
1428
|
+
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
1429
|
+
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
1430
|
+
},
|
|
1431
|
+
mapWindowWidth: function mapWindowWidth() {
|
|
1432
|
+
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1433
|
+
widthList[_key] = arguments[_key];
|
|
1434
|
+
}
|
|
1148
1435
|
|
|
1149
|
-
|
|
1150
|
-
function
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
1436
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
1437
|
+
widthList.slice(1).forEach(function (_ref, index) {
|
|
1438
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
1439
|
+
minWidth = _ref2[0];
|
|
1154
1440
|
|
|
1155
|
-
|
|
1156
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1157
|
-
isVisible = _useState2[0],
|
|
1158
|
-
setIsVisible = _useState2[1];
|
|
1441
|
+
var previousMinWidth = widthList[index][0];
|
|
1159
1442
|
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
autoCorrect: false,
|
|
1164
|
-
secureTextEntry: !isVisible,
|
|
1165
|
-
right: right || /*#__PURE__*/jsx(InputPressable, {
|
|
1166
|
-
accessibilityRole: "button",
|
|
1167
|
-
onPress: function onPress() {
|
|
1168
|
-
return setIsVisible(function (prev) {
|
|
1169
|
-
return !prev;
|
|
1443
|
+
if (previousMinWidth > minWidth) {
|
|
1444
|
+
throw new Error("mapWindowWidth: sort your values to be mobile first. ".concat(minWidth, " is < ").concat(previousMinWidth, ", so ").concat(minWidth, " should be before ").concat(previousMinWidth, "."));
|
|
1445
|
+
}
|
|
1170
1446
|
});
|
|
1171
|
-
}
|
|
1172
|
-
children: /*#__PURE__*/jsx(InputIcon, {
|
|
1173
|
-
icon: isVisible ? /*#__PURE__*/jsx(EyeOffIcon, {}) : /*#__PURE__*/jsx(EyeIcon, {})
|
|
1174
|
-
})
|
|
1175
|
-
})
|
|
1176
|
-
}));
|
|
1177
|
-
}
|
|
1447
|
+
}
|
|
1178
1448
|
|
|
1179
|
-
function
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1449
|
+
var found = widthList.find(function (_ref3) {
|
|
1450
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
1451
|
+
minWidth = _ref4[0];
|
|
1452
|
+
_ref4[1];
|
|
1453
|
+
|
|
1454
|
+
return matchWindowSize(dimensions, {
|
|
1455
|
+
minWidth: Number(minWidth)
|
|
1456
|
+
});
|
|
1457
|
+
});
|
|
1458
|
+
if (!found) return null;
|
|
1459
|
+
return found[1];
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1189
1462
|
}
|
|
1190
1463
|
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1464
|
+
function useKittTheme() {
|
|
1465
|
+
var dimensions = useWindowDimensions();
|
|
1466
|
+
return useMemo(function () {
|
|
1467
|
+
return {
|
|
1468
|
+
kitt: theme,
|
|
1469
|
+
responsive: createWindowSizeHelper(dimensions)
|
|
1470
|
+
};
|
|
1471
|
+
}, [dimensions]);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
var CheckboxAndLabelPressableWrapper = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1475
|
+
displayName: "Checkbox__CheckboxAndLabelPressableWrapper"
|
|
1476
|
+
})(["display:flex;flex-direction:row;align-items:center;"]);
|
|
1477
|
+
var CheckboxContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1478
|
+
displayName: "Checkbox__CheckboxContainer"
|
|
1479
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:center;height:", "px;width:", "px;position:relative;border-radius:", "px;", " margin-right:", ";"], function (_ref) {
|
|
1480
|
+
var theme = _ref.theme;
|
|
1481
|
+
return theme.kitt.forms.checkbox.height;
|
|
1482
|
+
}, function (_ref2) {
|
|
1483
|
+
var theme = _ref2.theme;
|
|
1484
|
+
return theme.kitt.forms.checkbox.width;
|
|
1485
|
+
}, function (_ref3) {
|
|
1486
|
+
var theme = _ref3.theme;
|
|
1487
|
+
return theme.kitt.forms.checkbox.borderRadius;
|
|
1488
|
+
}, function (_ref4) {
|
|
1489
|
+
var $isChecked = _ref4.$isChecked,
|
|
1490
|
+
theme = _ref4.theme;
|
|
1491
|
+
var _theme$kitt$forms$che = theme.kitt.forms.checkbox,
|
|
1492
|
+
checkedBackgroundColor = _theme$kitt$forms$che.checkedBackgroundColor,
|
|
1493
|
+
checkedBorderColor = _theme$kitt$forms$che.checkedBorderColor,
|
|
1494
|
+
borderColor = _theme$kitt$forms$che.borderColor,
|
|
1495
|
+
borderWidth = _theme$kitt$forms$che.borderWidth,
|
|
1496
|
+
backgroundColor = _theme$kitt$forms$che.backgroundColor;
|
|
1497
|
+
|
|
1498
|
+
if ($isChecked) {
|
|
1499
|
+
return css(["background-color:", ";border:", ";"], checkedBackgroundColor, "".concat(borderWidth, "px solid ").concat(checkedBorderColor));
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
return css(["background-color:", ";border:", ";"], backgroundColor, "".concat(borderWidth, "px solid ").concat(borderColor));
|
|
1503
|
+
}, function (_ref5) {
|
|
1504
|
+
var theme = _ref5.theme,
|
|
1505
|
+
$hasLabel = _ref5.$hasLabel;
|
|
1506
|
+
if (!$hasLabel) return '0px';
|
|
1507
|
+
return "".concat(theme.kitt.spacing * 2.5, "px;");
|
|
1508
|
+
});
|
|
1509
|
+
function Checkbox(_ref6) {
|
|
1510
|
+
var onChange = _ref6.onChange,
|
|
1511
|
+
onBlur = _ref6.onBlur,
|
|
1512
|
+
onFocus = _ref6.onFocus,
|
|
1513
|
+
value = _ref6.value,
|
|
1514
|
+
_ref6$hitSlop = _ref6.hitSlop,
|
|
1515
|
+
hitSlop = _ref6$hitSlop === void 0 ? 40 : _ref6$hitSlop,
|
|
1516
|
+
id = _ref6.id,
|
|
1517
|
+
children = _ref6.children;
|
|
1518
|
+
var theme = useKittTheme();
|
|
1519
|
+
return /*#__PURE__*/jsxs(CheckboxAndLabelPressableWrapper, {
|
|
1520
|
+
accessibilityRole: "checkbox",
|
|
1521
|
+
accessibilityState: {
|
|
1522
|
+
checked: value
|
|
1523
|
+
},
|
|
1524
|
+
hitSlop: hitSlop,
|
|
1525
|
+
onPress: function handlePress(e) {
|
|
1526
|
+
if (onFocus) onFocus(e);
|
|
1527
|
+
if (onChange) onChange(e);
|
|
1528
|
+
if (onBlur) onBlur(e);
|
|
1529
|
+
},
|
|
1530
|
+
children: [/*#__PURE__*/jsx(CheckboxContainer, {
|
|
1531
|
+
$isChecked: value,
|
|
1532
|
+
$hasLabel: !!children,
|
|
1533
|
+
testID: id,
|
|
1534
|
+
children: value ? /*#__PURE__*/jsx(Icon, {
|
|
1535
|
+
align: "center",
|
|
1536
|
+
color: theme.kitt.forms.checkbox.markColor,
|
|
1537
|
+
size: theme.kitt.forms.checkbox.iconSize,
|
|
1538
|
+
icon: /*#__PURE__*/jsx(CheckboxMark, {})
|
|
1539
|
+
}) : null
|
|
1540
|
+
}), children]
|
|
1541
|
+
});
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
|
|
1194
1545
|
var theme = _ref.theme,
|
|
1195
|
-
|
|
1196
|
-
return theme.kitt.forms.
|
|
1546
|
+
$state = _ref.$state;
|
|
1547
|
+
return $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states["default"].backgroundColor;
|
|
1197
1548
|
}, function (_ref2) {
|
|
1198
1549
|
var theme = _ref2.theme;
|
|
1199
|
-
return theme.kitt.forms.
|
|
1550
|
+
return theme.kitt.forms.input.borderWidth;
|
|
1200
1551
|
}, function (_ref3) {
|
|
1201
1552
|
var theme = _ref3.theme;
|
|
1202
|
-
return theme.kitt.forms.
|
|
1553
|
+
return theme.kitt.forms.input.borderRadius;
|
|
1203
1554
|
}, function (_ref4) {
|
|
1204
|
-
var theme = _ref4.theme
|
|
1205
|
-
|
|
1555
|
+
var theme = _ref4.theme,
|
|
1556
|
+
$state = _ref4.$state;
|
|
1557
|
+
return theme.kitt.forms.input.states[$state].borderColor;
|
|
1206
1558
|
}, function (_ref5) {
|
|
1207
1559
|
var theme = _ref5.theme;
|
|
1208
|
-
|
|
1560
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
1561
|
+
return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize, "px");
|
|
1209
1562
|
}, function (_ref6) {
|
|
1210
1563
|
var theme = _ref6.theme,
|
|
1211
|
-
|
|
1212
|
-
return theme.kitt.forms.
|
|
1213
|
-
})
|
|
1214
|
-
var SelectedOuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1215
|
-
displayName: "Radio__SelectedOuterRadio"
|
|
1216
|
-
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], function (_ref7) {
|
|
1564
|
+
$state = _ref6.$state;
|
|
1565
|
+
return theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color];
|
|
1566
|
+
}, function (_ref7) {
|
|
1217
1567
|
var theme = _ref7.theme;
|
|
1218
|
-
return theme.kitt.
|
|
1219
|
-
}, function (_ref8) {
|
|
1220
|
-
var theme = _ref8.theme;
|
|
1221
|
-
return theme.kitt.forms.radio.size;
|
|
1222
|
-
}, function (_ref9) {
|
|
1223
|
-
var theme = _ref9.theme;
|
|
1224
|
-
return theme.kitt.forms.radio.size;
|
|
1225
|
-
}, function (_ref10) {
|
|
1226
|
-
var theme = _ref10.theme;
|
|
1227
|
-
return theme.kitt.forms.radio.size / 2;
|
|
1228
|
-
});
|
|
1229
|
-
var SelectedInnerRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1230
|
-
displayName: "Radio__SelectedInnerRadio"
|
|
1231
|
-
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], function (_ref11) {
|
|
1232
|
-
var theme = _ref11.theme;
|
|
1233
|
-
return theme.kitt.forms.radio.checked.innerBackgroundColor;
|
|
1234
|
-
}, function (_ref12) {
|
|
1235
|
-
var theme = _ref12.theme;
|
|
1236
|
-
return theme.kitt.forms.radio.checked.innerSize;
|
|
1237
|
-
}, function (_ref13) {
|
|
1238
|
-
var theme = _ref13.theme;
|
|
1239
|
-
return theme.kitt.forms.radio.checked.innerSize;
|
|
1240
|
-
}, function (_ref14) {
|
|
1241
|
-
var theme = _ref14.theme;
|
|
1242
|
-
return theme.kitt.forms.radio.checked.innerSize / 2;
|
|
1243
|
-
});
|
|
1244
|
-
var Container$4 = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1245
|
-
displayName: "Radio__Container"
|
|
1246
|
-
})(["flex-direction:row;align-items:center;"]);
|
|
1247
|
-
var Text = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
1248
|
-
displayName: "Radio__Text"
|
|
1249
|
-
})(["margin-left:", "px;"], function (_ref15) {
|
|
1250
|
-
var theme = _ref15.theme;
|
|
1251
|
-
return theme.kitt.spacing * 2;
|
|
1568
|
+
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
1252
1569
|
});
|
|
1253
|
-
function Radio(_ref16) {
|
|
1254
|
-
var id = _ref16.id,
|
|
1255
|
-
checked = _ref16.checked,
|
|
1256
|
-
onChange = _ref16.onChange,
|
|
1257
|
-
value = _ref16.value,
|
|
1258
|
-
_ref16$disabled = _ref16.disabled,
|
|
1259
|
-
disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
|
|
1260
|
-
children = _ref16.children;
|
|
1261
|
-
return /*#__PURE__*/jsxs(Container$4, {
|
|
1262
|
-
nativeID: id,
|
|
1263
|
-
disabled: disabled,
|
|
1264
|
-
accessibilityRole: "radio",
|
|
1265
|
-
"aria-checked": checked,
|
|
1266
|
-
focusable: checked && !disabled,
|
|
1267
|
-
onPress: function handlePress() {
|
|
1268
|
-
onChange(value);
|
|
1269
|
-
},
|
|
1270
|
-
children: [checked && !disabled ? /*#__PURE__*/jsx(SelectedOuterRadio, {
|
|
1271
|
-
children: /*#__PURE__*/jsx(SelectedInnerRadio, {})
|
|
1272
|
-
}) : /*#__PURE__*/jsx(OuterRadio, {
|
|
1273
|
-
disabled: disabled
|
|
1274
|
-
}), /*#__PURE__*/jsx(Text, {
|
|
1275
|
-
base: "body",
|
|
1276
|
-
color: disabled ? 'black-light' : 'black',
|
|
1277
|
-
children: children
|
|
1278
|
-
})]
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
1570
|
|
|
1282
|
-
function
|
|
1571
|
+
function getInputUIState(_ref) {
|
|
1572
|
+
var isFocused = _ref.isFocused,
|
|
1573
|
+
isDisabled = _ref.isDisabled,
|
|
1574
|
+
formState = _ref.formState;
|
|
1575
|
+
if (isDisabled) return 'disabled';
|
|
1576
|
+
if (isFocused) return 'focus';
|
|
1577
|
+
if (formState === 'invalid') return 'invalid';
|
|
1578
|
+
return 'default';
|
|
1579
|
+
}
|
|
1283
1580
|
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1581
|
+
var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1582
|
+
displayName: "InputTextContainer"
|
|
1583
|
+
})(["position:relative;"]);
|
|
1287
1584
|
|
|
1288
|
-
|
|
1289
|
-
return /*#__PURE__*/jsx(InputText, _objectSpread$b({
|
|
1290
|
-
multiline: true,
|
|
1291
|
-
textAlignVertical: "top",
|
|
1292
|
-
minHeight: theme.kitt.forms.textArea.minHeight
|
|
1293
|
-
}, props));
|
|
1294
|
-
}
|
|
1585
|
+
var _excluded$9 = ["id", "right", "minHeight", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoCompleteType", "keyboardType", "onFocus", "onBlur"];
|
|
1295
1586
|
|
|
1296
|
-
var
|
|
1297
|
-
displayName: "Body"
|
|
1298
|
-
})(["", " background-color:", ";flex:1;"], function (_ref) {
|
|
1299
|
-
var theme = _ref.theme;
|
|
1300
|
-
return theme.responsive.ifWindowSizeMatches({
|
|
1301
|
-
minWidth: KittBreakpoints.MEDIUM
|
|
1302
|
-
}, "padding-right: ".concat(theme.kitt.spacing * 12, "px;\n padding-left: ").concat(theme.kitt.spacing * 12, "px;"), "padding-right: ".concat(theme.kitt.spacing * 6, "px;\n padding-left: ").concat(theme.kitt.spacing * 6, "px;"));
|
|
1303
|
-
}, function (_ref2) {
|
|
1304
|
-
var theme = _ref2.theme;
|
|
1305
|
-
return theme.kitt.colors.uiBackgroundLight;
|
|
1306
|
-
});
|
|
1307
|
-
function FullScreenModalBody(_ref3) {
|
|
1308
|
-
var children = _ref3.children;
|
|
1309
|
-
return /*#__PURE__*/jsx(Body, {
|
|
1310
|
-
children: children
|
|
1311
|
-
});
|
|
1312
|
-
}
|
|
1587
|
+
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; }
|
|
1313
1588
|
|
|
1314
|
-
var
|
|
1315
|
-
|
|
1316
|
-
|
|
1589
|
+
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1590
|
+
var StyledTextInput = /*#__PURE__*/styled(TextInput).withConfig({
|
|
1591
|
+
displayName: "InputText__StyledTextInput"
|
|
1592
|
+
})(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, function (_ref) {
|
|
1317
1593
|
var theme = _ref.theme,
|
|
1318
|
-
|
|
1319
|
-
side = _ref$side === void 0 ? 'left' : _ref$side;
|
|
1320
|
-
var padding = theme.kitt.spacing * 2;
|
|
1594
|
+
multiline = _ref.multiline;
|
|
1321
1595
|
|
|
1322
|
-
if (
|
|
1323
|
-
return
|
|
1596
|
+
if (!multiline && Platform.OS === 'ios') {
|
|
1597
|
+
return theme.kitt.forms.input.padding.iOSSingleLine;
|
|
1324
1598
|
}
|
|
1325
1599
|
|
|
1326
|
-
return
|
|
1327
|
-
})
|
|
1328
|
-
|
|
1329
|
-
function getHeaderHorizontalMediumPadding(spacing) {
|
|
1330
|
-
return spacing * 6;
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
var Header = /*#__PURE__*/styled.View.withConfig({
|
|
1334
|
-
displayName: "Header"
|
|
1335
|
-
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], function (_ref2) {
|
|
1600
|
+
return theme.kitt.forms.input.padding["default"];
|
|
1601
|
+
}, function (_ref2) {
|
|
1336
1602
|
var theme = _ref2.theme,
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
var
|
|
1340
|
-
|
|
1341
|
-
paddingVertical = _theme$kitt$fullScree.paddingVertical,
|
|
1342
|
-
paddingHorizontal = _theme$kitt$fullScree.paddingHorizontal;
|
|
1343
|
-
return theme.responsive.ifWindowSizeMatches({
|
|
1344
|
-
minWidth: KittBreakpoints.MEDIUM
|
|
1345
|
-
}, "padding: ".concat(paddingTop, "px ").concat(getHeaderHorizontalMediumPadding(theme.kitt.spacing), "px ").concat(paddingVertical, "px;"), "padding: ".concat(paddingTop, "px ").concat(paddingHorizontal, "px ").concat(paddingVertical, "px;"));
|
|
1603
|
+
multiline = _ref2.multiline;
|
|
1604
|
+
if (!multiline && Platform.OS === 'ios') return 0;
|
|
1605
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
1606
|
+
return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight, "px");
|
|
1346
1607
|
}, function (_ref3) {
|
|
1347
|
-
var
|
|
1348
|
-
return
|
|
1608
|
+
var $minHeight = _ref3.$minHeight;
|
|
1609
|
+
return $minHeight;
|
|
1349
1610
|
});
|
|
1350
|
-
var
|
|
1351
|
-
displayName: "
|
|
1352
|
-
})(["
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1611
|
+
var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1612
|
+
displayName: "InputText__RightInputContainer"
|
|
1613
|
+
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
1614
|
+
var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
1615
|
+
var id = _ref4.id,
|
|
1616
|
+
right = _ref4.right,
|
|
1617
|
+
_ref4$minHeight = _ref4.minHeight,
|
|
1618
|
+
minHeight = _ref4$minHeight === void 0 ? 0 : _ref4$minHeight,
|
|
1619
|
+
formState = _ref4.state,
|
|
1620
|
+
internalForceState = _ref4.internalForceState,
|
|
1621
|
+
_ref4$disabled = _ref4.disabled,
|
|
1622
|
+
disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
|
|
1623
|
+
_ref4$autoCorrect = _ref4.autoCorrect,
|
|
1624
|
+
autoCorrect = _ref4$autoCorrect === void 0 ? true : _ref4$autoCorrect,
|
|
1625
|
+
_ref4$textContentType = _ref4.textContentType,
|
|
1626
|
+
textContentType = _ref4$textContentType === void 0 ? 'none' : _ref4$textContentType,
|
|
1627
|
+
_ref4$autoCompleteTyp = _ref4.autoCompleteType,
|
|
1628
|
+
autoCompleteType = _ref4$autoCompleteTyp === void 0 ? 'off' : _ref4$autoCompleteTyp,
|
|
1629
|
+
_ref4$keyboardType = _ref4.keyboardType,
|
|
1630
|
+
keyboardType = _ref4$keyboardType === void 0 ? 'default' : _ref4$keyboardType,
|
|
1631
|
+
_onFocus = _ref4.onFocus,
|
|
1632
|
+
_onBlur = _ref4.onBlur,
|
|
1633
|
+
props = _objectWithoutProperties(_ref4, _excluded$9);
|
|
1357
1634
|
|
|
1358
|
-
|
|
1359
|
-
* Since we don't have controll over the rendered left and right elements,
|
|
1360
|
-
* we must apply some logic to give the title all the available space
|
|
1361
|
-
*/
|
|
1362
|
-
var sideElementMaxWidth = Math.max(leftWidth, rightWidth);
|
|
1363
|
-
var parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
|
|
1364
|
-
var parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
|
|
1365
|
-
|
|
1366
|
-
var computeWidth = function (breakpointPadding) {
|
|
1367
|
-
return windowWidth - breakpointPadding - sideElementMaxWidth * 2;
|
|
1368
|
-
};
|
|
1369
|
-
|
|
1370
|
-
return theme.responsive.ifWindowSizeMatches({
|
|
1371
|
-
minWidth: KittBreakpoints.MEDIUM
|
|
1372
|
-
}, "width: ".concat(computeWidth(parentHorizontalPaddingMedium), "px;"), "width: ".concat(computeWidth(parentHorizontalPadding), "px;"));
|
|
1373
|
-
}, function (_ref5) {
|
|
1374
|
-
var leftWidth = _ref5.leftWidth,
|
|
1375
|
-
rightWidth = _ref5.rightWidth;
|
|
1376
|
-
// Depending of the wider element, we must add a margin to fill the diff in space between elements
|
|
1377
|
-
var deltaMargin = Math.abs(leftWidth - rightWidth);
|
|
1635
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1378
1636
|
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1637
|
+
var _useState = useState(false),
|
|
1638
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1639
|
+
isFocused = _useState2[0],
|
|
1640
|
+
setIsFocused = _useState2[1];
|
|
1382
1641
|
|
|
1383
|
-
|
|
1642
|
+
var state = internalForceState || getInputUIState({
|
|
1643
|
+
isFocused: isFocused,
|
|
1644
|
+
isDisabled: disabled,
|
|
1645
|
+
formState: formState
|
|
1646
|
+
});
|
|
1647
|
+
return /*#__PURE__*/jsxs(InputTextContainer, {
|
|
1648
|
+
$isDisabled: disabled,
|
|
1649
|
+
children: [/*#__PURE__*/jsx(StyledTextInput, _objectSpread$g(_objectSpread$g({
|
|
1650
|
+
ref: ref,
|
|
1651
|
+
nativeID: id,
|
|
1652
|
+
editable: !disabled,
|
|
1653
|
+
keyboardType: keyboardType,
|
|
1654
|
+
autoCompleteType: autoCompleteType,
|
|
1655
|
+
autoCorrect: autoCorrect,
|
|
1656
|
+
$minHeight: minHeight,
|
|
1657
|
+
textContentType: textContentType,
|
|
1658
|
+
placeholderTextColor: theme.kitt.forms.input.color.placeholder,
|
|
1659
|
+
selectionColor: theme.kitt.forms.input.color.selection
|
|
1660
|
+
}, props), {}, {
|
|
1661
|
+
$state: state,
|
|
1662
|
+
onFocus: function onFocus(e) {
|
|
1663
|
+
setIsFocused(true);
|
|
1664
|
+
if (_onFocus) _onFocus(e);
|
|
1665
|
+
},
|
|
1666
|
+
onBlur: function onBlur(e) {
|
|
1667
|
+
setIsFocused(false);
|
|
1668
|
+
if (_onBlur) _onBlur(e);
|
|
1669
|
+
}
|
|
1670
|
+
})), right ? /*#__PURE__*/jsx(RightInputContainer, {
|
|
1671
|
+
children: right
|
|
1672
|
+
}) : null]
|
|
1673
|
+
});
|
|
1384
1674
|
});
|
|
1385
|
-
function FullScreenModalHeader(_ref6) {
|
|
1386
|
-
var children = _ref6.children,
|
|
1387
|
-
right = _ref6.right,
|
|
1388
|
-
left = _ref6.left;
|
|
1389
|
-
|
|
1390
|
-
var _useSafeAreaInsets = useSafeAreaInsets(),
|
|
1391
|
-
top = _useSafeAreaInsets.top;
|
|
1392
|
-
|
|
1393
|
-
var dimensions = useWindowDimensions();
|
|
1394
1675
|
|
|
1395
|
-
|
|
1396
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1397
|
-
leftWidth = _useState2[0],
|
|
1398
|
-
setLeftWidth = _useState2[1];
|
|
1399
|
-
|
|
1400
|
-
var _useState3 = useState(0),
|
|
1401
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1402
|
-
rightWidth = _useState4[0],
|
|
1403
|
-
setRightWidth = _useState4[1];
|
|
1676
|
+
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; }
|
|
1404
1677
|
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1678
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1679
|
+
function InputEmail(props) {
|
|
1680
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$f({
|
|
1681
|
+
autoCompleteType: "email",
|
|
1682
|
+
keyboardType: "email-address",
|
|
1683
|
+
textContentType: "emailAddress"
|
|
1684
|
+
}, props));
|
|
1685
|
+
}
|
|
1408
1686
|
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1687
|
+
var getColorFromState = function (state) {
|
|
1688
|
+
switch (state) {
|
|
1689
|
+
case 'invalid':
|
|
1690
|
+
return 'danger';
|
|
1413
1691
|
|
|
1414
|
-
|
|
1415
|
-
|
|
1692
|
+
case 'valid':
|
|
1693
|
+
default:
|
|
1694
|
+
return 'black-light';
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1416
1697
|
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
leftWidth: leftWidth,
|
|
1427
|
-
rightWidth: rightWidth,
|
|
1428
|
-
children: children
|
|
1429
|
-
}), right ? /*#__PURE__*/jsx(SideContainer, {
|
|
1430
|
-
side: "right",
|
|
1431
|
-
onLayout: function onLayout(e) {
|
|
1432
|
-
return handleLayoutChange(e, 'right');
|
|
1433
|
-
},
|
|
1434
|
-
children: right
|
|
1435
|
-
}) : null]
|
|
1698
|
+
function InputFeedback(_ref) {
|
|
1699
|
+
var state = _ref.state,
|
|
1700
|
+
testID = _ref.testID,
|
|
1701
|
+
children = _ref.children;
|
|
1702
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
1703
|
+
base: "body-small",
|
|
1704
|
+
color: getColorFromState(state),
|
|
1705
|
+
testID: testID,
|
|
1706
|
+
children: children
|
|
1436
1707
|
});
|
|
1437
1708
|
}
|
|
1438
1709
|
|
|
1439
|
-
var
|
|
1440
|
-
displayName: "
|
|
1441
|
-
})(["
|
|
1710
|
+
var FieldContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1711
|
+
displayName: "InputField__FieldContainer"
|
|
1712
|
+
})(["padding:5px 0 10px;"]);
|
|
1713
|
+
var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1714
|
+
displayName: "InputField__FeedbackContainer"
|
|
1715
|
+
})(["", ";"], function (_ref) {
|
|
1442
1716
|
var theme = _ref.theme;
|
|
1443
|
-
return theme.
|
|
1717
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
1718
|
+
minWidth: KittBreakpoints.SMALL
|
|
1719
|
+
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
1444
1720
|
});
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1721
|
+
var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1722
|
+
displayName: "InputField__FieldLabelContainer"
|
|
1723
|
+
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
1724
|
+
var theme = _ref2.theme;
|
|
1725
|
+
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
1726
|
+
});
|
|
1727
|
+
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1728
|
+
displayName: "InputField__LabelContainer"
|
|
1729
|
+
})(["margin-right:", "px;"], function (_ref3) {
|
|
1730
|
+
var theme = _ref3.theme;
|
|
1731
|
+
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
1732
|
+
});
|
|
1733
|
+
function InputField(_ref4) {
|
|
1734
|
+
var label = _ref4.label,
|
|
1735
|
+
labelFeedback = _ref4.labelFeedback,
|
|
1736
|
+
input = _ref4.input,
|
|
1737
|
+
feedback = _ref4.feedback;
|
|
1738
|
+
return /*#__PURE__*/jsxs(FieldContainer, {
|
|
1739
|
+
children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
|
|
1740
|
+
children: [/*#__PURE__*/jsx(LabelContainer, {
|
|
1741
|
+
children: label
|
|
1742
|
+
}), labelFeedback]
|
|
1743
|
+
}) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
|
|
1744
|
+
children: feedback
|
|
1745
|
+
}) : null]
|
|
1449
1746
|
});
|
|
1450
1747
|
}
|
|
1451
|
-
FullScreenModal.Header = FullScreenModalHeader;
|
|
1452
|
-
FullScreenModal.Body = FullScreenModalBody;
|
|
1453
1748
|
|
|
1454
|
-
|
|
1749
|
+
function getIconColor(state, disabled) {
|
|
1750
|
+
if (disabled) return 'black-light';
|
|
1455
1751
|
|
|
1456
|
-
|
|
1752
|
+
switch (state) {
|
|
1753
|
+
case 'invalid':
|
|
1754
|
+
return 'danger';
|
|
1457
1755
|
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
var as = _ref.as,
|
|
1461
|
-
children = _ref.children,
|
|
1462
|
-
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1756
|
+
case 'valid':
|
|
1757
|
+
return 'success';
|
|
1463
1758
|
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
children: children
|
|
1468
|
-
}));
|
|
1759
|
+
default:
|
|
1760
|
+
return undefined;
|
|
1761
|
+
}
|
|
1469
1762
|
}
|
|
1470
1763
|
|
|
1471
|
-
function
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
1482
|
-
// };
|
|
1483
|
-
// }
|
|
1484
|
-
function withTheme(WrappedComponent) {
|
|
1485
|
-
// eslint-disable-next-line prefer-arrow-callback
|
|
1486
|
-
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
1487
|
-
var theme = /*#__PURE__*/useTheme();
|
|
1488
|
-
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$9({
|
|
1489
|
-
ref: ref,
|
|
1490
|
-
theme: theme
|
|
1491
|
-
}, props));
|
|
1764
|
+
function InputIcon(_ref) {
|
|
1765
|
+
var icon = _ref.icon,
|
|
1766
|
+
state = _ref.state,
|
|
1767
|
+
disabled = _ref.disabled;
|
|
1768
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1769
|
+
var color = getIconColor(state, disabled);
|
|
1770
|
+
return /*#__PURE__*/jsx(TypographyIcon, {
|
|
1771
|
+
color: color,
|
|
1772
|
+
icon: icon,
|
|
1773
|
+
size: theme.kitt.forms.input.icon.size
|
|
1492
1774
|
});
|
|
1493
1775
|
}
|
|
1494
1776
|
|
|
1495
|
-
|
|
1777
|
+
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; }
|
|
1496
1778
|
|
|
1497
|
-
function
|
|
1779
|
+
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; }
|
|
1780
|
+
function InputPressable(_ref) {
|
|
1781
|
+
var props = _extends({}, _ref);
|
|
1498
1782
|
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
name: "PressableIconButtonWebWrapper",
|
|
1502
|
-
"class": "p1nlccvg",
|
|
1503
|
-
vars: {
|
|
1504
|
-
"p1nlccvg-0": [function (_ref) {
|
|
1505
|
-
var theme = _ref.theme,
|
|
1506
|
-
$isDisabled = _ref.$isDisabled;
|
|
1507
|
-
return $isDisabled ? 1 : theme.kitt.iconButton.scale.base.hover;
|
|
1508
|
-
}],
|
|
1509
|
-
"p1nlccvg-2": [function (_ref2) {
|
|
1510
|
-
var theme = _ref2.theme,
|
|
1511
|
-
$isDisabled = _ref2.$isDisabled;
|
|
1512
|
-
return $isDisabled ? 1 : theme.kitt.iconButton.scale.medium.hover;
|
|
1513
|
-
}],
|
|
1514
|
-
"p1nlccvg-3": [function (_ref3) {
|
|
1515
|
-
var theme = _ref3.theme,
|
|
1516
|
-
$isDisabled = _ref3.$isDisabled;
|
|
1517
|
-
return $isDisabled ? 1 : theme.kitt.iconButton.scale.base.active;
|
|
1518
|
-
}],
|
|
1519
|
-
"p1nlccvg-4": [function (_ref4) {
|
|
1520
|
-
var theme = _ref4.theme,
|
|
1521
|
-
$isWhite = _ref4.$isWhite,
|
|
1522
|
-
$isDisabled = _ref4.$isDisabled;
|
|
1523
|
-
if ($isDisabled) return theme.kitt.iconButton.disabled.backgroundColor;
|
|
1524
|
-
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
1525
|
-
white = _theme$kitt$iconButto.white,
|
|
1526
|
-
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
1527
|
-
if ($isWhite) return white.pressedBackgroundColor;
|
|
1528
|
-
return defaultIconButton.pressedBackgroundColor;
|
|
1529
|
-
}]
|
|
1530
|
-
}
|
|
1531
|
-
}));
|
|
1532
|
-
var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1533
|
-
displayName: "PressableIconButton__StyledPressableIconButton"
|
|
1534
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref5) {
|
|
1535
|
-
var theme = _ref5.theme;
|
|
1536
|
-
return theme.kitt.iconButton.borderRadius;
|
|
1537
|
-
}, function (_ref6) {
|
|
1538
|
-
var theme = _ref6.theme;
|
|
1539
|
-
return theme.kitt.iconButton.width;
|
|
1540
|
-
}, function (_ref7) {
|
|
1541
|
-
var theme = _ref7.theme;
|
|
1542
|
-
return theme.kitt.iconButton.height;
|
|
1543
|
-
}, function (_ref8) {
|
|
1544
|
-
var theme = _ref8.theme,
|
|
1545
|
-
disabled = _ref8.disabled;
|
|
1546
|
-
var iconButton = theme.kitt.iconButton;
|
|
1783
|
+
return /*#__PURE__*/jsx(Pressable, _objectSpread$e({}, props));
|
|
1784
|
+
}
|
|
1547
1785
|
|
|
1548
|
-
|
|
1549
|
-
return undefined;
|
|
1550
|
-
}
|
|
1786
|
+
var _excluded$8 = ["isPasswordDefaultVisible", "right"];
|
|
1551
1787
|
|
|
1552
|
-
|
|
1788
|
+
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; }
|
|
1553
1789
|
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1790
|
+
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; }
|
|
1791
|
+
function InputPassword(_ref) {
|
|
1792
|
+
var isPasswordDefaultVisible = _ref.isPasswordDefaultVisible,
|
|
1793
|
+
right = _ref.right,
|
|
1794
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
1557
1795
|
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
disabled = _ref9.disabled,
|
|
1563
|
-
props = _objectWithoutProperties(_ref9, _excluded$6);
|
|
1796
|
+
var _useState = useState(Boolean(isPasswordDefaultVisible)),
|
|
1797
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1798
|
+
isVisible = _useState2[0],
|
|
1799
|
+
setIsVisible = _useState2[1];
|
|
1564
1800
|
|
|
1565
|
-
return /*#__PURE__*/jsx(
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1801
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$d(_objectSpread$d({}, props), {}, {
|
|
1802
|
+
textContentType: "password",
|
|
1803
|
+
autoCompleteType: "password",
|
|
1804
|
+
autoCorrect: false,
|
|
1805
|
+
secureTextEntry: !isVisible,
|
|
1806
|
+
right: right || /*#__PURE__*/jsx(InputPressable, {
|
|
1807
|
+
accessibilityRole: "button",
|
|
1808
|
+
onPress: function onPress() {
|
|
1809
|
+
return setIsVisible(function (prev) {
|
|
1810
|
+
return !prev;
|
|
1811
|
+
});
|
|
1812
|
+
},
|
|
1813
|
+
children: /*#__PURE__*/jsx(InputIcon, {
|
|
1814
|
+
icon: isVisible ? /*#__PURE__*/jsx(EyeOffIcon, {}) : /*#__PURE__*/jsx(EyeIcon, {})
|
|
1815
|
+
})
|
|
1816
|
+
})
|
|
1817
|
+
}));
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
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; }
|
|
1821
|
+
|
|
1822
|
+
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; }
|
|
1823
|
+
function InputPhone(props) {
|
|
1824
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$c(_objectSpread$c({}, props), {}, {
|
|
1825
|
+
autoCompleteType: "tel",
|
|
1826
|
+
keyboardType: "number-pad",
|
|
1827
|
+
textContentType: "telephoneNumber"
|
|
1828
|
+
}));
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
function Label(_ref) {
|
|
1832
|
+
var htmlFor = _ref.htmlFor,
|
|
1833
|
+
children = _ref.children;
|
|
1834
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
1835
|
+
base: "body",
|
|
1836
|
+
children: Platform.OS === 'web' ? /*#__PURE__*/jsx("label", {
|
|
1837
|
+
htmlFor: htmlFor,
|
|
1838
|
+
children: children
|
|
1839
|
+
}) : children
|
|
1572
1840
|
});
|
|
1573
1841
|
}
|
|
1574
1842
|
|
|
1575
|
-
var
|
|
1576
|
-
displayName: "
|
|
1577
|
-
})(["background-color:", ";
|
|
1843
|
+
var OuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1844
|
+
displayName: "Radio__OuterRadio"
|
|
1845
|
+
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], function (_ref) {
|
|
1578
1846
|
var theme = _ref.theme,
|
|
1579
|
-
color = _ref.color,
|
|
1580
1847
|
disabled = _ref.disabled;
|
|
1581
|
-
|
|
1582
|
-
if (disabled) return iconButton.disabled.backgroundColor;
|
|
1583
|
-
if (color === 'white') return iconButton.white.pressedBackgroundColor;
|
|
1584
|
-
return iconButton["default"].pressedBackgroundColor;
|
|
1848
|
+
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor;
|
|
1585
1849
|
}, function (_ref2) {
|
|
1586
1850
|
var theme = _ref2.theme;
|
|
1587
|
-
return theme.kitt.
|
|
1851
|
+
return theme.kitt.forms.radio.size;
|
|
1588
1852
|
}, function (_ref3) {
|
|
1589
1853
|
var theme = _ref3.theme;
|
|
1590
|
-
return theme.kitt.
|
|
1854
|
+
return theme.kitt.forms.radio.size;
|
|
1591
1855
|
}, function (_ref4) {
|
|
1592
1856
|
var theme = _ref4.theme;
|
|
1593
|
-
return theme.kitt.
|
|
1857
|
+
return theme.kitt.forms.radio.size / 2;
|
|
1858
|
+
}, function (_ref5) {
|
|
1859
|
+
var theme = _ref5.theme;
|
|
1860
|
+
return theme.kitt.forms.radio.unchecked.borderWidth;
|
|
1861
|
+
}, function (_ref6) {
|
|
1862
|
+
var theme = _ref6.theme,
|
|
1863
|
+
disabled = _ref6.disabled;
|
|
1864
|
+
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor;
|
|
1594
1865
|
});
|
|
1595
|
-
var
|
|
1596
|
-
displayName: "
|
|
1597
|
-
})(["
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1866
|
+
var SelectedOuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1867
|
+
displayName: "Radio__SelectedOuterRadio"
|
|
1868
|
+
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], function (_ref7) {
|
|
1869
|
+
var theme = _ref7.theme;
|
|
1870
|
+
return theme.kitt.forms.radio.checked.backgroundColor;
|
|
1871
|
+
}, function (_ref8) {
|
|
1872
|
+
var theme = _ref8.theme;
|
|
1873
|
+
return theme.kitt.forms.radio.size;
|
|
1874
|
+
}, function (_ref9) {
|
|
1875
|
+
var theme = _ref9.theme;
|
|
1876
|
+
return theme.kitt.forms.radio.size;
|
|
1877
|
+
}, function (_ref10) {
|
|
1878
|
+
var theme = _ref10.theme;
|
|
1879
|
+
return theme.kitt.forms.radio.size / 2;
|
|
1880
|
+
});
|
|
1881
|
+
var SelectedInnerRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1882
|
+
displayName: "Radio__SelectedInnerRadio"
|
|
1883
|
+
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], function (_ref11) {
|
|
1884
|
+
var theme = _ref11.theme;
|
|
1885
|
+
return theme.kitt.forms.radio.checked.innerBackgroundColor;
|
|
1886
|
+
}, function (_ref12) {
|
|
1887
|
+
var theme = _ref12.theme;
|
|
1888
|
+
return theme.kitt.forms.radio.checked.innerSize;
|
|
1889
|
+
}, function (_ref13) {
|
|
1890
|
+
var theme = _ref13.theme;
|
|
1891
|
+
return theme.kitt.forms.radio.checked.innerSize;
|
|
1892
|
+
}, function (_ref14) {
|
|
1893
|
+
var theme = _ref14.theme;
|
|
1894
|
+
return theme.kitt.forms.radio.checked.innerSize / 2;
|
|
1895
|
+
});
|
|
1896
|
+
var Container$4 = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1897
|
+
displayName: "Radio__Container"
|
|
1898
|
+
})(["flex-direction:row;align-items:center;"]);
|
|
1899
|
+
var Text = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
1900
|
+
displayName: "Radio__Text"
|
|
1901
|
+
})(["margin-left:", "px;"], function (_ref15) {
|
|
1902
|
+
var theme = _ref15.theme;
|
|
1903
|
+
return theme.kitt.spacing * 2;
|
|
1904
|
+
});
|
|
1905
|
+
function Radio(_ref16) {
|
|
1906
|
+
var id = _ref16.id,
|
|
1907
|
+
checked = _ref16.checked,
|
|
1908
|
+
onChange = _ref16.onChange,
|
|
1909
|
+
value = _ref16.value,
|
|
1910
|
+
_ref16$disabled = _ref16.disabled,
|
|
1911
|
+
disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
|
|
1912
|
+
children = _ref16.children;
|
|
1913
|
+
return /*#__PURE__*/jsxs(Container$4, {
|
|
1914
|
+
nativeID: id,
|
|
1915
|
+
disabled: disabled,
|
|
1916
|
+
accessibilityRole: "radio",
|
|
1917
|
+
"aria-checked": checked,
|
|
1918
|
+
focusable: checked && !disabled,
|
|
1919
|
+
onPress: function handlePress() {
|
|
1920
|
+
onChange(value);
|
|
1921
|
+
},
|
|
1922
|
+
children: [checked && !disabled ? /*#__PURE__*/jsx(SelectedOuterRadio, {
|
|
1923
|
+
children: /*#__PURE__*/jsx(SelectedInnerRadio, {})
|
|
1924
|
+
}) : /*#__PURE__*/jsx(OuterRadio, {
|
|
1925
|
+
disabled: disabled
|
|
1926
|
+
}), /*#__PURE__*/jsx(Text, {
|
|
1927
|
+
base: "body",
|
|
1928
|
+
color: disabled ? 'black-light' : 'black',
|
|
1929
|
+
children: children
|
|
1930
|
+
})]
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1627
1933
|
|
|
1628
|
-
|
|
1629
|
-
}());
|
|
1630
|
-
var scaleStyles = useAnimatedStyle(function () {
|
|
1631
|
-
var _f = function () {
|
|
1632
|
-
return {
|
|
1633
|
-
transform: [{
|
|
1634
|
-
scale: withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base["default"])
|
|
1635
|
-
}]
|
|
1636
|
-
};
|
|
1637
|
-
};
|
|
1934
|
+
function ownKeys$b(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; }
|
|
1638
1935
|
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
theme: {
|
|
1643
|
-
kitt: {
|
|
1644
|
-
iconButton: {
|
|
1645
|
-
scale: {
|
|
1646
|
-
base: {
|
|
1647
|
-
active: theme.kitt.iconButton.scale.base.active,
|
|
1648
|
-
"default": theme.kitt.iconButton.scale.base["default"]
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
};
|
|
1655
|
-
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{transform:[{scale:withSpring(pressed.value?theme.kitt.iconButton.scale.base.active:theme.kitt.iconButton.scale.base.default)}]};}}";
|
|
1656
|
-
_f.__workletHash = 13861998831411;
|
|
1657
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (66:39)";
|
|
1658
|
-
_f.__optimalization = 2;
|
|
1936
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$b(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1937
|
+
function TextArea(_ref) {
|
|
1938
|
+
var props = _extends({}, _ref);
|
|
1659
1939
|
|
|
1660
|
-
|
|
1940
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1941
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$b({
|
|
1942
|
+
multiline: true,
|
|
1943
|
+
textAlignVertical: "top",
|
|
1944
|
+
minHeight: theme.kitt.forms.textArea.minHeight
|
|
1945
|
+
}, props));
|
|
1946
|
+
}
|
|
1661
1947
|
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
accessibilityRole: accessibilityRole,
|
|
1666
|
-
disabled: disabled,
|
|
1667
|
-
color: color,
|
|
1668
|
-
testID: testID,
|
|
1669
|
-
accessibilityLabel: accessibilityLabel,
|
|
1670
|
-
onPress: onPress,
|
|
1671
|
-
onPressIn: function onPressIn() {
|
|
1672
|
-
pressed.value = true;
|
|
1673
|
-
},
|
|
1674
|
-
onPressOut: function onPressOut() {
|
|
1675
|
-
pressed.value = false;
|
|
1676
|
-
},
|
|
1677
|
-
children: /*#__PURE__*/jsxs(AnimatedViewContainer, {
|
|
1678
|
-
style: disabled ? [{
|
|
1679
|
-
transform: [{
|
|
1680
|
-
scale: 1
|
|
1681
|
-
}]
|
|
1682
|
-
}] : [scaleStyles],
|
|
1683
|
-
children: [/*#__PURE__*/jsx(AnimatedIconButtonBackground, {
|
|
1684
|
-
disabled: disabled,
|
|
1685
|
-
color: color,
|
|
1686
|
-
style: disabled ? [{
|
|
1687
|
-
opacity: 1
|
|
1688
|
-
}] : [opacityStyles]
|
|
1689
|
-
}), children]
|
|
1690
|
-
})
|
|
1691
|
-
});
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
var IconButtonContentBorder = /*#__PURE__*/styled.View.withConfig({
|
|
1695
|
-
displayName: "IconButton__IconButtonContentBorder"
|
|
1696
|
-
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], function (_ref) {
|
|
1948
|
+
var Body = /*#__PURE__*/styled.View.withConfig({
|
|
1949
|
+
displayName: "Body"
|
|
1950
|
+
})(["", " background-color:", ";flex:1;"], function (_ref) {
|
|
1697
1951
|
var theme = _ref.theme;
|
|
1698
|
-
return
|
|
1952
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
1953
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
1954
|
+
}, "padding-right: ".concat(theme.kitt.spacing * 12, "px;\n padding-left: ").concat(theme.kitt.spacing * 12, "px;"), "padding-right: ".concat(theme.kitt.spacing * 6, "px;\n padding-left: ").concat(theme.kitt.spacing * 6, "px;"));
|
|
1699
1955
|
}, function (_ref2) {
|
|
1700
|
-
var theme = _ref2.theme
|
|
1701
|
-
|
|
1702
|
-
return disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor;
|
|
1703
|
-
}, function (_ref3) {
|
|
1704
|
-
var theme = _ref3.theme;
|
|
1705
|
-
return theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth;
|
|
1706
|
-
}, function (_ref4) {
|
|
1707
|
-
var theme = _ref4.theme;
|
|
1708
|
-
return theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth;
|
|
1709
|
-
}, function (_ref5) {
|
|
1710
|
-
var theme = _ref5.theme;
|
|
1711
|
-
return theme.kitt.iconButton.borderRadius;
|
|
1956
|
+
var theme = _ref2.theme;
|
|
1957
|
+
return theme.kitt.colors.uiBackgroundLight;
|
|
1712
1958
|
});
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
icon = _ref6.icon;
|
|
1718
|
-
return /*#__PURE__*/jsx(IconButtonContentBorder, {
|
|
1719
|
-
disabled: disabled,
|
|
1720
|
-
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
1721
|
-
color: disabled ? 'black-light' : color,
|
|
1722
|
-
icon: icon
|
|
1723
|
-
})
|
|
1724
|
-
});
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
function IconButton(_ref7) {
|
|
1728
|
-
var icon = _ref7.icon,
|
|
1729
|
-
color = _ref7.color,
|
|
1730
|
-
disabled = _ref7.disabled,
|
|
1731
|
-
testID = _ref7.testID,
|
|
1732
|
-
accessibilityLabel = _ref7.accessibilityLabel,
|
|
1733
|
-
accessibilityRole = _ref7.accessibilityRole,
|
|
1734
|
-
onPress = _ref7.onPress;
|
|
1735
|
-
return /*#__PURE__*/jsx(PressableAnimatedContainer, {
|
|
1736
|
-
color: color,
|
|
1737
|
-
disabled: disabled,
|
|
1738
|
-
testID: testID,
|
|
1739
|
-
accessibilityLabel: accessibilityLabel,
|
|
1740
|
-
accessibilityRole: accessibilityRole,
|
|
1741
|
-
onPress: onPress,
|
|
1742
|
-
children: /*#__PURE__*/jsx(IconButtonContent, {
|
|
1743
|
-
disabled: disabled,
|
|
1744
|
-
color: color,
|
|
1745
|
-
icon: icon
|
|
1746
|
-
})
|
|
1959
|
+
function FullScreenModalBody(_ref3) {
|
|
1960
|
+
var children = _ref3.children;
|
|
1961
|
+
return /*#__PURE__*/jsx(Body, {
|
|
1962
|
+
children: children
|
|
1747
1963
|
});
|
|
1748
1964
|
}
|
|
1749
1965
|
|
|
1750
|
-
var
|
|
1966
|
+
var SideContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1967
|
+
displayName: "Header__SideContainer"
|
|
1968
|
+
})(["", ""], function (_ref) {
|
|
1969
|
+
var theme = _ref.theme,
|
|
1970
|
+
_ref$side = _ref.side,
|
|
1971
|
+
side = _ref$side === void 0 ? 'left' : _ref$side;
|
|
1972
|
+
var padding = theme.kitt.spacing * 2;
|
|
1751
1973
|
|
|
1752
|
-
|
|
1974
|
+
if (side === 'left') {
|
|
1975
|
+
return "padding-right: ".concat(padding, "px;");
|
|
1976
|
+
}
|
|
1753
1977
|
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
displayName: "ListItemContent__ContentView"
|
|
1757
|
-
})(["flex:1 0 0%;align-self:center;"]);
|
|
1758
|
-
function ListItemContent(_ref) {
|
|
1759
|
-
var children = _ref.children,
|
|
1760
|
-
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
1978
|
+
return "padding-left: ".concat(padding, "px;");
|
|
1979
|
+
});
|
|
1761
1980
|
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
}));
|
|
1981
|
+
function getHeaderHorizontalMediumPadding(spacing) {
|
|
1982
|
+
return spacing * 6;
|
|
1765
1983
|
}
|
|
1766
1984
|
|
|
1767
|
-
var
|
|
1768
|
-
|
|
1985
|
+
var Header = /*#__PURE__*/styled.View.withConfig({
|
|
1986
|
+
displayName: "Header"
|
|
1987
|
+
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], function (_ref2) {
|
|
1988
|
+
var theme = _ref2.theme,
|
|
1989
|
+
_ref2$insetTop = _ref2.insetTop,
|
|
1990
|
+
insetTop = _ref2$insetTop === void 0 ? 0 : _ref2$insetTop;
|
|
1991
|
+
var paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
|
|
1992
|
+
var _theme$kitt$fullScree = theme.kitt.fullScreenModal.header,
|
|
1993
|
+
paddingVertical = _theme$kitt$fullScree.paddingVertical,
|
|
1994
|
+
paddingHorizontal = _theme$kitt$fullScree.paddingHorizontal;
|
|
1995
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
1996
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
1997
|
+
}, "padding: ".concat(paddingTop, "px ").concat(getHeaderHorizontalMediumPadding(theme.kitt.spacing), "px ").concat(paddingVertical, "px;"), "padding: ".concat(paddingTop, "px ").concat(paddingHorizontal, "px ").concat(paddingVertical, "px;"));
|
|
1998
|
+
}, function (_ref3) {
|
|
1999
|
+
var theme = _ref3.theme;
|
|
2000
|
+
return theme.kitt.fullScreenModal.header.borderColor;
|
|
2001
|
+
});
|
|
2002
|
+
var HeaderContent = /*#__PURE__*/styled.View.withConfig({
|
|
2003
|
+
displayName: "Header__HeaderContent"
|
|
2004
|
+
})(["", ";", ";justify-content:center;align-items:center;"], function (_ref4) {
|
|
2005
|
+
var theme = _ref4.theme,
|
|
2006
|
+
leftWidth = _ref4.leftWidth,
|
|
2007
|
+
rightWidth = _ref4.rightWidth,
|
|
2008
|
+
windowWidth = _ref4.windowWidth;
|
|
1769
2009
|
|
|
1770
|
-
|
|
2010
|
+
/*
|
|
2011
|
+
* Since we don't have controll over the rendered left and right elements,
|
|
2012
|
+
* we must apply some logic to give the title all the available space
|
|
2013
|
+
*/
|
|
2014
|
+
var sideElementMaxWidth = Math.max(leftWidth, rightWidth);
|
|
2015
|
+
var parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
|
|
2016
|
+
var parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
|
|
1771
2017
|
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
|
|
1776
|
-
var theme = _ref.theme,
|
|
1777
|
-
side = _ref.side;
|
|
1778
|
-
return side === 'right' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
|
|
1779
|
-
}, function (_ref2) {
|
|
1780
|
-
var theme = _ref2.theme,
|
|
1781
|
-
side = _ref2.side;
|
|
1782
|
-
return side === 'left' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
|
|
1783
|
-
}); // Handles the vertical alignment of the side elements of the list item
|
|
2018
|
+
var computeWidth = function (breakpointPadding) {
|
|
2019
|
+
return windowWidth - breakpointPadding - sideElementMaxWidth * 2;
|
|
2020
|
+
};
|
|
1784
2021
|
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
2022
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
2023
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
2024
|
+
}, "width: ".concat(computeWidth(parentHorizontalPaddingMedium), "px;"), "width: ".concat(computeWidth(parentHorizontalPadding), "px;"));
|
|
2025
|
+
}, function (_ref5) {
|
|
2026
|
+
var leftWidth = _ref5.leftWidth,
|
|
2027
|
+
rightWidth = _ref5.rightWidth;
|
|
2028
|
+
// Depending of the wider element, we must add a margin to fill the diff in space between elements
|
|
2029
|
+
var deltaMargin = Math.abs(leftWidth - rightWidth);
|
|
1790
2030
|
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
}
|
|
1797
|
-
var SideContentView = /*#__PURE__*/styled.View.withConfig({
|
|
1798
|
-
displayName: "ListItemSideContent__SideContentView"
|
|
1799
|
-
})(["align-self:", ";"], function (_ref4) {
|
|
1800
|
-
var align = _ref4.align;
|
|
1801
|
-
return align;
|
|
2031
|
+
if (leftWidth > rightWidth) {
|
|
2032
|
+
return "margin-right: ".concat(deltaMargin, "px;");
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
return "margin-left: ".concat(deltaMargin, "px;");
|
|
1802
2036
|
});
|
|
1803
|
-
function
|
|
1804
|
-
var children =
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
rest = _objectWithoutProperties(_ref5, _excluded2$1);
|
|
2037
|
+
function FullScreenModalHeader(_ref6) {
|
|
2038
|
+
var children = _ref6.children,
|
|
2039
|
+
right = _ref6.right,
|
|
2040
|
+
left = _ref6.left;
|
|
1808
2041
|
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
}, rest), {}, {
|
|
1812
|
-
children: children
|
|
1813
|
-
}));
|
|
1814
|
-
}
|
|
2042
|
+
var _useSafeAreaInsets = useSafeAreaInsets(),
|
|
2043
|
+
top = _useSafeAreaInsets.top;
|
|
1815
2044
|
|
|
1816
|
-
var
|
|
2045
|
+
var dimensions = useWindowDimensions();
|
|
1817
2046
|
|
|
1818
|
-
|
|
2047
|
+
var _useState = useState(0),
|
|
2048
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2049
|
+
leftWidth = _useState2[0],
|
|
2050
|
+
setLeftWidth = _useState2[1];
|
|
1819
2051
|
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
var withPadding = _ref.withPadding,
|
|
1825
|
-
theme = _ref.theme;
|
|
1826
|
-
return withPadding ? theme.kitt.listItem.padding : 0;
|
|
1827
|
-
}, function (_ref2) {
|
|
1828
|
-
var theme = _ref2.theme,
|
|
1829
|
-
borders = _ref2.borders;
|
|
1830
|
-
var borderWidth = theme.kitt.listItem.borderWidth;
|
|
2052
|
+
var _useState3 = useState(0),
|
|
2053
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2054
|
+
rightWidth = _useState4[0],
|
|
2055
|
+
setRightWidth = _useState4[1];
|
|
1831
2056
|
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
2057
|
+
var handleLayoutChange = function (event, side) {
|
|
2058
|
+
// Prevents react to nullify event on rerenders
|
|
2059
|
+
event.persist();
|
|
1835
2060
|
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
2061
|
+
if (side === 'left') {
|
|
2062
|
+
setLeftWidth(event.nativeEvent.layout.width);
|
|
2063
|
+
return;
|
|
2064
|
+
}
|
|
1839
2065
|
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
}
|
|
2066
|
+
setRightWidth(event.nativeEvent.layout.width);
|
|
2067
|
+
};
|
|
1843
2068
|
|
|
1844
|
-
return
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
})
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
accessibilityRole: 'button',
|
|
1864
|
-
onPress: onPress
|
|
1865
|
-
}, rest) : undefined;
|
|
1866
|
-
var containerProps = onPress ? undefined : rest;
|
|
1867
|
-
return /*#__PURE__*/jsx(Wrapper, _objectSpread$5(_objectSpread$5({}, wrapperProps), {}, {
|
|
1868
|
-
children: /*#__PURE__*/jsxs(ContainerView, _objectSpread$5(_objectSpread$5({
|
|
1869
|
-
withPadding: withPadding,
|
|
1870
|
-
borders: borders
|
|
1871
|
-
}, containerProps), {}, {
|
|
1872
|
-
children: [left ? /*#__PURE__*/jsx(ListItemSideContainer, {
|
|
1873
|
-
side: "left",
|
|
1874
|
-
children: left
|
|
1875
|
-
}) : null, /*#__PURE__*/jsx(ListItemContent, {
|
|
1876
|
-
children: children
|
|
1877
|
-
}), right ? /*#__PURE__*/jsx(ListItemSideContainer, {
|
|
1878
|
-
side: "right",
|
|
1879
|
-
children: right
|
|
1880
|
-
}) : null]
|
|
1881
|
-
}))
|
|
1882
|
-
}));
|
|
1883
|
-
}
|
|
1884
|
-
ListItem.Content = ListItemContent;
|
|
1885
|
-
ListItem.SideContent = ListItemSideContent;
|
|
1886
|
-
ListItem.SideContainer = ListItemSideContainer;
|
|
1887
|
-
|
|
1888
|
-
function getActivityIndicatorSize(size) {
|
|
1889
|
-
if (Platform.OS === 'android') return size;
|
|
1890
|
-
return size < 36 ? 'small' : 'large';
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
function Loader(_ref) {
|
|
1894
|
-
var _ref$color = _ref.color,
|
|
1895
|
-
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
1896
|
-
_ref$size = _ref.size,
|
|
1897
|
-
size = _ref$size === void 0 ? 20 : _ref$size;
|
|
1898
|
-
var theme = /*#__PURE__*/useTheme();
|
|
1899
|
-
var colorHex = theme.kitt.typography.colors[color];
|
|
1900
|
-
return /*#__PURE__*/jsx(ActivityIndicator, {
|
|
1901
|
-
testID: "ActivityIndicator",
|
|
1902
|
-
color: colorHex,
|
|
1903
|
-
size: getActivityIndicatorSize(size)
|
|
2069
|
+
return /*#__PURE__*/jsxs(Header, {
|
|
2070
|
+
insetTop: Platform.OS === 'ios' ? undefined : top,
|
|
2071
|
+
children: [left ? /*#__PURE__*/jsx(SideContainer, {
|
|
2072
|
+
onLayout: function onLayout(e) {
|
|
2073
|
+
return handleLayoutChange(e, 'left');
|
|
2074
|
+
},
|
|
2075
|
+
children: left
|
|
2076
|
+
}) : null, /*#__PURE__*/jsx(HeaderContent, {
|
|
2077
|
+
windowWidth: dimensions.width,
|
|
2078
|
+
leftWidth: leftWidth,
|
|
2079
|
+
rightWidth: rightWidth,
|
|
2080
|
+
children: children
|
|
2081
|
+
}), right ? /*#__PURE__*/jsx(SideContainer, {
|
|
2082
|
+
side: "right",
|
|
2083
|
+
onLayout: function onLayout(e) {
|
|
2084
|
+
return handleLayoutChange(e, 'right');
|
|
2085
|
+
},
|
|
2086
|
+
children: right
|
|
2087
|
+
}) : null]
|
|
1904
2088
|
});
|
|
1905
2089
|
}
|
|
1906
2090
|
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
2091
|
+
var Container$3 = /*#__PURE__*/styled.View.withConfig({
|
|
2092
|
+
displayName: "FullScreenModal__Container"
|
|
2093
|
+
})(["flex:1;background-color:", ";"], function (_ref) {
|
|
2094
|
+
var theme = _ref.theme;
|
|
2095
|
+
return theme.kitt.colors.uiBackground;
|
|
2096
|
+
});
|
|
2097
|
+
function FullScreenModal(_ref2) {
|
|
2098
|
+
var children = _ref2.children;
|
|
2099
|
+
return /*#__PURE__*/jsx(Container$3, {
|
|
2100
|
+
children: children
|
|
1913
2101
|
});
|
|
1914
2102
|
}
|
|
2103
|
+
FullScreenModal.Header = FullScreenModalHeader;
|
|
2104
|
+
FullScreenModal.Body = FullScreenModalBody;
|
|
1915
2105
|
|
|
1916
|
-
|
|
1917
|
-
var type = _ref.type,
|
|
1918
|
-
color = _ref.color;
|
|
2106
|
+
var _excluded$7 = ["as", "children"];
|
|
1919
2107
|
|
|
1920
|
-
|
|
1921
|
-
case 'warning':
|
|
1922
|
-
return /*#__PURE__*/jsx(AlertCircleIcon, {
|
|
1923
|
-
color: color
|
|
1924
|
-
});
|
|
2108
|
+
function ownKeys$a(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; }
|
|
1925
2109
|
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
2110
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$a(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2111
|
+
function StyleWebWrapper(_ref) {
|
|
2112
|
+
var as = _ref.as,
|
|
2113
|
+
children = _ref.children,
|
|
2114
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1930
2115
|
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
2116
|
+
if (Platform.OS !== 'web') return children;
|
|
2117
|
+
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
2118
|
+
return /*#__PURE__*/jsx(as || 'div', _objectSpread$a(_objectSpread$a({}, props), {}, {
|
|
2119
|
+
children: children
|
|
2120
|
+
}));
|
|
2121
|
+
}
|
|
1935
2122
|
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
2123
|
+
function ownKeys$9(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; }
|
|
2124
|
+
|
|
2125
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$9(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2126
|
+
// type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
|
|
2127
|
+
// type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
|
|
2128
|
+
// export function withTheme<Props extends { theme: DefaultTheme }, C>(
|
|
2129
|
+
// WrappedComponent: ComponentType<Props> & C,
|
|
2130
|
+
// ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
|
|
2131
|
+
// return function ThemedComponent(props) {
|
|
2132
|
+
// const theme = useTheme();
|
|
2133
|
+
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
2134
|
+
// };
|
|
2135
|
+
// }
|
|
2136
|
+
function withTheme(WrappedComponent) {
|
|
2137
|
+
// eslint-disable-next-line prefer-arrow-callback
|
|
2138
|
+
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
2139
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2140
|
+
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$9({
|
|
2141
|
+
ref: ref,
|
|
2142
|
+
theme: theme
|
|
2143
|
+
}, props));
|
|
2144
|
+
});
|
|
1941
2145
|
}
|
|
1942
2146
|
|
|
1943
|
-
var
|
|
1944
|
-
switch (type) {
|
|
1945
|
-
case 'success':
|
|
1946
|
-
return 'white';
|
|
2147
|
+
var _excluded$6 = ["color", "disabled"];
|
|
1947
2148
|
|
|
1948
|
-
|
|
1949
|
-
return 'white';
|
|
2149
|
+
function ownKeys$8(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; }
|
|
1950
2150
|
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
2151
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$8(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2152
|
+
var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled$1("div")({
|
|
2153
|
+
name: "PressableIconButtonWebWrapper",
|
|
2154
|
+
"class": "p1nlccvg",
|
|
2155
|
+
vars: {
|
|
2156
|
+
"p1nlccvg-0": [function (_ref) {
|
|
2157
|
+
var theme = _ref.theme,
|
|
2158
|
+
$isDisabled = _ref.$isDisabled;
|
|
2159
|
+
return $isDisabled ? 1 : theme.kitt.iconButton.scale.base.hover;
|
|
2160
|
+
}],
|
|
2161
|
+
"p1nlccvg-2": [function (_ref2) {
|
|
2162
|
+
var theme = _ref2.theme,
|
|
2163
|
+
$isDisabled = _ref2.$isDisabled;
|
|
2164
|
+
return $isDisabled ? 1 : theme.kitt.iconButton.scale.medium.hover;
|
|
2165
|
+
}],
|
|
2166
|
+
"p1nlccvg-3": [function (_ref3) {
|
|
2167
|
+
var theme = _ref3.theme,
|
|
2168
|
+
$isDisabled = _ref3.$isDisabled;
|
|
2169
|
+
return $isDisabled ? 1 : theme.kitt.iconButton.scale.base.active;
|
|
2170
|
+
}],
|
|
2171
|
+
"p1nlccvg-4": [function (_ref4) {
|
|
2172
|
+
var theme = _ref4.theme,
|
|
2173
|
+
$isWhite = _ref4.$isWhite,
|
|
2174
|
+
$isDisabled = _ref4.$isDisabled;
|
|
2175
|
+
if ($isDisabled) return theme.kitt.iconButton.disabled.backgroundColor;
|
|
2176
|
+
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
2177
|
+
white = _theme$kitt$iconButto.white,
|
|
2178
|
+
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
2179
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
2180
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
2181
|
+
}]
|
|
1954
2182
|
}
|
|
1955
|
-
};
|
|
1956
|
-
var
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2183
|
+
}));
|
|
2184
|
+
var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
2185
|
+
displayName: "PressableIconButton__StyledPressableIconButton"
|
|
2186
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref5) {
|
|
2187
|
+
var theme = _ref5.theme;
|
|
2188
|
+
return theme.kitt.iconButton.borderRadius;
|
|
2189
|
+
}, function (_ref6) {
|
|
2190
|
+
var theme = _ref6.theme;
|
|
2191
|
+
return theme.kitt.iconButton.width;
|
|
2192
|
+
}, function (_ref7) {
|
|
2193
|
+
var theme = _ref7.theme;
|
|
2194
|
+
return theme.kitt.iconButton.height;
|
|
2195
|
+
}, function (_ref8) {
|
|
2196
|
+
var theme = _ref8.theme,
|
|
2197
|
+
disabled = _ref8.disabled;
|
|
2198
|
+
var iconButton = theme.kitt.iconButton;
|
|
1961
2199
|
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
return 'black';
|
|
2200
|
+
if (Platform.OS !== 'web') {
|
|
2201
|
+
return undefined;
|
|
1965
2202
|
}
|
|
1966
|
-
};
|
|
1967
2203
|
|
|
1968
|
-
var
|
|
1969
|
-
displayName: "BaseMessage__StyledMessageContainer"
|
|
1970
|
-
})(["flex-direction:row;align-items:flex-start;justify-content:space-between;min-height:60px;padding-top:", "px;border-radius:", "px;background-color:", ";"], function (_ref) {
|
|
1971
|
-
var _$insets$top;
|
|
2204
|
+
var transition = iconButton.transition;
|
|
1972
2205
|
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
return $hasNoRadius ? 0 : theme.kitt.spacing * 5;
|
|
1979
|
-
}, function (_ref3) {
|
|
1980
|
-
var theme = _ref3.theme,
|
|
1981
|
-
$type = _ref3.$type;
|
|
1982
|
-
return theme.kitt.feedbackMessage[$type].backgroundColor;
|
|
1983
|
-
});
|
|
1984
|
-
var StyledDismissWrapper = /*#__PURE__*/styled.View.withConfig({
|
|
1985
|
-
displayName: "BaseMessage__StyledDismissWrapper"
|
|
1986
|
-
})(["align-items:center;align-items:flex-start;margin:", ";"], function (_ref4) {
|
|
1987
|
-
var theme = _ref4.theme;
|
|
1988
|
-
var spacing = theme.kitt.spacing;
|
|
1989
|
-
return "".concat(spacing * 2.5, "px ").concat(spacing * 2, "px 0 ").concat(spacing * 5, "px");
|
|
1990
|
-
});
|
|
1991
|
-
var StyledIconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1992
|
-
displayName: "BaseMessage__StyledIconContainer"
|
|
1993
|
-
})(["margin:", ";"], function (_ref5) {
|
|
1994
|
-
var theme = _ref5.theme;
|
|
1995
|
-
var spacing = theme.kitt.spacing;
|
|
1996
|
-
return "".concat(spacing, "px ").concat(spacing * 5, "px 0 0");
|
|
2206
|
+
if (disabled) {
|
|
2207
|
+
return "\n background-color: ".concat(iconButton.disabled.backgroundColor, ";\n ");
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1997
2211
|
});
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
return $isCenteredText ? 'center' : 'left';
|
|
2003
|
-
});
|
|
2004
|
-
var StyledMessageContent = /*#__PURE__*/styled.View.withConfig({
|
|
2005
|
-
displayName: "BaseMessage__StyledMessageContent"
|
|
2006
|
-
})(["display:flex;flex-direction:row;flex-grow:1;align-self:center;align-items:flex-start;flex-shrink:1;padding:", ";"], function (_ref7) {
|
|
2007
|
-
var theme = _ref7.theme;
|
|
2008
|
-
var spacing = theme.kitt.spacing;
|
|
2009
|
-
return "".concat(spacing * 4, "px ").concat(spacing * 5, "px");
|
|
2010
|
-
});
|
|
2011
|
-
function BaseMessage(_ref8) {
|
|
2012
|
-
var _ref8$type = _ref8.type,
|
|
2013
|
-
type = _ref8$type === void 0 ? 'info' : _ref8$type,
|
|
2014
|
-
children = _ref8.children,
|
|
2015
|
-
hasNoRadius = _ref8.hasNoRadius,
|
|
2016
|
-
centeredText = _ref8.centeredText,
|
|
2017
|
-
insets = _ref8.insets,
|
|
2018
|
-
onDismiss = _ref8.onDismiss;
|
|
2019
|
-
var color = getColorByType(type);
|
|
2020
|
-
return /*#__PURE__*/jsxs(StyledMessageContainer, {
|
|
2021
|
-
$type: type,
|
|
2022
|
-
$hasNoRadius: hasNoRadius,
|
|
2023
|
-
$insets: insets,
|
|
2024
|
-
children: [/*#__PURE__*/jsxs(StyledMessageContent, {
|
|
2025
|
-
children: [centeredText ? null : /*#__PURE__*/jsx(StyledIconContainer, {
|
|
2026
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
2027
|
-
color: color,
|
|
2028
|
-
icon: /*#__PURE__*/jsx(IconContent, {
|
|
2029
|
-
type: type,
|
|
2030
|
-
color: color
|
|
2031
|
-
})
|
|
2032
|
-
})
|
|
2033
|
-
}), /*#__PURE__*/jsx(StyledTextContent, {
|
|
2034
|
-
$isCenteredText: centeredText,
|
|
2035
|
-
base: "body",
|
|
2036
|
-
color: color,
|
|
2037
|
-
children: children
|
|
2038
|
-
})]
|
|
2039
|
-
}), onDismiss ? /*#__PURE__*/jsx(StyledDismissWrapper, {
|
|
2040
|
-
children: /*#__PURE__*/jsx(IconButton, {
|
|
2041
|
-
color: getIconButtonColor(type),
|
|
2042
|
-
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
2043
|
-
onPress: onDismiss
|
|
2044
|
-
})
|
|
2045
|
-
}) : null]
|
|
2046
|
-
});
|
|
2047
|
-
}
|
|
2048
|
-
|
|
2049
|
-
function Message(_ref) {
|
|
2050
|
-
var _ref$type = _ref.type,
|
|
2051
|
-
type = _ref$type === void 0 ? 'info' : _ref$type,
|
|
2052
|
-
children = _ref.children,
|
|
2053
|
-
hasNoRadius = _ref.hasNoRadius,
|
|
2054
|
-
centeredText = _ref.centeredText,
|
|
2055
|
-
insets = _ref.insets,
|
|
2056
|
-
onDismiss = _ref.onDismiss;
|
|
2057
|
-
return /*#__PURE__*/jsx(BaseMessage, {
|
|
2058
|
-
insets: insets,
|
|
2059
|
-
hasNoRadius: hasNoRadius,
|
|
2060
|
-
type: type,
|
|
2061
|
-
centeredText: centeredText,
|
|
2062
|
-
onDismiss: onDismiss,
|
|
2063
|
-
children: children
|
|
2064
|
-
});
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
function ownKeys$4(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; }
|
|
2212
|
+
function PressableIconButton(_ref9) {
|
|
2213
|
+
var color = _ref9.color,
|
|
2214
|
+
disabled = _ref9.disabled,
|
|
2215
|
+
props = _objectWithoutProperties(_ref9, _excluded$6);
|
|
2068
2216
|
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
backgroundColor: theme.kitt.colors.overlay.dark
|
|
2077
|
-
});
|
|
2078
|
-
});
|
|
2079
|
-
function Overlay(_ref2) {
|
|
2080
|
-
var onPress = _ref2.onPress;
|
|
2081
|
-
return /*#__PURE__*/jsx(OverlayPressable, {
|
|
2082
|
-
accessibilityRole: "none",
|
|
2083
|
-
onPress: onPress,
|
|
2084
|
-
children: /*#__PURE__*/jsx(View, {})
|
|
2217
|
+
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
2218
|
+
as: PressableIconButtonWebWrapper,
|
|
2219
|
+
$isWhite: color === 'white',
|
|
2220
|
+
$isDisabled: Boolean(disabled),
|
|
2221
|
+
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$8(_objectSpread$8({}, props), {}, {
|
|
2222
|
+
disabled: disabled
|
|
2223
|
+
}))
|
|
2085
2224
|
});
|
|
2086
2225
|
}
|
|
2087
2226
|
|
|
2088
|
-
var
|
|
2089
|
-
displayName: "
|
|
2090
|
-
})(["
|
|
2091
|
-
var theme = _ref.theme
|
|
2092
|
-
|
|
2227
|
+
var AnimatedIconButtonBackground = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
2228
|
+
displayName: "PressableAnimatedContainer__AnimatedIconButtonBackground"
|
|
2229
|
+
})(["background-color:", ";border-radius:", "px;width:", "px;height:", "px;position:absolute;bottom:0;left:0;"], function (_ref) {
|
|
2230
|
+
var theme = _ref.theme,
|
|
2231
|
+
color = _ref.color,
|
|
2232
|
+
disabled = _ref.disabled;
|
|
2233
|
+
var iconButton = theme.kitt.iconButton;
|
|
2234
|
+
if (disabled) return iconButton.disabled.backgroundColor;
|
|
2235
|
+
if (color === 'white') return iconButton.white.pressedBackgroundColor;
|
|
2236
|
+
return iconButton["default"].pressedBackgroundColor;
|
|
2093
2237
|
}, function (_ref2) {
|
|
2094
2238
|
var theme = _ref2.theme;
|
|
2095
|
-
return theme.kitt.
|
|
2239
|
+
return theme.kitt.iconButton.borderRadius;
|
|
2240
|
+
}, function (_ref3) {
|
|
2241
|
+
var theme = _ref3.theme;
|
|
2242
|
+
return theme.kitt.iconButton.width;
|
|
2243
|
+
}, function (_ref4) {
|
|
2244
|
+
var theme = _ref4.theme;
|
|
2245
|
+
return theme.kitt.iconButton.height;
|
|
2096
2246
|
});
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2247
|
+
var AnimatedViewContainer = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
2248
|
+
displayName: "PressableAnimatedContainer__AnimatedViewContainer"
|
|
2249
|
+
})(["position:relative;align-items:center;justify-content:center;width:100%;height:100%;"]);
|
|
2250
|
+
function PressableAnimatedContainer(_ref5) {
|
|
2251
|
+
var disabled = _ref5.disabled,
|
|
2252
|
+
_ref5$color = _ref5.color,
|
|
2253
|
+
color = _ref5$color === void 0 ? 'black' : _ref5$color,
|
|
2254
|
+
testID = _ref5.testID,
|
|
2255
|
+
_ref5$accessibilityRo = _ref5.accessibilityRole,
|
|
2256
|
+
accessibilityRole = _ref5$accessibilityRo === void 0 ? 'button' : _ref5$accessibilityRo,
|
|
2257
|
+
accessibilityLabel = _ref5.accessibilityLabel,
|
|
2258
|
+
children = _ref5.children,
|
|
2259
|
+
onPress = _ref5.onPress;
|
|
2260
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2261
|
+
var pressed = useSharedValue(false);
|
|
2262
|
+
var opacityStyles = useAnimatedStyle(function () {
|
|
2263
|
+
var _f = function () {
|
|
2264
|
+
return {
|
|
2265
|
+
opacity: withSpring(pressed.value ? 1 : 0)
|
|
2266
|
+
};
|
|
2267
|
+
};
|
|
2268
|
+
|
|
2269
|
+
_f._closure = {
|
|
2270
|
+
withSpring: withSpring,
|
|
2271
|
+
pressed: pressed
|
|
2272
|
+
};
|
|
2273
|
+
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
2274
|
+
_f.__workletHash = 10645190329247;
|
|
2275
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:41)";
|
|
2276
|
+
_f.__optimalization = 2;
|
|
2277
|
+
|
|
2278
|
+
global.__reanimatedWorkletInit(_f);
|
|
2279
|
+
|
|
2280
|
+
return _f;
|
|
2281
|
+
}());
|
|
2282
|
+
var scaleStyles = useAnimatedStyle(function () {
|
|
2283
|
+
var _f = function () {
|
|
2284
|
+
return {
|
|
2285
|
+
transform: [{
|
|
2286
|
+
scale: withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base["default"])
|
|
2287
|
+
}]
|
|
2288
|
+
};
|
|
2289
|
+
};
|
|
2290
|
+
|
|
2291
|
+
_f._closure = {
|
|
2292
|
+
withSpring: withSpring,
|
|
2293
|
+
pressed: pressed,
|
|
2294
|
+
theme: {
|
|
2295
|
+
kitt: {
|
|
2296
|
+
iconButton: {
|
|
2297
|
+
scale: {
|
|
2298
|
+
base: {
|
|
2299
|
+
active: theme.kitt.iconButton.scale.base.active,
|
|
2300
|
+
"default": theme.kitt.iconButton.scale.base["default"]
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
};
|
|
2307
|
+
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{transform:[{scale:withSpring(pressed.value?theme.kitt.iconButton.scale.base.active:theme.kitt.iconButton.scale.base.default)}]};}}";
|
|
2308
|
+
_f.__workletHash = 13861998831411;
|
|
2309
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (66:39)";
|
|
2310
|
+
_f.__optimalization = 2;
|
|
2311
|
+
|
|
2312
|
+
global.__reanimatedWorkletInit(_f);
|
|
2313
|
+
|
|
2314
|
+
return _f;
|
|
2315
|
+
}());
|
|
2316
|
+
return /*#__PURE__*/jsx(PressableIconButton, {
|
|
2317
|
+
accessibilityRole: accessibilityRole,
|
|
2318
|
+
disabled: disabled,
|
|
2319
|
+
color: color,
|
|
2320
|
+
testID: testID,
|
|
2321
|
+
accessibilityLabel: accessibilityLabel,
|
|
2322
|
+
onPress: onPress,
|
|
2323
|
+
onPressIn: function onPressIn() {
|
|
2324
|
+
pressed.value = true;
|
|
2325
|
+
},
|
|
2326
|
+
onPressOut: function onPressOut() {
|
|
2327
|
+
pressed.value = false;
|
|
2328
|
+
},
|
|
2329
|
+
children: /*#__PURE__*/jsxs(AnimatedViewContainer, {
|
|
2330
|
+
style: disabled ? [{
|
|
2331
|
+
transform: [{
|
|
2332
|
+
scale: 1
|
|
2333
|
+
}]
|
|
2334
|
+
}] : [scaleStyles],
|
|
2335
|
+
children: [/*#__PURE__*/jsx(AnimatedIconButtonBackground, {
|
|
2336
|
+
disabled: disabled,
|
|
2337
|
+
color: color,
|
|
2338
|
+
style: disabled ? [{
|
|
2339
|
+
opacity: 1
|
|
2340
|
+
}] : [opacityStyles]
|
|
2341
|
+
}), children]
|
|
2102
2342
|
})
|
|
2103
2343
|
});
|
|
2104
2344
|
}
|
|
2105
2345
|
|
|
2106
|
-
var
|
|
2107
|
-
displayName: "
|
|
2108
|
-
})(["
|
|
2346
|
+
var IconButtonContentBorder = /*#__PURE__*/styled.View.withConfig({
|
|
2347
|
+
displayName: "IconButton__IconButtonContentBorder"
|
|
2348
|
+
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], function (_ref) {
|
|
2109
2349
|
var theme = _ref.theme;
|
|
2110
|
-
return theme.kitt.
|
|
2350
|
+
return "".concat(theme.kitt.iconButton.borderWidth, "px solid");
|
|
2111
2351
|
}, function (_ref2) {
|
|
2112
|
-
var theme = _ref2.theme
|
|
2113
|
-
|
|
2352
|
+
var theme = _ref2.theme,
|
|
2353
|
+
disabled = _ref2.disabled;
|
|
2354
|
+
return disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor;
|
|
2355
|
+
}, function (_ref3) {
|
|
2356
|
+
var theme = _ref3.theme;
|
|
2357
|
+
return theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth;
|
|
2358
|
+
}, function (_ref4) {
|
|
2359
|
+
var theme = _ref4.theme;
|
|
2360
|
+
return theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth;
|
|
2361
|
+
}, function (_ref5) {
|
|
2362
|
+
var theme = _ref5.theme;
|
|
2363
|
+
return theme.kitt.iconButton.borderRadius;
|
|
2114
2364
|
});
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2365
|
+
|
|
2366
|
+
function IconButtonContent(_ref6) {
|
|
2367
|
+
var disabled = _ref6.disabled,
|
|
2368
|
+
color = _ref6.color,
|
|
2369
|
+
icon = _ref6.icon;
|
|
2370
|
+
return /*#__PURE__*/jsx(IconButtonContentBorder, {
|
|
2371
|
+
disabled: disabled,
|
|
2372
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
2373
|
+
color: disabled ? 'black-light' : color,
|
|
2374
|
+
icon: icon
|
|
2375
|
+
})
|
|
2119
2376
|
});
|
|
2120
2377
|
}
|
|
2121
2378
|
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
})(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
|
|
2142
|
-
var theme = _ref4.theme;
|
|
2143
|
-
return theme.kitt.spacing * 2;
|
|
2144
|
-
});
|
|
2145
|
-
var TitleView = /*#__PURE__*/styled.View.withConfig({
|
|
2146
|
-
displayName: "Header__TitleView"
|
|
2147
|
-
})(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
|
|
2148
|
-
var theme = _ref5.theme,
|
|
2149
|
-
isIconLeft = _ref5.isIconLeft;
|
|
2150
|
-
return isIconLeft ? 0 : theme.kitt.spacing * 2;
|
|
2151
|
-
});
|
|
2152
|
-
function ModalHeader(_ref6) {
|
|
2153
|
-
var left = _ref6.left,
|
|
2154
|
-
right = _ref6.right,
|
|
2155
|
-
children = _ref6.children;
|
|
2156
|
-
var onClose = useContext(OnCloseContext);
|
|
2157
|
-
var isIconLeft = !!left;
|
|
2158
|
-
return /*#__PURE__*/jsxs(HeaderView, {
|
|
2159
|
-
children: [isIconLeft && /*#__PURE__*/jsx(LeftIconView, {
|
|
2160
|
-
children: left
|
|
2161
|
-
}), /*#__PURE__*/jsx(TitleView, {
|
|
2162
|
-
isIconLeft: isIconLeft,
|
|
2163
|
-
children: children
|
|
2164
|
-
}), right !== undefined ? right : /*#__PURE__*/jsx(RightIconView, {
|
|
2165
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
2166
|
-
type: "subtle-dark",
|
|
2167
|
-
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
2168
|
-
onPress: onClose
|
|
2169
|
-
})
|
|
2170
|
-
})]
|
|
2171
|
-
});
|
|
2172
|
-
}
|
|
2173
|
-
|
|
2174
|
-
var ModalView = /*#__PURE__*/styled.View.withConfig({
|
|
2175
|
-
displayName: "Modal__ModalView"
|
|
2176
|
-
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], function (_ref) {
|
|
2177
|
-
var theme = _ref.theme;
|
|
2178
|
-
return theme.kitt.spacing * 20;
|
|
2179
|
-
}, function (_ref2) {
|
|
2180
|
-
var theme = _ref2.theme;
|
|
2181
|
-
return theme.kitt.spacing * 4;
|
|
2182
|
-
});
|
|
2183
|
-
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
2184
|
-
displayName: "Modal__ContentView"
|
|
2185
|
-
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], function (_ref3) {
|
|
2186
|
-
var theme = _ref3.theme;
|
|
2187
|
-
return theme.kitt.card.borderRadius;
|
|
2188
|
-
}, function (_ref4) {
|
|
2189
|
-
var theme = _ref4.theme;
|
|
2190
|
-
return theme.kitt.colors.uiBackgroundLight;
|
|
2191
|
-
});
|
|
2192
|
-
function Modal(_ref5) {
|
|
2193
|
-
var visible = _ref5.visible,
|
|
2194
|
-
children = _ref5.children,
|
|
2195
|
-
onClose = _ref5.onClose,
|
|
2196
|
-
onEntered = _ref5.onEntered,
|
|
2197
|
-
onExited = _ref5.onExited;
|
|
2198
|
-
return /*#__PURE__*/jsx(OnCloseContext.Provider, {
|
|
2199
|
-
value: onClose,
|
|
2200
|
-
children: /*#__PURE__*/jsx(Modal$1, {
|
|
2201
|
-
transparent: true,
|
|
2202
|
-
animationType: "fade",
|
|
2203
|
-
visible: visible,
|
|
2204
|
-
onShow: onEntered,
|
|
2205
|
-
onDismiss: onExited,
|
|
2206
|
-
onRequestClose: onClose,
|
|
2207
|
-
children: /*#__PURE__*/jsxs(ModalView, {
|
|
2208
|
-
children: [/*#__PURE__*/jsx(Overlay, {
|
|
2209
|
-
onPress: onClose
|
|
2210
|
-
}), /*#__PURE__*/jsx(ContentView, {
|
|
2211
|
-
children: children
|
|
2212
|
-
})]
|
|
2213
|
-
})
|
|
2379
|
+
function IconButton(_ref7) {
|
|
2380
|
+
var icon = _ref7.icon,
|
|
2381
|
+
color = _ref7.color,
|
|
2382
|
+
disabled = _ref7.disabled,
|
|
2383
|
+
testID = _ref7.testID,
|
|
2384
|
+
accessibilityLabel = _ref7.accessibilityLabel,
|
|
2385
|
+
accessibilityRole = _ref7.accessibilityRole,
|
|
2386
|
+
onPress = _ref7.onPress;
|
|
2387
|
+
return /*#__PURE__*/jsx(PressableAnimatedContainer, {
|
|
2388
|
+
color: color,
|
|
2389
|
+
disabled: disabled,
|
|
2390
|
+
testID: testID,
|
|
2391
|
+
accessibilityLabel: accessibilityLabel,
|
|
2392
|
+
accessibilityRole: accessibilityRole,
|
|
2393
|
+
onPress: onPress,
|
|
2394
|
+
children: /*#__PURE__*/jsx(IconButtonContent, {
|
|
2395
|
+
disabled: disabled,
|
|
2396
|
+
color: color,
|
|
2397
|
+
icon: icon
|
|
2214
2398
|
})
|
|
2215
2399
|
});
|
|
2216
2400
|
}
|
|
2217
|
-
Modal.Header = ModalHeader;
|
|
2218
|
-
Modal.Body = ModalBody;
|
|
2219
|
-
Modal.Footer = ModalFooter;
|
|
2220
2401
|
|
|
2221
|
-
|
|
2222
|
-
var type = _ref.type,
|
|
2223
|
-
children = _ref.children,
|
|
2224
|
-
centeredText = _ref.centeredText,
|
|
2225
|
-
insets = _ref.insets,
|
|
2226
|
-
onDelete = _ref.onDelete,
|
|
2227
|
-
onDismiss = _ref.onDismiss;
|
|
2402
|
+
var _excluded$5 = ["children"];
|
|
2228
2403
|
|
|
2229
|
-
|
|
2230
|
-
if (onDelete) {
|
|
2231
|
-
throw new Error('onDelete is deprecated us onDismiss instead');
|
|
2232
|
-
}
|
|
2233
|
-
}
|
|
2404
|
+
function ownKeys$7(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; }
|
|
2234
2405
|
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2406
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2407
|
+
var ContentView$1 = /*#__PURE__*/styled.View.withConfig({
|
|
2408
|
+
displayName: "ListItemContent__ContentView"
|
|
2409
|
+
})(["flex:1 0 0%;align-self:center;"]);
|
|
2410
|
+
function ListItemContent(_ref) {
|
|
2411
|
+
var children = _ref.children,
|
|
2412
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
2413
|
+
|
|
2414
|
+
return /*#__PURE__*/jsx(ContentView$1, _objectSpread$7(_objectSpread$7({}, rest), {}, {
|
|
2241
2415
|
children: children
|
|
2242
|
-
});
|
|
2416
|
+
}));
|
|
2243
2417
|
}
|
|
2244
2418
|
|
|
2245
|
-
var
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2419
|
+
var _excluded$4 = ["children", "side"],
|
|
2420
|
+
_excluded2$1 = ["children", "align"];
|
|
2421
|
+
|
|
2422
|
+
function ownKeys$6(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; }
|
|
2423
|
+
|
|
2424
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2425
|
+
var SideContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
2426
|
+
displayName: "ListItemSideContent__SideContainerView"
|
|
2427
|
+
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
|
|
2428
|
+
var theme = _ref.theme,
|
|
2429
|
+
side = _ref.side;
|
|
2430
|
+
return side === 'right' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
|
|
2250
2431
|
}, function (_ref2) {
|
|
2251
|
-
var theme = _ref2.theme
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
function SkeletonContent(_ref3) {
|
|
2256
|
-
var isLoading = _ref3.isLoading,
|
|
2257
|
-
width = _ref3.width;
|
|
2258
|
-
var theme = /*#__PURE__*/useTheme();
|
|
2259
|
-
var sharedX = useSharedValue(0);
|
|
2260
|
-
useEffect(function () {
|
|
2261
|
-
if (isLoading) {
|
|
2262
|
-
sharedX.value = withRepeat(withTiming(1, {
|
|
2263
|
-
duration: theme.kitt.skeleton.animationDuration,
|
|
2264
|
-
easing: Easing$1.inOut(Easing$1.ease)
|
|
2265
|
-
}), -1);
|
|
2266
|
-
}
|
|
2267
|
-
}, [sharedX, width, isLoading, theme]);
|
|
2268
|
-
var linearGradientStyle = useAnimatedStyle(function () {
|
|
2269
|
-
var _f = function () {
|
|
2270
|
-
return {
|
|
2271
|
-
transform: [{
|
|
2272
|
-
translateX: interpolate(sharedX.value, [0, 1], [-width, width])
|
|
2273
|
-
}]
|
|
2274
|
-
};
|
|
2275
|
-
};
|
|
2432
|
+
var theme = _ref2.theme,
|
|
2433
|
+
side = _ref2.side;
|
|
2434
|
+
return side === 'left' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
|
|
2435
|
+
}); // Handles the vertical alignment of the side elements of the list item
|
|
2276
2436
|
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
_f.asString = "function _f(){const{interpolate,sharedX,width}=jsThis._closure;{return{transform:[{translateX:interpolate(sharedX.value,[0,1],[-width,width])}]};}}";
|
|
2283
|
-
_f.__workletHash = 1670955855244;
|
|
2284
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (41:47)";
|
|
2285
|
-
_f.__optimalization = 3;
|
|
2437
|
+
function ListItemSideContainer(_ref3) {
|
|
2438
|
+
var children = _ref3.children,
|
|
2439
|
+
_ref3$side = _ref3.side,
|
|
2440
|
+
side = _ref3$side === void 0 ? 'left' : _ref3$side,
|
|
2441
|
+
rest = _objectWithoutProperties(_ref3, _excluded$4);
|
|
2286
2442
|
|
|
2287
|
-
|
|
2443
|
+
return /*#__PURE__*/jsx(SideContainerView, _objectSpread$6(_objectSpread$6({
|
|
2444
|
+
side: side
|
|
2445
|
+
}, rest), {}, {
|
|
2446
|
+
children: children
|
|
2447
|
+
}));
|
|
2448
|
+
}
|
|
2449
|
+
var SideContentView = /*#__PURE__*/styled.View.withConfig({
|
|
2450
|
+
displayName: "ListItemSideContent__SideContentView"
|
|
2451
|
+
})(["align-self:", ";"], function (_ref4) {
|
|
2452
|
+
var align = _ref4.align;
|
|
2453
|
+
return align;
|
|
2454
|
+
});
|
|
2455
|
+
function ListItemSideContent(_ref5) {
|
|
2456
|
+
var children = _ref5.children,
|
|
2457
|
+
_ref5$align = _ref5.align,
|
|
2458
|
+
align = _ref5$align === void 0 ? 'auto' : _ref5$align,
|
|
2459
|
+
rest = _objectWithoutProperties(_ref5, _excluded2$1);
|
|
2288
2460
|
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
children:
|
|
2293
|
-
|
|
2294
|
-
locations: [0.1, 0.5, 0.9],
|
|
2295
|
-
start: {
|
|
2296
|
-
x: 0,
|
|
2297
|
-
y: 0
|
|
2298
|
-
},
|
|
2299
|
-
end: {
|
|
2300
|
-
x: 1,
|
|
2301
|
-
y: 0
|
|
2302
|
-
},
|
|
2303
|
-
style: [StyleSheet.absoluteFill, linearGradientStyle]
|
|
2304
|
-
})
|
|
2305
|
-
});
|
|
2461
|
+
return /*#__PURE__*/jsx(SideContentView, _objectSpread$6(_objectSpread$6({
|
|
2462
|
+
align: align
|
|
2463
|
+
}, rest), {}, {
|
|
2464
|
+
children: children
|
|
2465
|
+
}));
|
|
2306
2466
|
}
|
|
2307
2467
|
|
|
2308
|
-
var
|
|
2309
|
-
displayName: "Skeleton__SkeletonContainer"
|
|
2310
|
-
})(["overflow:hidden;"]);
|
|
2311
|
-
function Skeleton(_ref) {
|
|
2312
|
-
var isLoading = _ref.isLoading,
|
|
2313
|
-
style = _ref.style;
|
|
2468
|
+
var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
|
|
2314
2469
|
|
|
2315
|
-
|
|
2316
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
2317
|
-
width = _useState2[0],
|
|
2318
|
-
setWidth = _useState2[1];
|
|
2470
|
+
function ownKeys$5(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; }
|
|
2319
2471
|
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
}
|
|
2472
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2473
|
+
var ContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
2474
|
+
displayName: "ListItem__ContainerView"
|
|
2475
|
+
})(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], function (_ref) {
|
|
2476
|
+
var withPadding = _ref.withPadding,
|
|
2477
|
+
theme = _ref.theme;
|
|
2478
|
+
return withPadding ? theme.kitt.listItem.padding : 0;
|
|
2479
|
+
}, function (_ref2) {
|
|
2480
|
+
var theme = _ref2.theme,
|
|
2481
|
+
borders = _ref2.borders;
|
|
2482
|
+
var borderWidth = theme.kitt.listItem.borderWidth;
|
|
2483
|
+
|
|
2484
|
+
if (borders === 'top') {
|
|
2485
|
+
return "border-top-width: ".concat(borderWidth, "px");
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
if (borders === 'bottom') {
|
|
2489
|
+
return "border-bottom-width: ".concat(borderWidth, "px");
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
if (borders === 'both') {
|
|
2493
|
+
return css(["border-top-width:", "px;border-bottom-width:", "px;"], borderWidth, borderWidth);
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
return 'border: none';
|
|
2497
|
+
}, function (_ref3) {
|
|
2335
2498
|
var theme = _ref3.theme;
|
|
2336
|
-
return theme.kitt.
|
|
2499
|
+
return theme.kitt.listItem.borderColor;
|
|
2337
2500
|
}, function (_ref4) {
|
|
2338
2501
|
var theme = _ref4.theme;
|
|
2339
|
-
return theme.kitt.
|
|
2340
|
-
});
|
|
2341
|
-
var Circle = /*#__PURE__*/styled(Skeleton).withConfig({
|
|
2342
|
-
displayName: "Skeleton__Circle"
|
|
2343
|
-
})(["width:", "px;height:", "px;border-radius:", "px;"], function (_ref5) {
|
|
2344
|
-
var theme = _ref5.theme;
|
|
2345
|
-
return theme.kitt.spacing * 12;
|
|
2346
|
-
}, function (_ref6) {
|
|
2347
|
-
var theme = _ref6.theme;
|
|
2348
|
-
return theme.kitt.spacing * 12;
|
|
2349
|
-
}, function (_ref7) {
|
|
2350
|
-
var theme = _ref7.theme;
|
|
2351
|
-
return theme.kitt.spacing * 6;
|
|
2352
|
-
});
|
|
2353
|
-
var Square = /*#__PURE__*/styled(Skeleton).withConfig({
|
|
2354
|
-
displayName: "Skeleton__Square"
|
|
2355
|
-
})(["width:", "px;height:", "px;border-radius:", "px;"], function (_ref8) {
|
|
2356
|
-
var theme = _ref8.theme;
|
|
2357
|
-
return theme.kitt.spacing * 12;
|
|
2358
|
-
}, function (_ref9) {
|
|
2359
|
-
var theme = _ref9.theme;
|
|
2360
|
-
return theme.kitt.spacing * 12;
|
|
2361
|
-
}, function (_ref10) {
|
|
2362
|
-
var theme = _ref10.theme;
|
|
2363
|
-
return theme.kitt.spacing * 1.5;
|
|
2502
|
+
return theme.kitt.colors.uiBackgroundLight;
|
|
2364
2503
|
});
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2504
|
+
function ListItem(_ref5) {
|
|
2505
|
+
var children = _ref5.children,
|
|
2506
|
+
withPadding = _ref5.withPadding,
|
|
2507
|
+
borders = _ref5.borders,
|
|
2508
|
+
left = _ref5.left,
|
|
2509
|
+
right = _ref5.right,
|
|
2510
|
+
onPress = _ref5.onPress,
|
|
2511
|
+
rest = _objectWithoutProperties(_ref5, _excluded$3);
|
|
2368
2512
|
|
|
2369
|
-
var
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
})
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
})
|
|
2513
|
+
var Wrapper = onPress ? Pressable : Fragment;
|
|
2514
|
+
var wrapperProps = onPress ? _objectSpread$5({
|
|
2515
|
+
accessibilityRole: 'button',
|
|
2516
|
+
onPress: onPress
|
|
2517
|
+
}, rest) : undefined;
|
|
2518
|
+
var containerProps = onPress ? undefined : rest;
|
|
2519
|
+
return /*#__PURE__*/jsx(Wrapper, _objectSpread$5(_objectSpread$5({}, wrapperProps), {}, {
|
|
2520
|
+
children: /*#__PURE__*/jsxs(ContainerView, _objectSpread$5(_objectSpread$5({
|
|
2521
|
+
withPadding: withPadding,
|
|
2522
|
+
borders: borders
|
|
2523
|
+
}, containerProps), {}, {
|
|
2524
|
+
children: [left ? /*#__PURE__*/jsx(ListItemSideContainer, {
|
|
2525
|
+
side: "left",
|
|
2526
|
+
children: left
|
|
2527
|
+
}) : null, /*#__PURE__*/jsx(ListItemContent, {
|
|
2528
|
+
children: children
|
|
2529
|
+
}), right ? /*#__PURE__*/jsx(ListItemSideContainer, {
|
|
2530
|
+
side: "right",
|
|
2531
|
+
children: right
|
|
2532
|
+
}) : null]
|
|
2533
|
+
}))
|
|
2534
|
+
}));
|
|
2535
|
+
}
|
|
2536
|
+
ListItem.Content = ListItemContent;
|
|
2537
|
+
ListItem.SideContent = ListItemSideContent;
|
|
2538
|
+
ListItem.SideContainer = ListItemSideContainer;
|
|
2384
2539
|
|
|
2385
|
-
|
|
2540
|
+
function getActivityIndicatorSize(size) {
|
|
2541
|
+
if (Platform.OS === 'android') return size;
|
|
2542
|
+
return size < 36 ? 'small' : 'large';
|
|
2543
|
+
}
|
|
2386
2544
|
|
|
2387
|
-
|
|
2388
|
-
var color =
|
|
2545
|
+
function Loader(_ref) {
|
|
2546
|
+
var _ref$color = _ref.color,
|
|
2547
|
+
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
2548
|
+
_ref$size = _ref.size,
|
|
2549
|
+
size = _ref$size === void 0 ? 20 : _ref$size;
|
|
2550
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2551
|
+
var colorHex = theme.kitt.typography.colors[color];
|
|
2552
|
+
return /*#__PURE__*/jsx(ActivityIndicator, {
|
|
2553
|
+
testID: "ActivityIndicator",
|
|
2554
|
+
color: colorHex,
|
|
2555
|
+
size: getActivityIndicatorSize(size)
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2389
2558
|
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2559
|
+
function LargeLoader(_ref) {
|
|
2560
|
+
var _ref$color = _ref.color,
|
|
2561
|
+
color = _ref$color === void 0 ? 'primary' : _ref$color;
|
|
2562
|
+
return /*#__PURE__*/jsx(Loader, {
|
|
2563
|
+
color: color,
|
|
2564
|
+
size: 60
|
|
2565
|
+
});
|
|
2566
|
+
}
|
|
2393
2567
|
|
|
2394
|
-
|
|
2395
|
-
|
|
2568
|
+
function IconContent(_ref) {
|
|
2569
|
+
var type = _ref.type,
|
|
2570
|
+
color = _ref.color;
|
|
2396
2571
|
|
|
2397
|
-
|
|
2398
|
-
|
|
2572
|
+
switch (type) {
|
|
2573
|
+
case 'warning':
|
|
2574
|
+
return /*#__PURE__*/jsx(AlertCircleIcon, {
|
|
2575
|
+
color: color
|
|
2576
|
+
});
|
|
2577
|
+
|
|
2578
|
+
case 'success':
|
|
2579
|
+
return /*#__PURE__*/jsx(CheckIcon, {
|
|
2580
|
+
color: color
|
|
2581
|
+
});
|
|
2582
|
+
|
|
2583
|
+
case 'danger':
|
|
2584
|
+
return /*#__PURE__*/jsx(AlertTriangleIcon, {
|
|
2585
|
+
color: color
|
|
2586
|
+
});
|
|
2399
2587
|
|
|
2400
2588
|
default:
|
|
2401
|
-
return
|
|
2589
|
+
return /*#__PURE__*/jsx(InfoIcon, {
|
|
2590
|
+
color: color
|
|
2591
|
+
});
|
|
2402
2592
|
}
|
|
2403
|
-
}
|
|
2593
|
+
}
|
|
2404
2594
|
|
|
2405
|
-
var
|
|
2406
|
-
|
|
2595
|
+
var getColorByType = function (type) {
|
|
2596
|
+
switch (type) {
|
|
2597
|
+
case 'success':
|
|
2598
|
+
return 'white';
|
|
2407
2599
|
|
|
2408
|
-
|
|
2409
|
-
case 'dark':
|
|
2410
|
-
case 'primary':
|
|
2600
|
+
case 'danger':
|
|
2411
2601
|
return 'white';
|
|
2412
2602
|
|
|
2413
|
-
case '
|
|
2603
|
+
case 'warning':
|
|
2414
2604
|
default:
|
|
2415
2605
|
return 'black';
|
|
2416
2606
|
}
|
|
2417
2607
|
};
|
|
2608
|
+
var getIconButtonColor = function (messageType) {
|
|
2609
|
+
switch (messageType) {
|
|
2610
|
+
case 'success':
|
|
2611
|
+
case 'danger':
|
|
2612
|
+
return 'white';
|
|
2418
2613
|
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
return color || storyBlockColor;
|
|
2614
|
+
case 'warning':
|
|
2615
|
+
default:
|
|
2616
|
+
return 'black';
|
|
2617
|
+
}
|
|
2424
2618
|
};
|
|
2425
|
-
var StyledStoryBlockView = /*#__PURE__*/styled.View.withConfig({
|
|
2426
|
-
displayName: "StoryBlock__StyledStoryBlockView"
|
|
2427
|
-
})(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, function (_ref) {
|
|
2428
|
-
var theme = _ref.theme,
|
|
2429
|
-
background = _ref.background;
|
|
2430
|
-
return getBackgroundColorFromBlockColor(theme, background);
|
|
2431
|
-
});
|
|
2432
|
-
function StoryBlock(_ref2) {
|
|
2433
|
-
var children = _ref2.children,
|
|
2434
|
-
background = _ref2.background;
|
|
2435
|
-
return /*#__PURE__*/jsx(StyledStoryBlockView, {
|
|
2436
|
-
background: background,
|
|
2437
|
-
children: /*#__PURE__*/jsx(StoryBlockColorContext.Provider, {
|
|
2438
|
-
value: getTypographyColorFromBlockColor(background),
|
|
2439
|
-
children: /*#__PURE__*/jsx(StoryBlockBackgroundContext.Provider, {
|
|
2440
|
-
value: background,
|
|
2441
|
-
children: children
|
|
2442
|
-
})
|
|
2443
|
-
})
|
|
2444
|
-
});
|
|
2445
|
-
}
|
|
2446
2619
|
|
|
2447
|
-
var
|
|
2448
|
-
displayName: "
|
|
2449
|
-
})(["
|
|
2450
|
-
var
|
|
2451
|
-
displayName: "StoryTitle__StorySubTitleContainer"
|
|
2452
|
-
})(["margin-bottom:10px;"]);
|
|
2453
|
-
function StoryTitle(_ref) {
|
|
2454
|
-
var color = _ref.color,
|
|
2455
|
-
children = _ref.children,
|
|
2456
|
-
numberOfLines = _ref.numberOfLines;
|
|
2457
|
-
return /*#__PURE__*/jsx(StoryTitleContainer, {
|
|
2458
|
-
children: /*#__PURE__*/jsx(Typography.Header1, {
|
|
2459
|
-
variant: "bold",
|
|
2460
|
-
base: "header1",
|
|
2461
|
-
color: useStoryBlockColor(color),
|
|
2462
|
-
numberOfLines: numberOfLines,
|
|
2463
|
-
children: children
|
|
2464
|
-
})
|
|
2465
|
-
});
|
|
2466
|
-
}
|
|
2620
|
+
var StyledMessageContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2621
|
+
displayName: "BaseMessage__StyledMessageContainer"
|
|
2622
|
+
})(["flex-direction:row;align-items:flex-start;justify-content:space-between;min-height:60px;padding-top:", "px;border-radius:", "px;background-color:", ";"], function (_ref) {
|
|
2623
|
+
var _$insets$top;
|
|
2467
2624
|
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2625
|
+
var $insets = _ref.$insets;
|
|
2626
|
+
return (_$insets$top = $insets === null || $insets === void 0 ? void 0 : $insets.top) !== null && _$insets$top !== void 0 ? _$insets$top : 0;
|
|
2627
|
+
}, function (_ref2) {
|
|
2628
|
+
var theme = _ref2.theme,
|
|
2629
|
+
$hasNoRadius = _ref2.$hasNoRadius;
|
|
2630
|
+
return $hasNoRadius ? 0 : theme.kitt.spacing * 5;
|
|
2631
|
+
}, function (_ref3) {
|
|
2632
|
+
var theme = _ref3.theme,
|
|
2633
|
+
$type = _ref3.$type;
|
|
2634
|
+
return theme.kitt.feedbackMessage[$type].backgroundColor;
|
|
2635
|
+
});
|
|
2636
|
+
var StyledDismissWrapper = /*#__PURE__*/styled.View.withConfig({
|
|
2637
|
+
displayName: "BaseMessage__StyledDismissWrapper"
|
|
2638
|
+
})(["align-items:center;align-items:flex-start;margin:", ";"], function (_ref4) {
|
|
2639
|
+
var theme = _ref4.theme;
|
|
2640
|
+
var spacing = theme.kitt.spacing;
|
|
2641
|
+
return "".concat(spacing * 2.5, "px ").concat(spacing * 2, "px 0 ").concat(spacing * 5, "px");
|
|
2642
|
+
});
|
|
2643
|
+
var StyledIconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2644
|
+
displayName: "BaseMessage__StyledIconContainer"
|
|
2645
|
+
})(["margin:", ";"], function (_ref5) {
|
|
2646
|
+
var theme = _ref5.theme;
|
|
2647
|
+
var spacing = theme.kitt.spacing;
|
|
2648
|
+
return "".concat(spacing, "px ").concat(spacing * 5, "px 0 0");
|
|
2649
|
+
});
|
|
2650
|
+
var StyledTextContent = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
2651
|
+
displayName: "BaseMessage__StyledTextContent"
|
|
2652
|
+
})(["flex:1;text-align:", ";"], function (_ref6) {
|
|
2653
|
+
var $isCenteredText = _ref6.$isCenteredText;
|
|
2654
|
+
return $isCenteredText ? 'center' : 'left';
|
|
2655
|
+
});
|
|
2656
|
+
var StyledMessageContent = /*#__PURE__*/styled.View.withConfig({
|
|
2657
|
+
displayName: "BaseMessage__StyledMessageContent"
|
|
2658
|
+
})(["display:flex;flex-direction:row;flex-grow:1;align-self:center;align-items:flex-start;flex-shrink:1;padding:", ";"], function (_ref7) {
|
|
2659
|
+
var theme = _ref7.theme;
|
|
2660
|
+
var spacing = theme.kitt.spacing;
|
|
2661
|
+
return "".concat(spacing * 4, "px ").concat(spacing * 5, "px");
|
|
2662
|
+
});
|
|
2663
|
+
function BaseMessage(_ref8) {
|
|
2664
|
+
var _ref8$type = _ref8.type,
|
|
2665
|
+
type = _ref8$type === void 0 ? 'info' : _ref8$type,
|
|
2666
|
+
children = _ref8.children,
|
|
2667
|
+
hasNoRadius = _ref8.hasNoRadius,
|
|
2668
|
+
centeredText = _ref8.centeredText,
|
|
2669
|
+
insets = _ref8.insets,
|
|
2670
|
+
onDismiss = _ref8.onDismiss;
|
|
2671
|
+
var color = getColorByType(type);
|
|
2672
|
+
return /*#__PURE__*/jsxs(StyledMessageContainer, {
|
|
2673
|
+
$type: type,
|
|
2674
|
+
$hasNoRadius: hasNoRadius,
|
|
2675
|
+
$insets: insets,
|
|
2676
|
+
children: [/*#__PURE__*/jsxs(StyledMessageContent, {
|
|
2677
|
+
children: [centeredText ? null : /*#__PURE__*/jsx(StyledIconContainer, {
|
|
2678
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
2679
|
+
color: color,
|
|
2680
|
+
icon: /*#__PURE__*/jsx(IconContent, {
|
|
2681
|
+
type: type,
|
|
2682
|
+
color: color
|
|
2683
|
+
})
|
|
2684
|
+
})
|
|
2685
|
+
}), /*#__PURE__*/jsx(StyledTextContent, {
|
|
2686
|
+
$isCenteredText: centeredText,
|
|
2687
|
+
base: "body",
|
|
2688
|
+
color: color,
|
|
2689
|
+
children: children
|
|
2690
|
+
})]
|
|
2691
|
+
}), onDismiss ? /*#__PURE__*/jsx(StyledDismissWrapper, {
|
|
2692
|
+
children: /*#__PURE__*/jsx(IconButton, {
|
|
2693
|
+
color: getIconButtonColor(type),
|
|
2694
|
+
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
2695
|
+
onPress: onDismiss
|
|
2696
|
+
})
|
|
2697
|
+
}) : null]
|
|
2480
2698
|
});
|
|
2481
2699
|
}
|
|
2482
2700
|
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2701
|
+
function Message(_ref) {
|
|
2702
|
+
var _ref$type = _ref.type,
|
|
2703
|
+
type = _ref$type === void 0 ? 'info' : _ref$type,
|
|
2704
|
+
children = _ref.children,
|
|
2705
|
+
hasNoRadius = _ref.hasNoRadius,
|
|
2706
|
+
centeredText = _ref.centeredText,
|
|
2707
|
+
insets = _ref.insets,
|
|
2708
|
+
onDismiss = _ref.onDismiss;
|
|
2709
|
+
return /*#__PURE__*/jsx(BaseMessage, {
|
|
2710
|
+
insets: insets,
|
|
2711
|
+
hasNoRadius: hasNoRadius,
|
|
2712
|
+
type: type,
|
|
2713
|
+
centeredText: centeredText,
|
|
2714
|
+
onDismiss: onDismiss,
|
|
2715
|
+
children: children
|
|
2498
2716
|
});
|
|
2499
2717
|
}
|
|
2500
2718
|
|
|
2501
|
-
|
|
2719
|
+
function ownKeys$4(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; }
|
|
2502
2720
|
|
|
2503
|
-
function
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
medium: "header5",
|
|
2512
|
-
color: useStoryBlockColor(color),
|
|
2513
|
-
numberOfLines: numberOfLines,
|
|
2514
|
-
children: children
|
|
2515
|
-
})
|
|
2721
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2722
|
+
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
2723
|
+
var OverlayPressable = /*#__PURE__*/styled(Pressable).withConfig({
|
|
2724
|
+
displayName: "Overlay__OverlayPressable"
|
|
2725
|
+
})(function (_ref) {
|
|
2726
|
+
var theme = _ref.theme;
|
|
2727
|
+
return _objectSpread$4(_objectSpread$4({}, StyleSheet.absoluteFillObject), {}, {
|
|
2728
|
+
backgroundColor: theme.kitt.colors.overlay.dark
|
|
2516
2729
|
});
|
|
2517
|
-
}
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
|
|
2525
|
-
displayName: "Story__StoryContainer"
|
|
2526
|
-
})(["padding:", "px;"], storyPadding);
|
|
2527
|
-
function Story(_ref) {
|
|
2528
|
-
var title = _ref.title,
|
|
2529
|
-
contentContainerStyle = _ref.contentContainerStyle,
|
|
2530
|
-
children = _ref.children;
|
|
2531
|
-
return /*#__PURE__*/jsxs(StoryContainer$1, {
|
|
2532
|
-
contentContainerStyle: contentContainerStyle,
|
|
2533
|
-
children: [/*#__PURE__*/jsx(StoryTitle, {
|
|
2534
|
-
children: title
|
|
2535
|
-
}), children]
|
|
2730
|
+
});
|
|
2731
|
+
function Overlay(_ref2) {
|
|
2732
|
+
var onPress = _ref2.onPress;
|
|
2733
|
+
return /*#__PURE__*/jsx(OverlayPressable, {
|
|
2734
|
+
accessibilityRole: "none",
|
|
2735
|
+
onPress: onPress,
|
|
2736
|
+
children: /*#__PURE__*/jsx(View, {})
|
|
2536
2737
|
});
|
|
2537
2738
|
}
|
|
2538
2739
|
|
|
2539
|
-
var
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
internalIsDemoSection = _ref.internalIsDemoSection,
|
|
2553
|
-
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
2554
|
-
|
|
2555
|
-
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
2556
|
-
return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2557
|
-
children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
|
|
2558
|
-
children: title
|
|
2559
|
-
}), children]
|
|
2560
|
-
}));
|
|
2561
|
-
}
|
|
2562
|
-
var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
|
|
2563
|
-
displayName: "StorySection__StyledSubSection"
|
|
2564
|
-
})(["margin-bottom:16px;"]);
|
|
2565
|
-
|
|
2566
|
-
function SubSection(_ref2) {
|
|
2567
|
-
var title = _ref2.title,
|
|
2568
|
-
children = _ref2.children,
|
|
2569
|
-
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
2570
|
-
|
|
2571
|
-
return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2572
|
-
children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
|
|
2573
|
-
children: title
|
|
2574
|
-
}), children]
|
|
2575
|
-
}));
|
|
2576
|
-
}
|
|
2577
|
-
|
|
2578
|
-
var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
|
|
2579
|
-
displayName: "StorySection__StyledBlockSection"
|
|
2580
|
-
})(["margin-bottom:16px;"]);
|
|
2581
|
-
|
|
2582
|
-
function BlockSection(_ref3) {
|
|
2583
|
-
var title = _ref3.title,
|
|
2584
|
-
children = _ref3.children,
|
|
2585
|
-
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
2586
|
-
|
|
2587
|
-
return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2588
|
-
children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
2589
|
-
children: title
|
|
2590
|
-
}), children]
|
|
2591
|
-
}));
|
|
2592
|
-
}
|
|
2593
|
-
|
|
2594
|
-
var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
|
|
2595
|
-
displayName: "StorySection__StyledDemoSection"
|
|
2596
|
-
})(["margin-bottom:64px;"]);
|
|
2597
|
-
|
|
2598
|
-
function DemoSection(_ref4) {
|
|
2599
|
-
var children = _ref4.children;
|
|
2600
|
-
return /*#__PURE__*/jsx(StyledDemoSection, {
|
|
2601
|
-
children: /*#__PURE__*/jsx(StorySection, {
|
|
2602
|
-
internalIsDemoSection: true,
|
|
2603
|
-
title: "Demo",
|
|
2740
|
+
var BodyView = /*#__PURE__*/styled.View.withConfig({
|
|
2741
|
+
displayName: "Body__BodyView"
|
|
2742
|
+
})(["padding:", "px ", "px;"], function (_ref) {
|
|
2743
|
+
var theme = _ref.theme;
|
|
2744
|
+
return theme.kitt.spacing * 6;
|
|
2745
|
+
}, function (_ref2) {
|
|
2746
|
+
var theme = _ref2.theme;
|
|
2747
|
+
return theme.kitt.spacing * 4;
|
|
2748
|
+
});
|
|
2749
|
+
function ModalBody(_ref3) {
|
|
2750
|
+
var children = _ref3.children;
|
|
2751
|
+
return /*#__PURE__*/jsx(ScrollView, {
|
|
2752
|
+
children: /*#__PURE__*/jsx(BodyView, {
|
|
2604
2753
|
children: children
|
|
2605
2754
|
})
|
|
2606
2755
|
});
|
|
2607
2756
|
}
|
|
2608
2757
|
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2758
|
+
var FooterView = /*#__PURE__*/styled.View.withConfig({
|
|
2759
|
+
displayName: "Footer__FooterView"
|
|
2760
|
+
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], function (_ref) {
|
|
2761
|
+
var theme = _ref.theme;
|
|
2762
|
+
return theme.kitt.spacing * 4;
|
|
2763
|
+
}, function (_ref2) {
|
|
2764
|
+
var theme = _ref2.theme;
|
|
2765
|
+
return theme.kitt.colors.separator;
|
|
2766
|
+
});
|
|
2767
|
+
function ModalFooter(_ref3) {
|
|
2768
|
+
var children = _ref3.children;
|
|
2769
|
+
return /*#__PURE__*/jsx(FooterView, {
|
|
2770
|
+
children: children
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2612
2773
|
|
|
2613
|
-
|
|
2614
|
-
StorySection.Demo = DemoSection;
|
|
2615
|
-
/** @deprecated use StorySection instead */
|
|
2616
|
-
|
|
2617
|
-
var DeprecatedSection = StorySection;
|
|
2774
|
+
var OnCloseContext = /*#__PURE__*/createContext(function () {});
|
|
2618
2775
|
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2776
|
+
var HeaderView = /*#__PURE__*/styled.View.withConfig({
|
|
2777
|
+
displayName: "Header__HeaderView"
|
|
2778
|
+
})(["position:relative;padding:", "px;display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;align-items:center;border-bottom-width:1px;border-bottom-color:", ";min-height:57px;"], function (_ref) {
|
|
2779
|
+
var theme = _ref.theme;
|
|
2780
|
+
return theme.kitt.spacing * 2;
|
|
2781
|
+
}, function (_ref2) {
|
|
2782
|
+
var theme = _ref2.theme;
|
|
2783
|
+
return theme.kitt.colors.separator;
|
|
2784
|
+
});
|
|
2785
|
+
var LeftIconView = /*#__PURE__*/styled.View.withConfig({
|
|
2786
|
+
displayName: "Header__LeftIconView"
|
|
2787
|
+
})(["align-self:flex-start;margin-right:", "px;"], function (_ref3) {
|
|
2788
|
+
var theme = _ref3.theme;
|
|
2789
|
+
return theme.kitt.spacing * 2;
|
|
2790
|
+
});
|
|
2791
|
+
var RightIconView = /*#__PURE__*/styled.View.withConfig({
|
|
2792
|
+
displayName: "Header__RightIconView"
|
|
2793
|
+
})(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
|
|
2794
|
+
var theme = _ref4.theme;
|
|
2795
|
+
return theme.kitt.spacing * 2;
|
|
2796
|
+
});
|
|
2797
|
+
var TitleView = /*#__PURE__*/styled.View.withConfig({
|
|
2798
|
+
displayName: "Header__TitleView"
|
|
2799
|
+
})(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
|
|
2800
|
+
var theme = _ref5.theme,
|
|
2801
|
+
isIconLeft = _ref5.isIconLeft;
|
|
2802
|
+
return isIconLeft ? 0 : theme.kitt.spacing * 2;
|
|
2803
|
+
});
|
|
2804
|
+
function ModalHeader(_ref6) {
|
|
2805
|
+
var left = _ref6.left,
|
|
2806
|
+
right = _ref6.right,
|
|
2807
|
+
children = _ref6.children;
|
|
2808
|
+
var onClose = useContext(OnCloseContext);
|
|
2809
|
+
var isIconLeft = !!left;
|
|
2810
|
+
return /*#__PURE__*/jsxs(HeaderView, {
|
|
2811
|
+
children: [isIconLeft && /*#__PURE__*/jsx(LeftIconView, {
|
|
2812
|
+
children: left
|
|
2813
|
+
}), /*#__PURE__*/jsx(TitleView, {
|
|
2814
|
+
isIconLeft: isIconLeft,
|
|
2815
|
+
children: children
|
|
2816
|
+
}), right !== undefined ? right : /*#__PURE__*/jsx(RightIconView, {
|
|
2817
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
2818
|
+
type: "subtle-dark",
|
|
2819
|
+
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
2820
|
+
onPress: onClose
|
|
2821
|
+
})
|
|
2822
|
+
})]
|
|
2631
2823
|
});
|
|
2632
2824
|
}
|
|
2633
2825
|
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2826
|
+
var ModalView = /*#__PURE__*/styled.View.withConfig({
|
|
2827
|
+
displayName: "Modal__ModalView"
|
|
2828
|
+
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], function (_ref) {
|
|
2829
|
+
var theme = _ref.theme;
|
|
2830
|
+
return theme.kitt.spacing * 20;
|
|
2831
|
+
}, function (_ref2) {
|
|
2832
|
+
var theme = _ref2.theme;
|
|
2833
|
+
return theme.kitt.spacing * 4;
|
|
2834
|
+
});
|
|
2835
|
+
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
2836
|
+
displayName: "Modal__ContentView"
|
|
2837
|
+
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], function (_ref3) {
|
|
2838
|
+
var theme = _ref3.theme;
|
|
2839
|
+
return theme.kitt.card.borderRadius;
|
|
2840
|
+
}, function (_ref4) {
|
|
2841
|
+
var theme = _ref4.theme;
|
|
2842
|
+
return theme.kitt.colors.uiBackgroundLight;
|
|
2843
|
+
});
|
|
2844
|
+
function Modal(_ref5) {
|
|
2845
|
+
var visible = _ref5.visible,
|
|
2846
|
+
children = _ref5.children,
|
|
2847
|
+
onClose = _ref5.onClose,
|
|
2848
|
+
onEntered = _ref5.onEntered,
|
|
2849
|
+
onExited = _ref5.onExited;
|
|
2850
|
+
return /*#__PURE__*/jsx(OnCloseContext.Provider, {
|
|
2851
|
+
value: onClose,
|
|
2852
|
+
children: /*#__PURE__*/jsx(Modal$1, {
|
|
2853
|
+
transparent: true,
|
|
2854
|
+
animationType: "fade",
|
|
2855
|
+
visible: visible,
|
|
2856
|
+
onShow: onEntered,
|
|
2857
|
+
onDismiss: onExited,
|
|
2858
|
+
onRequestClose: onClose,
|
|
2859
|
+
children: /*#__PURE__*/jsxs(ModalView, {
|
|
2860
|
+
children: [/*#__PURE__*/jsx(Overlay, {
|
|
2861
|
+
onPress: onClose
|
|
2862
|
+
}), /*#__PURE__*/jsx(ContentView, {
|
|
2863
|
+
children: children
|
|
2864
|
+
})]
|
|
2865
|
+
})
|
|
2866
|
+
})
|
|
2638
2867
|
});
|
|
2639
2868
|
}
|
|
2869
|
+
Modal.Header = ModalHeader;
|
|
2870
|
+
Modal.Body = ModalBody;
|
|
2871
|
+
Modal.Footer = ModalFooter;
|
|
2640
2872
|
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
displayName: "StoryGrid__FlexRow"
|
|
2649
|
-
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
2650
|
-
var FlexCol = /*#__PURE__*/styled.View.withConfig({
|
|
2651
|
-
displayName: "StoryGrid__FlexCol"
|
|
2652
|
-
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
2653
|
-
|
|
2654
|
-
function StoryGridRow(_ref) {
|
|
2655
|
-
var children = _ref.children,
|
|
2656
|
-
_ref$breakpoint = _ref.breakpoint,
|
|
2657
|
-
breakpoint = _ref$breakpoint === void 0 ? 'small' : _ref$breakpoint;
|
|
2658
|
-
|
|
2659
|
-
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2660
|
-
// TODO use useBreakpoint instead
|
|
2661
|
-
var _useWindowDimensions = useWindowDimensions(),
|
|
2662
|
-
width = _useWindowDimensions.width;
|
|
2663
|
-
|
|
2664
|
-
var breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
2873
|
+
function Notification(_ref) {
|
|
2874
|
+
var type = _ref.type,
|
|
2875
|
+
children = _ref.children,
|
|
2876
|
+
centeredText = _ref.centeredText,
|
|
2877
|
+
insets = _ref.insets,
|
|
2878
|
+
onDelete = _ref.onDelete,
|
|
2879
|
+
onDismiss = _ref.onDismiss;
|
|
2665
2880
|
|
|
2666
|
-
if (
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
children: child
|
|
2671
|
-
});
|
|
2672
|
-
})
|
|
2673
|
-
});
|
|
2881
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
2882
|
+
if (onDelete) {
|
|
2883
|
+
throw new Error('onDelete is deprecated us onDismiss instead');
|
|
2884
|
+
}
|
|
2674
2885
|
}
|
|
2675
2886
|
|
|
2676
|
-
return /*#__PURE__*/jsx(
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2887
|
+
return /*#__PURE__*/jsx(BaseMessage, {
|
|
2888
|
+
hasNoRadius: true,
|
|
2889
|
+
type: type,
|
|
2890
|
+
centeredText: centeredText,
|
|
2891
|
+
insets: insets,
|
|
2892
|
+
onDismiss: onDismiss,
|
|
2893
|
+
children: children
|
|
2682
2894
|
});
|
|
2683
2895
|
}
|
|
2684
2896
|
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
var
|
|
2897
|
+
var Container$2 = /*#__PURE__*/styled.View.withConfig({
|
|
2898
|
+
displayName: "SkeletonContent__Container"
|
|
2899
|
+
})(["background-color:", ";border-color:", ";height:100%;width:100%;"], function (_ref) {
|
|
2900
|
+
var theme = _ref.theme;
|
|
2901
|
+
return theme.kitt.skeleton.backgroundColor;
|
|
2902
|
+
}, function (_ref2) {
|
|
2903
|
+
var theme = _ref2.theme;
|
|
2904
|
+
return theme.kitt.skeleton.flareColor;
|
|
2905
|
+
});
|
|
2906
|
+
var AnimatedLinearGradient = Animated$1.createAnimatedComponent(LinearGradient);
|
|
2907
|
+
function SkeletonContent(_ref3) {
|
|
2908
|
+
var isLoading = _ref3.isLoading,
|
|
2909
|
+
width = _ref3.width;
|
|
2910
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2911
|
+
var sharedX = useSharedValue(0);
|
|
2912
|
+
useEffect(function () {
|
|
2913
|
+
if (isLoading) {
|
|
2914
|
+
sharedX.value = withRepeat(withTiming(1, {
|
|
2915
|
+
duration: theme.kitt.skeleton.animationDuration,
|
|
2916
|
+
easing: Easing$1.inOut(Easing$1.ease)
|
|
2917
|
+
}), -1);
|
|
2918
|
+
}
|
|
2919
|
+
}, [sharedX, width, isLoading, theme]);
|
|
2920
|
+
var linearGradientStyle = useAnimatedStyle(function () {
|
|
2921
|
+
var _f = function () {
|
|
2922
|
+
return {
|
|
2923
|
+
transform: [{
|
|
2924
|
+
translateX: interpolate(sharedX.value, [0, 1], [-width, width])
|
|
2925
|
+
}]
|
|
2926
|
+
};
|
|
2927
|
+
};
|
|
2692
2928
|
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2929
|
+
_f._closure = {
|
|
2930
|
+
interpolate: interpolate,
|
|
2931
|
+
sharedX: sharedX,
|
|
2932
|
+
width: width
|
|
2933
|
+
};
|
|
2934
|
+
_f.asString = "function _f(){const{interpolate,sharedX,width}=jsThis._closure;{return{transform:[{translateX:interpolate(sharedX.value,[0,1],[-width,width])}]};}}";
|
|
2935
|
+
_f.__workletHash = 1670955855244;
|
|
2936
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (41:47)";
|
|
2937
|
+
_f.__optimalization = 3;
|
|
2696
2938
|
|
|
2697
|
-
|
|
2698
|
-
return null;
|
|
2699
|
-
}
|
|
2939
|
+
global.__reanimatedWorkletInit(_f);
|
|
2700
2940
|
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2941
|
+
return _f;
|
|
2942
|
+
}());
|
|
2943
|
+
return /*#__PURE__*/jsx(Container$2, {
|
|
2944
|
+
children: /*#__PURE__*/jsx(AnimatedLinearGradient, {
|
|
2945
|
+
colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
|
|
2946
|
+
locations: [0.1, 0.5, 0.9],
|
|
2947
|
+
start: {
|
|
2948
|
+
x: 0,
|
|
2949
|
+
y: 0
|
|
2950
|
+
},
|
|
2951
|
+
end: {
|
|
2952
|
+
x: 1,
|
|
2953
|
+
y: 0
|
|
2954
|
+
},
|
|
2955
|
+
style: [StyleSheet.absoluteFill, linearGradientStyle]
|
|
2956
|
+
})
|
|
2707
2957
|
});
|
|
2708
2958
|
}
|
|
2709
2959
|
|
|
2710
|
-
var
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2960
|
+
var SkeletonContainer = /*#__PURE__*/styled(View).withConfig({
|
|
2961
|
+
displayName: "Skeleton__SkeletonContainer"
|
|
2962
|
+
})(["overflow:hidden;"]);
|
|
2963
|
+
function Skeleton(_ref) {
|
|
2964
|
+
var isLoading = _ref.isLoading,
|
|
2965
|
+
style = _ref.style;
|
|
2714
2966
|
|
|
2715
|
-
var
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2967
|
+
var _useState = useState(0),
|
|
2968
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2969
|
+
width = _useState2[0],
|
|
2970
|
+
setWidth = _useState2[1];
|
|
2971
|
+
|
|
2972
|
+
return /*#__PURE__*/jsx(SkeletonContainer, {
|
|
2973
|
+
style: style,
|
|
2974
|
+
onLayout: function onLayout(_ref2) {
|
|
2975
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
2976
|
+
return setWidth(nativeEvent.layout.width);
|
|
2977
|
+
},
|
|
2978
|
+
children: /*#__PURE__*/jsx(SkeletonContent, {
|
|
2979
|
+
isLoading: isLoading,
|
|
2980
|
+
width: width
|
|
2981
|
+
})
|
|
2982
|
+
});
|
|
2983
|
+
}
|
|
2984
|
+
var Bar = /*#__PURE__*/styled(Skeleton).withConfig({
|
|
2985
|
+
displayName: "Skeleton__Bar"
|
|
2986
|
+
})(["width:100%;height:", "px;border-radius:", "px;"], function (_ref3) {
|
|
2987
|
+
var theme = _ref3.theme;
|
|
2988
|
+
return theme.kitt.spacing * 2;
|
|
2732
2989
|
}, function (_ref4) {
|
|
2733
2990
|
var theme = _ref4.theme;
|
|
2734
|
-
return theme.kitt.
|
|
2735
|
-
}
|
|
2991
|
+
return theme.kitt.spacing * 2;
|
|
2992
|
+
});
|
|
2993
|
+
var Circle = /*#__PURE__*/styled(Skeleton).withConfig({
|
|
2994
|
+
displayName: "Skeleton__Circle"
|
|
2995
|
+
})(["width:", "px;height:", "px;border-radius:", "px;"], function (_ref5) {
|
|
2736
2996
|
var theme = _ref5.theme;
|
|
2737
|
-
return theme.kitt.
|
|
2997
|
+
return theme.kitt.spacing * 12;
|
|
2998
|
+
}, function (_ref6) {
|
|
2999
|
+
var theme = _ref6.theme;
|
|
3000
|
+
return theme.kitt.spacing * 12;
|
|
3001
|
+
}, function (_ref7) {
|
|
3002
|
+
var theme = _ref7.theme;
|
|
3003
|
+
return theme.kitt.spacing * 6;
|
|
2738
3004
|
});
|
|
2739
|
-
var
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
3005
|
+
var Square = /*#__PURE__*/styled(Skeleton).withConfig({
|
|
3006
|
+
displayName: "Skeleton__Square"
|
|
3007
|
+
})(["width:", "px;height:", "px;border-radius:", "px;"], function (_ref8) {
|
|
3008
|
+
var theme = _ref8.theme;
|
|
3009
|
+
return theme.kitt.spacing * 12;
|
|
3010
|
+
}, function (_ref9) {
|
|
3011
|
+
var theme = _ref9.theme;
|
|
3012
|
+
return theme.kitt.spacing * 12;
|
|
3013
|
+
}, function (_ref10) {
|
|
3014
|
+
var theme = _ref10.theme;
|
|
3015
|
+
return theme.kitt.spacing * 1.5;
|
|
3016
|
+
});
|
|
3017
|
+
Skeleton.Bar = Bar;
|
|
3018
|
+
Skeleton.Circle = Circle;
|
|
3019
|
+
Skeleton.Square = Square;
|
|
3020
|
+
|
|
3021
|
+
var Flex = /*#__PURE__*/styled.View.withConfig({
|
|
3022
|
+
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
3023
|
+
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
3024
|
+
}
|
|
3025
|
+
}).withConfig({
|
|
3026
|
+
displayName: "Flex"
|
|
3027
|
+
})(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], function (_ref) {
|
|
3028
|
+
var direction = _ref.direction;
|
|
3029
|
+
return direction;
|
|
3030
|
+
}, function (_ref2) {
|
|
3031
|
+
var theme = _ref2.theme,
|
|
3032
|
+
_ref2$padding = _ref2.padding,
|
|
3033
|
+
padding = _ref2$padding === void 0 ? 0 : _ref2$padding;
|
|
3034
|
+
return padding * theme.kitt.spacing;
|
|
3035
|
+
});
|
|
3036
|
+
|
|
3037
|
+
var storyPadding = 16;
|
|
3038
|
+
|
|
3039
|
+
var getBackgroundColorFromBlockColor = function (theme) {
|
|
3040
|
+
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'transparent';
|
|
3041
|
+
|
|
3042
|
+
switch (color) {
|
|
3043
|
+
case 'dark':
|
|
3044
|
+
return '#293033';
|
|
3045
|
+
|
|
3046
|
+
case 'light':
|
|
3047
|
+
return '#ffffff';
|
|
2745
3048
|
|
|
2746
3049
|
case 'primary':
|
|
2747
|
-
|
|
2748
|
-
return 'primary';
|
|
2749
|
-
}
|
|
3050
|
+
return theme.kitt.palettes.lateOcean.lateOcean;
|
|
2750
3051
|
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
3052
|
+
default:
|
|
3053
|
+
return 'transparent';
|
|
3054
|
+
}
|
|
3055
|
+
};
|
|
3056
|
+
|
|
3057
|
+
var getTypographyColorFromBlockColor = function () {
|
|
3058
|
+
var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transparent';
|
|
3059
|
+
|
|
3060
|
+
switch (color) {
|
|
3061
|
+
case 'dark':
|
|
3062
|
+
case 'primary':
|
|
3063
|
+
return 'white';
|
|
2755
3064
|
|
|
3065
|
+
case 'light':
|
|
2756
3066
|
default:
|
|
2757
|
-
|
|
2758
|
-
return 'black';
|
|
2759
|
-
}
|
|
3067
|
+
return 'black';
|
|
2760
3068
|
}
|
|
2761
3069
|
};
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
3070
|
+
|
|
3071
|
+
var StoryBlockBackgroundContext = /*#__PURE__*/createContext('transparent');
|
|
3072
|
+
var StoryBlockColorContext = /*#__PURE__*/createContext('black');
|
|
3073
|
+
var useStoryBlockColor = function (color) {
|
|
3074
|
+
var storyBlockColor = useContext(StoryBlockColorContext);
|
|
3075
|
+
return color || storyBlockColor;
|
|
3076
|
+
};
|
|
3077
|
+
var StyledStoryBlockView = /*#__PURE__*/styled.View.withConfig({
|
|
3078
|
+
displayName: "StoryBlock__StyledStoryBlockView"
|
|
3079
|
+
})(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, function (_ref) {
|
|
3080
|
+
var theme = _ref.theme,
|
|
3081
|
+
background = _ref.background;
|
|
3082
|
+
return getBackgroundColorFromBlockColor(theme, background);
|
|
3083
|
+
});
|
|
3084
|
+
function StoryBlock(_ref2) {
|
|
3085
|
+
var children = _ref2.children,
|
|
3086
|
+
background = _ref2.background;
|
|
3087
|
+
return /*#__PURE__*/jsx(StyledStoryBlockView, {
|
|
3088
|
+
background: background,
|
|
3089
|
+
children: /*#__PURE__*/jsx(StoryBlockColorContext.Provider, {
|
|
3090
|
+
value: getTypographyColorFromBlockColor(background),
|
|
3091
|
+
children: /*#__PURE__*/jsx(StoryBlockBackgroundContext.Provider, {
|
|
3092
|
+
value: background,
|
|
3093
|
+
children: children
|
|
3094
|
+
})
|
|
2775
3095
|
})
|
|
2776
3096
|
});
|
|
2777
3097
|
}
|
|
2778
3098
|
|
|
2779
|
-
var
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
moonPurple: '#DBD6F9',
|
|
2800
|
-
moonPurpleLight1: '#EDEBFC'
|
|
2801
|
-
};
|
|
3099
|
+
var StoryTitleContainer = /*#__PURE__*/styled.View.withConfig({
|
|
3100
|
+
displayName: "StoryTitle__StoryTitleContainer"
|
|
3101
|
+
})(["margin-bottom:30px;"]);
|
|
3102
|
+
var StorySubTitleContainer = /*#__PURE__*/styled.View.withConfig({
|
|
3103
|
+
displayName: "StoryTitle__StorySubTitleContainer"
|
|
3104
|
+
})(["margin-bottom:10px;"]);
|
|
3105
|
+
function StoryTitle(_ref) {
|
|
3106
|
+
var color = _ref.color,
|
|
3107
|
+
children = _ref.children,
|
|
3108
|
+
numberOfLines = _ref.numberOfLines;
|
|
3109
|
+
return /*#__PURE__*/jsx(StoryTitleContainer, {
|
|
3110
|
+
children: /*#__PURE__*/jsx(Typography.Header1, {
|
|
3111
|
+
variant: "bold",
|
|
3112
|
+
base: "header1",
|
|
3113
|
+
color: useStoryBlockColor(color),
|
|
3114
|
+
numberOfLines: numberOfLines,
|
|
3115
|
+
children: children
|
|
3116
|
+
})
|
|
3117
|
+
});
|
|
3118
|
+
}
|
|
2802
3119
|
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2818
|
-
transparent: lateOceanColorPalette.transparent,
|
|
2819
|
-
disabled: lateOceanColorPalette.black50,
|
|
2820
|
-
overlay: {
|
|
2821
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2822
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2823
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2824
|
-
}
|
|
2825
|
-
};
|
|
3120
|
+
function StoryTitleLevel2(_ref2) {
|
|
3121
|
+
var color = _ref2.color,
|
|
3122
|
+
children = _ref2.children,
|
|
3123
|
+
numberOfLines = _ref2.numberOfLines;
|
|
3124
|
+
return /*#__PURE__*/jsx(StoryTitleContainer, {
|
|
3125
|
+
children: /*#__PURE__*/jsx(Typography.Header2, {
|
|
3126
|
+
variant: "bold",
|
|
3127
|
+
base: "header2",
|
|
3128
|
+
color: useStoryBlockColor(color),
|
|
3129
|
+
numberOfLines: numberOfLines,
|
|
3130
|
+
children: children
|
|
3131
|
+
})
|
|
3132
|
+
});
|
|
3133
|
+
}
|
|
2826
3134
|
|
|
2827
|
-
|
|
2828
|
-
borderRadius: 10,
|
|
2829
|
-
"default": {
|
|
2830
|
-
backgroundColor: colors.primary
|
|
2831
|
-
},
|
|
2832
|
-
light: {
|
|
2833
|
-
backgroundColor: lateOceanColorPalette.black100
|
|
2834
|
-
}
|
|
2835
|
-
};
|
|
3135
|
+
StoryTitleLevel2.displayName = 'StoryTitle.Level2';
|
|
2836
3136
|
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
medium: {
|
|
2853
|
-
hover: 1.05
|
|
2854
|
-
}
|
|
2855
|
-
},
|
|
2856
|
-
contentPadding: {
|
|
2857
|
-
"default": '8px 16px 7px',
|
|
2858
|
-
large: '12px 24px 11px',
|
|
2859
|
-
disabled: '6px 14px 5px'
|
|
2860
|
-
},
|
|
2861
|
-
transition: {
|
|
2862
|
-
duration: '200ms',
|
|
2863
|
-
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2864
|
-
},
|
|
2865
|
-
"default": {
|
|
2866
|
-
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2867
|
-
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2868
|
-
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2869
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2870
|
-
},
|
|
2871
|
-
primary: {
|
|
2872
|
-
backgroundColor: colors.primary,
|
|
2873
|
-
pressedBackgroundColor: colors.primaryLight,
|
|
2874
|
-
hoverBackgroundColor: colors.primaryLight,
|
|
2875
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2876
|
-
},
|
|
2877
|
-
white: {
|
|
2878
|
-
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2879
|
-
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2880
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2881
|
-
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2882
|
-
},
|
|
2883
|
-
subtle: {
|
|
2884
|
-
backgroundColor: colors.transparent,
|
|
2885
|
-
pressedBackgroundColor: colors.transparent,
|
|
2886
|
-
hoverBackgroundColor: colors.transparent,
|
|
2887
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2888
|
-
color: colors.primary,
|
|
2889
|
-
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2890
|
-
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2891
|
-
},
|
|
2892
|
-
'subtle-dark': {
|
|
2893
|
-
backgroundColor: colors.transparent,
|
|
2894
|
-
pressedBackgroundColor: colors.transparent,
|
|
2895
|
-
hoverBackgroundColor: colors.transparent,
|
|
2896
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2897
|
-
color: colors.black,
|
|
2898
|
-
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2899
|
-
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2900
|
-
},
|
|
2901
|
-
disabled: {
|
|
2902
|
-
backgroundColor: colors.disabled,
|
|
2903
|
-
pressedBackgroundColor: colors.disabled,
|
|
2904
|
-
hoverBackgroundColor: colors.disabled,
|
|
2905
|
-
focusBorderColor: lateOceanColorPalette.black100,
|
|
2906
|
-
borderColor: lateOceanColorPalette.black100
|
|
2907
|
-
}
|
|
2908
|
-
};
|
|
3137
|
+
function StoryTitleLevel3(_ref3) {
|
|
3138
|
+
var color = _ref3.color,
|
|
3139
|
+
children = _ref3.children,
|
|
3140
|
+
numberOfLines = _ref3.numberOfLines;
|
|
3141
|
+
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
3142
|
+
children: /*#__PURE__*/jsx(Typography.Header3, {
|
|
3143
|
+
variant: "bold",
|
|
3144
|
+
base: "header3",
|
|
3145
|
+
medium: "header4",
|
|
3146
|
+
color: useStoryBlockColor(color),
|
|
3147
|
+
numberOfLines: numberOfLines,
|
|
3148
|
+
children: children
|
|
3149
|
+
})
|
|
3150
|
+
});
|
|
3151
|
+
}
|
|
2909
3152
|
|
|
2910
|
-
|
|
2911
|
-
borderRadius: 20,
|
|
2912
|
-
borderWidth: 2,
|
|
2913
|
-
primary: {
|
|
2914
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2915
|
-
borderColor: colors.primary
|
|
2916
|
-
},
|
|
2917
|
-
secondary: {
|
|
2918
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
2919
|
-
borderColor: colors.separator
|
|
2920
|
-
},
|
|
2921
|
-
subtle: {
|
|
2922
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
2923
|
-
borderColor: colors.separator
|
|
2924
|
-
}
|
|
2925
|
-
};
|
|
3153
|
+
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
2926
3154
|
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
};
|
|
3155
|
+
function StoryTitleLevel4(_ref4) {
|
|
3156
|
+
var color = _ref4.color,
|
|
3157
|
+
children = _ref4.children,
|
|
3158
|
+
numberOfLines = _ref4.numberOfLines;
|
|
3159
|
+
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
3160
|
+
children: /*#__PURE__*/jsx(Typography.Header4, {
|
|
3161
|
+
variant: "bold",
|
|
3162
|
+
base: "header4",
|
|
3163
|
+
medium: "header5",
|
|
3164
|
+
color: useStoryBlockColor(color),
|
|
3165
|
+
numberOfLines: numberOfLines,
|
|
3166
|
+
children: children
|
|
3167
|
+
})
|
|
3168
|
+
});
|
|
3169
|
+
}
|
|
2941
3170
|
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
return {
|
|
2947
|
-
baseAndSmall: {
|
|
2948
|
-
fontSize: baseAndSmallFontSize,
|
|
2949
|
-
lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
|
|
2950
|
-
},
|
|
2951
|
-
mediumAndWide: {
|
|
2952
|
-
fontSize: mediumAndWideFontSize,
|
|
2953
|
-
lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
|
|
2954
|
-
}
|
|
2955
|
-
};
|
|
2956
|
-
};
|
|
2957
|
-
var typography = {
|
|
2958
|
-
colors: {
|
|
2959
|
-
black: lateOceanColorPalette.black1000,
|
|
2960
|
-
'black-anthracite': lateOceanColorPalette.black800,
|
|
2961
|
-
'black-light': lateOceanColorPalette.black555,
|
|
2962
|
-
white: lateOceanColorPalette.white,
|
|
2963
|
-
'white-light': lateOceanColorPalette.white,
|
|
2964
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2965
|
-
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
2966
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2967
|
-
success: lateOceanColorPalette.viride,
|
|
2968
|
-
danger: lateOceanColorPalette.englishVermillon
|
|
2969
|
-
},
|
|
2970
|
-
types: {
|
|
2971
|
-
headers: {
|
|
2972
|
-
fontFamily: {
|
|
2973
|
-
regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
2974
|
-
bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
2975
|
-
},
|
|
2976
|
-
fontWeight: 400,
|
|
2977
|
-
fontStyle: 'normal',
|
|
2978
|
-
configs: {
|
|
2979
|
-
// also known as xxlarge
|
|
2980
|
-
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
2981
|
-
// also known as xlarge
|
|
2982
|
-
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
2983
|
-
// also known as medium
|
|
2984
|
-
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
2985
|
-
// also known as xsmall
|
|
2986
|
-
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
2987
|
-
// also known as xxsmall
|
|
2988
|
-
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
2989
|
-
}
|
|
2990
|
-
},
|
|
2991
|
-
bodies: {
|
|
2992
|
-
fontFamily: {
|
|
2993
|
-
regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
2994
|
-
bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
2995
|
-
},
|
|
2996
|
-
fontWeight: {
|
|
2997
|
-
regular: 400,
|
|
2998
|
-
bold: 700
|
|
2999
|
-
},
|
|
3000
|
-
fontStyle: {
|
|
3001
|
-
regular: 'normal',
|
|
3002
|
-
bold: 'normal'
|
|
3003
|
-
},
|
|
3004
|
-
configs: {
|
|
3005
|
-
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
3006
|
-
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
3007
|
-
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
3008
|
-
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
3009
|
-
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
3010
|
-
}
|
|
3011
|
-
}
|
|
3012
|
-
},
|
|
3013
|
-
link: {
|
|
3014
|
-
disabledColor: lateOceanColorPalette.black200
|
|
3015
|
-
}
|
|
3016
|
-
};
|
|
3171
|
+
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
3172
|
+
StoryTitle.Level2 = StoryTitleLevel2;
|
|
3173
|
+
StoryTitle.Level3 = StoryTitleLevel3;
|
|
3174
|
+
StoryTitle.Level4 = StoryTitleLevel4;
|
|
3017
3175
|
|
|
3018
|
-
var
|
|
3019
|
-
"
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
color: 'black'
|
|
3033
|
-
},
|
|
3034
|
-
hover: {
|
|
3035
|
-
borderColor: lateOceanColorPalette.black200,
|
|
3036
|
-
color: 'black'
|
|
3037
|
-
},
|
|
3038
|
-
focus: {
|
|
3039
|
-
borderColor: colors.primary,
|
|
3040
|
-
color: 'black'
|
|
3041
|
-
},
|
|
3042
|
-
disabled: {
|
|
3043
|
-
backgroundColor: colors.disabled,
|
|
3044
|
-
borderColor: colors.separator,
|
|
3045
|
-
color: 'black-light'
|
|
3046
|
-
},
|
|
3047
|
-
invalid: {
|
|
3048
|
-
borderColor: colors.separator,
|
|
3049
|
-
color: 'black'
|
|
3050
|
-
}
|
|
3051
|
-
};
|
|
3052
|
-
var input = {
|
|
3053
|
-
color: {
|
|
3054
|
-
selection: colors.primary,
|
|
3055
|
-
placeholder: typography.colors['black-light']
|
|
3056
|
-
},
|
|
3057
|
-
borderWidth: 2,
|
|
3058
|
-
borderRadius: 10,
|
|
3059
|
-
icon: {
|
|
3060
|
-
size: 20
|
|
3061
|
-
},
|
|
3062
|
-
padding: {
|
|
3063
|
-
"default": '5px 16px',
|
|
3064
|
-
iOSSingleLine: '7px 16px'
|
|
3065
|
-
},
|
|
3066
|
-
transition: {
|
|
3067
|
-
property: 'border-color',
|
|
3068
|
-
duration: '200ms',
|
|
3069
|
-
timingFunction: 'ease-in-out'
|
|
3070
|
-
},
|
|
3071
|
-
states: inputStatesStyle
|
|
3072
|
-
};
|
|
3176
|
+
var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
|
|
3177
|
+
displayName: "Story__StoryContainer"
|
|
3178
|
+
})(["padding:", "px;"], storyPadding);
|
|
3179
|
+
function Story(_ref) {
|
|
3180
|
+
var title = _ref.title,
|
|
3181
|
+
contentContainerStyle = _ref.contentContainerStyle,
|
|
3182
|
+
children = _ref.children;
|
|
3183
|
+
return /*#__PURE__*/jsxs(StoryContainer$1, {
|
|
3184
|
+
contentContainerStyle: contentContainerStyle,
|
|
3185
|
+
children: [/*#__PURE__*/jsx(StoryTitle, {
|
|
3186
|
+
children: title
|
|
3187
|
+
}), children]
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3073
3190
|
|
|
3074
|
-
var
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
};
|
|
3191
|
+
var _excluded$2 = ["title", "children", "internalIsDemoSection"],
|
|
3192
|
+
_excluded2 = ["title", "children"],
|
|
3193
|
+
_excluded3 = ["title", "children"];
|
|
3078
3194
|
|
|
3079
|
-
var
|
|
3080
|
-
size: 18,
|
|
3081
|
-
unchecked: {
|
|
3082
|
-
backgroundColor: colors.uiBackgroundLight,
|
|
3083
|
-
borderWidth: 2,
|
|
3084
|
-
borderColor: lateOceanColorPalette.black200
|
|
3085
|
-
},
|
|
3086
|
-
checked: {
|
|
3087
|
-
backgroundColor: colors.primary,
|
|
3088
|
-
innerSize: 5,
|
|
3089
|
-
innerBackgroundColor: colors.uiBackgroundLight
|
|
3090
|
-
},
|
|
3091
|
-
disabled: {
|
|
3092
|
-
backgroundColor: colors.disabled,
|
|
3093
|
-
borderColor: colors.separator
|
|
3094
|
-
}
|
|
3095
|
-
};
|
|
3195
|
+
function ownKeys$3(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; }
|
|
3096
3196
|
|
|
3097
|
-
var
|
|
3098
|
-
|
|
3099
|
-
|
|
3197
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3198
|
+
var StyledSection = /*#__PURE__*/styled.View.withConfig({
|
|
3199
|
+
displayName: "StorySection__StyledSection"
|
|
3200
|
+
})(["margin-bottom:32px;"]);
|
|
3201
|
+
function StorySection(_ref) {
|
|
3202
|
+
var title = _ref.title,
|
|
3203
|
+
children = _ref.children,
|
|
3204
|
+
internalIsDemoSection = _ref.internalIsDemoSection,
|
|
3205
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
3100
3206
|
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
};
|
|
3207
|
+
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
3208
|
+
return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
3209
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
|
|
3210
|
+
children: title
|
|
3211
|
+
}), children]
|
|
3212
|
+
}));
|
|
3213
|
+
}
|
|
3214
|
+
var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
|
|
3215
|
+
displayName: "StorySection__StyledSubSection"
|
|
3216
|
+
})(["margin-bottom:16px;"]);
|
|
3107
3217
|
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3218
|
+
function SubSection(_ref2) {
|
|
3219
|
+
var title = _ref2.title,
|
|
3220
|
+
children = _ref2.children,
|
|
3221
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
3222
|
+
|
|
3223
|
+
return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
3224
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
|
|
3225
|
+
children: title
|
|
3226
|
+
}), children]
|
|
3227
|
+
}));
|
|
3228
|
+
}
|
|
3229
|
+
|
|
3230
|
+
var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
|
|
3231
|
+
displayName: "StorySection__StyledBlockSection"
|
|
3232
|
+
})(["margin-bottom:16px;"]);
|
|
3233
|
+
|
|
3234
|
+
function BlockSection(_ref3) {
|
|
3235
|
+
var title = _ref3.title,
|
|
3236
|
+
children = _ref3.children,
|
|
3237
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
3238
|
+
|
|
3239
|
+
return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
3240
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
3241
|
+
children: title
|
|
3242
|
+
}), children]
|
|
3243
|
+
}));
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3246
|
+
var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
|
|
3247
|
+
displayName: "StorySection__StyledDemoSection"
|
|
3248
|
+
})(["margin-bottom:64px;"]);
|
|
3249
|
+
|
|
3250
|
+
function DemoSection(_ref4) {
|
|
3251
|
+
var children = _ref4.children;
|
|
3252
|
+
return /*#__PURE__*/jsx(StyledDemoSection, {
|
|
3253
|
+
children: /*#__PURE__*/jsx(StorySection, {
|
|
3254
|
+
internalIsDemoSection: true,
|
|
3255
|
+
title: "Demo",
|
|
3256
|
+
children: children
|
|
3257
|
+
})
|
|
3258
|
+
});
|
|
3259
|
+
}
|
|
3260
|
+
|
|
3261
|
+
StorySection.SubSection = SubSection;
|
|
3262
|
+
StorySection.BlockSection = BlockSection;
|
|
3263
|
+
/** @deprecated use StorySection.Demo instead */
|
|
3264
|
+
|
|
3265
|
+
StorySection.DemoSection = DemoSection;
|
|
3266
|
+
StorySection.Demo = DemoSection;
|
|
3267
|
+
/** @deprecated use StorySection instead */
|
|
3268
|
+
|
|
3269
|
+
var DeprecatedSection = StorySection;
|
|
3270
|
+
|
|
3271
|
+
function StoryContainer(_ref) {
|
|
3272
|
+
var children = _ref.children,
|
|
3273
|
+
title = _ref.title,
|
|
3274
|
+
_ref$state = _ref.state,
|
|
3275
|
+
state = _ref$state === void 0 ? 'none' : _ref$state,
|
|
3276
|
+
_ref$platform = _ref.platform,
|
|
3277
|
+
platform = _ref$platform === void 0 ? 'all' : _ref$platform;
|
|
3278
|
+
if (platform === 'web') return null;
|
|
3279
|
+
return /*#__PURE__*/jsx(StorySection.BlockSection, {
|
|
3280
|
+
testID: state,
|
|
3281
|
+
title: title,
|
|
3282
|
+
children: children
|
|
3283
|
+
});
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
function StoryDecorator(storyFn, context) {
|
|
3287
|
+
return /*#__PURE__*/jsx(Story, {
|
|
3288
|
+
title: context.name,
|
|
3289
|
+
children: storyFn()
|
|
3290
|
+
});
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
var SmallScreenRow = /*#__PURE__*/styled.View.withConfig({
|
|
3294
|
+
displayName: "StoryGrid__SmallScreenRow"
|
|
3295
|
+
})(["flex-direction:column;margin:0;"]);
|
|
3296
|
+
var SmallScreenCol = /*#__PURE__*/styled.View.withConfig({
|
|
3297
|
+
displayName: "StoryGrid__SmallScreenCol"
|
|
3298
|
+
})(["padding:8px 0 16px;"]);
|
|
3299
|
+
var FlexRow = /*#__PURE__*/styled.View.withConfig({
|
|
3300
|
+
displayName: "StoryGrid__FlexRow"
|
|
3301
|
+
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
3302
|
+
var FlexCol = /*#__PURE__*/styled.View.withConfig({
|
|
3303
|
+
displayName: "StoryGrid__FlexCol"
|
|
3304
|
+
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
3305
|
+
|
|
3306
|
+
function StoryGridRow(_ref) {
|
|
3307
|
+
var children = _ref.children,
|
|
3308
|
+
_ref$breakpoint = _ref.breakpoint,
|
|
3309
|
+
breakpoint = _ref$breakpoint === void 0 ? 'small' : _ref$breakpoint;
|
|
3310
|
+
|
|
3311
|
+
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3312
|
+
// TODO use useBreakpoint instead
|
|
3313
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
3314
|
+
width = _useWindowDimensions.width;
|
|
3315
|
+
|
|
3316
|
+
var breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
3317
|
+
|
|
3318
|
+
if (width < breakpointValue) {
|
|
3319
|
+
return /*#__PURE__*/jsx(SmallScreenRow, {
|
|
3320
|
+
children: Children.map(children, function (child) {
|
|
3321
|
+
return /*#__PURE__*/jsx(SmallScreenCol, {
|
|
3322
|
+
children: child
|
|
3323
|
+
});
|
|
3324
|
+
})
|
|
3325
|
+
});
|
|
3113
3326
|
}
|
|
3114
|
-
};
|
|
3115
3327
|
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
hover: 1.05
|
|
3136
|
-
}
|
|
3137
|
-
},
|
|
3138
|
-
disabled: {
|
|
3139
|
-
scale: 1,
|
|
3140
|
-
backgroundColor: button.disabled.backgroundColor,
|
|
3141
|
-
borderColor: button.disabled.borderColor
|
|
3142
|
-
},
|
|
3143
|
-
"default": {
|
|
3144
|
-
pressedBackgroundColor: button["default"].pressedBackgroundColor
|
|
3145
|
-
},
|
|
3146
|
-
white: {
|
|
3147
|
-
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
3328
|
+
return /*#__PURE__*/jsx(FlexRow, {
|
|
3329
|
+
children: Children.map(children, function (child) {
|
|
3330
|
+
return /*#__PURE__*/jsx(FlexCol, {
|
|
3331
|
+
children: child
|
|
3332
|
+
});
|
|
3333
|
+
})
|
|
3334
|
+
});
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3337
|
+
function StoryGridCol(_ref2) {
|
|
3338
|
+
var title = _ref2.title,
|
|
3339
|
+
titleColor = _ref2.titleColor,
|
|
3340
|
+
children = _ref2.children,
|
|
3341
|
+
_ref2$platform = _ref2.platform,
|
|
3342
|
+
platform = _ref2$platform === void 0 ? 'all' : _ref2$platform;
|
|
3343
|
+
var isNative = Platform.OS === 'ios' || Platform.OS === 'android';
|
|
3344
|
+
|
|
3345
|
+
if (Platform.OS === 'web' && platform === 'native') {
|
|
3346
|
+
return null;
|
|
3148
3347
|
}
|
|
3149
|
-
};
|
|
3150
3348
|
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
borderWidth: 1,
|
|
3155
|
-
innerMargin: 8
|
|
3156
|
-
};
|
|
3349
|
+
if (isNative && platform === 'web') {
|
|
3350
|
+
return null;
|
|
3351
|
+
}
|
|
3157
3352
|
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3353
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
3354
|
+
children: [title ? /*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
3355
|
+
numberOfLines: 1,
|
|
3356
|
+
color: titleColor,
|
|
3357
|
+
children: title
|
|
3358
|
+
}) : null, children]
|
|
3359
|
+
});
|
|
3360
|
+
}
|
|
3161
3361
|
|
|
3162
|
-
var
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
animationDuration: 1000
|
|
3362
|
+
var StoryGrid = {
|
|
3363
|
+
Row: StoryGridRow,
|
|
3364
|
+
Col: StoryGridCol
|
|
3166
3365
|
};
|
|
3167
3366
|
|
|
3168
|
-
var
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
borderWidth: 0,
|
|
3199
|
-
borderColor: colors.transparent
|
|
3200
|
-
},
|
|
3201
|
-
outline: {
|
|
3202
|
-
backgroundColor: colors.transparent,
|
|
3203
|
-
borderWidth: 1,
|
|
3204
|
-
borderColor: colors.danger
|
|
3205
|
-
}
|
|
3206
|
-
}
|
|
3207
|
-
};
|
|
3367
|
+
var Container$1 = /*#__PURE__*/styled.View.withConfig({
|
|
3368
|
+
displayName: "Tag__Container"
|
|
3369
|
+
})(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], function (_ref) {
|
|
3370
|
+
var theme = _ref.theme,
|
|
3371
|
+
type = _ref.type,
|
|
3372
|
+
variant = _ref.variant;
|
|
3373
|
+
return theme.kitt.tag[type][variant].backgroundColor;
|
|
3374
|
+
}, function (_ref2) {
|
|
3375
|
+
var theme = _ref2.theme,
|
|
3376
|
+
type = _ref2.type,
|
|
3377
|
+
variant = _ref2.variant;
|
|
3378
|
+
return theme.kitt.tag[type][variant].borderWidth;
|
|
3379
|
+
}, function (_ref3) {
|
|
3380
|
+
var theme = _ref3.theme,
|
|
3381
|
+
type = _ref3.type,
|
|
3382
|
+
variant = _ref3.variant;
|
|
3383
|
+
return theme.kitt.tag[type][variant].borderColor;
|
|
3384
|
+
}, function (_ref4) {
|
|
3385
|
+
var theme = _ref4.theme;
|
|
3386
|
+
return theme.kitt.tag.padding;
|
|
3387
|
+
}, function (_ref5) {
|
|
3388
|
+
var theme = _ref5.theme;
|
|
3389
|
+
return theme.kitt.tag.borderRadius;
|
|
3390
|
+
});
|
|
3391
|
+
var getLabelColor = function (type, variant) {
|
|
3392
|
+
switch (type) {
|
|
3393
|
+
case 'danger':
|
|
3394
|
+
{
|
|
3395
|
+
return variant === 'outline' ? 'danger' : 'black';
|
|
3396
|
+
}
|
|
3208
3397
|
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
horizontalPadding: 16,
|
|
3214
|
-
verticalPadding: 4,
|
|
3215
|
-
floatingPadding: 8
|
|
3216
|
-
};
|
|
3398
|
+
case 'primary':
|
|
3399
|
+
{
|
|
3400
|
+
return 'primary';
|
|
3401
|
+
}
|
|
3217
3402
|
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
medium: 768,
|
|
3223
|
-
large: 1024,
|
|
3224
|
-
wide: 1280
|
|
3225
|
-
},
|
|
3226
|
-
min: {
|
|
3227
|
-
smallBreakpoint: 'min-width: 480px',
|
|
3228
|
-
mediumBreakpoint: 'min-width: 768px',
|
|
3229
|
-
largeBreakpoint: 'min-width: 1024px',
|
|
3230
|
-
wideBreakpoint: 'min-width: 1280px'
|
|
3231
|
-
},
|
|
3232
|
-
max: {
|
|
3233
|
-
smallBreakpoint: 'max-width: 479px',
|
|
3234
|
-
mediumBreakpoint: 'max-width: 767px',
|
|
3235
|
-
largeBreakpoint: 'max-width: 1023px',
|
|
3236
|
-
wideBreakpoint: 'max-width: 1279px'
|
|
3237
|
-
}
|
|
3238
|
-
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3239
|
-
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
3403
|
+
case 'default':
|
|
3404
|
+
{
|
|
3405
|
+
return 'black';
|
|
3406
|
+
}
|
|
3240
3407
|
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
},
|
|
3247
|
-
avatar: avatar,
|
|
3248
|
-
button: button,
|
|
3249
|
-
card: card,
|
|
3250
|
-
feedbackMessage: feedbackMessage,
|
|
3251
|
-
forms: forms,
|
|
3252
|
-
typography: typography,
|
|
3253
|
-
tag: tag,
|
|
3254
|
-
shadows: shadows,
|
|
3255
|
-
fullScreenModal: fullScreenModal,
|
|
3256
|
-
iconButton: iconButton,
|
|
3257
|
-
listItem: listItem,
|
|
3258
|
-
tooltip: tooltip,
|
|
3259
|
-
skeleton: skeleton,
|
|
3260
|
-
breakpoints: breakpoints
|
|
3408
|
+
default:
|
|
3409
|
+
{
|
|
3410
|
+
return 'black';
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3261
3413
|
};
|
|
3414
|
+
function Tag(_ref6) {
|
|
3415
|
+
var label = _ref6.label,
|
|
3416
|
+
_ref6$type = _ref6.type,
|
|
3417
|
+
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
3418
|
+
_ref6$variant = _ref6.variant,
|
|
3419
|
+
variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
|
|
3420
|
+
return /*#__PURE__*/jsx(Container$1, {
|
|
3421
|
+
type: type,
|
|
3422
|
+
variant: variant,
|
|
3423
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
3424
|
+
base: "body-xsmall",
|
|
3425
|
+
color: getLabelColor(type, variant),
|
|
3426
|
+
children: label
|
|
3427
|
+
})
|
|
3428
|
+
});
|
|
3429
|
+
}
|
|
3262
3430
|
|
|
3263
3431
|
function Title(_ref) {
|
|
3264
3432
|
var children = _ref.children;
|
|
@@ -3671,79 +3839,6 @@ function TypographyLink(_ref5) {
|
|
|
3671
3839
|
}));
|
|
3672
3840
|
}
|
|
3673
3841
|
|
|
3674
|
-
function matchWindowSize(_ref, _ref2) {
|
|
3675
|
-
var width = _ref.width,
|
|
3676
|
-
height = _ref.height;
|
|
3677
|
-
var minWidth = _ref2.minWidth,
|
|
3678
|
-
maxWidth = _ref2.maxWidth,
|
|
3679
|
-
minHeight = _ref2.minHeight,
|
|
3680
|
-
maxHeight = _ref2.maxHeight;
|
|
3681
|
-
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3682
|
-
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3683
|
-
return hasWidthMatched && hasHeightMatched;
|
|
3684
|
-
}
|
|
3685
|
-
function useMatchWindowSize(options) {
|
|
3686
|
-
var _useWindowDimensions = useWindowDimensions(),
|
|
3687
|
-
width = _useWindowDimensions.width,
|
|
3688
|
-
height = _useWindowDimensions.height;
|
|
3689
|
-
|
|
3690
|
-
return matchWindowSize({
|
|
3691
|
-
width: width,
|
|
3692
|
-
height: height
|
|
3693
|
-
}, options);
|
|
3694
|
-
}
|
|
3695
|
-
|
|
3696
|
-
function createWindowSizeHelper(dimensions) {
|
|
3697
|
-
return {
|
|
3698
|
-
matchWindowSize: function matchWindowSize$1(options) {
|
|
3699
|
-
return matchWindowSize(dimensions, options);
|
|
3700
|
-
},
|
|
3701
|
-
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
3702
|
-
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
3703
|
-
},
|
|
3704
|
-
mapWindowWidth: function mapWindowWidth() {
|
|
3705
|
-
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3706
|
-
widthList[_key] = arguments[_key];
|
|
3707
|
-
}
|
|
3708
|
-
|
|
3709
|
-
if ((process.env.NODE_ENV !== "production")) {
|
|
3710
|
-
widthList.slice(1).forEach(function (_ref, index) {
|
|
3711
|
-
var _ref2 = _slicedToArray(_ref, 1),
|
|
3712
|
-
minWidth = _ref2[0];
|
|
3713
|
-
|
|
3714
|
-
var previousMinWidth = widthList[index][0];
|
|
3715
|
-
|
|
3716
|
-
if (previousMinWidth > minWidth) {
|
|
3717
|
-
throw new Error("mapWindowWidth: sort your values to be mobile first. ".concat(minWidth, " is < ").concat(previousMinWidth, ", so ").concat(minWidth, " should be before ").concat(previousMinWidth, "."));
|
|
3718
|
-
}
|
|
3719
|
-
});
|
|
3720
|
-
}
|
|
3721
|
-
|
|
3722
|
-
var found = widthList.find(function (_ref3) {
|
|
3723
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
3724
|
-
minWidth = _ref4[0];
|
|
3725
|
-
_ref4[1];
|
|
3726
|
-
|
|
3727
|
-
return matchWindowSize(dimensions, {
|
|
3728
|
-
minWidth: Number(minWidth)
|
|
3729
|
-
});
|
|
3730
|
-
});
|
|
3731
|
-
if (!found) return null;
|
|
3732
|
-
return found[1];
|
|
3733
|
-
}
|
|
3734
|
-
};
|
|
3735
|
-
}
|
|
3736
|
-
|
|
3737
|
-
function useKittTheme() {
|
|
3738
|
-
var dimensions = useWindowDimensions();
|
|
3739
|
-
return useMemo(function () {
|
|
3740
|
-
return {
|
|
3741
|
-
kitt: theme,
|
|
3742
|
-
responsive: createWindowSizeHelper(dimensions)
|
|
3743
|
-
};
|
|
3744
|
-
}, [dimensions]);
|
|
3745
|
-
}
|
|
3746
|
-
|
|
3747
3842
|
var hex2rgba = function (hex) {
|
|
3748
3843
|
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
3749
3844
|
var r = parseInt(hex.slice(1, 3), 16);
|
|
@@ -3782,5 +3877,5 @@ function MatchWindowSize(_ref) {
|
|
|
3782
3877
|
return children;
|
|
3783
3878
|
}
|
|
3784
3879
|
|
|
3785
|
-
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPressable, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
|
|
3880
|
+
export { Avatar, Button, Card, Checkbox, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPhone, InputPressable, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
|
|
3786
3881
|
//# sourceMappingURL=index-browser-all.es.js.map
|