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