@ornikar/kitt-universal 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +1 -1
- package/dist/definitions/forms/DatePicker/DatePicker.d.ts +30 -0
- package/dist/definitions/forms/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts +11 -0
- package/dist/definitions/forms/DatePicker/DatePickerInputPart.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts +11 -0
- package/dist/definitions/forms/DatePicker/ModalPlatformDateTimePicker.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts +14 -0
- package/dist/definitions/forms/DatePicker/PlatformDateTimePicker.d.ts.map +1 -0
- package/dist/definitions/forms/InputTag/InputTag.d.ts +10 -0
- package/dist/definitions/forms/InputTag/InputTag.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 +2 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/datePicker.d.ts +11 -0
- package/dist/definitions/themes/late-ocean/datePicker.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/input.d.ts +1 -0
- package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/inputTag.d.ts +14 -0
- package/dist/definitions/themes/late-ocean/inputTag.d.ts.map +1 -0
- package/dist/index-browser-all.es.android.js +1135 -773
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +1135 -773
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +1275 -913
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +855 -490
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +1097 -763
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -1
- package/dist/index-node-14.17.cjs.web.js +874 -543
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +33 -1
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +33 -1
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +33 -1
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +33 -1
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +33 -1
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +33 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import { UserIcon, CheckboxMark, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon,
|
|
3
|
+
import { UserIcon, CheckboxMark, XIcon, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
|
|
4
4
|
export * from '@ornikar/kitt-icons';
|
|
5
|
-
import { Animated, Easing, useWindowDimensions, Image, Platform, Linking,
|
|
5
|
+
import { Animated, Easing, useWindowDimensions, Image, Platform, Linking, View, Pressable, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1, TextInput, ActivityIndicator } from 'react-native';
|
|
6
6
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
7
7
|
import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
8
|
-
import { useRef, useEffect, cloneElement, useContext, createContext, forwardRef, useMemo, useState, Fragment, Children } from 'react';
|
|
9
|
-
import { jsx, jsxs, Fragment
|
|
8
|
+
import { useRef, useEffect, cloneElement, useContext, createContext, forwardRef, useMemo, useState, Fragment as Fragment$1, Children } from 'react';
|
|
9
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import Animated$1, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, withRepeat, withTiming, Easing as Easing$1, interpolate } from 'react-native-reanimated';
|
|
11
11
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
12
12
|
import { parse } from 'twemoji-parser';
|
|
13
13
|
import { openBrowserAsync } from 'expo-web-browser';
|
|
14
|
+
import { FormattedMessage } from 'react-intl';
|
|
15
|
+
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
14
16
|
import _extends from '@babel/runtime/helpers/extends';
|
|
15
17
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
16
18
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
17
|
-
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
18
|
-
import { FormattedMessage } from 'react-intl';
|
|
19
19
|
import { useFloating, offset, shift, flip } from '@floating-ui/react-native';
|
|
20
20
|
import { makeDecorator } from '@storybook/addons';
|
|
21
21
|
|
|
@@ -51,7 +51,7 @@ function SpinningIcon(_ref) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
var IconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
54
|
+
var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
55
55
|
displayName: "Icon__IconContainer"
|
|
56
56
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
57
57
|
var color = _ref.color;
|
|
@@ -77,7 +77,7 @@ function Icon(_ref5) {
|
|
|
77
77
|
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
78
78
|
color: color
|
|
79
79
|
});
|
|
80
|
-
return /*#__PURE__*/jsx(IconContainer, {
|
|
80
|
+
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
81
81
|
align: align,
|
|
82
82
|
size: size,
|
|
83
83
|
color: color,
|
|
@@ -135,11 +135,11 @@ var KittBreakpointsMax = {
|
|
|
135
135
|
LARGE: KittBreakpoints.WIDE - 1
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
var _excluded$
|
|
138
|
+
var _excluded$f = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
|
|
139
139
|
|
|
140
|
-
function ownKeys$
|
|
140
|
+
function ownKeys$o(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$o(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$o(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$o(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() {
|
|
@@ -215,7 +215,7 @@ function Typography(_ref4) {
|
|
|
215
215
|
large = _ref4.large,
|
|
216
216
|
variant = _ref4.variant,
|
|
217
217
|
color = _ref4.color,
|
|
218
|
-
otherProps = _objectWithoutProperties(_ref4, _excluded$
|
|
218
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded$f);
|
|
219
219
|
|
|
220
220
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
221
221
|
var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
@@ -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$o({
|
|
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$o({
|
|
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$o({
|
|
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$o({
|
|
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$o(_objectSpread$o({
|
|
270
270
|
accessibilityRole: "header",
|
|
271
271
|
base: defaultBase
|
|
272
272
|
}, props), {}, {
|
|
@@ -302,11 +302,11 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
302
302
|
|
|
303
303
|
Typography.h5 = createHeading(5, 'header5');
|
|
304
304
|
|
|
305
|
-
var _excluded$
|
|
305
|
+
var _excluded$e = ["size", "base", "round", "light"];
|
|
306
306
|
|
|
307
|
-
function ownKeys$
|
|
307
|
+
function ownKeys$n(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$n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(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();
|
|
@@ -377,13 +377,13 @@ function Avatar(_ref6) {
|
|
|
377
377
|
base = _ref6$base === void 0 ? 'body-small' : _ref6$base,
|
|
378
378
|
round = _ref6.round,
|
|
379
379
|
light = _ref6.light,
|
|
380
|
-
props = _objectWithoutProperties(_ref6, _excluded$
|
|
380
|
+
props = _objectWithoutProperties(_ref6, _excluded$e);
|
|
381
381
|
|
|
382
382
|
return /*#__PURE__*/jsx(StyledAvatarView, {
|
|
383
383
|
$size: size,
|
|
384
384
|
$isRound: round,
|
|
385
385
|
$isLight: light,
|
|
386
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$
|
|
386
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$n({
|
|
387
387
|
size: size,
|
|
388
388
|
base: base,
|
|
389
389
|
isLight: light
|
|
@@ -525,26 +525,26 @@ var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
|
525
525
|
return defaultPadding;
|
|
526
526
|
});
|
|
527
527
|
|
|
528
|
-
var _excluded$
|
|
528
|
+
var _excluded$d = ["color"],
|
|
529
529
|
_excluded2$2 = ["color"];
|
|
530
530
|
|
|
531
|
-
function ownKeys$
|
|
531
|
+
function ownKeys$m(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$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(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
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
537
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
|
538
538
|
|
|
539
539
|
var theme = /*#__PURE__*/useTheme();
|
|
540
|
-
return /*#__PURE__*/jsx(Icon, _objectSpread$
|
|
540
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$m(_objectSpread$m({}, 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$m({
|
|
548
548
|
color: color
|
|
549
549
|
}, props));
|
|
550
550
|
}
|
|
@@ -554,23 +554,23 @@ 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$m({
|
|
558
558
|
color: color
|
|
559
559
|
}, props));
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
562
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$m({}, props));
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
function isSubtle(type) {
|
|
566
566
|
return type.startsWith('subtle');
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
-
var _excluded$
|
|
569
|
+
var _excluded$c = ["type", "isDisabled", "$isStretch", "icon", "children"];
|
|
570
570
|
|
|
571
|
-
function ownKeys$
|
|
571
|
+
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; }
|
|
572
572
|
|
|
573
|
-
function _objectSpread$
|
|
573
|
+
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; }
|
|
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$l(_objectSpread$l({}, 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$l(_objectSpread$l({}, buttonIconSharedProps), {}, {
|
|
691
691
|
icon: icon
|
|
692
692
|
})) : null]
|
|
693
693
|
});
|
|
@@ -713,14 +713,14 @@ function ButtonContent(_ref7) {
|
|
|
713
713
|
$isStretch = _ref7.$isStretch,
|
|
714
714
|
icon = _ref7.icon,
|
|
715
715
|
children = _ref7.children,
|
|
716
|
-
props = _objectWithoutProperties(_ref7, _excluded$
|
|
716
|
+
props = _objectWithoutProperties(_ref7, _excluded$c);
|
|
717
717
|
|
|
718
718
|
var color = isDisabled ? 'black-light' : getTextColorByType(type);
|
|
719
719
|
return /*#__PURE__*/jsx(ButtonContentContainer, {
|
|
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$l(_objectSpread$l({
|
|
724
724
|
icon: icon,
|
|
725
725
|
type: type,
|
|
726
726
|
isDisabled: isDisabled,
|
|
@@ -857,20 +857,20 @@ var defaultOpenLinkBehavior = {
|
|
|
857
857
|
web: 'targetBlank'
|
|
858
858
|
};
|
|
859
859
|
|
|
860
|
-
var _excluded$
|
|
860
|
+
var _excluded$b = ["as", "href", "openLinkBehavior", "onPress"];
|
|
861
861
|
|
|
862
|
-
function ownKeys$
|
|
862
|
+
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; }
|
|
863
863
|
|
|
864
|
-
function _objectSpread$
|
|
864
|
+
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; }
|
|
865
865
|
function ExternalLink(_ref) {
|
|
866
866
|
var Component = _ref.as,
|
|
867
867
|
href = _ref.href,
|
|
868
868
|
_ref$openLinkBehavior = _ref.openLinkBehavior,
|
|
869
869
|
openLinkBehavior = _ref$openLinkBehavior === void 0 ? defaultOpenLinkBehavior : _ref$openLinkBehavior,
|
|
870
870
|
onPress = _ref.onPress,
|
|
871
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
871
|
+
rest = _objectWithoutProperties(_ref, _excluded$b);
|
|
872
872
|
|
|
873
|
-
return /*#__PURE__*/jsx(Component, _objectSpread$
|
|
873
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$k(_objectSpread$k({}, rest), {}, {
|
|
874
874
|
onPress: function handleOnPress() {
|
|
875
875
|
if (onPress) onPress();
|
|
876
876
|
if (!href) return;
|
|
@@ -1075,6 +1075,18 @@ var checkbox = {
|
|
|
1075
1075
|
markColor: colors.uiBackgroundLight
|
|
1076
1076
|
};
|
|
1077
1077
|
|
|
1078
|
+
var datePicker = {
|
|
1079
|
+
day: {
|
|
1080
|
+
minWidth: 64
|
|
1081
|
+
},
|
|
1082
|
+
month: {
|
|
1083
|
+
minWidth: 64
|
|
1084
|
+
},
|
|
1085
|
+
year: {
|
|
1086
|
+
minWidth: 82
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1078
1090
|
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
1079
1091
|
return Math.round(fontSize * lineHeightMultiplier);
|
|
1080
1092
|
};
|
|
@@ -1186,6 +1198,7 @@ var inputStatesStyle = {
|
|
|
1186
1198
|
}
|
|
1187
1199
|
};
|
|
1188
1200
|
var input = {
|
|
1201
|
+
minHeight: 40,
|
|
1189
1202
|
color: {
|
|
1190
1203
|
selection: colors.primary,
|
|
1191
1204
|
placeholder: typography.colors['black-light']
|
|
@@ -1212,6 +1225,23 @@ var inputField = {
|
|
|
1212
1225
|
iconMarginLeft: 6
|
|
1213
1226
|
};
|
|
1214
1227
|
|
|
1228
|
+
var inputTag = {
|
|
1229
|
+
success: {
|
|
1230
|
+
backgroundColor: colors.success,
|
|
1231
|
+
labelColor: colors.uiBackgroundLight
|
|
1232
|
+
},
|
|
1233
|
+
danger: {
|
|
1234
|
+
backgroundColor: colors.danger,
|
|
1235
|
+
labelColor: colors.uiBackgroundLight
|
|
1236
|
+
},
|
|
1237
|
+
"default": {
|
|
1238
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1239
|
+
labelColor: colors.black
|
|
1240
|
+
},
|
|
1241
|
+
borderRadius: 10,
|
|
1242
|
+
iconSize: 13.5
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1215
1245
|
var radio = {
|
|
1216
1246
|
size: 18,
|
|
1217
1247
|
unchecked: {
|
|
@@ -1235,11 +1265,13 @@ var textArea = {
|
|
|
1235
1265
|
};
|
|
1236
1266
|
|
|
1237
1267
|
var forms = {
|
|
1268
|
+
datePicker: datePicker,
|
|
1238
1269
|
input: input,
|
|
1239
1270
|
radio: radio,
|
|
1240
1271
|
inputField: inputField,
|
|
1241
1272
|
textArea: textArea,
|
|
1242
|
-
checkbox: checkbox
|
|
1273
|
+
checkbox: checkbox,
|
|
1274
|
+
inputTag: inputTag
|
|
1243
1275
|
};
|
|
1244
1276
|
|
|
1245
1277
|
var fullScreenModal = {
|
|
@@ -1540,6 +1572,16 @@ function Checkbox(_ref6) {
|
|
|
1540
1572
|
});
|
|
1541
1573
|
}
|
|
1542
1574
|
|
|
1575
|
+
function getInputUIState(_ref) {
|
|
1576
|
+
var isFocused = _ref.isFocused,
|
|
1577
|
+
isDisabled = _ref.isDisabled,
|
|
1578
|
+
formState = _ref.formState;
|
|
1579
|
+
if (isDisabled) return 'disabled';
|
|
1580
|
+
if (isFocused) return 'focus';
|
|
1581
|
+
if (formState === 'invalid') return 'invalid';
|
|
1582
|
+
return 'default';
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1543
1585
|
var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
|
|
1544
1586
|
var theme = _ref.theme,
|
|
1545
1587
|
$state = _ref.$state;
|
|
@@ -1567,190 +1609,851 @@ var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width
|
|
|
1567
1609
|
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
1568
1610
|
});
|
|
1569
1611
|
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
return 'default';
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1581
|
-
displayName: "InputTextContainer"
|
|
1582
|
-
})(["position:relative;"]);
|
|
1583
|
-
|
|
1584
|
-
var _excluded$9 = ["id", "right", "minHeight", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoCompleteType", "keyboardType", "onFocus", "onBlur"];
|
|
1585
|
-
|
|
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; }
|
|
1587
|
-
|
|
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) {
|
|
1592
|
-
var theme = _ref.theme,
|
|
1593
|
-
multiline = _ref.multiline;
|
|
1594
|
-
|
|
1595
|
-
if (!multiline && Platform.OS === 'ios') {
|
|
1596
|
-
return theme.kitt.forms.input.padding.iOSSingleLine;
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1612
|
+
var StyledTypographyText = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
1613
|
+
displayName: "DatePickerInputPart__StyledTypographyText"
|
|
1614
|
+
})(["text-align:center;"]);
|
|
1615
|
+
var ViewInput = /*#__PURE__*/styled.View.withConfig({
|
|
1616
|
+
displayName: "DatePickerInputPart__ViewInput"
|
|
1617
|
+
})(["", " padding:", ";min-height:", "px;min-width:", ";"], styledTextInputMixin, function (_ref) {
|
|
1618
|
+
var theme = _ref.theme;
|
|
1599
1619
|
return theme.kitt.forms.input.padding["default"];
|
|
1600
1620
|
}, function (_ref2) {
|
|
1601
|
-
var theme = _ref2.theme
|
|
1602
|
-
|
|
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");
|
|
1621
|
+
var theme = _ref2.theme;
|
|
1622
|
+
return theme.kitt.forms.input.minHeight;
|
|
1606
1623
|
}, function (_ref3) {
|
|
1607
|
-
var
|
|
1608
|
-
|
|
1609
|
-
});
|
|
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);
|
|
1633
|
-
|
|
1634
|
-
var theme = /*#__PURE__*/useTheme();
|
|
1624
|
+
var theme = _ref3.theme,
|
|
1625
|
+
$partName = _ref3.$partName;
|
|
1635
1626
|
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
setIsFocused = _useState2[1];
|
|
1627
|
+
if (!$partName) {
|
|
1628
|
+
return undefined;
|
|
1629
|
+
}
|
|
1640
1630
|
|
|
1641
|
-
|
|
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
|
-
});
|
|
1631
|
+
return "".concat(theme.kitt.forms.datePicker[$partName].minWidth, "px");
|
|
1673
1632
|
});
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1633
|
+
function DatePickerInputPart(_ref4) {
|
|
1634
|
+
var $state = _ref4.$state,
|
|
1635
|
+
placeholder = _ref4.placeholder,
|
|
1636
|
+
value = _ref4.value,
|
|
1637
|
+
partName = _ref4.partName,
|
|
1638
|
+
disabled = _ref4.disabled;
|
|
1639
|
+
return /*#__PURE__*/jsx(ViewInput, {
|
|
1640
|
+
$state: $state,
|
|
1641
|
+
$partName: partName,
|
|
1642
|
+
children: placeholder || value ? /*#__PURE__*/jsx(StyledTypographyText, {
|
|
1643
|
+
color: !value || disabled ? 'black-light' : undefined,
|
|
1644
|
+
children: value || placeholder
|
|
1645
|
+
}) : null
|
|
1646
|
+
});
|
|
1684
1647
|
}
|
|
1685
1648
|
|
|
1686
|
-
var
|
|
1687
|
-
switch (state) {
|
|
1688
|
-
case 'invalid':
|
|
1689
|
-
return 'danger';
|
|
1690
|
-
|
|
1691
|
-
case 'valid':
|
|
1692
|
-
default:
|
|
1693
|
-
return 'black-light';
|
|
1694
|
-
}
|
|
1695
|
-
};
|
|
1649
|
+
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; }
|
|
1696
1650
|
|
|
1697
|
-
function
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1651
|
+
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; }
|
|
1652
|
+
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
1653
|
+
var OverlayPressable = /*#__PURE__*/styled(Pressable).withConfig({
|
|
1654
|
+
displayName: "Overlay__OverlayPressable"
|
|
1655
|
+
})(function (_ref) {
|
|
1656
|
+
var theme = _ref.theme;
|
|
1657
|
+
return _objectSpread$j(_objectSpread$j({}, StyleSheet.absoluteFillObject), {}, {
|
|
1658
|
+
backgroundColor: theme.kitt.colors.overlay.dark
|
|
1659
|
+
});
|
|
1660
|
+
});
|
|
1661
|
+
function Overlay(_ref2) {
|
|
1662
|
+
var onPress = _ref2.onPress;
|
|
1663
|
+
return /*#__PURE__*/jsx(OverlayPressable, {
|
|
1664
|
+
accessibilityRole: "none",
|
|
1665
|
+
onPress: onPress,
|
|
1666
|
+
children: /*#__PURE__*/jsx(View, {})
|
|
1706
1667
|
});
|
|
1707
1668
|
}
|
|
1708
1669
|
|
|
1709
|
-
var
|
|
1710
|
-
displayName: "
|
|
1711
|
-
})(["padding:
|
|
1712
|
-
var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1713
|
-
displayName: "InputField__FeedbackContainer"
|
|
1714
|
-
})(["", ";"], function (_ref) {
|
|
1670
|
+
var BodyView = /*#__PURE__*/styled.View.withConfig({
|
|
1671
|
+
displayName: "Body__BodyView"
|
|
1672
|
+
})(["padding:", "px ", "px;"], function (_ref) {
|
|
1715
1673
|
var theme = _ref.theme;
|
|
1716
|
-
return theme.
|
|
1717
|
-
|
|
1718
|
-
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
1719
|
-
});
|
|
1720
|
-
var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1721
|
-
displayName: "InputField__FieldLabelContainer"
|
|
1722
|
-
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
1674
|
+
return theme.kitt.spacing * 6;
|
|
1675
|
+
}, function (_ref2) {
|
|
1723
1676
|
var theme = _ref2.theme;
|
|
1724
|
-
return theme.kitt.
|
|
1677
|
+
return theme.kitt.spacing * 4;
|
|
1725
1678
|
});
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1679
|
+
function ModalBody(_ref3) {
|
|
1680
|
+
var children = _ref3.children;
|
|
1681
|
+
return /*#__PURE__*/jsx(ScrollView, {
|
|
1682
|
+
children: /*#__PURE__*/jsx(BodyView, {
|
|
1683
|
+
children: children
|
|
1684
|
+
})
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
var FooterView = /*#__PURE__*/styled.View.withConfig({
|
|
1689
|
+
displayName: "Footer__FooterView"
|
|
1690
|
+
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], function (_ref) {
|
|
1691
|
+
var theme = _ref.theme;
|
|
1692
|
+
return theme.kitt.spacing * 4;
|
|
1693
|
+
}, function (_ref2) {
|
|
1694
|
+
var theme = _ref2.theme;
|
|
1695
|
+
return theme.kitt.colors.separator;
|
|
1731
1696
|
});
|
|
1732
|
-
function
|
|
1733
|
-
var
|
|
1734
|
-
|
|
1735
|
-
|
|
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]
|
|
1697
|
+
function ModalFooter(_ref3) {
|
|
1698
|
+
var children = _ref3.children;
|
|
1699
|
+
return /*#__PURE__*/jsx(FooterView, {
|
|
1700
|
+
children: children
|
|
1745
1701
|
});
|
|
1746
1702
|
}
|
|
1747
1703
|
|
|
1748
|
-
|
|
1749
|
-
if (disabled) return 'black-light';
|
|
1704
|
+
var _excluded$a = ["as", "children"];
|
|
1750
1705
|
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1706
|
+
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; }
|
|
1707
|
+
|
|
1708
|
+
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; }
|
|
1709
|
+
function StyleWebWrapper(_ref) {
|
|
1710
|
+
var as = _ref.as,
|
|
1711
|
+
children = _ref.children,
|
|
1712
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
1713
|
+
|
|
1714
|
+
if (Platform.OS !== 'web') return children;
|
|
1715
|
+
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
1716
|
+
return /*#__PURE__*/jsx(as || 'div', _objectSpread$i(_objectSpread$i({}, props), {}, {
|
|
1717
|
+
children: children
|
|
1718
|
+
}));
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
var _excluded$9 = ["color", "disabled"];
|
|
1722
|
+
|
|
1723
|
+
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; }
|
|
1724
|
+
|
|
1725
|
+
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; }
|
|
1726
|
+
var PressableIconButtonWebWrapper = undefined;
|
|
1727
|
+
var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1728
|
+
displayName: "PressableIconButton__StyledPressableIconButton"
|
|
1729
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref) {
|
|
1730
|
+
var theme = _ref.theme;
|
|
1731
|
+
return theme.kitt.iconButton.borderRadius;
|
|
1732
|
+
}, function (_ref2) {
|
|
1733
|
+
var theme = _ref2.theme;
|
|
1734
|
+
return theme.kitt.iconButton.width;
|
|
1735
|
+
}, function (_ref3) {
|
|
1736
|
+
var theme = _ref3.theme;
|
|
1737
|
+
return theme.kitt.iconButton.height;
|
|
1738
|
+
}, function (_ref4) {
|
|
1739
|
+
var theme = _ref4.theme,
|
|
1740
|
+
disabled = _ref4.disabled;
|
|
1741
|
+
var iconButton = theme.kitt.iconButton;
|
|
1742
|
+
|
|
1743
|
+
if (Platform.OS !== 'web') {
|
|
1744
|
+
return undefined;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
var transition = iconButton.transition;
|
|
1748
|
+
|
|
1749
|
+
if (disabled) {
|
|
1750
|
+
return "\n background-color: ".concat(iconButton.disabled.backgroundColor, ";\n ");
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1754
|
+
});
|
|
1755
|
+
function PressableIconButton(_ref5) {
|
|
1756
|
+
var color = _ref5.color,
|
|
1757
|
+
disabled = _ref5.disabled,
|
|
1758
|
+
props = _objectWithoutProperties(_ref5, _excluded$9);
|
|
1759
|
+
|
|
1760
|
+
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1761
|
+
as: PressableIconButtonWebWrapper,
|
|
1762
|
+
$isWhite: color === 'white',
|
|
1763
|
+
$isDisabled: Boolean(disabled),
|
|
1764
|
+
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$h(_objectSpread$h({}, props), {}, {
|
|
1765
|
+
disabled: disabled
|
|
1766
|
+
}))
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
var AnimatedIconButtonBackground = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
1771
|
+
displayName: "PressableAnimatedContainer__AnimatedIconButtonBackground"
|
|
1772
|
+
})(["background-color:", ";border-radius:", "px;width:", "px;height:", "px;position:absolute;bottom:0;left:0;"], function (_ref) {
|
|
1773
|
+
var theme = _ref.theme,
|
|
1774
|
+
color = _ref.color,
|
|
1775
|
+
disabled = _ref.disabled;
|
|
1776
|
+
var iconButton = theme.kitt.iconButton;
|
|
1777
|
+
if (disabled) return iconButton.disabled.backgroundColor;
|
|
1778
|
+
if (color === 'white') return iconButton.white.pressedBackgroundColor;
|
|
1779
|
+
return iconButton["default"].pressedBackgroundColor;
|
|
1780
|
+
}, function (_ref2) {
|
|
1781
|
+
var theme = _ref2.theme;
|
|
1782
|
+
return theme.kitt.iconButton.borderRadius;
|
|
1783
|
+
}, function (_ref3) {
|
|
1784
|
+
var theme = _ref3.theme;
|
|
1785
|
+
return theme.kitt.iconButton.width;
|
|
1786
|
+
}, function (_ref4) {
|
|
1787
|
+
var theme = _ref4.theme;
|
|
1788
|
+
return theme.kitt.iconButton.height;
|
|
1789
|
+
});
|
|
1790
|
+
var AnimatedViewContainer = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
1791
|
+
displayName: "PressableAnimatedContainer__AnimatedViewContainer"
|
|
1792
|
+
})(["position:relative;align-items:center;justify-content:center;width:100%;height:100%;"]);
|
|
1793
|
+
function PressableAnimatedContainer(_ref5) {
|
|
1794
|
+
var disabled = _ref5.disabled,
|
|
1795
|
+
_ref5$color = _ref5.color,
|
|
1796
|
+
color = _ref5$color === void 0 ? 'black' : _ref5$color,
|
|
1797
|
+
testID = _ref5.testID,
|
|
1798
|
+
_ref5$accessibilityRo = _ref5.accessibilityRole,
|
|
1799
|
+
accessibilityRole = _ref5$accessibilityRo === void 0 ? 'button' : _ref5$accessibilityRo,
|
|
1800
|
+
accessibilityLabel = _ref5.accessibilityLabel,
|
|
1801
|
+
children = _ref5.children,
|
|
1802
|
+
onPress = _ref5.onPress;
|
|
1803
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1804
|
+
var pressed = useSharedValue(false);
|
|
1805
|
+
var opacityStyles = useAnimatedStyle(function () {
|
|
1806
|
+
var _f = function () {
|
|
1807
|
+
return {
|
|
1808
|
+
opacity: withSpring(pressed.value ? 1 : 0)
|
|
1809
|
+
};
|
|
1810
|
+
};
|
|
1811
|
+
|
|
1812
|
+
_f._closure = {
|
|
1813
|
+
withSpring: withSpring,
|
|
1814
|
+
pressed: pressed
|
|
1815
|
+
};
|
|
1816
|
+
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
1817
|
+
_f.__workletHash = 10645190329247;
|
|
1818
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:41)";
|
|
1819
|
+
_f.__optimalization = 2;
|
|
1820
|
+
|
|
1821
|
+
global.__reanimatedWorkletInit(_f);
|
|
1822
|
+
|
|
1823
|
+
return _f;
|
|
1824
|
+
}());
|
|
1825
|
+
var scaleStyles = useAnimatedStyle(function () {
|
|
1826
|
+
var _f = function () {
|
|
1827
|
+
return {
|
|
1828
|
+
transform: [{
|
|
1829
|
+
scale: withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base["default"])
|
|
1830
|
+
}]
|
|
1831
|
+
};
|
|
1832
|
+
};
|
|
1833
|
+
|
|
1834
|
+
_f._closure = {
|
|
1835
|
+
withSpring: withSpring,
|
|
1836
|
+
pressed: pressed,
|
|
1837
|
+
theme: {
|
|
1838
|
+
kitt: {
|
|
1839
|
+
iconButton: {
|
|
1840
|
+
scale: {
|
|
1841
|
+
base: {
|
|
1842
|
+
active: theme.kitt.iconButton.scale.base.active,
|
|
1843
|
+
"default": theme.kitt.iconButton.scale.base["default"]
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
};
|
|
1850
|
+
_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)}]};}}";
|
|
1851
|
+
_f.__workletHash = 13861998831411;
|
|
1852
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (66:39)";
|
|
1853
|
+
_f.__optimalization = 2;
|
|
1854
|
+
|
|
1855
|
+
global.__reanimatedWorkletInit(_f);
|
|
1856
|
+
|
|
1857
|
+
return _f;
|
|
1858
|
+
}());
|
|
1859
|
+
return /*#__PURE__*/jsx(PressableIconButton, {
|
|
1860
|
+
accessibilityRole: accessibilityRole,
|
|
1861
|
+
disabled: disabled,
|
|
1862
|
+
color: color,
|
|
1863
|
+
testID: testID,
|
|
1864
|
+
accessibilityLabel: accessibilityLabel,
|
|
1865
|
+
onPress: onPress,
|
|
1866
|
+
onPressIn: function onPressIn() {
|
|
1867
|
+
pressed.value = true;
|
|
1868
|
+
},
|
|
1869
|
+
onPressOut: function onPressOut() {
|
|
1870
|
+
pressed.value = false;
|
|
1871
|
+
},
|
|
1872
|
+
children: /*#__PURE__*/jsxs(AnimatedViewContainer, {
|
|
1873
|
+
style: disabled ? [{
|
|
1874
|
+
transform: [{
|
|
1875
|
+
scale: 1
|
|
1876
|
+
}]
|
|
1877
|
+
}] : [scaleStyles],
|
|
1878
|
+
children: [/*#__PURE__*/jsx(AnimatedIconButtonBackground, {
|
|
1879
|
+
disabled: disabled,
|
|
1880
|
+
color: color,
|
|
1881
|
+
style: disabled ? [{
|
|
1882
|
+
opacity: 1
|
|
1883
|
+
}] : [opacityStyles]
|
|
1884
|
+
}), children]
|
|
1885
|
+
})
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
var IconButtonContentBorder = /*#__PURE__*/styled.View.withConfig({
|
|
1890
|
+
displayName: "IconButton__IconButtonContentBorder"
|
|
1891
|
+
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], function (_ref) {
|
|
1892
|
+
var theme = _ref.theme;
|
|
1893
|
+
return "".concat(theme.kitt.iconButton.borderWidth, "px solid");
|
|
1894
|
+
}, function (_ref2) {
|
|
1895
|
+
var theme = _ref2.theme,
|
|
1896
|
+
disabled = _ref2.disabled;
|
|
1897
|
+
return disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor;
|
|
1898
|
+
}, function (_ref3) {
|
|
1899
|
+
var theme = _ref3.theme;
|
|
1900
|
+
return theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth;
|
|
1901
|
+
}, function (_ref4) {
|
|
1902
|
+
var theme = _ref4.theme;
|
|
1903
|
+
return theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth;
|
|
1904
|
+
}, function (_ref5) {
|
|
1905
|
+
var theme = _ref5.theme;
|
|
1906
|
+
return theme.kitt.iconButton.borderRadius;
|
|
1907
|
+
});
|
|
1908
|
+
|
|
1909
|
+
function IconButtonContent(_ref6) {
|
|
1910
|
+
var disabled = _ref6.disabled,
|
|
1911
|
+
color = _ref6.color,
|
|
1912
|
+
icon = _ref6.icon;
|
|
1913
|
+
return /*#__PURE__*/jsx(IconButtonContentBorder, {
|
|
1914
|
+
disabled: disabled,
|
|
1915
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
1916
|
+
color: disabled ? 'black-light' : color,
|
|
1917
|
+
icon: icon
|
|
1918
|
+
})
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
function IconButton(_ref7) {
|
|
1923
|
+
var icon = _ref7.icon,
|
|
1924
|
+
color = _ref7.color,
|
|
1925
|
+
disabled = _ref7.disabled,
|
|
1926
|
+
testID = _ref7.testID,
|
|
1927
|
+
accessibilityLabel = _ref7.accessibilityLabel,
|
|
1928
|
+
accessibilityRole = _ref7.accessibilityRole,
|
|
1929
|
+
onPress = _ref7.onPress;
|
|
1930
|
+
return /*#__PURE__*/jsx(PressableAnimatedContainer, {
|
|
1931
|
+
color: color,
|
|
1932
|
+
disabled: disabled,
|
|
1933
|
+
testID: testID,
|
|
1934
|
+
accessibilityLabel: accessibilityLabel,
|
|
1935
|
+
accessibilityRole: accessibilityRole,
|
|
1936
|
+
onPress: onPress,
|
|
1937
|
+
children: /*#__PURE__*/jsx(IconButtonContent, {
|
|
1938
|
+
disabled: disabled,
|
|
1939
|
+
color: color,
|
|
1940
|
+
icon: icon
|
|
1941
|
+
})
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
var OnCloseContext = /*#__PURE__*/createContext(function () {});
|
|
1946
|
+
|
|
1947
|
+
var HeaderView = /*#__PURE__*/styled.View.withConfig({
|
|
1948
|
+
displayName: "Header__HeaderView"
|
|
1949
|
+
})(["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) {
|
|
1950
|
+
var theme = _ref.theme;
|
|
1951
|
+
return theme.kitt.spacing * 2;
|
|
1952
|
+
}, function (_ref2) {
|
|
1953
|
+
var theme = _ref2.theme;
|
|
1954
|
+
return theme.kitt.colors.separator;
|
|
1955
|
+
});
|
|
1956
|
+
var LeftIconView = /*#__PURE__*/styled.View.withConfig({
|
|
1957
|
+
displayName: "Header__LeftIconView"
|
|
1958
|
+
})(["align-self:flex-start;margin-right:", "px;"], function (_ref3) {
|
|
1959
|
+
var theme = _ref3.theme;
|
|
1960
|
+
return theme.kitt.spacing * 2;
|
|
1961
|
+
});
|
|
1962
|
+
var RightIconView = /*#__PURE__*/styled.View.withConfig({
|
|
1963
|
+
displayName: "Header__RightIconView"
|
|
1964
|
+
})(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
|
|
1965
|
+
var theme = _ref4.theme;
|
|
1966
|
+
return theme.kitt.spacing * 2;
|
|
1967
|
+
});
|
|
1968
|
+
var TitleView = /*#__PURE__*/styled.View.withConfig({
|
|
1969
|
+
displayName: "Header__TitleView"
|
|
1970
|
+
})(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
|
|
1971
|
+
var theme = _ref5.theme,
|
|
1972
|
+
isIconLeft = _ref5.isIconLeft;
|
|
1973
|
+
return isIconLeft ? 0 : theme.kitt.spacing * 2;
|
|
1974
|
+
});
|
|
1975
|
+
function ModalHeader(_ref6) {
|
|
1976
|
+
var left = _ref6.left,
|
|
1977
|
+
right = _ref6.right,
|
|
1978
|
+
children = _ref6.children;
|
|
1979
|
+
var onClose = useContext(OnCloseContext);
|
|
1980
|
+
var isIconLeft = !!left;
|
|
1981
|
+
return /*#__PURE__*/jsxs(HeaderView, {
|
|
1982
|
+
children: [isIconLeft && /*#__PURE__*/jsx(LeftIconView, {
|
|
1983
|
+
children: left
|
|
1984
|
+
}), /*#__PURE__*/jsx(TitleView, {
|
|
1985
|
+
isIconLeft: isIconLeft,
|
|
1986
|
+
children: children
|
|
1987
|
+
}), right !== undefined ? right : /*#__PURE__*/jsx(RightIconView, {
|
|
1988
|
+
children: /*#__PURE__*/jsx(IconButton, {
|
|
1989
|
+
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
1990
|
+
onPress: onClose
|
|
1991
|
+
})
|
|
1992
|
+
})]
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
var ModalView = /*#__PURE__*/styled.View.withConfig({
|
|
1997
|
+
displayName: "Modal__ModalView"
|
|
1998
|
+
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], function (_ref) {
|
|
1999
|
+
var theme = _ref.theme;
|
|
2000
|
+
return theme.kitt.spacing * 20;
|
|
2001
|
+
}, function (_ref2) {
|
|
2002
|
+
var theme = _ref2.theme;
|
|
2003
|
+
return theme.kitt.spacing * 4;
|
|
2004
|
+
});
|
|
2005
|
+
var ContentView$1 = /*#__PURE__*/styled.View.withConfig({
|
|
2006
|
+
displayName: "Modal__ContentView"
|
|
2007
|
+
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], function (_ref3) {
|
|
2008
|
+
var theme = _ref3.theme;
|
|
2009
|
+
return theme.kitt.card.borderRadius;
|
|
2010
|
+
}, function (_ref4) {
|
|
2011
|
+
var theme = _ref4.theme;
|
|
2012
|
+
return theme.kitt.colors.uiBackgroundLight;
|
|
2013
|
+
});
|
|
2014
|
+
function Modal(_ref5) {
|
|
2015
|
+
var visible = _ref5.visible,
|
|
2016
|
+
children = _ref5.children,
|
|
2017
|
+
onClose = _ref5.onClose,
|
|
2018
|
+
onEntered = _ref5.onEntered,
|
|
2019
|
+
onExited = _ref5.onExited;
|
|
2020
|
+
return /*#__PURE__*/jsx(OnCloseContext.Provider, {
|
|
2021
|
+
value: onClose,
|
|
2022
|
+
children: /*#__PURE__*/jsx(Modal$1, {
|
|
2023
|
+
transparent: true,
|
|
2024
|
+
animationType: "fade",
|
|
2025
|
+
visible: visible,
|
|
2026
|
+
onShow: onEntered,
|
|
2027
|
+
onDismiss: onExited,
|
|
2028
|
+
onRequestClose: onClose,
|
|
2029
|
+
children: /*#__PURE__*/jsxs(ModalView, {
|
|
2030
|
+
children: [/*#__PURE__*/jsx(Overlay, {
|
|
2031
|
+
onPress: onClose
|
|
2032
|
+
}), /*#__PURE__*/jsx(ContentView$1, {
|
|
2033
|
+
children: children
|
|
2034
|
+
})]
|
|
2035
|
+
})
|
|
2036
|
+
})
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
Modal.Header = ModalHeader;
|
|
2040
|
+
Modal.Body = ModalBody;
|
|
2041
|
+
Modal.Footer = ModalFooter;
|
|
2042
|
+
|
|
2043
|
+
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; }
|
|
2044
|
+
|
|
2045
|
+
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; }
|
|
2046
|
+
|
|
2047
|
+
function getDatePickerDisplayMode() {
|
|
2048
|
+
if (Platform.OS === 'android') return 'calendar';
|
|
2049
|
+
if (Platform.OS === 'ios') return 'spinner';
|
|
2050
|
+
return 'default';
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
function PlatformDateTimePicker(_ref) {
|
|
2054
|
+
var value = _ref.value,
|
|
2055
|
+
_ref$defaultDate = _ref.defaultDate,
|
|
2056
|
+
defaultDate = _ref$defaultDate === void 0 ? new Date() : _ref$defaultDate,
|
|
2057
|
+
maximumDate = _ref.maximumDate,
|
|
2058
|
+
minimuDate = _ref.minimuDate,
|
|
2059
|
+
testID = _ref.testID,
|
|
2060
|
+
_onChange = _ref.onChange;
|
|
2061
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2062
|
+
var displayMode = getDatePickerDisplayMode();
|
|
2063
|
+
var iosProps = Platform.OS === 'ios' ? {
|
|
2064
|
+
textColor: theme.kitt.colors.primary
|
|
2065
|
+
} : {};
|
|
2066
|
+
return /*#__PURE__*/jsx(DateTimePicker, _objectSpread$g(_objectSpread$g({
|
|
2067
|
+
is24Hour: true,
|
|
2068
|
+
testID: testID,
|
|
2069
|
+
value: value || defaultDate,
|
|
2070
|
+
mode: "date",
|
|
2071
|
+
maximumDate: maximumDate,
|
|
2072
|
+
minimumDate: minimuDate,
|
|
2073
|
+
display: displayMode
|
|
2074
|
+
}, iosProps), {}, {
|
|
2075
|
+
onChange: function onChange(_event, date) {
|
|
2076
|
+
return _onChange(date);
|
|
2077
|
+
}
|
|
2078
|
+
}));
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
var _excluded$8 = ["title", "isVisible", "value", "validateButtonLabel", "onClose", "onChange"];
|
|
2082
|
+
|
|
2083
|
+
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; }
|
|
2084
|
+
|
|
2085
|
+
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; }
|
|
2086
|
+
|
|
2087
|
+
function ModalTitle(_ref) {
|
|
2088
|
+
var children = _ref.children;
|
|
2089
|
+
return /*#__PURE__*/jsx(Modal.Header, {
|
|
2090
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
2091
|
+
base: "body",
|
|
2092
|
+
variant: "bold",
|
|
2093
|
+
children: children
|
|
2094
|
+
})
|
|
2095
|
+
});
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
function ModalPlatformDateTimePicker(_ref2) {
|
|
2099
|
+
var title = _ref2.title,
|
|
2100
|
+
isVisible = _ref2.isVisible,
|
|
2101
|
+
value = _ref2.value,
|
|
2102
|
+
validateButtonLabel = _ref2.validateButtonLabel,
|
|
2103
|
+
onClose = _ref2.onClose,
|
|
2104
|
+
onChange = _ref2.onChange,
|
|
2105
|
+
props = _objectWithoutProperties(_ref2, _excluded$8);
|
|
2106
|
+
|
|
2107
|
+
var _useState = useState(value),
|
|
2108
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2109
|
+
currentValue = _useState2[0],
|
|
2110
|
+
setCurrentValue = _useState2[1]; // Prevent unsynced value between the modal and its parent state
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
return /*#__PURE__*/jsx(Modal, {
|
|
2114
|
+
visible: Boolean(isVisible),
|
|
2115
|
+
onClose: function handleClose() {
|
|
2116
|
+
setCurrentValue(value);
|
|
2117
|
+
onClose();
|
|
2118
|
+
},
|
|
2119
|
+
children: isVisible ? /*#__PURE__*/jsxs(Fragment, {
|
|
2120
|
+
children: [title ? /*#__PURE__*/jsx(ModalTitle, {
|
|
2121
|
+
children: title
|
|
2122
|
+
}) : null, /*#__PURE__*/jsx(Modal.Body, {
|
|
2123
|
+
children: /*#__PURE__*/jsx(PlatformDateTimePicker, _objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
2124
|
+
value: currentValue,
|
|
2125
|
+
onChange: function handleChange(newDate) {
|
|
2126
|
+
setCurrentValue(function (prev) {
|
|
2127
|
+
return newDate || prev;
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
}))
|
|
2131
|
+
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
2132
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
2133
|
+
stretch: true,
|
|
2134
|
+
type: "primary",
|
|
2135
|
+
onPress: function handleSubmit() {
|
|
2136
|
+
onChange(currentValue);
|
|
2137
|
+
},
|
|
2138
|
+
children: validateButtonLabel ? /*#__PURE__*/jsx(Text$1, {
|
|
2139
|
+
children: validateButtonLabel
|
|
2140
|
+
}) : /*#__PURE__*/jsx(FormattedMessage, {
|
|
2141
|
+
id: "kitt-universal.ModalDateTimePicker.confirm"
|
|
2142
|
+
})
|
|
2143
|
+
})
|
|
2144
|
+
})]
|
|
2145
|
+
}) : null
|
|
2146
|
+
});
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
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; }
|
|
2150
|
+
|
|
2151
|
+
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; }
|
|
2152
|
+
|
|
2153
|
+
function prefixWithZero(value) {
|
|
2154
|
+
return "".concat(value).padStart(2, '0');
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
var PartContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2158
|
+
displayName: "DatePicker__PartContainer"
|
|
2159
|
+
})(["margin-right:", ";", ";"], function (_ref) {
|
|
2160
|
+
var theme = _ref.theme,
|
|
2161
|
+
$isLast = _ref.$isLast;
|
|
2162
|
+
return !$isLast ? "".concat(theme.kitt.spacing * 2, "px") : 0;
|
|
2163
|
+
}, function (_ref2) {
|
|
2164
|
+
var $isStretch = _ref2.$isStretch;
|
|
2165
|
+
return $isStretch ? css(["flex:0.33;flex-grow:1;"]) : undefined;
|
|
2166
|
+
});
|
|
2167
|
+
var DatePickerPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
2168
|
+
displayName: "DatePicker__DatePickerPressable"
|
|
2169
|
+
})(["display:flex;flex-direction:row;", ";"], function (_ref3) {
|
|
2170
|
+
var $isStretch = _ref3.$isStretch;
|
|
2171
|
+
|
|
2172
|
+
if ($isStretch) {
|
|
2173
|
+
return css(["width:100%;"]);
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
return css(["align-self:baseline;"]);
|
|
2177
|
+
});
|
|
2178
|
+
function DatePicker(_ref4) {
|
|
2179
|
+
var value = _ref4.value,
|
|
2180
|
+
id = _ref4.id,
|
|
2181
|
+
disabled = _ref4.disabled,
|
|
2182
|
+
placeholder = _ref4.placeholder,
|
|
2183
|
+
state = _ref4.state,
|
|
2184
|
+
internalForceState = _ref4.internalForceState,
|
|
2185
|
+
testID = _ref4.testID,
|
|
2186
|
+
stretch = _ref4.stretch,
|
|
2187
|
+
pickerDefaultDate = _ref4.pickerDefaultDate,
|
|
2188
|
+
pickerUITestID = _ref4.pickerUITestID,
|
|
2189
|
+
pickerUITitle = _ref4.pickerUITitle,
|
|
2190
|
+
pickerUIValidateButtonLabel = _ref4.pickerUIValidateButtonLabel,
|
|
2191
|
+
onChange = _ref4.onChange,
|
|
2192
|
+
onFocus = _ref4.onFocus,
|
|
2193
|
+
onBlur = _ref4.onBlur;
|
|
2194
|
+
|
|
2195
|
+
var _useState = useState(false),
|
|
2196
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2197
|
+
isPickerUIVisible = _useState2[0],
|
|
2198
|
+
setIsPickerUIVisible = _useState2[1];
|
|
2199
|
+
|
|
2200
|
+
var _useState3 = useState(false),
|
|
2201
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2202
|
+
isFocused = _useState4[0],
|
|
2203
|
+
setIsFocused = _useState4[1];
|
|
2204
|
+
|
|
2205
|
+
var _useState5 = useState(value),
|
|
2206
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
2207
|
+
currentValue = _useState6[0],
|
|
2208
|
+
setCurrentValue = _useState6[1];
|
|
2209
|
+
|
|
2210
|
+
var handleModalClose = function () {
|
|
2211
|
+
if (onBlur) onBlur();
|
|
2212
|
+
setIsPickerUIVisible(false);
|
|
2213
|
+
setIsFocused(false);
|
|
2214
|
+
};
|
|
2215
|
+
|
|
2216
|
+
var handleChange = function (newDate) {
|
|
2217
|
+
setCurrentValue(newDate);
|
|
2218
|
+
onChange(newDate);
|
|
2219
|
+
handleModalClose();
|
|
2220
|
+
};
|
|
2221
|
+
|
|
2222
|
+
var currentState = internalForceState || getInputUIState({
|
|
2223
|
+
isFocused: isFocused,
|
|
2224
|
+
isDisabled: Boolean(disabled),
|
|
2225
|
+
formState: state
|
|
2226
|
+
});
|
|
2227
|
+
var sharedPickerProps = {
|
|
2228
|
+
testID: pickerUITestID,
|
|
2229
|
+
value: currentValue,
|
|
2230
|
+
onChange: handleChange
|
|
2231
|
+
};
|
|
2232
|
+
var sharedPartProps = {
|
|
2233
|
+
disabled: disabled,
|
|
2234
|
+
$state: currentState,
|
|
2235
|
+
defaultDate: pickerDefaultDate
|
|
2236
|
+
};
|
|
2237
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2238
|
+
children: [/*#__PURE__*/jsxs(DatePickerPressable, {
|
|
2239
|
+
$isStretch: stretch,
|
|
2240
|
+
nativeID: id,
|
|
2241
|
+
disabled: disabled,
|
|
2242
|
+
testID: testID,
|
|
2243
|
+
onPress: function handleModalOpen() {
|
|
2244
|
+
if (onFocus) onFocus();
|
|
2245
|
+
setIsPickerUIVisible(true);
|
|
2246
|
+
setIsFocused(true);
|
|
2247
|
+
},
|
|
2248
|
+
children: [/*#__PURE__*/jsx(PartContainer, {
|
|
2249
|
+
$isStretch: stretch,
|
|
2250
|
+
children: /*#__PURE__*/jsx(DatePickerInputPart, _objectSpread$e(_objectSpread$e({}, sharedPartProps), {}, {
|
|
2251
|
+
partName: "day",
|
|
2252
|
+
value: currentValue ? prefixWithZero(currentValue.getDate()) : undefined,
|
|
2253
|
+
placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.day
|
|
2254
|
+
}))
|
|
2255
|
+
}), /*#__PURE__*/jsx(PartContainer, {
|
|
2256
|
+
$isStretch: stretch,
|
|
2257
|
+
children: /*#__PURE__*/jsx(DatePickerInputPart, _objectSpread$e(_objectSpread$e({}, sharedPartProps), {}, {
|
|
2258
|
+
partName: "month",
|
|
2259
|
+
value: currentValue ? prefixWithZero(currentValue.getMonth() + 1) : undefined,
|
|
2260
|
+
placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.month
|
|
2261
|
+
}))
|
|
2262
|
+
}), /*#__PURE__*/jsx(PartContainer, {
|
|
2263
|
+
$isLast: true,
|
|
2264
|
+
$isStretch: stretch,
|
|
2265
|
+
children: /*#__PURE__*/jsx(DatePickerInputPart, _objectSpread$e(_objectSpread$e({}, sharedPartProps), {}, {
|
|
2266
|
+
partName: "year",
|
|
2267
|
+
value: currentValue === null || currentValue === void 0 ? void 0 : currentValue.getFullYear(),
|
|
2268
|
+
placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.year
|
|
2269
|
+
}))
|
|
2270
|
+
})]
|
|
2271
|
+
}), /*#__PURE__*/jsxs(Fragment, {
|
|
2272
|
+
children: [Platform.OS === 'android' && isPickerUIVisible ? /*#__PURE__*/jsx(PlatformDateTimePicker, _objectSpread$e({}, sharedPickerProps)) : null, Platform.OS !== 'android' ? /*#__PURE__*/jsx(ModalPlatformDateTimePicker, _objectSpread$e(_objectSpread$e({}, sharedPickerProps), {}, {
|
|
2273
|
+
isVisible: isPickerUIVisible,
|
|
2274
|
+
title: pickerUITitle,
|
|
2275
|
+
validateButtonLabel: pickerUIValidateButtonLabel,
|
|
2276
|
+
onClose: handleModalClose,
|
|
2277
|
+
onChange: handleChange
|
|
2278
|
+
})) : null]
|
|
2279
|
+
})]
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2284
|
+
displayName: "InputTextContainer"
|
|
2285
|
+
})(["position:relative;"]);
|
|
2286
|
+
|
|
2287
|
+
var _excluded$7 = ["id", "right", "minHeight", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoCompleteType", "keyboardType", "onFocus", "onBlur"];
|
|
2288
|
+
|
|
2289
|
+
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; }
|
|
2290
|
+
|
|
2291
|
+
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; }
|
|
2292
|
+
var StyledTextInput = /*#__PURE__*/styled(TextInput).withConfig({
|
|
2293
|
+
displayName: "InputText__StyledTextInput"
|
|
2294
|
+
})(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, function (_ref) {
|
|
2295
|
+
var theme = _ref.theme,
|
|
2296
|
+
multiline = _ref.multiline;
|
|
2297
|
+
|
|
2298
|
+
if (!multiline && Platform.OS === 'ios') {
|
|
2299
|
+
return theme.kitt.forms.input.padding.iOSSingleLine;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
return theme.kitt.forms.input.padding["default"];
|
|
2303
|
+
}, function (_ref2) {
|
|
2304
|
+
var theme = _ref2.theme,
|
|
2305
|
+
multiline = _ref2.multiline;
|
|
2306
|
+
if (!multiline && Platform.OS === 'ios') return 0;
|
|
2307
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
2308
|
+
return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight, "px");
|
|
2309
|
+
}, function (_ref3) {
|
|
2310
|
+
var $minHeight = _ref3.$minHeight;
|
|
2311
|
+
return $minHeight;
|
|
2312
|
+
});
|
|
2313
|
+
var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2314
|
+
displayName: "InputText__RightInputContainer"
|
|
2315
|
+
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
2316
|
+
var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
2317
|
+
var id = _ref4.id,
|
|
2318
|
+
right = _ref4.right,
|
|
2319
|
+
_ref4$minHeight = _ref4.minHeight,
|
|
2320
|
+
minHeight = _ref4$minHeight === void 0 ? 0 : _ref4$minHeight,
|
|
2321
|
+
formState = _ref4.state,
|
|
2322
|
+
internalForceState = _ref4.internalForceState,
|
|
2323
|
+
_ref4$disabled = _ref4.disabled,
|
|
2324
|
+
disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
|
|
2325
|
+
_ref4$autoCorrect = _ref4.autoCorrect,
|
|
2326
|
+
autoCorrect = _ref4$autoCorrect === void 0 ? true : _ref4$autoCorrect,
|
|
2327
|
+
_ref4$textContentType = _ref4.textContentType,
|
|
2328
|
+
textContentType = _ref4$textContentType === void 0 ? 'none' : _ref4$textContentType,
|
|
2329
|
+
_ref4$autoCompleteTyp = _ref4.autoCompleteType,
|
|
2330
|
+
autoCompleteType = _ref4$autoCompleteTyp === void 0 ? 'off' : _ref4$autoCompleteTyp,
|
|
2331
|
+
_ref4$keyboardType = _ref4.keyboardType,
|
|
2332
|
+
keyboardType = _ref4$keyboardType === void 0 ? 'default' : _ref4$keyboardType,
|
|
2333
|
+
_onFocus = _ref4.onFocus,
|
|
2334
|
+
_onBlur = _ref4.onBlur,
|
|
2335
|
+
props = _objectWithoutProperties(_ref4, _excluded$7);
|
|
2336
|
+
|
|
2337
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2338
|
+
|
|
2339
|
+
var _useState = useState(false),
|
|
2340
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2341
|
+
isFocused = _useState2[0],
|
|
2342
|
+
setIsFocused = _useState2[1];
|
|
2343
|
+
|
|
2344
|
+
var state = internalForceState || getInputUIState({
|
|
2345
|
+
isFocused: isFocused,
|
|
2346
|
+
isDisabled: disabled,
|
|
2347
|
+
formState: formState
|
|
2348
|
+
});
|
|
2349
|
+
return /*#__PURE__*/jsxs(InputTextContainer, {
|
|
2350
|
+
$isDisabled: disabled,
|
|
2351
|
+
children: [/*#__PURE__*/jsx(StyledTextInput, _objectSpread$d(_objectSpread$d({
|
|
2352
|
+
ref: ref,
|
|
2353
|
+
nativeID: id,
|
|
2354
|
+
editable: !disabled,
|
|
2355
|
+
keyboardType: keyboardType,
|
|
2356
|
+
autoCompleteType: autoCompleteType,
|
|
2357
|
+
autoCorrect: autoCorrect,
|
|
2358
|
+
$minHeight: minHeight,
|
|
2359
|
+
textContentType: textContentType,
|
|
2360
|
+
placeholderTextColor: theme.kitt.forms.input.color.placeholder,
|
|
2361
|
+
selectionColor: theme.kitt.forms.input.color.selection
|
|
2362
|
+
}, props), {}, {
|
|
2363
|
+
$state: state,
|
|
2364
|
+
onFocus: function onFocus(e) {
|
|
2365
|
+
setIsFocused(true);
|
|
2366
|
+
if (_onFocus) _onFocus(e);
|
|
2367
|
+
},
|
|
2368
|
+
onBlur: function onBlur(e) {
|
|
2369
|
+
setIsFocused(false);
|
|
2370
|
+
if (_onBlur) _onBlur(e);
|
|
2371
|
+
}
|
|
2372
|
+
})), right ? /*#__PURE__*/jsx(RightInputContainer, {
|
|
2373
|
+
children: right
|
|
2374
|
+
}) : null]
|
|
2375
|
+
});
|
|
2376
|
+
});
|
|
2377
|
+
|
|
2378
|
+
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; }
|
|
2379
|
+
|
|
2380
|
+
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; }
|
|
2381
|
+
function InputEmail(props) {
|
|
2382
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$c({
|
|
2383
|
+
autoCompleteType: "email",
|
|
2384
|
+
keyboardType: "email-address",
|
|
2385
|
+
textContentType: "emailAddress"
|
|
2386
|
+
}, props));
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
var getColorFromState = function (state) {
|
|
2390
|
+
switch (state) {
|
|
2391
|
+
case 'invalid':
|
|
2392
|
+
return 'danger';
|
|
2393
|
+
|
|
2394
|
+
case 'valid':
|
|
2395
|
+
default:
|
|
2396
|
+
return 'black-light';
|
|
2397
|
+
}
|
|
2398
|
+
};
|
|
2399
|
+
|
|
2400
|
+
function InputFeedback(_ref) {
|
|
2401
|
+
var state = _ref.state,
|
|
2402
|
+
testID = _ref.testID,
|
|
2403
|
+
children = _ref.children;
|
|
2404
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
2405
|
+
base: "body-small",
|
|
2406
|
+
color: getColorFromState(state),
|
|
2407
|
+
testID: testID,
|
|
2408
|
+
children: children
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
var FieldContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2413
|
+
displayName: "InputField__FieldContainer"
|
|
2414
|
+
})(["padding:5px 0 10px;"]);
|
|
2415
|
+
var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2416
|
+
displayName: "InputField__FeedbackContainer"
|
|
2417
|
+
})(["", ";"], function (_ref) {
|
|
2418
|
+
var theme = _ref.theme;
|
|
2419
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
2420
|
+
minWidth: KittBreakpoints.SMALL
|
|
2421
|
+
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
2422
|
+
});
|
|
2423
|
+
var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2424
|
+
displayName: "InputField__FieldLabelContainer"
|
|
2425
|
+
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
2426
|
+
var theme = _ref2.theme;
|
|
2427
|
+
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
2428
|
+
});
|
|
2429
|
+
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2430
|
+
displayName: "InputField__LabelContainer"
|
|
2431
|
+
})(["margin-right:", "px;"], function (_ref3) {
|
|
2432
|
+
var theme = _ref3.theme;
|
|
2433
|
+
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
2434
|
+
});
|
|
2435
|
+
function InputField(_ref4) {
|
|
2436
|
+
var label = _ref4.label,
|
|
2437
|
+
labelFeedback = _ref4.labelFeedback,
|
|
2438
|
+
input = _ref4.input,
|
|
2439
|
+
feedback = _ref4.feedback;
|
|
2440
|
+
return /*#__PURE__*/jsxs(FieldContainer, {
|
|
2441
|
+
children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
|
|
2442
|
+
children: [/*#__PURE__*/jsx(LabelContainer, {
|
|
2443
|
+
children: label
|
|
2444
|
+
}), labelFeedback]
|
|
2445
|
+
}) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
|
|
2446
|
+
children: feedback
|
|
2447
|
+
}) : null]
|
|
2448
|
+
});
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
function getIconColor(state, disabled) {
|
|
2452
|
+
if (disabled) return 'black-light';
|
|
2453
|
+
|
|
2454
|
+
switch (state) {
|
|
2455
|
+
case 'invalid':
|
|
2456
|
+
return 'danger';
|
|
1754
2457
|
|
|
1755
2458
|
case 'valid':
|
|
1756
2459
|
return 'success';
|
|
@@ -1773,31 +2476,31 @@ function InputIcon(_ref) {
|
|
|
1773
2476
|
});
|
|
1774
2477
|
}
|
|
1775
2478
|
|
|
1776
|
-
function ownKeys$
|
|
2479
|
+
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; }
|
|
1777
2480
|
|
|
1778
|
-
function _objectSpread$
|
|
2481
|
+
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; }
|
|
1779
2482
|
function InputPressable(_ref) {
|
|
1780
2483
|
var props = _extends({}, _ref);
|
|
1781
2484
|
|
|
1782
|
-
return /*#__PURE__*/jsx(Pressable, _objectSpread$
|
|
2485
|
+
return /*#__PURE__*/jsx(Pressable, _objectSpread$b({}, props));
|
|
1783
2486
|
}
|
|
1784
2487
|
|
|
1785
|
-
var _excluded$
|
|
2488
|
+
var _excluded$6 = ["isPasswordDefaultVisible", "right"];
|
|
1786
2489
|
|
|
1787
|
-
function ownKeys$
|
|
2490
|
+
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; }
|
|
1788
2491
|
|
|
1789
|
-
function _objectSpread$
|
|
2492
|
+
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; }
|
|
1790
2493
|
function InputPassword(_ref) {
|
|
1791
2494
|
var isPasswordDefaultVisible = _ref.isPasswordDefaultVisible,
|
|
1792
2495
|
right = _ref.right,
|
|
1793
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2496
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1794
2497
|
|
|
1795
2498
|
var _useState = useState(Boolean(isPasswordDefaultVisible)),
|
|
1796
2499
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1797
2500
|
isVisible = _useState2[0],
|
|
1798
2501
|
setIsVisible = _useState2[1];
|
|
1799
2502
|
|
|
1800
|
-
return /*#__PURE__*/jsx(InputText, _objectSpread$
|
|
2503
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$a(_objectSpread$a({}, props), {}, {
|
|
1801
2504
|
textContentType: "password",
|
|
1802
2505
|
autoCompleteType: "password",
|
|
1803
2506
|
autoCorrect: false,
|
|
@@ -1816,17 +2519,71 @@ function InputPassword(_ref) {
|
|
|
1816
2519
|
}));
|
|
1817
2520
|
}
|
|
1818
2521
|
|
|
1819
|
-
function ownKeys$
|
|
2522
|
+
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; }
|
|
1820
2523
|
|
|
1821
|
-
function _objectSpread$
|
|
2524
|
+
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; }
|
|
1822
2525
|
function InputPhone(props) {
|
|
1823
|
-
return /*#__PURE__*/jsx(InputText, _objectSpread$
|
|
2526
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$9(_objectSpread$9({}, props), {}, {
|
|
1824
2527
|
autoCompleteType: "tel",
|
|
1825
2528
|
keyboardType: "number-pad",
|
|
1826
2529
|
textContentType: "telephoneNumber"
|
|
1827
2530
|
}));
|
|
1828
2531
|
}
|
|
1829
2532
|
|
|
2533
|
+
var getTypographyColor = function (type) {
|
|
2534
|
+
return type ? 'white' : 'black';
|
|
2535
|
+
};
|
|
2536
|
+
|
|
2537
|
+
var InputTagContainer = /*#__PURE__*/styled(View).withConfig({
|
|
2538
|
+
displayName: "InputTag__InputTagContainer"
|
|
2539
|
+
})(["align-items:center;justify-content:center;flex-direction:row;align-self:flex-start;overflow:hidden;padding-horizontal:", "px;background-color:", ";border-radius:", "px;"], function (_ref) {
|
|
2540
|
+
var theme = _ref.theme;
|
|
2541
|
+
return theme.kitt.spacing * 2;
|
|
2542
|
+
}, function (_ref2) {
|
|
2543
|
+
var theme = _ref2.theme,
|
|
2544
|
+
type = _ref2.type;
|
|
2545
|
+
|
|
2546
|
+
if (type === 'success') {
|
|
2547
|
+
return theme.kitt.forms.inputTag.success.backgroundColor;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
if (type === 'danger') {
|
|
2551
|
+
return theme.kitt.forms.inputTag.danger.backgroundColor;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
return theme.kitt.forms.inputTag["default"].backgroundColor;
|
|
2555
|
+
}, function (_ref3) {
|
|
2556
|
+
var theme = _ref3.theme;
|
|
2557
|
+
return theme.kitt.forms.inputTag.borderRadius;
|
|
2558
|
+
});
|
|
2559
|
+
var IconContainer = /*#__PURE__*/styled(View).withConfig({
|
|
2560
|
+
displayName: "InputTag__IconContainer"
|
|
2561
|
+
})(["margin-right:", "px;"], function (_ref4) {
|
|
2562
|
+
var theme = _ref4.theme;
|
|
2563
|
+
return theme.kitt.spacing;
|
|
2564
|
+
});
|
|
2565
|
+
function InputTag(_ref5) {
|
|
2566
|
+
var children = _ref5.children,
|
|
2567
|
+
type = _ref5.type,
|
|
2568
|
+
icon = _ref5.icon;
|
|
2569
|
+
var typographyColor = getTypographyColor(type);
|
|
2570
|
+
var theme = useKittTheme();
|
|
2571
|
+
return /*#__PURE__*/jsxs(InputTagContainer, {
|
|
2572
|
+
type: type,
|
|
2573
|
+
children: [icon && /*#__PURE__*/jsx(IconContainer, {
|
|
2574
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
2575
|
+
icon: icon,
|
|
2576
|
+
size: theme.kitt.forms.inputTag.iconSize,
|
|
2577
|
+
color: typographyColor
|
|
2578
|
+
})
|
|
2579
|
+
}), /*#__PURE__*/jsx(Typography.Text, {
|
|
2580
|
+
base: "body-small",
|
|
2581
|
+
color: typographyColor,
|
|
2582
|
+
children: children
|
|
2583
|
+
})]
|
|
2584
|
+
});
|
|
2585
|
+
}
|
|
2586
|
+
|
|
1830
2587
|
function Label(_ref) {
|
|
1831
2588
|
var htmlFor = _ref.htmlFor,
|
|
1832
2589
|
children = _ref.children;
|
|
@@ -1925,437 +2682,196 @@ function Radio(_ref16) {
|
|
|
1925
2682
|
}), /*#__PURE__*/jsx(Text, {
|
|
1926
2683
|
base: "body",
|
|
1927
2684
|
color: disabled ? 'black-light' : 'black',
|
|
1928
|
-
children: children
|
|
1929
|
-
})]
|
|
1930
|
-
});
|
|
1931
|
-
}
|
|
1932
|
-
|
|
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; }
|
|
1934
|
-
|
|
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);
|
|
1938
|
-
|
|
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
|
-
}
|
|
1946
|
-
|
|
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, {
|
|
1961
|
-
children: children
|
|
1962
|
-
});
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
var SideContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1966
|
-
displayName: "Header__SideContainer"
|
|
1967
|
-
})(["", ""], function (_ref) {
|
|
1968
|
-
var theme = _ref.theme,
|
|
1969
|
-
_ref$side = _ref.side,
|
|
1970
|
-
side = _ref$side === void 0 ? 'left' : _ref$side;
|
|
1971
|
-
var padding = theme.kitt.spacing * 2;
|
|
1972
|
-
|
|
1973
|
-
if (side === 'left') {
|
|
1974
|
-
return "padding-right: ".concat(padding, "px;");
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
return "padding-left: ".concat(padding, "px;");
|
|
1978
|
-
});
|
|
1979
|
-
|
|
1980
|
-
function getHeaderHorizontalMediumPadding(spacing) {
|
|
1981
|
-
return spacing * 6;
|
|
1982
|
-
}
|
|
1983
|
-
|
|
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) {
|
|
1987
|
-
var theme = _ref2.theme,
|
|
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;
|
|
2008
|
-
|
|
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;
|
|
2016
|
-
|
|
2017
|
-
var computeWidth = function (breakpointPadding) {
|
|
2018
|
-
return windowWidth - breakpointPadding - sideElementMaxWidth * 2;
|
|
2019
|
-
};
|
|
2020
|
-
|
|
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;");
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
return "margin-left: ".concat(deltaMargin, "px;");
|
|
2035
|
-
});
|
|
2036
|
-
function FullScreenModalHeader(_ref6) {
|
|
2037
|
-
var children = _ref6.children,
|
|
2038
|
-
right = _ref6.right,
|
|
2039
|
-
left = _ref6.left;
|
|
2040
|
-
|
|
2041
|
-
var _useSafeAreaInsets = useSafeAreaInsets(),
|
|
2042
|
-
top = _useSafeAreaInsets.top;
|
|
2043
|
-
|
|
2044
|
-
var dimensions = useWindowDimensions();
|
|
2045
|
-
|
|
2046
|
-
var _useState = useState(0),
|
|
2047
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
2048
|
-
leftWidth = _useState2[0],
|
|
2049
|
-
setLeftWidth = _useState2[1];
|
|
2050
|
-
|
|
2051
|
-
var _useState3 = useState(0),
|
|
2052
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
2053
|
-
rightWidth = _useState4[0],
|
|
2054
|
-
setRightWidth = _useState4[1];
|
|
2055
|
-
|
|
2056
|
-
var handleLayoutChange = function (event, side) {
|
|
2057
|
-
// Prevents react to nullify event on rerenders
|
|
2058
|
-
event.persist();
|
|
2059
|
-
|
|
2060
|
-
if (side === 'left') {
|
|
2061
|
-
setLeftWidth(event.nativeEvent.layout.width);
|
|
2062
|
-
return;
|
|
2063
|
-
}
|
|
2064
|
-
|
|
2065
|
-
setRightWidth(event.nativeEvent.layout.width);
|
|
2066
|
-
};
|
|
2067
|
-
|
|
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
|
|
2086
|
-
}) : null]
|
|
2087
|
-
});
|
|
2088
|
-
}
|
|
2089
|
-
|
|
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, {
|
|
2099
|
-
children: children
|
|
2685
|
+
children: children
|
|
2686
|
+
})]
|
|
2100
2687
|
});
|
|
2101
2688
|
}
|
|
2102
|
-
FullScreenModal.Header = FullScreenModalHeader;
|
|
2103
|
-
FullScreenModal.Body = FullScreenModalBody;
|
|
2104
2689
|
|
|
2105
|
-
|
|
2106
|
-
|
|
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; }
|
|
2690
|
+
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; }
|
|
2108
2691
|
|
|
2109
|
-
function _objectSpread$
|
|
2110
|
-
function
|
|
2111
|
-
var
|
|
2112
|
-
children = _ref.children,
|
|
2113
|
-
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
2692
|
+
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; }
|
|
2693
|
+
function TextArea(_ref) {
|
|
2694
|
+
var props = _extends({}, _ref);
|
|
2114
2695
|
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2696
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2697
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$8({
|
|
2698
|
+
multiline: true,
|
|
2699
|
+
textAlignVertical: "top",
|
|
2700
|
+
minHeight: theme.kitt.forms.textArea.minHeight
|
|
2701
|
+
}, props));
|
|
2120
2702
|
}
|
|
2121
2703
|
|
|
2122
|
-
var
|
|
2123
|
-
|
|
2124
|
-
|
|
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) {
|
|
2704
|
+
var Body = /*#__PURE__*/styled.View.withConfig({
|
|
2705
|
+
displayName: "Body"
|
|
2706
|
+
})(["", " background-color:", ";flex:1;"], function (_ref) {
|
|
2131
2707
|
var theme = _ref.theme;
|
|
2132
|
-
return theme.
|
|
2708
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
2709
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
2710
|
+
}, "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;"));
|
|
2133
2711
|
}, function (_ref2) {
|
|
2134
2712
|
var theme = _ref2.theme;
|
|
2135
|
-
return theme.kitt.
|
|
2136
|
-
}
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
if (Platform.OS !== 'web') {
|
|
2145
|
-
return undefined;
|
|
2146
|
-
}
|
|
2713
|
+
return theme.kitt.colors.uiBackgroundLight;
|
|
2714
|
+
});
|
|
2715
|
+
function FullScreenModalBody(_ref3) {
|
|
2716
|
+
var children = _ref3.children;
|
|
2717
|
+
return /*#__PURE__*/jsx(Body, {
|
|
2718
|
+
children: children
|
|
2719
|
+
});
|
|
2720
|
+
}
|
|
2147
2721
|
|
|
2148
|
-
|
|
2722
|
+
var SideContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2723
|
+
displayName: "Header__SideContainer"
|
|
2724
|
+
})(["", ""], function (_ref) {
|
|
2725
|
+
var theme = _ref.theme,
|
|
2726
|
+
_ref$side = _ref.side,
|
|
2727
|
+
side = _ref$side === void 0 ? 'left' : _ref$side;
|
|
2728
|
+
var padding = theme.kitt.spacing * 2;
|
|
2149
2729
|
|
|
2150
|
-
if (
|
|
2151
|
-
return "
|
|
2730
|
+
if (side === 'left') {
|
|
2731
|
+
return "padding-right: ".concat(padding, "px;");
|
|
2152
2732
|
}
|
|
2153
2733
|
|
|
2154
|
-
return "
|
|
2734
|
+
return "padding-left: ".concat(padding, "px;");
|
|
2155
2735
|
});
|
|
2156
|
-
function PressableIconButton(_ref5) {
|
|
2157
|
-
var color = _ref5.color,
|
|
2158
|
-
disabled = _ref5.disabled,
|
|
2159
|
-
props = _objectWithoutProperties(_ref5, _excluded$6);
|
|
2160
2736
|
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
$isWhite: color === 'white',
|
|
2164
|
-
$isDisabled: Boolean(disabled),
|
|
2165
|
-
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$9(_objectSpread$9({}, props), {}, {
|
|
2166
|
-
disabled: disabled
|
|
2167
|
-
}))
|
|
2168
|
-
});
|
|
2737
|
+
function getHeaderHorizontalMediumPadding(spacing) {
|
|
2738
|
+
return spacing * 6;
|
|
2169
2739
|
}
|
|
2170
2740
|
|
|
2171
|
-
var
|
|
2172
|
-
displayName: "
|
|
2173
|
-
})(["
|
|
2174
|
-
var theme =
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
var
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2741
|
+
var Header = /*#__PURE__*/styled.View.withConfig({
|
|
2742
|
+
displayName: "Header"
|
|
2743
|
+
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], function (_ref2) {
|
|
2744
|
+
var theme = _ref2.theme,
|
|
2745
|
+
_ref2$insetTop = _ref2.insetTop,
|
|
2746
|
+
insetTop = _ref2$insetTop === void 0 ? 0 : _ref2$insetTop;
|
|
2747
|
+
var paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
|
|
2748
|
+
var _theme$kitt$fullScree = theme.kitt.fullScreenModal.header,
|
|
2749
|
+
paddingVertical = _theme$kitt$fullScree.paddingVertical,
|
|
2750
|
+
paddingHorizontal = _theme$kitt$fullScree.paddingHorizontal;
|
|
2751
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
2752
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
2753
|
+
}, "padding: ".concat(paddingTop, "px ").concat(getHeaderHorizontalMediumPadding(theme.kitt.spacing), "px ").concat(paddingVertical, "px;"), "padding: ".concat(paddingTop, "px ").concat(paddingHorizontal, "px ").concat(paddingVertical, "px;"));
|
|
2184
2754
|
}, function (_ref3) {
|
|
2185
2755
|
var theme = _ref3.theme;
|
|
2186
|
-
return theme.kitt.
|
|
2187
|
-
}, function (_ref4) {
|
|
2188
|
-
var theme = _ref4.theme;
|
|
2189
|
-
return theme.kitt.iconButton.height;
|
|
2756
|
+
return theme.kitt.fullScreenModal.header.borderColor;
|
|
2190
2757
|
});
|
|
2191
|
-
var
|
|
2192
|
-
displayName: "
|
|
2193
|
-
})(["
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
testID = _ref5.testID,
|
|
2199
|
-
_ref5$accessibilityRo = _ref5.accessibilityRole,
|
|
2200
|
-
accessibilityRole = _ref5$accessibilityRo === void 0 ? 'button' : _ref5$accessibilityRo,
|
|
2201
|
-
accessibilityLabel = _ref5.accessibilityLabel,
|
|
2202
|
-
children = _ref5.children,
|
|
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
|
-
};
|
|
2212
|
-
|
|
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;
|
|
2221
|
-
|
|
2222
|
-
global.__reanimatedWorkletInit(_f);
|
|
2758
|
+
var HeaderContent = /*#__PURE__*/styled.View.withConfig({
|
|
2759
|
+
displayName: "Header__HeaderContent"
|
|
2760
|
+
})(["", ";", ";justify-content:center;align-items:center;"], function (_ref4) {
|
|
2761
|
+
var theme = _ref4.theme,
|
|
2762
|
+
leftWidth = _ref4.leftWidth,
|
|
2763
|
+
rightWidth = _ref4.rightWidth,
|
|
2764
|
+
windowWidth = _ref4.windowWidth;
|
|
2223
2765
|
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
}]
|
|
2232
|
-
};
|
|
2233
|
-
};
|
|
2766
|
+
/*
|
|
2767
|
+
* Since we don't have controll over the rendered left and right elements,
|
|
2768
|
+
* we must apply some logic to give the title all the available space
|
|
2769
|
+
*/
|
|
2770
|
+
var sideElementMaxWidth = Math.max(leftWidth, rightWidth);
|
|
2771
|
+
var parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
|
|
2772
|
+
var parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
|
|
2234
2773
|
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
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
|
-
}
|
|
2250
|
-
};
|
|
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;
|
|
2774
|
+
var computeWidth = function (breakpointPadding) {
|
|
2775
|
+
return windowWidth - breakpointPadding - sideElementMaxWidth * 2;
|
|
2776
|
+
};
|
|
2255
2777
|
|
|
2256
|
-
|
|
2778
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
2779
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
2780
|
+
}, "width: ".concat(computeWidth(parentHorizontalPaddingMedium), "px;"), "width: ".concat(computeWidth(parentHorizontalPadding), "px;"));
|
|
2781
|
+
}, function (_ref5) {
|
|
2782
|
+
var leftWidth = _ref5.leftWidth,
|
|
2783
|
+
rightWidth = _ref5.rightWidth;
|
|
2784
|
+
// Depending of the wider element, we must add a margin to fill the diff in space between elements
|
|
2785
|
+
var deltaMargin = Math.abs(leftWidth - rightWidth);
|
|
2257
2786
|
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
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
|
-
},
|
|
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]
|
|
2286
|
-
})
|
|
2287
|
-
});
|
|
2288
|
-
}
|
|
2787
|
+
if (leftWidth > rightWidth) {
|
|
2788
|
+
return "margin-right: ".concat(deltaMargin, "px;");
|
|
2789
|
+
}
|
|
2289
2790
|
|
|
2290
|
-
|
|
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) {
|
|
2300
|
-
var theme = _ref3.theme;
|
|
2301
|
-
return theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth;
|
|
2302
|
-
}, function (_ref4) {
|
|
2303
|
-
var theme = _ref4.theme;
|
|
2304
|
-
return theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth;
|
|
2305
|
-
}, function (_ref5) {
|
|
2306
|
-
var theme = _ref5.theme;
|
|
2307
|
-
return theme.kitt.iconButton.borderRadius;
|
|
2791
|
+
return "margin-left: ".concat(deltaMargin, "px;");
|
|
2308
2792
|
});
|
|
2793
|
+
function FullScreenModalHeader(_ref6) {
|
|
2794
|
+
var children = _ref6.children,
|
|
2795
|
+
right = _ref6.right,
|
|
2796
|
+
left = _ref6.left;
|
|
2309
2797
|
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2798
|
+
var _useSafeAreaInsets = useSafeAreaInsets(),
|
|
2799
|
+
top = _useSafeAreaInsets.top;
|
|
2800
|
+
|
|
2801
|
+
var dimensions = useWindowDimensions();
|
|
2802
|
+
|
|
2803
|
+
var _useState = useState(0),
|
|
2804
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2805
|
+
leftWidth = _useState2[0],
|
|
2806
|
+
setLeftWidth = _useState2[1];
|
|
2807
|
+
|
|
2808
|
+
var _useState3 = useState(0),
|
|
2809
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2810
|
+
rightWidth = _useState4[0],
|
|
2811
|
+
setRightWidth = _useState4[1];
|
|
2812
|
+
|
|
2813
|
+
var handleLayoutChange = function (event, side) {
|
|
2814
|
+
// Prevents react to nullify event on rerenders
|
|
2815
|
+
event.persist();
|
|
2816
|
+
|
|
2817
|
+
if (side === 'left') {
|
|
2818
|
+
setLeftWidth(event.nativeEvent.layout.width);
|
|
2819
|
+
return;
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
setRightWidth(event.nativeEvent.layout.width);
|
|
2823
|
+
};
|
|
2824
|
+
|
|
2825
|
+
return /*#__PURE__*/jsxs(Header, {
|
|
2826
|
+
insetTop: Platform.OS === 'ios' ? undefined : top,
|
|
2827
|
+
children: [left ? /*#__PURE__*/jsx(SideContainer, {
|
|
2828
|
+
onLayout: function onLayout(e) {
|
|
2829
|
+
return handleLayoutChange(e, 'left');
|
|
2830
|
+
},
|
|
2831
|
+
children: left
|
|
2832
|
+
}) : null, /*#__PURE__*/jsx(HeaderContent, {
|
|
2833
|
+
windowWidth: dimensions.width,
|
|
2834
|
+
leftWidth: leftWidth,
|
|
2835
|
+
rightWidth: rightWidth,
|
|
2836
|
+
children: children
|
|
2837
|
+
}), right ? /*#__PURE__*/jsx(SideContainer, {
|
|
2838
|
+
side: "right",
|
|
2839
|
+
onLayout: function onLayout(e) {
|
|
2840
|
+
return handleLayoutChange(e, 'right');
|
|
2841
|
+
},
|
|
2842
|
+
children: right
|
|
2843
|
+
}) : null]
|
|
2320
2844
|
});
|
|
2321
2845
|
}
|
|
2322
2846
|
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
return /*#__PURE__*/jsx(
|
|
2332
|
-
|
|
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
|
|
2342
|
-
})
|
|
2847
|
+
var Container$3 = /*#__PURE__*/styled.View.withConfig({
|
|
2848
|
+
displayName: "FullScreenModal__Container"
|
|
2849
|
+
})(["flex:1;background-color:", ";"], function (_ref) {
|
|
2850
|
+
var theme = _ref.theme;
|
|
2851
|
+
return theme.kitt.colors.uiBackground;
|
|
2852
|
+
});
|
|
2853
|
+
function FullScreenModal(_ref2) {
|
|
2854
|
+
var children = _ref2.children;
|
|
2855
|
+
return /*#__PURE__*/jsx(Container$3, {
|
|
2856
|
+
children: children
|
|
2343
2857
|
});
|
|
2344
2858
|
}
|
|
2859
|
+
FullScreenModal.Header = FullScreenModalHeader;
|
|
2860
|
+
FullScreenModal.Body = FullScreenModalBody;
|
|
2345
2861
|
|
|
2346
2862
|
var _excluded$5 = ["children"];
|
|
2347
2863
|
|
|
2348
|
-
function ownKeys$
|
|
2864
|
+
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; }
|
|
2349
2865
|
|
|
2350
|
-
function _objectSpread$
|
|
2351
|
-
var ContentView
|
|
2866
|
+
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; }
|
|
2867
|
+
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
2352
2868
|
displayName: "ListItemContent__ContentView"
|
|
2353
2869
|
})(["flex:1 0 0%;align-self:center;"]);
|
|
2354
2870
|
function ListItemContent(_ref) {
|
|
2355
2871
|
var children = _ref.children,
|
|
2356
2872
|
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
2357
2873
|
|
|
2358
|
-
return /*#__PURE__*/jsx(ContentView
|
|
2874
|
+
return /*#__PURE__*/jsx(ContentView, _objectSpread$7(_objectSpread$7({}, rest), {}, {
|
|
2359
2875
|
children: children
|
|
2360
2876
|
}));
|
|
2361
2877
|
}
|
|
@@ -2363,9 +2879,9 @@ function ListItemContent(_ref) {
|
|
|
2363
2879
|
var _excluded$4 = ["children", "side"],
|
|
2364
2880
|
_excluded2$1 = ["children", "align"];
|
|
2365
2881
|
|
|
2366
|
-
function ownKeys$
|
|
2882
|
+
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; }
|
|
2367
2883
|
|
|
2368
|
-
function _objectSpread$
|
|
2884
|
+
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; }
|
|
2369
2885
|
var SideContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
2370
2886
|
displayName: "ListItemSideContent__SideContainerView"
|
|
2371
2887
|
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
|
|
@@ -2384,7 +2900,7 @@ function ListItemSideContainer(_ref3) {
|
|
|
2384
2900
|
side = _ref3$side === void 0 ? 'left' : _ref3$side,
|
|
2385
2901
|
rest = _objectWithoutProperties(_ref3, _excluded$4);
|
|
2386
2902
|
|
|
2387
|
-
return /*#__PURE__*/jsx(SideContainerView, _objectSpread$
|
|
2903
|
+
return /*#__PURE__*/jsx(SideContainerView, _objectSpread$6(_objectSpread$6({
|
|
2388
2904
|
side: side
|
|
2389
2905
|
}, rest), {}, {
|
|
2390
2906
|
children: children
|
|
@@ -2402,7 +2918,7 @@ function ListItemSideContent(_ref5) {
|
|
|
2402
2918
|
align = _ref5$align === void 0 ? 'auto' : _ref5$align,
|
|
2403
2919
|
rest = _objectWithoutProperties(_ref5, _excluded2$1);
|
|
2404
2920
|
|
|
2405
|
-
return /*#__PURE__*/jsx(SideContentView, _objectSpread$
|
|
2921
|
+
return /*#__PURE__*/jsx(SideContentView, _objectSpread$6(_objectSpread$6({
|
|
2406
2922
|
align: align
|
|
2407
2923
|
}, rest), {}, {
|
|
2408
2924
|
children: children
|
|
@@ -2411,9 +2927,9 @@ function ListItemSideContent(_ref5) {
|
|
|
2411
2927
|
|
|
2412
2928
|
var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
|
|
2413
2929
|
|
|
2414
|
-
function ownKeys$
|
|
2930
|
+
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; }
|
|
2415
2931
|
|
|
2416
|
-
function _objectSpread$
|
|
2932
|
+
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; }
|
|
2417
2933
|
var ContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
2418
2934
|
displayName: "ListItem__ContainerView"
|
|
2419
2935
|
})(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], function (_ref) {
|
|
@@ -2454,14 +2970,14 @@ function ListItem(_ref5) {
|
|
|
2454
2970
|
onPress = _ref5.onPress,
|
|
2455
2971
|
rest = _objectWithoutProperties(_ref5, _excluded$3);
|
|
2456
2972
|
|
|
2457
|
-
var Wrapper = onPress ? Pressable : Fragment;
|
|
2458
|
-
var wrapperProps = onPress ? _objectSpread$
|
|
2973
|
+
var Wrapper = onPress ? Pressable : Fragment$1;
|
|
2974
|
+
var wrapperProps = onPress ? _objectSpread$5({
|
|
2459
2975
|
accessibilityRole: 'button',
|
|
2460
2976
|
onPress: onPress
|
|
2461
2977
|
}, rest) : undefined;
|
|
2462
2978
|
var containerProps = onPress ? undefined : rest;
|
|
2463
|
-
return /*#__PURE__*/jsx(Wrapper, _objectSpread$
|
|
2464
|
-
children: /*#__PURE__*/jsxs(ContainerView, _objectSpread$
|
|
2979
|
+
return /*#__PURE__*/jsx(Wrapper, _objectSpread$5(_objectSpread$5({}, wrapperProps), {}, {
|
|
2980
|
+
children: /*#__PURE__*/jsxs(ContainerView, _objectSpread$5(_objectSpread$5({
|
|
2465
2981
|
withPadding: withPadding,
|
|
2466
2982
|
borders: borders
|
|
2467
2983
|
}, containerProps), {}, {
|
|
@@ -2660,160 +3176,6 @@ function Message(_ref) {
|
|
|
2660
3176
|
});
|
|
2661
3177
|
}
|
|
2662
3178
|
|
|
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; }
|
|
2664
|
-
|
|
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
|
|
2698
|
-
})
|
|
2699
|
-
});
|
|
2700
|
-
}
|
|
2701
|
-
|
|
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
|
-
}
|
|
2717
|
-
|
|
2718
|
-
var OnCloseContext = /*#__PURE__*/createContext(function () {});
|
|
2719
|
-
|
|
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
3179
|
function Notification(_ref) {
|
|
2818
3180
|
var type = _ref.type,
|
|
2819
3181
|
children = _ref.children,
|
|
@@ -3294,7 +3656,7 @@ function StoryGridCol(_ref2) {
|
|
|
3294
3656
|
return null;
|
|
3295
3657
|
}
|
|
3296
3658
|
|
|
3297
|
-
return /*#__PURE__*/jsxs(Fragment
|
|
3659
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
3298
3660
|
children: [title ? /*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
3299
3661
|
numberOfLines: 1,
|
|
3300
3662
|
color: titleColor,
|
|
@@ -3403,7 +3765,7 @@ function ModalDateTimePicker(_ref2) {
|
|
|
3403
3765
|
setCurrentValue(value);
|
|
3404
3766
|
onClose();
|
|
3405
3767
|
},
|
|
3406
|
-
children: visible ? /*#__PURE__*/jsxs(Fragment
|
|
3768
|
+
children: visible ? /*#__PURE__*/jsxs(Fragment, {
|
|
3407
3769
|
children: [title ? /*#__PURE__*/jsx(Title, {
|
|
3408
3770
|
children: title
|
|
3409
3771
|
}) : null, /*#__PURE__*/jsx(Modal.Body, {
|
|
@@ -3836,5 +4198,5 @@ function withTheme(WrappedComponent) {
|
|
|
3836
4198
|
});
|
|
3837
4199
|
}
|
|
3838
4200
|
|
|
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 };
|
|
4201
|
+
export { Avatar, Button, Card, Checkbox, DatePicker, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPhone, InputPressable, InputTag, 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 };
|
|
3840
4202
|
//# sourceMappingURL=index-browser-all.es.ios.js.map
|