@ornikar/kitt-universal 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/definitions/Avatar/Avatar.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts +1 -1
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContainer.d.ts +3 -3
- package/dist/definitions/Button/ButtonContainer.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts +2 -1
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/Card/Card.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 +2 -5
- package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
- package/dist/definitions/IconButton/IconButton.d.ts +11 -0
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -0
- package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts +13 -0
- package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts.map +1 -0
- package/dist/definitions/IconButton/PressableIconButton.d.ts +8 -0
- package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -0
- package/dist/definitions/ListItem/ListItem.d.ts +5 -3
- 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 +4 -3
- package/dist/definitions/ListItem/ListItemSideContent.d.ts.map +1 -1
- package/dist/definitions/Loader/LargeLoader.web.d.ts.map +1 -1
- package/dist/definitions/Message/Message.d.ts.map +1 -1
- package/dist/definitions/Modal/Body.d.ts +2 -4
- 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 +2 -2
- package/dist/definitions/Modal/Modal.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 +6 -3
- package/dist/definitions/Tag/Tag.d.ts.map +1 -1
- package/dist/definitions/forms/InputField/InputField.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputText.d.ts +0 -1
- package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/forms/Radio/Radio.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +15 -1
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveLink.d.ts +11 -0
- package/dist/definitions/primitives/PrimitiveLink.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveLink.web.d.ts +4 -0
- package/dist/definitions/primitives/PrimitiveLink.web.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitivePressable.d.ts +16 -0
- package/dist/definitions/primitives/PrimitivePressable.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitivePressable.web.d.ts +4 -0
- package/dist/definitions/primitives/PrimitivePressable.web.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveScrollView.d.ts +8 -0
- package/dist/definitions/primitives/PrimitiveScrollView.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveScrollView.web.d.ts +4 -0
- package/dist/definitions/primitives/PrimitiveScrollView.web.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveText.d.ts +14 -0
- package/dist/definitions/primitives/PrimitiveText.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveText.web.d.ts +6 -0
- package/dist/definitions/primitives/PrimitiveText.web.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveView.d.ts +21 -0
- package/dist/definitions/primitives/PrimitiveView.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveView.web.d.ts +23 -0
- package/dist/definitions/primitives/PrimitiveView.web.d.ts.map +1 -0
- package/dist/definitions/primitives/helpers.d.ts +7 -0
- package/dist/definitions/primitives/helpers.d.ts.map +1 -0
- package/dist/definitions/primitives/reset.d.ts +2 -0
- package/dist/definitions/primitives/reset.d.ts.map +1 -0
- package/dist/definitions/story-components/Flex.d.ts +9 -0
- package/dist/definitions/story-components/Flex.d.ts.map +1 -0
- package/dist/definitions/story-components/Story.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryBlock.d.ts +11 -0
- package/dist/definitions/story-components/StoryBlock.d.ts.map +1 -0
- package/dist/definitions/story-components/StoryContainer.d.ts +9 -0
- package/dist/definitions/story-components/StoryContainer.d.ts.map +1 -0
- package/dist/definitions/story-components/StoryContainer.web.d.ts +4 -0
- package/dist/definitions/story-components/StoryContainer.web.d.ts.map +1 -0
- package/dist/definitions/story-components/StoryGrid.d.ts +2 -1
- package/dist/definitions/story-components/StoryGrid.d.ts.map +1 -1
- package/dist/definitions/story-components/StorySection.d.ts +23 -0
- package/dist/definitions/story-components/StorySection.d.ts.map +1 -0
- package/dist/definitions/story-components/StoryTitle.d.ts.map +1 -1
- package/dist/definitions/story-components/index.d.ts +10 -1
- package/dist/definitions/story-components/index.d.ts.map +1 -1
- package/dist/definitions/story-components/theme.d.ts +2 -0
- package/dist/definitions/story-components/theme.d.ts.map +1 -0
- package/dist/definitions/themes/default.d.ts +64 -3
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts +8 -0
- package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/iconButton.d.ts +36 -0
- package/dist/definitions/themes/late-ocean/iconButton.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts +30 -3
- package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +3 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +9 -3
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts +6 -4
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/definitions/utils/tests/styled-component-typing-test.d.ts +18 -0
- package/dist/definitions/utils/tests/styled-component-typing-test.d.ts.map +1 -0
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts +2 -2
- package/dist/index-browser-all.es.android.js +658 -161
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +658 -161
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +694 -153
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +804 -182
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +712 -135
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +10 -5
- package/dist/definitions/story-components/Section.d.ts +0 -18
- package/dist/definitions/story-components/Section.d.ts.map +0 -1
- package/dist/styles.css +0 -117
|
@@ -2,24 +2,129 @@ import _extends from '@babel/runtime/helpers/extends';
|
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import { UserIcon, EyeIcon, EyeOffIcon, LoaderIcon, XIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon } from '@ornikar/kitt-icons';
|
|
4
4
|
export * from '@ornikar/kitt-icons';
|
|
5
|
-
import React, {
|
|
6
|
-
import { Image,
|
|
5
|
+
import React, { createContext, forwardRef, useContext, useState, Fragment, useMemo } from 'react';
|
|
6
|
+
import { Image, TextInput, useWindowDimensions, TouchableOpacity, StyleSheet, Modal as Modal$1 } from 'react-native';
|
|
7
7
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
8
|
-
import styled, { useTheme,
|
|
8
|
+
import styled, { css, keyframes, useTheme, ThemeProvider } from 'styled-components';
|
|
9
9
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
10
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
10
|
+
import { useSafeAreaInsets, SafeAreaProvider } from 'react-native-safe-area-context';
|
|
11
|
+
import 'react-native-reanimated';
|
|
11
12
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
13
|
+
import { makeDecorator } from '@storybook/addons';
|
|
12
14
|
|
|
13
|
-
var
|
|
15
|
+
var resetMixin = /*#__PURE__*/css(["border:0 solid black;box-sizing:border-box;margin:0;padding:0;"]);
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
var mapAccessibilityRoleToAriaRole = {
|
|
18
|
+
header: 'heading',
|
|
19
|
+
none: 'presentation',
|
|
20
|
+
paragraph: 'paragraph'
|
|
21
|
+
};
|
|
22
|
+
var PrimitiveTextAncestorContext = /*#__PURE__*/createContext(false);
|
|
23
|
+
var PrimitiveTextWithClassName$1 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
24
|
+
var children = _ref.children,
|
|
25
|
+
className = _ref.className,
|
|
26
|
+
accessibilityRole = _ref.accessibilityRole,
|
|
27
|
+
accessibilityRoleDescription = _ref.accessibilityRoleDescription,
|
|
28
|
+
accessibilityLevel = _ref.accessibilityLevel;
|
|
29
|
+
_ref.selectable;
|
|
30
|
+
_ref.numberOfLines;
|
|
31
|
+
var hasTextAncestor = React.useContext(PrimitiveTextAncestorContext);
|
|
32
|
+
var Component = hasTextAncestor ? 'span' : 'div';
|
|
33
|
+
|
|
34
|
+
if (accessibilityRole === 'header' && accessibilityLevel && accessibilityLevel < 7) {
|
|
35
|
+
Component = "h".concat(accessibilityLevel); // eslint-disable-next-line no-param-reassign
|
|
36
|
+
|
|
37
|
+
accessibilityRole = undefined; // eslint-disable-next-line no-param-reassign
|
|
38
|
+
|
|
39
|
+
accessibilityLevel = undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var element = /*#__PURE__*/React.createElement(Component, {
|
|
43
|
+
ref: ref,
|
|
44
|
+
className: className,
|
|
45
|
+
role: accessibilityRole ? mapAccessibilityRoleToAriaRole[accessibilityRole] : undefined,
|
|
46
|
+
"aria-roledescription": accessibilityRoleDescription,
|
|
47
|
+
"aria-level": accessibilityLevel
|
|
19
48
|
}, children);
|
|
49
|
+
return hasTextAncestor ? element : /*#__PURE__*/React.createElement(PrimitiveTextAncestorContext.Provider, {
|
|
50
|
+
value: true
|
|
51
|
+
}, element);
|
|
52
|
+
});
|
|
53
|
+
var textResetMixin = /*#__PURE__*/css(["", " display:inline;white-space:pre-wrap;word-wrap:break-word;color:inherit;font:inherit;"], resetMixin);
|
|
54
|
+
var PrimitiveText = /*#__PURE__*/styled(PrimitiveTextWithClassName$1).withConfig({
|
|
55
|
+
displayName: "PrimitiveTextweb__PrimitiveText",
|
|
56
|
+
componentId: "kitt-universal__sc-8bfguf-0"
|
|
57
|
+
})(["", " ", ";", ""], textResetMixin, function (_ref2) {
|
|
58
|
+
var selectable = _ref2.selectable;
|
|
59
|
+
return selectable == null ? undefined : "user-select: ".concat(selectable ? 'text' : 'none');
|
|
60
|
+
}, function (_ref3) {
|
|
61
|
+
var numberOfLines = _ref3.numberOfLines;
|
|
62
|
+
return numberOfLines ? "\n display: -webkit-box;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-line-clamp: ".concat(numberOfLines, ";\n -webkit-box-orient: vertical;\n line-clamp: ").concat(numberOfLines, ";\n ") : '';
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
function createPressClickHandler(onPress) {
|
|
66
|
+
if (!onPress) return undefined;
|
|
67
|
+
return function (event) {
|
|
68
|
+
event.stopPropagation();
|
|
69
|
+
onPress(event);
|
|
70
|
+
};
|
|
20
71
|
}
|
|
21
72
|
|
|
22
|
-
var
|
|
73
|
+
var isValidKeyPress = function (_ref) {
|
|
74
|
+
var key = _ref.key,
|
|
75
|
+
target = _ref.target;
|
|
76
|
+
var role = target.getAttribute('role');
|
|
77
|
+
return key === 'Enter' || (key === ' ' || key === 'Spacebar') && role === 'button';
|
|
78
|
+
}; // https://github.com/necolas/react-native-web/blob/b2eb3ca03ffc4b8570591b6c2082c6e4edae0e7f/packages/react-native-web/src/modules/usePressEvents/PressResponder.js#L300-L322
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
function createPressKeyUpHandler(onPress) {
|
|
82
|
+
if (!onPress) return undefined;
|
|
83
|
+
return function (event) {
|
|
84
|
+
if (isValidKeyPress(event)) {
|
|
85
|
+
onPress(event);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var StyledDiv = /*#__PURE__*/styled('div').withConfig({
|
|
91
|
+
displayName: "PrimitiveViewweb__StyledDiv",
|
|
92
|
+
componentId: "kitt-universal__sc-1t2oiuz-0"
|
|
93
|
+
})(["", " align-items:stretch;display:", ";flex-basis:auto;flex-direction:column;flex-shrink:0;min-height:0;min-width:0;position:'relative';z-index:0;"], resetMixin, function (_ref) {
|
|
94
|
+
var hasTextAncestor = _ref.hasTextAncestor;
|
|
95
|
+
return hasTextAncestor ? 'inline-flex' : 'flex';
|
|
96
|
+
});
|
|
97
|
+
var PrimitiveView = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
98
|
+
var children = _ref2.children,
|
|
99
|
+
className = _ref2.className,
|
|
100
|
+
style = _ref2.style,
|
|
101
|
+
accessibilityRole = _ref2.accessibilityRole,
|
|
102
|
+
nativeID = _ref2.nativeID,
|
|
103
|
+
testID = _ref2.testID,
|
|
104
|
+
tabIndex = _ref2.tabIndex,
|
|
105
|
+
onPress = _ref2.onPress;
|
|
106
|
+
var hasTextAncestor = React.useContext(PrimitiveTextAncestorContext);
|
|
107
|
+
return /*#__PURE__*/React.createElement(StyledDiv, {
|
|
108
|
+
ref: ref,
|
|
109
|
+
hasTextAncestor: hasTextAncestor,
|
|
110
|
+
id: nativeID,
|
|
111
|
+
className: className,
|
|
112
|
+
style: style,
|
|
113
|
+
"data-testid": testID,
|
|
114
|
+
role: accessibilityRole,
|
|
115
|
+
tabIndex: tabIndex,
|
|
116
|
+
onClick: createPressClickHandler(onPress),
|
|
117
|
+
onKeyUp: createPressKeyUpHandler(onPress)
|
|
118
|
+
}, children);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
var spin = /*#__PURE__*/keyframes(["0%{transform:rotate(-1deg);}100%{transform:rotate(359deg);}"]);
|
|
122
|
+
var SpinningIcon = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
123
|
+
displayName: "SpinningIconweb__SpinningIcon",
|
|
124
|
+
componentId: "kitt-universal__sc-xgsnek-0"
|
|
125
|
+
})(["animation:", " 1.1s infinite linear;"], spin);
|
|
126
|
+
|
|
127
|
+
var IconContainer$2 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
23
128
|
displayName: "Icon__IconContainer",
|
|
24
129
|
componentId: "kitt-universal__sc-usm0ol-0"
|
|
25
130
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
@@ -53,13 +158,13 @@ function Icon(_ref5) {
|
|
|
53
158
|
}, spin ? /*#__PURE__*/React.createElement(SpinningIcon, null, clonedIcon) : clonedIcon);
|
|
54
159
|
}
|
|
55
160
|
|
|
56
|
-
var _excluded$
|
|
161
|
+
var _excluded$a = ["accessibilityRole", "base", "variant", "color"];
|
|
57
162
|
var TypographyTypeContext = /*#__PURE__*/createContext(undefined);
|
|
58
163
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
59
164
|
function useTypographyColor() {
|
|
60
165
|
return useContext(TypographyColorContext);
|
|
61
166
|
}
|
|
62
|
-
var StyledTypography = /*#__PURE__*/styled.
|
|
167
|
+
var StyledTypography = /*#__PURE__*/styled(PrimitiveText).withConfig({
|
|
63
168
|
displayName: "Typography__StyledTypography",
|
|
64
169
|
componentId: "kitt-universal__sc-1dz700q-0"
|
|
65
170
|
})(["", " ", ""], function (_ref) {
|
|
@@ -88,11 +193,11 @@ var isTypographyHeader = function (base, typeInContext) {
|
|
|
88
193
|
};
|
|
89
194
|
|
|
90
195
|
function Typography(_ref3) {
|
|
91
|
-
_ref3.accessibilityRole
|
|
92
|
-
|
|
196
|
+
var accessibilityRole = _ref3.accessibilityRole,
|
|
197
|
+
base = _ref3.base,
|
|
93
198
|
variant = _ref3.variant,
|
|
94
199
|
color = _ref3.color,
|
|
95
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded$
|
|
200
|
+
otherProps = _objectWithoutProperties(_ref3, _excluded$a);
|
|
96
201
|
|
|
97
202
|
var typeInContext = useContext(TypographyTypeContext);
|
|
98
203
|
var isHeader = isTypographyHeader(base, typeInContext);
|
|
@@ -107,11 +212,13 @@ function Typography(_ref3) {
|
|
|
107
212
|
color: colorWithDefaultToBlack,
|
|
108
213
|
isHeader: isHeader,
|
|
109
214
|
type: base,
|
|
110
|
-
variant: nonNullableVariant
|
|
215
|
+
variant: nonNullableVariant,
|
|
216
|
+
accessibilityRole: accessibilityRole || undefined
|
|
111
217
|
}, otherProps))) : /*#__PURE__*/React.createElement(StyledTypography, _extends({
|
|
112
218
|
color: colorWithDefaultToBlack,
|
|
113
219
|
isHeader: isHeader,
|
|
114
|
-
variant: nonNullableVariant
|
|
220
|
+
variant: nonNullableVariant,
|
|
221
|
+
accessibilityRole: accessibilityRole || undefined
|
|
115
222
|
}, otherProps));
|
|
116
223
|
return color ? /*#__PURE__*/React.createElement(TypographyColorContext.Provider, {
|
|
117
224
|
value: color
|
|
@@ -125,19 +232,19 @@ function TypographyText(props) {
|
|
|
125
232
|
}
|
|
126
233
|
|
|
127
234
|
function TypographyParagraph(props) {
|
|
128
|
-
// @ts-expect-error paragraph is not allowed in react-native but exists in react-native-web
|
|
129
235
|
return /*#__PURE__*/React.createElement(Typography, _extends({
|
|
130
236
|
accessibilityRole: "paragraph"
|
|
131
237
|
}, props));
|
|
132
238
|
}
|
|
133
239
|
|
|
134
|
-
var createHeading = function (level) {
|
|
240
|
+
var createHeading = function (level, defaultBase) {
|
|
135
241
|
// https://github.com/necolas/react-native-web/issues/401
|
|
136
242
|
function TypographyHeading(props) {
|
|
137
243
|
return /*#__PURE__*/React.createElement(Typography, _extends({
|
|
138
|
-
accessibilityRole: "header"
|
|
244
|
+
accessibilityRole: "header",
|
|
245
|
+
base: defaultBase
|
|
139
246
|
}, props, {
|
|
140
|
-
|
|
247
|
+
accessibilityLevel: level
|
|
141
248
|
}));
|
|
142
249
|
}
|
|
143
250
|
|
|
@@ -147,13 +254,29 @@ var createHeading = function (level) {
|
|
|
147
254
|
|
|
148
255
|
Typography.Text = TypographyText;
|
|
149
256
|
Typography.Paragraph = TypographyParagraph;
|
|
150
|
-
Typography.
|
|
151
|
-
Typography.
|
|
152
|
-
Typography.
|
|
153
|
-
Typography.
|
|
154
|
-
Typography.
|
|
257
|
+
Typography.Header1 = createHeading(1);
|
|
258
|
+
Typography.Header2 = createHeading(2);
|
|
259
|
+
Typography.Header3 = createHeading(3);
|
|
260
|
+
Typography.Header4 = createHeading(4);
|
|
261
|
+
Typography.Header5 = createHeading(5);
|
|
262
|
+
Typography.Header6 = createHeading(6);
|
|
263
|
+
/** @deprecated use Typography.Header1 */
|
|
264
|
+
|
|
265
|
+
Typography.h1 = createHeading(1, 'header1');
|
|
266
|
+
/** @deprecated use Typography.Header2 */
|
|
267
|
+
|
|
268
|
+
Typography.h2 = createHeading(2, 'header2');
|
|
269
|
+
/** @deprecated use Typography.Header3 */
|
|
270
|
+
|
|
271
|
+
Typography.h3 = createHeading(3, 'header3');
|
|
272
|
+
/** @deprecated use Typography.Header4 */
|
|
273
|
+
|
|
274
|
+
Typography.h4 = createHeading(4, 'header4');
|
|
275
|
+
/** @deprecated use Typography.Header6 */
|
|
155
276
|
|
|
156
|
-
|
|
277
|
+
Typography.h5 = createHeading(5, 'header5');
|
|
278
|
+
|
|
279
|
+
var _excluded$9 = ["size"];
|
|
157
280
|
|
|
158
281
|
var getFirstCharacter = function (string) {
|
|
159
282
|
return string ? string[0] : '';
|
|
@@ -163,7 +286,7 @@ var getInitials = function (firstname, lastname) {
|
|
|
163
286
|
return (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
|
|
164
287
|
};
|
|
165
288
|
|
|
166
|
-
var StyledAvatarView = /*#__PURE__*/styled.
|
|
289
|
+
var StyledAvatarView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
167
290
|
displayName: "Avatar__StyledAvatarView",
|
|
168
291
|
componentId: "kitt-universal__sc-9miubv-0"
|
|
169
292
|
})(["border-radius:", "px;background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
@@ -220,7 +343,7 @@ function AvatarContent(_ref5) {
|
|
|
220
343
|
function Avatar(_ref6) {
|
|
221
344
|
var _ref6$size = _ref6.size,
|
|
222
345
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
223
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
346
|
+
rest = _objectWithoutProperties(_ref6, _excluded$9);
|
|
224
347
|
|
|
225
348
|
return /*#__PURE__*/React.createElement(StyledAvatarView, _extends({}, rest, {
|
|
226
349
|
size: size
|
|
@@ -229,7 +352,55 @@ function Avatar(_ref6) {
|
|
|
229
352
|
})));
|
|
230
353
|
}
|
|
231
354
|
|
|
232
|
-
var
|
|
355
|
+
var getTabIndex = function (_ref) {
|
|
356
|
+
var focusable = _ref.focusable,
|
|
357
|
+
disabled = _ref.disabled;
|
|
358
|
+
if (disabled) return -1;
|
|
359
|
+
if (focusable === false) return -1;
|
|
360
|
+
return 0;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
var handlePressPreventDefault = function (e) {
|
|
364
|
+
e.preventDefault();
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
var PrimitivePressableWithClassName = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
368
|
+
var disabled = _ref2.disabled,
|
|
369
|
+
focusable = _ref2.focusable,
|
|
370
|
+
children = _ref2.children,
|
|
371
|
+
className = _ref2.className,
|
|
372
|
+
accessibilityRole = _ref2.accessibilityRole,
|
|
373
|
+
nativeID = _ref2.nativeID,
|
|
374
|
+
testID = _ref2.testID,
|
|
375
|
+
onPress = _ref2.onPress;
|
|
376
|
+
return /*#__PURE__*/React.createElement(PrimitiveView, {
|
|
377
|
+
ref: ref,
|
|
378
|
+
nativeID: nativeID,
|
|
379
|
+
testID: testID,
|
|
380
|
+
className: className,
|
|
381
|
+
"aria-disabled": !!disabled,
|
|
382
|
+
accessibilityRole: accessibilityRole
|
|
383
|
+
/* https://necolas.github.io/react-native-web/docs/accessibility/#keyboard-focus */
|
|
384
|
+
,
|
|
385
|
+
tabIndex: getTabIndex({
|
|
386
|
+
focusable: focusable,
|
|
387
|
+
disabled: disabled
|
|
388
|
+
}),
|
|
389
|
+
onPress: disabled ? handlePressPreventDefault : onPress
|
|
390
|
+
}, children);
|
|
391
|
+
});
|
|
392
|
+
var PrimitivePressable = /*#__PURE__*/styled(PrimitivePressableWithClassName).withConfig({
|
|
393
|
+
displayName: "PrimitivePressableweb__PrimitivePressable",
|
|
394
|
+
componentId: "kitt-universal__sc-1pzco2e-0"
|
|
395
|
+
})(["cursor:", ";touch-action:", ";"], function (_ref3) {
|
|
396
|
+
var disabled = _ref3.disabled;
|
|
397
|
+
return disabled ? 'not-allowed' : 'pointer';
|
|
398
|
+
}, function (_ref4) {
|
|
399
|
+
var disabled = _ref4.disabled;
|
|
400
|
+
return disabled ? 'none' : 'manipulation';
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
var ButtonContainer = /*#__PURE__*/styled(PrimitivePressable).withConfig({
|
|
233
404
|
displayName: "ButtonContainer",
|
|
234
405
|
componentId: "kitt-universal__sc-ofbpwm-0"
|
|
235
406
|
})(["min-width:", ";max-width:", ";width:", ";min-height:", ";background-color:", ";padding:", ";flex-direction:row;align-self:flex-start;border-radius:", ";border-color:", ";border-width:", ";"], function (_ref) {
|
|
@@ -272,7 +443,7 @@ var ButtonContainer = /*#__PURE__*/styled.Pressable.withConfig({
|
|
|
272
443
|
return theme.kitt.button.borderWidth;
|
|
273
444
|
});
|
|
274
445
|
|
|
275
|
-
var _excluded$
|
|
446
|
+
var _excluded$8 = ["color"],
|
|
276
447
|
_excluded2$2 = ["color"];
|
|
277
448
|
|
|
278
449
|
function TypographyIconInheritColor(props) {
|
|
@@ -285,7 +456,7 @@ function TypographyIconInheritColor(props) {
|
|
|
285
456
|
|
|
286
457
|
function TypographyIconSpecifiedColor(_ref) {
|
|
287
458
|
var color = _ref.color,
|
|
288
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
459
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$8);
|
|
289
460
|
|
|
290
461
|
var theme = /*#__PURE__*/useTheme();
|
|
291
462
|
return /*#__PURE__*/React.createElement(Icon, _extends({}, otherProps, {
|
|
@@ -329,7 +500,7 @@ var ButtonText = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
|
329
500
|
displayName: "ButtonContent__ButtonText",
|
|
330
501
|
componentId: "kitt-universal__sc-dnyw3n-0"
|
|
331
502
|
})(["text-align:center;"]);
|
|
332
|
-
var Content$1 = /*#__PURE__*/styled.
|
|
503
|
+
var Content$1 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
333
504
|
displayName: "ButtonContent__Content",
|
|
334
505
|
componentId: "kitt-universal__sc-dnyw3n-1"
|
|
335
506
|
})(["flex-direction:row;align-items:center;justify-content:center;flex:", ";"], function (_ref) {
|
|
@@ -337,7 +508,7 @@ var Content$1 = /*#__PURE__*/styled.View.withConfig({
|
|
|
337
508
|
iconOnly = _ref.iconOnly;
|
|
338
509
|
return "".concat(stretch || iconOnly ? 1 : 0, " 1 auto");
|
|
339
510
|
});
|
|
340
|
-
var IconContainer$1 = /*#__PURE__*/styled.
|
|
511
|
+
var IconContainer$1 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
341
512
|
displayName: "ButtonContent__IconContainer",
|
|
342
513
|
componentId: "kitt-universal__sc-dnyw3n-2"
|
|
343
514
|
})(["", ""], function (_ref2) {
|
|
@@ -387,7 +558,7 @@ function ButtonContent(_ref4) {
|
|
|
387
558
|
size: theme.kitt.button.iconSize
|
|
388
559
|
};
|
|
389
560
|
|
|
390
|
-
if (process.env.NODE_ENV !== "production") {
|
|
561
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
391
562
|
if (!(children || icon)) {
|
|
392
563
|
throw new Error('kitt(Button): You should provide at least a children or a icon');
|
|
393
564
|
}
|
|
@@ -475,7 +646,7 @@ function Button(_ref) {
|
|
|
475
646
|
}), children));
|
|
476
647
|
}
|
|
477
648
|
|
|
478
|
-
var Container$5 = /*#__PURE__*/styled.
|
|
649
|
+
var Container$5 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
479
650
|
displayName: "Card__Container",
|
|
480
651
|
componentId: "kitt-universal__sc-1n9psug-0"
|
|
481
652
|
})(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], function (_ref) {
|
|
@@ -573,11 +744,11 @@ var KittBreakpointsMax = {
|
|
|
573
744
|
LARGE: KittBreakpoints.WIDE - 1
|
|
574
745
|
};
|
|
575
746
|
|
|
576
|
-
var FieldContainer = /*#__PURE__*/styled.
|
|
747
|
+
var FieldContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
577
748
|
displayName: "InputField__FieldContainer",
|
|
578
749
|
componentId: "kitt-universal__sc-13fkixs-0"
|
|
579
750
|
})(["padding:5px 0 10px;"]);
|
|
580
|
-
var FeedbackContainer = /*#__PURE__*/styled.
|
|
751
|
+
var FeedbackContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
581
752
|
displayName: "InputField__FeedbackContainer",
|
|
582
753
|
componentId: "kitt-universal__sc-13fkixs-1"
|
|
583
754
|
})(["", ";"], function (_ref) {
|
|
@@ -586,14 +757,14 @@ var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
|
|
|
586
757
|
minWidth: KittBreakpoints.SMALL
|
|
587
758
|
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
588
759
|
});
|
|
589
|
-
var FieldLabelContainer = /*#__PURE__*/styled.
|
|
760
|
+
var FieldLabelContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
590
761
|
displayName: "InputField__FieldLabelContainer",
|
|
591
762
|
componentId: "kitt-universal__sc-13fkixs-2"
|
|
592
763
|
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
593
764
|
var theme = _ref2.theme;
|
|
594
765
|
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
595
766
|
});
|
|
596
|
-
var LabelContainer = /*#__PURE__*/styled.
|
|
767
|
+
var LabelContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
597
768
|
displayName: "InputField__LabelContainer",
|
|
598
769
|
componentId: "kitt-universal__sc-13fkixs-3"
|
|
599
770
|
})(["margin-right:", "px;"], function (_ref3) {
|
|
@@ -636,7 +807,7 @@ var useInputText = function () {
|
|
|
636
807
|
};
|
|
637
808
|
};
|
|
638
809
|
|
|
639
|
-
var _excluded$
|
|
810
|
+
var _excluded$7 = ["id", "minHeight", "type", "state", "internalForceState", "disabled", "onFocus", "onBlur"];
|
|
640
811
|
var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", ";border-radius:", ";border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
|
|
641
812
|
var theme = _ref.theme,
|
|
642
813
|
state = _ref.state;
|
|
@@ -662,7 +833,7 @@ var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width
|
|
|
662
833
|
var theme = _ref7.theme;
|
|
663
834
|
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
664
835
|
});
|
|
665
|
-
var Input = /*#__PURE__*/styled
|
|
836
|
+
var Input = /*#__PURE__*/styled(TextInput).withConfig({
|
|
666
837
|
displayName: "InputText__Input",
|
|
667
838
|
componentId: "kitt-universal__sc-uke279-0"
|
|
668
839
|
})(["", " padding:", ";line-height:", ";min-height:", "px;"], styledTextInputMixin, function (_ref8) {
|
|
@@ -677,7 +848,7 @@ var Input = /*#__PURE__*/styled.TextInput.withConfig({
|
|
|
677
848
|
var minHeight = _ref10.minHeight;
|
|
678
849
|
return minHeight;
|
|
679
850
|
});
|
|
680
|
-
var Container$4 = /*#__PURE__*/styled.
|
|
851
|
+
var Container$4 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
681
852
|
displayName: "InputText__Container",
|
|
682
853
|
componentId: "kitt-universal__sc-uke279-1"
|
|
683
854
|
})(["margin-top:", ";margin-bottom:", ";"], function (_ref11) {
|
|
@@ -687,7 +858,7 @@ var Container$4 = /*#__PURE__*/styled.View.withConfig({
|
|
|
687
858
|
var theme = _ref12.theme;
|
|
688
859
|
return theme.kitt.forms.input.marginBottom;
|
|
689
860
|
});
|
|
690
|
-
var PasswordButtonContainer = /*#__PURE__*/styled.
|
|
861
|
+
var PasswordButtonContainer = /*#__PURE__*/styled(PrimitivePressable).withConfig({
|
|
691
862
|
displayName: "InputText__PasswordButtonContainer",
|
|
692
863
|
componentId: "kitt-universal__sc-uke279-2"
|
|
693
864
|
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:", "px;"], function (_ref13) {
|
|
@@ -740,7 +911,7 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
740
911
|
disabled = _ref15$disabled === void 0 ? false : _ref15$disabled,
|
|
741
912
|
_onFocus = _ref15.onFocus,
|
|
742
913
|
_onBlur = _ref15.onBlur,
|
|
743
|
-
props = _objectWithoutProperties(_ref15, _excluded$
|
|
914
|
+
props = _objectWithoutProperties(_ref15, _excluded$7);
|
|
744
915
|
|
|
745
916
|
var _useInputText = useInputText(),
|
|
746
917
|
isFocused = _useInputText.isFocused,
|
|
@@ -778,6 +949,7 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
778
949
|
if (_onBlur) _onBlur(e);
|
|
779
950
|
}
|
|
780
951
|
})), type === 'password' && !disabled && /*#__PURE__*/React.createElement(PasswordButtonContainer, {
|
|
952
|
+
accessibilityRole: "button",
|
|
781
953
|
onPress: togglePasswordVisibility
|
|
782
954
|
}, /*#__PURE__*/React.createElement(TypographyIcon, {
|
|
783
955
|
icon: isPasswordVisible ? /*#__PURE__*/React.createElement(EyeIcon, null) : /*#__PURE__*/React.createElement(EyeOffIcon, null),
|
|
@@ -796,7 +968,7 @@ function Label(_ref) {
|
|
|
796
968
|
}, children));
|
|
797
969
|
}
|
|
798
970
|
|
|
799
|
-
var OuterRadio = /*#__PURE__*/styled.
|
|
971
|
+
var OuterRadio = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
800
972
|
displayName: "Radio__OuterRadio",
|
|
801
973
|
componentId: "kitt-universal__sc-1mdgr2o-0"
|
|
802
974
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", ";border-color:", ";"], function (_ref) {
|
|
@@ -820,7 +992,7 @@ var OuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
|
820
992
|
disabled = _ref6.disabled;
|
|
821
993
|
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor;
|
|
822
994
|
});
|
|
823
|
-
var SelectedOuterRadio = /*#__PURE__*/styled.
|
|
995
|
+
var SelectedOuterRadio = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
824
996
|
displayName: "Radio__SelectedOuterRadio",
|
|
825
997
|
componentId: "kitt-universal__sc-1mdgr2o-1"
|
|
826
998
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], function (_ref7) {
|
|
@@ -836,7 +1008,7 @@ var SelectedOuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
|
836
1008
|
var theme = _ref10.theme;
|
|
837
1009
|
return theme.kitt.forms.radio.size / 2;
|
|
838
1010
|
});
|
|
839
|
-
var SelectedInnerRadio = /*#__PURE__*/styled.
|
|
1011
|
+
var SelectedInnerRadio = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
840
1012
|
displayName: "Radio__SelectedInnerRadio",
|
|
841
1013
|
componentId: "kitt-universal__sc-1mdgr2o-2"
|
|
842
1014
|
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], function (_ref11) {
|
|
@@ -852,7 +1024,7 @@ var SelectedInnerRadio = /*#__PURE__*/styled.View.withConfig({
|
|
|
852
1024
|
var theme = _ref14.theme;
|
|
853
1025
|
return theme.kitt.forms.radio.checked.innerSize / 2;
|
|
854
1026
|
});
|
|
855
|
-
var Container$3 = /*#__PURE__*/styled.
|
|
1027
|
+
var Container$3 = /*#__PURE__*/styled(PrimitivePressable).withConfig({
|
|
856
1028
|
displayName: "Radio__Container",
|
|
857
1029
|
componentId: "kitt-universal__sc-1mdgr2o-3"
|
|
858
1030
|
})(["flex-direction:row;align-items:center;"]);
|
|
@@ -876,7 +1048,7 @@ function Radio(_ref16) {
|
|
|
876
1048
|
disabled: disabled,
|
|
877
1049
|
accessibilityRole: "radio",
|
|
878
1050
|
"aria-checked": checked,
|
|
879
|
-
|
|
1051
|
+
focusable: checked && !disabled,
|
|
880
1052
|
onPress: function handlePress() {
|
|
881
1053
|
onChange(value);
|
|
882
1054
|
}
|
|
@@ -900,7 +1072,7 @@ function TextArea(_ref) {
|
|
|
900
1072
|
}));
|
|
901
1073
|
}
|
|
902
1074
|
|
|
903
|
-
var Body = /*#__PURE__*/styled.
|
|
1075
|
+
var Body = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
904
1076
|
displayName: "Body",
|
|
905
1077
|
componentId: "kitt-universal__sc-1ofncfn-0"
|
|
906
1078
|
})(["", " background-color:", ";flex:1;"], function (_ref) {
|
|
@@ -917,7 +1089,7 @@ function FullScreenModalBody(_ref3) {
|
|
|
917
1089
|
return /*#__PURE__*/React.createElement(Body, null, children);
|
|
918
1090
|
}
|
|
919
1091
|
|
|
920
|
-
var SideContainer = /*#__PURE__*/styled.
|
|
1092
|
+
var SideContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
921
1093
|
displayName: "Header__SideContainer",
|
|
922
1094
|
componentId: "kitt-universal__sc-dfmxi1-0"
|
|
923
1095
|
})(["", ""], function (_ref) {
|
|
@@ -937,7 +1109,7 @@ function getHeaderHorizontalMediumPadding(spacing) {
|
|
|
937
1109
|
return spacing * 6;
|
|
938
1110
|
}
|
|
939
1111
|
|
|
940
|
-
var Header = /*#__PURE__*/styled.
|
|
1112
|
+
var Header = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
941
1113
|
displayName: "Header",
|
|
942
1114
|
componentId: "kitt-universal__sc-dfmxi1-1"
|
|
943
1115
|
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], function (_ref2) {
|
|
@@ -955,7 +1127,7 @@ var Header = /*#__PURE__*/styled.View.withConfig({
|
|
|
955
1127
|
var theme = _ref3.theme;
|
|
956
1128
|
return theme.kitt.fullScreenModal.header.borderColor;
|
|
957
1129
|
});
|
|
958
|
-
var HeaderContent = /*#__PURE__*/styled.
|
|
1130
|
+
var HeaderContent = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
959
1131
|
displayName: "Header__HeaderContent",
|
|
960
1132
|
componentId: "kitt-universal__sc-dfmxi1-2"
|
|
961
1133
|
})(["", ";", ";justify-content:center;align-items:center;"], function (_ref4) {
|
|
@@ -1041,7 +1213,7 @@ function FullScreenModalHeader(_ref6) {
|
|
|
1041
1213
|
}, right) : null);
|
|
1042
1214
|
}
|
|
1043
1215
|
|
|
1044
|
-
var Container$2 = /*#__PURE__*/styled.
|
|
1216
|
+
var Container$2 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1045
1217
|
displayName: "FullScreenModal__Container",
|
|
1046
1218
|
componentId: "kitt-universal__sc-11qpbe3-0"
|
|
1047
1219
|
})(["flex:1;background-color:", ";"], function (_ref) {
|
|
@@ -1055,21 +1227,112 @@ function FullScreenModal(_ref2) {
|
|
|
1055
1227
|
FullScreenModal.Header = FullScreenModalHeader;
|
|
1056
1228
|
FullScreenModal.Body = FullScreenModalBody;
|
|
1057
1229
|
|
|
1058
|
-
var
|
|
1059
|
-
|
|
1230
|
+
var PressableIconButton = /*#__PURE__*/styled(PrimitivePressable).withConfig({
|
|
1231
|
+
displayName: "PressableIconButton",
|
|
1232
|
+
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1233
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref) {
|
|
1234
|
+
var theme = _ref.theme;
|
|
1235
|
+
return theme.kitt.iconButton.borderRadius;
|
|
1236
|
+
}, function (_ref2) {
|
|
1237
|
+
var theme = _ref2.theme;
|
|
1238
|
+
return theme.kitt.iconButton.width;
|
|
1239
|
+
}, function (_ref3) {
|
|
1240
|
+
var theme = _ref3.theme;
|
|
1241
|
+
return theme.kitt.iconButton.height;
|
|
1242
|
+
}, function (_ref4) {
|
|
1243
|
+
var theme = _ref4.theme,
|
|
1244
|
+
color = _ref4.color,
|
|
1245
|
+
disabled = _ref4.disabled;
|
|
1246
|
+
var iconButton = theme.kitt.iconButton;
|
|
1247
|
+
var transition = iconButton.transition,
|
|
1248
|
+
scale = iconButton.scale;
|
|
1249
|
+
|
|
1250
|
+
if (disabled) {
|
|
1251
|
+
return "\n background-color: ".concat(iconButton.disabled.backgroundColor, ";\n ");
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n\n &:hover,\n .kitt-hover & {\n @media (hover: none) and (pointer: coarse) {\n transform: scale(").concat(scale.base.hover, ");\n }\n\n @media(").concat(theme.breakpoints.min.mediumBreakpoint, ") {\n transform: scale(").concat(scale.medium.hover, ");\n }\n }\n\n &:active,\n .kitt-active & {\n transform: scale(").concat(scale.base.active, ");\n }\n\n &:hover,\n .kitt-hover &,\n &:focus,\n .kitt-focus &,\n &:active,\n .kitt-active & {\n background-color: ").concat(color === 'white' ? iconButton.white.pressedBackgroundColor : iconButton["default"].pressedBackgroundColor, ";\n }\n ");
|
|
1255
|
+
});
|
|
1256
|
+
|
|
1257
|
+
function WebAnimatedContainer(_ref) {
|
|
1258
|
+
var children = _ref.children,
|
|
1259
|
+
color = _ref.color,
|
|
1260
|
+
disabled = _ref.disabled,
|
|
1261
|
+
onPress = _ref.onPress;
|
|
1262
|
+
return /*#__PURE__*/React.createElement(PressableIconButton, {
|
|
1263
|
+
accessibilityRole: "button",
|
|
1264
|
+
color: color,
|
|
1265
|
+
disabled: disabled,
|
|
1266
|
+
onPress: onPress
|
|
1267
|
+
}, children);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
var PressableAnimatedContainer = WebAnimatedContainer;
|
|
1271
|
+
|
|
1272
|
+
var IconButtonContentBorder = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1273
|
+
displayName: "IconButton__IconButtonContentBorder",
|
|
1274
|
+
componentId: "kitt-universal__sc-swelbf-0"
|
|
1275
|
+
})(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], function (_ref) {
|
|
1276
|
+
var theme = _ref.theme;
|
|
1277
|
+
return "".concat(theme.kitt.iconButton.borderWidth, "px solid");
|
|
1278
|
+
}, function (_ref2) {
|
|
1279
|
+
var theme = _ref2.theme,
|
|
1280
|
+
disabled = _ref2.disabled;
|
|
1281
|
+
return disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor;
|
|
1282
|
+
}, function (_ref3) {
|
|
1283
|
+
var theme = _ref3.theme;
|
|
1284
|
+
return theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth;
|
|
1285
|
+
}, function (_ref4) {
|
|
1286
|
+
var theme = _ref4.theme;
|
|
1287
|
+
return theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth;
|
|
1288
|
+
}, function (_ref5) {
|
|
1289
|
+
var theme = _ref5.theme;
|
|
1290
|
+
return theme.kitt.iconButton.borderRadius;
|
|
1291
|
+
});
|
|
1292
|
+
|
|
1293
|
+
function IconButtonContent(_ref6) {
|
|
1294
|
+
var disabled = _ref6.disabled,
|
|
1295
|
+
color = _ref6.color,
|
|
1296
|
+
icon = _ref6.icon;
|
|
1297
|
+
return /*#__PURE__*/React.createElement(IconButtonContentBorder, {
|
|
1298
|
+
disabled: disabled
|
|
1299
|
+
}, /*#__PURE__*/React.createElement(TypographyIcon, {
|
|
1300
|
+
color: disabled ? 'black-light' : color,
|
|
1301
|
+
icon: icon
|
|
1302
|
+
}));
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
function IconButton(_ref7) {
|
|
1306
|
+
var icon = _ref7.icon,
|
|
1307
|
+
color = _ref7.color,
|
|
1308
|
+
disabled = _ref7.disabled,
|
|
1309
|
+
onPress = _ref7.onPress;
|
|
1310
|
+
return /*#__PURE__*/React.createElement(PressableAnimatedContainer, {
|
|
1311
|
+
color: color,
|
|
1312
|
+
disabled: disabled,
|
|
1313
|
+
onPress: onPress
|
|
1314
|
+
}, /*#__PURE__*/React.createElement(IconButtonContent, {
|
|
1315
|
+
disabled: disabled,
|
|
1316
|
+
color: color,
|
|
1317
|
+
icon: icon
|
|
1318
|
+
}));
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
var _excluded$6 = ["children"];
|
|
1322
|
+
var ContentView$1 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1060
1323
|
displayName: "ListItemContent__ContentView",
|
|
1061
1324
|
componentId: "kitt-universal__sc-57q0u9-0"
|
|
1062
1325
|
})(["flex:1 0 0%;align-self:center;"]);
|
|
1063
1326
|
function ListItemContent(_ref) {
|
|
1064
1327
|
var children = _ref.children,
|
|
1065
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
1328
|
+
rest = _objectWithoutProperties(_ref, _excluded$6);
|
|
1066
1329
|
|
|
1067
1330
|
return /*#__PURE__*/React.createElement(ContentView$1, rest, children);
|
|
1068
1331
|
}
|
|
1069
1332
|
|
|
1070
|
-
var _excluded$
|
|
1333
|
+
var _excluded$5 = ["children", "side"],
|
|
1071
1334
|
_excluded2$1 = ["children", "align"];
|
|
1072
|
-
var SideContainerView = /*#__PURE__*/styled.
|
|
1335
|
+
var SideContainerView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1073
1336
|
displayName: "ListItemSideContent__SideContainerView",
|
|
1074
1337
|
componentId: "kitt-universal__sc-1vajiw-0"
|
|
1075
1338
|
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
|
|
@@ -1086,13 +1349,13 @@ function ListItemSideContainer(_ref3) {
|
|
|
1086
1349
|
var children = _ref3.children,
|
|
1087
1350
|
_ref3$side = _ref3.side,
|
|
1088
1351
|
side = _ref3$side === void 0 ? 'left' : _ref3$side,
|
|
1089
|
-
rest = _objectWithoutProperties(_ref3, _excluded$
|
|
1352
|
+
rest = _objectWithoutProperties(_ref3, _excluded$5);
|
|
1090
1353
|
|
|
1091
1354
|
return /*#__PURE__*/React.createElement(SideContainerView, _extends({
|
|
1092
1355
|
side: side
|
|
1093
1356
|
}, rest), children);
|
|
1094
1357
|
}
|
|
1095
|
-
var SideContentView = /*#__PURE__*/styled.
|
|
1358
|
+
var SideContentView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1096
1359
|
displayName: "ListItemSideContent__SideContentView",
|
|
1097
1360
|
componentId: "kitt-universal__sc-1vajiw-1"
|
|
1098
1361
|
})(["align-self:", ";"], function (_ref4) {
|
|
@@ -1110,8 +1373,12 @@ function ListItemSideContent(_ref5) {
|
|
|
1110
1373
|
}, rest), children);
|
|
1111
1374
|
}
|
|
1112
1375
|
|
|
1113
|
-
var _excluded$
|
|
1114
|
-
|
|
1376
|
+
var _excluded$4 = ["children", "withPadding", "borders", "left", "right", "onPress"];
|
|
1377
|
+
|
|
1378
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
1379
|
+
|
|
1380
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1381
|
+
var ContainerView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1115
1382
|
displayName: "ListItem__ContainerView",
|
|
1116
1383
|
componentId: "kitt-universal__sc-2afp9s-0"
|
|
1117
1384
|
})(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], function (_ref) {
|
|
@@ -1149,12 +1416,19 @@ function ListItem(_ref5) {
|
|
|
1149
1416
|
borders = _ref5.borders,
|
|
1150
1417
|
left = _ref5.left,
|
|
1151
1418
|
right = _ref5.right,
|
|
1152
|
-
|
|
1419
|
+
onPress = _ref5.onPress,
|
|
1420
|
+
rest = _objectWithoutProperties(_ref5, _excluded$4);
|
|
1153
1421
|
|
|
1154
|
-
|
|
1422
|
+
var Wrapper = onPress ? PrimitivePressable : Fragment;
|
|
1423
|
+
var wrapperProps = onPress ? _objectSpread$1({
|
|
1424
|
+
accessibilityRole: 'button',
|
|
1425
|
+
onPress: onPress
|
|
1426
|
+
}, rest) : undefined;
|
|
1427
|
+
var containerProps = onPress ? undefined : rest;
|
|
1428
|
+
return /*#__PURE__*/React.createElement(Wrapper, wrapperProps, /*#__PURE__*/React.createElement(ContainerView, _extends({
|
|
1155
1429
|
withPadding: withPadding,
|
|
1156
1430
|
borders: borders
|
|
1157
|
-
}, left ? /*#__PURE__*/React.createElement(ListItemSideContainer, {
|
|
1431
|
+
}, containerProps), left ? /*#__PURE__*/React.createElement(ListItemSideContainer, {
|
|
1158
1432
|
side: "left"
|
|
1159
1433
|
}, left) : null, /*#__PURE__*/React.createElement(ListItemContent, null, children), right ? /*#__PURE__*/React.createElement(ListItemSideContainer, {
|
|
1160
1434
|
side: "right"
|
|
@@ -1164,24 +1438,43 @@ ListItem.Content = ListItemContent;
|
|
|
1164
1438
|
ListItem.SideContent = ListItemSideContent;
|
|
1165
1439
|
ListItem.SideContainer = ListItemSideContainer;
|
|
1166
1440
|
|
|
1167
|
-
var
|
|
1168
|
-
|
|
1441
|
+
var init = /*#__PURE__*/keyframes(["0%{stroke-dashoffset:169.64px;}100%{stroke-dashoffset:0;}"]);
|
|
1442
|
+
var offset = /*#__PURE__*/keyframes(["0%{stroke-dashoffset:169.64px;}100%{stroke-dashoffset:34px;}"]);
|
|
1443
|
+
var rotate = /*#__PURE__*/keyframes(["0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}"]);
|
|
1444
|
+
var LargeLoaderContainer = /*#__PURE__*/styled.div.withConfig({
|
|
1445
|
+
displayName: "LargeLoaderweb__LargeLoaderContainer",
|
|
1446
|
+
componentId: "kitt-universal__sc-18y4z3t-0"
|
|
1447
|
+
})(["width:60px;height:60px;transform:scale(-1) rotate(90deg);"]);
|
|
1448
|
+
var LargeLoaderCircleMixin = /*#__PURE__*/css(["transform-origin:center center;stroke-width:3px;stroke-dasharray:169.64px;stroke-dashoffset:169.64px;stroke-linecap:round;"]);
|
|
1449
|
+
var LargeLoaderFill = /*#__PURE__*/styled.g.withConfig({
|
|
1450
|
+
displayName: "LargeLoaderweb__LargeLoaderFill",
|
|
1451
|
+
componentId: "kitt-universal__sc-18y4z3t-1"
|
|
1452
|
+
})(["transform-origin:center center;animation:", " 1.8s linear 0.5s infinite;"], rotate);
|
|
1453
|
+
var LargeLoaderBase = /*#__PURE__*/styled.g.withConfig({
|
|
1454
|
+
displayName: "LargeLoaderweb__LargeLoaderBase",
|
|
1455
|
+
componentId: "kitt-universal__sc-18y4z3t-2"
|
|
1456
|
+
})(["transform-origin:center center;"]);
|
|
1457
|
+
var LargeLoaderBaseCircle = /*#__PURE__*/styled.circle.withConfig({
|
|
1458
|
+
displayName: "LargeLoaderweb__LargeLoaderBaseCircle",
|
|
1459
|
+
componentId: "kitt-universal__sc-18y4z3t-3"
|
|
1460
|
+
})(["", " stroke:#ccc;animation:", " 1s cubic-bezier(0.39,0.575,0.565,1) 0.5s forwards;"], LargeLoaderCircleMixin, init);
|
|
1461
|
+
var LargeLoaderFillCircle = /*#__PURE__*/styled.circle.withConfig({
|
|
1462
|
+
displayName: "LargeLoaderweb__LargeLoaderFillCircle",
|
|
1463
|
+
componentId: "kitt-universal__sc-18y4z3t-4"
|
|
1464
|
+
})(["", " stroke:", ";animation:", " 1.8s cubic-bezier(0.39,0.575,0.565,1) 0.5s infinite alternate,", " 2.16s linear 0.5s infinite;"], LargeLoaderCircleMixin, function (_ref) {
|
|
1465
|
+
var theme = _ref.theme;
|
|
1466
|
+
return theme.kitt.colors.primary;
|
|
1467
|
+
}, offset, rotate);
|
|
1169
1468
|
function LargeLoader() {
|
|
1170
|
-
return /*#__PURE__*/React.createElement("
|
|
1171
|
-
className: styles.LargeLoader
|
|
1172
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
1469
|
+
return /*#__PURE__*/React.createElement(LargeLoaderContainer, null, /*#__PURE__*/React.createElement("svg", {
|
|
1173
1470
|
width: "60",
|
|
1174
1471
|
height: "60"
|
|
1175
|
-
}, /*#__PURE__*/React.createElement(
|
|
1176
|
-
className: styles.LargeLoaderBase
|
|
1177
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
1472
|
+
}, /*#__PURE__*/React.createElement(LargeLoaderBase, null, /*#__PURE__*/React.createElement(LargeLoaderBaseCircle, {
|
|
1178
1473
|
cx: "30",
|
|
1179
1474
|
cy: "30",
|
|
1180
1475
|
r: "27",
|
|
1181
1476
|
fill: "none"
|
|
1182
|
-
})), /*#__PURE__*/React.createElement(
|
|
1183
|
-
className: styles.LargeLoaderFill
|
|
1184
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
1477
|
+
})), /*#__PURE__*/React.createElement(LargeLoaderFill, null, /*#__PURE__*/React.createElement(LargeLoaderFillCircle, {
|
|
1185
1478
|
cx: "30",
|
|
1186
1479
|
cy: "30",
|
|
1187
1480
|
r: "27",
|
|
@@ -1204,7 +1497,7 @@ function Loader(_ref) {
|
|
|
1204
1497
|
|
|
1205
1498
|
var xIconSize = 14;
|
|
1206
1499
|
var mainIconSize = 20;
|
|
1207
|
-
var Container$1 = /*#__PURE__*/styled.
|
|
1500
|
+
var Container$1 = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1208
1501
|
displayName: "Message__Container",
|
|
1209
1502
|
componentId: "kitt-universal__sc-c6400e-0"
|
|
1210
1503
|
})(["border-radius:", "px;background-color:", ";padding-bottom:", "px;padding-left:", "px;padding-right:", "px;padding-top:", "px;flex-direction:row;align-items:flex-start;justify-content:space-between;"], function (_ref) {
|
|
@@ -1231,7 +1524,7 @@ var Container$1 = /*#__PURE__*/styled.View.withConfig({
|
|
|
1231
1524
|
insets = _ref6.insets;
|
|
1232
1525
|
return ((_insets$top = insets === null || insets === void 0 ? void 0 : insets.top) !== null && _insets$top !== void 0 ? _insets$top : 0) + theme.kitt.spacing * 4;
|
|
1233
1526
|
});
|
|
1234
|
-
var CloseContainer = /*#__PURE__*/styled
|
|
1527
|
+
var CloseContainer = /*#__PURE__*/styled(TouchableOpacity).withConfig({
|
|
1235
1528
|
displayName: "Message__CloseContainer",
|
|
1236
1529
|
componentId: "kitt-universal__sc-c6400e-1"
|
|
1237
1530
|
})(["margin-left:", "px;padding:", "px;"], function (_ref7) {
|
|
@@ -1241,14 +1534,14 @@ var CloseContainer = /*#__PURE__*/styled.TouchableOpacity.withConfig({
|
|
|
1241
1534
|
var theme = _ref8.theme;
|
|
1242
1535
|
return theme.kitt.spacing;
|
|
1243
1536
|
});
|
|
1244
|
-
var IconContainer = /*#__PURE__*/styled.
|
|
1537
|
+
var IconContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1245
1538
|
displayName: "Message__IconContainer",
|
|
1246
1539
|
componentId: "kitt-universal__sc-c6400e-2"
|
|
1247
1540
|
})(["margin-right:", "px;"], function (_ref9) {
|
|
1248
1541
|
var theme = _ref9.theme;
|
|
1249
1542
|
return theme.kitt.spacing * 4;
|
|
1250
1543
|
});
|
|
1251
|
-
var Content = /*#__PURE__*/styled.
|
|
1544
|
+
var Content = /*#__PURE__*/styled(PrimitiveText).withConfig({
|
|
1252
1545
|
displayName: "Message__Content",
|
|
1253
1546
|
componentId: "kitt-universal__sc-c6400e-3"
|
|
1254
1547
|
})(["text-align:", ";flex:1;"], function (_ref10) {
|
|
@@ -1323,7 +1616,7 @@ function Message(_ref11) {
|
|
|
1323
1616
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
1324
1617
|
|
|
1325
1618
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1326
|
-
var OverlayPressable = /*#__PURE__*/styled.
|
|
1619
|
+
var OverlayPressable = /*#__PURE__*/styled(PrimitivePressable).withConfig({
|
|
1327
1620
|
displayName: "Overlay__OverlayPressable",
|
|
1328
1621
|
componentId: "kitt-universal__sc-1cz1gbr-0"
|
|
1329
1622
|
})(function (_ref) {
|
|
@@ -1335,11 +1628,25 @@ var OverlayPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
|
1335
1628
|
function Overlay(_ref2) {
|
|
1336
1629
|
var onPress = _ref2.onPress;
|
|
1337
1630
|
return /*#__PURE__*/React.createElement(OverlayPressable, {
|
|
1631
|
+
accessibilityRole: "none",
|
|
1338
1632
|
onPress: onPress
|
|
1339
|
-
}, /*#__PURE__*/React.createElement(
|
|
1633
|
+
}, /*#__PURE__*/React.createElement(PrimitiveView, null));
|
|
1340
1634
|
}
|
|
1341
1635
|
|
|
1342
|
-
var
|
|
1636
|
+
var _excluded$3 = ["contentContainerStyle", "children"];
|
|
1637
|
+
var PrimitiveScrollView = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1638
|
+
var contentContainerStyle = _ref.contentContainerStyle,
|
|
1639
|
+
children = _ref.children,
|
|
1640
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1641
|
+
|
|
1642
|
+
return /*#__PURE__*/React.createElement(PrimitiveView, _extends({
|
|
1643
|
+
ref: ref
|
|
1644
|
+
}, props), /*#__PURE__*/React.createElement(PrimitiveView, {
|
|
1645
|
+
style: contentContainerStyle
|
|
1646
|
+
}, children));
|
|
1647
|
+
});
|
|
1648
|
+
|
|
1649
|
+
var BodyView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1343
1650
|
displayName: "Body__BodyView",
|
|
1344
1651
|
componentId: "kitt-universal__sc-17fwpo4-0"
|
|
1345
1652
|
})(["padding:", "px ", "px;"], function (_ref) {
|
|
@@ -1349,14 +1656,12 @@ var BodyView = /*#__PURE__*/styled.View.withConfig({
|
|
|
1349
1656
|
var theme = _ref2.theme;
|
|
1350
1657
|
return theme.kitt.spacing * 4;
|
|
1351
1658
|
});
|
|
1352
|
-
|
|
1659
|
+
function ModalBody(_ref3) {
|
|
1353
1660
|
var children = _ref3.children;
|
|
1354
|
-
return /*#__PURE__*/React.createElement(
|
|
1355
|
-
|
|
1356
|
-
}, /*#__PURE__*/React.createElement(BodyView, null, children));
|
|
1357
|
-
});
|
|
1661
|
+
return /*#__PURE__*/React.createElement(PrimitiveScrollView, null, /*#__PURE__*/React.createElement(BodyView, null, children));
|
|
1662
|
+
}
|
|
1358
1663
|
|
|
1359
|
-
var FooterView = /*#__PURE__*/styled.
|
|
1664
|
+
var FooterView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1360
1665
|
displayName: "Footer__FooterView",
|
|
1361
1666
|
componentId: "kitt-universal__sc-1ujq2dc-0"
|
|
1362
1667
|
})(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], function (_ref) {
|
|
@@ -1373,7 +1678,7 @@ function ModalFooter(_ref3) {
|
|
|
1373
1678
|
|
|
1374
1679
|
var OnCloseContext = /*#__PURE__*/createContext(function () {});
|
|
1375
1680
|
|
|
1376
|
-
var HeaderView = /*#__PURE__*/styled.
|
|
1681
|
+
var HeaderView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1377
1682
|
displayName: "Header__HeaderView",
|
|
1378
1683
|
componentId: "kitt-universal__sc-1iwabch-0"
|
|
1379
1684
|
})(["position:relative;padding:", "px;display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;align-items:center;border-bottom-width:1px;border-bottom-color:", ";min-height:57px;"], function (_ref) {
|
|
@@ -1383,21 +1688,21 @@ var HeaderView = /*#__PURE__*/styled.View.withConfig({
|
|
|
1383
1688
|
var theme = _ref2.theme;
|
|
1384
1689
|
return theme.kitt.colors.separator;
|
|
1385
1690
|
});
|
|
1386
|
-
var LeftIconView = /*#__PURE__*/styled.
|
|
1691
|
+
var LeftIconView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1387
1692
|
displayName: "Header__LeftIconView",
|
|
1388
1693
|
componentId: "kitt-universal__sc-1iwabch-1"
|
|
1389
1694
|
})(["align-self:flex-start;margin-right:", "px;"], function (_ref3) {
|
|
1390
1695
|
var theme = _ref3.theme;
|
|
1391
1696
|
return theme.kitt.spacing * 2;
|
|
1392
1697
|
});
|
|
1393
|
-
var RightIconView = /*#__PURE__*/styled.
|
|
1698
|
+
var RightIconView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1394
1699
|
displayName: "Header__RightIconView",
|
|
1395
1700
|
componentId: "kitt-universal__sc-1iwabch-2"
|
|
1396
1701
|
})(["align-self:flex-start;margin-left:", "px;"], function (_ref4) {
|
|
1397
1702
|
var theme = _ref4.theme;
|
|
1398
1703
|
return theme.kitt.spacing * 2;
|
|
1399
1704
|
});
|
|
1400
|
-
var TitleView = /*#__PURE__*/styled.
|
|
1705
|
+
var TitleView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1401
1706
|
displayName: "Header__TitleView",
|
|
1402
1707
|
componentId: "kitt-universal__sc-1iwabch-3"
|
|
1403
1708
|
})(["padding-left:", "px;flex-shrink:1;"], function (_ref5) {
|
|
@@ -1420,7 +1725,7 @@ function ModalHeader(_ref6) {
|
|
|
1420
1725
|
})));
|
|
1421
1726
|
}
|
|
1422
1727
|
|
|
1423
|
-
var ModalView = /*#__PURE__*/styled.
|
|
1728
|
+
var ModalView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1424
1729
|
displayName: "Modal__ModalView",
|
|
1425
1730
|
componentId: "kitt-universal__sc-1xy2w5u-0"
|
|
1426
1731
|
})(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], function (_ref) {
|
|
@@ -1430,7 +1735,7 @@ var ModalView = /*#__PURE__*/styled.View.withConfig({
|
|
|
1430
1735
|
var theme = _ref2.theme;
|
|
1431
1736
|
return theme.kitt.spacing * 4;
|
|
1432
1737
|
});
|
|
1433
|
-
var ContentView = /*#__PURE__*/styled.
|
|
1738
|
+
var ContentView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1434
1739
|
displayName: "Modal__ContentView",
|
|
1435
1740
|
componentId: "kitt-universal__sc-1xy2w5u-1"
|
|
1436
1741
|
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", ";background-color:", ";"], function (_ref3) {
|
|
@@ -1483,11 +1788,120 @@ function Notification(_ref) {
|
|
|
1483
1788
|
}, children);
|
|
1484
1789
|
}
|
|
1485
1790
|
|
|
1486
|
-
var
|
|
1791
|
+
var PrimitiveTextWithClassName = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1792
|
+
var children = _ref.children,
|
|
1793
|
+
className = _ref.className,
|
|
1794
|
+
onPress = _ref.onPress;
|
|
1795
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md
|
|
1796
|
+
// if (href) {
|
|
1797
|
+
// return (
|
|
1798
|
+
// <a ref={ref} href={href} className={className}>
|
|
1799
|
+
// {children}
|
|
1800
|
+
// </a>
|
|
1801
|
+
// );
|
|
1802
|
+
// }
|
|
1803
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
1804
|
+
ref: ref,
|
|
1805
|
+
role: "button",
|
|
1806
|
+
className: className,
|
|
1807
|
+
tabIndex: onPress ? 0 : -1,
|
|
1808
|
+
onClick: createPressClickHandler(onPress),
|
|
1809
|
+
onKeyUp: createPressKeyUpHandler(onPress)
|
|
1810
|
+
}, children);
|
|
1811
|
+
});
|
|
1812
|
+
var PrimitiveLink = /*#__PURE__*/styled(PrimitiveTextWithClassName).withConfig({
|
|
1813
|
+
displayName: "PrimitiveLinkweb__PrimitiveLink",
|
|
1814
|
+
componentId: "kitt-universal__sc-24w4og-0"
|
|
1815
|
+
})(["", " background-color:transparent;color:inherit;font:inherit;list-style:none;text-align:inherit;text-decoration:none;", ";", ";"], textResetMixin, function (_ref2) {
|
|
1816
|
+
var selectable = _ref2.selectable;
|
|
1817
|
+
return selectable == null ? undefined : "user-select: ".concat(selectable ? 'none' : 'text');
|
|
1818
|
+
}, function (_ref3) {
|
|
1819
|
+
var onPress = _ref3.onPress;
|
|
1820
|
+
return onPress ? 'cursor: pointer;' : undefined;
|
|
1821
|
+
});
|
|
1822
|
+
|
|
1823
|
+
var Flex = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1824
|
+
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
1825
|
+
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
1826
|
+
}
|
|
1827
|
+
}).withConfig({
|
|
1828
|
+
displayName: "Flex",
|
|
1829
|
+
componentId: "kitt-universal__sc-15q3v3h-0"
|
|
1830
|
+
})(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], function (_ref) {
|
|
1831
|
+
var direction = _ref.direction;
|
|
1832
|
+
return direction;
|
|
1833
|
+
}, function (_ref2) {
|
|
1834
|
+
var theme = _ref2.theme,
|
|
1835
|
+
_ref2$padding = _ref2.padding,
|
|
1836
|
+
padding = _ref2$padding === void 0 ? 0 : _ref2$padding;
|
|
1837
|
+
return padding * theme.kitt.spacing;
|
|
1838
|
+
});
|
|
1839
|
+
|
|
1840
|
+
var storyPadding = 16;
|
|
1841
|
+
|
|
1842
|
+
var getBackgroundColorFromBlockColor = function (theme) {
|
|
1843
|
+
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'transparent';
|
|
1844
|
+
|
|
1845
|
+
switch (color) {
|
|
1846
|
+
case 'dark':
|
|
1847
|
+
return '#293033';
|
|
1848
|
+
|
|
1849
|
+
case 'light':
|
|
1850
|
+
return '#ffffff';
|
|
1851
|
+
|
|
1852
|
+
case 'primary':
|
|
1853
|
+
return theme.kitt.palettes.lateOcean.lateOcean;
|
|
1854
|
+
|
|
1855
|
+
default:
|
|
1856
|
+
return 'transparent';
|
|
1857
|
+
}
|
|
1858
|
+
};
|
|
1859
|
+
|
|
1860
|
+
var getTypographyColorFromBlockColor = function () {
|
|
1861
|
+
var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transparent';
|
|
1862
|
+
|
|
1863
|
+
switch (color) {
|
|
1864
|
+
case 'dark':
|
|
1865
|
+
case 'primary':
|
|
1866
|
+
return 'white';
|
|
1867
|
+
|
|
1868
|
+
case 'light':
|
|
1869
|
+
default:
|
|
1870
|
+
return 'black';
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
var StoryBlockBackgroundContext = /*#__PURE__*/createContext('transparent');
|
|
1875
|
+
var StoryBlockColorContext = /*#__PURE__*/createContext('black');
|
|
1876
|
+
var useStoryBlockColor = function (color) {
|
|
1877
|
+
var storyBlockColor = useContext(StoryBlockColorContext);
|
|
1878
|
+
return color || storyBlockColor;
|
|
1879
|
+
};
|
|
1880
|
+
var StyledStoryBlockView = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1881
|
+
displayName: "StoryBlock__StyledStoryBlockView",
|
|
1882
|
+
componentId: "kitt-universal__sc-3w4hdm-0"
|
|
1883
|
+
})(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, function (_ref) {
|
|
1884
|
+
var theme = _ref.theme,
|
|
1885
|
+
background = _ref.background;
|
|
1886
|
+
return getBackgroundColorFromBlockColor(theme, background);
|
|
1887
|
+
});
|
|
1888
|
+
function StoryBlock(_ref2) {
|
|
1889
|
+
var children = _ref2.children,
|
|
1890
|
+
background = _ref2.background;
|
|
1891
|
+
return /*#__PURE__*/React.createElement(StyledStoryBlockView, {
|
|
1892
|
+
background: background
|
|
1893
|
+
}, /*#__PURE__*/React.createElement(StoryBlockColorContext.Provider, {
|
|
1894
|
+
value: getTypographyColorFromBlockColor(background)
|
|
1895
|
+
}, /*#__PURE__*/React.createElement(StoryBlockBackgroundContext.Provider, {
|
|
1896
|
+
value: background
|
|
1897
|
+
}, children)));
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
var StoryTitleContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1487
1901
|
displayName: "StoryTitle__StoryTitleContainer",
|
|
1488
1902
|
componentId: "kitt-universal__sc-sic7hb-0"
|
|
1489
1903
|
})(["margin-bottom:30px;"]);
|
|
1490
|
-
var StorySubTitleContainer = /*#__PURE__*/styled.
|
|
1904
|
+
var StorySubTitleContainer = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1491
1905
|
displayName: "StoryTitle__StorySubTitleContainer",
|
|
1492
1906
|
componentId: "kitt-universal__sc-sic7hb-1"
|
|
1493
1907
|
})(["margin-bottom:10px;"]);
|
|
@@ -1495,10 +1909,10 @@ function StoryTitle(_ref) {
|
|
|
1495
1909
|
var color = _ref.color,
|
|
1496
1910
|
children = _ref.children,
|
|
1497
1911
|
numberOfLines = _ref.numberOfLines;
|
|
1498
|
-
return /*#__PURE__*/React.createElement(StoryTitleContainer, null, /*#__PURE__*/React.createElement(Typography.
|
|
1912
|
+
return /*#__PURE__*/React.createElement(StoryTitleContainer, null, /*#__PURE__*/React.createElement(Typography.Header1, {
|
|
1499
1913
|
variant: "bold",
|
|
1500
1914
|
base: "header1",
|
|
1501
|
-
color: color,
|
|
1915
|
+
color: useStoryBlockColor(color),
|
|
1502
1916
|
numberOfLines: numberOfLines
|
|
1503
1917
|
}, children));
|
|
1504
1918
|
}
|
|
@@ -1507,10 +1921,10 @@ function StoryTitleLevel2(_ref2) {
|
|
|
1507
1921
|
var color = _ref2.color,
|
|
1508
1922
|
children = _ref2.children,
|
|
1509
1923
|
numberOfLines = _ref2.numberOfLines;
|
|
1510
|
-
return /*#__PURE__*/React.createElement(StoryTitleContainer, null, /*#__PURE__*/React.createElement(Typography.
|
|
1924
|
+
return /*#__PURE__*/React.createElement(StoryTitleContainer, null, /*#__PURE__*/React.createElement(Typography.Header2, {
|
|
1511
1925
|
variant: "bold",
|
|
1512
1926
|
base: "header2",
|
|
1513
|
-
color: color,
|
|
1927
|
+
color: useStoryBlockColor(color),
|
|
1514
1928
|
numberOfLines: numberOfLines
|
|
1515
1929
|
}, children));
|
|
1516
1930
|
}
|
|
@@ -1521,11 +1935,11 @@ function StoryTitleLevel3(_ref3) {
|
|
|
1521
1935
|
var color = _ref3.color,
|
|
1522
1936
|
children = _ref3.children,
|
|
1523
1937
|
numberOfLines = _ref3.numberOfLines;
|
|
1524
|
-
return /*#__PURE__*/React.createElement(StorySubTitleContainer, null, /*#__PURE__*/React.createElement(Typography.
|
|
1938
|
+
return /*#__PURE__*/React.createElement(StorySubTitleContainer, null, /*#__PURE__*/React.createElement(Typography.Header3, {
|
|
1525
1939
|
variant: "bold",
|
|
1526
1940
|
base: "header3",
|
|
1527
1941
|
medium: "header4",
|
|
1528
|
-
color: color,
|
|
1942
|
+
color: useStoryBlockColor(color),
|
|
1529
1943
|
numberOfLines: numberOfLines
|
|
1530
1944
|
}, children));
|
|
1531
1945
|
}
|
|
@@ -1536,11 +1950,11 @@ function StoryTitleLevel4(_ref4) {
|
|
|
1536
1950
|
var color = _ref4.color,
|
|
1537
1951
|
children = _ref4.children,
|
|
1538
1952
|
numberOfLines = _ref4.numberOfLines;
|
|
1539
|
-
return /*#__PURE__*/React.createElement(StorySubTitleContainer, null, /*#__PURE__*/React.createElement(Typography.
|
|
1953
|
+
return /*#__PURE__*/React.createElement(StorySubTitleContainer, null, /*#__PURE__*/React.createElement(Typography.Header4, {
|
|
1540
1954
|
variant: "bold",
|
|
1541
1955
|
base: "header4",
|
|
1542
1956
|
medium: "header5",
|
|
1543
|
-
color: color,
|
|
1957
|
+
color: useStoryBlockColor(color),
|
|
1544
1958
|
numberOfLines: numberOfLines
|
|
1545
1959
|
}, children));
|
|
1546
1960
|
}
|
|
@@ -1550,24 +1964,40 @@ StoryTitle.Level2 = StoryTitleLevel2;
|
|
|
1550
1964
|
StoryTitle.Level3 = StoryTitleLevel3;
|
|
1551
1965
|
StoryTitle.Level4 = StoryTitleLevel4;
|
|
1552
1966
|
|
|
1553
|
-
var
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1967
|
+
var StoryContainer$1 = /*#__PURE__*/styled(PrimitiveScrollView).withConfig({
|
|
1968
|
+
displayName: "Story__StoryContainer",
|
|
1969
|
+
componentId: "kitt-universal__sc-1kwdg2p-0"
|
|
1970
|
+
})(["padding:", "px;"], storyPadding);
|
|
1971
|
+
function Story(_ref) {
|
|
1972
|
+
var title = _ref.title,
|
|
1973
|
+
contentContainerStyle = _ref.contentContainerStyle,
|
|
1974
|
+
children = _ref.children;
|
|
1975
|
+
return /*#__PURE__*/React.createElement(StoryContainer$1, {
|
|
1976
|
+
contentContainerStyle: contentContainerStyle
|
|
1977
|
+
}, /*#__PURE__*/React.createElement(StoryTitle, null, title), children);
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
var _excluded$2 = ["title", "className", "children", "internalIsDemoSection"],
|
|
1981
|
+
_excluded2 = ["title", "className", "children"],
|
|
1982
|
+
_excluded3 = ["title", "className", "children"];
|
|
1983
|
+
var StyledSection = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1984
|
+
displayName: "StorySection__StyledSection",
|
|
1985
|
+
componentId: "kitt-universal__sc-1b3liv5-0"
|
|
1986
|
+
})(["margin-bottom:32px;"]);
|
|
1987
|
+
function StorySection(_ref) {
|
|
1560
1988
|
var title = _ref.title;
|
|
1561
1989
|
_ref.className;
|
|
1562
1990
|
var children = _ref.children,
|
|
1991
|
+
internalIsDemoSection = _ref.internalIsDemoSection,
|
|
1563
1992
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1564
1993
|
|
|
1994
|
+
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
1565
1995
|
return /*#__PURE__*/React.createElement(StyledSection, props, /*#__PURE__*/React.createElement(StoryTitle.Level2, null, title), children);
|
|
1566
1996
|
}
|
|
1567
|
-
var StyledSubSection = /*#__PURE__*/styled.
|
|
1568
|
-
displayName: "
|
|
1569
|
-
componentId: "kitt-universal__sc-
|
|
1570
|
-
})(["margin-bottom:
|
|
1997
|
+
var StyledSubSection = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1998
|
+
displayName: "StorySection__StyledSubSection",
|
|
1999
|
+
componentId: "kitt-universal__sc-1b3liv5-1"
|
|
2000
|
+
})(["margin-bottom:16px;"]);
|
|
1571
2001
|
|
|
1572
2002
|
function SubSection(_ref2) {
|
|
1573
2003
|
var title = _ref2.title;
|
|
@@ -1578,32 +2008,55 @@ function SubSection(_ref2) {
|
|
|
1578
2008
|
return /*#__PURE__*/React.createElement(StyledSubSection, props, /*#__PURE__*/React.createElement(StoryTitle.Level3, null, title), children);
|
|
1579
2009
|
}
|
|
1580
2010
|
|
|
1581
|
-
var
|
|
1582
|
-
displayName: "
|
|
1583
|
-
componentId: "kitt-universal__sc-
|
|
1584
|
-
})(["margin-bottom:
|
|
2011
|
+
var StyledBlockSection = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
2012
|
+
displayName: "StorySection__StyledBlockSection",
|
|
2013
|
+
componentId: "kitt-universal__sc-1b3liv5-2"
|
|
2014
|
+
})(["margin-bottom:16px;"]);
|
|
1585
2015
|
|
|
1586
|
-
function
|
|
1587
|
-
var
|
|
1588
|
-
|
|
2016
|
+
function BlockSection(_ref3) {
|
|
2017
|
+
var title = _ref3.title;
|
|
2018
|
+
_ref3.className;
|
|
2019
|
+
var children = _ref3.children,
|
|
2020
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
2021
|
+
|
|
2022
|
+
return /*#__PURE__*/React.createElement(StyledBlockSection, props, /*#__PURE__*/React.createElement(StoryTitle.Level4, null, title), children);
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
var StyledDemoSection = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
2026
|
+
displayName: "StorySection__StyledDemoSection",
|
|
2027
|
+
componentId: "kitt-universal__sc-1b3liv5-3"
|
|
2028
|
+
})(["margin-bottom:64px;"]);
|
|
2029
|
+
|
|
2030
|
+
function DemoSection(_ref4) {
|
|
2031
|
+
var children = _ref4.children;
|
|
2032
|
+
return /*#__PURE__*/React.createElement(StyledDemoSection, null, /*#__PURE__*/React.createElement(StorySection, {
|
|
2033
|
+
internalIsDemoSection: true,
|
|
1589
2034
|
title: "Demo"
|
|
1590
2035
|
}, children));
|
|
1591
2036
|
}
|
|
1592
2037
|
|
|
1593
|
-
|
|
1594
|
-
|
|
2038
|
+
StorySection.SubSection = SubSection;
|
|
2039
|
+
StorySection.BlockSection = BlockSection;
|
|
2040
|
+
/** @deprecated use StorySection.Demo instead */
|
|
1595
2041
|
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
2042
|
+
StorySection.DemoSection = DemoSection;
|
|
2043
|
+
StorySection.Demo = DemoSection;
|
|
2044
|
+
/** @deprecated use StorySection instead */
|
|
2045
|
+
|
|
2046
|
+
var DeprecatedSection = StorySection;
|
|
2047
|
+
|
|
2048
|
+
function StoryContainer(_ref) {
|
|
2049
|
+
var children = _ref.children,
|
|
2050
|
+
state = _ref.state,
|
|
2051
|
+
title = _ref.title,
|
|
2052
|
+
platform = _ref.platform;
|
|
2053
|
+
if (platform === 'native') return null;
|
|
2054
|
+
return /*#__PURE__*/React.createElement(StorySection.BlockSection, {
|
|
2055
|
+
testID: state,
|
|
2056
|
+
title: title
|
|
2057
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2058
|
+
className: state ? "kitt-".concat(state) : undefined
|
|
2059
|
+
}, children));
|
|
1607
2060
|
}
|
|
1608
2061
|
|
|
1609
2062
|
function StoryDecorator(storyFn, context) {
|
|
@@ -1612,22 +2065,22 @@ function StoryDecorator(storyFn, context) {
|
|
|
1612
2065
|
}, storyFn());
|
|
1613
2066
|
}
|
|
1614
2067
|
|
|
1615
|
-
var SmallScreenRow = /*#__PURE__*/styled.
|
|
2068
|
+
var SmallScreenRow = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1616
2069
|
displayName: "StoryGrid__SmallScreenRow",
|
|
1617
2070
|
componentId: "kitt-universal__sc-4z5new-0"
|
|
1618
2071
|
})(["flex-direction:column;margin:0;"]);
|
|
1619
|
-
var SmallScreenCol = /*#__PURE__*/styled.
|
|
2072
|
+
var SmallScreenCol = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1620
2073
|
displayName: "StoryGrid__SmallScreenCol",
|
|
1621
2074
|
componentId: "kitt-universal__sc-4z5new-1"
|
|
1622
|
-
})(["padding:
|
|
1623
|
-
var FlexRow = /*#__PURE__*/styled.
|
|
2075
|
+
})(["padding:8px 0 16px;"]);
|
|
2076
|
+
var FlexRow = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1624
2077
|
displayName: "StoryGrid__FlexRow",
|
|
1625
2078
|
componentId: "kitt-universal__sc-4z5new-2"
|
|
1626
|
-
})(["flex-direction:row;margin:0 -
|
|
1627
|
-
var FlexCol = /*#__PURE__*/styled.
|
|
2079
|
+
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
2080
|
+
var FlexCol = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1628
2081
|
displayName: "StoryGrid__FlexCol",
|
|
1629
2082
|
componentId: "kitt-universal__sc-4z5new-3"
|
|
1630
|
-
})(["flex-grow:1;flex-basis:0;margin:0
|
|
2083
|
+
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
1631
2084
|
|
|
1632
2085
|
function StoryGridRow(_ref) {
|
|
1633
2086
|
var children = _ref.children,
|
|
@@ -1655,7 +2108,14 @@ function StoryGridRow(_ref) {
|
|
|
1655
2108
|
function StoryGridCol(_ref2) {
|
|
1656
2109
|
var title = _ref2.title,
|
|
1657
2110
|
titleColor = _ref2.titleColor,
|
|
1658
|
-
children = _ref2.children
|
|
2111
|
+
children = _ref2.children,
|
|
2112
|
+
_ref2$platform = _ref2.platform,
|
|
2113
|
+
platform = _ref2$platform === void 0 ? 'all' : _ref2$platform;
|
|
2114
|
+
|
|
2115
|
+
if (platform === 'native') {
|
|
2116
|
+
return null;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
1659
2119
|
return /*#__PURE__*/React.createElement(React.Fragment, null, title ? /*#__PURE__*/React.createElement(StoryTitle.Level4, {
|
|
1660
2120
|
numberOfLines: 1,
|
|
1661
2121
|
color: titleColor
|
|
@@ -1667,29 +2127,66 @@ var StoryGrid = {
|
|
|
1667
2127
|
Col: StoryGridCol
|
|
1668
2128
|
};
|
|
1669
2129
|
|
|
1670
|
-
var Container = /*#__PURE__*/styled.
|
|
2130
|
+
var Container = /*#__PURE__*/styled(PrimitiveView).withConfig({
|
|
1671
2131
|
displayName: "Tag__Container",
|
|
1672
2132
|
componentId: "kitt-universal__sc-19jmowi-0"
|
|
1673
|
-
})(["background-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], function (_ref) {
|
|
2133
|
+
})(["background-color:", ";border-width:", ";border-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], function (_ref) {
|
|
1674
2134
|
var theme = _ref.theme,
|
|
1675
|
-
type = _ref.type
|
|
1676
|
-
|
|
2135
|
+
type = _ref.type,
|
|
2136
|
+
variant = _ref.variant;
|
|
2137
|
+
return theme.kitt.tag[type][variant].backgroundColor;
|
|
1677
2138
|
}, function (_ref2) {
|
|
1678
|
-
var theme = _ref2.theme
|
|
1679
|
-
|
|
2139
|
+
var theme = _ref2.theme,
|
|
2140
|
+
type = _ref2.type,
|
|
2141
|
+
variant = _ref2.variant;
|
|
2142
|
+
return theme.kitt.tag[type][variant].borderWidth;
|
|
1680
2143
|
}, function (_ref3) {
|
|
1681
|
-
var theme = _ref3.theme
|
|
2144
|
+
var theme = _ref3.theme,
|
|
2145
|
+
type = _ref3.type,
|
|
2146
|
+
variant = _ref3.variant;
|
|
2147
|
+
return theme.kitt.tag[type][variant].borderColor;
|
|
2148
|
+
}, function (_ref4) {
|
|
2149
|
+
var theme = _ref4.theme;
|
|
2150
|
+
return theme.kitt.tag.padding;
|
|
2151
|
+
}, function (_ref5) {
|
|
2152
|
+
var theme = _ref5.theme;
|
|
1682
2153
|
return theme.kitt.tag.borderRadius;
|
|
1683
2154
|
});
|
|
1684
|
-
function
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
2155
|
+
var getLabelColor = function (type, variant) {
|
|
2156
|
+
switch (type) {
|
|
2157
|
+
case 'danger':
|
|
2158
|
+
{
|
|
2159
|
+
return variant === 'outline' ? 'danger' : 'black';
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
case 'primary':
|
|
2163
|
+
{
|
|
2164
|
+
return 'primary';
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
case 'default':
|
|
2168
|
+
{
|
|
2169
|
+
return 'black';
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
default:
|
|
2173
|
+
{
|
|
2174
|
+
return 'black';
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
};
|
|
2178
|
+
function Tag(_ref6) {
|
|
2179
|
+
var label = _ref6.label,
|
|
2180
|
+
_ref6$type = _ref6.type,
|
|
2181
|
+
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
2182
|
+
_ref6$variant = _ref6.variant,
|
|
2183
|
+
variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
|
|
1688
2184
|
return /*#__PURE__*/React.createElement(Container, {
|
|
1689
|
-
type: type
|
|
2185
|
+
type: type,
|
|
2186
|
+
variant: variant
|
|
1690
2187
|
}, /*#__PURE__*/React.createElement(Typography.Text, {
|
|
1691
2188
|
base: "body-xsmall",
|
|
1692
|
-
color: type
|
|
2189
|
+
color: getLabelColor(type, variant)
|
|
1693
2190
|
}, label));
|
|
1694
2191
|
}
|
|
1695
2192
|
|
|
@@ -1742,9 +2239,9 @@ var buttonLateOceanTheme = {
|
|
|
1742
2239
|
disabledBorderColor: lateOceanColorPalette.black100
|
|
1743
2240
|
},
|
|
1744
2241
|
secondary: {
|
|
1745
|
-
backgroundColor:
|
|
2242
|
+
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
1746
2243
|
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
1747
|
-
pressedBackgroundColor:
|
|
2244
|
+
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
1748
2245
|
disabledBorderColor: lateOceanColorPalette.black100
|
|
1749
2246
|
},
|
|
1750
2247
|
subtle: {
|
|
@@ -1758,6 +2255,14 @@ var buttonLateOceanTheme = {
|
|
|
1758
2255
|
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
1759
2256
|
pressedBackgroundColor: lateOceanColorPalette.transparent,
|
|
1760
2257
|
disabledBorderColor: lateOceanColorPalette.transparent
|
|
2258
|
+
},
|
|
2259
|
+
white: {
|
|
2260
|
+
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2261
|
+
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2262
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2263
|
+
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2264
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)',
|
|
2265
|
+
disabledBorderColor: lateOceanColorPalette.transparent
|
|
1761
2266
|
}
|
|
1762
2267
|
};
|
|
1763
2268
|
|
|
@@ -1886,6 +2391,41 @@ var fullScreenModalLateOceanTheme = {
|
|
|
1886
2391
|
}
|
|
1887
2392
|
};
|
|
1888
2393
|
|
|
2394
|
+
var iconButton = {
|
|
2395
|
+
backgroundColor: 'transparent',
|
|
2396
|
+
width: 40,
|
|
2397
|
+
height: 40,
|
|
2398
|
+
borderRadius: 20,
|
|
2399
|
+
borderWidth: 2,
|
|
2400
|
+
borderColor: 'transparent',
|
|
2401
|
+
transition: {
|
|
2402
|
+
property: 'all',
|
|
2403
|
+
duration: '200ms',
|
|
2404
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
|
|
2405
|
+
},
|
|
2406
|
+
scale: {
|
|
2407
|
+
base: {
|
|
2408
|
+
"default": 1,
|
|
2409
|
+
hover: 0.95,
|
|
2410
|
+
active: 0.95
|
|
2411
|
+
},
|
|
2412
|
+
medium: {
|
|
2413
|
+
hover: 1.05
|
|
2414
|
+
}
|
|
2415
|
+
},
|
|
2416
|
+
disabled: {
|
|
2417
|
+
scale: 1,
|
|
2418
|
+
backgroundColor: buttonLateOceanTheme.secondary.disabledBackgroundColor,
|
|
2419
|
+
borderColor: buttonLateOceanTheme.secondary.disabledBorderColor
|
|
2420
|
+
},
|
|
2421
|
+
"default": {
|
|
2422
|
+
pressedBackgroundColor: buttonLateOceanTheme.secondary.pressedBackgroundColor
|
|
2423
|
+
},
|
|
2424
|
+
white: {
|
|
2425
|
+
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
|
|
1889
2429
|
var listItemLateOceanTheme = {
|
|
1890
2430
|
padding: '12px 16px',
|
|
1891
2431
|
borderColor: colorsLateOceanTheme.separator,
|
|
@@ -1901,15 +2441,40 @@ var tagLateOceanTheme = {
|
|
|
1901
2441
|
borderRadius: '10px',
|
|
1902
2442
|
padding: '2px 12px',
|
|
1903
2443
|
primary: {
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
2444
|
+
fill: {
|
|
2445
|
+
backgroundColor: '#EDEBFC',
|
|
2446
|
+
borderWidth: '0',
|
|
2447
|
+
borderColor: lateOceanColorPalette.transparent
|
|
2448
|
+
},
|
|
2449
|
+
outline: {
|
|
2450
|
+
backgroundColor: lateOceanColorPalette.transparent,
|
|
2451
|
+
borderWidth: '1px',
|
|
2452
|
+
borderColor: lateOceanColorPalette.lateOcean
|
|
2453
|
+
}
|
|
1907
2454
|
},
|
|
1908
2455
|
"default": {
|
|
1909
|
-
|
|
2456
|
+
fill: {
|
|
2457
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
2458
|
+
borderWidth: '0',
|
|
2459
|
+
borderColor: lateOceanColorPalette.transparent
|
|
2460
|
+
},
|
|
2461
|
+
outline: {
|
|
2462
|
+
backgroundColor: lateOceanColorPalette.transparent,
|
|
2463
|
+
borderWidth: '1px',
|
|
2464
|
+
borderColor: lateOceanColorPalette.black1000
|
|
2465
|
+
}
|
|
1910
2466
|
},
|
|
1911
2467
|
danger: {
|
|
1912
|
-
|
|
2468
|
+
fill: {
|
|
2469
|
+
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
2470
|
+
borderWidth: '0',
|
|
2471
|
+
borderColor: lateOceanColorPalette.transparent
|
|
2472
|
+
},
|
|
2473
|
+
outline: {
|
|
2474
|
+
backgroundColor: lateOceanColorPalette.transparent,
|
|
2475
|
+
borderWidth: '1px',
|
|
2476
|
+
borderColor: colorsLateOceanTheme.danger
|
|
2477
|
+
}
|
|
1913
2478
|
}
|
|
1914
2479
|
};
|
|
1915
2480
|
|
|
@@ -1990,9 +2555,33 @@ var typographyLateOceanTheme = {
|
|
|
1990
2555
|
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
1991
2556
|
}
|
|
1992
2557
|
}
|
|
2558
|
+
},
|
|
2559
|
+
link: {
|
|
2560
|
+
disabledColor: lateOceanColorPalette.black200
|
|
1993
2561
|
}
|
|
1994
2562
|
};
|
|
1995
2563
|
|
|
2564
|
+
var breakpoints = {
|
|
2565
|
+
values: {
|
|
2566
|
+
base: 0,
|
|
2567
|
+
small: 480,
|
|
2568
|
+
medium: 768,
|
|
2569
|
+
large: 1024,
|
|
2570
|
+
wide: 1280
|
|
2571
|
+
},
|
|
2572
|
+
min: {
|
|
2573
|
+
smallBreakpoint: 'min-width: 480px',
|
|
2574
|
+
mediumBreakpoint: 'min-width: 768px',
|
|
2575
|
+
largeBreakpoint: 'min-width: 1024px',
|
|
2576
|
+
wideBreakpoint: 'min-width: 1280px'
|
|
2577
|
+
},
|
|
2578
|
+
max: {
|
|
2579
|
+
smallBreakpoint: 'max-width: 479px',
|
|
2580
|
+
mediumBreakpoint: 'max-width: 767px',
|
|
2581
|
+
largeBreakpoint: 'max-width: 1023px',
|
|
2582
|
+
wideBreakpoint: 'max-width: 1279px'
|
|
2583
|
+
}
|
|
2584
|
+
};
|
|
1996
2585
|
var theme = {
|
|
1997
2586
|
spacing: 4,
|
|
1998
2587
|
colors: colorsLateOceanTheme,
|
|
@@ -2008,42 +2597,47 @@ var theme = {
|
|
|
2008
2597
|
tag: tagLateOceanTheme,
|
|
2009
2598
|
shadows: shadowsLateOceanTheme,
|
|
2010
2599
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2600
|
+
iconButton: iconButton,
|
|
2011
2601
|
listItem: listItemLateOceanTheme
|
|
2012
2602
|
};
|
|
2013
2603
|
|
|
2014
2604
|
function Tooltip(_ref) {
|
|
2015
2605
|
var children = _ref.children;
|
|
2016
|
-
return /*#__PURE__*/React.createElement(
|
|
2606
|
+
return /*#__PURE__*/React.createElement(PrimitiveView, null, children);
|
|
2017
2607
|
}
|
|
2018
2608
|
|
|
2019
|
-
var _excluded$1 = ["disabled", "noUnderline", "
|
|
2020
|
-
var StyledLink = /*#__PURE__*/styled(
|
|
2609
|
+
var _excluded$1 = ["children", "disabled", "noUnderline", "onPress"];
|
|
2610
|
+
var StyledLink = /*#__PURE__*/styled(PrimitiveLink).withConfig({
|
|
2021
2611
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
2022
2612
|
return !['disabled', 'noUnderline'].includes(prop);
|
|
2023
2613
|
}
|
|
2024
2614
|
}).withConfig({
|
|
2025
2615
|
displayName: "TypographyLink__StyledLink",
|
|
2026
2616
|
componentId: "kitt-universal__sc-1o1zy30-0"
|
|
2027
|
-
})(["text-decoration:", ";", "
|
|
2617
|
+
})(["text-decoration:", ";", ""], function (_ref) {
|
|
2028
2618
|
var noUnderline = _ref.noUnderline;
|
|
2029
2619
|
return noUnderline ? 'none' : 'underline';
|
|
2030
2620
|
}, function (_ref2) {
|
|
2031
|
-
var disabled = _ref2.disabled
|
|
2032
|
-
|
|
2621
|
+
var disabled = _ref2.disabled,
|
|
2622
|
+
theme = _ref2.theme,
|
|
2623
|
+
noUnderline = _ref2.noUnderline;
|
|
2624
|
+
return "\n ".concat(disabled ? "color: ".concat(theme.kitt.typography.link.disabledColor, ";") : '', "\n ").concat("\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat(disabled ? 'not-allowed' : 'pointer', ";\n\n\n &:hover, &:active, .kitt-hover & {\n text-decoration: ").concat(noUnderline ? 'underline' : 'none', ";\n }\n "));
|
|
2033
2625
|
});
|
|
2034
2626
|
function TypographyLink(_ref3) {
|
|
2035
|
-
var
|
|
2627
|
+
var children = _ref3.children,
|
|
2628
|
+
disabled = _ref3.disabled,
|
|
2036
2629
|
noUnderline = _ref3.noUnderline,
|
|
2037
|
-
|
|
2038
|
-
variant = _ref3$variant === void 0 ? 'bold' : _ref3$variant,
|
|
2630
|
+
onPress = _ref3.onPress,
|
|
2039
2631
|
otherProps = _objectWithoutProperties(_ref3, _excluded$1);
|
|
2040
2632
|
|
|
2041
|
-
return /*#__PURE__*/React.createElement(
|
|
2633
|
+
return /*#__PURE__*/React.createElement(Typography, _extends({}, otherProps, {
|
|
2634
|
+
accessibilityRole: "none"
|
|
2635
|
+
}), /*#__PURE__*/React.createElement(StyledLink, {
|
|
2042
2636
|
disabled: disabled,
|
|
2043
2637
|
noUnderline: noUnderline,
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
},
|
|
2638
|
+
accessibilityRole: "link",
|
|
2639
|
+
onPress: disabled ? undefined : onPress
|
|
2640
|
+
}, children));
|
|
2047
2641
|
}
|
|
2048
2642
|
|
|
2049
2643
|
function matchWindowSize(currentWidth, _ref) {
|
|
@@ -2071,7 +2665,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
2071
2665
|
widthList[_key] = arguments[_key];
|
|
2072
2666
|
}
|
|
2073
2667
|
|
|
2074
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2668
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
2075
2669
|
widthList.slice(1).forEach(function (_ref, index) {
|
|
2076
2670
|
var _ref2 = _slicedToArray(_ref, 1),
|
|
2077
2671
|
minWidth = _ref2[0];
|
|
@@ -2106,11 +2700,39 @@ function useKittTheme() {
|
|
|
2106
2700
|
return useMemo(function () {
|
|
2107
2701
|
return {
|
|
2108
2702
|
kitt: theme,
|
|
2109
|
-
responsive: createWindowSizeHelper(width)
|
|
2703
|
+
responsive: createWindowSizeHelper(width),
|
|
2704
|
+
breakpoints: breakpoints
|
|
2110
2705
|
};
|
|
2111
2706
|
}, [width]);
|
|
2112
2707
|
}
|
|
2113
2708
|
|
|
2709
|
+
function KittThemeProvider(_ref) {
|
|
2710
|
+
var children = _ref.children;
|
|
2711
|
+
var theme = useKittTheme();
|
|
2712
|
+
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
2713
|
+
theme: theme
|
|
2714
|
+
}, children);
|
|
2715
|
+
}
|
|
2716
|
+
var KittThemeDecorator = makeDecorator({
|
|
2717
|
+
name: 'ThemeDecorator',
|
|
2718
|
+
parameterName: 'theme',
|
|
2719
|
+
wrapper: function wrapper(storyFn, context, _ref2) {
|
|
2720
|
+
_ref2.options;
|
|
2721
|
+
_ref2.parameters;
|
|
2722
|
+
return /*#__PURE__*/React.createElement(KittThemeProvider, null, storyFn(context));
|
|
2723
|
+
}
|
|
2724
|
+
});
|
|
2725
|
+
|
|
2726
|
+
var SafeAreaProviderDecorator = makeDecorator({
|
|
2727
|
+
name: 'SafeAreaProviderDecorator',
|
|
2728
|
+
parameterName: 'safeAreaProvider',
|
|
2729
|
+
wrapper: function wrapper(storyFn, context, _ref) {
|
|
2730
|
+
_ref.options;
|
|
2731
|
+
_ref.parameters;
|
|
2732
|
+
return /*#__PURE__*/React.createElement(SafeAreaProvider, null, storyFn(context));
|
|
2733
|
+
}
|
|
2734
|
+
});
|
|
2735
|
+
|
|
2114
2736
|
var _excluded = ["children"];
|
|
2115
2737
|
function MatchWindowSize(_ref) {
|
|
2116
2738
|
var children = _ref.children,
|
|
@@ -2121,5 +2743,5 @@ function MatchWindowSize(_ref) {
|
|
|
2121
2743
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
2122
2744
|
}
|
|
2123
2745
|
|
|
2124
|
-
export { Avatar, Button, Card, FullScreenModal, Icon, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, Section, Story, StoryDecorator, StoryGrid, StoryTitle, Tag, TextArea, Tooltip, Typography, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize };
|
|
2746
|
+
export { Avatar, Button, Card, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, PrimitiveLink, PrimitivePressable, PrimitiveScrollView, PrimitiveText, PrimitiveView, Radio, SafeAreaProviderDecorator, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, Tooltip, Typography, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
2125
2747
|
//# sourceMappingURL=index-browser-all.es.web.js.map
|