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