@ornikar/kitt-universal 3.1.0 → 3.5.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/Skeleton/Skeleton.d.ts +14 -0
- package/dist/definitions/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/definitions/Skeleton/SkeletonContent.d.ts +8 -0
- package/dist/definitions/Skeleton/SkeletonContent.d.ts.map +1 -0
- package/dist/definitions/Skeleton/SkeletonContent.web.d.ts +7 -0
- package/dist/definitions/Skeleton/SkeletonContent.web.d.ts.map +1 -0
- package/dist/definitions/forms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +4 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +4 -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/themes/late-ocean/skeletonTheme.d.ts +7 -0
- package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +2 -0
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- 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/hexToRgba.d.ts +2 -0
- package/dist/definitions/utils/hexToRgba.d.ts.map +1 -0
- 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 +614 -272
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.css +2 -2
- package/dist/index-browser-all.es.ios.js +614 -272
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +654 -306
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +608 -288
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.css +2 -2
- package/dist/index-node-14.17.cjs.js +602 -226
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +4 -2
- package/dist/index-node-14.17.cjs.web.js +546 -220
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +4 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -3
- 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, withRepeat, withTiming, Easing as Easing$1, interpolate } 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 { LinearGradient } from 'expo-linear-gradient';
|
|
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$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
141
|
|
|
141
|
-
function _objectSpread$
|
|
142
|
+
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
143
|
var IsHeaderTypographyContext = /*#__PURE__*/createContext(undefined);
|
|
143
144
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
144
145
|
function useTypographyColor() {
|
|
@@ -193,34 +194,53 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
|
193
194
|
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
194
195
|
return base;
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
-
var
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
197
|
+
function getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, _ref3) {
|
|
198
|
+
var base = _ref3.base,
|
|
199
|
+
color = _ref3.color;
|
|
200
|
+
// return the props set or undefined. In case of undefined, the value will be inherited from its parents.
|
|
201
|
+
if (hasTypographyAncestor) return {
|
|
202
|
+
base: base,
|
|
203
|
+
color: color
|
|
204
|
+
};
|
|
205
|
+
return {
|
|
206
|
+
base: base !== null && base !== void 0 ? base : 'body',
|
|
207
|
+
color: color !== null && color !== void 0 ? color : 'black'
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function Typography(_ref4) {
|
|
211
|
+
var accessibilityRole = _ref4.accessibilityRole,
|
|
212
|
+
base = _ref4.base,
|
|
213
|
+
small = _ref4.small,
|
|
214
|
+
medium = _ref4.medium,
|
|
215
|
+
large = _ref4.large,
|
|
216
|
+
variant = _ref4.variant,
|
|
217
|
+
color = _ref4.color,
|
|
218
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded$d);
|
|
205
219
|
|
|
206
220
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
207
|
-
var
|
|
208
|
-
|
|
209
|
-
var
|
|
210
|
-
|
|
221
|
+
var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
222
|
+
|
|
223
|
+
var _getTypographyInherit = getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
|
|
224
|
+
base: base,
|
|
225
|
+
color: color
|
|
226
|
+
}),
|
|
227
|
+
baseOrDefaultToBody = _getTypographyInherit.base,
|
|
228
|
+
colorOrDefaultToBlack = _getTypographyInherit.color;
|
|
211
229
|
|
|
212
|
-
var
|
|
213
|
-
var
|
|
230
|
+
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(baseOrDefaultToBody, small, medium, large);
|
|
231
|
+
var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
232
|
+
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular';
|
|
233
|
+
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
214
234
|
value: isHeader,
|
|
215
|
-
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
216
|
-
$color:
|
|
235
|
+
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
236
|
+
$color: colorOrDefaultToBlack,
|
|
217
237
|
$isHeader: isHeader,
|
|
218
238
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
219
239
|
$variant: nonNullableVariant,
|
|
220
240
|
accessibilityRole: accessibilityRole || undefined
|
|
221
241
|
}, otherProps))
|
|
222
|
-
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$
|
|
223
|
-
$color:
|
|
242
|
+
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
243
|
+
$color: colorOrDefaultToBlack,
|
|
224
244
|
$isHeader: isHeader,
|
|
225
245
|
$variant: nonNullableVariant,
|
|
226
246
|
accessibilityRole: accessibilityRole || undefined
|
|
@@ -232,13 +252,13 @@ function Typography(_ref3) {
|
|
|
232
252
|
}
|
|
233
253
|
|
|
234
254
|
function TypographyText(props) {
|
|
235
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
255
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$g({
|
|
236
256
|
accessibilityRole: null
|
|
237
257
|
}, props));
|
|
238
258
|
}
|
|
239
259
|
|
|
240
260
|
function TypographyParagraph(props) {
|
|
241
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
261
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$g({
|
|
242
262
|
accessibilityRole: "paragraph"
|
|
243
263
|
}, props));
|
|
244
264
|
}
|
|
@@ -246,7 +266,7 @@ function TypographyParagraph(props) {
|
|
|
246
266
|
var createHeading = function (level, defaultBase) {
|
|
247
267
|
// https://github.com/necolas/react-native-web/issues/401
|
|
248
268
|
function TypographyHeading(props) {
|
|
249
|
-
return /*#__PURE__*/jsx(Typography, _objectSpread$
|
|
269
|
+
return /*#__PURE__*/jsx(Typography, _objectSpread$g(_objectSpread$g({
|
|
250
270
|
accessibilityRole: "header",
|
|
251
271
|
base: defaultBase
|
|
252
272
|
}, props), {}, {
|
|
@@ -282,11 +302,11 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
282
302
|
|
|
283
303
|
Typography.h5 = createHeading(5, 'header5');
|
|
284
304
|
|
|
285
|
-
var _excluded$
|
|
305
|
+
var _excluded$c = ["size"];
|
|
286
306
|
|
|
287
|
-
function ownKeys$
|
|
307
|
+
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
308
|
|
|
289
|
-
function _objectSpread$
|
|
309
|
+
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
310
|
|
|
291
311
|
var getFirstCharacter = function (string) {
|
|
292
312
|
return string ? string[0] : '';
|
|
@@ -353,95 +373,242 @@ function AvatarContent(_ref5) {
|
|
|
353
373
|
function Avatar(_ref6) {
|
|
354
374
|
var _ref6$size = _ref6.size,
|
|
355
375
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
356
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
376
|
+
rest = _objectWithoutProperties(_ref6, _excluded$c);
|
|
357
377
|
|
|
358
|
-
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$
|
|
378
|
+
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$f(_objectSpread$f({}, rest), {}, {
|
|
359
379
|
size: size,
|
|
360
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$
|
|
380
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$f(_objectSpread$f({}, rest), {}, {
|
|
361
381
|
size: size
|
|
362
382
|
}))
|
|
363
383
|
}));
|
|
364
384
|
}
|
|
365
385
|
|
|
366
|
-
var
|
|
367
|
-
|
|
386
|
+
var StyledPressable = /*#__PURE__*/styled.Pressable.withConfig({
|
|
387
|
+
displayName: "AnimatedButtonPressable__StyledPressable"
|
|
388
|
+
})(["", ""], function (_ref) {
|
|
389
|
+
var $isStretch = _ref.$isStretch;
|
|
390
|
+
if ($isStretch) return undefined;
|
|
391
|
+
return 'align-self: flex-start;';
|
|
392
|
+
});
|
|
393
|
+
var StyledAnimatedView = /*#__PURE__*/styled(Animated$1.View).withConfig({
|
|
394
|
+
displayName: "AnimatedButtonPressable__StyledAnimatedView"
|
|
395
|
+
})(["border-radius:", ";"], function (_ref2) {
|
|
396
|
+
var theme = _ref2.theme;
|
|
397
|
+
return theme.kitt.button.borderRadius;
|
|
398
|
+
});
|
|
399
|
+
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
400
|
+
var children = _ref3.children,
|
|
401
|
+
disabled = _ref3.disabled,
|
|
402
|
+
accessibilityRole = _ref3.accessibilityRole,
|
|
403
|
+
$type = _ref3.$type,
|
|
404
|
+
$isStretch = _ref3.$isStretch,
|
|
405
|
+
href = _ref3.href,
|
|
406
|
+
hrefAttrs = _ref3.hrefAttrs,
|
|
407
|
+
testID = _ref3.testID,
|
|
408
|
+
onPress = _ref3.onPress;
|
|
409
|
+
var theme = /*#__PURE__*/useTheme();
|
|
410
|
+
var pressed = useSharedValue(0);
|
|
411
|
+
var color = useSharedValue(0);
|
|
412
|
+
var _theme$kitt$button$$t = theme.kitt.button[$type],
|
|
413
|
+
backgroundColor = _theme$kitt$button$$t.backgroundColor,
|
|
414
|
+
pressedBackgroundColor = _theme$kitt$button$$t.pressedBackgroundColor;
|
|
415
|
+
var scale = theme.kitt.button.scale;
|
|
416
|
+
var scaleStyles = useAnimatedStyle(function () {
|
|
417
|
+
var _f = function () {
|
|
418
|
+
return {
|
|
419
|
+
backgroundColor: interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
|
|
420
|
+
transform: [{
|
|
421
|
+
scale: withSpring(pressed.value ? scale.base.active : scale.base["default"])
|
|
422
|
+
}]
|
|
423
|
+
};
|
|
424
|
+
};
|
|
368
425
|
|
|
369
|
-
|
|
426
|
+
_f._closure = {
|
|
427
|
+
interpolateColor: interpolateColor,
|
|
428
|
+
color: color,
|
|
429
|
+
backgroundColor: backgroundColor,
|
|
430
|
+
pressedBackgroundColor: pressedBackgroundColor,
|
|
431
|
+
withSpring: withSpring,
|
|
432
|
+
pressed: pressed,
|
|
433
|
+
scale: {
|
|
434
|
+
base: {
|
|
435
|
+
active: scale.base.active,
|
|
436
|
+
"default": scale.base["default"]
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
_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)}]};}}";
|
|
441
|
+
_f.__workletHash = 5368461229978;
|
|
442
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (53:41)";
|
|
443
|
+
_f.__optimalization = 2;
|
|
370
444
|
|
|
371
|
-
|
|
445
|
+
global.__reanimatedWorkletInit(_f);
|
|
372
446
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
color:
|
|
378
|
-
|
|
379
|
-
}
|
|
447
|
+
return _f;
|
|
448
|
+
}());
|
|
449
|
+
|
|
450
|
+
var handlePressInOut = function (pressIn) {
|
|
451
|
+
color.value = withSpring(pressIn ? 1 : 0);
|
|
452
|
+
pressed.value = pressIn ? 1 : 0;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
return /*#__PURE__*/jsx(StyledPressable, {
|
|
456
|
+
ref: ref,
|
|
457
|
+
disabled: disabled,
|
|
458
|
+
accessibilityRole: accessibilityRole,
|
|
459
|
+
testID: testID,
|
|
460
|
+
href: href,
|
|
461
|
+
hrefAttrs: hrefAttrs,
|
|
462
|
+
$isStretch: $isStretch,
|
|
463
|
+
$type: $type,
|
|
464
|
+
onPress: onPress,
|
|
465
|
+
onPressIn: function onPressIn() {
|
|
466
|
+
handlePressInOut(true);
|
|
467
|
+
},
|
|
468
|
+
onPressOut: function onPressOut() {
|
|
469
|
+
handlePressInOut(false);
|
|
470
|
+
},
|
|
471
|
+
children: /*#__PURE__*/jsx(StyledAnimatedView, {
|
|
472
|
+
style: disabled ? [{
|
|
473
|
+
transform: [{
|
|
474
|
+
scale: 1
|
|
475
|
+
}]
|
|
476
|
+
}] : [scaleStyles],
|
|
477
|
+
children: children
|
|
478
|
+
})
|
|
479
|
+
});
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
var BaseStyledButtonPressable = /*#__PURE__*/styled.View.withConfig({
|
|
483
|
+
displayName: "BaseStyledButtonPressable"
|
|
484
|
+
})(["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) {
|
|
485
|
+
var theme = _ref.theme;
|
|
486
|
+
return theme.kitt.button.minWidth;
|
|
487
|
+
}, function (_ref2) {
|
|
488
|
+
var theme = _ref2.theme,
|
|
489
|
+
$isStretch = _ref2.$isStretch;
|
|
490
|
+
return $isStretch ? '100%' : theme.kitt.button.maxWidth;
|
|
491
|
+
}, function (_ref3) {
|
|
492
|
+
var $isStretch = _ref3.$isStretch;
|
|
493
|
+
return $isStretch ? '100%' : 'auto';
|
|
494
|
+
}, function (_ref4) {
|
|
495
|
+
var theme = _ref4.theme;
|
|
496
|
+
return theme.kitt.button.minHeight;
|
|
497
|
+
}, function (_ref5) {
|
|
498
|
+
var theme = _ref5.theme;
|
|
499
|
+
return theme.kitt.button.borderRadius;
|
|
500
|
+
}, function (_ref6) {
|
|
501
|
+
var theme = _ref6.theme,
|
|
502
|
+
$isDisabled = _ref6.$isDisabled,
|
|
503
|
+
$type = _ref6.$type;
|
|
504
|
+
if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
|
|
505
|
+
if (Platform.OS !== 'web') return 'transparent';
|
|
506
|
+
return theme.kitt.button[$type].backgroundColor;
|
|
507
|
+
}, function (_ref7) {
|
|
508
|
+
var theme = _ref7.theme,
|
|
509
|
+
$isLarge = _ref7.$isLarge,
|
|
510
|
+
$isDisabled = _ref7.$isDisabled;
|
|
511
|
+
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
512
|
+
large = _theme$kitt$button$co.large,
|
|
513
|
+
defaultPadding = _theme$kitt$button$co["default"],
|
|
514
|
+
disabledPadding = _theme$kitt$button$co.disabled;
|
|
515
|
+
if ($isLarge) return large;
|
|
516
|
+
if ($isDisabled) return disabledPadding;
|
|
517
|
+
return defaultPadding;
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
var _excluded$b = ["color"],
|
|
521
|
+
_excluded2$2 = ["color"];
|
|
522
|
+
|
|
523
|
+
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; }
|
|
524
|
+
|
|
525
|
+
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
526
|
|
|
381
527
|
function TypographyIconSpecifiedColor(_ref) {
|
|
382
528
|
var color = _ref.color,
|
|
383
|
-
|
|
529
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
384
530
|
|
|
385
531
|
var theme = /*#__PURE__*/useTheme();
|
|
386
|
-
return /*#__PURE__*/jsx(Icon, _objectSpread$
|
|
387
|
-
color: theme.kitt.typography.colors[color]
|
|
532
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$e(_objectSpread$e({}, props), {}, {
|
|
533
|
+
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
388
534
|
}));
|
|
389
535
|
}
|
|
390
536
|
|
|
537
|
+
function TypographyIconInheritColor(props) {
|
|
538
|
+
var color = useTypographyColor();
|
|
539
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$e({
|
|
540
|
+
color: color
|
|
541
|
+
}, props));
|
|
542
|
+
}
|
|
543
|
+
|
|
391
544
|
function TypographyIcon(_ref2) {
|
|
392
545
|
var color = _ref2.color,
|
|
393
|
-
|
|
546
|
+
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
394
547
|
|
|
395
548
|
if (color) {
|
|
396
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
549
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$e({
|
|
397
550
|
color: color
|
|
398
|
-
},
|
|
551
|
+
}, props));
|
|
399
552
|
}
|
|
400
553
|
|
|
401
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
554
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$e({}, props));
|
|
402
555
|
}
|
|
403
556
|
|
|
404
|
-
function
|
|
557
|
+
function isSubtle(type) {
|
|
558
|
+
return type.startsWith('subtle');
|
|
559
|
+
}
|
|
405
560
|
|
|
406
|
-
|
|
561
|
+
var _excluded$a = ["type", "isDisabled", "$isStretch", "icon", "children"];
|
|
562
|
+
|
|
563
|
+
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; }
|
|
407
564
|
|
|
408
|
-
var
|
|
409
|
-
if (disabled) return 'black-light';
|
|
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; }
|
|
410
566
|
|
|
567
|
+
var getTextColorByType = function (type) {
|
|
411
568
|
switch (type) {
|
|
412
569
|
case 'primary':
|
|
413
570
|
return 'white';
|
|
414
571
|
|
|
572
|
+
case 'white':
|
|
573
|
+
return 'white';
|
|
574
|
+
|
|
415
575
|
case 'subtle':
|
|
416
|
-
return
|
|
576
|
+
return 'primary';
|
|
417
577
|
|
|
418
578
|
case 'subtle-dark':
|
|
419
|
-
return
|
|
579
|
+
return 'black';
|
|
420
580
|
|
|
421
|
-
case 'secondary':
|
|
422
581
|
default:
|
|
423
582
|
return 'black';
|
|
424
583
|
}
|
|
425
584
|
};
|
|
426
585
|
|
|
427
|
-
var
|
|
428
|
-
displayName: "
|
|
429
|
-
})(["text-align:center;"])
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
586
|
+
var StyledButtonText = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
587
|
+
displayName: "ButtonContent__StyledButtonText"
|
|
588
|
+
})(["text-align:center;", " ", ""], function () {
|
|
589
|
+
// Make the multilines case work properly on native
|
|
590
|
+
// Breaks the web implem
|
|
591
|
+
if (Platform.OS === 'web') return undefined;
|
|
592
|
+
return "\n flex-shrink: 1;\n ";
|
|
593
|
+
}, function (_ref) {
|
|
594
|
+
var $type = _ref.$type,
|
|
595
|
+
$isDisabled = _ref.$isDisabled;
|
|
596
|
+
|
|
597
|
+
/* For subltes button, color changes when hovered.
|
|
598
|
+
* We don't want to use a mouse event handler with a react state to handle it
|
|
599
|
+
* For this precise case, we've decided to work outside the typography logic
|
|
600
|
+
*/
|
|
601
|
+
if (Platform.OS !== 'web' || $isDisabled || !isSubtle($type)) return undefined;
|
|
602
|
+
return 'color: inherit';
|
|
436
603
|
});
|
|
437
|
-
var
|
|
438
|
-
displayName: "
|
|
604
|
+
var StyledIconContainer = /*#__PURE__*/styled.View.withConfig({
|
|
605
|
+
displayName: "ButtonContent__StyledIconContainer"
|
|
439
606
|
})(["", ""], function (_ref2) {
|
|
440
607
|
var theme = _ref2.theme,
|
|
441
|
-
iconPosition = _ref2
|
|
442
|
-
var value = theme.kitt.spacing *
|
|
608
|
+
$iconPosition = _ref2.$iconPosition;
|
|
609
|
+
var value = theme.kitt.spacing * 2;
|
|
443
610
|
|
|
444
|
-
if (iconPosition === 'left') {
|
|
611
|
+
if ($iconPosition === 'left') {
|
|
445
612
|
return "margin: 0 ".concat(value, "px 0 0;");
|
|
446
613
|
}
|
|
447
614
|
|
|
@@ -450,39 +617,32 @@ var IconContainer$1 = /*#__PURE__*/styled.View.withConfig({
|
|
|
450
617
|
|
|
451
618
|
function ButtonIcon(_ref3) {
|
|
452
619
|
var icon = _ref3.icon,
|
|
453
|
-
spin = _ref3.spin,
|
|
454
620
|
color = _ref3.color,
|
|
455
|
-
|
|
621
|
+
spin = _ref3.spin,
|
|
456
622
|
iconPosition = _ref3.iconPosition,
|
|
457
623
|
testID = _ref3.testID;
|
|
458
|
-
return /*#__PURE__*/jsx(
|
|
459
|
-
iconPosition: iconPosition,
|
|
624
|
+
return /*#__PURE__*/jsx(StyledIconContainer, {
|
|
625
|
+
$iconPosition: iconPosition,
|
|
460
626
|
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
461
627
|
icon: icon,
|
|
462
628
|
spin: spin,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
testID: testID
|
|
629
|
+
testID: testID,
|
|
630
|
+
color: color
|
|
466
631
|
})
|
|
467
632
|
});
|
|
468
633
|
}
|
|
469
634
|
|
|
470
|
-
|
|
635
|
+
var StyledChildrenWithIcon = /*#__PURE__*/styled.View.withConfig({
|
|
636
|
+
displayName: "ButtonContent__StyledChildrenWithIcon"
|
|
637
|
+
})(["align-items:center;justify-content:center;flex-direction:row;"]);
|
|
638
|
+
function ButtonContentChildren(_ref4) {
|
|
471
639
|
var type = _ref4.type,
|
|
472
|
-
isPressed = _ref4.isPressed,
|
|
473
|
-
stretch = _ref4.stretch,
|
|
474
640
|
icon = _ref4.icon,
|
|
475
641
|
iconPosition = _ref4.iconPosition,
|
|
476
642
|
iconSpin = _ref4.iconSpin,
|
|
477
|
-
|
|
643
|
+
isDisabled = _ref4.isDisabled,
|
|
644
|
+
color = _ref4.color,
|
|
478
645
|
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
646
|
|
|
487
647
|
if ((process.env.NODE_ENV !== "production")) {
|
|
488
648
|
if (!(children || icon)) {
|
|
@@ -490,130 +650,138 @@ function ButtonContent(_ref4) {
|
|
|
490
650
|
}
|
|
491
651
|
}
|
|
492
652
|
|
|
653
|
+
var isWebSubtle = isSubtle(type) && Platform.OS === 'web' && !isDisabled;
|
|
654
|
+
|
|
493
655
|
if (!children) {
|
|
494
|
-
return /*#__PURE__*/jsx(
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}))
|
|
656
|
+
return /*#__PURE__*/jsx(TypographyIcon, {
|
|
657
|
+
spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
658
|
+
,
|
|
659
|
+
icon: icon,
|
|
660
|
+
color: isWebSubtle ? 'inherit' : color
|
|
500
661
|
});
|
|
501
662
|
}
|
|
502
663
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
664
|
+
var buttonIconSharedProps = {
|
|
665
|
+
type: type,
|
|
666
|
+
spin: iconSpin,
|
|
667
|
+
iconPosition: iconPosition,
|
|
668
|
+
color: isWebSubtle ? 'inherit' : color
|
|
669
|
+
};
|
|
670
|
+
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
671
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$d(_objectSpread$d({}, buttonIconSharedProps), {}, {
|
|
672
|
+
testID: "button-left-icon",
|
|
673
|
+
icon: icon
|
|
674
|
+
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
510
675
|
base: "body",
|
|
511
|
-
color: color,
|
|
512
676
|
variant: "bold",
|
|
677
|
+
$type: type,
|
|
678
|
+
$isDisabled: isDisabled // set to color: inherit via styled components
|
|
679
|
+
,
|
|
680
|
+
color: isWebSubtle ? undefined : color,
|
|
513
681
|
children: children
|
|
514
|
-
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
515
|
-
icon: icon
|
|
516
|
-
iconPosition: iconPosition
|
|
682
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$d(_objectSpread$d({}, buttonIconSharedProps), {}, {
|
|
683
|
+
icon: icon
|
|
517
684
|
})) : null]
|
|
518
685
|
});
|
|
519
686
|
}
|
|
687
|
+
var ButtonContentContainer = /*#__PURE__*/styled.View.withConfig({
|
|
688
|
+
displayName: "ButtonContent__ButtonContentContainer"
|
|
689
|
+
})(["line-height:16px;", " ", ";"], function (_ref5) {
|
|
690
|
+
var $isStretch = _ref5.$isStretch,
|
|
691
|
+
$isIconOnly = _ref5.$isIconOnly;
|
|
692
|
+
// Make the multilines case work properly on web
|
|
693
|
+
// Breaks the native implem
|
|
694
|
+
if (Platform.OS !== 'web') return undefined;
|
|
695
|
+
return "\n flex: ".concat($isStretch || $isIconOnly ? 1 : 0, " 1 auto;\n ");
|
|
696
|
+
}, function (_ref6) {
|
|
697
|
+
var $isSubtle = _ref6.$isSubtle;
|
|
698
|
+
if (Platform.OS !== 'web' || !$isSubtle) return undefined; // Needed for subtle type
|
|
699
|
+
|
|
700
|
+
return 'color: inherit';
|
|
701
|
+
});
|
|
702
|
+
function ButtonContent(_ref7) {
|
|
703
|
+
var type = _ref7.type,
|
|
704
|
+
isDisabled = _ref7.isDisabled,
|
|
705
|
+
$isStretch = _ref7.$isStretch,
|
|
706
|
+
icon = _ref7.icon,
|
|
707
|
+
children = _ref7.children,
|
|
708
|
+
props = _objectWithoutProperties(_ref7, _excluded$a);
|
|
709
|
+
|
|
710
|
+
var color = isDisabled ? 'black-light' : getTextColorByType(type);
|
|
711
|
+
return /*#__PURE__*/jsx(ButtonContentContainer, {
|
|
712
|
+
$isSubtle: isSubtle(type),
|
|
713
|
+
$isStretch: $isStretch,
|
|
714
|
+
$isIconOnly: Boolean(!children && icon),
|
|
715
|
+
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$d(_objectSpread$d({
|
|
716
|
+
icon: icon,
|
|
717
|
+
type: type,
|
|
718
|
+
isDisabled: isDisabled,
|
|
719
|
+
color: color
|
|
720
|
+
}, props), {}, {
|
|
721
|
+
children: children
|
|
722
|
+
}))
|
|
723
|
+
});
|
|
724
|
+
}
|
|
520
725
|
|
|
521
|
-
var
|
|
522
|
-
displayName: "
|
|
523
|
-
})(["
|
|
726
|
+
var StyledDisabled = /*#__PURE__*/styled.View.withConfig({
|
|
727
|
+
displayName: "StyledDisabled"
|
|
728
|
+
})(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", ";"], function (_ref) {
|
|
524
729
|
var theme = _ref.theme;
|
|
525
|
-
|
|
730
|
+
var _theme$kitt$button = theme.kitt.button,
|
|
731
|
+
borderWidth = _theme$kitt$button.borderWidth,
|
|
732
|
+
disabled = _theme$kitt$button.disabled;
|
|
733
|
+
return "".concat(borderWidth.disabled, " solid ").concat(disabled.borderColor);
|
|
526
734
|
}, 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;
|
|
735
|
+
var theme = _ref2.theme;
|
|
552
736
|
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
737
|
});
|
|
562
738
|
|
|
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) {
|
|
739
|
+
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
567
740
|
var children = _ref.children,
|
|
568
741
|
_ref$type = _ref.type,
|
|
569
|
-
type = _ref$type === void 0 ? '
|
|
742
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
743
|
+
disabled = _ref.disabled,
|
|
744
|
+
stretch = _ref.stretch,
|
|
745
|
+
large = _ref.large,
|
|
570
746
|
icon = _ref.icon,
|
|
571
747
|
_ref$iconPosition = _ref.iconPosition,
|
|
572
748
|
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
573
749
|
iconSpin = _ref.iconSpin,
|
|
574
|
-
stretch = _ref.stretch,
|
|
575
|
-
disabled = _ref.disabled,
|
|
576
750
|
testID = _ref.testID,
|
|
577
751
|
href = _ref.href,
|
|
578
752
|
hrefAttrs = _ref.hrefAttrs,
|
|
753
|
+
_ref$accessibilityRol = _ref.accessibilityRole,
|
|
754
|
+
accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
|
|
579
755
|
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",
|
|
756
|
+
return /*#__PURE__*/jsx(AnimatedButtonPressable, {
|
|
757
|
+
ref: ref,
|
|
758
|
+
accessibilityRole: accessibilityRole,
|
|
597
759
|
testID: testID,
|
|
598
760
|
href: href,
|
|
599
761
|
hrefAttrs: hrefAttrs,
|
|
762
|
+
disabled: disabled,
|
|
763
|
+
$isStretch: stretch,
|
|
764
|
+
$type: type,
|
|
600
765
|
onPress: onPress,
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
766
|
+
children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
|
|
767
|
+
$type: type,
|
|
768
|
+
$isStretch: stretch,
|
|
769
|
+
$isLarge: large,
|
|
770
|
+
$isDisabled: disabled,
|
|
771
|
+
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
772
|
+
type: type,
|
|
773
|
+
$isStretch: stretch,
|
|
774
|
+
isDisabled: disabled,
|
|
775
|
+
icon: icon,
|
|
776
|
+
iconPosition: iconPosition,
|
|
777
|
+
iconSpin: iconSpin,
|
|
778
|
+
children: children
|
|
779
|
+
}), Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsx(StyledDisabled, {}) : null]
|
|
780
|
+
})
|
|
781
|
+
});
|
|
782
|
+
});
|
|
615
783
|
|
|
616
|
-
var Container$
|
|
784
|
+
var Container$7 = /*#__PURE__*/styled.View.withConfig({
|
|
617
785
|
displayName: "Card__Container"
|
|
618
786
|
})(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], function (_ref) {
|
|
619
787
|
var theme = _ref.theme,
|
|
@@ -636,7 +804,7 @@ var Container$6 = /*#__PURE__*/styled.View.withConfig({
|
|
|
636
804
|
function Card(_ref6) {
|
|
637
805
|
var children = _ref6.children,
|
|
638
806
|
type = _ref6.type;
|
|
639
|
-
return /*#__PURE__*/jsx(Container$
|
|
807
|
+
return /*#__PURE__*/jsx(Container$7, {
|
|
640
808
|
type: type,
|
|
641
809
|
children: children
|
|
642
810
|
});
|
|
@@ -859,7 +1027,7 @@ var Input = /*#__PURE__*/styled(TextInput).withConfig({
|
|
|
859
1027
|
var minHeight = _ref10.minHeight;
|
|
860
1028
|
return minHeight;
|
|
861
1029
|
});
|
|
862
|
-
var Container$
|
|
1030
|
+
var Container$6 = /*#__PURE__*/styled.View.withConfig({
|
|
863
1031
|
displayName: "InputText__Container"
|
|
864
1032
|
})(["margin-top:", ";margin-bottom:", ";"], function (_ref11) {
|
|
865
1033
|
var theme = _ref11.theme;
|
|
@@ -935,7 +1103,7 @@ var InputText = /*#__PURE__*/forwardRef(function (_ref15, ref) {
|
|
|
935
1103
|
isDisabled: disabled,
|
|
936
1104
|
formState: formState
|
|
937
1105
|
});
|
|
938
|
-
return /*#__PURE__*/jsxs(Container$
|
|
1106
|
+
return /*#__PURE__*/jsxs(Container$6, {
|
|
939
1107
|
children: [/*#__PURE__*/jsx(Input, _objectSpread$b(_objectSpread$b({
|
|
940
1108
|
ref: ref,
|
|
941
1109
|
nativeID: id,
|
|
@@ -1035,7 +1203,7 @@ var SelectedInnerRadio = /*#__PURE__*/styled.View.withConfig({
|
|
|
1035
1203
|
var theme = _ref14.theme;
|
|
1036
1204
|
return theme.kitt.forms.radio.checked.innerSize / 2;
|
|
1037
1205
|
});
|
|
1038
|
-
var Container$
|
|
1206
|
+
var Container$5 = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1039
1207
|
displayName: "Radio__Container"
|
|
1040
1208
|
})(["flex-direction:row;align-items:center;"]);
|
|
1041
1209
|
var Text = /*#__PURE__*/styled(Typography.Text).withConfig({
|
|
@@ -1052,7 +1220,7 @@ function Radio(_ref16) {
|
|
|
1052
1220
|
_ref16$disabled = _ref16.disabled,
|
|
1053
1221
|
disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
|
|
1054
1222
|
children = _ref16.children;
|
|
1055
|
-
return /*#__PURE__*/jsxs(Container$
|
|
1223
|
+
return /*#__PURE__*/jsxs(Container$5, {
|
|
1056
1224
|
nativeID: id,
|
|
1057
1225
|
disabled: disabled,
|
|
1058
1226
|
accessibilityRole: "radio",
|
|
@@ -1081,7 +1249,8 @@ function TextArea(_ref) {
|
|
|
1081
1249
|
|
|
1082
1250
|
var theme = /*#__PURE__*/useTheme();
|
|
1083
1251
|
return /*#__PURE__*/jsx(InputText, _objectSpread$a(_objectSpread$a({
|
|
1084
|
-
multiline: true
|
|
1252
|
+
multiline: true,
|
|
1253
|
+
textAlignVertical: "top"
|
|
1085
1254
|
}, props), {}, {
|
|
1086
1255
|
type: "text",
|
|
1087
1256
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
@@ -1231,7 +1400,7 @@ function FullScreenModalHeader(_ref6) {
|
|
|
1231
1400
|
});
|
|
1232
1401
|
}
|
|
1233
1402
|
|
|
1234
|
-
var Container$
|
|
1403
|
+
var Container$4 = /*#__PURE__*/styled.View.withConfig({
|
|
1235
1404
|
displayName: "FullScreenModal__Container"
|
|
1236
1405
|
})(["flex:1;background-color:", ";"], function (_ref) {
|
|
1237
1406
|
var theme = _ref.theme;
|
|
@@ -1239,7 +1408,7 @@ var Container$3 = /*#__PURE__*/styled.View.withConfig({
|
|
|
1239
1408
|
});
|
|
1240
1409
|
function FullScreenModal(_ref2) {
|
|
1241
1410
|
var children = _ref2.children;
|
|
1242
|
-
return /*#__PURE__*/jsx(Container$
|
|
1411
|
+
return /*#__PURE__*/jsx(Container$4, {
|
|
1243
1412
|
children: children
|
|
1244
1413
|
});
|
|
1245
1414
|
}
|
|
@@ -1303,7 +1472,7 @@ function PressableIconButton(_ref5) {
|
|
|
1303
1472
|
|
|
1304
1473
|
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1305
1474
|
as: PressableIconButtonWebWrapper,
|
|
1306
|
-
|
|
1475
|
+
$isWhite: color === 'white',
|
|
1307
1476
|
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$8({}, props))
|
|
1308
1477
|
});
|
|
1309
1478
|
}
|
|
@@ -1639,7 +1808,7 @@ function LargeLoader(_ref) {
|
|
|
1639
1808
|
|
|
1640
1809
|
var xIconSize = 14;
|
|
1641
1810
|
var mainIconSize = 20;
|
|
1642
|
-
var Container$
|
|
1811
|
+
var Container$3 = /*#__PURE__*/styled.View.withConfig({
|
|
1643
1812
|
displayName: "Message__Container"
|
|
1644
1813
|
})(["border-radius:", "px;background-color:", ";padding-bottom:", "px;padding-left:", "px;padding-right:", "px;padding-top:", "px;flex-direction:row;align-items:flex-start;justify-content:space-between;"], function (_ref) {
|
|
1645
1814
|
var theme = _ref.theme,
|
|
@@ -1728,7 +1897,7 @@ function Message(_ref11) {
|
|
|
1728
1897
|
onDismiss = _ref11.onDismiss,
|
|
1729
1898
|
insets = _ref11.insets;
|
|
1730
1899
|
var color = getColorByType(type);
|
|
1731
|
-
return /*#__PURE__*/jsxs(Container$
|
|
1900
|
+
return /*#__PURE__*/jsxs(Container$3, {
|
|
1732
1901
|
type: type,
|
|
1733
1902
|
noRadius: noRadius,
|
|
1734
1903
|
insets: insets,
|
|
@@ -1932,6 +2101,127 @@ function Notification(_ref) {
|
|
|
1932
2101
|
});
|
|
1933
2102
|
}
|
|
1934
2103
|
|
|
2104
|
+
var Container$2 = /*#__PURE__*/styled.View.withConfig({
|
|
2105
|
+
displayName: "SkeletonContent__Container"
|
|
2106
|
+
})(["background-color:", ";border-color:", ";height:100%;width:100%;"], function (_ref) {
|
|
2107
|
+
var theme = _ref.theme;
|
|
2108
|
+
return theme.kitt.skeleton.backgroundColor;
|
|
2109
|
+
}, function (_ref2) {
|
|
2110
|
+
var theme = _ref2.theme;
|
|
2111
|
+
return theme.kitt.skeleton.flareColor;
|
|
2112
|
+
});
|
|
2113
|
+
var AnimatedLinearGradient = Animated$1.createAnimatedComponent(LinearGradient);
|
|
2114
|
+
function SkeletonContent(_ref3) {
|
|
2115
|
+
var isLoading = _ref3.isLoading,
|
|
2116
|
+
width = _ref3.width;
|
|
2117
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2118
|
+
var sharedX = useSharedValue(0);
|
|
2119
|
+
useEffect(function () {
|
|
2120
|
+
if (isLoading) {
|
|
2121
|
+
sharedX.value = withRepeat(withTiming(1, {
|
|
2122
|
+
duration: theme.kitt.skeleton.animationDuration,
|
|
2123
|
+
easing: Easing$1.inOut(Easing$1.ease)
|
|
2124
|
+
}), -1);
|
|
2125
|
+
}
|
|
2126
|
+
}, [sharedX, width, isLoading, theme]);
|
|
2127
|
+
var linearGradientStyle = useAnimatedStyle(function () {
|
|
2128
|
+
var _f = function () {
|
|
2129
|
+
return {
|
|
2130
|
+
transform: [{
|
|
2131
|
+
translateX: interpolate(sharedX.value, [0, 1], [-width, width])
|
|
2132
|
+
}]
|
|
2133
|
+
};
|
|
2134
|
+
};
|
|
2135
|
+
|
|
2136
|
+
_f._closure = {
|
|
2137
|
+
interpolate: interpolate,
|
|
2138
|
+
sharedX: sharedX,
|
|
2139
|
+
width: width
|
|
2140
|
+
};
|
|
2141
|
+
_f.asString = "function _f(){const{interpolate,sharedX,width}=jsThis._closure;{return{transform:[{translateX:interpolate(sharedX.value,[0,1],[-width,width])}]};}}";
|
|
2142
|
+
_f.__workletHash = 1670955855244;
|
|
2143
|
+
_f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (41:47)";
|
|
2144
|
+
_f.__optimalization = 3;
|
|
2145
|
+
|
|
2146
|
+
global.__reanimatedWorkletInit(_f);
|
|
2147
|
+
|
|
2148
|
+
return _f;
|
|
2149
|
+
}());
|
|
2150
|
+
return /*#__PURE__*/jsx(Container$2, {
|
|
2151
|
+
children: /*#__PURE__*/jsx(AnimatedLinearGradient, {
|
|
2152
|
+
colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
|
|
2153
|
+
locations: [0.1, 0.5, 0.9],
|
|
2154
|
+
start: {
|
|
2155
|
+
x: 0,
|
|
2156
|
+
y: 0
|
|
2157
|
+
},
|
|
2158
|
+
end: {
|
|
2159
|
+
x: 1,
|
|
2160
|
+
y: 0
|
|
2161
|
+
},
|
|
2162
|
+
style: [StyleSheet.absoluteFill, linearGradientStyle]
|
|
2163
|
+
})
|
|
2164
|
+
});
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
function Skeleton(_ref) {
|
|
2168
|
+
var isLoading = _ref.isLoading,
|
|
2169
|
+
style = _ref.style;
|
|
2170
|
+
|
|
2171
|
+
var _useState = useState(0),
|
|
2172
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2173
|
+
width = _useState2[0],
|
|
2174
|
+
setWidth = _useState2[1];
|
|
2175
|
+
|
|
2176
|
+
return /*#__PURE__*/jsx(View, {
|
|
2177
|
+
style: style,
|
|
2178
|
+
onLayout: function onLayout(_ref2) {
|
|
2179
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
2180
|
+
return setWidth(nativeEvent.layout.width);
|
|
2181
|
+
},
|
|
2182
|
+
children: /*#__PURE__*/jsx(SkeletonContent, {
|
|
2183
|
+
isLoading: isLoading,
|
|
2184
|
+
width: width
|
|
2185
|
+
})
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
var Bar = /*#__PURE__*/styled(Skeleton).withConfig({
|
|
2189
|
+
displayName: "Skeleton__Bar"
|
|
2190
|
+
})(["width:100%;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref3) {
|
|
2191
|
+
var theme = _ref3.theme;
|
|
2192
|
+
return theme.kitt.spacing * 2;
|
|
2193
|
+
}, function (_ref4) {
|
|
2194
|
+
var theme = _ref4.theme;
|
|
2195
|
+
return theme.kitt.spacing * 2;
|
|
2196
|
+
});
|
|
2197
|
+
var Circle = /*#__PURE__*/styled(Skeleton).withConfig({
|
|
2198
|
+
displayName: "Skeleton__Circle"
|
|
2199
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref5) {
|
|
2200
|
+
var theme = _ref5.theme;
|
|
2201
|
+
return theme.kitt.spacing * 12;
|
|
2202
|
+
}, function (_ref6) {
|
|
2203
|
+
var theme = _ref6.theme;
|
|
2204
|
+
return theme.kitt.spacing * 12;
|
|
2205
|
+
}, function (_ref7) {
|
|
2206
|
+
var theme = _ref7.theme;
|
|
2207
|
+
return theme.kitt.spacing * 6;
|
|
2208
|
+
});
|
|
2209
|
+
var Square = /*#__PURE__*/styled(Skeleton).withConfig({
|
|
2210
|
+
displayName: "Skeleton__Square"
|
|
2211
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref8) {
|
|
2212
|
+
var theme = _ref8.theme;
|
|
2213
|
+
return theme.kitt.spacing * 12;
|
|
2214
|
+
}, function (_ref9) {
|
|
2215
|
+
var theme = _ref9.theme;
|
|
2216
|
+
return theme.kitt.spacing * 12;
|
|
2217
|
+
}, function (_ref10) {
|
|
2218
|
+
var theme = _ref10.theme;
|
|
2219
|
+
return theme.kitt.spacing * 1.5;
|
|
2220
|
+
});
|
|
2221
|
+
Skeleton.Bar = Bar;
|
|
2222
|
+
Skeleton.Circle = Circle;
|
|
2223
|
+
Skeleton.Square = Square;
|
|
2224
|
+
|
|
1935
2225
|
var Flex = /*#__PURE__*/styled.View.withConfig({
|
|
1936
2226
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
1937
2227
|
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
@@ -2376,47 +2666,98 @@ var avatarLateOceanTheme = {
|
|
|
2376
2666
|
}
|
|
2377
2667
|
};
|
|
2378
2668
|
|
|
2669
|
+
var colorsLateOceanTheme = {
|
|
2670
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
2671
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2672
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
2673
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2674
|
+
success: lateOceanColorPalette.viride,
|
|
2675
|
+
correct: lateOceanColorPalette.viride,
|
|
2676
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
2677
|
+
separator: lateOceanColorPalette.black100,
|
|
2678
|
+
hover: lateOceanColorPalette.black100,
|
|
2679
|
+
black: lateOceanColorPalette.black1000,
|
|
2680
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
2681
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2682
|
+
transparent: lateOceanColorPalette.transparent,
|
|
2683
|
+
disabled: lateOceanColorPalette.black50,
|
|
2684
|
+
overlay: {
|
|
2685
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2686
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
2687
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2688
|
+
}
|
|
2689
|
+
};
|
|
2690
|
+
|
|
2379
2691
|
var buttonLateOceanTheme = {
|
|
2380
2692
|
borderRadius: '30px',
|
|
2381
|
-
borderWidth:
|
|
2382
|
-
|
|
2693
|
+
borderWidth: {
|
|
2694
|
+
disabled: '2px',
|
|
2695
|
+
focus: '3px'
|
|
2696
|
+
},
|
|
2697
|
+
minHeight: '40px',
|
|
2383
2698
|
minWidth: '40px',
|
|
2384
2699
|
maxWidth: '335px',
|
|
2385
|
-
|
|
2700
|
+
scale: {
|
|
2701
|
+
base: {
|
|
2702
|
+
"default": 1,
|
|
2703
|
+
hover: 0.95,
|
|
2704
|
+
active: 0.95
|
|
2705
|
+
},
|
|
2706
|
+
medium: {
|
|
2707
|
+
hover: 1.05
|
|
2708
|
+
}
|
|
2709
|
+
},
|
|
2386
2710
|
contentPadding: {
|
|
2387
|
-
"default": '8px 16px'
|
|
2711
|
+
"default": '8px 16px 7px',
|
|
2712
|
+
large: '12px 24px 11px',
|
|
2713
|
+
disabled: '6px 14px 5px'
|
|
2388
2714
|
},
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
|
|
2393
|
-
disabledBorderColor: lateOceanColorPalette.black100
|
|
2715
|
+
transition: {
|
|
2716
|
+
duration: '200ms',
|
|
2717
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2394
2718
|
},
|
|
2395
|
-
|
|
2719
|
+
"default": {
|
|
2396
2720
|
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2397
|
-
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
2398
2721
|
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2399
|
-
|
|
2722
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2723
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2400
2724
|
},
|
|
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
|
|
2725
|
+
primary: {
|
|
2726
|
+
backgroundColor: colorsLateOceanTheme.primary,
|
|
2727
|
+
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2728
|
+
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2729
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2412
2730
|
},
|
|
2413
2731
|
white: {
|
|
2414
2732
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2415
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2416
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2417
2733
|
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2418
|
-
|
|
2419
|
-
|
|
2734
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2735
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2736
|
+
},
|
|
2737
|
+
subtle: {
|
|
2738
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2739
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2740
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2741
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2742
|
+
color: colorsLateOceanTheme.primary,
|
|
2743
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2744
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2745
|
+
},
|
|
2746
|
+
'subtle-dark': {
|
|
2747
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2748
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2749
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2750
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2751
|
+
color: colorsLateOceanTheme.black,
|
|
2752
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2753
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2754
|
+
},
|
|
2755
|
+
disabled: {
|
|
2756
|
+
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2757
|
+
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2758
|
+
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2759
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
2760
|
+
borderColor: lateOceanColorPalette.black100
|
|
2420
2761
|
}
|
|
2421
2762
|
};
|
|
2422
2763
|
|
|
@@ -2438,26 +2779,6 @@ var cardLateOceanTheme = {
|
|
|
2438
2779
|
}
|
|
2439
2780
|
};
|
|
2440
2781
|
|
|
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
2782
|
var feedbackMessageLateOceanTheme = {
|
|
2462
2783
|
backgroundColors: {
|
|
2463
2784
|
success: lateOceanColorPalette.viride,
|
|
@@ -2571,11 +2892,11 @@ var iconButton = {
|
|
|
2571
2892
|
},
|
|
2572
2893
|
disabled: {
|
|
2573
2894
|
scale: 1,
|
|
2574
|
-
backgroundColor: buttonLateOceanTheme.
|
|
2575
|
-
borderColor: buttonLateOceanTheme.
|
|
2895
|
+
backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
|
|
2896
|
+
borderColor: buttonLateOceanTheme.disabled.borderColor
|
|
2576
2897
|
},
|
|
2577
2898
|
"default": {
|
|
2578
|
-
pressedBackgroundColor: buttonLateOceanTheme.
|
|
2899
|
+
pressedBackgroundColor: buttonLateOceanTheme["default"].pressedBackgroundColor
|
|
2579
2900
|
},
|
|
2580
2901
|
white: {
|
|
2581
2902
|
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
@@ -2593,6 +2914,12 @@ var shadowsLateOceanTheme = {
|
|
|
2593
2914
|
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
2594
2915
|
};
|
|
2595
2916
|
|
|
2917
|
+
var skeletonTheme = {
|
|
2918
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
2919
|
+
flareColor: lateOceanColorPalette.black200,
|
|
2920
|
+
animationDuration: 1000
|
|
2921
|
+
};
|
|
2922
|
+
|
|
2596
2923
|
var tagLateOceanTheme = {
|
|
2597
2924
|
borderRadius: '10px',
|
|
2598
2925
|
padding: '2px 12px',
|
|
@@ -2646,20 +2973,18 @@ var tooltip = {
|
|
|
2646
2973
|
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
2647
2974
|
return Math.round(fontSize * lineHeightMultiplier);
|
|
2648
2975
|
};
|
|
2649
|
-
|
|
2650
2976
|
var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
|
|
2651
2977
|
return {
|
|
2652
2978
|
baseAndSmall: {
|
|
2653
2979
|
fontSize: "".concat(baseAndSmallFontSize, "px"),
|
|
2654
|
-
lineHeight: "".concat(calcLineHeight(
|
|
2980
|
+
lineHeight: "".concat(calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier), "px")
|
|
2655
2981
|
},
|
|
2656
2982
|
mediumAndWide: {
|
|
2657
2983
|
fontSize: "".concat(mediumAndWideFontSize, "px"),
|
|
2658
|
-
lineHeight: "".concat(calcLineHeight(
|
|
2984
|
+
lineHeight: "".concat(calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier), "px")
|
|
2659
2985
|
}
|
|
2660
2986
|
};
|
|
2661
2987
|
};
|
|
2662
|
-
|
|
2663
2988
|
var typographyLateOceanTheme = {
|
|
2664
2989
|
colors: {
|
|
2665
2990
|
black: lateOceanColorPalette.black1000,
|
|
@@ -2741,7 +3066,7 @@ var breakpoints = {
|
|
|
2741
3066
|
wideBreakpoint: 'max-width: 1279px'
|
|
2742
3067
|
}
|
|
2743
3068
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2744
|
-
// TODO : seperate brand
|
|
3069
|
+
// TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
|
|
2745
3070
|
|
|
2746
3071
|
var theme = {
|
|
2747
3072
|
spacing: 4,
|
|
@@ -2760,7 +3085,8 @@ var theme = {
|
|
|
2760
3085
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2761
3086
|
iconButton: iconButton,
|
|
2762
3087
|
listItem: listItemLateOceanTheme,
|
|
2763
|
-
tooltip: tooltip
|
|
3088
|
+
tooltip: tooltip,
|
|
3089
|
+
skeleton: skeletonTheme
|
|
2764
3090
|
};
|
|
2765
3091
|
|
|
2766
3092
|
function Title(_ref) {
|
|
@@ -3146,8 +3472,8 @@ var TypographyLinkWebWrapper = undefined;
|
|
|
3146
3472
|
var StyledLink = /*#__PURE__*/styled.Text.withConfig({
|
|
3147
3473
|
displayName: "TypographyLink__StyledLink"
|
|
3148
3474
|
})(["text-decoration:", ";", ";", ";"], function (_ref) {
|
|
3149
|
-
var $
|
|
3150
|
-
return $
|
|
3475
|
+
var $hasNoUnderline = _ref.$hasNoUnderline;
|
|
3476
|
+
return $hasNoUnderline ? 'none' : 'underline';
|
|
3151
3477
|
}, function (_ref2) {
|
|
3152
3478
|
var $disabled = _ref2.$disabled;
|
|
3153
3479
|
if (Platform.OS !== 'web') return undefined;
|
|
@@ -3171,10 +3497,10 @@ function TypographyLink(_ref4) {
|
|
|
3171
3497
|
accessibilityRole: "none",
|
|
3172
3498
|
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3173
3499
|
as: TypographyLinkWebWrapper,
|
|
3174
|
-
|
|
3500
|
+
$hasNoUnderline: noUnderline,
|
|
3175
3501
|
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3176
3502
|
$disabled: disabled,
|
|
3177
|
-
$
|
|
3503
|
+
$hasNoUnderline: noUnderline,
|
|
3178
3504
|
href: href,
|
|
3179
3505
|
hrefAttrs: hrefAttrs,
|
|
3180
3506
|
accessibilityRole: "link",
|
|
@@ -3189,25 +3515,35 @@ function TypographyLink(_ref4) {
|
|
|
3189
3515
|
}));
|
|
3190
3516
|
}
|
|
3191
3517
|
|
|
3192
|
-
function matchWindowSize(
|
|
3193
|
-
var
|
|
3194
|
-
|
|
3195
|
-
|
|
3518
|
+
function matchWindowSize(_ref, _ref2) {
|
|
3519
|
+
var width = _ref.width,
|
|
3520
|
+
height = _ref.height;
|
|
3521
|
+
var minWidth = _ref2.minWidth,
|
|
3522
|
+
maxWidth = _ref2.maxWidth,
|
|
3523
|
+
minHeight = _ref2.minHeight,
|
|
3524
|
+
maxHeight = _ref2.maxHeight;
|
|
3525
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3526
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3527
|
+
return hasWidthMatched && hasHeightMatched;
|
|
3196
3528
|
}
|
|
3197
3529
|
function useMatchWindowSize(options) {
|
|
3198
3530
|
var _useWindowDimensions = useWindowDimensions(),
|
|
3199
|
-
width = _useWindowDimensions.width
|
|
3531
|
+
width = _useWindowDimensions.width,
|
|
3532
|
+
height = _useWindowDimensions.height;
|
|
3200
3533
|
|
|
3201
|
-
return matchWindowSize(
|
|
3534
|
+
return matchWindowSize({
|
|
3535
|
+
width: width,
|
|
3536
|
+
height: height
|
|
3537
|
+
}, options);
|
|
3202
3538
|
}
|
|
3203
3539
|
|
|
3204
|
-
function createWindowSizeHelper(
|
|
3540
|
+
function createWindowSizeHelper(dimensions) {
|
|
3205
3541
|
return {
|
|
3206
3542
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
3207
|
-
return matchWindowSize(
|
|
3543
|
+
return matchWindowSize(dimensions, options);
|
|
3208
3544
|
},
|
|
3209
3545
|
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
3210
|
-
return matchWindowSize(
|
|
3546
|
+
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
3211
3547
|
},
|
|
3212
3548
|
mapWindowWidth: function mapWindowWidth() {
|
|
3213
3549
|
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3232,7 +3568,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3232
3568
|
minWidth = _ref4[0];
|
|
3233
3569
|
_ref4[1];
|
|
3234
3570
|
|
|
3235
|
-
return matchWindowSize(
|
|
3571
|
+
return matchWindowSize(dimensions, {
|
|
3236
3572
|
minWidth: Number(minWidth)
|
|
3237
3573
|
});
|
|
3238
3574
|
});
|
|
@@ -3243,18 +3579,24 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3243
3579
|
}
|
|
3244
3580
|
|
|
3245
3581
|
function useKittTheme() {
|
|
3246
|
-
var
|
|
3247
|
-
width = _useWindowSize.width;
|
|
3248
|
-
|
|
3582
|
+
var dimensions = useWindowDimensions();
|
|
3249
3583
|
return useMemo(function () {
|
|
3250
3584
|
return {
|
|
3251
3585
|
kitt: theme,
|
|
3252
|
-
responsive: createWindowSizeHelper(
|
|
3586
|
+
responsive: createWindowSizeHelper(dimensions),
|
|
3253
3587
|
breakpoints: breakpoints
|
|
3254
3588
|
};
|
|
3255
|
-
}, [
|
|
3589
|
+
}, [dimensions]);
|
|
3256
3590
|
}
|
|
3257
3591
|
|
|
3592
|
+
var hex2rgba = function (hex) {
|
|
3593
|
+
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
3594
|
+
var r = parseInt(hex.slice(1, 3), 16);
|
|
3595
|
+
var g = parseInt(hex.slice(3, 5), 16);
|
|
3596
|
+
var b = parseInt(hex.slice(5, 7), 16);
|
|
3597
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
|
3598
|
+
};
|
|
3599
|
+
|
|
3258
3600
|
function KittThemeProvider(_ref) {
|
|
3259
3601
|
var children = _ref.children;
|
|
3260
3602
|
var theme = useKittTheme();
|
|
@@ -3287,5 +3629,5 @@ function MatchWindowSize(_ref) {
|
|
|
3287
3629
|
});
|
|
3288
3630
|
}
|
|
3289
3631
|
|
|
3290
|
-
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
3632
|
+
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
3291
3633
|
//# sourceMappingURL=index-browser-all.es.ios.js.map
|