@ornikar/kitt-universal 2.4.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definitions/Avatar/Avatar.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts +4 -4
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonPressable.d.ts +4 -3
- package/dist/definitions/Button/ButtonPressable.d.ts.map +1 -1
- package/dist/definitions/Card/Card.d.ts.map +1 -1
- package/dist/definitions/Emoji/Emoji.d.ts +3 -3
- package/dist/definitions/Emoji/Emoji.d.ts.map +1 -1
- package/dist/definitions/ExternalLink/ExternalLink.d.ts +3 -3
- package/dist/definitions/ExternalLink/ExternalLink.d.ts.map +1 -1
- package/dist/definitions/ExternalLink/ExternalLink.web.d.ts.map +1 -1
- package/dist/definitions/FullScreenModal/Body.d.ts.map +1 -1
- package/dist/definitions/FullScreenModal/FullScreenModal.d.ts.map +1 -1
- package/dist/definitions/FullScreenModal/Header.d.ts.map +1 -1
- package/dist/definitions/Icon/Icon.d.ts.map +1 -1
- package/dist/definitions/Icon/SpinningIcon.web.d.ts +3 -2
- package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableAnimatedContainer.web.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableIconButton.d.ts +4 -4
- package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItem.d.ts +3 -4
- package/dist/definitions/ListItem/ListItem.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItemContent.d.ts +2 -2
- package/dist/definitions/ListItem/ListItemContent.d.ts.map +1 -1
- package/dist/definitions/ListItem/ListItemSideContent.d.ts +3 -4
- package/dist/definitions/ListItem/ListItemSideContent.d.ts.map +1 -1
- package/dist/definitions/Loader/LargeLoader.d.ts.map +1 -1
- package/dist/definitions/Loader/LargeLoader.web.d.ts.map +1 -1
- package/dist/definitions/Loader/Loader.d.ts.map +1 -1
- package/dist/definitions/Loader/Loader.web.d.ts.map +1 -1
- package/dist/definitions/Message/Message.d.ts.map +1 -1
- package/dist/definitions/Modal/Body.d.ts.map +1 -1
- package/dist/definitions/Modal/Footer.d.ts.map +1 -1
- package/dist/definitions/Modal/Header.d.ts.map +1 -1
- package/dist/definitions/Modal/Modal.d.ts.map +1 -1
- package/dist/definitions/Notification/Notification.d.ts.map +1 -1
- package/dist/definitions/Overlay/Overlay.d.ts +2 -2
- package/dist/definitions/Overlay/Overlay.d.ts.map +1 -1
- package/dist/definitions/Tag/Tag.d.ts.map +1 -1
- package/dist/definitions/TimePicker/ModalDateTimePicker.d.ts +12 -0
- package/dist/definitions/TimePicker/ModalDateTimePicker.d.ts.map +1 -0
- package/dist/definitions/TimePicker/TimePicker.d.ts +15 -0
- package/dist/definitions/TimePicker/TimePicker.d.ts.map +1 -0
- package/dist/definitions/TimePicker/TimePicker.web.d.ts +3 -0
- package/dist/definitions/TimePicker/TimePicker.web.d.ts.map +1 -0
- package/dist/definitions/TimePicker/useTimePicker.d.ts +14 -0
- package/dist/definitions/TimePicker/useTimePicker.d.ts.map +1 -0
- package/dist/definitions/Tooltip/Tooltip.d.ts +23 -3
- package/dist/definitions/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/definitions/Tooltip/Tooltip.web.d.ts +8 -0
- package/dist/definitions/Tooltip/Tooltip.web.d.ts.map +1 -0
- package/dist/definitions/Tooltip/TooltipView.d.ts +8 -0
- package/dist/definitions/Tooltip/TooltipView.d.ts.map +1 -0
- package/dist/definitions/Tooltip/tooltipUtils.d.ts +5 -0
- package/dist/definitions/Tooltip/tooltipUtils.d.ts.map +1 -0
- package/dist/definitions/forms/InputFeedback/InputFeedback.d.ts.map +1 -1
- package/dist/definitions/forms/InputField/InputField.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputText.d.ts +3 -2
- package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/forms/Label/Label.d.ts.map +1 -1
- package/dist/definitions/forms/Radio/Radio.d.ts.map +1 -1
- package/dist/definitions/forms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +3 -15
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/story-components/Flex.d.ts +2 -2
- package/dist/definitions/story-components/Flex.d.ts.map +1 -1
- package/dist/definitions/story-components/Story.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryBlock.d.ts +1 -2
- package/dist/definitions/story-components/StoryBlock.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryContainer.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryContainer.web.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryDecorator.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryGrid.d.ts.map +1 -1
- package/dist/definitions/story-components/StorySection.d.ts +7 -9
- package/dist/definitions/story-components/StorySection.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryTitle.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +3 -6
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts +1 -0
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/tooltip.d.ts +10 -0
- package/dist/definitions/themes/late-ocean/tooltip.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +6 -8
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +16 -4
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyEmoji.d.ts +3 -4
- package/dist/definitions/typography/TypographyEmoji.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts +6 -9
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/definitions/useKittTheme.d.ts +8 -1
- package/dist/definitions/useKittTheme.d.ts.map +1 -1
- package/dist/definitions/utils/StyleWebWrapper.d.ts +7 -0
- package/dist/definitions/utils/StyleWebWrapper.d.ts.map +1 -0
- package/dist/definitions/utils/storybook/{decorators/KittThemeDecorator.d.ts → KittThemeDecorator.d.ts} +1 -1
- package/dist/definitions/utils/storybook/KittThemeDecorator.d.ts.map +1 -0
- package/dist/definitions/utils/tests/renderWithProvidersUtils.d.ts +2 -2
- package/dist/definitions/utils/tests/renderWithProvidersUtils.d.ts.map +1 -1
- package/dist/definitions/utils/tests/styled-component-typing-test.d.ts +1 -0
- package/dist/definitions/utils/tests/styled-component-typing-test.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/MatchWindowSize.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts +2 -2
- package/dist/definitions/utils/withTheme.d.ts +7 -0
- package/dist/definitions/utils/withTheme.d.ts.map +1 -0
- package/dist/index-browser-all.es.android.js +1299 -622
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.css +2 -0
- package/dist/index-browser-all.es.ios.js +1300 -623
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +1262 -696
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +1113 -850
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.css +2 -0
- package/dist/index-node-14.17.cjs.js +1112 -619
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +4 -0
- package/dist/index-node-14.17.cjs.web.js +2979 -0
- package/dist/index-node-14.17.cjs.web.js.map +1 -0
- package/dist/styles.css +4 -0
- package/dist/tsbuildinfo +1 -1
- package/package.json +16 -6
- package/translations/es-ES.json +3 -0
- package/translations/fr-FR.json +3 -0
- package/dist/definitions/primitives/PrimitiveImage.d.ts +0 -13
- package/dist/definitions/primitives/PrimitiveImage.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveImage.web.d.ts +0 -4
- package/dist/definitions/primitives/PrimitiveImage.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveLink.d.ts +0 -13
- package/dist/definitions/primitives/PrimitiveLink.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveLink.web.d.ts +0 -4
- package/dist/definitions/primitives/PrimitiveLink.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitivePressable.d.ts +0 -19
- package/dist/definitions/primitives/PrimitivePressable.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitivePressable.web.d.ts +0 -4
- package/dist/definitions/primitives/PrimitivePressable.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveScrollView.d.ts +0 -8
- package/dist/definitions/primitives/PrimitiveScrollView.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveScrollView.web.d.ts +0 -4
- package/dist/definitions/primitives/PrimitiveScrollView.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveText.d.ts +0 -14
- package/dist/definitions/primitives/PrimitiveText.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveText.web.d.ts +0 -6
- package/dist/definitions/primitives/PrimitiveText.web.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveView.d.ts +0 -24
- package/dist/definitions/primitives/PrimitiveView.d.ts.map +0 -1
- package/dist/definitions/primitives/PrimitiveView.web.d.ts +0 -27
- package/dist/definitions/primitives/PrimitiveView.web.d.ts.map +0 -1
- package/dist/definitions/primitives/helpers.d.ts +0 -7
- package/dist/definitions/primitives/helpers.d.ts.map +0 -1
- package/dist/definitions/primitives/reset.d.ts +0 -2
- package/dist/definitions/primitives/reset.d.ts.map +0 -1
- package/dist/definitions/utils/storybook/decorators/KittThemeDecorator.d.ts.map +0 -1
- package/dist/definitions/utils/storybook/decorators/SafeAreaProviderDecorator.d.ts +0 -2
- package/dist/definitions/utils/storybook/decorators/SafeAreaProviderDecorator.d.ts.map +0 -1
- package/dist/definitions/utils/storybook/setup-global-decorators.d.ts +0 -2
- package/dist/definitions/utils/storybook/setup-global-decorators.d.ts.map +0 -1
|
@@ -2,35 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const _extends = require('@babel/runtime/helpers/extends');
|
|
6
5
|
const kittIcons = require('@ornikar/kitt-icons');
|
|
7
|
-
const React = require('react');
|
|
8
6
|
const reactNative = require('react-native');
|
|
9
|
-
const styled = require('styled-components');
|
|
7
|
+
const styled = require('styled-components/native');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
const twemojiParser = require('twemoji-parser');
|
|
11
11
|
const WebBrowser = require('expo-web-browser');
|
|
12
12
|
const reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
13
13
|
const Animated = require('react-native-reanimated');
|
|
14
|
+
const react$1 = require('@linaria/react');
|
|
15
|
+
const DateTimePicker = require('@react-native-community/datetimepicker');
|
|
16
|
+
const reactIntl = require('react-intl');
|
|
17
|
+
const reactNative$1 = require('@floating-ui/react-native');
|
|
14
18
|
const addons = require('@storybook/addons');
|
|
15
19
|
|
|
16
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
17
21
|
|
|
18
|
-
const _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
19
|
-
const React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
22
|
const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
21
23
|
const Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
|
|
22
|
-
|
|
23
|
-
const PrimitiveView = reactNative.View;
|
|
24
|
+
const DateTimePicker__default = /*#__PURE__*/_interopDefaultLegacy(DateTimePicker);
|
|
24
25
|
|
|
25
26
|
function SpinningIcon({
|
|
26
27
|
children
|
|
27
28
|
}) {
|
|
28
|
-
const animationRef =
|
|
29
|
+
const animationRef = react.useRef(new reactNative.Animated.Value(0));
|
|
29
30
|
const rotation = animationRef.current.interpolate({
|
|
30
31
|
inputRange: [0, 1],
|
|
31
32
|
outputRange: ['0deg', '360deg']
|
|
32
33
|
});
|
|
33
|
-
|
|
34
|
+
react.useEffect(() => {
|
|
34
35
|
if (process.env.TESTS) return undefined;
|
|
35
36
|
const animation = reactNative.Animated.loop(reactNative.Animated.timing(animationRef.current, {
|
|
36
37
|
toValue: 1,
|
|
@@ -45,16 +46,17 @@ function SpinningIcon({
|
|
|
45
46
|
return undefined;
|
|
46
47
|
};
|
|
47
48
|
}, []);
|
|
48
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Animated.View, {
|
|
49
50
|
style: {
|
|
50
51
|
transform: [{
|
|
51
52
|
rotate: rotation
|
|
52
53
|
}]
|
|
53
|
-
}
|
|
54
|
-
|
|
54
|
+
},
|
|
55
|
+
children: children
|
|
56
|
+
});
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
const IconContainer$2 = /*#__PURE__*/styled__default
|
|
59
|
+
const IconContainer$2 = /*#__PURE__*/styled__default.View.withConfig({
|
|
58
60
|
displayName: "Icon__IconContainer",
|
|
59
61
|
componentId: "kitt-universal__sc-usm0ol-0"
|
|
60
62
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
|
|
@@ -73,118 +75,198 @@ function Icon({
|
|
|
73
75
|
align,
|
|
74
76
|
color
|
|
75
77
|
}) {
|
|
76
|
-
const clonedIcon = /*#__PURE__*/
|
|
78
|
+
const clonedIcon = /*#__PURE__*/react.cloneElement(icon, {
|
|
77
79
|
color
|
|
78
80
|
});
|
|
79
|
-
return /*#__PURE__*/
|
|
81
|
+
return /*#__PURE__*/jsxRuntime.jsx(IconContainer$2, {
|
|
80
82
|
align: align,
|
|
81
83
|
size: size,
|
|
82
|
-
color: color
|
|
83
|
-
|
|
84
|
+
color: color,
|
|
85
|
+
children: spin ? /*#__PURE__*/jsxRuntime.jsx(SpinningIcon, {
|
|
86
|
+
children: clonedIcon
|
|
87
|
+
}) : clonedIcon
|
|
88
|
+
});
|
|
84
89
|
}
|
|
85
90
|
|
|
86
|
-
const
|
|
91
|
+
const KittBreakpoints = {
|
|
92
|
+
/**
|
|
93
|
+
* min-width: 0
|
|
94
|
+
*/
|
|
95
|
+
BASE: 0,
|
|
87
96
|
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
/**
|
|
98
|
+
* min-width: 480px
|
|
99
|
+
*/
|
|
100
|
+
SMALL: 480,
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* min-width: 768px
|
|
104
|
+
*/
|
|
105
|
+
MEDIUM: 768,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* min-width: 1024px
|
|
109
|
+
*/
|
|
110
|
+
LARGE: 1024,
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* min-width: 1280px
|
|
114
|
+
*/
|
|
115
|
+
WIDE: 1280
|
|
116
|
+
};
|
|
117
|
+
const KittBreakpointsMax = {
|
|
118
|
+
/**
|
|
119
|
+
* max-width: 479px
|
|
120
|
+
*/
|
|
121
|
+
BASE: KittBreakpoints.SMALL - 1,
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* max-width: 767px
|
|
125
|
+
*/
|
|
126
|
+
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* max-width: 1023px
|
|
130
|
+
*/
|
|
131
|
+
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* max-width: 1279px
|
|
135
|
+
*/
|
|
136
|
+
LARGE: KittBreakpoints.WIDE - 1
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const IsHeaderTypographyContext = /*#__PURE__*/react.createContext(undefined);
|
|
140
|
+
const TypographyColorContext = /*#__PURE__*/react.createContext('black');
|
|
90
141
|
function useTypographyColor() {
|
|
91
|
-
return
|
|
142
|
+
return react.useContext(TypographyColorContext);
|
|
143
|
+
}
|
|
144
|
+
const getTypographyTypeConfigKey = theme => {
|
|
145
|
+
const isMediumOrAbove = theme.responsive.matchWindowSize({
|
|
146
|
+
minWidth: KittBreakpoints.MEDIUM
|
|
147
|
+
});
|
|
148
|
+
return isMediumOrAbove ? 'mediumAndWide' : 'baseAndSmall';
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const isTypeHeader = type => type.startsWith('header');
|
|
152
|
+
|
|
153
|
+
const isTypographyHeader = (type, typographyIsHeaderInContext) => {
|
|
154
|
+
if (type) return isTypeHeader(type);
|
|
155
|
+
if (typographyIsHeaderInContext != null) return typographyIsHeaderInContext;
|
|
156
|
+
throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
|
|
157
|
+
};
|
|
158
|
+
function getTypographyTypeConfig(type, theme) {
|
|
159
|
+
if (isTypographyHeader(type, undefined)) {
|
|
160
|
+
return theme.kitt.typography.types.headers.configs[type];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return theme.kitt.typography.types.bodies.configs[type];
|
|
92
164
|
}
|
|
93
|
-
const StyledTypography = /*#__PURE__*/styled__default
|
|
165
|
+
const StyledTypography = /*#__PURE__*/styled__default.Text.withConfig({
|
|
94
166
|
displayName: "Typography__StyledTypography",
|
|
95
167
|
componentId: "kitt-universal__sc-1dz700q-0"
|
|
96
168
|
})(["", " ", ""], ({
|
|
97
169
|
theme,
|
|
98
|
-
isHeader,
|
|
99
|
-
|
|
100
|
-
variant
|
|
170
|
+
$isHeader,
|
|
171
|
+
$typeForCurrentWindowSize,
|
|
172
|
+
$variant
|
|
101
173
|
}) => {
|
|
102
174
|
const {
|
|
103
175
|
headers,
|
|
104
176
|
bodies
|
|
105
177
|
} = theme.kitt.typography.types;
|
|
178
|
+
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
106
179
|
return `
|
|
107
180
|
/* type */
|
|
108
|
-
${
|
|
109
|
-
font-family: ${isHeader ? headers.fontFamily[variant] : bodies.fontFamily[variant]};
|
|
110
|
-
font-size: ${isHeader ? headers.configs[
|
|
111
|
-
line-height: ${isHeader ? headers.configs[
|
|
181
|
+
${!$typeForCurrentWindowSize ? '' : `
|
|
182
|
+
font-family: ${$isHeader ? headers.fontFamily[$variant] : bodies.fontFamily[$variant]};
|
|
183
|
+
font-size: ${$isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize};
|
|
184
|
+
line-height: ${$isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight};
|
|
112
185
|
`}
|
|
113
186
|
|
|
114
187
|
/* variant */
|
|
115
|
-
font-weight: ${isHeader ? headers.fontWeight : bodies.fontWeight[variant]};
|
|
116
|
-
font-style: ${isHeader ? headers.fontStyle : bodies.fontStyle[variant]};
|
|
188
|
+
font-weight: ${$isHeader ? headers.fontWeight : bodies.fontWeight[$variant]};
|
|
189
|
+
font-style: ${$isHeader ? headers.fontStyle : bodies.fontStyle[$variant]};
|
|
117
190
|
`;
|
|
118
191
|
}, ({
|
|
119
192
|
theme,
|
|
120
|
-
color
|
|
121
|
-
}) =>
|
|
122
|
-
color: ${theme.kitt.typography.colors[color]};
|
|
123
|
-
text-decoration-color: ${theme.kitt.typography.colors[color]};
|
|
193
|
+
$color
|
|
194
|
+
}) => !$color ? '' : `
|
|
195
|
+
color: ${theme.kitt.typography.colors[$color]};
|
|
196
|
+
text-decoration-color: ${theme.kitt.typography.colors[$color]};
|
|
124
197
|
`);
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
198
|
+
function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
199
|
+
const {
|
|
200
|
+
width
|
|
201
|
+
} = reactNative.useWindowDimensions();
|
|
202
|
+
if (large && width >= KittBreakpoints.LARGE) return large;
|
|
203
|
+
if (medium && width >= KittBreakpoints.MEDIUM) return medium;
|
|
204
|
+
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
205
|
+
return base;
|
|
206
|
+
}
|
|
134
207
|
function Typography({
|
|
135
208
|
accessibilityRole,
|
|
136
209
|
base,
|
|
210
|
+
small,
|
|
211
|
+
medium,
|
|
212
|
+
large,
|
|
137
213
|
variant,
|
|
138
214
|
color,
|
|
139
215
|
...otherProps
|
|
140
216
|
}) {
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
value:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
217
|
+
const isHeaderTypographyInContext = react.useContext(IsHeaderTypographyContext);
|
|
218
|
+
const typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
|
|
219
|
+
const isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
220
|
+
const nonNullableVariant = variant ?? (isHeader ? 'bold' : 'regular'); // if isHeaderTypographyInContext exists, it means we are inside another typography so we don't want to
|
|
221
|
+
// redefine the color, just inherit from it
|
|
222
|
+
|
|
223
|
+
const colorWithDefaultToBlack = color ?? (isHeaderTypographyInContext !== undefined ? undefined : 'black');
|
|
224
|
+
const content = base ? /*#__PURE__*/jsxRuntime.jsx(IsHeaderTypographyContext.Provider, {
|
|
225
|
+
value: isHeader,
|
|
226
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
|
|
227
|
+
$color: colorWithDefaultToBlack,
|
|
228
|
+
$isHeader: isHeader,
|
|
229
|
+
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
230
|
+
$variant: nonNullableVariant,
|
|
231
|
+
accessibilityRole: accessibilityRole || undefined,
|
|
232
|
+
...otherProps
|
|
233
|
+
})
|
|
234
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
|
|
235
|
+
$color: colorWithDefaultToBlack,
|
|
236
|
+
$isHeader: isHeader,
|
|
237
|
+
$variant: nonNullableVariant,
|
|
238
|
+
accessibilityRole: accessibilityRole || undefined,
|
|
239
|
+
...otherProps
|
|
240
|
+
});
|
|
241
|
+
return color ? /*#__PURE__*/jsxRuntime.jsx(TypographyColorContext.Provider, {
|
|
242
|
+
value: color,
|
|
243
|
+
children: content
|
|
244
|
+
}) : content;
|
|
165
245
|
}
|
|
166
246
|
|
|
167
247
|
function TypographyText(props) {
|
|
168
|
-
return /*#__PURE__*/
|
|
169
|
-
accessibilityRole: null
|
|
170
|
-
|
|
248
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
249
|
+
accessibilityRole: null,
|
|
250
|
+
...props
|
|
251
|
+
});
|
|
171
252
|
}
|
|
172
253
|
|
|
173
254
|
function TypographyParagraph(props) {
|
|
174
|
-
return /*#__PURE__*/
|
|
175
|
-
accessibilityRole: "paragraph"
|
|
176
|
-
|
|
255
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
256
|
+
accessibilityRole: "paragraph",
|
|
257
|
+
...props
|
|
258
|
+
});
|
|
177
259
|
}
|
|
178
260
|
|
|
179
261
|
const createHeading = (level, defaultBase) => {
|
|
180
262
|
// https://github.com/necolas/react-native-web/issues/401
|
|
181
263
|
function TypographyHeading(props) {
|
|
182
|
-
return /*#__PURE__*/
|
|
264
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
183
265
|
accessibilityRole: "header",
|
|
184
|
-
base: defaultBase
|
|
185
|
-
|
|
266
|
+
base: defaultBase,
|
|
267
|
+
...props,
|
|
186
268
|
accessibilityLevel: level
|
|
187
|
-
})
|
|
269
|
+
});
|
|
188
270
|
}
|
|
189
271
|
|
|
190
272
|
TypographyHeading.displayName = `TypographyHeading${level}`;
|
|
@@ -219,7 +301,7 @@ const getFirstCharacter = string => string ? string[0] : '';
|
|
|
219
301
|
|
|
220
302
|
const getInitials = (firstname, lastname) => (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
|
|
221
303
|
|
|
222
|
-
const StyledAvatarView = /*#__PURE__*/styled__default
|
|
304
|
+
const StyledAvatarView = /*#__PURE__*/styled__default.View.withConfig({
|
|
223
305
|
displayName: "Avatar__StyledAvatarView",
|
|
224
306
|
componentId: "kitt-universal__sc-9miubv-0"
|
|
225
307
|
})(["border-radius:", "px;background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], ({
|
|
@@ -242,7 +324,7 @@ function AvatarContent({
|
|
|
242
324
|
light
|
|
243
325
|
}) {
|
|
244
326
|
if (src) {
|
|
245
|
-
return /*#__PURE__*/
|
|
327
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
|
|
246
328
|
source: {
|
|
247
329
|
uri: src
|
|
248
330
|
},
|
|
@@ -254,15 +336,16 @@ function AvatarContent({
|
|
|
254
336
|
}
|
|
255
337
|
|
|
256
338
|
if (firstname && lastname) {
|
|
257
|
-
return /*#__PURE__*/
|
|
339
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
258
340
|
base: "body-small",
|
|
259
341
|
variant: "bold",
|
|
260
|
-
color: light ? 'black' : 'white'
|
|
261
|
-
|
|
342
|
+
color: light ? 'black' : 'white',
|
|
343
|
+
children: getInitials(firstname, lastname)
|
|
344
|
+
});
|
|
262
345
|
}
|
|
263
346
|
|
|
264
|
-
return /*#__PURE__*/
|
|
265
|
-
icon: /*#__PURE__*/
|
|
347
|
+
return /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
348
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.UserIcon, {}),
|
|
266
349
|
color: light ? 'black' : 'white',
|
|
267
350
|
size: size / 2
|
|
268
351
|
});
|
|
@@ -272,19 +355,20 @@ function Avatar({
|
|
|
272
355
|
size = 40,
|
|
273
356
|
...rest
|
|
274
357
|
}) {
|
|
275
|
-
return /*#__PURE__*/
|
|
276
|
-
size: size
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
358
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledAvatarView, { ...rest,
|
|
359
|
+
size: size,
|
|
360
|
+
children: /*#__PURE__*/jsxRuntime.jsx(AvatarContent, { ...rest,
|
|
361
|
+
size: size
|
|
362
|
+
})
|
|
363
|
+
});
|
|
280
364
|
}
|
|
281
365
|
|
|
282
366
|
function TypographyIconInheritColor(props) {
|
|
283
367
|
const color = useTypographyColor();
|
|
284
368
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
285
|
-
return /*#__PURE__*/
|
|
369
|
+
return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...props,
|
|
286
370
|
color: theme.kitt.typography.colors[color]
|
|
287
|
-
})
|
|
371
|
+
});
|
|
288
372
|
}
|
|
289
373
|
|
|
290
374
|
function TypographyIconSpecifiedColor({
|
|
@@ -292,9 +376,9 @@ function TypographyIconSpecifiedColor({
|
|
|
292
376
|
...otherProps
|
|
293
377
|
}) {
|
|
294
378
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
295
|
-
return /*#__PURE__*/
|
|
379
|
+
return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...otherProps,
|
|
296
380
|
color: theme.kitt.typography.colors[color]
|
|
297
|
-
})
|
|
381
|
+
});
|
|
298
382
|
}
|
|
299
383
|
|
|
300
384
|
function TypographyIcon({
|
|
@@ -302,12 +386,14 @@ function TypographyIcon({
|
|
|
302
386
|
...otherProps
|
|
303
387
|
}) {
|
|
304
388
|
if (color) {
|
|
305
|
-
return /*#__PURE__*/
|
|
306
|
-
color: color
|
|
307
|
-
|
|
389
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
|
|
390
|
+
color: color,
|
|
391
|
+
...otherProps
|
|
392
|
+
});
|
|
308
393
|
}
|
|
309
394
|
|
|
310
|
-
return /*#__PURE__*/
|
|
395
|
+
return /*#__PURE__*/jsxRuntime.jsx(TypographyIconInheritColor, { ...otherProps
|
|
396
|
+
});
|
|
311
397
|
}
|
|
312
398
|
|
|
313
399
|
const getTextColorByType = (type, isPressed, disabled) => {
|
|
@@ -333,14 +419,14 @@ const ButtonText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
|
|
|
333
419
|
displayName: "ButtonContent__ButtonText",
|
|
334
420
|
componentId: "kitt-universal__sc-dnyw3n-0"
|
|
335
421
|
})(["text-align:center;"]);
|
|
336
|
-
const Content$1 = /*#__PURE__*/styled__default
|
|
422
|
+
const Content$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
337
423
|
displayName: "ButtonContent__Content",
|
|
338
424
|
componentId: "kitt-universal__sc-dnyw3n-1"
|
|
339
425
|
})(["flex-direction:row;align-items:center;justify-content:center;flex:", ";"], ({
|
|
340
426
|
stretch,
|
|
341
427
|
iconOnly
|
|
342
428
|
}) => `${stretch || iconOnly ? 1 : 0} 1 auto`);
|
|
343
|
-
const IconContainer$1 = /*#__PURE__*/styled__default
|
|
429
|
+
const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
344
430
|
displayName: "ButtonContent__IconContainer",
|
|
345
431
|
componentId: "kitt-universal__sc-dnyw3n-2"
|
|
346
432
|
})(["", ""], ({
|
|
@@ -364,15 +450,16 @@ function ButtonIcon({
|
|
|
364
450
|
iconPosition,
|
|
365
451
|
testID
|
|
366
452
|
}) {
|
|
367
|
-
return /*#__PURE__*/
|
|
368
|
-
iconPosition: iconPosition
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
453
|
+
return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
|
|
454
|
+
iconPosition: iconPosition,
|
|
455
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
456
|
+
icon: icon,
|
|
457
|
+
spin: spin,
|
|
458
|
+
color: color,
|
|
459
|
+
size: size,
|
|
460
|
+
testID: testID
|
|
461
|
+
})
|
|
462
|
+
});
|
|
376
463
|
}
|
|
377
464
|
|
|
378
465
|
function ButtonContent({
|
|
@@ -400,33 +487,34 @@ function ButtonContent({
|
|
|
400
487
|
}
|
|
401
488
|
|
|
402
489
|
if (!children) {
|
|
403
|
-
return /*#__PURE__*/
|
|
490
|
+
return /*#__PURE__*/jsxRuntime.jsx(Content$1, {
|
|
404
491
|
iconOnly: true,
|
|
405
|
-
stretch: stretch
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
492
|
+
stretch: stretch,
|
|
493
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, { ...sharedIconProps,
|
|
494
|
+
icon: icon
|
|
495
|
+
})
|
|
496
|
+
});
|
|
409
497
|
}
|
|
410
498
|
|
|
411
|
-
return /*#__PURE__*/
|
|
412
|
-
stretch: stretch
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
icon
|
|
423
|
-
|
|
424
|
-
|
|
499
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Content$1, {
|
|
500
|
+
stretch: stretch,
|
|
501
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...sharedIconProps,
|
|
502
|
+
icon: icon,
|
|
503
|
+
iconPosition: iconPosition,
|
|
504
|
+
testID: "button-left-icon"
|
|
505
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(ButtonText, {
|
|
506
|
+
base: "body",
|
|
507
|
+
color: color,
|
|
508
|
+
variant: "bold",
|
|
509
|
+
children: children
|
|
510
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...sharedIconProps,
|
|
511
|
+
icon: icon,
|
|
512
|
+
iconPosition: iconPosition
|
|
513
|
+
}) : null]
|
|
514
|
+
});
|
|
425
515
|
}
|
|
426
516
|
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
const ButtonPressable = /*#__PURE__*/styled__default(PrimitivePressable).withConfig({
|
|
517
|
+
const ButtonPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
430
518
|
displayName: "ButtonPressable",
|
|
431
519
|
componentId: "kitt-universal__sc-7ckel6-0"
|
|
432
520
|
})(["min-width:", ";max-width:", ";width:", ";min-height:", ";background-color:", ";padding:", ";flex-direction:row;align-self:flex-start;border-radius:", ";border-color:", ";border-width:", ";"], ({
|
|
@@ -474,16 +562,16 @@ function Button({
|
|
|
474
562
|
hrefAttrs,
|
|
475
563
|
onPress
|
|
476
564
|
}) {
|
|
477
|
-
const [isPressed, setIsPressed] =
|
|
565
|
+
const [isPressed, setIsPressed] = react.useState(false);
|
|
478
566
|
const sharedProps = {
|
|
479
567
|
type,
|
|
480
568
|
stretch,
|
|
481
569
|
disabled
|
|
482
570
|
};
|
|
483
|
-
return /*#__PURE__*/
|
|
571
|
+
return /*#__PURE__*/jsxRuntime.jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
484
572
|
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
485
573
|
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
486
|
-
,
|
|
574
|
+
, { ...sharedProps,
|
|
487
575
|
isPressed: isPressed,
|
|
488
576
|
accessibilityRole: "button",
|
|
489
577
|
testID: testID,
|
|
@@ -491,15 +579,17 @@ function Button({
|
|
|
491
579
|
hrefAttrs: hrefAttrs,
|
|
492
580
|
onPress: onPress,
|
|
493
581
|
onPressIn: () => setIsPressed(true),
|
|
494
|
-
onPressOut: () => setIsPressed(false)
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
582
|
+
onPressOut: () => setIsPressed(false),
|
|
583
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ButtonContent, { ...sharedProps,
|
|
584
|
+
icon: icon,
|
|
585
|
+
iconPosition: iconPosition,
|
|
586
|
+
iconSpin: iconSpin,
|
|
587
|
+
children: children
|
|
588
|
+
})
|
|
589
|
+
});
|
|
500
590
|
}
|
|
501
591
|
|
|
502
|
-
const Container$
|
|
592
|
+
const Container$6 = /*#__PURE__*/styled__default.View.withConfig({
|
|
503
593
|
displayName: "Card__Container",
|
|
504
594
|
componentId: "kitt-universal__sc-1n9psug-0"
|
|
505
595
|
})(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], ({
|
|
@@ -519,14 +609,13 @@ function Card({
|
|
|
519
609
|
children,
|
|
520
610
|
type
|
|
521
611
|
}) {
|
|
522
|
-
return /*#__PURE__*/
|
|
523
|
-
type: type
|
|
524
|
-
|
|
612
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container$6, {
|
|
613
|
+
type: type,
|
|
614
|
+
children: children
|
|
615
|
+
});
|
|
525
616
|
}
|
|
526
617
|
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
const StyledEmoji = /*#__PURE__*/styled__default(PrimitiveImage).withConfig({
|
|
618
|
+
const StyledEmoji = /*#__PURE__*/styled__default.Image.withConfig({
|
|
530
619
|
displayName: "Emoji__StyledEmoji",
|
|
531
620
|
componentId: "kitt-universal__sc-ggl6wj-0"
|
|
532
621
|
})(["width:", "px;height:", "px;"], ({
|
|
@@ -537,22 +626,20 @@ const StyledEmoji = /*#__PURE__*/styled__default(PrimitiveImage).withConfig({
|
|
|
537
626
|
function Emoji({
|
|
538
627
|
emoji,
|
|
539
628
|
size,
|
|
540
|
-
style
|
|
541
|
-
className
|
|
629
|
+
style
|
|
542
630
|
}) {
|
|
543
|
-
const [emojiData] =
|
|
631
|
+
const [emojiData] = react.useMemo(() => twemojiParser.parse(emoji, {
|
|
544
632
|
// on native plaforms, you can't display svg as Image
|
|
545
|
-
assetType:
|
|
633
|
+
assetType: 'svg'
|
|
546
634
|
}), [emoji]);
|
|
547
635
|
if (!emojiData) return null;
|
|
548
|
-
return /*#__PURE__*/
|
|
636
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledEmoji, {
|
|
549
637
|
size: size,
|
|
550
638
|
accessibilityLabel: emojiData.text,
|
|
551
639
|
source: {
|
|
552
640
|
uri: emojiData.url
|
|
553
641
|
},
|
|
554
|
-
style: style
|
|
555
|
-
className: className
|
|
642
|
+
style: style
|
|
556
643
|
});
|
|
557
644
|
}
|
|
558
645
|
|
|
@@ -568,7 +655,7 @@ function ExternalLink({
|
|
|
568
655
|
onPress,
|
|
569
656
|
...rest
|
|
570
657
|
}) {
|
|
571
|
-
return /*#__PURE__*/
|
|
658
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, { ...rest,
|
|
572
659
|
onPress: () => {
|
|
573
660
|
if (onPress) onPress();
|
|
574
661
|
if (!href) return;
|
|
@@ -576,13 +663,13 @@ function ExternalLink({
|
|
|
576
663
|
switch (openLinkBehavior.native) {
|
|
577
664
|
case 'openInModal':
|
|
578
665
|
case undefined:
|
|
579
|
-
|
|
666
|
+
WebBrowser.openBrowserAsync(href).catch(err => {
|
|
580
667
|
console.error(`An error occurred while opening ${href}`, err);
|
|
581
668
|
});
|
|
582
669
|
break;
|
|
583
670
|
|
|
584
671
|
case 'openBrowserApp':
|
|
585
|
-
|
|
672
|
+
reactNative.Linking.openURL(href).catch(err => {
|
|
586
673
|
console.error(`An error occurred while opening ${href}`, err);
|
|
587
674
|
});
|
|
588
675
|
break;
|
|
@@ -594,7 +681,7 @@ function ExternalLink({
|
|
|
594
681
|
|
|
595
682
|
}
|
|
596
683
|
}
|
|
597
|
-
})
|
|
684
|
+
});
|
|
598
685
|
}
|
|
599
686
|
|
|
600
687
|
const getColorFromState = state => {
|
|
@@ -612,66 +699,19 @@ function InputFeedback({
|
|
|
612
699
|
testID,
|
|
613
700
|
children
|
|
614
701
|
}) {
|
|
615
|
-
return /*#__PURE__*/
|
|
702
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
616
703
|
base: "body-small",
|
|
617
704
|
color: getColorFromState(state),
|
|
618
|
-
testID: testID
|
|
619
|
-
|
|
705
|
+
testID: testID,
|
|
706
|
+
children: children
|
|
707
|
+
});
|
|
620
708
|
}
|
|
621
709
|
|
|
622
|
-
const
|
|
623
|
-
/**
|
|
624
|
-
* min-width: 0
|
|
625
|
-
*/
|
|
626
|
-
BASE: 0,
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* min-width: 480px
|
|
630
|
-
*/
|
|
631
|
-
SMALL: 480,
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* min-width: 768px
|
|
635
|
-
*/
|
|
636
|
-
MEDIUM: 768,
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* min-width: 1024px
|
|
640
|
-
*/
|
|
641
|
-
LARGE: 1024,
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* min-width: 1280px
|
|
645
|
-
*/
|
|
646
|
-
WIDE: 1280
|
|
647
|
-
};
|
|
648
|
-
const KittBreakpointsMax = {
|
|
649
|
-
/**
|
|
650
|
-
* max-width: 479px
|
|
651
|
-
*/
|
|
652
|
-
BASE: KittBreakpoints.SMALL - 1,
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* max-width: 767px
|
|
656
|
-
*/
|
|
657
|
-
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* max-width: 1023px
|
|
661
|
-
*/
|
|
662
|
-
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* max-width: 1279px
|
|
666
|
-
*/
|
|
667
|
-
LARGE: KittBreakpoints.WIDE - 1
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
const FieldContainer = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
710
|
+
const FieldContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
671
711
|
displayName: "InputField__FieldContainer",
|
|
672
712
|
componentId: "kitt-universal__sc-13fkixs-0"
|
|
673
713
|
})(["padding:5px 0 10px;"]);
|
|
674
|
-
const FeedbackContainer = /*#__PURE__*/styled__default
|
|
714
|
+
const FeedbackContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
675
715
|
displayName: "InputField__FeedbackContainer",
|
|
676
716
|
componentId: "kitt-universal__sc-13fkixs-1"
|
|
677
717
|
})(["", ";"], ({
|
|
@@ -679,13 +719,13 @@ const FeedbackContainer = /*#__PURE__*/styled__default(PrimitiveView).withConfig
|
|
|
679
719
|
}) => theme.responsive.ifWindowSizeMatches({
|
|
680
720
|
minWidth: KittBreakpoints.SMALL
|
|
681
721
|
}, 'padding-top: 10px', 'padding-top: 5px'));
|
|
682
|
-
const FieldLabelContainer = /*#__PURE__*/styled__default
|
|
722
|
+
const FieldLabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
683
723
|
displayName: "InputField__FieldLabelContainer",
|
|
684
724
|
componentId: "kitt-universal__sc-13fkixs-2"
|
|
685
725
|
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
|
|
686
726
|
theme
|
|
687
727
|
}) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
|
|
688
|
-
const LabelContainer = /*#__PURE__*/styled__default
|
|
728
|
+
const LabelContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
689
729
|
displayName: "InputField__LabelContainer",
|
|
690
730
|
componentId: "kitt-universal__sc-13fkixs-3"
|
|
691
731
|
})(["margin-right:", "px;"], ({
|
|
@@ -697,12 +737,20 @@ function InputField({
|
|
|
697
737
|
input,
|
|
698
738
|
feedback
|
|
699
739
|
}) {
|
|
700
|
-
return /*#__PURE__*/
|
|
740
|
+
return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
|
|
741
|
+
children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
|
|
742
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(LabelContainer, {
|
|
743
|
+
children: label
|
|
744
|
+
}), labelFeedback]
|
|
745
|
+
}) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(FeedbackContainer, {
|
|
746
|
+
children: feedback
|
|
747
|
+
}) : null]
|
|
748
|
+
});
|
|
701
749
|
}
|
|
702
750
|
|
|
703
751
|
const useInputText = () => {
|
|
704
|
-
const [isFocused, setIsFocused] =
|
|
705
|
-
const [isPasswordVisible, setIsPasswordVisible] =
|
|
752
|
+
const [isFocused, setIsFocused] = react.useState(false);
|
|
753
|
+
const [isPasswordVisible, setIsPasswordVisible] = react.useState(false);
|
|
706
754
|
return {
|
|
707
755
|
isFocused,
|
|
708
756
|
handleInputFocus: () => setIsFocused(true),
|
|
@@ -724,7 +772,10 @@ const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";bor
|
|
|
724
772
|
state
|
|
725
773
|
}) => theme.kitt.forms.input.states[state].borderColor, ({
|
|
726
774
|
theme
|
|
727
|
-
}) =>
|
|
775
|
+
}) => {
|
|
776
|
+
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
777
|
+
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize;
|
|
778
|
+
}, ({
|
|
728
779
|
theme,
|
|
729
780
|
state
|
|
730
781
|
}) => theme.kitt.typography.colors[theme.kitt.forms.input.states[state].color], ({
|
|
@@ -736,13 +787,17 @@ const Input = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
|
|
|
736
787
|
})(["", " padding:", ";line-height:", ";min-height:", "px;"], styledTextInputMixin, ({
|
|
737
788
|
theme,
|
|
738
789
|
multiline
|
|
739
|
-
}) => !multiline &&
|
|
790
|
+
}) => !multiline && "web" === 'ios' ? theme.kitt.forms.input.paddingSingleLineIOS : theme.kitt.forms.input.padding, ({
|
|
740
791
|
theme,
|
|
741
792
|
multiline
|
|
742
|
-
}) =>
|
|
793
|
+
}) => {
|
|
794
|
+
if (!multiline && "web" === 'ios') return 0;
|
|
795
|
+
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
796
|
+
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight;
|
|
797
|
+
}, ({
|
|
743
798
|
minHeight
|
|
744
799
|
}) => minHeight);
|
|
745
|
-
const Container$
|
|
800
|
+
const Container$5 = /*#__PURE__*/styled__default.View.withConfig({
|
|
746
801
|
displayName: "InputText__Container",
|
|
747
802
|
componentId: "kitt-universal__sc-uke279-1"
|
|
748
803
|
})(["margin-top:", ";margin-bottom:", ";"], ({
|
|
@@ -750,7 +805,7 @@ const Container$4 = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
750
805
|
}) => theme.kitt.forms.input.marginTop, ({
|
|
751
806
|
theme
|
|
752
807
|
}) => theme.kitt.forms.input.marginBottom);
|
|
753
|
-
const PasswordButtonContainer = /*#__PURE__*/styled__default
|
|
808
|
+
const PasswordButtonContainer = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
754
809
|
displayName: "InputText__PasswordButtonContainer",
|
|
755
810
|
componentId: "kitt-universal__sc-uke279-2"
|
|
756
811
|
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:", "px;"], ({
|
|
@@ -792,7 +847,7 @@ const textContentTypeByType = {
|
|
|
792
847
|
password: 'password',
|
|
793
848
|
username: 'username'
|
|
794
849
|
};
|
|
795
|
-
const InputText = /*#__PURE__*/
|
|
850
|
+
const InputText = /*#__PURE__*/react.forwardRef(({
|
|
796
851
|
id,
|
|
797
852
|
minHeight = 0,
|
|
798
853
|
type,
|
|
@@ -816,50 +871,55 @@ const InputText = /*#__PURE__*/React.forwardRef(({
|
|
|
816
871
|
isDisabled: disabled,
|
|
817
872
|
formState
|
|
818
873
|
});
|
|
819
|
-
return /*#__PURE__*/
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
874
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container$5, {
|
|
875
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
876
|
+
ref: ref,
|
|
877
|
+
nativeID: id,
|
|
878
|
+
editable: !disabled,
|
|
879
|
+
keyboardType: keyboardTypeByTextInputType[type],
|
|
880
|
+
autoCompleteType: autoCompleteTypeByType[type],
|
|
881
|
+
autoCorrect: autoCorrectByType[type],
|
|
882
|
+
minHeight: minHeight,
|
|
883
|
+
textContentType: textContentTypeByType[type],
|
|
884
|
+
placeholderTextColor: theme.kitt.typography.colors[theme.kitt.forms.input.placeholderColor],
|
|
885
|
+
selectionColor: theme.kitt.forms.input.selectionColor,
|
|
886
|
+
secureTextEntry: type === 'password' && !isPasswordVisible,
|
|
887
|
+
...props,
|
|
888
|
+
state: state,
|
|
889
|
+
onFocus: e => {
|
|
890
|
+
handleInputFocus();
|
|
891
|
+
if (onFocus) onFocus(e);
|
|
892
|
+
},
|
|
893
|
+
onBlur: e => {
|
|
894
|
+
handleInputBlur();
|
|
895
|
+
if (onBlur) onBlur(e);
|
|
896
|
+
}
|
|
897
|
+
}), type === 'password' && !disabled && /*#__PURE__*/jsxRuntime.jsx(PasswordButtonContainer, {
|
|
898
|
+
accessibilityRole: "button",
|
|
899
|
+
onPress: togglePasswordVisibility,
|
|
900
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
901
|
+
icon: isPasswordVisible ? /*#__PURE__*/jsxRuntime.jsx(kittIcons.EyeIcon, {}) : /*#__PURE__*/jsxRuntime.jsx(kittIcons.EyeOffIcon, {}),
|
|
902
|
+
size: theme.kitt.forms.input.passwordButtonIconSize,
|
|
903
|
+
color: theme.kitt.forms.input.states[state].passwordButtonIconColor
|
|
904
|
+
})
|
|
905
|
+
})]
|
|
906
|
+
});
|
|
849
907
|
});
|
|
850
908
|
|
|
851
909
|
function Label({
|
|
852
910
|
htmlFor,
|
|
853
911
|
children
|
|
854
912
|
}) {
|
|
855
|
-
return /*#__PURE__*/
|
|
856
|
-
base: "body"
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
913
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
914
|
+
base: "body",
|
|
915
|
+
children: /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
916
|
+
htmlFor: htmlFor,
|
|
917
|
+
children: children
|
|
918
|
+
})
|
|
919
|
+
});
|
|
860
920
|
}
|
|
861
921
|
|
|
862
|
-
const OuterRadio = /*#__PURE__*/styled__default
|
|
922
|
+
const OuterRadio = /*#__PURE__*/styled__default.View.withConfig({
|
|
863
923
|
displayName: "Radio__OuterRadio",
|
|
864
924
|
componentId: "kitt-universal__sc-1mdgr2o-0"
|
|
865
925
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", ";border-color:", ";"], ({
|
|
@@ -877,7 +937,7 @@ const OuterRadio = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
877
937
|
theme,
|
|
878
938
|
disabled
|
|
879
939
|
}) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor);
|
|
880
|
-
const SelectedOuterRadio = /*#__PURE__*/styled__default
|
|
940
|
+
const SelectedOuterRadio = /*#__PURE__*/styled__default.View.withConfig({
|
|
881
941
|
displayName: "Radio__SelectedOuterRadio",
|
|
882
942
|
componentId: "kitt-universal__sc-1mdgr2o-1"
|
|
883
943
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], ({
|
|
@@ -889,7 +949,7 @@ const SelectedOuterRadio = /*#__PURE__*/styled__default(PrimitiveView).withConfi
|
|
|
889
949
|
}) => theme.kitt.forms.radio.size, ({
|
|
890
950
|
theme
|
|
891
951
|
}) => theme.kitt.forms.radio.size / 2);
|
|
892
|
-
const SelectedInnerRadio = /*#__PURE__*/styled__default
|
|
952
|
+
const SelectedInnerRadio = /*#__PURE__*/styled__default.View.withConfig({
|
|
893
953
|
displayName: "Radio__SelectedInnerRadio",
|
|
894
954
|
componentId: "kitt-universal__sc-1mdgr2o-2"
|
|
895
955
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], ({
|
|
@@ -901,7 +961,7 @@ const SelectedInnerRadio = /*#__PURE__*/styled__default(PrimitiveView).withConfi
|
|
|
901
961
|
}) => theme.kitt.forms.radio.checked.innerSize, ({
|
|
902
962
|
theme
|
|
903
963
|
}) => theme.kitt.forms.radio.checked.innerSize / 2);
|
|
904
|
-
const Container$
|
|
964
|
+
const Container$4 = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
905
965
|
displayName: "Radio__Container",
|
|
906
966
|
componentId: "kitt-universal__sc-1mdgr2o-3"
|
|
907
967
|
})(["flex-direction:row;align-items:center;"]);
|
|
@@ -919,7 +979,7 @@ function Radio({
|
|
|
919
979
|
disabled = false,
|
|
920
980
|
children
|
|
921
981
|
}) {
|
|
922
|
-
return /*#__PURE__*/
|
|
982
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container$4, {
|
|
923
983
|
nativeID: id,
|
|
924
984
|
disabled: disabled,
|
|
925
985
|
accessibilityRole: "radio",
|
|
@@ -927,27 +987,31 @@ function Radio({
|
|
|
927
987
|
focusable: checked && !disabled,
|
|
928
988
|
onPress: () => {
|
|
929
989
|
onChange(value);
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
990
|
+
},
|
|
991
|
+
children: [checked && !disabled ? /*#__PURE__*/jsxRuntime.jsx(SelectedOuterRadio, {
|
|
992
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SelectedInnerRadio, {})
|
|
993
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(OuterRadio, {
|
|
994
|
+
disabled: disabled
|
|
995
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Text, {
|
|
996
|
+
base: "body",
|
|
997
|
+
color: disabled ? 'black-light' : 'black',
|
|
998
|
+
children: children
|
|
999
|
+
})]
|
|
1000
|
+
});
|
|
937
1001
|
}
|
|
938
1002
|
|
|
939
1003
|
function TextArea({ ...props
|
|
940
1004
|
}) {
|
|
941
1005
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
942
|
-
return /*#__PURE__*/
|
|
943
|
-
multiline: true
|
|
944
|
-
|
|
1006
|
+
return /*#__PURE__*/jsxRuntime.jsx(InputText, {
|
|
1007
|
+
multiline: true,
|
|
1008
|
+
...props,
|
|
945
1009
|
type: "text",
|
|
946
1010
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
947
|
-
})
|
|
1011
|
+
});
|
|
948
1012
|
}
|
|
949
1013
|
|
|
950
|
-
const Body = /*#__PURE__*/styled__default
|
|
1014
|
+
const Body = /*#__PURE__*/styled__default.View.withConfig({
|
|
951
1015
|
displayName: "Body",
|
|
952
1016
|
componentId: "kitt-universal__sc-1ofncfn-0"
|
|
953
1017
|
})(["", " background-color:", ";flex:1;"], ({
|
|
@@ -962,10 +1026,12 @@ const Body = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
962
1026
|
function FullScreenModalBody({
|
|
963
1027
|
children
|
|
964
1028
|
}) {
|
|
965
|
-
return /*#__PURE__*/
|
|
1029
|
+
return /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
1030
|
+
children: children
|
|
1031
|
+
});
|
|
966
1032
|
}
|
|
967
1033
|
|
|
968
|
-
const SideContainer = /*#__PURE__*/styled__default
|
|
1034
|
+
const SideContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
969
1035
|
displayName: "Header__SideContainer",
|
|
970
1036
|
componentId: "kitt-universal__sc-dfmxi1-0"
|
|
971
1037
|
})(["", ""], ({
|
|
@@ -985,7 +1051,7 @@ function getHeaderHorizontalMediumPadding(spacing) {
|
|
|
985
1051
|
return spacing * 6;
|
|
986
1052
|
}
|
|
987
1053
|
|
|
988
|
-
const Header = /*#__PURE__*/styled__default
|
|
1054
|
+
const Header = /*#__PURE__*/styled__default.View.withConfig({
|
|
989
1055
|
displayName: "Header",
|
|
990
1056
|
componentId: "kitt-universal__sc-dfmxi1-1"
|
|
991
1057
|
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
|
|
@@ -1003,7 +1069,7 @@ const Header = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
1003
1069
|
}, ({
|
|
1004
1070
|
theme
|
|
1005
1071
|
}) => theme.kitt.fullScreenModal.header.borderColor);
|
|
1006
|
-
const HeaderContent = /*#__PURE__*/styled__default
|
|
1072
|
+
const HeaderContent = /*#__PURE__*/styled__default.View.withConfig({
|
|
1007
1073
|
displayName: "Header__HeaderContent",
|
|
1008
1074
|
componentId: "kitt-universal__sc-dfmxi1-2"
|
|
1009
1075
|
})(["", ";", ";justify-content:center;align-items:center;"], ({
|
|
@@ -1047,8 +1113,8 @@ function FullScreenModalHeader({
|
|
|
1047
1113
|
top
|
|
1048
1114
|
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
1049
1115
|
const dimensions = reactNative.useWindowDimensions();
|
|
1050
|
-
const [leftWidth, setLeftWidth] =
|
|
1051
|
-
const [rightWidth, setRightWidth] =
|
|
1116
|
+
const [leftWidth, setLeftWidth] = react.useState(0);
|
|
1117
|
+
const [rightWidth, setRightWidth] = react.useState(0);
|
|
1052
1118
|
|
|
1053
1119
|
const handleLayoutChange = (event, side) => {
|
|
1054
1120
|
// Prevents react to nullify event on rerenders
|
|
@@ -1062,21 +1128,25 @@ function FullScreenModalHeader({
|
|
|
1062
1128
|
setRightWidth(event.nativeEvent.layout.width);
|
|
1063
1129
|
};
|
|
1064
1130
|
|
|
1065
|
-
return /*#__PURE__*/
|
|
1066
|
-
insetTop:
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1131
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Header, {
|
|
1132
|
+
insetTop: top,
|
|
1133
|
+
children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
1134
|
+
onLayout: e => handleLayoutChange(e, 'left'),
|
|
1135
|
+
children: left
|
|
1136
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(HeaderContent, {
|
|
1137
|
+
windowWidth: dimensions.width,
|
|
1138
|
+
leftWidth: leftWidth,
|
|
1139
|
+
rightWidth: rightWidth,
|
|
1140
|
+
children: children
|
|
1141
|
+
}), right ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
1142
|
+
side: "right",
|
|
1143
|
+
onLayout: e => handleLayoutChange(e, 'right'),
|
|
1144
|
+
children: right
|
|
1145
|
+
}) : null]
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
|
|
1080
1150
|
displayName: "FullScreenModal__Container",
|
|
1081
1151
|
componentId: "kitt-universal__sc-11qpbe3-0"
|
|
1082
1152
|
})(["flex:1;background-color:", ";"], ({
|
|
@@ -1085,13 +1155,71 @@ const Container$2 = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
1085
1155
|
function FullScreenModal({
|
|
1086
1156
|
children
|
|
1087
1157
|
}) {
|
|
1088
|
-
return /*#__PURE__*/
|
|
1158
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container$3, {
|
|
1159
|
+
children: children
|
|
1160
|
+
});
|
|
1089
1161
|
}
|
|
1090
1162
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
1091
1163
|
FullScreenModal.Body = FullScreenModalBody;
|
|
1092
1164
|
|
|
1093
|
-
|
|
1094
|
-
|
|
1165
|
+
function StyleWebWrapper({
|
|
1166
|
+
as,
|
|
1167
|
+
children,
|
|
1168
|
+
...props
|
|
1169
|
+
}) {
|
|
1170
|
+
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
1171
|
+
return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
|
|
1172
|
+
children: children
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
|
|
1177
|
+
// type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
|
|
1178
|
+
// export function withTheme<Props extends { theme: DefaultTheme }, C>(
|
|
1179
|
+
// WrappedComponent: ComponentType<Props> & C,
|
|
1180
|
+
// ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
|
|
1181
|
+
// return function ThemedComponent(props) {
|
|
1182
|
+
// const theme = useTheme();
|
|
1183
|
+
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
1184
|
+
// };
|
|
1185
|
+
// }
|
|
1186
|
+
function withTheme( // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1187
|
+
WrappedComponent) {
|
|
1188
|
+
return function (props) {
|
|
1189
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
1190
|
+
return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
|
|
1191
|
+
theme: theme,
|
|
1192
|
+
...props
|
|
1193
|
+
});
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
|
|
1198
|
+
name: "PressableIconButtonWebWrapper",
|
|
1199
|
+
class: "p1nlccvg",
|
|
1200
|
+
vars: {
|
|
1201
|
+
"p1nlccvg-0": [({
|
|
1202
|
+
theme
|
|
1203
|
+
}) => theme.kitt.iconButton.scale.base.hover],
|
|
1204
|
+
"p1nlccvg-1": [({
|
|
1205
|
+
theme
|
|
1206
|
+
}) => theme.breakpoints.min.mediumBreakpoint],
|
|
1207
|
+
"p1nlccvg-2": [({
|
|
1208
|
+
theme
|
|
1209
|
+
}) => theme.kitt.iconButton.scale.medium.hover],
|
|
1210
|
+
"p1nlccvg-3": [({
|
|
1211
|
+
theme
|
|
1212
|
+
}) => theme.kitt.iconButton.scale.base.active],
|
|
1213
|
+
"p1nlccvg-4": [({
|
|
1214
|
+
theme
|
|
1215
|
+
}) => theme.kitt.iconButton.default.pressedBackgroundColor],
|
|
1216
|
+
"p1nlccvg-5": [({
|
|
1217
|
+
theme
|
|
1218
|
+
}) => theme.kitt.iconButton.white.pressedBackgroundColor]
|
|
1219
|
+
}
|
|
1220
|
+
}));
|
|
1221
|
+
const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
1222
|
+
displayName: "PressableIconButton__StyledPressableIconButton",
|
|
1095
1223
|
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1096
1224
|
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], ({
|
|
1097
1225
|
theme
|
|
@@ -1101,20 +1229,13 @@ const PressableIconButton = /*#__PURE__*/styled__default(PrimitivePressable).wit
|
|
|
1101
1229
|
theme
|
|
1102
1230
|
}) => theme.kitt.iconButton.height, ({
|
|
1103
1231
|
theme,
|
|
1104
|
-
color,
|
|
1105
1232
|
disabled
|
|
1106
1233
|
}) => {
|
|
1107
1234
|
const {
|
|
1108
1235
|
iconButton
|
|
1109
1236
|
} = theme.kitt;
|
|
1110
|
-
|
|
1111
|
-
if (reactNative.Platform.OS !== 'web') {
|
|
1112
|
-
return undefined;
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
1237
|
const {
|
|
1116
|
-
transition
|
|
1117
|
-
scale
|
|
1238
|
+
transition
|
|
1118
1239
|
} = iconButton;
|
|
1119
1240
|
|
|
1120
1241
|
if (disabled) {
|
|
@@ -1125,33 +1246,19 @@ const PressableIconButton = /*#__PURE__*/styled__default(PrimitivePressable).wit
|
|
|
1125
1246
|
|
|
1126
1247
|
return `
|
|
1127
1248
|
transition: ${transition.property} ${transition.duration} ${transition.timingFunction};
|
|
1128
|
-
|
|
1129
|
-
&:hover,
|
|
1130
|
-
.kitt-hover & {
|
|
1131
|
-
@media (hover: none) and (pointer: coarse) {
|
|
1132
|
-
transform: scale(${scale.base.hover});
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
@media(${theme.breakpoints.min.mediumBreakpoint}) {
|
|
1136
|
-
transform: scale(${scale.medium.hover});
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
&:active,
|
|
1141
|
-
.kitt-active & {
|
|
1142
|
-
transform: scale(${scale.base.active});
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
&:hover,
|
|
1146
|
-
.kitt-hover &,
|
|
1147
|
-
&:focus,
|
|
1148
|
-
.kitt-focus &,
|
|
1149
|
-
&:active,
|
|
1150
|
-
.kitt-active & {
|
|
1151
|
-
background-color: ${color === 'white' ? iconButton.white.pressedBackgroundColor : iconButton.default.pressedBackgroundColor};
|
|
1152
|
-
}
|
|
1153
1249
|
`;
|
|
1154
1250
|
});
|
|
1251
|
+
function PressableIconButton({
|
|
1252
|
+
color,
|
|
1253
|
+
...props
|
|
1254
|
+
}) {
|
|
1255
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
1256
|
+
as: PressableIconButtonWebWrapper,
|
|
1257
|
+
"data-color-white": color === 'white' ? true : undefined,
|
|
1258
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props
|
|
1259
|
+
})
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1155
1262
|
|
|
1156
1263
|
const AnimatedIconButtonBackground = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
|
|
1157
1264
|
displayName: "PressableAnimatedContainer__AnimatedIconButtonBackground",
|
|
@@ -1199,7 +1306,7 @@ function PressableAnimatedContainer({
|
|
|
1199
1306
|
};
|
|
1200
1307
|
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
1201
1308
|
_f.__workletHash = 10645190329247;
|
|
1202
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (
|
|
1309
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (54:41)";
|
|
1203
1310
|
_f.__optimalization = 2;
|
|
1204
1311
|
|
|
1205
1312
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -1233,14 +1340,14 @@ function PressableAnimatedContainer({
|
|
|
1233
1340
|
};
|
|
1234
1341
|
_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)}]};}}";
|
|
1235
1342
|
_f.__workletHash = 13861998831411;
|
|
1236
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (
|
|
1343
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:39)";
|
|
1237
1344
|
_f.__optimalization = 2;
|
|
1238
1345
|
|
|
1239
1346
|
global.__reanimatedWorkletInit(_f);
|
|
1240
1347
|
|
|
1241
1348
|
return _f;
|
|
1242
1349
|
}());
|
|
1243
|
-
return /*#__PURE__*/
|
|
1350
|
+
return /*#__PURE__*/jsxRuntime.jsx(PressableIconButton, {
|
|
1244
1351
|
accessibilityRole: "button",
|
|
1245
1352
|
disabled: disabled,
|
|
1246
1353
|
color: color,
|
|
@@ -1250,23 +1357,25 @@ function PressableAnimatedContainer({
|
|
|
1250
1357
|
},
|
|
1251
1358
|
onPressOut: () => {
|
|
1252
1359
|
pressed.value = false;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1360
|
+
},
|
|
1361
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(AnimatedViewContainer, {
|
|
1362
|
+
style: disabled ? [{
|
|
1363
|
+
transform: [{
|
|
1364
|
+
scale: 1
|
|
1365
|
+
}]
|
|
1366
|
+
}] : [scaleStyles],
|
|
1367
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedIconButtonBackground, {
|
|
1368
|
+
disabled: disabled,
|
|
1369
|
+
color: color,
|
|
1370
|
+
style: disabled ? [{
|
|
1371
|
+
opacity: 1
|
|
1372
|
+
}] : [opacityStyles]
|
|
1373
|
+
}), children]
|
|
1374
|
+
})
|
|
1375
|
+
});
|
|
1267
1376
|
}
|
|
1268
1377
|
|
|
1269
|
-
const IconButtonContentBorder = /*#__PURE__*/styled__default
|
|
1378
|
+
const IconButtonContentBorder = /*#__PURE__*/styled__default.View.withConfig({
|
|
1270
1379
|
displayName: "IconButton__IconButtonContentBorder",
|
|
1271
1380
|
componentId: "kitt-universal__sc-swelbf-0"
|
|
1272
1381
|
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], ({
|
|
@@ -1287,12 +1396,13 @@ function IconButtonContent({
|
|
|
1287
1396
|
color,
|
|
1288
1397
|
icon
|
|
1289
1398
|
}) {
|
|
1290
|
-
return /*#__PURE__*/
|
|
1291
|
-
disabled: disabled
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1399
|
+
return /*#__PURE__*/jsxRuntime.jsx(IconButtonContentBorder, {
|
|
1400
|
+
disabled: disabled,
|
|
1401
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
1402
|
+
color: disabled ? 'black-light' : color,
|
|
1403
|
+
icon: icon
|
|
1404
|
+
})
|
|
1405
|
+
});
|
|
1296
1406
|
}
|
|
1297
1407
|
|
|
1298
1408
|
function IconButton({
|
|
@@ -1301,18 +1411,19 @@ function IconButton({
|
|
|
1301
1411
|
disabled,
|
|
1302
1412
|
onPress
|
|
1303
1413
|
}) {
|
|
1304
|
-
return /*#__PURE__*/
|
|
1414
|
+
return /*#__PURE__*/jsxRuntime.jsx(PressableAnimatedContainer, {
|
|
1305
1415
|
color: color,
|
|
1306
1416
|
disabled: disabled,
|
|
1307
|
-
onPress: onPress
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1417
|
+
onPress: onPress,
|
|
1418
|
+
children: /*#__PURE__*/jsxRuntime.jsx(IconButtonContent, {
|
|
1419
|
+
disabled: disabled,
|
|
1420
|
+
color: color,
|
|
1421
|
+
icon: icon
|
|
1422
|
+
})
|
|
1423
|
+
});
|
|
1313
1424
|
}
|
|
1314
1425
|
|
|
1315
|
-
const ContentView$1 = /*#__PURE__*/styled__default
|
|
1426
|
+
const ContentView$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
1316
1427
|
displayName: "ListItemContent__ContentView",
|
|
1317
1428
|
componentId: "kitt-universal__sc-57q0u9-0"
|
|
1318
1429
|
})(["flex:1 0 0%;align-self:center;"]);
|
|
@@ -1320,10 +1431,12 @@ function ListItemContent({
|
|
|
1320
1431
|
children,
|
|
1321
1432
|
...rest
|
|
1322
1433
|
}) {
|
|
1323
|
-
return /*#__PURE__*/
|
|
1434
|
+
return /*#__PURE__*/jsxRuntime.jsx(ContentView$1, { ...rest,
|
|
1435
|
+
children: children
|
|
1436
|
+
});
|
|
1324
1437
|
}
|
|
1325
1438
|
|
|
1326
|
-
const SideContainerView = /*#__PURE__*/styled__default
|
|
1439
|
+
const SideContainerView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1327
1440
|
displayName: "ListItemSideContent__SideContainerView",
|
|
1328
1441
|
componentId: "kitt-universal__sc-1vajiw-0"
|
|
1329
1442
|
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], ({
|
|
@@ -1339,11 +1452,13 @@ function ListItemSideContainer({
|
|
|
1339
1452
|
side = 'left',
|
|
1340
1453
|
...rest
|
|
1341
1454
|
}) {
|
|
1342
|
-
return /*#__PURE__*/
|
|
1343
|
-
side: side
|
|
1344
|
-
|
|
1455
|
+
return /*#__PURE__*/jsxRuntime.jsx(SideContainerView, {
|
|
1456
|
+
side: side,
|
|
1457
|
+
...rest,
|
|
1458
|
+
children: children
|
|
1459
|
+
});
|
|
1345
1460
|
}
|
|
1346
|
-
const SideContentView = /*#__PURE__*/styled__default
|
|
1461
|
+
const SideContentView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1347
1462
|
displayName: "ListItemSideContent__SideContentView",
|
|
1348
1463
|
componentId: "kitt-universal__sc-1vajiw-1"
|
|
1349
1464
|
})(["align-self:", ";"], ({
|
|
@@ -1354,12 +1469,14 @@ function ListItemSideContent({
|
|
|
1354
1469
|
align = 'auto',
|
|
1355
1470
|
...rest
|
|
1356
1471
|
}) {
|
|
1357
|
-
return /*#__PURE__*/
|
|
1358
|
-
align: align
|
|
1359
|
-
|
|
1472
|
+
return /*#__PURE__*/jsxRuntime.jsx(SideContentView, {
|
|
1473
|
+
align: align,
|
|
1474
|
+
...rest,
|
|
1475
|
+
children: children
|
|
1476
|
+
});
|
|
1360
1477
|
}
|
|
1361
1478
|
|
|
1362
|
-
const ContainerView = /*#__PURE__*/styled__default
|
|
1479
|
+
const ContainerView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1363
1480
|
displayName: "ListItem__ContainerView",
|
|
1364
1481
|
componentId: "kitt-universal__sc-2afp9s-0"
|
|
1365
1482
|
})(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], ({
|
|
@@ -1400,28 +1517,35 @@ function ListItem({
|
|
|
1400
1517
|
onPress,
|
|
1401
1518
|
...rest
|
|
1402
1519
|
}) {
|
|
1403
|
-
const Wrapper = onPress ?
|
|
1520
|
+
const Wrapper = onPress ? reactNative.Pressable : react.Fragment;
|
|
1404
1521
|
const wrapperProps = onPress ? {
|
|
1405
1522
|
accessibilityRole: 'button',
|
|
1406
1523
|
onPress,
|
|
1407
1524
|
...rest
|
|
1408
1525
|
} : undefined;
|
|
1409
1526
|
const containerProps = onPress ? undefined : rest;
|
|
1410
|
-
return /*#__PURE__*/
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1527
|
+
return /*#__PURE__*/jsxRuntime.jsx(Wrapper, { ...wrapperProps,
|
|
1528
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(ContainerView, {
|
|
1529
|
+
withPadding: withPadding,
|
|
1530
|
+
borders: borders,
|
|
1531
|
+
...containerProps,
|
|
1532
|
+
children: [left ? /*#__PURE__*/jsxRuntime.jsx(ListItemSideContainer, {
|
|
1533
|
+
side: "left",
|
|
1534
|
+
children: left
|
|
1535
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(ListItemContent, {
|
|
1536
|
+
children: children
|
|
1537
|
+
}), right ? /*#__PURE__*/jsxRuntime.jsx(ListItemSideContainer, {
|
|
1538
|
+
side: "right",
|
|
1539
|
+
children: right
|
|
1540
|
+
}) : null]
|
|
1541
|
+
})
|
|
1542
|
+
});
|
|
1418
1543
|
}
|
|
1419
1544
|
ListItem.Content = ListItemContent;
|
|
1420
1545
|
ListItem.SideContent = ListItemSideContent;
|
|
1421
1546
|
ListItem.SideContainer = ListItemSideContainer;
|
|
1422
1547
|
|
|
1423
1548
|
function getActivityIndicatorSize(size) {
|
|
1424
|
-
if (reactNative.Platform.OS === 'android') return size;
|
|
1425
1549
|
return size < 36 ? 'small' : 'large';
|
|
1426
1550
|
}
|
|
1427
1551
|
|
|
@@ -1431,7 +1555,7 @@ function Loader({
|
|
|
1431
1555
|
}) {
|
|
1432
1556
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
1433
1557
|
const colorHex = theme.kitt.typography.colors[color];
|
|
1434
|
-
return /*#__PURE__*/
|
|
1558
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.ActivityIndicator, {
|
|
1435
1559
|
testID: "ActivityIndicator",
|
|
1436
1560
|
color: colorHex,
|
|
1437
1561
|
size: getActivityIndicatorSize(size)
|
|
@@ -1441,7 +1565,7 @@ function Loader({
|
|
|
1441
1565
|
function LargeLoader({
|
|
1442
1566
|
color = 'primary'
|
|
1443
1567
|
}) {
|
|
1444
|
-
return /*#__PURE__*/
|
|
1568
|
+
return /*#__PURE__*/jsxRuntime.jsx(Loader, {
|
|
1445
1569
|
color: color,
|
|
1446
1570
|
size: 60
|
|
1447
1571
|
});
|
|
@@ -1449,7 +1573,7 @@ function LargeLoader({
|
|
|
1449
1573
|
|
|
1450
1574
|
const xIconSize = 14;
|
|
1451
1575
|
const mainIconSize = 20;
|
|
1452
|
-
const Container$
|
|
1576
|
+
const Container$2 = /*#__PURE__*/styled__default.View.withConfig({
|
|
1453
1577
|
displayName: "Message__Container",
|
|
1454
1578
|
componentId: "kitt-universal__sc-c6400e-0"
|
|
1455
1579
|
})(["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;"], ({
|
|
@@ -1476,13 +1600,13 @@ const CloseContainer = /*#__PURE__*/styled__default(reactNative.TouchableOpacity
|
|
|
1476
1600
|
}) => theme.kitt.spacing * 4, ({
|
|
1477
1601
|
theme
|
|
1478
1602
|
}) => theme.kitt.spacing);
|
|
1479
|
-
const IconContainer = /*#__PURE__*/styled__default
|
|
1603
|
+
const IconContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1480
1604
|
displayName: "Message__IconContainer",
|
|
1481
1605
|
componentId: "kitt-universal__sc-c6400e-2"
|
|
1482
1606
|
})(["margin-right:", "px;"], ({
|
|
1483
1607
|
theme
|
|
1484
1608
|
}) => theme.kitt.spacing * 4);
|
|
1485
|
-
const Content = /*#__PURE__*/styled__default
|
|
1609
|
+
const Content = /*#__PURE__*/styled__default.Text.withConfig({
|
|
1486
1610
|
displayName: "Message__Content",
|
|
1487
1611
|
componentId: "kitt-universal__sc-c6400e-3"
|
|
1488
1612
|
})(["text-align:", ";flex:1;"], ({
|
|
@@ -1506,16 +1630,16 @@ const getColorByType = type => {
|
|
|
1506
1630
|
function getIconContent(type) {
|
|
1507
1631
|
switch (type) {
|
|
1508
1632
|
case 'warning':
|
|
1509
|
-
return /*#__PURE__*/
|
|
1633
|
+
return /*#__PURE__*/jsxRuntime.jsx(kittIcons.AlertCircleIcon, {});
|
|
1510
1634
|
|
|
1511
1635
|
case 'success':
|
|
1512
|
-
return /*#__PURE__*/
|
|
1636
|
+
return /*#__PURE__*/jsxRuntime.jsx(kittIcons.CheckIcon, {});
|
|
1513
1637
|
|
|
1514
1638
|
case 'danger':
|
|
1515
|
-
return /*#__PURE__*/
|
|
1639
|
+
return /*#__PURE__*/jsxRuntime.jsx(kittIcons.AlertTriangleIcon, {});
|
|
1516
1640
|
|
|
1517
1641
|
default:
|
|
1518
|
-
return /*#__PURE__*/
|
|
1642
|
+
return /*#__PURE__*/jsxRuntime.jsx(kittIcons.InfoIcon, {});
|
|
1519
1643
|
}
|
|
1520
1644
|
}
|
|
1521
1645
|
|
|
@@ -1528,30 +1652,37 @@ function Message({
|
|
|
1528
1652
|
insets
|
|
1529
1653
|
}) {
|
|
1530
1654
|
const color = getColorByType(type);
|
|
1531
|
-
return /*#__PURE__*/
|
|
1655
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container$2, {
|
|
1532
1656
|
type: type,
|
|
1533
1657
|
noRadius: noRadius,
|
|
1534
|
-
insets: insets
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1658
|
+
insets: insets,
|
|
1659
|
+
children: [!centeredText ? /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
|
|
1660
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1661
|
+
size: mainIconSize,
|
|
1662
|
+
color: color,
|
|
1663
|
+
icon: getIconContent(type)
|
|
1664
|
+
})
|
|
1665
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(Content, {
|
|
1666
|
+
type: type,
|
|
1667
|
+
centeredText: centeredText,
|
|
1668
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
1669
|
+
base: "body-small",
|
|
1670
|
+
color: color,
|
|
1671
|
+
children: children
|
|
1672
|
+
})
|
|
1673
|
+
}), onDismiss ? /*#__PURE__*/jsxRuntime.jsx(CloseContainer, {
|
|
1674
|
+
onPress: onDismiss,
|
|
1675
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1676
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
|
|
1677
|
+
size: xIconSize,
|
|
1678
|
+
color: color
|
|
1679
|
+
})
|
|
1680
|
+
}) : null]
|
|
1681
|
+
});
|
|
1552
1682
|
}
|
|
1553
1683
|
|
|
1554
|
-
|
|
1684
|
+
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
1685
|
+
const OverlayPressable = /*#__PURE__*/styled__default(reactNative.Pressable).withConfig({
|
|
1555
1686
|
displayName: "Overlay__OverlayPressable",
|
|
1556
1687
|
componentId: "kitt-universal__sc-1cz1gbr-0"
|
|
1557
1688
|
})(({
|
|
@@ -1562,15 +1693,14 @@ const OverlayPressable = /*#__PURE__*/styled__default(PrimitivePressable).withCo
|
|
|
1562
1693
|
function Overlay({
|
|
1563
1694
|
onPress
|
|
1564
1695
|
}) {
|
|
1565
|
-
return /*#__PURE__*/
|
|
1696
|
+
return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
|
|
1566
1697
|
accessibilityRole: "none",
|
|
1567
|
-
onPress: onPress
|
|
1568
|
-
|
|
1698
|
+
onPress: onPress,
|
|
1699
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {})
|
|
1700
|
+
});
|
|
1569
1701
|
}
|
|
1570
1702
|
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1573
|
-
const BodyView = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
1703
|
+
const BodyView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1574
1704
|
displayName: "Body__BodyView",
|
|
1575
1705
|
componentId: "kitt-universal__sc-17fwpo4-0"
|
|
1576
1706
|
})(["padding:", "px ", "px;"], ({
|
|
@@ -1581,10 +1711,14 @@ const BodyView = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
1581
1711
|
function ModalBody({
|
|
1582
1712
|
children
|
|
1583
1713
|
}) {
|
|
1584
|
-
return /*#__PURE__*/
|
|
1714
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
1715
|
+
children: /*#__PURE__*/jsxRuntime.jsx(BodyView, {
|
|
1716
|
+
children: children
|
|
1717
|
+
})
|
|
1718
|
+
});
|
|
1585
1719
|
}
|
|
1586
1720
|
|
|
1587
|
-
const FooterView = /*#__PURE__*/styled__default
|
|
1721
|
+
const FooterView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1588
1722
|
displayName: "Footer__FooterView",
|
|
1589
1723
|
componentId: "kitt-universal__sc-1ujq2dc-0"
|
|
1590
1724
|
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
|
|
@@ -1595,12 +1729,14 @@ const FooterView = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
1595
1729
|
function ModalFooter({
|
|
1596
1730
|
children
|
|
1597
1731
|
}) {
|
|
1598
|
-
return /*#__PURE__*/
|
|
1732
|
+
return /*#__PURE__*/jsxRuntime.jsx(FooterView, {
|
|
1733
|
+
children: children
|
|
1734
|
+
});
|
|
1599
1735
|
}
|
|
1600
1736
|
|
|
1601
|
-
const OnCloseContext = /*#__PURE__*/
|
|
1737
|
+
const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
|
|
1602
1738
|
|
|
1603
|
-
const HeaderView = /*#__PURE__*/styled__default
|
|
1739
|
+
const HeaderView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1604
1740
|
displayName: "Header__HeaderView",
|
|
1605
1741
|
componentId: "kitt-universal__sc-1iwabch-0"
|
|
1606
1742
|
})(["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;"], ({
|
|
@@ -1608,19 +1744,19 @@ const HeaderView = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
1608
1744
|
}) => theme.kitt.spacing * 2, ({
|
|
1609
1745
|
theme
|
|
1610
1746
|
}) => theme.kitt.colors.separator);
|
|
1611
|
-
const LeftIconView = /*#__PURE__*/styled__default
|
|
1747
|
+
const LeftIconView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1612
1748
|
displayName: "Header__LeftIconView",
|
|
1613
1749
|
componentId: "kitt-universal__sc-1iwabch-1"
|
|
1614
1750
|
})(["align-self:flex-start;margin-right:", "px;"], ({
|
|
1615
1751
|
theme
|
|
1616
1752
|
}) => theme.kitt.spacing * 2);
|
|
1617
|
-
const RightIconView = /*#__PURE__*/styled__default
|
|
1753
|
+
const RightIconView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1618
1754
|
displayName: "Header__RightIconView",
|
|
1619
1755
|
componentId: "kitt-universal__sc-1iwabch-2"
|
|
1620
1756
|
})(["align-self:flex-start;margin-left:", "px;"], ({
|
|
1621
1757
|
theme
|
|
1622
1758
|
}) => theme.kitt.spacing * 2);
|
|
1623
|
-
const TitleView = /*#__PURE__*/styled__default
|
|
1759
|
+
const TitleView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1624
1760
|
displayName: "Header__TitleView",
|
|
1625
1761
|
componentId: "kitt-universal__sc-1iwabch-3"
|
|
1626
1762
|
})(["padding-left:", "px;flex-shrink:1;"], ({
|
|
@@ -1632,18 +1768,25 @@ function ModalHeader({
|
|
|
1632
1768
|
right,
|
|
1633
1769
|
children
|
|
1634
1770
|
}) {
|
|
1635
|
-
const onClose =
|
|
1771
|
+
const onClose = react.useContext(OnCloseContext);
|
|
1636
1772
|
const isIconLeft = !!left;
|
|
1637
|
-
return /*#__PURE__*/
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1773
|
+
return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
|
|
1774
|
+
children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
|
|
1775
|
+
children: left
|
|
1776
|
+
}), /*#__PURE__*/jsxRuntime.jsx(TitleView, {
|
|
1777
|
+
isIconLeft: isIconLeft,
|
|
1778
|
+
children: children
|
|
1779
|
+
}), right !== undefined ? right : /*#__PURE__*/jsxRuntime.jsx(RightIconView, {
|
|
1780
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1781
|
+
type: "subtle-dark",
|
|
1782
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
|
|
1783
|
+
onPress: onClose
|
|
1784
|
+
})
|
|
1785
|
+
})]
|
|
1786
|
+
});
|
|
1644
1787
|
}
|
|
1645
1788
|
|
|
1646
|
-
const ModalView = /*#__PURE__*/styled__default
|
|
1789
|
+
const ModalView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1647
1790
|
displayName: "Modal__ModalView",
|
|
1648
1791
|
componentId: "kitt-universal__sc-1xy2w5u-0"
|
|
1649
1792
|
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
|
|
@@ -1651,7 +1794,7 @@ const ModalView = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
|
1651
1794
|
}) => theme.kitt.spacing * 20, ({
|
|
1652
1795
|
theme
|
|
1653
1796
|
}) => theme.kitt.spacing * 4);
|
|
1654
|
-
const ContentView = /*#__PURE__*/styled__default
|
|
1797
|
+
const ContentView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1655
1798
|
displayName: "Modal__ContentView",
|
|
1656
1799
|
componentId: "kitt-universal__sc-1xy2w5u-1"
|
|
1657
1800
|
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", ";background-color:", ";"], ({
|
|
@@ -1666,18 +1809,24 @@ function Modal({
|
|
|
1666
1809
|
onEntered,
|
|
1667
1810
|
onExited
|
|
1668
1811
|
}) {
|
|
1669
|
-
return /*#__PURE__*/
|
|
1670
|
-
value: onClose
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1812
|
+
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
|
|
1813
|
+
value: onClose,
|
|
1814
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Modal, {
|
|
1815
|
+
transparent: true,
|
|
1816
|
+
animationType: "fade",
|
|
1817
|
+
visible: visible,
|
|
1818
|
+
onShow: onEntered,
|
|
1819
|
+
onDismiss: onExited,
|
|
1820
|
+
onRequestClose: onClose,
|
|
1821
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
|
|
1822
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
|
|
1823
|
+
onPress: onClose
|
|
1824
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ContentView, {
|
|
1825
|
+
children: children
|
|
1826
|
+
})]
|
|
1827
|
+
})
|
|
1828
|
+
})
|
|
1829
|
+
});
|
|
1681
1830
|
}
|
|
1682
1831
|
Modal.Header = ModalHeader;
|
|
1683
1832
|
Modal.Body = ModalBody;
|
|
@@ -1692,20 +1841,19 @@ function Notification({
|
|
|
1692
1841
|
const {
|
|
1693
1842
|
top
|
|
1694
1843
|
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
1695
|
-
return /*#__PURE__*/
|
|
1844
|
+
return /*#__PURE__*/jsxRuntime.jsx(Message, {
|
|
1696
1845
|
noRadius: true,
|
|
1697
1846
|
type: type,
|
|
1698
1847
|
centeredText: centeredText,
|
|
1699
1848
|
insets: {
|
|
1700
1849
|
top
|
|
1701
1850
|
},
|
|
1702
|
-
onDismiss: onDelete
|
|
1703
|
-
|
|
1851
|
+
onDismiss: onDelete,
|
|
1852
|
+
children: children
|
|
1853
|
+
});
|
|
1704
1854
|
}
|
|
1705
1855
|
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1708
|
-
const Flex = /*#__PURE__*/styled__default(PrimitiveView).withConfig({
|
|
1856
|
+
const Flex = /*#__PURE__*/styled__default.View.withConfig({
|
|
1709
1857
|
shouldForwardProp: (prop, defaultValidatorFn) => !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop)
|
|
1710
1858
|
}).withConfig({
|
|
1711
1859
|
displayName: "Flex",
|
|
@@ -1747,13 +1895,13 @@ const getTypographyColorFromBlockColor = (color = 'transparent') => {
|
|
|
1747
1895
|
}
|
|
1748
1896
|
};
|
|
1749
1897
|
|
|
1750
|
-
const StoryBlockBackgroundContext = /*#__PURE__*/
|
|
1751
|
-
const StoryBlockColorContext = /*#__PURE__*/
|
|
1898
|
+
const StoryBlockBackgroundContext = /*#__PURE__*/react.createContext('transparent');
|
|
1899
|
+
const StoryBlockColorContext = /*#__PURE__*/react.createContext('black');
|
|
1752
1900
|
const useStoryBlockColor = color => {
|
|
1753
|
-
const storyBlockColor =
|
|
1901
|
+
const storyBlockColor = react.useContext(StoryBlockColorContext);
|
|
1754
1902
|
return color || storyBlockColor;
|
|
1755
1903
|
};
|
|
1756
|
-
const StyledStoryBlockView = /*#__PURE__*/styled__default
|
|
1904
|
+
const StyledStoryBlockView = /*#__PURE__*/styled__default.View.withConfig({
|
|
1757
1905
|
displayName: "StoryBlock__StyledStoryBlockView",
|
|
1758
1906
|
componentId: "kitt-universal__sc-3w4hdm-0"
|
|
1759
1907
|
})(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, ({
|
|
@@ -1764,20 +1912,23 @@ function StoryBlock({
|
|
|
1764
1912
|
children,
|
|
1765
1913
|
background
|
|
1766
1914
|
}) {
|
|
1767
|
-
return /*#__PURE__*/
|
|
1768
|
-
background: background
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1915
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledStoryBlockView, {
|
|
1916
|
+
background: background,
|
|
1917
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StoryBlockColorContext.Provider, {
|
|
1918
|
+
value: getTypographyColorFromBlockColor(background),
|
|
1919
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StoryBlockBackgroundContext.Provider, {
|
|
1920
|
+
value: background,
|
|
1921
|
+
children: children
|
|
1922
|
+
})
|
|
1923
|
+
})
|
|
1924
|
+
});
|
|
1774
1925
|
}
|
|
1775
1926
|
|
|
1776
|
-
const StoryTitleContainer = /*#__PURE__*/styled__default
|
|
1927
|
+
const StoryTitleContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1777
1928
|
displayName: "StoryTitle__StoryTitleContainer",
|
|
1778
1929
|
componentId: "kitt-universal__sc-sic7hb-0"
|
|
1779
1930
|
})(["margin-bottom:30px;"]);
|
|
1780
|
-
const StorySubTitleContainer = /*#__PURE__*/styled__default
|
|
1931
|
+
const StorySubTitleContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1781
1932
|
displayName: "StoryTitle__StorySubTitleContainer",
|
|
1782
1933
|
componentId: "kitt-universal__sc-sic7hb-1"
|
|
1783
1934
|
})(["margin-bottom:10px;"]);
|
|
@@ -1786,12 +1937,15 @@ function StoryTitle({
|
|
|
1786
1937
|
children,
|
|
1787
1938
|
numberOfLines
|
|
1788
1939
|
}) {
|
|
1789
|
-
return /*#__PURE__*/
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1940
|
+
return /*#__PURE__*/jsxRuntime.jsx(StoryTitleContainer, {
|
|
1941
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header1, {
|
|
1942
|
+
variant: "bold",
|
|
1943
|
+
base: "header1",
|
|
1944
|
+
color: useStoryBlockColor(color),
|
|
1945
|
+
numberOfLines: numberOfLines,
|
|
1946
|
+
children: children
|
|
1947
|
+
})
|
|
1948
|
+
});
|
|
1795
1949
|
}
|
|
1796
1950
|
|
|
1797
1951
|
function StoryTitleLevel2({
|
|
@@ -1799,12 +1953,15 @@ function StoryTitleLevel2({
|
|
|
1799
1953
|
children,
|
|
1800
1954
|
numberOfLines
|
|
1801
1955
|
}) {
|
|
1802
|
-
return /*#__PURE__*/
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1956
|
+
return /*#__PURE__*/jsxRuntime.jsx(StoryTitleContainer, {
|
|
1957
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header2, {
|
|
1958
|
+
variant: "bold",
|
|
1959
|
+
base: "header2",
|
|
1960
|
+
color: useStoryBlockColor(color),
|
|
1961
|
+
numberOfLines: numberOfLines,
|
|
1962
|
+
children: children
|
|
1963
|
+
})
|
|
1964
|
+
});
|
|
1808
1965
|
}
|
|
1809
1966
|
|
|
1810
1967
|
StoryTitleLevel2.displayName = 'StoryTitle.Level2';
|
|
@@ -1814,13 +1971,16 @@ function StoryTitleLevel3({
|
|
|
1814
1971
|
children,
|
|
1815
1972
|
numberOfLines
|
|
1816
1973
|
}) {
|
|
1817
|
-
return /*#__PURE__*/
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1974
|
+
return /*#__PURE__*/jsxRuntime.jsx(StorySubTitleContainer, {
|
|
1975
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header3, {
|
|
1976
|
+
variant: "bold",
|
|
1977
|
+
base: "header3",
|
|
1978
|
+
medium: "header4",
|
|
1979
|
+
color: useStoryBlockColor(color),
|
|
1980
|
+
numberOfLines: numberOfLines,
|
|
1981
|
+
children: children
|
|
1982
|
+
})
|
|
1983
|
+
});
|
|
1824
1984
|
}
|
|
1825
1985
|
|
|
1826
1986
|
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
@@ -1830,13 +1990,16 @@ function StoryTitleLevel4({
|
|
|
1830
1990
|
children,
|
|
1831
1991
|
numberOfLines
|
|
1832
1992
|
}) {
|
|
1833
|
-
return /*#__PURE__*/
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1993
|
+
return /*#__PURE__*/jsxRuntime.jsx(StorySubTitleContainer, {
|
|
1994
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header4, {
|
|
1995
|
+
variant: "bold",
|
|
1996
|
+
base: "header4",
|
|
1997
|
+
medium: "header5",
|
|
1998
|
+
color: useStoryBlockColor(color),
|
|
1999
|
+
numberOfLines: numberOfLines,
|
|
2000
|
+
children: children
|
|
2001
|
+
})
|
|
2002
|
+
});
|
|
1840
2003
|
}
|
|
1841
2004
|
|
|
1842
2005
|
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
@@ -1844,7 +2007,7 @@ StoryTitle.Level2 = StoryTitleLevel2;
|
|
|
1844
2007
|
StoryTitle.Level3 = StoryTitleLevel3;
|
|
1845
2008
|
StoryTitle.Level4 = StoryTitleLevel4;
|
|
1846
2009
|
|
|
1847
|
-
const StoryContainer$1 = /*#__PURE__*/styled__default
|
|
2010
|
+
const StoryContainer$1 = /*#__PURE__*/styled__default.ScrollView.withConfig({
|
|
1848
2011
|
displayName: "Story__StoryContainer",
|
|
1849
2012
|
componentId: "kitt-universal__sc-1kwdg2p-0"
|
|
1850
2013
|
})(["padding:", "px;"], storyPadding);
|
|
@@ -1853,54 +2016,66 @@ function Story({
|
|
|
1853
2016
|
contentContainerStyle,
|
|
1854
2017
|
children
|
|
1855
2018
|
}) {
|
|
1856
|
-
return /*#__PURE__*/
|
|
1857
|
-
contentContainerStyle: contentContainerStyle
|
|
1858
|
-
|
|
2019
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StoryContainer$1, {
|
|
2020
|
+
contentContainerStyle: contentContainerStyle,
|
|
2021
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle, {
|
|
2022
|
+
children: title
|
|
2023
|
+
}), children]
|
|
2024
|
+
});
|
|
1859
2025
|
}
|
|
1860
2026
|
|
|
1861
|
-
const StyledSection = /*#__PURE__*/styled__default
|
|
2027
|
+
const StyledSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
1862
2028
|
displayName: "StorySection__StyledSection",
|
|
1863
2029
|
componentId: "kitt-universal__sc-1b3liv5-0"
|
|
1864
2030
|
})(["margin-bottom:32px;"]);
|
|
1865
2031
|
function StorySection({
|
|
1866
2032
|
title,
|
|
1867
|
-
className,
|
|
1868
2033
|
children,
|
|
1869
2034
|
internalIsDemoSection,
|
|
1870
2035
|
...props
|
|
1871
2036
|
}) {
|
|
1872
2037
|
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
1873
|
-
return /*#__PURE__*/
|
|
2038
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledSection, { ...props,
|
|
2039
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level2, {
|
|
2040
|
+
children: title
|
|
2041
|
+
}), children]
|
|
2042
|
+
});
|
|
1874
2043
|
}
|
|
1875
|
-
const StyledSubSection = /*#__PURE__*/styled__default
|
|
2044
|
+
const StyledSubSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
1876
2045
|
displayName: "StorySection__StyledSubSection",
|
|
1877
2046
|
componentId: "kitt-universal__sc-1b3liv5-1"
|
|
1878
2047
|
})(["margin-bottom:16px;"]);
|
|
1879
2048
|
|
|
1880
2049
|
function SubSection({
|
|
1881
2050
|
title,
|
|
1882
|
-
className,
|
|
1883
2051
|
children,
|
|
1884
2052
|
...props
|
|
1885
2053
|
}) {
|
|
1886
|
-
return /*#__PURE__*/
|
|
2054
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledSubSection, { ...props,
|
|
2055
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level3, {
|
|
2056
|
+
children: title
|
|
2057
|
+
}), children]
|
|
2058
|
+
});
|
|
1887
2059
|
}
|
|
1888
2060
|
|
|
1889
|
-
const StyledBlockSection = /*#__PURE__*/styled__default
|
|
2061
|
+
const StyledBlockSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
1890
2062
|
displayName: "StorySection__StyledBlockSection",
|
|
1891
2063
|
componentId: "kitt-universal__sc-1b3liv5-2"
|
|
1892
2064
|
})(["margin-bottom:16px;"]);
|
|
1893
2065
|
|
|
1894
2066
|
function BlockSection({
|
|
1895
2067
|
title,
|
|
1896
|
-
className,
|
|
1897
2068
|
children,
|
|
1898
2069
|
...props
|
|
1899
2070
|
}) {
|
|
1900
|
-
return /*#__PURE__*/
|
|
2071
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledBlockSection, { ...props,
|
|
2072
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
2073
|
+
children: title
|
|
2074
|
+
}), children]
|
|
2075
|
+
});
|
|
1901
2076
|
}
|
|
1902
2077
|
|
|
1903
|
-
const StyledDemoSection = /*#__PURE__*/styled__default
|
|
2078
|
+
const StyledDemoSection = /*#__PURE__*/styled__default.View.withConfig({
|
|
1904
2079
|
displayName: "StorySection__StyledDemoSection",
|
|
1905
2080
|
componentId: "kitt-universal__sc-1b3liv5-3"
|
|
1906
2081
|
})(["margin-bottom:64px;"]);
|
|
@@ -1908,10 +2083,13 @@ const StyledDemoSection = /*#__PURE__*/styled__default(PrimitiveView).withConfig
|
|
|
1908
2083
|
function DemoSection({
|
|
1909
2084
|
children
|
|
1910
2085
|
}) {
|
|
1911
|
-
return /*#__PURE__*/
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
2086
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledDemoSection, {
|
|
2087
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StorySection, {
|
|
2088
|
+
internalIsDemoSection: true,
|
|
2089
|
+
title: "Demo",
|
|
2090
|
+
children: children
|
|
2091
|
+
})
|
|
2092
|
+
});
|
|
1915
2093
|
}
|
|
1916
2094
|
|
|
1917
2095
|
StorySection.SubSection = SubSection;
|
|
@@ -1931,31 +2109,33 @@ function StoryContainer({
|
|
|
1931
2109
|
platform = 'all'
|
|
1932
2110
|
}) {
|
|
1933
2111
|
if (platform === 'web') return null;
|
|
1934
|
-
return /*#__PURE__*/
|
|
2112
|
+
return /*#__PURE__*/jsxRuntime.jsx(StorySection.BlockSection, {
|
|
1935
2113
|
testID: state,
|
|
1936
|
-
title: title
|
|
1937
|
-
|
|
2114
|
+
title: title,
|
|
2115
|
+
children: children
|
|
2116
|
+
});
|
|
1938
2117
|
}
|
|
1939
2118
|
|
|
1940
2119
|
function StoryDecorator(storyFn, context) {
|
|
1941
|
-
return /*#__PURE__*/
|
|
1942
|
-
title: context.name
|
|
1943
|
-
|
|
2120
|
+
return /*#__PURE__*/jsxRuntime.jsx(Story, {
|
|
2121
|
+
title: context.name,
|
|
2122
|
+
children: storyFn()
|
|
2123
|
+
});
|
|
1944
2124
|
}
|
|
1945
2125
|
|
|
1946
|
-
const SmallScreenRow = /*#__PURE__*/styled__default
|
|
2126
|
+
const SmallScreenRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
1947
2127
|
displayName: "StoryGrid__SmallScreenRow",
|
|
1948
2128
|
componentId: "kitt-universal__sc-4z5new-0"
|
|
1949
2129
|
})(["flex-direction:column;margin:0;"]);
|
|
1950
|
-
const SmallScreenCol = /*#__PURE__*/styled__default
|
|
2130
|
+
const SmallScreenCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
1951
2131
|
displayName: "StoryGrid__SmallScreenCol",
|
|
1952
2132
|
componentId: "kitt-universal__sc-4z5new-1"
|
|
1953
2133
|
})(["padding:8px 0 16px;"]);
|
|
1954
|
-
const FlexRow = /*#__PURE__*/styled__default
|
|
2134
|
+
const FlexRow = /*#__PURE__*/styled__default.View.withConfig({
|
|
1955
2135
|
displayName: "StoryGrid__FlexRow",
|
|
1956
2136
|
componentId: "kitt-universal__sc-4z5new-2"
|
|
1957
2137
|
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
1958
|
-
const FlexCol = /*#__PURE__*/styled__default
|
|
2138
|
+
const FlexCol = /*#__PURE__*/styled__default.View.withConfig({
|
|
1959
2139
|
displayName: "StoryGrid__FlexCol",
|
|
1960
2140
|
componentId: "kitt-universal__sc-4z5new-3"
|
|
1961
2141
|
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
@@ -1972,10 +2152,18 @@ function StoryGridRow({
|
|
|
1972
2152
|
const breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
1973
2153
|
|
|
1974
2154
|
if (width < breakpointValue) {
|
|
1975
|
-
return /*#__PURE__*/
|
|
2155
|
+
return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
|
|
2156
|
+
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
|
|
2157
|
+
children: child
|
|
2158
|
+
}))
|
|
2159
|
+
});
|
|
1976
2160
|
}
|
|
1977
2161
|
|
|
1978
|
-
return /*#__PURE__*/
|
|
2162
|
+
return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
|
|
2163
|
+
children: react.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
|
|
2164
|
+
children: child
|
|
2165
|
+
}))
|
|
2166
|
+
});
|
|
1979
2167
|
}
|
|
1980
2168
|
|
|
1981
2169
|
function StoryGridCol({
|
|
@@ -1984,20 +2172,17 @@ function StoryGridCol({
|
|
|
1984
2172
|
children,
|
|
1985
2173
|
platform = 'all'
|
|
1986
2174
|
}) {
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
if (reactNative.Platform.OS === 'web' && platform === 'native') {
|
|
1990
|
-
return null;
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
|
-
if (isNative && platform === 'web') {
|
|
2175
|
+
if (platform === 'native') {
|
|
1994
2176
|
return null;
|
|
1995
2177
|
}
|
|
1996
2178
|
|
|
1997
|
-
return /*#__PURE__*/
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2179
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2180
|
+
children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
|
|
2181
|
+
numberOfLines: 1,
|
|
2182
|
+
color: titleColor,
|
|
2183
|
+
children: title
|
|
2184
|
+
}) : null, children]
|
|
2185
|
+
});
|
|
2001
2186
|
}
|
|
2002
2187
|
|
|
2003
2188
|
const StoryGrid = {
|
|
@@ -2005,7 +2190,7 @@ const StoryGrid = {
|
|
|
2005
2190
|
Col: StoryGridCol
|
|
2006
2191
|
};
|
|
2007
2192
|
|
|
2008
|
-
const Container = /*#__PURE__*/styled__default
|
|
2193
|
+
const Container$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
2009
2194
|
displayName: "Tag__Container",
|
|
2010
2195
|
componentId: "kitt-universal__sc-19jmowi-0"
|
|
2011
2196
|
})(["background-color:", ";border-width:", ";border-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], ({
|
|
@@ -2053,13 +2238,15 @@ function Tag({
|
|
|
2053
2238
|
type = 'default',
|
|
2054
2239
|
variant = 'fill'
|
|
2055
2240
|
}) {
|
|
2056
|
-
return /*#__PURE__*/
|
|
2241
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container$1, {
|
|
2057
2242
|
type: type,
|
|
2058
|
-
variant: variant
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2243
|
+
variant: variant,
|
|
2244
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
2245
|
+
base: "body-xsmall",
|
|
2246
|
+
color: getLabelColor(type, variant),
|
|
2247
|
+
children: label
|
|
2248
|
+
})
|
|
2249
|
+
});
|
|
2063
2250
|
}
|
|
2064
2251
|
|
|
2065
2252
|
const lateOceanColorPalette = {
|
|
@@ -2168,6 +2355,7 @@ const colorsLateOceanTheme = {
|
|
|
2168
2355
|
danger: lateOceanColorPalette.englishVermillon,
|
|
2169
2356
|
separator: lateOceanColorPalette.black100,
|
|
2170
2357
|
hover: lateOceanColorPalette.black100,
|
|
2358
|
+
black: lateOceanColorPalette.black1000,
|
|
2171
2359
|
uiBackground: lateOceanColorPalette.black25,
|
|
2172
2360
|
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2173
2361
|
overlay: {
|
|
@@ -2353,6 +2541,15 @@ const tagLateOceanTheme = {
|
|
|
2353
2541
|
}
|
|
2354
2542
|
};
|
|
2355
2543
|
|
|
2544
|
+
const tooltip = {
|
|
2545
|
+
backgroundColor: colorsLateOceanTheme.black,
|
|
2546
|
+
borderRadius: 10,
|
|
2547
|
+
opacity: 0.95,
|
|
2548
|
+
horizontalPadding: 16,
|
|
2549
|
+
verticalPadding: 4,
|
|
2550
|
+
floatingPadding: 8
|
|
2551
|
+
};
|
|
2552
|
+
|
|
2356
2553
|
const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
|
|
2357
2554
|
|
|
2358
2555
|
const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
|
|
@@ -2381,8 +2578,8 @@ const typographyLateOceanTheme = {
|
|
|
2381
2578
|
types: {
|
|
2382
2579
|
headers: {
|
|
2383
2580
|
fontFamily: {
|
|
2384
|
-
regular:
|
|
2385
|
-
bold:
|
|
2581
|
+
regular: 'Moderat',
|
|
2582
|
+
bold: 'Moderat'
|
|
2386
2583
|
},
|
|
2387
2584
|
fontWeight: 400,
|
|
2388
2585
|
fontStyle: 'normal',
|
|
@@ -2401,8 +2598,8 @@ const typographyLateOceanTheme = {
|
|
|
2401
2598
|
},
|
|
2402
2599
|
bodies: {
|
|
2403
2600
|
fontFamily: {
|
|
2404
|
-
regular:
|
|
2405
|
-
bold:
|
|
2601
|
+
regular: 'Noto Sans',
|
|
2602
|
+
bold: 'Noto Sans'
|
|
2406
2603
|
},
|
|
2407
2604
|
fontWeight: {
|
|
2408
2605
|
regular: 400,
|
|
@@ -2465,36 +2662,330 @@ const theme = {
|
|
|
2465
2662
|
shadows: shadowsLateOceanTheme,
|
|
2466
2663
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2467
2664
|
iconButton,
|
|
2468
|
-
listItem: listItemLateOceanTheme
|
|
2665
|
+
listItem: listItemLateOceanTheme,
|
|
2666
|
+
tooltip
|
|
2469
2667
|
};
|
|
2470
2668
|
|
|
2471
|
-
function
|
|
2669
|
+
function Title({
|
|
2472
2670
|
children
|
|
2473
2671
|
}) {
|
|
2474
|
-
return /*#__PURE__*/
|
|
2672
|
+
return /*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
|
|
2673
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
2674
|
+
base: "body",
|
|
2675
|
+
variant: "bold",
|
|
2676
|
+
children: children
|
|
2677
|
+
})
|
|
2678
|
+
});
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
function ModalDateTimePicker({
|
|
2682
|
+
title,
|
|
2683
|
+
visible,
|
|
2684
|
+
value,
|
|
2685
|
+
validateButtonLabel,
|
|
2686
|
+
onChange,
|
|
2687
|
+
onClose
|
|
2688
|
+
}) {
|
|
2689
|
+
const [currentValue, setCurrentValue] = react.useState(value); // Prevent unsynced value between the modal and its parent state
|
|
2690
|
+
|
|
2691
|
+
return /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
2692
|
+
visible: Boolean(visible),
|
|
2693
|
+
onClose: () => {
|
|
2694
|
+
setCurrentValue(value);
|
|
2695
|
+
onClose();
|
|
2696
|
+
},
|
|
2697
|
+
children: visible ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2698
|
+
children: [title ? /*#__PURE__*/jsxRuntime.jsx(Title, {
|
|
2699
|
+
children: title
|
|
2700
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
|
|
2701
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
2702
|
+
is24Hour: true,
|
|
2703
|
+
testID: "date-picker-native-element",
|
|
2704
|
+
value: currentValue,
|
|
2705
|
+
mode: "time",
|
|
2706
|
+
display: 'default',
|
|
2707
|
+
onChange: (_event, date) => setCurrentValue(prev => {
|
|
2708
|
+
return date || prev;
|
|
2709
|
+
})
|
|
2710
|
+
})
|
|
2711
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
|
|
2712
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2713
|
+
stretch: true,
|
|
2714
|
+
type: "primary",
|
|
2715
|
+
onPress: () => {
|
|
2716
|
+
onChange(currentValue);
|
|
2717
|
+
},
|
|
2718
|
+
children: validateButtonLabel ? /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
2719
|
+
children: validateButtonLabel
|
|
2720
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(reactIntl.FormattedMessage, {
|
|
2721
|
+
id: "kitt-universal.ModalDateTimePicker.confirm"
|
|
2722
|
+
})
|
|
2723
|
+
})
|
|
2724
|
+
})]
|
|
2725
|
+
}) : null
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
const timePickerPlaceholder = '--:--';
|
|
2730
|
+
const useTimePicker = (value, onChange, onBlur, disabled, defaultValue) => {
|
|
2731
|
+
const [isTimePickerModalVisible, setIsTimePickerModalVisible] = react.useState(false);
|
|
2732
|
+
const todayAtNoon = react.useMemo(() => {
|
|
2733
|
+
const now = new Date(2000, 0, 1, 12);
|
|
2734
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDay(), 12);
|
|
2735
|
+
}, []);
|
|
2736
|
+
const defaultDate = defaultValue || todayAtNoon;
|
|
2737
|
+
const dateTimePickerValue = value || defaultDate;
|
|
2738
|
+
const displayedValue = value === null ? timePickerPlaceholder : Intl.DateTimeFormat('fr-FR', {
|
|
2739
|
+
minute: 'numeric',
|
|
2740
|
+
hour: 'numeric'
|
|
2741
|
+
}).format(dateTimePickerValue);
|
|
2742
|
+
const timePickerState = isTimePickerModalVisible ? 'focus' : 'default';
|
|
2743
|
+
return {
|
|
2744
|
+
dateTimePickerValue,
|
|
2745
|
+
displayedValue,
|
|
2746
|
+
timePickerState,
|
|
2747
|
+
isTimePickerModalVisible,
|
|
2748
|
+
handleInputPress: () => {
|
|
2749
|
+
if (disabled) {
|
|
2750
|
+
return;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
setIsTimePickerModalVisible(true);
|
|
2754
|
+
},
|
|
2755
|
+
handleTimeChange: date => {
|
|
2756
|
+
setIsTimePickerModalVisible(false);
|
|
2757
|
+
onChange(date || defaultDate);
|
|
2758
|
+
onBlur();
|
|
2759
|
+
},
|
|
2760
|
+
handleModalClose: () => setIsTimePickerModalVisible(false)
|
|
2761
|
+
};
|
|
2762
|
+
};
|
|
2763
|
+
|
|
2764
|
+
const Container = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
2765
|
+
displayName: "TimePicker__Container",
|
|
2766
|
+
componentId: "kitt-universal__sc-18zhpwp-0"
|
|
2767
|
+
})(["", " width:100px;height:40px;justify-content:center;align-items:center;"], styledTextInputMixin);
|
|
2768
|
+
function TimePicker({
|
|
2769
|
+
title,
|
|
2770
|
+
state = 'default',
|
|
2771
|
+
disabled = false,
|
|
2772
|
+
forceDefaultValue,
|
|
2773
|
+
value,
|
|
2774
|
+
validateButtonLabel,
|
|
2775
|
+
onChange,
|
|
2776
|
+
onBlur
|
|
2777
|
+
}) {
|
|
2778
|
+
const {
|
|
2779
|
+
dateTimePickerValue,
|
|
2780
|
+
displayedValue,
|
|
2781
|
+
timePickerState,
|
|
2782
|
+
handleInputPress,
|
|
2783
|
+
handleModalClose,
|
|
2784
|
+
handleTimeChange,
|
|
2785
|
+
isTimePickerModalVisible
|
|
2786
|
+
} = useTimePicker(value || null, onChange, onBlur, disabled, forceDefaultValue);
|
|
2787
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container, {
|
|
2788
|
+
state: timePickerState === 'default' ? state : timePickerState,
|
|
2789
|
+
accessibilityRole: "button",
|
|
2790
|
+
onPress: handleInputPress,
|
|
2791
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
2792
|
+
base: "body",
|
|
2793
|
+
color: displayedValue === timePickerPlaceholder ? 'black-light' : 'black',
|
|
2794
|
+
children: displayedValue
|
|
2795
|
+
}), null, /*#__PURE__*/jsxRuntime.jsx(ModalDateTimePicker, {
|
|
2796
|
+
title: title,
|
|
2797
|
+
visible: isTimePickerModalVisible,
|
|
2798
|
+
value: dateTimePickerValue,
|
|
2799
|
+
validateButtonLabel: validateButtonLabel,
|
|
2800
|
+
onChange: handleTimeChange,
|
|
2801
|
+
onClose: handleModalClose
|
|
2802
|
+
})]
|
|
2803
|
+
});
|
|
2475
2804
|
}
|
|
2476
2805
|
|
|
2477
|
-
|
|
2478
|
-
return
|
|
2806
|
+
var Arrow = function (props) {
|
|
2807
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", { ...props,
|
|
2808
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
2809
|
+
fillRule: "evenodd",
|
|
2810
|
+
clipRule: "evenodd",
|
|
2811
|
+
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",
|
|
2812
|
+
fill: "currentColor"
|
|
2813
|
+
})
|
|
2814
|
+
});
|
|
2479
2815
|
};
|
|
2480
2816
|
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2817
|
+
Arrow.defaultProps = {
|
|
2818
|
+
width: "36",
|
|
2819
|
+
height: "8",
|
|
2820
|
+
viewBox: "0 0 36 9",
|
|
2821
|
+
fill: "none",
|
|
2822
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2823
|
+
};
|
|
2824
|
+
const StyledTooltipView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2825
|
+
displayName: "TooltipView__StyledTooltipView",
|
|
2826
|
+
componentId: "kitt-universal__sc-156zm6m-0"
|
|
2827
|
+
})(["align-items:center;"]);
|
|
2828
|
+
const StyledTooltipContent = /*#__PURE__*/styled__default.View.withConfig({
|
|
2829
|
+
displayName: "TooltipView__StyledTooltipContent",
|
|
2830
|
+
componentId: "kitt-universal__sc-156zm6m-1"
|
|
2831
|
+
})(["background-color:", ";border-radius:", "px;opacity:", ";padding:", ";"], ({
|
|
2832
|
+
theme
|
|
2833
|
+
}) => theme.kitt.tooltip.backgroundColor, ({
|
|
2834
|
+
theme
|
|
2835
|
+
}) => theme.kitt.tooltip.borderRadius, ({
|
|
2836
|
+
theme
|
|
2837
|
+
}) => theme.kitt.tooltip.opacity, ({
|
|
2838
|
+
theme
|
|
2839
|
+
}) => `${theme.kitt.tooltip.verticalPadding}px ${theme.kitt.tooltip.horizontalPadding}px`);
|
|
2485
2840
|
|
|
2486
|
-
|
|
2841
|
+
function ArrowView(props) {
|
|
2842
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
2843
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.View, { ...props,
|
|
2844
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Arrow, {
|
|
2845
|
+
color: theme.kitt.tooltip.backgroundColor
|
|
2846
|
+
})
|
|
2847
|
+
});
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
const StyledArrow = /*#__PURE__*/styled__default(ArrowView).withConfig({
|
|
2851
|
+
displayName: "TooltipView__StyledArrow",
|
|
2852
|
+
componentId: "kitt-universal__sc-156zm6m-2"
|
|
2853
|
+
})(["color:", ";transform:", ";"], ({
|
|
2854
|
+
theme
|
|
2855
|
+
}) => theme.kitt.tooltip.backgroundColor, ({
|
|
2856
|
+
$position
|
|
2857
|
+
}) => `rotate(${$position === 'bottom' ? 180 : 0}deg)`);
|
|
2858
|
+
function TooltipView({
|
|
2859
|
+
children,
|
|
2860
|
+
position
|
|
2861
|
+
}) {
|
|
2862
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledTooltipView, {
|
|
2863
|
+
children: [position === 'bottom' ? /*#__PURE__*/jsxRuntime.jsx(StyledArrow, {
|
|
2864
|
+
$position: position
|
|
2865
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(StyledTooltipContent, {
|
|
2866
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
2867
|
+
base: "body",
|
|
2868
|
+
color: "white",
|
|
2869
|
+
children: children
|
|
2870
|
+
})
|
|
2871
|
+
}), position === 'top' ? /*#__PURE__*/jsxRuntime.jsx(StyledArrow, {
|
|
2872
|
+
$position: position
|
|
2873
|
+
}) : null]
|
|
2874
|
+
});
|
|
2487
2875
|
}
|
|
2488
2876
|
|
|
2877
|
+
const tooltipDefaultPosition = 'top';
|
|
2878
|
+
|
|
2879
|
+
// Since the tooltip use absolute positionning, we need a parent to provide the relative root
|
|
2880
|
+
const TooltipContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2881
|
+
displayName: "Tooltip__TooltipContainer",
|
|
2882
|
+
componentId: "kitt-universal__sc-7ja8gx-0"
|
|
2883
|
+
})(["position:relative;align-self:baseline;"]);
|
|
2884
|
+
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2885
|
+
// TODO : update position on scroll in future iteration
|
|
2886
|
+
function Tooltip({
|
|
2887
|
+
children,
|
|
2888
|
+
defaultVisible,
|
|
2889
|
+
position = tooltipDefaultPosition,
|
|
2890
|
+
content,
|
|
2891
|
+
floatingPadding,
|
|
2892
|
+
onUpdate
|
|
2893
|
+
}) {
|
|
2894
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
2895
|
+
const padding = floatingPadding || theme.kitt.tooltip.floatingPadding;
|
|
2896
|
+
const pressed = Animated.useSharedValue(defaultVisible);
|
|
2897
|
+
const opacityStyles = Animated.useAnimatedStyle(function () {
|
|
2898
|
+
const _f = function () {
|
|
2899
|
+
return {
|
|
2900
|
+
opacity: Animated.withSpring(pressed.value ? theme.kitt.tooltip.opacity : 0)
|
|
2901
|
+
};
|
|
2902
|
+
};
|
|
2903
|
+
|
|
2904
|
+
_f._closure = {
|
|
2905
|
+
withSpring: Animated.withSpring,
|
|
2906
|
+
pressed,
|
|
2907
|
+
theme: {
|
|
2908
|
+
kitt: {
|
|
2909
|
+
tooltip: {
|
|
2910
|
+
opacity: theme.kitt.tooltip.opacity
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
};
|
|
2915
|
+
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{opacity:withSpring(pressed.value?theme.kitt.tooltip.opacity:0)};}}";
|
|
2916
|
+
_f.__workletHash = 15953928507970;
|
|
2917
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (57:41)";
|
|
2918
|
+
_f.__optimalization = 2;
|
|
2919
|
+
|
|
2920
|
+
global.__reanimatedWorkletInit(_f);
|
|
2921
|
+
|
|
2922
|
+
return _f;
|
|
2923
|
+
}());
|
|
2924
|
+
const {
|
|
2925
|
+
x,
|
|
2926
|
+
y,
|
|
2927
|
+
reference,
|
|
2928
|
+
floating,
|
|
2929
|
+
update,
|
|
2930
|
+
refs,
|
|
2931
|
+
middlewareData
|
|
2932
|
+
} = reactNative$1.useFloating({
|
|
2933
|
+
placement: position,
|
|
2934
|
+
middleware: [reactNative$1.offset(padding), reactNative$1.shift(), reactNative$1.flip({
|
|
2935
|
+
padding
|
|
2936
|
+
})]
|
|
2937
|
+
});
|
|
2938
|
+
react.useEffect(() => {
|
|
2939
|
+
if (!onUpdate) return;
|
|
2940
|
+
onUpdate({
|
|
2941
|
+
x,
|
|
2942
|
+
y,
|
|
2943
|
+
reference,
|
|
2944
|
+
floating,
|
|
2945
|
+
strategy: 'absolute',
|
|
2946
|
+
update,
|
|
2947
|
+
refs,
|
|
2948
|
+
middlewareData
|
|
2949
|
+
});
|
|
2950
|
+
}, [x, y, reference, floating, update, refs, middlewareData, onUpdate]);
|
|
2951
|
+
return /*#__PURE__*/jsxRuntime.jsxs(TooltipContainer, {
|
|
2952
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
2953
|
+
ref: reference,
|
|
2954
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Pressable, {
|
|
2955
|
+
accessibilityRole: "button",
|
|
2956
|
+
onPress: () => {
|
|
2957
|
+
pressed.value = !pressed.value;
|
|
2958
|
+
},
|
|
2959
|
+
children: children
|
|
2960
|
+
})
|
|
2961
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
2962
|
+
ref: floating,
|
|
2963
|
+
accessibilityElementsHidden: !pressed.value,
|
|
2964
|
+
importantForAccessibility: pressed.value === true ? 'auto' : 'no-hide-descendants',
|
|
2965
|
+
style: { ...reactNative.StyleSheet.absoluteFillObject,
|
|
2966
|
+
top: y && position === 'bottom' ? y : undefined,
|
|
2967
|
+
bottom: y && position === 'top' ? y : undefined,
|
|
2968
|
+
left: x ?? 0
|
|
2969
|
+
},
|
|
2970
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
|
|
2971
|
+
style: [opacityStyles],
|
|
2972
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TooltipView, {
|
|
2973
|
+
position: position,
|
|
2974
|
+
children: content
|
|
2975
|
+
})
|
|
2976
|
+
})
|
|
2977
|
+
})]
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
Tooltip.View = TooltipView;
|
|
2981
|
+
|
|
2489
2982
|
const StyledTypographyEmoji = /*#__PURE__*/styled__default(Emoji).withConfig({
|
|
2490
2983
|
displayName: "TypographyEmoji__StyledTypographyEmoji",
|
|
2491
2984
|
componentId: "kitt-universal__sc-1if5guu-0"
|
|
2492
2985
|
})(["align-self:center;", ""], ({
|
|
2493
2986
|
size
|
|
2494
2987
|
}) => {
|
|
2495
|
-
if (reactNative.Platform.OS !== 'web') return undefined;
|
|
2496
2988
|
/* Style Twemoji: https://github.com/twitter/twemoji#inline-styles */
|
|
2497
|
-
|
|
2498
2989
|
return `
|
|
2499
2990
|
margin: 0 ${size / 20}px 0 ${size / 10}px;
|
|
2500
2991
|
transform: translateY(${size / 10 * 2}px);
|
|
@@ -2502,49 +2993,53 @@ const StyledTypographyEmoji = /*#__PURE__*/styled__default(Emoji).withConfig({
|
|
|
2502
2993
|
});
|
|
2503
2994
|
function TypographyEmoji({
|
|
2504
2995
|
emoji,
|
|
2505
|
-
base
|
|
2996
|
+
base,
|
|
2997
|
+
small,
|
|
2998
|
+
medium,
|
|
2999
|
+
large
|
|
2506
3000
|
}) {
|
|
2507
3001
|
const theme = /*#__PURE__*/styled.useTheme();
|
|
2508
|
-
const
|
|
3002
|
+
const typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
|
|
3003
|
+
const typeConfig = getTypographyTypeConfig(typeForCurrentWindowSize || 'body', theme);
|
|
3004
|
+
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
2509
3005
|
const {
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
}
|
|
2513
|
-
} = dimensions;
|
|
3006
|
+
fontSize
|
|
3007
|
+
} = typeConfig[typeConfigKey];
|
|
2514
3008
|
|
|
2515
3009
|
if ((process.env.NODE_ENV !== "production")) {
|
|
2516
3010
|
if (!fontSize.endsWith('px')) throw new Error(`Unexpected font-size value: ${fontSize}`);
|
|
2517
3011
|
}
|
|
2518
3012
|
|
|
2519
|
-
return /*#__PURE__*/
|
|
3013
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledTypographyEmoji, {
|
|
2520
3014
|
size: parseInt(fontSize.slice(0, -2), 10),
|
|
2521
3015
|
emoji: emoji
|
|
2522
3016
|
});
|
|
2523
3017
|
}
|
|
2524
3018
|
|
|
2525
|
-
const
|
|
2526
|
-
|
|
2527
|
-
|
|
3019
|
+
const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/react$1.styled("span")({
|
|
3020
|
+
name: "TypographyLinkWebWrapper",
|
|
3021
|
+
class: "tcwz3nt"
|
|
3022
|
+
}));
|
|
3023
|
+
const StyledLink = /*#__PURE__*/styled__default.Text.withConfig({
|
|
2528
3024
|
displayName: "TypographyLink__StyledLink",
|
|
2529
3025
|
componentId: "kitt-universal__sc-1o1zy30-0"
|
|
2530
|
-
})(["text-decoration:", ";", ""], ({
|
|
2531
|
-
noUnderline
|
|
2532
|
-
}) => noUnderline ? 'none' : 'underline', ({
|
|
2533
|
-
disabled
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
` : ''}`);
|
|
3026
|
+
})(["text-decoration:", ";", ";", ";"], ({
|
|
3027
|
+
$noUnderline
|
|
3028
|
+
}) => $noUnderline ? 'none' : 'underline', ({
|
|
3029
|
+
$disabled
|
|
3030
|
+
}) => {
|
|
3031
|
+
return `
|
|
3032
|
+
text-decoration-color: inherit;
|
|
3033
|
+
transition: color 0.2s ease-in-out;
|
|
3034
|
+
cursor: ${$disabled ? 'not-allowed' : 'pointer'};
|
|
3035
|
+
`;
|
|
3036
|
+
}, ({
|
|
3037
|
+
$disabled,
|
|
3038
|
+
theme
|
|
3039
|
+
}) => {
|
|
3040
|
+
if (!$disabled) return undefined;
|
|
3041
|
+
return `color: ${theme.kitt.typography.link.disabledColor};`;
|
|
3042
|
+
});
|
|
2548
3043
|
function TypographyLink({
|
|
2549
3044
|
children,
|
|
2550
3045
|
disabled,
|
|
@@ -2554,16 +3049,26 @@ function TypographyLink({
|
|
|
2554
3049
|
onPress,
|
|
2555
3050
|
...otherProps
|
|
2556
3051
|
}) {
|
|
2557
|
-
return /*#__PURE__*/
|
|
2558
|
-
accessibilityRole: "none"
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
3052
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography, { ...otherProps,
|
|
3053
|
+
accessibilityRole: "none",
|
|
3054
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
3055
|
+
as: TypographyLinkWebWrapper,
|
|
3056
|
+
"data-nounderline": noUnderline ? true : undefined,
|
|
3057
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledLink, {
|
|
3058
|
+
$disabled: disabled,
|
|
3059
|
+
$noUnderline: noUnderline,
|
|
3060
|
+
href: href,
|
|
3061
|
+
hrefAttrs: hrefAttrs,
|
|
3062
|
+
accessibilityRole: "link",
|
|
3063
|
+
dataSet: {
|
|
3064
|
+
// remove data-kitt-universal when we delete kitt web. See See :global(a) in Link styles.module.css
|
|
3065
|
+
'kitt-universal': 'true'
|
|
3066
|
+
},
|
|
3067
|
+
onPress: disabled ? undefined : onPress,
|
|
3068
|
+
children: children
|
|
3069
|
+
})
|
|
3070
|
+
})
|
|
3071
|
+
});
|
|
2567
3072
|
}
|
|
2568
3073
|
|
|
2569
3074
|
function matchWindowSize(currentWidth, {
|
|
@@ -2607,7 +3112,7 @@ function useKittTheme() {
|
|
|
2607
3112
|
const {
|
|
2608
3113
|
width
|
|
2609
3114
|
} = reactNative.useWindowDimensions();
|
|
2610
|
-
return
|
|
3115
|
+
return react.useMemo(() => {
|
|
2611
3116
|
return {
|
|
2612
3117
|
kitt: theme,
|
|
2613
3118
|
responsive: createWindowSizeHelper(width),
|
|
@@ -2620,9 +3125,10 @@ function KittThemeProvider({
|
|
|
2620
3125
|
children
|
|
2621
3126
|
}) {
|
|
2622
3127
|
const theme = useKittTheme();
|
|
2623
|
-
return /*#__PURE__*/
|
|
2624
|
-
theme: theme
|
|
2625
|
-
|
|
3128
|
+
return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
3129
|
+
theme: theme,
|
|
3130
|
+
children: children
|
|
3131
|
+
});
|
|
2626
3132
|
}
|
|
2627
3133
|
const KittThemeDecorator = addons.makeDecorator({
|
|
2628
3134
|
name: 'ThemeDecorator',
|
|
@@ -2631,18 +3137,9 @@ const KittThemeDecorator = addons.makeDecorator({
|
|
|
2631
3137
|
options = {},
|
|
2632
3138
|
parameters = {}
|
|
2633
3139
|
}) => {
|
|
2634
|
-
return /*#__PURE__*/
|
|
2635
|
-
|
|
2636
|
-
});
|
|
2637
|
-
|
|
2638
|
-
const SafeAreaProviderDecorator = addons.makeDecorator({
|
|
2639
|
-
name: 'SafeAreaProviderDecorator',
|
|
2640
|
-
parameterName: 'safeAreaProvider',
|
|
2641
|
-
wrapper: (storyFn, context, {
|
|
2642
|
-
options = {},
|
|
2643
|
-
parameters = {}
|
|
2644
|
-
}) => {
|
|
2645
|
-
return /*#__PURE__*/React__default.createElement(reactNativeSafeAreaContext.SafeAreaProvider, null, storyFn(context));
|
|
3140
|
+
return /*#__PURE__*/jsxRuntime.jsx(KittThemeProvider, {
|
|
3141
|
+
children: storyFn(context)
|
|
3142
|
+
});
|
|
2646
3143
|
}
|
|
2647
3144
|
});
|
|
2648
3145
|
|
|
@@ -2652,7 +3149,9 @@ function MatchWindowSize({
|
|
|
2652
3149
|
}) {
|
|
2653
3150
|
const match = useMatchWindowSize(matchWindowSizeOptions);
|
|
2654
3151
|
if (!match) return null;
|
|
2655
|
-
return /*#__PURE__*/
|
|
3152
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3153
|
+
children: children
|
|
3154
|
+
});
|
|
2656
3155
|
}
|
|
2657
3156
|
|
|
2658
3157
|
exports.useWindowSize = reactNative.useWindowDimensions;
|
|
@@ -2680,14 +3179,7 @@ exports.MatchWindowSize = MatchWindowSize;
|
|
|
2680
3179
|
exports.Message = Message;
|
|
2681
3180
|
exports.Modal = Modal;
|
|
2682
3181
|
exports.Notification = Notification;
|
|
2683
|
-
exports.PrimitiveImage = PrimitiveImage;
|
|
2684
|
-
exports.PrimitiveLink = PrimitiveLink;
|
|
2685
|
-
exports.PrimitivePressable = PrimitivePressable;
|
|
2686
|
-
exports.PrimitiveScrollView = PrimitiveScrollView;
|
|
2687
|
-
exports.PrimitiveText = PrimitiveText;
|
|
2688
|
-
exports.PrimitiveView = PrimitiveView;
|
|
2689
3182
|
exports.Radio = Radio;
|
|
2690
|
-
exports.SafeAreaProviderDecorator = SafeAreaProviderDecorator;
|
|
2691
3183
|
exports.Section = DeprecatedSection;
|
|
2692
3184
|
exports.Story = Story;
|
|
2693
3185
|
exports.StoryBlock = StoryBlock;
|
|
@@ -2698,6 +3190,7 @@ exports.StorySection = StorySection;
|
|
|
2698
3190
|
exports.StoryTitle = StoryTitle;
|
|
2699
3191
|
exports.Tag = Tag;
|
|
2700
3192
|
exports.TextArea = TextArea;
|
|
3193
|
+
exports.TimePicker = TimePicker;
|
|
2701
3194
|
exports.Tooltip = Tooltip;
|
|
2702
3195
|
exports.Typography = Typography;
|
|
2703
3196
|
exports.TypographyEmoji = TypographyEmoji;
|