@ornikar/kitt-universal 2.4.0 → 3.0.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/Avatar/Avatar.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts +4 -4
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonPressable.d.ts +4 -3
- package/dist/definitions/Button/ButtonPressable.d.ts.map +1 -1
- package/dist/definitions/Card/Card.d.ts.map +1 -1
- package/dist/definitions/Emoji/Emoji.d.ts +3 -3
- package/dist/definitions/Emoji/Emoji.d.ts.map +1 -1
- package/dist/definitions/ExternalLink/ExternalLink.d.ts +3 -3
- package/dist/definitions/ExternalLink/ExternalLink.d.ts.map +1 -1
- package/dist/definitions/ExternalLink/ExternalLink.web.d.ts.map +1 -1
- package/dist/definitions/FullScreenModal/Body.d.ts.map +1 -1
- package/dist/definitions/FullScreenModal/FullScreenModal.d.ts.map +1 -1
- package/dist/definitions/FullScreenModal/Header.d.ts.map +1 -1
- package/dist/definitions/Icon/Icon.d.ts.map +1 -1
- package/dist/definitions/Icon/SpinningIcon.web.d.ts +3 -2
- package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableAnimatedContainer.web.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableIconButton.d.ts +4 -4
- package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItem.d.ts +3 -4
- package/dist/definitions/ListItem/ListItem.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItemContent.d.ts +2 -2
- package/dist/definitions/ListItem/ListItemContent.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItemSideContent.d.ts +3 -4
- package/dist/definitions/ListItem/ListItemSideContent.d.ts.map +1 -1
- package/dist/definitions/Loader/LargeLoader.d.ts.map +1 -1
- package/dist/definitions/Loader/LargeLoader.web.d.ts.map +1 -1
- package/dist/definitions/Loader/Loader.d.ts.map +1 -1
- package/dist/definitions/Loader/Loader.web.d.ts.map +1 -1
- package/dist/definitions/Message/Message.d.ts.map +1 -1
- package/dist/definitions/Modal/Body.d.ts.map +1 -1
- package/dist/definitions/Modal/Footer.d.ts.map +1 -1
- package/dist/definitions/Modal/Header.d.ts.map +1 -1
- package/dist/definitions/Modal/Modal.d.ts.map +1 -1
- package/dist/definitions/Notification/Notification.d.ts.map +1 -1
- package/dist/definitions/Overlay/Overlay.d.ts +2 -2
- package/dist/definitions/Overlay/Overlay.d.ts.map +1 -1
- package/dist/definitions/Tag/Tag.d.ts.map +1 -1
- package/dist/definitions/TimePicker/ModalDateTimePicker.d.ts +12 -0
- package/dist/definitions/TimePicker/ModalDateTimePicker.d.ts.map +1 -0
- package/dist/definitions/TimePicker/TimePicker.d.ts +15 -0
- package/dist/definitions/TimePicker/TimePicker.d.ts.map +1 -0
- package/dist/definitions/TimePicker/TimePicker.web.d.ts +3 -0
- package/dist/definitions/TimePicker/TimePicker.web.d.ts.map +1 -0
- package/dist/definitions/TimePicker/useTimePicker.d.ts +14 -0
- package/dist/definitions/TimePicker/useTimePicker.d.ts.map +1 -0
- package/dist/definitions/Tooltip/Tooltip.d.ts +23 -3
- package/dist/definitions/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/definitions/Tooltip/Tooltip.web.d.ts +8 -0
- package/dist/definitions/Tooltip/Tooltip.web.d.ts.map +1 -0
- package/dist/definitions/Tooltip/TooltipView.d.ts +8 -0
- package/dist/definitions/Tooltip/TooltipView.d.ts.map +1 -0
- package/dist/definitions/Tooltip/tooltipUtils.d.ts +5 -0
- package/dist/definitions/Tooltip/tooltipUtils.d.ts.map +1 -0
- package/dist/definitions/forms/InputFeedback/InputFeedback.d.ts.map +1 -1
- package/dist/definitions/forms/InputField/InputField.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputText.d.ts +3 -2
- package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/forms/Label/Label.d.ts.map +1 -1
- package/dist/definitions/forms/Radio/Radio.d.ts.map +1 -1
- package/dist/definitions/forms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +3 -15
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/story-components/Flex.d.ts +2 -2
- package/dist/definitions/story-components/Flex.d.ts.map +1 -1
- package/dist/definitions/story-components/Story.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryBlock.d.ts +1 -2
- package/dist/definitions/story-components/StoryBlock.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryContainer.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryContainer.web.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryDecorator.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryGrid.d.ts.map +1 -1
- package/dist/definitions/story-components/StorySection.d.ts +7 -9
- package/dist/definitions/story-components/StorySection.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryTitle.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +3 -6
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts +1 -0
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/tooltip.d.ts +10 -0
- package/dist/definitions/themes/late-ocean/tooltip.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +6 -8
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +16 -4
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyEmoji.d.ts +3 -4
- package/dist/definitions/typography/TypographyEmoji.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts +6 -9
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/definitions/useKittTheme.d.ts +8 -1
- package/dist/definitions/useKittTheme.d.ts.map +1 -1
- package/dist/definitions/utils/StyleWebWrapper.d.ts +7 -0
- package/dist/definitions/utils/StyleWebWrapper.d.ts.map +1 -0
- package/dist/definitions/utils/storybook/{decorators/KittThemeDecorator.d.ts → KittThemeDecorator.d.ts} +1 -1
- package/dist/definitions/utils/storybook/KittThemeDecorator.d.ts.map +1 -0
- package/dist/definitions/utils/tests/renderWithProvidersUtils.d.ts +2 -2
- package/dist/definitions/utils/tests/renderWithProvidersUtils.d.ts.map +1 -1
- package/dist/definitions/utils/tests/styled-component-typing-test.d.ts +1 -0
- package/dist/definitions/utils/tests/styled-component-typing-test.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/MatchWindowSize.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts +2 -2
- package/dist/definitions/utils/withTheme.d.ts +7 -0
- package/dist/definitions/utils/withTheme.d.ts.map +1 -0
- package/dist/index-browser-all.es.android.js +1299 -622
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.css +2 -0
- package/dist/index-browser-all.es.ios.js +1300 -623
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +1262 -696
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +1113 -850
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.css +2 -0
- package/dist/index-node-14.17.cjs.js +1112 -619
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +4 -0
- package/dist/index-node-14.17.cjs.web.js +2979 -0
- package/dist/index-node-14.17.cjs.web.js.map +1 -0
- package/dist/styles.css +4 -0
- package/dist/tsbuildinfo +1 -1
- package/package.json +16 -6
- package/translations/es-ES.json +3 -0
- package/translations/fr-FR.json +3 -0
- package/dist/definitions/primitives/PrimitiveImage.d.ts +0 -13
- package/dist/definitions/primitives/PrimitiveImage.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveImage.web.d.ts +0 -4
- package/dist/definitions/primitives/PrimitiveImage.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveLink.d.ts +0 -13
- package/dist/definitions/primitives/PrimitiveLink.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveLink.web.d.ts +0 -4
- package/dist/definitions/primitives/PrimitiveLink.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitivePressable.d.ts +0 -19
- package/dist/definitions/primitives/PrimitivePressable.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitivePressable.web.d.ts +0 -4
- package/dist/definitions/primitives/PrimitivePressable.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveScrollView.d.ts +0 -8
- package/dist/definitions/primitives/PrimitiveScrollView.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveScrollView.web.d.ts +0 -4
- package/dist/definitions/primitives/PrimitiveScrollView.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveText.d.ts +0 -14
- package/dist/definitions/primitives/PrimitiveText.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveText.web.d.ts +0 -6
- package/dist/definitions/primitives/PrimitiveText.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveView.d.ts +0 -24
- package/dist/definitions/primitives/PrimitiveView.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveView.web.d.ts +0 -27
- package/dist/definitions/primitives/PrimitiveView.web.d.ts.map +0 -1
- package/dist/definitions/primitives/helpers.d.ts +0 -7
- package/dist/definitions/primitives/helpers.d.ts.map +0 -1
- package/dist/definitions/primitives/reset.d.ts +0 -2
- package/dist/definitions/primitives/reset.d.ts.map +0 -1
- package/dist/definitions/utils/storybook/decorators/KittThemeDecorator.d.ts.map +0 -1
- package/dist/definitions/utils/storybook/decorators/SafeAreaProviderDecorator.d.ts +0 -2
- package/dist/definitions/utils/storybook/decorators/SafeAreaProviderDecorator.d.ts.map +0 -1
- package/dist/definitions/utils/storybook/setup-global-decorators.d.ts +0 -2
- package/dist/definitions/utils/storybook/setup-global-decorators.d.ts.map +0 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
4
3
|
import { UserIcon, EyeIcon, EyeOffIcon, XIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon } from '@ornikar/kitt-icons';
|
|
5
4
|
export * from '@ornikar/kitt-icons';
|
|
6
|
-
import
|
|
7
|
-
import { View, Animated, Easing, Text as Text$1, Image, Pressable, Linking, TextInput, useWindowDimensions, ActivityIndicator, TouchableOpacity, StyleSheet, ScrollView, Modal as Modal$1 } from 'react-native';
|
|
5
|
+
import { Animated, Easing, useWindowDimensions, Image, Platform, Linking, TextInput, Pressable, ActivityIndicator, TouchableOpacity, View, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1 } from 'react-native';
|
|
8
6
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
9
|
-
import styled, { useTheme, css, ThemeProvider } from 'styled-components';
|
|
7
|
+
import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
8
|
+
import { useRef, useEffect, cloneElement, useContext, createContext, useState, useMemo, forwardRef, Fragment, Children } from 'react';
|
|
9
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
10
10
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
11
11
|
import { parse } from 'twemoji-parser';
|
|
12
12
|
import { openBrowserAsync } from 'expo-web-browser';
|
|
13
|
-
import
|
|
13
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
14
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
14
15
|
import Animated$1, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
15
|
-
import
|
|
16
|
+
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
17
|
+
import { FormattedMessage } from 'react-intl';
|
|
18
|
+
import { useFloating, offset, shift, flip } from '@floating-ui/react-native';
|
|
16
19
|
import { makeDecorator } from '@storybook/addons';
|
|
17
20
|
|
|
18
|
-
var PrimitiveView = View;
|
|
19
|
-
|
|
20
21
|
function SpinningIcon(_ref) {
|
|
21
22
|
var children = _ref.children;
|
|
22
23
|
var animationRef = useRef(new Animated.Value(0));
|
|
@@ -39,17 +40,19 @@ function SpinningIcon(_ref) {
|
|
|
39
40
|
return undefined;
|
|
40
41
|
};
|
|
41
42
|
}, []);
|
|
42
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/jsx(Animated.View, {
|
|
43
44
|
style: {
|
|
44
45
|
transform: [{
|
|
45
46
|
rotate: rotation
|
|
46
47
|
}]
|
|
47
|
-
}
|
|
48
|
-
|
|
48
|
+
},
|
|
49
|
+
children: children
|
|
50
|
+
});
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
+
var IconContainer$2 = /*#__PURE__*/styled.View.withConfig({
|
|
54
|
+
displayName: "Icon__IconContainer"
|
|
55
|
+
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
53
56
|
var color = _ref.color;
|
|
54
57
|
return color;
|
|
55
58
|
}, function (_ref2) {
|
|
@@ -70,92 +73,172 @@ function Icon(_ref5) {
|
|
|
70
73
|
spin = _ref5.spin,
|
|
71
74
|
align = _ref5.align,
|
|
72
75
|
color = _ref5.color;
|
|
73
|
-
var clonedIcon = /*#__PURE__*/
|
|
76
|
+
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
74
77
|
color: color
|
|
75
78
|
});
|
|
76
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/jsx(IconContainer$2, {
|
|
77
80
|
align: align,
|
|
78
81
|
size: size,
|
|
79
|
-
color: color
|
|
80
|
-
|
|
82
|
+
color: color,
|
|
83
|
+
children: spin ? /*#__PURE__*/jsx(SpinningIcon, {
|
|
84
|
+
children: clonedIcon
|
|
85
|
+
}) : clonedIcon
|
|
86
|
+
});
|
|
81
87
|
}
|
|
82
88
|
|
|
83
|
-
var
|
|
89
|
+
var KittBreakpoints = {
|
|
90
|
+
/**
|
|
91
|
+
* min-width: 0
|
|
92
|
+
*/
|
|
93
|
+
BASE: 0,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* min-width: 480px
|
|
97
|
+
*/
|
|
98
|
+
SMALL: 480,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* min-width: 768px
|
|
102
|
+
*/
|
|
103
|
+
MEDIUM: 768,
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* min-width: 1024px
|
|
107
|
+
*/
|
|
108
|
+
LARGE: 1024,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* min-width: 1280px
|
|
112
|
+
*/
|
|
113
|
+
WIDE: 1280
|
|
114
|
+
};
|
|
115
|
+
var KittBreakpointsMax = {
|
|
116
|
+
/**
|
|
117
|
+
* max-width: 479px
|
|
118
|
+
*/
|
|
119
|
+
BASE: KittBreakpoints.SMALL - 1,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* max-width: 767px
|
|
123
|
+
*/
|
|
124
|
+
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
84
125
|
|
|
85
|
-
|
|
126
|
+
/**
|
|
127
|
+
* max-width: 1023px
|
|
128
|
+
*/
|
|
129
|
+
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
86
130
|
|
|
87
|
-
|
|
88
|
-
|
|
131
|
+
/**
|
|
132
|
+
* max-width: 1279px
|
|
133
|
+
*/
|
|
134
|
+
LARGE: KittBreakpoints.WIDE - 1
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
var _excluded$c = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
|
|
138
|
+
|
|
139
|
+
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; }
|
|
140
|
+
|
|
141
|
+
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; }
|
|
142
|
+
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
89
143
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
90
144
|
function useTypographyColor() {
|
|
91
145
|
return useContext(TypographyColorContext);
|
|
92
146
|
}
|
|
93
|
-
var
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
headers = _theme$kitt$typograph.headers,
|
|
100
|
-
bodies = _theme$kitt$typograph.bodies;
|
|
101
|
-
return "\n /* type */\n ".concat(!type ? '' : "\n font-family: ".concat(isHeader ? headers.fontFamily[variant] : bodies.fontFamily[variant], ";\n font-size: ").concat(isHeader ? headers.configs[type].baseAndSmall.fontSize : bodies.configs[type].baseAndSmall.fontSize, ";\n line-height: ").concat(isHeader ? headers.configs[type].baseAndSmall.lineHeight : bodies.configs[type].baseAndSmall.lineHeight, ";\n "), "\n\n /* variant */\n font-weight: ").concat(isHeader ? headers.fontWeight : bodies.fontWeight[variant], ";\n font-style: ").concat(isHeader ? headers.fontStyle : bodies.fontStyle[variant], ";\n ");
|
|
102
|
-
}, function (_ref2) {
|
|
103
|
-
var theme = _ref2.theme,
|
|
104
|
-
color = _ref2.color;
|
|
105
|
-
return !color ? '' : "\n color: ".concat(theme.kitt.typography.colors[color], ";\n text-decoration-color: ").concat(theme.kitt.typography.colors[color], ";\n ");
|
|
106
|
-
});
|
|
147
|
+
var getTypographyTypeConfigKey = function (theme) {
|
|
148
|
+
var isMediumOrAbove = theme.responsive.matchWindowSize({
|
|
149
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
150
|
+
});
|
|
151
|
+
return isMediumOrAbove ? 'mediumAndWide' : 'baseAndSmall';
|
|
152
|
+
};
|
|
107
153
|
|
|
108
154
|
var isTypeHeader = function (type) {
|
|
109
155
|
return type.startsWith('header');
|
|
110
156
|
};
|
|
111
157
|
|
|
112
|
-
var isTypographyHeader = function (
|
|
113
|
-
if (
|
|
114
|
-
if (
|
|
158
|
+
var isTypographyHeader = function (type, typographyIsHeaderInContext) {
|
|
159
|
+
if (type) return isTypeHeader(type);
|
|
160
|
+
if (typographyIsHeaderInContext != null) return typographyIsHeaderInContext;
|
|
115
161
|
throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
|
|
116
162
|
};
|
|
163
|
+
function getTypographyTypeConfig(type, theme) {
|
|
164
|
+
if (isTypographyHeader(type, undefined)) {
|
|
165
|
+
return theme.kitt.typography.types.headers.configs[type];
|
|
166
|
+
}
|
|
117
167
|
|
|
168
|
+
return theme.kitt.typography.types.bodies.configs[type];
|
|
169
|
+
}
|
|
170
|
+
var StyledTypography = /*#__PURE__*/styled.Text.withConfig({
|
|
171
|
+
displayName: "Typography__StyledTypography"
|
|
172
|
+
})(["", " ", ""], function (_ref) {
|
|
173
|
+
var theme = _ref.theme,
|
|
174
|
+
$isHeader = _ref.$isHeader,
|
|
175
|
+
$typeForCurrentWindowSize = _ref.$typeForCurrentWindowSize,
|
|
176
|
+
$variant = _ref.$variant;
|
|
177
|
+
var _theme$kitt$typograph = theme.kitt.typography.types,
|
|
178
|
+
headers = _theme$kitt$typograph.headers,
|
|
179
|
+
bodies = _theme$kitt$typograph.bodies;
|
|
180
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
181
|
+
return "\n /* type */\n ".concat(!$typeForCurrentWindowSize ? '' : "\n font-family: ".concat($isHeader ? headers.fontFamily[$variant] : bodies.fontFamily[$variant], ";\n font-size: ").concat($isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize, ";\n line-height: ").concat($isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight, ";\n "), "\n\n /* variant */\n font-weight: ").concat($isHeader ? headers.fontWeight : bodies.fontWeight[$variant], ";\n font-style: ").concat($isHeader ? headers.fontStyle : bodies.fontStyle[$variant], ";\n ");
|
|
182
|
+
}, function (_ref2) {
|
|
183
|
+
var theme = _ref2.theme,
|
|
184
|
+
$color = _ref2.$color;
|
|
185
|
+
return !$color ? '' : "\n color: ".concat(theme.kitt.typography.colors[$color], ";\n text-decoration-color: ").concat(theme.kitt.typography.colors[$color], ";\n ");
|
|
186
|
+
});
|
|
187
|
+
function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
188
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
189
|
+
width = _useWindowDimensions.width;
|
|
190
|
+
|
|
191
|
+
if (large && width >= KittBreakpoints.LARGE) return large;
|
|
192
|
+
if (medium && width >= KittBreakpoints.MEDIUM) return medium;
|
|
193
|
+
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
194
|
+
return base;
|
|
195
|
+
}
|
|
118
196
|
function Typography(_ref3) {
|
|
119
197
|
var accessibilityRole = _ref3.accessibilityRole,
|
|
120
198
|
base = _ref3.base,
|
|
199
|
+
small = _ref3.small,
|
|
200
|
+
medium = _ref3.medium,
|
|
201
|
+
large = _ref3.large,
|
|
121
202
|
variant = _ref3.variant,
|
|
122
203
|
color = _ref3.color,
|
|
123
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded$
|
|
124
|
-
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
value:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
204
|
+
otherProps = _objectWithoutProperties(_ref3, _excluded$c);
|
|
205
|
+
|
|
206
|
+
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
207
|
+
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
|
|
208
|
+
var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
209
|
+
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular'; // if isHeaderTypographyInContext exists, it means we are inside another typography so we don't want to
|
|
210
|
+
// redefine the color, just inherit from it
|
|
211
|
+
|
|
212
|
+
var colorWithDefaultToBlack = color !== null && color !== void 0 ? color : isHeaderTypographyInContext !== undefined ? undefined : 'black';
|
|
213
|
+
var content = base ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
214
|
+
value: isHeader,
|
|
215
|
+
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$h({
|
|
216
|
+
$color: colorWithDefaultToBlack,
|
|
217
|
+
$isHeader: isHeader,
|
|
218
|
+
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
219
|
+
$variant: nonNullableVariant,
|
|
220
|
+
accessibilityRole: accessibilityRole || undefined
|
|
221
|
+
}, otherProps))
|
|
222
|
+
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$h({
|
|
223
|
+
$color: colorWithDefaultToBlack,
|
|
224
|
+
$isHeader: isHeader,
|
|
225
|
+
$variant: nonNullableVariant,
|
|
144
226
|
accessibilityRole: accessibilityRole || undefined
|
|
145
227
|
}, otherProps));
|
|
146
|
-
return color ? /*#__PURE__*/
|
|
147
|
-
value: color
|
|
148
|
-
|
|
228
|
+
return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
|
|
229
|
+
value: color,
|
|
230
|
+
children: content
|
|
231
|
+
}) : content;
|
|
149
232
|
}
|
|
150
233
|
|
|
151
234
|
function TypographyText(props) {
|
|
152
|
-
return /*#__PURE__*/
|
|
235
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h({
|
|
153
236
|
accessibilityRole: null
|
|
154
237
|
}, props));
|
|
155
238
|
}
|
|
156
239
|
|
|
157
240
|
function TypographyParagraph(props) {
|
|
158
|
-
return /*#__PURE__*/
|
|
241
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h({
|
|
159
242
|
accessibilityRole: "paragraph"
|
|
160
243
|
}, props));
|
|
161
244
|
}
|
|
@@ -163,10 +246,10 @@ function TypographyParagraph(props) {
|
|
|
163
246
|
var createHeading = function (level, defaultBase) {
|
|
164
247
|
// https://github.com/necolas/react-native-web/issues/401
|
|
165
248
|
function TypographyHeading(props) {
|
|
166
|
-
return /*#__PURE__*/
|
|
249
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h(_objectSpread$h({
|
|
167
250
|
accessibilityRole: "header",
|
|
168
251
|
base: defaultBase
|
|
169
|
-
}, props, {
|
|
252
|
+
}, props), {}, {
|
|
170
253
|
accessibilityLevel: level
|
|
171
254
|
}));
|
|
172
255
|
}
|
|
@@ -199,9 +282,11 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
199
282
|
|
|
200
283
|
Typography.h5 = createHeading(5, 'header5');
|
|
201
284
|
|
|
202
|
-
var _excluded$
|
|
285
|
+
var _excluded$b = ["size"];
|
|
203
286
|
|
|
204
|
-
var
|
|
287
|
+
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; }
|
|
288
|
+
|
|
289
|
+
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; }
|
|
205
290
|
|
|
206
291
|
var getFirstCharacter = function (string) {
|
|
207
292
|
return string ? string[0] : '';
|
|
@@ -211,7 +296,9 @@ var getInitials = function (firstname, lastname) {
|
|
|
211
296
|
return (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
|
|
212
297
|
};
|
|
213
298
|
|
|
214
|
-
var StyledAvatarView = styled(
|
|
299
|
+
var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
|
|
300
|
+
displayName: "Avatar__StyledAvatarView"
|
|
301
|
+
})(["border-radius:", "px;background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
215
302
|
var round = _ref.round,
|
|
216
303
|
size = _ref.size;
|
|
217
304
|
return round ? size / 2 : 10;
|
|
@@ -236,7 +323,7 @@ function AvatarContent(_ref5) {
|
|
|
236
323
|
light = _ref5.light;
|
|
237
324
|
|
|
238
325
|
if (src) {
|
|
239
|
-
return /*#__PURE__*/
|
|
326
|
+
return /*#__PURE__*/jsx(Image, {
|
|
240
327
|
source: {
|
|
241
328
|
uri: src
|
|
242
329
|
},
|
|
@@ -248,15 +335,16 @@ function AvatarContent(_ref5) {
|
|
|
248
335
|
}
|
|
249
336
|
|
|
250
337
|
if (firstname && lastname) {
|
|
251
|
-
return /*#__PURE__*/
|
|
338
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
252
339
|
base: "body-small",
|
|
253
340
|
variant: "bold",
|
|
254
|
-
color: light ? 'black' : 'white'
|
|
255
|
-
|
|
341
|
+
color: light ? 'black' : 'white',
|
|
342
|
+
children: getInitials(firstname, lastname)
|
|
343
|
+
});
|
|
256
344
|
}
|
|
257
345
|
|
|
258
|
-
return /*#__PURE__*/
|
|
259
|
-
icon: /*#__PURE__*/
|
|
346
|
+
return /*#__PURE__*/jsx(Icon, {
|
|
347
|
+
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
260
348
|
color: light ? 'black' : 'white',
|
|
261
349
|
size: size / 2
|
|
262
350
|
});
|
|
@@ -265,32 +353,37 @@ function AvatarContent(_ref5) {
|
|
|
265
353
|
function Avatar(_ref6) {
|
|
266
354
|
var _ref6$size = _ref6.size,
|
|
267
355
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
268
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
356
|
+
rest = _objectWithoutProperties(_ref6, _excluded$b);
|
|
269
357
|
|
|
270
|
-
return /*#__PURE__*/
|
|
271
|
-
size: size
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
358
|
+
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$g(_objectSpread$g({}, rest), {}, {
|
|
359
|
+
size: size,
|
|
360
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$g(_objectSpread$g({}, rest), {}, {
|
|
361
|
+
size: size
|
|
362
|
+
}))
|
|
363
|
+
}));
|
|
275
364
|
}
|
|
276
365
|
|
|
277
|
-
var _excluded$
|
|
366
|
+
var _excluded$a = ["color"],
|
|
278
367
|
_excluded2$2 = ["color"];
|
|
279
368
|
|
|
369
|
+
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; }
|
|
370
|
+
|
|
371
|
+
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; }
|
|
372
|
+
|
|
280
373
|
function TypographyIconInheritColor(props) {
|
|
281
374
|
var color = useTypographyColor();
|
|
282
|
-
var theme = useTheme();
|
|
283
|
-
return /*#__PURE__*/
|
|
375
|
+
var theme = /*#__PURE__*/useTheme();
|
|
376
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
284
377
|
color: theme.kitt.typography.colors[color]
|
|
285
378
|
}));
|
|
286
379
|
}
|
|
287
380
|
|
|
288
381
|
function TypographyIconSpecifiedColor(_ref) {
|
|
289
382
|
var color = _ref.color,
|
|
290
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
383
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$a);
|
|
291
384
|
|
|
292
|
-
var theme = useTheme();
|
|
293
|
-
return /*#__PURE__*/
|
|
385
|
+
var theme = /*#__PURE__*/useTheme();
|
|
386
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$f(_objectSpread$f({}, otherProps), {}, {
|
|
294
387
|
color: theme.kitt.typography.colors[color]
|
|
295
388
|
}));
|
|
296
389
|
}
|
|
@@ -300,15 +393,17 @@ function TypographyIcon(_ref2) {
|
|
|
300
393
|
otherProps = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
301
394
|
|
|
302
395
|
if (color) {
|
|
303
|
-
return /*#__PURE__*/
|
|
396
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$f({
|
|
304
397
|
color: color
|
|
305
398
|
}, otherProps));
|
|
306
399
|
}
|
|
307
400
|
|
|
308
|
-
return /*#__PURE__*/
|
|
401
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$f({}, otherProps));
|
|
309
402
|
}
|
|
310
403
|
|
|
311
|
-
|
|
404
|
+
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; }
|
|
405
|
+
|
|
406
|
+
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; }
|
|
312
407
|
|
|
313
408
|
var getTextColorByType = function (type, isPressed, disabled) {
|
|
314
409
|
if (disabled) return 'black-light';
|
|
@@ -329,13 +424,19 @@ var getTextColorByType = function (type, isPressed, disabled) {
|
|
|
329
424
|
}
|
|
330
425
|
};
|
|
331
426
|
|
|
332
|
-
var ButtonText = styled(Typography.Text)(
|
|
333
|
-
|
|
427
|
+
var ButtonText = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
428
|
+
displayName: "ButtonContent__ButtonText"
|
|
429
|
+
})(["text-align:center;"]);
|
|
430
|
+
var Content$1 = /*#__PURE__*/styled.View.withConfig({
|
|
431
|
+
displayName: "ButtonContent__Content"
|
|
432
|
+
})(["flex-direction:row;align-items:center;justify-content:center;flex:", ";"], function (_ref) {
|
|
334
433
|
var stretch = _ref.stretch,
|
|
335
434
|
iconOnly = _ref.iconOnly;
|
|
336
435
|
return "".concat(stretch || iconOnly ? 1 : 0, " 1 auto");
|
|
337
436
|
});
|
|
338
|
-
var IconContainer$1 = styled(
|
|
437
|
+
var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
438
|
+
displayName: "ButtonContent__IconContainer"
|
|
439
|
+
})(["", ""], function (_ref2) {
|
|
339
440
|
var theme = _ref2.theme,
|
|
340
441
|
iconPosition = _ref2.iconPosition;
|
|
341
442
|
var value = theme.kitt.spacing * 3;
|
|
@@ -354,15 +455,16 @@ function ButtonIcon(_ref3) {
|
|
|
354
455
|
size = _ref3.size,
|
|
355
456
|
iconPosition = _ref3.iconPosition,
|
|
356
457
|
testID = _ref3.testID;
|
|
357
|
-
return /*#__PURE__*/
|
|
358
|
-
iconPosition: iconPosition
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
458
|
+
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
459
|
+
iconPosition: iconPosition,
|
|
460
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
461
|
+
icon: icon,
|
|
462
|
+
spin: spin,
|
|
463
|
+
color: color,
|
|
464
|
+
size: size,
|
|
465
|
+
testID: testID
|
|
466
|
+
})
|
|
467
|
+
});
|
|
366
468
|
}
|
|
367
469
|
|
|
368
470
|
function ButtonContent(_ref4) {
|
|
@@ -375,7 +477,7 @@ function ButtonContent(_ref4) {
|
|
|
375
477
|
disabled = _ref4.disabled,
|
|
376
478
|
children = _ref4.children;
|
|
377
479
|
var color = getTextColorByType(type, Boolean(isPressed), Boolean(disabled));
|
|
378
|
-
var theme = useTheme();
|
|
480
|
+
var theme = /*#__PURE__*/useTheme();
|
|
379
481
|
var sharedIconProps = {
|
|
380
482
|
spin: iconSpin,
|
|
381
483
|
color: color,
|
|
@@ -389,34 +491,36 @@ function ButtonContent(_ref4) {
|
|
|
389
491
|
}
|
|
390
492
|
|
|
391
493
|
if (!children) {
|
|
392
|
-
return /*#__PURE__*/
|
|
494
|
+
return /*#__PURE__*/jsx(Content$1, {
|
|
393
495
|
iconOnly: true,
|
|
394
|
-
stretch: stretch
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
496
|
+
stretch: stretch,
|
|
497
|
+
children: /*#__PURE__*/jsx(TypographyIcon, _objectSpread$e(_objectSpread$e({}, sharedIconProps), {}, {
|
|
498
|
+
icon: icon
|
|
499
|
+
}))
|
|
500
|
+
});
|
|
398
501
|
}
|
|
399
502
|
|
|
400
|
-
return /*#__PURE__*/
|
|
401
|
-
stretch: stretch
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
icon
|
|
412
|
-
|
|
413
|
-
|
|
503
|
+
return /*#__PURE__*/jsxs(Content$1, {
|
|
504
|
+
stretch: stretch,
|
|
505
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$e(_objectSpread$e({}, sharedIconProps), {}, {
|
|
506
|
+
icon: icon,
|
|
507
|
+
iconPosition: iconPosition,
|
|
508
|
+
testID: "button-left-icon"
|
|
509
|
+
})) : null, /*#__PURE__*/jsx(ButtonText, {
|
|
510
|
+
base: "body",
|
|
511
|
+
color: color,
|
|
512
|
+
variant: "bold",
|
|
513
|
+
children: children
|
|
514
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$e(_objectSpread$e({}, sharedIconProps), {}, {
|
|
515
|
+
icon: icon,
|
|
516
|
+
iconPosition: iconPosition
|
|
517
|
+
})) : null]
|
|
518
|
+
});
|
|
414
519
|
}
|
|
415
520
|
|
|
416
|
-
var
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
var ButtonPressable = styled(PrimitivePressable)(_templateObject$s || (_templateObject$s = _taggedTemplateLiteral(["\n min-width: ", ";\n max-width: ", ";\n width: ", ";\n min-height: ", ";\n background-color: ", ";\n padding: ", ";\n flex-direction: row;\n\n /* Emulate inline-* css display by making the button taking only its necessary space */\n align-self: flex-start;\n border-radius: ", ";\n border-color: ", ";\n border-width: ", ";\n"])), function (_ref) {
|
|
521
|
+
var ButtonPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
522
|
+
displayName: "ButtonPressable"
|
|
523
|
+
})(["min-width:", ";max-width:", ";width:", ";min-height:", ";background-color:", ";padding:", ";flex-direction:row;align-self:flex-start;border-radius:", ";border-color:", ";border-width:", ";"], function (_ref) {
|
|
420
524
|
var theme = _ref.theme;
|
|
421
525
|
return theme.kitt.button.minWidth;
|
|
422
526
|
}, function (_ref2) {
|
|
@@ -456,6 +560,9 @@ var ButtonPressable = styled(PrimitivePressable)(_templateObject$s || (_template
|
|
|
456
560
|
return theme.kitt.button.borderWidth;
|
|
457
561
|
});
|
|
458
562
|
|
|
563
|
+
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; }
|
|
564
|
+
|
|
565
|
+
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; }
|
|
459
566
|
function Button(_ref) {
|
|
460
567
|
var children = _ref.children,
|
|
461
568
|
_ref$type = _ref.type,
|
|
@@ -481,10 +588,10 @@ function Button(_ref) {
|
|
|
481
588
|
stretch: stretch,
|
|
482
589
|
disabled: disabled
|
|
483
590
|
};
|
|
484
|
-
return /*#__PURE__*/
|
|
591
|
+
return /*#__PURE__*/jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
485
592
|
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
486
593
|
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
487
|
-
,
|
|
594
|
+
, _objectSpread$d(_objectSpread$d({}, sharedProps), {}, {
|
|
488
595
|
isPressed: isPressed,
|
|
489
596
|
accessibilityRole: "button",
|
|
490
597
|
testID: testID,
|
|
@@ -496,16 +603,19 @@ function Button(_ref) {
|
|
|
496
603
|
},
|
|
497
604
|
onPressOut: function handleButtonPressOut() {
|
|
498
605
|
return setIsPressed(false);
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
606
|
+
},
|
|
607
|
+
children: /*#__PURE__*/jsx(ButtonContent, _objectSpread$d(_objectSpread$d({}, sharedProps), {}, {
|
|
608
|
+
icon: icon,
|
|
609
|
+
iconPosition: iconPosition,
|
|
610
|
+
iconSpin: iconSpin,
|
|
611
|
+
children: children
|
|
612
|
+
}))
|
|
613
|
+
}));
|
|
505
614
|
}
|
|
506
615
|
|
|
507
|
-
var
|
|
508
|
-
|
|
616
|
+
var Container$6 = /*#__PURE__*/styled.View.withConfig({
|
|
617
|
+
displayName: "Card__Container"
|
|
618
|
+
})(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], function (_ref) {
|
|
509
619
|
var theme = _ref.theme,
|
|
510
620
|
type = _ref.type;
|
|
511
621
|
return theme.kitt.card[type].backgroundColor;
|
|
@@ -526,15 +636,15 @@ var Container$5 = styled(PrimitiveView)(_templateObject$r || (_templateObject$r
|
|
|
526
636
|
function Card(_ref6) {
|
|
527
637
|
var children = _ref6.children,
|
|
528
638
|
type = _ref6.type;
|
|
529
|
-
return /*#__PURE__*/
|
|
530
|
-
type: type
|
|
531
|
-
|
|
639
|
+
return /*#__PURE__*/jsx(Container$6, {
|
|
640
|
+
type: type,
|
|
641
|
+
children: children
|
|
642
|
+
});
|
|
532
643
|
}
|
|
533
644
|
|
|
534
|
-
var
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
var StyledEmoji = styled(PrimitiveImage)(_templateObject$q || (_templateObject$q = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n"])), function (_ref) {
|
|
645
|
+
var StyledEmoji = /*#__PURE__*/styled.Image.withConfig({
|
|
646
|
+
displayName: "Emoji__StyledEmoji"
|
|
647
|
+
})(["width:", "px;height:", "px;"], function (_ref) {
|
|
538
648
|
var size = _ref.size;
|
|
539
649
|
return size;
|
|
540
650
|
}, function (_ref2) {
|
|
@@ -544,27 +654,25 @@ var StyledEmoji = styled(PrimitiveImage)(_templateObject$q || (_templateObject$q
|
|
|
544
654
|
function Emoji(_ref3) {
|
|
545
655
|
var emoji = _ref3.emoji,
|
|
546
656
|
size = _ref3.size,
|
|
547
|
-
style = _ref3.style
|
|
548
|
-
className = _ref3.className;
|
|
657
|
+
style = _ref3.style;
|
|
549
658
|
|
|
550
659
|
var _useMemo = useMemo(function () {
|
|
551
660
|
return parse(emoji, {
|
|
552
661
|
// on native plaforms, you can't display svg as Image
|
|
553
|
-
assetType: 'png'
|
|
662
|
+
assetType: Platform.OS === 'web' ? 'svg' : 'png'
|
|
554
663
|
});
|
|
555
664
|
}, [emoji]),
|
|
556
665
|
_useMemo2 = _slicedToArray(_useMemo, 1),
|
|
557
666
|
emojiData = _useMemo2[0];
|
|
558
667
|
|
|
559
668
|
if (!emojiData) return null;
|
|
560
|
-
return /*#__PURE__*/
|
|
669
|
+
return /*#__PURE__*/jsx(StyledEmoji, {
|
|
561
670
|
size: size,
|
|
562
671
|
accessibilityLabel: emojiData.text,
|
|
563
672
|
source: {
|
|
564
673
|
uri: emojiData.url
|
|
565
674
|
},
|
|
566
|
-
style: style
|
|
567
|
-
className: className
|
|
675
|
+
style: style
|
|
568
676
|
});
|
|
569
677
|
}
|
|
570
678
|
|
|
@@ -573,16 +681,20 @@ var defaultOpenLinkBehavior = {
|
|
|
573
681
|
web: 'targetBlank'
|
|
574
682
|
};
|
|
575
683
|
|
|
576
|
-
var _excluded$
|
|
684
|
+
var _excluded$9 = ["as", "href", "openLinkBehavior", "onPress"];
|
|
685
|
+
|
|
686
|
+
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; }
|
|
687
|
+
|
|
688
|
+
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; }
|
|
577
689
|
function ExternalLink(_ref) {
|
|
578
690
|
var Component = _ref.as,
|
|
579
691
|
href = _ref.href,
|
|
580
692
|
_ref$openLinkBehavior = _ref.openLinkBehavior,
|
|
581
693
|
openLinkBehavior = _ref$openLinkBehavior === void 0 ? defaultOpenLinkBehavior : _ref$openLinkBehavior,
|
|
582
694
|
onPress = _ref.onPress,
|
|
583
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
695
|
+
rest = _objectWithoutProperties(_ref, _excluded$9);
|
|
584
696
|
|
|
585
|
-
return /*#__PURE__*/
|
|
697
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$c(_objectSpread$c({}, rest), {}, {
|
|
586
698
|
onPress: function handleOnPress() {
|
|
587
699
|
if (onPress) onPress();
|
|
588
700
|
if (!href) return;
|
|
@@ -590,13 +702,13 @@ function ExternalLink(_ref) {
|
|
|
590
702
|
switch (openLinkBehavior["native"]) {
|
|
591
703
|
case 'openInModal':
|
|
592
704
|
case undefined:
|
|
593
|
-
|
|
705
|
+
openBrowserAsync(href)["catch"](function (err) {
|
|
594
706
|
console.error("An error occurred while opening ".concat(href), err);
|
|
595
707
|
});
|
|
596
708
|
break;
|
|
597
709
|
|
|
598
710
|
case 'openBrowserApp':
|
|
599
|
-
|
|
711
|
+
Linking.openURL(href)["catch"](function (err) {
|
|
600
712
|
console.error("An error occurred while opening ".concat(href), err);
|
|
601
713
|
});
|
|
602
714
|
break;
|
|
@@ -625,74 +737,34 @@ function InputFeedback(_ref) {
|
|
|
625
737
|
var state = _ref.state,
|
|
626
738
|
testID = _ref.testID,
|
|
627
739
|
children = _ref.children;
|
|
628
|
-
return /*#__PURE__*/
|
|
740
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
629
741
|
base: "body-small",
|
|
630
742
|
color: getColorFromState(state),
|
|
631
|
-
testID: testID
|
|
632
|
-
|
|
743
|
+
testID: testID,
|
|
744
|
+
children: children
|
|
745
|
+
});
|
|
633
746
|
}
|
|
634
747
|
|
|
635
|
-
var
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
/**
|
|
642
|
-
* min-width: 480px
|
|
643
|
-
*/
|
|
644
|
-
SMALL: 480,
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* min-width: 768px
|
|
648
|
-
*/
|
|
649
|
-
MEDIUM: 768,
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* min-width: 1024px
|
|
653
|
-
*/
|
|
654
|
-
LARGE: 1024,
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* min-width: 1280px
|
|
658
|
-
*/
|
|
659
|
-
WIDE: 1280
|
|
660
|
-
};
|
|
661
|
-
var KittBreakpointsMax = {
|
|
662
|
-
/**
|
|
663
|
-
* max-width: 479px
|
|
664
|
-
*/
|
|
665
|
-
BASE: KittBreakpoints.SMALL - 1,
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* max-width: 767px
|
|
669
|
-
*/
|
|
670
|
-
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* max-width: 1023px
|
|
674
|
-
*/
|
|
675
|
-
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* max-width: 1279px
|
|
679
|
-
*/
|
|
680
|
-
LARGE: KittBreakpoints.WIDE - 1
|
|
681
|
-
};
|
|
682
|
-
|
|
683
|
-
var _templateObject$p, _templateObject2$b, _templateObject3$7, _templateObject4$6;
|
|
684
|
-
var FieldContainer = styled(PrimitiveView)(_templateObject$p || (_templateObject$p = _taggedTemplateLiteral(["\n padding: 5px 0 10px;\n"])));
|
|
685
|
-
var FeedbackContainer = styled(PrimitiveView)(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteral(["\n ", ";\n"])), function (_ref) {
|
|
748
|
+
var FieldContainer = /*#__PURE__*/styled.View.withConfig({
|
|
749
|
+
displayName: "InputField__FieldContainer"
|
|
750
|
+
})(["padding:5px 0 10px;"]);
|
|
751
|
+
var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
|
|
752
|
+
displayName: "InputField__FeedbackContainer"
|
|
753
|
+
})(["", ";"], function (_ref) {
|
|
686
754
|
var theme = _ref.theme;
|
|
687
755
|
return theme.responsive.ifWindowSizeMatches({
|
|
688
756
|
minWidth: KittBreakpoints.SMALL
|
|
689
757
|
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
690
758
|
});
|
|
691
|
-
var FieldLabelContainer = styled(
|
|
759
|
+
var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
760
|
+
displayName: "InputField__FieldLabelContainer"
|
|
761
|
+
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
692
762
|
var theme = _ref2.theme;
|
|
693
763
|
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
694
764
|
});
|
|
695
|
-
var LabelContainer = styled(
|
|
765
|
+
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
766
|
+
displayName: "InputField__LabelContainer"
|
|
767
|
+
})(["margin-right:", "px;"], function (_ref3) {
|
|
696
768
|
var theme = _ref3.theme;
|
|
697
769
|
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
698
770
|
});
|
|
@@ -701,7 +773,15 @@ function InputField(_ref4) {
|
|
|
701
773
|
labelFeedback = _ref4.labelFeedback,
|
|
702
774
|
input = _ref4.input,
|
|
703
775
|
feedback = _ref4.feedback;
|
|
704
|
-
return /*#__PURE__*/
|
|
776
|
+
return /*#__PURE__*/jsxs(FieldContainer, {
|
|
777
|
+
children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
|
|
778
|
+
children: [/*#__PURE__*/jsx(LabelContainer, {
|
|
779
|
+
children: label
|
|
780
|
+
}), labelFeedback]
|
|
781
|
+
}) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
|
|
782
|
+
children: feedback
|
|
783
|
+
}) : null]
|
|
784
|
+
});
|
|
705
785
|
}
|
|
706
786
|
|
|
707
787
|
var useInputText = function () {
|
|
@@ -732,10 +812,12 @@ var useInputText = function () {
|
|
|
732
812
|
};
|
|
733
813
|
};
|
|
734
814
|
|
|
735
|
-
var _excluded$
|
|
815
|
+
var _excluded$8 = ["id", "minHeight", "type", "state", "internalForceState", "disabled", "onFocus", "onBlur"];
|
|
736
816
|
|
|
737
|
-
|
|
738
|
-
|
|
817
|
+
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; }
|
|
818
|
+
|
|
819
|
+
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; }
|
|
820
|
+
var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", ";border-radius:", ";border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
|
|
739
821
|
var theme = _ref.theme,
|
|
740
822
|
state = _ref.state;
|
|
741
823
|
return state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states["default"].backgroundColor;
|
|
@@ -751,7 +833,8 @@ var styledTextInputMixin = css(_templateObject$o || (_templateObject$o = _tagged
|
|
|
751
833
|
return theme.kitt.forms.input.states[state].borderColor;
|
|
752
834
|
}, function (_ref5) {
|
|
753
835
|
var theme = _ref5.theme;
|
|
754
|
-
|
|
836
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
837
|
+
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize;
|
|
755
838
|
}, function (_ref6) {
|
|
756
839
|
var theme = _ref6.theme,
|
|
757
840
|
state = _ref6.state;
|
|
@@ -760,26 +843,34 @@ var styledTextInputMixin = css(_templateObject$o || (_templateObject$o = _tagged
|
|
|
760
843
|
var theme = _ref7.theme;
|
|
761
844
|
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
762
845
|
});
|
|
763
|
-
var Input = styled(TextInput)(
|
|
846
|
+
var Input = /*#__PURE__*/styled(TextInput).withConfig({
|
|
847
|
+
displayName: "InputText__Input"
|
|
848
|
+
})(["", " padding:", ";line-height:", ";min-height:", "px;"], styledTextInputMixin, function (_ref8) {
|
|
764
849
|
var theme = _ref8.theme,
|
|
765
850
|
multiline = _ref8.multiline;
|
|
766
|
-
return !multiline &&
|
|
851
|
+
return !multiline && Platform.OS === 'ios' ? theme.kitt.forms.input.paddingSingleLineIOS : theme.kitt.forms.input.padding;
|
|
767
852
|
}, function (_ref9) {
|
|
768
853
|
var theme = _ref9.theme,
|
|
769
854
|
multiline = _ref9.multiline;
|
|
770
|
-
|
|
855
|
+
if (!multiline && Platform.OS === 'ios') return 0;
|
|
856
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
857
|
+
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight;
|
|
771
858
|
}, function (_ref10) {
|
|
772
859
|
var minHeight = _ref10.minHeight;
|
|
773
860
|
return minHeight;
|
|
774
861
|
});
|
|
775
|
-
var Container$
|
|
862
|
+
var Container$5 = /*#__PURE__*/styled.View.withConfig({
|
|
863
|
+
displayName: "InputText__Container"
|
|
864
|
+
})(["margin-top:", ";margin-bottom:", ";"], function (_ref11) {
|
|
776
865
|
var theme = _ref11.theme;
|
|
777
866
|
return theme.kitt.forms.input.marginTop;
|
|
778
867
|
}, function (_ref12) {
|
|
779
868
|
var theme = _ref12.theme;
|
|
780
869
|
return theme.kitt.forms.input.marginBottom;
|
|
781
870
|
});
|
|
782
|
-
var PasswordButtonContainer = styled(
|
|
871
|
+
var PasswordButtonContainer = /*#__PURE__*/styled.Pressable.withConfig({
|
|
872
|
+
displayName: "InputText__PasswordButtonContainer"
|
|
873
|
+
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:", "px;"], function (_ref13) {
|
|
783
874
|
var theme = _ref13.theme;
|
|
784
875
|
return theme.kitt.forms.input.passwordButtonIconSize / 2;
|
|
785
876
|
});
|
|
@@ -829,7 +920,7 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
829
920
|
disabled = _ref15$disabled === void 0 ? false : _ref15$disabled,
|
|
830
921
|
_onFocus = _ref15.onFocus,
|
|
831
922
|
_onBlur = _ref15.onBlur,
|
|
832
|
-
props = _objectWithoutProperties(_ref15, _excluded$
|
|
923
|
+
props = _objectWithoutProperties(_ref15, _excluded$8);
|
|
833
924
|
|
|
834
925
|
var _useInputText = useInputText(),
|
|
835
926
|
isFocused = _useInputText.isFocused,
|
|
@@ -838,54 +929,62 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
838
929
|
isPasswordVisible = _useInputText.isPasswordVisible,
|
|
839
930
|
togglePasswordVisibility = _useInputText.togglePasswordVisibility;
|
|
840
931
|
|
|
841
|
-
var theme = useTheme();
|
|
932
|
+
var theme = /*#__PURE__*/useTheme();
|
|
842
933
|
var state = internalForceState || getInputState({
|
|
843
934
|
isFocused: isFocused,
|
|
844
935
|
isDisabled: disabled,
|
|
845
936
|
formState: formState
|
|
846
937
|
});
|
|
847
|
-
return /*#__PURE__*/
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
938
|
+
return /*#__PURE__*/jsxs(Container$5, {
|
|
939
|
+
children: [/*#__PURE__*/jsx(Input, _objectSpread$b(_objectSpread$b({
|
|
940
|
+
ref: ref,
|
|
941
|
+
nativeID: id,
|
|
942
|
+
editable: !disabled,
|
|
943
|
+
keyboardType: keyboardTypeByTextInputType[type],
|
|
944
|
+
autoCompleteType: autoCompleteTypeByType[type],
|
|
945
|
+
autoCorrect: autoCorrectByType[type],
|
|
946
|
+
minHeight: minHeight,
|
|
947
|
+
textContentType: textContentTypeByType[type],
|
|
948
|
+
placeholderTextColor: theme.kitt.typography.colors[theme.kitt.forms.input.placeholderColor],
|
|
949
|
+
selectionColor: theme.kitt.forms.input.selectionColor,
|
|
950
|
+
secureTextEntry: type === 'password' && !isPasswordVisible
|
|
951
|
+
}, props), {}, {
|
|
952
|
+
state: state,
|
|
953
|
+
onFocus: function onFocus(e) {
|
|
954
|
+
handleInputFocus();
|
|
955
|
+
if (_onFocus) _onFocus(e);
|
|
956
|
+
},
|
|
957
|
+
onBlur: function onBlur(e) {
|
|
958
|
+
handleInputBlur();
|
|
959
|
+
if (_onBlur) _onBlur(e);
|
|
960
|
+
}
|
|
961
|
+
})), type === 'password' && !disabled && /*#__PURE__*/jsx(PasswordButtonContainer, {
|
|
962
|
+
accessibilityRole: "button",
|
|
963
|
+
onPress: togglePasswordVisibility,
|
|
964
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
965
|
+
icon: isPasswordVisible ? /*#__PURE__*/jsx(EyeIcon, {}) : /*#__PURE__*/jsx(EyeOffIcon, {}),
|
|
966
|
+
size: theme.kitt.forms.input.passwordButtonIconSize,
|
|
967
|
+
color: theme.kitt.forms.input.states[state].passwordButtonIconColor
|
|
968
|
+
})
|
|
969
|
+
})]
|
|
970
|
+
});
|
|
877
971
|
});
|
|
878
972
|
|
|
879
973
|
function Label(_ref) {
|
|
880
|
-
_ref.htmlFor
|
|
881
|
-
|
|
882
|
-
return /*#__PURE__*/
|
|
883
|
-
base: "body"
|
|
884
|
-
|
|
974
|
+
var htmlFor = _ref.htmlFor,
|
|
975
|
+
children = _ref.children;
|
|
976
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
977
|
+
base: "body",
|
|
978
|
+
children: Platform.OS === 'web' ? /*#__PURE__*/jsx("label", {
|
|
979
|
+
htmlFor: htmlFor,
|
|
980
|
+
children: children
|
|
981
|
+
}) : children
|
|
982
|
+
});
|
|
885
983
|
}
|
|
886
984
|
|
|
887
|
-
var
|
|
888
|
-
|
|
985
|
+
var OuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
986
|
+
displayName: "Radio__OuterRadio"
|
|
987
|
+
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", ";border-color:", ";"], function (_ref) {
|
|
889
988
|
var theme = _ref.theme,
|
|
890
989
|
disabled = _ref.disabled;
|
|
891
990
|
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor;
|
|
@@ -906,7 +1005,9 @@ var OuterRadio = styled(PrimitiveView)(_templateObject$n || (_templateObject$n =
|
|
|
906
1005
|
disabled = _ref6.disabled;
|
|
907
1006
|
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor;
|
|
908
1007
|
});
|
|
909
|
-
var SelectedOuterRadio = styled(
|
|
1008
|
+
var SelectedOuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1009
|
+
displayName: "Radio__SelectedOuterRadio"
|
|
1010
|
+
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], function (_ref7) {
|
|
910
1011
|
var theme = _ref7.theme;
|
|
911
1012
|
return theme.kitt.forms.radio.checked.backgroundColor;
|
|
912
1013
|
}, function (_ref8) {
|
|
@@ -919,7 +1020,9 @@ var SelectedOuterRadio = styled(PrimitiveView)(_templateObject2$9 || (_templateO
|
|
|
919
1020
|
var theme = _ref10.theme;
|
|
920
1021
|
return theme.kitt.forms.radio.size / 2;
|
|
921
1022
|
});
|
|
922
|
-
var SelectedInnerRadio = styled(
|
|
1023
|
+
var SelectedInnerRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1024
|
+
displayName: "Radio__SelectedInnerRadio"
|
|
1025
|
+
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], function (_ref11) {
|
|
923
1026
|
var theme = _ref11.theme;
|
|
924
1027
|
return theme.kitt.forms.radio.checked.innerBackgroundColor;
|
|
925
1028
|
}, function (_ref12) {
|
|
@@ -932,8 +1035,12 @@ var SelectedInnerRadio = styled(PrimitiveView)(_templateObject3$5 || (_templateO
|
|
|
932
1035
|
var theme = _ref14.theme;
|
|
933
1036
|
return theme.kitt.forms.radio.checked.innerSize / 2;
|
|
934
1037
|
});
|
|
935
|
-
var Container$
|
|
936
|
-
|
|
1038
|
+
var Container$4 = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1039
|
+
displayName: "Radio__Container"
|
|
1040
|
+
})(["flex-direction:row;align-items:center;"]);
|
|
1041
|
+
var Text = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
1042
|
+
displayName: "Radio__Text"
|
|
1043
|
+
})(["margin-left:", "px;"], function (_ref15) {
|
|
937
1044
|
var theme = _ref15.theme;
|
|
938
1045
|
return theme.kitt.spacing * 2;
|
|
939
1046
|
});
|
|
@@ -945,7 +1052,7 @@ function Radio(_ref16) {
|
|
|
945
1052
|
_ref16$disabled = _ref16.disabled,
|
|
946
1053
|
disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
|
|
947
1054
|
children = _ref16.children;
|
|
948
|
-
return /*#__PURE__*/
|
|
1055
|
+
return /*#__PURE__*/jsxs(Container$4, {
|
|
949
1056
|
nativeID: id,
|
|
950
1057
|
disabled: disabled,
|
|
951
1058
|
accessibilityRole: "radio",
|
|
@@ -953,29 +1060,37 @@ function Radio(_ref16) {
|
|
|
953
1060
|
focusable: checked && !disabled,
|
|
954
1061
|
onPress: function handlePress() {
|
|
955
1062
|
onChange(value);
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1063
|
+
},
|
|
1064
|
+
children: [checked && !disabled ? /*#__PURE__*/jsx(SelectedOuterRadio, {
|
|
1065
|
+
children: /*#__PURE__*/jsx(SelectedInnerRadio, {})
|
|
1066
|
+
}) : /*#__PURE__*/jsx(OuterRadio, {
|
|
1067
|
+
disabled: disabled
|
|
1068
|
+
}), /*#__PURE__*/jsx(Text, {
|
|
1069
|
+
base: "body",
|
|
1070
|
+
color: disabled ? 'black-light' : 'black',
|
|
1071
|
+
children: children
|
|
1072
|
+
})]
|
|
1073
|
+
});
|
|
963
1074
|
}
|
|
964
1075
|
|
|
1076
|
+
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; }
|
|
1077
|
+
|
|
1078
|
+
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; }
|
|
965
1079
|
function TextArea(_ref) {
|
|
966
1080
|
var props = _extends({}, _ref);
|
|
967
1081
|
|
|
968
|
-
var theme = useTheme();
|
|
969
|
-
return /*#__PURE__*/
|
|
1082
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1083
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$a(_objectSpread$a({
|
|
970
1084
|
multiline: true
|
|
971
|
-
}, props, {
|
|
1085
|
+
}, props), {}, {
|
|
972
1086
|
type: "text",
|
|
973
1087
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
974
1088
|
}));
|
|
975
1089
|
}
|
|
976
1090
|
|
|
977
|
-
var
|
|
978
|
-
|
|
1091
|
+
var Body = /*#__PURE__*/styled.View.withConfig({
|
|
1092
|
+
displayName: "Body"
|
|
1093
|
+
})(["", " background-color:", ";flex:1;"], function (_ref) {
|
|
979
1094
|
var theme = _ref.theme;
|
|
980
1095
|
return theme.responsive.ifWindowSizeMatches({
|
|
981
1096
|
minWidth: KittBreakpoints.MEDIUM
|
|
@@ -986,11 +1101,14 @@ var Body = styled(PrimitiveView)(_templateObject$m || (_templateObject$m = _tagg
|
|
|
986
1101
|
});
|
|
987
1102
|
function FullScreenModalBody(_ref3) {
|
|
988
1103
|
var children = _ref3.children;
|
|
989
|
-
return /*#__PURE__*/
|
|
1104
|
+
return /*#__PURE__*/jsx(Body, {
|
|
1105
|
+
children: children
|
|
1106
|
+
});
|
|
990
1107
|
}
|
|
991
1108
|
|
|
992
|
-
var
|
|
993
|
-
|
|
1109
|
+
var SideContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1110
|
+
displayName: "Header__SideContainer"
|
|
1111
|
+
})(["", ""], function (_ref) {
|
|
994
1112
|
var theme = _ref.theme,
|
|
995
1113
|
_ref$side = _ref.side,
|
|
996
1114
|
side = _ref$side === void 0 ? 'left' : _ref$side;
|
|
@@ -1007,7 +1125,9 @@ function getHeaderHorizontalMediumPadding(spacing) {
|
|
|
1007
1125
|
return spacing * 6;
|
|
1008
1126
|
}
|
|
1009
1127
|
|
|
1010
|
-
var Header = styled(
|
|
1128
|
+
var Header = /*#__PURE__*/styled.View.withConfig({
|
|
1129
|
+
displayName: "Header"
|
|
1130
|
+
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], function (_ref2) {
|
|
1011
1131
|
var theme = _ref2.theme,
|
|
1012
1132
|
_ref2$insetTop = _ref2.insetTop,
|
|
1013
1133
|
insetTop = _ref2$insetTop === void 0 ? 0 : _ref2$insetTop;
|
|
@@ -1022,7 +1142,9 @@ var Header = styled(PrimitiveView)(_templateObject2$8 || (_templateObject2$8 = _
|
|
|
1022
1142
|
var theme = _ref3.theme;
|
|
1023
1143
|
return theme.kitt.fullScreenModal.header.borderColor;
|
|
1024
1144
|
});
|
|
1025
|
-
var HeaderContent = styled(
|
|
1145
|
+
var HeaderContent = /*#__PURE__*/styled.View.withConfig({
|
|
1146
|
+
displayName: "Header__HeaderContent"
|
|
1147
|
+
})(["", ";", ";justify-content:center;align-items:center;"], function (_ref4) {
|
|
1026
1148
|
var theme = _ref4.theme,
|
|
1027
1149
|
leftWidth = _ref4.leftWidth,
|
|
1028
1150
|
rightWidth = _ref4.rightWidth,
|
|
@@ -1087,38 +1209,69 @@ function FullScreenModalHeader(_ref6) {
|
|
|
1087
1209
|
setRightWidth(event.nativeEvent.layout.width);
|
|
1088
1210
|
};
|
|
1089
1211
|
|
|
1090
|
-
return /*#__PURE__*/
|
|
1091
|
-
insetTop: top
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1212
|
+
return /*#__PURE__*/jsxs(Header, {
|
|
1213
|
+
insetTop: Platform.OS === 'ios' ? undefined : top,
|
|
1214
|
+
children: [left ? /*#__PURE__*/jsx(SideContainer, {
|
|
1215
|
+
onLayout: function onLayout(e) {
|
|
1216
|
+
return handleLayoutChange(e, 'left');
|
|
1217
|
+
},
|
|
1218
|
+
children: left
|
|
1219
|
+
}) : null, /*#__PURE__*/jsx(HeaderContent, {
|
|
1220
|
+
windowWidth: dimensions.width,
|
|
1221
|
+
leftWidth: leftWidth,
|
|
1222
|
+
rightWidth: rightWidth,
|
|
1223
|
+
children: children
|
|
1224
|
+
}), right ? /*#__PURE__*/jsx(SideContainer, {
|
|
1225
|
+
side: "right",
|
|
1226
|
+
onLayout: function onLayout(e) {
|
|
1227
|
+
return handleLayoutChange(e, 'right');
|
|
1228
|
+
},
|
|
1229
|
+
children: right
|
|
1230
|
+
}) : null]
|
|
1231
|
+
});
|
|
1106
1232
|
}
|
|
1107
1233
|
|
|
1108
|
-
var
|
|
1109
|
-
|
|
1234
|
+
var Container$3 = /*#__PURE__*/styled.View.withConfig({
|
|
1235
|
+
displayName: "FullScreenModal__Container"
|
|
1236
|
+
})(["flex:1;background-color:", ";"], function (_ref) {
|
|
1110
1237
|
var theme = _ref.theme;
|
|
1111
1238
|
return theme.kitt.colors.uiBackground;
|
|
1112
1239
|
});
|
|
1113
1240
|
function FullScreenModal(_ref2) {
|
|
1114
1241
|
var children = _ref2.children;
|
|
1115
|
-
return /*#__PURE__*/
|
|
1242
|
+
return /*#__PURE__*/jsx(Container$3, {
|
|
1243
|
+
children: children
|
|
1244
|
+
});
|
|
1116
1245
|
}
|
|
1117
1246
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
1118
1247
|
FullScreenModal.Body = FullScreenModalBody;
|
|
1119
1248
|
|
|
1120
|
-
var
|
|
1121
|
-
|
|
1249
|
+
var _excluded$7 = ["as", "children"];
|
|
1250
|
+
|
|
1251
|
+
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; }
|
|
1252
|
+
|
|
1253
|
+
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; }
|
|
1254
|
+
function StyleWebWrapper(_ref) {
|
|
1255
|
+
var as = _ref.as,
|
|
1256
|
+
children = _ref.children,
|
|
1257
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1258
|
+
|
|
1259
|
+
if (Platform.OS !== 'web') return children;
|
|
1260
|
+
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
1261
|
+
return /*#__PURE__*/jsx(as || 'div', _objectSpread$9(_objectSpread$9({}, props), {}, {
|
|
1262
|
+
children: children
|
|
1263
|
+
}));
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
var _excluded$6 = ["color"];
|
|
1267
|
+
|
|
1268
|
+
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; }
|
|
1269
|
+
|
|
1270
|
+
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; }
|
|
1271
|
+
var PressableIconButtonWebWrapper = undefined;
|
|
1272
|
+
var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1273
|
+
displayName: "PressableIconButton__StyledPressableIconButton"
|
|
1274
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref) {
|
|
1122
1275
|
var theme = _ref.theme;
|
|
1123
1276
|
return theme.kitt.iconButton.borderRadius;
|
|
1124
1277
|
}, function (_ref2) {
|
|
@@ -1128,15 +1281,36 @@ var PressableIconButton = styled(PrimitivePressable)(_templateObject$j || (_temp
|
|
|
1128
1281
|
var theme = _ref3.theme;
|
|
1129
1282
|
return theme.kitt.iconButton.height;
|
|
1130
1283
|
}, function (_ref4) {
|
|
1131
|
-
var theme = _ref4.theme
|
|
1132
|
-
_ref4.
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1284
|
+
var theme = _ref4.theme,
|
|
1285
|
+
disabled = _ref4.disabled;
|
|
1286
|
+
var iconButton = theme.kitt.iconButton;
|
|
1287
|
+
|
|
1288
|
+
if (Platform.OS !== 'web') {
|
|
1289
|
+
return undefined;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
var transition = iconButton.transition;
|
|
1293
|
+
|
|
1294
|
+
if (disabled) {
|
|
1295
|
+
return "\n background-color: ".concat(iconButton.disabled.backgroundColor, ";\n ");
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1136
1299
|
});
|
|
1300
|
+
function PressableIconButton(_ref5) {
|
|
1301
|
+
var color = _ref5.color,
|
|
1302
|
+
props = _objectWithoutProperties(_ref5, _excluded$6);
|
|
1303
|
+
|
|
1304
|
+
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1305
|
+
as: PressableIconButtonWebWrapper,
|
|
1306
|
+
"data-color-white": color === 'white' ? true : undefined,
|
|
1307
|
+
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$8({}, props))
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1137
1310
|
|
|
1138
|
-
var
|
|
1139
|
-
|
|
1311
|
+
var AnimatedIconButtonBackground = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
1312
|
+
displayName: "PressableAnimatedContainer__AnimatedIconButtonBackground"
|
|
1313
|
+
})(["background-color:", ";border-radius:", "px;width:", "px;height:", "px;position:absolute;bottom:0;left:0;"], function (_ref) {
|
|
1140
1314
|
var theme = _ref.theme,
|
|
1141
1315
|
color = _ref.color,
|
|
1142
1316
|
disabled = _ref.disabled;
|
|
@@ -1154,14 +1328,16 @@ var AnimatedIconButtonBackground = styled(Animated$1.View)(_templateObject$i ||
|
|
|
1154
1328
|
var theme = _ref4.theme;
|
|
1155
1329
|
return theme.kitt.iconButton.height;
|
|
1156
1330
|
});
|
|
1157
|
-
var AnimatedViewContainer = styled(Animated$1.View)(
|
|
1331
|
+
var AnimatedViewContainer = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
1332
|
+
displayName: "PressableAnimatedContainer__AnimatedViewContainer"
|
|
1333
|
+
})(["position:relative;align-items:center;justify-content:center;width:100%;height:100%;"]);
|
|
1158
1334
|
function PressableAnimatedContainer(_ref5) {
|
|
1159
1335
|
var disabled = _ref5.disabled,
|
|
1160
1336
|
_ref5$color = _ref5.color,
|
|
1161
1337
|
color = _ref5$color === void 0 ? 'black' : _ref5$color,
|
|
1162
1338
|
children = _ref5.children,
|
|
1163
1339
|
onPress = _ref5.onPress;
|
|
1164
|
-
var theme = useTheme();
|
|
1340
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1165
1341
|
var pressed = useSharedValue(false);
|
|
1166
1342
|
var opacityStyles = useAnimatedStyle(function () {
|
|
1167
1343
|
var _f = function () {
|
|
@@ -1176,7 +1352,7 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1176
1352
|
};
|
|
1177
1353
|
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
1178
1354
|
_f.__workletHash = 10645190329247;
|
|
1179
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (
|
|
1355
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (54:41)";
|
|
1180
1356
|
_f.__optimalization = 2;
|
|
1181
1357
|
|
|
1182
1358
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -1210,14 +1386,14 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1210
1386
|
};
|
|
1211
1387
|
_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)}]};}}";
|
|
1212
1388
|
_f.__workletHash = 13861998831411;
|
|
1213
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (
|
|
1389
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:39)";
|
|
1214
1390
|
_f.__optimalization = 2;
|
|
1215
1391
|
|
|
1216
1392
|
global.__reanimatedWorkletInit(_f);
|
|
1217
1393
|
|
|
1218
1394
|
return _f;
|
|
1219
1395
|
}());
|
|
1220
|
-
return /*#__PURE__*/
|
|
1396
|
+
return /*#__PURE__*/jsx(PressableIconButton, {
|
|
1221
1397
|
accessibilityRole: "button",
|
|
1222
1398
|
disabled: disabled,
|
|
1223
1399
|
color: color,
|
|
@@ -1227,24 +1403,27 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1227
1403
|
},
|
|
1228
1404
|
onPressOut: function onPressOut() {
|
|
1229
1405
|
pressed.value = false;
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1406
|
+
},
|
|
1407
|
+
children: /*#__PURE__*/jsxs(AnimatedViewContainer, {
|
|
1408
|
+
style: disabled ? [{
|
|
1409
|
+
transform: [{
|
|
1410
|
+
scale: 1
|
|
1411
|
+
}]
|
|
1412
|
+
}] : [scaleStyles],
|
|
1413
|
+
children: [/*#__PURE__*/jsx(AnimatedIconButtonBackground, {
|
|
1414
|
+
disabled: disabled,
|
|
1415
|
+
color: color,
|
|
1416
|
+
style: disabled ? [{
|
|
1417
|
+
opacity: 1
|
|
1418
|
+
}] : [opacityStyles]
|
|
1419
|
+
}), children]
|
|
1420
|
+
})
|
|
1421
|
+
});
|
|
1244
1422
|
}
|
|
1245
1423
|
|
|
1246
|
-
var
|
|
1247
|
-
|
|
1424
|
+
var IconButtonContentBorder = /*#__PURE__*/styled.View.withConfig({
|
|
1425
|
+
displayName: "IconButton__IconButtonContentBorder"
|
|
1426
|
+
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], function (_ref) {
|
|
1248
1427
|
var theme = _ref.theme;
|
|
1249
1428
|
return "".concat(theme.kitt.iconButton.borderWidth, "px solid");
|
|
1250
1429
|
}, function (_ref2) {
|
|
@@ -1266,12 +1445,13 @@ function IconButtonContent(_ref6) {
|
|
|
1266
1445
|
var disabled = _ref6.disabled,
|
|
1267
1446
|
color = _ref6.color,
|
|
1268
1447
|
icon = _ref6.icon;
|
|
1269
|
-
return /*#__PURE__*/
|
|
1270
|
-
disabled: disabled
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1448
|
+
return /*#__PURE__*/jsx(IconButtonContentBorder, {
|
|
1449
|
+
disabled: disabled,
|
|
1450
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
1451
|
+
color: disabled ? 'black-light' : color,
|
|
1452
|
+
icon: icon
|
|
1453
|
+
})
|
|
1454
|
+
});
|
|
1275
1455
|
}
|
|
1276
1456
|
|
|
1277
1457
|
function IconButton(_ref7) {
|
|
@@ -1279,33 +1459,44 @@ function IconButton(_ref7) {
|
|
|
1279
1459
|
color = _ref7.color,
|
|
1280
1460
|
disabled = _ref7.disabled,
|
|
1281
1461
|
onPress = _ref7.onPress;
|
|
1282
|
-
return /*#__PURE__*/
|
|
1462
|
+
return /*#__PURE__*/jsx(PressableAnimatedContainer, {
|
|
1283
1463
|
color: color,
|
|
1284
1464
|
disabled: disabled,
|
|
1285
|
-
onPress: onPress
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1465
|
+
onPress: onPress,
|
|
1466
|
+
children: /*#__PURE__*/jsx(IconButtonContent, {
|
|
1467
|
+
disabled: disabled,
|
|
1468
|
+
color: color,
|
|
1469
|
+
icon: icon
|
|
1470
|
+
})
|
|
1471
|
+
});
|
|
1291
1472
|
}
|
|
1292
1473
|
|
|
1293
1474
|
var _excluded$5 = ["children"];
|
|
1294
1475
|
|
|
1295
|
-
var
|
|
1296
|
-
|
|
1476
|
+
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; }
|
|
1477
|
+
|
|
1478
|
+
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; }
|
|
1479
|
+
var ContentView$1 = /*#__PURE__*/styled.View.withConfig({
|
|
1480
|
+
displayName: "ListItemContent__ContentView"
|
|
1481
|
+
})(["flex:1 0 0%;align-self:center;"]);
|
|
1297
1482
|
function ListItemContent(_ref) {
|
|
1298
1483
|
var children = _ref.children,
|
|
1299
1484
|
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
1300
1485
|
|
|
1301
|
-
return /*#__PURE__*/
|
|
1486
|
+
return /*#__PURE__*/jsx(ContentView$1, _objectSpread$7(_objectSpread$7({}, rest), {}, {
|
|
1487
|
+
children: children
|
|
1488
|
+
}));
|
|
1302
1489
|
}
|
|
1303
1490
|
|
|
1304
1491
|
var _excluded$4 = ["children", "side"],
|
|
1305
1492
|
_excluded2$1 = ["children", "align"];
|
|
1306
1493
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1494
|
+
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; }
|
|
1495
|
+
|
|
1496
|
+
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; }
|
|
1497
|
+
var SideContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
1498
|
+
displayName: "ListItemSideContent__SideContainerView"
|
|
1499
|
+
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
|
|
1309
1500
|
var theme = _ref.theme,
|
|
1310
1501
|
side = _ref.side;
|
|
1311
1502
|
return side === 'right' ? theme.kitt.listItem.innerMargin : 0;
|
|
@@ -1321,11 +1512,15 @@ function ListItemSideContainer(_ref3) {
|
|
|
1321
1512
|
side = _ref3$side === void 0 ? 'left' : _ref3$side,
|
|
1322
1513
|
rest = _objectWithoutProperties(_ref3, _excluded$4);
|
|
1323
1514
|
|
|
1324
|
-
return /*#__PURE__*/
|
|
1515
|
+
return /*#__PURE__*/jsx(SideContainerView, _objectSpread$6(_objectSpread$6({
|
|
1325
1516
|
side: side
|
|
1326
|
-
}, rest),
|
|
1517
|
+
}, rest), {}, {
|
|
1518
|
+
children: children
|
|
1519
|
+
}));
|
|
1327
1520
|
}
|
|
1328
|
-
var SideContentView = styled(
|
|
1521
|
+
var SideContentView = /*#__PURE__*/styled.View.withConfig({
|
|
1522
|
+
displayName: "ListItemSideContent__SideContentView"
|
|
1523
|
+
})(["align-self:", ";"], function (_ref4) {
|
|
1329
1524
|
var align = _ref4.align;
|
|
1330
1525
|
return align;
|
|
1331
1526
|
});
|
|
@@ -1335,19 +1530,21 @@ function ListItemSideContent(_ref5) {
|
|
|
1335
1530
|
align = _ref5$align === void 0 ? 'auto' : _ref5$align,
|
|
1336
1531
|
rest = _objectWithoutProperties(_ref5, _excluded2$1);
|
|
1337
1532
|
|
|
1338
|
-
return /*#__PURE__*/
|
|
1533
|
+
return /*#__PURE__*/jsx(SideContentView, _objectSpread$6(_objectSpread$6({
|
|
1339
1534
|
align: align
|
|
1340
|
-
}, rest),
|
|
1535
|
+
}, rest), {}, {
|
|
1536
|
+
children: children
|
|
1537
|
+
}));
|
|
1341
1538
|
}
|
|
1342
1539
|
|
|
1343
1540
|
var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
|
|
1344
1541
|
|
|
1345
|
-
var
|
|
1346
|
-
|
|
1347
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1542
|
+
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; }
|
|
1348
1543
|
|
|
1349
|
-
function _objectSpread$
|
|
1350
|
-
var ContainerView = styled(
|
|
1544
|
+
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; }
|
|
1545
|
+
var ContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
1546
|
+
displayName: "ListItem__ContainerView"
|
|
1547
|
+
})(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], function (_ref) {
|
|
1351
1548
|
var withPadding = _ref.withPadding,
|
|
1352
1549
|
theme = _ref.theme;
|
|
1353
1550
|
return withPadding ? theme.kitt.listItem.padding : 0;
|
|
@@ -1385,27 +1582,36 @@ function ListItem(_ref5) {
|
|
|
1385
1582
|
onPress = _ref5.onPress,
|
|
1386
1583
|
rest = _objectWithoutProperties(_ref5, _excluded$3);
|
|
1387
1584
|
|
|
1388
|
-
var Wrapper = onPress ?
|
|
1389
|
-
var wrapperProps = onPress ? _objectSpread$
|
|
1585
|
+
var Wrapper = onPress ? Pressable : Fragment;
|
|
1586
|
+
var wrapperProps = onPress ? _objectSpread$5({
|
|
1390
1587
|
accessibilityRole: 'button',
|
|
1391
1588
|
onPress: onPress
|
|
1392
1589
|
}, rest) : undefined;
|
|
1393
1590
|
var containerProps = onPress ? undefined : rest;
|
|
1394
|
-
return /*#__PURE__*/
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1591
|
+
return /*#__PURE__*/jsx(Wrapper, _objectSpread$5(_objectSpread$5({}, wrapperProps), {}, {
|
|
1592
|
+
children: /*#__PURE__*/jsxs(ContainerView, _objectSpread$5(_objectSpread$5({
|
|
1593
|
+
withPadding: withPadding,
|
|
1594
|
+
borders: borders
|
|
1595
|
+
}, containerProps), {}, {
|
|
1596
|
+
children: [left ? /*#__PURE__*/jsx(ListItemSideContainer, {
|
|
1597
|
+
side: "left",
|
|
1598
|
+
children: left
|
|
1599
|
+
}) : null, /*#__PURE__*/jsx(ListItemContent, {
|
|
1600
|
+
children: children
|
|
1601
|
+
}), right ? /*#__PURE__*/jsx(ListItemSideContainer, {
|
|
1602
|
+
side: "right",
|
|
1603
|
+
children: right
|
|
1604
|
+
}) : null]
|
|
1605
|
+
}))
|
|
1606
|
+
}));
|
|
1402
1607
|
}
|
|
1403
1608
|
ListItem.Content = ListItemContent;
|
|
1404
1609
|
ListItem.SideContent = ListItemSideContent;
|
|
1405
1610
|
ListItem.SideContainer = ListItemSideContainer;
|
|
1406
1611
|
|
|
1407
1612
|
function getActivityIndicatorSize(size) {
|
|
1408
|
-
return size;
|
|
1613
|
+
if (Platform.OS === 'android') return size;
|
|
1614
|
+
return size < 36 ? 'small' : 'large';
|
|
1409
1615
|
}
|
|
1410
1616
|
|
|
1411
1617
|
function Loader(_ref) {
|
|
@@ -1413,9 +1619,9 @@ function Loader(_ref) {
|
|
|
1413
1619
|
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
1414
1620
|
_ref$size = _ref.size,
|
|
1415
1621
|
size = _ref$size === void 0 ? 20 : _ref$size;
|
|
1416
|
-
var theme = useTheme();
|
|
1622
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1417
1623
|
var colorHex = theme.kitt.typography.colors[color];
|
|
1418
|
-
return /*#__PURE__*/
|
|
1624
|
+
return /*#__PURE__*/jsx(ActivityIndicator, {
|
|
1419
1625
|
testID: "ActivityIndicator",
|
|
1420
1626
|
color: colorHex,
|
|
1421
1627
|
size: getActivityIndicatorSize(size)
|
|
@@ -1425,16 +1631,17 @@ function Loader(_ref) {
|
|
|
1425
1631
|
function LargeLoader(_ref) {
|
|
1426
1632
|
var _ref$color = _ref.color,
|
|
1427
1633
|
color = _ref$color === void 0 ? 'primary' : _ref$color;
|
|
1428
|
-
return /*#__PURE__*/
|
|
1634
|
+
return /*#__PURE__*/jsx(Loader, {
|
|
1429
1635
|
color: color,
|
|
1430
1636
|
size: 60
|
|
1431
1637
|
});
|
|
1432
1638
|
}
|
|
1433
1639
|
|
|
1434
|
-
var _templateObject$d, _templateObject2$5, _templateObject3$3, _templateObject4$3;
|
|
1435
1640
|
var xIconSize = 14;
|
|
1436
1641
|
var mainIconSize = 20;
|
|
1437
|
-
var Container$
|
|
1642
|
+
var Container$2 = /*#__PURE__*/styled.View.withConfig({
|
|
1643
|
+
displayName: "Message__Container"
|
|
1644
|
+
})(["border-radius:", "px;background-color:", ";padding-bottom:", "px;padding-left:", "px;padding-right:", "px;padding-top:", "px;flex-direction:row;align-items:flex-start;justify-content:space-between;"], function (_ref) {
|
|
1438
1645
|
var theme = _ref.theme,
|
|
1439
1646
|
noRadius = _ref.noRadius;
|
|
1440
1647
|
return noRadius ? 0 : theme.kitt.spacing * 5;
|
|
@@ -1458,18 +1665,24 @@ var Container$1 = styled(PrimitiveView)(_templateObject$d || (_templateObject$d
|
|
|
1458
1665
|
insets = _ref6.insets;
|
|
1459
1666
|
return ((_insets$top = insets === null || insets === void 0 ? void 0 : insets.top) !== null && _insets$top !== void 0 ? _insets$top : 0) + theme.kitt.spacing * 4;
|
|
1460
1667
|
});
|
|
1461
|
-
var CloseContainer = styled(TouchableOpacity)(
|
|
1668
|
+
var CloseContainer = /*#__PURE__*/styled(TouchableOpacity).withConfig({
|
|
1669
|
+
displayName: "Message__CloseContainer"
|
|
1670
|
+
})(["margin-left:", "px;padding:", "px;"], function (_ref7) {
|
|
1462
1671
|
var theme = _ref7.theme;
|
|
1463
1672
|
return theme.kitt.spacing * 4;
|
|
1464
1673
|
}, function (_ref8) {
|
|
1465
1674
|
var theme = _ref8.theme;
|
|
1466
1675
|
return theme.kitt.spacing;
|
|
1467
1676
|
});
|
|
1468
|
-
var IconContainer = styled(
|
|
1677
|
+
var IconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1678
|
+
displayName: "Message__IconContainer"
|
|
1679
|
+
})(["margin-right:", "px;"], function (_ref9) {
|
|
1469
1680
|
var theme = _ref9.theme;
|
|
1470
1681
|
return theme.kitt.spacing * 4;
|
|
1471
1682
|
});
|
|
1472
|
-
var Content = styled(
|
|
1683
|
+
var Content = /*#__PURE__*/styled.Text.withConfig({
|
|
1684
|
+
displayName: "Message__Content"
|
|
1685
|
+
})(["text-align:", ";flex:1;"], function (_ref10) {
|
|
1473
1686
|
var centeredText = _ref10.centeredText;
|
|
1474
1687
|
return centeredText ? 'center' : 'left';
|
|
1475
1688
|
});
|
|
@@ -1491,16 +1704,16 @@ var getColorByType = function (type) {
|
|
|
1491
1704
|
function getIconContent(type) {
|
|
1492
1705
|
switch (type) {
|
|
1493
1706
|
case 'warning':
|
|
1494
|
-
return /*#__PURE__*/
|
|
1707
|
+
return /*#__PURE__*/jsx(AlertCircleIcon, {});
|
|
1495
1708
|
|
|
1496
1709
|
case 'success':
|
|
1497
|
-
return /*#__PURE__*/
|
|
1710
|
+
return /*#__PURE__*/jsx(CheckIcon, {});
|
|
1498
1711
|
|
|
1499
1712
|
case 'danger':
|
|
1500
|
-
return /*#__PURE__*/
|
|
1713
|
+
return /*#__PURE__*/jsx(AlertTriangleIcon, {});
|
|
1501
1714
|
|
|
1502
1715
|
default:
|
|
1503
|
-
return /*#__PURE__*/
|
|
1716
|
+
return /*#__PURE__*/jsx(InfoIcon, {});
|
|
1504
1717
|
}
|
|
1505
1718
|
}
|
|
1506
1719
|
|
|
@@ -1515,50 +1728,59 @@ function Message(_ref11) {
|
|
|
1515
1728
|
onDismiss = _ref11.onDismiss,
|
|
1516
1729
|
insets = _ref11.insets;
|
|
1517
1730
|
var color = getColorByType(type);
|
|
1518
|
-
return /*#__PURE__*/
|
|
1731
|
+
return /*#__PURE__*/jsxs(Container$2, {
|
|
1519
1732
|
type: type,
|
|
1520
1733
|
noRadius: noRadius,
|
|
1521
|
-
insets: insets
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1734
|
+
insets: insets,
|
|
1735
|
+
children: [!centeredText ? /*#__PURE__*/jsx(IconContainer, {
|
|
1736
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
1737
|
+
size: mainIconSize,
|
|
1738
|
+
color: color,
|
|
1739
|
+
icon: getIconContent(type)
|
|
1740
|
+
})
|
|
1741
|
+
}) : null, /*#__PURE__*/jsx(Content, {
|
|
1742
|
+
type: type,
|
|
1743
|
+
centeredText: centeredText,
|
|
1744
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
1745
|
+
base: "body-small",
|
|
1746
|
+
color: color,
|
|
1747
|
+
children: children
|
|
1748
|
+
})
|
|
1749
|
+
}), onDismiss ? /*#__PURE__*/jsx(CloseContainer, {
|
|
1750
|
+
onPress: onDismiss,
|
|
1751
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
1752
|
+
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
1753
|
+
size: xIconSize,
|
|
1754
|
+
color: color
|
|
1755
|
+
})
|
|
1756
|
+
}) : null]
|
|
1757
|
+
});
|
|
1539
1758
|
}
|
|
1540
1759
|
|
|
1541
|
-
function ownKeys(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; }
|
|
1760
|
+
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1542
1761
|
|
|
1543
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1544
|
-
|
|
1762
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1763
|
+
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
1764
|
+
var OverlayPressable = /*#__PURE__*/styled(Pressable).withConfig({
|
|
1765
|
+
displayName: "Overlay__OverlayPressable"
|
|
1766
|
+
})(function (_ref) {
|
|
1545
1767
|
var theme = _ref.theme;
|
|
1546
|
-
return _objectSpread(_objectSpread({}, StyleSheet.absoluteFillObject), {}, {
|
|
1768
|
+
return _objectSpread$4(_objectSpread$4({}, StyleSheet.absoluteFillObject), {}, {
|
|
1547
1769
|
backgroundColor: theme.kitt.colors.overlay.dark
|
|
1548
1770
|
});
|
|
1549
1771
|
});
|
|
1550
1772
|
function Overlay(_ref2) {
|
|
1551
1773
|
var onPress = _ref2.onPress;
|
|
1552
|
-
return /*#__PURE__*/
|
|
1774
|
+
return /*#__PURE__*/jsx(OverlayPressable, {
|
|
1553
1775
|
accessibilityRole: "none",
|
|
1554
|
-
onPress: onPress
|
|
1555
|
-
|
|
1776
|
+
onPress: onPress,
|
|
1777
|
+
children: /*#__PURE__*/jsx(View, {})
|
|
1778
|
+
});
|
|
1556
1779
|
}
|
|
1557
1780
|
|
|
1558
|
-
var
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
var BodyView = styled(PrimitiveView)(_templateObject$c || (_templateObject$c = _taggedTemplateLiteral(["\n padding: ", "px ", "px;\n"])), function (_ref) {
|
|
1781
|
+
var BodyView = /*#__PURE__*/styled.View.withConfig({
|
|
1782
|
+
displayName: "Body__BodyView"
|
|
1783
|
+
})(["padding:", "px ", "px;"], function (_ref) {
|
|
1562
1784
|
var theme = _ref.theme;
|
|
1563
1785
|
return theme.kitt.spacing * 6;
|
|
1564
1786
|
}, function (_ref2) {
|
|
@@ -1567,11 +1789,16 @@ var BodyView = styled(PrimitiveView)(_templateObject$c || (_templateObject$c = _
|
|
|
1567
1789
|
});
|
|
1568
1790
|
function ModalBody(_ref3) {
|
|
1569
1791
|
var children = _ref3.children;
|
|
1570
|
-
return /*#__PURE__*/
|
|
1792
|
+
return /*#__PURE__*/jsx(ScrollView, {
|
|
1793
|
+
children: /*#__PURE__*/jsx(BodyView, {
|
|
1794
|
+
children: children
|
|
1795
|
+
})
|
|
1796
|
+
});
|
|
1571
1797
|
}
|
|
1572
1798
|
|
|
1573
|
-
var
|
|
1574
|
-
|
|
1799
|
+
var FooterView = /*#__PURE__*/styled.View.withConfig({
|
|
1800
|
+
displayName: "Footer__FooterView"
|
|
1801
|
+
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], function (_ref) {
|
|
1575
1802
|
var theme = _ref.theme;
|
|
1576
1803
|
return theme.kitt.spacing * 4;
|
|
1577
1804
|
}, function (_ref2) {
|
|
@@ -1580,28 +1807,37 @@ var FooterView = styled(PrimitiveView)(_templateObject$b || (_templateObject$b =
|
|
|
1580
1807
|
});
|
|
1581
1808
|
function ModalFooter(_ref3) {
|
|
1582
1809
|
var children = _ref3.children;
|
|
1583
|
-
return /*#__PURE__*/
|
|
1810
|
+
return /*#__PURE__*/jsx(FooterView, {
|
|
1811
|
+
children: children
|
|
1812
|
+
});
|
|
1584
1813
|
}
|
|
1585
1814
|
|
|
1586
1815
|
var OnCloseContext = /*#__PURE__*/createContext(function () {});
|
|
1587
1816
|
|
|
1588
|
-
var
|
|
1589
|
-
|
|
1817
|
+
var HeaderView = /*#__PURE__*/styled.View.withConfig({
|
|
1818
|
+
displayName: "Header__HeaderView"
|
|
1819
|
+
})(["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) {
|
|
1590
1820
|
var theme = _ref.theme;
|
|
1591
1821
|
return theme.kitt.spacing * 2;
|
|
1592
1822
|
}, function (_ref2) {
|
|
1593
1823
|
var theme = _ref2.theme;
|
|
1594
1824
|
return theme.kitt.colors.separator;
|
|
1595
1825
|
});
|
|
1596
|
-
var LeftIconView = styled(
|
|
1826
|
+
var LeftIconView = /*#__PURE__*/styled.View.withConfig({
|
|
1827
|
+
displayName: "Header__LeftIconView"
|
|
1828
|
+
})(["align-self:flex-start;margin-right:", "px;"], function (_ref3) {
|
|
1597
1829
|
var theme = _ref3.theme;
|
|
1598
1830
|
return theme.kitt.spacing * 2;
|
|
1599
1831
|
});
|
|
1600
|
-
var RightIconView = styled(
|
|
1832
|
+
var RightIconView = /*#__PURE__*/styled.View.withConfig({
|
|
1833
|
+
displayName: "Header__RightIconView"
|
|
1834
|
+
})(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
|
|
1601
1835
|
var theme = _ref4.theme;
|
|
1602
1836
|
return theme.kitt.spacing * 2;
|
|
1603
1837
|
});
|
|
1604
|
-
var TitleView = styled(
|
|
1838
|
+
var TitleView = /*#__PURE__*/styled.View.withConfig({
|
|
1839
|
+
displayName: "Header__TitleView"
|
|
1840
|
+
})(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
|
|
1605
1841
|
var theme = _ref5.theme,
|
|
1606
1842
|
isIconLeft = _ref5.isIconLeft;
|
|
1607
1843
|
return isIconLeft ? 0 : theme.kitt.spacing * 2;
|
|
@@ -1612,24 +1848,34 @@ function ModalHeader(_ref6) {
|
|
|
1612
1848
|
children = _ref6.children;
|
|
1613
1849
|
var onClose = useContext(OnCloseContext);
|
|
1614
1850
|
var isIconLeft = !!left;
|
|
1615
|
-
return /*#__PURE__*/
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1851
|
+
return /*#__PURE__*/jsxs(HeaderView, {
|
|
1852
|
+
children: [isIconLeft && /*#__PURE__*/jsx(LeftIconView, {
|
|
1853
|
+
children: left
|
|
1854
|
+
}), /*#__PURE__*/jsx(TitleView, {
|
|
1855
|
+
isIconLeft: isIconLeft,
|
|
1856
|
+
children: children
|
|
1857
|
+
}), right !== undefined ? right : /*#__PURE__*/jsx(RightIconView, {
|
|
1858
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
1859
|
+
type: "subtle-dark",
|
|
1860
|
+
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
1861
|
+
onPress: onClose
|
|
1862
|
+
})
|
|
1863
|
+
})]
|
|
1864
|
+
});
|
|
1622
1865
|
}
|
|
1623
1866
|
|
|
1624
|
-
var
|
|
1625
|
-
|
|
1867
|
+
var ModalView = /*#__PURE__*/styled.View.withConfig({
|
|
1868
|
+
displayName: "Modal__ModalView"
|
|
1869
|
+
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], function (_ref) {
|
|
1626
1870
|
var theme = _ref.theme;
|
|
1627
1871
|
return theme.kitt.spacing * 20;
|
|
1628
1872
|
}, function (_ref2) {
|
|
1629
1873
|
var theme = _ref2.theme;
|
|
1630
1874
|
return theme.kitt.spacing * 4;
|
|
1631
1875
|
});
|
|
1632
|
-
var ContentView = styled(
|
|
1876
|
+
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
1877
|
+
displayName: "Modal__ContentView"
|
|
1878
|
+
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", ";background-color:", ";"], function (_ref3) {
|
|
1633
1879
|
var theme = _ref3.theme;
|
|
1634
1880
|
return theme.kitt.card.borderRadius;
|
|
1635
1881
|
}, function (_ref4) {
|
|
@@ -1642,18 +1888,24 @@ function Modal(_ref5) {
|
|
|
1642
1888
|
onClose = _ref5.onClose,
|
|
1643
1889
|
onEntered = _ref5.onEntered,
|
|
1644
1890
|
onExited = _ref5.onExited;
|
|
1645
|
-
return /*#__PURE__*/
|
|
1646
|
-
value: onClose
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1891
|
+
return /*#__PURE__*/jsx(OnCloseContext.Provider, {
|
|
1892
|
+
value: onClose,
|
|
1893
|
+
children: /*#__PURE__*/jsx(Modal$1, {
|
|
1894
|
+
transparent: true,
|
|
1895
|
+
animationType: "fade",
|
|
1896
|
+
visible: visible,
|
|
1897
|
+
onShow: onEntered,
|
|
1898
|
+
onDismiss: onExited,
|
|
1899
|
+
onRequestClose: onClose,
|
|
1900
|
+
children: /*#__PURE__*/jsxs(ModalView, {
|
|
1901
|
+
children: [/*#__PURE__*/jsx(Overlay, {
|
|
1902
|
+
onPress: onClose
|
|
1903
|
+
}), /*#__PURE__*/jsx(ContentView, {
|
|
1904
|
+
children: children
|
|
1905
|
+
})]
|
|
1906
|
+
})
|
|
1907
|
+
})
|
|
1908
|
+
});
|
|
1657
1909
|
}
|
|
1658
1910
|
Modal.Header = ModalHeader;
|
|
1659
1911
|
Modal.Body = ModalBody;
|
|
@@ -1668,25 +1920,25 @@ function Notification(_ref) {
|
|
|
1668
1920
|
var _useSafeAreaInsets = useSafeAreaInsets(),
|
|
1669
1921
|
top = _useSafeAreaInsets.top;
|
|
1670
1922
|
|
|
1671
|
-
return /*#__PURE__*/
|
|
1923
|
+
return /*#__PURE__*/jsx(Message, {
|
|
1672
1924
|
noRadius: true,
|
|
1673
1925
|
type: type,
|
|
1674
1926
|
centeredText: centeredText,
|
|
1675
1927
|
insets: {
|
|
1676
1928
|
top: top
|
|
1677
1929
|
},
|
|
1678
|
-
onDismiss: onDelete
|
|
1679
|
-
|
|
1930
|
+
onDismiss: onDelete,
|
|
1931
|
+
children: children
|
|
1932
|
+
});
|
|
1680
1933
|
}
|
|
1681
1934
|
|
|
1682
|
-
var
|
|
1683
|
-
|
|
1684
|
-
var _templateObject$8;
|
|
1685
|
-
var Flex = styled(PrimitiveView).withConfig({
|
|
1935
|
+
var Flex = /*#__PURE__*/styled.View.withConfig({
|
|
1686
1936
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
1687
1937
|
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
1688
1938
|
}
|
|
1689
|
-
})(
|
|
1939
|
+
}).withConfig({
|
|
1940
|
+
displayName: "Flex"
|
|
1941
|
+
})(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], function (_ref) {
|
|
1690
1942
|
var direction = _ref.direction;
|
|
1691
1943
|
return direction;
|
|
1692
1944
|
}, function (_ref2) {
|
|
@@ -1698,8 +1950,6 @@ var Flex = styled(PrimitiveView).withConfig({
|
|
|
1698
1950
|
|
|
1699
1951
|
var storyPadding = 16;
|
|
1700
1952
|
|
|
1701
|
-
var _templateObject$7;
|
|
1702
|
-
|
|
1703
1953
|
var getBackgroundColorFromBlockColor = function (theme) {
|
|
1704
1954
|
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'transparent';
|
|
1705
1955
|
|
|
@@ -1738,7 +1988,9 @@ var useStoryBlockColor = function (color) {
|
|
|
1738
1988
|
var storyBlockColor = useContext(StoryBlockColorContext);
|
|
1739
1989
|
return color || storyBlockColor;
|
|
1740
1990
|
};
|
|
1741
|
-
var StyledStoryBlockView = styled(
|
|
1991
|
+
var StyledStoryBlockView = /*#__PURE__*/styled.View.withConfig({
|
|
1992
|
+
displayName: "StoryBlock__StyledStoryBlockView"
|
|
1993
|
+
})(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, function (_ref) {
|
|
1742
1994
|
var theme = _ref.theme,
|
|
1743
1995
|
background = _ref.background;
|
|
1744
1996
|
return getBackgroundColorFromBlockColor(theme, background);
|
|
@@ -1746,40 +1998,52 @@ var StyledStoryBlockView = styled(PrimitiveView)(_templateObject$7 || (_template
|
|
|
1746
1998
|
function StoryBlock(_ref2) {
|
|
1747
1999
|
var children = _ref2.children,
|
|
1748
2000
|
background = _ref2.background;
|
|
1749
|
-
return /*#__PURE__*/
|
|
1750
|
-
background: background
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
2001
|
+
return /*#__PURE__*/jsx(StyledStoryBlockView, {
|
|
2002
|
+
background: background,
|
|
2003
|
+
children: /*#__PURE__*/jsx(StoryBlockColorContext.Provider, {
|
|
2004
|
+
value: getTypographyColorFromBlockColor(background),
|
|
2005
|
+
children: /*#__PURE__*/jsx(StoryBlockBackgroundContext.Provider, {
|
|
2006
|
+
value: background,
|
|
2007
|
+
children: children
|
|
2008
|
+
})
|
|
2009
|
+
})
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
var StoryTitleContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2014
|
+
displayName: "StoryTitle__StoryTitleContainer"
|
|
2015
|
+
})(["margin-bottom:30px;"]);
|
|
2016
|
+
var StorySubTitleContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2017
|
+
displayName: "StoryTitle__StorySubTitleContainer"
|
|
2018
|
+
})(["margin-bottom:10px;"]);
|
|
1761
2019
|
function StoryTitle(_ref) {
|
|
1762
2020
|
var color = _ref.color,
|
|
1763
2021
|
children = _ref.children,
|
|
1764
2022
|
numberOfLines = _ref.numberOfLines;
|
|
1765
|
-
return /*#__PURE__*/
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
2023
|
+
return /*#__PURE__*/jsx(StoryTitleContainer, {
|
|
2024
|
+
children: /*#__PURE__*/jsx(Typography.Header1, {
|
|
2025
|
+
variant: "bold",
|
|
2026
|
+
base: "header1",
|
|
2027
|
+
color: useStoryBlockColor(color),
|
|
2028
|
+
numberOfLines: numberOfLines,
|
|
2029
|
+
children: children
|
|
2030
|
+
})
|
|
2031
|
+
});
|
|
1771
2032
|
}
|
|
1772
2033
|
|
|
1773
2034
|
function StoryTitleLevel2(_ref2) {
|
|
1774
2035
|
var color = _ref2.color,
|
|
1775
2036
|
children = _ref2.children,
|
|
1776
2037
|
numberOfLines = _ref2.numberOfLines;
|
|
1777
|
-
return /*#__PURE__*/
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
2038
|
+
return /*#__PURE__*/jsx(StoryTitleContainer, {
|
|
2039
|
+
children: /*#__PURE__*/jsx(Typography.Header2, {
|
|
2040
|
+
variant: "bold",
|
|
2041
|
+
base: "header2",
|
|
2042
|
+
color: useStoryBlockColor(color),
|
|
2043
|
+
numberOfLines: numberOfLines,
|
|
2044
|
+
children: children
|
|
2045
|
+
})
|
|
2046
|
+
});
|
|
1783
2047
|
}
|
|
1784
2048
|
|
|
1785
2049
|
StoryTitleLevel2.displayName = 'StoryTitle.Level2';
|
|
@@ -1788,13 +2052,16 @@ function StoryTitleLevel3(_ref3) {
|
|
|
1788
2052
|
var color = _ref3.color,
|
|
1789
2053
|
children = _ref3.children,
|
|
1790
2054
|
numberOfLines = _ref3.numberOfLines;
|
|
1791
|
-
return /*#__PURE__*/
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
2055
|
+
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
2056
|
+
children: /*#__PURE__*/jsx(Typography.Header3, {
|
|
2057
|
+
variant: "bold",
|
|
2058
|
+
base: "header3",
|
|
2059
|
+
medium: "header4",
|
|
2060
|
+
color: useStoryBlockColor(color),
|
|
2061
|
+
numberOfLines: numberOfLines,
|
|
2062
|
+
children: children
|
|
2063
|
+
})
|
|
2064
|
+
});
|
|
1798
2065
|
}
|
|
1799
2066
|
|
|
1800
2067
|
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
@@ -1803,13 +2070,16 @@ function StoryTitleLevel4(_ref4) {
|
|
|
1803
2070
|
var color = _ref4.color,
|
|
1804
2071
|
children = _ref4.children,
|
|
1805
2072
|
numberOfLines = _ref4.numberOfLines;
|
|
1806
|
-
return /*#__PURE__*/
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
2073
|
+
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
2074
|
+
children: /*#__PURE__*/jsx(Typography.Header4, {
|
|
2075
|
+
variant: "bold",
|
|
2076
|
+
base: "header4",
|
|
2077
|
+
medium: "header5",
|
|
2078
|
+
color: useStoryBlockColor(color),
|
|
2079
|
+
numberOfLines: numberOfLines,
|
|
2080
|
+
children: children
|
|
2081
|
+
})
|
|
2082
|
+
});
|
|
1813
2083
|
}
|
|
1814
2084
|
|
|
1815
2085
|
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
@@ -1817,63 +2087,89 @@ StoryTitle.Level2 = StoryTitleLevel2;
|
|
|
1817
2087
|
StoryTitle.Level3 = StoryTitleLevel3;
|
|
1818
2088
|
StoryTitle.Level4 = StoryTitleLevel4;
|
|
1819
2089
|
|
|
1820
|
-
var
|
|
1821
|
-
|
|
2090
|
+
var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
|
|
2091
|
+
displayName: "Story__StoryContainer"
|
|
2092
|
+
})(["padding:", "px;"], storyPadding);
|
|
1822
2093
|
function Story(_ref) {
|
|
1823
2094
|
var title = _ref.title,
|
|
1824
2095
|
contentContainerStyle = _ref.contentContainerStyle,
|
|
1825
2096
|
children = _ref.children;
|
|
1826
|
-
return /*#__PURE__*/
|
|
1827
|
-
contentContainerStyle: contentContainerStyle
|
|
1828
|
-
|
|
2097
|
+
return /*#__PURE__*/jsxs(StoryContainer$1, {
|
|
2098
|
+
contentContainerStyle: contentContainerStyle,
|
|
2099
|
+
children: [/*#__PURE__*/jsx(StoryTitle, {
|
|
2100
|
+
children: title
|
|
2101
|
+
}), children]
|
|
2102
|
+
});
|
|
1829
2103
|
}
|
|
1830
2104
|
|
|
1831
|
-
var _excluded$2 = ["title", "
|
|
1832
|
-
_excluded2 = ["title", "
|
|
1833
|
-
_excluded3 = ["title", "
|
|
2105
|
+
var _excluded$2 = ["title", "children", "internalIsDemoSection"],
|
|
2106
|
+
_excluded2 = ["title", "children"],
|
|
2107
|
+
_excluded3 = ["title", "children"];
|
|
2108
|
+
|
|
2109
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1834
2110
|
|
|
1835
|
-
var
|
|
1836
|
-
var StyledSection = styled(
|
|
2111
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2112
|
+
var StyledSection = /*#__PURE__*/styled.View.withConfig({
|
|
2113
|
+
displayName: "StorySection__StyledSection"
|
|
2114
|
+
})(["margin-bottom:32px;"]);
|
|
1837
2115
|
function StorySection(_ref) {
|
|
1838
|
-
var title = _ref.title
|
|
1839
|
-
_ref.
|
|
1840
|
-
var children = _ref.children,
|
|
2116
|
+
var title = _ref.title,
|
|
2117
|
+
children = _ref.children,
|
|
1841
2118
|
internalIsDemoSection = _ref.internalIsDemoSection,
|
|
1842
2119
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1843
2120
|
|
|
1844
2121
|
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
1845
|
-
return /*#__PURE__*/
|
|
2122
|
+
return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2123
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
|
|
2124
|
+
children: title
|
|
2125
|
+
}), children]
|
|
2126
|
+
}));
|
|
1846
2127
|
}
|
|
1847
|
-
var StyledSubSection = styled(
|
|
2128
|
+
var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
|
|
2129
|
+
displayName: "StorySection__StyledSubSection"
|
|
2130
|
+
})(["margin-bottom:16px;"]);
|
|
1848
2131
|
|
|
1849
2132
|
function SubSection(_ref2) {
|
|
1850
|
-
var title = _ref2.title
|
|
1851
|
-
_ref2.
|
|
1852
|
-
var children = _ref2.children,
|
|
2133
|
+
var title = _ref2.title,
|
|
2134
|
+
children = _ref2.children,
|
|
1853
2135
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
1854
2136
|
|
|
1855
|
-
return /*#__PURE__*/
|
|
2137
|
+
return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2138
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
|
|
2139
|
+
children: title
|
|
2140
|
+
}), children]
|
|
2141
|
+
}));
|
|
1856
2142
|
}
|
|
1857
2143
|
|
|
1858
|
-
var StyledBlockSection = styled(
|
|
2144
|
+
var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
|
|
2145
|
+
displayName: "StorySection__StyledBlockSection"
|
|
2146
|
+
})(["margin-bottom:16px;"]);
|
|
1859
2147
|
|
|
1860
2148
|
function BlockSection(_ref3) {
|
|
1861
|
-
var title = _ref3.title
|
|
1862
|
-
_ref3.
|
|
1863
|
-
var children = _ref3.children,
|
|
2149
|
+
var title = _ref3.title,
|
|
2150
|
+
children = _ref3.children,
|
|
1864
2151
|
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
1865
2152
|
|
|
1866
|
-
return /*#__PURE__*/
|
|
2153
|
+
return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2154
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
2155
|
+
children: title
|
|
2156
|
+
}), children]
|
|
2157
|
+
}));
|
|
1867
2158
|
}
|
|
1868
2159
|
|
|
1869
|
-
var StyledDemoSection = styled(
|
|
2160
|
+
var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
|
|
2161
|
+
displayName: "StorySection__StyledDemoSection"
|
|
2162
|
+
})(["margin-bottom:64px;"]);
|
|
1870
2163
|
|
|
1871
2164
|
function DemoSection(_ref4) {
|
|
1872
2165
|
var children = _ref4.children;
|
|
1873
|
-
return /*#__PURE__*/
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
2166
|
+
return /*#__PURE__*/jsx(StyledDemoSection, {
|
|
2167
|
+
children: /*#__PURE__*/jsx(StorySection, {
|
|
2168
|
+
internalIsDemoSection: true,
|
|
2169
|
+
title: "Demo",
|
|
2170
|
+
children: children
|
|
2171
|
+
})
|
|
2172
|
+
});
|
|
1877
2173
|
}
|
|
1878
2174
|
|
|
1879
2175
|
StorySection.SubSection = SubSection;
|
|
@@ -1894,23 +2190,32 @@ function StoryContainer(_ref) {
|
|
|
1894
2190
|
_ref$platform = _ref.platform,
|
|
1895
2191
|
platform = _ref$platform === void 0 ? 'all' : _ref$platform;
|
|
1896
2192
|
if (platform === 'web') return null;
|
|
1897
|
-
return /*#__PURE__*/
|
|
2193
|
+
return /*#__PURE__*/jsx(StorySection.BlockSection, {
|
|
1898
2194
|
testID: state,
|
|
1899
|
-
title: title
|
|
1900
|
-
|
|
2195
|
+
title: title,
|
|
2196
|
+
children: children
|
|
2197
|
+
});
|
|
1901
2198
|
}
|
|
1902
2199
|
|
|
1903
2200
|
function StoryDecorator(storyFn, context) {
|
|
1904
|
-
return /*#__PURE__*/
|
|
1905
|
-
title: context.name
|
|
1906
|
-
|
|
2201
|
+
return /*#__PURE__*/jsx(Story, {
|
|
2202
|
+
title: context.name,
|
|
2203
|
+
children: storyFn()
|
|
2204
|
+
});
|
|
1907
2205
|
}
|
|
1908
2206
|
|
|
1909
|
-
var
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
var
|
|
1913
|
-
|
|
2207
|
+
var SmallScreenRow = /*#__PURE__*/styled.View.withConfig({
|
|
2208
|
+
displayName: "StoryGrid__SmallScreenRow"
|
|
2209
|
+
})(["flex-direction:column;margin:0;"]);
|
|
2210
|
+
var SmallScreenCol = /*#__PURE__*/styled.View.withConfig({
|
|
2211
|
+
displayName: "StoryGrid__SmallScreenCol"
|
|
2212
|
+
})(["padding:8px 0 16px;"]);
|
|
2213
|
+
var FlexRow = /*#__PURE__*/styled.View.withConfig({
|
|
2214
|
+
displayName: "StoryGrid__FlexRow"
|
|
2215
|
+
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
2216
|
+
var FlexCol = /*#__PURE__*/styled.View.withConfig({
|
|
2217
|
+
displayName: "StoryGrid__FlexCol"
|
|
2218
|
+
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
1914
2219
|
|
|
1915
2220
|
function StoryGridRow(_ref) {
|
|
1916
2221
|
var children = _ref.children,
|
|
@@ -1925,14 +2230,22 @@ function StoryGridRow(_ref) {
|
|
|
1925
2230
|
var breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
1926
2231
|
|
|
1927
2232
|
if (width < breakpointValue) {
|
|
1928
|
-
return /*#__PURE__*/
|
|
1929
|
-
|
|
1930
|
-
|
|
2233
|
+
return /*#__PURE__*/jsx(SmallScreenRow, {
|
|
2234
|
+
children: Children.map(children, function (child) {
|
|
2235
|
+
return /*#__PURE__*/jsx(SmallScreenCol, {
|
|
2236
|
+
children: child
|
|
2237
|
+
});
|
|
2238
|
+
})
|
|
2239
|
+
});
|
|
1931
2240
|
}
|
|
1932
2241
|
|
|
1933
|
-
return /*#__PURE__*/
|
|
1934
|
-
|
|
1935
|
-
|
|
2242
|
+
return /*#__PURE__*/jsx(FlexRow, {
|
|
2243
|
+
children: Children.map(children, function (child) {
|
|
2244
|
+
return /*#__PURE__*/jsx(FlexCol, {
|
|
2245
|
+
children: child
|
|
2246
|
+
});
|
|
2247
|
+
})
|
|
2248
|
+
});
|
|
1936
2249
|
}
|
|
1937
2250
|
|
|
1938
2251
|
function StoryGridCol(_ref2) {
|
|
@@ -1941,15 +2254,23 @@ function StoryGridCol(_ref2) {
|
|
|
1941
2254
|
children = _ref2.children,
|
|
1942
2255
|
_ref2$platform = _ref2.platform,
|
|
1943
2256
|
platform = _ref2$platform === void 0 ? 'all' : _ref2$platform;
|
|
2257
|
+
var isNative = Platform.OS === 'ios' || Platform.OS === 'android';
|
|
1944
2258
|
|
|
1945
|
-
if (
|
|
2259
|
+
if (Platform.OS === 'web' && platform === 'native') {
|
|
1946
2260
|
return null;
|
|
1947
2261
|
}
|
|
1948
2262
|
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2263
|
+
if (isNative && platform === 'web') {
|
|
2264
|
+
return null;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
2268
|
+
children: [title ? /*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
2269
|
+
numberOfLines: 1,
|
|
2270
|
+
color: titleColor,
|
|
2271
|
+
children: title
|
|
2272
|
+
}) : null, children]
|
|
2273
|
+
});
|
|
1953
2274
|
}
|
|
1954
2275
|
|
|
1955
2276
|
var StoryGrid = {
|
|
@@ -1957,8 +2278,9 @@ var StoryGrid = {
|
|
|
1957
2278
|
Col: StoryGridCol
|
|
1958
2279
|
};
|
|
1959
2280
|
|
|
1960
|
-
var
|
|
1961
|
-
|
|
2281
|
+
var Container$1 = /*#__PURE__*/styled.View.withConfig({
|
|
2282
|
+
displayName: "Tag__Container"
|
|
2283
|
+
})(["background-color:", ";border-width:", ";border-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], function (_ref) {
|
|
1962
2284
|
var theme = _ref.theme,
|
|
1963
2285
|
type = _ref.type,
|
|
1964
2286
|
variant = _ref.variant;
|
|
@@ -2009,13 +2331,15 @@ function Tag(_ref6) {
|
|
|
2009
2331
|
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
2010
2332
|
_ref6$variant = _ref6.variant,
|
|
2011
2333
|
variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
|
|
2012
|
-
return /*#__PURE__*/
|
|
2334
|
+
return /*#__PURE__*/jsx(Container$1, {
|
|
2013
2335
|
type: type,
|
|
2014
|
-
variant: variant
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2336
|
+
variant: variant,
|
|
2337
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
2338
|
+
base: "body-xsmall",
|
|
2339
|
+
color: getLabelColor(type, variant),
|
|
2340
|
+
children: label
|
|
2341
|
+
})
|
|
2342
|
+
});
|
|
2019
2343
|
}
|
|
2020
2344
|
|
|
2021
2345
|
var lateOceanColorPalette = {
|
|
@@ -2124,6 +2448,7 @@ var colorsLateOceanTheme = {
|
|
|
2124
2448
|
danger: lateOceanColorPalette.englishVermillon,
|
|
2125
2449
|
separator: lateOceanColorPalette.black100,
|
|
2126
2450
|
hover: lateOceanColorPalette.black100,
|
|
2451
|
+
black: lateOceanColorPalette.black1000,
|
|
2127
2452
|
uiBackground: lateOceanColorPalette.black25,
|
|
2128
2453
|
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2129
2454
|
overlay: {
|
|
@@ -2309,6 +2634,15 @@ var tagLateOceanTheme = {
|
|
|
2309
2634
|
}
|
|
2310
2635
|
};
|
|
2311
2636
|
|
|
2637
|
+
var tooltip = {
|
|
2638
|
+
backgroundColor: colorsLateOceanTheme.black,
|
|
2639
|
+
borderRadius: 10,
|
|
2640
|
+
opacity: 0.95,
|
|
2641
|
+
horizontalPadding: 16,
|
|
2642
|
+
verticalPadding: 4,
|
|
2643
|
+
floatingPadding: 8
|
|
2644
|
+
};
|
|
2645
|
+
|
|
2312
2646
|
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
2313
2647
|
return Math.round(fontSize * lineHeightMultiplier);
|
|
2314
2648
|
};
|
|
@@ -2341,8 +2675,8 @@ var typographyLateOceanTheme = {
|
|
|
2341
2675
|
types: {
|
|
2342
2676
|
headers: {
|
|
2343
2677
|
fontFamily: {
|
|
2344
|
-
regular: 'Moderat-Extended-Bold',
|
|
2345
|
-
bold: 'Moderat-Extended-Bold'
|
|
2678
|
+
regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
2679
|
+
bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
2346
2680
|
},
|
|
2347
2681
|
fontWeight: 400,
|
|
2348
2682
|
fontStyle: 'normal',
|
|
@@ -2361,8 +2695,8 @@ var typographyLateOceanTheme = {
|
|
|
2361
2695
|
},
|
|
2362
2696
|
bodies: {
|
|
2363
2697
|
fontFamily: {
|
|
2364
|
-
regular: 'NotoSans',
|
|
2365
|
-
bold: 'NotoSans-Bold'
|
|
2698
|
+
regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
2699
|
+
bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
2366
2700
|
},
|
|
2367
2701
|
fontWeight: {
|
|
2368
2702
|
regular: 400,
|
|
@@ -2425,46 +2759,379 @@ var theme = {
|
|
|
2425
2759
|
shadows: shadowsLateOceanTheme,
|
|
2426
2760
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2427
2761
|
iconButton: iconButton,
|
|
2428
|
-
listItem: listItemLateOceanTheme
|
|
2762
|
+
listItem: listItemLateOceanTheme,
|
|
2763
|
+
tooltip: tooltip
|
|
2429
2764
|
};
|
|
2430
2765
|
|
|
2431
|
-
function
|
|
2766
|
+
function Title(_ref) {
|
|
2432
2767
|
var children = _ref.children;
|
|
2433
|
-
return /*#__PURE__*/
|
|
2768
|
+
return /*#__PURE__*/jsx(Modal.Header, {
|
|
2769
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
2770
|
+
base: "body",
|
|
2771
|
+
variant: "bold",
|
|
2772
|
+
children: children
|
|
2773
|
+
})
|
|
2774
|
+
});
|
|
2434
2775
|
}
|
|
2435
2776
|
|
|
2436
|
-
|
|
2777
|
+
function ModalDateTimePicker(_ref2) {
|
|
2778
|
+
var title = _ref2.title,
|
|
2779
|
+
visible = _ref2.visible,
|
|
2780
|
+
value = _ref2.value,
|
|
2781
|
+
validateButtonLabel = _ref2.validateButtonLabel,
|
|
2782
|
+
onChange = _ref2.onChange,
|
|
2783
|
+
onClose = _ref2.onClose;
|
|
2437
2784
|
|
|
2438
|
-
var
|
|
2439
|
-
|
|
2785
|
+
var _useState = useState(value),
|
|
2786
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2787
|
+
currentValue = _useState2[0],
|
|
2788
|
+
setCurrentValue = _useState2[1]; // Prevent unsynced value between the modal and its parent state
|
|
2789
|
+
|
|
2790
|
+
|
|
2791
|
+
return /*#__PURE__*/jsx(Modal, {
|
|
2792
|
+
visible: Boolean(visible),
|
|
2793
|
+
onClose: function handleClose() {
|
|
2794
|
+
setCurrentValue(value);
|
|
2795
|
+
onClose();
|
|
2796
|
+
},
|
|
2797
|
+
children: visible ? /*#__PURE__*/jsxs(Fragment$1, {
|
|
2798
|
+
children: [title ? /*#__PURE__*/jsx(Title, {
|
|
2799
|
+
children: title
|
|
2800
|
+
}) : null, /*#__PURE__*/jsx(Modal.Body, {
|
|
2801
|
+
children: /*#__PURE__*/jsx(DateTimePicker, {
|
|
2802
|
+
is24Hour: true,
|
|
2803
|
+
testID: "date-picker-native-element",
|
|
2804
|
+
value: currentValue,
|
|
2805
|
+
mode: "time",
|
|
2806
|
+
display: Platform.OS === 'ios' ? 'spinner' : 'default',
|
|
2807
|
+
onChange: function (_event, date) {
|
|
2808
|
+
return setCurrentValue(function (prev) {
|
|
2809
|
+
return date || prev;
|
|
2810
|
+
});
|
|
2811
|
+
}
|
|
2812
|
+
})
|
|
2813
|
+
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
2814
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
2815
|
+
stretch: true,
|
|
2816
|
+
type: "primary",
|
|
2817
|
+
onPress: function handleSubmit() {
|
|
2818
|
+
onChange(currentValue);
|
|
2819
|
+
},
|
|
2820
|
+
children: validateButtonLabel ? /*#__PURE__*/jsx(Text$1, {
|
|
2821
|
+
children: validateButtonLabel
|
|
2822
|
+
}) : /*#__PURE__*/jsx(FormattedMessage, {
|
|
2823
|
+
id: "kitt-universal.ModalDateTimePicker.confirm"
|
|
2824
|
+
})
|
|
2825
|
+
})
|
|
2826
|
+
})]
|
|
2827
|
+
}) : null
|
|
2828
|
+
});
|
|
2829
|
+
}
|
|
2830
|
+
|
|
2831
|
+
var timePickerPlaceholder = '--:--';
|
|
2832
|
+
var useTimePicker = function (value, onChange, onBlur, disabled, defaultValue) {
|
|
2833
|
+
var _useState = useState(false),
|
|
2834
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2835
|
+
isTimePickerModalVisible = _useState2[0],
|
|
2836
|
+
setIsTimePickerModalVisible = _useState2[1];
|
|
2837
|
+
|
|
2838
|
+
var todayAtNoon = useMemo(function () {
|
|
2839
|
+
var now = new Date(2000, 0, 1, 12);
|
|
2840
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDay(), 12);
|
|
2841
|
+
}, []);
|
|
2842
|
+
var defaultDate = defaultValue || todayAtNoon;
|
|
2843
|
+
var dateTimePickerValue = value || defaultDate;
|
|
2844
|
+
var displayedValue = value === null ? timePickerPlaceholder : Intl.DateTimeFormat('fr-FR', {
|
|
2845
|
+
minute: 'numeric',
|
|
2846
|
+
hour: 'numeric'
|
|
2847
|
+
}).format(dateTimePickerValue);
|
|
2848
|
+
var timePickerState = isTimePickerModalVisible ? 'focus' : 'default';
|
|
2849
|
+
return {
|
|
2850
|
+
dateTimePickerValue: dateTimePickerValue,
|
|
2851
|
+
displayedValue: displayedValue,
|
|
2852
|
+
timePickerState: timePickerState,
|
|
2853
|
+
isTimePickerModalVisible: isTimePickerModalVisible,
|
|
2854
|
+
handleInputPress: function handleInputPress() {
|
|
2855
|
+
if (disabled) {
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
setIsTimePickerModalVisible(true);
|
|
2860
|
+
},
|
|
2861
|
+
handleTimeChange: function handleTimeChange(date) {
|
|
2862
|
+
setIsTimePickerModalVisible(false);
|
|
2863
|
+
onChange(date || defaultDate);
|
|
2864
|
+
onBlur();
|
|
2865
|
+
},
|
|
2866
|
+
handleModalClose: function handleModalClose() {
|
|
2867
|
+
return setIsTimePickerModalVisible(false);
|
|
2868
|
+
}
|
|
2869
|
+
};
|
|
2440
2870
|
};
|
|
2441
2871
|
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2872
|
+
var Container = /*#__PURE__*/styled.Pressable.withConfig({
|
|
2873
|
+
displayName: "TimePicker__Container"
|
|
2874
|
+
})(["", " width:100px;height:40px;justify-content:center;align-items:center;"], styledTextInputMixin);
|
|
2875
|
+
function TimePicker(_ref) {
|
|
2876
|
+
var title = _ref.title,
|
|
2877
|
+
_ref$state = _ref.state,
|
|
2878
|
+
state = _ref$state === void 0 ? 'default' : _ref$state,
|
|
2879
|
+
_ref$disabled = _ref.disabled,
|
|
2880
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
2881
|
+
forceDefaultValue = _ref.forceDefaultValue,
|
|
2882
|
+
value = _ref.value,
|
|
2883
|
+
validateButtonLabel = _ref.validateButtonLabel,
|
|
2884
|
+
onChange = _ref.onChange,
|
|
2885
|
+
onBlur = _ref.onBlur;
|
|
2886
|
+
|
|
2887
|
+
var _useTimePicker = useTimePicker(value || null, onChange, onBlur, disabled, forceDefaultValue),
|
|
2888
|
+
dateTimePickerValue = _useTimePicker.dateTimePickerValue,
|
|
2889
|
+
displayedValue = _useTimePicker.displayedValue,
|
|
2890
|
+
timePickerState = _useTimePicker.timePickerState,
|
|
2891
|
+
handleInputPress = _useTimePicker.handleInputPress,
|
|
2892
|
+
handleModalClose = _useTimePicker.handleModalClose,
|
|
2893
|
+
handleTimeChange = _useTimePicker.handleTimeChange,
|
|
2894
|
+
isTimePickerModalVisible = _useTimePicker.isTimePickerModalVisible;
|
|
2895
|
+
|
|
2896
|
+
return /*#__PURE__*/jsxs(Container, {
|
|
2897
|
+
state: timePickerState === 'default' ? state : timePickerState,
|
|
2898
|
+
accessibilityRole: "button",
|
|
2899
|
+
onPress: handleInputPress,
|
|
2900
|
+
children: [/*#__PURE__*/jsx(Typography.Text, {
|
|
2901
|
+
base: "body",
|
|
2902
|
+
color: displayedValue === timePickerPlaceholder ? 'black-light' : 'black',
|
|
2903
|
+
children: displayedValue
|
|
2904
|
+
}), Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsx(DateTimePicker, {
|
|
2905
|
+
is24Hour: true,
|
|
2906
|
+
testID: "date-picker-native-element",
|
|
2907
|
+
value: dateTimePickerValue,
|
|
2908
|
+
mode: "time",
|
|
2909
|
+
display: "default",
|
|
2910
|
+
onChange: function (_event, date) {
|
|
2911
|
+
return handleTimeChange(date);
|
|
2912
|
+
}
|
|
2913
|
+
}) : null, Platform.OS !== 'android' ? /*#__PURE__*/jsx(ModalDateTimePicker, {
|
|
2914
|
+
title: title,
|
|
2915
|
+
visible: isTimePickerModalVisible,
|
|
2916
|
+
value: dateTimePickerValue,
|
|
2917
|
+
validateButtonLabel: validateButtonLabel,
|
|
2918
|
+
onChange: handleTimeChange,
|
|
2919
|
+
onClose: handleModalClose
|
|
2920
|
+
}) : null]
|
|
2921
|
+
});
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
function ownKeys$2(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; }
|
|
2925
|
+
|
|
2926
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2927
|
+
|
|
2928
|
+
var Arrow = function (props) {
|
|
2929
|
+
return /*#__PURE__*/jsx("svg", _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
2930
|
+
children: /*#__PURE__*/jsx("path", {
|
|
2931
|
+
fillRule: "evenodd",
|
|
2932
|
+
clipRule: "evenodd",
|
|
2933
|
+
d: "M22.399 6.128C20.939 7.722 19.767 9 18 9s-2.938-1.278-4.399-2.872C11.187 3.494 7.984 0 0 0h36c-7.984 0-11.187 3.494-13.601 6.128z",
|
|
2934
|
+
fill: "currentColor"
|
|
2935
|
+
})
|
|
2936
|
+
}));
|
|
2937
|
+
};
|
|
2938
|
+
|
|
2939
|
+
Arrow.defaultProps = {
|
|
2940
|
+
width: "36",
|
|
2941
|
+
height: "8",
|
|
2942
|
+
viewBox: "0 0 36 9",
|
|
2943
|
+
fill: "none",
|
|
2944
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2945
|
+
};
|
|
2946
|
+
var StyledTooltipView = /*#__PURE__*/styled.View.withConfig({
|
|
2947
|
+
displayName: "TooltipView__StyledTooltipView"
|
|
2948
|
+
})(["align-items:center;"]);
|
|
2949
|
+
var StyledTooltipContent = /*#__PURE__*/styled.View.withConfig({
|
|
2950
|
+
displayName: "TooltipView__StyledTooltipContent"
|
|
2951
|
+
})(["background-color:", ";border-radius:", "px;opacity:", ";padding:", ";"], function (_ref) {
|
|
2952
|
+
var theme = _ref.theme;
|
|
2953
|
+
return theme.kitt.tooltip.backgroundColor;
|
|
2954
|
+
}, function (_ref2) {
|
|
2955
|
+
var theme = _ref2.theme;
|
|
2956
|
+
return theme.kitt.tooltip.borderRadius;
|
|
2957
|
+
}, function (_ref3) {
|
|
2958
|
+
var theme = _ref3.theme;
|
|
2959
|
+
return theme.kitt.tooltip.opacity;
|
|
2960
|
+
}, function (_ref4) {
|
|
2961
|
+
var theme = _ref4.theme;
|
|
2962
|
+
return "".concat(theme.kitt.tooltip.verticalPadding, "px ").concat(theme.kitt.tooltip.horizontalPadding, "px");
|
|
2963
|
+
});
|
|
2964
|
+
|
|
2965
|
+
function ArrowView(props) {
|
|
2966
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2967
|
+
return /*#__PURE__*/jsx(View, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
2968
|
+
children: /*#__PURE__*/jsx(Arrow, {
|
|
2969
|
+
color: theme.kitt.tooltip.backgroundColor
|
|
2970
|
+
})
|
|
2971
|
+
}));
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
var StyledArrow = /*#__PURE__*/styled(ArrowView).withConfig({
|
|
2975
|
+
displayName: "TooltipView__StyledArrow"
|
|
2976
|
+
})(["color:", ";transform:", ";"], function (_ref5) {
|
|
2977
|
+
var theme = _ref5.theme;
|
|
2978
|
+
return theme.kitt.tooltip.backgroundColor;
|
|
2979
|
+
}, function (_ref6) {
|
|
2980
|
+
var $position = _ref6.$position;
|
|
2981
|
+
return "rotate(".concat($position === 'bottom' ? 180 : 0, "deg)");
|
|
2982
|
+
});
|
|
2983
|
+
function TooltipView(_ref7) {
|
|
2984
|
+
var children = _ref7.children,
|
|
2985
|
+
position = _ref7.position;
|
|
2986
|
+
return /*#__PURE__*/jsxs(StyledTooltipView, {
|
|
2987
|
+
children: [position === 'bottom' ? /*#__PURE__*/jsx(StyledArrow, {
|
|
2988
|
+
$position: position
|
|
2989
|
+
}) : null, /*#__PURE__*/jsx(StyledTooltipContent, {
|
|
2990
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
2991
|
+
base: "body",
|
|
2992
|
+
color: "white",
|
|
2993
|
+
children: children
|
|
2994
|
+
})
|
|
2995
|
+
}), position === 'top' ? /*#__PURE__*/jsx(StyledArrow, {
|
|
2996
|
+
$position: position
|
|
2997
|
+
}) : null]
|
|
2998
|
+
});
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
var tooltipDefaultPosition = 'top';
|
|
3002
|
+
|
|
3003
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3004
|
+
|
|
3005
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3006
|
+
// Since the tooltip use absolute positionning, we need a parent to provide the relative root
|
|
3007
|
+
var TooltipContainer = /*#__PURE__*/styled.View.withConfig({
|
|
3008
|
+
displayName: "Tooltip__TooltipContainer"
|
|
3009
|
+
})(["position:relative;align-self:baseline;"]);
|
|
3010
|
+
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3011
|
+
// TODO : update position on scroll in future iteration
|
|
3012
|
+
function Tooltip(_ref) {
|
|
3013
|
+
var children = _ref.children,
|
|
3014
|
+
defaultVisible = _ref.defaultVisible,
|
|
3015
|
+
_ref$position = _ref.position,
|
|
3016
|
+
position = _ref$position === void 0 ? tooltipDefaultPosition : _ref$position,
|
|
3017
|
+
content = _ref.content,
|
|
3018
|
+
floatingPadding = _ref.floatingPadding,
|
|
3019
|
+
onUpdate = _ref.onUpdate;
|
|
3020
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3021
|
+
var padding = floatingPadding || theme.kitt.tooltip.floatingPadding;
|
|
3022
|
+
var pressed = useSharedValue(defaultVisible);
|
|
3023
|
+
var opacityStyles = useAnimatedStyle(function () {
|
|
3024
|
+
var _f = function () {
|
|
3025
|
+
return {
|
|
3026
|
+
opacity: withSpring(pressed.value ? theme.kitt.tooltip.opacity : 0)
|
|
3027
|
+
};
|
|
3028
|
+
};
|
|
3029
|
+
|
|
3030
|
+
_f._closure = {
|
|
3031
|
+
withSpring: withSpring,
|
|
3032
|
+
pressed: pressed,
|
|
3033
|
+
theme: {
|
|
3034
|
+
kitt: {
|
|
3035
|
+
tooltip: {
|
|
3036
|
+
opacity: theme.kitt.tooltip.opacity
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
};
|
|
3041
|
+
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{opacity:withSpring(pressed.value?theme.kitt.tooltip.opacity:0)};}}";
|
|
3042
|
+
_f.__workletHash = 15953928507970;
|
|
3043
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (57:41)";
|
|
3044
|
+
_f.__optimalization = 2;
|
|
3045
|
+
|
|
3046
|
+
global.__reanimatedWorkletInit(_f);
|
|
3047
|
+
|
|
3048
|
+
return _f;
|
|
3049
|
+
}());
|
|
2446
3050
|
|
|
2447
|
-
|
|
3051
|
+
var _useFloating = useFloating({
|
|
3052
|
+
placement: position,
|
|
3053
|
+
middleware: [offset(padding), shift(), flip({
|
|
3054
|
+
padding: padding
|
|
3055
|
+
})]
|
|
3056
|
+
}),
|
|
3057
|
+
x = _useFloating.x,
|
|
3058
|
+
y = _useFloating.y,
|
|
3059
|
+
reference = _useFloating.reference,
|
|
3060
|
+
floating = _useFloating.floating,
|
|
3061
|
+
update = _useFloating.update,
|
|
3062
|
+
refs = _useFloating.refs,
|
|
3063
|
+
middlewareData = _useFloating.middlewareData;
|
|
3064
|
+
|
|
3065
|
+
useEffect(function () {
|
|
3066
|
+
if (!onUpdate) return;
|
|
3067
|
+
onUpdate({
|
|
3068
|
+
x: x,
|
|
3069
|
+
y: y,
|
|
3070
|
+
reference: reference,
|
|
3071
|
+
floating: floating,
|
|
3072
|
+
strategy: 'absolute',
|
|
3073
|
+
update: update,
|
|
3074
|
+
refs: refs,
|
|
3075
|
+
middlewareData: middlewareData
|
|
3076
|
+
});
|
|
3077
|
+
}, [x, y, reference, floating, update, refs, middlewareData, onUpdate]);
|
|
3078
|
+
return /*#__PURE__*/jsxs(TooltipContainer, {
|
|
3079
|
+
children: [/*#__PURE__*/jsx(View, {
|
|
3080
|
+
ref: reference,
|
|
3081
|
+
children: /*#__PURE__*/jsx(Pressable, {
|
|
3082
|
+
accessibilityRole: "button",
|
|
3083
|
+
onPress: function handlePress() {
|
|
3084
|
+
pressed.value = !pressed.value;
|
|
3085
|
+
},
|
|
3086
|
+
children: children
|
|
3087
|
+
})
|
|
3088
|
+
}), /*#__PURE__*/jsx(View, {
|
|
3089
|
+
ref: floating,
|
|
3090
|
+
accessibilityElementsHidden: !pressed.value,
|
|
3091
|
+
importantForAccessibility: pressed.value === true ? 'auto' : 'no-hide-descendants',
|
|
3092
|
+
style: _objectSpread$1(_objectSpread$1({}, StyleSheet.absoluteFillObject), {}, {
|
|
3093
|
+
top: y && position === 'bottom' ? y : undefined,
|
|
3094
|
+
bottom: y && position === 'top' ? y : undefined,
|
|
3095
|
+
left: x !== null && x !== void 0 ? x : 0
|
|
3096
|
+
}),
|
|
3097
|
+
children: /*#__PURE__*/jsx(Animated$1.View, {
|
|
3098
|
+
style: [opacityStyles],
|
|
3099
|
+
children: /*#__PURE__*/jsx(TooltipView, {
|
|
3100
|
+
position: position,
|
|
3101
|
+
children: content
|
|
3102
|
+
})
|
|
3103
|
+
})
|
|
3104
|
+
})]
|
|
3105
|
+
});
|
|
2448
3106
|
}
|
|
3107
|
+
Tooltip.View = TooltipView;
|
|
2449
3108
|
|
|
2450
|
-
var StyledTypographyEmoji = styled(Emoji)(
|
|
2451
|
-
|
|
2452
|
-
|
|
3109
|
+
var StyledTypographyEmoji = /*#__PURE__*/styled(Emoji).withConfig({
|
|
3110
|
+
displayName: "TypographyEmoji__StyledTypographyEmoji"
|
|
3111
|
+
})(["align-self:center;", ""], function (_ref) {
|
|
3112
|
+
var size = _ref.size;
|
|
3113
|
+
if (Platform.OS !== 'web') return undefined;
|
|
2453
3114
|
/* Style Twemoji: https://github.com/twitter/twemoji#inline-styles */
|
|
3115
|
+
|
|
3116
|
+
return "\n margin: 0 ".concat(size / 20, "px 0 ").concat(size / 10, "px;\n transform: translateY(").concat(size / 10 * 2, "px);\n ");
|
|
2454
3117
|
});
|
|
2455
3118
|
function TypographyEmoji(_ref2) {
|
|
2456
3119
|
var emoji = _ref2.emoji,
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
var
|
|
3120
|
+
base = _ref2.base,
|
|
3121
|
+
small = _ref2.small,
|
|
3122
|
+
medium = _ref2.medium,
|
|
3123
|
+
large = _ref2.large;
|
|
3124
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3125
|
+
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
|
|
3126
|
+
var typeConfig = getTypographyTypeConfig(typeForCurrentWindowSize || 'body', theme);
|
|
3127
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
3128
|
+
var fontSize = typeConfig[typeConfigKey].fontSize;
|
|
2462
3129
|
|
|
2463
3130
|
if ((process.env.NODE_ENV !== "production")) {
|
|
2464
3131
|
if (!fontSize.endsWith('px')) throw new Error("Unexpected font-size value: ".concat(fontSize));
|
|
2465
3132
|
}
|
|
2466
3133
|
|
|
2467
|
-
return /*#__PURE__*/
|
|
3134
|
+
return /*#__PURE__*/jsx(StyledTypographyEmoji, {
|
|
2468
3135
|
size: parseInt(fontSize.slice(0, -2), 10),
|
|
2469
3136
|
emoji: emoji
|
|
2470
3137
|
});
|
|
@@ -2472,39 +3139,54 @@ function TypographyEmoji(_ref2) {
|
|
|
2472
3139
|
|
|
2473
3140
|
var _excluded$1 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
|
|
2474
3141
|
|
|
2475
|
-
var
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
3142
|
+
function ownKeys(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; }
|
|
3143
|
+
|
|
3144
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3145
|
+
var TypographyLinkWebWrapper = undefined;
|
|
3146
|
+
var StyledLink = /*#__PURE__*/styled.Text.withConfig({
|
|
3147
|
+
displayName: "TypographyLink__StyledLink"
|
|
3148
|
+
})(["text-decoration:", ";", ";", ";"], function (_ref) {
|
|
3149
|
+
var $noUnderline = _ref.$noUnderline;
|
|
3150
|
+
return $noUnderline ? 'none' : 'underline';
|
|
2483
3151
|
}, function (_ref2) {
|
|
2484
|
-
var disabled = _ref2
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
3152
|
+
var $disabled = _ref2.$disabled;
|
|
3153
|
+
if (Platform.OS !== 'web') return undefined;
|
|
3154
|
+
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3155
|
+
}, function (_ref3) {
|
|
3156
|
+
var $disabled = _ref3.$disabled,
|
|
3157
|
+
theme = _ref3.theme;
|
|
3158
|
+
if (!$disabled) return undefined;
|
|
3159
|
+
return "color: ".concat(theme.kitt.typography.link.disabledColor, ";");
|
|
2488
3160
|
});
|
|
2489
|
-
function TypographyLink(
|
|
2490
|
-
var children =
|
|
2491
|
-
disabled =
|
|
2492
|
-
noUnderline =
|
|
2493
|
-
href =
|
|
2494
|
-
hrefAttrs =
|
|
2495
|
-
onPress =
|
|
2496
|
-
otherProps = _objectWithoutProperties(
|
|
2497
|
-
|
|
2498
|
-
return /*#__PURE__*/
|
|
2499
|
-
accessibilityRole: "none"
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
3161
|
+
function TypographyLink(_ref4) {
|
|
3162
|
+
var children = _ref4.children,
|
|
3163
|
+
disabled = _ref4.disabled,
|
|
3164
|
+
noUnderline = _ref4.noUnderline,
|
|
3165
|
+
href = _ref4.href,
|
|
3166
|
+
hrefAttrs = _ref4.hrefAttrs,
|
|
3167
|
+
onPress = _ref4.onPress,
|
|
3168
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded$1);
|
|
3169
|
+
|
|
3170
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
3171
|
+
accessibilityRole: "none",
|
|
3172
|
+
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3173
|
+
as: TypographyLinkWebWrapper,
|
|
3174
|
+
"data-nounderline": noUnderline ? true : undefined,
|
|
3175
|
+
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3176
|
+
$disabled: disabled,
|
|
3177
|
+
$noUnderline: noUnderline,
|
|
3178
|
+
href: href,
|
|
3179
|
+
hrefAttrs: hrefAttrs,
|
|
3180
|
+
accessibilityRole: "link",
|
|
3181
|
+
dataSet: {
|
|
3182
|
+
// remove data-kitt-universal when we delete kitt web. See See :global(a) in Link styles.module.css
|
|
3183
|
+
'kitt-universal': 'true'
|
|
3184
|
+
},
|
|
3185
|
+
onPress: disabled ? undefined : onPress,
|
|
3186
|
+
children: children
|
|
3187
|
+
})
|
|
3188
|
+
})
|
|
3189
|
+
}));
|
|
2508
3190
|
}
|
|
2509
3191
|
|
|
2510
3192
|
function matchWindowSize(currentWidth, _ref) {
|
|
@@ -2576,9 +3258,10 @@ function useKittTheme() {
|
|
|
2576
3258
|
function KittThemeProvider(_ref) {
|
|
2577
3259
|
var children = _ref.children;
|
|
2578
3260
|
var theme = useKittTheme();
|
|
2579
|
-
return /*#__PURE__*/
|
|
2580
|
-
theme: theme
|
|
2581
|
-
|
|
3261
|
+
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
3262
|
+
theme: theme,
|
|
3263
|
+
children: children
|
|
3264
|
+
});
|
|
2582
3265
|
}
|
|
2583
3266
|
var KittThemeDecorator = makeDecorator({
|
|
2584
3267
|
name: 'ThemeDecorator',
|
|
@@ -2586,17 +3269,9 @@ var KittThemeDecorator = makeDecorator({
|
|
|
2586
3269
|
wrapper: function wrapper(storyFn, context, _ref2) {
|
|
2587
3270
|
_ref2.options;
|
|
2588
3271
|
_ref2.parameters;
|
|
2589
|
-
return /*#__PURE__*/
|
|
2590
|
-
|
|
2591
|
-
});
|
|
2592
|
-
|
|
2593
|
-
var SafeAreaProviderDecorator = makeDecorator({
|
|
2594
|
-
name: 'SafeAreaProviderDecorator',
|
|
2595
|
-
parameterName: 'safeAreaProvider',
|
|
2596
|
-
wrapper: function wrapper(storyFn, context, _ref) {
|
|
2597
|
-
_ref.options;
|
|
2598
|
-
_ref.parameters;
|
|
2599
|
-
return /*#__PURE__*/React.createElement(SafeAreaProvider, null, storyFn(context));
|
|
3272
|
+
return /*#__PURE__*/jsx(KittThemeProvider, {
|
|
3273
|
+
children: storyFn(context)
|
|
3274
|
+
});
|
|
2600
3275
|
}
|
|
2601
3276
|
});
|
|
2602
3277
|
|
|
@@ -2607,8 +3282,10 @@ function MatchWindowSize(_ref) {
|
|
|
2607
3282
|
|
|
2608
3283
|
var match = useMatchWindowSize(matchWindowSizeOptions);
|
|
2609
3284
|
if (!match) return null;
|
|
2610
|
-
return /*#__PURE__*/
|
|
3285
|
+
return /*#__PURE__*/jsx(Fragment$1, {
|
|
3286
|
+
children: children
|
|
3287
|
+
});
|
|
2611
3288
|
}
|
|
2612
3289
|
|
|
2613
|
-
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification,
|
|
3290
|
+
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
2614
3291
|
//# sourceMappingURL=index-browser-all.es.android.js.map
|