@ornikar/kitt-universal 1.0.0-pre

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.
Files changed (146) hide show
  1. package/dist/index-browser-all-dev.es.js +1934 -0
  2. package/dist/index-browser-all-dev.es.js.map +1 -0
  3. package/dist/index-browser-all.es.js +1920 -0
  4. package/dist/index-browser-all.es.js.map +1 -0
  5. package/dist/index-node-12.13-dev.cjs.js +2059 -0
  6. package/dist/index-node-12.13-dev.cjs.js.map +1 -0
  7. package/dist/index-node-12.13.cjs.js +2048 -0
  8. package/dist/index-node-12.13.cjs.js.map +1 -0
  9. package/index.js +7 -0
  10. package/package.json +61 -0
  11. package/src/.eslintrc.json +42 -0
  12. package/src/Avatar/Avatar.stories.tsx +47 -0
  13. package/src/Avatar/Avatar.tsx +60 -0
  14. package/src/Avatar/__snapshots__/Avatar.stories.tsx.snap +1229 -0
  15. package/src/Button/Button.stories.tsx +303 -0
  16. package/src/Button/Button.tsx +60 -0
  17. package/src/Button/ButtonContainer.tsx +32 -0
  18. package/src/Button/ButtonContent.tsx +133 -0
  19. package/src/Button/__snapshots__/Button.stories.tsx.snap +7483 -0
  20. package/src/Button/useButton.ts +14 -0
  21. package/src/Card/Card.stories.tsx +33 -0
  22. package/src/Card/Card.tsx +25 -0
  23. package/src/Card/__snapshots__/Card.stories.tsx.snap +306 -0
  24. package/src/FullScreenModal/Body.tsx +25 -0
  25. package/src/FullScreenModal/FullScreenModal.stories.tsx +65 -0
  26. package/src/FullScreenModal/FullScreenModal.tsx +21 -0
  27. package/src/FullScreenModal/Header.tsx +129 -0
  28. package/src/FullScreenModal/__snapshots__/FullScreenModal.stories.tsx.snap +771 -0
  29. package/src/Icon/Icon.stories.tsx +61 -0
  30. package/src/Icon/Icon.tsx +37 -0
  31. package/src/Icon/SpinningIcon.tsx +38 -0
  32. package/src/Icon/SpinningIcon.web.css +13 -0
  33. package/src/Icon/SpinningIcon.web.tsx +11 -0
  34. package/src/Icon/__snapshots__/Icon.stories.tsx.snap +5648 -0
  35. package/src/KittBreakpoints.ts +44 -0
  36. package/src/KittThemeProvider.tsx +30 -0
  37. package/src/ListItem/ListItem.stories.tsx +124 -0
  38. package/src/ListItem/ListItem.tsx +61 -0
  39. package/src/ListItem/ListItemContent.tsx +17 -0
  40. package/src/ListItem/ListItemSideContent.tsx +41 -0
  41. package/src/ListItem/__snapshots__/ListItem.stories.tsx.snap +1514 -0
  42. package/src/Loader/LargeLoader.tsx +12 -0
  43. package/src/Loader/LargeLoader.web.css +103 -0
  44. package/src/Loader/LargeLoader.web.test.tsx +10 -0
  45. package/src/Loader/LargeLoader.web.tsx +18 -0
  46. package/src/Loader/Loader.stories.tsx +49 -0
  47. package/src/Loader/Loader.tsx +21 -0
  48. package/src/Loader/Loader.web.test.tsx +20 -0
  49. package/src/Loader/Loader.web.tsx +14 -0
  50. package/src/Loader/__snapshots__/LargeLoader.web.test.tsx.snap +33 -0
  51. package/src/Loader/__snapshots__/Loader.stories.tsx.snap +607 -0
  52. package/src/Loader/__snapshots__/Loader.web.test.tsx.snap +103 -0
  53. package/src/Message/Message.stories.tsx +104 -0
  54. package/src/Message/Message.tsx +114 -0
  55. package/src/Message/__snapshots__/Message.stories.tsx.snap +2776 -0
  56. package/src/Modal/Body.tsx +20 -0
  57. package/src/Modal/Footer.tsx +18 -0
  58. package/src/Modal/Header.tsx +66 -0
  59. package/src/Modal/Modal.stories.tsx +183 -0
  60. package/src/Modal/Modal.tsx +66 -0
  61. package/src/Modal/OnCloseContext.ts +3 -0
  62. package/src/Modal/__snapshots__/Modal.stories.tsx.snap +2960 -0
  63. package/src/Notification/Notification.stories.tsx +103 -0
  64. package/src/Notification/Notification.tsx +21 -0
  65. package/src/Notification/__snapshots__/Notification.stories.tsx.snap +2861 -0
  66. package/src/Overlay/Overlay.tsx +22 -0
  67. package/src/Tag/Tag.stories.tsx +19 -0
  68. package/src/Tag/Tag.tsx +31 -0
  69. package/src/Tag/__snapshots__/Tag.stories.tsx.snap +303 -0
  70. package/src/Tooltip/Tooltip.tsx +17 -0
  71. package/src/__mocks__/react-native-safe-area-context.tsx +26 -0
  72. package/src/forms/InputFeedback/InputFeedback.stories.tsx +20 -0
  73. package/src/forms/InputFeedback/InputFeedback.tsx +28 -0
  74. package/src/forms/InputFeedback/__snapshots__/InputFeedback.stories.tsx.snap +252 -0
  75. package/src/forms/InputField/InputField.stories.tsx +21 -0
  76. package/src/forms/InputField/InputField.tsx +45 -0
  77. package/src/forms/InputField/__snapshots__/InputField.stories.tsx.snap +240 -0
  78. package/src/forms/InputFormState.ts +1 -0
  79. package/src/forms/InputText/InputText.stories.tsx +87 -0
  80. package/src/forms/InputText/InputText.tsx +172 -0
  81. package/src/forms/InputText/__snapshots__/InputText.stories.tsx.snap +4274 -0
  82. package/src/forms/InputText/useInputText.ts +19 -0
  83. package/src/forms/Label/Label.stories.tsx +16 -0
  84. package/src/forms/Label/Label.tsx +17 -0
  85. package/src/forms/Label/__snapshots__/Label.stories.tsx.snap +174 -0
  86. package/src/forms/Radio/Radio.stories.tsx +50 -0
  87. package/src/forms/Radio/Radio.tsx +81 -0
  88. package/src/forms/Radio/__snapshots__/Radio.stories.tsx.snap +967 -0
  89. package/src/forms/TextArea/TextArea.stories.tsx +74 -0
  90. package/src/forms/TextArea/TextArea.tsx +12 -0
  91. package/src/forms/TextArea/__snapshots__/TextArea.stories.tsx.snap +2091 -0
  92. package/src/index.ts +43 -0
  93. package/src/stories/Block.tsx +24 -0
  94. package/src/stories/Flex.tsx +16 -0
  95. package/src/stories/color-tokens.stories.tsx +143 -0
  96. package/src/stories-list.tsx +22 -0
  97. package/src/story-components/Section.tsx +56 -0
  98. package/src/story-components/Story.tsx +24 -0
  99. package/src/story-components/StoryDecorator.tsx +8 -0
  100. package/src/story-components/StoryGrid.tsx +80 -0
  101. package/src/story-components/StoryTitle.stories.tsx +12 -0
  102. package/src/story-components/StoryTitle.tsx +69 -0
  103. package/src/story-components/__snapshots__/StoryTitle.stories.tsx.snap +155 -0
  104. package/src/story-components/index.ts +13 -0
  105. package/src/themes/default.ts +34 -0
  106. package/src/themes/late-ocean/avatarLateOceanTheme.ts +12 -0
  107. package/src/themes/late-ocean/buttonLateOceanTheme.ts +37 -0
  108. package/src/themes/late-ocean/cardLateOceanTheme.ts +19 -0
  109. package/src/themes/late-ocean/colorsLateOceanTheme.ts +19 -0
  110. package/src/themes/late-ocean/feedbackMessageLateOceanTheme.ts +10 -0
  111. package/src/themes/late-ocean/formLateOceanTheme.ts +9 -0
  112. package/src/themes/late-ocean/fullScreenModalLateOceanTheme.ts +8 -0
  113. package/src/themes/late-ocean/inputFieldLateOceanTheme.ts +4 -0
  114. package/src/themes/late-ocean/inputLateOceanTheme.ts +55 -0
  115. package/src/themes/late-ocean/listItemLateOceanTheme.ts +8 -0
  116. package/src/themes/late-ocean/radioLateOceanTheme.ts +19 -0
  117. package/src/themes/late-ocean/shadowsLateOceanTheme.ts +3 -0
  118. package/src/themes/late-ocean/tagLateOceanTheme.ts +17 -0
  119. package/src/themes/late-ocean/typographyLateOceanTheme.ts +94 -0
  120. package/src/themes/palettes/lateOceanColorPalette.ts +24 -0
  121. package/src/typings/babel-config.d.ts +6 -0
  122. package/src/typings/metro.d.ts +6 -0
  123. package/src/typography/Typography.stories.tsx +115 -0
  124. package/src/typography/Typography.tsx +165 -0
  125. package/src/typography/TypographyIcon.stories.tsx +32 -0
  126. package/src/typography/TypographyIcon.tsx +35 -0
  127. package/src/typography/TypographyLink.stories.tsx +89 -0
  128. package/src/typography/TypographyLink.tsx +48 -0
  129. package/src/typography/__snapshots__/Typography.stories.tsx.snap +6118 -0
  130. package/src/typography/__snapshots__/TypographyIcon.stories.tsx.snap +334 -0
  131. package/src/typography/__snapshots__/TypographyLink.stories.tsx.snap +10945 -0
  132. package/src/utils/storybook/decorators/KittThemeDecorator.tsx +11 -0
  133. package/src/utils/storybook/decorators/SafeAreaProviderDecorator.tsx +11 -0
  134. package/src/utils/storybook/setup-global-decorators.ts +6 -0
  135. package/src/utils/tests/renderWithProvidersUtils.tsx +17 -0
  136. package/src/utils/typeUtils.ts +6 -0
  137. package/src/utils/windowSize/MatchWindowSize.tsx +14 -0
  138. package/src/utils/windowSize/__snapshots__/windowSize.stories.tsx.snap +1485 -0
  139. package/src/utils/windowSize/createWindowSizeHelper.test.ts +11 -0
  140. package/src/utils/windowSize/createWindowSizeHelper.ts +65 -0
  141. package/src/utils/windowSize/useMatchWindowSize.ts +14 -0
  142. package/src/utils/windowSize/useWindowSize.ts +1 -0
  143. package/src/utils/windowSize/windowSize.stories.tsx +116 -0
  144. package/tsconfig.build.json +30 -0
  145. package/tsconfig.json +13 -0
  146. package/yarn-error.log +22274 -0
@@ -0,0 +1,1920 @@
1
+ import _extends from '@babel/runtime/helpers/extends';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
+ import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
4
+ import { UserIcon, EyeIcon, EyeOffIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon } from '@ornikar/kitt-icons';
5
+ export * from '@ornikar/kitt-icons';
6
+ import React, { useRef, useEffect, useContext, createContext, useState, forwardRef, useMemo } from 'react';
7
+ import { Animated, Easing, Image, Platform, useWindowDimensions, Pressable, StyleSheet, View, ScrollView, Modal as Modal$1 } from 'react-native';
8
+ export { useWindowDimensions as useWindowSize } from 'react-native';
9
+ import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
10
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
11
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
12
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
13
+
14
+ function SpinningIcon(_ref) {
15
+ var children = _ref.children;
16
+ var animationRef = useRef(new Animated.Value(0));
17
+ var rotation = animationRef.current.interpolate({
18
+ inputRange: [0, 1],
19
+ outputRange: ['0deg', '360deg']
20
+ });
21
+ useEffect(function () {
22
+ if (process.env.TESTS) return undefined;
23
+ var animation = Animated.loop(Animated.timing(animationRef.current, {
24
+ toValue: 1,
25
+ duration: 1100,
26
+ easing: Easing.linear,
27
+ useNativeDriver: true
28
+ }));
29
+ animation.start();
30
+ return function () {
31
+ if (process.env.TESTS) return undefined;
32
+ animation.stop();
33
+ return undefined;
34
+ };
35
+ }, []);
36
+ return /*#__PURE__*/React.createElement(Animated.View, {
37
+ style: {
38
+ transform: [{
39
+ rotate: rotation
40
+ }]
41
+ }
42
+ }, children);
43
+ }
44
+
45
+ var _templateObject$p;
46
+ var IconContainer$2 = styled.View(_templateObject$p || (_templateObject$p = _taggedTemplateLiteral(["\n color: ", ";\n width: ", "px;\n height: ", "px;\n align-self: ", ";\n"])), function (_ref) {
47
+ var color = _ref.color;
48
+ return color;
49
+ }, function (_ref2) {
50
+ var size = _ref2.size;
51
+ return size;
52
+ }, function (_ref3) {
53
+ var size = _ref3.size;
54
+ return size;
55
+ }, function (_ref4) {
56
+ var _ref4$align = _ref4.align,
57
+ align = _ref4$align === void 0 ? 'auto' : _ref4$align;
58
+ return align;
59
+ });
60
+ function Icon(_ref5) {
61
+ var icon = _ref5.icon,
62
+ _ref5$size = _ref5.size,
63
+ size = _ref5$size === void 0 ? 20 : _ref5$size,
64
+ spin = _ref5.spin,
65
+ align = _ref5.align,
66
+ color = _ref5.color;
67
+ var clonedIcon = /*#__PURE__*/React.cloneElement(icon, {
68
+ color: color
69
+ });
70
+ return /*#__PURE__*/React.createElement(IconContainer$2, {
71
+ align: align,
72
+ size: size,
73
+ color: color
74
+ }, spin ? /*#__PURE__*/React.createElement(SpinningIcon, null, clonedIcon) : clonedIcon);
75
+ }
76
+
77
+ var _templateObject$o;
78
+ var TypographyTypeContext = /*#__PURE__*/createContext(undefined);
79
+ var TypographyColorContext = /*#__PURE__*/createContext('black');
80
+ function useTypographyColor() {
81
+ return useContext(TypographyColorContext);
82
+ }
83
+ var StyledTypography = styled.Text(_templateObject$o || (_templateObject$o = _taggedTemplateLiteral(["\n /* font */\n ", "\n\n /* color */\n ", "\n"])), function (_ref) {
84
+ var theme = _ref.theme,
85
+ isHeader = _ref.isHeader,
86
+ type = _ref.type,
87
+ variant = _ref.variant;
88
+ var _theme$kitt$typograph = theme.kitt.typography.types,
89
+ headers = _theme$kitt$typograph.headers,
90
+ bodies = _theme$kitt$typograph.bodies;
91
+ return "\n /* type */\n ".concat(!type ? '' : "\n font-family: ".concat(isHeader ? headers.fontFamily[variant] : bodies.fontFamily[variant], ";\n font-size: ").concat(isHeader ? headers.configs[type].baseAndSmall.fontSize : bodies.configs[type].baseAndSmall.fontSize, ";\n line-height: ").concat(isHeader ? headers.configs[type].baseAndSmall.lineHeight : bodies.configs[type].baseAndSmall.lineHeight, ";\n "), "\n\n /* variant */\n font-weight: ").concat(isHeader ? headers.fontWeight : bodies.fontWeight[variant], ";\n font-style: ").concat(isHeader ? headers.fontStyle : bodies.fontStyle[variant], ";\n ");
92
+ }, function (_ref2) {
93
+ var theme = _ref2.theme,
94
+ color = _ref2.color;
95
+ return !color ? '' : "\n color: ".concat(theme.kitt.typography.colors[color], ";\n text-decoration-color: ").concat(theme.kitt.typography.colors[color], ";\n ");
96
+ });
97
+
98
+ var isTypeHeader = function (type) {
99
+ return type.startsWith('header');
100
+ };
101
+
102
+ var isTypographyHeader = function (base, typeInContext) {
103
+ if (base) return isTypeHeader(base);
104
+ if (typeInContext) return isTypeHeader(typeInContext);
105
+ throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
106
+ };
107
+
108
+ function Typography(_ref3) {
109
+ _ref3.accessibilityRole;
110
+ var base = _ref3.base,
111
+ variant = _ref3.variant,
112
+ color = _ref3.color,
113
+ otherProps = _objectWithoutProperties(_ref3, ["accessibilityRole", "base", "variant", "color"]);
114
+
115
+ var typeInContext = useContext(TypographyTypeContext);
116
+ var isHeader = isTypographyHeader(base, typeInContext);
117
+ var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular';
118
+ var colorWithDefaultToBlack = color !== null && color !== void 0 ? color : typeInContext ? undefined : 'black';
119
+ var content = base ?
120
+ /*#__PURE__*/
121
+ // use the type and pass the type to the context for children
122
+ React.createElement(TypographyTypeContext.Provider, {
123
+ value: base
124
+ }, /*#__PURE__*/React.createElement(StyledTypography, _extends({
125
+ color: colorWithDefaultToBlack,
126
+ isHeader: isHeader,
127
+ type: base,
128
+ variant: nonNullableVariant
129
+ }, otherProps))) : /*#__PURE__*/React.createElement(StyledTypography, _extends({
130
+ color: colorWithDefaultToBlack,
131
+ isHeader: isHeader,
132
+ variant: nonNullableVariant
133
+ }, otherProps));
134
+ return color ? /*#__PURE__*/React.createElement(TypographyColorContext.Provider, {
135
+ value: color
136
+ }, content) : content;
137
+ }
138
+
139
+ function TypographyText(props) {
140
+ return /*#__PURE__*/React.createElement(Typography, _extends({
141
+ accessibilityRole: null
142
+ }, props));
143
+ }
144
+
145
+ function TypographyParagraph(props) {
146
+ // @ts-expect-error paragraph is not allowed in react-native but exists in react-native-web
147
+ return /*#__PURE__*/React.createElement(Typography, _extends({
148
+ accessibilityRole: "paragraph"
149
+ }, props));
150
+ }
151
+
152
+ var createHeading = function (level) {
153
+ // https://github.com/necolas/react-native-web/issues/401
154
+ function TypographyHeading(props) {
155
+ return /*#__PURE__*/React.createElement(Typography, _extends({
156
+ accessibilityRole: "header"
157
+ }, props, {
158
+ "aria-level": level
159
+ }));
160
+ }
161
+
162
+ TypographyHeading.displayName = "TypographyHeading".concat(level);
163
+ return TypographyHeading;
164
+ };
165
+
166
+ Typography.Text = TypographyText;
167
+ Typography.Paragraph = TypographyParagraph;
168
+ Typography.h1 = createHeading('1');
169
+ Typography.h2 = createHeading('2');
170
+ Typography.h3 = createHeading('3');
171
+ Typography.h4 = createHeading('4');
172
+ Typography.h5 = createHeading('5');
173
+
174
+ var _templateObject$n;
175
+
176
+ var getFirstCharacter = function (string) {
177
+ return string ? string[0] : '';
178
+ };
179
+
180
+ var getInitials = function (firstname, lastname) {
181
+ return (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
182
+ };
183
+
184
+ var StyledAvatarView = styled.View(_templateObject$n || (_templateObject$n = _taggedTemplateLiteral(["\n border-radius: ", "px;\n background-color: ", ";\n height: ", "px;\n width: ", "px;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n"])), function (_ref) {
185
+ var round = _ref.round,
186
+ size = _ref.size;
187
+ return round ? size / 2 : 10;
188
+ }, function (_ref2) {
189
+ var theme = _ref2.theme,
190
+ light = _ref2.light;
191
+ return light ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
192
+ }, function (_ref3) {
193
+ var size = _ref3.size;
194
+ return size;
195
+ }, function (_ref4) {
196
+ var size = _ref4.size;
197
+ return size;
198
+ });
199
+
200
+ function AvatarContent(_ref5) {
201
+ var _ref5$size = _ref5.size,
202
+ size = _ref5$size === void 0 ? 40 : _ref5$size,
203
+ src = _ref5.src,
204
+ firstname = _ref5.firstname,
205
+ lastname = _ref5.lastname,
206
+ light = _ref5.light;
207
+
208
+ if (src) {
209
+ return /*#__PURE__*/React.createElement(Image, {
210
+ source: {
211
+ uri: src
212
+ },
213
+ style: {
214
+ width: size,
215
+ height: size
216
+ }
217
+ });
218
+ }
219
+
220
+ if (firstname && lastname) {
221
+ return /*#__PURE__*/React.createElement(Typography.Text, {
222
+ base: "body-small",
223
+ variant: "bold",
224
+ color: light ? 'black' : 'white'
225
+ }, getInitials(firstname, lastname));
226
+ }
227
+
228
+ return /*#__PURE__*/React.createElement(Icon, {
229
+ icon: /*#__PURE__*/React.createElement(UserIcon, null),
230
+ color: light ? 'black' : 'white',
231
+ size: size / 2
232
+ });
233
+ }
234
+
235
+ function Avatar(_ref6) {
236
+ var _ref6$size = _ref6.size,
237
+ size = _ref6$size === void 0 ? 40 : _ref6$size,
238
+ rest = _objectWithoutProperties(_ref6, ["size"]);
239
+
240
+ return /*#__PURE__*/React.createElement(StyledAvatarView, _extends({}, rest, {
241
+ size: size
242
+ }), /*#__PURE__*/React.createElement(AvatarContent, _extends({}, rest, {
243
+ size: size
244
+ })));
245
+ }
246
+
247
+ var _templateObject$m;
248
+ var ButtonContainer = styled.Pressable(_templateObject$m || (_templateObject$m = _taggedTemplateLiteral(["\n min-width: ", ";\n max-width: ", ";\n width: ", ";\n min-height: ", ";\n background-color: ", ";\n padding: ", ";\n flex-direction: row;\n\n /* Emulate inline-* css display by making the button taking only its necessary space */\n align-self: flex-start;\n border-radius: ", ";\n border-color: ", ";\n border-width: ", ";\n"])), function (_ref) {
249
+ var theme = _ref.theme;
250
+ return theme.kitt.button.minWidth;
251
+ }, function (_ref2) {
252
+ var theme = _ref2.theme,
253
+ stretch = _ref2.stretch;
254
+ return stretch ? 'auto' : theme.kitt.button.maxWidth;
255
+ }, function (_ref3) {
256
+ var stretch = _ref3.stretch;
257
+ return stretch ? '100%' : 'auto';
258
+ }, function (_ref4) {
259
+ var theme = _ref4.theme;
260
+ return theme.kitt.button.minHeight;
261
+ }, function (_ref5) {
262
+ var theme = _ref5.theme,
263
+ isPressed = _ref5.isPressed,
264
+ disabled = _ref5.disabled,
265
+ type = _ref5.type;
266
+
267
+ if (disabled) {
268
+ return theme.kitt.button[type].disabledBackgroundColor;
269
+ }
270
+
271
+ return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
272
+ }, function (_ref6) {
273
+ var theme = _ref6.theme;
274
+ return theme.kitt.button.contentPadding["default"];
275
+ }, function (_ref7) {
276
+ var theme = _ref7.theme;
277
+ return theme.kitt.button.borderRadius;
278
+ }, function (_ref8) {
279
+ var theme = _ref8.theme,
280
+ disabled = _ref8.disabled,
281
+ type = _ref8.type;
282
+ return disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent';
283
+ }, function (_ref9) {
284
+ var theme = _ref9.theme;
285
+ return theme.kitt.button.borderWidth;
286
+ });
287
+
288
+ function TypographyIconInheritColor(props) {
289
+ var color = useTypographyColor();
290
+ var theme = useTheme();
291
+ return /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
292
+ color: theme.kitt.typography.colors[color]
293
+ }));
294
+ }
295
+
296
+ function TypographyIconSpecifiedColor(_ref) {
297
+ var color = _ref.color,
298
+ otherProps = _objectWithoutProperties(_ref, ["color"]);
299
+
300
+ var theme = useTheme();
301
+ return /*#__PURE__*/React.createElement(Icon, _extends({}, otherProps, {
302
+ color: theme.kitt.typography.colors[color]
303
+ }));
304
+ }
305
+
306
+ function TypographyIcon(_ref2) {
307
+ var color = _ref2.color,
308
+ otherProps = _objectWithoutProperties(_ref2, ["color"]);
309
+
310
+ if (color) {
311
+ return /*#__PURE__*/React.createElement(TypographyIconSpecifiedColor, _extends({
312
+ color: color
313
+ }, otherProps));
314
+ }
315
+
316
+ return /*#__PURE__*/React.createElement(TypographyIconInheritColor, otherProps);
317
+ }
318
+
319
+ var _templateObject$l, _templateObject2$b, _templateObject3$8;
320
+
321
+ var getTextColorByType = function (type, isPressed, disabled) {
322
+ if (disabled) return 'black-light';
323
+
324
+ switch (type) {
325
+ case 'primary':
326
+ return 'white';
327
+
328
+ case 'subtle':
329
+ return isPressed ? 'primary-light' : 'primary';
330
+
331
+ case 'subtle-dark':
332
+ return isPressed ? 'black-light' : 'black';
333
+
334
+ case 'secondary':
335
+ default:
336
+ return 'black';
337
+ }
338
+ };
339
+
340
+ var ButtonText = styled(Typography.Text)(_templateObject$l || (_templateObject$l = _taggedTemplateLiteral(["\n /* On native code, this is the only way to ensure that the text is centered */\n text-align: center;\n"])));
341
+ var Content$1 = styled.View(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteral(["\n flex-direction: row;\n align-items: center;\n justify-content: center;\n\n /*\n On native code flex grow does not work as expected which cause an issue with the flex props.\n In order to occupy only the needed space, we enable flex grow only when stretched\n */\n flex: ", ";\n"])), function (_ref) {
342
+ var stretch = _ref.stretch,
343
+ iconOnly = _ref.iconOnly;
344
+ return "".concat(stretch || iconOnly ? 1 : 0, " 1 auto");
345
+ });
346
+ var IconContainer$1 = styled.View(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref2) {
347
+ var theme = _ref2.theme,
348
+ iconPosition = _ref2.iconPosition;
349
+ var value = theme.kitt.spacing * 3;
350
+
351
+ if (iconPosition === 'left') {
352
+ return "margin: 0 ".concat(value, "px 0 0;");
353
+ }
354
+
355
+ return "margin: 0 0 0 ".concat(value, "px;");
356
+ });
357
+
358
+ function ButtonIcon(_ref3) {
359
+ var icon = _ref3.icon,
360
+ spin = _ref3.spin,
361
+ color = _ref3.color,
362
+ size = _ref3.size,
363
+ iconPosition = _ref3.iconPosition,
364
+ testID = _ref3.testID;
365
+ return /*#__PURE__*/React.createElement(IconContainer$1, {
366
+ iconPosition: iconPosition
367
+ }, /*#__PURE__*/React.createElement(TypographyIcon, {
368
+ icon: icon,
369
+ spin: spin,
370
+ color: color,
371
+ size: size,
372
+ testID: testID
373
+ }));
374
+ }
375
+
376
+ function ButtonContent(_ref4) {
377
+ var type = _ref4.type,
378
+ isPressed = _ref4.isPressed,
379
+ stretch = _ref4.stretch,
380
+ icon = _ref4.icon,
381
+ iconPosition = _ref4.iconPosition,
382
+ iconSpin = _ref4.iconSpin,
383
+ disabled = _ref4.disabled,
384
+ children = _ref4.children;
385
+ var color = getTextColorByType(type, Boolean(isPressed), Boolean(disabled));
386
+ var theme = useTheme();
387
+ var sharedIconProps = {
388
+ spin: iconSpin,
389
+ color: color,
390
+ size: theme.kitt.button.iconSize
391
+ };
392
+
393
+ if (!children) {
394
+ return /*#__PURE__*/React.createElement(Content$1, {
395
+ iconOnly: true,
396
+ stretch: stretch
397
+ }, /*#__PURE__*/React.createElement(TypographyIcon, _extends({}, sharedIconProps, {
398
+ icon: icon
399
+ })));
400
+ }
401
+
402
+ return /*#__PURE__*/React.createElement(Content$1, {
403
+ stretch: stretch
404
+ }, icon && iconPosition === 'left' ? /*#__PURE__*/React.createElement(ButtonIcon, _extends({}, sharedIconProps, {
405
+ icon: icon,
406
+ iconPosition: iconPosition,
407
+ testID: "button-left-icon"
408
+ })) : null, /*#__PURE__*/React.createElement(ButtonText, {
409
+ base: "body",
410
+ color: color,
411
+ variant: "bold"
412
+ }, children), icon && iconPosition === 'right' ? /*#__PURE__*/React.createElement(ButtonIcon, _extends({}, sharedIconProps, {
413
+ icon: icon,
414
+ iconPosition: iconPosition
415
+ })) : null);
416
+ }
417
+
418
+ var useButton = function () {
419
+ var _useState = useState(false),
420
+ _useState2 = _slicedToArray(_useState, 2),
421
+ isPressed = _useState2[0],
422
+ setIsPressed = _useState2[1];
423
+
424
+ return {
425
+ isPressed: isPressed,
426
+ handleButtonPressIn: function handleButtonPressIn() {
427
+ return setIsPressed(true);
428
+ },
429
+ handleButtonPressOut: function handleButtonPressOut() {
430
+ return setIsPressed(false);
431
+ }
432
+ };
433
+ };
434
+
435
+ function Button(_ref) {
436
+ var children = _ref.children,
437
+ _ref$type = _ref.type,
438
+ type = _ref$type === void 0 ? 'secondary' : _ref$type,
439
+ icon = _ref.icon,
440
+ _ref$iconPosition = _ref.iconPosition,
441
+ iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
442
+ iconSpin = _ref.iconSpin,
443
+ stretch = _ref.stretch,
444
+ disabled = _ref.disabled,
445
+ onPress = _ref.onPress,
446
+ testID = _ref.testID;
447
+
448
+ var _useButton = useButton(),
449
+ isPressed = _useButton.isPressed,
450
+ handleButtonPressIn = _useButton.handleButtonPressIn,
451
+ handleButtonPressOut = _useButton.handleButtonPressOut;
452
+
453
+ var sharedProps = {
454
+ type: type,
455
+ stretch: stretch,
456
+ disabled: disabled
457
+ };
458
+ return /*#__PURE__*/React.createElement(ButtonContainer // eslint-disable-next-line unicorn/expiring-todo-comments
459
+ // TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
460
+ // underlayColor={globalTheme.button[type].pressedBackgroundColor}
461
+ , _extends({}, sharedProps, {
462
+ isPressed: isPressed,
463
+ accessibilityRole: "button",
464
+ testID: testID,
465
+ onPress: onPress,
466
+ onPressIn: handleButtonPressIn,
467
+ onPressOut: handleButtonPressOut
468
+ }), /*#__PURE__*/React.createElement(ButtonContent, _extends({}, sharedProps, {
469
+ icon: icon,
470
+ iconPosition: iconPosition,
471
+ iconSpin: iconSpin
472
+ }), children));
473
+ }
474
+
475
+ var _templateObject$k;
476
+ var Container$5 = styled.View(_templateObject$k || (_templateObject$k = _taggedTemplateLiteral(["\n background-color: ", ";\n padding: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-color: ", ";\n"])), function (_ref) {
477
+ var theme = _ref.theme,
478
+ type = _ref.type;
479
+ return theme.kitt.card[type].backgroundColor;
480
+ }, function (_ref2) {
481
+ var theme = _ref2.theme;
482
+ return theme.kitt.card.padding;
483
+ }, function (_ref3) {
484
+ var theme = _ref3.theme;
485
+ return theme.kitt.card.borderRadius;
486
+ }, function (_ref4) {
487
+ var theme = _ref4.theme;
488
+ return theme.kitt.card.borderWidth;
489
+ }, function (_ref5) {
490
+ var theme = _ref5.theme,
491
+ type = _ref5.type;
492
+ return theme.kitt.card[type].borderColor;
493
+ });
494
+ function Card(_ref6) {
495
+ var children = _ref6.children,
496
+ type = _ref6.type;
497
+ return /*#__PURE__*/React.createElement(Container$5, {
498
+ type: type
499
+ }, children);
500
+ }
501
+
502
+ var getColorFromState = function (state) {
503
+ switch (state) {
504
+ case 'invalid':
505
+ return 'danger';
506
+
507
+ default:
508
+ return 'grey';
509
+ }
510
+ };
511
+
512
+ function InputFeedback(_ref) {
513
+ var state = _ref.state,
514
+ testID = _ref.testID,
515
+ children = _ref.children;
516
+ return /*#__PURE__*/React.createElement(Typography.Text, {
517
+ base: "body-small",
518
+ color: getColorFromState(state),
519
+ testID: testID
520
+ }, children);
521
+ }
522
+
523
+ var _templateObject$j, _templateObject2$a, _templateObject3$7, _templateObject4$5;
524
+ var FieldContainer = styled.View(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n padding: 5px 0 10px;\n"]))); // eslint-disable-next-line unicorn/expiring-todo-comments
525
+ // TODO: https://ornikar.atlassian.net/browse/INSTRUCTOR-202
526
+ // @media (--small-breakpoint) {
527
+ // padding: 10px 0;
528
+ // }
529
+
530
+ var FeedbackContainer = styled.View(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteral(["\n padding-top: 5px;\n"])));
531
+ var FieldLabelContainer = styled.View(_templateObject3$7 || (_templateObject3$7 = _taggedTemplateLiteral(["\n flex-direction: row;\n align-items: center;\n padding-bottom: ", "px;\n"])), function (_ref) {
532
+ var theme = _ref.theme;
533
+ return theme.reactForms.labelContainerPaddingBottom;
534
+ });
535
+ var LabelContainer = styled.View(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteral(["\n margin-right: ", "px;\n"])), function (_ref2) {
536
+ var theme = _ref2.theme;
537
+ return theme.reactForms.iconMarginLeft;
538
+ });
539
+ function InputField(_ref3) {
540
+ var label = _ref3.label,
541
+ labelFeedback = _ref3.labelFeedback,
542
+ input = _ref3.input,
543
+ feedback = _ref3.feedback;
544
+ return /*#__PURE__*/React.createElement(FieldContainer, null, label ? /*#__PURE__*/React.createElement(FieldLabelContainer, null, /*#__PURE__*/React.createElement(LabelContainer, null, label), labelFeedback) : null, input, feedback ? /*#__PURE__*/React.createElement(FeedbackContainer, null, feedback) : null);
545
+ }
546
+
547
+ var useInputText = function () {
548
+ var _useState = useState(false),
549
+ _useState2 = _slicedToArray(_useState, 2),
550
+ isFocused = _useState2[0],
551
+ setIsFocused = _useState2[1];
552
+
553
+ var _useState3 = useState(false),
554
+ _useState4 = _slicedToArray(_useState3, 2),
555
+ isPasswordVisible = _useState4[0],
556
+ setIsPasswordVisible = _useState4[1];
557
+
558
+ return {
559
+ isFocused: isFocused,
560
+ handleInputFocus: function handleInputFocus() {
561
+ return setIsFocused(true);
562
+ },
563
+ handleInputBlur: function handleInputBlur() {
564
+ return setIsFocused(false);
565
+ },
566
+ togglePasswordVisibility: function togglePasswordVisibility() {
567
+ return setIsPasswordVisible(function (isVisible) {
568
+ return !isVisible;
569
+ });
570
+ },
571
+ isPasswordVisible: isPasswordVisible
572
+ };
573
+ };
574
+
575
+ var _templateObject$i, _templateObject2$9, _templateObject3$6, _templateObject4$4;
576
+ var styledTextInputMixin = css(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n /* stylelint-disable declaration-property-value-allowed-list */\n background-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n border-color: ", ";\n font-size: ", ";\n color: ", ";\n font-family: ", ";\n"])), function (_ref) {
577
+ var theme = _ref.theme,
578
+ state = _ref.state;
579
+ return state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states["default"].backgroundColor;
580
+ }, function (_ref2) {
581
+ var theme = _ref2.theme;
582
+ return theme.kitt.forms.input.borderWidth;
583
+ }, function (_ref3) {
584
+ var theme = _ref3.theme;
585
+ return theme.kitt.forms.input.borderRadius;
586
+ }, function (_ref4) {
587
+ var theme = _ref4.theme,
588
+ state = _ref4.state;
589
+ return theme.kitt.forms.input.states[state].borderColor;
590
+ }, function (_ref5) {
591
+ var theme = _ref5.theme;
592
+ return theme.kitt.typography.types.bodies.configs.body.baseAndSmall.fontSize;
593
+ }, function (_ref6) {
594
+ var theme = _ref6.theme,
595
+ state = _ref6.state;
596
+ return theme.kitt.typography.colors[theme.kitt.forms.input.states[state].color];
597
+ }, function (_ref7) {
598
+ var theme = _ref7.theme;
599
+ return theme.kitt.typography.types.bodies.fontFamily.regular;
600
+ });
601
+ var Input = styled.TextInput(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteral(["\n /* stylelint-disable declaration-bang-space-before */\n /* stylelint-disable comment-word-disallowed-list */\n\n /* FIXME: text input is not vertically centered on iOS because of bigger line-height */\n ", "\n padding: ", ";\n line-height: ", ";\n min-height: ", "px;\n"])), styledTextInputMixin, function (_ref8) {
602
+ var theme = _ref8.theme,
603
+ multiline = _ref8.multiline;
604
+ return !multiline && Platform.OS === 'ios' ? theme.kitt.forms.input.paddingSingleLineIOS : theme.kitt.forms.input.padding;
605
+ }, function (_ref9) {
606
+ var theme = _ref9.theme,
607
+ multiline = _ref9.multiline;
608
+ return !multiline && Platform.OS === 'ios' ? 0 : theme.kitt.typography.types.bodies.configs.body.baseAndSmall.lineHeight;
609
+ }, function (_ref10) {
610
+ var minHeight = _ref10.minHeight;
611
+ return minHeight;
612
+ });
613
+ var Container$4 = styled.View(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteral(["\n margin-top: ", ";\n margin-bottom: ", ";\n"])), function (_ref11) {
614
+ var theme = _ref11.theme;
615
+ return theme.kitt.forms.input.marginTop;
616
+ }, function (_ref12) {
617
+ var theme = _ref12.theme;
618
+ return theme.kitt.forms.input.marginBottom;
619
+ });
620
+ var PasswordButtonContainer = styled.Pressable(_templateObject4$4 || (_templateObject4$4 = _taggedTemplateLiteral(["\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n justify-content: center;\n padding: ", "px;\n"])), function (_ref13) {
621
+ var theme = _ref13.theme;
622
+ return theme.kitt.forms.input.passwordButtonIconSize / 2;
623
+ });
624
+
625
+ var getInputState = function (_ref14) {
626
+ var isDisabled = _ref14.isDisabled,
627
+ isFocused = _ref14.isFocused,
628
+ formState = _ref14.formState;
629
+ if (isDisabled) return 'disabled';
630
+ if (isFocused) return 'focus';
631
+ if (formState === 'invalid') return 'invalid';
632
+ return 'default';
633
+ };
634
+
635
+ var keyboardTypeByTextInputType = {
636
+ text: 'default',
637
+ email: 'email-address',
638
+ password: 'default',
639
+ username: 'default'
640
+ };
641
+ var autoCompleteTypeByType = {
642
+ text: 'off',
643
+ email: 'email',
644
+ password: 'password',
645
+ username: 'name'
646
+ };
647
+ var autoCorrectByType = {
648
+ text: true,
649
+ email: false,
650
+ password: false,
651
+ username: false
652
+ };
653
+ var textContentTypeByType = {
654
+ text: 'none',
655
+ email: 'emailAddress',
656
+ password: 'password',
657
+ username: 'username'
658
+ };
659
+ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
660
+ var id = _ref15.id,
661
+ _ref15$minHeight = _ref15.minHeight,
662
+ minHeight = _ref15$minHeight === void 0 ? 0 : _ref15$minHeight,
663
+ type = _ref15.type,
664
+ formState = _ref15.state,
665
+ internalForceState = _ref15.internalForceState,
666
+ _ref15$disabled = _ref15.disabled,
667
+ disabled = _ref15$disabled === void 0 ? false : _ref15$disabled,
668
+ _onFocus = _ref15.onFocus,
669
+ _onBlur = _ref15.onBlur,
670
+ props = _objectWithoutProperties(_ref15, ["id", "minHeight", "type", "state", "internalForceState", "disabled", "onFocus", "onBlur"]);
671
+
672
+ var _useInputText = useInputText(),
673
+ isFocused = _useInputText.isFocused,
674
+ handleInputBlur = _useInputText.handleInputBlur,
675
+ handleInputFocus = _useInputText.handleInputFocus,
676
+ isPasswordVisible = _useInputText.isPasswordVisible,
677
+ togglePasswordVisibility = _useInputText.togglePasswordVisibility;
678
+
679
+ var theme = useTheme();
680
+ var state = internalForceState || getInputState({
681
+ isFocused: isFocused,
682
+ isDisabled: disabled,
683
+ formState: formState
684
+ });
685
+ return /*#__PURE__*/React.createElement(Container$4, null, /*#__PURE__*/React.createElement(Input, _extends({
686
+ ref: ref,
687
+ nativeID: id,
688
+ editable: !disabled,
689
+ keyboardType: keyboardTypeByTextInputType[type],
690
+ autoCompleteType: autoCompleteTypeByType[type],
691
+ autoCorrect: autoCorrectByType[type],
692
+ minHeight: minHeight,
693
+ textContentType: textContentTypeByType[type],
694
+ placeholderTextColor: theme.kitt.typography.colors[theme.kitt.forms.input.placeholderColor],
695
+ selectionColor: theme.kitt.forms.input.selectionColor,
696
+ secureTextEntry: type === 'password' && !isPasswordVisible
697
+ }, props, {
698
+ state: state,
699
+ onFocus: function onFocus(e) {
700
+ handleInputFocus();
701
+ if (_onFocus) _onFocus(e);
702
+ },
703
+ onBlur: function onBlur(e) {
704
+ handleInputBlur();
705
+ if (_onBlur) _onBlur(e);
706
+ }
707
+ })), type === 'password' && !disabled && /*#__PURE__*/React.createElement(PasswordButtonContainer, {
708
+ onPress: togglePasswordVisibility
709
+ }, /*#__PURE__*/React.createElement(TypographyIcon, {
710
+ icon: isPasswordVisible ? /*#__PURE__*/React.createElement(EyeIcon, null) : /*#__PURE__*/React.createElement(EyeOffIcon, null),
711
+ size: theme.kitt.forms.input.passwordButtonIconSize,
712
+ color: theme.kitt.forms.input.states[state].passwordButtonIconColor
713
+ })));
714
+ });
715
+
716
+ function Label(_ref) {
717
+ var htmlFor = _ref.htmlFor,
718
+ children = _ref.children;
719
+ return /*#__PURE__*/React.createElement(Typography.Text, {
720
+ base: "body"
721
+ }, Platform.OS === 'web' ? /*#__PURE__*/React.createElement("label", {
722
+ htmlFor: htmlFor
723
+ }, children) : children);
724
+ }
725
+
726
+ var _templateObject$h, _templateObject2$8, _templateObject3$5, _templateObject4$3, _templateObject5;
727
+ var OuterRadio = styled.View(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral(["\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n border-radius: ", "px;\n border-width: ", ";\n border-color: ", ";\n"])), function (_ref) {
728
+ var theme = _ref.theme,
729
+ disabled = _ref.disabled;
730
+ return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor;
731
+ }, function (_ref2) {
732
+ var theme = _ref2.theme;
733
+ return theme.kitt.forms.radio.size;
734
+ }, function (_ref3) {
735
+ var theme = _ref3.theme;
736
+ return theme.kitt.forms.radio.size;
737
+ }, function (_ref4) {
738
+ var theme = _ref4.theme;
739
+ return theme.kitt.forms.radio.size / 2;
740
+ }, function (_ref5) {
741
+ var theme = _ref5.theme;
742
+ return theme.kitt.forms.radio.unchecked.borderWidth;
743
+ }, function (_ref6) {
744
+ var theme = _ref6.theme,
745
+ disabled = _ref6.disabled;
746
+ return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor;
747
+ });
748
+ var SelectedOuterRadio = styled.View(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteral(["\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n border-radius: ", "px;\n justify-content: center;\n align-items: center;\n"])), function (_ref7) {
749
+ var theme = _ref7.theme;
750
+ return theme.kitt.forms.radio.checked.backgroundColor;
751
+ }, function (_ref8) {
752
+ var theme = _ref8.theme;
753
+ return theme.kitt.forms.radio.size;
754
+ }, function (_ref9) {
755
+ var theme = _ref9.theme;
756
+ return theme.kitt.forms.radio.size;
757
+ }, function (_ref10) {
758
+ var theme = _ref10.theme;
759
+ return theme.kitt.forms.radio.size / 2;
760
+ });
761
+ var SelectedInnerRadio = styled.View(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteral(["\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n border-radius: ", "px;\n"])), function (_ref11) {
762
+ var theme = _ref11.theme;
763
+ return theme.kitt.forms.radio.checked.innerBackgroundColor;
764
+ }, function (_ref12) {
765
+ var theme = _ref12.theme;
766
+ return theme.kitt.forms.radio.checked.innerSize;
767
+ }, function (_ref13) {
768
+ var theme = _ref13.theme;
769
+ return theme.kitt.forms.radio.checked.innerSize;
770
+ }, function (_ref14) {
771
+ var theme = _ref14.theme;
772
+ return theme.kitt.forms.radio.checked.innerSize / 2;
773
+ });
774
+ var Container$3 = styled.Pressable(_templateObject4$3 || (_templateObject4$3 = _taggedTemplateLiteral(["\n flex-direction: row;\n align-items: center;\n"])));
775
+ var Text = styled(Typography.Text)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: ", "px;\n"])), function (_ref15) {
776
+ var theme = _ref15.theme;
777
+ return theme.kitt.spacing * 2;
778
+ });
779
+ function Radio(_ref16) {
780
+ var id = _ref16.id,
781
+ checked = _ref16.checked,
782
+ onChange = _ref16.onChange,
783
+ value = _ref16.value,
784
+ _ref16$disabled = _ref16.disabled,
785
+ disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
786
+ children = _ref16.children;
787
+ return /*#__PURE__*/React.createElement(Container$3, {
788
+ nativeID: id,
789
+ disabled: disabled,
790
+ accessibilityRole: "radio",
791
+ "aria-checked": checked,
792
+ accessible: checked && !disabled,
793
+ onPress: function handlePress() {
794
+ onChange(value);
795
+ }
796
+ }, checked && !disabled ? /*#__PURE__*/React.createElement(SelectedOuterRadio, null, /*#__PURE__*/React.createElement(SelectedInnerRadio, null)) : /*#__PURE__*/React.createElement(OuterRadio, {
797
+ disabled: disabled
798
+ }), /*#__PURE__*/React.createElement(Text, {
799
+ base: "body",
800
+ color: disabled ? 'black-light' : 'black'
801
+ }, children));
802
+ }
803
+
804
+ function TextArea(_ref) {
805
+ var props = _extends({}, _ref);
806
+
807
+ var theme = useTheme();
808
+ return /*#__PURE__*/React.createElement(InputText, _extends({
809
+ multiline: true
810
+ }, props, {
811
+ type: "text",
812
+ minHeight: theme.kitt.forms.input.textAreaMinHeight
813
+ }));
814
+ }
815
+
816
+ var KittBreakpoints = {
817
+ /**
818
+ * min-width: 0
819
+ */
820
+ BASE: 0,
821
+
822
+ /**
823
+ * min-width: 480px
824
+ */
825
+ SMALL: 480,
826
+
827
+ /**
828
+ * min-width: 768px
829
+ */
830
+ MEDIUM: 768,
831
+
832
+ /**
833
+ * min-width: 1024px
834
+ */
835
+ LARGE: 1024,
836
+
837
+ /**
838
+ * min-width: 1280px
839
+ */
840
+ WIDE: 1280
841
+ };
842
+
843
+ var _templateObject$g;
844
+ var Body = styled.View(_templateObject$g || (_templateObject$g = _taggedTemplateLiteral(["\n ", "\n background-color: ", ";\n flex: 1;\n"])), function (_ref) {
845
+ var theme = _ref.theme;
846
+ return theme.responsive.ifWindowSizeMatches({
847
+ minWidth: KittBreakpoints.MEDIUM
848
+ }, "padding-right: ".concat(theme.kitt.spacing * 12, "px;\n padding-left: ").concat(theme.kitt.spacing * 12, "px;"), "padding-right: ".concat(theme.kitt.spacing * 6, "px;\n padding-left: ").concat(theme.kitt.spacing * 6, "px;"));
849
+ }, function (_ref2) {
850
+ var theme = _ref2.theme;
851
+ return theme.kitt.colors.uiBackgroundLight;
852
+ });
853
+ function FullScreenModalBody(_ref3) {
854
+ var children = _ref3.children;
855
+ return /*#__PURE__*/React.createElement(Body, null, children);
856
+ }
857
+
858
+ var _templateObject$f, _templateObject2$7, _templateObject3$4;
859
+ var SideContainer = styled.View(_templateObject$f || (_templateObject$f = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref) {
860
+ var theme = _ref.theme,
861
+ _ref$side = _ref.side,
862
+ side = _ref$side === void 0 ? 'left' : _ref$side;
863
+ var padding = theme.kitt.spacing * 2;
864
+
865
+ if (side === 'left') {
866
+ return "padding-right: ".concat(padding, "px;");
867
+ }
868
+
869
+ return "padding-left: ".concat(padding, "px;");
870
+ });
871
+
872
+ function getHeaderHorizontalMediumPadding(spacing) {
873
+ return spacing * 6;
874
+ }
875
+
876
+ var Header = styled.View(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteral(["\n ", ";\n border-bottom-color: ", ";\n border-bottom-width: 1px;\n flex-direction: row;\n align-items: center;\n"])), function (_ref2) {
877
+ var theme = _ref2.theme,
878
+ _ref2$insetTop = _ref2.insetTop,
879
+ insetTop = _ref2$insetTop === void 0 ? 0 : _ref2$insetTop;
880
+ var paddingTop = insetTop + theme.kitt.fullScreenModal.header.padding;
881
+ var padding = theme.kitt.fullScreenModal.header.padding;
882
+ return theme.responsive.ifWindowSizeMatches({
883
+ minWidth: KittBreakpoints.MEDIUM
884
+ }, "padding: ".concat(paddingTop, "px ").concat(getHeaderHorizontalMediumPadding(theme.kitt.spacing), "px ").concat(padding, "px;"), "padding: ".concat(paddingTop, "px ").concat(padding, "px ").concat(padding, "px;"));
885
+ }, function (_ref3) {
886
+ var theme = _ref3.theme;
887
+ return theme.kitt.fullScreenModal.header.borderColor;
888
+ });
889
+ var HeaderContent = styled.View(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n justify-content: center;\n align-items: center;\n"])), function (_ref4) {
890
+ var theme = _ref4.theme,
891
+ leftWidth = _ref4.leftWidth,
892
+ rightWidth = _ref4.rightWidth,
893
+ windowWidth = _ref4.windowWidth;
894
+
895
+ /*
896
+ * Since we don't have controll over the rendered left and right elements,
897
+ * we must apply some logic to give the title all the available space
898
+ */
899
+ var sideElementMaxWidth = Math.max(leftWidth, rightWidth);
900
+ var parentHorizontalPadding = theme.kitt.fullScreenModal.header.padding * 2;
901
+ var parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
902
+
903
+ var computeWidth = function (breakpointPadding) {
904
+ return windowWidth - breakpointPadding - sideElementMaxWidth * 2;
905
+ };
906
+
907
+ return theme.responsive.ifWindowSizeMatches({
908
+ minWidth: KittBreakpoints.MEDIUM
909
+ }, "width: ".concat(computeWidth(parentHorizontalPaddingMedium), "px;"), "width: ".concat(computeWidth(parentHorizontalPadding), "px;"));
910
+ }, function (_ref5) {
911
+ var leftWidth = _ref5.leftWidth,
912
+ rightWidth = _ref5.rightWidth;
913
+ // Depending of the wider element, we must add a margin to fill the diff in space between elements
914
+ var deltaMargin = Math.abs(leftWidth - rightWidth);
915
+
916
+ if (leftWidth > rightWidth) {
917
+ return "margin-right: ".concat(deltaMargin, "px;");
918
+ }
919
+
920
+ return "margin-left: ".concat(deltaMargin, "px;");
921
+ });
922
+ function FullScreenModalHeader(_ref6) {
923
+ var children = _ref6.children,
924
+ right = _ref6.right,
925
+ left = _ref6.left;
926
+
927
+ var _useSafeAreaInsets = useSafeAreaInsets(),
928
+ top = _useSafeAreaInsets.top;
929
+
930
+ var dimensions = useWindowDimensions();
931
+
932
+ var _useState = useState(0),
933
+ _useState2 = _slicedToArray(_useState, 2),
934
+ leftWidth = _useState2[0],
935
+ setLeftWidth = _useState2[1];
936
+
937
+ var _useState3 = useState(0),
938
+ _useState4 = _slicedToArray(_useState3, 2),
939
+ rightWidth = _useState4[0],
940
+ setRightWidth = _useState4[1];
941
+
942
+ var handleLayoutChange = function (event, side) {
943
+ // Prevents react to nullify event on rerenders
944
+ event.persist();
945
+
946
+ if (side === 'left') {
947
+ setLeftWidth(event.nativeEvent.layout.width);
948
+ return;
949
+ }
950
+
951
+ setRightWidth(event.nativeEvent.layout.width);
952
+ };
953
+
954
+ return /*#__PURE__*/React.createElement(Header, {
955
+ insetTop: Platform.OS === 'ios' ? undefined : top
956
+ }, left ? /*#__PURE__*/React.createElement(SideContainer, {
957
+ onLayout: function onLayout(e) {
958
+ return handleLayoutChange(e, 'left');
959
+ }
960
+ }, left) : null, /*#__PURE__*/React.createElement(HeaderContent, {
961
+ windowWidth: dimensions.width,
962
+ leftWidth: leftWidth,
963
+ rightWidth: rightWidth
964
+ }, children), right ? /*#__PURE__*/React.createElement(SideContainer, {
965
+ side: "right",
966
+ onLayout: function onLayout(e) {
967
+ return handleLayoutChange(e, 'right');
968
+ }
969
+ }, right) : null);
970
+ }
971
+
972
+ var _templateObject$e;
973
+ var Container$2 = styled.View(_templateObject$e || (_templateObject$e = _taggedTemplateLiteral(["\n flex: 1;\n background-color: ", ";\n"])), function (_ref) {
974
+ var theme = _ref.theme;
975
+ return theme.kitt.colors.uiBackground;
976
+ });
977
+ function FullScreenModal(_ref2) {
978
+ var children = _ref2.children;
979
+ return /*#__PURE__*/React.createElement(Container$2, null, children);
980
+ }
981
+ FullScreenModal.Header = FullScreenModalHeader;
982
+ FullScreenModal.Body = FullScreenModalBody;
983
+
984
+ var lateOceanColorPalette = {
985
+ lateOcean: '#4C34E0',
986
+ lateOceanLight1: '#705DE6',
987
+ lateOceanLight2: '#9485EC',
988
+ lateOceanLight3: '#D6BAF9',
989
+ warmEmbrace: '#F4D3CE',
990
+ warmEmbraceLight1: '#FFEDE6',
991
+ black1000: '#000000',
992
+ black555: '#737373',
993
+ black200: '#CCCCCC',
994
+ black100: '#E5E5E5',
995
+ black50: '#F2F2F2',
996
+ black25: '#F9F9F9',
997
+ white: '#FFFFFF',
998
+ viride: '#38836D',
999
+ englishVermillon: '#D44148',
1000
+ goldCrayola: '#F8C583',
1001
+ aero: '#89BDDD',
1002
+ transparent: 'transparent'
1003
+ };
1004
+
1005
+ var avatarLateOceanTheme = {
1006
+ "default": {
1007
+ color: lateOceanColorPalette.white,
1008
+ backgroundColor: lateOceanColorPalette.lateOcean
1009
+ },
1010
+ light: {
1011
+ color: lateOceanColorPalette.black1000,
1012
+ backgroundColor: lateOceanColorPalette.black100
1013
+ }
1014
+ };
1015
+
1016
+ var buttonLateOceanTheme = {
1017
+ borderRadius: '30px',
1018
+ borderWidth: '2px',
1019
+ minHeight: '42px',
1020
+ minWidth: '40px',
1021
+ maxWidth: '335px',
1022
+ iconSize: 18,
1023
+ contentPadding: {
1024
+ "default": '8px 16px'
1025
+ },
1026
+ primary: {
1027
+ backgroundColor: lateOceanColorPalette.lateOcean,
1028
+ disabledBackgroundColor: lateOceanColorPalette.black50,
1029
+ pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
1030
+ disabledBorderColor: lateOceanColorPalette.black100
1031
+ },
1032
+ secondary: {
1033
+ backgroundColor: lateOceanColorPalette.black50,
1034
+ disabledBackgroundColor: lateOceanColorPalette.black50,
1035
+ pressedBackgroundColor: lateOceanColorPalette.black100,
1036
+ disabledBorderColor: lateOceanColorPalette.black100
1037
+ },
1038
+ subtle: {
1039
+ backgroundColor: lateOceanColorPalette.transparent,
1040
+ disabledBackgroundColor: lateOceanColorPalette.transparent,
1041
+ pressedBackgroundColor: lateOceanColorPalette.transparent,
1042
+ disabledBorderColor: lateOceanColorPalette.transparent
1043
+ },
1044
+ 'subtle-dark': {
1045
+ backgroundColor: lateOceanColorPalette.transparent,
1046
+ disabledBackgroundColor: lateOceanColorPalette.transparent,
1047
+ pressedBackgroundColor: lateOceanColorPalette.transparent,
1048
+ disabledBorderColor: lateOceanColorPalette.transparent
1049
+ }
1050
+ };
1051
+
1052
+ var cardLateOceanTheme = {
1053
+ borderRadius: '20px',
1054
+ borderWidth: '2px',
1055
+ padding: '16px',
1056
+ primary: {
1057
+ backgroundColor: lateOceanColorPalette.white,
1058
+ borderColor: lateOceanColorPalette.lateOcean
1059
+ },
1060
+ secondary: {
1061
+ backgroundColor: lateOceanColorPalette.white,
1062
+ borderColor: lateOceanColorPalette.black100
1063
+ },
1064
+ subtle: {
1065
+ backgroundColor: lateOceanColorPalette.black50,
1066
+ borderColor: lateOceanColorPalette.black100
1067
+ }
1068
+ };
1069
+
1070
+ var colorsLateOceanTheme = {
1071
+ primary: lateOceanColorPalette.lateOcean,
1072
+ accent: lateOceanColorPalette.warmEmbrace,
1073
+ accentLight: lateOceanColorPalette.warmEmbraceLight1,
1074
+ success: lateOceanColorPalette.viride,
1075
+ correct: lateOceanColorPalette.viride,
1076
+ danger: lateOceanColorPalette.englishVermillon,
1077
+ separator: lateOceanColorPalette.black100,
1078
+ hover: lateOceanColorPalette.black100,
1079
+ uiBackground: lateOceanColorPalette.black25,
1080
+ uiBackgroundLight: lateOceanColorPalette.white,
1081
+ overlay: {
1082
+ dark: 'rgba(41, 48, 51, 0.25)',
1083
+ light: 'rgba(255, 255, 255, 0.90)',
1084
+ fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
1085
+ }
1086
+ };
1087
+
1088
+ var feedbackMessageLateOceanTheme = {
1089
+ backgroundColors: {
1090
+ success: lateOceanColorPalette.viride,
1091
+ danger: lateOceanColorPalette.englishVermillon,
1092
+ warning: lateOceanColorPalette.goldCrayola,
1093
+ info: lateOceanColorPalette.aero
1094
+ }
1095
+ };
1096
+
1097
+ var inputStatesStyle = {
1098
+ "default": {
1099
+ backgroundColor: lateOceanColorPalette.white,
1100
+ borderColor: lateOceanColorPalette.black100,
1101
+ color: 'black',
1102
+ passwordButtonIconColor: 'black'
1103
+ },
1104
+ hover: {
1105
+ borderColor: lateOceanColorPalette.black200,
1106
+ color: 'black',
1107
+ passwordButtonIconColor: 'black'
1108
+ },
1109
+ focus: {
1110
+ borderColor: lateOceanColorPalette.lateOcean,
1111
+ color: 'black',
1112
+ passwordButtonIconColor: 'black'
1113
+ },
1114
+ disabled: {
1115
+ backgroundColor: lateOceanColorPalette.black50,
1116
+ borderColor: lateOceanColorPalette.black100,
1117
+ color: 'black-light',
1118
+ passwordButtonIconColor: 'black-light'
1119
+ },
1120
+ invalid: {
1121
+ borderColor: lateOceanColorPalette.englishVermillon,
1122
+ color: 'black',
1123
+ passwordButtonIconColor: 'black'
1124
+ }
1125
+ };
1126
+ var inputLateOceanTheme = {
1127
+ marginTop: '2px',
1128
+ marginBottom: '4px',
1129
+ borderWidth: '2px',
1130
+ borderRadius: '10px',
1131
+ passwordButtonIconSize: 20,
1132
+ padding: '7px 16px',
1133
+ paddingSingleLineIOS: '12px 16px',
1134
+ selectionColor: lateOceanColorPalette.lateOcean,
1135
+ placeholderColor: 'black-light',
1136
+ textAreaMinHeight: 120,
1137
+ states: inputStatesStyle
1138
+ };
1139
+
1140
+ var radioLateOceanTheme = {
1141
+ size: 18,
1142
+ unchecked: {
1143
+ backgroundColor: lateOceanColorPalette.white,
1144
+ borderWidth: '2px',
1145
+ borderColor: lateOceanColorPalette.black200
1146
+ },
1147
+ checked: {
1148
+ backgroundColor: lateOceanColorPalette.lateOcean,
1149
+ innerSize: 5,
1150
+ innerBackgroundColor: lateOceanColorPalette.white
1151
+ },
1152
+ disabled: {
1153
+ backgroundColor: lateOceanColorPalette.black50,
1154
+ borderColor: lateOceanColorPalette.black100
1155
+ }
1156
+ };
1157
+
1158
+ var formsLateOceanTheme = {
1159
+ input: inputLateOceanTheme,
1160
+ radio: radioLateOceanTheme
1161
+ };
1162
+
1163
+ var fullScreenModalLateOceanTheme = {
1164
+ header: {
1165
+ padding: 11,
1166
+ borderColor: lateOceanColorPalette.black100
1167
+ }
1168
+ };
1169
+
1170
+ var listItemLateOceanTheme = {
1171
+ padding: '12px 16px',
1172
+ borderColor: colorsLateOceanTheme.separator,
1173
+ borderWidth: '1px',
1174
+ innerMargin: '8px'
1175
+ };
1176
+
1177
+ var shadowsLateOceanTheme = {
1178
+ medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
1179
+ };
1180
+
1181
+ var tagLateOceanTheme = {
1182
+ borderRadius: '10px',
1183
+ padding: '2px 12px',
1184
+ primary: {
1185
+ // eslint-disable-next-line unicorn/expiring-todo-comments
1186
+ // TODO: validate Moon shadow color with design team
1187
+ backgroundColor: '#EDEBFC'
1188
+ },
1189
+ "default": {
1190
+ backgroundColor: lateOceanColorPalette.black50
1191
+ },
1192
+ danger: {
1193
+ backgroundColor: lateOceanColorPalette.warmEmbrace
1194
+ }
1195
+ };
1196
+
1197
+ var calcLineHeight = function (fontSize, lineHeightMultiplier) {
1198
+ return Math.round(fontSize * lineHeightMultiplier);
1199
+ };
1200
+
1201
+ var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
1202
+ return {
1203
+ baseAndSmall: {
1204
+ fontSize: "".concat(baseAndSmallFontSize, "px"),
1205
+ lineHeight: "".concat(calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize), "px")
1206
+ },
1207
+ mediumAndWide: {
1208
+ fontSize: "".concat(mediumAndWideFontSize, "px"),
1209
+ lineHeight: "".concat(calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize), "px")
1210
+ }
1211
+ };
1212
+ };
1213
+
1214
+ var typographyLateOceanTheme = {
1215
+ colors: {
1216
+ black: lateOceanColorPalette.black1000,
1217
+ 'black-light': lateOceanColorPalette.black555,
1218
+ grey: lateOceanColorPalette.black555,
1219
+ 'grey-light': lateOceanColorPalette.black200,
1220
+ white: lateOceanColorPalette.white,
1221
+ 'white-light': lateOceanColorPalette.white,
1222
+ primary: lateOceanColorPalette.lateOcean,
1223
+ 'primary-light': lateOceanColorPalette.lateOceanLight1,
1224
+ accent: lateOceanColorPalette.warmEmbrace,
1225
+ success: lateOceanColorPalette.viride,
1226
+ danger: lateOceanColorPalette.englishVermillon
1227
+ },
1228
+ types: {
1229
+ headers: {
1230
+ fontFamily: {
1231
+ regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
1232
+ bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
1233
+ italic: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
1234
+ },
1235
+ fontWeight: 400,
1236
+ fontStyle: 'normal',
1237
+ configs: {
1238
+ // also known as xxlarge
1239
+ header1: createTypographyTypeConfig(1.3, 38, 62),
1240
+ // also known as xlarge
1241
+ header2: createTypographyTypeConfig(1.3, 32, 48),
1242
+ // also known as medium
1243
+ header3: createTypographyTypeConfig(1.3, 24, 36),
1244
+ // also known as xsmall
1245
+ header4: createTypographyTypeConfig(1.3, 18, 24),
1246
+ // also known as xxsmall
1247
+ header5: createTypographyTypeConfig(1.3, 18, 18)
1248
+ }
1249
+ },
1250
+ bodies: {
1251
+ fontFamily: {
1252
+ regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
1253
+ bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold',
1254
+ italic: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Italic'
1255
+ },
1256
+ fontWeight: {
1257
+ regular: 400,
1258
+ bold: 700,
1259
+ italic: 400
1260
+ },
1261
+ fontStyle: {
1262
+ regular: 'normal',
1263
+ bold: 'normal',
1264
+ italic: 'italic'
1265
+ },
1266
+ configs: {
1267
+ 'body-large': createTypographyTypeConfig(1.6, 18, 24),
1268
+ 'body-medium': createTypographyTypeConfig(1.6, 18, 18),
1269
+ body: createTypographyTypeConfig(1.6, 16, 16),
1270
+ 'body-small': createTypographyTypeConfig(1.6, 14, 14),
1271
+ 'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
1272
+ }
1273
+ }
1274
+ }
1275
+ };
1276
+
1277
+ var theme = {
1278
+ spacing: 4,
1279
+ colors: colorsLateOceanTheme,
1280
+ palettes: {
1281
+ lateOcean: lateOceanColorPalette
1282
+ },
1283
+ avatar: avatarLateOceanTheme,
1284
+ button: buttonLateOceanTheme,
1285
+ card: cardLateOceanTheme,
1286
+ feedbackMessage: feedbackMessageLateOceanTheme,
1287
+ forms: formsLateOceanTheme,
1288
+ typography: typographyLateOceanTheme,
1289
+ tag: tagLateOceanTheme,
1290
+ shadows: shadowsLateOceanTheme,
1291
+ fullScreenModal: fullScreenModalLateOceanTheme,
1292
+ listItem: listItemLateOceanTheme
1293
+ };
1294
+
1295
+ function matchWindowSize(currentWidth, _ref) {
1296
+ var minWidth = _ref.minWidth,
1297
+ maxWidth = _ref.maxWidth;
1298
+ return currentWidth >= minWidth && (!maxWidth || currentWidth <= maxWidth);
1299
+ }
1300
+
1301
+ function createWindowSizeHelper(currentWidth) {
1302
+ return {
1303
+ matchWindowSize: function matchWindowSize$1(options) {
1304
+ return matchWindowSize(currentWidth, options);
1305
+ },
1306
+ ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
1307
+ return matchWindowSize(currentWidth, options) ? valueIfTrue : valueIfFalse;
1308
+ },
1309
+ mapWindowWidth: function mapWindowWidth() {
1310
+ for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
1311
+ widthList[_key] = arguments[_key];
1312
+ }
1313
+
1314
+ var found = widthList.find(function (_ref3) {
1315
+ var _ref4 = _slicedToArray(_ref3, 2),
1316
+ minWidth = _ref4[0];
1317
+ _ref4[1];
1318
+
1319
+ return matchWindowSize(currentWidth, {
1320
+ minWidth: Number(minWidth)
1321
+ });
1322
+ });
1323
+ if (!found) return null;
1324
+ return found[1];
1325
+ }
1326
+ };
1327
+ }
1328
+
1329
+ 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; }
1330
+
1331
+ 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; }
1332
+ function KittThemeProvider(_ref) {
1333
+ var children = _ref.children,
1334
+ _ref$appTheme = _ref.appTheme,
1335
+ appTheme = _ref$appTheme === void 0 ? {} : _ref$appTheme;
1336
+
1337
+ var _useWindowSize = useWindowDimensions(),
1338
+ width = _useWindowSize.width;
1339
+
1340
+ var themeWithWindowSizeHelper = useMemo(function () {
1341
+ return _objectSpread$1(_objectSpread$1({
1342
+ kitt: theme
1343
+ }, appTheme), {}, {
1344
+ responsive: createWindowSizeHelper(width)
1345
+ });
1346
+ }, [width, appTheme]);
1347
+ return /*#__PURE__*/React.createElement(ThemeProvider, {
1348
+ theme: themeWithWindowSizeHelper
1349
+ }, children);
1350
+ }
1351
+
1352
+ var _templateObject$d;
1353
+ var ContentView$1 = styled.View(_templateObject$d || (_templateObject$d = _taggedTemplateLiteral(["\n flex: 1 0 0%;\n align-self: center;\n"])));
1354
+ function ListItemContent(_ref) {
1355
+ var children = _ref.children,
1356
+ rest = _objectWithoutProperties(_ref, ["children"]);
1357
+
1358
+ return /*#__PURE__*/React.createElement(ContentView$1, rest, children);
1359
+ }
1360
+
1361
+ var _templateObject$c, _templateObject2$6;
1362
+ var SideContainerView = styled.View(_templateObject$c || (_templateObject$c = _taggedTemplateLiteral(["\n flex-direction: row;\n margin-left: ", ";\n margin-right: ", ";\n"])), function (_ref) {
1363
+ var theme = _ref.theme,
1364
+ side = _ref.side;
1365
+ return side === 'right' ? theme.kitt.listItem.innerMargin : 0;
1366
+ }, function (_ref2) {
1367
+ var theme = _ref2.theme,
1368
+ side = _ref2.side;
1369
+ return side === 'left' ? theme.kitt.listItem.innerMargin : 0;
1370
+ }); // Handles the vertical alignment of the side elements of the list item
1371
+
1372
+ function ListItemSideContainer(_ref3) {
1373
+ var children = _ref3.children,
1374
+ _ref3$side = _ref3.side,
1375
+ side = _ref3$side === void 0 ? 'left' : _ref3$side,
1376
+ rest = _objectWithoutProperties(_ref3, ["children", "side"]);
1377
+
1378
+ return /*#__PURE__*/React.createElement(SideContainerView, _extends({
1379
+ side: side
1380
+ }, rest), children);
1381
+ }
1382
+ var SideContentView = styled.View(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n align-self: ", ";\n"])), function (_ref4) {
1383
+ var align = _ref4.align;
1384
+ return align;
1385
+ });
1386
+ function ListItemSideContent(_ref5) {
1387
+ var children = _ref5.children,
1388
+ _ref5$align = _ref5.align,
1389
+ align = _ref5$align === void 0 ? 'auto' : _ref5$align,
1390
+ rest = _objectWithoutProperties(_ref5, ["children", "align"]);
1391
+
1392
+ return /*#__PURE__*/React.createElement(SideContentView, _extends({
1393
+ align: align
1394
+ }, rest), children);
1395
+ }
1396
+
1397
+ var _templateObject$b;
1398
+ var ContainerView = styled.View(_templateObject$b || (_templateObject$b = _taggedTemplateLiteral(["\n flex-direction: row;\n padding: ", ";\n ", ";\n border-color: ", ";\n background-color: ", ";\n"])), function (_ref) {
1399
+ var withPadding = _ref.withPadding,
1400
+ theme = _ref.theme;
1401
+ return withPadding ? theme.kitt.listItem.padding : 0;
1402
+ }, function (_ref2) {
1403
+ var theme = _ref2.theme,
1404
+ borders = _ref2.borders;
1405
+ var borderWidth = theme.kitt.listItem.borderWidth;
1406
+
1407
+ if (borders === 'top') {
1408
+ return "border-top-width: ".concat(borderWidth);
1409
+ }
1410
+
1411
+ if (borders === 'bottom') {
1412
+ return "border-bottom-width: ".concat(borderWidth);
1413
+ }
1414
+
1415
+ if (borders === 'both') {
1416
+ return "border-top-width: ".concat(borderWidth, "; border-bottom-width: ").concat(borderWidth);
1417
+ }
1418
+
1419
+ return 'border: none';
1420
+ }, function (_ref3) {
1421
+ var theme = _ref3.theme;
1422
+ return theme.kitt.listItem.borderColor;
1423
+ }, function (_ref4) {
1424
+ var theme = _ref4.theme;
1425
+ return theme.kitt.colors.uiBackgroundLight;
1426
+ });
1427
+ function ListItem(_ref5) {
1428
+ var children = _ref5.children,
1429
+ withPadding = _ref5.withPadding,
1430
+ borders = _ref5.borders,
1431
+ left = _ref5.left,
1432
+ right = _ref5.right,
1433
+ rest = _objectWithoutProperties(_ref5, ["children", "withPadding", "borders", "left", "right"]);
1434
+
1435
+ return /*#__PURE__*/React.createElement(Pressable, rest, /*#__PURE__*/React.createElement(ContainerView, {
1436
+ withPadding: withPadding,
1437
+ borders: borders
1438
+ }, left ? /*#__PURE__*/React.createElement(ListItemSideContainer, {
1439
+ side: "left"
1440
+ }, left) : null, /*#__PURE__*/React.createElement(ListItemContent, null, children), right ? /*#__PURE__*/React.createElement(ListItemSideContainer, {
1441
+ side: "right"
1442
+ }, right) : null));
1443
+ }
1444
+ ListItem.Content = ListItemContent;
1445
+ ListItem.SideContent = ListItemSideContent;
1446
+ ListItem.SideContainer = ListItemSideContainer;
1447
+
1448
+ var _templateObject$a, _templateObject2$5, _templateObject3$3, _templateObject4$2;
1449
+ var xIconSize = 14;
1450
+ var mainIconSize = 20;
1451
+ var Container$1 = styled.View(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n border-radius: ", "px;\n background-color: ", ";\n padding-bottom: ", "px;\n padding-left: ", "px;\n padding-right: ", "px;\n padding-top: ", "px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n"])), function (_ref) {
1452
+ var theme = _ref.theme,
1453
+ noRadius = _ref.noRadius;
1454
+ return noRadius ? 0 : theme.kitt.spacing * 5;
1455
+ }, function (_ref2) {
1456
+ var theme = _ref2.theme,
1457
+ type = _ref2.type;
1458
+ return theme.kitt.feedbackMessage.backgroundColors[type];
1459
+ }, function (_ref3) {
1460
+ var theme = _ref3.theme;
1461
+ return theme.kitt.spacing * 4;
1462
+ }, function (_ref4) {
1463
+ var theme = _ref4.theme;
1464
+ return theme.kitt.spacing * 4;
1465
+ }, function (_ref5) {
1466
+ var theme = _ref5.theme;
1467
+ return theme.kitt.spacing * 4;
1468
+ }, function (_ref6) {
1469
+ var _insets$top;
1470
+
1471
+ var theme = _ref6.theme,
1472
+ insets = _ref6.insets;
1473
+ return ((_insets$top = insets === null || insets === void 0 ? void 0 : insets.top) !== null && _insets$top !== void 0 ? _insets$top : 0) + theme.kitt.spacing * 4;
1474
+ });
1475
+ var CloseContainer = styled.TouchableOpacity(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteral(["\n margin-left: ", "px;\n padding: ", "px;\n"])), function (_ref7) {
1476
+ var theme = _ref7.theme;
1477
+ return theme.kitt.spacing * 4;
1478
+ }, function (_ref8) {
1479
+ var theme = _ref8.theme;
1480
+ return theme.kitt.spacing;
1481
+ });
1482
+ var IconContainer = styled.View(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n margin-right: ", "px;\n"])), function (_ref9) {
1483
+ var theme = _ref9.theme;
1484
+ return theme.kitt.spacing * 4;
1485
+ });
1486
+ var Content = styled.Text(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteral(["\n text-align: ", ";\n flex: 1;\n"])), function (_ref10) {
1487
+ var centeredText = _ref10.centeredText;
1488
+ return centeredText ? 'center' : 'left';
1489
+ });
1490
+
1491
+ var getColorByType = function (type) {
1492
+ switch (type) {
1493
+ case 'success':
1494
+ return 'white';
1495
+
1496
+ case 'danger':
1497
+ return 'white';
1498
+
1499
+ case 'warning':
1500
+ default:
1501
+ return 'black';
1502
+ }
1503
+ };
1504
+
1505
+ function IconContent(_ref11) {
1506
+ var type = _ref11.type;
1507
+
1508
+ switch (type) {
1509
+ case 'warning':
1510
+ return /*#__PURE__*/React.createElement(AlertCircleIcon, null);
1511
+
1512
+ case 'success':
1513
+ return /*#__PURE__*/React.createElement(CheckIcon, null);
1514
+
1515
+ case 'danger':
1516
+ return /*#__PURE__*/React.createElement(AlertTriangleIcon, null);
1517
+
1518
+ default:
1519
+ return /*#__PURE__*/React.createElement(InfoIcon, null);
1520
+ }
1521
+ }
1522
+
1523
+ function Message(_ref12) {
1524
+ var _ref12$type = _ref12.type,
1525
+ type = _ref12$type === void 0 ? 'info' : _ref12$type,
1526
+ children = _ref12.children,
1527
+ _ref12$noRadius = _ref12.noRadius,
1528
+ noRadius = _ref12$noRadius === void 0 ? false : _ref12$noRadius,
1529
+ _ref12$centeredText = _ref12.centeredText,
1530
+ centeredText = _ref12$centeredText === void 0 ? false : _ref12$centeredText,
1531
+ onDismiss = _ref12.onDismiss,
1532
+ insets = _ref12.insets;
1533
+ var color = getColorByType(type);
1534
+ return /*#__PURE__*/React.createElement(Container$1, {
1535
+ type: type,
1536
+ noRadius: noRadius,
1537
+ insets: insets
1538
+ }, !centeredText ? /*#__PURE__*/React.createElement(IconContainer, null, /*#__PURE__*/React.createElement(Icon, {
1539
+ size: mainIconSize,
1540
+ color: color,
1541
+ icon: /*#__PURE__*/React.createElement(IconContent, {
1542
+ type: type
1543
+ })
1544
+ })) : null, /*#__PURE__*/React.createElement(Content, {
1545
+ type: type,
1546
+ centeredText: centeredText
1547
+ }, /*#__PURE__*/React.createElement(Typography.Text, {
1548
+ base: "body-small",
1549
+ color: color
1550
+ }, children)), onDismiss ? /*#__PURE__*/React.createElement(CloseContainer, {
1551
+ onPress: onDismiss
1552
+ }, /*#__PURE__*/React.createElement(Icon, {
1553
+ name: "x",
1554
+ size: xIconSize,
1555
+ color: color
1556
+ })) : null);
1557
+ }
1558
+
1559
+ 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; }
1560
+
1561
+ 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; }
1562
+ var OverlayPressable = styled.Pressable(function (_ref) {
1563
+ var theme = _ref.theme;
1564
+ return _objectSpread(_objectSpread({}, StyleSheet.absoluteFillObject), {}, {
1565
+ backgroundColor: theme.kitt.colors.overlay.dark
1566
+ });
1567
+ });
1568
+ function Overlay(_ref2) {
1569
+ var onPress = _ref2.onPress;
1570
+ return /*#__PURE__*/React.createElement(OverlayPressable, {
1571
+ onPress: onPress
1572
+ }, /*#__PURE__*/React.createElement(View, null));
1573
+ }
1574
+
1575
+ var _templateObject$9;
1576
+ var BodyView = styled.View(_templateObject$9 || (_templateObject$9 = _taggedTemplateLiteral(["\n padding: ", "px ", "px;\n"])), function (_ref) {
1577
+ var theme = _ref.theme;
1578
+ return theme.kitt.spacing * 6;
1579
+ }, function (_ref2) {
1580
+ var theme = _ref2.theme;
1581
+ return theme.kitt.spacing * 4;
1582
+ });
1583
+ var ModalBody = /*#__PURE__*/forwardRef(function (_ref3, ref) {
1584
+ var children = _ref3.children;
1585
+ return /*#__PURE__*/React.createElement(ScrollView, {
1586
+ ref: ref
1587
+ }, /*#__PURE__*/React.createElement(BodyView, null, children));
1588
+ });
1589
+
1590
+ var _templateObject$8;
1591
+ var FooterView = styled.View(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n padding: ", "px;\n border-top-width: 1px;\n border-top-color: ", ";\n"])), function (_ref) {
1592
+ var theme = _ref.theme;
1593
+ return theme.kitt.spacing * 4;
1594
+ }, function (_ref2) {
1595
+ var theme = _ref2.theme;
1596
+ return theme.kitt.colors.separator;
1597
+ });
1598
+ function ModalFooter(_ref3) {
1599
+ var children = _ref3.children;
1600
+ return /*#__PURE__*/React.createElement(FooterView, null, children);
1601
+ }
1602
+
1603
+ var OnCloseContext = /*#__PURE__*/createContext(function () {});
1604
+
1605
+ var _templateObject$7, _templateObject2$4, _templateObject3$2, _templateObject4$1;
1606
+ var HeaderView = styled.View(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n position: relative;\n padding: ", "px;\n display: flex;\n flex: 0 0 auto;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n border-bottom-width: 1px;\n border-bottom-color: ", ";\n min-height: 57px;\n"])), function (_ref) {
1607
+ var theme = _ref.theme;
1608
+ return theme.kitt.spacing * 2;
1609
+ }, function (_ref2) {
1610
+ var theme = _ref2.theme;
1611
+ return theme.kitt.colors.separator;
1612
+ });
1613
+ var LeftIconView = styled.View(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral(["\n align-self: flex-start;\n margin-right: ", "px;\n"])), function (_ref3) {
1614
+ var theme = _ref3.theme;
1615
+ return theme.kitt.spacing * 2;
1616
+ });
1617
+ var RightIconView = styled.View(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n align-self: flex-start;\n margin-left: ", "px;\n"])), function (_ref4) {
1618
+ var theme = _ref4.theme;
1619
+ return theme.kitt.spacing * 2;
1620
+ });
1621
+ var TitleView = styled.View(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n padding-left: ", "px;\n flex-shrink: 1;\n"])), function (_ref5) {
1622
+ var theme = _ref5.theme,
1623
+ isIconLeft = _ref5.isIconLeft;
1624
+ return isIconLeft ? 0 : theme.kitt.spacing * 2;
1625
+ });
1626
+ function ModalHeader(_ref6) {
1627
+ var left = _ref6.left,
1628
+ right = _ref6.right,
1629
+ children = _ref6.children;
1630
+ var onClose = useContext(OnCloseContext);
1631
+ var isIconLeft = !!left;
1632
+ return /*#__PURE__*/React.createElement(HeaderView, null, isIconLeft && /*#__PURE__*/React.createElement(LeftIconView, null, left), /*#__PURE__*/React.createElement(TitleView, {
1633
+ isIconLeft: isIconLeft
1634
+ }, children), right !== undefined ? right : /*#__PURE__*/React.createElement(RightIconView, null, /*#__PURE__*/React.createElement(Button, {
1635
+ type: "subtle-dark",
1636
+ icon: /*#__PURE__*/React.createElement(XIcon, null),
1637
+ onPress: onClose
1638
+ })));
1639
+ }
1640
+
1641
+ var _templateObject$6, _templateObject2$3;
1642
+ var ModalView = styled.View(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ", "px ", "px;\n"])), function (_ref) {
1643
+ var theme = _ref.theme;
1644
+ return theme.kitt.spacing * 20;
1645
+ }, function (_ref2) {
1646
+ var theme = _ref2.theme;
1647
+ return theme.kitt.spacing * 4;
1648
+ });
1649
+ var ContentView = styled.View(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n flex-direction: column;\n max-height: 100%;\n max-width: 540px;\n height: auto;\n width: 100%;\n border-radius: ", ";\n background-color: ", ";\n"])), function (_ref3) {
1650
+ var theme = _ref3.theme;
1651
+ return theme.kitt.card.borderRadius;
1652
+ }, function (_ref4) {
1653
+ var theme = _ref4.theme;
1654
+ return theme.kitt.palettes.lateOcean.white;
1655
+ });
1656
+ function Modal(_ref5) {
1657
+ var visible = _ref5.visible,
1658
+ children = _ref5.children,
1659
+ onClose = _ref5.onClose,
1660
+ onEntered = _ref5.onEntered,
1661
+ onExited = _ref5.onExited;
1662
+ return /*#__PURE__*/React.createElement(OnCloseContext.Provider, {
1663
+ value: onClose
1664
+ }, /*#__PURE__*/React.createElement(Modal$1, {
1665
+ transparent: true,
1666
+ animationType: "fade",
1667
+ visible: visible,
1668
+ onShow: onEntered,
1669
+ onDismiss: onExited,
1670
+ onRequestClose: onClose
1671
+ }, /*#__PURE__*/React.createElement(ModalView, null, /*#__PURE__*/React.createElement(Overlay, {
1672
+ onPress: onClose
1673
+ }), /*#__PURE__*/React.createElement(ContentView, null, children))));
1674
+ }
1675
+ Modal.Header = ModalHeader;
1676
+ Modal.Body = ModalBody;
1677
+ Modal.Footer = ModalFooter;
1678
+
1679
+ function Notification(_ref) {
1680
+ var type = _ref.type,
1681
+ children = _ref.children,
1682
+ centeredText = _ref.centeredText,
1683
+ onDelete = _ref.onDelete;
1684
+
1685
+ var _useSafeAreaInsets = useSafeAreaInsets(),
1686
+ top = _useSafeAreaInsets.top;
1687
+
1688
+ return /*#__PURE__*/React.createElement(Message, {
1689
+ noRadius: true,
1690
+ type: type,
1691
+ centeredText: centeredText,
1692
+ insets: {
1693
+ top: top
1694
+ },
1695
+ onDismiss: onDelete
1696
+ }, children);
1697
+ }
1698
+
1699
+ var _templateObject$5, _templateObject2$2;
1700
+ var StoryTitleContainer = styled.View(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n margin-bottom: 30px;\n"])));
1701
+ var StorySubTitleContainer = styled.View(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n margin-bottom: 10px;\n"])));
1702
+ function StoryTitle(_ref) {
1703
+ var color = _ref.color,
1704
+ children = _ref.children,
1705
+ numberOfLines = _ref.numberOfLines;
1706
+ return /*#__PURE__*/React.createElement(StoryTitleContainer, null, /*#__PURE__*/React.createElement(Typography.h1, {
1707
+ variant: "bold",
1708
+ base: "header1",
1709
+ color: color,
1710
+ numberOfLines: numberOfLines
1711
+ }, children));
1712
+ }
1713
+
1714
+ function StoryTitleLevel2(_ref2) {
1715
+ var color = _ref2.color,
1716
+ children = _ref2.children,
1717
+ numberOfLines = _ref2.numberOfLines;
1718
+ return /*#__PURE__*/React.createElement(StoryTitleContainer, null, /*#__PURE__*/React.createElement(Typography.h2, {
1719
+ variant: "bold",
1720
+ base: "header2",
1721
+ color: color,
1722
+ numberOfLines: numberOfLines
1723
+ }, children));
1724
+ }
1725
+
1726
+ StoryTitleLevel2.displayName = 'StoryTitle.Level2';
1727
+
1728
+ function StoryTitleLevel3(_ref3) {
1729
+ var color = _ref3.color,
1730
+ children = _ref3.children,
1731
+ numberOfLines = _ref3.numberOfLines;
1732
+ return /*#__PURE__*/React.createElement(StorySubTitleContainer, null, /*#__PURE__*/React.createElement(Typography.h3, {
1733
+ variant: "bold",
1734
+ base: "header3",
1735
+ medium: "header4",
1736
+ color: color,
1737
+ numberOfLines: numberOfLines
1738
+ }, children));
1739
+ }
1740
+
1741
+ StoryTitleLevel3.displayName = 'StoryTitle.Level3';
1742
+
1743
+ function StoryTitleLevel4(_ref4) {
1744
+ var color = _ref4.color,
1745
+ children = _ref4.children,
1746
+ numberOfLines = _ref4.numberOfLines;
1747
+ return /*#__PURE__*/React.createElement(StorySubTitleContainer, null, /*#__PURE__*/React.createElement(Typography.h4, {
1748
+ variant: "bold",
1749
+ base: "header4",
1750
+ medium: "header5",
1751
+ color: color,
1752
+ numberOfLines: numberOfLines
1753
+ }, children));
1754
+ }
1755
+
1756
+ StoryTitleLevel4.displayName = 'StoryTitle.Level3';
1757
+ StoryTitle.Level2 = StoryTitleLevel2;
1758
+ StoryTitle.Level3 = StoryTitleLevel3;
1759
+ StoryTitle.Level4 = StoryTitleLevel4;
1760
+
1761
+ var _templateObject$4, _templateObject2$1, _templateObject3$1;
1762
+ var StyledSection = styled.View(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n margin-bottom: 30px;\n"])));
1763
+ function Section(_ref) {
1764
+ var title = _ref.title;
1765
+ _ref.className;
1766
+ var children = _ref.children,
1767
+ props = _objectWithoutProperties(_ref, ["title", "className", "children"]);
1768
+
1769
+ return /*#__PURE__*/React.createElement(StyledSection, props, /*#__PURE__*/React.createElement(StoryTitle.Level2, null, title), children);
1770
+ }
1771
+ var StyledSubSection = styled.View(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n margin-bottom: 20px;\n"])));
1772
+
1773
+ function SubSection(_ref2) {
1774
+ var title = _ref2.title;
1775
+ _ref2.className;
1776
+ var children = _ref2.children,
1777
+ props = _objectWithoutProperties(_ref2, ["title", "className", "children"]);
1778
+
1779
+ return /*#__PURE__*/React.createElement(StyledSubSection, props, /*#__PURE__*/React.createElement(StoryTitle.Level3, null, title), children);
1780
+ }
1781
+
1782
+ var StyledDemoSection = styled.View(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n margin-bottom: 90px;\n"])));
1783
+
1784
+ function DemoSection(_ref3) {
1785
+ var children = _ref3.children;
1786
+ return /*#__PURE__*/React.createElement(StyledDemoSection, null, /*#__PURE__*/React.createElement(Section, {
1787
+ title: "Demo"
1788
+ }, children));
1789
+ }
1790
+
1791
+ Section.SubSection = SubSection;
1792
+ Section.DemoSection = DemoSection;
1793
+
1794
+ var _templateObject$3;
1795
+ var StoryContainer = styled.ScrollView(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n padding: 10px;\n"])));
1796
+ function Story(_ref) {
1797
+ var title = _ref.title,
1798
+ contentContainerStyle = _ref.contentContainerStyle,
1799
+ children = _ref.children;
1800
+ return /*#__PURE__*/React.createElement(StoryContainer, {
1801
+ contentContainerStyle: contentContainerStyle
1802
+ }, /*#__PURE__*/React.createElement(StoryTitle, null, title), children);
1803
+ }
1804
+
1805
+ function StoryDecorator(storyFn, context) {
1806
+ return /*#__PURE__*/React.createElement(Story, {
1807
+ title: context.name
1808
+ }, storyFn());
1809
+ }
1810
+
1811
+ var _templateObject$2, _templateObject2, _templateObject3, _templateObject4;
1812
+ var SmallScreenRow = styled.View(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n flex-direction: column;\n margin: 0;\n"])));
1813
+ var SmallScreenCol = styled.View(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 10px 0 20px;\n"])));
1814
+ var FlexRow = styled.View(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex-direction: row;\n margin: 0 -5px 20px;\n"])));
1815
+ var FlexCol = styled.View(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex-grow: 1;\n flex-basis: 0;\n margin: 0 5px 10px;\n"])));
1816
+
1817
+ function StoryGridRow(_ref) {
1818
+ var children = _ref.children,
1819
+ _ref$breakpoint = _ref.breakpoint,
1820
+ breakpoint = _ref$breakpoint === void 0 ? 'small' : _ref$breakpoint;
1821
+
1822
+ // eslint-disable-next-line unicorn/expiring-todo-comments
1823
+ // TODO use useBreakpoint instead
1824
+ var _useWindowDimensions = useWindowDimensions(),
1825
+ width = _useWindowDimensions.width;
1826
+
1827
+ var breakpointValue = breakpoint === 'small' ? 480 : 768;
1828
+
1829
+ if (width < breakpointValue) {
1830
+ return /*#__PURE__*/React.createElement(SmallScreenRow, null, React.Children.map(children, function (child) {
1831
+ return /*#__PURE__*/React.createElement(SmallScreenCol, null, child);
1832
+ }));
1833
+ }
1834
+
1835
+ return /*#__PURE__*/React.createElement(FlexRow, null, React.Children.map(children, function (child) {
1836
+ return /*#__PURE__*/React.createElement(FlexCol, null, child);
1837
+ }));
1838
+ }
1839
+
1840
+ function StoryGridCol(_ref2) {
1841
+ var title = _ref2.title,
1842
+ titleColor = _ref2.titleColor,
1843
+ children = _ref2.children;
1844
+ return /*#__PURE__*/React.createElement(React.Fragment, null, title ? /*#__PURE__*/React.createElement(StoryTitle.Level4, {
1845
+ numberOfLines: 1,
1846
+ color: titleColor
1847
+ }, title) : null, children);
1848
+ }
1849
+
1850
+ var StoryGrid = {
1851
+ Row: StoryGridRow,
1852
+ Col: StoryGridCol
1853
+ };
1854
+
1855
+ var StoryComponents = {
1856
+ Section: Section,
1857
+ Story: Story,
1858
+ StoryDecorator: StoryDecorator,
1859
+ StoryGrid: StoryGrid,
1860
+ StoryTitle: StoryTitle
1861
+ };
1862
+
1863
+ var _templateObject$1;
1864
+ var Container = styled.View(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n background-color: ", ";\n padding: ", ";\n border-radius: ", ";\n align-self: flex-start;\n"])), function (_ref) {
1865
+ var theme = _ref.theme,
1866
+ type = _ref.type;
1867
+ return theme.kitt.tag[type].backgroundColor;
1868
+ }, function (_ref2) {
1869
+ var theme = _ref2.theme;
1870
+ return theme.kitt.tag.padding;
1871
+ }, function (_ref3) {
1872
+ var theme = _ref3.theme;
1873
+ return theme.kitt.tag.borderRadius;
1874
+ });
1875
+ function Tag(_ref4) {
1876
+ var label = _ref4.label,
1877
+ _ref4$type = _ref4.type,
1878
+ type = _ref4$type === void 0 ? 'default' : _ref4$type;
1879
+ return /*#__PURE__*/React.createElement(Container, {
1880
+ type: type
1881
+ }, /*#__PURE__*/React.createElement(Typography.Text, {
1882
+ base: "body-xsmall",
1883
+ color: type === 'primary' ? 'primary-light' : undefined
1884
+ }, label));
1885
+ }
1886
+
1887
+ function Tooltip(_ref) {
1888
+ var children = _ref.children;
1889
+ return /*#__PURE__*/React.createElement(View, null, children);
1890
+ }
1891
+
1892
+ var _templateObject;
1893
+ var StyledLink = styled(Typography).withConfig({
1894
+ shouldForwardProp: function shouldForwardProp(prop) {
1895
+ return !['disabled', 'noUnderline'].includes(prop);
1896
+ }
1897
+ })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-decoration: ", ";\n ", ";\n margin: 0;\n"])), function (_ref) {
1898
+ var noUnderline = _ref.noUnderline;
1899
+ return noUnderline ? 'none' : 'underline';
1900
+ }, function (_ref2) {
1901
+ var disabled = _ref2.disabled;
1902
+ return Platform.OS === 'web' ? "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat(disabled ? 'not-allowed' : 'pointer', ";\n ") : null;
1903
+ });
1904
+ function TypographyLink(_ref3) {
1905
+ var disabled = _ref3.disabled,
1906
+ noUnderline = _ref3.noUnderline,
1907
+ _ref3$variant = _ref3.variant,
1908
+ variant = _ref3$variant === void 0 ? 'bold' : _ref3$variant,
1909
+ otherProps = _objectWithoutProperties(_ref3, ["disabled", "noUnderline", "variant"]);
1910
+
1911
+ return /*#__PURE__*/React.createElement(StyledLink, _extends({
1912
+ disabled: disabled,
1913
+ noUnderline: noUnderline,
1914
+ variant: variant,
1915
+ accessibilityRole: "link"
1916
+ }, otherProps));
1917
+ }
1918
+
1919
+ export { Avatar, Button, Card, FullScreenModal, Icon, InputFeedback, InputField, InputText, KittThemeProvider, Label, ListItem, Message, Modal, Notification, Radio, StoryComponents, Tag, TextArea, Tooltip, Typography, TypographyIcon, TypographyLink, createWindowSizeHelper, styledTextInputMixin, theme, useButton };
1920
+ //# sourceMappingURL=index-browser-all.es.js.map