@ornikar/kitt-universal 23.3.0 → 23.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/CHANGELOG.md +9 -0
- package/dist/definitions/BottomSheet/useStaticBottomSheet.d.ts +3 -3
- package/dist/definitions/BottomSheet/useStaticBottomSheet.d.ts.map +1 -1
- package/dist/definitions/forms/DocumentPicker/DocumentPicker.d.ts +15 -0
- package/dist/definitions/forms/DocumentPicker/DocumentPicker.d.ts.map +1 -0
- package/dist/definitions/forms/FilePicker/BottomSheetActions/BottomSheetActions.d.ts +13 -0
- package/dist/definitions/forms/FilePicker/BottomSheetActions/BottomSheetActions.d.ts.map +1 -0
- package/dist/definitions/forms/FilePicker/BottomSheetActions/BottomSheetActionsItem.d.ts +7 -0
- package/dist/definitions/forms/FilePicker/BottomSheetActions/BottomSheetActionsItem.d.ts.map +1 -0
- package/dist/definitions/forms/FilePicker/FilePicker.d.ts +17 -0
- package/dist/definitions/forms/FilePicker/FilePicker.d.ts.map +1 -0
- package/dist/definitions/forms/FilePicker/FilePicker.web.d.ts +4 -0
- package/dist/definitions/forms/FilePicker/FilePicker.web.d.ts.map +1 -0
- package/dist/definitions/forms/ImagePicker/ImagePicker.d.ts +15 -0
- package/dist/definitions/forms/ImagePicker/ImagePicker.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +7 -2
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +311 -164
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +311 -164
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-20.10.cjs.js +231 -83
- package/dist/index-node-20.10.cjs.js.map +1 -1
- package/dist/index-node-20.10.cjs.web.js +62 -0
- package/dist/index-node-20.10.cjs.web.js.map +1 -1
- package/dist/index-node-20.10.es.mjs +231 -86
- package/dist/index-node-20.10.es.mjs.map +1 -1
- package/dist/index-node-20.10.es.web.mjs +60 -1
- package/dist/index-node-20.10.es.web.mjs.map +1 -1
- package/dist/index.es.js +343 -158
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +104 -1
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -1
- package/translations/fr-FR.json +2 -0
|
@@ -11,6 +11,8 @@ export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
|
11
11
|
import { parse } from 'twemoji-parser';
|
|
12
12
|
import { CaretUpFillIcon, CaretDownFillIcon, EyeClosedRegularIcon, EyeRegularIcon, CaretDownRegularIcon, XRegularIcon } from '@ornikar/kitt-icons/phosphor';
|
|
13
13
|
import Downshift, { useSelect } from 'downshift';
|
|
14
|
+
import { getDocumentAsync } from 'expo-document-picker';
|
|
15
|
+
import { launchImageLibraryAsync } from 'expo-image-picker';
|
|
14
16
|
import { useDebouncedCallback } from 'use-debounce';
|
|
15
17
|
import { Loader } from '@googlemaps/js-api-loader';
|
|
16
18
|
import { parseNumber, getCountryCallingCode, isValidNumber } from 'libphonenumber-js';
|
|
@@ -4743,6 +4745,63 @@ const DatePicker = /*#__PURE__*/forwardRef(({
|
|
|
4743
4745
|
});
|
|
4744
4746
|
});
|
|
4745
4747
|
|
|
4748
|
+
function DocumentPicker({
|
|
4749
|
+
onDocumentUpload,
|
|
4750
|
+
children,
|
|
4751
|
+
disabled,
|
|
4752
|
+
documentPickerOptions
|
|
4753
|
+
}) {
|
|
4754
|
+
const childElement = Children.only(children);
|
|
4755
|
+
return /*#__PURE__*/cloneElement(childElement, {
|
|
4756
|
+
// ensure that the press event is not prevented by Button component
|
|
4757
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
4758
|
+
onPress: async () => {
|
|
4759
|
+
if (disabled) return;
|
|
4760
|
+
childElement.props.onPress?.();
|
|
4761
|
+
const result = await getDocumentAsync({
|
|
4762
|
+
...documentPickerOptions,
|
|
4763
|
+
multiple: false
|
|
4764
|
+
});
|
|
4765
|
+
if (!result.canceled && result.assets[0].file) {
|
|
4766
|
+
onDocumentUpload(result.assets[0].file);
|
|
4767
|
+
}
|
|
4768
|
+
},
|
|
4769
|
+
disabled
|
|
4770
|
+
});
|
|
4771
|
+
}
|
|
4772
|
+
|
|
4773
|
+
function FilePicker() {
|
|
4774
|
+
throw new Error('FilePicker only works on native');
|
|
4775
|
+
}
|
|
4776
|
+
|
|
4777
|
+
function ImagePicker({
|
|
4778
|
+
onImageSelected,
|
|
4779
|
+
children,
|
|
4780
|
+
disabled,
|
|
4781
|
+
imagePickerOptions
|
|
4782
|
+
}) {
|
|
4783
|
+
const childElement = Children.only(children);
|
|
4784
|
+
return /*#__PURE__*/jsx(View, {
|
|
4785
|
+
children: /*#__PURE__*/cloneElement(childElement, {
|
|
4786
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
4787
|
+
onPress: async () => {
|
|
4788
|
+
if (disabled) return;
|
|
4789
|
+
childElement.props.onPress?.();
|
|
4790
|
+
|
|
4791
|
+
// No permissions request is necessary for launching the image library
|
|
4792
|
+
const result = await launchImageLibraryAsync({
|
|
4793
|
+
...imagePickerOptions,
|
|
4794
|
+
allowsMultipleSelection: false
|
|
4795
|
+
});
|
|
4796
|
+
if (!result.canceled) {
|
|
4797
|
+
onImageSelected(result.assets[0]);
|
|
4798
|
+
}
|
|
4799
|
+
},
|
|
4800
|
+
disabled
|
|
4801
|
+
})
|
|
4802
|
+
});
|
|
4803
|
+
}
|
|
4804
|
+
|
|
4746
4805
|
const GoogleMapsApiKeyContext = /*#__PURE__*/createContext(undefined);
|
|
4747
4806
|
function GoogleMapsApiKeyProvider({
|
|
4748
4807
|
children,
|
|
@@ -10551,5 +10610,5 @@ function VerticalSteps({
|
|
|
10551
10610
|
}
|
|
10552
10611
|
VerticalSteps.Step = ExternalStep;
|
|
10553
10612
|
|
|
10554
|
-
export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, CardModal, Center, Checkbox, ChoicesElements, CloseIconButton, DatePicker, DialogModal, Emoji, ExternalAppLink, ExternalLink, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, HStack, Highlight, Icon, IconButton, Image, InputAddress, InputEmail, InputFeedback, InputField, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarkerLarge, MapMarkerPosition, MapMarkerSimple, MatchWindowSize, Message, ModalBehaviour, NativeOnlyFlatList, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
|
|
10613
|
+
export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, CardModal, Center, Checkbox, ChoicesElements, CloseIconButton, DatePicker, DialogModal, DocumentPicker, Emoji, ExternalAppLink, ExternalLink, FilePicker, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, HStack, Highlight, Icon, IconButton, Image, ImagePicker, InputAddress, InputEmail, InputFeedback, InputField, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarkerLarge, MapMarkerPosition, MapMarkerSimple, MatchWindowSize, Message, ModalBehaviour, NativeOnlyFlatList, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
|
|
10555
10614
|
//# sourceMappingURL=index-node-20.10.es.web.mjs.map
|