@ornikar/kitt-universal 6.1.0 → 7.0.2
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 +5 -4
- package/dist/definitions/Avatar/Avatar.d.ts.map +1 -1
- package/dist/definitions/Icon/Icon.d.ts +1 -1
- package/dist/definitions/Icon/Icon.d.ts.map +1 -1
- package/dist/definitions/Icon/SpinningIcon.d.ts +4 -3
- package/dist/definitions/Icon/SpinningIcon.d.ts.map +1 -1
- package/dist/definitions/Icon/SpinningIcon.web.d.ts +1 -1
- package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
- package/dist/definitions/LoaderIcon/LoaderIcon.d.ts +7 -0
- package/dist/definitions/LoaderIcon/LoaderIcon.d.ts.map +1 -0
- package/dist/definitions/Overlay/Overlay.d.ts +1 -1
- package/dist/definitions/Overlay/Overlay.d.ts.map +1 -1
- package/dist/definitions/PageLoader/PageLoader.d.ts +4 -0
- package/dist/definitions/PageLoader/PageLoader.d.ts.map +1 -0
- package/dist/definitions/PageLoader/PageLoader.web.d.ts +3 -0
- package/dist/definitions/PageLoader/PageLoader.web.d.ts.map +1 -0
- package/dist/definitions/TimePicker/useTimePicker.d.ts +2 -0
- package/dist/definitions/TimePicker/useTimePicker.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +5 -6
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +37 -36
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/avatar.d.ts +7 -3
- package/dist/definitions/themes/late-ocean/avatar.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/pageLoader.d.ts +5 -0
- package/dist/definitions/themes/late-ocean/pageLoader.d.ts.map +1 -0
- package/dist/index-browser-all.es.android.js +107 -137
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +107 -137
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +107 -137
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +107 -142
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +63 -92
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -1
- package/dist/index-node-14.17.cjs.web.js +75 -104
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +13 -5
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +13 -5
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +13 -5
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +13 -5
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +13 -5
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +13 -5
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/definitions/Loader/LargeLoader.d.ts +0 -7
- package/dist/definitions/Loader/LargeLoader.d.ts.map +0 -1
- package/dist/definitions/Loader/LargeLoader.web.d.ts +0 -3
- package/dist/definitions/Loader/LargeLoader.web.d.ts.map +0 -1
- package/dist/definitions/Loader/Loader.d.ts +0 -8
- package/dist/definitions/Loader/Loader.d.ts.map +0 -1
- package/dist/definitions/Loader/Loader.web.d.ts +0 -8
- package/dist/definitions/Loader/Loader.web.d.ts.map +0 -1
- package/dist/definitions/typography/TypographySpinningIcon.d.ts +0 -9
- package/dist/definitions/typography/TypographySpinningIcon.d.ts.map +0 -1
|
@@ -290,10 +290,11 @@ const StyledAvatarView = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
290
290
|
})(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], ({
|
|
291
291
|
theme,
|
|
292
292
|
$isRound,
|
|
293
|
-
$size
|
|
293
|
+
$size,
|
|
294
|
+
$sizeVariant
|
|
294
295
|
}) => {
|
|
295
296
|
if ($isRound) return `${$size / 2}px`;
|
|
296
|
-
return `${theme.kitt.avatar.borderRadius}px`;
|
|
297
|
+
return `${$sizeVariant === 'large' ? theme.kitt.avatar.large.borderRadius : theme.kitt.avatar.borderRadius}px`;
|
|
297
298
|
}, ({
|
|
298
299
|
theme,
|
|
299
300
|
$isLight
|
|
@@ -309,8 +310,8 @@ function AvatarContent({
|
|
|
309
310
|
firstname,
|
|
310
311
|
lastname,
|
|
311
312
|
alt,
|
|
312
|
-
|
|
313
|
-
|
|
313
|
+
isLight,
|
|
314
|
+
sizeVariant
|
|
314
315
|
}) {
|
|
315
316
|
if (src) {
|
|
316
317
|
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
|
|
@@ -327,8 +328,8 @@ function AvatarContent({
|
|
|
327
328
|
|
|
328
329
|
if (firstname && lastname) {
|
|
329
330
|
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
330
|
-
base:
|
|
331
|
-
variant:
|
|
331
|
+
base: sizeVariant === 'large' ? 'body-large' : 'body',
|
|
332
|
+
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
332
333
|
color: isLight ? 'black' : 'white',
|
|
333
334
|
children: getInitials(firstname, lastname)
|
|
334
335
|
});
|
|
@@ -343,19 +344,20 @@ function AvatarContent({
|
|
|
343
344
|
|
|
344
345
|
function Avatar({
|
|
345
346
|
size = 40,
|
|
346
|
-
base = 'body-small',
|
|
347
347
|
round,
|
|
348
348
|
light,
|
|
349
|
+
sizeVariant,
|
|
349
350
|
...props
|
|
350
351
|
}) {
|
|
351
352
|
return /*#__PURE__*/jsxRuntime.jsx(StyledAvatarView, {
|
|
352
353
|
$size: size,
|
|
353
354
|
$isRound: round,
|
|
354
355
|
$isLight: light,
|
|
356
|
+
$sizeVariant: sizeVariant,
|
|
355
357
|
children: /*#__PURE__*/jsxRuntime.jsx(AvatarContent, {
|
|
356
358
|
size: size,
|
|
357
|
-
base: base,
|
|
358
359
|
isLight: light,
|
|
360
|
+
sizeVariant: sizeVariant,
|
|
359
361
|
...props
|
|
360
362
|
})
|
|
361
363
|
});
|
|
@@ -938,6 +940,9 @@ const avatar = {
|
|
|
938
940
|
},
|
|
939
941
|
light: {
|
|
940
942
|
backgroundColor: lateOceanColorPalette.black100
|
|
943
|
+
},
|
|
944
|
+
large: {
|
|
945
|
+
borderRadius: 30
|
|
941
946
|
}
|
|
942
947
|
};
|
|
943
948
|
|
|
@@ -1325,6 +1330,10 @@ const listItem = {
|
|
|
1325
1330
|
innerMargin: 8
|
|
1326
1331
|
};
|
|
1327
1332
|
|
|
1333
|
+
const pageLoader = {
|
|
1334
|
+
size: 60
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1328
1337
|
const shadows = {
|
|
1329
1338
|
medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
|
|
1330
1339
|
};
|
|
@@ -1415,19 +1424,20 @@ const theme = {
|
|
|
1415
1424
|
lateOcean: lateOceanColorPalette
|
|
1416
1425
|
},
|
|
1417
1426
|
avatar,
|
|
1427
|
+
breakpoints,
|
|
1418
1428
|
button,
|
|
1419
1429
|
card,
|
|
1420
1430
|
feedbackMessage,
|
|
1421
1431
|
forms,
|
|
1422
|
-
typography,
|
|
1423
|
-
tag,
|
|
1424
|
-
shadows,
|
|
1425
1432
|
fullScreenModal,
|
|
1426
1433
|
iconButton,
|
|
1427
1434
|
listItem,
|
|
1428
|
-
|
|
1435
|
+
pageLoader,
|
|
1436
|
+
shadows,
|
|
1429
1437
|
skeleton,
|
|
1430
|
-
|
|
1438
|
+
tag,
|
|
1439
|
+
tooltip,
|
|
1440
|
+
typography
|
|
1431
1441
|
};
|
|
1432
1442
|
|
|
1433
1443
|
function matchWindowSize({
|
|
@@ -1769,8 +1779,7 @@ function Overlay({
|
|
|
1769
1779
|
}) {
|
|
1770
1780
|
return /*#__PURE__*/jsxRuntime.jsx(OverlayPressable, {
|
|
1771
1781
|
accessibilityRole: "none",
|
|
1772
|
-
onPress: onPress
|
|
1773
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {})
|
|
1782
|
+
onPress: onPress
|
|
1774
1783
|
});
|
|
1775
1784
|
}
|
|
1776
1785
|
|
|
@@ -2878,10 +2887,12 @@ FullScreenModal.Body = FullScreenModalBody;
|
|
|
2878
2887
|
|
|
2879
2888
|
function SpinningIcon({
|
|
2880
2889
|
icon,
|
|
2881
|
-
size = defaultIconSize,
|
|
2882
|
-
align,
|
|
2883
2890
|
color
|
|
2884
2891
|
}) {
|
|
2892
|
+
if (process.env.NODE_ENV !== 'production' && !color) {
|
|
2893
|
+
throw new Error(`Invalid color passed to SpinningIcon: ${String(color)}`);
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2885
2896
|
const clonedIcon = /*#__PURE__*/react.cloneElement(icon, {
|
|
2886
2897
|
color
|
|
2887
2898
|
});
|
|
@@ -2905,18 +2916,13 @@ function SpinningIcon({
|
|
|
2905
2916
|
return undefined;
|
|
2906
2917
|
};
|
|
2907
2918
|
}, []);
|
|
2908
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
rotate: rotation
|
|
2916
|
-
}]
|
|
2917
|
-
},
|
|
2918
|
-
children: clonedIcon
|
|
2919
|
-
})
|
|
2919
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.Animated.View, {
|
|
2920
|
+
style: {
|
|
2921
|
+
transform: [{
|
|
2922
|
+
rotate: rotation
|
|
2923
|
+
}]
|
|
2924
|
+
},
|
|
2925
|
+
children: clonedIcon
|
|
2920
2926
|
});
|
|
2921
2927
|
}
|
|
2922
2928
|
|
|
@@ -3042,31 +3048,12 @@ ListItem.Content = ListItemContent;
|
|
|
3042
3048
|
ListItem.SideContent = ListItemSideContent;
|
|
3043
3049
|
ListItem.SideContainer = ListItemSideContainer;
|
|
3044
3050
|
|
|
3045
|
-
function
|
|
3046
|
-
|
|
3047
|
-
return size < 36 ? 'small' : 'large';
|
|
3048
|
-
}
|
|
3049
|
-
|
|
3050
|
-
const defaultLoaderSize = defaultIconSize;
|
|
3051
|
-
function Loader({
|
|
3052
|
-
color = 'primary',
|
|
3053
|
-
size = defaultLoaderSize
|
|
3054
|
-
}) {
|
|
3055
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
3056
|
-
const colorHex = theme.kitt.typography.colors[color];
|
|
3057
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactNative.ActivityIndicator, {
|
|
3058
|
-
testID: "ActivityIndicator",
|
|
3059
|
-
color: colorHex,
|
|
3060
|
-
size: getActivityIndicatorSize(size)
|
|
3061
|
-
});
|
|
3062
|
-
}
|
|
3063
|
-
|
|
3064
|
-
function LargeLoader({
|
|
3065
|
-
color = 'primary'
|
|
3051
|
+
function LoaderIcon({
|
|
3052
|
+
color
|
|
3066
3053
|
}) {
|
|
3067
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
3054
|
+
return /*#__PURE__*/jsxRuntime.jsx(SpinningIcon, {
|
|
3068
3055
|
color: color,
|
|
3069
|
-
|
|
3056
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.ArcIcon, {})
|
|
3070
3057
|
});
|
|
3071
3058
|
}
|
|
3072
3059
|
|
|
@@ -3253,6 +3240,24 @@ function Notification({
|
|
|
3253
3240
|
});
|
|
3254
3241
|
}
|
|
3255
3242
|
|
|
3243
|
+
function getActivityIndicatorSize(size) {
|
|
3244
|
+
if (reactNative.Platform.OS === 'android') return size;
|
|
3245
|
+
return size < 36 ? 'small' : 'large';
|
|
3246
|
+
}
|
|
3247
|
+
|
|
3248
|
+
function PageLoader() {
|
|
3249
|
+
const theme = /*#__PURE__*/styled.useTheme();
|
|
3250
|
+
const {
|
|
3251
|
+
size
|
|
3252
|
+
} = theme.kitt.pageLoader;
|
|
3253
|
+
const colorHex = theme.kitt.typography.colors.primary;
|
|
3254
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactNative.ActivityIndicator, {
|
|
3255
|
+
testID: "ActivityIndicator",
|
|
3256
|
+
color: colorHex,
|
|
3257
|
+
size: getActivityIndicatorSize(size)
|
|
3258
|
+
});
|
|
3259
|
+
}
|
|
3260
|
+
|
|
3256
3261
|
const Container$2 = /*#__PURE__*/styled__default.View.withConfig({
|
|
3257
3262
|
displayName: "SkeletonContent__Container",
|
|
3258
3263
|
componentId: "kitt-universal__sc-1u3chjb-0"
|
|
@@ -3831,6 +3836,8 @@ function ModalDateTimePicker({
|
|
|
3831
3836
|
}
|
|
3832
3837
|
|
|
3833
3838
|
const timePickerPlaceholder = '--:--';
|
|
3839
|
+
const formatNumberToTimeString = time => `${String(time).padStart(2, '0')}`;
|
|
3840
|
+
const formatDateToTimeString = date => `${formatNumberToTimeString(date.getHours())}:${formatNumberToTimeString(date.getMinutes())}`;
|
|
3834
3841
|
const useTimePicker = (value, onChange, onBlur, disabled, defaultValue) => {
|
|
3835
3842
|
const [isTimePickerModalVisible, setIsTimePickerModalVisible] = react.useState(false);
|
|
3836
3843
|
const todayAtNoon = react.useMemo(() => {
|
|
@@ -3839,10 +3846,7 @@ const useTimePicker = (value, onChange, onBlur, disabled, defaultValue) => {
|
|
|
3839
3846
|
}, []);
|
|
3840
3847
|
const defaultDate = defaultValue || todayAtNoon;
|
|
3841
3848
|
const dateTimePickerValue = value || defaultDate;
|
|
3842
|
-
const displayedValue = value === null ? timePickerPlaceholder :
|
|
3843
|
-
minute: 'numeric',
|
|
3844
|
-
hour: 'numeric'
|
|
3845
|
-
}).format(dateTimePickerValue);
|
|
3849
|
+
const displayedValue = value === null ? timePickerPlaceholder : formatDateToTimeString(dateTimePickerValue);
|
|
3846
3850
|
const timePickerState = isTimePickerModalVisible ? 'focus' : 'default';
|
|
3847
3851
|
return {
|
|
3848
3852
|
dateTimePickerValue,
|
|
@@ -4167,39 +4171,6 @@ function TypographyLink({
|
|
|
4167
4171
|
});
|
|
4168
4172
|
}
|
|
4169
4173
|
|
|
4170
|
-
function TypographySpinningIconSpecifiedColor({
|
|
4171
|
-
color,
|
|
4172
|
-
...props
|
|
4173
|
-
}) {
|
|
4174
|
-
const theme = /*#__PURE__*/styled.useTheme();
|
|
4175
|
-
return /*#__PURE__*/jsxRuntime.jsx(SpinningIcon, { ...props,
|
|
4176
|
-
color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
|
|
4177
|
-
});
|
|
4178
|
-
}
|
|
4179
|
-
|
|
4180
|
-
function TypographySpinningIconInheritColor(props) {
|
|
4181
|
-
const color = useTypographyColor();
|
|
4182
|
-
return /*#__PURE__*/jsxRuntime.jsx(TypographySpinningIconSpecifiedColor, {
|
|
4183
|
-
color: color,
|
|
4184
|
-
...props
|
|
4185
|
-
});
|
|
4186
|
-
}
|
|
4187
|
-
|
|
4188
|
-
function TypographySpinningIcon({
|
|
4189
|
-
color,
|
|
4190
|
-
...props
|
|
4191
|
-
}) {
|
|
4192
|
-
if (color) {
|
|
4193
|
-
return /*#__PURE__*/jsxRuntime.jsx(TypographySpinningIconSpecifiedColor, {
|
|
4194
|
-
color: color,
|
|
4195
|
-
...props
|
|
4196
|
-
});
|
|
4197
|
-
}
|
|
4198
|
-
|
|
4199
|
-
return /*#__PURE__*/jsxRuntime.jsx(TypographySpinningIconInheritColor, { ...props
|
|
4200
|
-
});
|
|
4201
|
-
}
|
|
4202
|
-
|
|
4203
4174
|
const hex2rgba = (hex, alpha = 1) => {
|
|
4204
4175
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
4205
4176
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
@@ -4264,13 +4235,14 @@ exports.KittBreakpointsMax = KittBreakpointsMax;
|
|
|
4264
4235
|
exports.KittThemeDecorator = KittThemeDecorator;
|
|
4265
4236
|
exports.KittThemeProvider = KittThemeProvider;
|
|
4266
4237
|
exports.Label = Label;
|
|
4267
|
-
exports.LargeLoader = LargeLoader;
|
|
4268
4238
|
exports.ListItem = ListItem;
|
|
4269
|
-
exports.
|
|
4239
|
+
exports.LoaderIcon = LoaderIcon;
|
|
4270
4240
|
exports.MatchWindowSize = MatchWindowSize;
|
|
4271
4241
|
exports.Message = Message;
|
|
4272
4242
|
exports.Modal = Modal;
|
|
4273
4243
|
exports.Notification = Notification;
|
|
4244
|
+
exports.Overlay = Overlay;
|
|
4245
|
+
exports.PageLoader = PageLoader;
|
|
4274
4246
|
exports.Radio = Radio;
|
|
4275
4247
|
exports.Section = DeprecatedSection;
|
|
4276
4248
|
exports.Skeleton = Skeleton;
|
|
@@ -4291,7 +4263,6 @@ exports.Typography = Typography;
|
|
|
4291
4263
|
exports.TypographyEmoji = TypographyEmoji;
|
|
4292
4264
|
exports.TypographyIcon = TypographyIcon;
|
|
4293
4265
|
exports.TypographyLink = TypographyLink;
|
|
4294
|
-
exports.TypographySpinningIcon = TypographySpinningIcon;
|
|
4295
4266
|
exports.createWindowSizeHelper = createWindowSizeHelper;
|
|
4296
4267
|
exports.hex2rgba = hex2rgba;
|
|
4297
4268
|
exports.matchWindowSize = matchWindowSize;
|