@ornikar/kitt-universal 3.2.0 → 3.6.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/Avatar/Avatar.d.ts +9 -4
- package/dist/definitions/Avatar/Avatar.d.ts.map +1 -1
- package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
- package/dist/definitions/Skeleton/Skeleton.d.ts +14 -0
- package/dist/definitions/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/definitions/Skeleton/SkeletonContent.d.ts +8 -0
- package/dist/definitions/Skeleton/SkeletonContent.d.ts.map +1 -0
- package/dist/definitions/Skeleton/SkeletonContent.web.d.ts +7 -0
- package/dist/definitions/Skeleton/SkeletonContent.web.d.ts.map +1 -0
- package/dist/definitions/forms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +5 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +2 -10
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/avatarLateOceanTheme.d.ts +9 -10
- package/dist/definitions/themes/late-ocean/avatarLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts +7 -0
- package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts.map +1 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +2 -0
- package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +2 -0
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/definitions/utils/hexToRgba.d.ts +2 -0
- package/dist/definitions/utils/hexToRgba.d.ts.map +1 -0
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts +7 -2
- package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts +5 -2
- package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +355 -163
- 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 +355 -163
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +307 -130
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +261 -119
- 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 +264 -84
- 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 +219 -74
- 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 +5 -4
|
@@ -194,34 +194,53 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
|
194
194
|
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
195
195
|
return base;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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);
|
|
206
219
|
|
|
207
220
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
208
|
-
var
|
|
209
|
-
var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
210
|
-
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular'; // if isHeaderTypographyInContext exists, it means we are inside another typography so we don't want to
|
|
211
|
-
// redefine the color, just inherit from it
|
|
221
|
+
var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
212
222
|
|
|
213
|
-
var
|
|
214
|
-
|
|
223
|
+
var _getTypographyInherit = getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
|
|
224
|
+
base: base,
|
|
225
|
+
color: color
|
|
226
|
+
}),
|
|
227
|
+
baseOrDefaultToBody = _getTypographyInherit.base,
|
|
228
|
+
colorOrDefaultToBlack = _getTypographyInherit.color;
|
|
229
|
+
|
|
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, {
|
|
215
234
|
value: isHeader,
|
|
216
235
|
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
217
|
-
$color:
|
|
236
|
+
$color: colorOrDefaultToBlack,
|
|
218
237
|
$isHeader: isHeader,
|
|
219
238
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
220
239
|
$variant: nonNullableVariant,
|
|
221
240
|
accessibilityRole: accessibilityRole || undefined
|
|
222
241
|
}, otherProps))
|
|
223
242
|
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
|
|
224
|
-
$color:
|
|
243
|
+
$color: colorOrDefaultToBlack,
|
|
225
244
|
$isHeader: isHeader,
|
|
226
245
|
$variant: nonNullableVariant,
|
|
227
246
|
accessibilityRole: accessibilityRole || undefined
|
|
@@ -283,46 +302,45 @@ Typography.h4 = createHeading(4, 'header4');
|
|
|
283
302
|
|
|
284
303
|
Typography.h5 = createHeading(5, 'header5');
|
|
285
304
|
|
|
286
|
-
var _excluded$d = ["size"];
|
|
305
|
+
var _excluded$d = ["size", "base", "round", "light"];
|
|
287
306
|
|
|
288
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; }
|
|
289
308
|
|
|
290
309
|
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
291
310
|
|
|
292
|
-
var getFirstCharacter = function (string) {
|
|
293
|
-
return string ? string[0] : '';
|
|
294
|
-
};
|
|
295
|
-
|
|
296
311
|
var getInitials = function (firstname, lastname) {
|
|
297
|
-
return (
|
|
312
|
+
return "".concat(firstname[0]).concat(lastname[0]).toUpperCase();
|
|
298
313
|
};
|
|
299
314
|
|
|
300
315
|
var StyledAvatarView = /*#__PURE__*/styled$1(View).withConfig({
|
|
301
316
|
displayName: "Avatar__StyledAvatarView",
|
|
302
317
|
componentId: "kitt-universal__sc-9miubv-0"
|
|
303
|
-
})(["border-radius:", "
|
|
304
|
-
var
|
|
305
|
-
|
|
306
|
-
|
|
318
|
+
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], function (_ref) {
|
|
319
|
+
var theme = _ref.theme,
|
|
320
|
+
$isRound = _ref.$isRound,
|
|
321
|
+
$size = _ref.$size;
|
|
322
|
+
if ($isRound) return "".concat($size / 2, "px");
|
|
323
|
+
return theme.kitt.avatar.borderRadius;
|
|
307
324
|
}, function (_ref2) {
|
|
308
325
|
var theme = _ref2.theme,
|
|
309
|
-
|
|
310
|
-
return
|
|
326
|
+
$isLight = _ref2.$isLight;
|
|
327
|
+
return $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar["default"].backgroundColor;
|
|
311
328
|
}, function (_ref3) {
|
|
312
|
-
var size = _ref3
|
|
313
|
-
return size;
|
|
329
|
+
var $size = _ref3.$size;
|
|
330
|
+
return $size;
|
|
314
331
|
}, function (_ref4) {
|
|
315
|
-
var size = _ref4
|
|
316
|
-
return size;
|
|
332
|
+
var $size = _ref4.$size;
|
|
333
|
+
return $size;
|
|
317
334
|
});
|
|
318
335
|
|
|
319
336
|
function AvatarContent(_ref5) {
|
|
320
|
-
var
|
|
321
|
-
size = _ref5$size === void 0 ? 40 : _ref5$size,
|
|
337
|
+
var size = _ref5.size,
|
|
322
338
|
src = _ref5.src,
|
|
323
339
|
firstname = _ref5.firstname,
|
|
324
340
|
lastname = _ref5.lastname,
|
|
325
|
-
|
|
341
|
+
alt = _ref5.alt,
|
|
342
|
+
base = _ref5.base,
|
|
343
|
+
isLight = _ref5.isLight;
|
|
326
344
|
|
|
327
345
|
if (src) {
|
|
328
346
|
return /*#__PURE__*/jsx(Image, {
|
|
@@ -332,22 +350,23 @@ function AvatarContent(_ref5) {
|
|
|
332
350
|
style: {
|
|
333
351
|
width: size,
|
|
334
352
|
height: size
|
|
335
|
-
}
|
|
353
|
+
},
|
|
354
|
+
accessibilityLabel: alt
|
|
336
355
|
});
|
|
337
356
|
}
|
|
338
357
|
|
|
339
358
|
if (firstname && lastname) {
|
|
340
359
|
return /*#__PURE__*/jsx(Typography.Text, {
|
|
341
|
-
base:
|
|
360
|
+
base: base,
|
|
342
361
|
variant: "bold",
|
|
343
|
-
color:
|
|
362
|
+
color: isLight ? 'black' : 'white',
|
|
344
363
|
children: getInitials(firstname, lastname)
|
|
345
364
|
});
|
|
346
365
|
}
|
|
347
366
|
|
|
348
367
|
return /*#__PURE__*/jsx(Icon, {
|
|
349
368
|
icon: /*#__PURE__*/jsx(UserIcon, {}),
|
|
350
|
-
color:
|
|
369
|
+
color: isLight ? 'black' : 'white',
|
|
351
370
|
size: size / 2
|
|
352
371
|
});
|
|
353
372
|
}
|
|
@@ -355,14 +374,22 @@ function AvatarContent(_ref5) {
|
|
|
355
374
|
function Avatar(_ref6) {
|
|
356
375
|
var _ref6$size = _ref6.size,
|
|
357
376
|
size = _ref6$size === void 0 ? 40 : _ref6$size,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
377
|
+
_ref6$base = _ref6.base,
|
|
378
|
+
base = _ref6$base === void 0 ? 'body-small' : _ref6$base,
|
|
379
|
+
round = _ref6.round,
|
|
380
|
+
light = _ref6.light,
|
|
381
|
+
props = _objectWithoutProperties(_ref6, _excluded$d);
|
|
382
|
+
|
|
383
|
+
return /*#__PURE__*/jsx(StyledAvatarView, {
|
|
384
|
+
$size: size,
|
|
385
|
+
$isRound: round,
|
|
386
|
+
$isLight: light,
|
|
387
|
+
children: /*#__PURE__*/jsx(AvatarContent, _objectSpread$f({
|
|
388
|
+
size: size,
|
|
389
|
+
base: base,
|
|
390
|
+
isLight: light
|
|
391
|
+
}, props))
|
|
392
|
+
});
|
|
366
393
|
}
|
|
367
394
|
|
|
368
395
|
function isSubtle(type) {
|
|
@@ -1237,7 +1264,8 @@ function TextArea(_ref) {
|
|
|
1237
1264
|
|
|
1238
1265
|
var theme = /*#__PURE__*/useTheme();
|
|
1239
1266
|
return /*#__PURE__*/jsx(InputText, _objectSpread$9(_objectSpread$9({
|
|
1240
|
-
multiline: true
|
|
1267
|
+
multiline: true,
|
|
1268
|
+
textAlignVertical: "top"
|
|
1241
1269
|
}, props), {}, {
|
|
1242
1270
|
type: "text",
|
|
1243
1271
|
minHeight: theme.kitt.forms.input.textAreaMinHeight
|
|
@@ -1449,30 +1477,31 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled("div")({
|
|
|
1449
1477
|
return theme.kitt.iconButton.scale.base.active;
|
|
1450
1478
|
}],
|
|
1451
1479
|
"p1nlccvg-4": [function (_ref5) {
|
|
1452
|
-
var theme = _ref5.theme
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
return
|
|
1480
|
+
var theme = _ref5.theme,
|
|
1481
|
+
$isWhite = _ref5.$isWhite;
|
|
1482
|
+
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
1483
|
+
white = _theme$kitt$iconButto.white,
|
|
1484
|
+
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
1485
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1486
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1458
1487
|
}]
|
|
1459
1488
|
}
|
|
1460
1489
|
}));
|
|
1461
1490
|
var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
1462
1491
|
displayName: "PressableIconButton__StyledPressableIconButton",
|
|
1463
1492
|
componentId: "kitt-universal__sc-1m6jo3s-0"
|
|
1464
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (
|
|
1465
|
-
var theme =
|
|
1493
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref6) {
|
|
1494
|
+
var theme = _ref6.theme;
|
|
1466
1495
|
return theme.kitt.iconButton.borderRadius;
|
|
1496
|
+
}, function (_ref7) {
|
|
1497
|
+
var theme = _ref7.theme;
|
|
1498
|
+
return theme.kitt.iconButton.width;
|
|
1467
1499
|
}, function (_ref8) {
|
|
1468
1500
|
var theme = _ref8.theme;
|
|
1469
|
-
return theme.kitt.iconButton.width;
|
|
1470
|
-
}, function (_ref9) {
|
|
1471
|
-
var theme = _ref9.theme;
|
|
1472
1501
|
return theme.kitt.iconButton.height;
|
|
1473
|
-
}, function (
|
|
1474
|
-
var theme =
|
|
1475
|
-
disabled =
|
|
1502
|
+
}, function (_ref9) {
|
|
1503
|
+
var theme = _ref9.theme,
|
|
1504
|
+
disabled = _ref9.disabled;
|
|
1476
1505
|
var iconButton = theme.kitt.iconButton;
|
|
1477
1506
|
var transition = iconButton.transition;
|
|
1478
1507
|
|
|
@@ -1482,13 +1511,13 @@ var StyledPressableIconButton = /*#__PURE__*/styled$1(Pressable).withConfig({
|
|
|
1482
1511
|
|
|
1483
1512
|
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1484
1513
|
});
|
|
1485
|
-
function PressableIconButton(
|
|
1486
|
-
var color =
|
|
1487
|
-
props = _objectWithoutProperties(
|
|
1514
|
+
function PressableIconButton(_ref10) {
|
|
1515
|
+
var color = _ref10.color,
|
|
1516
|
+
props = _objectWithoutProperties(_ref10, _excluded$6);
|
|
1488
1517
|
|
|
1489
1518
|
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1490
1519
|
as: PressableIconButtonWebWrapper,
|
|
1491
|
-
|
|
1520
|
+
$isWhite: color === 'white',
|
|
1492
1521
|
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$7({}, props))
|
|
1493
1522
|
});
|
|
1494
1523
|
}
|
|
@@ -2061,6 +2090,93 @@ function Notification(_ref) {
|
|
|
2061
2090
|
});
|
|
2062
2091
|
}
|
|
2063
2092
|
|
|
2093
|
+
var StyledSkeleton = withTheme( /*#__PURE__*/styled("div")({
|
|
2094
|
+
name: "StyledSkeleton",
|
|
2095
|
+
"class": "sc3upcl",
|
|
2096
|
+
vars: {
|
|
2097
|
+
"sc3upcl-0": [function (_ref) {
|
|
2098
|
+
var theme = _ref.theme;
|
|
2099
|
+
return theme.kitt.skeleton.backgroundColor;
|
|
2100
|
+
}],
|
|
2101
|
+
"sc3upcl-1": [function (_ref2) {
|
|
2102
|
+
var $isLoading = _ref2.$isLoading,
|
|
2103
|
+
theme = _ref2.theme;
|
|
2104
|
+
return $isLoading ? "linear-gradient(\n -90deg,\n ".concat(theme.kitt.skeleton.backgroundColor, ",\n ").concat(theme.kitt.skeleton.flareColor, " 50%,\n ").concat(theme.kitt.skeleton.backgroundColor, " 100%\n )") : 'none';
|
|
2105
|
+
}],
|
|
2106
|
+
"sc3upcl-2": [function (_ref3) {
|
|
2107
|
+
var $isLoading = _ref3.$isLoading;
|
|
2108
|
+
return $isLoading ? '1s ease-in-out infinite' : 'none';
|
|
2109
|
+
}]
|
|
2110
|
+
}
|
|
2111
|
+
}));
|
|
2112
|
+
function SkeletonContent(_ref4) {
|
|
2113
|
+
var isLoading = _ref4.isLoading;
|
|
2114
|
+
return /*#__PURE__*/jsx(StyledSkeleton, {
|
|
2115
|
+
$isLoading: isLoading
|
|
2116
|
+
});
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
function Skeleton(_ref) {
|
|
2120
|
+
var isLoading = _ref.isLoading,
|
|
2121
|
+
style = _ref.style;
|
|
2122
|
+
|
|
2123
|
+
var _useState = useState(0),
|
|
2124
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2125
|
+
width = _useState2[0],
|
|
2126
|
+
setWidth = _useState2[1];
|
|
2127
|
+
|
|
2128
|
+
return /*#__PURE__*/jsx(View, {
|
|
2129
|
+
style: style,
|
|
2130
|
+
onLayout: function onLayout(_ref2) {
|
|
2131
|
+
var nativeEvent = _ref2.nativeEvent;
|
|
2132
|
+
return setWidth(nativeEvent.layout.width);
|
|
2133
|
+
},
|
|
2134
|
+
children: /*#__PURE__*/jsx(SkeletonContent, {
|
|
2135
|
+
isLoading: isLoading,
|
|
2136
|
+
width: width
|
|
2137
|
+
})
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
var Bar = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2141
|
+
displayName: "Skeleton__Bar",
|
|
2142
|
+
componentId: "kitt-universal__sc-1w5cm3i-0"
|
|
2143
|
+
})(["width:100%;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref3) {
|
|
2144
|
+
var theme = _ref3.theme;
|
|
2145
|
+
return theme.kitt.spacing * 2;
|
|
2146
|
+
}, function (_ref4) {
|
|
2147
|
+
var theme = _ref4.theme;
|
|
2148
|
+
return theme.kitt.spacing * 2;
|
|
2149
|
+
});
|
|
2150
|
+
var Circle = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2151
|
+
displayName: "Skeleton__Circle",
|
|
2152
|
+
componentId: "kitt-universal__sc-1w5cm3i-1"
|
|
2153
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref5) {
|
|
2154
|
+
var theme = _ref5.theme;
|
|
2155
|
+
return theme.kitt.spacing * 12;
|
|
2156
|
+
}, function (_ref6) {
|
|
2157
|
+
var theme = _ref6.theme;
|
|
2158
|
+
return theme.kitt.spacing * 12;
|
|
2159
|
+
}, function (_ref7) {
|
|
2160
|
+
var theme = _ref7.theme;
|
|
2161
|
+
return theme.kitt.spacing * 6;
|
|
2162
|
+
});
|
|
2163
|
+
var Square = /*#__PURE__*/styled$1(Skeleton).withConfig({
|
|
2164
|
+
displayName: "Skeleton__Square",
|
|
2165
|
+
componentId: "kitt-universal__sc-1w5cm3i-2"
|
|
2166
|
+
})(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref8) {
|
|
2167
|
+
var theme = _ref8.theme;
|
|
2168
|
+
return theme.kitt.spacing * 12;
|
|
2169
|
+
}, function (_ref9) {
|
|
2170
|
+
var theme = _ref9.theme;
|
|
2171
|
+
return theme.kitt.spacing * 12;
|
|
2172
|
+
}, function (_ref10) {
|
|
2173
|
+
var theme = _ref10.theme;
|
|
2174
|
+
return theme.kitt.spacing * 1.5;
|
|
2175
|
+
});
|
|
2176
|
+
Skeleton.Bar = Bar;
|
|
2177
|
+
Skeleton.Circle = Circle;
|
|
2178
|
+
Skeleton.Square = Square;
|
|
2179
|
+
|
|
2064
2180
|
var Flex = /*#__PURE__*/styled$1(View).withConfig({
|
|
2065
2181
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
2066
2182
|
return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
|
|
@@ -2504,17 +2620,6 @@ var lateOceanColorPalette = {
|
|
|
2504
2620
|
moonPurpleLight1: '#EDEBFC'
|
|
2505
2621
|
};
|
|
2506
2622
|
|
|
2507
|
-
var avatarLateOceanTheme = {
|
|
2508
|
-
"default": {
|
|
2509
|
-
color: lateOceanColorPalette.white,
|
|
2510
|
-
backgroundColor: lateOceanColorPalette.lateOcean
|
|
2511
|
-
},
|
|
2512
|
-
light: {
|
|
2513
|
-
color: lateOceanColorPalette.black1000,
|
|
2514
|
-
backgroundColor: lateOceanColorPalette.black100
|
|
2515
|
-
}
|
|
2516
|
-
};
|
|
2517
|
-
|
|
2518
2623
|
var colorsLateOceanTheme = {
|
|
2519
2624
|
primary: lateOceanColorPalette.lateOcean,
|
|
2520
2625
|
primaryLight: lateOceanColorPalette.lateOceanLight1,
|
|
@@ -2537,6 +2642,16 @@ var colorsLateOceanTheme = {
|
|
|
2537
2642
|
}
|
|
2538
2643
|
};
|
|
2539
2644
|
|
|
2645
|
+
var avatar = {
|
|
2646
|
+
borderRadius: '10px',
|
|
2647
|
+
"default": {
|
|
2648
|
+
backgroundColor: colorsLateOceanTheme.primary
|
|
2649
|
+
},
|
|
2650
|
+
light: {
|
|
2651
|
+
backgroundColor: lateOceanColorPalette.black100
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
|
|
2540
2655
|
var buttonLateOceanTheme = {
|
|
2541
2656
|
borderRadius: '30px',
|
|
2542
2657
|
borderWidth: {
|
|
@@ -2763,6 +2878,12 @@ var shadowsLateOceanTheme = {
|
|
|
2763
2878
|
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
2764
2879
|
};
|
|
2765
2880
|
|
|
2881
|
+
var skeletonTheme = {
|
|
2882
|
+
backgroundColor: lateOceanColorPalette.black100,
|
|
2883
|
+
flareColor: lateOceanColorPalette.black200,
|
|
2884
|
+
animationDuration: 1000
|
|
2885
|
+
};
|
|
2886
|
+
|
|
2766
2887
|
var tagLateOceanTheme = {
|
|
2767
2888
|
borderRadius: '10px',
|
|
2768
2889
|
padding: '2px 12px',
|
|
@@ -2816,20 +2937,18 @@ var tooltip = {
|
|
|
2816
2937
|
var calcLineHeight = function (fontSize, lineHeightMultiplier) {
|
|
2817
2938
|
return Math.round(fontSize * lineHeightMultiplier);
|
|
2818
2939
|
};
|
|
2819
|
-
|
|
2820
2940
|
var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
|
|
2821
2941
|
return {
|
|
2822
2942
|
baseAndSmall: {
|
|
2823
2943
|
fontSize: "".concat(baseAndSmallFontSize, "px"),
|
|
2824
|
-
lineHeight: "".concat(calcLineHeight(
|
|
2944
|
+
lineHeight: "".concat(calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier), "px")
|
|
2825
2945
|
},
|
|
2826
2946
|
mediumAndWide: {
|
|
2827
2947
|
fontSize: "".concat(mediumAndWideFontSize, "px"),
|
|
2828
|
-
lineHeight: "".concat(calcLineHeight(
|
|
2948
|
+
lineHeight: "".concat(calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier), "px")
|
|
2829
2949
|
}
|
|
2830
2950
|
};
|
|
2831
2951
|
};
|
|
2832
|
-
|
|
2833
2952
|
var typographyLateOceanTheme = {
|
|
2834
2953
|
colors: {
|
|
2835
2954
|
black: lateOceanColorPalette.black1000,
|
|
@@ -2919,7 +3038,7 @@ var theme = {
|
|
|
2919
3038
|
palettes: {
|
|
2920
3039
|
lateOcean: lateOceanColorPalette
|
|
2921
3040
|
},
|
|
2922
|
-
avatar:
|
|
3041
|
+
avatar: avatar,
|
|
2923
3042
|
button: buttonLateOceanTheme,
|
|
2924
3043
|
card: cardLateOceanTheme,
|
|
2925
3044
|
feedbackMessage: feedbackMessageLateOceanTheme,
|
|
@@ -2930,7 +3049,8 @@ var theme = {
|
|
|
2930
3049
|
fullScreenModal: fullScreenModalLateOceanTheme,
|
|
2931
3050
|
iconButton: iconButton,
|
|
2932
3051
|
listItem: listItemLateOceanTheme,
|
|
2933
|
-
tooltip: tooltip
|
|
3052
|
+
tooltip: tooltip,
|
|
3053
|
+
skeleton: skeletonTheme
|
|
2934
3054
|
};
|
|
2935
3055
|
|
|
2936
3056
|
function TimePicker() {
|
|
@@ -3196,40 +3316,46 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3196
3316
|
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
3317
|
var TypographyLinkWebWrapper = withTheme( /*#__PURE__*/styled("span")({
|
|
3198
3318
|
name: "TypographyLinkWebWrapper",
|
|
3199
|
-
"class": "tcwz3nt"
|
|
3319
|
+
"class": "tcwz3nt",
|
|
3320
|
+
vars: {
|
|
3321
|
+
"tcwz3nt-0": [function (_ref) {
|
|
3322
|
+
var $hasNoUnderline = _ref.$hasNoUnderline;
|
|
3323
|
+
return $hasNoUnderline ? 'underline' : 'none';
|
|
3324
|
+
}]
|
|
3325
|
+
}
|
|
3200
3326
|
}));
|
|
3201
3327
|
var StyledLink = /*#__PURE__*/styled$1(Text$1).withConfig({
|
|
3202
3328
|
displayName: "TypographyLink__StyledLink",
|
|
3203
3329
|
componentId: "kitt-universal__sc-1o1zy30-0"
|
|
3204
|
-
})(["text-decoration:", ";", ";", ";"], function (
|
|
3205
|
-
var $
|
|
3206
|
-
return $
|
|
3207
|
-
}, function (_ref2) {
|
|
3208
|
-
var $disabled = _ref2.$disabled;
|
|
3209
|
-
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3330
|
+
})(["text-decoration:", ";", ";", ";"], function (_ref2) {
|
|
3331
|
+
var $hasNoUnderline = _ref2.$hasNoUnderline;
|
|
3332
|
+
return $hasNoUnderline ? 'none' : 'underline';
|
|
3210
3333
|
}, function (_ref3) {
|
|
3211
|
-
var $disabled = _ref3.$disabled
|
|
3212
|
-
|
|
3334
|
+
var $disabled = _ref3.$disabled;
|
|
3335
|
+
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3336
|
+
}, function (_ref4) {
|
|
3337
|
+
var $disabled = _ref4.$disabled,
|
|
3338
|
+
theme = _ref4.theme;
|
|
3213
3339
|
if (!$disabled) return undefined;
|
|
3214
3340
|
return "color: ".concat(theme.kitt.typography.link.disabledColor, ";");
|
|
3215
3341
|
});
|
|
3216
|
-
function TypographyLink(
|
|
3217
|
-
var children =
|
|
3218
|
-
disabled =
|
|
3219
|
-
noUnderline =
|
|
3220
|
-
href =
|
|
3221
|
-
hrefAttrs =
|
|
3222
|
-
onPress =
|
|
3223
|
-
otherProps = _objectWithoutProperties(
|
|
3342
|
+
function TypographyLink(_ref5) {
|
|
3343
|
+
var children = _ref5.children,
|
|
3344
|
+
disabled = _ref5.disabled,
|
|
3345
|
+
noUnderline = _ref5.noUnderline,
|
|
3346
|
+
href = _ref5.href,
|
|
3347
|
+
hrefAttrs = _ref5.hrefAttrs,
|
|
3348
|
+
onPress = _ref5.onPress,
|
|
3349
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$1);
|
|
3224
3350
|
|
|
3225
3351
|
return /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
3226
3352
|
accessibilityRole: "none",
|
|
3227
3353
|
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3228
3354
|
as: TypographyLinkWebWrapper,
|
|
3229
|
-
|
|
3355
|
+
$hasNoUnderline: noUnderline,
|
|
3230
3356
|
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3231
3357
|
$disabled: disabled,
|
|
3232
|
-
$
|
|
3358
|
+
$hasNoUnderline: noUnderline,
|
|
3233
3359
|
href: href,
|
|
3234
3360
|
hrefAttrs: hrefAttrs,
|
|
3235
3361
|
accessibilityRole: "link",
|
|
@@ -3244,25 +3370,35 @@ function TypographyLink(_ref4) {
|
|
|
3244
3370
|
}));
|
|
3245
3371
|
}
|
|
3246
3372
|
|
|
3247
|
-
function matchWindowSize(
|
|
3248
|
-
var
|
|
3249
|
-
|
|
3250
|
-
|
|
3373
|
+
function matchWindowSize(_ref, _ref2) {
|
|
3374
|
+
var width = _ref.width,
|
|
3375
|
+
height = _ref.height;
|
|
3376
|
+
var minWidth = _ref2.minWidth,
|
|
3377
|
+
maxWidth = _ref2.maxWidth,
|
|
3378
|
+
minHeight = _ref2.minHeight,
|
|
3379
|
+
maxHeight = _ref2.maxHeight;
|
|
3380
|
+
var hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
|
|
3381
|
+
var hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
|
|
3382
|
+
return hasWidthMatched && hasHeightMatched;
|
|
3251
3383
|
}
|
|
3252
3384
|
function useMatchWindowSize(options) {
|
|
3253
3385
|
var _useWindowDimensions = useWindowDimensions(),
|
|
3254
|
-
width = _useWindowDimensions.width
|
|
3386
|
+
width = _useWindowDimensions.width,
|
|
3387
|
+
height = _useWindowDimensions.height;
|
|
3255
3388
|
|
|
3256
|
-
return matchWindowSize(
|
|
3389
|
+
return matchWindowSize({
|
|
3390
|
+
width: width,
|
|
3391
|
+
height: height
|
|
3392
|
+
}, options);
|
|
3257
3393
|
}
|
|
3258
3394
|
|
|
3259
|
-
function createWindowSizeHelper(
|
|
3395
|
+
function createWindowSizeHelper(dimensions) {
|
|
3260
3396
|
return {
|
|
3261
3397
|
matchWindowSize: function matchWindowSize$1(options) {
|
|
3262
|
-
return matchWindowSize(
|
|
3398
|
+
return matchWindowSize(dimensions, options);
|
|
3263
3399
|
},
|
|
3264
3400
|
ifWindowSizeMatches: function ifWindowSizeMatches(options, valueIfTrue, valueIfFalse) {
|
|
3265
|
-
return matchWindowSize(
|
|
3401
|
+
return matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse;
|
|
3266
3402
|
},
|
|
3267
3403
|
mapWindowWidth: function mapWindowWidth() {
|
|
3268
3404
|
for (var _len = arguments.length, widthList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3287,7 +3423,7 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3287
3423
|
minWidth = _ref4[0];
|
|
3288
3424
|
_ref4[1];
|
|
3289
3425
|
|
|
3290
|
-
return matchWindowSize(
|
|
3426
|
+
return matchWindowSize(dimensions, {
|
|
3291
3427
|
minWidth: Number(minWidth)
|
|
3292
3428
|
});
|
|
3293
3429
|
});
|
|
@@ -3298,18 +3434,24 @@ function createWindowSizeHelper(currentWidth) {
|
|
|
3298
3434
|
}
|
|
3299
3435
|
|
|
3300
3436
|
function useKittTheme() {
|
|
3301
|
-
var
|
|
3302
|
-
width = _useWindowSize.width;
|
|
3303
|
-
|
|
3437
|
+
var dimensions = useWindowDimensions();
|
|
3304
3438
|
return useMemo(function () {
|
|
3305
3439
|
return {
|
|
3306
3440
|
kitt: theme,
|
|
3307
|
-
responsive: createWindowSizeHelper(
|
|
3441
|
+
responsive: createWindowSizeHelper(dimensions),
|
|
3308
3442
|
breakpoints: breakpoints
|
|
3309
3443
|
};
|
|
3310
|
-
}, [
|
|
3444
|
+
}, [dimensions]);
|
|
3311
3445
|
}
|
|
3312
3446
|
|
|
3447
|
+
var hex2rgba = function (hex) {
|
|
3448
|
+
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
3449
|
+
var r = parseInt(hex.slice(1, 3), 16);
|
|
3450
|
+
var g = parseInt(hex.slice(3, 5), 16);
|
|
3451
|
+
var b = parseInt(hex.slice(5, 7), 16);
|
|
3452
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
|
3453
|
+
};
|
|
3454
|
+
|
|
3313
3455
|
function KittThemeProvider(_ref) {
|
|
3314
3456
|
var children = _ref.children;
|
|
3315
3457
|
var theme = useKittTheme();
|
|
@@ -3342,5 +3484,5 @@ function MatchWindowSize(_ref) {
|
|
|
3342
3484
|
});
|
|
3343
3485
|
}
|
|
3344
3486
|
|
|
3345
|
-
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
3487
|
+
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
|
|
3346
3488
|
//# sourceMappingURL=index-browser-all.es.web.js.map
|