@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,7 +5,7 @@ export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
|
5
5
|
import { UserIcon, EyeIcon, EyeOffIcon, LoaderIcon, XIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon } from '@ornikar/kitt-icons';
|
|
6
6
|
export * from '@ornikar/kitt-icons';
|
|
7
7
|
import styled$1, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
8
|
-
import { cloneElement, useContext, createContext,
|
|
8
|
+
import { cloneElement, useContext, createContext, forwardRef, useMemo, useState, Fragment, Children, useEffect } from 'react';
|
|
9
9
|
import { styled } from '@linaria/react';
|
|
10
10
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
11
11
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
@@ -29,8 +29,7 @@ function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
29
29
|
// return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
|
|
30
30
|
// };
|
|
31
31
|
// }
|
|
32
|
-
function withTheme(
|
|
33
|
-
WrappedComponent) {
|
|
32
|
+
function withTheme(WrappedComponent) {
|
|
34
33
|
return function (props) {
|
|
35
34
|
var theme = /*#__PURE__*/useTheme();
|
|
36
35
|
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread$h({
|
|
@@ -50,7 +49,7 @@ function SpinningIcon(_ref) {
|
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
var IconContainer$
|
|
52
|
+
var IconContainer$1 = /*#__PURE__*/styled$1(View).withConfig({
|
|
54
53
|
displayName: "Icon__IconContainer",
|
|
55
54
|
componentId: "kitt-universal__sc-usm0ol-0"
|
|
56
55
|
})(["color:", ";width:", "px;height:", "px;align-self:", ";"], function (_ref) {
|
|
@@ -77,7 +76,7 @@ function Icon(_ref5) {
|
|
|
77
76
|
var clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
78
77
|
color: color
|
|
79
78
|
});
|
|
80
|
-
return /*#__PURE__*/jsx(IconContainer$
|
|
79
|
+
return /*#__PURE__*/jsx(IconContainer$1, {
|
|
81
80
|
align: align,
|
|
82
81
|
size: size,
|
|
83
82
|
color: color,
|
|
@@ -135,7 +134,7 @@ var KittBreakpointsMax = {
|
|
|
135
134
|
LARGE: KittBreakpoints.WIDE - 1
|
|
136
135
|
};
|
|
137
136
|
|
|
138
|
-
var _excluded$
|
|
137
|
+
var _excluded$e = ["accessibilityRole", "base", "small", "medium", "large", "variant", "color"];
|
|
139
138
|
|
|
140
139
|
function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
141
140
|
|
|
@@ -195,34 +194,53 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
|
195
194
|
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
196
195
|
return base;
|
|
197
196
|
}
|
|
198
|
-
function
|
|
199
|
-
var
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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$e);
|
|
207
219
|
|
|
208
220
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
var
|
|
212
|
-
|
|
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;
|
|
213
229
|
|
|
214
|
-
var
|
|
215
|
-
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, {
|
|
216
234
|
value: isHeader,
|
|
217
235
|
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
218
|
-
$color:
|
|
236
|
+
$color: colorOrDefaultToBlack,
|
|
219
237
|
$isHeader: isHeader,
|
|
220
238
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
221
239
|
$variant: nonNullableVariant,
|
|
222
240
|
accessibilityRole: accessibilityRole || undefined
|
|
223
241
|
}, otherProps))
|
|
224
242
|
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
225
|
-
$color:
|
|
243
|
+
$color: colorOrDefaultToBlack,
|
|
226
244
|
$isHeader: isHeader,
|
|
227
245
|
$variant: nonNullableVariant,
|
|
228
246
|
accessibilityRole: accessibilityRole || undefined
|
|
@@ -284,7 +302,7 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
284
302
|
|
|
285
303
|
Typography.h5 = createHeading(5, 'header5');
|
|
286
304
|
|
|
287
|
-
var _excluded$
|
|
305
|
+
var _excluded$d = ["size"];
|
|
288
306
|
|
|
289
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; }
|
|
290
308
|
|
|
@@ -356,7 +374,7 @@ function AvatarContent(_ref5) {
|
|
|
356
374
|
function Avatar(_ref6) {
|
|
357
375
|
var _ref6$size = _ref6.size,
|
|
358
376
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
359
|
-
rest = _objectWithoutProperties(_ref6, _excluded$
|
|
377
|
+
rest = _objectWithoutProperties(_ref6, _excluded$d);
|
|
360
378
|
|
|
361
379
|
return /*#__PURE__*/jsx(StyledAvatarView, _objectSpread$f(_objectSpread$f({}, rest), {}, {
|
|
362
380
|
size: size,
|
|
@@ -366,88 +384,257 @@ function Avatar(_ref6) {
|
|
|
366
384
|
}));
|
|
367
385
|
}
|
|
368
386
|
|
|
369
|
-
|
|
370
|
-
|
|
387
|
+
function isSubtle(type) {
|
|
388
|
+
return type.startsWith('subtle');
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
var _excluded$c = ["$type", "$isStretch", "disabled"];
|
|
371
392
|
|
|
372
393
|
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; }
|
|
373
394
|
|
|
374
395
|
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; }
|
|
396
|
+
var AnimatedButtonPressableContainer = withTheme( /*#__PURE__*/styled("div")({
|
|
397
|
+
name: "AnimatedButtonPressableContainer",
|
|
398
|
+
"class": "a1vkj3mh",
|
|
399
|
+
vars: {
|
|
400
|
+
"a1vkj3mh-0": [function (_ref) {
|
|
401
|
+
var $isStretch = _ref.$isStretch;
|
|
402
|
+
return $isStretch ? 'inherit' : 'inline-flex';
|
|
403
|
+
}],
|
|
404
|
+
"a1vkj3mh-1": [function (_ref2) {
|
|
405
|
+
var $isStretch = _ref2.$isStretch;
|
|
406
|
+
return $isStretch ? 'stretch' : 'baseline';
|
|
407
|
+
}],
|
|
408
|
+
"a1vkj3mh-2": [function (_ref3) {
|
|
409
|
+
var theme = _ref3.theme;
|
|
410
|
+
return theme.breakpoints.min.mediumBreakpoint;
|
|
411
|
+
}],
|
|
412
|
+
"a1vkj3mh-3": [function (_ref4) {
|
|
413
|
+
var theme = _ref4.theme;
|
|
414
|
+
return theme.kitt.button.scale.medium.hover;
|
|
415
|
+
}],
|
|
416
|
+
"a1vkj3mh-4": [function (_ref5) {
|
|
417
|
+
var theme = _ref5.theme,
|
|
418
|
+
$isDisabled = _ref5.$isDisabled;
|
|
419
|
+
return "scale(".concat($isDisabled ? 1 : theme.kitt.button.scale.base.active, ")");
|
|
420
|
+
}],
|
|
421
|
+
"a1vkj3mh-5": [function (_ref6) {
|
|
422
|
+
var theme = _ref6.theme,
|
|
423
|
+
$type = _ref6.$type,
|
|
424
|
+
$isDisabled = _ref6.$isDisabled;
|
|
425
|
+
if ($isDisabled) return theme.kitt.button.disabled.hoverBackgroundColor;
|
|
426
|
+
return theme.kitt.button[$type].hoverBackgroundColor;
|
|
427
|
+
}],
|
|
428
|
+
"a1vkj3mh-6": [function (_ref7) {
|
|
429
|
+
var theme = _ref7.theme;
|
|
430
|
+
var _theme$kitt$button$tr = theme.kitt.button.transition,
|
|
431
|
+
duration = _theme$kitt$button$tr.duration,
|
|
432
|
+
timingFunction = _theme$kitt$button$tr.timingFunction;
|
|
433
|
+
return "color, background, border-color, ".concat(duration, " ").concat(timingFunction);
|
|
434
|
+
}],
|
|
435
|
+
"a1vkj3mh-7": [function (_ref8) {
|
|
436
|
+
var theme = _ref8.theme;
|
|
437
|
+
return theme.kitt.button.borderRadius;
|
|
438
|
+
}],
|
|
439
|
+
"a1vkj3mh-8": [function (_ref9) {
|
|
440
|
+
var theme = _ref9.theme;
|
|
441
|
+
return "opacity ".concat(theme.kitt.button.transition.duration, " ").concat(theme.kitt.button.transition.timingFunction);
|
|
442
|
+
}],
|
|
443
|
+
"a1vkj3mh-9": [function (_ref10) {
|
|
444
|
+
var $isDisabled = _ref10.$isDisabled;
|
|
445
|
+
return $isDisabled ? 1 : 0;
|
|
446
|
+
}],
|
|
447
|
+
"a1vkj3mh-10": [function (_ref11) {
|
|
448
|
+
var theme = _ref11.theme;
|
|
449
|
+
return "-".concat(theme.kitt.button.borderWidth.disabled);
|
|
450
|
+
}],
|
|
451
|
+
"a1vkj3mh-12": [function (_ref12) {
|
|
452
|
+
var theme = _ref12.theme;
|
|
453
|
+
return "calc(100% - ".concat(parseInt(theme.kitt.button.borderWidth.disabled, 10) * 0.5, "px)");
|
|
454
|
+
}],
|
|
455
|
+
"a1vkj3mh-14": [function (_ref13) {
|
|
456
|
+
var theme = _ref13.theme;
|
|
457
|
+
return "".concat(theme.kitt.button.disabled.borderColor, " solid ").concat(theme.kitt.button.borderWidth.disabled);
|
|
458
|
+
}],
|
|
459
|
+
"a1vkj3mh-15": [function (_ref14) {
|
|
460
|
+
var theme = _ref14.theme,
|
|
461
|
+
$type = _ref14.$type;
|
|
462
|
+
return "".concat(theme.kitt.button.borderWidth.focus, " solid ").concat(theme.kitt.button[$type].focusBorderColor);
|
|
463
|
+
}],
|
|
464
|
+
"a1vkj3mh-16": [function (_ref15) {
|
|
465
|
+
var theme = _ref15.theme;
|
|
466
|
+
return "-".concat(theme.kitt.button.borderWidth.focus);
|
|
467
|
+
}],
|
|
468
|
+
"a1vkj3mh-18": [function (_ref16) {
|
|
469
|
+
var theme = _ref16.theme,
|
|
470
|
+
$type = _ref16.$type,
|
|
471
|
+
$isDisabled = _ref16.$isDisabled;
|
|
472
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
473
|
+
if (!isSubtle($type)) return 'inherit';
|
|
474
|
+
return theme.kitt.button[$type].color;
|
|
475
|
+
}],
|
|
476
|
+
"a1vkj3mh-19": [function (_ref17) {
|
|
477
|
+
var theme = _ref17.theme,
|
|
478
|
+
$type = _ref17.$type,
|
|
479
|
+
$isDisabled = _ref17.$isDisabled;
|
|
480
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
481
|
+
if (!isSubtle($type)) return 'inherit';
|
|
482
|
+
return theme.kitt.button[$type].hoverColor;
|
|
483
|
+
}],
|
|
484
|
+
"a1vkj3mh-20": [function (_ref18) {
|
|
485
|
+
var theme = _ref18.theme,
|
|
486
|
+
$type = _ref18.$type,
|
|
487
|
+
$isDisabled = _ref18.$isDisabled;
|
|
488
|
+
if ($isDisabled) return theme.kitt.typography.colors['black-light'];
|
|
489
|
+
if (!isSubtle($type)) return 'inherit';
|
|
490
|
+
return theme.kitt.button[$type].activeColor;
|
|
491
|
+
}]
|
|
492
|
+
}
|
|
493
|
+
}));
|
|
494
|
+
var AnimatedButtonPressable = /*#__PURE__*/forwardRef(function (_ref19, ref) {
|
|
495
|
+
var $type = _ref19.$type,
|
|
496
|
+
$isStretch = _ref19.$isStretch,
|
|
497
|
+
disabled = _ref19.disabled,
|
|
498
|
+
props = _objectWithoutProperties(_ref19, _excluded$c);
|
|
499
|
+
|
|
500
|
+
return /*#__PURE__*/jsx(AnimatedButtonPressableContainer, {
|
|
501
|
+
ref: ref,
|
|
502
|
+
$type: $type,
|
|
503
|
+
$isDisabled: !!disabled,
|
|
504
|
+
$isStretch: $isStretch,
|
|
505
|
+
children: /*#__PURE__*/jsx(Pressable, _objectSpread$e({
|
|
506
|
+
disabled: disabled
|
|
507
|
+
}, props))
|
|
508
|
+
});
|
|
509
|
+
});
|
|
375
510
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
511
|
+
var BaseStyledButtonPressable = /*#__PURE__*/styled$1(View).withConfig({
|
|
512
|
+
displayName: "BaseStyledButtonPressable",
|
|
513
|
+
componentId: "kitt-universal__sc-4k8lse-0"
|
|
514
|
+
})(["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) {
|
|
515
|
+
var theme = _ref.theme;
|
|
516
|
+
return theme.kitt.button.minWidth;
|
|
517
|
+
}, function (_ref2) {
|
|
518
|
+
var theme = _ref2.theme,
|
|
519
|
+
$isStretch = _ref2.$isStretch;
|
|
520
|
+
return $isStretch ? '100%' : theme.kitt.button.maxWidth;
|
|
521
|
+
}, function (_ref3) {
|
|
522
|
+
var $isStretch = _ref3.$isStretch;
|
|
523
|
+
return $isStretch ? '100%' : 'auto';
|
|
524
|
+
}, function (_ref4) {
|
|
525
|
+
var theme = _ref4.theme;
|
|
526
|
+
return theme.kitt.button.minHeight;
|
|
527
|
+
}, function (_ref5) {
|
|
528
|
+
var theme = _ref5.theme;
|
|
529
|
+
return theme.kitt.button.borderRadius;
|
|
530
|
+
}, function (_ref6) {
|
|
531
|
+
var theme = _ref6.theme,
|
|
532
|
+
$isDisabled = _ref6.$isDisabled,
|
|
533
|
+
$type = _ref6.$type;
|
|
534
|
+
if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
|
|
535
|
+
return theme.kitt.button[$type].backgroundColor;
|
|
536
|
+
}, function (_ref7) {
|
|
537
|
+
var theme = _ref7.theme,
|
|
538
|
+
$isLarge = _ref7.$isLarge,
|
|
539
|
+
$isDisabled = _ref7.$isDisabled;
|
|
540
|
+
var _theme$kitt$button$co = theme.kitt.button.contentPadding,
|
|
541
|
+
large = _theme$kitt$button$co.large,
|
|
542
|
+
defaultPadding = _theme$kitt$button$co["default"],
|
|
543
|
+
disabledPadding = _theme$kitt$button$co.disabled;
|
|
544
|
+
if ($isLarge) return large;
|
|
545
|
+
if ($isDisabled) return disabledPadding;
|
|
546
|
+
return defaultPadding;
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
var _excluded$b = ["color"],
|
|
550
|
+
_excluded2$2 = ["color"];
|
|
551
|
+
|
|
552
|
+
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; }
|
|
553
|
+
|
|
554
|
+
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; }
|
|
383
555
|
|
|
384
556
|
function TypographyIconSpecifiedColor(_ref) {
|
|
385
557
|
var color = _ref.color,
|
|
386
|
-
|
|
558
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
387
559
|
|
|
388
560
|
var theme = /*#__PURE__*/useTheme();
|
|
389
|
-
return /*#__PURE__*/jsx(Icon, _objectSpread$
|
|
390
|
-
color: theme.kitt.typography.colors[color]
|
|
561
|
+
return /*#__PURE__*/jsx(Icon, _objectSpread$d(_objectSpread$d({}, props), {}, {
|
|
562
|
+
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
391
563
|
}));
|
|
392
564
|
}
|
|
393
565
|
|
|
566
|
+
function TypographyIconInheritColor(props) {
|
|
567
|
+
var color = useTypographyColor();
|
|
568
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$d({
|
|
569
|
+
color: color
|
|
570
|
+
}, props));
|
|
571
|
+
}
|
|
572
|
+
|
|
394
573
|
function TypographyIcon(_ref2) {
|
|
395
574
|
var color = _ref2.color,
|
|
396
|
-
|
|
575
|
+
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
397
576
|
|
|
398
577
|
if (color) {
|
|
399
|
-
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$
|
|
578
|
+
return /*#__PURE__*/jsx(TypographyIconSpecifiedColor, _objectSpread$d({
|
|
400
579
|
color: color
|
|
401
|
-
},
|
|
580
|
+
}, props));
|
|
402
581
|
}
|
|
403
582
|
|
|
404
|
-
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$
|
|
583
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread$d({}, props));
|
|
405
584
|
}
|
|
406
585
|
|
|
407
|
-
|
|
586
|
+
var _excluded$a = ["type", "isDisabled", "$isStretch", "icon", "children"];
|
|
408
587
|
|
|
409
|
-
function
|
|
588
|
+
function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
410
589
|
|
|
411
|
-
var
|
|
412
|
-
if (disabled) return 'black-light';
|
|
590
|
+
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
413
591
|
|
|
592
|
+
var getTextColorByType = function (type) {
|
|
414
593
|
switch (type) {
|
|
415
594
|
case 'primary':
|
|
416
595
|
return 'white';
|
|
417
596
|
|
|
597
|
+
case 'white':
|
|
598
|
+
return 'white';
|
|
599
|
+
|
|
418
600
|
case 'subtle':
|
|
419
|
-
return
|
|
601
|
+
return 'primary';
|
|
420
602
|
|
|
421
603
|
case 'subtle-dark':
|
|
422
|
-
return
|
|
604
|
+
return 'black';
|
|
423
605
|
|
|
424
|
-
case 'secondary':
|
|
425
606
|
default:
|
|
426
607
|
return 'black';
|
|
427
608
|
}
|
|
428
609
|
};
|
|
429
610
|
|
|
430
|
-
var
|
|
431
|
-
displayName: "
|
|
611
|
+
var StyledButtonText = /*#__PURE__*/styled$1(Typography.Text).withConfig({
|
|
612
|
+
displayName: "ButtonContent__StyledButtonText",
|
|
432
613
|
componentId: "kitt-universal__sc-dnyw3n-0"
|
|
433
|
-
})(["text-align:center;"])
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
var
|
|
439
|
-
|
|
440
|
-
|
|
614
|
+
})(["text-align:center;", " ", ""], function () {
|
|
615
|
+
// Make the multilines case work properly on native
|
|
616
|
+
// Breaks the web implem
|
|
617
|
+
return undefined;
|
|
618
|
+
}, function (_ref) {
|
|
619
|
+
var $type = _ref.$type,
|
|
620
|
+
$isDisabled = _ref.$isDisabled;
|
|
621
|
+
|
|
622
|
+
/* For subltes button, color changes when hovered.
|
|
623
|
+
* We don't want to use a mouse event handler with a react state to handle it
|
|
624
|
+
* For this precise case, we've decided to work outside the typography logic
|
|
625
|
+
*/
|
|
626
|
+
if ($isDisabled || !isSubtle($type)) return undefined;
|
|
627
|
+
return 'color: inherit';
|
|
441
628
|
});
|
|
442
|
-
var
|
|
443
|
-
displayName: "
|
|
444
|
-
componentId: "kitt-universal__sc-dnyw3n-
|
|
629
|
+
var StyledIconContainer = /*#__PURE__*/styled$1(View).withConfig({
|
|
630
|
+
displayName: "ButtonContent__StyledIconContainer",
|
|
631
|
+
componentId: "kitt-universal__sc-dnyw3n-1"
|
|
445
632
|
})(["", ""], function (_ref2) {
|
|
446
633
|
var theme = _ref2.theme,
|
|
447
|
-
iconPosition = _ref2
|
|
448
|
-
var value = theme.kitt.spacing *
|
|
634
|
+
$iconPosition = _ref2.$iconPosition;
|
|
635
|
+
var value = theme.kitt.spacing * 2;
|
|
449
636
|
|
|
450
|
-
if (iconPosition === 'left') {
|
|
637
|
+
if ($iconPosition === 'left') {
|
|
451
638
|
return "margin: 0 ".concat(value, "px 0 0;");
|
|
452
639
|
}
|
|
453
640
|
|
|
@@ -456,39 +643,33 @@ var IconContainer$1 = /*#__PURE__*/styled$1(View).withConfig({
|
|
|
456
643
|
|
|
457
644
|
function ButtonIcon(_ref3) {
|
|
458
645
|
var icon = _ref3.icon,
|
|
459
|
-
spin = _ref3.spin,
|
|
460
646
|
color = _ref3.color,
|
|
461
|
-
|
|
647
|
+
spin = _ref3.spin,
|
|
462
648
|
iconPosition = _ref3.iconPosition,
|
|
463
649
|
testID = _ref3.testID;
|
|
464
|
-
return /*#__PURE__*/jsx(
|
|
465
|
-
iconPosition: iconPosition,
|
|
650
|
+
return /*#__PURE__*/jsx(StyledIconContainer, {
|
|
651
|
+
$iconPosition: iconPosition,
|
|
466
652
|
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
467
653
|
icon: icon,
|
|
468
654
|
spin: spin,
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
testID: testID
|
|
655
|
+
testID: testID,
|
|
656
|
+
color: color
|
|
472
657
|
})
|
|
473
658
|
});
|
|
474
659
|
}
|
|
475
660
|
|
|
476
|
-
|
|
661
|
+
var StyledChildrenWithIcon = /*#__PURE__*/styled$1(View).withConfig({
|
|
662
|
+
displayName: "ButtonContent__StyledChildrenWithIcon",
|
|
663
|
+
componentId: "kitt-universal__sc-dnyw3n-2"
|
|
664
|
+
})(["align-items:center;justify-content:center;flex-direction:row;"]);
|
|
665
|
+
function ButtonContentChildren(_ref4) {
|
|
477
666
|
var type = _ref4.type,
|
|
478
|
-
isPressed = _ref4.isPressed,
|
|
479
|
-
stretch = _ref4.stretch,
|
|
480
667
|
icon = _ref4.icon,
|
|
481
668
|
iconPosition = _ref4.iconPosition,
|
|
482
669
|
iconSpin = _ref4.iconSpin,
|
|
483
|
-
|
|
670
|
+
isDisabled = _ref4.isDisabled,
|
|
671
|
+
color = _ref4.color,
|
|
484
672
|
children = _ref4.children;
|
|
485
|
-
var color = getTextColorByType(type, Boolean(isPressed), Boolean(disabled));
|
|
486
|
-
var theme = /*#__PURE__*/useTheme();
|
|
487
|
-
var sharedIconProps = {
|
|
488
|
-
spin: iconSpin,
|
|
489
|
-
color: color,
|
|
490
|
-
size: theme.kitt.button.iconSize
|
|
491
|
-
};
|
|
492
673
|
|
|
493
674
|
if ((process.env.NODE_ENV !== "production")) {
|
|
494
675
|
if (!(children || icon)) {
|
|
@@ -496,129 +677,121 @@ function ButtonContent(_ref4) {
|
|
|
496
677
|
}
|
|
497
678
|
}
|
|
498
679
|
|
|
680
|
+
var isWebSubtle = isSubtle(type) && "web" === 'web' && !isDisabled;
|
|
681
|
+
|
|
499
682
|
if (!children) {
|
|
500
|
-
return /*#__PURE__*/jsx(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
}))
|
|
683
|
+
return /*#__PURE__*/jsx(TypographyIcon, {
|
|
684
|
+
spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
685
|
+
,
|
|
686
|
+
icon: icon,
|
|
687
|
+
color: isWebSubtle ? 'inherit' : color
|
|
506
688
|
});
|
|
507
689
|
}
|
|
508
690
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
691
|
+
var buttonIconSharedProps = {
|
|
692
|
+
type: type,
|
|
693
|
+
spin: iconSpin,
|
|
694
|
+
iconPosition: iconPosition,
|
|
695
|
+
color: isWebSubtle ? 'inherit' : color
|
|
696
|
+
};
|
|
697
|
+
return /*#__PURE__*/jsxs(StyledChildrenWithIcon, {
|
|
698
|
+
children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$c(_objectSpread$c({}, buttonIconSharedProps), {}, {
|
|
699
|
+
testID: "button-left-icon",
|
|
700
|
+
icon: icon
|
|
701
|
+
})) : null, /*#__PURE__*/jsx(StyledButtonText, {
|
|
516
702
|
base: "body",
|
|
517
|
-
color: color,
|
|
518
703
|
variant: "bold",
|
|
704
|
+
$type: type,
|
|
705
|
+
$isDisabled: isDisabled // set to color: inherit via styled components
|
|
706
|
+
,
|
|
707
|
+
color: isWebSubtle ? undefined : color,
|
|
519
708
|
children: children
|
|
520
|
-
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$
|
|
521
|
-
icon: icon
|
|
522
|
-
iconPosition: iconPosition
|
|
709
|
+
}), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread$c(_objectSpread$c({}, buttonIconSharedProps), {}, {
|
|
710
|
+
icon: icon
|
|
523
711
|
})) : null]
|
|
524
712
|
});
|
|
525
713
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return
|
|
533
|
-
}, function (_ref2) {
|
|
534
|
-
var theme = _ref2.theme,
|
|
535
|
-
stretch = _ref2.stretch;
|
|
536
|
-
return stretch ? 'auto' : theme.kitt.button.maxWidth;
|
|
537
|
-
}, function (_ref3) {
|
|
538
|
-
var stretch = _ref3.stretch;
|
|
539
|
-
return stretch ? '100%' : 'auto';
|
|
540
|
-
}, function (_ref4) {
|
|
541
|
-
var theme = _ref4.theme;
|
|
542
|
-
return theme.kitt.button.minHeight;
|
|
543
|
-
}, function (_ref5) {
|
|
544
|
-
var theme = _ref5.theme,
|
|
545
|
-
isPressed = _ref5.isPressed,
|
|
546
|
-
disabled = _ref5.disabled,
|
|
547
|
-
type = _ref5.type;
|
|
548
|
-
|
|
549
|
-
if (disabled) {
|
|
550
|
-
return theme.kitt.button[type].disabledBackgroundColor;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
|
|
714
|
+
var ButtonContentContainer = /*#__PURE__*/styled$1(View).withConfig({
|
|
715
|
+
displayName: "ButtonContent__ButtonContentContainer",
|
|
716
|
+
componentId: "kitt-universal__sc-dnyw3n-3"
|
|
717
|
+
})(["line-height:16px;", " ", ";"], function (_ref5) {
|
|
718
|
+
var $isStretch = _ref5.$isStretch,
|
|
719
|
+
$isIconOnly = _ref5.$isIconOnly;
|
|
720
|
+
return "\n flex: ".concat($isStretch || $isIconOnly ? 1 : 0, " 1 auto;\n ");
|
|
554
721
|
}, function (_ref6) {
|
|
555
|
-
var
|
|
556
|
-
return
|
|
557
|
-
}, function (_ref7) {
|
|
558
|
-
var theme = _ref7.theme;
|
|
559
|
-
return theme.kitt.button.borderRadius;
|
|
560
|
-
}, function (_ref8) {
|
|
561
|
-
var theme = _ref8.theme,
|
|
562
|
-
disabled = _ref8.disabled,
|
|
563
|
-
type = _ref8.type;
|
|
564
|
-
return disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent';
|
|
565
|
-
}, function (_ref9) {
|
|
566
|
-
var theme = _ref9.theme;
|
|
567
|
-
return theme.kitt.button.borderWidth;
|
|
568
|
-
});
|
|
722
|
+
var $isSubtle = _ref6.$isSubtle;
|
|
723
|
+
if (!$isSubtle) return undefined; // Needed for subtle type
|
|
569
724
|
|
|
570
|
-
|
|
725
|
+
return 'color: inherit';
|
|
726
|
+
});
|
|
727
|
+
function ButtonContent(_ref7) {
|
|
728
|
+
var type = _ref7.type,
|
|
729
|
+
isDisabled = _ref7.isDisabled,
|
|
730
|
+
$isStretch = _ref7.$isStretch,
|
|
731
|
+
icon = _ref7.icon,
|
|
732
|
+
children = _ref7.children,
|
|
733
|
+
props = _objectWithoutProperties(_ref7, _excluded$a);
|
|
734
|
+
|
|
735
|
+
var color = isDisabled ? 'black-light' : getTextColorByType(type);
|
|
736
|
+
return /*#__PURE__*/jsx(ButtonContentContainer, {
|
|
737
|
+
$isSubtle: isSubtle(type),
|
|
738
|
+
$isStretch: $isStretch,
|
|
739
|
+
$isIconOnly: Boolean(!children && icon),
|
|
740
|
+
children: /*#__PURE__*/jsx(ButtonContentChildren, _objectSpread$c(_objectSpread$c({
|
|
741
|
+
icon: icon,
|
|
742
|
+
type: type,
|
|
743
|
+
isDisabled: isDisabled,
|
|
744
|
+
color: color
|
|
745
|
+
}, props), {}, {
|
|
746
|
+
children: children
|
|
747
|
+
}))
|
|
748
|
+
});
|
|
749
|
+
}
|
|
571
750
|
|
|
572
|
-
|
|
573
|
-
function Button(_ref) {
|
|
751
|
+
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
574
752
|
var children = _ref.children,
|
|
575
753
|
_ref$type = _ref.type,
|
|
576
|
-
type = _ref$type === void 0 ? '
|
|
754
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
755
|
+
disabled = _ref.disabled,
|
|
756
|
+
stretch = _ref.stretch,
|
|
757
|
+
large = _ref.large,
|
|
577
758
|
icon = _ref.icon,
|
|
578
759
|
_ref$iconPosition = _ref.iconPosition,
|
|
579
760
|
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
580
761
|
iconSpin = _ref.iconSpin,
|
|
581
|
-
stretch = _ref.stretch,
|
|
582
|
-
disabled = _ref.disabled,
|
|
583
762
|
testID = _ref.testID,
|
|
584
763
|
href = _ref.href,
|
|
585
764
|
hrefAttrs = _ref.hrefAttrs,
|
|
765
|
+
_ref$accessibilityRol = _ref.accessibilityRole,
|
|
766
|
+
accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
|
|
586
767
|
onPress = _ref.onPress;
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
isPressed = _useState2[0],
|
|
591
|
-
setIsPressed = _useState2[1];
|
|
592
|
-
|
|
593
|
-
var sharedProps = {
|
|
594
|
-
type: type,
|
|
595
|
-
stretch: stretch,
|
|
596
|
-
disabled: disabled
|
|
597
|
-
};
|
|
598
|
-
return /*#__PURE__*/jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
599
|
-
// TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
|
|
600
|
-
// underlayColor={globalTheme.button[type].pressedBackgroundColor}
|
|
601
|
-
, _objectSpread$c(_objectSpread$c({}, sharedProps), {}, {
|
|
602
|
-
isPressed: isPressed,
|
|
603
|
-
accessibilityRole: "button",
|
|
768
|
+
return /*#__PURE__*/jsx(AnimatedButtonPressable, {
|
|
769
|
+
ref: ref,
|
|
770
|
+
accessibilityRole: accessibilityRole,
|
|
604
771
|
testID: testID,
|
|
605
772
|
href: href,
|
|
606
773
|
hrefAttrs: hrefAttrs,
|
|
774
|
+
disabled: disabled,
|
|
775
|
+
$isStretch: stretch,
|
|
776
|
+
$type: type,
|
|
607
777
|
onPress: onPress,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
778
|
+
children: /*#__PURE__*/jsxs(BaseStyledButtonPressable, {
|
|
779
|
+
$type: type,
|
|
780
|
+
$isStretch: stretch,
|
|
781
|
+
$isLarge: large,
|
|
782
|
+
$isDisabled: disabled,
|
|
783
|
+
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
784
|
+
type: type,
|
|
785
|
+
$isStretch: stretch,
|
|
786
|
+
isDisabled: disabled,
|
|
787
|
+
icon: icon,
|
|
788
|
+
iconPosition: iconPosition,
|
|
789
|
+
iconSpin: iconSpin,
|
|
790
|
+
children: children
|
|
791
|
+
}), null]
|
|
792
|
+
})
|
|
793
|
+
});
|
|
794
|
+
});
|
|
622
795
|
|
|
623
796
|
var Container$5 = /*#__PURE__*/styled$1(View).withConfig({
|
|
624
797
|
displayName: "Card__Container",
|
|
@@ -1295,30 +1468,31 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled("div")({
|
|
|
1295
1468
|
return theme.kitt.iconButton.scale.base.active;
|
|
1296
1469
|
}],
|
|
1297
1470
|
"p1nlccvg-4": [function (_ref5) {
|
|
1298
|
-
var theme = _ref5.theme
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
return
|
|
1471
|
+
var theme = _ref5.theme,
|
|
1472
|
+
$isWhite = _ref5.$isWhite;
|
|
1473
|
+
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
1474
|
+
white = _theme$kitt$iconButto.white,
|
|
1475
|
+
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
1476
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1477
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1304
1478
|
}]
|
|
1305
1479
|
}
|
|
1306
1480
|
}));
|
|
1307
1481
|
var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
1308
1482
|
displayName: "PressableIconButton__StyledPressableIconButton",
|
|
1309
1483
|
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1310
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (
|
|
1311
|
-
var theme =
|
|
1484
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref6) {
|
|
1485
|
+
var theme = _ref6.theme;
|
|
1312
1486
|
return theme.kitt.iconButton.borderRadius;
|
|
1487
|
+
}, function (_ref7) {
|
|
1488
|
+
var theme = _ref7.theme;
|
|
1489
|
+
return theme.kitt.iconButton.width;
|
|
1313
1490
|
}, function (_ref8) {
|
|
1314
1491
|
var theme = _ref8.theme;
|
|
1315
|
-
return theme.kitt.iconButton.width;
|
|
1316
|
-
}, function (_ref9) {
|
|
1317
|
-
var theme = _ref9.theme;
|
|
1318
1492
|
return theme.kitt.iconButton.height;
|
|
1319
|
-
}, function (
|
|
1320
|
-
var theme =
|
|
1321
|
-
disabled =
|
|
1493
|
+
}, function (_ref9) {
|
|
1494
|
+
var theme = _ref9.theme,
|
|
1495
|
+
disabled = _ref9.disabled;
|
|
1322
1496
|
var iconButton = theme.kitt.iconButton;
|
|
1323
1497
|
var transition = iconButton.transition;
|
|
1324
1498
|
|
|
@@ -1328,13 +1502,13 @@ var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
|
1328
1502
|
|
|
1329
1503
|
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1330
1504
|
});
|
|
1331
|
-
function PressableIconButton(
|
|
1332
|
-
var color =
|
|
1333
|
-
props = _objectWithoutProperties(
|
|
1505
|
+
function PressableIconButton(_ref10) {
|
|
1506
|
+
var color = _ref10.color,
|
|
1507
|
+
props = _objectWithoutProperties(_ref10, _excluded$6);
|
|
1334
1508
|
|
|
1335
1509
|
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1336
1510
|
as: PressableIconButtonWebWrapper,
|
|
1337
|
-
|
|
1511
|
+
$isWhite: color === 'white',
|
|
1338
1512
|
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$7({}, props))
|
|
1339
1513
|
});
|
|
1340
1514
|
}
|
|
@@ -2361,47 +2535,98 @@ var avatarLateOceanTheme = {
|
|
|
2361
2535
|
}
|
|
2362
2536
|
};
|
|
2363
2537
|
|
|
2538
|
+
var colorsLateOceanTheme = {
|
|
2539
|
+
primary: lateOceanColorPalette.lateOcean,
|
|
2540
|
+
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2541
|
+
accent: lateOceanColorPalette.warmEmbrace,
|
|
2542
|
+
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2543
|
+
success: lateOceanColorPalette.viride,
|
|
2544
|
+
correct: lateOceanColorPalette.viride,
|
|
2545
|
+
danger: lateOceanColorPalette.englishVermillon,
|
|
2546
|
+
separator: lateOceanColorPalette.black100,
|
|
2547
|
+
hover: lateOceanColorPalette.black100,
|
|
2548
|
+
black: lateOceanColorPalette.black1000,
|
|
2549
|
+
uiBackground: lateOceanColorPalette.black25,
|
|
2550
|
+
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2551
|
+
transparent: lateOceanColorPalette.transparent,
|
|
2552
|
+
disabled: lateOceanColorPalette.black50,
|
|
2553
|
+
overlay: {
|
|
2554
|
+
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2555
|
+
light: 'rgba(255, 255, 255, 0.90)',
|
|
2556
|
+
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2557
|
+
}
|
|
2558
|
+
};
|
|
2559
|
+
|
|
2364
2560
|
var buttonLateOceanTheme = {
|
|
2365
2561
|
borderRadius: '30px',
|
|
2366
|
-
borderWidth:
|
|
2367
|
-
|
|
2562
|
+
borderWidth: {
|
|
2563
|
+
disabled: '2px',
|
|
2564
|
+
focus: '3px'
|
|
2565
|
+
},
|
|
2566
|
+
minHeight: '40px',
|
|
2368
2567
|
minWidth: '40px',
|
|
2369
2568
|
maxWidth: '335px',
|
|
2370
|
-
|
|
2569
|
+
scale: {
|
|
2570
|
+
base: {
|
|
2571
|
+
"default": 1,
|
|
2572
|
+
hover: 0.95,
|
|
2573
|
+
active: 0.95
|
|
2574
|
+
},
|
|
2575
|
+
medium: {
|
|
2576
|
+
hover: 1.05
|
|
2577
|
+
}
|
|
2578
|
+
},
|
|
2371
2579
|
contentPadding: {
|
|
2372
|
-
"default": '8px 16px'
|
|
2580
|
+
"default": '8px 16px 7px',
|
|
2581
|
+
large: '12px 24px 11px',
|
|
2582
|
+
disabled: '6px 14px 5px'
|
|
2373
2583
|
},
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
|
|
2378
|
-
disabledBorderColor: lateOceanColorPalette.black100
|
|
2584
|
+
transition: {
|
|
2585
|
+
duration: '200ms',
|
|
2586
|
+
timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
2379
2587
|
},
|
|
2380
|
-
|
|
2588
|
+
"default": {
|
|
2381
2589
|
backgroundColor: 'rgba(0, 0, 0, 0.05)',
|
|
2382
|
-
disabledBackgroundColor: lateOceanColorPalette.black50,
|
|
2383
2590
|
pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2384
|
-
|
|
2591
|
+
hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
2592
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)'
|
|
2385
2593
|
},
|
|
2386
|
-
|
|
2387
|
-
backgroundColor:
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
},
|
|
2392
|
-
'subtle-dark': {
|
|
2393
|
-
backgroundColor: lateOceanColorPalette.transparent,
|
|
2394
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2395
|
-
pressedBackgroundColor: lateOceanColorPalette.transparent,
|
|
2396
|
-
disabledBorderColor: lateOceanColorPalette.transparent
|
|
2594
|
+
primary: {
|
|
2595
|
+
backgroundColor: colorsLateOceanTheme.primary,
|
|
2596
|
+
pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2597
|
+
hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
|
|
2598
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)'
|
|
2397
2599
|
},
|
|
2398
2600
|
white: {
|
|
2399
2601
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
2400
|
-
disabledBackgroundColor: lateOceanColorPalette.transparent,
|
|
2401
|
-
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2402
2602
|
pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2403
|
-
|
|
2404
|
-
|
|
2603
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
2604
|
+
focusBorderColor: 'rgba(255, 255, 255, 0.1)'
|
|
2605
|
+
},
|
|
2606
|
+
subtle: {
|
|
2607
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2608
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2609
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2610
|
+
focusBorderColor: 'rgba(76, 52, 224, 0.2)',
|
|
2611
|
+
color: colorsLateOceanTheme.primary,
|
|
2612
|
+
hoverColor: 'rgba(76, 52, 224, 0.8)',
|
|
2613
|
+
activeColor: 'rgba(76, 52, 224, 0.8)'
|
|
2614
|
+
},
|
|
2615
|
+
'subtle-dark': {
|
|
2616
|
+
backgroundColor: colorsLateOceanTheme.transparent,
|
|
2617
|
+
pressedBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2618
|
+
hoverBackgroundColor: colorsLateOceanTheme.transparent,
|
|
2619
|
+
focusBorderColor: 'rgba(0, 0, 0, 0.1)',
|
|
2620
|
+
color: colorsLateOceanTheme.black,
|
|
2621
|
+
hoverColor: 'rgba(0, 0, 0, 0.8)',
|
|
2622
|
+
activeColor: 'rgba(0, 0, 0, 0.8)'
|
|
2623
|
+
},
|
|
2624
|
+
disabled: {
|
|
2625
|
+
backgroundColor: colorsLateOceanTheme.disabled,
|
|
2626
|
+
pressedBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2627
|
+
hoverBackgroundColor: colorsLateOceanTheme.disabled,
|
|
2628
|
+
focusBorderColor: lateOceanColorPalette.black100,
|
|
2629
|
+
borderColor: lateOceanColorPalette.black100
|
|
2405
2630
|
}
|
|
2406
2631
|
};
|
|
2407
2632
|
|
|
@@ -2423,26 +2648,6 @@ var cardLateOceanTheme = {
|
|
|
2423
2648
|
}
|
|
2424
2649
|
};
|
|
2425
2650
|
|
|
2426
|
-
var colorsLateOceanTheme = {
|
|
2427
|
-
primary: lateOceanColorPalette.lateOcean,
|
|
2428
|
-
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
2429
|
-
accent: lateOceanColorPalette.warmEmbrace,
|
|
2430
|
-
accentLight: lateOceanColorPalette.warmEmbraceLight1,
|
|
2431
|
-
success: lateOceanColorPalette.viride,
|
|
2432
|
-
correct: lateOceanColorPalette.viride,
|
|
2433
|
-
danger: lateOceanColorPalette.englishVermillon,
|
|
2434
|
-
separator: lateOceanColorPalette.black100,
|
|
2435
|
-
hover: lateOceanColorPalette.black100,
|
|
2436
|
-
black: lateOceanColorPalette.black1000,
|
|
2437
|
-
uiBackground: lateOceanColorPalette.black25,
|
|
2438
|
-
uiBackgroundLight: lateOceanColorPalette.white,
|
|
2439
|
-
overlay: {
|
|
2440
|
-
dark: 'rgba(41, 48, 51, 0.25)',
|
|
2441
|
-
light: 'rgba(255, 255, 255, 0.90)',
|
|
2442
|
-
fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
|
|
2443
|
-
}
|
|
2444
|
-
};
|
|
2445
|
-
|
|
2446
2651
|
var feedbackMessageLateOceanTheme = {
|
|
2447
2652
|
backgroundColors: {
|
|
2448
2653
|
success: lateOceanColorPalette.viride,
|
|
@@ -2556,11 +2761,11 @@ var iconButton = {
|
|
|
2556
2761
|
},
|
|
2557
2762
|
disabled: {
|
|
2558
2763
|
scale: 1,
|
|
2559
|
-
backgroundColor: buttonLateOceanTheme.
|
|
2560
|
-
borderColor: buttonLateOceanTheme.
|
|
2764
|
+
backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
|
|
2765
|
+
borderColor: buttonLateOceanTheme.disabled.borderColor
|
|
2561
2766
|
},
|
|
2562
2767
|
"default": {
|
|
2563
|
-
pressedBackgroundColor: buttonLateOceanTheme.
|
|
2768
|
+
pressedBackgroundColor: buttonLateOceanTheme["default"].pressedBackgroundColor
|
|
2564
2769
|
},
|
|
2565
2770
|
white: {
|
|
2566
2771
|
pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
|
|
@@ -2726,7 +2931,7 @@ var breakpoints = {
|
|
|
2726
2931
|
wideBreakpoint: 'max-width: 1279px'
|
|
2727
2932
|
}
|
|
2728
2933
|
}; // eslint-disable-next-line unicorn/expiring-todo-comments
|
|
2729
|
-
// TODO : seperate brand
|
|
2934
|
+
// TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
|
|
2730
2935
|
|
|
2731
2936
|
var theme = {
|
|
2732
2937
|
spacing: 4,
|
|
@@ -3011,40 +3216,46 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3011
3216
|
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; }
|
|
3012
3217
|
var TypographyLinkWebWrapper = withTheme( /*#__PURE__*/styled("span")({
|
|
3013
3218
|
name: "TypographyLinkWebWrapper",
|
|
3014
|
-
"class": "tcwz3nt"
|
|
3219
|
+
"class": "tcwz3nt",
|
|
3220
|
+
vars: {
|
|
3221
|
+
"tcwz3nt-0": [function (_ref) {
|
|
3222
|
+
var $hasNoUnderline = _ref.$hasNoUnderline;
|
|
3223
|
+
return $hasNoUnderline ? 'underline' : 'none';
|
|
3224
|
+
}]
|
|
3225
|
+
}
|
|
3015
3226
|
}));
|
|
3016
3227
|
var StyledLink = /*#__PURE__*/styled$1(Text$1).withConfig({
|
|
3017
3228
|
displayName: "TypographyLink__StyledLink",
|
|
3018
3229
|
componentId: "kitt-universal__sc-1o1zy30-0"
|
|
3019
|
-
})(["text-decoration:", ";", ";", ";"], function (
|
|
3020
|
-
var $
|
|
3021
|
-
return $
|
|
3022
|
-
}, function (_ref2) {
|
|
3023
|
-
var $disabled = _ref2.$disabled;
|
|
3024
|
-
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3230
|
+
})(["text-decoration:", ";", ";", ";"], function (_ref2) {
|
|
3231
|
+
var $hasNoUnderline = _ref2.$hasNoUnderline;
|
|
3232
|
+
return $hasNoUnderline ? 'none' : 'underline';
|
|
3025
3233
|
}, function (_ref3) {
|
|
3026
|
-
var $disabled = _ref3.$disabled
|
|
3027
|
-
|
|
3234
|
+
var $disabled = _ref3.$disabled;
|
|
3235
|
+
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3236
|
+
}, function (_ref4) {
|
|
3237
|
+
var $disabled = _ref4.$disabled,
|
|
3238
|
+
theme = _ref4.theme;
|
|
3028
3239
|
if (!$disabled) return undefined;
|
|
3029
3240
|
return "color: ".concat(theme.kitt.typography.link.disabledColor, ";");
|
|
3030
3241
|
});
|
|
3031
|
-
function TypographyLink(
|
|
3032
|
-
var children =
|
|
3033
|
-
disabled =
|
|
3034
|
-
noUnderline =
|
|
3035
|
-
href =
|
|
3036
|
-
hrefAttrs =
|
|
3037
|
-
onPress =
|
|
3038
|
-
otherProps = _objectWithoutProperties(
|
|
3242
|
+
function TypographyLink(_ref5) {
|
|
3243
|
+
var children = _ref5.children,
|
|
3244
|
+
disabled = _ref5.disabled,
|
|
3245
|
+
noUnderline = _ref5.noUnderline,
|
|
3246
|
+
href = _ref5.href,
|
|
3247
|
+
hrefAttrs = _ref5.hrefAttrs,
|
|
3248
|
+
onPress = _ref5.onPress,
|
|
3249
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$1);
|
|
3039
3250
|
|
|
3040
3251
|
return /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
3041
3252
|
accessibilityRole: "none",
|
|
3042
3253
|
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3043
3254
|
as: TypographyLinkWebWrapper,
|
|
3044
|
-
|
|
3255
|
+
$hasNoUnderline: noUnderline,
|
|
3045
3256
|
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3046
3257
|
$disabled: disabled,
|
|
3047
|
-
$
|
|
3258
|
+
$hasNoUnderline: noUnderline,
|
|
3048
3259
|
href: href,
|
|
3049
3260
|
hrefAttrs: hrefAttrs,
|
|
3050
3261
|
accessibilityRole: "link",
|
|
@@ -3059,25 +3270,35 @@ function TypographyLink(_ref4) {
|
|
|
3059
3270
|
}));
|
|
3060
3271
|
}
|
|
3061
3272
|
|
|
3062
|
-
function matchWindowSize(
|
|
3063
|
-
var
|
|
3064
|
-
|
|
3065
|
-
|
|
3273
|
+
function matchWindowSize(_ref, _ref2) {
|
|
3274
|
+
var width = _ref.width,
|
|
3275
|
+
height = _ref.height;
|
|
3276
|
+
var minWidth = _ref2.minWidth,
|
|
3277
|
+
maxWidth = _ref2.maxWidth,
|
|
3278
|
+
minHeight = _ref2.minHeight,
|
|
3279
|
+
maxHeight = _ref2.maxHeight;
|
|
3280
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3281
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3282
|
+
return hasWidthMatched && hasHeightMatched;
|
|
3066
3283
|
}
|
|
3067
3284
|
function useMatchWindowSize(options) {
|
|
3068
3285
|
var _useWindowDimensions = useWindowDimensions(),
|
|
3069
|
-
width = _useWindowDimensions.width
|
|
3286
|
+
width = _useWindowDimensions.width,
|
|
3287
|
+
height = _useWindowDimensions.height;
|
|
3070
3288
|
|
|
3071
|
-
return matchWindowSize(
|
|
3289
|
+
return matchWindowSize({
|
|
3290
|
+
width: width,
|
|
3291
|
+
height: height
|
|
3292
|
+
}, options);
|
|
3072
3293
|
}
|
|
3073
3294
|
|
|
3074
|
-
function createWindowSizeHelper(
|
|
3295
|
+
function createWindowSizeHelper(dimensions) {
|
|
3075
3296
|
return {
|
|
3076
3297
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
3077
|
-
return matchWindowSize(
|
|
3298
|
+
return matchWindowSize(dimensions, options);
|
|
3078
3299
|
},
|
|
3079
3300
|
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
3080
|
-
return matchWindowSize(
|
|
3301
|
+
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
3081
3302
|
},
|
|
3082
3303
|
mapWindowWidth: function mapWindowWidth() {
|
|
3083
3304
|
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3102,7 +3323,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3102
3323
|
minWidth = _ref4[0];
|
|
3103
3324
|
_ref4[1];
|
|
3104
3325
|
|
|
3105
|
-
return matchWindowSize(
|
|
3326
|
+
return matchWindowSize(dimensions, {
|
|
3106
3327
|
minWidth: Number(minWidth)
|
|
3107
3328
|
});
|
|
3108
3329
|
});
|
|
@@ -3113,16 +3334,14 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3113
3334
|
}
|
|
3114
3335
|
|
|
3115
3336
|
function useKittTheme() {
|
|
3116
|
-
var
|
|
3117
|
-
width = _useWindowSize.width;
|
|
3118
|
-
|
|
3337
|
+
var dimensions = useWindowDimensions();
|
|
3119
3338
|
return useMemo(function () {
|
|
3120
3339
|
return {
|
|
3121
3340
|
kitt: theme,
|
|
3122
|
-
responsive: createWindowSizeHelper(
|
|
3341
|
+
responsive: createWindowSizeHelper(dimensions),
|
|
3123
3342
|
breakpoints: breakpoints
|
|
3124
3343
|
};
|
|
3125
|
-
}, [
|
|
3344
|
+
}, [dimensions]);
|
|
3126
3345
|
}
|
|
3127
3346
|
|
|
3128
3347
|
function KittThemeProvider(_ref) {
|