@ornikar/kitt-universal 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +1 -1
- package/dist/definitions/ListItem/ListItem.d.ts.map +1 -1
- package/dist/definitions/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts +13 -0
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/definitions/forms/InputEmail/InputEmail.d.ts +7 -0
- package/dist/definitions/forms/InputEmail/InputEmail.d.ts.map +1 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts +7 -0
- package/dist/definitions/forms/InputPhone/InputPhone.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.d.ts +8 -0
- package/dist/definitions/forms/InputText/InputTextContainer.d.ts.map +1 -0
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +11 -0
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +6 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +31 -93
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/{avatarLateOceanTheme.d.ts → avatar.d.ts} +2 -2
- package/dist/definitions/themes/late-ocean/avatar.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/button.d.ts +6 -6
- package/dist/definitions/themes/late-ocean/card.d.ts +13 -0
- package/dist/definitions/themes/late-ocean/card.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/checkbox.d.ts +13 -0
- package/dist/definitions/themes/late-ocean/checkbox.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{colorsLateOceanTheme.d.ts → colors.d.ts} +2 -2
- package/dist/definitions/themes/late-ocean/colors.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{feedbackMessage.d.ts → feedback.d.ts} +1 -1
- package/dist/definitions/themes/late-ocean/feedback.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/forms.d.ts +13 -17
- package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/{fullScreenModalLateOceanTheme.d.ts → fullScreenModal.d.ts} +2 -2
- package/dist/definitions/themes/late-ocean/fullScreenModal.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/input.d.ts +9 -4
- package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/inputField.d.ts +5 -0
- package/dist/definitions/themes/late-ocean/inputField.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/listItem.d.ts +8 -0
- package/dist/definitions/themes/late-ocean/listItem.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{radioLateOceanTheme.d.ts → radio.d.ts} +6 -5
- package/dist/definitions/themes/late-ocean/radio.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/shadows.d.ts +4 -0
- package/dist/definitions/themes/late-ocean/shadows.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{skeletonTheme.d.ts → skeleton.d.ts} +2 -2
- package/dist/definitions/themes/late-ocean/skeleton.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/tag.d.ts +18 -0
- package/dist/definitions/themes/late-ocean/tag.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/{typographyLateOceanTheme.d.ts → typography.d.ts} +5 -4
- package/dist/definitions/themes/late-ocean/typography.d.ts.map +1 -0
- package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts +1 -0
- package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +2 -2
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyEmoji.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +1127 -1020
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +1127 -1020
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +1127 -1020
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +1159 -1024
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +983 -876
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -0
- package/dist/index-node-14.17.cjs.web.js +1125 -989
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +120 -100
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +120 -100
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +120 -100
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +120 -100
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +120 -100
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +120 -100
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -0
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/definitions/themes/late-ocean/avatarLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/cardLateOceanTheme.d.ts +0 -18
- package/dist/definitions/themes/late-ocean/cardLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/feedbackMessage.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/fullScreenModalLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/inputFieldLateOceanTheme.d.ts +0 -5
- package/dist/definitions/themes/late-ocean/inputFieldLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/listItemLateOceanTheme.d.ts +0 -7
- package/dist/definitions/themes/late-ocean/listItemLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/radioLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/shadowsLateOceanTheme.d.ts +0 -4
- package/dist/definitions/themes/late-ocean/shadowsLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts +0 -41
- package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts.map +0 -1
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import { UserIcon, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
|
|
3
|
+
import { UserIcon, CheckboxMark, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
|
|
4
4
|
export * from '@ornikar/kitt-icons';
|
|
5
|
-
import { Animated, Easing, useWindowDimensions, Image, Platform, Linking,
|
|
5
|
+
import { Animated, Easing, useWindowDimensions, Image, Platform, Linking, TextInput, Pressable, ActivityIndicator, View, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1 } from 'react-native';
|
|
6
6
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
7
7
|
import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
8
8
|
import { useRef, useEffect, cloneElement, useContext, createContext, forwardRef, useMemo, useState, Fragment, Children } from 'react';
|
|
@@ -138,9 +138,9 @@ var KittBreakpointsMax = {
|
|
|
138
138
|
|
|
139
139
|
var _excluded$e = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
|
|
140
140
|
|
|
141
|
-
function ownKeys$
|
|
141
|
+
function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
142
142
|
|
|
143
|
-
function _objectSpread$
|
|
143
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
144
144
|
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
145
145
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
146
146
|
function useTypographyColor() {
|
|
@@ -180,7 +180,7 @@ var StyledTypography = /*#__PURE__*/styled.Text.withConfig({
|
|
|
180
180
|
headers = _theme$kitt$typograph.headers,
|
|
181
181
|
bodies = _theme$kitt$typograph.bodies;
|
|
182
182
|
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
183
|
-
return "\n /* type */\n ".concat(!$typeForCurrentWindowSize ? '' : "\n font-family: ".concat($isHeader ? headers.fontFamily[$variant] : bodies.fontFamily[$variant], ";\n font-size: ").concat($isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize, ";\n line-height: ").concat($isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight, ";\n "), "\n\n /* variant */\n font-weight: ").concat($isHeader ? headers.fontWeight : bodies.fontWeight[$variant], ";\n font-style: ").concat($isHeader ? headers.fontStyle : bodies.fontStyle[$variant], ";\n ");
|
|
183
|
+
return "\n /* type */\n ".concat(!$typeForCurrentWindowSize ? '' : "\n font-family: ".concat($isHeader ? headers.fontFamily[$variant] : bodies.fontFamily[$variant], ";\n font-size: ").concat($isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].fontSize, "px;\n line-height: ").concat($isHeader ? headers.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight : bodies.configs[$typeForCurrentWindowSize][typeConfigKey].lineHeight, "px;\n "), "\n\n /* variant */\n font-weight: ").concat($isHeader ? headers.fontWeight : bodies.fontWeight[$variant], ";\n font-style: ").concat($isHeader ? headers.fontStyle : bodies.fontStyle[$variant], ";\n ");
|
|
184
184
|
}, function (_ref2) {
|
|
185
185
|
var theme = _ref2.theme,
|
|
186
186
|
$color = _ref2.$color;
|
|
@@ -233,14 +233,14 @@ function Typography(_ref4) {
|
|
|
233
233
|
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular';
|
|
234
234
|
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
235
235
|
value: isHeader,
|
|
236
|
-
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
236
|
+
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$l({
|
|
237
237
|
$color: colorOrDefaultToBlack,
|
|
238
238
|
$isHeader: isHeader,
|
|
239
239
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
240
240
|
$variant: nonNullableVariant,
|
|
241
241
|
accessibilityRole: accessibilityRole || undefined
|
|
242
242
|
}, otherProps))
|
|
243
|
-
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
243
|
+
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$l({
|
|
244
244
|
$color: colorOrDefaultToBlack,
|
|
245
245
|
$isHeader: isHeader,
|
|
246
246
|
$variant: nonNullableVariant,
|
|
@@ -253,13 +253,13 @@ function Typography(_ref4) {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
function TypographyText(props) {
|
|
256
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
256
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$l({
|
|
257
257
|
accessibilityRole: null
|
|
258
258
|
}, props));
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
function TypographyParagraph(props) {
|
|
262
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
262
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$l({
|
|
263
263
|
accessibilityRole: "paragraph"
|
|
264
264
|
}, props));
|
|
265
265
|
}
|
|
@@ -267,7 +267,7 @@ function TypographyParagraph(props) {
|
|
|
267
267
|
var createHeading = function (level, defaultBase) {
|
|
268
268
|
// https://github.com/necolas/react-native-web/issues/401
|
|
269
269
|
function TypographyHeading(props) {
|
|
270
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
270
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$l(_objectSpread$l({
|
|
271
271
|
accessibilityRole: "header",
|
|
272
272
|
base: defaultBase
|
|
273
273
|
}, props), {}, {
|
|
@@ -305,9 +305,9 @@ Typography.h5 = createHeading(5, 'header5');
|
|
|
305
305
|
|
|
306
306
|
var _excluded$d = ["size", "base", "round", "light"];
|
|
307
307
|
|
|
308
|
-
function ownKeys$
|
|
308
|
+
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
309
309
|
|
|
310
|
-
function _objectSpread$
|
|
310
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
311
311
|
|
|
312
312
|
var getInitials = function (firstname, lastname) {
|
|
313
313
|
return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
|
|
@@ -320,7 +320,7 @@ var StyledAvatarView = /*#__PURE__*/styled.View.withConfig({
|
|
|
320
320
|
$isRound = _ref.$isRound,
|
|
321
321
|
$size = _ref.$size;
|
|
322
322
|
if ($isRound) return "".concat($size / 2, "px");
|
|
323
|
-
return theme.kitt.avatar.borderRadius;
|
|
323
|
+
return "".concat(theme.kitt.avatar.borderRadius, "px");
|
|
324
324
|
}, function (_ref2) {
|
|
325
325
|
var theme = _ref2.theme,
|
|
326
326
|
$isLight = _ref2.$isLight;
|
|
@@ -384,7 +384,7 @@ function Avatar(_ref6) {
|
|
|
384
384
|
$size: size,
|
|
385
385
|
$isRound: round,
|
|
386
386
|
$isLight: light,
|
|
387
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$
|
|
387
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$k({
|
|
388
388
|
size: size,
|
|
389
389
|
base: base,
|
|
390
390
|
isLight: light
|
|
@@ -401,7 +401,7 @@ var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
|
401
401
|
});
|
|
402
402
|
var StyledAnimatedView = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
403
403
|
displayName: "AnimatedButtonPressable__StyledAnimatedView"
|
|
404
|
-
})(["border-radius:", ";"], function (_ref2) {
|
|
404
|
+
})(["border-radius:", "px;"], function (_ref2) {
|
|
405
405
|
var theme = _ref2.theme;
|
|
406
406
|
return theme.kitt.button.borderRadius;
|
|
407
407
|
});
|
|
@@ -490,13 +490,13 @@ var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
490
490
|
|
|
491
491
|
var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
492
492
|
displayName: "BaseStyledButtonPressable"
|
|
493
|
-
})(["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:", ";"], function (_ref) {
|
|
493
|
+
})(["position:relative;min-width:", "px;max-width:", ";width:", ";min-height:", "px;border-radius:", "px;flex-direction:row;align-items:center;justify-content:center;align-self:flex-start;background-color:", ";padding:", ";"], function (_ref) {
|
|
494
494
|
var theme = _ref.theme;
|
|
495
495
|
return theme.kitt.button.minWidth;
|
|
496
496
|
}, function (_ref2) {
|
|
497
497
|
var theme = _ref2.theme,
|
|
498
498
|
$isStretch = _ref2.$isStretch;
|
|
499
|
-
return $isStretch ? '100%' : theme.kitt.button.maxWidth;
|
|
499
|
+
return $isStretch ? '100%' : "".concat(theme.kitt.button.maxWidth, "px");
|
|
500
500
|
}, function (_ref3) {
|
|
501
501
|
var $isStretch = _ref3.$isStretch;
|
|
502
502
|
return $isStretch ? '100%' : 'auto';
|
|
@@ -529,23 +529,23 @@ var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
|
529
529
|
var _excluded$c = ["color"],
|
|
530
530
|
_excluded2$2 = ["color"];
|
|
531
531
|
|
|
532
|
-
function ownKeys$
|
|
532
|
+
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
533
533
|
|
|
534
|
-
function _objectSpread$
|
|
534
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
535
535
|
|
|
536
536
|
function TypographyIconSpecifiedColor(_ref) {
|
|
537
537
|
var color = _ref.color,
|
|
538
538
|
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
539
539
|
|
|
540
540
|
var theme = /*#__PURE__*/useTheme();
|
|
541
|
-
return /*#__PURE__*/jsx(Icon, _objectSpread$
|
|
541
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$j(_objectSpread$j({}, props), {}, {
|
|
542
542
|
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
543
543
|
}));
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
function TypographyIconInheritColor(props) {
|
|
547
547
|
var color = useTypographyColor();
|
|
548
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
548
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$j({
|
|
549
549
|
color: color
|
|
550
550
|
}, props));
|
|
551
551
|
}
|
|
@@ -555,12 +555,12 @@ function TypographyIcon(_ref2) {
|
|
|
555
555
|
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
556
556
|
|
|
557
557
|
if (color) {
|
|
558
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
558
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$j({
|
|
559
559
|
color: color
|
|
560
560
|
}, props));
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
563
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$j({}, props));
|
|
564
564
|
}
|
|
565
565
|
|
|
566
566
|
function isSubtle(type) {
|
|
@@ -569,9 +569,9 @@ function isSubtle(type) {
|
|
|
569
569
|
|
|
570
570
|
var _excluded$b = ["type", "isDisabled", "$isStretch", "icon", "children"];
|
|
571
571
|
|
|
572
|
-
function ownKeys$
|
|
572
|
+
function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
573
573
|
|
|
574
|
-
function _objectSpread$
|
|
574
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
575
575
|
|
|
576
576
|
var getTextColorByType = function (type) {
|
|
577
577
|
switch (type) {
|
|
@@ -677,7 +677,7 @@ function ButtonContentChildren(_ref4) {
|
|
|
677
677
|
color: isWebSubtle ? 'inherit' : color
|
|
678
678
|
};
|
|
679
679
|
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
680
|
-
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
680
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$i(_objectSpread$i({}, buttonIconSharedProps), {}, {
|
|
681
681
|
testID: "button-left-icon",
|
|
682
682
|
icon: icon
|
|
683
683
|
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
@@ -688,7 +688,7 @@ function ButtonContentChildren(_ref4) {
|
|
|
688
688
|
,
|
|
689
689
|
color: isWebSubtle ? undefined : color,
|
|
690
690
|
children: children
|
|
691
|
-
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
691
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$i(_objectSpread$i({}, buttonIconSharedProps), {}, {
|
|
692
692
|
icon: icon
|
|
693
693
|
})) : null]
|
|
694
694
|
});
|
|
@@ -721,7 +721,7 @@ function ButtonContent(_ref7) {
|
|
|
721
721
|
$isSubtle: isSubtle(type),
|
|
722
722
|
$isStretch: $isStretch,
|
|
723
723
|
$isIconOnly: Boolean(!children && icon),
|
|
724
|
-
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$
|
|
724
|
+
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$i(_objectSpread$i({
|
|
725
725
|
icon: icon,
|
|
726
726
|
type: type,
|
|
727
727
|
isDisabled: isDisabled,
|
|
@@ -734,12 +734,12 @@ function ButtonContent(_ref7) {
|
|
|
734
734
|
|
|
735
735
|
var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
|
|
736
736
|
displayName: "StyledDisabled"
|
|
737
|
-
})(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", ";"], function (_ref) {
|
|
737
|
+
})(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", "px;"], function (_ref) {
|
|
738
738
|
var theme = _ref.theme;
|
|
739
739
|
var _theme$kitt$button = theme.kitt.button,
|
|
740
740
|
borderWidth = _theme$kitt$button.borderWidth,
|
|
741
741
|
disabled = _theme$kitt$button.disabled;
|
|
742
|
-
return "".concat(borderWidth.disabled, " solid ").concat(disabled.borderColor);
|
|
742
|
+
return "".concat(borderWidth.disabled, "px solid ").concat(disabled.borderColor);
|
|
743
743
|
}, function (_ref2) {
|
|
744
744
|
var theme = _ref2.theme;
|
|
745
745
|
return theme.kitt.button.borderRadius;
|
|
@@ -792,13 +792,13 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
792
792
|
|
|
793
793
|
var Container$5 = /*#__PURE__*/styled.View.withConfig({
|
|
794
794
|
displayName: "Card__Container"
|
|
795
|
-
})(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], function (_ref) {
|
|
795
|
+
})(["background-color:", ";padding:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], function (_ref) {
|
|
796
796
|
var theme = _ref.theme,
|
|
797
797
|
type = _ref.type;
|
|
798
798
|
return theme.kitt.card[type].backgroundColor;
|
|
799
799
|
}, function (_ref2) {
|
|
800
800
|
var theme = _ref2.theme;
|
|
801
|
-
return theme.kitt.
|
|
801
|
+
return theme.kitt.spacing * 4;
|
|
802
802
|
}, function (_ref3) {
|
|
803
803
|
var theme = _ref3.theme;
|
|
804
804
|
return theme.kitt.card.borderRadius;
|
|
@@ -860,9 +860,9 @@ var defaultOpenLinkBehavior = {
|
|
|
860
860
|
|
|
861
861
|
var _excluded$a = ["as", "href", "openLinkBehavior", "onPress"];
|
|
862
862
|
|
|
863
|
-
function ownKeys$
|
|
863
|
+
function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
864
864
|
|
|
865
|
-
function _objectSpread$
|
|
865
|
+
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
866
866
|
function ExternalLink(_ref) {
|
|
867
867
|
var Component = _ref.as,
|
|
868
868
|
href = _ref.href,
|
|
@@ -871,7 +871,7 @@ function ExternalLink(_ref) {
|
|
|
871
871
|
onPress = _ref.onPress,
|
|
872
872
|
rest = _objectWithoutProperties(_ref, _excluded$a);
|
|
873
873
|
|
|
874
|
-
return /*#__PURE__*/jsx(Component, _objectSpread$
|
|
874
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$h(_objectSpread$h({}, rest), {}, {
|
|
875
875
|
onPress: function handleOnPress() {
|
|
876
876
|
if (onPress) onPress();
|
|
877
877
|
if (!href) return;
|
|
@@ -900,134 +900,676 @@ function ExternalLink(_ref) {
|
|
|
900
900
|
}));
|
|
901
901
|
}
|
|
902
902
|
|
|
903
|
-
var
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
903
|
+
var lateOceanColorPalette = {
|
|
904
|
+
lateOcean: '#4C34E0',
|
|
905
|
+
lateOceanLight1: '#705DE6',
|
|
906
|
+
lateOceanLight2: '#9485EC',
|
|
907
|
+
lateOceanLight3: '#D6BAF9',
|
|
908
|
+
warmEmbrace: '#F4D3CE',
|
|
909
|
+
warmEmbraceLight1: '#FFEDE6',
|
|
910
|
+
black1000: '#000000',
|
|
911
|
+
black800: '#2C293D',
|
|
912
|
+
black555: '#737373',
|
|
913
|
+
black200: '#CCCCCC',
|
|
914
|
+
black100: '#E5E5E5',
|
|
915
|
+
black50: '#F2F2F2',
|
|
916
|
+
black25: '#F9F9F9',
|
|
917
|
+
white: '#FFFFFF',
|
|
918
|
+
viride: '#38836D',
|
|
919
|
+
englishVermillon: '#D44148',
|
|
920
|
+
goldCrayola: '#F8C583',
|
|
921
|
+
aero: '#89BDDD',
|
|
922
|
+
transparent: 'transparent',
|
|
923
|
+
moonPurple: '#DBD6F9',
|
|
924
|
+
moonPurpleLight1: '#EDEBFC'
|
|
925
|
+
};
|
|
907
926
|
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
927
|
+
var colors = {
|
|
928
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
929
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
930
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
931
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
932
|
+
success: lateOceanColorPalette.viride,
|
|
933
|
+
correct: lateOceanColorPalette.viride,
|
|
934
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
935
|
+
info: lateOceanColorPalette.aero,
|
|
936
|
+
warning: lateOceanColorPalette.goldCrayola,
|
|
937
|
+
separator: lateOceanColorPalette.black100,
|
|
938
|
+
hover: lateOceanColorPalette.black100,
|
|
939
|
+
black: lateOceanColorPalette.black1000,
|
|
940
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
941
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
942
|
+
transparent: lateOceanColorPalette.transparent,
|
|
943
|
+
disabled: lateOceanColorPalette.black50,
|
|
944
|
+
overlay: {
|
|
945
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
946
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
947
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
911
948
|
}
|
|
912
949
|
};
|
|
913
950
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
testID: testID,
|
|
922
|
-
children: children
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
var FieldContainer = /*#__PURE__*/styled.View.withConfig({
|
|
927
|
-
displayName: "InputField__FieldContainer"
|
|
928
|
-
})(["padding:5px 0 10px;"]);
|
|
929
|
-
var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
|
|
930
|
-
displayName: "InputField__FeedbackContainer"
|
|
931
|
-
})(["", ";"], function (_ref) {
|
|
932
|
-
var theme = _ref.theme;
|
|
933
|
-
return theme.responsive.ifWindowSizeMatches({
|
|
934
|
-
minWidth: KittBreakpoints.SMALL
|
|
935
|
-
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
936
|
-
});
|
|
937
|
-
var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
938
|
-
displayName: "InputField__FieldLabelContainer"
|
|
939
|
-
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
940
|
-
var theme = _ref2.theme;
|
|
941
|
-
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
942
|
-
});
|
|
943
|
-
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
944
|
-
displayName: "InputField__LabelContainer"
|
|
945
|
-
})(["margin-right:", "px;"], function (_ref3) {
|
|
946
|
-
var theme = _ref3.theme;
|
|
947
|
-
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
948
|
-
});
|
|
949
|
-
function InputField(_ref4) {
|
|
950
|
-
var label = _ref4.label,
|
|
951
|
-
labelFeedback = _ref4.labelFeedback,
|
|
952
|
-
input = _ref4.input,
|
|
953
|
-
feedback = _ref4.feedback;
|
|
954
|
-
return /*#__PURE__*/jsxs(FieldContainer, {
|
|
955
|
-
children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
|
|
956
|
-
children: [/*#__PURE__*/jsx(LabelContainer, {
|
|
957
|
-
children: label
|
|
958
|
-
}), labelFeedback]
|
|
959
|
-
}) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
|
|
960
|
-
children: feedback
|
|
961
|
-
}) : null]
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
function getIconColor(state, disabled) {
|
|
966
|
-
if (disabled) return 'black-light';
|
|
967
|
-
|
|
968
|
-
switch (state) {
|
|
969
|
-
case 'invalid':
|
|
970
|
-
return 'danger';
|
|
971
|
-
|
|
972
|
-
case 'valid':
|
|
973
|
-
return 'success';
|
|
974
|
-
|
|
975
|
-
default:
|
|
976
|
-
return undefined;
|
|
951
|
+
var avatar = {
|
|
952
|
+
borderRadius: 10,
|
|
953
|
+
"default": {
|
|
954
|
+
backgroundColor: colors.primary
|
|
955
|
+
},
|
|
956
|
+
light: {
|
|
957
|
+
backgroundColor: lateOceanColorPalette.black100
|
|
977
958
|
}
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
function InputIcon(_ref) {
|
|
981
|
-
var icon = _ref.icon,
|
|
982
|
-
state = _ref.state,
|
|
983
|
-
disabled = _ref.disabled;
|
|
984
|
-
var theme = /*#__PURE__*/useTheme();
|
|
985
|
-
var color = getIconColor(state, disabled);
|
|
986
|
-
return /*#__PURE__*/jsx(TypographyIcon, {
|
|
987
|
-
color: color,
|
|
988
|
-
icon: icon,
|
|
989
|
-
size: theme.kitt.forms.input.icon.size
|
|
990
|
-
});
|
|
991
|
-
}
|
|
959
|
+
};
|
|
992
960
|
|
|
993
|
-
|
|
961
|
+
var button = {
|
|
962
|
+
borderRadius: 30,
|
|
963
|
+
borderWidth: {
|
|
964
|
+
disabled: 2,
|
|
965
|
+
focus: 3
|
|
966
|
+
},
|
|
967
|
+
minHeight: 40,
|
|
968
|
+
minWidth: 40,
|
|
969
|
+
maxWidth: 335,
|
|
970
|
+
scale: {
|
|
971
|
+
base: {
|
|
972
|
+
"default": 1,
|
|
973
|
+
hover: 0.95,
|
|
974
|
+
active: 0.95
|
|
975
|
+
},
|
|
976
|
+
medium: {
|
|
977
|
+
hover: 1.05
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
contentPadding: {
|
|
981
|
+
"default": '8px 16px 7px',
|
|
982
|
+
large: '12px 24px 11px',
|
|
983
|
+
disabled: '6px 14px 5px'
|
|
984
|
+
},
|
|
985
|
+
transition: {
|
|
986
|
+
duration: '200ms',
|
|
987
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
988
|
+
},
|
|
989
|
+
"default": {
|
|
990
|
+
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
991
|
+
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
992
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
993
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
994
|
+
},
|
|
995
|
+
primary: {
|
|
996
|
+
backgroundColor: colors.primary,
|
|
997
|
+
pressedBackgroundColor: colors.primaryLight,
|
|
998
|
+
hoverBackgroundColor: colors.primaryLight,
|
|
999
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
1000
|
+
},
|
|
1001
|
+
white: {
|
|
1002
|
+
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
1003
|
+
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1004
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1005
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
1006
|
+
},
|
|
1007
|
+
subtle: {
|
|
1008
|
+
backgroundColor: colors.transparent,
|
|
1009
|
+
pressedBackgroundColor: colors.transparent,
|
|
1010
|
+
hoverBackgroundColor: colors.transparent,
|
|
1011
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
1012
|
+
color: colors.primary,
|
|
1013
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
1014
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
1015
|
+
},
|
|
1016
|
+
'subtle-dark': {
|
|
1017
|
+
backgroundColor: colors.transparent,
|
|
1018
|
+
pressedBackgroundColor: colors.transparent,
|
|
1019
|
+
hoverBackgroundColor: colors.transparent,
|
|
1020
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
1021
|
+
color: colors.black,
|
|
1022
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
1023
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
1024
|
+
},
|
|
1025
|
+
disabled: {
|
|
1026
|
+
backgroundColor: colors.disabled,
|
|
1027
|
+
pressedBackgroundColor: colors.disabled,
|
|
1028
|
+
hoverBackgroundColor: colors.disabled,
|
|
1029
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
1030
|
+
borderColor: lateOceanColorPalette.black100
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
994
1033
|
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1034
|
+
var card = {
|
|
1035
|
+
borderRadius: 20,
|
|
1036
|
+
borderWidth: 2,
|
|
1037
|
+
primary: {
|
|
1038
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1039
|
+
borderColor: colors.primary
|
|
1040
|
+
},
|
|
1041
|
+
secondary: {
|
|
1042
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1043
|
+
borderColor: colors.separator
|
|
1044
|
+
},
|
|
1045
|
+
subtle: {
|
|
1046
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1047
|
+
borderColor: colors.separator
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
998
1050
|
|
|
999
|
-
|
|
1000
|
-
|
|
1051
|
+
var feedbackMessage = {
|
|
1052
|
+
danger: {
|
|
1053
|
+
backgroundColor: colors.danger
|
|
1054
|
+
},
|
|
1055
|
+
success: {
|
|
1056
|
+
backgroundColor: colors.success
|
|
1057
|
+
},
|
|
1058
|
+
info: {
|
|
1059
|
+
backgroundColor: colors.info
|
|
1060
|
+
},
|
|
1061
|
+
warning: {
|
|
1062
|
+
backgroundColor: colors.warning
|
|
1063
|
+
}
|
|
1064
|
+
};
|
|
1001
1065
|
|
|
1002
|
-
var
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
$state = _ref4.$state;
|
|
1015
|
-
return theme.kitt.forms.input.states[$state].borderColor;
|
|
1016
|
-
}, function (_ref5) {
|
|
1017
|
-
var theme = _ref5.theme;
|
|
1018
|
-
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
1019
|
-
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize;
|
|
1020
|
-
}, function (_ref6) {
|
|
1021
|
-
var theme = _ref6.theme,
|
|
1022
|
-
$state = _ref6.$state;
|
|
1023
|
-
return theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color];
|
|
1024
|
-
}, function (_ref7) {
|
|
1025
|
-
var theme = _ref7.theme;
|
|
1026
|
-
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
1027
|
-
});
|
|
1066
|
+
var checkbox = {
|
|
1067
|
+
borderWidth: 2,
|
|
1068
|
+
borderRadius: 5,
|
|
1069
|
+
height: 20,
|
|
1070
|
+
width: 20,
|
|
1071
|
+
iconSize: 14,
|
|
1072
|
+
borderColor: colors.separator,
|
|
1073
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1074
|
+
checkedBorderColor: colors.primary,
|
|
1075
|
+
checkedBackgroundColor: colors.primary,
|
|
1076
|
+
markColor: colors.uiBackgroundLight
|
|
1077
|
+
};
|
|
1028
1078
|
|
|
1029
|
-
function
|
|
1030
|
-
|
|
1079
|
+
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
1080
|
+
return Math.round(fontSize * lineHeightMultiplier);
|
|
1081
|
+
};
|
|
1082
|
+
var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
|
|
1083
|
+
return {
|
|
1084
|
+
baseAndSmall: {
|
|
1085
|
+
fontSize: baseAndSmallFontSize,
|
|
1086
|
+
lineHeight: calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)
|
|
1087
|
+
},
|
|
1088
|
+
mediumAndWide: {
|
|
1089
|
+
fontSize: mediumAndWideFontSize,
|
|
1090
|
+
lineHeight: calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
};
|
|
1094
|
+
var typography = {
|
|
1095
|
+
colors: {
|
|
1096
|
+
black: lateOceanColorPalette.black1000,
|
|
1097
|
+
'black-anthracite': lateOceanColorPalette.black800,
|
|
1098
|
+
'black-light': lateOceanColorPalette.black555,
|
|
1099
|
+
white: lateOceanColorPalette.white,
|
|
1100
|
+
'white-light': lateOceanColorPalette.white,
|
|
1101
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
1102
|
+
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
1103
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
1104
|
+
success: lateOceanColorPalette.viride,
|
|
1105
|
+
danger: lateOceanColorPalette.englishVermillon
|
|
1106
|
+
},
|
|
1107
|
+
types: {
|
|
1108
|
+
headers: {
|
|
1109
|
+
fontFamily: {
|
|
1110
|
+
regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
1111
|
+
bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
1112
|
+
},
|
|
1113
|
+
fontWeight: 400,
|
|
1114
|
+
fontStyle: 'normal',
|
|
1115
|
+
configs: {
|
|
1116
|
+
// also known as xxlarge
|
|
1117
|
+
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
1118
|
+
// also known as xlarge
|
|
1119
|
+
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
1120
|
+
// also known as medium
|
|
1121
|
+
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
1122
|
+
// also known as xsmall
|
|
1123
|
+
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
1124
|
+
// also known as xxsmall
|
|
1125
|
+
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
bodies: {
|
|
1129
|
+
fontFamily: {
|
|
1130
|
+
regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
1131
|
+
bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
1132
|
+
},
|
|
1133
|
+
fontWeight: {
|
|
1134
|
+
regular: 400,
|
|
1135
|
+
bold: 700
|
|
1136
|
+
},
|
|
1137
|
+
fontStyle: {
|
|
1138
|
+
regular: 'normal',
|
|
1139
|
+
bold: 'normal'
|
|
1140
|
+
},
|
|
1141
|
+
configs: {
|
|
1142
|
+
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
1143
|
+
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
1144
|
+
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
1145
|
+
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
1146
|
+
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
link: {
|
|
1151
|
+
disabledColor: lateOceanColorPalette.black200
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
var inputStatesStyle = {
|
|
1156
|
+
"default": {
|
|
1157
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1158
|
+
borderColor: colors.separator,
|
|
1159
|
+
color: 'black'
|
|
1160
|
+
},
|
|
1161
|
+
pending: {
|
|
1162
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1163
|
+
borderColor: colors.separator,
|
|
1164
|
+
color: 'black'
|
|
1165
|
+
},
|
|
1166
|
+
valid: {
|
|
1167
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1168
|
+
borderColor: lateOceanColorPalette.black100,
|
|
1169
|
+
color: 'black'
|
|
1170
|
+
},
|
|
1171
|
+
hover: {
|
|
1172
|
+
borderColor: lateOceanColorPalette.black200,
|
|
1173
|
+
color: 'black'
|
|
1174
|
+
},
|
|
1175
|
+
focus: {
|
|
1176
|
+
borderColor: colors.primary,
|
|
1177
|
+
color: 'black'
|
|
1178
|
+
},
|
|
1179
|
+
disabled: {
|
|
1180
|
+
backgroundColor: colors.disabled,
|
|
1181
|
+
borderColor: colors.separator,
|
|
1182
|
+
color: 'black-light'
|
|
1183
|
+
},
|
|
1184
|
+
invalid: {
|
|
1185
|
+
borderColor: colors.separator,
|
|
1186
|
+
color: 'black'
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
var input = {
|
|
1190
|
+
color: {
|
|
1191
|
+
selection: colors.primary,
|
|
1192
|
+
placeholder: typography.colors['black-light']
|
|
1193
|
+
},
|
|
1194
|
+
borderWidth: 2,
|
|
1195
|
+
borderRadius: 10,
|
|
1196
|
+
icon: {
|
|
1197
|
+
size: 20
|
|
1198
|
+
},
|
|
1199
|
+
padding: {
|
|
1200
|
+
"default": '5px 16px',
|
|
1201
|
+
iOSSingleLine: '7px 16px'
|
|
1202
|
+
},
|
|
1203
|
+
transition: {
|
|
1204
|
+
property: 'border-color',
|
|
1205
|
+
duration: '200ms',
|
|
1206
|
+
timingFunction: 'ease-in-out'
|
|
1207
|
+
},
|
|
1208
|
+
states: inputStatesStyle
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
var inputField = {
|
|
1212
|
+
labelContainerPaddingBottom: 5,
|
|
1213
|
+
iconMarginLeft: 6
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
var radio = {
|
|
1217
|
+
size: 18,
|
|
1218
|
+
unchecked: {
|
|
1219
|
+
backgroundColor: colors.uiBackgroundLight,
|
|
1220
|
+
borderWidth: 2,
|
|
1221
|
+
borderColor: lateOceanColorPalette.black200
|
|
1222
|
+
},
|
|
1223
|
+
checked: {
|
|
1224
|
+
backgroundColor: colors.primary,
|
|
1225
|
+
innerSize: 5,
|
|
1226
|
+
innerBackgroundColor: colors.uiBackgroundLight
|
|
1227
|
+
},
|
|
1228
|
+
disabled: {
|
|
1229
|
+
backgroundColor: colors.disabled,
|
|
1230
|
+
borderColor: colors.separator
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
|
|
1234
|
+
var textArea = {
|
|
1235
|
+
minHeight: 120
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
var forms = {
|
|
1239
|
+
input: input,
|
|
1240
|
+
radio: radio,
|
|
1241
|
+
inputField: inputField,
|
|
1242
|
+
textArea: textArea,
|
|
1243
|
+
checkbox: checkbox
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
var fullScreenModal = {
|
|
1247
|
+
header: {
|
|
1248
|
+
paddingVertical: 12,
|
|
1249
|
+
paddingHorizontal: 16,
|
|
1250
|
+
borderColor: lateOceanColorPalette.black100
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1254
|
+
var iconButton = {
|
|
1255
|
+
backgroundColor: 'transparent',
|
|
1256
|
+
width: 40,
|
|
1257
|
+
height: 40,
|
|
1258
|
+
borderRadius: 20,
|
|
1259
|
+
borderWidth: 2,
|
|
1260
|
+
borderColor: 'transparent',
|
|
1261
|
+
transition: {
|
|
1262
|
+
property: 'all',
|
|
1263
|
+
duration: '200ms',
|
|
1264
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
|
|
1265
|
+
},
|
|
1266
|
+
scale: {
|
|
1267
|
+
base: {
|
|
1268
|
+
"default": 1,
|
|
1269
|
+
hover: 0.95,
|
|
1270
|
+
active: 0.95
|
|
1271
|
+
},
|
|
1272
|
+
medium: {
|
|
1273
|
+
hover: 1.05
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
disabled: {
|
|
1277
|
+
scale: 1,
|
|
1278
|
+
backgroundColor: button.disabled.backgroundColor,
|
|
1279
|
+
borderColor: button.disabled.borderColor
|
|
1280
|
+
},
|
|
1281
|
+
"default": {
|
|
1282
|
+
pressedBackgroundColor: button["default"].pressedBackgroundColor
|
|
1283
|
+
},
|
|
1284
|
+
white: {
|
|
1285
|
+
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
var listItem = {
|
|
1290
|
+
padding: '12px 16px',
|
|
1291
|
+
borderColor: colors.separator,
|
|
1292
|
+
borderWidth: 1,
|
|
1293
|
+
innerMargin: 8
|
|
1294
|
+
};
|
|
1295
|
+
|
|
1296
|
+
var shadows = {
|
|
1297
|
+
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
var skeleton = {
|
|
1301
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
1302
|
+
flareColor: lateOceanColorPalette.black200,
|
|
1303
|
+
animationDuration: 1000
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1306
|
+
var tag = {
|
|
1307
|
+
borderRadius: 10,
|
|
1308
|
+
padding: '2px 12px',
|
|
1309
|
+
primary: {
|
|
1310
|
+
fill: {
|
|
1311
|
+
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
1312
|
+
borderWidth: 0,
|
|
1313
|
+
borderColor: colors.transparent
|
|
1314
|
+
},
|
|
1315
|
+
outline: {
|
|
1316
|
+
backgroundColor: colors.transparent,
|
|
1317
|
+
borderWidth: 1,
|
|
1318
|
+
borderColor: colors.primary
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
"default": {
|
|
1322
|
+
fill: {
|
|
1323
|
+
backgroundColor: lateOceanColorPalette.black50,
|
|
1324
|
+
borderWidth: 0,
|
|
1325
|
+
borderColor: colors.transparent
|
|
1326
|
+
},
|
|
1327
|
+
outline: {
|
|
1328
|
+
backgroundColor: colors.transparent,
|
|
1329
|
+
borderWidth: 1,
|
|
1330
|
+
borderColor: colors.black
|
|
1331
|
+
}
|
|
1332
|
+
},
|
|
1333
|
+
danger: {
|
|
1334
|
+
fill: {
|
|
1335
|
+
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
1336
|
+
borderWidth: 0,
|
|
1337
|
+
borderColor: colors.transparent
|
|
1338
|
+
},
|
|
1339
|
+
outline: {
|
|
1340
|
+
backgroundColor: colors.transparent,
|
|
1341
|
+
borderWidth: 1,
|
|
1342
|
+
borderColor: colors.danger
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
var tooltip = {
|
|
1348
|
+
backgroundColor: colors.black,
|
|
1349
|
+
borderRadius: 10,
|
|
1350
|
+
opacity: 0.95,
|
|
1351
|
+
horizontalPadding: 16,
|
|
1352
|
+
verticalPadding: 4,
|
|
1353
|
+
floatingPadding: 8
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
var breakpoints = {
|
|
1357
|
+
values: {
|
|
1358
|
+
base: 0,
|
|
1359
|
+
small: 480,
|
|
1360
|
+
medium: 768,
|
|
1361
|
+
large: 1024,
|
|
1362
|
+
wide: 1280
|
|
1363
|
+
},
|
|
1364
|
+
min: {
|
|
1365
|
+
smallBreakpoint: 'min-width: 480px',
|
|
1366
|
+
mediumBreakpoint: 'min-width: 768px',
|
|
1367
|
+
largeBreakpoint: 'min-width: 1024px',
|
|
1368
|
+
wideBreakpoint: 'min-width: 1280px'
|
|
1369
|
+
},
|
|
1370
|
+
max: {
|
|
1371
|
+
smallBreakpoint: 'max-width: 479px',
|
|
1372
|
+
mediumBreakpoint: 'max-width: 767px',
|
|
1373
|
+
largeBreakpoint: 'max-width: 1023px',
|
|
1374
|
+
wideBreakpoint: 'max-width: 1279px'
|
|
1375
|
+
}
|
|
1376
|
+
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
1377
|
+
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
1378
|
+
|
|
1379
|
+
var theme = {
|
|
1380
|
+
spacing: 4,
|
|
1381
|
+
colors: colors,
|
|
1382
|
+
palettes: {
|
|
1383
|
+
lateOcean: lateOceanColorPalette
|
|
1384
|
+
},
|
|
1385
|
+
avatar: avatar,
|
|
1386
|
+
button: button,
|
|
1387
|
+
card: card,
|
|
1388
|
+
feedbackMessage: feedbackMessage,
|
|
1389
|
+
forms: forms,
|
|
1390
|
+
typography: typography,
|
|
1391
|
+
tag: tag,
|
|
1392
|
+
shadows: shadows,
|
|
1393
|
+
fullScreenModal: fullScreenModal,
|
|
1394
|
+
iconButton: iconButton,
|
|
1395
|
+
listItem: listItem,
|
|
1396
|
+
tooltip: tooltip,
|
|
1397
|
+
skeleton: skeleton,
|
|
1398
|
+
breakpoints: breakpoints
|
|
1399
|
+
};
|
|
1400
|
+
|
|
1401
|
+
function matchWindowSize(_ref, _ref2) {
|
|
1402
|
+
var width = _ref.width,
|
|
1403
|
+
height = _ref.height;
|
|
1404
|
+
var minWidth = _ref2.minWidth,
|
|
1405
|
+
maxWidth = _ref2.maxWidth,
|
|
1406
|
+
minHeight = _ref2.minHeight,
|
|
1407
|
+
maxHeight = _ref2.maxHeight;
|
|
1408
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
1409
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
1410
|
+
return hasWidthMatched && hasHeightMatched;
|
|
1411
|
+
}
|
|
1412
|
+
function useMatchWindowSize(options) {
|
|
1413
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
1414
|
+
width = _useWindowDimensions.width,
|
|
1415
|
+
height = _useWindowDimensions.height;
|
|
1416
|
+
|
|
1417
|
+
return matchWindowSize({
|
|
1418
|
+
width: width,
|
|
1419
|
+
height: height
|
|
1420
|
+
}, options);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
function createWindowSizeHelper(dimensions) {
|
|
1424
|
+
return {
|
|
1425
|
+
matchWindowSize: function matchWindowSize$1(options) {
|
|
1426
|
+
return matchWindowSize(dimensions, options);
|
|
1427
|
+
},
|
|
1428
|
+
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
1429
|
+
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
1430
|
+
},
|
|
1431
|
+
mapWindowWidth: function mapWindowWidth() {
|
|
1432
|
+
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1433
|
+
widthList[_key] = arguments[_key];
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
1437
|
+
widthList.slice(1).forEach(function (_ref, index) {
|
|
1438
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
1439
|
+
minWidth = _ref2[0];
|
|
1440
|
+
|
|
1441
|
+
var previousMinWidth = widthList[index][0];
|
|
1442
|
+
|
|
1443
|
+
if (previousMinWidth > minWidth) {
|
|
1444
|
+
throw new Error("mapWindowWidth: sort your values to be mobile first. ".concat(minWidth, " is < ").concat(previousMinWidth, ", so ").concat(minWidth, " should be before ").concat(previousMinWidth, "."));
|
|
1445
|
+
}
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
var found = widthList.find(function (_ref3) {
|
|
1450
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
1451
|
+
minWidth = _ref4[0];
|
|
1452
|
+
_ref4[1];
|
|
1453
|
+
|
|
1454
|
+
return matchWindowSize(dimensions, {
|
|
1455
|
+
minWidth: Number(minWidth)
|
|
1456
|
+
});
|
|
1457
|
+
});
|
|
1458
|
+
if (!found) return null;
|
|
1459
|
+
return found[1];
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
function useKittTheme() {
|
|
1465
|
+
var dimensions = useWindowDimensions();
|
|
1466
|
+
return useMemo(function () {
|
|
1467
|
+
return {
|
|
1468
|
+
kitt: theme,
|
|
1469
|
+
responsive: createWindowSizeHelper(dimensions)
|
|
1470
|
+
};
|
|
1471
|
+
}, [dimensions]);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
var CheckboxAndLabelPressableWrapper = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1475
|
+
displayName: "Checkbox__CheckboxAndLabelPressableWrapper"
|
|
1476
|
+
})(["display:flex;flex-direction:row;align-items:center;"]);
|
|
1477
|
+
var CheckboxContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1478
|
+
displayName: "Checkbox__CheckboxContainer"
|
|
1479
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:center;height:", "px;width:", "px;position:relative;border-radius:", "px;", " margin-right:", ";"], function (_ref) {
|
|
1480
|
+
var theme = _ref.theme;
|
|
1481
|
+
return theme.kitt.forms.checkbox.height;
|
|
1482
|
+
}, function (_ref2) {
|
|
1483
|
+
var theme = _ref2.theme;
|
|
1484
|
+
return theme.kitt.forms.checkbox.width;
|
|
1485
|
+
}, function (_ref3) {
|
|
1486
|
+
var theme = _ref3.theme;
|
|
1487
|
+
return theme.kitt.forms.checkbox.borderRadius;
|
|
1488
|
+
}, function (_ref4) {
|
|
1489
|
+
var $isChecked = _ref4.$isChecked,
|
|
1490
|
+
theme = _ref4.theme;
|
|
1491
|
+
var _theme$kitt$forms$che = theme.kitt.forms.checkbox,
|
|
1492
|
+
checkedBackgroundColor = _theme$kitt$forms$che.checkedBackgroundColor,
|
|
1493
|
+
checkedBorderColor = _theme$kitt$forms$che.checkedBorderColor,
|
|
1494
|
+
borderColor = _theme$kitt$forms$che.borderColor,
|
|
1495
|
+
borderWidth = _theme$kitt$forms$che.borderWidth,
|
|
1496
|
+
backgroundColor = _theme$kitt$forms$che.backgroundColor;
|
|
1497
|
+
|
|
1498
|
+
if ($isChecked) {
|
|
1499
|
+
return css(["background-color:", ";border:", ";"], checkedBackgroundColor, "".concat(borderWidth, "px solid ").concat(checkedBorderColor));
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
return css(["background-color:", ";border:", ";"], backgroundColor, "".concat(borderWidth, "px solid ").concat(borderColor));
|
|
1503
|
+
}, function (_ref5) {
|
|
1504
|
+
var theme = _ref5.theme,
|
|
1505
|
+
$hasLabel = _ref5.$hasLabel;
|
|
1506
|
+
if (!$hasLabel) return '0px';
|
|
1507
|
+
return "".concat(theme.kitt.spacing * 2.5, "px;");
|
|
1508
|
+
});
|
|
1509
|
+
function Checkbox(_ref6) {
|
|
1510
|
+
var onChange = _ref6.onChange,
|
|
1511
|
+
onBlur = _ref6.onBlur,
|
|
1512
|
+
onFocus = _ref6.onFocus,
|
|
1513
|
+
value = _ref6.value,
|
|
1514
|
+
_ref6$hitSlop = _ref6.hitSlop,
|
|
1515
|
+
hitSlop = _ref6$hitSlop === void 0 ? 40 : _ref6$hitSlop,
|
|
1516
|
+
id = _ref6.id,
|
|
1517
|
+
children = _ref6.children;
|
|
1518
|
+
var theme = useKittTheme();
|
|
1519
|
+
return /*#__PURE__*/jsxs(CheckboxAndLabelPressableWrapper, {
|
|
1520
|
+
accessibilityRole: "checkbox",
|
|
1521
|
+
accessibilityState: {
|
|
1522
|
+
checked: value
|
|
1523
|
+
},
|
|
1524
|
+
hitSlop: hitSlop,
|
|
1525
|
+
onPress: function handlePress(e) {
|
|
1526
|
+
if (onFocus) onFocus(e);
|
|
1527
|
+
if (onChange) onChange(e);
|
|
1528
|
+
if (onBlur) onBlur(e);
|
|
1529
|
+
},
|
|
1530
|
+
children: [/*#__PURE__*/jsx(CheckboxContainer, {
|
|
1531
|
+
$isChecked: value,
|
|
1532
|
+
$hasLabel: !!children,
|
|
1533
|
+
testID: id,
|
|
1534
|
+
children: value ? /*#__PURE__*/jsx(Icon, {
|
|
1535
|
+
align: "center",
|
|
1536
|
+
color: theme.kitt.forms.checkbox.markColor,
|
|
1537
|
+
size: theme.kitt.forms.checkbox.iconSize,
|
|
1538
|
+
icon: /*#__PURE__*/jsx(CheckboxMark, {})
|
|
1539
|
+
}) : null
|
|
1540
|
+
}), children]
|
|
1541
|
+
});
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
|
|
1545
|
+
var theme = _ref.theme,
|
|
1546
|
+
$state = _ref.$state;
|
|
1547
|
+
return $state === 'disabled' ? theme.kitt.forms.input.states.disabled.backgroundColor : theme.kitt.forms.input.states["default"].backgroundColor;
|
|
1548
|
+
}, function (_ref2) {
|
|
1549
|
+
var theme = _ref2.theme;
|
|
1550
|
+
return theme.kitt.forms.input.borderWidth;
|
|
1551
|
+
}, function (_ref3) {
|
|
1552
|
+
var theme = _ref3.theme;
|
|
1553
|
+
return theme.kitt.forms.input.borderRadius;
|
|
1554
|
+
}, function (_ref4) {
|
|
1555
|
+
var theme = _ref4.theme,
|
|
1556
|
+
$state = _ref4.$state;
|
|
1557
|
+
return theme.kitt.forms.input.states[$state].borderColor;
|
|
1558
|
+
}, function (_ref5) {
|
|
1559
|
+
var theme = _ref5.theme;
|
|
1560
|
+
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
1561
|
+
return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].fontSize, "px");
|
|
1562
|
+
}, function (_ref6) {
|
|
1563
|
+
var theme = _ref6.theme,
|
|
1564
|
+
$state = _ref6.$state;
|
|
1565
|
+
return theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color];
|
|
1566
|
+
}, function (_ref7) {
|
|
1567
|
+
var theme = _ref7.theme;
|
|
1568
|
+
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
1569
|
+
});
|
|
1570
|
+
|
|
1571
|
+
function getInputUIState(_ref) {
|
|
1572
|
+
var isFocused = _ref.isFocused,
|
|
1031
1573
|
isDisabled = _ref.isDisabled,
|
|
1032
1574
|
formState = _ref.formState;
|
|
1033
1575
|
if (isDisabled) return 'disabled';
|
|
@@ -1036,14 +1578,18 @@ function getInputUIState(_ref) {
|
|
|
1036
1578
|
return 'default';
|
|
1037
1579
|
}
|
|
1038
1580
|
|
|
1581
|
+
var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1582
|
+
displayName: "InputTextContainer"
|
|
1583
|
+
})(["position:relative;"]);
|
|
1584
|
+
|
|
1039
1585
|
var _excluded$9 = ["id", "right", "minHeight", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoCompleteType", "keyboardType", "onFocus", "onBlur"];
|
|
1040
1586
|
|
|
1041
|
-
function ownKeys$
|
|
1587
|
+
function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1042
1588
|
|
|
1043
|
-
function _objectSpread$
|
|
1589
|
+
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1044
1590
|
var StyledTextInput = /*#__PURE__*/styled(TextInput).withConfig({
|
|
1045
1591
|
displayName: "InputText__StyledTextInput"
|
|
1046
|
-
})(["", " padding:", ";line-height:", ";min-height:", "px;"], styledTextInputMixin, function (_ref) {
|
|
1592
|
+
})(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, function (_ref) {
|
|
1047
1593
|
var theme = _ref.theme,
|
|
1048
1594
|
multiline = _ref.multiline;
|
|
1049
1595
|
|
|
@@ -1057,14 +1603,11 @@ var StyledTextInput = /*#__PURE__*/styled(TextInput).withConfig({
|
|
|
1057
1603
|
multiline = _ref2.multiline;
|
|
1058
1604
|
if (!multiline && Platform.OS === 'ios') return 0;
|
|
1059
1605
|
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
1060
|
-
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight;
|
|
1606
|
+
return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight, "px");
|
|
1061
1607
|
}, function (_ref3) {
|
|
1062
1608
|
var $minHeight = _ref3.$minHeight;
|
|
1063
1609
|
return $minHeight;
|
|
1064
1610
|
});
|
|
1065
|
-
var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1066
|
-
displayName: "InputText__InputTextContainer"
|
|
1067
|
-
})(["position:relative;"]);
|
|
1068
1611
|
var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1069
1612
|
displayName: "InputText__RightInputContainer"
|
|
1070
1613
|
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
@@ -1091,49 +1634,160 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
1091
1634
|
|
|
1092
1635
|
var theme = /*#__PURE__*/useTheme();
|
|
1093
1636
|
|
|
1094
|
-
var _useState = useState(false),
|
|
1095
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1096
|
-
isFocused = _useState2[0],
|
|
1097
|
-
setIsFocused = _useState2[1];
|
|
1637
|
+
var _useState = useState(false),
|
|
1638
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1639
|
+
isFocused = _useState2[0],
|
|
1640
|
+
setIsFocused = _useState2[1];
|
|
1641
|
+
|
|
1642
|
+
var state = internalForceState || getInputUIState({
|
|
1643
|
+
isFocused: isFocused,
|
|
1644
|
+
isDisabled: disabled,
|
|
1645
|
+
formState: formState
|
|
1646
|
+
});
|
|
1647
|
+
return /*#__PURE__*/jsxs(InputTextContainer, {
|
|
1648
|
+
$isDisabled: disabled,
|
|
1649
|
+
children: [/*#__PURE__*/jsx(StyledTextInput, _objectSpread$g(_objectSpread$g({
|
|
1650
|
+
ref: ref,
|
|
1651
|
+
nativeID: id,
|
|
1652
|
+
editable: !disabled,
|
|
1653
|
+
keyboardType: keyboardType,
|
|
1654
|
+
autoCompleteType: autoCompleteType,
|
|
1655
|
+
autoCorrect: autoCorrect,
|
|
1656
|
+
$minHeight: minHeight,
|
|
1657
|
+
textContentType: textContentType,
|
|
1658
|
+
placeholderTextColor: theme.kitt.forms.input.color.placeholder,
|
|
1659
|
+
selectionColor: theme.kitt.forms.input.color.selection
|
|
1660
|
+
}, props), {}, {
|
|
1661
|
+
$state: state,
|
|
1662
|
+
onFocus: function onFocus(e) {
|
|
1663
|
+
setIsFocused(true);
|
|
1664
|
+
if (_onFocus) _onFocus(e);
|
|
1665
|
+
},
|
|
1666
|
+
onBlur: function onBlur(e) {
|
|
1667
|
+
setIsFocused(false);
|
|
1668
|
+
if (_onBlur) _onBlur(e);
|
|
1669
|
+
}
|
|
1670
|
+
})), right ? /*#__PURE__*/jsx(RightInputContainer, {
|
|
1671
|
+
children: right
|
|
1672
|
+
}) : null]
|
|
1673
|
+
});
|
|
1674
|
+
});
|
|
1675
|
+
|
|
1676
|
+
function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1677
|
+
|
|
1678
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1679
|
+
function InputEmail(props) {
|
|
1680
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$f({
|
|
1681
|
+
autoCompleteType: "email",
|
|
1682
|
+
keyboardType: "email-address",
|
|
1683
|
+
textContentType: "emailAddress"
|
|
1684
|
+
}, props));
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
var getColorFromState = function (state) {
|
|
1688
|
+
switch (state) {
|
|
1689
|
+
case 'invalid':
|
|
1690
|
+
return 'danger';
|
|
1691
|
+
|
|
1692
|
+
case 'valid':
|
|
1693
|
+
default:
|
|
1694
|
+
return 'black-light';
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
|
|
1698
|
+
function InputFeedback(_ref) {
|
|
1699
|
+
var state = _ref.state,
|
|
1700
|
+
testID = _ref.testID,
|
|
1701
|
+
children = _ref.children;
|
|
1702
|
+
return /*#__PURE__*/jsx(Typography.Text, {
|
|
1703
|
+
base: "body-small",
|
|
1704
|
+
color: getColorFromState(state),
|
|
1705
|
+
testID: testID,
|
|
1706
|
+
children: children
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
var FieldContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1711
|
+
displayName: "InputField__FieldContainer"
|
|
1712
|
+
})(["padding:5px 0 10px;"]);
|
|
1713
|
+
var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1714
|
+
displayName: "InputField__FeedbackContainer"
|
|
1715
|
+
})(["", ";"], function (_ref) {
|
|
1716
|
+
var theme = _ref.theme;
|
|
1717
|
+
return theme.responsive.ifWindowSizeMatches({
|
|
1718
|
+
minWidth: KittBreakpoints.SMALL
|
|
1719
|
+
}, 'padding-top: 10px', 'padding-top: 5px');
|
|
1720
|
+
});
|
|
1721
|
+
var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1722
|
+
displayName: "InputField__FieldLabelContainer"
|
|
1723
|
+
})(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
|
|
1724
|
+
var theme = _ref2.theme;
|
|
1725
|
+
return theme.kitt.forms.inputField.labelContainerPaddingBottom;
|
|
1726
|
+
});
|
|
1727
|
+
var LabelContainer = /*#__PURE__*/styled.View.withConfig({
|
|
1728
|
+
displayName: "InputField__LabelContainer"
|
|
1729
|
+
})(["margin-right:", "px;"], function (_ref3) {
|
|
1730
|
+
var theme = _ref3.theme;
|
|
1731
|
+
return theme.kitt.forms.inputField.iconMarginLeft;
|
|
1732
|
+
});
|
|
1733
|
+
function InputField(_ref4) {
|
|
1734
|
+
var label = _ref4.label,
|
|
1735
|
+
labelFeedback = _ref4.labelFeedback,
|
|
1736
|
+
input = _ref4.input,
|
|
1737
|
+
feedback = _ref4.feedback;
|
|
1738
|
+
return /*#__PURE__*/jsxs(FieldContainer, {
|
|
1739
|
+
children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
|
|
1740
|
+
children: [/*#__PURE__*/jsx(LabelContainer, {
|
|
1741
|
+
children: label
|
|
1742
|
+
}), labelFeedback]
|
|
1743
|
+
}) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
|
|
1744
|
+
children: feedback
|
|
1745
|
+
}) : null]
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
function getIconColor(state, disabled) {
|
|
1750
|
+
if (disabled) return 'black-light';
|
|
1751
|
+
|
|
1752
|
+
switch (state) {
|
|
1753
|
+
case 'invalid':
|
|
1754
|
+
return 'danger';
|
|
1755
|
+
|
|
1756
|
+
case 'valid':
|
|
1757
|
+
return 'success';
|
|
1758
|
+
|
|
1759
|
+
default:
|
|
1760
|
+
return undefined;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
function InputIcon(_ref) {
|
|
1765
|
+
var icon = _ref.icon,
|
|
1766
|
+
state = _ref.state,
|
|
1767
|
+
disabled = _ref.disabled;
|
|
1768
|
+
var theme = /*#__PURE__*/useTheme();
|
|
1769
|
+
var color = getIconColor(state, disabled);
|
|
1770
|
+
return /*#__PURE__*/jsx(TypographyIcon, {
|
|
1771
|
+
color: color,
|
|
1772
|
+
icon: icon,
|
|
1773
|
+
size: theme.kitt.forms.input.icon.size
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1098
1778
|
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
});
|
|
1104
|
-
|
|
1105
|
-
children: [/*#__PURE__*/jsx(StyledTextInput, _objectSpread$d(_objectSpread$d({
|
|
1106
|
-
ref: ref,
|
|
1107
|
-
nativeID: id,
|
|
1108
|
-
editable: !disabled,
|
|
1109
|
-
keyboardType: keyboardType,
|
|
1110
|
-
autoCompleteType: autoCompleteType,
|
|
1111
|
-
autoCorrect: autoCorrect,
|
|
1112
|
-
$minHeight: minHeight,
|
|
1113
|
-
textContentType: textContentType,
|
|
1114
|
-
placeholderTextColor: theme.kitt.forms.input.color.placeholder,
|
|
1115
|
-
selectionColor: theme.kitt.forms.input.color.selection
|
|
1116
|
-
}, props), {}, {
|
|
1117
|
-
$state: state,
|
|
1118
|
-
onFocus: function onFocus(e) {
|
|
1119
|
-
setIsFocused(true);
|
|
1120
|
-
if (_onFocus) _onFocus(e);
|
|
1121
|
-
},
|
|
1122
|
-
onBlur: function onBlur(e) {
|
|
1123
|
-
setIsFocused(false);
|
|
1124
|
-
if (_onBlur) _onBlur(e);
|
|
1125
|
-
}
|
|
1126
|
-
})), right ? /*#__PURE__*/jsx(RightInputContainer, {
|
|
1127
|
-
children: right
|
|
1128
|
-
}) : null]
|
|
1129
|
-
});
|
|
1130
|
-
});
|
|
1779
|
+
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1780
|
+
function InputPressable(_ref) {
|
|
1781
|
+
var props = _extends({}, _ref);
|
|
1782
|
+
|
|
1783
|
+
return /*#__PURE__*/jsx(Pressable, _objectSpread$e({}, props));
|
|
1784
|
+
}
|
|
1131
1785
|
|
|
1132
1786
|
var _excluded$8 = ["isPasswordDefaultVisible", "right"];
|
|
1133
1787
|
|
|
1134
|
-
function ownKeys$
|
|
1788
|
+
function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1135
1789
|
|
|
1136
|
-
function _objectSpread$
|
|
1790
|
+
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1137
1791
|
function InputPassword(_ref) {
|
|
1138
1792
|
var isPasswordDefaultVisible = _ref.isPasswordDefaultVisible,
|
|
1139
1793
|
right = _ref.right,
|
|
@@ -1144,7 +1798,7 @@ function InputPassword(_ref) {
|
|
|
1144
1798
|
isVisible = _useState2[0],
|
|
1145
1799
|
setIsVisible = _useState2[1];
|
|
1146
1800
|
|
|
1147
|
-
return /*#__PURE__*/jsx(InputText, _objectSpread$
|
|
1801
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$d(_objectSpread$d({}, props), {}, {
|
|
1148
1802
|
textContentType: "password",
|
|
1149
1803
|
autoCompleteType: "password",
|
|
1150
1804
|
autoCorrect: false,
|
|
@@ -1163,6 +1817,17 @@ function InputPassword(_ref) {
|
|
|
1163
1817
|
}));
|
|
1164
1818
|
}
|
|
1165
1819
|
|
|
1820
|
+
function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1821
|
+
|
|
1822
|
+
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1823
|
+
function InputPhone(props) {
|
|
1824
|
+
return /*#__PURE__*/jsx(InputText, _objectSpread$c(_objectSpread$c({}, props), {}, {
|
|
1825
|
+
autoCompleteType: "tel",
|
|
1826
|
+
keyboardType: "number-pad",
|
|
1827
|
+
textContentType: "telephoneNumber"
|
|
1828
|
+
}));
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1166
1831
|
function Label(_ref) {
|
|
1167
1832
|
var htmlFor = _ref.htmlFor,
|
|
1168
1833
|
children = _ref.children;
|
|
@@ -1177,7 +1842,7 @@ function Label(_ref) {
|
|
|
1177
1842
|
|
|
1178
1843
|
var OuterRadio = /*#__PURE__*/styled.View.withConfig({
|
|
1179
1844
|
displayName: "Radio__OuterRadio"
|
|
1180
|
-
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", ";border-color:", ";"], function (_ref) {
|
|
1845
|
+
})(["background-color:", ";width:", "px;height:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], function (_ref) {
|
|
1181
1846
|
var theme = _ref.theme,
|
|
1182
1847
|
disabled = _ref.disabled;
|
|
1183
1848
|
return theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor;
|
|
@@ -1762,11 +2427,11 @@ var SideContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
|
1762
2427
|
})(["flex-direction:row;margin-left:", ";margin-right:", ";"], function (_ref) {
|
|
1763
2428
|
var theme = _ref.theme,
|
|
1764
2429
|
side = _ref.side;
|
|
1765
|
-
return side === 'right' ? theme.kitt.listItem.innerMargin : 0;
|
|
2430
|
+
return side === 'right' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
|
|
1766
2431
|
}, function (_ref2) {
|
|
1767
2432
|
var theme = _ref2.theme,
|
|
1768
2433
|
side = _ref2.side;
|
|
1769
|
-
return side === 'left' ? theme.kitt.listItem.innerMargin : 0;
|
|
2434
|
+
return side === 'left' ? "".concat(theme.kitt.listItem.innerMargin, "px") : 0;
|
|
1770
2435
|
}); // Handles the vertical alignment of the side elements of the list item
|
|
1771
2436
|
|
|
1772
2437
|
function ListItemSideContainer(_ref3) {
|
|
@@ -1817,15 +2482,15 @@ var ContainerView = /*#__PURE__*/styled.View.withConfig({
|
|
|
1817
2482
|
var borderWidth = theme.kitt.listItem.borderWidth;
|
|
1818
2483
|
|
|
1819
2484
|
if (borders === 'top') {
|
|
1820
|
-
return "border-top-width: ".concat(borderWidth);
|
|
2485
|
+
return "border-top-width: ".concat(borderWidth, "px");
|
|
1821
2486
|
}
|
|
1822
2487
|
|
|
1823
2488
|
if (borders === 'bottom') {
|
|
1824
|
-
return "border-bottom-width: ".concat(borderWidth);
|
|
2489
|
+
return "border-bottom-width: ".concat(borderWidth, "px");
|
|
1825
2490
|
}
|
|
1826
2491
|
|
|
1827
2492
|
if (borders === 'both') {
|
|
1828
|
-
return "border-top-width:
|
|
2493
|
+
return css(["border-top-width:", "px;border-bottom-width:", "px;"], borderWidth, borderWidth);
|
|
1829
2494
|
}
|
|
1830
2495
|
|
|
1831
2496
|
return 'border: none';
|
|
@@ -2169,12 +2834,12 @@ var ModalView = /*#__PURE__*/styled.View.withConfig({
|
|
|
2169
2834
|
});
|
|
2170
2835
|
var ContentView = /*#__PURE__*/styled.View.withConfig({
|
|
2171
2836
|
displayName: "Modal__ContentView"
|
|
2172
|
-
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", ";background-color:", ";"], function (_ref3) {
|
|
2837
|
+
})(["position:relative;display:flex;flex-direction:column;max-height:100%;max-width:540px;height:auto;width:100%;border-radius:", "px;background-color:", ";"], function (_ref3) {
|
|
2173
2838
|
var theme = _ref3.theme;
|
|
2174
2839
|
return theme.kitt.card.borderRadius;
|
|
2175
2840
|
}, function (_ref4) {
|
|
2176
2841
|
var theme = _ref4.theme;
|
|
2177
|
-
return theme.kitt.
|
|
2842
|
+
return theme.kitt.colors.uiBackgroundLight;
|
|
2178
2843
|
});
|
|
2179
2844
|
function Modal(_ref5) {
|
|
2180
2845
|
var visible = _ref5.visible,
|
|
@@ -2472,774 +3137,296 @@ StoryTitleLevel2.displayName = 'StoryTitle.Level2';
|
|
|
2472
3137
|
function StoryTitleLevel3(_ref3) {
|
|
2473
3138
|
var color = _ref3.color,
|
|
2474
3139
|
children = _ref3.children,
|
|
2475
|
-
numberOfLines = _ref3.numberOfLines;
|
|
2476
|
-
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
2477
|
-
children: /*#__PURE__*/jsx(Typography.Header3, {
|
|
2478
|
-
variant: "bold",
|
|
2479
|
-
base: "header3",
|
|
2480
|
-
medium: "header4",
|
|
2481
|
-
color: useStoryBlockColor(color),
|
|
2482
|
-
numberOfLines: numberOfLines,
|
|
2483
|
-
children: children
|
|
2484
|
-
})
|
|
2485
|
-
});
|
|
2486
|
-
}
|
|
2487
|
-
|
|
2488
|
-
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
2489
|
-
|
|
2490
|
-
function StoryTitleLevel4(_ref4) {
|
|
2491
|
-
var color = _ref4.color,
|
|
2492
|
-
children = _ref4.children,
|
|
2493
|
-
numberOfLines = _ref4.numberOfLines;
|
|
2494
|
-
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
2495
|
-
children: /*#__PURE__*/jsx(Typography.Header4, {
|
|
2496
|
-
variant: "bold",
|
|
2497
|
-
base: "header4",
|
|
2498
|
-
medium: "header5",
|
|
2499
|
-
color: useStoryBlockColor(color),
|
|
2500
|
-
numberOfLines: numberOfLines,
|
|
2501
|
-
children: children
|
|
2502
|
-
})
|
|
2503
|
-
});
|
|
2504
|
-
}
|
|
2505
|
-
|
|
2506
|
-
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
2507
|
-
StoryTitle.Level2 = StoryTitleLevel2;
|
|
2508
|
-
StoryTitle.Level3 = StoryTitleLevel3;
|
|
2509
|
-
StoryTitle.Level4 = StoryTitleLevel4;
|
|
2510
|
-
|
|
2511
|
-
var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
|
|
2512
|
-
displayName: "Story__StoryContainer"
|
|
2513
|
-
})(["padding:", "px;"], storyPadding);
|
|
2514
|
-
function Story(_ref) {
|
|
2515
|
-
var title = _ref.title,
|
|
2516
|
-
contentContainerStyle = _ref.contentContainerStyle,
|
|
2517
|
-
children = _ref.children;
|
|
2518
|
-
return /*#__PURE__*/jsxs(StoryContainer$1, {
|
|
2519
|
-
contentContainerStyle: contentContainerStyle,
|
|
2520
|
-
children: [/*#__PURE__*/jsx(StoryTitle, {
|
|
2521
|
-
children: title
|
|
2522
|
-
}), children]
|
|
2523
|
-
});
|
|
2524
|
-
}
|
|
2525
|
-
|
|
2526
|
-
var _excluded$2 = ["title", "children", "internalIsDemoSection"],
|
|
2527
|
-
_excluded2 = ["title", "children"],
|
|
2528
|
-
_excluded3 = ["title", "children"];
|
|
2529
|
-
|
|
2530
|
-
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2531
|
-
|
|
2532
|
-
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2533
|
-
var StyledSection = /*#__PURE__*/styled.View.withConfig({
|
|
2534
|
-
displayName: "StorySection__StyledSection"
|
|
2535
|
-
})(["margin-bottom:32px;"]);
|
|
2536
|
-
function StorySection(_ref) {
|
|
2537
|
-
var title = _ref.title,
|
|
2538
|
-
children = _ref.children,
|
|
2539
|
-
internalIsDemoSection = _ref.internalIsDemoSection,
|
|
2540
|
-
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
2541
|
-
|
|
2542
|
-
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
2543
|
-
return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2544
|
-
children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
|
|
2545
|
-
children: title
|
|
2546
|
-
}), children]
|
|
2547
|
-
}));
|
|
2548
|
-
}
|
|
2549
|
-
var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
|
|
2550
|
-
displayName: "StorySection__StyledSubSection"
|
|
2551
|
-
})(["margin-bottom:16px;"]);
|
|
2552
|
-
|
|
2553
|
-
function SubSection(_ref2) {
|
|
2554
|
-
var title = _ref2.title,
|
|
2555
|
-
children = _ref2.children,
|
|
2556
|
-
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
2557
|
-
|
|
2558
|
-
return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2559
|
-
children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
|
|
2560
|
-
children: title
|
|
2561
|
-
}), children]
|
|
2562
|
-
}));
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
|
-
var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
|
|
2566
|
-
displayName: "StorySection__StyledBlockSection"
|
|
2567
|
-
})(["margin-bottom:16px;"]);
|
|
2568
|
-
|
|
2569
|
-
function BlockSection(_ref3) {
|
|
2570
|
-
var title = _ref3.title,
|
|
2571
|
-
children = _ref3.children,
|
|
2572
|
-
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
2573
|
-
|
|
2574
|
-
return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
2575
|
-
children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
2576
|
-
children: title
|
|
2577
|
-
}), children]
|
|
2578
|
-
}));
|
|
2579
|
-
}
|
|
2580
|
-
|
|
2581
|
-
var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
|
|
2582
|
-
displayName: "StorySection__StyledDemoSection"
|
|
2583
|
-
})(["margin-bottom:64px;"]);
|
|
2584
|
-
|
|
2585
|
-
function DemoSection(_ref4) {
|
|
2586
|
-
var children = _ref4.children;
|
|
2587
|
-
return /*#__PURE__*/jsx(StyledDemoSection, {
|
|
2588
|
-
children: /*#__PURE__*/jsx(StorySection, {
|
|
2589
|
-
internalIsDemoSection: true,
|
|
2590
|
-
title: "Demo",
|
|
2591
|
-
children: children
|
|
2592
|
-
})
|
|
2593
|
-
});
|
|
2594
|
-
}
|
|
2595
|
-
|
|
2596
|
-
StorySection.SubSection = SubSection;
|
|
2597
|
-
StorySection.BlockSection = BlockSection;
|
|
2598
|
-
/** @deprecated use StorySection.Demo instead */
|
|
2599
|
-
|
|
2600
|
-
StorySection.DemoSection = DemoSection;
|
|
2601
|
-
StorySection.Demo = DemoSection;
|
|
2602
|
-
/** @deprecated use StorySection instead */
|
|
2603
|
-
|
|
2604
|
-
var DeprecatedSection = StorySection;
|
|
2605
|
-
|
|
2606
|
-
function StoryContainer(_ref) {
|
|
2607
|
-
var children = _ref.children,
|
|
2608
|
-
title = _ref.title,
|
|
2609
|
-
_ref$state = _ref.state,
|
|
2610
|
-
state = _ref$state === void 0 ? 'none' : _ref$state,
|
|
2611
|
-
_ref$platform = _ref.platform,
|
|
2612
|
-
platform = _ref$platform === void 0 ? 'all' : _ref$platform;
|
|
2613
|
-
if (platform === 'web') return null;
|
|
2614
|
-
return /*#__PURE__*/jsx(StorySection.BlockSection, {
|
|
2615
|
-
testID: state,
|
|
2616
|
-
title: title,
|
|
2617
|
-
children: children
|
|
2618
|
-
});
|
|
2619
|
-
}
|
|
2620
|
-
|
|
2621
|
-
function StoryDecorator(storyFn, context) {
|
|
2622
|
-
return /*#__PURE__*/jsx(Story, {
|
|
2623
|
-
title: context.name,
|
|
2624
|
-
children: storyFn()
|
|
2625
|
-
});
|
|
2626
|
-
}
|
|
2627
|
-
|
|
2628
|
-
var SmallScreenRow = /*#__PURE__*/styled.View.withConfig({
|
|
2629
|
-
displayName: "StoryGrid__SmallScreenRow"
|
|
2630
|
-
})(["flex-direction:column;margin:0;"]);
|
|
2631
|
-
var SmallScreenCol = /*#__PURE__*/styled.View.withConfig({
|
|
2632
|
-
displayName: "StoryGrid__SmallScreenCol"
|
|
2633
|
-
})(["padding:8px 0 16px;"]);
|
|
2634
|
-
var FlexRow = /*#__PURE__*/styled.View.withConfig({
|
|
2635
|
-
displayName: "StoryGrid__FlexRow"
|
|
2636
|
-
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
2637
|
-
var FlexCol = /*#__PURE__*/styled.View.withConfig({
|
|
2638
|
-
displayName: "StoryGrid__FlexCol"
|
|
2639
|
-
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
2640
|
-
|
|
2641
|
-
function StoryGridRow(_ref) {
|
|
2642
|
-
var children = _ref.children,
|
|
2643
|
-
_ref$breakpoint = _ref.breakpoint,
|
|
2644
|
-
breakpoint = _ref$breakpoint === void 0 ? 'small' : _ref$breakpoint;
|
|
2645
|
-
|
|
2646
|
-
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2647
|
-
// TODO use useBreakpoint instead
|
|
2648
|
-
var _useWindowDimensions = useWindowDimensions(),
|
|
2649
|
-
width = _useWindowDimensions.width;
|
|
2650
|
-
|
|
2651
|
-
var breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
2652
|
-
|
|
2653
|
-
if (width < breakpointValue) {
|
|
2654
|
-
return /*#__PURE__*/jsx(SmallScreenRow, {
|
|
2655
|
-
children: Children.map(children, function (child) {
|
|
2656
|
-
return /*#__PURE__*/jsx(SmallScreenCol, {
|
|
2657
|
-
children: child
|
|
2658
|
-
});
|
|
2659
|
-
})
|
|
2660
|
-
});
|
|
2661
|
-
}
|
|
2662
|
-
|
|
2663
|
-
return /*#__PURE__*/jsx(FlexRow, {
|
|
2664
|
-
children: Children.map(children, function (child) {
|
|
2665
|
-
return /*#__PURE__*/jsx(FlexCol, {
|
|
2666
|
-
children: child
|
|
2667
|
-
});
|
|
3140
|
+
numberOfLines = _ref3.numberOfLines;
|
|
3141
|
+
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
3142
|
+
children: /*#__PURE__*/jsx(Typography.Header3, {
|
|
3143
|
+
variant: "bold",
|
|
3144
|
+
base: "header3",
|
|
3145
|
+
medium: "header4",
|
|
3146
|
+
color: useStoryBlockColor(color),
|
|
3147
|
+
numberOfLines: numberOfLines,
|
|
3148
|
+
children: children
|
|
2668
3149
|
})
|
|
2669
3150
|
});
|
|
2670
3151
|
}
|
|
2671
3152
|
|
|
2672
|
-
|
|
2673
|
-
var title = _ref2.title,
|
|
2674
|
-
titleColor = _ref2.titleColor,
|
|
2675
|
-
children = _ref2.children,
|
|
2676
|
-
_ref2$platform = _ref2.platform,
|
|
2677
|
-
platform = _ref2$platform === void 0 ? 'all' : _ref2$platform;
|
|
2678
|
-
var isNative = Platform.OS === 'ios' || Platform.OS === 'android';
|
|
3153
|
+
StoryTitleLevel3.displayName = 'StoryTitle.Level3';
|
|
2679
3154
|
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
3155
|
+
function StoryTitleLevel4(_ref4) {
|
|
3156
|
+
var color = _ref4.color,
|
|
3157
|
+
children = _ref4.children,
|
|
3158
|
+
numberOfLines = _ref4.numberOfLines;
|
|
3159
|
+
return /*#__PURE__*/jsx(StorySubTitleContainer, {
|
|
3160
|
+
children: /*#__PURE__*/jsx(Typography.Header4, {
|
|
3161
|
+
variant: "bold",
|
|
3162
|
+
base: "header4",
|
|
3163
|
+
medium: "header5",
|
|
3164
|
+
color: useStoryBlockColor(color),
|
|
3165
|
+
numberOfLines: numberOfLines,
|
|
3166
|
+
children: children
|
|
3167
|
+
})
|
|
3168
|
+
});
|
|
3169
|
+
}
|
|
2683
3170
|
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
3171
|
+
StoryTitleLevel4.displayName = 'StoryTitle.Level3';
|
|
3172
|
+
StoryTitle.Level2 = StoryTitleLevel2;
|
|
3173
|
+
StoryTitle.Level3 = StoryTitleLevel3;
|
|
3174
|
+
StoryTitle.Level4 = StoryTitleLevel4;
|
|
2687
3175
|
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
3176
|
+
var StoryContainer$1 = /*#__PURE__*/styled.ScrollView.withConfig({
|
|
3177
|
+
displayName: "Story__StoryContainer"
|
|
3178
|
+
})(["padding:", "px;"], storyPadding);
|
|
3179
|
+
function Story(_ref) {
|
|
3180
|
+
var title = _ref.title,
|
|
3181
|
+
contentContainerStyle = _ref.contentContainerStyle,
|
|
3182
|
+
children = _ref.children;
|
|
3183
|
+
return /*#__PURE__*/jsxs(StoryContainer$1, {
|
|
3184
|
+
contentContainerStyle: contentContainerStyle,
|
|
3185
|
+
children: [/*#__PURE__*/jsx(StoryTitle, {
|
|
2692
3186
|
children: title
|
|
2693
|
-
})
|
|
3187
|
+
}), children]
|
|
2694
3188
|
});
|
|
2695
3189
|
}
|
|
2696
3190
|
|
|
2697
|
-
var
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
};
|
|
2701
|
-
|
|
2702
|
-
var Container$1 = /*#__PURE__*/styled.View.withConfig({
|
|
2703
|
-
displayName: "Tag__Container"
|
|
2704
|
-
})(["background-color:", ";border-width:", ";border-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], function (_ref) {
|
|
2705
|
-
var theme = _ref.theme,
|
|
2706
|
-
type = _ref.type,
|
|
2707
|
-
variant = _ref.variant;
|
|
2708
|
-
return theme.kitt.tag[type][variant].backgroundColor;
|
|
2709
|
-
}, function (_ref2) {
|
|
2710
|
-
var theme = _ref2.theme,
|
|
2711
|
-
type = _ref2.type,
|
|
2712
|
-
variant = _ref2.variant;
|
|
2713
|
-
return theme.kitt.tag[type][variant].borderWidth;
|
|
2714
|
-
}, function (_ref3) {
|
|
2715
|
-
var theme = _ref3.theme,
|
|
2716
|
-
type = _ref3.type,
|
|
2717
|
-
variant = _ref3.variant;
|
|
2718
|
-
return theme.kitt.tag[type][variant].borderColor;
|
|
2719
|
-
}, function (_ref4) {
|
|
2720
|
-
var theme = _ref4.theme;
|
|
2721
|
-
return theme.kitt.tag.padding;
|
|
2722
|
-
}, function (_ref5) {
|
|
2723
|
-
var theme = _ref5.theme;
|
|
2724
|
-
return theme.kitt.tag.borderRadius;
|
|
2725
|
-
});
|
|
2726
|
-
var getLabelColor = function (type, variant) {
|
|
2727
|
-
switch (type) {
|
|
2728
|
-
case 'danger':
|
|
2729
|
-
{
|
|
2730
|
-
return variant === 'outline' ? 'danger' : 'black';
|
|
2731
|
-
}
|
|
3191
|
+
var _excluded$2 = ["title", "children", "internalIsDemoSection"],
|
|
3192
|
+
_excluded2 = ["title", "children"],
|
|
3193
|
+
_excluded3 = ["title", "children"];
|
|
2732
3194
|
|
|
2733
|
-
|
|
2734
|
-
{
|
|
2735
|
-
return 'primary';
|
|
2736
|
-
}
|
|
3195
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2737
3196
|
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
3197
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3198
|
+
var StyledSection = /*#__PURE__*/styled.View.withConfig({
|
|
3199
|
+
displayName: "StorySection__StyledSection"
|
|
3200
|
+
})(["margin-bottom:32px;"]);
|
|
3201
|
+
function StorySection(_ref) {
|
|
3202
|
+
var title = _ref.title,
|
|
3203
|
+
children = _ref.children,
|
|
3204
|
+
internalIsDemoSection = _ref.internalIsDemoSection,
|
|
3205
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
2742
3206
|
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
};
|
|
2749
|
-
function Tag(_ref6) {
|
|
2750
|
-
var label = _ref6.label,
|
|
2751
|
-
_ref6$type = _ref6.type,
|
|
2752
|
-
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
2753
|
-
_ref6$variant = _ref6.variant,
|
|
2754
|
-
variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
|
|
2755
|
-
return /*#__PURE__*/jsx(Container$1, {
|
|
2756
|
-
type: type,
|
|
2757
|
-
variant: variant,
|
|
2758
|
-
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
2759
|
-
base: "body-xsmall",
|
|
2760
|
-
color: getLabelColor(type, variant),
|
|
2761
|
-
children: label
|
|
2762
|
-
})
|
|
2763
|
-
});
|
|
3207
|
+
if (title === 'Demo' && !internalIsDemoSection) throw new Error('Use StorySection.Demo instead');
|
|
3208
|
+
return /*#__PURE__*/jsxs(StyledSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
3209
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level2, {
|
|
3210
|
+
children: title
|
|
3211
|
+
}), children]
|
|
3212
|
+
}));
|
|
2764
3213
|
}
|
|
3214
|
+
var StyledSubSection = /*#__PURE__*/styled.View.withConfig({
|
|
3215
|
+
displayName: "StorySection__StyledSubSection"
|
|
3216
|
+
})(["margin-bottom:16px;"]);
|
|
2765
3217
|
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
lateOceanLight3: '#D6BAF9',
|
|
2771
|
-
warmEmbrace: '#F4D3CE',
|
|
2772
|
-
warmEmbraceLight1: '#FFEDE6',
|
|
2773
|
-
black1000: '#000000',
|
|
2774
|
-
black555: '#737373',
|
|
2775
|
-
black200: '#CCCCCC',
|
|
2776
|
-
black100: '#E5E5E5',
|
|
2777
|
-
black50: '#F2F2F2',
|
|
2778
|
-
black25: '#F9F9F9',
|
|
2779
|
-
white: '#FFFFFF',
|
|
2780
|
-
viride: '#38836D',
|
|
2781
|
-
englishVermillon: '#D44148',
|
|
2782
|
-
goldCrayola: '#F8C583',
|
|
2783
|
-
aero: '#89BDDD',
|
|
2784
|
-
transparent: 'transparent',
|
|
2785
|
-
moonPurple: '#DBD6F9',
|
|
2786
|
-
moonPurpleLight1: '#EDEBFC'
|
|
2787
|
-
};
|
|
2788
|
-
|
|
2789
|
-
var colorsLateOceanTheme = {
|
|
2790
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2791
|
-
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2792
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2793
|
-
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2794
|
-
success: lateOceanColorPalette.viride,
|
|
2795
|
-
correct: lateOceanColorPalette.viride,
|
|
2796
|
-
danger: lateOceanColorPalette.englishVermillon,
|
|
2797
|
-
info: lateOceanColorPalette.aero,
|
|
2798
|
-
warning: lateOceanColorPalette.goldCrayola,
|
|
2799
|
-
separator: lateOceanColorPalette.black100,
|
|
2800
|
-
hover: lateOceanColorPalette.black100,
|
|
2801
|
-
black: lateOceanColorPalette.black1000,
|
|
2802
|
-
uiBackground: lateOceanColorPalette.black25,
|
|
2803
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2804
|
-
transparent: lateOceanColorPalette.transparent,
|
|
2805
|
-
disabled: lateOceanColorPalette.black50,
|
|
2806
|
-
overlay: {
|
|
2807
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2808
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2809
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2810
|
-
}
|
|
2811
|
-
};
|
|
2812
|
-
|
|
2813
|
-
var avatar = {
|
|
2814
|
-
borderRadius: '10px',
|
|
2815
|
-
"default": {
|
|
2816
|
-
backgroundColor: colorsLateOceanTheme.primary
|
|
2817
|
-
},
|
|
2818
|
-
light: {
|
|
2819
|
-
backgroundColor: lateOceanColorPalette.black100
|
|
2820
|
-
}
|
|
2821
|
-
};
|
|
3218
|
+
function SubSection(_ref2) {
|
|
3219
|
+
var title = _ref2.title,
|
|
3220
|
+
children = _ref2.children,
|
|
3221
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
2822
3222
|
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
minHeight: '40px',
|
|
2830
|
-
minWidth: '40px',
|
|
2831
|
-
maxWidth: '335px',
|
|
2832
|
-
scale: {
|
|
2833
|
-
base: {
|
|
2834
|
-
"default": 1,
|
|
2835
|
-
hover: 0.95,
|
|
2836
|
-
active: 0.95
|
|
2837
|
-
},
|
|
2838
|
-
medium: {
|
|
2839
|
-
hover: 1.05
|
|
2840
|
-
}
|
|
2841
|
-
},
|
|
2842
|
-
contentPadding: {
|
|
2843
|
-
"default": '8px 16px 7px',
|
|
2844
|
-
large: '12px 24px 11px',
|
|
2845
|
-
disabled: '6px 14px 5px'
|
|
2846
|
-
},
|
|
2847
|
-
transition: {
|
|
2848
|
-
duration: '200ms',
|
|
2849
|
-
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2850
|
-
},
|
|
2851
|
-
"default": {
|
|
2852
|
-
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2853
|
-
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2854
|
-
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2855
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2856
|
-
},
|
|
2857
|
-
primary: {
|
|
2858
|
-
backgroundColor: colorsLateOceanTheme.primary,
|
|
2859
|
-
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2860
|
-
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2861
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2862
|
-
},
|
|
2863
|
-
white: {
|
|
2864
|
-
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2865
|
-
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2866
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2867
|
-
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2868
|
-
},
|
|
2869
|
-
subtle: {
|
|
2870
|
-
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2871
|
-
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2872
|
-
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2873
|
-
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2874
|
-
color: colorsLateOceanTheme.primary,
|
|
2875
|
-
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2876
|
-
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2877
|
-
},
|
|
2878
|
-
'subtle-dark': {
|
|
2879
|
-
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2880
|
-
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2881
|
-
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2882
|
-
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2883
|
-
color: colorsLateOceanTheme.black,
|
|
2884
|
-
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2885
|
-
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2886
|
-
},
|
|
2887
|
-
disabled: {
|
|
2888
|
-
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2889
|
-
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2890
|
-
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2891
|
-
focusBorderColor: lateOceanColorPalette.black100,
|
|
2892
|
-
borderColor: lateOceanColorPalette.black100
|
|
2893
|
-
}
|
|
2894
|
-
};
|
|
3223
|
+
return /*#__PURE__*/jsxs(StyledSubSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
3224
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level3, {
|
|
3225
|
+
children: title
|
|
3226
|
+
}), children]
|
|
3227
|
+
}));
|
|
3228
|
+
}
|
|
2895
3229
|
|
|
2896
|
-
var
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
padding: '16px',
|
|
2900
|
-
primary: {
|
|
2901
|
-
backgroundColor: lateOceanColorPalette.white,
|
|
2902
|
-
borderColor: lateOceanColorPalette.lateOcean
|
|
2903
|
-
},
|
|
2904
|
-
secondary: {
|
|
2905
|
-
backgroundColor: lateOceanColorPalette.white,
|
|
2906
|
-
borderColor: lateOceanColorPalette.black100
|
|
2907
|
-
},
|
|
2908
|
-
subtle: {
|
|
2909
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
2910
|
-
borderColor: lateOceanColorPalette.black100
|
|
2911
|
-
}
|
|
2912
|
-
};
|
|
3230
|
+
var StyledBlockSection = /*#__PURE__*/styled.View.withConfig({
|
|
3231
|
+
displayName: "StorySection__StyledBlockSection"
|
|
3232
|
+
})(["margin-bottom:16px;"]);
|
|
2913
3233
|
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
success: {
|
|
2919
|
-
backgroundColor: colorsLateOceanTheme.success
|
|
2920
|
-
},
|
|
2921
|
-
info: {
|
|
2922
|
-
backgroundColor: colorsLateOceanTheme.info
|
|
2923
|
-
},
|
|
2924
|
-
warning: {
|
|
2925
|
-
backgroundColor: colorsLateOceanTheme.warning
|
|
2926
|
-
}
|
|
2927
|
-
};
|
|
3234
|
+
function BlockSection(_ref3) {
|
|
3235
|
+
var title = _ref3.title,
|
|
3236
|
+
children = _ref3.children,
|
|
3237
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
2928
3238
|
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
fontSize: "".concat(baseAndSmallFontSize, "px"),
|
|
2936
|
-
lineHeight: "".concat(calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier), "px")
|
|
2937
|
-
},
|
|
2938
|
-
mediumAndWide: {
|
|
2939
|
-
fontSize: "".concat(mediumAndWideFontSize, "px"),
|
|
2940
|
-
lineHeight: "".concat(calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier), "px")
|
|
2941
|
-
}
|
|
2942
|
-
};
|
|
2943
|
-
};
|
|
2944
|
-
var typographyLateOceanTheme = {
|
|
2945
|
-
colors: {
|
|
2946
|
-
black: lateOceanColorPalette.black1000,
|
|
2947
|
-
'black-light': lateOceanColorPalette.black555,
|
|
2948
|
-
white: lateOceanColorPalette.white,
|
|
2949
|
-
'white-light': lateOceanColorPalette.white,
|
|
2950
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2951
|
-
'primary-light': lateOceanColorPalette.lateOceanLight1,
|
|
2952
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2953
|
-
success: lateOceanColorPalette.viride,
|
|
2954
|
-
danger: lateOceanColorPalette.englishVermillon
|
|
2955
|
-
},
|
|
2956
|
-
types: {
|
|
2957
|
-
headers: {
|
|
2958
|
-
fontFamily: {
|
|
2959
|
-
regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
2960
|
-
bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
2961
|
-
},
|
|
2962
|
-
fontWeight: 400,
|
|
2963
|
-
fontStyle: 'normal',
|
|
2964
|
-
configs: {
|
|
2965
|
-
// also known as xxlarge
|
|
2966
|
-
header1: createTypographyTypeConfig(1.3, 38, 62),
|
|
2967
|
-
// also known as xlarge
|
|
2968
|
-
header2: createTypographyTypeConfig(1.3, 32, 48),
|
|
2969
|
-
// also known as medium
|
|
2970
|
-
header3: createTypographyTypeConfig(1.3, 24, 36),
|
|
2971
|
-
// also known as xsmall
|
|
2972
|
-
header4: createTypographyTypeConfig(1.3, 18, 24),
|
|
2973
|
-
// also known as xxsmall
|
|
2974
|
-
header5: createTypographyTypeConfig(1.3, 18, 18)
|
|
2975
|
-
}
|
|
2976
|
-
},
|
|
2977
|
-
bodies: {
|
|
2978
|
-
fontFamily: {
|
|
2979
|
-
regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
2980
|
-
bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
2981
|
-
},
|
|
2982
|
-
fontWeight: {
|
|
2983
|
-
regular: 400,
|
|
2984
|
-
bold: 700
|
|
2985
|
-
},
|
|
2986
|
-
fontStyle: {
|
|
2987
|
-
regular: 'normal',
|
|
2988
|
-
bold: 'normal'
|
|
2989
|
-
},
|
|
2990
|
-
configs: {
|
|
2991
|
-
'body-large': createTypographyTypeConfig(1.6, 18, 24),
|
|
2992
|
-
'body-medium': createTypographyTypeConfig(1.6, 18, 18),
|
|
2993
|
-
body: createTypographyTypeConfig(1.6, 16, 16),
|
|
2994
|
-
'body-small': createTypographyTypeConfig(1.6, 14, 14),
|
|
2995
|
-
'body-xsmall': createTypographyTypeConfig(1.6, 12, 12)
|
|
2996
|
-
}
|
|
2997
|
-
}
|
|
2998
|
-
},
|
|
2999
|
-
link: {
|
|
3000
|
-
disabledColor: lateOceanColorPalette.black200
|
|
3001
|
-
}
|
|
3002
|
-
};
|
|
3239
|
+
return /*#__PURE__*/jsxs(StyledBlockSection, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
3240
|
+
children: [/*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
3241
|
+
children: title
|
|
3242
|
+
}), children]
|
|
3243
|
+
}));
|
|
3244
|
+
}
|
|
3003
3245
|
|
|
3004
|
-
var
|
|
3005
|
-
"
|
|
3006
|
-
|
|
3007
|
-
borderColor: colorsLateOceanTheme.separator,
|
|
3008
|
-
color: 'black'
|
|
3009
|
-
},
|
|
3010
|
-
pending: {
|
|
3011
|
-
backgroundColor: colorsLateOceanTheme.uiBackgroundLight,
|
|
3012
|
-
borderColor: colorsLateOceanTheme.separator,
|
|
3013
|
-
color: 'black'
|
|
3014
|
-
},
|
|
3015
|
-
valid: {
|
|
3016
|
-
backgroundColor: colorsLateOceanTheme.uiBackgroundLight,
|
|
3017
|
-
borderColor: lateOceanColorPalette.black100,
|
|
3018
|
-
color: 'black'
|
|
3019
|
-
},
|
|
3020
|
-
hover: {
|
|
3021
|
-
borderColor: lateOceanColorPalette.black200,
|
|
3022
|
-
color: 'black'
|
|
3023
|
-
},
|
|
3024
|
-
focus: {
|
|
3025
|
-
borderColor: colorsLateOceanTheme.primary,
|
|
3026
|
-
color: 'black'
|
|
3027
|
-
},
|
|
3028
|
-
disabled: {
|
|
3029
|
-
backgroundColor: colorsLateOceanTheme.disabled,
|
|
3030
|
-
borderColor: colorsLateOceanTheme.separator,
|
|
3031
|
-
color: 'black-light'
|
|
3032
|
-
},
|
|
3033
|
-
invalid: {
|
|
3034
|
-
borderColor: colorsLateOceanTheme.separator,
|
|
3035
|
-
color: 'black'
|
|
3036
|
-
}
|
|
3037
|
-
};
|
|
3038
|
-
var input = {
|
|
3039
|
-
color: {
|
|
3040
|
-
selection: colorsLateOceanTheme.primary,
|
|
3041
|
-
placeholder: typographyLateOceanTheme.colors['black-light']
|
|
3042
|
-
},
|
|
3043
|
-
borderWidth: '2px',
|
|
3044
|
-
borderRadius: '10px',
|
|
3045
|
-
icon: {
|
|
3046
|
-
size: 20
|
|
3047
|
-
},
|
|
3048
|
-
padding: {
|
|
3049
|
-
"default": '7px 16px',
|
|
3050
|
-
iOSSingleLine: '12px 16px'
|
|
3051
|
-
},
|
|
3052
|
-
states: inputStatesStyle
|
|
3053
|
-
};
|
|
3246
|
+
var StyledDemoSection = /*#__PURE__*/styled.View.withConfig({
|
|
3247
|
+
displayName: "StorySection__StyledDemoSection"
|
|
3248
|
+
})(["margin-bottom:64px;"]);
|
|
3054
3249
|
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3250
|
+
function DemoSection(_ref4) {
|
|
3251
|
+
var children = _ref4.children;
|
|
3252
|
+
return /*#__PURE__*/jsx(StyledDemoSection, {
|
|
3253
|
+
children: /*#__PURE__*/jsx(StorySection, {
|
|
3254
|
+
internalIsDemoSection: true,
|
|
3255
|
+
title: "Demo",
|
|
3256
|
+
children: children
|
|
3257
|
+
})
|
|
3258
|
+
});
|
|
3259
|
+
}
|
|
3059
3260
|
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3261
|
+
StorySection.SubSection = SubSection;
|
|
3262
|
+
StorySection.BlockSection = BlockSection;
|
|
3263
|
+
/** @deprecated use StorySection.Demo instead */
|
|
3264
|
+
|
|
3265
|
+
StorySection.DemoSection = DemoSection;
|
|
3266
|
+
StorySection.Demo = DemoSection;
|
|
3267
|
+
/** @deprecated use StorySection instead */
|
|
3268
|
+
|
|
3269
|
+
var DeprecatedSection = StorySection;
|
|
3270
|
+
|
|
3271
|
+
function StoryContainer(_ref) {
|
|
3272
|
+
var children = _ref.children,
|
|
3273
|
+
title = _ref.title,
|
|
3274
|
+
_ref$state = _ref.state,
|
|
3275
|
+
state = _ref$state === void 0 ? 'none' : _ref$state,
|
|
3276
|
+
_ref$platform = _ref.platform,
|
|
3277
|
+
platform = _ref$platform === void 0 ? 'all' : _ref$platform;
|
|
3278
|
+
if (platform === 'web') return null;
|
|
3279
|
+
return /*#__PURE__*/jsx(StorySection.BlockSection, {
|
|
3280
|
+
testID: state,
|
|
3281
|
+
title: title,
|
|
3282
|
+
children: children
|
|
3283
|
+
});
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
function StoryDecorator(storyFn, context) {
|
|
3287
|
+
return /*#__PURE__*/jsx(Story, {
|
|
3288
|
+
title: context.name,
|
|
3289
|
+
children: storyFn()
|
|
3290
|
+
});
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
var SmallScreenRow = /*#__PURE__*/styled.View.withConfig({
|
|
3294
|
+
displayName: "StoryGrid__SmallScreenRow"
|
|
3295
|
+
})(["flex-direction:column;margin:0;"]);
|
|
3296
|
+
var SmallScreenCol = /*#__PURE__*/styled.View.withConfig({
|
|
3297
|
+
displayName: "StoryGrid__SmallScreenCol"
|
|
3298
|
+
})(["padding:8px 0 16px;"]);
|
|
3299
|
+
var FlexRow = /*#__PURE__*/styled.View.withConfig({
|
|
3300
|
+
displayName: "StoryGrid__FlexRow"
|
|
3301
|
+
})(["flex-direction:row;margin:0 -4px 16px;"]);
|
|
3302
|
+
var FlexCol = /*#__PURE__*/styled.View.withConfig({
|
|
3303
|
+
displayName: "StoryGrid__FlexCol"
|
|
3304
|
+
})(["flex-grow:1;flex-basis:0;margin:0 8px;"]);
|
|
3305
|
+
|
|
3306
|
+
function StoryGridRow(_ref) {
|
|
3307
|
+
var children = _ref.children,
|
|
3308
|
+
_ref$breakpoint = _ref.breakpoint,
|
|
3309
|
+
breakpoint = _ref$breakpoint === void 0 ? 'small' : _ref$breakpoint;
|
|
3310
|
+
|
|
3311
|
+
// eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3312
|
+
// TODO use useBreakpoint instead
|
|
3313
|
+
var _useWindowDimensions = useWindowDimensions(),
|
|
3314
|
+
width = _useWindowDimensions.width;
|
|
3315
|
+
|
|
3316
|
+
var breakpointValue = breakpoint === 'small' ? 480 : 768;
|
|
3317
|
+
|
|
3318
|
+
if (width < breakpointValue) {
|
|
3319
|
+
return /*#__PURE__*/jsx(SmallScreenRow, {
|
|
3320
|
+
children: Children.map(children, function (child) {
|
|
3321
|
+
return /*#__PURE__*/jsx(SmallScreenCol, {
|
|
3322
|
+
children: child
|
|
3323
|
+
});
|
|
3324
|
+
})
|
|
3325
|
+
});
|
|
3075
3326
|
}
|
|
3076
|
-
};
|
|
3077
3327
|
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3328
|
+
return /*#__PURE__*/jsx(FlexRow, {
|
|
3329
|
+
children: Children.map(children, function (child) {
|
|
3330
|
+
return /*#__PURE__*/jsx(FlexCol, {
|
|
3331
|
+
children: child
|
|
3332
|
+
});
|
|
3333
|
+
})
|
|
3334
|
+
});
|
|
3335
|
+
}
|
|
3081
3336
|
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3337
|
+
function StoryGridCol(_ref2) {
|
|
3338
|
+
var title = _ref2.title,
|
|
3339
|
+
titleColor = _ref2.titleColor,
|
|
3340
|
+
children = _ref2.children,
|
|
3341
|
+
_ref2$platform = _ref2.platform,
|
|
3342
|
+
platform = _ref2$platform === void 0 ? 'all' : _ref2$platform;
|
|
3343
|
+
var isNative = Platform.OS === 'ios' || Platform.OS === 'android';
|
|
3088
3344
|
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
paddingVertical: 12,
|
|
3092
|
-
paddingHorizontal: 16,
|
|
3093
|
-
borderColor: lateOceanColorPalette.black100
|
|
3345
|
+
if (Platform.OS === 'web' && platform === 'native') {
|
|
3346
|
+
return null;
|
|
3094
3347
|
}
|
|
3095
|
-
};
|
|
3096
3348
|
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
width: 40,
|
|
3100
|
-
height: 40,
|
|
3101
|
-
borderRadius: 20,
|
|
3102
|
-
borderWidth: 2,
|
|
3103
|
-
borderColor: 'transparent',
|
|
3104
|
-
transition: {
|
|
3105
|
-
property: 'all',
|
|
3106
|
-
duration: '200ms',
|
|
3107
|
-
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1);'
|
|
3108
|
-
},
|
|
3109
|
-
scale: {
|
|
3110
|
-
base: {
|
|
3111
|
-
"default": 1,
|
|
3112
|
-
hover: 0.95,
|
|
3113
|
-
active: 0.95
|
|
3114
|
-
},
|
|
3115
|
-
medium: {
|
|
3116
|
-
hover: 1.05
|
|
3117
|
-
}
|
|
3118
|
-
},
|
|
3119
|
-
disabled: {
|
|
3120
|
-
scale: 1,
|
|
3121
|
-
backgroundColor: button.disabled.backgroundColor,
|
|
3122
|
-
borderColor: button.disabled.borderColor
|
|
3123
|
-
},
|
|
3124
|
-
"default": {
|
|
3125
|
-
pressedBackgroundColor: button["default"].pressedBackgroundColor
|
|
3126
|
-
},
|
|
3127
|
-
white: {
|
|
3128
|
-
pressedBackgroundColor: button.white.hoverBackgroundColor
|
|
3349
|
+
if (isNative && platform === 'web') {
|
|
3350
|
+
return null;
|
|
3129
3351
|
}
|
|
3130
|
-
};
|
|
3131
3352
|
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
}
|
|
3353
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
3354
|
+
children: [title ? /*#__PURE__*/jsx(StoryTitle.Level4, {
|
|
3355
|
+
numberOfLines: 1,
|
|
3356
|
+
color: titleColor,
|
|
3357
|
+
children: title
|
|
3358
|
+
}) : null, children]
|
|
3359
|
+
});
|
|
3360
|
+
}
|
|
3138
3361
|
|
|
3139
|
-
var
|
|
3140
|
-
|
|
3362
|
+
var StoryGrid = {
|
|
3363
|
+
Row: StoryGridRow,
|
|
3364
|
+
Col: StoryGridCol
|
|
3141
3365
|
};
|
|
3142
3366
|
|
|
3143
|
-
var
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3367
|
+
var Container$1 = /*#__PURE__*/styled.View.withConfig({
|
|
3368
|
+
displayName: "Tag__Container"
|
|
3369
|
+
})(["background-color:", ";border-width:", "px;border-color:", ";padding:", ";border-radius:", "px;align-self:flex-start;"], function (_ref) {
|
|
3370
|
+
var theme = _ref.theme,
|
|
3371
|
+
type = _ref.type,
|
|
3372
|
+
variant = _ref.variant;
|
|
3373
|
+
return theme.kitt.tag[type][variant].backgroundColor;
|
|
3374
|
+
}, function (_ref2) {
|
|
3375
|
+
var theme = _ref2.theme,
|
|
3376
|
+
type = _ref2.type,
|
|
3377
|
+
variant = _ref2.variant;
|
|
3378
|
+
return theme.kitt.tag[type][variant].borderWidth;
|
|
3379
|
+
}, function (_ref3) {
|
|
3380
|
+
var theme = _ref3.theme,
|
|
3381
|
+
type = _ref3.type,
|
|
3382
|
+
variant = _ref3.variant;
|
|
3383
|
+
return theme.kitt.tag[type][variant].borderColor;
|
|
3384
|
+
}, function (_ref4) {
|
|
3385
|
+
var theme = _ref4.theme;
|
|
3386
|
+
return theme.kitt.tag.padding;
|
|
3387
|
+
}, function (_ref5) {
|
|
3388
|
+
var theme = _ref5.theme;
|
|
3389
|
+
return theme.kitt.tag.borderRadius;
|
|
3390
|
+
});
|
|
3391
|
+
var getLabelColor = function (type, variant) {
|
|
3392
|
+
switch (type) {
|
|
3393
|
+
case 'danger':
|
|
3394
|
+
{
|
|
3395
|
+
return variant === 'outline' ? 'danger' : 'black';
|
|
3396
|
+
}
|
|
3148
3397
|
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
fill: {
|
|
3154
|
-
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
3155
|
-
borderWidth: '0',
|
|
3156
|
-
borderColor: lateOceanColorPalette.transparent
|
|
3157
|
-
},
|
|
3158
|
-
outline: {
|
|
3159
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
3160
|
-
borderWidth: '1px',
|
|
3161
|
-
borderColor: lateOceanColorPalette.lateOcean
|
|
3162
|
-
}
|
|
3163
|
-
},
|
|
3164
|
-
"default": {
|
|
3165
|
-
fill: {
|
|
3166
|
-
backgroundColor: lateOceanColorPalette.black50,
|
|
3167
|
-
borderWidth: '0',
|
|
3168
|
-
borderColor: lateOceanColorPalette.transparent
|
|
3169
|
-
},
|
|
3170
|
-
outline: {
|
|
3171
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
3172
|
-
borderWidth: '1px',
|
|
3173
|
-
borderColor: lateOceanColorPalette.black1000
|
|
3174
|
-
}
|
|
3175
|
-
},
|
|
3176
|
-
danger: {
|
|
3177
|
-
fill: {
|
|
3178
|
-
backgroundColor: lateOceanColorPalette.warmEmbrace,
|
|
3179
|
-
borderWidth: '0',
|
|
3180
|
-
borderColor: lateOceanColorPalette.transparent
|
|
3181
|
-
},
|
|
3182
|
-
outline: {
|
|
3183
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
3184
|
-
borderWidth: '1px',
|
|
3185
|
-
borderColor: colorsLateOceanTheme.danger
|
|
3186
|
-
}
|
|
3187
|
-
}
|
|
3188
|
-
};
|
|
3398
|
+
case 'primary':
|
|
3399
|
+
{
|
|
3400
|
+
return 'primary';
|
|
3401
|
+
}
|
|
3189
3402
|
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
horizontalPadding: 16,
|
|
3195
|
-
verticalPadding: 4,
|
|
3196
|
-
floatingPadding: 8
|
|
3197
|
-
};
|
|
3403
|
+
case 'default':
|
|
3404
|
+
{
|
|
3405
|
+
return 'black';
|
|
3406
|
+
}
|
|
3198
3407
|
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
medium: 768,
|
|
3204
|
-
large: 1024,
|
|
3205
|
-
wide: 1280
|
|
3206
|
-
},
|
|
3207
|
-
min: {
|
|
3208
|
-
smallBreakpoint: 'min-width: 480px',
|
|
3209
|
-
mediumBreakpoint: 'min-width: 768px',
|
|
3210
|
-
largeBreakpoint: 'min-width: 1024px',
|
|
3211
|
-
wideBreakpoint: 'min-width: 1280px'
|
|
3212
|
-
},
|
|
3213
|
-
max: {
|
|
3214
|
-
smallBreakpoint: 'max-width: 479px',
|
|
3215
|
-
mediumBreakpoint: 'max-width: 767px',
|
|
3216
|
-
largeBreakpoint: 'max-width: 1023px',
|
|
3217
|
-
wideBreakpoint: 'max-width: 1279px'
|
|
3408
|
+
default:
|
|
3409
|
+
{
|
|
3410
|
+
return 'black';
|
|
3411
|
+
}
|
|
3218
3412
|
}
|
|
3219
|
-
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
3220
|
-
// TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
|
|
3221
|
-
|
|
3222
|
-
var theme = {
|
|
3223
|
-
spacing: 4,
|
|
3224
|
-
colors: colorsLateOceanTheme,
|
|
3225
|
-
palettes: {
|
|
3226
|
-
lateOcean: lateOceanColorPalette
|
|
3227
|
-
},
|
|
3228
|
-
avatar: avatar,
|
|
3229
|
-
button: button,
|
|
3230
|
-
card: cardLateOceanTheme,
|
|
3231
|
-
feedbackMessage: feedbackMessage,
|
|
3232
|
-
forms: forms,
|
|
3233
|
-
typography: typographyLateOceanTheme,
|
|
3234
|
-
tag: tagLateOceanTheme,
|
|
3235
|
-
shadows: shadowsLateOceanTheme,
|
|
3236
|
-
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
3237
|
-
iconButton: iconButton,
|
|
3238
|
-
listItem: listItemLateOceanTheme,
|
|
3239
|
-
tooltip: tooltip,
|
|
3240
|
-
skeleton: skeletonTheme,
|
|
3241
|
-
breakpoints: breakpoints
|
|
3242
3413
|
};
|
|
3414
|
+
function Tag(_ref6) {
|
|
3415
|
+
var label = _ref6.label,
|
|
3416
|
+
_ref6$type = _ref6.type,
|
|
3417
|
+
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
3418
|
+
_ref6$variant = _ref6.variant,
|
|
3419
|
+
variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
|
|
3420
|
+
return /*#__PURE__*/jsx(Container$1, {
|
|
3421
|
+
type: type,
|
|
3422
|
+
variant: variant,
|
|
3423
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
3424
|
+
base: "body-xsmall",
|
|
3425
|
+
color: getLabelColor(type, variant),
|
|
3426
|
+
children: label
|
|
3427
|
+
})
|
|
3428
|
+
});
|
|
3429
|
+
}
|
|
3243
3430
|
|
|
3244
3431
|
function Title(_ref) {
|
|
3245
3432
|
var children = _ref.children;
|
|
@@ -3499,7 +3686,7 @@ function Tooltip(_ref) {
|
|
|
3499
3686
|
};
|
|
3500
3687
|
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{opacity:withSpring(pressed.value?theme.kitt.tooltip.opacity:0)};}}";
|
|
3501
3688
|
_f.__workletHash = 15953928507970;
|
|
3502
|
-
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (
|
|
3689
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (59:41)";
|
|
3503
3690
|
_f.__optimalization = 2;
|
|
3504
3691
|
|
|
3505
3692
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -3585,13 +3772,8 @@ function TypographyEmoji(_ref2) {
|
|
|
3585
3772
|
var typeConfig = getTypographyTypeConfig(typeForCurrentWindowSize || 'body', theme);
|
|
3586
3773
|
var typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
3587
3774
|
var fontSize = typeConfig[typeConfigKey].fontSize;
|
|
3588
|
-
|
|
3589
|
-
if ((process.env.NODE_ENV !== "production")) {
|
|
3590
|
-
if (!fontSize.endsWith('px')) throw new Error("Unexpected font-size value: ".concat(fontSize));
|
|
3591
|
-
}
|
|
3592
|
-
|
|
3593
3775
|
return /*#__PURE__*/jsx(StyledTypographyEmoji, {
|
|
3594
|
-
size:
|
|
3776
|
+
size: fontSize,
|
|
3595
3777
|
emoji: emoji
|
|
3596
3778
|
});
|
|
3597
3779
|
}
|
|
@@ -3657,79 +3839,6 @@ function TypographyLink(_ref5) {
|
|
|
3657
3839
|
}));
|
|
3658
3840
|
}
|
|
3659
3841
|
|
|
3660
|
-
function matchWindowSize(_ref, _ref2) {
|
|
3661
|
-
var width = _ref.width,
|
|
3662
|
-
height = _ref.height;
|
|
3663
|
-
var minWidth = _ref2.minWidth,
|
|
3664
|
-
maxWidth = _ref2.maxWidth,
|
|
3665
|
-
minHeight = _ref2.minHeight,
|
|
3666
|
-
maxHeight = _ref2.maxHeight;
|
|
3667
|
-
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3668
|
-
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3669
|
-
return hasWidthMatched && hasHeightMatched;
|
|
3670
|
-
}
|
|
3671
|
-
function useMatchWindowSize(options) {
|
|
3672
|
-
var _useWindowDimensions = useWindowDimensions(),
|
|
3673
|
-
width = _useWindowDimensions.width,
|
|
3674
|
-
height = _useWindowDimensions.height;
|
|
3675
|
-
|
|
3676
|
-
return matchWindowSize({
|
|
3677
|
-
width: width,
|
|
3678
|
-
height: height
|
|
3679
|
-
}, options);
|
|
3680
|
-
}
|
|
3681
|
-
|
|
3682
|
-
function createWindowSizeHelper(dimensions) {
|
|
3683
|
-
return {
|
|
3684
|
-
matchWindowSize: function matchWindowSize$1(options) {
|
|
3685
|
-
return matchWindowSize(dimensions, options);
|
|
3686
|
-
},
|
|
3687
|
-
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
3688
|
-
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
3689
|
-
},
|
|
3690
|
-
mapWindowWidth: function mapWindowWidth() {
|
|
3691
|
-
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3692
|
-
widthList[_key] = arguments[_key];
|
|
3693
|
-
}
|
|
3694
|
-
|
|
3695
|
-
if ((process.env.NODE_ENV !== "production")) {
|
|
3696
|
-
widthList.slice(1).forEach(function (_ref, index) {
|
|
3697
|
-
var _ref2 = _slicedToArray(_ref, 1),
|
|
3698
|
-
minWidth = _ref2[0];
|
|
3699
|
-
|
|
3700
|
-
var previousMinWidth = widthList[index][0];
|
|
3701
|
-
|
|
3702
|
-
if (previousMinWidth > minWidth) {
|
|
3703
|
-
throw new Error("mapWindowWidth: sort your values to be mobile first. ".concat(minWidth, " is < ").concat(previousMinWidth, ", so ").concat(minWidth, " should be before ").concat(previousMinWidth, "."));
|
|
3704
|
-
}
|
|
3705
|
-
});
|
|
3706
|
-
}
|
|
3707
|
-
|
|
3708
|
-
var found = widthList.find(function (_ref3) {
|
|
3709
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
3710
|
-
minWidth = _ref4[0];
|
|
3711
|
-
_ref4[1];
|
|
3712
|
-
|
|
3713
|
-
return matchWindowSize(dimensions, {
|
|
3714
|
-
minWidth: Number(minWidth)
|
|
3715
|
-
});
|
|
3716
|
-
});
|
|
3717
|
-
if (!found) return null;
|
|
3718
|
-
return found[1];
|
|
3719
|
-
}
|
|
3720
|
-
};
|
|
3721
|
-
}
|
|
3722
|
-
|
|
3723
|
-
function useKittTheme() {
|
|
3724
|
-
var dimensions = useWindowDimensions();
|
|
3725
|
-
return useMemo(function () {
|
|
3726
|
-
return {
|
|
3727
|
-
kitt: theme,
|
|
3728
|
-
responsive: createWindowSizeHelper(dimensions)
|
|
3729
|
-
};
|
|
3730
|
-
}, [dimensions]);
|
|
3731
|
-
}
|
|
3732
|
-
|
|
3733
3842
|
var hex2rgba = function (hex) {
|
|
3734
3843
|
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
3735
3844
|
var r = parseInt(hex.slice(1, 3), 16);
|
|
@@ -3765,10 +3874,8 @@ function MatchWindowSize(_ref) {
|
|
|
3765
3874
|
|
|
3766
3875
|
var match = useMatchWindowSize(matchWindowSizeOptions);
|
|
3767
3876
|
if (!match) return null;
|
|
3768
|
-
return
|
|
3769
|
-
children: children
|
|
3770
|
-
});
|
|
3877
|
+
return children;
|
|
3771
3878
|
}
|
|
3772
3879
|
|
|
3773
|
-
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputIcon, InputPassword, InputPressable, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
|
|
3880
|
+
export { Avatar, Button, Card, Checkbox, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPhone, InputPressable, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
|
|
3774
3881
|
//# sourceMappingURL=index-browser-all.es.js.map
|