@ornikar/kitt-universal 3.0.0-beta.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/withTheme.d.ts +2 -2
- package/dist/definitions/utils/withTheme.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +402 -223
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.css +1 -1
- package/dist/index-browser-all.es.ios.js +402 -223
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +406 -227
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +399 -214
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.css +1 -1
- package/dist/index-node-14.17.cjs.js +428 -196
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +5 -0
- package/dist/index-node-14.17.cjs.web.js +3173 -0
- package/dist/index-node-14.17.cjs.web.js.map +1 -0
- package/dist/styles.css +2 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +9 -8
- package/CHANGELOG.md +0 -131
- package/dist/definitions/Button/ButtonPressable.d.ts +0 -13
- package/dist/definitions/Button/ButtonPressable.d.ts.map +0 -1
|
@@ -5,14 +5,15 @@ 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
|
|
16
|
+
import { styled as styled$1 } from '@linaria/react';
|
|
16
17
|
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
17
18
|
import { FormattedMessage } from 'react-intl';
|
|
18
19
|
import { useFloating, offset, shift, flip } from '@floating-ui/react-native';
|
|
@@ -50,7 +51,7 @@ function SpinningIcon(_ref) {
|
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
var IconContainer$
|
|
54
|
+
var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
54
55
|
displayName: "Icon__IconContainer"
|
|
55
56
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
56
57
|
var color = _ref.color;
|
|
@@ -76,7 +77,7 @@ function Icon(_ref5) {
|
|
|
76
77
|
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
77
78
|
color: color
|
|
78
79
|
});
|
|
79
|
-
return /*#__PURE__*/jsx(IconContainer$
|
|
80
|
+
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
80
81
|
align: align,
|
|
81
82
|
size: size,
|
|
82
83
|
color: color,
|
|
@@ -134,11 +135,11 @@ var KittBreakpointsMax = {
|
|
|
134
135
|
LARGE: KittBreakpoints.WIDE - 1
|
|
135
136
|
};
|
|
136
137
|
|
|
137
|
-
var _excluded$
|
|
138
|
+
var _excluded$d = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
|
|
138
139
|
|
|
139
|
-
function ownKeys$
|
|
140
|
+
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; }
|
|
140
141
|
|
|
141
|
-
function _objectSpread$
|
|
142
|
+
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; }
|
|
142
143
|
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
143
144
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
144
145
|
function useTypographyColor() {
|
|
@@ -201,7 +202,7 @@ function Typography(_ref3) {
|
|
|
201
202
|
large = _ref3.large,
|
|
202
203
|
variant = _ref3.variant,
|
|
203
204
|
color = _ref3.color,
|
|
204
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded$
|
|
205
|
+
otherProps = _objectWithoutProperties(_ref3, _excluded$d);
|
|
205
206
|
|
|
206
207
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
207
208
|
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
|
|
@@ -212,14 +213,14 @@ function Typography(_ref3) {
|
|
|
212
213
|
var colorWithDefaultToBlack = color !== null && color !== void 0 ? color : isHeaderTypographyInContext !== undefined ? undefined : 'black';
|
|
213
214
|
var content = base ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
214
215
|
value: isHeader,
|
|
215
|
-
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
216
|
+
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$h({
|
|
216
217
|
$color: colorWithDefaultToBlack,
|
|
217
218
|
$isHeader: isHeader,
|
|
218
219
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
219
220
|
$variant: nonNullableVariant,
|
|
220
221
|
accessibilityRole: accessibilityRole || undefined
|
|
221
222
|
}, otherProps))
|
|
222
|
-
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
223
|
+
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$h({
|
|
223
224
|
$color: colorWithDefaultToBlack,
|
|
224
225
|
$isHeader: isHeader,
|
|
225
226
|
$variant: nonNullableVariant,
|
|
@@ -232,13 +233,13 @@ function Typography(_ref3) {
|
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
function TypographyText(props) {
|
|
235
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
236
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h({
|
|
236
237
|
accessibilityRole: null
|
|
237
238
|
}, props));
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
function TypographyParagraph(props) {
|
|
241
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
242
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h({
|
|
242
243
|
accessibilityRole: "paragraph"
|
|
243
244
|
}, props));
|
|
244
245
|
}
|
|
@@ -246,7 +247,7 @@ function TypographyParagraph(props) {
|
|
|
246
247
|
var createHeading = function (level, defaultBase) {
|
|
247
248
|
// https://github.com/necolas/react-native-web/issues/401
|
|
248
249
|
function TypographyHeading(props) {
|
|
249
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
250
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$h(_objectSpread$h({
|
|
250
251
|
accessibilityRole: "header",
|
|
251
252
|
base: defaultBase
|
|
252
253
|
}, props), {}, {
|
|
@@ -282,11 +283,11 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
282
283
|
|
|
283
284
|
Typography.h5 = createHeading(5, 'header5');
|
|
284
285
|
|
|
285
|
-
var _excluded$
|
|
286
|
+
var _excluded$c = ["size"];
|
|
286
287
|
|
|
287
|
-
function ownKeys$
|
|
288
|
+
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; }
|
|
288
289
|
|
|
289
|
-
function _objectSpread$
|
|
290
|
+
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; }
|
|
290
291
|
|
|
291
292
|
var getFirstCharacter = function (string) {
|
|
292
293
|
return string ? string[0] : '';
|
|
@@ -353,95 +354,242 @@ function AvatarContent(_ref5) {
|
|
|
353
354
|
function Avatar(_ref6) {
|
|
354
355
|
var _ref6$size = _ref6.size,
|
|
355
356
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
356
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
357
|
+
rest = _objectWithoutProperties(_ref6, _excluded$c);
|
|
357
358
|
|
|
358
|
-
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$
|
|
359
|
+
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$g(_objectSpread$g({}, rest), {}, {
|
|
359
360
|
size: size,
|
|
360
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$
|
|
361
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$g(_objectSpread$g({}, rest), {}, {
|
|
361
362
|
size: size
|
|
362
363
|
}))
|
|
363
364
|
}));
|
|
364
365
|
}
|
|
365
366
|
|
|
366
|
-
var
|
|
367
|
-
|
|
367
|
+
var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
368
|
+
displayName: "AnimatedButtonPressable__StyledPressable"
|
|
369
|
+
})(["", ""], function (_ref) {
|
|
370
|
+
var $isStretch = _ref.$isStretch;
|
|
371
|
+
if ($isStretch) return undefined;
|
|
372
|
+
return 'align-self: flex-start;';
|
|
373
|
+
});
|
|
374
|
+
var StyledAnimatedView = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
375
|
+
displayName: "AnimatedButtonPressable__StyledAnimatedView"
|
|
376
|
+
})(["border-radius:", ";"], function (_ref2) {
|
|
377
|
+
var theme = _ref2.theme;
|
|
378
|
+
return theme.kitt.button.borderRadius;
|
|
379
|
+
});
|
|
380
|
+
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
381
|
+
var children = _ref3.children,
|
|
382
|
+
disabled = _ref3.disabled,
|
|
383
|
+
accessibilityRole = _ref3.accessibilityRole,
|
|
384
|
+
$type = _ref3.$type,
|
|
385
|
+
$isStretch = _ref3.$isStretch,
|
|
386
|
+
href = _ref3.href,
|
|
387
|
+
hrefAttrs = _ref3.hrefAttrs,
|
|
388
|
+
testID = _ref3.testID,
|
|
389
|
+
onPress = _ref3.onPress;
|
|
390
|
+
var theme = /*#__PURE__*/useTheme();
|
|
391
|
+
var pressed = useSharedValue(0);
|
|
392
|
+
var color = useSharedValue(0);
|
|
393
|
+
var _theme$kitt$button$$t = theme.kitt.button[$type],
|
|
394
|
+
backgroundColor = _theme$kitt$button$$t.backgroundColor,
|
|
395
|
+
pressedBackgroundColor = _theme$kitt$button$$t.pressedBackgroundColor;
|
|
396
|
+
var scale = theme.kitt.button.scale;
|
|
397
|
+
var scaleStyles = useAnimatedStyle(function () {
|
|
398
|
+
var _f = function () {
|
|
399
|
+
return {
|
|
400
|
+
backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
401
|
+
transform: [{
|
|
402
|
+
scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
|
|
403
|
+
}]
|
|
404
|
+
};
|
|
405
|
+
};
|
|
368
406
|
|
|
369
|
-
|
|
407
|
+
_f._closure = {
|
|
408
|
+
interpolateColor: interpolateColor,
|
|
409
|
+
color: color,
|
|
410
|
+
backgroundColor: backgroundColor,
|
|
411
|
+
pressedBackgroundColor: pressedBackgroundColor,
|
|
412
|
+
withSpring: withSpring,
|
|
413
|
+
pressed: pressed,
|
|
414
|
+
scale: {
|
|
415
|
+
base: {
|
|
416
|
+
active: scale.base.active,
|
|
417
|
+
"default": scale.base["default"]
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
_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)}]};}}";
|
|
422
|
+
_f.__workletHash = 5368461229978;
|
|
423
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (53:41)";
|
|
424
|
+
_f.__optimalization = 2;
|
|
370
425
|
|
|
371
|
-
|
|
426
|
+
global.__reanimatedWorkletInit(_f);
|
|
372
427
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
color:
|
|
378
|
-
|
|
379
|
-
}
|
|
428
|
+
return _f;
|
|
429
|
+
}());
|
|
430
|
+
|
|
431
|
+
var handlePressInOut = function (pressIn) {
|
|
432
|
+
color.value = withSpring(pressIn ? 1 : 0);
|
|
433
|
+
pressed.value = pressIn ? 1 : 0;
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
return /*#__PURE__*/jsx(StyledPressable, {
|
|
437
|
+
ref: ref,
|
|
438
|
+
disabled: disabled,
|
|
439
|
+
accessibilityRole: accessibilityRole,
|
|
440
|
+
testID: testID,
|
|
441
|
+
href: href,
|
|
442
|
+
hrefAttrs: hrefAttrs,
|
|
443
|
+
$isStretch: $isStretch,
|
|
444
|
+
$type: $type,
|
|
445
|
+
onPress: onPress,
|
|
446
|
+
onPressIn: function onPressIn() {
|
|
447
|
+
handlePressInOut(true);
|
|
448
|
+
},
|
|
449
|
+
onPressOut: function onPressOut() {
|
|
450
|
+
handlePressInOut(false);
|
|
451
|
+
},
|
|
452
|
+
children: /*#__PURE__*/jsx(StyledAnimatedView, {
|
|
453
|
+
style: disabled ? [{
|
|
454
|
+
transform: [{
|
|
455
|
+
scale: 1
|
|
456
|
+
}]
|
|
457
|
+
}] : [scaleStyles],
|
|
458
|
+
children: children
|
|
459
|
+
})
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
464
|
+
displayName: "BaseStyledButtonPressable"
|
|
465
|
+
})(["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) {
|
|
466
|
+
var theme = _ref.theme;
|
|
467
|
+
return theme.kitt.button.minWidth;
|
|
468
|
+
}, function (_ref2) {
|
|
469
|
+
var theme = _ref2.theme,
|
|
470
|
+
$isStretch = _ref2.$isStretch;
|
|
471
|
+
return $isStretch ? '100%' : theme.kitt.button.maxWidth;
|
|
472
|
+
}, function (_ref3) {
|
|
473
|
+
var $isStretch = _ref3.$isStretch;
|
|
474
|
+
return $isStretch ? '100%' : 'auto';
|
|
475
|
+
}, function (_ref4) {
|
|
476
|
+
var theme = _ref4.theme;
|
|
477
|
+
return theme.kitt.button.minHeight;
|
|
478
|
+
}, function (_ref5) {
|
|
479
|
+
var theme = _ref5.theme;
|
|
480
|
+
return theme.kitt.button.borderRadius;
|
|
481
|
+
}, function (_ref6) {
|
|
482
|
+
var theme = _ref6.theme,
|
|
483
|
+
$isDisabled = _ref6.$isDisabled,
|
|
484
|
+
$type = _ref6.$type;
|
|
485
|
+
if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
|
|
486
|
+
if (Platform.OS !== 'web') return 'transparent';
|
|
487
|
+
return theme.kitt.button[$type].backgroundColor;
|
|
488
|
+
}, function (_ref7) {
|
|
489
|
+
var theme = _ref7.theme,
|
|
490
|
+
$isLarge = _ref7.$isLarge,
|
|
491
|
+
$isDisabled = _ref7.$isDisabled;
|
|
492
|
+
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
493
|
+
large = _theme$kitt$button$co.large,
|
|
494
|
+
defaultPadding = _theme$kitt$button$co["default"],
|
|
495
|
+
disabledPadding = _theme$kitt$button$co.disabled;
|
|
496
|
+
if ($isLarge) return large;
|
|
497
|
+
if ($isDisabled) return disabledPadding;
|
|
498
|
+
return defaultPadding;
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
var _excluded$b = ["color"],
|
|
502
|
+
_excluded2$2 = ["color"];
|
|
503
|
+
|
|
504
|
+
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; }
|
|
505
|
+
|
|
506
|
+
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; }
|
|
380
507
|
|
|
381
508
|
function TypographyIconSpecifiedColor(_ref) {
|
|
382
509
|
var color = _ref.color,
|
|
383
|
-
|
|
510
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
384
511
|
|
|
385
512
|
var theme = /*#__PURE__*/useTheme();
|
|
386
|
-
return /*#__PURE__*/jsx(Icon, _objectSpread$
|
|
387
|
-
color: theme.kitt.typography.colors[color]
|
|
513
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
514
|
+
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
388
515
|
}));
|
|
389
516
|
}
|
|
390
517
|
|
|
518
|
+
function TypographyIconInheritColor(props) {
|
|
519
|
+
var color = useTypographyColor();
|
|
520
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$f({
|
|
521
|
+
color: color
|
|
522
|
+
}, props));
|
|
523
|
+
}
|
|
524
|
+
|
|
391
525
|
function TypographyIcon(_ref2) {
|
|
392
526
|
var color = _ref2.color,
|
|
393
|
-
|
|
527
|
+
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
394
528
|
|
|
395
529
|
if (color) {
|
|
396
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
530
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$f({
|
|
397
531
|
color: color
|
|
398
|
-
},
|
|
532
|
+
}, props));
|
|
399
533
|
}
|
|
400
534
|
|
|
401
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
535
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$f({}, props));
|
|
402
536
|
}
|
|
403
537
|
|
|
404
|
-
function
|
|
538
|
+
function isSubtle(type) {
|
|
539
|
+
return type.startsWith('subtle');
|
|
540
|
+
}
|
|
405
541
|
|
|
406
|
-
|
|
542
|
+
var _excluded$a = ["type", "isDisabled", "$isStretch", "icon", "children"];
|
|
543
|
+
|
|
544
|
+
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; }
|
|
407
545
|
|
|
408
|
-
var
|
|
409
|
-
if (disabled) return 'black-light';
|
|
546
|
+
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; }
|
|
410
547
|
|
|
548
|
+
var getTextColorByType = function (type) {
|
|
411
549
|
switch (type) {
|
|
412
550
|
case 'primary':
|
|
413
551
|
return 'white';
|
|
414
552
|
|
|
553
|
+
case 'white':
|
|
554
|
+
return 'white';
|
|
555
|
+
|
|
415
556
|
case 'subtle':
|
|
416
|
-
return
|
|
557
|
+
return 'primary';
|
|
417
558
|
|
|
418
559
|
case 'subtle-dark':
|
|
419
|
-
return
|
|
560
|
+
return 'black';
|
|
420
561
|
|
|
421
|
-
case 'secondary':
|
|
422
562
|
default:
|
|
423
563
|
return 'black';
|
|
424
564
|
}
|
|
425
565
|
};
|
|
426
566
|
|
|
427
|
-
var
|
|
428
|
-
displayName: "
|
|
429
|
-
})(["text-align:center;"])
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
567
|
+
var StyledButtonText = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
568
|
+
displayName: "ButtonContent__StyledButtonText"
|
|
569
|
+
})(["text-align:center;", " ", ""], function () {
|
|
570
|
+
// Make the multilines case work properly on native
|
|
571
|
+
// Breaks the web implem
|
|
572
|
+
if (Platform.OS === 'web') return undefined;
|
|
573
|
+
return "\n flex-shrink: 1;\n ";
|
|
574
|
+
}, function (_ref) {
|
|
575
|
+
var $type = _ref.$type,
|
|
576
|
+
$isDisabled = _ref.$isDisabled;
|
|
577
|
+
|
|
578
|
+
/* For subltes button, color changes when hovered.
|
|
579
|
+
* We don't want to use a mouse event handler with a react state to handle it
|
|
580
|
+
* For this precise case, we've decided to work outside the typography logic
|
|
581
|
+
*/
|
|
582
|
+
if (Platform.OS !== 'web' || $isDisabled || !isSubtle($type)) return undefined;
|
|
583
|
+
return 'color: inherit';
|
|
436
584
|
});
|
|
437
|
-
var
|
|
438
|
-
displayName: "
|
|
585
|
+
var StyledIconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
586
|
+
displayName: "ButtonContent__StyledIconContainer"
|
|
439
587
|
})(["", ""], function (_ref2) {
|
|
440
588
|
var theme = _ref2.theme,
|
|
441
|
-
iconPosition = _ref2
|
|
442
|
-
var value = theme.kitt.spacing *
|
|
589
|
+
$iconPosition = _ref2.$iconPosition;
|
|
590
|
+
var value = theme.kitt.spacing * 2;
|
|
443
591
|
|
|
444
|
-
if (iconPosition === 'left') {
|
|
592
|
+
if ($iconPosition === 'left') {
|
|
445
593
|
return "margin: 0 ".concat(value, "px 0 0;");
|
|
446
594
|
}
|
|
447
595
|
|
|
@@ -450,39 +598,32 @@ var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
|
450
598
|
|
|
451
599
|
function ButtonIcon(_ref3) {
|
|
452
600
|
var icon = _ref3.icon,
|
|
453
|
-
spin = _ref3.spin,
|
|
454
601
|
color = _ref3.color,
|
|
455
|
-
|
|
602
|
+
spin = _ref3.spin,
|
|
456
603
|
iconPosition = _ref3.iconPosition,
|
|
457
604
|
testID = _ref3.testID;
|
|
458
|
-
return /*#__PURE__*/jsx(
|
|
459
|
-
iconPosition: iconPosition,
|
|
605
|
+
return /*#__PURE__*/jsx(StyledIconContainer, {
|
|
606
|
+
$iconPosition: iconPosition,
|
|
460
607
|
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
461
608
|
icon: icon,
|
|
462
609
|
spin: spin,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
testID: testID
|
|
610
|
+
testID: testID,
|
|
611
|
+
color: color
|
|
466
612
|
})
|
|
467
613
|
});
|
|
468
614
|
}
|
|
469
615
|
|
|
470
|
-
|
|
616
|
+
var StyledChildrenWithIcon = /*#__PURE__*/styled.View.withConfig({
|
|
617
|
+
displayName: "ButtonContent__StyledChildrenWithIcon"
|
|
618
|
+
})(["align-items:center;justify-content:center;flex-direction:row;"]);
|
|
619
|
+
function ButtonContentChildren(_ref4) {
|
|
471
620
|
var type = _ref4.type,
|
|
472
|
-
isPressed = _ref4.isPressed,
|
|
473
|
-
stretch = _ref4.stretch,
|
|
474
621
|
icon = _ref4.icon,
|
|
475
622
|
iconPosition = _ref4.iconPosition,
|
|
476
623
|
iconSpin = _ref4.iconSpin,
|
|
477
|
-
|
|
624
|
+
isDisabled = _ref4.isDisabled,
|
|
625
|
+
color = _ref4.color,
|
|
478
626
|
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
627
|
|
|
487
628
|
if ((process.env.NODE_ENV !== "production")) {
|
|
488
629
|
if (!(children || icon)) {
|
|
@@ -490,128 +631,136 @@ function ButtonContent(_ref4) {
|
|
|
490
631
|
}
|
|
491
632
|
}
|
|
492
633
|
|
|
634
|
+
var isWebSubtle = isSubtle(type) && Platform.OS === 'web' && !isDisabled;
|
|
635
|
+
|
|
493
636
|
if (!children) {
|
|
494
|
-
return /*#__PURE__*/jsx(
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}))
|
|
637
|
+
return /*#__PURE__*/jsx(TypographyIcon, {
|
|
638
|
+
spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
639
|
+
,
|
|
640
|
+
icon: icon,
|
|
641
|
+
color: isWebSubtle ? 'inherit' : color
|
|
500
642
|
});
|
|
501
643
|
}
|
|
502
644
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
645
|
+
var buttonIconSharedProps = {
|
|
646
|
+
type: type,
|
|
647
|
+
spin: iconSpin,
|
|
648
|
+
iconPosition: iconPosition,
|
|
649
|
+
color: isWebSubtle ? 'inherit' : color
|
|
650
|
+
};
|
|
651
|
+
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
652
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$e(_objectSpread$e({}, buttonIconSharedProps), {}, {
|
|
653
|
+
testID: "button-left-icon",
|
|
654
|
+
icon: icon
|
|
655
|
+
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
510
656
|
base: "body",
|
|
511
|
-
color: color,
|
|
512
657
|
variant: "bold",
|
|
658
|
+
$type: type,
|
|
659
|
+
$isDisabled: isDisabled // set to color: inherit via styled components
|
|
660
|
+
,
|
|
661
|
+
color: isWebSubtle ? undefined : color,
|
|
513
662
|
children: children
|
|
514
|
-
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
515
|
-
icon: icon
|
|
516
|
-
iconPosition: iconPosition
|
|
663
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$e(_objectSpread$e({}, buttonIconSharedProps), {}, {
|
|
664
|
+
icon: icon
|
|
517
665
|
})) : null]
|
|
518
666
|
});
|
|
519
667
|
}
|
|
668
|
+
var ButtonContentContainer = /*#__PURE__*/styled.View.withConfig({
|
|
669
|
+
displayName: "ButtonContent__ButtonContentContainer"
|
|
670
|
+
})(["line-height:16px;", " ", ";"], function (_ref5) {
|
|
671
|
+
var $isStretch = _ref5.$isStretch,
|
|
672
|
+
$isIconOnly = _ref5.$isIconOnly;
|
|
673
|
+
// Make the multilines case work properly on web
|
|
674
|
+
// Breaks the native implem
|
|
675
|
+
if (Platform.OS !== 'web') return undefined;
|
|
676
|
+
return "\n flex: ".concat($isStretch || $isIconOnly ? 1 : 0, " 1 auto;\n ");
|
|
677
|
+
}, function (_ref6) {
|
|
678
|
+
var $isSubtle = _ref6.$isSubtle;
|
|
679
|
+
if (Platform.OS !== 'web' || !$isSubtle) return undefined; // Needed for subtle type
|
|
520
680
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
681
|
+
return 'color: inherit';
|
|
682
|
+
});
|
|
683
|
+
function ButtonContent(_ref7) {
|
|
684
|
+
var type = _ref7.type,
|
|
685
|
+
isDisabled = _ref7.isDisabled,
|
|
686
|
+
$isStretch = _ref7.$isStretch,
|
|
687
|
+
icon = _ref7.icon,
|
|
688
|
+
children = _ref7.children,
|
|
689
|
+
props = _objectWithoutProperties(_ref7, _excluded$a);
|
|
690
|
+
|
|
691
|
+
var color = isDisabled ? 'black-light' : getTextColorByType(type);
|
|
692
|
+
return /*#__PURE__*/jsx(ButtonContentContainer, {
|
|
693
|
+
$isSubtle: isSubtle(type),
|
|
694
|
+
$isStretch: $isStretch,
|
|
695
|
+
$isIconOnly: Boolean(!children && icon),
|
|
696
|
+
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$e(_objectSpread$e({
|
|
697
|
+
icon: icon,
|
|
698
|
+
type: type,
|
|
699
|
+
isDisabled: isDisabled,
|
|
700
|
+
color: color
|
|
701
|
+
}, props), {}, {
|
|
702
|
+
children: children
|
|
703
|
+
}))
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
|
|
708
|
+
displayName: "StyledDisabled"
|
|
709
|
+
})(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", ";"], function (_ref) {
|
|
524
710
|
var theme = _ref.theme;
|
|
525
|
-
|
|
711
|
+
var _theme$kitt$button = theme.kitt.button,
|
|
712
|
+
borderWidth = _theme$kitt$button.borderWidth,
|
|
713
|
+
disabled = _theme$kitt$button.disabled;
|
|
714
|
+
return "".concat(borderWidth.disabled, " solid ").concat(disabled.borderColor);
|
|
526
715
|
}, 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;
|
|
716
|
+
var theme = _ref2.theme;
|
|
552
717
|
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
718
|
});
|
|
562
719
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
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; }
|
|
566
|
-
function Button(_ref) {
|
|
720
|
+
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
567
721
|
var children = _ref.children,
|
|
568
722
|
_ref$type = _ref.type,
|
|
569
|
-
type = _ref$type === void 0 ? '
|
|
723
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
724
|
+
disabled = _ref.disabled,
|
|
725
|
+
stretch = _ref.stretch,
|
|
726
|
+
large = _ref.large,
|
|
570
727
|
icon = _ref.icon,
|
|
571
728
|
_ref$iconPosition = _ref.iconPosition,
|
|
572
729
|
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
573
730
|
iconSpin = _ref.iconSpin,
|
|
574
|
-
stretch = _ref.stretch,
|
|
575
|
-
disabled = _ref.disabled,
|
|
576
731
|
testID = _ref.testID,
|
|
577
732
|
href = _ref.href,
|
|
578
733
|
hrefAttrs = _ref.hrefAttrs,
|
|
734
|
+
_ref$accessibilityRol = _ref.accessibilityRole,
|
|
735
|
+
accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
|
|
579
736
|
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$e(_objectSpread$e({}, sharedProps), {}, {
|
|
595
|
-
isPressed: isPressed,
|
|
596
|
-
accessibilityRole: "button",
|
|
737
|
+
return /*#__PURE__*/jsx(AnimatedButtonPressable, {
|
|
738
|
+
ref: ref,
|
|
739
|
+
accessibilityRole: accessibilityRole,
|
|
597
740
|
testID: testID,
|
|
598
741
|
href: href,
|
|
599
742
|
hrefAttrs: hrefAttrs,
|
|
743
|
+
disabled: disabled,
|
|
744
|
+
$isStretch: stretch,
|
|
745
|
+
$type: type,
|
|
600
746
|
onPress: onPress,
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
747
|
+
children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
|
|
748
|
+
$type: type,
|
|
749
|
+
$isStretch: stretch,
|
|
750
|
+
$isLarge: large,
|
|
751
|
+
$isDisabled: disabled,
|
|
752
|
+
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
753
|
+
type: type,
|
|
754
|
+
$isStretch: stretch,
|
|
755
|
+
isDisabled: disabled,
|
|
756
|
+
icon: icon,
|
|
757
|
+
iconPosition: iconPosition,
|
|
758
|
+
iconSpin: iconSpin,
|
|
759
|
+
children: children
|
|
760
|
+
}), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
|
|
761
|
+
})
|
|
762
|
+
});
|
|
763
|
+
});
|
|
615
764
|
|
|
616
765
|
var Container$6 = /*#__PURE__*/styled.View.withConfig({
|
|
617
766
|
displayName: "Card__Container"
|
|
@@ -1276,8 +1425,7 @@ function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
1276
1425
|
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
1277
1426
|
// };
|
|
1278
1427
|
// }
|
|
1279
|
-
function withTheme(
|
|
1280
|
-
WrappedComponent) {
|
|
1428
|
+
function withTheme(WrappedComponent) {
|
|
1281
1429
|
return function (props) {
|
|
1282
1430
|
var theme = /*#__PURE__*/useTheme();
|
|
1283
1431
|
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$9({
|
|
@@ -1291,7 +1439,7 @@ var _excluded$6 = ["color"];
|
|
|
1291
1439
|
function ownKeys$8(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; }
|
|
1292
1440
|
|
|
1293
1441
|
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$8(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1294
|
-
var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/
|
|
1442
|
+
var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled$1("div")({
|
|
1295
1443
|
name: "PressableIconButtonWebWrapper",
|
|
1296
1444
|
"class": "p1nlccvg",
|
|
1297
1445
|
vars: {
|
|
@@ -1404,7 +1552,7 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1404
1552
|
};
|
|
1405
1553
|
_f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
|
|
1406
1554
|
_f.__workletHash = 10645190329247;
|
|
1407
|
-
_f.__location = "/home/
|
|
1555
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (54:41)";
|
|
1408
1556
|
_f.__optimalization = 2;
|
|
1409
1557
|
|
|
1410
1558
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -1438,7 +1586,7 @@ function PressableAnimatedContainer(_ref5) {
|
|
|
1438
1586
|
};
|
|
1439
1587
|
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{transform:[{scale:withSpring(pressed.value?theme.kitt.iconButton.scale.base.active:theme.kitt.iconButton.scale.base.default)}]};}}";
|
|
1440
1588
|
_f.__workletHash = 13861998831411;
|
|
1441
|
-
_f.__location = "/home/
|
|
1589
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:39)";
|
|
1442
1590
|
_f.__optimalization = 2;
|
|
1443
1591
|
|
|
1444
1592
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -2428,47 +2576,98 @@ var avatarLateOceanTheme = {
|
|
|
2428
2576
|
}
|
|
2429
2577
|
};
|
|
2430
2578
|
|
|
2579
|
+
var colorsLateOceanTheme = {
|
|
2580
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
2581
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2582
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
2583
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2584
|
+
success: lateOceanColorPalette.viride,
|
|
2585
|
+
correct: lateOceanColorPalette.viride,
|
|
2586
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
2587
|
+
separator: lateOceanColorPalette.black100,
|
|
2588
|
+
hover: lateOceanColorPalette.black100,
|
|
2589
|
+
black: lateOceanColorPalette.black1000,
|
|
2590
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
2591
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2592
|
+
transparent: lateOceanColorPalette.transparent,
|
|
2593
|
+
disabled: lateOceanColorPalette.black50,
|
|
2594
|
+
overlay: {
|
|
2595
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2596
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
2597
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2598
|
+
}
|
|
2599
|
+
};
|
|
2600
|
+
|
|
2431
2601
|
var buttonLateOceanTheme = {
|
|
2432
2602
|
borderRadius: '30px',
|
|
2433
|
-
borderWidth:
|
|
2434
|
-
|
|
2603
|
+
borderWidth: {
|
|
2604
|
+
disabled: '2px',
|
|
2605
|
+
focus: '3px'
|
|
2606
|
+
},
|
|
2607
|
+
minHeight: '40px',
|
|
2435
2608
|
minWidth: '40px',
|
|
2436
2609
|
maxWidth: '335px',
|
|
2437
|
-
|
|
2610
|
+
scale: {
|
|
2611
|
+
base: {
|
|
2612
|
+
"default": 1,
|
|
2613
|
+
hover: 0.95,
|
|
2614
|
+
active: 0.95
|
|
2615
|
+
},
|
|
2616
|
+
medium: {
|
|
2617
|
+
hover: 1.05
|
|
2618
|
+
}
|
|
2619
|
+
},
|
|
2438
2620
|
contentPadding: {
|
|
2439
|
-
"default": '8px 16px'
|
|
2621
|
+
"default": '8px 16px 7px',
|
|
2622
|
+
large: '12px 24px 11px',
|
|
2623
|
+
disabled: '6px 14px 5px'
|
|
2440
2624
|
},
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
|
|
2445
|
-
disabledBorderColor: lateOceanColorPalette.black100
|
|
2625
|
+
transition: {
|
|
2626
|
+
duration: '200ms',
|
|
2627
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2446
2628
|
},
|
|
2447
|
-
|
|
2629
|
+
"default": {
|
|
2448
2630
|
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2449
|
-
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
2450
2631
|
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
subtle: {
|
|
2454
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
2455
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2456
|
-
pressedBackgroundColor: lateOceanColorPalette.transparent,
|
|
2457
|
-
disabledBorderColor: lateOceanColorPalette.transparent
|
|
2632
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2633
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2458
2634
|
},
|
|
2459
|
-
|
|
2460
|
-
backgroundColor:
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2635
|
+
primary: {
|
|
2636
|
+
backgroundColor: colorsLateOceanTheme.primary,
|
|
2637
|
+
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2638
|
+
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2639
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2464
2640
|
},
|
|
2465
2641
|
white: {
|
|
2466
2642
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2467
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2468
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2469
2643
|
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2470
|
-
|
|
2471
|
-
|
|
2644
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2645
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2646
|
+
},
|
|
2647
|
+
subtle: {
|
|
2648
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2649
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2650
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2651
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2652
|
+
color: colorsLateOceanTheme.primary,
|
|
2653
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2654
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2655
|
+
},
|
|
2656
|
+
'subtle-dark': {
|
|
2657
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2658
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2659
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2660
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2661
|
+
color: colorsLateOceanTheme.black,
|
|
2662
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2663
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2664
|
+
},
|
|
2665
|
+
disabled: {
|
|
2666
|
+
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2667
|
+
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2668
|
+
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2669
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
2670
|
+
borderColor: lateOceanColorPalette.black100
|
|
2472
2671
|
}
|
|
2473
2672
|
};
|
|
2474
2673
|
|
|
@@ -2490,26 +2689,6 @@ var cardLateOceanTheme = {
|
|
|
2490
2689
|
}
|
|
2491
2690
|
};
|
|
2492
2691
|
|
|
2493
|
-
var colorsLateOceanTheme = {
|
|
2494
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2495
|
-
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2496
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2497
|
-
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2498
|
-
success: lateOceanColorPalette.viride,
|
|
2499
|
-
correct: lateOceanColorPalette.viride,
|
|
2500
|
-
danger: lateOceanColorPalette.englishVermillon,
|
|
2501
|
-
separator: lateOceanColorPalette.black100,
|
|
2502
|
-
hover: lateOceanColorPalette.black100,
|
|
2503
|
-
black: lateOceanColorPalette.black1000,
|
|
2504
|
-
uiBackground: lateOceanColorPalette.black25,
|
|
2505
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2506
|
-
overlay: {
|
|
2507
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2508
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2509
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2510
|
-
}
|
|
2511
|
-
};
|
|
2512
|
-
|
|
2513
2692
|
var feedbackMessageLateOceanTheme = {
|
|
2514
2693
|
backgroundColors: {
|
|
2515
2694
|
success: lateOceanColorPalette.viride,
|
|
@@ -2623,11 +2802,11 @@ var iconButton = {
|
|
|
2623
2802
|
},
|
|
2624
2803
|
disabled: {
|
|
2625
2804
|
scale: 1,
|
|
2626
|
-
backgroundColor: buttonLateOceanTheme.
|
|
2627
|
-
borderColor: buttonLateOceanTheme.
|
|
2805
|
+
backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
|
|
2806
|
+
borderColor: buttonLateOceanTheme.disabled.borderColor
|
|
2628
2807
|
},
|
|
2629
2808
|
"default": {
|
|
2630
|
-
pressedBackgroundColor: buttonLateOceanTheme.
|
|
2809
|
+
pressedBackgroundColor: buttonLateOceanTheme["default"].pressedBackgroundColor
|
|
2631
2810
|
},
|
|
2632
2811
|
white: {
|
|
2633
2812
|
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
@@ -2793,7 +2972,7 @@ var breakpoints = {
|
|
|
2793
2972
|
wideBreakpoint: 'max-width: 1279px'
|
|
2794
2973
|
}
|
|
2795
2974
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2796
|
-
// TODO : seperate brand
|
|
2975
|
+
// TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
|
|
2797
2976
|
|
|
2798
2977
|
var theme = {
|
|
2799
2978
|
spacing: 4,
|
|
@@ -3092,7 +3271,7 @@ function Tooltip(_ref) {
|
|
|
3092
3271
|
};
|
|
3093
3272
|
_f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{opacity:withSpring(pressed.value?theme.kitt.tooltip.opacity:0)};}}";
|
|
3094
3273
|
_f.__workletHash = 15953928507970;
|
|
3095
|
-
_f.__location = "/home/
|
|
3274
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (57:41)";
|
|
3096
3275
|
_f.__optimalization = 2;
|
|
3097
3276
|
|
|
3098
3277
|
global.__reanimatedWorkletInit(_f);
|
|
@@ -3194,7 +3373,7 @@ var _excluded$1 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "
|
|
|
3194
3373
|
function ownKeys(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; }
|
|
3195
3374
|
|
|
3196
3375
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3197
|
-
var TypographyLinkWebWrapper = withTheme( /*#__PURE__*/
|
|
3376
|
+
var TypographyLinkWebWrapper = withTheme( /*#__PURE__*/styled$1("span")({
|
|
3198
3377
|
name: "TypographyLinkWebWrapper",
|
|
3199
3378
|
"class": "tcwz3nt"
|
|
3200
3379
|
}));
|
|
@@ -3226,7 +3405,7 @@ function TypographyLink(_ref4) {
|
|
|
3226
3405
|
accessibilityRole: "none",
|
|
3227
3406
|
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3228
3407
|
as: TypographyLinkWebWrapper,
|
|
3229
|
-
"data-nounderline": noUnderline,
|
|
3408
|
+
"data-nounderline": noUnderline ? true : undefined,
|
|
3230
3409
|
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3231
3410
|
$disabled: disabled,
|
|
3232
3411
|
$noUnderline: noUnderline,
|