@ornikar/kitt-universal 3.0.0 → 3.3.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.d.ts +14 -0
- package/dist/definitions/Button/AnimatedButtonPressable.d.ts.map +1 -0
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +17 -0
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts.map +1 -0
- package/dist/definitions/Button/BaseStyledButtonPressable.d.ts +11 -0
- package/dist/definitions/Button/BaseStyledButtonPressable.d.ts.map +1 -0
- package/dist/definitions/Button/Button.d.ts +9 -4
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonContent.d.ts +11 -3
- package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
- package/dist/definitions/Button/StyledDisabled.d.ts +3 -0
- package/dist/definitions/Button/StyledDisabled.d.ts.map +1 -0
- package/dist/definitions/Button/isSubtle.d.ts +3 -0
- package/dist/definitions/Button/isSubtle.d.ts.map +1 -0
- package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
- package/dist/definitions/Loader/LargeLoader.web.d.ts.map +1 -1
- package/dist/definitions/Loader/Loader.d.ts +1 -1
- package/dist/definitions/Loader/Loader.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +3 -43
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts +42 -35
- package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +11 -11
- package/dist/definitions/typography/TypographyIcon.d.ts +2 -2
- package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts +7 -2
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts +5 -2
- package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts.map +1 -1
- package/dist/definitions/utils/withTheme.d.ts +2 -2
- package/dist/definitions/utils/withTheme.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +421 -234
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +421 -234
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +425 -238
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +421 -228
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +448 -206
- 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 +400 -196
- package/dist/index-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/Button/ButtonPressable.d.ts +0 -13
- package/dist/definitions/Button/ButtonPressable.d.ts.map +0 -1
|
@@ -5,14 +5,14 @@ export * from '@ornikar/kitt-icons';
|
|
|
5
5
|
import { Animated, Easing, useWindowDimensions, Image, Platform, Linking, TextInput, Pressable, ActivityIndicator, TouchableOpacity, 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
|
-
import { useRef, useEffect, cloneElement, useContext, createContext,
|
|
8
|
+
import { useRef, useEffect, cloneElement, useContext, createContext, forwardRef, useMemo, useState, Fragment, Children } from 'react';
|
|
9
9
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
10
|
+
import Animated$1, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring } from 'react-native-reanimated';
|
|
10
11
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
11
12
|
import { parse } from 'twemoji-parser';
|
|
12
13
|
import { openBrowserAsync } from 'expo-web-browser';
|
|
13
14
|
import _extends from '@babel/runtime/helpers/extends';
|
|
14
15
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
15
|
-
import Animated$1, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
16
16
|
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
17
17
|
import { FormattedMessage } from 'react-intl';
|
|
18
18
|
import { useFloating, offset, shift, flip } from '@floating-ui/react-native';
|
|
@@ -50,7 +50,7 @@ function SpinningIcon(_ref) {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
var IconContainer$
|
|
53
|
+
var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
54
54
|
displayName: "Icon__IconContainer"
|
|
55
55
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
56
56
|
var color = _ref.color;
|
|
@@ -76,7 +76,7 @@ function Icon(_ref5) {
|
|
|
76
76
|
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
77
77
|
color: color
|
|
78
78
|
});
|
|
79
|
-
return /*#__PURE__*/jsx(IconContainer$
|
|
79
|
+
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
80
80
|
align: align,
|
|
81
81
|
size: size,
|
|
82
82
|
color: color,
|
|
@@ -134,11 +134,11 @@ var KittBreakpointsMax = {
|
|
|
134
134
|
LARGE: KittBreakpoints.WIDE - 1
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
var _excluded$
|
|
137
|
+
var _excluded$d = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
|
|
138
138
|
|
|
139
|
-
function ownKeys$
|
|
139
|
+
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; }
|
|
140
140
|
|
|
141
|
-
function _objectSpread$
|
|
141
|
+
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; }
|
|
142
142
|
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
143
143
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
144
144
|
function useTypographyColor() {
|
|
@@ -201,7 +201,7 @@ function Typography(_ref3) {
|
|
|
201
201
|
large = _ref3.large,
|
|
202
202
|
variant = _ref3.variant,
|
|
203
203
|
color = _ref3.color,
|
|
204
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded$
|
|
204
|
+
otherProps = _objectWithoutProperties(_ref3, _excluded$d);
|
|
205
205
|
|
|
206
206
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
207
207
|
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
|
|
@@ -212,14 +212,14 @@ function Typography(_ref3) {
|
|
|
212
212
|
var colorWithDefaultToBlack = color !== null && color !== void 0 ? color : isHeaderTypographyInContext !== undefined ? undefined : 'black';
|
|
213
213
|
var content = base ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
214
214
|
value: isHeader,
|
|
215
|
-
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
215
|
+
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
216
216
|
$color: colorWithDefaultToBlack,
|
|
217
217
|
$isHeader: isHeader,
|
|
218
218
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
219
219
|
$variant: nonNullableVariant,
|
|
220
220
|
accessibilityRole: accessibilityRole || undefined
|
|
221
221
|
}, otherProps))
|
|
222
|
-
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
222
|
+
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
223
223
|
$color: colorWithDefaultToBlack,
|
|
224
224
|
$isHeader: isHeader,
|
|
225
225
|
$variant: nonNullableVariant,
|
|
@@ -232,13 +232,13 @@ function Typography(_ref3) {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
function TypographyText(props) {
|
|
235
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
235
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$g({
|
|
236
236
|
accessibilityRole: null
|
|
237
237
|
}, props));
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
function TypographyParagraph(props) {
|
|
241
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
241
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$g({
|
|
242
242
|
accessibilityRole: "paragraph"
|
|
243
243
|
}, props));
|
|
244
244
|
}
|
|
@@ -246,7 +246,7 @@ function TypographyParagraph(props) {
|
|
|
246
246
|
var createHeading = function (level, defaultBase) {
|
|
247
247
|
// https://github.com/necolas/react-native-web/issues/401
|
|
248
248
|
function TypographyHeading(props) {
|
|
249
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
249
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$g(_objectSpread$g({
|
|
250
250
|
accessibilityRole: "header",
|
|
251
251
|
base: defaultBase
|
|
252
252
|
}, props), {}, {
|
|
@@ -282,11 +282,11 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
282
282
|
|
|
283
283
|
Typography.h5 = createHeading(5, 'header5');
|
|
284
284
|
|
|
285
|
-
var _excluded$
|
|
285
|
+
var _excluded$c = ["size"];
|
|
286
286
|
|
|
287
|
-
function ownKeys$
|
|
287
|
+
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; }
|
|
288
288
|
|
|
289
|
-
function _objectSpread$
|
|
289
|
+
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; }
|
|
290
290
|
|
|
291
291
|
var getFirstCharacter = function (string) {
|
|
292
292
|
return string ? string[0] : '';
|
|
@@ -353,95 +353,242 @@ function AvatarContent(_ref5) {
|
|
|
353
353
|
function Avatar(_ref6) {
|
|
354
354
|
var _ref6$size = _ref6.size,
|
|
355
355
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
356
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
356
|
+
rest = _objectWithoutProperties(_ref6, _excluded$c);
|
|
357
357
|
|
|
358
|
-
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$
|
|
358
|
+
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$f(_objectSpread$f({}, rest), {}, {
|
|
359
359
|
size: size,
|
|
360
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$
|
|
360
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$f(_objectSpread$f({}, rest), {}, {
|
|
361
361
|
size: size
|
|
362
362
|
}))
|
|
363
363
|
}));
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
var
|
|
367
|
-
|
|
366
|
+
var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
367
|
+
displayName: "AnimatedButtonPressable__StyledPressable"
|
|
368
|
+
})(["", ""], function (_ref) {
|
|
369
|
+
var $isStretch = _ref.$isStretch;
|
|
370
|
+
if ($isStretch) return undefined;
|
|
371
|
+
return 'align-self: flex-start;';
|
|
372
|
+
});
|
|
373
|
+
var StyledAnimatedView = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
374
|
+
displayName: "AnimatedButtonPressable__StyledAnimatedView"
|
|
375
|
+
})(["border-radius:", ";"], function (_ref2) {
|
|
376
|
+
var theme = _ref2.theme;
|
|
377
|
+
return theme.kitt.button.borderRadius;
|
|
378
|
+
});
|
|
379
|
+
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
380
|
+
var children = _ref3.children,
|
|
381
|
+
disabled = _ref3.disabled,
|
|
382
|
+
accessibilityRole = _ref3.accessibilityRole,
|
|
383
|
+
$type = _ref3.$type,
|
|
384
|
+
$isStretch = _ref3.$isStretch,
|
|
385
|
+
href = _ref3.href,
|
|
386
|
+
hrefAttrs = _ref3.hrefAttrs,
|
|
387
|
+
testID = _ref3.testID,
|
|
388
|
+
onPress = _ref3.onPress;
|
|
389
|
+
var theme = /*#__PURE__*/useTheme();
|
|
390
|
+
var pressed = useSharedValue(0);
|
|
391
|
+
var color = useSharedValue(0);
|
|
392
|
+
var _theme$kitt$button$$t = theme.kitt.button[$type],
|
|
393
|
+
backgroundColor = _theme$kitt$button$$t.backgroundColor,
|
|
394
|
+
pressedBackgroundColor = _theme$kitt$button$$t.pressedBackgroundColor;
|
|
395
|
+
var scale = theme.kitt.button.scale;
|
|
396
|
+
var scaleStyles = useAnimatedStyle(function () {
|
|
397
|
+
var _f = function () {
|
|
398
|
+
return {
|
|
399
|
+
backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
400
|
+
transform: [{
|
|
401
|
+
scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
|
|
402
|
+
}]
|
|
403
|
+
};
|
|
404
|
+
};
|
|
368
405
|
|
|
369
|
-
|
|
406
|
+
_f._closure = {
|
|
407
|
+
interpolateColor: interpolateColor,
|
|
408
|
+
color: color,
|
|
409
|
+
backgroundColor: backgroundColor,
|
|
410
|
+
pressedBackgroundColor: pressedBackgroundColor,
|
|
411
|
+
withSpring: withSpring,
|
|
412
|
+
pressed: pressed,
|
|
413
|
+
scale: {
|
|
414
|
+
base: {
|
|
415
|
+
active: scale.base.active,
|
|
416
|
+
"default": scale.base["default"]
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
_f.asString = "function _f(){const{interpolateColor,color,backgroundColor,pressedBackgroundColor,withSpring,pressed,scale}=jsThis._closure;{return{backgroundColor:interpolateColor(color.value,[0,1],[backgroundColor,pressedBackgroundColor]),transform:[{scale:withSpring(pressed.value?scale.base.active:scale.base.default)}]};}}";
|
|
421
|
+
_f.__workletHash = 5368461229978;
|
|
422
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (53:41)";
|
|
423
|
+
_f.__optimalization = 2;
|
|
370
424
|
|
|
371
|
-
|
|
425
|
+
global.__reanimatedWorkletInit(_f);
|
|
372
426
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
color:
|
|
378
|
-
|
|
379
|
-
}
|
|
427
|
+
return _f;
|
|
428
|
+
}());
|
|
429
|
+
|
|
430
|
+
var handlePressInOut = function (pressIn) {
|
|
431
|
+
color.value = withSpring(pressIn ? 1 : 0);
|
|
432
|
+
pressed.value = pressIn ? 1 : 0;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
return /*#__PURE__*/jsx(StyledPressable, {
|
|
436
|
+
ref: ref,
|
|
437
|
+
disabled: disabled,
|
|
438
|
+
accessibilityRole: accessibilityRole,
|
|
439
|
+
testID: testID,
|
|
440
|
+
href: href,
|
|
441
|
+
hrefAttrs: hrefAttrs,
|
|
442
|
+
$isStretch: $isStretch,
|
|
443
|
+
$type: $type,
|
|
444
|
+
onPress: onPress,
|
|
445
|
+
onPressIn: function onPressIn() {
|
|
446
|
+
handlePressInOut(true);
|
|
447
|
+
},
|
|
448
|
+
onPressOut: function onPressOut() {
|
|
449
|
+
handlePressInOut(false);
|
|
450
|
+
},
|
|
451
|
+
children: /*#__PURE__*/jsx(StyledAnimatedView, {
|
|
452
|
+
style: disabled ? [{
|
|
453
|
+
transform: [{
|
|
454
|
+
scale: 1
|
|
455
|
+
}]
|
|
456
|
+
}] : [scaleStyles],
|
|
457
|
+
children: children
|
|
458
|
+
})
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
463
|
+
displayName: "BaseStyledButtonPressable"
|
|
464
|
+
})(["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) {
|
|
465
|
+
var theme = _ref.theme;
|
|
466
|
+
return theme.kitt.button.minWidth;
|
|
467
|
+
}, function (_ref2) {
|
|
468
|
+
var theme = _ref2.theme,
|
|
469
|
+
$isStretch = _ref2.$isStretch;
|
|
470
|
+
return $isStretch ? '100%' : theme.kitt.button.maxWidth;
|
|
471
|
+
}, function (_ref3) {
|
|
472
|
+
var $isStretch = _ref3.$isStretch;
|
|
473
|
+
return $isStretch ? '100%' : 'auto';
|
|
474
|
+
}, function (_ref4) {
|
|
475
|
+
var theme = _ref4.theme;
|
|
476
|
+
return theme.kitt.button.minHeight;
|
|
477
|
+
}, function (_ref5) {
|
|
478
|
+
var theme = _ref5.theme;
|
|
479
|
+
return theme.kitt.button.borderRadius;
|
|
480
|
+
}, function (_ref6) {
|
|
481
|
+
var theme = _ref6.theme,
|
|
482
|
+
$isDisabled = _ref6.$isDisabled,
|
|
483
|
+
$type = _ref6.$type;
|
|
484
|
+
if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
|
|
485
|
+
if (Platform.OS !== 'web') return 'transparent';
|
|
486
|
+
return theme.kitt.button[$type].backgroundColor;
|
|
487
|
+
}, function (_ref7) {
|
|
488
|
+
var theme = _ref7.theme,
|
|
489
|
+
$isLarge = _ref7.$isLarge,
|
|
490
|
+
$isDisabled = _ref7.$isDisabled;
|
|
491
|
+
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
492
|
+
large = _theme$kitt$button$co.large,
|
|
493
|
+
defaultPadding = _theme$kitt$button$co["default"],
|
|
494
|
+
disabledPadding = _theme$kitt$button$co.disabled;
|
|
495
|
+
if ($isLarge) return large;
|
|
496
|
+
if ($isDisabled) return disabledPadding;
|
|
497
|
+
return defaultPadding;
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
var _excluded$b = ["color"],
|
|
501
|
+
_excluded2$2 = ["color"];
|
|
502
|
+
|
|
503
|
+
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; }
|
|
504
|
+
|
|
505
|
+
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; }
|
|
380
506
|
|
|
381
507
|
function TypographyIconSpecifiedColor(_ref) {
|
|
382
508
|
var color = _ref.color,
|
|
383
|
-
|
|
509
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
384
510
|
|
|
385
511
|
var theme = /*#__PURE__*/useTheme();
|
|
386
|
-
return /*#__PURE__*/jsx(Icon, _objectSpread$
|
|
387
|
-
color: theme.kitt.typography.colors[color]
|
|
512
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$e(_objectSpread$e({}, props), {}, {
|
|
513
|
+
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
388
514
|
}));
|
|
389
515
|
}
|
|
390
516
|
|
|
517
|
+
function TypographyIconInheritColor(props) {
|
|
518
|
+
var color = useTypographyColor();
|
|
519
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$e({
|
|
520
|
+
color: color
|
|
521
|
+
}, props));
|
|
522
|
+
}
|
|
523
|
+
|
|
391
524
|
function TypographyIcon(_ref2) {
|
|
392
525
|
var color = _ref2.color,
|
|
393
|
-
|
|
526
|
+
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
394
527
|
|
|
395
528
|
if (color) {
|
|
396
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
529
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$e({
|
|
397
530
|
color: color
|
|
398
|
-
},
|
|
531
|
+
}, props));
|
|
399
532
|
}
|
|
400
533
|
|
|
401
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
534
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$e({}, props));
|
|
402
535
|
}
|
|
403
536
|
|
|
404
|
-
function
|
|
537
|
+
function isSubtle(type) {
|
|
538
|
+
return type.startsWith('subtle');
|
|
539
|
+
}
|
|
405
540
|
|
|
406
|
-
|
|
541
|
+
var _excluded$a = ["type", "isDisabled", "$isStretch", "icon", "children"];
|
|
407
542
|
|
|
408
|
-
var
|
|
409
|
-
|
|
543
|
+
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; }
|
|
544
|
+
|
|
545
|
+
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; }
|
|
410
546
|
|
|
547
|
+
var getTextColorByType = function (type) {
|
|
411
548
|
switch (type) {
|
|
412
549
|
case 'primary':
|
|
413
550
|
return 'white';
|
|
414
551
|
|
|
552
|
+
case 'white':
|
|
553
|
+
return 'white';
|
|
554
|
+
|
|
415
555
|
case 'subtle':
|
|
416
|
-
return
|
|
556
|
+
return 'primary';
|
|
417
557
|
|
|
418
558
|
case 'subtle-dark':
|
|
419
|
-
return
|
|
559
|
+
return 'black';
|
|
420
560
|
|
|
421
|
-
case 'secondary':
|
|
422
561
|
default:
|
|
423
562
|
return 'black';
|
|
424
563
|
}
|
|
425
564
|
};
|
|
426
565
|
|
|
427
|
-
var
|
|
428
|
-
displayName: "
|
|
429
|
-
})(["text-align:center;"])
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
566
|
+
var StyledButtonText = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
567
|
+
displayName: "ButtonContent__StyledButtonText"
|
|
568
|
+
})(["text-align:center;", " ", ""], function () {
|
|
569
|
+
// Make the multilines case work properly on native
|
|
570
|
+
// Breaks the web implem
|
|
571
|
+
if (Platform.OS === 'web') return undefined;
|
|
572
|
+
return "\n flex-shrink: 1;\n ";
|
|
573
|
+
}, function (_ref) {
|
|
574
|
+
var $type = _ref.$type,
|
|
575
|
+
$isDisabled = _ref.$isDisabled;
|
|
576
|
+
|
|
577
|
+
/* For subltes button, color changes when hovered.
|
|
578
|
+
* We don't want to use a mouse event handler with a react state to handle it
|
|
579
|
+
* For this precise case, we've decided to work outside the typography logic
|
|
580
|
+
*/
|
|
581
|
+
if (Platform.OS !== 'web' || $isDisabled || !isSubtle($type)) return undefined;
|
|
582
|
+
return 'color: inherit';
|
|
436
583
|
});
|
|
437
|
-
var
|
|
438
|
-
displayName: "
|
|
584
|
+
var StyledIconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
585
|
+
displayName: "ButtonContent__StyledIconContainer"
|
|
439
586
|
})(["", ""], function (_ref2) {
|
|
440
587
|
var theme = _ref2.theme,
|
|
441
|
-
iconPosition = _ref2
|
|
442
|
-
var value = theme.kitt.spacing *
|
|
588
|
+
$iconPosition = _ref2.$iconPosition;
|
|
589
|
+
var value = theme.kitt.spacing * 2;
|
|
443
590
|
|
|
444
|
-
if (iconPosition === 'left') {
|
|
591
|
+
if ($iconPosition === 'left') {
|
|
445
592
|
return "margin: 0 ".concat(value, "px 0 0;");
|
|
446
593
|
}
|
|
447
594
|
|
|
@@ -450,39 +597,32 @@ var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
|
450
597
|
|
|
451
598
|
function ButtonIcon(_ref3) {
|
|
452
599
|
var icon = _ref3.icon,
|
|
453
|
-
spin = _ref3.spin,
|
|
454
600
|
color = _ref3.color,
|
|
455
|
-
|
|
601
|
+
spin = _ref3.spin,
|
|
456
602
|
iconPosition = _ref3.iconPosition,
|
|
457
603
|
testID = _ref3.testID;
|
|
458
|
-
return /*#__PURE__*/jsx(
|
|
459
|
-
iconPosition: iconPosition,
|
|
604
|
+
return /*#__PURE__*/jsx(StyledIconContainer, {
|
|
605
|
+
$iconPosition: iconPosition,
|
|
460
606
|
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
461
607
|
icon: icon,
|
|
462
608
|
spin: spin,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
testID: testID
|
|
609
|
+
testID: testID,
|
|
610
|
+
color: color
|
|
466
611
|
})
|
|
467
612
|
});
|
|
468
613
|
}
|
|
469
614
|
|
|
470
|
-
|
|
615
|
+
var StyledChildrenWithIcon = /*#__PURE__*/styled.View.withConfig({
|
|
616
|
+
displayName: "ButtonContent__StyledChildrenWithIcon"
|
|
617
|
+
})(["align-items:center;justify-content:center;flex-direction:row;"]);
|
|
618
|
+
function ButtonContentChildren(_ref4) {
|
|
471
619
|
var type = _ref4.type,
|
|
472
|
-
isPressed = _ref4.isPressed,
|
|
473
|
-
stretch = _ref4.stretch,
|
|
474
620
|
icon = _ref4.icon,
|
|
475
621
|
iconPosition = _ref4.iconPosition,
|
|
476
622
|
iconSpin = _ref4.iconSpin,
|
|
477
|
-
|
|
623
|
+
isDisabled = _ref4.isDisabled,
|
|
624
|
+
color = _ref4.color,
|
|
478
625
|
children = _ref4.children;
|
|
479
|
-
var color = getTextColorByType(type, Boolean(isPressed), Boolean(disabled));
|
|
480
|
-
var theme = /*#__PURE__*/useTheme();
|
|
481
|
-
var sharedIconProps = {
|
|
482
|
-
spin: iconSpin,
|
|
483
|
-
color: color,
|
|
484
|
-
size: theme.kitt.button.iconSize
|
|
485
|
-
};
|
|
486
626
|
|
|
487
627
|
if ((process.env.NODE_ENV !== "production")) {
|
|
488
628
|
if (!(children || icon)) {
|
|
@@ -490,128 +630,136 @@ function ButtonContent(_ref4) {
|
|
|
490
630
|
}
|
|
491
631
|
}
|
|
492
632
|
|
|
633
|
+
var isWebSubtle = isSubtle(type) && Platform.OS === 'web' && !isDisabled;
|
|
634
|
+
|
|
493
635
|
if (!children) {
|
|
494
|
-
return /*#__PURE__*/jsx(
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}))
|
|
636
|
+
return /*#__PURE__*/jsx(TypographyIcon, {
|
|
637
|
+
spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
638
|
+
,
|
|
639
|
+
icon: icon,
|
|
640
|
+
color: isWebSubtle ? 'inherit' : color
|
|
500
641
|
});
|
|
501
642
|
}
|
|
502
643
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
644
|
+
var buttonIconSharedProps = {
|
|
645
|
+
type: type,
|
|
646
|
+
spin: iconSpin,
|
|
647
|
+
iconPosition: iconPosition,
|
|
648
|
+
color: isWebSubtle ? 'inherit' : color
|
|
649
|
+
};
|
|
650
|
+
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
651
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$d(_objectSpread$d({}, buttonIconSharedProps), {}, {
|
|
652
|
+
testID: "button-left-icon",
|
|
653
|
+
icon: icon
|
|
654
|
+
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
510
655
|
base: "body",
|
|
511
|
-
color: color,
|
|
512
656
|
variant: "bold",
|
|
657
|
+
$type: type,
|
|
658
|
+
$isDisabled: isDisabled // set to color: inherit via styled components
|
|
659
|
+
,
|
|
660
|
+
color: isWebSubtle ? undefined : color,
|
|
513
661
|
children: children
|
|
514
|
-
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
515
|
-
icon: icon
|
|
516
|
-
iconPosition: iconPosition
|
|
662
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$d(_objectSpread$d({}, buttonIconSharedProps), {}, {
|
|
663
|
+
icon: icon
|
|
517
664
|
})) : null]
|
|
518
665
|
});
|
|
519
666
|
}
|
|
667
|
+
var ButtonContentContainer = /*#__PURE__*/styled.View.withConfig({
|
|
668
|
+
displayName: "ButtonContent__ButtonContentContainer"
|
|
669
|
+
})(["line-height:16px;", " ", ";"], function (_ref5) {
|
|
670
|
+
var $isStretch = _ref5.$isStretch,
|
|
671
|
+
$isIconOnly = _ref5.$isIconOnly;
|
|
672
|
+
// Make the multilines case work properly on web
|
|
673
|
+
// Breaks the native implem
|
|
674
|
+
if (Platform.OS !== 'web') return undefined;
|
|
675
|
+
return "\n flex: ".concat($isStretch || $isIconOnly ? 1 : 0, " 1 auto;\n ");
|
|
676
|
+
}, function (_ref6) {
|
|
677
|
+
var $isSubtle = _ref6.$isSubtle;
|
|
678
|
+
if (Platform.OS !== 'web' || !$isSubtle) return undefined; // Needed for subtle type
|
|
520
679
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
680
|
+
return 'color: inherit';
|
|
681
|
+
});
|
|
682
|
+
function ButtonContent(_ref7) {
|
|
683
|
+
var type = _ref7.type,
|
|
684
|
+
isDisabled = _ref7.isDisabled,
|
|
685
|
+
$isStretch = _ref7.$isStretch,
|
|
686
|
+
icon = _ref7.icon,
|
|
687
|
+
children = _ref7.children,
|
|
688
|
+
props = _objectWithoutProperties(_ref7, _excluded$a);
|
|
689
|
+
|
|
690
|
+
var color = isDisabled ? 'black-light' : getTextColorByType(type);
|
|
691
|
+
return /*#__PURE__*/jsx(ButtonContentContainer, {
|
|
692
|
+
$isSubtle: isSubtle(type),
|
|
693
|
+
$isStretch: $isStretch,
|
|
694
|
+
$isIconOnly: Boolean(!children && icon),
|
|
695
|
+
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$d(_objectSpread$d({
|
|
696
|
+
icon: icon,
|
|
697
|
+
type: type,
|
|
698
|
+
isDisabled: isDisabled,
|
|
699
|
+
color: color
|
|
700
|
+
}, props), {}, {
|
|
701
|
+
children: children
|
|
702
|
+
}))
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
|
|
707
|
+
displayName: "StyledDisabled"
|
|
708
|
+
})(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", ";"], function (_ref) {
|
|
524
709
|
var theme = _ref.theme;
|
|
525
|
-
|
|
710
|
+
var _theme$kitt$button = theme.kitt.button,
|
|
711
|
+
borderWidth = _theme$kitt$button.borderWidth,
|
|
712
|
+
disabled = _theme$kitt$button.disabled;
|
|
713
|
+
return "".concat(borderWidth.disabled, " solid ").concat(disabled.borderColor);
|
|
526
714
|
}, function (_ref2) {
|
|
527
|
-
var theme = _ref2.theme
|
|
528
|
-
stretch = _ref2.stretch;
|
|
529
|
-
return stretch ? 'auto' : theme.kitt.button.maxWidth;
|
|
530
|
-
}, function (_ref3) {
|
|
531
|
-
var stretch = _ref3.stretch;
|
|
532
|
-
return stretch ? '100%' : 'auto';
|
|
533
|
-
}, function (_ref4) {
|
|
534
|
-
var theme = _ref4.theme;
|
|
535
|
-
return theme.kitt.button.minHeight;
|
|
536
|
-
}, function (_ref5) {
|
|
537
|
-
var theme = _ref5.theme,
|
|
538
|
-
isPressed = _ref5.isPressed,
|
|
539
|
-
disabled = _ref5.disabled,
|
|
540
|
-
type = _ref5.type;
|
|
541
|
-
|
|
542
|
-
if (disabled) {
|
|
543
|
-
return theme.kitt.button[type].disabledBackgroundColor;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
|
|
547
|
-
}, function (_ref6) {
|
|
548
|
-
var theme = _ref6.theme;
|
|
549
|
-
return theme.kitt.button.contentPadding["default"];
|
|
550
|
-
}, function (_ref7) {
|
|
551
|
-
var theme = _ref7.theme;
|
|
715
|
+
var theme = _ref2.theme;
|
|
552
716
|
return theme.kitt.button.borderRadius;
|
|
553
|
-
}, function (_ref8) {
|
|
554
|
-
var theme = _ref8.theme,
|
|
555
|
-
disabled = _ref8.disabled,
|
|
556
|
-
type = _ref8.type;
|
|
557
|
-
return disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent';
|
|
558
|
-
}, function (_ref9) {
|
|
559
|
-
var theme = _ref9.theme;
|
|
560
|
-
return theme.kitt.button.borderWidth;
|
|
561
717
|
});
|
|
562
718
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
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; }
|
|
566
|
-
function Button(_ref) {
|
|
719
|
+
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
567
720
|
var children = _ref.children,
|
|
568
721
|
_ref$type = _ref.type,
|
|
569
|
-
type = _ref$type === void 0 ? '
|
|
722
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
723
|
+
disabled = _ref.disabled,
|
|
724
|
+
stretch = _ref.stretch,
|
|
725
|
+
large = _ref.large,
|
|
570
726
|
icon = _ref.icon,
|
|
571
727
|
_ref$iconPosition = _ref.iconPosition,
|
|
572
728
|
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
573
729
|
iconSpin = _ref.iconSpin,
|
|
574
|
-
stretch = _ref.stretch,
|
|
575
|
-
disabled = _ref.disabled,
|
|
576
730
|
testID = _ref.testID,
|
|
577
731
|
href = _ref.href,
|
|
578
732
|
hrefAttrs = _ref.hrefAttrs,
|
|
733
|
+
_ref$accessibilityRol = _ref.accessibilityRole,
|
|
734
|
+
accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
|
|
579
735
|
onPress = _ref.onPress;
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
isPressed = _useState2[0],
|
|
584
|
-
setIsPressed = _useState2[1];
|
|
585
|
-
|
|
586
|
-
var sharedProps = {
|
|
587
|
-
type: type,
|
|
588
|
-
stretch: stretch,
|
|
589
|
-
disabled: disabled
|
|
590
|
-
};
|
|
591
|
-
return /*#__PURE__*/jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
592
|
-
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
593
|
-
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
594
|
-
, _objectSpread$d(_objectSpread$d({}, sharedProps), {}, {
|
|
595
|
-
isPressed: isPressed,
|
|
596
|
-
accessibilityRole: "button",
|
|
736
|
+
return /*#__PURE__*/jsx(AnimatedButtonPressable, {
|
|
737
|
+
ref: ref,
|
|
738
|
+
accessibilityRole: accessibilityRole,
|
|
597
739
|
testID: testID,
|
|
598
740
|
href: href,
|
|
599
741
|
hrefAttrs: hrefAttrs,
|
|
742
|
+
disabled: disabled,
|
|
743
|
+
$isStretch: stretch,
|
|
744
|
+
$type: type,
|
|
600
745
|
onPress: onPress,
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
746
|
+
children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
|
|
747
|
+
$type: type,
|
|
748
|
+
$isStretch: stretch,
|
|
749
|
+
$isLarge: large,
|
|
750
|
+
$isDisabled: disabled,
|
|
751
|
+
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
752
|
+
type: type,
|
|
753
|
+
$isStretch: stretch,
|
|
754
|
+
isDisabled: disabled,
|
|
755
|
+
icon: icon,
|
|
756
|
+
iconPosition: iconPosition,
|
|
757
|
+
iconSpin: iconSpin,
|
|
758
|
+
children: children
|
|
759
|
+
}), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
|
|
760
|
+
})
|
|
761
|
+
});
|
|
762
|
+
});
|
|
615
763
|
|
|
616
764
|
var Container$6 = /*#__PURE__*/styled.View.withConfig({
|
|
617
765
|
displayName: "Card__Container"
|
|
@@ -2376,47 +2524,98 @@ var avatarLateOceanTheme = {
|
|
|
2376
2524
|
}
|
|
2377
2525
|
};
|
|
2378
2526
|
|
|
2527
|
+
var colorsLateOceanTheme = {
|
|
2528
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
2529
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2530
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
2531
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2532
|
+
success: lateOceanColorPalette.viride,
|
|
2533
|
+
correct: lateOceanColorPalette.viride,
|
|
2534
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
2535
|
+
separator: lateOceanColorPalette.black100,
|
|
2536
|
+
hover: lateOceanColorPalette.black100,
|
|
2537
|
+
black: lateOceanColorPalette.black1000,
|
|
2538
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
2539
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2540
|
+
transparent: lateOceanColorPalette.transparent,
|
|
2541
|
+
disabled: lateOceanColorPalette.black50,
|
|
2542
|
+
overlay: {
|
|
2543
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2544
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
2545
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2546
|
+
}
|
|
2547
|
+
};
|
|
2548
|
+
|
|
2379
2549
|
var buttonLateOceanTheme = {
|
|
2380
2550
|
borderRadius: '30px',
|
|
2381
|
-
borderWidth:
|
|
2382
|
-
|
|
2551
|
+
borderWidth: {
|
|
2552
|
+
disabled: '2px',
|
|
2553
|
+
focus: '3px'
|
|
2554
|
+
},
|
|
2555
|
+
minHeight: '40px',
|
|
2383
2556
|
minWidth: '40px',
|
|
2384
2557
|
maxWidth: '335px',
|
|
2385
|
-
|
|
2558
|
+
scale: {
|
|
2559
|
+
base: {
|
|
2560
|
+
"default": 1,
|
|
2561
|
+
hover: 0.95,
|
|
2562
|
+
active: 0.95
|
|
2563
|
+
},
|
|
2564
|
+
medium: {
|
|
2565
|
+
hover: 1.05
|
|
2566
|
+
}
|
|
2567
|
+
},
|
|
2386
2568
|
contentPadding: {
|
|
2387
|
-
"default": '8px 16px'
|
|
2569
|
+
"default": '8px 16px 7px',
|
|
2570
|
+
large: '12px 24px 11px',
|
|
2571
|
+
disabled: '6px 14px 5px'
|
|
2388
2572
|
},
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
|
|
2393
|
-
disabledBorderColor: lateOceanColorPalette.black100
|
|
2573
|
+
transition: {
|
|
2574
|
+
duration: '200ms',
|
|
2575
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2394
2576
|
},
|
|
2395
|
-
|
|
2577
|
+
"default": {
|
|
2396
2578
|
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2397
|
-
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
2398
2579
|
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2399
|
-
|
|
2580
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2581
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2400
2582
|
},
|
|
2401
|
-
|
|
2402
|
-
backgroundColor:
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
},
|
|
2407
|
-
'subtle-dark': {
|
|
2408
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
2409
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2410
|
-
pressedBackgroundColor: lateOceanColorPalette.transparent,
|
|
2411
|
-
disabledBorderColor: lateOceanColorPalette.transparent
|
|
2583
|
+
primary: {
|
|
2584
|
+
backgroundColor: colorsLateOceanTheme.primary,
|
|
2585
|
+
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2586
|
+
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2587
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2412
2588
|
},
|
|
2413
2589
|
white: {
|
|
2414
2590
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2415
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2416
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2417
2591
|
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2418
|
-
|
|
2419
|
-
|
|
2592
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2593
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2594
|
+
},
|
|
2595
|
+
subtle: {
|
|
2596
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2597
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2598
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2599
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2600
|
+
color: colorsLateOceanTheme.primary,
|
|
2601
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2602
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2603
|
+
},
|
|
2604
|
+
'subtle-dark': {
|
|
2605
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2606
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2607
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2608
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2609
|
+
color: colorsLateOceanTheme.black,
|
|
2610
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2611
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2612
|
+
},
|
|
2613
|
+
disabled: {
|
|
2614
|
+
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2615
|
+
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2616
|
+
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2617
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
2618
|
+
borderColor: lateOceanColorPalette.black100
|
|
2420
2619
|
}
|
|
2421
2620
|
};
|
|
2422
2621
|
|
|
@@ -2438,26 +2637,6 @@ var cardLateOceanTheme = {
|
|
|
2438
2637
|
}
|
|
2439
2638
|
};
|
|
2440
2639
|
|
|
2441
|
-
var colorsLateOceanTheme = {
|
|
2442
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2443
|
-
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2444
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2445
|
-
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2446
|
-
success: lateOceanColorPalette.viride,
|
|
2447
|
-
correct: lateOceanColorPalette.viride,
|
|
2448
|
-
danger: lateOceanColorPalette.englishVermillon,
|
|
2449
|
-
separator: lateOceanColorPalette.black100,
|
|
2450
|
-
hover: lateOceanColorPalette.black100,
|
|
2451
|
-
black: lateOceanColorPalette.black1000,
|
|
2452
|
-
uiBackground: lateOceanColorPalette.black25,
|
|
2453
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2454
|
-
overlay: {
|
|
2455
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2456
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2457
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2458
|
-
}
|
|
2459
|
-
};
|
|
2460
|
-
|
|
2461
2640
|
var feedbackMessageLateOceanTheme = {
|
|
2462
2641
|
backgroundColors: {
|
|
2463
2642
|
success: lateOceanColorPalette.viride,
|
|
@@ -2571,11 +2750,11 @@ var iconButton = {
|
|
|
2571
2750
|
},
|
|
2572
2751
|
disabled: {
|
|
2573
2752
|
scale: 1,
|
|
2574
|
-
backgroundColor: buttonLateOceanTheme.
|
|
2575
|
-
borderColor: buttonLateOceanTheme.
|
|
2753
|
+
backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
|
|
2754
|
+
borderColor: buttonLateOceanTheme.disabled.borderColor
|
|
2576
2755
|
},
|
|
2577
2756
|
"default": {
|
|
2578
|
-
pressedBackgroundColor: buttonLateOceanTheme.
|
|
2757
|
+
pressedBackgroundColor: buttonLateOceanTheme["default"].pressedBackgroundColor
|
|
2579
2758
|
},
|
|
2580
2759
|
white: {
|
|
2581
2760
|
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
@@ -2741,7 +2920,7 @@ var breakpoints = {
|
|
|
2741
2920
|
wideBreakpoint: 'max-width: 1279px'
|
|
2742
2921
|
}
|
|
2743
2922
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2744
|
-
// TODO : seperate brand
|
|
2923
|
+
// TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
|
|
2745
2924
|
|
|
2746
2925
|
var theme = {
|
|
2747
2926
|
spacing: 4,
|
|
@@ -3189,25 +3368,35 @@ function TypographyLink(_ref4) {
|
|
|
3189
3368
|
}));
|
|
3190
3369
|
}
|
|
3191
3370
|
|
|
3192
|
-
function matchWindowSize(
|
|
3193
|
-
var
|
|
3194
|
-
|
|
3195
|
-
|
|
3371
|
+
function matchWindowSize(_ref, _ref2) {
|
|
3372
|
+
var width = _ref.width,
|
|
3373
|
+
height = _ref.height;
|
|
3374
|
+
var minWidth = _ref2.minWidth,
|
|
3375
|
+
maxWidth = _ref2.maxWidth,
|
|
3376
|
+
minHeight = _ref2.minHeight,
|
|
3377
|
+
maxHeight = _ref2.maxHeight;
|
|
3378
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3379
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3380
|
+
return hasWidthMatched && hasHeightMatched;
|
|
3196
3381
|
}
|
|
3197
3382
|
function useMatchWindowSize(options) {
|
|
3198
3383
|
var _useWindowDimensions = useWindowDimensions(),
|
|
3199
|
-
width = _useWindowDimensions.width
|
|
3384
|
+
width = _useWindowDimensions.width,
|
|
3385
|
+
height = _useWindowDimensions.height;
|
|
3200
3386
|
|
|
3201
|
-
return matchWindowSize(
|
|
3387
|
+
return matchWindowSize({
|
|
3388
|
+
width: width,
|
|
3389
|
+
height: height
|
|
3390
|
+
}, options);
|
|
3202
3391
|
}
|
|
3203
3392
|
|
|
3204
|
-
function createWindowSizeHelper(
|
|
3393
|
+
function createWindowSizeHelper(dimensions) {
|
|
3205
3394
|
return {
|
|
3206
3395
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
3207
|
-
return matchWindowSize(
|
|
3396
|
+
return matchWindowSize(dimensions, options);
|
|
3208
3397
|
},
|
|
3209
3398
|
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
3210
|
-
return matchWindowSize(
|
|
3399
|
+
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
3211
3400
|
},
|
|
3212
3401
|
mapWindowWidth: function mapWindowWidth() {
|
|
3213
3402
|
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3232,7 +3421,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3232
3421
|
minWidth = _ref4[0];
|
|
3233
3422
|
_ref4[1];
|
|
3234
3423
|
|
|
3235
|
-
return matchWindowSize(
|
|
3424
|
+
return matchWindowSize(dimensions, {
|
|
3236
3425
|
minWidth: Number(minWidth)
|
|
3237
3426
|
});
|
|
3238
3427
|
});
|
|
@@ -3243,16 +3432,14 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3243
3432
|
}
|
|
3244
3433
|
|
|
3245
3434
|
function useKittTheme() {
|
|
3246
|
-
var
|
|
3247
|
-
width = _useWindowSize.width;
|
|
3248
|
-
|
|
3435
|
+
var dimensions = useWindowDimensions();
|
|
3249
3436
|
return useMemo(function () {
|
|
3250
3437
|
return {
|
|
3251
3438
|
kitt: theme,
|
|
3252
|
-
responsive: createWindowSizeHelper(
|
|
3439
|
+
responsive: createWindowSizeHelper(dimensions),
|
|
3253
3440
|
breakpoints: breakpoints
|
|
3254
3441
|
};
|
|
3255
|
-
}, [
|
|
3442
|
+
}, [dimensions]);
|
|
3256
3443
|
}
|
|
3257
3444
|
|
|
3258
3445
|
function KittThemeProvider(_ref) {
|