@ornikar/kitt-universal 2.3.0 → 3.0.0-beta.1
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/CHANGELOG.md +131 -0
- 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 +8 -0
- package/dist/definitions/Emoji/Emoji.d.ts.map +1 -0
- 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 +7 -13
- 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 +3 -3
- 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 +19 -7
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyEmoji.d.ts +7 -0
- package/dist/definitions/typography/TypographyEmoji.d.ts.map +1 -0
- 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 +1347 -595
- 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 +1348 -596
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +1318 -672
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +1173 -812
- 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 +1168 -591
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/styles.css +4 -0
- package/dist/tsbuildinfo +1 -1
- package/package.json +18 -7
- package/translations/es-ES.json +3 -0
- package/translations/fr-FR.json +3 -0
- 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 -18
- 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 -23
- 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,21 +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
|
+
import { parse } from 'twemoji-parser';
|
|
11
12
|
import { openBrowserAsync } from 'expo-web-browser';
|
|
12
|
-
import
|
|
13
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
14
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
13
15
|
import Animated$1, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
14
|
-
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';
|
|
15
19
|
import { makeDecorator } from '@storybook/addons';
|
|
16
20
|
|
|
17
|
-
var PrimitiveView = View;
|
|
18
|
-
|
|
19
21
|
function SpinningIcon(_ref) {
|
|
20
22
|
var children = _ref.children;
|
|
21
23
|
var animationRef = useRef(new Animated.Value(0));
|
|
@@ -38,17 +40,19 @@ function SpinningIcon(_ref) {
|
|
|
38
40
|
return undefined;
|
|
39
41
|
};
|
|
40
42
|
}, []);
|
|
41
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/jsx(Animated.View, {
|
|
42
44
|
style: {
|
|
43
45
|
transform: [{
|
|
44
46
|
rotate: rotation
|
|
45
47
|
}]
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
+
},
|
|
49
|
+
children: children
|
|
50
|
+
});
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
var
|
|
51
|
-
|
|
53
|
+
var IconContainer$2 = /*#__PURE__*/styled.View.withConfig({
|
|
54
|
+
displayName: "Icon__IconContainer"
|
|
55
|
+
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
52
56
|
var color = _ref.color;
|
|
53
57
|
return color;
|
|
54
58
|
}, function (_ref2) {
|
|
@@ -69,92 +73,172 @@ function Icon(_ref5) {
|
|
|
69
73
|
spin = _ref5.spin,
|
|
70
74
|
align = _ref5.align,
|
|
71
75
|
color = _ref5.color;
|
|
72
|
-
var clonedIcon = /*#__PURE__*/
|
|
76
|
+
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
73
77
|
color: color
|
|
74
78
|
});
|
|
75
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/jsx(IconContainer$2, {
|
|
76
80
|
align: align,
|
|
77
81
|
size: size,
|
|
78
|
-
color: color
|
|
79
|
-
|
|
82
|
+
color: color,
|
|
83
|
+
children: spin ? /*#__PURE__*/jsx(SpinningIcon, {
|
|
84
|
+
children: clonedIcon
|
|
85
|
+
}) : clonedIcon
|
|
86
|
+
});
|
|
80
87
|
}
|
|
81
88
|
|
|
82
|
-
var
|
|
89
|
+
var KittBreakpoints = {
|
|
90
|
+
/**
|
|
91
|
+
* min-width: 0
|
|
92
|
+
*/
|
|
93
|
+
BASE: 0,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* min-width: 480px
|
|
97
|
+
*/
|
|
98
|
+
SMALL: 480,
|
|
83
99
|
|
|
84
|
-
|
|
100
|
+
/**
|
|
101
|
+
* min-width: 768px
|
|
102
|
+
*/
|
|
103
|
+
MEDIUM: 768,
|
|
85
104
|
|
|
86
|
-
|
|
87
|
-
|
|
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,
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* max-width: 1023px
|
|
128
|
+
*/
|
|
129
|
+
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
130
|
+
|
|
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);
|
|
88
143
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
89
144
|
function useTypographyColor() {
|
|
90
145
|
return useContext(TypographyColorContext);
|
|
91
146
|
}
|
|
92
|
-
var
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
headers = _theme$kitt$typograph.headers,
|
|
99
|
-
bodies = _theme$kitt$typograph.bodies;
|
|
100
|
-
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 ");
|
|
101
|
-
}, function (_ref2) {
|
|
102
|
-
var theme = _ref2.theme,
|
|
103
|
-
color = _ref2.color;
|
|
104
|
-
return !color ? '' : "\n color: ".concat(theme.kitt.typography.colors[color], ";\n text-decoration-color: ").concat(theme.kitt.typography.colors[color], ";\n ");
|
|
105
|
-
});
|
|
147
|
+
var getTypographyTypeConfigKey = function (theme) {
|
|
148
|
+
var isMediumOrAbove = theme.responsive.matchWindowSize({
|
|
149
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
150
|
+
});
|
|
151
|
+
return isMediumOrAbove ? 'mediumAndWide' : 'baseAndSmall';
|
|
152
|
+
};
|
|
106
153
|
|
|
107
154
|
var isTypeHeader = function (type) {
|
|
108
155
|
return type.startsWith('header');
|
|
109
156
|
};
|
|
110
157
|
|
|
111
|
-
var isTypographyHeader = function (
|
|
112
|
-
if (
|
|
113
|
-
if (
|
|
158
|
+
var isTypographyHeader = function (type, typographyIsHeaderInContext) {
|
|
159
|
+
if (type) return isTypeHeader(type);
|
|
160
|
+
if (typographyIsHeaderInContext != null) return typographyIsHeaderInContext;
|
|
114
161
|
throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
|
|
115
162
|
};
|
|
163
|
+
function getTypographyTypeConfig(type, theme) {
|
|
164
|
+
if (isTypographyHeader(type, undefined)) {
|
|
165
|
+
return theme.kitt.typography.types.headers.configs[type];
|
|
166
|
+
}
|
|
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;
|
|
116
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
|
+
}
|
|
117
196
|
function Typography(_ref3) {
|
|
118
197
|
var accessibilityRole = _ref3.accessibilityRole,
|
|
119
198
|
base = _ref3.base,
|
|
199
|
+
small = _ref3.small,
|
|
200
|
+
medium = _ref3.medium,
|
|
201
|
+
large = _ref3.large,
|
|
120
202
|
variant = _ref3.variant,
|
|
121
203
|
color = _ref3.color,
|
|
122
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded$
|
|
123
|
-
|
|
124
|
-
var
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
value:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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,
|
|
143
226
|
accessibilityRole: accessibilityRole || undefined
|
|
144
227
|
}, otherProps));
|
|
145
|
-
return color ? /*#__PURE__*/
|
|
146
|
-
value: color
|
|
147
|
-
|
|
228
|
+
return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
|
|
229
|
+
value: color,
|
|
230
|
+
children: content
|
|
231
|
+
}) : content;
|
|
148
232
|
}
|
|
149
233
|
|
|
150
234
|
function TypographyText(props) {
|
|
151
|
-
return /*#__PURE__*/
|
|
235
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h({
|
|
152
236
|
accessibilityRole: null
|
|
153
237
|
}, props));
|
|
154
238
|
}
|
|
155
239
|
|
|
156
240
|
function TypographyParagraph(props) {
|
|
157
|
-
return /*#__PURE__*/
|
|
241
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h({
|
|
158
242
|
accessibilityRole: "paragraph"
|
|
159
243
|
}, props));
|
|
160
244
|
}
|
|
@@ -162,10 +246,10 @@ function TypographyParagraph(props) {
|
|
|
162
246
|
var createHeading = function (level, defaultBase) {
|
|
163
247
|
// https://github.com/necolas/react-native-web/issues/401
|
|
164
248
|
function TypographyHeading(props) {
|
|
165
|
-
return /*#__PURE__*/
|
|
249
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h(_objectSpread$h({
|
|
166
250
|
accessibilityRole: "header",
|
|
167
251
|
base: defaultBase
|
|
168
|
-
}, props, {
|
|
252
|
+
}, props), {}, {
|
|
169
253
|
accessibilityLevel: level
|
|
170
254
|
}));
|
|
171
255
|
}
|
|
@@ -198,9 +282,11 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
198
282
|
|
|
199
283
|
Typography.h5 = createHeading(5, 'header5');
|
|
200
284
|
|
|
201
|
-
var _excluded$
|
|
285
|
+
var _excluded$b = ["size"];
|
|
286
|
+
|
|
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; }
|
|
202
288
|
|
|
203
|
-
var
|
|
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; }
|
|
204
290
|
|
|
205
291
|
var getFirstCharacter = function (string) {
|
|
206
292
|
return string ? string[0] : '';
|
|
@@ -210,7 +296,9 @@ var getInitials = function (firstname, lastname) {
|
|
|
210
296
|
return (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
|
|
211
297
|
};
|
|
212
298
|
|
|
213
|
-
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) {
|
|
214
302
|
var round = _ref.round,
|
|
215
303
|
size = _ref.size;
|
|
216
304
|
return round ? size / 2 : 10;
|
|
@@ -235,7 +323,7 @@ function AvatarContent(_ref5) {
|
|
|
235
323
|
light = _ref5.light;
|
|
236
324
|
|
|
237
325
|
if (src) {
|
|
238
|
-
return /*#__PURE__*/
|
|
326
|
+
return /*#__PURE__*/jsx(Image, {
|
|
239
327
|
source: {
|
|
240
328
|
uri: src
|
|
241
329
|
},
|
|
@@ -247,15 +335,16 @@ function AvatarContent(_ref5) {
|
|
|
247
335
|
}
|
|
248
336
|
|
|
249
337
|
if (firstname && lastname) {
|
|
250
|
-
return /*#__PURE__*/
|
|
338
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
251
339
|
base: "body-small",
|
|
252
340
|
variant: "bold",
|
|
253
|
-
color: light ? 'black' : 'white'
|
|
254
|
-
|
|
341
|
+
color: light ? 'black' : 'white',
|
|
342
|
+
children: getInitials(firstname, lastname)
|
|
343
|
+
});
|
|
255
344
|
}
|
|
256
345
|
|
|
257
|
-
return /*#__PURE__*/
|
|
258
|
-
icon: /*#__PURE__*/
|
|
346
|
+
return /*#__PURE__*/jsx(Icon, {
|
|
347
|
+
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
259
348
|
color: light ? 'black' : 'white',
|
|
260
349
|
size: size / 2
|
|
261
350
|
});
|
|
@@ -264,32 +353,37 @@ function AvatarContent(_ref5) {
|
|
|
264
353
|
function Avatar(_ref6) {
|
|
265
354
|
var _ref6$size = _ref6.size,
|
|
266
355
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
267
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
356
|
+
rest = _objectWithoutProperties(_ref6, _excluded$b);
|
|
268
357
|
|
|
269
|
-
return /*#__PURE__*/
|
|
270
|
-
size: size
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
+
}));
|
|
274
364
|
}
|
|
275
365
|
|
|
276
|
-
var _excluded$
|
|
366
|
+
var _excluded$a = ["color"],
|
|
277
367
|
_excluded2$2 = ["color"];
|
|
278
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
|
+
|
|
279
373
|
function TypographyIconInheritColor(props) {
|
|
280
374
|
var color = useTypographyColor();
|
|
281
|
-
var theme = useTheme();
|
|
282
|
-
return /*#__PURE__*/
|
|
375
|
+
var theme = /*#__PURE__*/useTheme();
|
|
376
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
283
377
|
color: theme.kitt.typography.colors[color]
|
|
284
378
|
}));
|
|
285
379
|
}
|
|
286
380
|
|
|
287
381
|
function TypographyIconSpecifiedColor(_ref) {
|
|
288
382
|
var color = _ref.color,
|
|
289
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
383
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$a);
|
|
290
384
|
|
|
291
|
-
var theme = useTheme();
|
|
292
|
-
return /*#__PURE__*/
|
|
385
|
+
var theme = /*#__PURE__*/useTheme();
|
|
386
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$f(_objectSpread$f({}, otherProps), {}, {
|
|
293
387
|
color: theme.kitt.typography.colors[color]
|
|
294
388
|
}));
|
|
295
389
|
}
|
|
@@ -299,15 +393,17 @@ function TypographyIcon(_ref2) {
|
|
|
299
393
|
otherProps = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
300
394
|
|
|
301
395
|
if (color) {
|
|
302
|
-
return /*#__PURE__*/
|
|
396
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$f({
|
|
303
397
|
color: color
|
|
304
398
|
}, otherProps));
|
|
305
399
|
}
|
|
306
400
|
|
|
307
|
-
return /*#__PURE__*/
|
|
401
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$f({}, otherProps));
|
|
308
402
|
}
|
|
309
403
|
|
|
310
|
-
|
|
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; }
|
|
311
407
|
|
|
312
408
|
var getTextColorByType = function (type, isPressed, disabled) {
|
|
313
409
|
if (disabled) return 'black-light';
|
|
@@ -328,13 +424,19 @@ var getTextColorByType = function (type, isPressed, disabled) {
|
|
|
328
424
|
}
|
|
329
425
|
};
|
|
330
426
|
|
|
331
|
-
var ButtonText = styled(Typography.Text)(
|
|
332
|
-
|
|
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) {
|
|
333
433
|
var stretch = _ref.stretch,
|
|
334
434
|
iconOnly = _ref.iconOnly;
|
|
335
435
|
return "".concat(stretch || iconOnly ? 1 : 0, " 1 auto");
|
|
336
436
|
});
|
|
337
|
-
var IconContainer$1 = styled(
|
|
437
|
+
var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
438
|
+
displayName: "ButtonContent__IconContainer"
|
|
439
|
+
})(["", ""], function (_ref2) {
|
|
338
440
|
var theme = _ref2.theme,
|
|
339
441
|
iconPosition = _ref2.iconPosition;
|
|
340
442
|
var value = theme.kitt.spacing * 3;
|
|
@@ -353,15 +455,16 @@ function ButtonIcon(_ref3) {
|
|
|
353
455
|
size = _ref3.size,
|
|
354
456
|
iconPosition = _ref3.iconPosition,
|
|
355
457
|
testID = _ref3.testID;
|
|
356
|
-
return /*#__PURE__*/
|
|
357
|
-
iconPosition: iconPosition
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
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
|
+
});
|
|
365
468
|
}
|
|
366
469
|
|
|
367
470
|
function ButtonContent(_ref4) {
|
|
@@ -374,7 +477,7 @@ function ButtonContent(_ref4) {
|
|
|
374
477
|
disabled = _ref4.disabled,
|
|
375
478
|
children = _ref4.children;
|
|
376
479
|
var color = getTextColorByType(type, Boolean(isPressed), Boolean(disabled));
|
|
377
|
-
var theme = useTheme();
|
|
480
|
+
var theme = /*#__PURE__*/useTheme();
|
|
378
481
|
var sharedIconProps = {
|
|
379
482
|
spin: iconSpin,
|
|
380
483
|
color: color,
|
|
@@ -388,34 +491,36 @@ function ButtonContent(_ref4) {
|
|
|
388
491
|
}
|
|
389
492
|
|
|
390
493
|
if (!children) {
|
|
391
|
-
return /*#__PURE__*/
|
|
494
|
+
return /*#__PURE__*/jsx(Content$1, {
|
|
392
495
|
iconOnly: true,
|
|
393
|
-
stretch: stretch
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
496
|
+
stretch: stretch,
|
|
497
|
+
children: /*#__PURE__*/jsx(TypographyIcon, _objectSpread$e(_objectSpread$e({}, sharedIconProps), {}, {
|
|
498
|
+
icon: icon
|
|
499
|
+
}))
|
|
500
|
+
});
|
|
397
501
|
}
|
|
398
502
|
|
|
399
|
-
return /*#__PURE__*/
|
|
400
|
-
stretch: stretch
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
icon
|
|
411
|
-
|
|
412
|
-
|
|
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
|
+
});
|
|
413
519
|
}
|
|
414
520
|
|
|
415
|
-
var
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
var ButtonPressable = styled(PrimitivePressable)(_templateObject$q || (_templateObject$q = _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) {
|
|
419
524
|
var theme = _ref.theme;
|
|
420
525
|
return theme.kitt.button.minWidth;
|
|
421
526
|
}, function (_ref2) {
|
|
@@ -455,6 +560,9 @@ var ButtonPressable = styled(PrimitivePressable)(_templateObject$q || (_template
|
|
|
455
560
|
return theme.kitt.button.borderWidth;
|
|
456
561
|
});
|
|
457
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; }
|
|
458
566
|
function Button(_ref) {
|
|
459
567
|
var children = _ref.children,
|
|
460
568
|
_ref$type = _ref.type,
|
|
@@ -480,10 +588,10 @@ function Button(_ref) {
|
|
|
480
588
|
stretch: stretch,
|
|
481
589
|
disabled: disabled
|
|
482
590
|
};
|
|
483
|
-
return /*#__PURE__*/
|
|
591
|
+
return /*#__PURE__*/jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
484
592
|
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
485
593
|
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
486
|
-
,
|
|
594
|
+
, _objectSpread$d(_objectSpread$d({}, sharedProps), {}, {
|
|
487
595
|
isPressed: isPressed,
|
|
488
596
|
accessibilityRole: "button",
|
|
489
597
|
testID: testID,
|
|
@@ -495,16 +603,19 @@ function Button(_ref) {
|
|
|
495
603
|
},
|
|
496
604
|
onPressOut: function handleButtonPressOut() {
|
|
497
605
|
return setIsPressed(false);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
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
|
+
}));
|
|
504
614
|
}
|
|
505
615
|
|
|
506
|
-
var
|
|
507
|
-
|
|
616
|
+
var Container$6 = /*#__PURE__*/styled.View.withConfig({
|
|
617
|
+
displayName: "Card__Container"
|
|
618
|
+
})(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], function (_ref) {
|
|
508
619
|
var theme = _ref.theme,
|
|
509
620
|
type = _ref.type;
|
|
510
621
|
return theme.kitt.card[type].backgroundColor;
|
|
@@ -525,9 +636,44 @@ var Container$5 = styled(PrimitiveView)(_templateObject$p || (_templateObject$p
|
|
|
525
636
|
function Card(_ref6) {
|
|
526
637
|
var children = _ref6.children,
|
|
527
638
|
type = _ref6.type;
|
|
528
|
-
return /*#__PURE__*/
|
|
529
|
-
type: type
|
|
530
|
-
|
|
639
|
+
return /*#__PURE__*/jsx(Container$6, {
|
|
640
|
+
type: type,
|
|
641
|
+
children: children
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
var StyledEmoji = /*#__PURE__*/styled.Image.withConfig({
|
|
646
|
+
displayName: "Emoji__StyledEmoji"
|
|
647
|
+
})(["width:", "px;height:", "px;"], function (_ref) {
|
|
648
|
+
var size = _ref.size;
|
|
649
|
+
return size;
|
|
650
|
+
}, function (_ref2) {
|
|
651
|
+
var size = _ref2.size;
|
|
652
|
+
return size;
|
|
653
|
+
});
|
|
654
|
+
function Emoji(_ref3) {
|
|
655
|
+
var emoji = _ref3.emoji,
|
|
656
|
+
size = _ref3.size,
|
|
657
|
+
style = _ref3.style;
|
|
658
|
+
|
|
659
|
+
var _useMemo = useMemo(function () {
|
|
660
|
+
return parse(emoji, {
|
|
661
|
+
// on native plaforms, you can't display svg as Image
|
|
662
|
+
assetType: Platform.OS === 'web' ? 'svg' : 'png'
|
|
663
|
+
});
|
|
664
|
+
}, [emoji]),
|
|
665
|
+
_useMemo2 = _slicedToArray(_useMemo, 1),
|
|
666
|
+
emojiData = _useMemo2[0];
|
|
667
|
+
|
|
668
|
+
if (!emojiData) return null;
|
|
669
|
+
return /*#__PURE__*/jsx(StyledEmoji, {
|
|
670
|
+
size: size,
|
|
671
|
+
accessibilityLabel: emojiData.text,
|
|
672
|
+
source: {
|
|
673
|
+
uri: emojiData.url
|
|
674
|
+
},
|
|
675
|
+
style: style
|
|
676
|
+
});
|
|
531
677
|
}
|
|
532
678
|
|
|
533
679
|
var defaultOpenLinkBehavior = {
|
|
@@ -535,16 +681,20 @@ var defaultOpenLinkBehavior = {
|
|
|
535
681
|
web: 'targetBlank'
|
|
536
682
|
};
|
|
537
683
|
|
|
538
|
-
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; }
|
|
539
689
|
function ExternalLink(_ref) {
|
|
540
690
|
var Component = _ref.as,
|
|
541
691
|
href = _ref.href,
|
|
542
692
|
_ref$openLinkBehavior = _ref.openLinkBehavior,
|
|
543
693
|
openLinkBehavior = _ref$openLinkBehavior === void 0 ? defaultOpenLinkBehavior : _ref$openLinkBehavior,
|
|
544
694
|
onPress = _ref.onPress,
|
|
545
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
695
|
+
rest = _objectWithoutProperties(_ref, _excluded$9);
|
|
546
696
|
|
|
547
|
-
return /*#__PURE__*/
|
|
697
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$c(_objectSpread$c({}, rest), {}, {
|
|
548
698
|
onPress: function handleOnPress() {
|
|
549
699
|
if (onPress) onPress();
|
|
550
700
|
if (!href) return;
|
|
@@ -552,13 +702,13 @@ function ExternalLink(_ref) {
|
|
|
552
702
|
switch (openLinkBehavior["native"]) {
|
|
553
703
|
case 'openInModal':
|
|
554
704
|
case undefined:
|
|
555
|
-
|
|
705
|
+
openBrowserAsync(href)["catch"](function (err) {
|
|
556
706
|
console.error("An error occurred while opening ".concat(href), err);
|
|
557
707
|
});
|
|
558
708
|
break;
|
|
559
709
|
|
|
560
710
|
case 'openBrowserApp':
|
|
561
|
-
|
|
711
|
+
Linking.openURL(href)["catch"](function (err) {
|
|
562
712
|
console.error("An error occurred while opening ".concat(href), err);
|
|
563
713
|
});
|
|
564
714
|
break;
|
|
@@ -587,74 +737,34 @@ function InputFeedback(_ref) {
|
|
|
587
737
|
var state = _ref.state,
|
|
588
738
|
testID = _ref.testID,
|
|
589
739
|
children = _ref.children;
|
|
590
|
-
return /*#__PURE__*/
|
|
740
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
591
741
|
base: "body-small",
|
|
592
742
|
color: getColorFromState(state),
|
|
593
|
-
testID: testID
|
|
594
|
-
|
|
743
|
+
testID: testID,
|
|
744
|
+
children: children
|
|
745
|
+
});
|
|
595
746
|
}
|
|
596
747
|
|
|
597
|
-
var
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
/**
|
|
604
|
-
* min-width: 480px
|
|
605
|
-
*/
|
|
606
|
-
SMALL: 480,
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* min-width: 768px
|
|
610
|
-
*/
|
|
611
|
-
MEDIUM: 768,
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* min-width: 1024px
|
|
615
|
-
*/
|
|
616
|
-
LARGE: 1024,
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* min-width: 1280px
|
|
620
|
-
*/
|
|
621
|
-
WIDE: 1280
|
|
622
|
-
};
|
|
623
|
-
var KittBreakpointsMax = {
|
|
624
|
-
/**
|
|
625
|
-
* max-width: 479px
|
|
626
|
-
*/
|
|
627
|
-
BASE: KittBreakpoints.SMALL - 1,
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* max-width: 767px
|
|
631
|
-
*/
|
|
632
|
-
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* max-width: 1023px
|
|
636
|
-
*/
|
|
637
|
-
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* max-width: 1279px
|
|
641
|
-
*/
|
|
642
|
-
LARGE: KittBreakpoints.WIDE - 1
|
|
643
|
-
};
|
|
644
|
-
|
|
645
|
-
var _templateObject$o, _templateObject2$b, _templateObject3$7, _templateObject4$6;
|
|
646
|
-
var FieldContainer = styled(PrimitiveView)(_templateObject$o || (_templateObject$o = _taggedTemplateLiteral(["\n padding: 5px 0 10px;\n"])));
|
|
647
|
-
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) {
|
|
648
754
|
var theme = _ref.theme;
|
|
649
755
|
return theme.responsive.ifWindowSizeMatches({
|
|
650
756
|
minWidth: KittBreakpoints.SMALL
|
|
651
757
|
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
652
758
|
});
|
|
653
|
-
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) {
|
|
654
762
|
var theme = _ref2.theme;
|
|
655
763
|
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
656
764
|
});
|
|
657
|
-
var LabelContainer = styled(
|
|
765
|
+
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
766
|
+
displayName: "InputField__LabelContainer"
|
|
767
|
+
})(["margin-right:", "px;"], function (_ref3) {
|
|
658
768
|
var theme = _ref3.theme;
|
|
659
769
|
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
660
770
|
});
|
|
@@ -663,7 +773,15 @@ function InputField(_ref4) {
|
|
|
663
773
|
labelFeedback = _ref4.labelFeedback,
|
|
664
774
|
input = _ref4.input,
|
|
665
775
|
feedback = _ref4.feedback;
|
|
666
|
-
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
|
+
});
|
|
667
785
|
}
|
|
668
786
|
|
|
669
787
|
var useInputText = function () {
|
|
@@ -694,10 +812,12 @@ var useInputText = function () {
|
|
|
694
812
|
};
|
|
695
813
|
};
|
|
696
814
|
|
|
697
|
-
var _excluded$
|
|
815
|
+
var _excluded$8 = ["id", "minHeight", "type", "state", "internalForceState", "disabled", "onFocus", "onBlur"];
|
|
816
|
+
|
|
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; }
|
|
698
818
|
|
|
699
|
-
var
|
|
700
|
-
var styledTextInputMixin = css(
|
|
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) {
|
|
701
821
|
var theme = _ref.theme,
|
|
702
822
|
state = _ref.state;
|
|
703
823
|
return state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states["default"].backgroundColor;
|
|
@@ -713,7 +833,8 @@ var styledTextInputMixin = css(_templateObject$n || (_templateObject$n = _tagged
|
|
|
713
833
|
return theme.kitt.forms.input.states[state].borderColor;
|
|
714
834
|
}, function (_ref5) {
|
|
715
835
|
var theme = _ref5.theme;
|
|
716
|
-
|
|
836
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
837
|
+
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize;
|
|
717
838
|
}, function (_ref6) {
|
|
718
839
|
var theme = _ref6.theme,
|
|
719
840
|
state = _ref6.state;
|
|
@@ -722,26 +843,34 @@ var styledTextInputMixin = css(_templateObject$n || (_templateObject$n = _tagged
|
|
|
722
843
|
var theme = _ref7.theme;
|
|
723
844
|
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
724
845
|
});
|
|
725
|
-
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) {
|
|
726
849
|
var theme = _ref8.theme,
|
|
727
850
|
multiline = _ref8.multiline;
|
|
728
|
-
return !multiline &&
|
|
851
|
+
return !multiline && Platform.OS === 'ios' ? theme.kitt.forms.input.paddingSingleLineIOS : theme.kitt.forms.input.padding;
|
|
729
852
|
}, function (_ref9) {
|
|
730
853
|
var theme = _ref9.theme,
|
|
731
854
|
multiline = _ref9.multiline;
|
|
732
|
-
|
|
855
|
+
if (!multiline && Platform.OS === 'ios') return 0;
|
|
856
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
857
|
+
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight;
|
|
733
858
|
}, function (_ref10) {
|
|
734
859
|
var minHeight = _ref10.minHeight;
|
|
735
860
|
return minHeight;
|
|
736
861
|
});
|
|
737
|
-
var Container$
|
|
862
|
+
var Container$5 = /*#__PURE__*/styled.View.withConfig({
|
|
863
|
+
displayName: "InputText__Container"
|
|
864
|
+
})(["margin-top:", ";margin-bottom:", ";"], function (_ref11) {
|
|
738
865
|
var theme = _ref11.theme;
|
|
739
866
|
return theme.kitt.forms.input.marginTop;
|
|
740
867
|
}, function (_ref12) {
|
|
741
868
|
var theme = _ref12.theme;
|
|
742
869
|
return theme.kitt.forms.input.marginBottom;
|
|
743
870
|
});
|
|
744
|
-
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) {
|
|
745
874
|
var theme = _ref13.theme;
|
|
746
875
|
return theme.kitt.forms.input.passwordButtonIconSize / 2;
|
|
747
876
|
});
|
|
@@ -791,7 +920,7 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
791
920
|
disabled = _ref15$disabled === void 0 ? false : _ref15$disabled,
|
|
792
921
|
_onFocus = _ref15.onFocus,
|
|
793
922
|
_onBlur = _ref15.onBlur,
|
|
794
|
-
props = _objectWithoutProperties(_ref15, _excluded$
|
|
923
|
+
props = _objectWithoutProperties(_ref15, _excluded$8);
|
|
795
924
|
|
|
796
925
|
var _useInputText = useInputText(),
|
|
797
926
|
isFocused = _useInputText.isFocused,
|
|
@@ -800,54 +929,62 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
800
929
|
isPasswordVisible = _useInputText.isPasswordVisible,
|
|
801
930
|
togglePasswordVisibility = _useInputText.togglePasswordVisibility;
|
|
802
931
|
|
|
803
|
-
var theme = useTheme();
|
|
932
|
+
var theme = /*#__PURE__*/useTheme();
|
|
804
933
|
var state = internalForceState || getInputState({
|
|
805
934
|
isFocused: isFocused,
|
|
806
935
|
isDisabled: disabled,
|
|
807
936
|
formState: formState
|
|
808
937
|
});
|
|
809
|
-
return /*#__PURE__*/
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
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
|
+
});
|
|
839
971
|
});
|
|
840
972
|
|
|
841
973
|
function Label(_ref) {
|
|
842
|
-
_ref.htmlFor
|
|
843
|
-
|
|
844
|
-
return /*#__PURE__*/
|
|
845
|
-
base: "body"
|
|
846
|
-
|
|
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
|
+
});
|
|
847
983
|
}
|
|
848
984
|
|
|
849
|
-
var
|
|
850
|
-
|
|
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) {
|
|
851
988
|
var theme = _ref.theme,
|
|
852
989
|
disabled = _ref.disabled;
|
|
853
990
|
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor;
|
|
@@ -868,7 +1005,9 @@ var OuterRadio = styled(PrimitiveView)(_templateObject$m || (_templateObject$m =
|
|
|
868
1005
|
disabled = _ref6.disabled;
|
|
869
1006
|
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor;
|
|
870
1007
|
});
|
|
871
|
-
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) {
|
|
872
1011
|
var theme = _ref7.theme;
|
|
873
1012
|
return theme.kitt.forms.radio.checked.backgroundColor;
|
|
874
1013
|
}, function (_ref8) {
|
|
@@ -881,7 +1020,9 @@ var SelectedOuterRadio = styled(PrimitiveView)(_templateObject2$9 || (_templateO
|
|
|
881
1020
|
var theme = _ref10.theme;
|
|
882
1021
|
return theme.kitt.forms.radio.size / 2;
|
|
883
1022
|
});
|
|
884
|
-
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) {
|
|
885
1026
|
var theme = _ref11.theme;
|
|
886
1027
|
return theme.kitt.forms.radio.checked.innerBackgroundColor;
|
|
887
1028
|
}, function (_ref12) {
|
|
@@ -894,8 +1035,12 @@ var SelectedInnerRadio = styled(PrimitiveView)(_templateObject3$5 || (_templateO
|
|
|
894
1035
|
var theme = _ref14.theme;
|
|
895
1036
|
return theme.kitt.forms.radio.checked.innerSize / 2;
|
|
896
1037
|
});
|
|
897
|
-
var Container$
|
|
898
|
-
|
|
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) {
|
|
899
1044
|
var theme = _ref15.theme;
|
|
900
1045
|
return theme.kitt.spacing * 2;
|
|
901
1046
|
});
|
|
@@ -907,7 +1052,7 @@ function Radio(_ref16) {
|
|
|
907
1052
|
_ref16$disabled = _ref16.disabled,
|
|
908
1053
|
disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
|
|
909
1054
|
children = _ref16.children;
|
|
910
|
-
return /*#__PURE__*/
|
|
1055
|
+
return /*#__PURE__*/jsxs(Container$4, {
|
|
911
1056
|
nativeID: id,
|
|
912
1057
|
disabled: disabled,
|
|
913
1058
|
accessibilityRole: "radio",
|
|
@@ -915,29 +1060,37 @@ function Radio(_ref16) {
|
|
|
915
1060
|
focusable: checked && !disabled,
|
|
916
1061
|
onPress: function handlePress() {
|
|
917
1062
|
onChange(value);
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
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
|
+
});
|
|
925
1074
|
}
|
|
926
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; }
|
|
927
1079
|
function TextArea(_ref) {
|
|
928
1080
|
var props = _extends({}, _ref);
|
|
929
1081
|
|
|
930
|
-
var theme = useTheme();
|
|
931
|
-
return /*#__PURE__*/
|
|
1082
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1083
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$a(_objectSpread$a({
|
|
932
1084
|
multiline: true
|
|
933
|
-
}, props, {
|
|
1085
|
+
}, props), {}, {
|
|
934
1086
|
type: "text",
|
|
935
1087
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
936
1088
|
}));
|
|
937
1089
|
}
|
|
938
1090
|
|
|
939
|
-
var
|
|
940
|
-
|
|
1091
|
+
var Body = /*#__PURE__*/styled.View.withConfig({
|
|
1092
|
+
displayName: "Body"
|
|
1093
|
+
})(["", " background-color:", ";flex:1;"], function (_ref) {
|
|
941
1094
|
var theme = _ref.theme;
|
|
942
1095
|
return theme.responsive.ifWindowSizeMatches({
|
|
943
1096
|
minWidth: KittBreakpoints.MEDIUM
|
|
@@ -948,11 +1101,14 @@ var Body = styled(PrimitiveView)(_templateObject$l || (_templateObject$l = _tagg
|
|
|
948
1101
|
});
|
|
949
1102
|
function FullScreenModalBody(_ref3) {
|
|
950
1103
|
var children = _ref3.children;
|
|
951
|
-
return /*#__PURE__*/
|
|
1104
|
+
return /*#__PURE__*/jsx(Body, {
|
|
1105
|
+
children: children
|
|
1106
|
+
});
|
|
952
1107
|
}
|
|
953
1108
|
|
|
954
|
-
var
|
|
955
|
-
|
|
1109
|
+
var SideContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1110
|
+
displayName: "Header__SideContainer"
|
|
1111
|
+
})(["", ""], function (_ref) {
|
|
956
1112
|
var theme = _ref.theme,
|
|
957
1113
|
_ref$side = _ref.side,
|
|
958
1114
|
side = _ref$side === void 0 ? 'left' : _ref$side;
|
|
@@ -969,7 +1125,9 @@ function getHeaderHorizontalMediumPadding(spacing) {
|
|
|
969
1125
|
return spacing * 6;
|
|
970
1126
|
}
|
|
971
1127
|
|
|
972
|
-
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) {
|
|
973
1131
|
var theme = _ref2.theme,
|
|
974
1132
|
_ref2$insetTop = _ref2.insetTop,
|
|
975
1133
|
insetTop = _ref2$insetTop === void 0 ? 0 : _ref2$insetTop;
|
|
@@ -984,7 +1142,9 @@ var Header = styled(PrimitiveView)(_templateObject2$8 || (_templateObject2$8 = _
|
|
|
984
1142
|
var theme = _ref3.theme;
|
|
985
1143
|
return theme.kitt.fullScreenModal.header.borderColor;
|
|
986
1144
|
});
|
|
987
|
-
var HeaderContent = styled(
|
|
1145
|
+
var HeaderContent = /*#__PURE__*/styled.View.withConfig({
|
|
1146
|
+
displayName: "Header__HeaderContent"
|
|
1147
|
+
})(["", ";", ";justify-content:center;align-items:center;"], function (_ref4) {
|
|
988
1148
|
var theme = _ref4.theme,
|
|
989
1149
|
leftWidth = _ref4.leftWidth,
|
|
990
1150
|
rightWidth = _ref4.rightWidth,
|
|
@@ -1022,8 +1182,8 @@ function FullScreenModalHeader(_ref6) {
|
|
|
1022
1182
|
right = _ref6.right,
|
|
1023
1183
|
left = _ref6.left;
|
|
1024
1184
|
|
|
1025
|
-
var _useSafeAreaInsets = useSafeAreaInsets()
|
|
1026
|
-
_useSafeAreaInsets.top;
|
|
1185
|
+
var _useSafeAreaInsets = useSafeAreaInsets(),
|
|
1186
|
+
top = _useSafeAreaInsets.top;
|
|
1027
1187
|
|
|
1028
1188
|
var dimensions = useWindowDimensions();
|
|
1029
1189
|
|
|
@@ -1049,38 +1209,69 @@ function FullScreenModalHeader(_ref6) {
|
|
|
1049
1209
|
setRightWidth(event.nativeEvent.layout.width);
|
|
1050
1210
|
};
|
|
1051
1211
|
|
|
1052
|
-
return /*#__PURE__*/
|
|
1053
|
-
insetTop: undefined
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
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
|
+
});
|
|
1068
1232
|
}
|
|
1069
1233
|
|
|
1070
|
-
var
|
|
1071
|
-
|
|
1234
|
+
var Container$3 = /*#__PURE__*/styled.View.withConfig({
|
|
1235
|
+
displayName: "FullScreenModal__Container"
|
|
1236
|
+
})(["flex:1;background-color:", ";"], function (_ref) {
|
|
1072
1237
|
var theme = _ref.theme;
|
|
1073
1238
|
return theme.kitt.colors.uiBackground;
|
|
1074
1239
|
});
|
|
1075
1240
|
function FullScreenModal(_ref2) {
|
|
1076
1241
|
var children = _ref2.children;
|
|
1077
|
-
return /*#__PURE__*/
|
|
1242
|
+
return /*#__PURE__*/jsx(Container$3, {
|
|
1243
|
+
children: children
|
|
1244
|
+
});
|
|
1078
1245
|
}
|
|
1079
1246
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
1080
1247
|
FullScreenModal.Body = FullScreenModalBody;
|
|
1081
1248
|
|
|
1082
|
-
var
|
|
1083
|
-
|
|
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) {
|
|
1084
1275
|
var theme = _ref.theme;
|
|
1085
1276
|
return theme.kitt.iconButton.borderRadius;
|
|
1086
1277
|
}, function (_ref2) {
|
|
@@ -1090,15 +1281,36 @@ var PressableIconButton = styled(PrimitivePressable)(_templateObject$i || (_temp
|
|
|
1090
1281
|
var theme = _ref3.theme;
|
|
1091
1282
|
return theme.kitt.iconButton.height;
|
|
1092
1283
|
}, function (_ref4) {
|
|
1093
|
-
var theme = _ref4.theme
|
|
1094
|
-
_ref4.
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
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 ");
|
|
1098
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
|
+
}
|
|
1099
1310
|
|
|
1100
|
-
var
|
|
1101
|
-
|
|
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) {
|
|
1102
1314
|
var theme = _ref.theme,
|
|
1103
1315
|
color = _ref.color,
|
|
1104
1316
|
disabled = _ref.disabled;
|
|
@@ -1116,14 +1328,16 @@ var AnimatedIconButtonBackground = styled(Animated$1.View)(_templateObject$h ||
|
|
|
1116
1328
|
var theme = _ref4.theme;
|
|
1117
1329
|
return theme.kitt.iconButton.height;
|
|
1118
1330
|
});
|
|
1119
|
-
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%;"]);
|
|
1120
1334
|
function PressableAnimatedContainer(_ref5) {
|
|
1121
1335
|
var disabled = _ref5.disabled,
|
|
1122
1336
|
_ref5$color = _ref5.color,
|
|
1123
1337
|
color = _ref5$color === void 0 ? 'black' : _ref5$color,
|
|
1124
1338
|
children = _ref5.children,
|
|
1125
1339
|
onPress = _ref5.onPress;
|
|
1126
|
-
var theme = useTheme();
|
|
1340
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1127
1341
|
var pressed = useSharedValue(false);
|
|
1128
1342
|
var opacityStyles = useAnimatedStyle(function () {
|
|
1129
1343
|
var _f = function () {
|
|
@@ -1138,7 +1352,7 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1138
1352
|
};
|
|
1139
1353
|
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
1140
1354
|
_f.__workletHash = 10645190329247;
|
|
1141
|
-
_f.__location = "/home/
|
|
1355
|
+
_f.__location = "/home/chris/ornikar/kitt/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (54:41)";
|
|
1142
1356
|
_f.__optimalization = 2;
|
|
1143
1357
|
|
|
1144
1358
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -1172,14 +1386,14 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1172
1386
|
};
|
|
1173
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)}]};}}";
|
|
1174
1388
|
_f.__workletHash = 13861998831411;
|
|
1175
|
-
_f.__location = "/home/
|
|
1389
|
+
_f.__location = "/home/chris/ornikar/kitt/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:39)";
|
|
1176
1390
|
_f.__optimalization = 2;
|
|
1177
1391
|
|
|
1178
1392
|
global.__reanimatedWorkletInit(_f);
|
|
1179
1393
|
|
|
1180
1394
|
return _f;
|
|
1181
1395
|
}());
|
|
1182
|
-
return /*#__PURE__*/
|
|
1396
|
+
return /*#__PURE__*/jsx(PressableIconButton, {
|
|
1183
1397
|
accessibilityRole: "button",
|
|
1184
1398
|
disabled: disabled,
|
|
1185
1399
|
color: color,
|
|
@@ -1189,24 +1403,27 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1189
1403
|
},
|
|
1190
1404
|
onPressOut: function onPressOut() {
|
|
1191
1405
|
pressed.value = false;
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
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
|
+
});
|
|
1206
1422
|
}
|
|
1207
1423
|
|
|
1208
|
-
var
|
|
1209
|
-
|
|
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) {
|
|
1210
1427
|
var theme = _ref.theme;
|
|
1211
1428
|
return "".concat(theme.kitt.iconButton.borderWidth, "px solid");
|
|
1212
1429
|
}, function (_ref2) {
|
|
@@ -1228,12 +1445,13 @@ function IconButtonContent(_ref6) {
|
|
|
1228
1445
|
var disabled = _ref6.disabled,
|
|
1229
1446
|
color = _ref6.color,
|
|
1230
1447
|
icon = _ref6.icon;
|
|
1231
|
-
return /*#__PURE__*/
|
|
1232
|
-
disabled: disabled
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1448
|
+
return /*#__PURE__*/jsx(IconButtonContentBorder, {
|
|
1449
|
+
disabled: disabled,
|
|
1450
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
1451
|
+
color: disabled ? 'black-light' : color,
|
|
1452
|
+
icon: icon
|
|
1453
|
+
})
|
|
1454
|
+
});
|
|
1237
1455
|
}
|
|
1238
1456
|
|
|
1239
1457
|
function IconButton(_ref7) {
|
|
@@ -1241,33 +1459,44 @@ function IconButton(_ref7) {
|
|
|
1241
1459
|
color = _ref7.color,
|
|
1242
1460
|
disabled = _ref7.disabled,
|
|
1243
1461
|
onPress = _ref7.onPress;
|
|
1244
|
-
return /*#__PURE__*/
|
|
1462
|
+
return /*#__PURE__*/jsx(PressableAnimatedContainer, {
|
|
1245
1463
|
color: color,
|
|
1246
1464
|
disabled: disabled,
|
|
1247
|
-
onPress: onPress
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1465
|
+
onPress: onPress,
|
|
1466
|
+
children: /*#__PURE__*/jsx(IconButtonContent, {
|
|
1467
|
+
disabled: disabled,
|
|
1468
|
+
color: color,
|
|
1469
|
+
icon: icon
|
|
1470
|
+
})
|
|
1471
|
+
});
|
|
1253
1472
|
}
|
|
1254
1473
|
|
|
1255
1474
|
var _excluded$5 = ["children"];
|
|
1256
1475
|
|
|
1257
|
-
var
|
|
1258
|
-
|
|
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;"]);
|
|
1259
1482
|
function ListItemContent(_ref) {
|
|
1260
1483
|
var children = _ref.children,
|
|
1261
1484
|
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
1262
1485
|
|
|
1263
|
-
return /*#__PURE__*/
|
|
1486
|
+
return /*#__PURE__*/jsx(ContentView$1, _objectSpread$7(_objectSpread$7({}, rest), {}, {
|
|
1487
|
+
children: children
|
|
1488
|
+
}));
|
|
1264
1489
|
}
|
|
1265
1490
|
|
|
1266
1491
|
var _excluded$4 = ["children", "side"],
|
|
1267
1492
|
_excluded2$1 = ["children", "align"];
|
|
1268
1493
|
|
|
1269
|
-
|
|
1270
|
-
|
|
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) {
|
|
1271
1500
|
var theme = _ref.theme,
|
|
1272
1501
|
side = _ref.side;
|
|
1273
1502
|
return side === 'right' ? theme.kitt.listItem.innerMargin : 0;
|
|
@@ -1283,11 +1512,15 @@ function ListItemSideContainer(_ref3) {
|
|
|
1283
1512
|
side = _ref3$side === void 0 ? 'left' : _ref3$side,
|
|
1284
1513
|
rest = _objectWithoutProperties(_ref3, _excluded$4);
|
|
1285
1514
|
|
|
1286
|
-
return /*#__PURE__*/
|
|
1515
|
+
return /*#__PURE__*/jsx(SideContainerView, _objectSpread$6(_objectSpread$6({
|
|
1287
1516
|
side: side
|
|
1288
|
-
}, rest),
|
|
1517
|
+
}, rest), {}, {
|
|
1518
|
+
children: children
|
|
1519
|
+
}));
|
|
1289
1520
|
}
|
|
1290
|
-
var SideContentView = styled(
|
|
1521
|
+
var SideContentView = /*#__PURE__*/styled.View.withConfig({
|
|
1522
|
+
displayName: "ListItemSideContent__SideContentView"
|
|
1523
|
+
})(["align-self:", ";"], function (_ref4) {
|
|
1291
1524
|
var align = _ref4.align;
|
|
1292
1525
|
return align;
|
|
1293
1526
|
});
|
|
@@ -1297,19 +1530,21 @@ function ListItemSideContent(_ref5) {
|
|
|
1297
1530
|
align = _ref5$align === void 0 ? 'auto' : _ref5$align,
|
|
1298
1531
|
rest = _objectWithoutProperties(_ref5, _excluded2$1);
|
|
1299
1532
|
|
|
1300
|
-
return /*#__PURE__*/
|
|
1533
|
+
return /*#__PURE__*/jsx(SideContentView, _objectSpread$6(_objectSpread$6({
|
|
1301
1534
|
align: align
|
|
1302
|
-
}, rest),
|
|
1535
|
+
}, rest), {}, {
|
|
1536
|
+
children: children
|
|
1537
|
+
}));
|
|
1303
1538
|
}
|
|
1304
1539
|
|
|
1305
1540
|
var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
|
|
1306
1541
|
|
|
1307
|
-
var
|
|
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; }
|
|
1308
1543
|
|
|
1309
|
-
function
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
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) {
|
|
1313
1548
|
var withPadding = _ref.withPadding,
|
|
1314
1549
|
theme = _ref.theme;
|
|
1315
1550
|
return withPadding ? theme.kitt.listItem.padding : 0;
|
|
@@ -1347,26 +1582,35 @@ function ListItem(_ref5) {
|
|
|
1347
1582
|
onPress = _ref5.onPress,
|
|
1348
1583
|
rest = _objectWithoutProperties(_ref5, _excluded$3);
|
|
1349
1584
|
|
|
1350
|
-
var Wrapper = onPress ?
|
|
1351
|
-
var wrapperProps = onPress ? _objectSpread$
|
|
1585
|
+
var Wrapper = onPress ? Pressable : Fragment;
|
|
1586
|
+
var wrapperProps = onPress ? _objectSpread$5({
|
|
1352
1587
|
accessibilityRole: 'button',
|
|
1353
1588
|
onPress: onPress
|
|
1354
1589
|
}, rest) : undefined;
|
|
1355
1590
|
var containerProps = onPress ? undefined : rest;
|
|
1356
|
-
return /*#__PURE__*/
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
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
|
+
}));
|
|
1364
1607
|
}
|
|
1365
1608
|
ListItem.Content = ListItemContent;
|
|
1366
1609
|
ListItem.SideContent = ListItemSideContent;
|
|
1367
1610
|
ListItem.SideContainer = ListItemSideContainer;
|
|
1368
1611
|
|
|
1369
1612
|
function getActivityIndicatorSize(size) {
|
|
1613
|
+
if (Platform.OS === 'android') return size;
|
|
1370
1614
|
return size < 36 ? 'small' : 'large';
|
|
1371
1615
|
}
|
|
1372
1616
|
|
|
@@ -1375,9 +1619,9 @@ function Loader(_ref) {
|
|
|
1375
1619
|
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
1376
1620
|
_ref$size = _ref.size,
|
|
1377
1621
|
size = _ref$size === void 0 ? 20 : _ref$size;
|
|
1378
|
-
var theme = useTheme();
|
|
1622
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1379
1623
|
var colorHex = theme.kitt.typography.colors[color];
|
|
1380
|
-
return /*#__PURE__*/
|
|
1624
|
+
return /*#__PURE__*/jsx(ActivityIndicator, {
|
|
1381
1625
|
testID: "ActivityIndicator",
|
|
1382
1626
|
color: colorHex,
|
|
1383
1627
|
size: getActivityIndicatorSize(size)
|
|
@@ -1387,16 +1631,17 @@ function Loader(_ref) {
|
|
|
1387
1631
|
function LargeLoader(_ref) {
|
|
1388
1632
|
var _ref$color = _ref.color,
|
|
1389
1633
|
color = _ref$color === void 0 ? 'primary' : _ref$color;
|
|
1390
|
-
return /*#__PURE__*/
|
|
1634
|
+
return /*#__PURE__*/jsx(Loader, {
|
|
1391
1635
|
color: color,
|
|
1392
1636
|
size: 60
|
|
1393
1637
|
});
|
|
1394
1638
|
}
|
|
1395
1639
|
|
|
1396
|
-
var _templateObject$c, _templateObject2$5, _templateObject3$3, _templateObject4$3;
|
|
1397
1640
|
var xIconSize = 14;
|
|
1398
1641
|
var mainIconSize = 20;
|
|
1399
|
-
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) {
|
|
1400
1645
|
var theme = _ref.theme,
|
|
1401
1646
|
noRadius = _ref.noRadius;
|
|
1402
1647
|
return noRadius ? 0 : theme.kitt.spacing * 5;
|
|
@@ -1420,18 +1665,24 @@ var Container$1 = styled(PrimitiveView)(_templateObject$c || (_templateObject$c
|
|
|
1420
1665
|
insets = _ref6.insets;
|
|
1421
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;
|
|
1422
1667
|
});
|
|
1423
|
-
var CloseContainer = styled(TouchableOpacity)(
|
|
1668
|
+
var CloseContainer = /*#__PURE__*/styled(TouchableOpacity).withConfig({
|
|
1669
|
+
displayName: "Message__CloseContainer"
|
|
1670
|
+
})(["margin-left:", "px;padding:", "px;"], function (_ref7) {
|
|
1424
1671
|
var theme = _ref7.theme;
|
|
1425
1672
|
return theme.kitt.spacing * 4;
|
|
1426
1673
|
}, function (_ref8) {
|
|
1427
1674
|
var theme = _ref8.theme;
|
|
1428
1675
|
return theme.kitt.spacing;
|
|
1429
1676
|
});
|
|
1430
|
-
var IconContainer = styled(
|
|
1677
|
+
var IconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1678
|
+
displayName: "Message__IconContainer"
|
|
1679
|
+
})(["margin-right:", "px;"], function (_ref9) {
|
|
1431
1680
|
var theme = _ref9.theme;
|
|
1432
1681
|
return theme.kitt.spacing * 4;
|
|
1433
1682
|
});
|
|
1434
|
-
var Content = styled(
|
|
1683
|
+
var Content = /*#__PURE__*/styled.Text.withConfig({
|
|
1684
|
+
displayName: "Message__Content"
|
|
1685
|
+
})(["text-align:", ";flex:1;"], function (_ref10) {
|
|
1435
1686
|
var centeredText = _ref10.centeredText;
|
|
1436
1687
|
return centeredText ? 'center' : 'left';
|
|
1437
1688
|
});
|
|
@@ -1453,16 +1704,16 @@ var getColorByType = function (type) {
|
|
|
1453
1704
|
function getIconContent(type) {
|
|
1454
1705
|
switch (type) {
|
|
1455
1706
|
case 'warning':
|
|
1456
|
-
return /*#__PURE__*/
|
|
1707
|
+
return /*#__PURE__*/jsx(AlertCircleIcon, {});
|
|
1457
1708
|
|
|
1458
1709
|
case 'success':
|
|
1459
|
-
return /*#__PURE__*/
|
|
1710
|
+
return /*#__PURE__*/jsx(CheckIcon, {});
|
|
1460
1711
|
|
|
1461
1712
|
case 'danger':
|
|
1462
|
-
return /*#__PURE__*/
|
|
1713
|
+
return /*#__PURE__*/jsx(AlertTriangleIcon, {});
|
|
1463
1714
|
|
|
1464
1715
|
default:
|
|
1465
|
-
return /*#__PURE__*/
|
|
1716
|
+
return /*#__PURE__*/jsx(InfoIcon, {});
|
|
1466
1717
|
}
|
|
1467
1718
|
}
|
|
1468
1719
|
|
|
@@ -1477,50 +1728,59 @@ function Message(_ref11) {
|
|
|
1477
1728
|
onDismiss = _ref11.onDismiss,
|
|
1478
1729
|
insets = _ref11.insets;
|
|
1479
1730
|
var color = getColorByType(type);
|
|
1480
|
-
return /*#__PURE__*/
|
|
1731
|
+
return /*#__PURE__*/jsxs(Container$2, {
|
|
1481
1732
|
type: type,
|
|
1482
1733
|
noRadius: noRadius,
|
|
1483
|
-
insets: insets
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
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
|
+
});
|
|
1501
1758
|
}
|
|
1502
1759
|
|
|
1503
|
-
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; }
|
|
1504
1761
|
|
|
1505
|
-
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; }
|
|
1506
|
-
|
|
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) {
|
|
1507
1767
|
var theme = _ref.theme;
|
|
1508
|
-
return _objectSpread(_objectSpread({}, StyleSheet.absoluteFillObject), {}, {
|
|
1768
|
+
return _objectSpread$4(_objectSpread$4({}, StyleSheet.absoluteFillObject), {}, {
|
|
1509
1769
|
backgroundColor: theme.kitt.colors.overlay.dark
|
|
1510
1770
|
});
|
|
1511
1771
|
});
|
|
1512
1772
|
function Overlay(_ref2) {
|
|
1513
1773
|
var onPress = _ref2.onPress;
|
|
1514
|
-
return /*#__PURE__*/
|
|
1774
|
+
return /*#__PURE__*/jsx(OverlayPressable, {
|
|
1515
1775
|
accessibilityRole: "none",
|
|
1516
|
-
onPress: onPress
|
|
1517
|
-
|
|
1776
|
+
onPress: onPress,
|
|
1777
|
+
children: /*#__PURE__*/jsx(View, {})
|
|
1778
|
+
});
|
|
1518
1779
|
}
|
|
1519
1780
|
|
|
1520
|
-
var
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
var BodyView = styled(PrimitiveView)(_templateObject$b || (_templateObject$b = _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) {
|
|
1524
1784
|
var theme = _ref.theme;
|
|
1525
1785
|
return theme.kitt.spacing * 6;
|
|
1526
1786
|
}, function (_ref2) {
|
|
@@ -1529,11 +1789,16 @@ var BodyView = styled(PrimitiveView)(_templateObject$b || (_templateObject$b = _
|
|
|
1529
1789
|
});
|
|
1530
1790
|
function ModalBody(_ref3) {
|
|
1531
1791
|
var children = _ref3.children;
|
|
1532
|
-
return /*#__PURE__*/
|
|
1792
|
+
return /*#__PURE__*/jsx(ScrollView, {
|
|
1793
|
+
children: /*#__PURE__*/jsx(BodyView, {
|
|
1794
|
+
children: children
|
|
1795
|
+
})
|
|
1796
|
+
});
|
|
1533
1797
|
}
|
|
1534
1798
|
|
|
1535
|
-
var
|
|
1536
|
-
|
|
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) {
|
|
1537
1802
|
var theme = _ref.theme;
|
|
1538
1803
|
return theme.kitt.spacing * 4;
|
|
1539
1804
|
}, function (_ref2) {
|
|
@@ -1542,28 +1807,37 @@ var FooterView = styled(PrimitiveView)(_templateObject$a || (_templateObject$a =
|
|
|
1542
1807
|
});
|
|
1543
1808
|
function ModalFooter(_ref3) {
|
|
1544
1809
|
var children = _ref3.children;
|
|
1545
|
-
return /*#__PURE__*/
|
|
1810
|
+
return /*#__PURE__*/jsx(FooterView, {
|
|
1811
|
+
children: children
|
|
1812
|
+
});
|
|
1546
1813
|
}
|
|
1547
1814
|
|
|
1548
1815
|
var OnCloseContext = /*#__PURE__*/createContext(function () {});
|
|
1549
1816
|
|
|
1550
|
-
var
|
|
1551
|
-
|
|
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) {
|
|
1552
1820
|
var theme = _ref.theme;
|
|
1553
1821
|
return theme.kitt.spacing * 2;
|
|
1554
1822
|
}, function (_ref2) {
|
|
1555
1823
|
var theme = _ref2.theme;
|
|
1556
1824
|
return theme.kitt.colors.separator;
|
|
1557
1825
|
});
|
|
1558
|
-
var LeftIconView = styled(
|
|
1826
|
+
var LeftIconView = /*#__PURE__*/styled.View.withConfig({
|
|
1827
|
+
displayName: "Header__LeftIconView"
|
|
1828
|
+
})(["align-self:flex-start;margin-right:", "px;"], function (_ref3) {
|
|
1559
1829
|
var theme = _ref3.theme;
|
|
1560
1830
|
return theme.kitt.spacing * 2;
|
|
1561
1831
|
});
|
|
1562
|
-
var RightIconView = styled(
|
|
1832
|
+
var RightIconView = /*#__PURE__*/styled.View.withConfig({
|
|
1833
|
+
displayName: "Header__RightIconView"
|
|
1834
|
+
})(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
|
|
1563
1835
|
var theme = _ref4.theme;
|
|
1564
1836
|
return theme.kitt.spacing * 2;
|
|
1565
1837
|
});
|
|
1566
|
-
var TitleView = styled(
|
|
1838
|
+
var TitleView = /*#__PURE__*/styled.View.withConfig({
|
|
1839
|
+
displayName: "Header__TitleView"
|
|
1840
|
+
})(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
|
|
1567
1841
|
var theme = _ref5.theme,
|
|
1568
1842
|
isIconLeft = _ref5.isIconLeft;
|
|
1569
1843
|
return isIconLeft ? 0 : theme.kitt.spacing * 2;
|
|
@@ -1574,24 +1848,34 @@ function ModalHeader(_ref6) {
|
|
|
1574
1848
|
children = _ref6.children;
|
|
1575
1849
|
var onClose = useContext(OnCloseContext);
|
|
1576
1850
|
var isIconLeft = !!left;
|
|
1577
|
-
return /*#__PURE__*/
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
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
|
+
});
|
|
1584
1865
|
}
|
|
1585
1866
|
|
|
1586
|
-
var
|
|
1587
|
-
|
|
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) {
|
|
1588
1870
|
var theme = _ref.theme;
|
|
1589
1871
|
return theme.kitt.spacing * 20;
|
|
1590
1872
|
}, function (_ref2) {
|
|
1591
1873
|
var theme = _ref2.theme;
|
|
1592
1874
|
return theme.kitt.spacing * 4;
|
|
1593
1875
|
});
|
|
1594
|
-
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) {
|
|
1595
1879
|
var theme = _ref3.theme;
|
|
1596
1880
|
return theme.kitt.card.borderRadius;
|
|
1597
1881
|
}, function (_ref4) {
|
|
@@ -1604,18 +1888,24 @@ function Modal(_ref5) {
|
|
|
1604
1888
|
onClose = _ref5.onClose,
|
|
1605
1889
|
onEntered = _ref5.onEntered,
|
|
1606
1890
|
onExited = _ref5.onExited;
|
|
1607
|
-
return /*#__PURE__*/
|
|
1608
|
-
value: onClose
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
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
|
+
});
|
|
1619
1909
|
}
|
|
1620
1910
|
Modal.Header = ModalHeader;
|
|
1621
1911
|
Modal.Body = ModalBody;
|
|
@@ -1630,25 +1920,25 @@ function Notification(_ref) {
|
|
|
1630
1920
|
var _useSafeAreaInsets = useSafeAreaInsets(),
|
|
1631
1921
|
top = _useSafeAreaInsets.top;
|
|
1632
1922
|
|
|
1633
|
-
return /*#__PURE__*/
|
|
1923
|
+
return /*#__PURE__*/jsx(Message, {
|
|
1634
1924
|
noRadius: true,
|
|
1635
1925
|
type: type,
|
|
1636
1926
|
centeredText: centeredText,
|
|
1637
1927
|
insets: {
|
|
1638
1928
|
top: top
|
|
1639
1929
|
},
|
|
1640
|
-
onDismiss: onDelete
|
|
1641
|
-
|
|
1930
|
+
onDismiss: onDelete,
|
|
1931
|
+
children: children
|
|
1932
|
+
});
|
|
1642
1933
|
}
|
|
1643
1934
|
|
|
1644
|
-
var
|
|
1645
|
-
|
|
1646
|
-
var _templateObject$7;
|
|
1647
|
-
var Flex = styled(PrimitiveView).withConfig({
|
|
1935
|
+
var Flex = /*#__PURE__*/styled.View.withConfig({
|
|
1648
1936
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
1649
1937
|
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
1650
1938
|
}
|
|
1651
|
-
})(
|
|
1939
|
+
}).withConfig({
|
|
1940
|
+
displayName: "Flex"
|
|
1941
|
+
})(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], function (_ref) {
|
|
1652
1942
|
var direction = _ref.direction;
|
|
1653
1943
|
return direction;
|
|
1654
1944
|
}, function (_ref2) {
|
|
@@ -1660,8 +1950,6 @@ var Flex = styled(PrimitiveView).withConfig({
|
|
|
1660
1950
|
|
|
1661
1951
|
var storyPadding = 16;
|
|
1662
1952
|
|
|
1663
|
-
var _templateObject$6;
|
|
1664
|
-
|
|
1665
1953
|
var getBackgroundColorFromBlockColor = function (theme) {
|
|
1666
1954
|
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'transparent';
|
|
1667
1955
|
|
|
@@ -1700,7 +1988,9 @@ var useStoryBlockColor = function (color) {
|
|
|
1700
1988
|
var storyBlockColor = useContext(StoryBlockColorContext);
|
|
1701
1989
|
return color || storyBlockColor;
|
|
1702
1990
|
};
|
|
1703
|
-
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) {
|
|
1704
1994
|
var theme = _ref.theme,
|
|
1705
1995
|
background = _ref.background;
|
|
1706
1996
|
return getBackgroundColorFromBlockColor(theme, background);
|
|
@@ -1708,40 +1998,52 @@ var StyledStoryBlockView = styled(PrimitiveView)(_templateObject$6 || (_template
|
|
|
1708
1998
|
function StoryBlock(_ref2) {
|
|
1709
1999
|
var children = _ref2.children,
|
|
1710
2000
|
background = _ref2.background;
|
|
1711
|
-
return /*#__PURE__*/
|
|
1712
|
-
background: background
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
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;"]);
|
|
1723
2019
|
function StoryTitle(_ref) {
|
|
1724
2020
|
var color = _ref.color,
|
|
1725
2021
|
children = _ref.children,
|
|
1726
2022
|
numberOfLines = _ref.numberOfLines;
|
|
1727
|
-
return /*#__PURE__*/
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
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
|
+
});
|
|
1733
2032
|
}
|
|
1734
2033
|
|
|
1735
2034
|
function StoryTitleLevel2(_ref2) {
|
|
1736
2035
|
var color = _ref2.color,
|
|
1737
2036
|
children = _ref2.children,
|
|
1738
2037
|
numberOfLines = _ref2.numberOfLines;
|
|
1739
|
-
return /*#__PURE__*/
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
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
|
+
});
|
|
1745
2047
|
}
|
|
1746
2048
|
|
|
1747
2049
|
StoryTitleLevel2.displayName = 'StoryTitle.Level2';
|
|
@@ -1750,13 +2052,16 @@ function StoryTitleLevel3(_ref3) {
|
|
|
1750
2052
|
var color = _ref3.color,
|
|
1751
2053
|
children = _ref3.children,
|
|
1752
2054
|
numberOfLines = _ref3.numberOfLines;
|
|
1753
|
-
return /*#__PURE__*/
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
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
|
+
});
|
|
1760
2065
|
}
|
|
1761
2066
|
|
|
1762
2067
|
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
@@ -1765,13 +2070,16 @@ function StoryTitleLevel4(_ref4) {
|
|
|
1765
2070
|
var color = _ref4.color,
|
|
1766
2071
|
children = _ref4.children,
|
|
1767
2072
|
numberOfLines = _ref4.numberOfLines;
|
|
1768
|
-
return /*#__PURE__*/
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
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
|
+
});
|
|
1775
2083
|
}
|
|
1776
2084
|
|
|
1777
2085
|
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
@@ -1779,63 +2087,89 @@ StoryTitle.Level2 = StoryTitleLevel2;
|
|
|
1779
2087
|
StoryTitle.Level3 = StoryTitleLevel3;
|
|
1780
2088
|
StoryTitle.Level4 = StoryTitleLevel4;
|
|
1781
2089
|
|
|
1782
|
-
var
|
|
1783
|
-
|
|
2090
|
+
var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
|
|
2091
|
+
displayName: "Story__StoryContainer"
|
|
2092
|
+
})(["padding:", "px;"], storyPadding);
|
|
1784
2093
|
function Story(_ref) {
|
|
1785
2094
|
var title = _ref.title,
|
|
1786
2095
|
contentContainerStyle = _ref.contentContainerStyle,
|
|
1787
2096
|
children = _ref.children;
|
|
1788
|
-
return /*#__PURE__*/
|
|
1789
|
-
contentContainerStyle: contentContainerStyle
|
|
1790
|
-
|
|
2097
|
+
return /*#__PURE__*/jsxs(StoryContainer$1, {
|
|
2098
|
+
contentContainerStyle: contentContainerStyle,
|
|
2099
|
+
children: [/*#__PURE__*/jsx(StoryTitle, {
|
|
2100
|
+
children: title
|
|
2101
|
+
}), children]
|
|
2102
|
+
});
|
|
1791
2103
|
}
|
|
1792
2104
|
|
|
1793
|
-
var _excluded$2 = ["title", "
|
|
1794
|
-
_excluded2 = ["title", "
|
|
1795
|
-
_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; }
|
|
1796
2110
|
|
|
1797
|
-
var
|
|
1798
|
-
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;"]);
|
|
1799
2115
|
function StorySection(_ref) {
|
|
1800
|
-
var title = _ref.title
|
|
1801
|
-
_ref.
|
|
1802
|
-
var children = _ref.children,
|
|
2116
|
+
var title = _ref.title,
|
|
2117
|
+
children = _ref.children,
|
|
1803
2118
|
internalIsDemoSection = _ref.internalIsDemoSection,
|
|
1804
2119
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1805
2120
|
|
|
1806
2121
|
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
1807
|
-
return /*#__PURE__*/
|
|
2122
|
+
return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2123
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
|
|
2124
|
+
children: title
|
|
2125
|
+
}), children]
|
|
2126
|
+
}));
|
|
1808
2127
|
}
|
|
1809
|
-
var StyledSubSection = styled(
|
|
2128
|
+
var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
|
|
2129
|
+
displayName: "StorySection__StyledSubSection"
|
|
2130
|
+
})(["margin-bottom:16px;"]);
|
|
1810
2131
|
|
|
1811
2132
|
function SubSection(_ref2) {
|
|
1812
|
-
var title = _ref2.title
|
|
1813
|
-
_ref2.
|
|
1814
|
-
var children = _ref2.children,
|
|
2133
|
+
var title = _ref2.title,
|
|
2134
|
+
children = _ref2.children,
|
|
1815
2135
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
1816
2136
|
|
|
1817
|
-
return /*#__PURE__*/
|
|
2137
|
+
return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2138
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
|
|
2139
|
+
children: title
|
|
2140
|
+
}), children]
|
|
2141
|
+
}));
|
|
1818
2142
|
}
|
|
1819
2143
|
|
|
1820
|
-
var StyledBlockSection = styled(
|
|
2144
|
+
var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
|
|
2145
|
+
displayName: "StorySection__StyledBlockSection"
|
|
2146
|
+
})(["margin-bottom:16px;"]);
|
|
1821
2147
|
|
|
1822
2148
|
function BlockSection(_ref3) {
|
|
1823
|
-
var title = _ref3.title
|
|
1824
|
-
_ref3.
|
|
1825
|
-
var children = _ref3.children,
|
|
2149
|
+
var title = _ref3.title,
|
|
2150
|
+
children = _ref3.children,
|
|
1826
2151
|
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
1827
2152
|
|
|
1828
|
-
return /*#__PURE__*/
|
|
2153
|
+
return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2154
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
2155
|
+
children: title
|
|
2156
|
+
}), children]
|
|
2157
|
+
}));
|
|
1829
2158
|
}
|
|
1830
2159
|
|
|
1831
|
-
var StyledDemoSection = styled(
|
|
2160
|
+
var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
|
|
2161
|
+
displayName: "StorySection__StyledDemoSection"
|
|
2162
|
+
})(["margin-bottom:64px;"]);
|
|
1832
2163
|
|
|
1833
2164
|
function DemoSection(_ref4) {
|
|
1834
2165
|
var children = _ref4.children;
|
|
1835
|
-
return /*#__PURE__*/
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
2166
|
+
return /*#__PURE__*/jsx(StyledDemoSection, {
|
|
2167
|
+
children: /*#__PURE__*/jsx(StorySection, {
|
|
2168
|
+
internalIsDemoSection: true,
|
|
2169
|
+
title: "Demo",
|
|
2170
|
+
children: children
|
|
2171
|
+
})
|
|
2172
|
+
});
|
|
1839
2173
|
}
|
|
1840
2174
|
|
|
1841
2175
|
StorySection.SubSection = SubSection;
|
|
@@ -1856,23 +2190,32 @@ function StoryContainer(_ref) {
|
|
|
1856
2190
|
_ref$platform = _ref.platform,
|
|
1857
2191
|
platform = _ref$platform === void 0 ? 'all' : _ref$platform;
|
|
1858
2192
|
if (platform === 'web') return null;
|
|
1859
|
-
return /*#__PURE__*/
|
|
2193
|
+
return /*#__PURE__*/jsx(StorySection.BlockSection, {
|
|
1860
2194
|
testID: state,
|
|
1861
|
-
title: title
|
|
1862
|
-
|
|
2195
|
+
title: title,
|
|
2196
|
+
children: children
|
|
2197
|
+
});
|
|
1863
2198
|
}
|
|
1864
2199
|
|
|
1865
2200
|
function StoryDecorator(storyFn, context) {
|
|
1866
|
-
return /*#__PURE__*/
|
|
1867
|
-
title: context.name
|
|
1868
|
-
|
|
2201
|
+
return /*#__PURE__*/jsx(Story, {
|
|
2202
|
+
title: context.name,
|
|
2203
|
+
children: storyFn()
|
|
2204
|
+
});
|
|
1869
2205
|
}
|
|
1870
2206
|
|
|
1871
|
-
var
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
var
|
|
1875
|
-
|
|
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;"]);
|
|
1876
2219
|
|
|
1877
2220
|
function StoryGridRow(_ref) {
|
|
1878
2221
|
var children = _ref.children,
|
|
@@ -1887,14 +2230,22 @@ function StoryGridRow(_ref) {
|
|
|
1887
2230
|
var breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
1888
2231
|
|
|
1889
2232
|
if (width < breakpointValue) {
|
|
1890
|
-
return /*#__PURE__*/
|
|
1891
|
-
|
|
1892
|
-
|
|
2233
|
+
return /*#__PURE__*/jsx(SmallScreenRow, {
|
|
2234
|
+
children: Children.map(children, function (child) {
|
|
2235
|
+
return /*#__PURE__*/jsx(SmallScreenCol, {
|
|
2236
|
+
children: child
|
|
2237
|
+
});
|
|
2238
|
+
})
|
|
2239
|
+
});
|
|
1893
2240
|
}
|
|
1894
2241
|
|
|
1895
|
-
return /*#__PURE__*/
|
|
1896
|
-
|
|
1897
|
-
|
|
2242
|
+
return /*#__PURE__*/jsx(FlexRow, {
|
|
2243
|
+
children: Children.map(children, function (child) {
|
|
2244
|
+
return /*#__PURE__*/jsx(FlexCol, {
|
|
2245
|
+
children: child
|
|
2246
|
+
});
|
|
2247
|
+
})
|
|
2248
|
+
});
|
|
1898
2249
|
}
|
|
1899
2250
|
|
|
1900
2251
|
function StoryGridCol(_ref2) {
|
|
@@ -1903,15 +2254,23 @@ function StoryGridCol(_ref2) {
|
|
|
1903
2254
|
children = _ref2.children,
|
|
1904
2255
|
_ref2$platform = _ref2.platform,
|
|
1905
2256
|
platform = _ref2$platform === void 0 ? 'all' : _ref2$platform;
|
|
2257
|
+
var isNative = Platform.OS === 'ios' || Platform.OS === 'android';
|
|
1906
2258
|
|
|
1907
|
-
if (
|
|
2259
|
+
if (Platform.OS === 'web' && platform === 'native') {
|
|
1908
2260
|
return null;
|
|
1909
2261
|
}
|
|
1910
2262
|
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
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
|
+
});
|
|
1915
2274
|
}
|
|
1916
2275
|
|
|
1917
2276
|
var StoryGrid = {
|
|
@@ -1919,8 +2278,9 @@ var StoryGrid = {
|
|
|
1919
2278
|
Col: StoryGridCol
|
|
1920
2279
|
};
|
|
1921
2280
|
|
|
1922
|
-
var
|
|
1923
|
-
|
|
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) {
|
|
1924
2284
|
var theme = _ref.theme,
|
|
1925
2285
|
type = _ref.type,
|
|
1926
2286
|
variant = _ref.variant;
|
|
@@ -1971,13 +2331,15 @@ function Tag(_ref6) {
|
|
|
1971
2331
|
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
1972
2332
|
_ref6$variant = _ref6.variant,
|
|
1973
2333
|
variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
|
|
1974
|
-
return /*#__PURE__*/
|
|
2334
|
+
return /*#__PURE__*/jsx(Container$1, {
|
|
1975
2335
|
type: type,
|
|
1976
|
-
variant: variant
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
2336
|
+
variant: variant,
|
|
2337
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
2338
|
+
base: "body-xsmall",
|
|
2339
|
+
color: getLabelColor(type, variant),
|
|
2340
|
+
children: label
|
|
2341
|
+
})
|
|
2342
|
+
});
|
|
1981
2343
|
}
|
|
1982
2344
|
|
|
1983
2345
|
var lateOceanColorPalette = {
|
|
@@ -2086,6 +2448,7 @@ var colorsLateOceanTheme = {
|
|
|
2086
2448
|
danger: lateOceanColorPalette.englishVermillon,
|
|
2087
2449
|
separator: lateOceanColorPalette.black100,
|
|
2088
2450
|
hover: lateOceanColorPalette.black100,
|
|
2451
|
+
black: lateOceanColorPalette.black1000,
|
|
2089
2452
|
uiBackground: lateOceanColorPalette.black25,
|
|
2090
2453
|
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2091
2454
|
overlay: {
|
|
@@ -2271,6 +2634,15 @@ var tagLateOceanTheme = {
|
|
|
2271
2634
|
}
|
|
2272
2635
|
};
|
|
2273
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
|
+
|
|
2274
2646
|
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
2275
2647
|
return Math.round(fontSize * lineHeightMultiplier);
|
|
2276
2648
|
};
|
|
@@ -2303,8 +2675,8 @@ var typographyLateOceanTheme = {
|
|
|
2303
2675
|
types: {
|
|
2304
2676
|
headers: {
|
|
2305
2677
|
fontFamily: {
|
|
2306
|
-
regular: 'Moderat-Extended-Bold',
|
|
2307
|
-
bold: 'Moderat-Extended-Bold'
|
|
2678
|
+
regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
2679
|
+
bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
2308
2680
|
},
|
|
2309
2681
|
fontWeight: 400,
|
|
2310
2682
|
fontStyle: 'normal',
|
|
@@ -2323,8 +2695,8 @@ var typographyLateOceanTheme = {
|
|
|
2323
2695
|
},
|
|
2324
2696
|
bodies: {
|
|
2325
2697
|
fontFamily: {
|
|
2326
|
-
regular: 'NotoSans',
|
|
2327
|
-
bold: 'NotoSans-Bold'
|
|
2698
|
+
regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
2699
|
+
bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
2328
2700
|
},
|
|
2329
2701
|
fontWeight: {
|
|
2330
2702
|
regular: 400,
|
|
@@ -2387,49 +2759,434 @@ var theme = {
|
|
|
2387
2759
|
shadows: shadowsLateOceanTheme,
|
|
2388
2760
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2389
2761
|
iconButton: iconButton,
|
|
2390
|
-
listItem: listItemLateOceanTheme
|
|
2762
|
+
listItem: listItemLateOceanTheme,
|
|
2763
|
+
tooltip: tooltip
|
|
2391
2764
|
};
|
|
2392
2765
|
|
|
2393
|
-
function
|
|
2766
|
+
function Title(_ref) {
|
|
2394
2767
|
var children = _ref.children;
|
|
2395
|
-
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
|
+
});
|
|
2396
2775
|
}
|
|
2397
2776
|
|
|
2398
|
-
|
|
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;
|
|
2784
|
+
|
|
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
|
+
};
|
|
2870
|
+
};
|
|
2871
|
+
|
|
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
|
+
};
|
|
2399
2938
|
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
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/chris/ornikar/kitt/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (57:41)";
|
|
3044
|
+
_f.__optimalization = 2;
|
|
3045
|
+
|
|
3046
|
+
global.__reanimatedWorkletInit(_f);
|
|
3047
|
+
|
|
3048
|
+
return _f;
|
|
3049
|
+
}());
|
|
3050
|
+
|
|
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
|
+
});
|
|
3106
|
+
}
|
|
3107
|
+
Tooltip.View = TooltipView;
|
|
3108
|
+
|
|
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;
|
|
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 ");
|
|
3117
|
+
});
|
|
3118
|
+
function TypographyEmoji(_ref2) {
|
|
3119
|
+
var emoji = _ref2.emoji,
|
|
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;
|
|
3129
|
+
|
|
3130
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
3131
|
+
if (!fontSize.endsWith('px')) throw new Error("Unexpected font-size value: ".concat(fontSize));
|
|
2404
3132
|
}
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
3133
|
+
|
|
3134
|
+
return /*#__PURE__*/jsx(StyledTypographyEmoji, {
|
|
3135
|
+
size: parseInt(fontSize.slice(0, -2), 10),
|
|
3136
|
+
emoji: emoji
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3140
|
+
var _excluded$1 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
|
|
3141
|
+
|
|
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';
|
|
2408
3151
|
}, function (_ref2) {
|
|
2409
|
-
var disabled = _ref2
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
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, ";");
|
|
2413
3160
|
});
|
|
2414
|
-
function TypographyLink(
|
|
2415
|
-
var children =
|
|
2416
|
-
disabled =
|
|
2417
|
-
noUnderline =
|
|
2418
|
-
href =
|
|
2419
|
-
hrefAttrs =
|
|
2420
|
-
onPress =
|
|
2421
|
-
otherProps = _objectWithoutProperties(
|
|
2422
|
-
|
|
2423
|
-
return /*#__PURE__*/
|
|
2424
|
-
accessibilityRole: "none"
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
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,
|
|
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
|
+
}));
|
|
2433
3190
|
}
|
|
2434
3191
|
|
|
2435
3192
|
function matchWindowSize(currentWidth, _ref) {
|
|
@@ -2501,9 +3258,10 @@ function useKittTheme() {
|
|
|
2501
3258
|
function KittThemeProvider(_ref) {
|
|
2502
3259
|
var children = _ref.children;
|
|
2503
3260
|
var theme = useKittTheme();
|
|
2504
|
-
return /*#__PURE__*/
|
|
2505
|
-
theme: theme
|
|
2506
|
-
|
|
3261
|
+
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
3262
|
+
theme: theme,
|
|
3263
|
+
children: children
|
|
3264
|
+
});
|
|
2507
3265
|
}
|
|
2508
3266
|
var KittThemeDecorator = makeDecorator({
|
|
2509
3267
|
name: 'ThemeDecorator',
|
|
@@ -2511,17 +3269,9 @@ var KittThemeDecorator = makeDecorator({
|
|
|
2511
3269
|
wrapper: function wrapper(storyFn, context, _ref2) {
|
|
2512
3270
|
_ref2.options;
|
|
2513
3271
|
_ref2.parameters;
|
|
2514
|
-
return /*#__PURE__*/
|
|
2515
|
-
|
|
2516
|
-
});
|
|
2517
|
-
|
|
2518
|
-
var SafeAreaProviderDecorator = makeDecorator({
|
|
2519
|
-
name: 'SafeAreaProviderDecorator',
|
|
2520
|
-
parameterName: 'safeAreaProvider',
|
|
2521
|
-
wrapper: function wrapper(storyFn, context, _ref) {
|
|
2522
|
-
_ref.options;
|
|
2523
|
-
_ref.parameters;
|
|
2524
|
-
return /*#__PURE__*/React.createElement(SafeAreaProvider, null, storyFn(context));
|
|
3272
|
+
return /*#__PURE__*/jsx(KittThemeProvider, {
|
|
3273
|
+
children: storyFn(context)
|
|
3274
|
+
});
|
|
2525
3275
|
}
|
|
2526
3276
|
});
|
|
2527
3277
|
|
|
@@ -2532,8 +3282,10 @@ function MatchWindowSize(_ref) {
|
|
|
2532
3282
|
|
|
2533
3283
|
var match = useMatchWindowSize(matchWindowSizeOptions);
|
|
2534
3284
|
if (!match) return null;
|
|
2535
|
-
return /*#__PURE__*/
|
|
3285
|
+
return /*#__PURE__*/jsx(Fragment$1, {
|
|
3286
|
+
children: children
|
|
3287
|
+
});
|
|
2536
3288
|
}
|
|
2537
3289
|
|
|
2538
|
-
export { Avatar, Button, Card, 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 };
|
|
2539
3291
|
//# sourceMappingURL=index-browser-all.es.ios.js.map
|