@ornikar/kitt-universal 3.0.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definitions/Button/AnimatedButtonPressable.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 +13 -11
- 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/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 +461 -255
- 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 +461 -255
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +504 -291
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +500 -281
- 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 +462 -213
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +3 -2
- package/dist/index-node-14.17.cjs.web.js +448 -215
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +3 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -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 } 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() {
|
|
@@ -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$h({
|
|
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$h({
|
|
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$h({
|
|
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$h({
|
|
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$h(_objectSpread$h({
|
|
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$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
308
|
|
|
289
|
-
function _objectSpread$
|
|
309
|
+
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
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$g(_objectSpread$g({}, rest), {}, {
|
|
359
379
|
size: size,
|
|
360
|
-
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$
|
|
380
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$g(_objectSpread$g({}, 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$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; }
|
|
524
|
+
|
|
525
|
+
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
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$f(_objectSpread$f({}, 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$f({
|
|
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$f({
|
|
397
550
|
color: color
|
|
398
|
-
},
|
|
551
|
+
}, props));
|
|
399
552
|
}
|
|
400
553
|
|
|
401
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
554
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$f({}, 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"];
|
|
407
562
|
|
|
408
|
-
var
|
|
409
|
-
if (disabled) return 'black-light';
|
|
563
|
+
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; }
|
|
410
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
|
+
|
|
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,128 +650,136 @@ 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$e(_objectSpread$e({}, 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$e(_objectSpread$e({}, 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
|
|
520
699
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
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$e(_objectSpread$e({
|
|
716
|
+
icon: icon,
|
|
717
|
+
type: type,
|
|
718
|
+
isDisabled: isDisabled,
|
|
719
|
+
color: color
|
|
720
|
+
}, props), {}, {
|
|
721
|
+
children: children
|
|
722
|
+
}))
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
|
|
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$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) {
|
|
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$e(_objectSpread$e({}, 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
784
|
var Container$6 = /*#__PURE__*/styled.View.withConfig({
|
|
617
785
|
displayName: "Card__Container"
|
|
@@ -1276,8 +1444,7 @@ function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
1276
1444
|
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
1277
1445
|
// };
|
|
1278
1446
|
// }
|
|
1279
|
-
function withTheme(
|
|
1280
|
-
WrappedComponent) {
|
|
1447
|
+
function withTheme(WrappedComponent) {
|
|
1281
1448
|
return function (props) {
|
|
1282
1449
|
var theme = /*#__PURE__*/useTheme();
|
|
1283
1450
|
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$9({
|
|
@@ -1291,7 +1458,7 @@ var _excluded$6 = ["color"];
|
|
|
1291
1458
|
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
1459
|
|
|
1293
1460
|
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__*/
|
|
1461
|
+
var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled$1("div")({
|
|
1295
1462
|
name: "PressableIconButtonWebWrapper",
|
|
1296
1463
|
"class": "p1nlccvg",
|
|
1297
1464
|
vars: {
|
|
@@ -1312,29 +1479,30 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styledLinaria("div")
|
|
|
1312
1479
|
return theme.kitt.iconButton.scale.base.active;
|
|
1313
1480
|
}],
|
|
1314
1481
|
"p1nlccvg-4": [function (_ref5) {
|
|
1315
|
-
var theme = _ref5.theme
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
return
|
|
1482
|
+
var theme = _ref5.theme,
|
|
1483
|
+
$isWhite = _ref5.$isWhite;
|
|
1484
|
+
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
1485
|
+
white = _theme$kitt$iconButto.white,
|
|
1486
|
+
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
1487
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1488
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1321
1489
|
}]
|
|
1322
1490
|
}
|
|
1323
1491
|
}));
|
|
1324
1492
|
var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1325
1493
|
displayName: "PressableIconButton__StyledPressableIconButton"
|
|
1326
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (
|
|
1327
|
-
var theme =
|
|
1494
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref6) {
|
|
1495
|
+
var theme = _ref6.theme;
|
|
1328
1496
|
return theme.kitt.iconButton.borderRadius;
|
|
1497
|
+
}, function (_ref7) {
|
|
1498
|
+
var theme = _ref7.theme;
|
|
1499
|
+
return theme.kitt.iconButton.width;
|
|
1329
1500
|
}, function (_ref8) {
|
|
1330
1501
|
var theme = _ref8.theme;
|
|
1331
|
-
return theme.kitt.iconButton.width;
|
|
1332
|
-
}, function (_ref9) {
|
|
1333
|
-
var theme = _ref9.theme;
|
|
1334
1502
|
return theme.kitt.iconButton.height;
|
|
1335
|
-
}, function (
|
|
1336
|
-
var theme =
|
|
1337
|
-
disabled =
|
|
1503
|
+
}, function (_ref9) {
|
|
1504
|
+
var theme = _ref9.theme,
|
|
1505
|
+
disabled = _ref9.disabled;
|
|
1338
1506
|
var iconButton = theme.kitt.iconButton;
|
|
1339
1507
|
|
|
1340
1508
|
if (Platform.OS !== 'web') {
|
|
@@ -1349,13 +1517,13 @@ var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
|
1349
1517
|
|
|
1350
1518
|
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1351
1519
|
});
|
|
1352
|
-
function PressableIconButton(
|
|
1353
|
-
var color =
|
|
1354
|
-
props = _objectWithoutProperties(
|
|
1520
|
+
function PressableIconButton(_ref10) {
|
|
1521
|
+
var color = _ref10.color,
|
|
1522
|
+
props = _objectWithoutProperties(_ref10, _excluded$6);
|
|
1355
1523
|
|
|
1356
1524
|
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1357
1525
|
as: PressableIconButtonWebWrapper,
|
|
1358
|
-
|
|
1526
|
+
$isWhite: color === 'white',
|
|
1359
1527
|
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$8({}, props))
|
|
1360
1528
|
});
|
|
1361
1529
|
}
|
|
@@ -2428,47 +2596,98 @@ var avatarLateOceanTheme = {
|
|
|
2428
2596
|
}
|
|
2429
2597
|
};
|
|
2430
2598
|
|
|
2599
|
+
var colorsLateOceanTheme = {
|
|
2600
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
2601
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2602
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
2603
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2604
|
+
success: lateOceanColorPalette.viride,
|
|
2605
|
+
correct: lateOceanColorPalette.viride,
|
|
2606
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
2607
|
+
separator: lateOceanColorPalette.black100,
|
|
2608
|
+
hover: lateOceanColorPalette.black100,
|
|
2609
|
+
black: lateOceanColorPalette.black1000,
|
|
2610
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
2611
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2612
|
+
transparent: lateOceanColorPalette.transparent,
|
|
2613
|
+
disabled: lateOceanColorPalette.black50,
|
|
2614
|
+
overlay: {
|
|
2615
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2616
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
2617
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2618
|
+
}
|
|
2619
|
+
};
|
|
2620
|
+
|
|
2431
2621
|
var buttonLateOceanTheme = {
|
|
2432
2622
|
borderRadius: '30px',
|
|
2433
|
-
borderWidth:
|
|
2434
|
-
|
|
2623
|
+
borderWidth: {
|
|
2624
|
+
disabled: '2px',
|
|
2625
|
+
focus: '3px'
|
|
2626
|
+
},
|
|
2627
|
+
minHeight: '40px',
|
|
2435
2628
|
minWidth: '40px',
|
|
2436
2629
|
maxWidth: '335px',
|
|
2437
|
-
|
|
2630
|
+
scale: {
|
|
2631
|
+
base: {
|
|
2632
|
+
"default": 1,
|
|
2633
|
+
hover: 0.95,
|
|
2634
|
+
active: 0.95
|
|
2635
|
+
},
|
|
2636
|
+
medium: {
|
|
2637
|
+
hover: 1.05
|
|
2638
|
+
}
|
|
2639
|
+
},
|
|
2438
2640
|
contentPadding: {
|
|
2439
|
-
"default": '8px 16px'
|
|
2641
|
+
"default": '8px 16px 7px',
|
|
2642
|
+
large: '12px 24px 11px',
|
|
2643
|
+
disabled: '6px 14px 5px'
|
|
2440
2644
|
},
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
|
|
2445
|
-
disabledBorderColor: lateOceanColorPalette.black100
|
|
2645
|
+
transition: {
|
|
2646
|
+
duration: '200ms',
|
|
2647
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2446
2648
|
},
|
|
2447
|
-
|
|
2649
|
+
"default": {
|
|
2448
2650
|
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2449
|
-
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
2450
2651
|
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
|
|
2652
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2653
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2458
2654
|
},
|
|
2459
|
-
|
|
2460
|
-
backgroundColor:
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2655
|
+
primary: {
|
|
2656
|
+
backgroundColor: colorsLateOceanTheme.primary,
|
|
2657
|
+
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2658
|
+
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2659
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2464
2660
|
},
|
|
2465
2661
|
white: {
|
|
2466
2662
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2467
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2468
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2469
2663
|
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2470
|
-
|
|
2471
|
-
|
|
2664
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2665
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2666
|
+
},
|
|
2667
|
+
subtle: {
|
|
2668
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2669
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2670
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2671
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2672
|
+
color: colorsLateOceanTheme.primary,
|
|
2673
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2674
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2675
|
+
},
|
|
2676
|
+
'subtle-dark': {
|
|
2677
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2678
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2679
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2680
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2681
|
+
color: colorsLateOceanTheme.black,
|
|
2682
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2683
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2684
|
+
},
|
|
2685
|
+
disabled: {
|
|
2686
|
+
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2687
|
+
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2688
|
+
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2689
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
2690
|
+
borderColor: lateOceanColorPalette.black100
|
|
2472
2691
|
}
|
|
2473
2692
|
};
|
|
2474
2693
|
|
|
@@ -2490,26 +2709,6 @@ var cardLateOceanTheme = {
|
|
|
2490
2709
|
}
|
|
2491
2710
|
};
|
|
2492
2711
|
|
|
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
2712
|
var feedbackMessageLateOceanTheme = {
|
|
2514
2713
|
backgroundColors: {
|
|
2515
2714
|
success: lateOceanColorPalette.viride,
|
|
@@ -2623,11 +2822,11 @@ var iconButton = {
|
|
|
2623
2822
|
},
|
|
2624
2823
|
disabled: {
|
|
2625
2824
|
scale: 1,
|
|
2626
|
-
backgroundColor: buttonLateOceanTheme.
|
|
2627
|
-
borderColor: buttonLateOceanTheme.
|
|
2825
|
+
backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
|
|
2826
|
+
borderColor: buttonLateOceanTheme.disabled.borderColor
|
|
2628
2827
|
},
|
|
2629
2828
|
"default": {
|
|
2630
|
-
pressedBackgroundColor: buttonLateOceanTheme.
|
|
2829
|
+
pressedBackgroundColor: buttonLateOceanTheme["default"].pressedBackgroundColor
|
|
2631
2830
|
},
|
|
2632
2831
|
white: {
|
|
2633
2832
|
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
@@ -2793,7 +2992,7 @@ var breakpoints = {
|
|
|
2793
2992
|
wideBreakpoint: 'max-width: 1279px'
|
|
2794
2993
|
}
|
|
2795
2994
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2796
|
-
// TODO : seperate brand
|
|
2995
|
+
// TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
|
|
2797
2996
|
|
|
2798
2997
|
var theme = {
|
|
2799
2998
|
spacing: 4,
|
|
@@ -3194,42 +3393,48 @@ var _excluded$1 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "
|
|
|
3194
3393
|
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
3394
|
|
|
3196
3395
|
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__*/
|
|
3396
|
+
var TypographyLinkWebWrapper = withTheme( /*#__PURE__*/styled$1("span")({
|
|
3198
3397
|
name: "TypographyLinkWebWrapper",
|
|
3199
|
-
"class": "tcwz3nt"
|
|
3398
|
+
"class": "tcwz3nt",
|
|
3399
|
+
vars: {
|
|
3400
|
+
"tcwz3nt-0": [function (_ref) {
|
|
3401
|
+
var $hasNoUnderline = _ref.$hasNoUnderline;
|
|
3402
|
+
return $hasNoUnderline ? 'underline' : 'none';
|
|
3403
|
+
}]
|
|
3404
|
+
}
|
|
3200
3405
|
}));
|
|
3201
3406
|
var StyledLink = /*#__PURE__*/styled.Text.withConfig({
|
|
3202
3407
|
displayName: "TypographyLink__StyledLink"
|
|
3203
|
-
})(["text-decoration:", ";", ";", ";"], function (
|
|
3204
|
-
var $
|
|
3205
|
-
return $
|
|
3206
|
-
}, function (
|
|
3207
|
-
var $disabled =
|
|
3408
|
+
})(["text-decoration:", ";", ";", ";"], function (_ref2) {
|
|
3409
|
+
var $hasNoUnderline = _ref2.$hasNoUnderline;
|
|
3410
|
+
return $hasNoUnderline ? 'none' : 'underline';
|
|
3411
|
+
}, function (_ref3) {
|
|
3412
|
+
var $disabled = _ref3.$disabled;
|
|
3208
3413
|
if (Platform.OS !== 'web') return undefined;
|
|
3209
3414
|
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3210
|
-
}, function (
|
|
3211
|
-
var $disabled =
|
|
3212
|
-
theme =
|
|
3415
|
+
}, function (_ref4) {
|
|
3416
|
+
var $disabled = _ref4.$disabled,
|
|
3417
|
+
theme = _ref4.theme;
|
|
3213
3418
|
if (!$disabled) return undefined;
|
|
3214
3419
|
return "color: ".concat(theme.kitt.typography.link.disabledColor, ";");
|
|
3215
3420
|
});
|
|
3216
|
-
function TypographyLink(
|
|
3217
|
-
var children =
|
|
3218
|
-
disabled =
|
|
3219
|
-
noUnderline =
|
|
3220
|
-
href =
|
|
3221
|
-
hrefAttrs =
|
|
3222
|
-
onPress =
|
|
3223
|
-
otherProps = _objectWithoutProperties(
|
|
3421
|
+
function TypographyLink(_ref5) {
|
|
3422
|
+
var children = _ref5.children,
|
|
3423
|
+
disabled = _ref5.disabled,
|
|
3424
|
+
noUnderline = _ref5.noUnderline,
|
|
3425
|
+
href = _ref5.href,
|
|
3426
|
+
hrefAttrs = _ref5.hrefAttrs,
|
|
3427
|
+
onPress = _ref5.onPress,
|
|
3428
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$1);
|
|
3224
3429
|
|
|
3225
3430
|
return /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
3226
3431
|
accessibilityRole: "none",
|
|
3227
3432
|
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3228
3433
|
as: TypographyLinkWebWrapper,
|
|
3229
|
-
|
|
3434
|
+
$hasNoUnderline: noUnderline,
|
|
3230
3435
|
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3231
3436
|
$disabled: disabled,
|
|
3232
|
-
$
|
|
3437
|
+
$hasNoUnderline: noUnderline,
|
|
3233
3438
|
href: href,
|
|
3234
3439
|
hrefAttrs: hrefAttrs,
|
|
3235
3440
|
accessibilityRole: "link",
|
|
@@ -3244,25 +3449,35 @@ function TypographyLink(_ref4) {
|
|
|
3244
3449
|
}));
|
|
3245
3450
|
}
|
|
3246
3451
|
|
|
3247
|
-
function matchWindowSize(
|
|
3248
|
-
var
|
|
3249
|
-
|
|
3250
|
-
|
|
3452
|
+
function matchWindowSize(_ref, _ref2) {
|
|
3453
|
+
var width = _ref.width,
|
|
3454
|
+
height = _ref.height;
|
|
3455
|
+
var minWidth = _ref2.minWidth,
|
|
3456
|
+
maxWidth = _ref2.maxWidth,
|
|
3457
|
+
minHeight = _ref2.minHeight,
|
|
3458
|
+
maxHeight = _ref2.maxHeight;
|
|
3459
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3460
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3461
|
+
return hasWidthMatched && hasHeightMatched;
|
|
3251
3462
|
}
|
|
3252
3463
|
function useMatchWindowSize(options) {
|
|
3253
3464
|
var _useWindowDimensions = useWindowDimensions(),
|
|
3254
|
-
width = _useWindowDimensions.width
|
|
3465
|
+
width = _useWindowDimensions.width,
|
|
3466
|
+
height = _useWindowDimensions.height;
|
|
3255
3467
|
|
|
3256
|
-
return matchWindowSize(
|
|
3468
|
+
return matchWindowSize({
|
|
3469
|
+
width: width,
|
|
3470
|
+
height: height
|
|
3471
|
+
}, options);
|
|
3257
3472
|
}
|
|
3258
3473
|
|
|
3259
|
-
function createWindowSizeHelper(
|
|
3474
|
+
function createWindowSizeHelper(dimensions) {
|
|
3260
3475
|
return {
|
|
3261
3476
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
3262
|
-
return matchWindowSize(
|
|
3477
|
+
return matchWindowSize(dimensions, options);
|
|
3263
3478
|
},
|
|
3264
3479
|
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
3265
|
-
return matchWindowSize(
|
|
3480
|
+
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
3266
3481
|
},
|
|
3267
3482
|
mapWindowWidth: function mapWindowWidth() {
|
|
3268
3483
|
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3287,7 +3502,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3287
3502
|
minWidth = _ref4[0];
|
|
3288
3503
|
_ref4[1];
|
|
3289
3504
|
|
|
3290
|
-
return matchWindowSize(
|
|
3505
|
+
return matchWindowSize(dimensions, {
|
|
3291
3506
|
minWidth: Number(minWidth)
|
|
3292
3507
|
});
|
|
3293
3508
|
});
|
|
@@ -3298,16 +3513,14 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3298
3513
|
}
|
|
3299
3514
|
|
|
3300
3515
|
function useKittTheme() {
|
|
3301
|
-
var
|
|
3302
|
-
width = _useWindowSize.width;
|
|
3303
|
-
|
|
3516
|
+
var dimensions = useWindowDimensions();
|
|
3304
3517
|
return useMemo(function () {
|
|
3305
3518
|
return {
|
|
3306
3519
|
kitt: theme,
|
|
3307
|
-
responsive: createWindowSizeHelper(
|
|
3520
|
+
responsive: createWindowSizeHelper(dimensions),
|
|
3308
3521
|
breakpoints: breakpoints
|
|
3309
3522
|
};
|
|
3310
|
-
}, [
|
|
3523
|
+
}, [dimensions]);
|
|
3311
3524
|
}
|
|
3312
3525
|
|
|
3313
3526
|
function KittThemeProvider(_ref) {
|