@ornikar/kitt-universal 7.0.1 → 7.0.4
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/TimePicker/useTimePicker.d.ts +2 -0
- package/dist/definitions/TimePicker/useTimePicker.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +11 -7
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +11 -7
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +11 -7
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +3 -2
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +6 -6
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.js +3 -2
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import { UserIcon, CheckboxMark, XIcon, EyeOffIcon, EyeIcon, ArcIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
|
|
4
4
|
export * from '@ornikar/kitt-icons';
|
|
5
|
-
import { useWindowDimensions,
|
|
5
|
+
import { useWindowDimensions, Platform, Image, Linking, Pressable, StyleSheet, ScrollView, Modal as Modal$1, Text as Text$1, TextInput, View, Animated as Animated$1, Easing, ActivityIndicator } from 'react-native';
|
|
6
6
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
7
7
|
import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
8
8
|
import { cloneElement, useContext, createContext, forwardRef, useMemo, useState, useRef, useEffect, Fragment as Fragment$1, Children } from 'react';
|
|
@@ -221,8 +221,9 @@ function TypographyText(props) {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
function TypographyParagraph(props) {
|
|
224
|
+
// role 'paragraph' does not exist in native, it's a web feature only.
|
|
224
225
|
return /*#__PURE__*/jsx(Typography, _objectSpread({
|
|
225
|
-
accessibilityRole:
|
|
226
|
+
accessibilityRole: Platform.OS === 'web' ? 'paragraph' : null
|
|
226
227
|
}, props));
|
|
227
228
|
}
|
|
228
229
|
|
|
@@ -316,7 +317,7 @@ function AvatarContent(_ref5) {
|
|
|
316
317
|
|
|
317
318
|
if (firstname && lastname) {
|
|
318
319
|
return /*#__PURE__*/jsx(Typography.Text, {
|
|
319
|
-
base: sizeVariant === 'large' ? 'body-large' : 'body',
|
|
320
|
+
base: sizeVariant === 'large' ? 'body-large' : 'body-small',
|
|
320
321
|
variant: sizeVariant === 'large' ? 'bold' : 'regular',
|
|
321
322
|
color: isLight ? 'black' : 'white',
|
|
322
323
|
children: getInitials(firstname, lastname)
|
|
@@ -3897,6 +3898,12 @@ function ModalDateTimePicker(_ref2) {
|
|
|
3897
3898
|
}
|
|
3898
3899
|
|
|
3899
3900
|
var timePickerPlaceholder = '--:--';
|
|
3901
|
+
var formatNumberToTimeString = function (time) {
|
|
3902
|
+
return "".concat(String(time).padStart(2, '0'));
|
|
3903
|
+
};
|
|
3904
|
+
var formatDateToTimeString = function (date) {
|
|
3905
|
+
return "".concat(formatNumberToTimeString(date.getHours()), ":").concat(formatNumberToTimeString(date.getMinutes()));
|
|
3906
|
+
};
|
|
3900
3907
|
var useTimePicker = function (value, onChange, onBlur, disabled, defaultValue) {
|
|
3901
3908
|
var _useState = useState(false),
|
|
3902
3909
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3909,10 +3916,7 @@ var useTimePicker = function (value, onChange, onBlur, disabled, defaultValue) {
|
|
|
3909
3916
|
}, []);
|
|
3910
3917
|
var defaultDate = defaultValue || todayAtNoon;
|
|
3911
3918
|
var dateTimePickerValue = value || defaultDate;
|
|
3912
|
-
var displayedValue = value === null ? timePickerPlaceholder :
|
|
3913
|
-
minute: 'numeric',
|
|
3914
|
-
hour: 'numeric'
|
|
3915
|
-
}).format(dateTimePickerValue);
|
|
3919
|
+
var displayedValue = value === null ? timePickerPlaceholder : formatDateToTimeString(dateTimePickerValue);
|
|
3916
3920
|
var timePickerState = isTimePickerModalVisible ? 'focus' : 'default';
|
|
3917
3921
|
return {
|
|
3918
3922
|
dateTimePickerValue: dateTimePickerValue,
|