@ornikar/kitt-universal 3.0.0-beta.1 → 3.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.
Files changed (52) hide show
  1. package/dist/definitions/Button/AnimatedButtonPressable.d.ts +14 -0
  2. package/dist/definitions/Button/AnimatedButtonPressable.d.ts.map +1 -0
  3. package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +17 -0
  4. package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts.map +1 -0
  5. package/dist/definitions/Button/BaseStyledButtonPressable.d.ts +11 -0
  6. package/dist/definitions/Button/BaseStyledButtonPressable.d.ts.map +1 -0
  7. package/dist/definitions/Button/Button.d.ts +9 -4
  8. package/dist/definitions/Button/Button.d.ts.map +1 -1
  9. package/dist/definitions/Button/ButtonContent.d.ts +11 -3
  10. package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
  11. package/dist/definitions/Button/StyledDisabled.d.ts +3 -0
  12. package/dist/definitions/Button/StyledDisabled.d.ts.map +1 -0
  13. package/dist/definitions/Button/isSubtle.d.ts +3 -0
  14. package/dist/definitions/Button/isSubtle.d.ts.map +1 -0
  15. package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
  16. package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
  17. package/dist/definitions/Loader/LargeLoader.web.d.ts.map +1 -1
  18. package/dist/definitions/Loader/Loader.d.ts +1 -1
  19. package/dist/definitions/Loader/Loader.d.ts.map +1 -1
  20. package/dist/definitions/themes/default.d.ts +3 -43
  21. package/dist/definitions/themes/default.d.ts.map +1 -1
  22. package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts +42 -35
  23. package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts.map +1 -1
  24. package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts +2 -0
  25. package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +1 -1
  26. package/dist/definitions/typography/Typography.d.ts +11 -11
  27. package/dist/definitions/typography/TypographyIcon.d.ts +2 -2
  28. package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
  29. package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
  30. package/dist/definitions/utils/withTheme.d.ts +2 -2
  31. package/dist/definitions/utils/withTheme.d.ts.map +1 -1
  32. package/dist/index-browser-all.es.android.js +402 -223
  33. package/dist/index-browser-all.es.android.js.map +1 -1
  34. package/dist/index-browser-all.es.css +1 -1
  35. package/dist/index-browser-all.es.ios.js +402 -223
  36. package/dist/index-browser-all.es.ios.js.map +1 -1
  37. package/dist/index-browser-all.es.js +406 -227
  38. package/dist/index-browser-all.es.js.map +1 -1
  39. package/dist/index-browser-all.es.web.js +399 -214
  40. package/dist/index-browser-all.es.web.js.map +1 -1
  41. package/dist/index-node-14.17.cjs.css +1 -1
  42. package/dist/index-node-14.17.cjs.js +428 -196
  43. package/dist/index-node-14.17.cjs.js.map +1 -1
  44. package/dist/index-node-14.17.cjs.web.css +5 -0
  45. package/dist/index-node-14.17.cjs.web.js +3173 -0
  46. package/dist/index-node-14.17.cjs.web.js.map +1 -0
  47. package/dist/styles.css +2 -1
  48. package/dist/tsbuildinfo +1 -1
  49. package/package.json +9 -8
  50. package/CHANGELOG.md +0 -131
  51. package/dist/definitions/Button/ButtonPressable.d.ts +0 -13
  52. package/dist/definitions/Button/ButtonPressable.d.ts.map +0 -1
@@ -0,0 +1,3173 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const BabelPluginStyledComponentsReactNative = require('react-native');
6
+ const kittIcons = require('@ornikar/kitt-icons');
7
+ const styled = require('styled-components/native');
8
+ const react$1 = require('react');
9
+ const react = require('@linaria/react');
10
+ const jsxRuntime = require('react/jsx-runtime');
11
+ const twemojiParser = require('twemoji-parser');
12
+ const reactNativeSafeAreaContext = require('react-native-safe-area-context');
13
+ const reactDom = require('@floating-ui/react-dom');
14
+ const addons = require('@storybook/addons');
15
+
16
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
17
+
18
+ const styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
19
+
20
+ // type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
21
+ // type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
22
+ // export function withTheme<Props extends { theme: DefaultTheme }, C>(
23
+ // WrappedComponent: ComponentType<Props> & C,
24
+ // ): ComponentType<SetOptional<Props, 'theme'>> & hoistNonReactStatics.NonReactStatics<typeof WrappedComponent> {
25
+ // return function ThemedComponent(props) {
26
+ // const theme = useTheme();
27
+ // return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
28
+ // };
29
+ // }
30
+ function withTheme(WrappedComponent) {
31
+ return function (props) {
32
+ const theme = /*#__PURE__*/styled.useTheme();
33
+ return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
34
+ theme: theme,
35
+ ...props
36
+ });
37
+ };
38
+ }
39
+
40
+ const StyledSpinningIconContainer = withTheme( /*#__PURE__*/react.styled("div")({
41
+ name: "StyledSpinningIconContainer",
42
+ class: "ssn8o83"
43
+ }));
44
+ function SpinningIcon({
45
+ children
46
+ }) {
47
+ return /*#__PURE__*/jsxRuntime.jsx(StyledSpinningIconContainer, {
48
+ children: children
49
+ });
50
+ }
51
+
52
+ const IconContainer$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
53
+ displayName: "Icon__IconContainer",
54
+ componentId: "kitt-universal__sc-usm0ol-0"
55
+ })(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
56
+ color
57
+ }) => color, ({
58
+ size
59
+ }) => size, ({
60
+ size
61
+ }) => size, ({
62
+ align = 'auto'
63
+ }) => align);
64
+ function Icon({
65
+ icon,
66
+ size = 20,
67
+ spin,
68
+ align,
69
+ color
70
+ }) {
71
+ const clonedIcon = /*#__PURE__*/react$1.cloneElement(icon, {
72
+ color
73
+ });
74
+ return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
75
+ align: align,
76
+ size: size,
77
+ color: color,
78
+ children: spin ? /*#__PURE__*/jsxRuntime.jsx(SpinningIcon, {
79
+ children: clonedIcon
80
+ }) : clonedIcon
81
+ });
82
+ }
83
+
84
+ const KittBreakpoints = {
85
+ /**
86
+ * min-width: 0
87
+ */
88
+ BASE: 0,
89
+
90
+ /**
91
+ * min-width: 480px
92
+ */
93
+ SMALL: 480,
94
+
95
+ /**
96
+ * min-width: 768px
97
+ */
98
+ MEDIUM: 768,
99
+
100
+ /**
101
+ * min-width: 1024px
102
+ */
103
+ LARGE: 1024,
104
+
105
+ /**
106
+ * min-width: 1280px
107
+ */
108
+ WIDE: 1280
109
+ };
110
+ const KittBreakpointsMax = {
111
+ /**
112
+ * max-width: 479px
113
+ */
114
+ BASE: KittBreakpoints.SMALL - 1,
115
+
116
+ /**
117
+ * max-width: 767px
118
+ */
119
+ SMALL: KittBreakpoints.MEDIUM - 1,
120
+
121
+ /**
122
+ * max-width: 1023px
123
+ */
124
+ MEDIUM: KittBreakpoints.LARGE - 1,
125
+
126
+ /**
127
+ * max-width: 1279px
128
+ */
129
+ LARGE: KittBreakpoints.WIDE - 1
130
+ };
131
+
132
+ const IsHeaderTypographyContext = /*#__PURE__*/react$1.createContext(undefined);
133
+ const TypographyColorContext = /*#__PURE__*/react$1.createContext('black');
134
+ function useTypographyColor() {
135
+ return react$1.useContext(TypographyColorContext);
136
+ }
137
+ const getTypographyTypeConfigKey = theme => {
138
+ const isMediumOrAbove = theme.responsive.matchWindowSize({
139
+ minWidth: KittBreakpoints.MEDIUM
140
+ });
141
+ return isMediumOrAbove ? 'mediumAndWide' : 'baseAndSmall';
142
+ };
143
+
144
+ const isTypeHeader = type => type.startsWith('header');
145
+
146
+ const isTypographyHeader = (type, typographyIsHeaderInContext) => {
147
+ if (type) return isTypeHeader(type);
148
+ if (typographyIsHeaderInContext != null) return typographyIsHeaderInContext;
149
+ throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
150
+ };
151
+ function getTypographyTypeConfig(type, theme) {
152
+ if (isTypographyHeader(type, undefined)) {
153
+ return theme.kitt.typography.types.headers.configs[type];
154
+ }
155
+
156
+ return theme.kitt.typography.types.bodies.configs[type];
157
+ }
158
+ const StyledTypography = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Text).withConfig({
159
+ displayName: "Typography__StyledTypography",
160
+ componentId: "kitt-universal__sc-1dz700q-0"
161
+ })(["", " ", ""], ({
162
+ theme,
163
+ $isHeader,
164
+ $typeForCurrentWindowSize,
165
+ $variant
166
+ }) => {
167
+ const {
168
+ headers,
169
+ bodies
170
+ } = theme.kitt.typography.types;
171
+ const typeConfigKey = getTypographyTypeConfigKey(theme);
172
+ return `
173
+ /* type */
174
+ ${!$typeForCurrentWindowSize ? '' : `
175
+ font-family: ${$isHeader ? headers.fontFamily[$variant] : bodies.fontFamily[$variant]};
176
+ font-size: ${$isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize};
177
+ line-height: ${$isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight};
178
+ `}
179
+
180
+ /* variant */
181
+ font-weight: ${$isHeader ? headers.fontWeight : bodies.fontWeight[$variant]};
182
+ font-style: ${$isHeader ? headers.fontStyle : bodies.fontStyle[$variant]};
183
+ `;
184
+ }, ({
185
+ theme,
186
+ $color
187
+ }) => !$color ? '' : `
188
+ color: ${theme.kitt.typography.colors[$color]};
189
+ text-decoration-color: ${theme.kitt.typography.colors[$color]};
190
+ `);
191
+ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
192
+ const {
193
+ width
194
+ } = BabelPluginStyledComponentsReactNative.useWindowDimensions();
195
+ if (large && width >= KittBreakpoints.LARGE) return large;
196
+ if (medium && width >= KittBreakpoints.MEDIUM) return medium;
197
+ if (small && width >= KittBreakpoints.SMALL) return small;
198
+ return base;
199
+ }
200
+ function Typography({
201
+ accessibilityRole,
202
+ base,
203
+ small,
204
+ medium,
205
+ large,
206
+ variant,
207
+ color,
208
+ ...otherProps
209
+ }) {
210
+ const isHeaderTypographyInContext = react$1.useContext(IsHeaderTypographyContext);
211
+ const typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
212
+ const isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
213
+ const nonNullableVariant = variant ?? (isHeader ? 'bold' : 'regular'); // if isHeaderTypographyInContext exists, it means we are inside another typography so we don't want to
214
+ // redefine the color, just inherit from it
215
+
216
+ const colorWithDefaultToBlack = color ?? (isHeaderTypographyInContext !== undefined ? undefined : 'black');
217
+ const content = base ? /*#__PURE__*/jsxRuntime.jsx(IsHeaderTypographyContext.Provider, {
218
+ value: isHeader,
219
+ children: /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
220
+ $color: colorWithDefaultToBlack,
221
+ $isHeader: isHeader,
222
+ $typeForCurrentWindowSize: typeForCurrentWindowSize,
223
+ $variant: nonNullableVariant,
224
+ accessibilityRole: accessibilityRole || undefined,
225
+ ...otherProps
226
+ })
227
+ }) : /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
228
+ $color: colorWithDefaultToBlack,
229
+ $isHeader: isHeader,
230
+ $variant: nonNullableVariant,
231
+ accessibilityRole: accessibilityRole || undefined,
232
+ ...otherProps
233
+ });
234
+ return color ? /*#__PURE__*/jsxRuntime.jsx(TypographyColorContext.Provider, {
235
+ value: color,
236
+ children: content
237
+ }) : content;
238
+ }
239
+
240
+ function TypographyText(props) {
241
+ return /*#__PURE__*/jsxRuntime.jsx(Typography, {
242
+ accessibilityRole: null,
243
+ ...props
244
+ });
245
+ }
246
+
247
+ function TypographyParagraph(props) {
248
+ return /*#__PURE__*/jsxRuntime.jsx(Typography, {
249
+ accessibilityRole: "paragraph",
250
+ ...props
251
+ });
252
+ }
253
+
254
+ const createHeading = (level, defaultBase) => {
255
+ // https://github.com/necolas/react-native-web/issues/401
256
+ function TypographyHeading(props) {
257
+ return /*#__PURE__*/jsxRuntime.jsx(Typography, {
258
+ accessibilityRole: "header",
259
+ base: defaultBase,
260
+ ...props,
261
+ accessibilityLevel: level
262
+ });
263
+ }
264
+
265
+ TypographyHeading.displayName = `TypographyHeading${level}`;
266
+ return TypographyHeading;
267
+ };
268
+
269
+ Typography.Text = TypographyText;
270
+ Typography.Paragraph = TypographyParagraph;
271
+ Typography.Header1 = createHeading(1);
272
+ Typography.Header2 = createHeading(2);
273
+ Typography.Header3 = createHeading(3);
274
+ Typography.Header4 = createHeading(4);
275
+ Typography.Header5 = createHeading(5);
276
+ Typography.Header6 = createHeading(6);
277
+ /** @deprecated use Typography.Header1 */
278
+
279
+ Typography.h1 = createHeading(1, 'header1');
280
+ /** @deprecated use Typography.Header2 */
281
+
282
+ Typography.h2 = createHeading(2, 'header2');
283
+ /** @deprecated use Typography.Header3 */
284
+
285
+ Typography.h3 = createHeading(3, 'header3');
286
+ /** @deprecated use Typography.Header4 */
287
+
288
+ Typography.h4 = createHeading(4, 'header4');
289
+ /** @deprecated use Typography.Header6 */
290
+
291
+ Typography.h5 = createHeading(5, 'header5');
292
+
293
+ const getFirstCharacter = string => string ? string[0] : '';
294
+
295
+ const getInitials = (firstname, lastname) => (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
296
+
297
+ const StyledAvatarView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
298
+ displayName: "Avatar__StyledAvatarView",
299
+ componentId: "kitt-universal__sc-9miubv-0"
300
+ })(["border-radius:", "px;background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], ({
301
+ round,
302
+ size
303
+ }) => round ? size / 2 : 10, ({
304
+ theme,
305
+ light
306
+ }) => light ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar.default.backgroundColor, ({
307
+ size
308
+ }) => size, ({
309
+ size
310
+ }) => size);
311
+
312
+ function AvatarContent({
313
+ size = 40,
314
+ src,
315
+ firstname,
316
+ lastname,
317
+ light
318
+ }) {
319
+ if (src) {
320
+ return /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Image, {
321
+ source: {
322
+ uri: src
323
+ },
324
+ style: {
325
+ width: size,
326
+ height: size
327
+ }
328
+ });
329
+ }
330
+
331
+ if (firstname && lastname) {
332
+ return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
333
+ base: "body-small",
334
+ variant: "bold",
335
+ color: light ? 'black' : 'white',
336
+ children: getInitials(firstname, lastname)
337
+ });
338
+ }
339
+
340
+ return /*#__PURE__*/jsxRuntime.jsx(Icon, {
341
+ icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.UserIcon, {}),
342
+ color: light ? 'black' : 'white',
343
+ size: size / 2
344
+ });
345
+ }
346
+
347
+ function Avatar({
348
+ size = 40,
349
+ ...rest
350
+ }) {
351
+ return /*#__PURE__*/jsxRuntime.jsx(StyledAvatarView, { ...rest,
352
+ size: size,
353
+ children: /*#__PURE__*/jsxRuntime.jsx(AvatarContent, { ...rest,
354
+ size: size
355
+ })
356
+ });
357
+ }
358
+
359
+ function isSubtle(type) {
360
+ return type.startsWith('subtle');
361
+ }
362
+
363
+ const AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/react.styled("div")({
364
+ name: "AnimatedButtonPressableContainer",
365
+ class: "a1vkj3mh",
366
+ vars: {
367
+ "a1vkj3mh-0": [({
368
+ $isStretch
369
+ }) => $isStretch ? 'inherit' : 'inline-flex'],
370
+ "a1vkj3mh-1": [({
371
+ $isStretch
372
+ }) => $isStretch ? 'stretch' : 'baseline'],
373
+ "a1vkj3mh-2": [({
374
+ theme
375
+ }) => theme.breakpoints.min.mediumBreakpoint],
376
+ "a1vkj3mh-3": [({
377
+ theme
378
+ }) => theme.kitt.button.scale.medium.hover],
379
+ "a1vkj3mh-4": [({
380
+ theme,
381
+ $isDisabled
382
+ }) => `scale(${$isDisabled ? 1 : theme.kitt.button.scale.base.active})`],
383
+ "a1vkj3mh-5": [({
384
+ theme,
385
+ $type,
386
+ $isDisabled
387
+ }) => {
388
+ if ($isDisabled) return theme.kitt.button.disabled.hoverBackgroundColor;
389
+ return theme.kitt.button[$type].hoverBackgroundColor;
390
+ }],
391
+ "a1vkj3mh-6": [({
392
+ theme
393
+ }) => {
394
+ const {
395
+ duration,
396
+ timingFunction
397
+ } = theme.kitt.button.transition;
398
+ return `color, background, border-color, ${duration} ${timingFunction}`;
399
+ }],
400
+ "a1vkj3mh-7": [({
401
+ theme
402
+ }) => theme.kitt.button.borderRadius],
403
+ "a1vkj3mh-8": [({
404
+ theme
405
+ }) => `opacity ${theme.kitt.button.transition.duration} ${theme.kitt.button.transition.timingFunction}`],
406
+ "a1vkj3mh-9": [({
407
+ $isDisabled
408
+ }) => $isDisabled ? 1 : 0],
409
+ "a1vkj3mh-10": [({
410
+ theme
411
+ }) => `-${theme.kitt.button.borderWidth.disabled}`],
412
+ "a1vkj3mh-12": [({
413
+ theme
414
+ }) => `calc(100% - ${parseInt(theme.kitt.button.borderWidth.disabled, 10) * 0.5}px)`],
415
+ "a1vkj3mh-14": [({
416
+ theme
417
+ }) => `${theme.kitt.button.disabled.borderColor} solid ${theme.kitt.button.borderWidth.disabled}`],
418
+ "a1vkj3mh-15": [({
419
+ theme,
420
+ $type
421
+ }) => `${theme.kitt.button.borderWidth.focus} solid ${theme.kitt.button[$type].focusBorderColor}`],
422
+ "a1vkj3mh-16": [({
423
+ theme
424
+ }) => `-${theme.kitt.button.borderWidth.focus}`],
425
+ "a1vkj3mh-18": [({
426
+ theme,
427
+ $type,
428
+ $isDisabled
429
+ }) => {
430
+ if ($isDisabled) return theme.kitt.typography.colors['black-light'];
431
+ if (!isSubtle($type)) return 'inherit';
432
+ return theme.kitt.button[$type].color;
433
+ }],
434
+ "a1vkj3mh-19": [({
435
+ theme,
436
+ $type,
437
+ $isDisabled
438
+ }) => {
439
+ if ($isDisabled) return theme.kitt.typography.colors['black-light'];
440
+ if (!isSubtle($type)) return 'inherit';
441
+ return theme.kitt.button[$type].hoverColor;
442
+ }],
443
+ "a1vkj3mh-20": [({
444
+ theme,
445
+ $type,
446
+ $isDisabled
447
+ }) => {
448
+ if ($isDisabled) return theme.kitt.typography.colors['black-light'];
449
+ if (!isSubtle($type)) return 'inherit';
450
+ return theme.kitt.button[$type].activeColor;
451
+ }]
452
+ }
453
+ }));
454
+ const AnimatedButtonPressable = /*#__PURE__*/react$1.forwardRef(({
455
+ $type,
456
+ $isStretch,
457
+ disabled,
458
+ ...props
459
+ }, ref) => {
460
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressableContainer, {
461
+ ref: ref,
462
+ $type: $type,
463
+ $isDisabled: !!disabled,
464
+ $isStretch: $isStretch,
465
+ children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Pressable, {
466
+ disabled: disabled,
467
+ ...props
468
+ })
469
+ });
470
+ });
471
+
472
+ const BaseStyledButtonPressable = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
473
+ displayName: "BaseStyledButtonPressable",
474
+ componentId: "kitt-universal__sc-4k8lse-0"
475
+ })(["position:relative;min-width:", ";max-width:", ";width:", ";min-height:", ";border-radius:", ";flex-direction:row;align-items:center;justify-content:center;align-self:flex-start;background-color:", ";padding:", ";"], ({
476
+ theme
477
+ }) => theme.kitt.button.minWidth, ({
478
+ theme,
479
+ $isStretch
480
+ }) => $isStretch ? '100%' : theme.kitt.button.maxWidth, ({
481
+ $isStretch
482
+ }) => $isStretch ? '100%' : 'auto', ({
483
+ theme
484
+ }) => theme.kitt.button.minHeight, ({
485
+ theme
486
+ }) => theme.kitt.button.borderRadius, ({
487
+ theme,
488
+ $isDisabled,
489
+ $type
490
+ }) => {
491
+ if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
492
+ return theme.kitt.button[$type].backgroundColor;
493
+ }, ({
494
+ theme,
495
+ $isLarge,
496
+ $isDisabled
497
+ }) => {
498
+ const {
499
+ large,
500
+ default: defaultPadding,
501
+ disabled: disabledPadding
502
+ } = theme.kitt.button.contentPadding;
503
+ if ($isLarge) return large;
504
+ if ($isDisabled) return disabledPadding;
505
+ return defaultPadding;
506
+ });
507
+
508
+ function TypographyIconSpecifiedColor({
509
+ color,
510
+ ...props
511
+ }) {
512
+ const theme = /*#__PURE__*/styled.useTheme();
513
+ return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...props,
514
+ color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
515
+ });
516
+ }
517
+
518
+ function TypographyIconInheritColor(props) {
519
+ const color = useTypographyColor();
520
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
521
+ color: color,
522
+ ...props
523
+ });
524
+ }
525
+
526
+ function TypographyIcon({
527
+ color,
528
+ ...props
529
+ }) {
530
+ if (color) {
531
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
532
+ color: color,
533
+ ...props
534
+ });
535
+ }
536
+
537
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIconInheritColor, { ...props
538
+ });
539
+ }
540
+
541
+ const getTextColorByType = type => {
542
+ switch (type) {
543
+ case 'primary':
544
+ return 'white';
545
+
546
+ case 'white':
547
+ return 'white';
548
+
549
+ case 'subtle':
550
+ return 'primary';
551
+
552
+ case 'subtle-dark':
553
+ return 'black';
554
+
555
+ default:
556
+ return 'black';
557
+ }
558
+ };
559
+
560
+ const StyledButtonText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
561
+ displayName: "ButtonContent__StyledButtonText",
562
+ componentId: "kitt-universal__sc-dnyw3n-0"
563
+ })(["text-align:center;", " ", ""], () => {
564
+ // Make the multilines case work properly on native
565
+ // Breaks the web implem
566
+ return undefined;
567
+ }, ({
568
+ $type,
569
+ $isDisabled
570
+ }) => {
571
+ /* For subltes button, color changes when hovered.
572
+ * We don't want to use a mouse event handler with a react state to handle it
573
+ * For this precise case, we've decided to work outside the typography logic
574
+ */
575
+ if ($isDisabled || !isSubtle($type)) return undefined;
576
+ return 'color: inherit';
577
+ });
578
+ const StyledIconContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
579
+ displayName: "ButtonContent__StyledIconContainer",
580
+ componentId: "kitt-universal__sc-dnyw3n-1"
581
+ })(["", ""], ({
582
+ theme,
583
+ $iconPosition
584
+ }) => {
585
+ const value = theme.kitt.spacing * 2;
586
+
587
+ if ($iconPosition === 'left') {
588
+ return `margin: 0 ${value}px 0 0;`;
589
+ }
590
+
591
+ return `margin: 0 0 0 ${value}px;`;
592
+ });
593
+
594
+ function ButtonIcon({
595
+ icon,
596
+ color,
597
+ spin,
598
+ iconPosition,
599
+ testID
600
+ }) {
601
+ return /*#__PURE__*/jsxRuntime.jsx(StyledIconContainer, {
602
+ $iconPosition: iconPosition,
603
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
604
+ icon: icon,
605
+ spin: spin,
606
+ testID: testID,
607
+ color: color
608
+ })
609
+ });
610
+ }
611
+
612
+ const StyledChildrenWithIcon = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
613
+ displayName: "ButtonContent__StyledChildrenWithIcon",
614
+ componentId: "kitt-universal__sc-dnyw3n-2"
615
+ })(["align-items:center;justify-content:center;flex-direction:row;"]);
616
+ function ButtonContentChildren({
617
+ type,
618
+ icon,
619
+ iconPosition,
620
+ iconSpin,
621
+ isDisabled,
622
+ color,
623
+ children
624
+ }) {
625
+ if ((process.env.NODE_ENV !== "production")) {
626
+ if (!(children || icon)) {
627
+ throw new Error('kitt(Button): You should provide at least a children or a icon');
628
+ }
629
+ }
630
+
631
+ const isWebSubtle = isSubtle(type) && "web" === 'web' && !isDisabled;
632
+
633
+ if (!children) {
634
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
635
+ spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
636
+ ,
637
+ icon: icon,
638
+ color: isWebSubtle ? 'inherit' : color
639
+ });
640
+ }
641
+
642
+ const buttonIconSharedProps = {
643
+ type,
644
+ spin: iconSpin,
645
+ iconPosition,
646
+ color: isWebSubtle ? 'inherit' : color
647
+ };
648
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledChildrenWithIcon, {
649
+ children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
650
+ testID: "button-left-icon",
651
+ icon: icon
652
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(StyledButtonText, {
653
+ base: "body",
654
+ variant: "bold",
655
+ $type: type,
656
+ $isDisabled: isDisabled // set to color: inherit via styled components
657
+ ,
658
+ color: isWebSubtle ? undefined : color,
659
+ children: children
660
+ }), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
661
+ icon: icon
662
+ }) : null]
663
+ });
664
+ }
665
+ const ButtonContentContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
666
+ displayName: "ButtonContent__ButtonContentContainer",
667
+ componentId: "kitt-universal__sc-dnyw3n-3"
668
+ })(["line-height:16px;", " ", ";"], ({
669
+ $isStretch,
670
+ $isIconOnly
671
+ }) => {
672
+ return `
673
+ flex: ${$isStretch || $isIconOnly ? 1 : 0} 1 auto;
674
+ `;
675
+ }, ({
676
+ $isSubtle
677
+ }) => {
678
+ if (!$isSubtle) return undefined; // Needed for subtle type
679
+
680
+ return 'color: inherit';
681
+ });
682
+ function ButtonContent({
683
+ type,
684
+ isDisabled,
685
+ $isStretch,
686
+ icon,
687
+ children,
688
+ ...props
689
+ }) {
690
+ const color = isDisabled ? 'black-light' : getTextColorByType(type);
691
+ return /*#__PURE__*/jsxRuntime.jsx(ButtonContentContainer, {
692
+ $isSubtle: isSubtle(type),
693
+ $isStretch: $isStretch,
694
+ $isIconOnly: Boolean(!children && icon),
695
+ children: /*#__PURE__*/jsxRuntime.jsx(ButtonContentChildren, {
696
+ icon: icon,
697
+ type: type,
698
+ isDisabled: isDisabled,
699
+ color: color,
700
+ ...props,
701
+ children: children
702
+ })
703
+ });
704
+ }
705
+
706
+ const Button = /*#__PURE__*/react$1.forwardRef(({
707
+ children,
708
+ type = 'default',
709
+ disabled,
710
+ stretch,
711
+ large,
712
+ icon,
713
+ iconPosition = 'left',
714
+ iconSpin,
715
+ testID,
716
+ href,
717
+ hrefAttrs,
718
+ accessibilityRole = 'button',
719
+ onPress
720
+ }, ref) => {
721
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressable, {
722
+ ref: ref,
723
+ accessibilityRole: accessibilityRole,
724
+ testID: testID,
725
+ href: href,
726
+ hrefAttrs: hrefAttrs,
727
+ disabled: disabled,
728
+ $isStretch: stretch,
729
+ $type: type,
730
+ onPress: onPress,
731
+ children: /*#__PURE__*/jsxRuntime.jsxs(BaseStyledButtonPressable, {
732
+ $type: type,
733
+ $isStretch: stretch,
734
+ $isLarge: large,
735
+ $isDisabled: disabled,
736
+ children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
737
+ type: type,
738
+ $isStretch: stretch,
739
+ isDisabled: disabled,
740
+ icon: icon,
741
+ iconPosition: iconPosition,
742
+ iconSpin: iconSpin,
743
+ children: children
744
+ }), null]
745
+ })
746
+ });
747
+ });
748
+
749
+ const Container$5 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
750
+ displayName: "Card__Container",
751
+ componentId: "kitt-universal__sc-1n9psug-0"
752
+ })(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], ({
753
+ theme,
754
+ type
755
+ }) => theme.kitt.card[type].backgroundColor, ({
756
+ theme
757
+ }) => theme.kitt.card.padding, ({
758
+ theme
759
+ }) => theme.kitt.card.borderRadius, ({
760
+ theme
761
+ }) => theme.kitt.card.borderWidth, ({
762
+ theme,
763
+ type
764
+ }) => theme.kitt.card[type].borderColor);
765
+ function Card({
766
+ children,
767
+ type
768
+ }) {
769
+ return /*#__PURE__*/jsxRuntime.jsx(Container$5, {
770
+ type: type,
771
+ children: children
772
+ });
773
+ }
774
+
775
+ const StyledEmoji = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Image).withConfig({
776
+ displayName: "Emoji__StyledEmoji",
777
+ componentId: "kitt-universal__sc-ggl6wj-0"
778
+ })(["width:", "px;height:", "px;"], ({
779
+ size
780
+ }) => size, ({
781
+ size
782
+ }) => size);
783
+ function Emoji({
784
+ emoji,
785
+ size,
786
+ style
787
+ }) {
788
+ const [emojiData] = react$1.useMemo(() => twemojiParser.parse(emoji, {
789
+ // on native plaforms, you can't display svg as Image
790
+ assetType: 'svg'
791
+ }), [emoji]);
792
+ if (!emojiData) return null;
793
+ return /*#__PURE__*/jsxRuntime.jsx(StyledEmoji, {
794
+ size: size,
795
+ accessibilityLabel: emojiData.text,
796
+ source: {
797
+ uri: emojiData.url
798
+ },
799
+ style: style
800
+ });
801
+ }
802
+
803
+ const defaultOpenLinkBehavior = {
804
+ native: 'openInModal',
805
+ web: 'targetBlank'
806
+ };
807
+
808
+ function ExternalLink({
809
+ as: Component,
810
+ href,
811
+ openLinkBehavior = defaultOpenLinkBehavior,
812
+ onPress,
813
+ ...rest
814
+ }) {
815
+ return /*#__PURE__*/jsxRuntime.jsx(Component, { ...rest,
816
+ href: href,
817
+ hrefAttrs: openLinkBehavior?.web === 'targetSelf' ? undefined : {
818
+ target: '_blank',
819
+ rel: 'noopener noreferrer'
820
+ },
821
+ onPress: onPress
822
+ });
823
+ }
824
+
825
+ const getColorFromState = state => {
826
+ switch (state) {
827
+ case 'invalid':
828
+ return 'danger';
829
+
830
+ default:
831
+ return 'black-light';
832
+ }
833
+ };
834
+
835
+ function InputFeedback({
836
+ state,
837
+ testID,
838
+ children
839
+ }) {
840
+ return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
841
+ base: "body-small",
842
+ color: getColorFromState(state),
843
+ testID: testID,
844
+ children: children
845
+ });
846
+ }
847
+
848
+ const FieldContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
849
+ displayName: "InputField__FieldContainer",
850
+ componentId: "kitt-universal__sc-13fkixs-0"
851
+ })(["padding:5px 0 10px;"]);
852
+ const FeedbackContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
853
+ displayName: "InputField__FeedbackContainer",
854
+ componentId: "kitt-universal__sc-13fkixs-1"
855
+ })(["", ";"], ({
856
+ theme
857
+ }) => theme.responsive.ifWindowSizeMatches({
858
+ minWidth: KittBreakpoints.SMALL
859
+ }, 'padding-top: 10px', 'padding-top: 5px'));
860
+ const FieldLabelContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
861
+ displayName: "InputField__FieldLabelContainer",
862
+ componentId: "kitt-universal__sc-13fkixs-2"
863
+ })(["flex-direction:row;align-items:center;padding-bottom:", "px;"], ({
864
+ theme
865
+ }) => theme.kitt.forms.inputField.labelContainerPaddingBottom);
866
+ const LabelContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
867
+ displayName: "InputField__LabelContainer",
868
+ componentId: "kitt-universal__sc-13fkixs-3"
869
+ })(["margin-right:", "px;"], ({
870
+ theme
871
+ }) => theme.kitt.forms.inputField.iconMarginLeft);
872
+ function InputField({
873
+ label,
874
+ labelFeedback,
875
+ input,
876
+ feedback
877
+ }) {
878
+ return /*#__PURE__*/jsxRuntime.jsxs(FieldContainer, {
879
+ children: [label ? /*#__PURE__*/jsxRuntime.jsxs(FieldLabelContainer, {
880
+ children: [/*#__PURE__*/jsxRuntime.jsx(LabelContainer, {
881
+ children: label
882
+ }), labelFeedback]
883
+ }) : null, input, feedback ? /*#__PURE__*/jsxRuntime.jsx(FeedbackContainer, {
884
+ children: feedback
885
+ }) : null]
886
+ });
887
+ }
888
+
889
+ const useInputText = () => {
890
+ const [isFocused, setIsFocused] = react$1.useState(false);
891
+ const [isPasswordVisible, setIsPasswordVisible] = react$1.useState(false);
892
+ return {
893
+ isFocused,
894
+ handleInputFocus: () => setIsFocused(true),
895
+ handleInputBlur: () => setIsFocused(false),
896
+ togglePasswordVisibility: () => setIsPasswordVisible(isVisible => !isVisible),
897
+ isPasswordVisible
898
+ };
899
+ };
900
+
901
+ const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", ";border-radius:", ";border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
902
+ theme,
903
+ state
904
+ }) => state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states.default.backgroundColor, ({
905
+ theme
906
+ }) => theme.kitt.forms.input.borderWidth, ({
907
+ theme
908
+ }) => theme.kitt.forms.input.borderRadius, ({
909
+ theme,
910
+ state
911
+ }) => theme.kitt.forms.input.states[state].borderColor, ({
912
+ theme
913
+ }) => {
914
+ const typeConfigKey = getTypographyTypeConfigKey(theme);
915
+ return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize;
916
+ }, ({
917
+ theme,
918
+ state
919
+ }) => theme.kitt.typography.colors[theme.kitt.forms.input.states[state].color], ({
920
+ theme
921
+ }) => theme.kitt.typography.types.bodies.fontFamily.regular);
922
+ const Input = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.TextInput).withConfig({
923
+ displayName: "InputText__Input",
924
+ componentId: "kitt-universal__sc-uke279-0"
925
+ })(["", " padding:", ";line-height:", ";min-height:", "px;"], styledTextInputMixin, ({
926
+ theme,
927
+ multiline
928
+ }) => !multiline && "web" === 'ios' ? theme.kitt.forms.input.paddingSingleLineIOS : theme.kitt.forms.input.padding, ({
929
+ theme,
930
+ multiline
931
+ }) => {
932
+ if (!multiline && "web" === 'ios') return 0;
933
+ const typeConfigKey = getTypographyTypeConfigKey(theme);
934
+ return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight;
935
+ }, ({
936
+ minHeight
937
+ }) => minHeight);
938
+ const Container$4 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
939
+ displayName: "InputText__Container",
940
+ componentId: "kitt-universal__sc-uke279-1"
941
+ })(["margin-top:", ";margin-bottom:", ";"], ({
942
+ theme
943
+ }) => theme.kitt.forms.input.marginTop, ({
944
+ theme
945
+ }) => theme.kitt.forms.input.marginBottom);
946
+ const PasswordButtonContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
947
+ displayName: "InputText__PasswordButtonContainer",
948
+ componentId: "kitt-universal__sc-uke279-2"
949
+ })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:", "px;"], ({
950
+ theme
951
+ }) => theme.kitt.forms.input.passwordButtonIconSize / 2);
952
+
953
+ const getInputState = ({
954
+ isDisabled,
955
+ isFocused,
956
+ formState
957
+ }) => {
958
+ if (isDisabled) return 'disabled';
959
+ if (isFocused) return 'focus';
960
+ if (formState === 'invalid') return 'invalid';
961
+ return 'default';
962
+ };
963
+
964
+ const keyboardTypeByTextInputType = {
965
+ text: 'default',
966
+ email: 'email-address',
967
+ password: 'default',
968
+ username: 'default'
969
+ };
970
+ const autoCompleteTypeByType = {
971
+ text: 'off',
972
+ email: 'email',
973
+ password: 'password',
974
+ username: 'name'
975
+ };
976
+ const autoCorrectByType = {
977
+ text: true,
978
+ email: false,
979
+ password: false,
980
+ username: false
981
+ };
982
+ const textContentTypeByType = {
983
+ text: 'none',
984
+ email: 'emailAddress',
985
+ password: 'password',
986
+ username: 'username'
987
+ };
988
+ const InputText = /*#__PURE__*/react$1.forwardRef(({
989
+ id,
990
+ minHeight = 0,
991
+ type,
992
+ state: formState,
993
+ internalForceState,
994
+ disabled = false,
995
+ onFocus,
996
+ onBlur,
997
+ ...props
998
+ }, ref) => {
999
+ const {
1000
+ isFocused,
1001
+ handleInputBlur,
1002
+ handleInputFocus,
1003
+ isPasswordVisible,
1004
+ togglePasswordVisibility
1005
+ } = useInputText();
1006
+ const theme = /*#__PURE__*/styled.useTheme();
1007
+ const state = internalForceState || getInputState({
1008
+ isFocused,
1009
+ isDisabled: disabled,
1010
+ formState
1011
+ });
1012
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$4, {
1013
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
1014
+ ref: ref,
1015
+ nativeID: id,
1016
+ editable: !disabled,
1017
+ keyboardType: keyboardTypeByTextInputType[type],
1018
+ autoCompleteType: autoCompleteTypeByType[type],
1019
+ autoCorrect: autoCorrectByType[type],
1020
+ minHeight: minHeight,
1021
+ textContentType: textContentTypeByType[type],
1022
+ placeholderTextColor: theme.kitt.typography.colors[theme.kitt.forms.input.placeholderColor],
1023
+ selectionColor: theme.kitt.forms.input.selectionColor,
1024
+ secureTextEntry: type === 'password' && !isPasswordVisible,
1025
+ ...props,
1026
+ state: state,
1027
+ onFocus: e => {
1028
+ handleInputFocus();
1029
+ if (onFocus) onFocus(e);
1030
+ },
1031
+ onBlur: e => {
1032
+ handleInputBlur();
1033
+ if (onBlur) onBlur(e);
1034
+ }
1035
+ }), type === 'password' && !disabled && /*#__PURE__*/jsxRuntime.jsx(PasswordButtonContainer, {
1036
+ accessibilityRole: "button",
1037
+ onPress: togglePasswordVisibility,
1038
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
1039
+ icon: isPasswordVisible ? /*#__PURE__*/jsxRuntime.jsx(kittIcons.EyeIcon, {}) : /*#__PURE__*/jsxRuntime.jsx(kittIcons.EyeOffIcon, {}),
1040
+ size: theme.kitt.forms.input.passwordButtonIconSize,
1041
+ color: theme.kitt.forms.input.states[state].passwordButtonIconColor
1042
+ })
1043
+ })]
1044
+ });
1045
+ });
1046
+
1047
+ function Label({
1048
+ htmlFor,
1049
+ children
1050
+ }) {
1051
+ return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
1052
+ base: "body",
1053
+ children: /*#__PURE__*/jsxRuntime.jsx("label", {
1054
+ htmlFor: htmlFor,
1055
+ children: children
1056
+ })
1057
+ });
1058
+ }
1059
+
1060
+ const OuterRadio = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1061
+ displayName: "Radio__OuterRadio",
1062
+ componentId: "kitt-universal__sc-1mdgr2o-0"
1063
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", ";border-color:", ";"], ({
1064
+ theme,
1065
+ disabled
1066
+ }) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor, ({
1067
+ theme
1068
+ }) => theme.kitt.forms.radio.size, ({
1069
+ theme
1070
+ }) => theme.kitt.forms.radio.size, ({
1071
+ theme
1072
+ }) => theme.kitt.forms.radio.size / 2, ({
1073
+ theme
1074
+ }) => theme.kitt.forms.radio.unchecked.borderWidth, ({
1075
+ theme,
1076
+ disabled
1077
+ }) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor);
1078
+ const SelectedOuterRadio = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1079
+ displayName: "Radio__SelectedOuterRadio",
1080
+ componentId: "kitt-universal__sc-1mdgr2o-1"
1081
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;justify-content:center;align-items:center;"], ({
1082
+ theme
1083
+ }) => theme.kitt.forms.radio.checked.backgroundColor, ({
1084
+ theme
1085
+ }) => theme.kitt.forms.radio.size, ({
1086
+ theme
1087
+ }) => theme.kitt.forms.radio.size, ({
1088
+ theme
1089
+ }) => theme.kitt.forms.radio.size / 2);
1090
+ const SelectedInnerRadio = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1091
+ displayName: "Radio__SelectedInnerRadio",
1092
+ componentId: "kitt-universal__sc-1mdgr2o-2"
1093
+ })(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;"], ({
1094
+ theme
1095
+ }) => theme.kitt.forms.radio.checked.innerBackgroundColor, ({
1096
+ theme
1097
+ }) => theme.kitt.forms.radio.checked.innerSize, ({
1098
+ theme
1099
+ }) => theme.kitt.forms.radio.checked.innerSize, ({
1100
+ theme
1101
+ }) => theme.kitt.forms.radio.checked.innerSize / 2);
1102
+ const Container$3 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1103
+ displayName: "Radio__Container",
1104
+ componentId: "kitt-universal__sc-1mdgr2o-3"
1105
+ })(["flex-direction:row;align-items:center;"]);
1106
+ const Text = /*#__PURE__*/styled__default(Typography.Text).withConfig({
1107
+ displayName: "Radio__Text",
1108
+ componentId: "kitt-universal__sc-1mdgr2o-4"
1109
+ })(["margin-left:", "px;"], ({
1110
+ theme
1111
+ }) => theme.kitt.spacing * 2);
1112
+ function Radio({
1113
+ id,
1114
+ checked,
1115
+ onChange,
1116
+ value,
1117
+ disabled = false,
1118
+ children
1119
+ }) {
1120
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$3, {
1121
+ nativeID: id,
1122
+ disabled: disabled,
1123
+ accessibilityRole: "radio",
1124
+ "aria-checked": checked,
1125
+ focusable: checked && !disabled,
1126
+ onPress: () => {
1127
+ onChange(value);
1128
+ },
1129
+ children: [checked && !disabled ? /*#__PURE__*/jsxRuntime.jsx(SelectedOuterRadio, {
1130
+ children: /*#__PURE__*/jsxRuntime.jsx(SelectedInnerRadio, {})
1131
+ }) : /*#__PURE__*/jsxRuntime.jsx(OuterRadio, {
1132
+ disabled: disabled
1133
+ }), /*#__PURE__*/jsxRuntime.jsx(Text, {
1134
+ base: "body",
1135
+ color: disabled ? 'black-light' : 'black',
1136
+ children: children
1137
+ })]
1138
+ });
1139
+ }
1140
+
1141
+ function TextArea({ ...props
1142
+ }) {
1143
+ const theme = /*#__PURE__*/styled.useTheme();
1144
+ return /*#__PURE__*/jsxRuntime.jsx(InputText, {
1145
+ multiline: true,
1146
+ ...props,
1147
+ type: "text",
1148
+ minHeight: theme.kitt.forms.input.textAreaMinHeight
1149
+ });
1150
+ }
1151
+
1152
+ const Body = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1153
+ displayName: "Body",
1154
+ componentId: "kitt-universal__sc-1ofncfn-0"
1155
+ })(["", " background-color:", ";flex:1;"], ({
1156
+ theme
1157
+ }) => theme.responsive.ifWindowSizeMatches({
1158
+ minWidth: KittBreakpoints.MEDIUM
1159
+ }, `padding-right: ${theme.kitt.spacing * 12}px;
1160
+ padding-left: ${theme.kitt.spacing * 12}px;`, `padding-right: ${theme.kitt.spacing * 6}px;
1161
+ padding-left: ${theme.kitt.spacing * 6}px;`), ({
1162
+ theme
1163
+ }) => theme.kitt.colors.uiBackgroundLight);
1164
+ function FullScreenModalBody({
1165
+ children
1166
+ }) {
1167
+ return /*#__PURE__*/jsxRuntime.jsx(Body, {
1168
+ children: children
1169
+ });
1170
+ }
1171
+
1172
+ const SideContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1173
+ displayName: "Header__SideContainer",
1174
+ componentId: "kitt-universal__sc-dfmxi1-0"
1175
+ })(["", ""], ({
1176
+ theme,
1177
+ side = 'left'
1178
+ }) => {
1179
+ const padding = theme.kitt.spacing * 2;
1180
+
1181
+ if (side === 'left') {
1182
+ return `padding-right: ${padding}px;`;
1183
+ }
1184
+
1185
+ return `padding-left: ${padding}px;`;
1186
+ });
1187
+
1188
+ function getHeaderHorizontalMediumPadding(spacing) {
1189
+ return spacing * 6;
1190
+ }
1191
+
1192
+ const Header = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1193
+ displayName: "Header",
1194
+ componentId: "kitt-universal__sc-dfmxi1-1"
1195
+ })(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
1196
+ theme,
1197
+ insetTop = 0
1198
+ }) => {
1199
+ const paddingTop = insetTop + theme.kitt.fullScreenModal.header.paddingVertical;
1200
+ const {
1201
+ paddingVertical,
1202
+ paddingHorizontal
1203
+ } = theme.kitt.fullScreenModal.header;
1204
+ return theme.responsive.ifWindowSizeMatches({
1205
+ minWidth: KittBreakpoints.MEDIUM
1206
+ }, `padding: ${paddingTop}px ${getHeaderHorizontalMediumPadding(theme.kitt.spacing)}px ${paddingVertical}px;`, `padding: ${paddingTop}px ${paddingHorizontal}px ${paddingVertical}px;`);
1207
+ }, ({
1208
+ theme
1209
+ }) => theme.kitt.fullScreenModal.header.borderColor);
1210
+ const HeaderContent = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1211
+ displayName: "Header__HeaderContent",
1212
+ componentId: "kitt-universal__sc-dfmxi1-2"
1213
+ })(["", ";", ";justify-content:center;align-items:center;"], ({
1214
+ theme,
1215
+ leftWidth,
1216
+ rightWidth,
1217
+ windowWidth
1218
+ }) => {
1219
+ /*
1220
+ * Since we don't have controll over the rendered left and right elements,
1221
+ * we must apply some logic to give the title all the available space
1222
+ */
1223
+ const sideElementMaxWidth = Math.max(leftWidth, rightWidth);
1224
+ const parentHorizontalPadding = theme.kitt.fullScreenModal.header.paddingHorizontal * 2;
1225
+ const parentHorizontalPaddingMedium = getHeaderHorizontalMediumPadding(theme.kitt.spacing) * 2;
1226
+
1227
+ const computeWidth = breakpointPadding => windowWidth - breakpointPadding - sideElementMaxWidth * 2;
1228
+
1229
+ return theme.responsive.ifWindowSizeMatches({
1230
+ minWidth: KittBreakpoints.MEDIUM
1231
+ }, `width: ${computeWidth(parentHorizontalPaddingMedium)}px;`, `width: ${computeWidth(parentHorizontalPadding)}px;`);
1232
+ }, ({
1233
+ leftWidth,
1234
+ rightWidth
1235
+ }) => {
1236
+ // Depending of the wider element, we must add a margin to fill the diff in space between elements
1237
+ const deltaMargin = Math.abs(leftWidth - rightWidth);
1238
+
1239
+ if (leftWidth > rightWidth) {
1240
+ return `margin-right: ${deltaMargin}px;`;
1241
+ }
1242
+
1243
+ return `margin-left: ${deltaMargin}px;`;
1244
+ });
1245
+ function FullScreenModalHeader({
1246
+ children,
1247
+ right,
1248
+ left
1249
+ }) {
1250
+ const {
1251
+ top
1252
+ } = reactNativeSafeAreaContext.useSafeAreaInsets();
1253
+ const dimensions = BabelPluginStyledComponentsReactNative.useWindowDimensions();
1254
+ const [leftWidth, setLeftWidth] = react$1.useState(0);
1255
+ const [rightWidth, setRightWidth] = react$1.useState(0);
1256
+
1257
+ const handleLayoutChange = (event, side) => {
1258
+ // Prevents react to nullify event on rerenders
1259
+ event.persist();
1260
+
1261
+ if (side === 'left') {
1262
+ setLeftWidth(event.nativeEvent.layout.width);
1263
+ return;
1264
+ }
1265
+
1266
+ setRightWidth(event.nativeEvent.layout.width);
1267
+ };
1268
+
1269
+ return /*#__PURE__*/jsxRuntime.jsxs(Header, {
1270
+ insetTop: top,
1271
+ children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
1272
+ onLayout: e => handleLayoutChange(e, 'left'),
1273
+ children: left
1274
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(HeaderContent, {
1275
+ windowWidth: dimensions.width,
1276
+ leftWidth: leftWidth,
1277
+ rightWidth: rightWidth,
1278
+ children: children
1279
+ }), right ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
1280
+ side: "right",
1281
+ onLayout: e => handleLayoutChange(e, 'right'),
1282
+ children: right
1283
+ }) : null]
1284
+ });
1285
+ }
1286
+
1287
+ const Container$2 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1288
+ displayName: "FullScreenModal__Container",
1289
+ componentId: "kitt-universal__sc-11qpbe3-0"
1290
+ })(["flex:1;background-color:", ";"], ({
1291
+ theme
1292
+ }) => theme.kitt.colors.uiBackground);
1293
+ function FullScreenModal({
1294
+ children
1295
+ }) {
1296
+ return /*#__PURE__*/jsxRuntime.jsx(Container$2, {
1297
+ children: children
1298
+ });
1299
+ }
1300
+ FullScreenModal.Header = FullScreenModalHeader;
1301
+ FullScreenModal.Body = FullScreenModalBody;
1302
+
1303
+ function StyleWebWrapper({
1304
+ as,
1305
+ children,
1306
+ ...props
1307
+ }) {
1308
+ // as or default to div. If as is undefined, T is div but typescript is not sure
1309
+ return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
1310
+ children: children
1311
+ });
1312
+ }
1313
+
1314
+ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react.styled("div")({
1315
+ name: "PressableIconButtonWebWrapper",
1316
+ class: "p1nlccvg",
1317
+ vars: {
1318
+ "p1nlccvg-0": [({
1319
+ theme
1320
+ }) => theme.kitt.iconButton.scale.base.hover],
1321
+ "p1nlccvg-1": [({
1322
+ theme
1323
+ }) => theme.breakpoints.min.mediumBreakpoint],
1324
+ "p1nlccvg-2": [({
1325
+ theme
1326
+ }) => theme.kitt.iconButton.scale.medium.hover],
1327
+ "p1nlccvg-3": [({
1328
+ theme
1329
+ }) => theme.kitt.iconButton.scale.base.active],
1330
+ "p1nlccvg-4": [({
1331
+ theme
1332
+ }) => theme.kitt.iconButton.default.pressedBackgroundColor],
1333
+ "p1nlccvg-5": [({
1334
+ theme
1335
+ }) => theme.kitt.iconButton.white.pressedBackgroundColor]
1336
+ }
1337
+ }));
1338
+ const StyledPressableIconButton = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1339
+ displayName: "PressableIconButton__StyledPressableIconButton",
1340
+ componentId: "kitt-universal__sc-1m6jo3s-0"
1341
+ })(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], ({
1342
+ theme
1343
+ }) => theme.kitt.iconButton.borderRadius, ({
1344
+ theme
1345
+ }) => theme.kitt.iconButton.width, ({
1346
+ theme
1347
+ }) => theme.kitt.iconButton.height, ({
1348
+ theme,
1349
+ disabled
1350
+ }) => {
1351
+ const {
1352
+ iconButton
1353
+ } = theme.kitt;
1354
+ const {
1355
+ transition
1356
+ } = iconButton;
1357
+
1358
+ if (disabled) {
1359
+ return `
1360
+ background-color: ${iconButton.disabled.backgroundColor};
1361
+ `;
1362
+ }
1363
+
1364
+ return `
1365
+ transition: ${transition.property} ${transition.duration} ${transition.timingFunction};
1366
+ `;
1367
+ });
1368
+ function PressableIconButton({
1369
+ color,
1370
+ ...props
1371
+ }) {
1372
+ return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
1373
+ as: PressableIconButtonWebWrapper,
1374
+ "data-color-white": color === 'white' ? true : undefined,
1375
+ children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props
1376
+ })
1377
+ });
1378
+ }
1379
+
1380
+ function PressableAnimatedContainer({
1381
+ children,
1382
+ color,
1383
+ disabled,
1384
+ onPress
1385
+ }) {
1386
+ return /*#__PURE__*/jsxRuntime.jsx(PressableIconButton, {
1387
+ accessibilityRole: "button",
1388
+ color: color,
1389
+ disabled: disabled,
1390
+ onPress: onPress,
1391
+ children: children
1392
+ });
1393
+ }
1394
+
1395
+ const IconButtonContentBorder = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1396
+ displayName: "IconButton__IconButtonContentBorder",
1397
+ componentId: "kitt-universal__sc-swelbf-0"
1398
+ })(["border:", ";border-color:", ";width:", "px;height:", "px;align-items:center;justify-content:center;border-radius:", "px;"], ({
1399
+ theme
1400
+ }) => `${theme.kitt.iconButton.borderWidth}px solid`, ({
1401
+ theme,
1402
+ disabled
1403
+ }) => disabled ? theme.kitt.iconButton.disabled.borderColor : theme.kitt.iconButton.borderColor, ({
1404
+ theme
1405
+ }) => theme.kitt.iconButton.width - theme.kitt.iconButton.borderWidth, ({
1406
+ theme
1407
+ }) => theme.kitt.iconButton.height - theme.kitt.iconButton.borderWidth, ({
1408
+ theme
1409
+ }) => theme.kitt.iconButton.borderRadius);
1410
+
1411
+ function IconButtonContent({
1412
+ disabled,
1413
+ color,
1414
+ icon
1415
+ }) {
1416
+ return /*#__PURE__*/jsxRuntime.jsx(IconButtonContentBorder, {
1417
+ disabled: disabled,
1418
+ children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
1419
+ color: disabled ? 'black-light' : color,
1420
+ icon: icon
1421
+ })
1422
+ });
1423
+ }
1424
+
1425
+ function IconButton({
1426
+ icon,
1427
+ color,
1428
+ disabled,
1429
+ onPress
1430
+ }) {
1431
+ return /*#__PURE__*/jsxRuntime.jsx(PressableAnimatedContainer, {
1432
+ color: color,
1433
+ disabled: disabled,
1434
+ onPress: onPress,
1435
+ children: /*#__PURE__*/jsxRuntime.jsx(IconButtonContent, {
1436
+ disabled: disabled,
1437
+ color: color,
1438
+ icon: icon
1439
+ })
1440
+ });
1441
+ }
1442
+
1443
+ const ContentView$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1444
+ displayName: "ListItemContent__ContentView",
1445
+ componentId: "kitt-universal__sc-57q0u9-0"
1446
+ })(["flex:1 0 0%;align-self:center;"]);
1447
+ function ListItemContent({
1448
+ children,
1449
+ ...rest
1450
+ }) {
1451
+ return /*#__PURE__*/jsxRuntime.jsx(ContentView$1, { ...rest,
1452
+ children: children
1453
+ });
1454
+ }
1455
+
1456
+ const SideContainerView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1457
+ displayName: "ListItemSideContent__SideContainerView",
1458
+ componentId: "kitt-universal__sc-1vajiw-0"
1459
+ })(["flex-direction:row;margin-left:", ";margin-right:", ";"], ({
1460
+ theme,
1461
+ side
1462
+ }) => side === 'right' ? theme.kitt.listItem.innerMargin : 0, ({
1463
+ theme,
1464
+ side
1465
+ }) => side === 'left' ? theme.kitt.listItem.innerMargin : 0); // Handles the vertical alignment of the side elements of the list item
1466
+
1467
+ function ListItemSideContainer({
1468
+ children,
1469
+ side = 'left',
1470
+ ...rest
1471
+ }) {
1472
+ return /*#__PURE__*/jsxRuntime.jsx(SideContainerView, {
1473
+ side: side,
1474
+ ...rest,
1475
+ children: children
1476
+ });
1477
+ }
1478
+ const SideContentView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1479
+ displayName: "ListItemSideContent__SideContentView",
1480
+ componentId: "kitt-universal__sc-1vajiw-1"
1481
+ })(["align-self:", ";"], ({
1482
+ align
1483
+ }) => align);
1484
+ function ListItemSideContent({
1485
+ children,
1486
+ align = 'auto',
1487
+ ...rest
1488
+ }) {
1489
+ return /*#__PURE__*/jsxRuntime.jsx(SideContentView, {
1490
+ align: align,
1491
+ ...rest,
1492
+ children: children
1493
+ });
1494
+ }
1495
+
1496
+ const ContainerView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1497
+ displayName: "ListItem__ContainerView",
1498
+ componentId: "kitt-universal__sc-2afp9s-0"
1499
+ })(["flex-direction:row;padding:", ";", ";border-color:", ";background-color:", ";"], ({
1500
+ withPadding,
1501
+ theme
1502
+ }) => withPadding ? theme.kitt.listItem.padding : 0, ({
1503
+ theme,
1504
+ borders
1505
+ }) => {
1506
+ const {
1507
+ borderWidth
1508
+ } = theme.kitt.listItem;
1509
+
1510
+ if (borders === 'top') {
1511
+ return `border-top-width: ${borderWidth}`;
1512
+ }
1513
+
1514
+ if (borders === 'bottom') {
1515
+ return `border-bottom-width: ${borderWidth}`;
1516
+ }
1517
+
1518
+ if (borders === 'both') {
1519
+ return `border-top-width: ${borderWidth}; border-bottom-width: ${borderWidth}`;
1520
+ }
1521
+
1522
+ return 'border: none';
1523
+ }, ({
1524
+ theme
1525
+ }) => theme.kitt.listItem.borderColor, ({
1526
+ theme
1527
+ }) => theme.kitt.colors.uiBackgroundLight);
1528
+ function ListItem({
1529
+ children,
1530
+ withPadding,
1531
+ borders,
1532
+ left,
1533
+ right,
1534
+ onPress,
1535
+ ...rest
1536
+ }) {
1537
+ const Wrapper = onPress ? BabelPluginStyledComponentsReactNative.Pressable : react$1.Fragment;
1538
+ const wrapperProps = onPress ? {
1539
+ accessibilityRole: 'button',
1540
+ onPress,
1541
+ ...rest
1542
+ } : undefined;
1543
+ const containerProps = onPress ? undefined : rest;
1544
+ return /*#__PURE__*/jsxRuntime.jsx(Wrapper, { ...wrapperProps,
1545
+ children: /*#__PURE__*/jsxRuntime.jsxs(ContainerView, {
1546
+ withPadding: withPadding,
1547
+ borders: borders,
1548
+ ...containerProps,
1549
+ children: [left ? /*#__PURE__*/jsxRuntime.jsx(ListItemSideContainer, {
1550
+ side: "left",
1551
+ children: left
1552
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(ListItemContent, {
1553
+ children: children
1554
+ }), right ? /*#__PURE__*/jsxRuntime.jsx(ListItemSideContainer, {
1555
+ side: "right",
1556
+ children: right
1557
+ }) : null]
1558
+ })
1559
+ });
1560
+ }
1561
+ ListItem.Content = ListItemContent;
1562
+ ListItem.SideContent = ListItemSideContent;
1563
+ ListItem.SideContainer = ListItemSideContainer;
1564
+
1565
+ const LargeLoaderContainer = withTheme( /*#__PURE__*/react.styled("div")({
1566
+ name: "LargeLoaderContainer",
1567
+ class: "l2im3sa",
1568
+ vars: {
1569
+ "l2im3sa-0": [({
1570
+ theme
1571
+ }) => theme.kitt.colors.separator],
1572
+ "l2im3sa-1": [({
1573
+ theme
1574
+ }) => theme.kitt.colors.primary]
1575
+ }
1576
+ }));
1577
+ function LargeLoader() {
1578
+ return /*#__PURE__*/jsxRuntime.jsx(LargeLoaderContainer, {
1579
+ children: /*#__PURE__*/jsxRuntime.jsxs("svg", {
1580
+ width: "60",
1581
+ height: "60",
1582
+ children: [/*#__PURE__*/jsxRuntime.jsx("g", {
1583
+ "data-large-loader": "base",
1584
+ children: /*#__PURE__*/jsxRuntime.jsx("circle", {
1585
+ cx: "30",
1586
+ cy: "30",
1587
+ r: "27",
1588
+ fill: "none"
1589
+ })
1590
+ }), /*#__PURE__*/jsxRuntime.jsx("g", {
1591
+ "data-large-loader": "fill",
1592
+ children: /*#__PURE__*/jsxRuntime.jsx("circle", {
1593
+ cx: "30",
1594
+ cy: "30",
1595
+ r: "27",
1596
+ fill: "none"
1597
+ })
1598
+ })]
1599
+ })
1600
+ });
1601
+ }
1602
+
1603
+ function Loader({
1604
+ color = 'primary',
1605
+ size = 20
1606
+ }) {
1607
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
1608
+ spin: true,
1609
+ color: color,
1610
+ size: size,
1611
+ icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.LoaderIcon, {})
1612
+ });
1613
+ }
1614
+
1615
+ const xIconSize = 14;
1616
+ const mainIconSize = 20;
1617
+ const Container$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1618
+ displayName: "Message__Container",
1619
+ componentId: "kitt-universal__sc-c6400e-0"
1620
+ })(["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;"], ({
1621
+ theme,
1622
+ noRadius
1623
+ }) => noRadius ? 0 : theme.kitt.spacing * 5, ({
1624
+ theme,
1625
+ type
1626
+ }) => theme.kitt.feedbackMessage.backgroundColors[type], ({
1627
+ theme
1628
+ }) => theme.kitt.spacing * 4, ({
1629
+ theme
1630
+ }) => theme.kitt.spacing * 4, ({
1631
+ theme
1632
+ }) => theme.kitt.spacing * 4, ({
1633
+ theme,
1634
+ insets
1635
+ }) => (insets?.top ?? 0) + theme.kitt.spacing * 4);
1636
+ const CloseContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.TouchableOpacity).withConfig({
1637
+ displayName: "Message__CloseContainer",
1638
+ componentId: "kitt-universal__sc-c6400e-1"
1639
+ })(["margin-left:", "px;padding:", "px;"], ({
1640
+ theme
1641
+ }) => theme.kitt.spacing * 4, ({
1642
+ theme
1643
+ }) => theme.kitt.spacing);
1644
+ const IconContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1645
+ displayName: "Message__IconContainer",
1646
+ componentId: "kitt-universal__sc-c6400e-2"
1647
+ })(["margin-right:", "px;"], ({
1648
+ theme
1649
+ }) => theme.kitt.spacing * 4);
1650
+ const Content = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Text).withConfig({
1651
+ displayName: "Message__Content",
1652
+ componentId: "kitt-universal__sc-c6400e-3"
1653
+ })(["text-align:", ";flex:1;"], ({
1654
+ centeredText
1655
+ }) => centeredText ? 'center' : 'left');
1656
+
1657
+ const getColorByType = type => {
1658
+ switch (type) {
1659
+ case 'success':
1660
+ return 'white';
1661
+
1662
+ case 'danger':
1663
+ return 'white';
1664
+
1665
+ case 'warning':
1666
+ default:
1667
+ return 'black';
1668
+ }
1669
+ };
1670
+
1671
+ function getIconContent(type) {
1672
+ switch (type) {
1673
+ case 'warning':
1674
+ return /*#__PURE__*/jsxRuntime.jsx(kittIcons.AlertCircleIcon, {});
1675
+
1676
+ case 'success':
1677
+ return /*#__PURE__*/jsxRuntime.jsx(kittIcons.CheckIcon, {});
1678
+
1679
+ case 'danger':
1680
+ return /*#__PURE__*/jsxRuntime.jsx(kittIcons.AlertTriangleIcon, {});
1681
+
1682
+ default:
1683
+ return /*#__PURE__*/jsxRuntime.jsx(kittIcons.InfoIcon, {});
1684
+ }
1685
+ }
1686
+
1687
+ function Message({
1688
+ type = 'info',
1689
+ children,
1690
+ noRadius = false,
1691
+ centeredText = false,
1692
+ onDismiss,
1693
+ insets
1694
+ }) {
1695
+ const color = getColorByType(type);
1696
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$1, {
1697
+ type: type,
1698
+ noRadius: noRadius,
1699
+ insets: insets,
1700
+ children: [!centeredText ? /*#__PURE__*/jsxRuntime.jsx(IconContainer, {
1701
+ children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
1702
+ size: mainIconSize,
1703
+ color: color,
1704
+ icon: getIconContent(type)
1705
+ })
1706
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(Content, {
1707
+ type: type,
1708
+ centeredText: centeredText,
1709
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
1710
+ base: "body-small",
1711
+ color: color,
1712
+ children: children
1713
+ })
1714
+ }), onDismiss ? /*#__PURE__*/jsxRuntime.jsx(CloseContainer, {
1715
+ onPress: onDismiss,
1716
+ children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
1717
+ icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
1718
+ size: xIconSize,
1719
+ color: color
1720
+ })
1721
+ }) : null]
1722
+ });
1723
+ }
1724
+
1725
+ // Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
1726
+ const OverlayPressable = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
1727
+ displayName: "Overlay__OverlayPressable",
1728
+ componentId: "kitt-universal__sc-1cz1gbr-0"
1729
+ })(({
1730
+ theme
1731
+ }) => ({ ...BabelPluginStyledComponentsReactNative.StyleSheet.absoluteFillObject,
1732
+ backgroundColor: theme.kitt.colors.overlay.dark
1733
+ }));
1734
+ function Overlay({
1735
+ onPress
1736
+ }) {
1737
+ return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
1738
+ accessibilityRole: "none",
1739
+ onPress: onPress,
1740
+ children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.View, {})
1741
+ });
1742
+ }
1743
+
1744
+ const BodyView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1745
+ displayName: "Body__BodyView",
1746
+ componentId: "kitt-universal__sc-17fwpo4-0"
1747
+ })(["padding:", "px ", "px;"], ({
1748
+ theme
1749
+ }) => theme.kitt.spacing * 6, ({
1750
+ theme
1751
+ }) => theme.kitt.spacing * 4);
1752
+ function ModalBody({
1753
+ children
1754
+ }) {
1755
+ return /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.ScrollView, {
1756
+ children: /*#__PURE__*/jsxRuntime.jsx(BodyView, {
1757
+ children: children
1758
+ })
1759
+ });
1760
+ }
1761
+
1762
+ const FooterView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1763
+ displayName: "Footer__FooterView",
1764
+ componentId: "kitt-universal__sc-1ujq2dc-0"
1765
+ })(["flex:0 0 auto;padding:", "px;border-top-width:1px;border-top-color:", ";"], ({
1766
+ theme
1767
+ }) => theme.kitt.spacing * 4, ({
1768
+ theme
1769
+ }) => theme.kitt.colors.separator);
1770
+ function ModalFooter({
1771
+ children
1772
+ }) {
1773
+ return /*#__PURE__*/jsxRuntime.jsx(FooterView, {
1774
+ children: children
1775
+ });
1776
+ }
1777
+
1778
+ const OnCloseContext = /*#__PURE__*/react$1.createContext(() => {});
1779
+
1780
+ const HeaderView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1781
+ displayName: "Header__HeaderView",
1782
+ componentId: "kitt-universal__sc-1iwabch-0"
1783
+ })(["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;"], ({
1784
+ theme
1785
+ }) => theme.kitt.spacing * 2, ({
1786
+ theme
1787
+ }) => theme.kitt.colors.separator);
1788
+ const LeftIconView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1789
+ displayName: "Header__LeftIconView",
1790
+ componentId: "kitt-universal__sc-1iwabch-1"
1791
+ })(["align-self:flex-start;margin-right:", "px;"], ({
1792
+ theme
1793
+ }) => theme.kitt.spacing * 2);
1794
+ const RightIconView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1795
+ displayName: "Header__RightIconView",
1796
+ componentId: "kitt-universal__sc-1iwabch-2"
1797
+ })(["align-self:flex-start;margin-left:", "px;"], ({
1798
+ theme
1799
+ }) => theme.kitt.spacing * 2);
1800
+ const TitleView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1801
+ displayName: "Header__TitleView",
1802
+ componentId: "kitt-universal__sc-1iwabch-3"
1803
+ })(["padding-left:", "px;flex-shrink:1;"], ({
1804
+ theme,
1805
+ isIconLeft
1806
+ }) => isIconLeft ? 0 : theme.kitt.spacing * 2);
1807
+ function ModalHeader({
1808
+ left,
1809
+ right,
1810
+ children
1811
+ }) {
1812
+ const onClose = react$1.useContext(OnCloseContext);
1813
+ const isIconLeft = !!left;
1814
+ return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
1815
+ children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
1816
+ children: left
1817
+ }), /*#__PURE__*/jsxRuntime.jsx(TitleView, {
1818
+ isIconLeft: isIconLeft,
1819
+ children: children
1820
+ }), right !== undefined ? right : /*#__PURE__*/jsxRuntime.jsx(RightIconView, {
1821
+ children: /*#__PURE__*/jsxRuntime.jsx(Button, {
1822
+ type: "subtle-dark",
1823
+ icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.XIcon, {}),
1824
+ onPress: onClose
1825
+ })
1826
+ })]
1827
+ });
1828
+ }
1829
+
1830
+ const ModalView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1831
+ displayName: "Modal__ModalView",
1832
+ componentId: "kitt-universal__sc-1xy2w5u-0"
1833
+ })(["top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:", "px ", "px;"], ({
1834
+ theme
1835
+ }) => theme.kitt.spacing * 20, ({
1836
+ theme
1837
+ }) => theme.kitt.spacing * 4);
1838
+ const ContentView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1839
+ displayName: "Modal__ContentView",
1840
+ componentId: "kitt-universal__sc-1xy2w5u-1"
1841
+ })(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", ";background-color:", ";"], ({
1842
+ theme
1843
+ }) => theme.kitt.card.borderRadius, ({
1844
+ theme
1845
+ }) => theme.kitt.palettes.lateOcean.white);
1846
+ function Modal({
1847
+ visible,
1848
+ children,
1849
+ onClose,
1850
+ onEntered,
1851
+ onExited
1852
+ }) {
1853
+ return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
1854
+ value: onClose,
1855
+ children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Modal, {
1856
+ transparent: true,
1857
+ animationType: "fade",
1858
+ visible: visible,
1859
+ onShow: onEntered,
1860
+ onDismiss: onExited,
1861
+ onRequestClose: onClose,
1862
+ children: /*#__PURE__*/jsxRuntime.jsxs(ModalView, {
1863
+ children: [/*#__PURE__*/jsxRuntime.jsx(Overlay, {
1864
+ onPress: onClose
1865
+ }), /*#__PURE__*/jsxRuntime.jsx(ContentView, {
1866
+ children: children
1867
+ })]
1868
+ })
1869
+ })
1870
+ });
1871
+ }
1872
+ Modal.Header = ModalHeader;
1873
+ Modal.Body = ModalBody;
1874
+ Modal.Footer = ModalFooter;
1875
+
1876
+ function Notification({
1877
+ type,
1878
+ children,
1879
+ centeredText,
1880
+ onDelete
1881
+ }) {
1882
+ const {
1883
+ top
1884
+ } = reactNativeSafeAreaContext.useSafeAreaInsets();
1885
+ return /*#__PURE__*/jsxRuntime.jsx(Message, {
1886
+ noRadius: true,
1887
+ type: type,
1888
+ centeredText: centeredText,
1889
+ insets: {
1890
+ top
1891
+ },
1892
+ onDismiss: onDelete,
1893
+ children: children
1894
+ });
1895
+ }
1896
+
1897
+ const Flex = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1898
+ shouldForwardProp: (prop, defaultValidatorFn) => !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop)
1899
+ }).withConfig({
1900
+ displayName: "Flex",
1901
+ componentId: "kitt-universal__sc-15q3v3h-0"
1902
+ })(["display:flex;flex-direction:", ";flex-wrap:wrap;padding:", "px;"], ({
1903
+ direction
1904
+ }) => direction, ({
1905
+ theme,
1906
+ padding = 0
1907
+ }) => padding * theme.kitt.spacing);
1908
+
1909
+ const storyPadding = 16;
1910
+
1911
+ const getBackgroundColorFromBlockColor = (theme, color = 'transparent') => {
1912
+ switch (color) {
1913
+ case 'dark':
1914
+ return '#293033';
1915
+
1916
+ case 'light':
1917
+ return '#ffffff';
1918
+
1919
+ case 'primary':
1920
+ return theme.kitt.palettes.lateOcean.lateOcean;
1921
+
1922
+ default:
1923
+ return 'transparent';
1924
+ }
1925
+ };
1926
+
1927
+ const getTypographyColorFromBlockColor = (color = 'transparent') => {
1928
+ switch (color) {
1929
+ case 'dark':
1930
+ case 'primary':
1931
+ return 'white';
1932
+
1933
+ case 'light':
1934
+ default:
1935
+ return 'black';
1936
+ }
1937
+ };
1938
+
1939
+ const StoryBlockBackgroundContext = /*#__PURE__*/react$1.createContext('transparent');
1940
+ const StoryBlockColorContext = /*#__PURE__*/react$1.createContext('black');
1941
+ const useStoryBlockColor = color => {
1942
+ const storyBlockColor = react$1.useContext(StoryBlockColorContext);
1943
+ return color || storyBlockColor;
1944
+ };
1945
+ const StyledStoryBlockView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1946
+ displayName: "StoryBlock__StyledStoryBlockView",
1947
+ componentId: "kitt-universal__sc-3w4hdm-0"
1948
+ })(["padding:16px ", "px 0;margin:0 -", "px;background:", ";"], storyPadding, storyPadding, ({
1949
+ theme,
1950
+ background
1951
+ }) => getBackgroundColorFromBlockColor(theme, background));
1952
+ function StoryBlock({
1953
+ children,
1954
+ background
1955
+ }) {
1956
+ return /*#__PURE__*/jsxRuntime.jsx(StyledStoryBlockView, {
1957
+ background: background,
1958
+ children: /*#__PURE__*/jsxRuntime.jsx(StoryBlockColorContext.Provider, {
1959
+ value: getTypographyColorFromBlockColor(background),
1960
+ children: /*#__PURE__*/jsxRuntime.jsx(StoryBlockBackgroundContext.Provider, {
1961
+ value: background,
1962
+ children: children
1963
+ })
1964
+ })
1965
+ });
1966
+ }
1967
+
1968
+ const StoryTitleContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1969
+ displayName: "StoryTitle__StoryTitleContainer",
1970
+ componentId: "kitt-universal__sc-sic7hb-0"
1971
+ })(["margin-bottom:30px;"]);
1972
+ const StorySubTitleContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
1973
+ displayName: "StoryTitle__StorySubTitleContainer",
1974
+ componentId: "kitt-universal__sc-sic7hb-1"
1975
+ })(["margin-bottom:10px;"]);
1976
+ function StoryTitle({
1977
+ color,
1978
+ children,
1979
+ numberOfLines
1980
+ }) {
1981
+ return /*#__PURE__*/jsxRuntime.jsx(StoryTitleContainer, {
1982
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header1, {
1983
+ variant: "bold",
1984
+ base: "header1",
1985
+ color: useStoryBlockColor(color),
1986
+ numberOfLines: numberOfLines,
1987
+ children: children
1988
+ })
1989
+ });
1990
+ }
1991
+
1992
+ function StoryTitleLevel2({
1993
+ color,
1994
+ children,
1995
+ numberOfLines
1996
+ }) {
1997
+ return /*#__PURE__*/jsxRuntime.jsx(StoryTitleContainer, {
1998
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header2, {
1999
+ variant: "bold",
2000
+ base: "header2",
2001
+ color: useStoryBlockColor(color),
2002
+ numberOfLines: numberOfLines,
2003
+ children: children
2004
+ })
2005
+ });
2006
+ }
2007
+
2008
+ StoryTitleLevel2.displayName = 'StoryTitle.Level2';
2009
+
2010
+ function StoryTitleLevel3({
2011
+ color,
2012
+ children,
2013
+ numberOfLines
2014
+ }) {
2015
+ return /*#__PURE__*/jsxRuntime.jsx(StorySubTitleContainer, {
2016
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header3, {
2017
+ variant: "bold",
2018
+ base: "header3",
2019
+ medium: "header4",
2020
+ color: useStoryBlockColor(color),
2021
+ numberOfLines: numberOfLines,
2022
+ children: children
2023
+ })
2024
+ });
2025
+ }
2026
+
2027
+ StoryTitleLevel3.displayName = 'StoryTitle.Level3';
2028
+
2029
+ function StoryTitleLevel4({
2030
+ color,
2031
+ children,
2032
+ numberOfLines
2033
+ }) {
2034
+ return /*#__PURE__*/jsxRuntime.jsx(StorySubTitleContainer, {
2035
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Header4, {
2036
+ variant: "bold",
2037
+ base: "header4",
2038
+ medium: "header5",
2039
+ color: useStoryBlockColor(color),
2040
+ numberOfLines: numberOfLines,
2041
+ children: children
2042
+ })
2043
+ });
2044
+ }
2045
+
2046
+ StoryTitleLevel4.displayName = 'StoryTitle.Level3';
2047
+ StoryTitle.Level2 = StoryTitleLevel2;
2048
+ StoryTitle.Level3 = StoryTitleLevel3;
2049
+ StoryTitle.Level4 = StoryTitleLevel4;
2050
+
2051
+ const StoryContainer$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.ScrollView).withConfig({
2052
+ displayName: "Story__StoryContainer",
2053
+ componentId: "kitt-universal__sc-1kwdg2p-0"
2054
+ })(["padding:", "px;"], storyPadding);
2055
+ function Story({
2056
+ title,
2057
+ contentContainerStyle,
2058
+ children
2059
+ }) {
2060
+ return /*#__PURE__*/jsxRuntime.jsxs(StoryContainer$1, {
2061
+ contentContainerStyle: contentContainerStyle,
2062
+ children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle, {
2063
+ children: title
2064
+ }), children]
2065
+ });
2066
+ }
2067
+
2068
+ const StyledSection = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2069
+ displayName: "StorySection__StyledSection",
2070
+ componentId: "kitt-universal__sc-1b3liv5-0"
2071
+ })(["margin-bottom:32px;"]);
2072
+ function StorySection({
2073
+ title,
2074
+ children,
2075
+ internalIsDemoSection,
2076
+ ...props
2077
+ }) {
2078
+ if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
2079
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledSection, { ...props,
2080
+ children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level2, {
2081
+ children: title
2082
+ }), children]
2083
+ });
2084
+ }
2085
+ const StyledSubSection = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2086
+ displayName: "StorySection__StyledSubSection",
2087
+ componentId: "kitt-universal__sc-1b3liv5-1"
2088
+ })(["margin-bottom:16px;"]);
2089
+
2090
+ function SubSection({
2091
+ title,
2092
+ children,
2093
+ ...props
2094
+ }) {
2095
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledSubSection, { ...props,
2096
+ children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level3, {
2097
+ children: title
2098
+ }), children]
2099
+ });
2100
+ }
2101
+
2102
+ const StyledBlockSection = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2103
+ displayName: "StorySection__StyledBlockSection",
2104
+ componentId: "kitt-universal__sc-1b3liv5-2"
2105
+ })(["margin-bottom:16px;"]);
2106
+
2107
+ function BlockSection({
2108
+ title,
2109
+ children,
2110
+ ...props
2111
+ }) {
2112
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledBlockSection, { ...props,
2113
+ children: [/*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
2114
+ children: title
2115
+ }), children]
2116
+ });
2117
+ }
2118
+
2119
+ const StyledDemoSection = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2120
+ displayName: "StorySection__StyledDemoSection",
2121
+ componentId: "kitt-universal__sc-1b3liv5-3"
2122
+ })(["margin-bottom:64px;"]);
2123
+
2124
+ function DemoSection({
2125
+ children
2126
+ }) {
2127
+ return /*#__PURE__*/jsxRuntime.jsx(StyledDemoSection, {
2128
+ children: /*#__PURE__*/jsxRuntime.jsx(StorySection, {
2129
+ internalIsDemoSection: true,
2130
+ title: "Demo",
2131
+ children: children
2132
+ })
2133
+ });
2134
+ }
2135
+
2136
+ StorySection.SubSection = SubSection;
2137
+ StorySection.BlockSection = BlockSection;
2138
+ /** @deprecated use StorySection.Demo instead */
2139
+
2140
+ StorySection.DemoSection = DemoSection;
2141
+ StorySection.Demo = DemoSection;
2142
+ /** @deprecated use StorySection instead */
2143
+
2144
+ const DeprecatedSection = StorySection;
2145
+
2146
+ function StoryContainer({
2147
+ children,
2148
+ state,
2149
+ title,
2150
+ platform
2151
+ }) {
2152
+ if (platform === 'native') return null;
2153
+ return /*#__PURE__*/jsxRuntime.jsx(StorySection.BlockSection, {
2154
+ testID: state,
2155
+ title: title,
2156
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
2157
+ className: state ? `kitt-${state}` : undefined,
2158
+ children: children
2159
+ })
2160
+ });
2161
+ }
2162
+
2163
+ function StoryDecorator(storyFn, context) {
2164
+ return /*#__PURE__*/jsxRuntime.jsx(Story, {
2165
+ title: context.name,
2166
+ children: storyFn()
2167
+ });
2168
+ }
2169
+
2170
+ const SmallScreenRow = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2171
+ displayName: "StoryGrid__SmallScreenRow",
2172
+ componentId: "kitt-universal__sc-4z5new-0"
2173
+ })(["flex-direction:column;margin:0;"]);
2174
+ const SmallScreenCol = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2175
+ displayName: "StoryGrid__SmallScreenCol",
2176
+ componentId: "kitt-universal__sc-4z5new-1"
2177
+ })(["padding:8px 0 16px;"]);
2178
+ const FlexRow = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2179
+ displayName: "StoryGrid__FlexRow",
2180
+ componentId: "kitt-universal__sc-4z5new-2"
2181
+ })(["flex-direction:row;margin:0 -4px 16px;"]);
2182
+ const FlexCol = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2183
+ displayName: "StoryGrid__FlexCol",
2184
+ componentId: "kitt-universal__sc-4z5new-3"
2185
+ })(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
2186
+
2187
+ function StoryGridRow({
2188
+ children,
2189
+ breakpoint = 'small'
2190
+ }) {
2191
+ // eslint-disable-next-line unicorn/expiring-todo-comments
2192
+ // TODO use useBreakpoint instead
2193
+ const {
2194
+ width
2195
+ } = BabelPluginStyledComponentsReactNative.useWindowDimensions();
2196
+ const breakpointValue = breakpoint === 'small' ? 480 : 768;
2197
+
2198
+ if (width < breakpointValue) {
2199
+ return /*#__PURE__*/jsxRuntime.jsx(SmallScreenRow, {
2200
+ children: react$1.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(SmallScreenCol, {
2201
+ children: child
2202
+ }))
2203
+ });
2204
+ }
2205
+
2206
+ return /*#__PURE__*/jsxRuntime.jsx(FlexRow, {
2207
+ children: react$1.Children.map(children, child => /*#__PURE__*/jsxRuntime.jsx(FlexCol, {
2208
+ children: child
2209
+ }))
2210
+ });
2211
+ }
2212
+
2213
+ function StoryGridCol({
2214
+ title,
2215
+ titleColor,
2216
+ children,
2217
+ platform = 'all'
2218
+ }) {
2219
+ if (platform === 'native') {
2220
+ return null;
2221
+ }
2222
+
2223
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2224
+ children: [title ? /*#__PURE__*/jsxRuntime.jsx(StoryTitle.Level4, {
2225
+ numberOfLines: 1,
2226
+ color: titleColor,
2227
+ children: title
2228
+ }) : null, children]
2229
+ });
2230
+ }
2231
+
2232
+ const StoryGrid = {
2233
+ Row: StoryGridRow,
2234
+ Col: StoryGridCol
2235
+ };
2236
+
2237
+ const Container = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2238
+ displayName: "Tag__Container",
2239
+ componentId: "kitt-universal__sc-19jmowi-0"
2240
+ })(["background-color:", ";border-width:", ";border-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], ({
2241
+ theme,
2242
+ type,
2243
+ variant
2244
+ }) => theme.kitt.tag[type][variant].backgroundColor, ({
2245
+ theme,
2246
+ type,
2247
+ variant
2248
+ }) => theme.kitt.tag[type][variant].borderWidth, ({
2249
+ theme,
2250
+ type,
2251
+ variant
2252
+ }) => theme.kitt.tag[type][variant].borderColor, ({
2253
+ theme
2254
+ }) => theme.kitt.tag.padding, ({
2255
+ theme
2256
+ }) => theme.kitt.tag.borderRadius);
2257
+ const getLabelColor = (type, variant) => {
2258
+ switch (type) {
2259
+ case 'danger':
2260
+ {
2261
+ return variant === 'outline' ? 'danger' : 'black';
2262
+ }
2263
+
2264
+ case 'primary':
2265
+ {
2266
+ return 'primary';
2267
+ }
2268
+
2269
+ case 'default':
2270
+ {
2271
+ return 'black';
2272
+ }
2273
+
2274
+ default:
2275
+ {
2276
+ return 'black';
2277
+ }
2278
+ }
2279
+ };
2280
+ function Tag({
2281
+ label,
2282
+ type = 'default',
2283
+ variant = 'fill'
2284
+ }) {
2285
+ return /*#__PURE__*/jsxRuntime.jsx(Container, {
2286
+ type: type,
2287
+ variant: variant,
2288
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2289
+ base: "body-xsmall",
2290
+ color: getLabelColor(type, variant),
2291
+ children: label
2292
+ })
2293
+ });
2294
+ }
2295
+
2296
+ const lateOceanColorPalette = {
2297
+ lateOcean: '#4C34E0',
2298
+ lateOceanLight1: '#705DE6',
2299
+ lateOceanLight2: '#9485EC',
2300
+ lateOceanLight3: '#D6BAF9',
2301
+ warmEmbrace: '#F4D3CE',
2302
+ warmEmbraceLight1: '#FFEDE6',
2303
+ black1000: '#000000',
2304
+ black555: '#737373',
2305
+ black200: '#CCCCCC',
2306
+ black100: '#E5E5E5',
2307
+ black50: '#F2F2F2',
2308
+ black25: '#F9F9F9',
2309
+ white: '#FFFFFF',
2310
+ viride: '#38836D',
2311
+ englishVermillon: '#D44148',
2312
+ goldCrayola: '#F8C583',
2313
+ aero: '#89BDDD',
2314
+ transparent: 'transparent',
2315
+ moonPurple: '#DBD6F9',
2316
+ moonPurpleLight1: '#EDEBFC'
2317
+ };
2318
+
2319
+ const avatarLateOceanTheme = {
2320
+ default: {
2321
+ color: lateOceanColorPalette.white,
2322
+ backgroundColor: lateOceanColorPalette.lateOcean
2323
+ },
2324
+ light: {
2325
+ color: lateOceanColorPalette.black1000,
2326
+ backgroundColor: lateOceanColorPalette.black100
2327
+ }
2328
+ };
2329
+
2330
+ const colorsLateOceanTheme = {
2331
+ primary: lateOceanColorPalette.lateOcean,
2332
+ primaryLight: lateOceanColorPalette.lateOceanLight1,
2333
+ accent: lateOceanColorPalette.warmEmbrace,
2334
+ accentLight: lateOceanColorPalette.warmEmbraceLight1,
2335
+ success: lateOceanColorPalette.viride,
2336
+ correct: lateOceanColorPalette.viride,
2337
+ danger: lateOceanColorPalette.englishVermillon,
2338
+ separator: lateOceanColorPalette.black100,
2339
+ hover: lateOceanColorPalette.black100,
2340
+ black: lateOceanColorPalette.black1000,
2341
+ uiBackground: lateOceanColorPalette.black25,
2342
+ uiBackgroundLight: lateOceanColorPalette.white,
2343
+ transparent: lateOceanColorPalette.transparent,
2344
+ disabled: lateOceanColorPalette.black50,
2345
+ overlay: {
2346
+ dark: 'rgba(41, 48, 51, 0.25)',
2347
+ light: 'rgba(255, 255, 255, 0.90)',
2348
+ fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
2349
+ }
2350
+ };
2351
+
2352
+ const buttonLateOceanTheme = {
2353
+ borderRadius: '30px',
2354
+ borderWidth: {
2355
+ disabled: '2px',
2356
+ focus: '3px'
2357
+ },
2358
+ minHeight: '40px',
2359
+ minWidth: '40px',
2360
+ maxWidth: '335px',
2361
+ scale: {
2362
+ base: {
2363
+ default: 1,
2364
+ hover: 0.95,
2365
+ active: 0.95
2366
+ },
2367
+ medium: {
2368
+ hover: 1.05
2369
+ }
2370
+ },
2371
+ contentPadding: {
2372
+ default: '8px 16px 7px',
2373
+ large: '12px 24px 11px',
2374
+ disabled: '6px 14px 5px'
2375
+ },
2376
+ transition: {
2377
+ duration: '200ms',
2378
+ timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
2379
+ },
2380
+ default: {
2381
+ backgroundColor: 'rgba(0, 0, 0, 0.05)',
2382
+ pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2383
+ hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2384
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)'
2385
+ },
2386
+ primary: {
2387
+ backgroundColor: colorsLateOceanTheme.primary,
2388
+ pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
2389
+ hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
2390
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)'
2391
+ },
2392
+ white: {
2393
+ backgroundColor: 'rgba(255, 255, 255, 0.05)',
2394
+ pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2395
+ hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2396
+ focusBorderColor: 'rgba(255, 255, 255, 0.1)'
2397
+ },
2398
+ subtle: {
2399
+ backgroundColor: colorsLateOceanTheme.transparent,
2400
+ pressedBackgroundColor: colorsLateOceanTheme.transparent,
2401
+ hoverBackgroundColor: colorsLateOceanTheme.transparent,
2402
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)',
2403
+ color: colorsLateOceanTheme.primary,
2404
+ hoverColor: 'rgba(76, 52, 224, 0.8)',
2405
+ activeColor: 'rgba(76, 52, 224, 0.8)'
2406
+ },
2407
+ 'subtle-dark': {
2408
+ backgroundColor: colorsLateOceanTheme.transparent,
2409
+ pressedBackgroundColor: colorsLateOceanTheme.transparent,
2410
+ hoverBackgroundColor: colorsLateOceanTheme.transparent,
2411
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)',
2412
+ color: colorsLateOceanTheme.black,
2413
+ hoverColor: 'rgba(0, 0, 0, 0.8)',
2414
+ activeColor: 'rgba(0, 0, 0, 0.8)'
2415
+ },
2416
+ disabled: {
2417
+ backgroundColor: colorsLateOceanTheme.disabled,
2418
+ pressedBackgroundColor: colorsLateOceanTheme.disabled,
2419
+ hoverBackgroundColor: colorsLateOceanTheme.disabled,
2420
+ focusBorderColor: lateOceanColorPalette.black100,
2421
+ borderColor: lateOceanColorPalette.black100
2422
+ }
2423
+ };
2424
+
2425
+ const cardLateOceanTheme = {
2426
+ borderRadius: '20px',
2427
+ borderWidth: '2px',
2428
+ padding: '16px',
2429
+ primary: {
2430
+ backgroundColor: lateOceanColorPalette.white,
2431
+ borderColor: lateOceanColorPalette.lateOcean
2432
+ },
2433
+ secondary: {
2434
+ backgroundColor: lateOceanColorPalette.white,
2435
+ borderColor: lateOceanColorPalette.black100
2436
+ },
2437
+ subtle: {
2438
+ backgroundColor: lateOceanColorPalette.black50,
2439
+ borderColor: lateOceanColorPalette.black100
2440
+ }
2441
+ };
2442
+
2443
+ const feedbackMessageLateOceanTheme = {
2444
+ backgroundColors: {
2445
+ success: lateOceanColorPalette.viride,
2446
+ danger: lateOceanColorPalette.englishVermillon,
2447
+ warning: lateOceanColorPalette.goldCrayola,
2448
+ info: lateOceanColorPalette.aero
2449
+ }
2450
+ };
2451
+
2452
+ const inputFieldLateOceanTheme = {
2453
+ labelContainerPaddingBottom: 5,
2454
+ iconMarginLeft: 6
2455
+ };
2456
+
2457
+ const inputStatesStyle = {
2458
+ default: {
2459
+ backgroundColor: lateOceanColorPalette.white,
2460
+ borderColor: lateOceanColorPalette.black100,
2461
+ color: 'black',
2462
+ passwordButtonIconColor: 'black'
2463
+ },
2464
+ hover: {
2465
+ borderColor: lateOceanColorPalette.black200,
2466
+ color: 'black',
2467
+ passwordButtonIconColor: 'black'
2468
+ },
2469
+ focus: {
2470
+ borderColor: lateOceanColorPalette.lateOcean,
2471
+ color: 'black',
2472
+ passwordButtonIconColor: 'black'
2473
+ },
2474
+ disabled: {
2475
+ backgroundColor: lateOceanColorPalette.black50,
2476
+ borderColor: lateOceanColorPalette.black100,
2477
+ color: 'black-light',
2478
+ passwordButtonIconColor: 'black-light'
2479
+ },
2480
+ invalid: {
2481
+ borderColor: lateOceanColorPalette.englishVermillon,
2482
+ color: 'black',
2483
+ passwordButtonIconColor: 'black'
2484
+ }
2485
+ };
2486
+ const inputLateOceanTheme = {
2487
+ marginTop: '2px',
2488
+ marginBottom: '4px',
2489
+ borderWidth: '2px',
2490
+ borderRadius: '10px',
2491
+ passwordButtonIconSize: 20,
2492
+ padding: '7px 16px',
2493
+ paddingSingleLineIOS: '12px 16px',
2494
+ selectionColor: lateOceanColorPalette.lateOcean,
2495
+ placeholderColor: 'black-light',
2496
+ textAreaMinHeight: 120,
2497
+ states: inputStatesStyle
2498
+ };
2499
+
2500
+ const radioLateOceanTheme = {
2501
+ size: 18,
2502
+ unchecked: {
2503
+ backgroundColor: lateOceanColorPalette.white,
2504
+ borderWidth: '2px',
2505
+ borderColor: lateOceanColorPalette.black200
2506
+ },
2507
+ checked: {
2508
+ backgroundColor: lateOceanColorPalette.lateOcean,
2509
+ innerSize: 5,
2510
+ innerBackgroundColor: lateOceanColorPalette.white
2511
+ },
2512
+ disabled: {
2513
+ backgroundColor: lateOceanColorPalette.black50,
2514
+ borderColor: lateOceanColorPalette.black100
2515
+ }
2516
+ };
2517
+
2518
+ const formsLateOceanTheme = {
2519
+ input: inputLateOceanTheme,
2520
+ radio: radioLateOceanTheme,
2521
+ inputField: inputFieldLateOceanTheme
2522
+ };
2523
+
2524
+ const fullScreenModalLateOceanTheme = {
2525
+ header: {
2526
+ paddingVertical: 12,
2527
+ paddingHorizontal: 16,
2528
+ borderColor: lateOceanColorPalette.black100
2529
+ }
2530
+ };
2531
+
2532
+ const iconButton = {
2533
+ backgroundColor: 'transparent',
2534
+ width: 40,
2535
+ height: 40,
2536
+ borderRadius: 20,
2537
+ borderWidth: 2,
2538
+ borderColor: 'transparent',
2539
+ transition: {
2540
+ property: 'all',
2541
+ duration: '200ms',
2542
+ timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
2543
+ },
2544
+ scale: {
2545
+ base: {
2546
+ default: 1,
2547
+ hover: 0.95,
2548
+ active: 0.95
2549
+ },
2550
+ medium: {
2551
+ hover: 1.05
2552
+ }
2553
+ },
2554
+ disabled: {
2555
+ scale: 1,
2556
+ backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
2557
+ borderColor: buttonLateOceanTheme.disabled.borderColor
2558
+ },
2559
+ default: {
2560
+ pressedBackgroundColor: buttonLateOceanTheme.default.pressedBackgroundColor
2561
+ },
2562
+ white: {
2563
+ pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
2564
+ }
2565
+ };
2566
+
2567
+ const listItemLateOceanTheme = {
2568
+ padding: '12px 16px',
2569
+ borderColor: colorsLateOceanTheme.separator,
2570
+ borderWidth: '1px',
2571
+ innerMargin: '8px'
2572
+ };
2573
+
2574
+ const shadowsLateOceanTheme = {
2575
+ medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
2576
+ };
2577
+
2578
+ const tagLateOceanTheme = {
2579
+ borderRadius: '10px',
2580
+ padding: '2px 12px',
2581
+ primary: {
2582
+ fill: {
2583
+ backgroundColor: lateOceanColorPalette.moonPurpleLight1,
2584
+ borderWidth: '0',
2585
+ borderColor: lateOceanColorPalette.transparent
2586
+ },
2587
+ outline: {
2588
+ backgroundColor: lateOceanColorPalette.transparent,
2589
+ borderWidth: '1px',
2590
+ borderColor: lateOceanColorPalette.lateOcean
2591
+ }
2592
+ },
2593
+ default: {
2594
+ fill: {
2595
+ backgroundColor: lateOceanColorPalette.black50,
2596
+ borderWidth: '0',
2597
+ borderColor: lateOceanColorPalette.transparent
2598
+ },
2599
+ outline: {
2600
+ backgroundColor: lateOceanColorPalette.transparent,
2601
+ borderWidth: '1px',
2602
+ borderColor: lateOceanColorPalette.black1000
2603
+ }
2604
+ },
2605
+ danger: {
2606
+ fill: {
2607
+ backgroundColor: lateOceanColorPalette.warmEmbrace,
2608
+ borderWidth: '0',
2609
+ borderColor: lateOceanColorPalette.transparent
2610
+ },
2611
+ outline: {
2612
+ backgroundColor: lateOceanColorPalette.transparent,
2613
+ borderWidth: '1px',
2614
+ borderColor: colorsLateOceanTheme.danger
2615
+ }
2616
+ }
2617
+ };
2618
+
2619
+ const tooltip = {
2620
+ backgroundColor: colorsLateOceanTheme.black,
2621
+ borderRadius: 10,
2622
+ opacity: 0.95,
2623
+ horizontalPadding: 16,
2624
+ verticalPadding: 4,
2625
+ floatingPadding: 8
2626
+ };
2627
+
2628
+ const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
2629
+
2630
+ const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
2631
+ baseAndSmall: {
2632
+ fontSize: `${baseAndSmallFontSize}px`,
2633
+ lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`
2634
+ },
2635
+ mediumAndWide: {
2636
+ fontSize: `${mediumAndWideFontSize}px`,
2637
+ lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`
2638
+ }
2639
+ });
2640
+
2641
+ const typographyLateOceanTheme = {
2642
+ colors: {
2643
+ black: lateOceanColorPalette.black1000,
2644
+ 'black-light': lateOceanColorPalette.black555,
2645
+ white: lateOceanColorPalette.white,
2646
+ 'white-light': lateOceanColorPalette.white,
2647
+ primary: lateOceanColorPalette.lateOcean,
2648
+ 'primary-light': lateOceanColorPalette.lateOceanLight1,
2649
+ accent: lateOceanColorPalette.warmEmbrace,
2650
+ success: lateOceanColorPalette.viride,
2651
+ danger: lateOceanColorPalette.englishVermillon
2652
+ },
2653
+ types: {
2654
+ headers: {
2655
+ fontFamily: {
2656
+ regular: 'Moderat',
2657
+ bold: 'Moderat'
2658
+ },
2659
+ fontWeight: 400,
2660
+ fontStyle: 'normal',
2661
+ configs: {
2662
+ // also known as xxlarge
2663
+ header1: createTypographyTypeConfig(1.3, 38, 62),
2664
+ // also known as xlarge
2665
+ header2: createTypographyTypeConfig(1.3, 32, 48),
2666
+ // also known as medium
2667
+ header3: createTypographyTypeConfig(1.3, 24, 36),
2668
+ // also known as xsmall
2669
+ header4: createTypographyTypeConfig(1.3, 18, 24),
2670
+ // also known as xxsmall
2671
+ header5: createTypographyTypeConfig(1.3, 18, 18)
2672
+ }
2673
+ },
2674
+ bodies: {
2675
+ fontFamily: {
2676
+ regular: 'Noto Sans',
2677
+ bold: 'Noto Sans'
2678
+ },
2679
+ fontWeight: {
2680
+ regular: 400,
2681
+ bold: 700
2682
+ },
2683
+ fontStyle: {
2684
+ regular: 'normal',
2685
+ bold: 'normal'
2686
+ },
2687
+ configs: {
2688
+ 'body-large': createTypographyTypeConfig(1.6, 18, 24),
2689
+ 'body-medium': createTypographyTypeConfig(1.6, 18, 18),
2690
+ body: createTypographyTypeConfig(1.6, 16, 16),
2691
+ 'body-small': createTypographyTypeConfig(1.6, 14, 14),
2692
+ 'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
2693
+ }
2694
+ }
2695
+ },
2696
+ link: {
2697
+ disabledColor: lateOceanColorPalette.black200
2698
+ }
2699
+ };
2700
+
2701
+ const breakpoints = {
2702
+ values: {
2703
+ base: 0,
2704
+ small: 480,
2705
+ medium: 768,
2706
+ large: 1024,
2707
+ wide: 1280
2708
+ },
2709
+ min: {
2710
+ smallBreakpoint: 'min-width: 480px',
2711
+ mediumBreakpoint: 'min-width: 768px',
2712
+ largeBreakpoint: 'min-width: 1024px',
2713
+ wideBreakpoint: 'min-width: 1280px'
2714
+ },
2715
+ max: {
2716
+ smallBreakpoint: 'max-width: 479px',
2717
+ mediumBreakpoint: 'max-width: 767px',
2718
+ largeBreakpoint: 'max-width: 1023px',
2719
+ wideBreakpoint: 'max-width: 1279px'
2720
+ }
2721
+ }; // eslint-disable-next-line unicorn/expiring-todo-comments
2722
+ // TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
2723
+
2724
+ const theme = {
2725
+ spacing: 4,
2726
+ colors: colorsLateOceanTheme,
2727
+ palettes: {
2728
+ lateOcean: lateOceanColorPalette
2729
+ },
2730
+ avatar: avatarLateOceanTheme,
2731
+ button: buttonLateOceanTheme,
2732
+ card: cardLateOceanTheme,
2733
+ feedbackMessage: feedbackMessageLateOceanTheme,
2734
+ forms: formsLateOceanTheme,
2735
+ typography: typographyLateOceanTheme,
2736
+ tag: tagLateOceanTheme,
2737
+ shadows: shadowsLateOceanTheme,
2738
+ fullScreenModal: fullScreenModalLateOceanTheme,
2739
+ iconButton,
2740
+ listItem: listItemLateOceanTheme,
2741
+ tooltip
2742
+ };
2743
+
2744
+ function TimePicker() {
2745
+ return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2746
+ base: "body",
2747
+ children: "TimePicker is not implemented for the web"
2748
+ });
2749
+ }
2750
+
2751
+ var Arrow = function (props) {
2752
+ return /*#__PURE__*/jsxRuntime.jsx("svg", { ...props,
2753
+ children: /*#__PURE__*/jsxRuntime.jsx("path", {
2754
+ fillRule: "evenodd",
2755
+ clipRule: "evenodd",
2756
+ d: "M22.399 6.128C20.939 7.722 19.767 9 18 9s-2.938-1.278-4.399-2.872C11.187 3.494 7.984 0 0 0h36c-7.984 0-11.187 3.494-13.601 6.128z",
2757
+ fill: "currentColor"
2758
+ })
2759
+ });
2760
+ };
2761
+
2762
+ Arrow.defaultProps = {
2763
+ width: "36",
2764
+ height: "8",
2765
+ viewBox: "0 0 36 9",
2766
+ fill: "none",
2767
+ xmlns: "http://www.w3.org/2000/svg"
2768
+ };
2769
+ const StyledTooltipView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2770
+ displayName: "TooltipView__StyledTooltipView",
2771
+ componentId: "kitt-universal__sc-156zm6m-0"
2772
+ })(["align-items:center;"]);
2773
+ const StyledTooltipContent = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2774
+ displayName: "TooltipView__StyledTooltipContent",
2775
+ componentId: "kitt-universal__sc-156zm6m-1"
2776
+ })(["background-color:", ";border-radius:", "px;opacity:", ";padding:", ";"], ({
2777
+ theme
2778
+ }) => theme.kitt.tooltip.backgroundColor, ({
2779
+ theme
2780
+ }) => theme.kitt.tooltip.borderRadius, ({
2781
+ theme
2782
+ }) => theme.kitt.tooltip.opacity, ({
2783
+ theme
2784
+ }) => `${theme.kitt.tooltip.verticalPadding}px ${theme.kitt.tooltip.horizontalPadding}px`);
2785
+
2786
+ function ArrowView(props) {
2787
+ const theme = /*#__PURE__*/styled.useTheme();
2788
+ return /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.View, { ...props,
2789
+ children: /*#__PURE__*/jsxRuntime.jsx(Arrow, {
2790
+ color: theme.kitt.tooltip.backgroundColor
2791
+ })
2792
+ });
2793
+ }
2794
+
2795
+ const StyledArrow = /*#__PURE__*/styled__default(ArrowView).withConfig({
2796
+ displayName: "TooltipView__StyledArrow",
2797
+ componentId: "kitt-universal__sc-156zm6m-2"
2798
+ })(["color:", ";transform:", ";"], ({
2799
+ theme
2800
+ }) => theme.kitt.tooltip.backgroundColor, ({
2801
+ $position
2802
+ }) => `rotate(${$position === 'bottom' ? 180 : 0}deg)`);
2803
+ function TooltipView({
2804
+ children,
2805
+ position
2806
+ }) {
2807
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledTooltipView, {
2808
+ children: [position === 'bottom' ? /*#__PURE__*/jsxRuntime.jsx(StyledArrow, {
2809
+ $position: position
2810
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(StyledTooltipContent, {
2811
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
2812
+ base: "body",
2813
+ color: "white",
2814
+ children: children
2815
+ })
2816
+ }), position === 'top' ? /*#__PURE__*/jsxRuntime.jsx(StyledArrow, {
2817
+ $position: position
2818
+ }) : null]
2819
+ });
2820
+ }
2821
+
2822
+ const tooltipDefaultPosition = 'top';
2823
+ const tooltipDefaultFloatingStrategy = {
2824
+ web: 'absolute'
2825
+ };
2826
+
2827
+ const StyledTooltipTrigger = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Pressable).withConfig({
2828
+ displayName: "Tooltipweb__StyledTooltipTrigger",
2829
+ componentId: "kitt-universal__sc-zn1y6f-0"
2830
+ })(["display:inline-flex;align-self:baseline;"]);
2831
+ const WebAnimatedTooltip = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2832
+ displayName: "Tooltipweb__WebAnimatedTooltip",
2833
+ componentId: "kitt-universal__sc-zn1y6f-1"
2834
+ })(["opacity:", ";transition:opacity 200ms;visibility:", ";"], ({
2835
+ theme,
2836
+ $visible
2837
+ }) => $visible ? theme.kitt.tooltip.opacity : 0, ({
2838
+ $visible
2839
+ }) => $visible ? 'visible' : 'hidden');
2840
+
2841
+ function getActualPosition(originalPosition, offsetMiddlewareData) {
2842
+ if (!offsetMiddlewareData) return originalPosition;
2843
+
2844
+ if (originalPosition === 'top') {
2845
+ return offsetMiddlewareData.y > 0 ? 'bottom' : originalPosition;
2846
+ }
2847
+
2848
+ if (originalPosition === 'bottom') {
2849
+ return offsetMiddlewareData.y < 0 ? 'top' : originalPosition;
2850
+ }
2851
+
2852
+ return originalPosition;
2853
+ }
2854
+
2855
+ function Tooltip({
2856
+ children,
2857
+ defaultVisible,
2858
+ position = tooltipDefaultPosition,
2859
+ content,
2860
+ floatingStrategy = tooltipDefaultFloatingStrategy,
2861
+ floatingPadding,
2862
+ onUpdate
2863
+ }) {
2864
+ const theme = /*#__PURE__*/styled.useTheme();
2865
+ const padding = floatingPadding || theme.kitt.tooltip.floatingPadding;
2866
+ const [visible, setVisible] = react$1.useState(Boolean(defaultVisible));
2867
+ const {
2868
+ x,
2869
+ y,
2870
+ reference,
2871
+ floating,
2872
+ strategy,
2873
+ update,
2874
+ refs,
2875
+ middlewareData
2876
+ } = reactDom.useFloating({
2877
+ placement: position,
2878
+ strategy: floatingStrategy?.web,
2879
+ middleware: [reactDom.offset(padding), reactDom.shift(), reactDom.flip()]
2880
+ }); // Update on scroll and resize for all relevant nodes
2881
+
2882
+ react$1.useEffect(() => {
2883
+ if (!refs.reference.current || !refs.floating.current) {
2884
+ return () => undefined;
2885
+ }
2886
+
2887
+ const parents = [...reactDom.getScrollParents(refs.reference.current), ...reactDom.getScrollParents(refs.floating.current)];
2888
+ parents.forEach(parent => {
2889
+ parent.addEventListener('scroll', update);
2890
+ parent.addEventListener('resize', update);
2891
+ });
2892
+ return () => {
2893
+ parents.forEach(parent => {
2894
+ parent.removeEventListener('scroll', update);
2895
+ parent.removeEventListener('resize', update);
2896
+ });
2897
+ };
2898
+ }, [refs.reference, refs.floating, update]);
2899
+ react$1.useEffect(() => {
2900
+ if (!onUpdate) return;
2901
+ onUpdate({
2902
+ x,
2903
+ y,
2904
+ reference,
2905
+ floating,
2906
+ strategy,
2907
+ update,
2908
+ refs,
2909
+ middlewareData
2910
+ });
2911
+ }, [x, y, reference, floating, strategy, update, refs, middlewareData, onUpdate]);
2912
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2913
+ children: [/*#__PURE__*/jsxRuntime.jsx(StyledTooltipTrigger, {
2914
+ ref: reference,
2915
+ accessibilityRole: "button",
2916
+ onPress: () => setVisible(prev => !prev),
2917
+ onMouseEnter: () => {
2918
+ setVisible(true);
2919
+ },
2920
+ onFocus: () => {
2921
+ setVisible(true);
2922
+ },
2923
+ children: children
2924
+ }), /*#__PURE__*/jsxRuntime.jsx(WebAnimatedTooltip, {
2925
+ ref: floating,
2926
+ $visible: visible,
2927
+ accessibilityHidden: !visible,
2928
+ style: {
2929
+ position: strategy,
2930
+ top: 0,
2931
+ left: 0,
2932
+ transform: [{
2933
+ // @ts-expect-error translate3d is missing in react-native definitions, only supported in web
2934
+ translate3d: `${Math.round(x ?? 0)}px, ${Math.round(y ?? 0)}px, 0`
2935
+ }]
2936
+ },
2937
+ children: /*#__PURE__*/jsxRuntime.jsx(TooltipView, {
2938
+ position: getActualPosition(position, middlewareData.offset),
2939
+ children: content
2940
+ })
2941
+ })]
2942
+ });
2943
+ }
2944
+ Tooltip.View = TooltipView;
2945
+
2946
+ const StyledTypographyEmoji = /*#__PURE__*/styled__default(Emoji).withConfig({
2947
+ displayName: "TypographyEmoji__StyledTypographyEmoji",
2948
+ componentId: "kitt-universal__sc-1if5guu-0"
2949
+ })(["align-self:center;", ""], ({
2950
+ size
2951
+ }) => {
2952
+ /* Style Twemoji: https://github.com/twitter/twemoji#inline-styles */
2953
+ return `
2954
+ margin: 0 ${size / 20}px 0 ${size / 10}px;
2955
+ transform: translateY(${size / 10 * 2}px);
2956
+ `;
2957
+ });
2958
+ function TypographyEmoji({
2959
+ emoji,
2960
+ base,
2961
+ small,
2962
+ medium,
2963
+ large
2964
+ }) {
2965
+ const theme = /*#__PURE__*/styled.useTheme();
2966
+ const typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
2967
+ const typeConfig = getTypographyTypeConfig(typeForCurrentWindowSize || 'body', theme);
2968
+ const typeConfigKey = getTypographyTypeConfigKey(theme);
2969
+ const {
2970
+ fontSize
2971
+ } = typeConfig[typeConfigKey];
2972
+
2973
+ if ((process.env.NODE_ENV !== "production")) {
2974
+ if (!fontSize.endsWith('px')) throw new Error(`Unexpected font-size value: ${fontSize}`);
2975
+ }
2976
+
2977
+ return /*#__PURE__*/jsxRuntime.jsx(StyledTypographyEmoji, {
2978
+ size: parseInt(fontSize.slice(0, -2), 10),
2979
+ emoji: emoji
2980
+ });
2981
+ }
2982
+
2983
+ const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/react.styled("span")({
2984
+ name: "TypographyLinkWebWrapper",
2985
+ class: "tcwz3nt"
2986
+ }));
2987
+ const StyledLink = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.Text).withConfig({
2988
+ displayName: "TypographyLink__StyledLink",
2989
+ componentId: "kitt-universal__sc-1o1zy30-0"
2990
+ })(["text-decoration:", ";", ";", ";"], ({
2991
+ $noUnderline
2992
+ }) => $noUnderline ? 'none' : 'underline', ({
2993
+ $disabled
2994
+ }) => {
2995
+ return `
2996
+ text-decoration-color: inherit;
2997
+ transition: color 0.2s ease-in-out;
2998
+ cursor: ${$disabled ? 'not-allowed' : 'pointer'};
2999
+ `;
3000
+ }, ({
3001
+ $disabled,
3002
+ theme
3003
+ }) => {
3004
+ if (!$disabled) return undefined;
3005
+ return `color: ${theme.kitt.typography.link.disabledColor};`;
3006
+ });
3007
+ function TypographyLink({
3008
+ children,
3009
+ disabled,
3010
+ noUnderline,
3011
+ href,
3012
+ hrefAttrs,
3013
+ onPress,
3014
+ ...otherProps
3015
+ }) {
3016
+ return /*#__PURE__*/jsxRuntime.jsx(Typography, { ...otherProps,
3017
+ accessibilityRole: "none",
3018
+ children: /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
3019
+ as: TypographyLinkWebWrapper,
3020
+ "data-nounderline": noUnderline ? true : undefined,
3021
+ children: /*#__PURE__*/jsxRuntime.jsx(StyledLink, {
3022
+ $disabled: disabled,
3023
+ $noUnderline: noUnderline,
3024
+ href: href,
3025
+ hrefAttrs: hrefAttrs,
3026
+ accessibilityRole: "link",
3027
+ dataSet: {
3028
+ // remove data-kitt-universal when we delete kitt web. See See :global(a) in Link styles.module.css
3029
+ 'kitt-universal': 'true'
3030
+ },
3031
+ onPress: disabled ? undefined : onPress,
3032
+ children: children
3033
+ })
3034
+ })
3035
+ });
3036
+ }
3037
+
3038
+ function matchWindowSize(currentWidth, {
3039
+ minWidth,
3040
+ maxWidth
3041
+ }) {
3042
+ return currentWidth >= minWidth && (!maxWidth || currentWidth <= maxWidth);
3043
+ }
3044
+ function useMatchWindowSize(options) {
3045
+ const {
3046
+ width
3047
+ } = BabelPluginStyledComponentsReactNative.useWindowDimensions();
3048
+ return matchWindowSize(width, options);
3049
+ }
3050
+
3051
+ function createWindowSizeHelper(currentWidth) {
3052
+ return {
3053
+ matchWindowSize: options => matchWindowSize(currentWidth, options),
3054
+ ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(currentWidth, options) ? valueIfTrue : valueIfFalse,
3055
+ mapWindowWidth: (...widthList) => {
3056
+ if ((process.env.NODE_ENV !== "production")) {
3057
+ widthList.slice(1).forEach(([minWidth], index) => {
3058
+ const previousMinWidth = widthList[index][0];
3059
+
3060
+ if (previousMinWidth > minWidth) {
3061
+ throw new Error(`mapWindowWidth: sort your values to be mobile first. ${minWidth} is < ${previousMinWidth}, so ${minWidth} should be before ${previousMinWidth}.`);
3062
+ }
3063
+ });
3064
+ }
3065
+
3066
+ const found = widthList.find(([minWidth, value]) => matchWindowSize(currentWidth, {
3067
+ minWidth: Number(minWidth)
3068
+ }));
3069
+ if (!found) return null;
3070
+ return found[1];
3071
+ }
3072
+ };
3073
+ }
3074
+
3075
+ function useKittTheme() {
3076
+ const {
3077
+ width
3078
+ } = BabelPluginStyledComponentsReactNative.useWindowDimensions();
3079
+ return react$1.useMemo(() => {
3080
+ return {
3081
+ kitt: theme,
3082
+ responsive: createWindowSizeHelper(width),
3083
+ breakpoints
3084
+ };
3085
+ }, [width]);
3086
+ }
3087
+
3088
+ function KittThemeProvider({
3089
+ children
3090
+ }) {
3091
+ const theme = useKittTheme();
3092
+ return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
3093
+ theme: theme,
3094
+ children: children
3095
+ });
3096
+ }
3097
+ const KittThemeDecorator = addons.makeDecorator({
3098
+ name: 'ThemeDecorator',
3099
+ parameterName: 'theme',
3100
+ wrapper: (storyFn, context, {
3101
+ options = {},
3102
+ parameters = {}
3103
+ }) => {
3104
+ return /*#__PURE__*/jsxRuntime.jsx(KittThemeProvider, {
3105
+ children: storyFn(context)
3106
+ });
3107
+ }
3108
+ });
3109
+
3110
+ function MatchWindowSize({
3111
+ children,
3112
+ ...matchWindowSizeOptions
3113
+ }) {
3114
+ const match = useMatchWindowSize(matchWindowSizeOptions);
3115
+ if (!match) return null;
3116
+ return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
3117
+ children: children
3118
+ });
3119
+ }
3120
+
3121
+ exports.useWindowSize = BabelPluginStyledComponentsReactNative.useWindowDimensions;
3122
+ exports.Avatar = Avatar;
3123
+ exports.Button = Button;
3124
+ exports.Card = Card;
3125
+ exports.Emoji = Emoji;
3126
+ exports.ExternalLink = ExternalLink;
3127
+ exports.Flex = Flex;
3128
+ exports.FullScreenModal = FullScreenModal;
3129
+ exports.Icon = Icon;
3130
+ exports.IconButton = IconButton;
3131
+ exports.InputFeedback = InputFeedback;
3132
+ exports.InputField = InputField;
3133
+ exports.InputText = InputText;
3134
+ exports.KittBreakpoints = KittBreakpoints;
3135
+ exports.KittBreakpointsMax = KittBreakpointsMax;
3136
+ exports.KittThemeDecorator = KittThemeDecorator;
3137
+ exports.KittThemeProvider = KittThemeProvider;
3138
+ exports.Label = Label;
3139
+ exports.LargeLoader = LargeLoader;
3140
+ exports.ListItem = ListItem;
3141
+ exports.Loader = Loader;
3142
+ exports.MatchWindowSize = MatchWindowSize;
3143
+ exports.Message = Message;
3144
+ exports.Modal = Modal;
3145
+ exports.Notification = Notification;
3146
+ exports.Radio = Radio;
3147
+ exports.Section = DeprecatedSection;
3148
+ exports.Story = Story;
3149
+ exports.StoryBlock = StoryBlock;
3150
+ exports.StoryContainer = StoryContainer;
3151
+ exports.StoryDecorator = StoryDecorator;
3152
+ exports.StoryGrid = StoryGrid;
3153
+ exports.StorySection = StorySection;
3154
+ exports.StoryTitle = StoryTitle;
3155
+ exports.Tag = Tag;
3156
+ exports.TextArea = TextArea;
3157
+ exports.TimePicker = TimePicker;
3158
+ exports.Tooltip = Tooltip;
3159
+ exports.Typography = Typography;
3160
+ exports.TypographyEmoji = TypographyEmoji;
3161
+ exports.TypographyIcon = TypographyIcon;
3162
+ exports.TypographyLink = TypographyLink;
3163
+ exports.createWindowSizeHelper = createWindowSizeHelper;
3164
+ exports.matchWindowSize = matchWindowSize;
3165
+ exports.styledTextInputMixin = styledTextInputMixin;
3166
+ exports.theme = theme;
3167
+ exports.useKittTheme = useKittTheme;
3168
+ exports.useMatchWindowSize = useMatchWindowSize;
3169
+ exports.useStoryBlockColor = useStoryBlockColor;
3170
+ Object.keys(kittIcons).forEach(function (k) {
3171
+ if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = kittIcons[k];
3172
+ });
3173
+ //# sourceMappingURL=index-node-14.17.cjs.web.js.map