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