@ornikar/kitt-universal 2.2.0 → 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +131 -0
- package/dist/definitions/Avatar/Avatar.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts +5 -2
- 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 +13 -0
- package/dist/definitions/Button/ButtonPressable.d.ts.map +1 -0
- 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 +18 -0
- package/dist/definitions/ExternalLink/ExternalLink.d.ts.map +1 -0
- package/dist/definitions/ExternalLink/ExternalLink.web.d.ts +4 -0
- package/dist/definitions/ExternalLink/ExternalLink.web.d.ts.map +1 -0
- package/dist/definitions/ExternalLink/ExternalLinkOpenLinkBehavior.d.ts +24 -0
- package/dist/definitions/ExternalLink/ExternalLinkOpenLinkBehavior.d.ts.map +1 -0
- 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 +9 -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 +9 -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 +1437 -652
- 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 +1437 -652
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +1403 -724
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +1249 -837
- 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 +1244 -634
- 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 +19 -7
- package/translations/es-ES.json +3 -0
- package/translations/fr-FR.json +3 -0
- package/dist/definitions/Button/ButtonContainer.d.ts +0 -12
- package/dist/definitions/Button/ButtonContainer.d.ts.map +0 -1
- package/dist/definitions/Button/useButton.d.ts +0 -6
- package/dist/definitions/Button/useButton.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveLink.d.ts +0 -11
- 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 -16
- 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 -21
- package/dist/definitions/primitives/PrimitiveView.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveView.web.d.ts +0 -23
- 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,19 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import { UserIcon, EyeIcon, EyeOffIcon, XIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon } from '@ornikar/kitt-icons';
|
|
4
4
|
export * from '@ornikar/kitt-icons';
|
|
5
|
-
import
|
|
6
|
-
import { View, Animated, Easing, Text as Text$1, Image, Pressable, TextInput, Platform, 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';
|
|
7
6
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
8
|
-
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';
|
|
9
10
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
10
|
-
import {
|
|
11
|
+
import { parse } from 'twemoji-parser';
|
|
12
|
+
import { openBrowserAsync } from 'expo-web-browser';
|
|
13
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
14
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
11
15
|
import Animated$1, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
12
|
-
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';
|
|
13
19
|
import { makeDecorator } from '@storybook/addons';
|
|
14
20
|
|
|
15
|
-
var PrimitiveView = View;
|
|
16
|
-
|
|
17
21
|
function SpinningIcon(_ref) {
|
|
18
22
|
var children = _ref.children;
|
|
19
23
|
var animationRef = useRef(new Animated.Value(0));
|
|
@@ -36,18 +40,18 @@ function SpinningIcon(_ref) {
|
|
|
36
40
|
return undefined;
|
|
37
41
|
};
|
|
38
42
|
}, []);
|
|
39
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/jsx(Animated.View, {
|
|
40
44
|
style: {
|
|
41
45
|
transform: [{
|
|
42
46
|
rotate: rotation
|
|
43
47
|
}]
|
|
44
|
-
}
|
|
45
|
-
|
|
48
|
+
},
|
|
49
|
+
children: children
|
|
50
|
+
});
|
|
46
51
|
}
|
|
47
52
|
|
|
48
|
-
var IconContainer$2 = /*#__PURE__*/styled
|
|
49
|
-
displayName: "Icon__IconContainer"
|
|
50
|
-
componentId: "kitt-universal__sc-usm0ol-0"
|
|
53
|
+
var IconContainer$2 = /*#__PURE__*/styled.View.withConfig({
|
|
54
|
+
displayName: "Icon__IconContainer"
|
|
51
55
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
52
56
|
var color = _ref.color;
|
|
53
57
|
return color;
|
|
@@ -69,93 +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,
|
|
83
94
|
|
|
84
|
-
|
|
85
|
-
|
|
95
|
+
/**
|
|
96
|
+
* min-width: 480px
|
|
97
|
+
*/
|
|
98
|
+
SMALL: 480,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* min-width: 768px
|
|
102
|
+
*/
|
|
103
|
+
MEDIUM: 768,
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* min-width: 1024px
|
|
107
|
+
*/
|
|
108
|
+
LARGE: 1024,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* min-width: 1280px
|
|
112
|
+
*/
|
|
113
|
+
WIDE: 1280
|
|
114
|
+
};
|
|
115
|
+
var KittBreakpointsMax = {
|
|
116
|
+
/**
|
|
117
|
+
* max-width: 479px
|
|
118
|
+
*/
|
|
119
|
+
BASE: KittBreakpoints.SMALL - 1,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* max-width: 767px
|
|
123
|
+
*/
|
|
124
|
+
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
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$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
140
|
+
|
|
141
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
142
|
+
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
86
143
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
87
144
|
function useTypographyColor() {
|
|
88
145
|
return useContext(TypographyColorContext);
|
|
89
146
|
}
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
|
|
147
|
+
var getTypographyTypeConfigKey = function (theme) {
|
|
148
|
+
var isMediumOrAbove = theme.responsive.matchWindowSize({
|
|
149
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
150
|
+
});
|
|
151
|
+
return isMediumOrAbove ? 'mediumAndWide' : 'baseAndSmall';
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
var isTypeHeader = function (type) {
|
|
155
|
+
return type.startsWith('header');
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var isTypographyHeader = function (type, typographyIsHeaderInContext) {
|
|
159
|
+
if (type) return isTypeHeader(type);
|
|
160
|
+
if (typographyIsHeaderInContext != null) return typographyIsHeaderInContext;
|
|
161
|
+
throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
|
|
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"
|
|
93
172
|
})(["", " ", ""], function (_ref) {
|
|
94
173
|
var theme = _ref.theme,
|
|
95
|
-
isHeader = _ref
|
|
96
|
-
|
|
97
|
-
variant = _ref
|
|
174
|
+
$isHeader = _ref.$isHeader,
|
|
175
|
+
$typeForCurrentWindowSize = _ref.$typeForCurrentWindowSize,
|
|
176
|
+
$variant = _ref.$variant;
|
|
98
177
|
var _theme$kitt$typograph = theme.kitt.typography.types,
|
|
99
178
|
headers = _theme$kitt$typograph.headers,
|
|
100
179
|
bodies = _theme$kitt$typograph.bodies;
|
|
101
|
-
|
|
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 ");
|
|
102
182
|
}, function (_ref2) {
|
|
103
183
|
var theme = _ref2.theme,
|
|
104
|
-
color = _ref2
|
|
105
|
-
return
|
|
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 ");
|
|
106
186
|
});
|
|
187
|
+
function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
188
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
189
|
+
width = _useWindowDimensions.width;
|
|
107
190
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (base) return isTypeHeader(base);
|
|
114
|
-
if (typeInContext) return isTypeHeader(typeInContext);
|
|
115
|
-
throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
|
|
116
|
-
};
|
|
117
|
-
|
|
191
|
+
if (large && width >= KittBreakpoints.LARGE) return large;
|
|
192
|
+
if (medium && width >= KittBreakpoints.MEDIUM) return medium;
|
|
193
|
+
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
194
|
+
return base;
|
|
195
|
+
}
|
|
118
196
|
function Typography(_ref3) {
|
|
119
197
|
var accessibilityRole = _ref3.accessibilityRole,
|
|
120
198
|
base = _ref3.base,
|
|
199
|
+
small = _ref3.small,
|
|
200
|
+
medium = _ref3.medium,
|
|
201
|
+
large = _ref3.large,
|
|
121
202
|
variant = _ref3.variant,
|
|
122
203
|
color = _ref3.color,
|
|
123
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded$
|
|
124
|
-
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
value:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
204
|
+
otherProps = _objectWithoutProperties(_ref3, _excluded$c);
|
|
205
|
+
|
|
206
|
+
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
207
|
+
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
|
|
208
|
+
var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
209
|
+
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular'; // if isHeaderTypographyInContext exists, it means we are inside another typography so we don't want to
|
|
210
|
+
// redefine the color, just inherit from it
|
|
211
|
+
|
|
212
|
+
var colorWithDefaultToBlack = color !== null && color !== void 0 ? color : isHeaderTypographyInContext !== undefined ? undefined : 'black';
|
|
213
|
+
var content = base ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
214
|
+
value: isHeader,
|
|
215
|
+
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$i({
|
|
216
|
+
$color: colorWithDefaultToBlack,
|
|
217
|
+
$isHeader: isHeader,
|
|
218
|
+
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
219
|
+
$variant: nonNullableVariant,
|
|
220
|
+
accessibilityRole: accessibilityRole || undefined
|
|
221
|
+
}, otherProps))
|
|
222
|
+
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$i({
|
|
223
|
+
$color: colorWithDefaultToBlack,
|
|
224
|
+
$isHeader: isHeader,
|
|
225
|
+
$variant: nonNullableVariant,
|
|
144
226
|
accessibilityRole: accessibilityRole || undefined
|
|
145
227
|
}, otherProps));
|
|
146
|
-
return color ? /*#__PURE__*/
|
|
147
|
-
value: color
|
|
148
|
-
|
|
228
|
+
return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
|
|
229
|
+
value: color,
|
|
230
|
+
children: content
|
|
231
|
+
}) : content;
|
|
149
232
|
}
|
|
150
233
|
|
|
151
234
|
function TypographyText(props) {
|
|
152
|
-
return /*#__PURE__*/
|
|
235
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$i({
|
|
153
236
|
accessibilityRole: null
|
|
154
237
|
}, props));
|
|
155
238
|
}
|
|
156
239
|
|
|
157
240
|
function TypographyParagraph(props) {
|
|
158
|
-
return /*#__PURE__*/
|
|
241
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$i({
|
|
159
242
|
accessibilityRole: "paragraph"
|
|
160
243
|
}, props));
|
|
161
244
|
}
|
|
@@ -163,10 +246,10 @@ function TypographyParagraph(props) {
|
|
|
163
246
|
var createHeading = function (level, defaultBase) {
|
|
164
247
|
// https://github.com/necolas/react-native-web/issues/401
|
|
165
248
|
function TypographyHeading(props) {
|
|
166
|
-
return /*#__PURE__*/
|
|
249
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$i(_objectSpread$i({
|
|
167
250
|
accessibilityRole: "header",
|
|
168
251
|
base: defaultBase
|
|
169
|
-
}, props, {
|
|
252
|
+
}, props), {}, {
|
|
170
253
|
accessibilityLevel: level
|
|
171
254
|
}));
|
|
172
255
|
}
|
|
@@ -199,7 +282,11 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
199
282
|
|
|
200
283
|
Typography.h5 = createHeading(5, 'header5');
|
|
201
284
|
|
|
202
|
-
var _excluded$
|
|
285
|
+
var _excluded$b = ["size"];
|
|
286
|
+
|
|
287
|
+
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; }
|
|
288
|
+
|
|
289
|
+
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; }
|
|
203
290
|
|
|
204
291
|
var getFirstCharacter = function (string) {
|
|
205
292
|
return string ? string[0] : '';
|
|
@@ -209,9 +296,8 @@ var getInitials = function (firstname, lastname) {
|
|
|
209
296
|
return (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
|
|
210
297
|
};
|
|
211
298
|
|
|
212
|
-
var StyledAvatarView = /*#__PURE__*/styled
|
|
213
|
-
displayName: "Avatar__StyledAvatarView"
|
|
214
|
-
componentId: "kitt-universal__sc-9miubv-0"
|
|
299
|
+
var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
|
|
300
|
+
displayName: "Avatar__StyledAvatarView"
|
|
215
301
|
})(["border-radius:", "px;background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
216
302
|
var round = _ref.round,
|
|
217
303
|
size = _ref.size;
|
|
@@ -237,7 +323,7 @@ function AvatarContent(_ref5) {
|
|
|
237
323
|
light = _ref5.light;
|
|
238
324
|
|
|
239
325
|
if (src) {
|
|
240
|
-
return /*#__PURE__*/
|
|
326
|
+
return /*#__PURE__*/jsx(Image, {
|
|
241
327
|
source: {
|
|
242
328
|
uri: src
|
|
243
329
|
},
|
|
@@ -249,15 +335,16 @@ function AvatarContent(_ref5) {
|
|
|
249
335
|
}
|
|
250
336
|
|
|
251
337
|
if (firstname && lastname) {
|
|
252
|
-
return /*#__PURE__*/
|
|
338
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
253
339
|
base: "body-small",
|
|
254
340
|
variant: "bold",
|
|
255
|
-
color: light ? 'black' : 'white'
|
|
256
|
-
|
|
341
|
+
color: light ? 'black' : 'white',
|
|
342
|
+
children: getInitials(firstname, lastname)
|
|
343
|
+
});
|
|
257
344
|
}
|
|
258
345
|
|
|
259
|
-
return /*#__PURE__*/
|
|
260
|
-
icon: /*#__PURE__*/
|
|
346
|
+
return /*#__PURE__*/jsx(Icon, {
|
|
347
|
+
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
261
348
|
color: light ? 'black' : 'white',
|
|
262
349
|
size: size / 2
|
|
263
350
|
});
|
|
@@ -266,77 +353,37 @@ function AvatarContent(_ref5) {
|
|
|
266
353
|
function Avatar(_ref6) {
|
|
267
354
|
var _ref6$size = _ref6.size,
|
|
268
355
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
269
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
356
|
+
rest = _objectWithoutProperties(_ref6, _excluded$b);
|
|
270
357
|
|
|
271
|
-
return /*#__PURE__*/
|
|
272
|
-
size: size
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
358
|
+
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$h(_objectSpread$h({}, rest), {}, {
|
|
359
|
+
size: size,
|
|
360
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$h(_objectSpread$h({}, rest), {}, {
|
|
361
|
+
size: size
|
|
362
|
+
}))
|
|
363
|
+
}));
|
|
276
364
|
}
|
|
277
365
|
|
|
278
|
-
var
|
|
279
|
-
|
|
280
|
-
var ButtonContainer = /*#__PURE__*/styled(PrimitivePressable).withConfig({
|
|
281
|
-
displayName: "ButtonContainer",
|
|
282
|
-
componentId: "kitt-universal__sc-ofbpwm-0"
|
|
283
|
-
})(["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) {
|
|
284
|
-
var theme = _ref.theme;
|
|
285
|
-
return theme.kitt.button.minWidth;
|
|
286
|
-
}, function (_ref2) {
|
|
287
|
-
var theme = _ref2.theme,
|
|
288
|
-
stretch = _ref2.stretch;
|
|
289
|
-
return stretch ? 'auto' : theme.kitt.button.maxWidth;
|
|
290
|
-
}, function (_ref3) {
|
|
291
|
-
var stretch = _ref3.stretch;
|
|
292
|
-
return stretch ? '100%' : 'auto';
|
|
293
|
-
}, function (_ref4) {
|
|
294
|
-
var theme = _ref4.theme;
|
|
295
|
-
return theme.kitt.button.minHeight;
|
|
296
|
-
}, function (_ref5) {
|
|
297
|
-
var theme = _ref5.theme,
|
|
298
|
-
isPressed = _ref5.isPressed,
|
|
299
|
-
disabled = _ref5.disabled,
|
|
300
|
-
type = _ref5.type;
|
|
301
|
-
|
|
302
|
-
if (disabled) {
|
|
303
|
-
return theme.kitt.button[type].disabledBackgroundColor;
|
|
304
|
-
}
|
|
366
|
+
var _excluded$a = ["color"],
|
|
367
|
+
_excluded2$2 = ["color"];
|
|
305
368
|
|
|
306
|
-
|
|
307
|
-
}, function (_ref6) {
|
|
308
|
-
var theme = _ref6.theme;
|
|
309
|
-
return theme.kitt.button.contentPadding["default"];
|
|
310
|
-
}, function (_ref7) {
|
|
311
|
-
var theme = _ref7.theme;
|
|
312
|
-
return theme.kitt.button.borderRadius;
|
|
313
|
-
}, function (_ref8) {
|
|
314
|
-
var theme = _ref8.theme,
|
|
315
|
-
disabled = _ref8.disabled,
|
|
316
|
-
type = _ref8.type;
|
|
317
|
-
return disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent';
|
|
318
|
-
}, function (_ref9) {
|
|
319
|
-
var theme = _ref9.theme;
|
|
320
|
-
return theme.kitt.button.borderWidth;
|
|
321
|
-
});
|
|
369
|
+
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; }
|
|
322
370
|
|
|
323
|
-
|
|
324
|
-
_excluded2$2 = ["color"];
|
|
371
|
+
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; }
|
|
325
372
|
|
|
326
373
|
function TypographyIconInheritColor(props) {
|
|
327
374
|
var color = useTypographyColor();
|
|
328
375
|
var theme = /*#__PURE__*/useTheme();
|
|
329
|
-
return /*#__PURE__*/
|
|
376
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$g(_objectSpread$g({}, props), {}, {
|
|
330
377
|
color: theme.kitt.typography.colors[color]
|
|
331
378
|
}));
|
|
332
379
|
}
|
|
333
380
|
|
|
334
381
|
function TypographyIconSpecifiedColor(_ref) {
|
|
335
382
|
var color = _ref.color,
|
|
336
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
383
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$a);
|
|
337
384
|
|
|
338
385
|
var theme = /*#__PURE__*/useTheme();
|
|
339
|
-
return /*#__PURE__*/
|
|
386
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$g(_objectSpread$g({}, otherProps), {}, {
|
|
340
387
|
color: theme.kitt.typography.colors[color]
|
|
341
388
|
}));
|
|
342
389
|
}
|
|
@@ -346,14 +393,18 @@ function TypographyIcon(_ref2) {
|
|
|
346
393
|
otherProps = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
347
394
|
|
|
348
395
|
if (color) {
|
|
349
|
-
return /*#__PURE__*/
|
|
396
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$g({
|
|
350
397
|
color: color
|
|
351
398
|
}, otherProps));
|
|
352
399
|
}
|
|
353
400
|
|
|
354
|
-
return /*#__PURE__*/
|
|
401
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$g({}, otherProps));
|
|
355
402
|
}
|
|
356
403
|
|
|
404
|
+
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; }
|
|
405
|
+
|
|
406
|
+
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; }
|
|
407
|
+
|
|
357
408
|
var getTextColorByType = function (type, isPressed, disabled) {
|
|
358
409
|
if (disabled) return 'black-light';
|
|
359
410
|
|
|
@@ -374,20 +425,17 @@ var getTextColorByType = function (type, isPressed, disabled) {
|
|
|
374
425
|
};
|
|
375
426
|
|
|
376
427
|
var ButtonText = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
377
|
-
displayName: "ButtonContent__ButtonText"
|
|
378
|
-
componentId: "kitt-universal__sc-dnyw3n-0"
|
|
428
|
+
displayName: "ButtonContent__ButtonText"
|
|
379
429
|
})(["text-align:center;"]);
|
|
380
|
-
var Content$1 = /*#__PURE__*/styled
|
|
381
|
-
displayName: "ButtonContent__Content"
|
|
382
|
-
componentId: "kitt-universal__sc-dnyw3n-1"
|
|
430
|
+
var Content$1 = /*#__PURE__*/styled.View.withConfig({
|
|
431
|
+
displayName: "ButtonContent__Content"
|
|
383
432
|
})(["flex-direction:row;align-items:center;justify-content:center;flex:", ";"], function (_ref) {
|
|
384
433
|
var stretch = _ref.stretch,
|
|
385
434
|
iconOnly = _ref.iconOnly;
|
|
386
435
|
return "".concat(stretch || iconOnly ? 1 : 0, " 1 auto");
|
|
387
436
|
});
|
|
388
|
-
var IconContainer$1 = /*#__PURE__*/styled
|
|
389
|
-
displayName: "ButtonContent__IconContainer"
|
|
390
|
-
componentId: "kitt-universal__sc-dnyw3n-2"
|
|
437
|
+
var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
438
|
+
displayName: "ButtonContent__IconContainer"
|
|
391
439
|
})(["", ""], function (_ref2) {
|
|
392
440
|
var theme = _ref2.theme,
|
|
393
441
|
iconPosition = _ref2.iconPosition;
|
|
@@ -407,15 +455,16 @@ function ButtonIcon(_ref3) {
|
|
|
407
455
|
size = _ref3.size,
|
|
408
456
|
iconPosition = _ref3.iconPosition,
|
|
409
457
|
testID = _ref3.testID;
|
|
410
|
-
return /*#__PURE__*/
|
|
411
|
-
iconPosition: iconPosition
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
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
|
+
});
|
|
419
468
|
}
|
|
420
469
|
|
|
421
470
|
function ButtonContent(_ref4) {
|
|
@@ -442,47 +491,78 @@ function ButtonContent(_ref4) {
|
|
|
442
491
|
}
|
|
443
492
|
|
|
444
493
|
if (!children) {
|
|
445
|
-
return /*#__PURE__*/
|
|
494
|
+
return /*#__PURE__*/jsx(Content$1, {
|
|
446
495
|
iconOnly: true,
|
|
447
|
-
stretch: stretch
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
496
|
+
stretch: stretch,
|
|
497
|
+
children: /*#__PURE__*/jsx(TypographyIcon, _objectSpread$f(_objectSpread$f({}, sharedIconProps), {}, {
|
|
498
|
+
icon: icon
|
|
499
|
+
}))
|
|
500
|
+
});
|
|
451
501
|
}
|
|
452
502
|
|
|
453
|
-
return /*#__PURE__*/
|
|
454
|
-
stretch: stretch
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
icon
|
|
465
|
-
|
|
466
|
-
|
|
503
|
+
return /*#__PURE__*/jsxs(Content$1, {
|
|
504
|
+
stretch: stretch,
|
|
505
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$f(_objectSpread$f({}, 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$f(_objectSpread$f({}, sharedIconProps), {}, {
|
|
515
|
+
icon: icon,
|
|
516
|
+
iconPosition: iconPosition
|
|
517
|
+
})) : null]
|
|
518
|
+
});
|
|
467
519
|
}
|
|
468
520
|
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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) {
|
|
524
|
+
var theme = _ref.theme;
|
|
525
|
+
return theme.kitt.button.minWidth;
|
|
526
|
+
}, function (_ref2) {
|
|
527
|
+
var theme = _ref2.theme,
|
|
528
|
+
stretch = _ref2.stretch;
|
|
529
|
+
return stretch ? 'auto' : theme.kitt.button.maxWidth;
|
|
530
|
+
}, function (_ref3) {
|
|
531
|
+
var stretch = _ref3.stretch;
|
|
532
|
+
return stretch ? '100%' : 'auto';
|
|
533
|
+
}, function (_ref4) {
|
|
534
|
+
var theme = _ref4.theme;
|
|
535
|
+
return theme.kitt.button.minHeight;
|
|
536
|
+
}, function (_ref5) {
|
|
537
|
+
var theme = _ref5.theme,
|
|
538
|
+
isPressed = _ref5.isPressed,
|
|
539
|
+
disabled = _ref5.disabled,
|
|
540
|
+
type = _ref5.type;
|
|
474
541
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
542
|
+
if (disabled) {
|
|
543
|
+
return theme.kitt.button[type].disabledBackgroundColor;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
|
|
547
|
+
}, function (_ref6) {
|
|
548
|
+
var theme = _ref6.theme;
|
|
549
|
+
return theme.kitt.button.contentPadding["default"];
|
|
550
|
+
}, function (_ref7) {
|
|
551
|
+
var theme = _ref7.theme;
|
|
552
|
+
return theme.kitt.button.borderRadius;
|
|
553
|
+
}, function (_ref8) {
|
|
554
|
+
var theme = _ref8.theme,
|
|
555
|
+
disabled = _ref8.disabled,
|
|
556
|
+
type = _ref8.type;
|
|
557
|
+
return disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent';
|
|
558
|
+
}, function (_ref9) {
|
|
559
|
+
var theme = _ref9.theme;
|
|
560
|
+
return theme.kitt.button.borderWidth;
|
|
561
|
+
});
|
|
485
562
|
|
|
563
|
+
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; }
|
|
564
|
+
|
|
565
|
+
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; }
|
|
486
566
|
function Button(_ref) {
|
|
487
567
|
var children = _ref.children,
|
|
488
568
|
_ref$type = _ref.type,
|
|
@@ -493,39 +573,48 @@ function Button(_ref) {
|
|
|
493
573
|
iconSpin = _ref.iconSpin,
|
|
494
574
|
stretch = _ref.stretch,
|
|
495
575
|
disabled = _ref.disabled,
|
|
496
|
-
|
|
497
|
-
|
|
576
|
+
testID = _ref.testID,
|
|
577
|
+
href = _ref.href,
|
|
578
|
+
hrefAttrs = _ref.hrefAttrs,
|
|
579
|
+
onPress = _ref.onPress;
|
|
498
580
|
|
|
499
|
-
var
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
581
|
+
var _useState = useState(false),
|
|
582
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
583
|
+
isPressed = _useState2[0],
|
|
584
|
+
setIsPressed = _useState2[1];
|
|
503
585
|
|
|
504
586
|
var sharedProps = {
|
|
505
587
|
type: type,
|
|
506
588
|
stretch: stretch,
|
|
507
589
|
disabled: disabled
|
|
508
590
|
};
|
|
509
|
-
return /*#__PURE__*/
|
|
591
|
+
return /*#__PURE__*/jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
510
592
|
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
511
593
|
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
512
|
-
,
|
|
594
|
+
, _objectSpread$e(_objectSpread$e({}, sharedProps), {}, {
|
|
513
595
|
isPressed: isPressed,
|
|
514
596
|
accessibilityRole: "button",
|
|
515
597
|
testID: testID,
|
|
598
|
+
href: href,
|
|
599
|
+
hrefAttrs: hrefAttrs,
|
|
516
600
|
onPress: onPress,
|
|
517
|
-
onPressIn: handleButtonPressIn
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
601
|
+
onPressIn: function handleButtonPressIn() {
|
|
602
|
+
return setIsPressed(true);
|
|
603
|
+
},
|
|
604
|
+
onPressOut: function handleButtonPressOut() {
|
|
605
|
+
return setIsPressed(false);
|
|
606
|
+
},
|
|
607
|
+
children: /*#__PURE__*/jsx(ButtonContent, _objectSpread$e(_objectSpread$e({}, sharedProps), {}, {
|
|
608
|
+
icon: icon,
|
|
609
|
+
iconPosition: iconPosition,
|
|
610
|
+
iconSpin: iconSpin,
|
|
611
|
+
children: children
|
|
612
|
+
}))
|
|
613
|
+
}));
|
|
524
614
|
}
|
|
525
615
|
|
|
526
|
-
var Container$
|
|
527
|
-
displayName: "Card__Container"
|
|
528
|
-
componentId: "kitt-universal__sc-1n9psug-0"
|
|
616
|
+
var Container$6 = /*#__PURE__*/styled.View.withConfig({
|
|
617
|
+
displayName: "Card__Container"
|
|
529
618
|
})(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], function (_ref) {
|
|
530
619
|
var theme = _ref.theme,
|
|
531
620
|
type = _ref.type;
|
|
@@ -547,9 +636,91 @@ var Container$5 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
547
636
|
function Card(_ref6) {
|
|
548
637
|
var children = _ref6.children,
|
|
549
638
|
type = _ref6.type;
|
|
550
|
-
return /*#__PURE__*/
|
|
551
|
-
type: type
|
|
552
|
-
|
|
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
|
+
});
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
var defaultOpenLinkBehavior = {
|
|
680
|
+
"native": 'openInModal',
|
|
681
|
+
web: 'targetBlank'
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
var _excluded$9 = ["as", "href", "openLinkBehavior", "onPress"];
|
|
685
|
+
|
|
686
|
+
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; }
|
|
687
|
+
|
|
688
|
+
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; }
|
|
689
|
+
function ExternalLink(_ref) {
|
|
690
|
+
var Component = _ref.as,
|
|
691
|
+
href = _ref.href,
|
|
692
|
+
_ref$openLinkBehavior = _ref.openLinkBehavior,
|
|
693
|
+
openLinkBehavior = _ref$openLinkBehavior === void 0 ? defaultOpenLinkBehavior : _ref$openLinkBehavior,
|
|
694
|
+
onPress = _ref.onPress,
|
|
695
|
+
rest = _objectWithoutProperties(_ref, _excluded$9);
|
|
696
|
+
|
|
697
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$d(_objectSpread$d({}, rest), {}, {
|
|
698
|
+
onPress: function handleOnPress() {
|
|
699
|
+
if (onPress) onPress();
|
|
700
|
+
if (!href) return;
|
|
701
|
+
|
|
702
|
+
switch (openLinkBehavior["native"]) {
|
|
703
|
+
case 'openInModal':
|
|
704
|
+
case undefined:
|
|
705
|
+
openBrowserAsync(href)["catch"](function (err) {
|
|
706
|
+
console.error("An error occurred while opening ".concat(href), err);
|
|
707
|
+
});
|
|
708
|
+
break;
|
|
709
|
+
|
|
710
|
+
case 'openBrowserApp':
|
|
711
|
+
Linking.openURL(href)["catch"](function (err) {
|
|
712
|
+
console.error("An error occurred while opening ".concat(href), err);
|
|
713
|
+
});
|
|
714
|
+
break;
|
|
715
|
+
|
|
716
|
+
default:
|
|
717
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
718
|
+
throw new Error("Invalid ExternalLink native behavior: ".concat(openLinkBehavior["native"]));
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}));
|
|
553
724
|
}
|
|
554
725
|
|
|
555
726
|
var getColorFromState = function (state) {
|
|
@@ -566,84 +737,33 @@ function InputFeedback(_ref) {
|
|
|
566
737
|
var state = _ref.state,
|
|
567
738
|
testID = _ref.testID,
|
|
568
739
|
children = _ref.children;
|
|
569
|
-
return /*#__PURE__*/
|
|
740
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
570
741
|
base: "body-small",
|
|
571
742
|
color: getColorFromState(state),
|
|
572
|
-
testID: testID
|
|
573
|
-
|
|
743
|
+
testID: testID,
|
|
744
|
+
children: children
|
|
745
|
+
});
|
|
574
746
|
}
|
|
575
747
|
|
|
576
|
-
var
|
|
577
|
-
|
|
578
|
-
* min-width: 0
|
|
579
|
-
*/
|
|
580
|
-
BASE: 0,
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* min-width: 480px
|
|
584
|
-
*/
|
|
585
|
-
SMALL: 480,
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* min-width: 768px
|
|
589
|
-
*/
|
|
590
|
-
MEDIUM: 768,
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* min-width: 1024px
|
|
594
|
-
*/
|
|
595
|
-
LARGE: 1024,
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
* min-width: 1280px
|
|
599
|
-
*/
|
|
600
|
-
WIDE: 1280
|
|
601
|
-
};
|
|
602
|
-
var KittBreakpointsMax = {
|
|
603
|
-
/**
|
|
604
|
-
* max-width: 479px
|
|
605
|
-
*/
|
|
606
|
-
BASE: KittBreakpoints.SMALL - 1,
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* max-width: 767px
|
|
610
|
-
*/
|
|
611
|
-
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* max-width: 1023px
|
|
615
|
-
*/
|
|
616
|
-
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* max-width: 1279px
|
|
620
|
-
*/
|
|
621
|
-
LARGE: KittBreakpoints.WIDE - 1
|
|
622
|
-
};
|
|
623
|
-
|
|
624
|
-
var FieldContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
625
|
-
displayName: "InputField__FieldContainer",
|
|
626
|
-
componentId: "kitt-universal__sc-13fkixs-0"
|
|
748
|
+
var FieldContainer = /*#__PURE__*/styled.View.withConfig({
|
|
749
|
+
displayName: "InputField__FieldContainer"
|
|
627
750
|
})(["padding:5px 0 10px;"]);
|
|
628
|
-
var FeedbackContainer = /*#__PURE__*/styled
|
|
629
|
-
displayName: "InputField__FeedbackContainer"
|
|
630
|
-
componentId: "kitt-universal__sc-13fkixs-1"
|
|
751
|
+
var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
|
|
752
|
+
displayName: "InputField__FeedbackContainer"
|
|
631
753
|
})(["", ";"], function (_ref) {
|
|
632
754
|
var theme = _ref.theme;
|
|
633
755
|
return theme.responsive.ifWindowSizeMatches({
|
|
634
756
|
minWidth: KittBreakpoints.SMALL
|
|
635
757
|
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
636
758
|
});
|
|
637
|
-
var FieldLabelContainer = /*#__PURE__*/styled
|
|
638
|
-
displayName: "InputField__FieldLabelContainer"
|
|
639
|
-
componentId: "kitt-universal__sc-13fkixs-2"
|
|
759
|
+
var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
760
|
+
displayName: "InputField__FieldLabelContainer"
|
|
640
761
|
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
641
762
|
var theme = _ref2.theme;
|
|
642
763
|
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
643
764
|
});
|
|
644
|
-
var LabelContainer = /*#__PURE__*/styled
|
|
645
|
-
displayName: "InputField__LabelContainer"
|
|
646
|
-
componentId: "kitt-universal__sc-13fkixs-3"
|
|
765
|
+
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
766
|
+
displayName: "InputField__LabelContainer"
|
|
647
767
|
})(["margin-right:", "px;"], function (_ref3) {
|
|
648
768
|
var theme = _ref3.theme;
|
|
649
769
|
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
@@ -653,7 +773,15 @@ function InputField(_ref4) {
|
|
|
653
773
|
labelFeedback = _ref4.labelFeedback,
|
|
654
774
|
input = _ref4.input,
|
|
655
775
|
feedback = _ref4.feedback;
|
|
656
|
-
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
|
+
});
|
|
657
785
|
}
|
|
658
786
|
|
|
659
787
|
var useInputText = function () {
|
|
@@ -684,7 +812,11 @@ var useInputText = function () {
|
|
|
684
812
|
};
|
|
685
813
|
};
|
|
686
814
|
|
|
687
|
-
var _excluded$
|
|
815
|
+
var _excluded$8 = ["id", "minHeight", "type", "state", "internalForceState", "disabled", "onFocus", "onBlur"];
|
|
816
|
+
|
|
817
|
+
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; }
|
|
818
|
+
|
|
819
|
+
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; }
|
|
688
820
|
var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", ";border-radius:", ";border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
|
|
689
821
|
var theme = _ref.theme,
|
|
690
822
|
state = _ref.state;
|
|
@@ -701,7 +833,8 @@ var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width
|
|
|
701
833
|
return theme.kitt.forms.input.states[state].borderColor;
|
|
702
834
|
}, function (_ref5) {
|
|
703
835
|
var theme = _ref5.theme;
|
|
704
|
-
|
|
836
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
837
|
+
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize;
|
|
705
838
|
}, function (_ref6) {
|
|
706
839
|
var theme = _ref6.theme,
|
|
707
840
|
state = _ref6.state;
|
|
@@ -711,8 +844,7 @@ var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width
|
|
|
711
844
|
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
712
845
|
});
|
|
713
846
|
var Input = /*#__PURE__*/styled(TextInput).withConfig({
|
|
714
|
-
displayName: "InputText__Input"
|
|
715
|
-
componentId: "kitt-universal__sc-uke279-0"
|
|
847
|
+
displayName: "InputText__Input"
|
|
716
848
|
})(["", " padding:", ";line-height:", ";min-height:", "px;"], styledTextInputMixin, function (_ref8) {
|
|
717
849
|
var theme = _ref8.theme,
|
|
718
850
|
multiline = _ref8.multiline;
|
|
@@ -720,14 +852,15 @@ var Input = /*#__PURE__*/styled(TextInput).withConfig({
|
|
|
720
852
|
}, function (_ref9) {
|
|
721
853
|
var theme = _ref9.theme,
|
|
722
854
|
multiline = _ref9.multiline;
|
|
723
|
-
|
|
855
|
+
if (!multiline && Platform.OS === 'ios') return 0;
|
|
856
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
857
|
+
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight;
|
|
724
858
|
}, function (_ref10) {
|
|
725
859
|
var minHeight = _ref10.minHeight;
|
|
726
860
|
return minHeight;
|
|
727
861
|
});
|
|
728
|
-
var Container$
|
|
729
|
-
displayName: "InputText__Container"
|
|
730
|
-
componentId: "kitt-universal__sc-uke279-1"
|
|
862
|
+
var Container$5 = /*#__PURE__*/styled.View.withConfig({
|
|
863
|
+
displayName: "InputText__Container"
|
|
731
864
|
})(["margin-top:", ";margin-bottom:", ";"], function (_ref11) {
|
|
732
865
|
var theme = _ref11.theme;
|
|
733
866
|
return theme.kitt.forms.input.marginTop;
|
|
@@ -735,9 +868,8 @@ var Container$4 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
735
868
|
var theme = _ref12.theme;
|
|
736
869
|
return theme.kitt.forms.input.marginBottom;
|
|
737
870
|
});
|
|
738
|
-
var PasswordButtonContainer = /*#__PURE__*/styled
|
|
739
|
-
displayName: "InputText__PasswordButtonContainer"
|
|
740
|
-
componentId: "kitt-universal__sc-uke279-2"
|
|
871
|
+
var PasswordButtonContainer = /*#__PURE__*/styled.Pressable.withConfig({
|
|
872
|
+
displayName: "InputText__PasswordButtonContainer"
|
|
741
873
|
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:", "px;"], function (_ref13) {
|
|
742
874
|
var theme = _ref13.theme;
|
|
743
875
|
return theme.kitt.forms.input.passwordButtonIconSize / 2;
|
|
@@ -788,7 +920,7 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
788
920
|
disabled = _ref15$disabled === void 0 ? false : _ref15$disabled,
|
|
789
921
|
_onFocus = _ref15.onFocus,
|
|
790
922
|
_onBlur = _ref15.onBlur,
|
|
791
|
-
props = _objectWithoutProperties(_ref15, _excluded$
|
|
923
|
+
props = _objectWithoutProperties(_ref15, _excluded$8);
|
|
792
924
|
|
|
793
925
|
var _useInputText = useInputText(),
|
|
794
926
|
isFocused = _useInputText.isFocused,
|
|
@@ -803,51 +935,55 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
803
935
|
isDisabled: disabled,
|
|
804
936
|
formState: formState
|
|
805
937
|
});
|
|
806
|
-
return /*#__PURE__*/
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
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
|
-
|
|
938
|
+
return /*#__PURE__*/jsxs(Container$5, {
|
|
939
|
+
children: [/*#__PURE__*/jsx(Input, _objectSpread$c(_objectSpread$c({
|
|
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
|
+
});
|
|
836
971
|
});
|
|
837
972
|
|
|
838
973
|
function Label(_ref) {
|
|
839
974
|
var htmlFor = _ref.htmlFor,
|
|
840
975
|
children = _ref.children;
|
|
841
|
-
return /*#__PURE__*/
|
|
842
|
-
base: "body"
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
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
|
+
});
|
|
846
983
|
}
|
|
847
984
|
|
|
848
|
-
var OuterRadio = /*#__PURE__*/styled
|
|
849
|
-
displayName: "Radio__OuterRadio"
|
|
850
|
-
componentId: "kitt-universal__sc-1mdgr2o-0"
|
|
985
|
+
var OuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
986
|
+
displayName: "Radio__OuterRadio"
|
|
851
987
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", ";border-color:", ";"], function (_ref) {
|
|
852
988
|
var theme = _ref.theme,
|
|
853
989
|
disabled = _ref.disabled;
|
|
@@ -869,9 +1005,8 @@ var OuterRadio = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
869
1005
|
disabled = _ref6.disabled;
|
|
870
1006
|
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor;
|
|
871
1007
|
});
|
|
872
|
-
var SelectedOuterRadio = /*#__PURE__*/styled
|
|
873
|
-
displayName: "Radio__SelectedOuterRadio"
|
|
874
|
-
componentId: "kitt-universal__sc-1mdgr2o-1"
|
|
1008
|
+
var SelectedOuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1009
|
+
displayName: "Radio__SelectedOuterRadio"
|
|
875
1010
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], function (_ref7) {
|
|
876
1011
|
var theme = _ref7.theme;
|
|
877
1012
|
return theme.kitt.forms.radio.checked.backgroundColor;
|
|
@@ -885,9 +1020,8 @@ var SelectedOuterRadio = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
885
1020
|
var theme = _ref10.theme;
|
|
886
1021
|
return theme.kitt.forms.radio.size / 2;
|
|
887
1022
|
});
|
|
888
|
-
var SelectedInnerRadio = /*#__PURE__*/styled
|
|
889
|
-
displayName: "Radio__SelectedInnerRadio"
|
|
890
|
-
componentId: "kitt-universal__sc-1mdgr2o-2"
|
|
1023
|
+
var SelectedInnerRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1024
|
+
displayName: "Radio__SelectedInnerRadio"
|
|
891
1025
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], function (_ref11) {
|
|
892
1026
|
var theme = _ref11.theme;
|
|
893
1027
|
return theme.kitt.forms.radio.checked.innerBackgroundColor;
|
|
@@ -901,13 +1035,11 @@ var SelectedInnerRadio = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
901
1035
|
var theme = _ref14.theme;
|
|
902
1036
|
return theme.kitt.forms.radio.checked.innerSize / 2;
|
|
903
1037
|
});
|
|
904
|
-
var Container$
|
|
905
|
-
displayName: "Radio__Container"
|
|
906
|
-
componentId: "kitt-universal__sc-1mdgr2o-3"
|
|
1038
|
+
var Container$4 = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1039
|
+
displayName: "Radio__Container"
|
|
907
1040
|
})(["flex-direction:row;align-items:center;"]);
|
|
908
1041
|
var Text = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
909
|
-
displayName: "Radio__Text"
|
|
910
|
-
componentId: "kitt-universal__sc-1mdgr2o-4"
|
|
1042
|
+
displayName: "Radio__Text"
|
|
911
1043
|
})(["margin-left:", "px;"], function (_ref15) {
|
|
912
1044
|
var theme = _ref15.theme;
|
|
913
1045
|
return theme.kitt.spacing * 2;
|
|
@@ -920,7 +1052,7 @@ function Radio(_ref16) {
|
|
|
920
1052
|
_ref16$disabled = _ref16.disabled,
|
|
921
1053
|
disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
|
|
922
1054
|
children = _ref16.children;
|
|
923
|
-
return /*#__PURE__*/
|
|
1055
|
+
return /*#__PURE__*/jsxs(Container$4, {
|
|
924
1056
|
nativeID: id,
|
|
925
1057
|
disabled: disabled,
|
|
926
1058
|
accessibilityRole: "radio",
|
|
@@ -928,30 +1060,36 @@ function Radio(_ref16) {
|
|
|
928
1060
|
focusable: checked && !disabled,
|
|
929
1061
|
onPress: function handlePress() {
|
|
930
1062
|
onChange(value);
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
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
|
+
});
|
|
938
1074
|
}
|
|
939
1075
|
|
|
1076
|
+
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; }
|
|
1077
|
+
|
|
1078
|
+
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; }
|
|
940
1079
|
function TextArea(_ref) {
|
|
941
1080
|
var props = _extends({}, _ref);
|
|
942
1081
|
|
|
943
1082
|
var theme = /*#__PURE__*/useTheme();
|
|
944
|
-
return /*#__PURE__*/
|
|
1083
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$b(_objectSpread$b({
|
|
945
1084
|
multiline: true
|
|
946
|
-
}, props, {
|
|
1085
|
+
}, props), {}, {
|
|
947
1086
|
type: "text",
|
|
948
1087
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
949
1088
|
}));
|
|
950
1089
|
}
|
|
951
1090
|
|
|
952
|
-
var Body = /*#__PURE__*/styled
|
|
953
|
-
displayName: "Body"
|
|
954
|
-
componentId: "kitt-universal__sc-1ofncfn-0"
|
|
1091
|
+
var Body = /*#__PURE__*/styled.View.withConfig({
|
|
1092
|
+
displayName: "Body"
|
|
955
1093
|
})(["", " background-color:", ";flex:1;"], function (_ref) {
|
|
956
1094
|
var theme = _ref.theme;
|
|
957
1095
|
return theme.responsive.ifWindowSizeMatches({
|
|
@@ -963,12 +1101,13 @@ var Body = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
963
1101
|
});
|
|
964
1102
|
function FullScreenModalBody(_ref3) {
|
|
965
1103
|
var children = _ref3.children;
|
|
966
|
-
return /*#__PURE__*/
|
|
1104
|
+
return /*#__PURE__*/jsx(Body, {
|
|
1105
|
+
children: children
|
|
1106
|
+
});
|
|
967
1107
|
}
|
|
968
1108
|
|
|
969
|
-
var SideContainer = /*#__PURE__*/styled
|
|
970
|
-
displayName: "Header__SideContainer"
|
|
971
|
-
componentId: "kitt-universal__sc-dfmxi1-0"
|
|
1109
|
+
var SideContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1110
|
+
displayName: "Header__SideContainer"
|
|
972
1111
|
})(["", ""], function (_ref) {
|
|
973
1112
|
var theme = _ref.theme,
|
|
974
1113
|
_ref$side = _ref.side,
|
|
@@ -986,9 +1125,8 @@ function getHeaderHorizontalMediumPadding(spacing) {
|
|
|
986
1125
|
return spacing * 6;
|
|
987
1126
|
}
|
|
988
1127
|
|
|
989
|
-
var Header = /*#__PURE__*/styled
|
|
990
|
-
displayName: "Header"
|
|
991
|
-
componentId: "kitt-universal__sc-dfmxi1-1"
|
|
1128
|
+
var Header = /*#__PURE__*/styled.View.withConfig({
|
|
1129
|
+
displayName: "Header"
|
|
992
1130
|
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], function (_ref2) {
|
|
993
1131
|
var theme = _ref2.theme,
|
|
994
1132
|
_ref2$insetTop = _ref2.insetTop,
|
|
@@ -1004,9 +1142,8 @@ var Header = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
1004
1142
|
var theme = _ref3.theme;
|
|
1005
1143
|
return theme.kitt.fullScreenModal.header.borderColor;
|
|
1006
1144
|
});
|
|
1007
|
-
var HeaderContent = /*#__PURE__*/styled
|
|
1008
|
-
displayName: "Header__HeaderContent"
|
|
1009
|
-
componentId: "kitt-universal__sc-dfmxi1-2"
|
|
1145
|
+
var HeaderContent = /*#__PURE__*/styled.View.withConfig({
|
|
1146
|
+
displayName: "Header__HeaderContent"
|
|
1010
1147
|
})(["", ";", ";justify-content:center;align-items:center;"], function (_ref4) {
|
|
1011
1148
|
var theme = _ref4.theme,
|
|
1012
1149
|
leftWidth = _ref4.leftWidth,
|
|
@@ -1072,73 +1209,158 @@ function FullScreenModalHeader(_ref6) {
|
|
|
1072
1209
|
setRightWidth(event.nativeEvent.layout.width);
|
|
1073
1210
|
};
|
|
1074
1211
|
|
|
1075
|
-
return /*#__PURE__*/
|
|
1076
|
-
insetTop: Platform.OS === 'ios' ? undefined : top
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
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
|
+
});
|
|
1091
1232
|
}
|
|
1092
1233
|
|
|
1093
|
-
var Container$
|
|
1094
|
-
displayName: "FullScreenModal__Container"
|
|
1095
|
-
componentId: "kitt-universal__sc-11qpbe3-0"
|
|
1234
|
+
var Container$3 = /*#__PURE__*/styled.View.withConfig({
|
|
1235
|
+
displayName: "FullScreenModal__Container"
|
|
1096
1236
|
})(["flex:1;background-color:", ";"], function (_ref) {
|
|
1097
1237
|
var theme = _ref.theme;
|
|
1098
1238
|
return theme.kitt.colors.uiBackground;
|
|
1099
1239
|
});
|
|
1100
1240
|
function FullScreenModal(_ref2) {
|
|
1101
1241
|
var children = _ref2.children;
|
|
1102
|
-
return /*#__PURE__*/
|
|
1242
|
+
return /*#__PURE__*/jsx(Container$3, {
|
|
1243
|
+
children: children
|
|
1244
|
+
});
|
|
1103
1245
|
}
|
|
1104
1246
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
1105
1247
|
FullScreenModal.Body = FullScreenModalBody;
|
|
1106
1248
|
|
|
1107
|
-
var
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1249
|
+
var _excluded$7 = ["as", "children"];
|
|
1250
|
+
|
|
1251
|
+
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; }
|
|
1252
|
+
|
|
1253
|
+
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; }
|
|
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
|
+
return /*#__PURE__*/jsx(as || 'div', _objectSpread$a(_objectSpread$a({}, props), {}, {
|
|
1261
|
+
children: children
|
|
1262
|
+
}));
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
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; }
|
|
1266
|
+
|
|
1267
|
+
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; }
|
|
1268
|
+
// type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
|
|
1269
|
+
// type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
|
|
1270
|
+
// export function withTheme<Props extends { theme: DefaultTheme }, C>(
|
|
1271
|
+
// WrappedComponent: ComponentType<Props> & C,
|
|
1272
|
+
// ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
|
|
1273
|
+
// return function ThemedComponent(props) {
|
|
1274
|
+
// const theme = useTheme();
|
|
1275
|
+
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
1276
|
+
// };
|
|
1277
|
+
// }
|
|
1278
|
+
function withTheme( // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1279
|
+
WrappedComponent) {
|
|
1280
|
+
return function (props) {
|
|
1281
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1282
|
+
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$9({
|
|
1283
|
+
theme: theme
|
|
1284
|
+
}, props));
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
var _excluded$6 = ["color"];
|
|
1289
|
+
|
|
1290
|
+
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; }
|
|
1291
|
+
|
|
1292
|
+
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; }
|
|
1293
|
+
var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styledLinaria("div")({
|
|
1294
|
+
name: "PressableIconButtonWebWrapper",
|
|
1295
|
+
"class": "p1nlccvg",
|
|
1296
|
+
vars: {
|
|
1297
|
+
"p1nlccvg-0": [function (_ref) {
|
|
1298
|
+
var theme = _ref.theme;
|
|
1299
|
+
return theme.kitt.iconButton.scale.base.hover;
|
|
1300
|
+
}],
|
|
1301
|
+
"p1nlccvg-1": [function (_ref2) {
|
|
1302
|
+
var theme = _ref2.theme;
|
|
1303
|
+
return theme.breakpoints.min.mediumBreakpoint;
|
|
1304
|
+
}],
|
|
1305
|
+
"p1nlccvg-2": [function (_ref3) {
|
|
1306
|
+
var theme = _ref3.theme;
|
|
1307
|
+
return theme.kitt.iconButton.scale.medium.hover;
|
|
1308
|
+
}],
|
|
1309
|
+
"p1nlccvg-3": [function (_ref4) {
|
|
1310
|
+
var theme = _ref4.theme;
|
|
1311
|
+
return theme.kitt.iconButton.scale.base.active;
|
|
1312
|
+
}],
|
|
1313
|
+
"p1nlccvg-4": [function (_ref5) {
|
|
1314
|
+
var theme = _ref5.theme;
|
|
1315
|
+
return theme.kitt.iconButton["default"].pressedBackgroundColor;
|
|
1316
|
+
}],
|
|
1317
|
+
"p1nlccvg-5": [function (_ref6) {
|
|
1318
|
+
var theme = _ref6.theme;
|
|
1319
|
+
return theme.kitt.iconButton.white.pressedBackgroundColor;
|
|
1320
|
+
}]
|
|
1321
|
+
}
|
|
1322
|
+
}));
|
|
1323
|
+
var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1324
|
+
displayName: "PressableIconButton__StyledPressableIconButton"
|
|
1325
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref7) {
|
|
1326
|
+
var theme = _ref7.theme;
|
|
1112
1327
|
return theme.kitt.iconButton.borderRadius;
|
|
1113
|
-
}, function (
|
|
1114
|
-
var theme =
|
|
1328
|
+
}, function (_ref8) {
|
|
1329
|
+
var theme = _ref8.theme;
|
|
1115
1330
|
return theme.kitt.iconButton.width;
|
|
1116
|
-
}, function (
|
|
1117
|
-
var theme =
|
|
1331
|
+
}, function (_ref9) {
|
|
1332
|
+
var theme = _ref9.theme;
|
|
1118
1333
|
return theme.kitt.iconButton.height;
|
|
1119
|
-
}, function (
|
|
1120
|
-
var theme =
|
|
1121
|
-
|
|
1122
|
-
disabled = _ref4.disabled;
|
|
1334
|
+
}, function (_ref10) {
|
|
1335
|
+
var theme = _ref10.theme,
|
|
1336
|
+
disabled = _ref10.disabled;
|
|
1123
1337
|
var iconButton = theme.kitt.iconButton;
|
|
1124
1338
|
|
|
1125
1339
|
if (Platform.OS !== 'web') {
|
|
1126
1340
|
return undefined;
|
|
1127
1341
|
}
|
|
1128
1342
|
|
|
1129
|
-
var transition = iconButton.transition
|
|
1130
|
-
scale = iconButton.scale;
|
|
1343
|
+
var transition = iconButton.transition;
|
|
1131
1344
|
|
|
1132
1345
|
if (disabled) {
|
|
1133
1346
|
return "\n background-color: ".concat(iconButton.disabled.backgroundColor, ";\n ");
|
|
1134
1347
|
}
|
|
1135
1348
|
|
|
1136
|
-
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n
|
|
1349
|
+
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1137
1350
|
});
|
|
1351
|
+
function PressableIconButton(_ref11) {
|
|
1352
|
+
var color = _ref11.color,
|
|
1353
|
+
props = _objectWithoutProperties(_ref11, _excluded$6);
|
|
1354
|
+
|
|
1355
|
+
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1356
|
+
as: PressableIconButtonWebWrapper,
|
|
1357
|
+
"data-color-white": color === 'white',
|
|
1358
|
+
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$8({}, props))
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1138
1361
|
|
|
1139
1362
|
var AnimatedIconButtonBackground = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
1140
|
-
displayName: "PressableAnimatedContainer__AnimatedIconButtonBackground"
|
|
1141
|
-
componentId: "kitt-universal__sc-xl9ll5-0"
|
|
1363
|
+
displayName: "PressableAnimatedContainer__AnimatedIconButtonBackground"
|
|
1142
1364
|
})(["background-color:", ";border-radius:", "px;width:", "px;height:", "px;position:absolute;bottom:0;left:0;"], function (_ref) {
|
|
1143
1365
|
var theme = _ref.theme,
|
|
1144
1366
|
color = _ref.color,
|
|
@@ -1158,8 +1380,7 @@ var AnimatedIconButtonBackground = /*#__PURE__*/styled(Animated$1.View).withConf
|
|
|
1158
1380
|
return theme.kitt.iconButton.height;
|
|
1159
1381
|
});
|
|
1160
1382
|
var AnimatedViewContainer = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
1161
|
-
displayName: "PressableAnimatedContainer__AnimatedViewContainer"
|
|
1162
|
-
componentId: "kitt-universal__sc-xl9ll5-1"
|
|
1383
|
+
displayName: "PressableAnimatedContainer__AnimatedViewContainer"
|
|
1163
1384
|
})(["position:relative;align-items:center;justify-content:center;width:100%;height:100%;"]);
|
|
1164
1385
|
function PressableAnimatedContainer(_ref5) {
|
|
1165
1386
|
var disabled = _ref5.disabled,
|
|
@@ -1182,7 +1403,7 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1182
1403
|
};
|
|
1183
1404
|
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
1184
1405
|
_f.__workletHash = 10645190329247;
|
|
1185
|
-
_f.__location = "/home/
|
|
1406
|
+
_f.__location = "/home/chris/ornikar/kitt/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (54:41)";
|
|
1186
1407
|
_f.__optimalization = 2;
|
|
1187
1408
|
|
|
1188
1409
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -1216,14 +1437,14 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1216
1437
|
};
|
|
1217
1438
|
_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)}]};}}";
|
|
1218
1439
|
_f.__workletHash = 13861998831411;
|
|
1219
|
-
_f.__location = "/home/
|
|
1440
|
+
_f.__location = "/home/chris/ornikar/kitt/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:39)";
|
|
1220
1441
|
_f.__optimalization = 2;
|
|
1221
1442
|
|
|
1222
1443
|
global.__reanimatedWorkletInit(_f);
|
|
1223
1444
|
|
|
1224
1445
|
return _f;
|
|
1225
1446
|
}());
|
|
1226
|
-
return /*#__PURE__*/
|
|
1447
|
+
return /*#__PURE__*/jsx(PressableIconButton, {
|
|
1227
1448
|
accessibilityRole: "button",
|
|
1228
1449
|
disabled: disabled,
|
|
1229
1450
|
color: color,
|
|
@@ -1233,25 +1454,26 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1233
1454
|
},
|
|
1234
1455
|
onPressOut: function onPressOut() {
|
|
1235
1456
|
pressed.value = false;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1457
|
+
},
|
|
1458
|
+
children: /*#__PURE__*/jsxs(AnimatedViewContainer, {
|
|
1459
|
+
style: disabled ? [{
|
|
1460
|
+
transform: [{
|
|
1461
|
+
scale: 1
|
|
1462
|
+
}]
|
|
1463
|
+
}] : [scaleStyles],
|
|
1464
|
+
children: [/*#__PURE__*/jsx(AnimatedIconButtonBackground, {
|
|
1465
|
+
disabled: disabled,
|
|
1466
|
+
color: color,
|
|
1467
|
+
style: disabled ? [{
|
|
1468
|
+
opacity: 1
|
|
1469
|
+
}] : [opacityStyles]
|
|
1470
|
+
}), children]
|
|
1471
|
+
})
|
|
1472
|
+
});
|
|
1250
1473
|
}
|
|
1251
1474
|
|
|
1252
|
-
var IconButtonContentBorder = /*#__PURE__*/styled
|
|
1253
|
-
displayName: "IconButton__IconButtonContentBorder"
|
|
1254
|
-
componentId: "kitt-universal__sc-swelbf-0"
|
|
1475
|
+
var IconButtonContentBorder = /*#__PURE__*/styled.View.withConfig({
|
|
1476
|
+
displayName: "IconButton__IconButtonContentBorder"
|
|
1255
1477
|
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], function (_ref) {
|
|
1256
1478
|
var theme = _ref.theme;
|
|
1257
1479
|
return "".concat(theme.kitt.iconButton.borderWidth, "px solid");
|
|
@@ -1274,12 +1496,13 @@ function IconButtonContent(_ref6) {
|
|
|
1274
1496
|
var disabled = _ref6.disabled,
|
|
1275
1497
|
color = _ref6.color,
|
|
1276
1498
|
icon = _ref6.icon;
|
|
1277
|
-
return /*#__PURE__*/
|
|
1278
|
-
disabled: disabled
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1499
|
+
return /*#__PURE__*/jsx(IconButtonContentBorder, {
|
|
1500
|
+
disabled: disabled,
|
|
1501
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
1502
|
+
color: disabled ? 'black-light' : color,
|
|
1503
|
+
icon: icon
|
|
1504
|
+
})
|
|
1505
|
+
});
|
|
1283
1506
|
}
|
|
1284
1507
|
|
|
1285
1508
|
function IconButton(_ref7) {
|
|
@@ -1287,34 +1510,43 @@ function IconButton(_ref7) {
|
|
|
1287
1510
|
color = _ref7.color,
|
|
1288
1511
|
disabled = _ref7.disabled,
|
|
1289
1512
|
onPress = _ref7.onPress;
|
|
1290
|
-
return /*#__PURE__*/
|
|
1513
|
+
return /*#__PURE__*/jsx(PressableAnimatedContainer, {
|
|
1291
1514
|
color: color,
|
|
1292
1515
|
disabled: disabled,
|
|
1293
|
-
onPress: onPress
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1516
|
+
onPress: onPress,
|
|
1517
|
+
children: /*#__PURE__*/jsx(IconButtonContent, {
|
|
1518
|
+
disabled: disabled,
|
|
1519
|
+
color: color,
|
|
1520
|
+
icon: icon
|
|
1521
|
+
})
|
|
1522
|
+
});
|
|
1299
1523
|
}
|
|
1300
1524
|
|
|
1301
1525
|
var _excluded$5 = ["children"];
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1526
|
+
|
|
1527
|
+
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; }
|
|
1528
|
+
|
|
1529
|
+
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; }
|
|
1530
|
+
var ContentView$1 = /*#__PURE__*/styled.View.withConfig({
|
|
1531
|
+
displayName: "ListItemContent__ContentView"
|
|
1305
1532
|
})(["flex:1 0 0%;align-self:center;"]);
|
|
1306
1533
|
function ListItemContent(_ref) {
|
|
1307
1534
|
var children = _ref.children,
|
|
1308
1535
|
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
1309
1536
|
|
|
1310
|
-
return /*#__PURE__*/
|
|
1537
|
+
return /*#__PURE__*/jsx(ContentView$1, _objectSpread$7(_objectSpread$7({}, rest), {}, {
|
|
1538
|
+
children: children
|
|
1539
|
+
}));
|
|
1311
1540
|
}
|
|
1312
1541
|
|
|
1313
1542
|
var _excluded$4 = ["children", "side"],
|
|
1314
1543
|
_excluded2$1 = ["children", "align"];
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1544
|
+
|
|
1545
|
+
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; }
|
|
1546
|
+
|
|
1547
|
+
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; }
|
|
1548
|
+
var SideContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
1549
|
+
displayName: "ListItemSideContent__SideContainerView"
|
|
1318
1550
|
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
|
|
1319
1551
|
var theme = _ref.theme,
|
|
1320
1552
|
side = _ref.side;
|
|
@@ -1331,13 +1563,14 @@ function ListItemSideContainer(_ref3) {
|
|
|
1331
1563
|
side = _ref3$side === void 0 ? 'left' : _ref3$side,
|
|
1332
1564
|
rest = _objectWithoutProperties(_ref3, _excluded$4);
|
|
1333
1565
|
|
|
1334
|
-
return /*#__PURE__*/
|
|
1566
|
+
return /*#__PURE__*/jsx(SideContainerView, _objectSpread$6(_objectSpread$6({
|
|
1335
1567
|
side: side
|
|
1336
|
-
}, rest),
|
|
1568
|
+
}, rest), {}, {
|
|
1569
|
+
children: children
|
|
1570
|
+
}));
|
|
1337
1571
|
}
|
|
1338
|
-
var SideContentView = /*#__PURE__*/styled
|
|
1339
|
-
displayName: "ListItemSideContent__SideContentView"
|
|
1340
|
-
componentId: "kitt-universal__sc-1vajiw-1"
|
|
1572
|
+
var SideContentView = /*#__PURE__*/styled.View.withConfig({
|
|
1573
|
+
displayName: "ListItemSideContent__SideContentView"
|
|
1341
1574
|
})(["align-self:", ";"], function (_ref4) {
|
|
1342
1575
|
var align = _ref4.align;
|
|
1343
1576
|
return align;
|
|
@@ -1348,19 +1581,20 @@ function ListItemSideContent(_ref5) {
|
|
|
1348
1581
|
align = _ref5$align === void 0 ? 'auto' : _ref5$align,
|
|
1349
1582
|
rest = _objectWithoutProperties(_ref5, _excluded2$1);
|
|
1350
1583
|
|
|
1351
|
-
return /*#__PURE__*/
|
|
1584
|
+
return /*#__PURE__*/jsx(SideContentView, _objectSpread$6(_objectSpread$6({
|
|
1352
1585
|
align: align
|
|
1353
|
-
}, rest),
|
|
1586
|
+
}, rest), {}, {
|
|
1587
|
+
children: children
|
|
1588
|
+
}));
|
|
1354
1589
|
}
|
|
1355
1590
|
|
|
1356
1591
|
var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
|
|
1357
1592
|
|
|
1358
|
-
function ownKeys$
|
|
1593
|
+
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; }
|
|
1359
1594
|
|
|
1360
|
-
function _objectSpread$
|
|
1361
|
-
var ContainerView = /*#__PURE__*/styled
|
|
1362
|
-
displayName: "ListItem__ContainerView"
|
|
1363
|
-
componentId: "kitt-universal__sc-2afp9s-0"
|
|
1595
|
+
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; }
|
|
1596
|
+
var ContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
1597
|
+
displayName: "ListItem__ContainerView"
|
|
1364
1598
|
})(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], function (_ref) {
|
|
1365
1599
|
var withPadding = _ref.withPadding,
|
|
1366
1600
|
theme = _ref.theme;
|
|
@@ -1399,20 +1633,28 @@ function ListItem(_ref5) {
|
|
|
1399
1633
|
onPress = _ref5.onPress,
|
|
1400
1634
|
rest = _objectWithoutProperties(_ref5, _excluded$3);
|
|
1401
1635
|
|
|
1402
|
-
var Wrapper = onPress ?
|
|
1403
|
-
var wrapperProps = onPress ? _objectSpread$
|
|
1636
|
+
var Wrapper = onPress ? Pressable : Fragment;
|
|
1637
|
+
var wrapperProps = onPress ? _objectSpread$5({
|
|
1404
1638
|
accessibilityRole: 'button',
|
|
1405
1639
|
onPress: onPress
|
|
1406
1640
|
}, rest) : undefined;
|
|
1407
1641
|
var containerProps = onPress ? undefined : rest;
|
|
1408
|
-
return /*#__PURE__*/
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1642
|
+
return /*#__PURE__*/jsx(Wrapper, _objectSpread$5(_objectSpread$5({}, wrapperProps), {}, {
|
|
1643
|
+
children: /*#__PURE__*/jsxs(ContainerView, _objectSpread$5(_objectSpread$5({
|
|
1644
|
+
withPadding: withPadding,
|
|
1645
|
+
borders: borders
|
|
1646
|
+
}, containerProps), {}, {
|
|
1647
|
+
children: [left ? /*#__PURE__*/jsx(ListItemSideContainer, {
|
|
1648
|
+
side: "left",
|
|
1649
|
+
children: left
|
|
1650
|
+
}) : null, /*#__PURE__*/jsx(ListItemContent, {
|
|
1651
|
+
children: children
|
|
1652
|
+
}), right ? /*#__PURE__*/jsx(ListItemSideContainer, {
|
|
1653
|
+
side: "right",
|
|
1654
|
+
children: right
|
|
1655
|
+
}) : null]
|
|
1656
|
+
}))
|
|
1657
|
+
}));
|
|
1416
1658
|
}
|
|
1417
1659
|
ListItem.Content = ListItemContent;
|
|
1418
1660
|
ListItem.SideContent = ListItemSideContent;
|
|
@@ -1430,7 +1672,7 @@ function Loader(_ref) {
|
|
|
1430
1672
|
size = _ref$size === void 0 ? 20 : _ref$size;
|
|
1431
1673
|
var theme = /*#__PURE__*/useTheme();
|
|
1432
1674
|
var colorHex = theme.kitt.typography.colors[color];
|
|
1433
|
-
return /*#__PURE__*/
|
|
1675
|
+
return /*#__PURE__*/jsx(ActivityIndicator, {
|
|
1434
1676
|
testID: "ActivityIndicator",
|
|
1435
1677
|
color: colorHex,
|
|
1436
1678
|
size: getActivityIndicatorSize(size)
|
|
@@ -1440,7 +1682,7 @@ function Loader(_ref) {
|
|
|
1440
1682
|
function LargeLoader(_ref) {
|
|
1441
1683
|
var _ref$color = _ref.color,
|
|
1442
1684
|
color = _ref$color === void 0 ? 'primary' : _ref$color;
|
|
1443
|
-
return /*#__PURE__*/
|
|
1685
|
+
return /*#__PURE__*/jsx(Loader, {
|
|
1444
1686
|
color: color,
|
|
1445
1687
|
size: 60
|
|
1446
1688
|
});
|
|
@@ -1448,9 +1690,8 @@ function LargeLoader(_ref) {
|
|
|
1448
1690
|
|
|
1449
1691
|
var xIconSize = 14;
|
|
1450
1692
|
var mainIconSize = 20;
|
|
1451
|
-
var Container$
|
|
1452
|
-
displayName: "Message__Container"
|
|
1453
|
-
componentId: "kitt-universal__sc-c6400e-0"
|
|
1693
|
+
var Container$2 = /*#__PURE__*/styled.View.withConfig({
|
|
1694
|
+
displayName: "Message__Container"
|
|
1454
1695
|
})(["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) {
|
|
1455
1696
|
var theme = _ref.theme,
|
|
1456
1697
|
noRadius = _ref.noRadius;
|
|
@@ -1476,8 +1717,7 @@ var Container$1 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
1476
1717
|
return ((_insets$top = insets === null || insets === void 0 ? void 0 : insets.top) !== null && _insets$top !== void 0 ? _insets$top : 0) + theme.kitt.spacing * 4;
|
|
1477
1718
|
});
|
|
1478
1719
|
var CloseContainer = /*#__PURE__*/styled(TouchableOpacity).withConfig({
|
|
1479
|
-
displayName: "Message__CloseContainer"
|
|
1480
|
-
componentId: "kitt-universal__sc-c6400e-1"
|
|
1720
|
+
displayName: "Message__CloseContainer"
|
|
1481
1721
|
})(["margin-left:", "px;padding:", "px;"], function (_ref7) {
|
|
1482
1722
|
var theme = _ref7.theme;
|
|
1483
1723
|
return theme.kitt.spacing * 4;
|
|
@@ -1485,16 +1725,14 @@ var CloseContainer = /*#__PURE__*/styled(TouchableOpacity).withConfig({
|
|
|
1485
1725
|
var theme = _ref8.theme;
|
|
1486
1726
|
return theme.kitt.spacing;
|
|
1487
1727
|
});
|
|
1488
|
-
var IconContainer = /*#__PURE__*/styled
|
|
1489
|
-
displayName: "Message__IconContainer"
|
|
1490
|
-
componentId: "kitt-universal__sc-c6400e-2"
|
|
1728
|
+
var IconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1729
|
+
displayName: "Message__IconContainer"
|
|
1491
1730
|
})(["margin-right:", "px;"], function (_ref9) {
|
|
1492
1731
|
var theme = _ref9.theme;
|
|
1493
1732
|
return theme.kitt.spacing * 4;
|
|
1494
1733
|
});
|
|
1495
|
-
var Content = /*#__PURE__*/styled
|
|
1496
|
-
displayName: "Message__Content"
|
|
1497
|
-
componentId: "kitt-universal__sc-c6400e-3"
|
|
1734
|
+
var Content = /*#__PURE__*/styled.Text.withConfig({
|
|
1735
|
+
displayName: "Message__Content"
|
|
1498
1736
|
})(["text-align:", ";flex:1;"], function (_ref10) {
|
|
1499
1737
|
var centeredText = _ref10.centeredText;
|
|
1500
1738
|
return centeredText ? 'center' : 'left';
|
|
@@ -1517,16 +1755,16 @@ var getColorByType = function (type) {
|
|
|
1517
1755
|
function getIconContent(type) {
|
|
1518
1756
|
switch (type) {
|
|
1519
1757
|
case 'warning':
|
|
1520
|
-
return /*#__PURE__*/
|
|
1758
|
+
return /*#__PURE__*/jsx(AlertCircleIcon, {});
|
|
1521
1759
|
|
|
1522
1760
|
case 'success':
|
|
1523
|
-
return /*#__PURE__*/
|
|
1761
|
+
return /*#__PURE__*/jsx(CheckIcon, {});
|
|
1524
1762
|
|
|
1525
1763
|
case 'danger':
|
|
1526
|
-
return /*#__PURE__*/
|
|
1764
|
+
return /*#__PURE__*/jsx(AlertTriangleIcon, {});
|
|
1527
1765
|
|
|
1528
1766
|
default:
|
|
1529
|
-
return /*#__PURE__*/
|
|
1767
|
+
return /*#__PURE__*/jsx(InfoIcon, {});
|
|
1530
1768
|
}
|
|
1531
1769
|
}
|
|
1532
1770
|
|
|
@@ -1541,54 +1779,57 @@ function Message(_ref11) {
|
|
|
1541
1779
|
onDismiss = _ref11.onDismiss,
|
|
1542
1780
|
insets = _ref11.insets;
|
|
1543
1781
|
var color = getColorByType(type);
|
|
1544
|
-
return /*#__PURE__*/
|
|
1782
|
+
return /*#__PURE__*/jsxs(Container$2, {
|
|
1545
1783
|
type: type,
|
|
1546
1784
|
noRadius: noRadius,
|
|
1547
|
-
insets: insets
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1785
|
+
insets: insets,
|
|
1786
|
+
children: [!centeredText ? /*#__PURE__*/jsx(IconContainer, {
|
|
1787
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
1788
|
+
size: mainIconSize,
|
|
1789
|
+
color: color,
|
|
1790
|
+
icon: getIconContent(type)
|
|
1791
|
+
})
|
|
1792
|
+
}) : null, /*#__PURE__*/jsx(Content, {
|
|
1793
|
+
type: type,
|
|
1794
|
+
centeredText: centeredText,
|
|
1795
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
1796
|
+
base: "body-small",
|
|
1797
|
+
color: color,
|
|
1798
|
+
children: children
|
|
1799
|
+
})
|
|
1800
|
+
}), onDismiss ? /*#__PURE__*/jsx(CloseContainer, {
|
|
1801
|
+
onPress: onDismiss,
|
|
1802
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
1803
|
+
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
1804
|
+
size: xIconSize,
|
|
1805
|
+
color: color
|
|
1806
|
+
})
|
|
1807
|
+
}) : null]
|
|
1808
|
+
});
|
|
1565
1809
|
}
|
|
1566
1810
|
|
|
1567
|
-
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; }
|
|
1811
|
+
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; }
|
|
1568
1812
|
|
|
1569
|
-
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; }
|
|
1570
|
-
var OverlayPressable = /*#__PURE__*/styled
|
|
1571
|
-
displayName: "Overlay__OverlayPressable"
|
|
1572
|
-
componentId: "kitt-universal__sc-1cz1gbr-0"
|
|
1813
|
+
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; }
|
|
1814
|
+
var OverlayPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1815
|
+
displayName: "Overlay__OverlayPressable"
|
|
1573
1816
|
})(function (_ref) {
|
|
1574
1817
|
var theme = _ref.theme;
|
|
1575
|
-
return _objectSpread(_objectSpread({}, StyleSheet.absoluteFillObject), {}, {
|
|
1818
|
+
return _objectSpread$4(_objectSpread$4({}, StyleSheet.absoluteFillObject), {}, {
|
|
1576
1819
|
backgroundColor: theme.kitt.colors.overlay.dark
|
|
1577
1820
|
});
|
|
1578
1821
|
});
|
|
1579
1822
|
function Overlay(_ref2) {
|
|
1580
1823
|
var onPress = _ref2.onPress;
|
|
1581
|
-
return /*#__PURE__*/
|
|
1824
|
+
return /*#__PURE__*/jsx(OverlayPressable, {
|
|
1582
1825
|
accessibilityRole: "none",
|
|
1583
|
-
onPress: onPress
|
|
1584
|
-
|
|
1826
|
+
onPress: onPress,
|
|
1827
|
+
children: /*#__PURE__*/jsx(View, {})
|
|
1828
|
+
});
|
|
1585
1829
|
}
|
|
1586
1830
|
|
|
1587
|
-
var
|
|
1588
|
-
|
|
1589
|
-
var BodyView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1590
|
-
displayName: "Body__BodyView",
|
|
1591
|
-
componentId: "kitt-universal__sc-17fwpo4-0"
|
|
1831
|
+
var BodyView = /*#__PURE__*/styled.View.withConfig({
|
|
1832
|
+
displayName: "Body__BodyView"
|
|
1592
1833
|
})(["padding:", "px ", "px;"], function (_ref) {
|
|
1593
1834
|
var theme = _ref.theme;
|
|
1594
1835
|
return theme.kitt.spacing * 6;
|
|
@@ -1598,12 +1839,15 @@ var BodyView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
1598
1839
|
});
|
|
1599
1840
|
function ModalBody(_ref3) {
|
|
1600
1841
|
var children = _ref3.children;
|
|
1601
|
-
return /*#__PURE__*/
|
|
1842
|
+
return /*#__PURE__*/jsx(ScrollView, {
|
|
1843
|
+
children: /*#__PURE__*/jsx(BodyView, {
|
|
1844
|
+
children: children
|
|
1845
|
+
})
|
|
1846
|
+
});
|
|
1602
1847
|
}
|
|
1603
1848
|
|
|
1604
|
-
var FooterView = /*#__PURE__*/styled
|
|
1605
|
-
displayName: "Footer__FooterView"
|
|
1606
|
-
componentId: "kitt-universal__sc-1ujq2dc-0"
|
|
1849
|
+
var FooterView = /*#__PURE__*/styled.View.withConfig({
|
|
1850
|
+
displayName: "Footer__FooterView"
|
|
1607
1851
|
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], function (_ref) {
|
|
1608
1852
|
var theme = _ref.theme;
|
|
1609
1853
|
return theme.kitt.spacing * 4;
|
|
@@ -1613,14 +1857,15 @@ var FooterView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
1613
1857
|
});
|
|
1614
1858
|
function ModalFooter(_ref3) {
|
|
1615
1859
|
var children = _ref3.children;
|
|
1616
|
-
return /*#__PURE__*/
|
|
1860
|
+
return /*#__PURE__*/jsx(FooterView, {
|
|
1861
|
+
children: children
|
|
1862
|
+
});
|
|
1617
1863
|
}
|
|
1618
1864
|
|
|
1619
1865
|
var OnCloseContext = /*#__PURE__*/createContext(function () {});
|
|
1620
1866
|
|
|
1621
|
-
var HeaderView = /*#__PURE__*/styled
|
|
1622
|
-
displayName: "Header__HeaderView"
|
|
1623
|
-
componentId: "kitt-universal__sc-1iwabch-0"
|
|
1867
|
+
var HeaderView = /*#__PURE__*/styled.View.withConfig({
|
|
1868
|
+
displayName: "Header__HeaderView"
|
|
1624
1869
|
})(["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) {
|
|
1625
1870
|
var theme = _ref.theme;
|
|
1626
1871
|
return theme.kitt.spacing * 2;
|
|
@@ -1628,23 +1873,20 @@ var HeaderView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
1628
1873
|
var theme = _ref2.theme;
|
|
1629
1874
|
return theme.kitt.colors.separator;
|
|
1630
1875
|
});
|
|
1631
|
-
var LeftIconView = /*#__PURE__*/styled
|
|
1632
|
-
displayName: "Header__LeftIconView"
|
|
1633
|
-
componentId: "kitt-universal__sc-1iwabch-1"
|
|
1876
|
+
var LeftIconView = /*#__PURE__*/styled.View.withConfig({
|
|
1877
|
+
displayName: "Header__LeftIconView"
|
|
1634
1878
|
})(["align-self:flex-start;margin-right:", "px;"], function (_ref3) {
|
|
1635
1879
|
var theme = _ref3.theme;
|
|
1636
1880
|
return theme.kitt.spacing * 2;
|
|
1637
1881
|
});
|
|
1638
|
-
var RightIconView = /*#__PURE__*/styled
|
|
1639
|
-
displayName: "Header__RightIconView"
|
|
1640
|
-
componentId: "kitt-universal__sc-1iwabch-2"
|
|
1882
|
+
var RightIconView = /*#__PURE__*/styled.View.withConfig({
|
|
1883
|
+
displayName: "Header__RightIconView"
|
|
1641
1884
|
})(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
|
|
1642
1885
|
var theme = _ref4.theme;
|
|
1643
1886
|
return theme.kitt.spacing * 2;
|
|
1644
1887
|
});
|
|
1645
|
-
var TitleView = /*#__PURE__*/styled
|
|
1646
|
-
displayName: "Header__TitleView"
|
|
1647
|
-
componentId: "kitt-universal__sc-1iwabch-3"
|
|
1888
|
+
var TitleView = /*#__PURE__*/styled.View.withConfig({
|
|
1889
|
+
displayName: "Header__TitleView"
|
|
1648
1890
|
})(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
|
|
1649
1891
|
var theme = _ref5.theme,
|
|
1650
1892
|
isIconLeft = _ref5.isIconLeft;
|
|
@@ -1656,18 +1898,24 @@ function ModalHeader(_ref6) {
|
|
|
1656
1898
|
children = _ref6.children;
|
|
1657
1899
|
var onClose = useContext(OnCloseContext);
|
|
1658
1900
|
var isIconLeft = !!left;
|
|
1659
|
-
return /*#__PURE__*/
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1901
|
+
return /*#__PURE__*/jsxs(HeaderView, {
|
|
1902
|
+
children: [isIconLeft && /*#__PURE__*/jsx(LeftIconView, {
|
|
1903
|
+
children: left
|
|
1904
|
+
}), /*#__PURE__*/jsx(TitleView, {
|
|
1905
|
+
isIconLeft: isIconLeft,
|
|
1906
|
+
children: children
|
|
1907
|
+
}), right !== undefined ? right : /*#__PURE__*/jsx(RightIconView, {
|
|
1908
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
1909
|
+
type: "subtle-dark",
|
|
1910
|
+
icon: /*#__PURE__*/jsx(XIcon, {}),
|
|
1911
|
+
onPress: onClose
|
|
1912
|
+
})
|
|
1913
|
+
})]
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
var ModalView = /*#__PURE__*/styled.View.withConfig({
|
|
1918
|
+
displayName: "Modal__ModalView"
|
|
1671
1919
|
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], function (_ref) {
|
|
1672
1920
|
var theme = _ref.theme;
|
|
1673
1921
|
return theme.kitt.spacing * 20;
|
|
@@ -1675,9 +1923,8 @@ var ModalView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
1675
1923
|
var theme = _ref2.theme;
|
|
1676
1924
|
return theme.kitt.spacing * 4;
|
|
1677
1925
|
});
|
|
1678
|
-
var ContentView = /*#__PURE__*/styled
|
|
1679
|
-
displayName: "Modal__ContentView"
|
|
1680
|
-
componentId: "kitt-universal__sc-1xy2w5u-1"
|
|
1926
|
+
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
1927
|
+
displayName: "Modal__ContentView"
|
|
1681
1928
|
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", ";background-color:", ";"], function (_ref3) {
|
|
1682
1929
|
var theme = _ref3.theme;
|
|
1683
1930
|
return theme.kitt.card.borderRadius;
|
|
@@ -1691,18 +1938,24 @@ function Modal(_ref5) {
|
|
|
1691
1938
|
onClose = _ref5.onClose,
|
|
1692
1939
|
onEntered = _ref5.onEntered,
|
|
1693
1940
|
onExited = _ref5.onExited;
|
|
1694
|
-
return /*#__PURE__*/
|
|
1695
|
-
value: onClose
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1941
|
+
return /*#__PURE__*/jsx(OnCloseContext.Provider, {
|
|
1942
|
+
value: onClose,
|
|
1943
|
+
children: /*#__PURE__*/jsx(Modal$1, {
|
|
1944
|
+
transparent: true,
|
|
1945
|
+
animationType: "fade",
|
|
1946
|
+
visible: visible,
|
|
1947
|
+
onShow: onEntered,
|
|
1948
|
+
onDismiss: onExited,
|
|
1949
|
+
onRequestClose: onClose,
|
|
1950
|
+
children: /*#__PURE__*/jsxs(ModalView, {
|
|
1951
|
+
children: [/*#__PURE__*/jsx(Overlay, {
|
|
1952
|
+
onPress: onClose
|
|
1953
|
+
}), /*#__PURE__*/jsx(ContentView, {
|
|
1954
|
+
children: children
|
|
1955
|
+
})]
|
|
1956
|
+
})
|
|
1957
|
+
})
|
|
1958
|
+
});
|
|
1706
1959
|
}
|
|
1707
1960
|
Modal.Header = ModalHeader;
|
|
1708
1961
|
Modal.Body = ModalBody;
|
|
@@ -1717,26 +1970,24 @@ function Notification(_ref) {
|
|
|
1717
1970
|
var _useSafeAreaInsets = useSafeAreaInsets(),
|
|
1718
1971
|
top = _useSafeAreaInsets.top;
|
|
1719
1972
|
|
|
1720
|
-
return /*#__PURE__*/
|
|
1973
|
+
return /*#__PURE__*/jsx(Message, {
|
|
1721
1974
|
noRadius: true,
|
|
1722
1975
|
type: type,
|
|
1723
1976
|
centeredText: centeredText,
|
|
1724
1977
|
insets: {
|
|
1725
1978
|
top: top
|
|
1726
1979
|
},
|
|
1727
|
-
onDismiss: onDelete
|
|
1728
|
-
|
|
1980
|
+
onDismiss: onDelete,
|
|
1981
|
+
children: children
|
|
1982
|
+
});
|
|
1729
1983
|
}
|
|
1730
1984
|
|
|
1731
|
-
var
|
|
1732
|
-
|
|
1733
|
-
var Flex = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1985
|
+
var Flex = /*#__PURE__*/styled.View.withConfig({
|
|
1734
1986
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
1735
1987
|
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
1736
1988
|
}
|
|
1737
1989
|
}).withConfig({
|
|
1738
|
-
displayName: "Flex"
|
|
1739
|
-
componentId: "kitt-universal__sc-15q3v3h-0"
|
|
1990
|
+
displayName: "Flex"
|
|
1740
1991
|
})(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], function (_ref) {
|
|
1741
1992
|
var direction = _ref.direction;
|
|
1742
1993
|
return direction;
|
|
@@ -1787,9 +2038,8 @@ var useStoryBlockColor = function (color) {
|
|
|
1787
2038
|
var storyBlockColor = useContext(StoryBlockColorContext);
|
|
1788
2039
|
return color || storyBlockColor;
|
|
1789
2040
|
};
|
|
1790
|
-
var StyledStoryBlockView = /*#__PURE__*/styled
|
|
1791
|
-
displayName: "StoryBlock__StyledStoryBlockView"
|
|
1792
|
-
componentId: "kitt-universal__sc-3w4hdm-0"
|
|
2041
|
+
var StyledStoryBlockView = /*#__PURE__*/styled.View.withConfig({
|
|
2042
|
+
displayName: "StoryBlock__StyledStoryBlockView"
|
|
1793
2043
|
})(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, function (_ref) {
|
|
1794
2044
|
var theme = _ref.theme,
|
|
1795
2045
|
background = _ref.background;
|
|
@@ -1798,45 +2048,52 @@ var StyledStoryBlockView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
|
1798
2048
|
function StoryBlock(_ref2) {
|
|
1799
2049
|
var children = _ref2.children,
|
|
1800
2050
|
background = _ref2.background;
|
|
1801
|
-
return /*#__PURE__*/
|
|
1802
|
-
background: background
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
2051
|
+
return /*#__PURE__*/jsx(StyledStoryBlockView, {
|
|
2052
|
+
background: background,
|
|
2053
|
+
children: /*#__PURE__*/jsx(StoryBlockColorContext.Provider, {
|
|
2054
|
+
value: getTypographyColorFromBlockColor(background),
|
|
2055
|
+
children: /*#__PURE__*/jsx(StoryBlockBackgroundContext.Provider, {
|
|
2056
|
+
value: background,
|
|
2057
|
+
children: children
|
|
2058
|
+
})
|
|
2059
|
+
})
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
var StoryTitleContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2064
|
+
displayName: "StoryTitle__StoryTitleContainer"
|
|
1813
2065
|
})(["margin-bottom:30px;"]);
|
|
1814
|
-
var StorySubTitleContainer = /*#__PURE__*/styled
|
|
1815
|
-
displayName: "StoryTitle__StorySubTitleContainer"
|
|
1816
|
-
componentId: "kitt-universal__sc-sic7hb-1"
|
|
2066
|
+
var StorySubTitleContainer = /*#__PURE__*/styled.View.withConfig({
|
|
2067
|
+
displayName: "StoryTitle__StorySubTitleContainer"
|
|
1817
2068
|
})(["margin-bottom:10px;"]);
|
|
1818
2069
|
function StoryTitle(_ref) {
|
|
1819
2070
|
var color = _ref.color,
|
|
1820
2071
|
children = _ref.children,
|
|
1821
2072
|
numberOfLines = _ref.numberOfLines;
|
|
1822
|
-
return /*#__PURE__*/
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
2073
|
+
return /*#__PURE__*/jsx(StoryTitleContainer, {
|
|
2074
|
+
children: /*#__PURE__*/jsx(Typography.Header1, {
|
|
2075
|
+
variant: "bold",
|
|
2076
|
+
base: "header1",
|
|
2077
|
+
color: useStoryBlockColor(color),
|
|
2078
|
+
numberOfLines: numberOfLines,
|
|
2079
|
+
children: children
|
|
2080
|
+
})
|
|
2081
|
+
});
|
|
1828
2082
|
}
|
|
1829
2083
|
|
|
1830
2084
|
function StoryTitleLevel2(_ref2) {
|
|
1831
2085
|
var color = _ref2.color,
|
|
1832
2086
|
children = _ref2.children,
|
|
1833
2087
|
numberOfLines = _ref2.numberOfLines;
|
|
1834
|
-
return /*#__PURE__*/
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
2088
|
+
return /*#__PURE__*/jsx(StoryTitleContainer, {
|
|
2089
|
+
children: /*#__PURE__*/jsx(Typography.Header2, {
|
|
2090
|
+
variant: "bold",
|
|
2091
|
+
base: "header2",
|
|
2092
|
+
color: useStoryBlockColor(color),
|
|
2093
|
+
numberOfLines: numberOfLines,
|
|
2094
|
+
children: children
|
|
2095
|
+
})
|
|
2096
|
+
});
|
|
1840
2097
|
}
|
|
1841
2098
|
|
|
1842
2099
|
StoryTitleLevel2.displayName = 'StoryTitle.Level2';
|
|
@@ -1845,13 +2102,16 @@ function StoryTitleLevel3(_ref3) {
|
|
|
1845
2102
|
var color = _ref3.color,
|
|
1846
2103
|
children = _ref3.children,
|
|
1847
2104
|
numberOfLines = _ref3.numberOfLines;
|
|
1848
|
-
return /*#__PURE__*/
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
2105
|
+
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
2106
|
+
children: /*#__PURE__*/jsx(Typography.Header3, {
|
|
2107
|
+
variant: "bold",
|
|
2108
|
+
base: "header3",
|
|
2109
|
+
medium: "header4",
|
|
2110
|
+
color: useStoryBlockColor(color),
|
|
2111
|
+
numberOfLines: numberOfLines,
|
|
2112
|
+
children: children
|
|
2113
|
+
})
|
|
2114
|
+
});
|
|
1855
2115
|
}
|
|
1856
2116
|
|
|
1857
2117
|
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
@@ -1860,13 +2120,16 @@ function StoryTitleLevel4(_ref4) {
|
|
|
1860
2120
|
var color = _ref4.color,
|
|
1861
2121
|
children = _ref4.children,
|
|
1862
2122
|
numberOfLines = _ref4.numberOfLines;
|
|
1863
|
-
return /*#__PURE__*/
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
2123
|
+
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
2124
|
+
children: /*#__PURE__*/jsx(Typography.Header4, {
|
|
2125
|
+
variant: "bold",
|
|
2126
|
+
base: "header4",
|
|
2127
|
+
medium: "header5",
|
|
2128
|
+
color: useStoryBlockColor(color),
|
|
2129
|
+
numberOfLines: numberOfLines,
|
|
2130
|
+
children: children
|
|
2131
|
+
})
|
|
2132
|
+
});
|
|
1870
2133
|
}
|
|
1871
2134
|
|
|
1872
2135
|
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
@@ -1874,75 +2137,89 @@ StoryTitle.Level2 = StoryTitleLevel2;
|
|
|
1874
2137
|
StoryTitle.Level3 = StoryTitleLevel3;
|
|
1875
2138
|
StoryTitle.Level4 = StoryTitleLevel4;
|
|
1876
2139
|
|
|
1877
|
-
var StoryContainer$1 = /*#__PURE__*/styled
|
|
1878
|
-
displayName: "Story__StoryContainer"
|
|
1879
|
-
componentId: "kitt-universal__sc-1kwdg2p-0"
|
|
2140
|
+
var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
|
|
2141
|
+
displayName: "Story__StoryContainer"
|
|
1880
2142
|
})(["padding:", "px;"], storyPadding);
|
|
1881
2143
|
function Story(_ref) {
|
|
1882
2144
|
var title = _ref.title,
|
|
1883
2145
|
contentContainerStyle = _ref.contentContainerStyle,
|
|
1884
2146
|
children = _ref.children;
|
|
1885
|
-
return /*#__PURE__*/
|
|
1886
|
-
contentContainerStyle: contentContainerStyle
|
|
1887
|
-
|
|
2147
|
+
return /*#__PURE__*/jsxs(StoryContainer$1, {
|
|
2148
|
+
contentContainerStyle: contentContainerStyle,
|
|
2149
|
+
children: [/*#__PURE__*/jsx(StoryTitle, {
|
|
2150
|
+
children: title
|
|
2151
|
+
}), children]
|
|
2152
|
+
});
|
|
1888
2153
|
}
|
|
1889
2154
|
|
|
1890
|
-
var _excluded$2 = ["title", "
|
|
1891
|
-
_excluded2 = ["title", "
|
|
1892
|
-
_excluded3 = ["title", "
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
2155
|
+
var _excluded$2 = ["title", "children", "internalIsDemoSection"],
|
|
2156
|
+
_excluded2 = ["title", "children"],
|
|
2157
|
+
_excluded3 = ["title", "children"];
|
|
2158
|
+
|
|
2159
|
+
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; }
|
|
2160
|
+
|
|
2161
|
+
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; }
|
|
2162
|
+
var StyledSection = /*#__PURE__*/styled.View.withConfig({
|
|
2163
|
+
displayName: "StorySection__StyledSection"
|
|
1896
2164
|
})(["margin-bottom:32px;"]);
|
|
1897
2165
|
function StorySection(_ref) {
|
|
1898
|
-
var title = _ref.title
|
|
1899
|
-
_ref.
|
|
1900
|
-
var children = _ref.children,
|
|
2166
|
+
var title = _ref.title,
|
|
2167
|
+
children = _ref.children,
|
|
1901
2168
|
internalIsDemoSection = _ref.internalIsDemoSection,
|
|
1902
2169
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1903
2170
|
|
|
1904
2171
|
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
1905
|
-
return /*#__PURE__*/
|
|
2172
|
+
return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2173
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
|
|
2174
|
+
children: title
|
|
2175
|
+
}), children]
|
|
2176
|
+
}));
|
|
1906
2177
|
}
|
|
1907
|
-
var StyledSubSection = /*#__PURE__*/styled
|
|
1908
|
-
displayName: "StorySection__StyledSubSection"
|
|
1909
|
-
componentId: "kitt-universal__sc-1b3liv5-1"
|
|
2178
|
+
var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
|
|
2179
|
+
displayName: "StorySection__StyledSubSection"
|
|
1910
2180
|
})(["margin-bottom:16px;"]);
|
|
1911
2181
|
|
|
1912
2182
|
function SubSection(_ref2) {
|
|
1913
|
-
var title = _ref2.title
|
|
1914
|
-
_ref2.
|
|
1915
|
-
var children = _ref2.children,
|
|
2183
|
+
var title = _ref2.title,
|
|
2184
|
+
children = _ref2.children,
|
|
1916
2185
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
1917
2186
|
|
|
1918
|
-
return /*#__PURE__*/
|
|
2187
|
+
return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2188
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
|
|
2189
|
+
children: title
|
|
2190
|
+
}), children]
|
|
2191
|
+
}));
|
|
1919
2192
|
}
|
|
1920
2193
|
|
|
1921
|
-
var StyledBlockSection = /*#__PURE__*/styled
|
|
1922
|
-
displayName: "StorySection__StyledBlockSection"
|
|
1923
|
-
componentId: "kitt-universal__sc-1b3liv5-2"
|
|
2194
|
+
var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
|
|
2195
|
+
displayName: "StorySection__StyledBlockSection"
|
|
1924
2196
|
})(["margin-bottom:16px;"]);
|
|
1925
2197
|
|
|
1926
2198
|
function BlockSection(_ref3) {
|
|
1927
|
-
var title = _ref3.title
|
|
1928
|
-
_ref3.
|
|
1929
|
-
var children = _ref3.children,
|
|
2199
|
+
var title = _ref3.title,
|
|
2200
|
+
children = _ref3.children,
|
|
1930
2201
|
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
1931
2202
|
|
|
1932
|
-
return /*#__PURE__*/
|
|
2203
|
+
return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2204
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
2205
|
+
children: title
|
|
2206
|
+
}), children]
|
|
2207
|
+
}));
|
|
1933
2208
|
}
|
|
1934
2209
|
|
|
1935
|
-
var StyledDemoSection = /*#__PURE__*/styled
|
|
1936
|
-
displayName: "StorySection__StyledDemoSection"
|
|
1937
|
-
componentId: "kitt-universal__sc-1b3liv5-3"
|
|
2210
|
+
var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
|
|
2211
|
+
displayName: "StorySection__StyledDemoSection"
|
|
1938
2212
|
})(["margin-bottom:64px;"]);
|
|
1939
2213
|
|
|
1940
2214
|
function DemoSection(_ref4) {
|
|
1941
2215
|
var children = _ref4.children;
|
|
1942
|
-
return /*#__PURE__*/
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
2216
|
+
return /*#__PURE__*/jsx(StyledDemoSection, {
|
|
2217
|
+
children: /*#__PURE__*/jsx(StorySection, {
|
|
2218
|
+
internalIsDemoSection: true,
|
|
2219
|
+
title: "Demo",
|
|
2220
|
+
children: children
|
|
2221
|
+
})
|
|
2222
|
+
});
|
|
1946
2223
|
}
|
|
1947
2224
|
|
|
1948
2225
|
StorySection.SubSection = SubSection;
|
|
@@ -1963,33 +2240,31 @@ function StoryContainer(_ref) {
|
|
|
1963
2240
|
_ref$platform = _ref.platform,
|
|
1964
2241
|
platform = _ref$platform === void 0 ? 'all' : _ref$platform;
|
|
1965
2242
|
if (platform === 'web') return null;
|
|
1966
|
-
return /*#__PURE__*/
|
|
2243
|
+
return /*#__PURE__*/jsx(StorySection.BlockSection, {
|
|
1967
2244
|
testID: state,
|
|
1968
|
-
title: title
|
|
1969
|
-
|
|
2245
|
+
title: title,
|
|
2246
|
+
children: children
|
|
2247
|
+
});
|
|
1970
2248
|
}
|
|
1971
2249
|
|
|
1972
2250
|
function StoryDecorator(storyFn, context) {
|
|
1973
|
-
return /*#__PURE__*/
|
|
1974
|
-
title: context.name
|
|
1975
|
-
|
|
2251
|
+
return /*#__PURE__*/jsx(Story, {
|
|
2252
|
+
title: context.name,
|
|
2253
|
+
children: storyFn()
|
|
2254
|
+
});
|
|
1976
2255
|
}
|
|
1977
2256
|
|
|
1978
|
-
var SmallScreenRow = /*#__PURE__*/styled
|
|
1979
|
-
displayName: "StoryGrid__SmallScreenRow"
|
|
1980
|
-
componentId: "kitt-universal__sc-4z5new-0"
|
|
2257
|
+
var SmallScreenRow = /*#__PURE__*/styled.View.withConfig({
|
|
2258
|
+
displayName: "StoryGrid__SmallScreenRow"
|
|
1981
2259
|
})(["flex-direction:column;margin:0;"]);
|
|
1982
|
-
var SmallScreenCol = /*#__PURE__*/styled
|
|
1983
|
-
displayName: "StoryGrid__SmallScreenCol"
|
|
1984
|
-
componentId: "kitt-universal__sc-4z5new-1"
|
|
2260
|
+
var SmallScreenCol = /*#__PURE__*/styled.View.withConfig({
|
|
2261
|
+
displayName: "StoryGrid__SmallScreenCol"
|
|
1985
2262
|
})(["padding:8px 0 16px;"]);
|
|
1986
|
-
var FlexRow = /*#__PURE__*/styled
|
|
1987
|
-
displayName: "StoryGrid__FlexRow"
|
|
1988
|
-
componentId: "kitt-universal__sc-4z5new-2"
|
|
2263
|
+
var FlexRow = /*#__PURE__*/styled.View.withConfig({
|
|
2264
|
+
displayName: "StoryGrid__FlexRow"
|
|
1989
2265
|
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
1990
|
-
var FlexCol = /*#__PURE__*/styled
|
|
1991
|
-
displayName: "StoryGrid__FlexCol"
|
|
1992
|
-
componentId: "kitt-universal__sc-4z5new-3"
|
|
2266
|
+
var FlexCol = /*#__PURE__*/styled.View.withConfig({
|
|
2267
|
+
displayName: "StoryGrid__FlexCol"
|
|
1993
2268
|
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
1994
2269
|
|
|
1995
2270
|
function StoryGridRow(_ref) {
|
|
@@ -2005,14 +2280,22 @@ function StoryGridRow(_ref) {
|
|
|
2005
2280
|
var breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
2006
2281
|
|
|
2007
2282
|
if (width < breakpointValue) {
|
|
2008
|
-
return /*#__PURE__*/
|
|
2009
|
-
|
|
2010
|
-
|
|
2283
|
+
return /*#__PURE__*/jsx(SmallScreenRow, {
|
|
2284
|
+
children: Children.map(children, function (child) {
|
|
2285
|
+
return /*#__PURE__*/jsx(SmallScreenCol, {
|
|
2286
|
+
children: child
|
|
2287
|
+
});
|
|
2288
|
+
})
|
|
2289
|
+
});
|
|
2011
2290
|
}
|
|
2012
2291
|
|
|
2013
|
-
return /*#__PURE__*/
|
|
2014
|
-
|
|
2015
|
-
|
|
2292
|
+
return /*#__PURE__*/jsx(FlexRow, {
|
|
2293
|
+
children: Children.map(children, function (child) {
|
|
2294
|
+
return /*#__PURE__*/jsx(FlexCol, {
|
|
2295
|
+
children: child
|
|
2296
|
+
});
|
|
2297
|
+
})
|
|
2298
|
+
});
|
|
2016
2299
|
}
|
|
2017
2300
|
|
|
2018
2301
|
function StoryGridCol(_ref2) {
|
|
@@ -2031,10 +2314,13 @@ function StoryGridCol(_ref2) {
|
|
|
2031
2314
|
return null;
|
|
2032
2315
|
}
|
|
2033
2316
|
|
|
2034
|
-
return /*#__PURE__*/
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2317
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
2318
|
+
children: [title ? /*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
2319
|
+
numberOfLines: 1,
|
|
2320
|
+
color: titleColor,
|
|
2321
|
+
children: title
|
|
2322
|
+
}) : null, children]
|
|
2323
|
+
});
|
|
2038
2324
|
}
|
|
2039
2325
|
|
|
2040
2326
|
var StoryGrid = {
|
|
@@ -2042,9 +2328,8 @@ var StoryGrid = {
|
|
|
2042
2328
|
Col: StoryGridCol
|
|
2043
2329
|
};
|
|
2044
2330
|
|
|
2045
|
-
var Container = /*#__PURE__*/styled
|
|
2046
|
-
displayName: "Tag__Container"
|
|
2047
|
-
componentId: "kitt-universal__sc-19jmowi-0"
|
|
2331
|
+
var Container$1 = /*#__PURE__*/styled.View.withConfig({
|
|
2332
|
+
displayName: "Tag__Container"
|
|
2048
2333
|
})(["background-color:", ";border-width:", ";border-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], function (_ref) {
|
|
2049
2334
|
var theme = _ref.theme,
|
|
2050
2335
|
type = _ref.type,
|
|
@@ -2096,13 +2381,15 @@ function Tag(_ref6) {
|
|
|
2096
2381
|
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
2097
2382
|
_ref6$variant = _ref6.variant,
|
|
2098
2383
|
variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
|
|
2099
|
-
return /*#__PURE__*/
|
|
2384
|
+
return /*#__PURE__*/jsx(Container$1, {
|
|
2100
2385
|
type: type,
|
|
2101
|
-
variant: variant
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2386
|
+
variant: variant,
|
|
2387
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
2388
|
+
base: "body-xsmall",
|
|
2389
|
+
color: getLabelColor(type, variant),
|
|
2390
|
+
children: label
|
|
2391
|
+
})
|
|
2392
|
+
});
|
|
2106
2393
|
}
|
|
2107
2394
|
|
|
2108
2395
|
var lateOceanColorPalette = {
|
|
@@ -2211,6 +2498,7 @@ var colorsLateOceanTheme = {
|
|
|
2211
2498
|
danger: lateOceanColorPalette.englishVermillon,
|
|
2212
2499
|
separator: lateOceanColorPalette.black100,
|
|
2213
2500
|
hover: lateOceanColorPalette.black100,
|
|
2501
|
+
black: lateOceanColorPalette.black1000,
|
|
2214
2502
|
uiBackground: lateOceanColorPalette.black25,
|
|
2215
2503
|
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2216
2504
|
overlay: {
|
|
@@ -2396,6 +2684,15 @@ var tagLateOceanTheme = {
|
|
|
2396
2684
|
}
|
|
2397
2685
|
};
|
|
2398
2686
|
|
|
2687
|
+
var tooltip = {
|
|
2688
|
+
backgroundColor: colorsLateOceanTheme.black,
|
|
2689
|
+
borderRadius: 10,
|
|
2690
|
+
opacity: 0.95,
|
|
2691
|
+
horizontalPadding: 16,
|
|
2692
|
+
verticalPadding: 4,
|
|
2693
|
+
floatingPadding: 8
|
|
2694
|
+
};
|
|
2695
|
+
|
|
2399
2696
|
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
2400
2697
|
return Math.round(fontSize * lineHeightMultiplier);
|
|
2401
2698
|
};
|
|
@@ -2512,46 +2809,433 @@ var theme = {
|
|
|
2512
2809
|
shadows: shadowsLateOceanTheme,
|
|
2513
2810
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2514
2811
|
iconButton: iconButton,
|
|
2515
|
-
listItem: listItemLateOceanTheme
|
|
2812
|
+
listItem: listItemLateOceanTheme,
|
|
2813
|
+
tooltip: tooltip
|
|
2516
2814
|
};
|
|
2517
2815
|
|
|
2518
|
-
function
|
|
2816
|
+
function Title(_ref) {
|
|
2519
2817
|
var children = _ref.children;
|
|
2520
|
-
return /*#__PURE__*/
|
|
2818
|
+
return /*#__PURE__*/jsx(Modal.Header, {
|
|
2819
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
2820
|
+
base: "body",
|
|
2821
|
+
variant: "bold",
|
|
2822
|
+
children: children
|
|
2823
|
+
})
|
|
2824
|
+
});
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
function ModalDateTimePicker(_ref2) {
|
|
2828
|
+
var title = _ref2.title,
|
|
2829
|
+
visible = _ref2.visible,
|
|
2830
|
+
value = _ref2.value,
|
|
2831
|
+
validateButtonLabel = _ref2.validateButtonLabel,
|
|
2832
|
+
onChange = _ref2.onChange,
|
|
2833
|
+
onClose = _ref2.onClose;
|
|
2834
|
+
|
|
2835
|
+
var _useState = useState(value),
|
|
2836
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2837
|
+
currentValue = _useState2[0],
|
|
2838
|
+
setCurrentValue = _useState2[1]; // Prevent unsynced value between the modal and its parent state
|
|
2839
|
+
|
|
2840
|
+
|
|
2841
|
+
return /*#__PURE__*/jsx(Modal, {
|
|
2842
|
+
visible: Boolean(visible),
|
|
2843
|
+
onClose: function handleClose() {
|
|
2844
|
+
setCurrentValue(value);
|
|
2845
|
+
onClose();
|
|
2846
|
+
},
|
|
2847
|
+
children: visible ? /*#__PURE__*/jsxs(Fragment$1, {
|
|
2848
|
+
children: [title ? /*#__PURE__*/jsx(Title, {
|
|
2849
|
+
children: title
|
|
2850
|
+
}) : null, /*#__PURE__*/jsx(Modal.Body, {
|
|
2851
|
+
children: /*#__PURE__*/jsx(DateTimePicker, {
|
|
2852
|
+
is24Hour: true,
|
|
2853
|
+
testID: "date-picker-native-element",
|
|
2854
|
+
value: currentValue,
|
|
2855
|
+
mode: "time",
|
|
2856
|
+
display: Platform.OS === 'ios' ? 'spinner' : 'default',
|
|
2857
|
+
onChange: function (_event, date) {
|
|
2858
|
+
return setCurrentValue(function (prev) {
|
|
2859
|
+
return date || prev;
|
|
2860
|
+
});
|
|
2861
|
+
}
|
|
2862
|
+
})
|
|
2863
|
+
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
2864
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
2865
|
+
stretch: true,
|
|
2866
|
+
type: "primary",
|
|
2867
|
+
onPress: function handleSubmit() {
|
|
2868
|
+
onChange(currentValue);
|
|
2869
|
+
},
|
|
2870
|
+
children: validateButtonLabel ? /*#__PURE__*/jsx(Text$1, {
|
|
2871
|
+
children: validateButtonLabel
|
|
2872
|
+
}) : /*#__PURE__*/jsx(FormattedMessage, {
|
|
2873
|
+
id: "kitt-universal.ModalDateTimePicker.confirm"
|
|
2874
|
+
})
|
|
2875
|
+
})
|
|
2876
|
+
})]
|
|
2877
|
+
}) : null
|
|
2878
|
+
});
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
var timePickerPlaceholder = '--:--';
|
|
2882
|
+
var useTimePicker = function (value, onChange, onBlur, disabled, defaultValue) {
|
|
2883
|
+
var _useState = useState(false),
|
|
2884
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2885
|
+
isTimePickerModalVisible = _useState2[0],
|
|
2886
|
+
setIsTimePickerModalVisible = _useState2[1];
|
|
2887
|
+
|
|
2888
|
+
var todayAtNoon = useMemo(function () {
|
|
2889
|
+
var now = new Date(2000, 0, 1, 12);
|
|
2890
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDay(), 12);
|
|
2891
|
+
}, []);
|
|
2892
|
+
var defaultDate = defaultValue || todayAtNoon;
|
|
2893
|
+
var dateTimePickerValue = value || defaultDate;
|
|
2894
|
+
var displayedValue = value === null ? timePickerPlaceholder : Intl.DateTimeFormat('fr-FR', {
|
|
2895
|
+
minute: 'numeric',
|
|
2896
|
+
hour: 'numeric'
|
|
2897
|
+
}).format(dateTimePickerValue);
|
|
2898
|
+
var timePickerState = isTimePickerModalVisible ? 'focus' : 'default';
|
|
2899
|
+
return {
|
|
2900
|
+
dateTimePickerValue: dateTimePickerValue,
|
|
2901
|
+
displayedValue: displayedValue,
|
|
2902
|
+
timePickerState: timePickerState,
|
|
2903
|
+
isTimePickerModalVisible: isTimePickerModalVisible,
|
|
2904
|
+
handleInputPress: function handleInputPress() {
|
|
2905
|
+
if (disabled) {
|
|
2906
|
+
return;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
setIsTimePickerModalVisible(true);
|
|
2910
|
+
},
|
|
2911
|
+
handleTimeChange: function handleTimeChange(date) {
|
|
2912
|
+
setIsTimePickerModalVisible(false);
|
|
2913
|
+
onChange(date || defaultDate);
|
|
2914
|
+
onBlur();
|
|
2915
|
+
},
|
|
2916
|
+
handleModalClose: function handleModalClose() {
|
|
2917
|
+
return setIsTimePickerModalVisible(false);
|
|
2918
|
+
}
|
|
2919
|
+
};
|
|
2920
|
+
};
|
|
2921
|
+
|
|
2922
|
+
var Container = /*#__PURE__*/styled.Pressable.withConfig({
|
|
2923
|
+
displayName: "TimePicker__Container"
|
|
2924
|
+
})(["", " width:100px;height:40px;justify-content:center;align-items:center;"], styledTextInputMixin);
|
|
2925
|
+
function TimePicker(_ref) {
|
|
2926
|
+
var title = _ref.title,
|
|
2927
|
+
_ref$state = _ref.state,
|
|
2928
|
+
state = _ref$state === void 0 ? 'default' : _ref$state,
|
|
2929
|
+
_ref$disabled = _ref.disabled,
|
|
2930
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
2931
|
+
forceDefaultValue = _ref.forceDefaultValue,
|
|
2932
|
+
value = _ref.value,
|
|
2933
|
+
validateButtonLabel = _ref.validateButtonLabel,
|
|
2934
|
+
onChange = _ref.onChange,
|
|
2935
|
+
onBlur = _ref.onBlur;
|
|
2936
|
+
|
|
2937
|
+
var _useTimePicker = useTimePicker(value || null, onChange, onBlur, disabled, forceDefaultValue),
|
|
2938
|
+
dateTimePickerValue = _useTimePicker.dateTimePickerValue,
|
|
2939
|
+
displayedValue = _useTimePicker.displayedValue,
|
|
2940
|
+
timePickerState = _useTimePicker.timePickerState,
|
|
2941
|
+
handleInputPress = _useTimePicker.handleInputPress,
|
|
2942
|
+
handleModalClose = _useTimePicker.handleModalClose,
|
|
2943
|
+
handleTimeChange = _useTimePicker.handleTimeChange,
|
|
2944
|
+
isTimePickerModalVisible = _useTimePicker.isTimePickerModalVisible;
|
|
2945
|
+
|
|
2946
|
+
return /*#__PURE__*/jsxs(Container, {
|
|
2947
|
+
state: timePickerState === 'default' ? state : timePickerState,
|
|
2948
|
+
accessibilityRole: "button",
|
|
2949
|
+
onPress: handleInputPress,
|
|
2950
|
+
children: [/*#__PURE__*/jsx(Typography.Text, {
|
|
2951
|
+
base: "body",
|
|
2952
|
+
color: displayedValue === timePickerPlaceholder ? 'black-light' : 'black',
|
|
2953
|
+
children: displayedValue
|
|
2954
|
+
}), Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsx(DateTimePicker, {
|
|
2955
|
+
is24Hour: true,
|
|
2956
|
+
testID: "date-picker-native-element",
|
|
2957
|
+
value: dateTimePickerValue,
|
|
2958
|
+
mode: "time",
|
|
2959
|
+
display: "default",
|
|
2960
|
+
onChange: function (_event, date) {
|
|
2961
|
+
return handleTimeChange(date);
|
|
2962
|
+
}
|
|
2963
|
+
}) : null, Platform.OS !== 'android' ? /*#__PURE__*/jsx(ModalDateTimePicker, {
|
|
2964
|
+
title: title,
|
|
2965
|
+
visible: isTimePickerModalVisible,
|
|
2966
|
+
value: dateTimePickerValue,
|
|
2967
|
+
validateButtonLabel: validateButtonLabel,
|
|
2968
|
+
onChange: handleTimeChange,
|
|
2969
|
+
onClose: handleModalClose
|
|
2970
|
+
}) : null]
|
|
2971
|
+
});
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
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; }
|
|
2975
|
+
|
|
2976
|
+
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; }
|
|
2977
|
+
|
|
2978
|
+
var Arrow = function (props) {
|
|
2979
|
+
return /*#__PURE__*/jsx("svg", _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
2980
|
+
children: /*#__PURE__*/jsx("path", {
|
|
2981
|
+
fillRule: "evenodd",
|
|
2982
|
+
clipRule: "evenodd",
|
|
2983
|
+
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",
|
|
2984
|
+
fill: "currentColor"
|
|
2985
|
+
})
|
|
2986
|
+
}));
|
|
2987
|
+
};
|
|
2988
|
+
|
|
2989
|
+
Arrow.defaultProps = {
|
|
2990
|
+
width: "36",
|
|
2991
|
+
height: "8",
|
|
2992
|
+
viewBox: "0 0 36 9",
|
|
2993
|
+
fill: "none",
|
|
2994
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2995
|
+
};
|
|
2996
|
+
var StyledTooltipView = /*#__PURE__*/styled.View.withConfig({
|
|
2997
|
+
displayName: "TooltipView__StyledTooltipView"
|
|
2998
|
+
})(["align-items:center;"]);
|
|
2999
|
+
var StyledTooltipContent = /*#__PURE__*/styled.View.withConfig({
|
|
3000
|
+
displayName: "TooltipView__StyledTooltipContent"
|
|
3001
|
+
})(["background-color:", ";border-radius:", "px;opacity:", ";padding:", ";"], function (_ref) {
|
|
3002
|
+
var theme = _ref.theme;
|
|
3003
|
+
return theme.kitt.tooltip.backgroundColor;
|
|
3004
|
+
}, function (_ref2) {
|
|
3005
|
+
var theme = _ref2.theme;
|
|
3006
|
+
return theme.kitt.tooltip.borderRadius;
|
|
3007
|
+
}, function (_ref3) {
|
|
3008
|
+
var theme = _ref3.theme;
|
|
3009
|
+
return theme.kitt.tooltip.opacity;
|
|
3010
|
+
}, function (_ref4) {
|
|
3011
|
+
var theme = _ref4.theme;
|
|
3012
|
+
return "".concat(theme.kitt.tooltip.verticalPadding, "px ").concat(theme.kitt.tooltip.horizontalPadding, "px");
|
|
3013
|
+
});
|
|
3014
|
+
|
|
3015
|
+
function ArrowView(props) {
|
|
3016
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3017
|
+
return /*#__PURE__*/jsx(View, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
3018
|
+
children: /*#__PURE__*/jsx(Arrow, {
|
|
3019
|
+
color: theme.kitt.tooltip.backgroundColor
|
|
3020
|
+
})
|
|
3021
|
+
}));
|
|
3022
|
+
}
|
|
3023
|
+
|
|
3024
|
+
var StyledArrow = /*#__PURE__*/styled(ArrowView).withConfig({
|
|
3025
|
+
displayName: "TooltipView__StyledArrow"
|
|
3026
|
+
})(["color:", ";transform:", ";"], function (_ref5) {
|
|
3027
|
+
var theme = _ref5.theme;
|
|
3028
|
+
return theme.kitt.tooltip.backgroundColor;
|
|
3029
|
+
}, function (_ref6) {
|
|
3030
|
+
var $position = _ref6.$position;
|
|
3031
|
+
return "rotate(".concat($position === 'bottom' ? 180 : 0, "deg)");
|
|
3032
|
+
});
|
|
3033
|
+
function TooltipView(_ref7) {
|
|
3034
|
+
var children = _ref7.children,
|
|
3035
|
+
position = _ref7.position;
|
|
3036
|
+
return /*#__PURE__*/jsxs(StyledTooltipView, {
|
|
3037
|
+
children: [position === 'bottom' ? /*#__PURE__*/jsx(StyledArrow, {
|
|
3038
|
+
$position: position
|
|
3039
|
+
}) : null, /*#__PURE__*/jsx(StyledTooltipContent, {
|
|
3040
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
3041
|
+
base: "body",
|
|
3042
|
+
color: "white",
|
|
3043
|
+
children: children
|
|
3044
|
+
})
|
|
3045
|
+
}), position === 'top' ? /*#__PURE__*/jsx(StyledArrow, {
|
|
3046
|
+
$position: position
|
|
3047
|
+
}) : null]
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
var tooltipDefaultPosition = 'top';
|
|
3052
|
+
|
|
3053
|
+
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; }
|
|
3054
|
+
|
|
3055
|
+
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; }
|
|
3056
|
+
// Since the tooltip use absolute positionning, we need a parent to provide the relative root
|
|
3057
|
+
var TooltipContainer = /*#__PURE__*/styled.View.withConfig({
|
|
3058
|
+
displayName: "Tooltip__TooltipContainer"
|
|
3059
|
+
})(["position:relative;align-self:baseline;"]);
|
|
3060
|
+
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3061
|
+
// TODO : update position on scroll in future iteration
|
|
3062
|
+
function Tooltip(_ref) {
|
|
3063
|
+
var children = _ref.children,
|
|
3064
|
+
defaultVisible = _ref.defaultVisible,
|
|
3065
|
+
_ref$position = _ref.position,
|
|
3066
|
+
position = _ref$position === void 0 ? tooltipDefaultPosition : _ref$position,
|
|
3067
|
+
content = _ref.content,
|
|
3068
|
+
floatingPadding = _ref.floatingPadding,
|
|
3069
|
+
onUpdate = _ref.onUpdate;
|
|
3070
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3071
|
+
var padding = floatingPadding || theme.kitt.tooltip.floatingPadding;
|
|
3072
|
+
var pressed = useSharedValue(defaultVisible);
|
|
3073
|
+
var opacityStyles = useAnimatedStyle(function () {
|
|
3074
|
+
var _f = function () {
|
|
3075
|
+
return {
|
|
3076
|
+
opacity: withSpring(pressed.value ? theme.kitt.tooltip.opacity : 0)
|
|
3077
|
+
};
|
|
3078
|
+
};
|
|
3079
|
+
|
|
3080
|
+
_f._closure = {
|
|
3081
|
+
withSpring: withSpring,
|
|
3082
|
+
pressed: pressed,
|
|
3083
|
+
theme: {
|
|
3084
|
+
kitt: {
|
|
3085
|
+
tooltip: {
|
|
3086
|
+
opacity: theme.kitt.tooltip.opacity
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
};
|
|
3091
|
+
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{opacity:withSpring(pressed.value?theme.kitt.tooltip.opacity:0)};}}";
|
|
3092
|
+
_f.__workletHash = 15953928507970;
|
|
3093
|
+
_f.__location = "/home/chris/ornikar/kitt/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (57:41)";
|
|
3094
|
+
_f.__optimalization = 2;
|
|
3095
|
+
|
|
3096
|
+
global.__reanimatedWorkletInit(_f);
|
|
3097
|
+
|
|
3098
|
+
return _f;
|
|
3099
|
+
}());
|
|
3100
|
+
|
|
3101
|
+
var _useFloating = useFloating({
|
|
3102
|
+
placement: position,
|
|
3103
|
+
middleware: [offset(padding), shift(), flip({
|
|
3104
|
+
padding: padding
|
|
3105
|
+
})]
|
|
3106
|
+
}),
|
|
3107
|
+
x = _useFloating.x,
|
|
3108
|
+
y = _useFloating.y,
|
|
3109
|
+
reference = _useFloating.reference,
|
|
3110
|
+
floating = _useFloating.floating,
|
|
3111
|
+
update = _useFloating.update,
|
|
3112
|
+
refs = _useFloating.refs,
|
|
3113
|
+
middlewareData = _useFloating.middlewareData;
|
|
3114
|
+
|
|
3115
|
+
useEffect(function () {
|
|
3116
|
+
if (!onUpdate) return;
|
|
3117
|
+
onUpdate({
|
|
3118
|
+
x: x,
|
|
3119
|
+
y: y,
|
|
3120
|
+
reference: reference,
|
|
3121
|
+
floating: floating,
|
|
3122
|
+
strategy: 'absolute',
|
|
3123
|
+
update: update,
|
|
3124
|
+
refs: refs,
|
|
3125
|
+
middlewareData: middlewareData
|
|
3126
|
+
});
|
|
3127
|
+
}, [x, y, reference, floating, update, refs, middlewareData, onUpdate]);
|
|
3128
|
+
return /*#__PURE__*/jsxs(TooltipContainer, {
|
|
3129
|
+
children: [/*#__PURE__*/jsx(View, {
|
|
3130
|
+
ref: reference,
|
|
3131
|
+
children: /*#__PURE__*/jsx(Pressable, {
|
|
3132
|
+
accessibilityRole: "button",
|
|
3133
|
+
onPress: function handlePress() {
|
|
3134
|
+
pressed.value = !pressed.value;
|
|
3135
|
+
},
|
|
3136
|
+
children: children
|
|
3137
|
+
})
|
|
3138
|
+
}), /*#__PURE__*/jsx(View, {
|
|
3139
|
+
ref: floating,
|
|
3140
|
+
accessibilityElementsHidden: !pressed.value,
|
|
3141
|
+
importantForAccessibility: pressed.value === true ? 'auto' : 'no-hide-descendants',
|
|
3142
|
+
style: _objectSpread$1(_objectSpread$1({}, StyleSheet.absoluteFillObject), {}, {
|
|
3143
|
+
top: y && position === 'bottom' ? y : undefined,
|
|
3144
|
+
bottom: y && position === 'top' ? y : undefined,
|
|
3145
|
+
left: x !== null && x !== void 0 ? x : 0
|
|
3146
|
+
}),
|
|
3147
|
+
children: /*#__PURE__*/jsx(Animated$1.View, {
|
|
3148
|
+
style: [opacityStyles],
|
|
3149
|
+
children: /*#__PURE__*/jsx(TooltipView, {
|
|
3150
|
+
position: position,
|
|
3151
|
+
children: content
|
|
3152
|
+
})
|
|
3153
|
+
})
|
|
3154
|
+
})]
|
|
3155
|
+
});
|
|
2521
3156
|
}
|
|
3157
|
+
Tooltip.View = TooltipView;
|
|
3158
|
+
|
|
3159
|
+
var StyledTypographyEmoji = /*#__PURE__*/styled(Emoji).withConfig({
|
|
3160
|
+
displayName: "TypographyEmoji__StyledTypographyEmoji"
|
|
3161
|
+
})(["align-self:center;", ""], function (_ref) {
|
|
3162
|
+
var size = _ref.size;
|
|
3163
|
+
if (Platform.OS !== 'web') return undefined;
|
|
3164
|
+
/* Style Twemoji: https://github.com/twitter/twemoji#inline-styles */
|
|
3165
|
+
|
|
3166
|
+
return "\n margin: 0 ".concat(size / 20, "px 0 ").concat(size / 10, "px;\n transform: translateY(").concat(size / 10 * 2, "px);\n ");
|
|
3167
|
+
});
|
|
3168
|
+
function TypographyEmoji(_ref2) {
|
|
3169
|
+
var emoji = _ref2.emoji,
|
|
3170
|
+
base = _ref2.base,
|
|
3171
|
+
small = _ref2.small,
|
|
3172
|
+
medium = _ref2.medium,
|
|
3173
|
+
large = _ref2.large;
|
|
3174
|
+
var theme = /*#__PURE__*/useTheme();
|
|
3175
|
+
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
|
|
3176
|
+
var typeConfig = getTypographyTypeConfig(typeForCurrentWindowSize || 'body', theme);
|
|
3177
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
3178
|
+
var fontSize = typeConfig[typeConfigKey].fontSize;
|
|
2522
3179
|
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
shouldForwardProp: function shouldForwardProp(prop) {
|
|
2526
|
-
return !['disabled', 'noUnderline'].includes(prop);
|
|
3180
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
3181
|
+
if (!fontSize.endsWith('px')) throw new Error("Unexpected font-size value: ".concat(fontSize));
|
|
2527
3182
|
}
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
3183
|
+
|
|
3184
|
+
return /*#__PURE__*/jsx(StyledTypographyEmoji, {
|
|
3185
|
+
size: parseInt(fontSize.slice(0, -2), 10),
|
|
3186
|
+
emoji: emoji
|
|
3187
|
+
});
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
var _excluded$1 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
|
|
3191
|
+
|
|
3192
|
+
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; }
|
|
3193
|
+
|
|
3194
|
+
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; }
|
|
3195
|
+
var TypographyLinkWebWrapper = withTheme( /*#__PURE__*/styledLinaria("span")({
|
|
3196
|
+
name: "TypographyLinkWebWrapper",
|
|
3197
|
+
"class": "tcwz3nt"
|
|
3198
|
+
}));
|
|
3199
|
+
var StyledLink = /*#__PURE__*/styled.Text.withConfig({
|
|
3200
|
+
displayName: "TypographyLink__StyledLink"
|
|
3201
|
+
})(["text-decoration:", ";", ";", ";"], function (_ref) {
|
|
3202
|
+
var $noUnderline = _ref.$noUnderline;
|
|
3203
|
+
return $noUnderline ? 'none' : 'underline';
|
|
2534
3204
|
}, function (_ref2) {
|
|
2535
|
-
var disabled = _ref2
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
3205
|
+
var $disabled = _ref2.$disabled;
|
|
3206
|
+
if (Platform.OS !== 'web') return undefined;
|
|
3207
|
+
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3208
|
+
}, function (_ref3) {
|
|
3209
|
+
var $disabled = _ref3.$disabled,
|
|
3210
|
+
theme = _ref3.theme;
|
|
3211
|
+
if (!$disabled) return undefined;
|
|
3212
|
+
return "color: ".concat(theme.kitt.typography.link.disabledColor, ";");
|
|
2539
3213
|
});
|
|
2540
|
-
function TypographyLink(
|
|
2541
|
-
var children =
|
|
2542
|
-
disabled =
|
|
2543
|
-
noUnderline =
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
3214
|
+
function TypographyLink(_ref4) {
|
|
3215
|
+
var children = _ref4.children,
|
|
3216
|
+
disabled = _ref4.disabled,
|
|
3217
|
+
noUnderline = _ref4.noUnderline,
|
|
3218
|
+
href = _ref4.href,
|
|
3219
|
+
hrefAttrs = _ref4.hrefAttrs,
|
|
3220
|
+
onPress = _ref4.onPress,
|
|
3221
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded$1);
|
|
3222
|
+
|
|
3223
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
3224
|
+
accessibilityRole: "none",
|
|
3225
|
+
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3226
|
+
as: TypographyLinkWebWrapper,
|
|
3227
|
+
"data-nounderline": noUnderline,
|
|
3228
|
+
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3229
|
+
$disabled: disabled,
|
|
3230
|
+
$noUnderline: noUnderline,
|
|
3231
|
+
href: href,
|
|
3232
|
+
hrefAttrs: hrefAttrs,
|
|
3233
|
+
accessibilityRole: "link",
|
|
3234
|
+
onPress: disabled ? undefined : onPress,
|
|
3235
|
+
children: children
|
|
3236
|
+
})
|
|
3237
|
+
})
|
|
3238
|
+
}));
|
|
2555
3239
|
}
|
|
2556
3240
|
|
|
2557
3241
|
function matchWindowSize(currentWidth, _ref) {
|
|
@@ -2623,9 +3307,10 @@ function useKittTheme() {
|
|
|
2623
3307
|
function KittThemeProvider(_ref) {
|
|
2624
3308
|
var children = _ref.children;
|
|
2625
3309
|
var theme = useKittTheme();
|
|
2626
|
-
return /*#__PURE__*/
|
|
2627
|
-
theme: theme
|
|
2628
|
-
|
|
3310
|
+
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
3311
|
+
theme: theme,
|
|
3312
|
+
children: children
|
|
3313
|
+
});
|
|
2629
3314
|
}
|
|
2630
3315
|
var KittThemeDecorator = makeDecorator({
|
|
2631
3316
|
name: 'ThemeDecorator',
|
|
@@ -2633,17 +3318,9 @@ var KittThemeDecorator = makeDecorator({
|
|
|
2633
3318
|
wrapper: function wrapper(storyFn, context, _ref2) {
|
|
2634
3319
|
_ref2.options;
|
|
2635
3320
|
_ref2.parameters;
|
|
2636
|
-
return /*#__PURE__*/
|
|
2637
|
-
|
|
2638
|
-
});
|
|
2639
|
-
|
|
2640
|
-
var SafeAreaProviderDecorator = makeDecorator({
|
|
2641
|
-
name: 'SafeAreaProviderDecorator',
|
|
2642
|
-
parameterName: 'safeAreaProvider',
|
|
2643
|
-
wrapper: function wrapper(storyFn, context, _ref) {
|
|
2644
|
-
_ref.options;
|
|
2645
|
-
_ref.parameters;
|
|
2646
|
-
return /*#__PURE__*/React.createElement(SafeAreaProvider, null, storyFn(context));
|
|
3321
|
+
return /*#__PURE__*/jsx(KittThemeProvider, {
|
|
3322
|
+
children: storyFn(context)
|
|
3323
|
+
});
|
|
2647
3324
|
}
|
|
2648
3325
|
});
|
|
2649
3326
|
|
|
@@ -2654,8 +3331,10 @@ function MatchWindowSize(_ref) {
|
|
|
2654
3331
|
|
|
2655
3332
|
var match = useMatchWindowSize(matchWindowSizeOptions);
|
|
2656
3333
|
if (!match) return null;
|
|
2657
|
-
return /*#__PURE__*/
|
|
3334
|
+
return /*#__PURE__*/jsx(Fragment$1, {
|
|
3335
|
+
children: children
|
|
3336
|
+
});
|
|
2658
3337
|
}
|
|
2659
3338
|
|
|
2660
|
-
export { Avatar, Button, Card, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification,
|
|
3339
|
+
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 };
|
|
2661
3340
|
//# sourceMappingURL=index-browser-all.es.js.map
|