@codeleap/mobile 2.4.6 → 3.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/mobile-packages.code-workspace +27 -0
- package/package.json +25 -33
- package/src/components/ActionIcon/index.tsx +16 -6
- package/src/components/ActionIcon/styles.ts +3 -90
- package/src/components/ActivityIndicator/index.tsx +28 -9
- package/src/components/ActivityIndicator/styles.ts +2 -59
- package/src/components/Autocomplete/index.tsx +235 -0
- package/src/components/Autocomplete/styles.ts +18 -0
- package/src/components/Autocomplete/types.ts +75 -0
- package/src/components/Avatar/index.tsx +126 -0
- package/src/components/Avatar/styles.ts +22 -0
- package/src/components/AvatarGroup/index.tsx +76 -0
- package/src/components/AvatarGroup/styles.ts +11 -0
- package/src/components/Backdrop/index.tsx +14 -13
- package/src/components/Backdrop/styles.ts +3 -24
- package/src/components/Badge/index.tsx +134 -0
- package/src/components/Badge/styles.ts +14 -0
- package/src/components/Button/index.tsx +39 -49
- package/src/components/Button/styles.ts +6 -107
- package/src/components/Calendar/index.tsx +3 -3
- package/src/components/Calendar/style.ts +2 -31
- package/src/components/Checkbox/index.tsx +137 -74
- package/src/components/Checkbox/styles.ts +13 -73
- package/src/components/ContentView/index.tsx +2 -2
- package/src/components/ContentView/styles.ts +1 -17
- package/src/components/DatePickerModal/index.tsx +240 -0
- package/src/components/DatePickerModal/styles.ts +15 -0
- package/src/components/DatePickerModal/types.ts +55 -0
- package/src/components/Drawer/index.tsx +2 -2
- package/src/components/Drawer/styles.ts +4 -39
- package/src/components/EmptyPlaceholder/index.tsx +3 -3
- package/src/components/EmptyPlaceholder/styles.ts +2 -47
- package/src/components/FileInput/styles.ts +1 -8
- package/src/components/Grid/index.tsx +76 -72
- package/src/components/Grid/styles.ts +4 -7
- package/src/components/Icon/index.tsx +46 -8
- package/src/components/Icon/styles.ts +3 -51
- package/src/components/Image/index.tsx +18 -22
- package/src/components/Image/styles.ts +1 -14
- package/src/components/ImageView/Spotlight.tsx +4 -2
- package/src/components/ImageView/component.tsx +0 -3
- package/src/components/InputBase/index.tsx +101 -0
- package/src/components/InputBase/styles.ts +135 -0
- package/src/components/InputBase/types.ts +28 -0
- package/src/components/InputBase/utils.ts +42 -0
- package/src/components/InputLabel/index.tsx +3 -3
- package/src/components/InputLabel/styles.ts +2 -14
- package/src/components/List/PaginationIndicator.tsx +4 -21
- package/src/components/List/index.tsx +84 -46
- package/src/components/List/styles.ts +8 -20
- package/src/components/LoadingOverlay/index.tsx +45 -45
- package/src/components/LoadingOverlay/styles.ts +5 -27
- package/src/components/Modal/index.tsx +57 -32
- package/src/components/Modal/styles.ts +3 -114
- package/src/components/NumberIncrement/index.tsx +318 -0
- package/src/components/NumberIncrement/styles.ts +14 -0
- package/src/components/NumberIncrement/types.ts +44 -0
- package/src/components/NumberIncrement/utils.ts +27 -0
- package/src/components/Pager/index.tsx +120 -67
- package/src/components/Pager/styles.ts +2 -69
- package/src/components/RadioInput/index.tsx +145 -68
- package/src/components/RadioInput/styles.ts +8 -61
- package/src/components/RefreshControl/index.tsx +28 -0
- package/src/components/RefreshControl/styles.ts +7 -0
- package/src/components/Scroll/index.tsx +22 -37
- package/src/components/Scroll/styles.ts +2 -16
- package/src/components/Sections/index.tsx +116 -54
- package/src/components/Sections/styles.ts +7 -0
- package/src/components/SegmentedControl/Option.tsx +51 -0
- package/src/components/SegmentedControl/index.tsx +51 -67
- package/src/components/SegmentedControl/styles.ts +7 -63
- package/src/components/Select/index.tsx +264 -93
- package/src/components/Select/styles.ts +11 -131
- package/src/components/Select/types.ts +47 -11
- package/src/components/Slider/index.tsx +151 -94
- package/src/components/Slider/styles.ts +7 -72
- package/src/components/Slider/types.ts +18 -20
- package/src/components/Switch/index.tsx +115 -63
- package/src/components/Switch/styles.ts +13 -30
- package/src/components/Text/index.tsx +14 -31
- package/src/components/Text/styles.ts +2 -41
- package/src/components/TextInput/index.tsx +237 -259
- package/src/components/TextInput/styles.ts +6 -120
- package/src/components/Touchable/index.tsx +74 -27
- package/src/components/Touchable/styles.ts +1 -12
- package/src/components/View/index.tsx +12 -25
- package/src/components/View/styles.ts +1 -17
- package/src/components/components.ts +9 -5
- package/src/components/defaultStyles.ts +74 -61
- package/src/index.ts +0 -1
- package/src/modules/PressableRipple/index.ts +5 -0
- package/src/modules/PressableRipple/ripple.js +258 -0
- package/src/modules/PressableRipple/styles.js +22 -0
- package/src/modules/PressableRipple/type.ts +17 -0
- package/src/modules/textInputMask.tsx +13 -0
- package/src/types/index.ts +5 -0
- package/src/types/utility.ts +2 -2
- package/src/utils/KeyboardAware/index.ts +0 -13
- package/src/utils/KeyboardAware/keyboardHooks.ts +69 -79
- package/src/utils/hooks.ts +141 -8
- package/src/utils/index.ts +1 -0
- package/src/utils/locale.ts +7 -0
- package/src/utils/theme.ts +1 -21
- package/dist/components/ActionIcon/index.d.ts +0 -13
- package/dist/components/ActionIcon/index.js +0 -51
- package/dist/components/ActionIcon/index.js.map +0 -1
- package/dist/components/ActionIcon/styles.d.ts +0 -65
- package/dist/components/ActionIcon/styles.js +0 -61
- package/dist/components/ActionIcon/styles.js.map +0 -1
- package/dist/components/ActivityIndicator/index.d.ts +0 -15
- package/dist/components/ActivityIndicator/index.js +0 -55
- package/dist/components/ActivityIndicator/index.js.map +0 -1
- package/dist/components/ActivityIndicator/styles.d.ts +0 -59
- package/dist/components/ActivityIndicator/styles.js +0 -52
- package/dist/components/ActivityIndicator/styles.js.map +0 -1
- package/dist/components/Animated.d.ts +0 -15
- package/dist/components/Animated.js +0 -55
- package/dist/components/Animated.js.map +0 -1
- package/dist/components/AutoComplete/index.d.ts +0 -34
- package/dist/components/AutoComplete/index.js +0 -126
- package/dist/components/AutoComplete/index.js.map +0 -1
- package/dist/components/AutoComplete/styles.d.ts +0 -57
- package/dist/components/AutoComplete/styles.js +0 -89
- package/dist/components/AutoComplete/styles.js.map +0 -1
- package/dist/components/Backdrop/index.d.ts +0 -14
- package/dist/components/Backdrop/index.js +0 -59
- package/dist/components/Backdrop/index.js.map +0 -1
- package/dist/components/Backdrop/styles.d.ts +0 -53
- package/dist/components/Backdrop/styles.js +0 -28
- package/dist/components/Backdrop/styles.js.map +0 -1
- package/dist/components/Button/index.d.ts +0 -246
- package/dist/components/Button/index.js +0 -115
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Button/styles.d.ts +0 -65
- package/dist/components/Button/styles.js +0 -61
- package/dist/components/Button/styles.js.map +0 -1
- package/dist/components/Calendar/index.d.ts +0 -15
- package/dist/components/Calendar/index.js +0 -76
- package/dist/components/Calendar/index.js.map +0 -1
- package/dist/components/Calendar/style.d.ts +0 -4
- package/dist/components/Calendar/style.js +0 -36
- package/dist/components/Calendar/style.js.map +0 -1
- package/dist/components/Calendar/types.d.ts +0 -95
- package/dist/components/Calendar/types.js +0 -3
- package/dist/components/Calendar/types.js.map +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -15
- package/dist/components/Checkbox/index.js +0 -81
- package/dist/components/Checkbox/index.js.map +0 -1
- package/dist/components/Checkbox/styles.d.ts +0 -56
- package/dist/components/Checkbox/styles.js +0 -53
- package/dist/components/Checkbox/styles.js.map +0 -1
- package/dist/components/ContentView/index.d.ts +0 -12
- package/dist/components/ContentView/index.js +0 -62
- package/dist/components/ContentView/index.js.map +0 -1
- package/dist/components/ContentView/styles.d.ts +0 -53
- package/dist/components/ContentView/styles.js +0 -26
- package/dist/components/ContentView/styles.js.map +0 -1
- package/dist/components/Drawer/index.d.ts +0 -7
- package/dist/components/Drawer/index.js +0 -66
- package/dist/components/Drawer/index.js.map +0 -1
- package/dist/components/Drawer/styles.d.ts +0 -56
- package/dist/components/Drawer/styles.js +0 -39
- package/dist/components/Drawer/styles.js.map +0 -1
- package/dist/components/EmptyPlaceholder/index.d.ts +0 -25
- package/dist/components/EmptyPlaceholder/index.js +0 -88
- package/dist/components/EmptyPlaceholder/index.js.map +0 -1
- package/dist/components/EmptyPlaceholder/styles.d.ts +0 -55
- package/dist/components/EmptyPlaceholder/styles.js +0 -30
- package/dist/components/EmptyPlaceholder/styles.js.map +0 -1
- package/dist/components/FileInput/index.d.ts +0 -24
- package/dist/components/FileInput/index.js +0 -179
- package/dist/components/FileInput/index.js.map +0 -1
- package/dist/components/FileInput/styles.d.ts +0 -53
- package/dist/components/FileInput/styles.js +0 -19
- package/dist/components/FileInput/styles.js.map +0 -1
- package/dist/components/Grid/index.d.ts +0 -32
- package/dist/components/Grid/index.js +0 -80
- package/dist/components/Grid/index.js.map +0 -1
- package/dist/components/Grid/styles.d.ts +0 -54
- package/dist/components/Grid/styles.js +0 -19
- package/dist/components/Grid/styles.js.map +0 -1
- package/dist/components/Icon/index.d.ts +0 -14
- package/dist/components/Icon/index.js +0 -75
- package/dist/components/Icon/index.js.map +0 -1
- package/dist/components/Icon/styles.d.ts +0 -61
- package/dist/components/Icon/styles.js +0 -49
- package/dist/components/Icon/styles.js.map +0 -1
- package/dist/components/Image/index.d.ts +0 -25
- package/dist/components/Image/index.js +0 -130
- package/dist/components/Image/index.js.map +0 -1
- package/dist/components/Image/styles.d.ts +0 -55
- package/dist/components/Image/styles.js +0 -25
- package/dist/components/Image/styles.js.map +0 -1
- package/dist/components/ImageView/Spotlight.d.ts +0 -25
- package/dist/components/ImageView/Spotlight.js +0 -150
- package/dist/components/ImageView/Spotlight.js.map +0 -1
- package/dist/components/ImageView/component.d.ts +0 -5
- package/dist/components/ImageView/component.js +0 -50
- package/dist/components/ImageView/component.js.map +0 -1
- package/dist/components/ImageView/index.d.ts +0 -2
- package/dist/components/ImageView/index.js +0 -15
- package/dist/components/ImageView/index.js.map +0 -1
- package/dist/components/InputLabel/index.d.ts +0 -12
- package/dist/components/InputLabel/index.js +0 -58
- package/dist/components/InputLabel/index.js.map +0 -1
- package/dist/components/InputLabel/styles.d.ts +0 -4
- package/dist/components/InputLabel/styles.js +0 -26
- package/dist/components/InputLabel/styles.js.map +0 -1
- package/dist/components/List/PaginationIndicator.d.ts +0 -67
- package/dist/components/List/PaginationIndicator.js +0 -51
- package/dist/components/List/PaginationIndicator.js.map +0 -1
- package/dist/components/List/index.d.ts +0 -31
- package/dist/components/List/index.js +0 -77
- package/dist/components/List/index.js.map +0 -1
- package/dist/components/List/styles.d.ts +0 -54
- package/dist/components/List/styles.js +0 -28
- package/dist/components/List/styles.js.map +0 -1
- package/dist/components/LoadingOverlay/index.d.ts +0 -11
- package/dist/components/LoadingOverlay/index.js +0 -60
- package/dist/components/LoadingOverlay/index.js.map +0 -1
- package/dist/components/LoadingOverlay/styles.d.ts +0 -7
- package/dist/components/LoadingOverlay/styles.js +0 -34
- package/dist/components/LoadingOverlay/styles.js.map +0 -1
- package/dist/components/Modal/index.d.ts +0 -43
- package/dist/components/Modal/index.js +0 -142
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/components/Modal/styles.d.ts +0 -58
- package/dist/components/Modal/styles.js +0 -74
- package/dist/components/Modal/styles.js.map +0 -1
- package/dist/components/MultiSelect/index.d.ts +0 -6
- package/dist/components/MultiSelect/index.js +0 -119
- package/dist/components/MultiSelect/index.js.map +0 -1
- package/dist/components/MultiSelect/styles.d.ts +0 -7
- package/dist/components/MultiSelect/styles.js +0 -84
- package/dist/components/MultiSelect/styles.js.map +0 -1
- package/dist/components/MultiSelect/types.d.ts +0 -43
- package/dist/components/MultiSelect/types.js +0 -3
- package/dist/components/MultiSelect/types.js.map +0 -1
- package/dist/components/Navigation/Navigation.d.ts +0 -3
- package/dist/components/Navigation/Navigation.js +0 -80
- package/dist/components/Navigation/Navigation.js.map +0 -1
- package/dist/components/Navigation/constants.d.ts +0 -5
- package/dist/components/Navigation/constants.js +0 -11
- package/dist/components/Navigation/constants.js.map +0 -1
- package/dist/components/Navigation/index.d.ts +0 -3
- package/dist/components/Navigation/index.js +0 -16
- package/dist/components/Navigation/index.js.map +0 -1
- package/dist/components/Navigation/types.d.ts +0 -26
- package/dist/components/Navigation/types.js +0 -8
- package/dist/components/Navigation/types.js.map +0 -1
- package/dist/components/Navigation/utils.d.ts +0 -3
- package/dist/components/Navigation/utils.js +0 -69
- package/dist/components/Navigation/utils.js.map +0 -1
- package/dist/components/Pager/index.d.ts +0 -26
- package/dist/components/Pager/index.js +0 -84
- package/dist/components/Pager/index.js.map +0 -1
- package/dist/components/Pager/styles.d.ts +0 -87
- package/dist/components/Pager/styles.js +0 -72
- package/dist/components/Pager/styles.js.map +0 -1
- package/dist/components/RadioInput/index.d.ts +0 -27
- package/dist/components/RadioInput/index.js +0 -72
- package/dist/components/RadioInput/index.js.map +0 -1
- package/dist/components/RadioInput/styles.d.ts +0 -58
- package/dist/components/RadioInput/styles.js +0 -50
- package/dist/components/RadioInput/styles.js.map +0 -1
- package/dist/components/Scroll/index.d.ts +0 -124
- package/dist/components/Scroll/index.js +0 -97
- package/dist/components/Scroll/index.js.map +0 -1
- package/dist/components/Scroll/styles.d.ts +0 -53
- package/dist/components/Scroll/styles.js +0 -26
- package/dist/components/Scroll/styles.js.map +0 -1
- package/dist/components/Sections/index.d.ts +0 -115
- package/dist/components/Sections/index.js +0 -76
- package/dist/components/Sections/index.js.map +0 -1
- package/dist/components/SegmentedControl/index.d.ts +0 -52
- package/dist/components/SegmentedControl/index.js +0 -131
- package/dist/components/SegmentedControl/index.js.map +0 -1
- package/dist/components/SegmentedControl/styles.d.ts +0 -60
- package/dist/components/SegmentedControl/styles.js +0 -43
- package/dist/components/SegmentedControl/styles.js.map +0 -1
- package/dist/components/Select/index.d.ts +0 -16
- package/dist/components/Select/index.js +0 -122
- package/dist/components/Select/index.js.map +0 -1
- package/dist/components/Select/styles.d.ts +0 -60
- package/dist/components/Select/styles.js +0 -83
- package/dist/components/Select/styles.js.map +0 -1
- package/dist/components/Select/types.d.ts +0 -43
- package/dist/components/Select/types.js +0 -3
- package/dist/components/Select/types.js.map +0 -1
- package/dist/components/Slider/Mark.d.ts +0 -3
- package/dist/components/Slider/Mark.js +0 -32
- package/dist/components/Slider/Mark.js.map +0 -1
- package/dist/components/Slider/Thumb.d.ts +0 -7
- package/dist/components/Slider/Thumb.js +0 -30
- package/dist/components/Slider/Thumb.js.map +0 -1
- package/dist/components/Slider/index.d.ts +0 -4
- package/dist/components/Slider/index.js +0 -99
- package/dist/components/Slider/index.js.map +0 -1
- package/dist/components/Slider/styles.d.ts +0 -54
- package/dist/components/Slider/styles.js +0 -61
- package/dist/components/Slider/styles.js.map +0 -1
- package/dist/components/Slider/types.d.ts +0 -26
- package/dist/components/Slider/types.js +0 -3
- package/dist/components/Slider/types.js.map +0 -1
- package/dist/components/Switch/index.d.ts +0 -14
- package/dist/components/Switch/index.js +0 -81
- package/dist/components/Switch/index.js.map +0 -1
- package/dist/components/Switch/styles.d.ts +0 -55
- package/dist/components/Switch/styles.js +0 -34
- package/dist/components/Switch/styles.js.map +0 -1
- package/dist/components/Text/index.d.ts +0 -25
- package/dist/components/Text/index.js +0 -121
- package/dist/components/Text/index.js.map +0 -1
- package/dist/components/Text/styles.d.ts +0 -70
- package/dist/components/Text/styles.js +0 -34
- package/dist/components/Text/styles.js.map +0 -1
- package/dist/components/TextInput/index.d.ts +0 -181
- package/dist/components/TextInput/index.js +0 -213
- package/dist/components/TextInput/index.js.map +0 -1
- package/dist/components/TextInput/styles.d.ts +0 -63
- package/dist/components/TextInput/styles.js +0 -65
- package/dist/components/TextInput/styles.js.map +0 -1
- package/dist/components/Touchable/index.d.ts +0 -22
- package/dist/components/Touchable/index.js +0 -165
- package/dist/components/Touchable/index.js.map +0 -1
- package/dist/components/Touchable/styles.d.ts +0 -58
- package/dist/components/Touchable/styles.js +0 -24
- package/dist/components/Touchable/styles.js.map +0 -1
- package/dist/components/View/index.d.ts +0 -23
- package/dist/components/View/index.js +0 -102
- package/dist/components/View/index.js.map +0 -1
- package/dist/components/View/styles.d.ts +0 -54
- package/dist/components/View/styles.js +0 -29
- package/dist/components/View/styles.js.map +0 -1
- package/dist/components/components.d.ts +0 -37
- package/dist/components/components.js +0 -50
- package/dist/components/components.js.map +0 -1
- package/dist/components/defaultStyles.d.ts +0 -1468
- package/dist/components/defaultStyles.js +0 -67
- package/dist/components/defaultStyles.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -39
- package/dist/index.js.map +0 -1
- package/dist/modules/documentPicker.d.ts +0 -3
- package/dist/modules/documentPicker.js +0 -12
- package/dist/modules/documentPicker.js.map +0 -1
- package/dist/modules/fastImage.d.ts +0 -1
- package/dist/modules/fastImage.js +0 -10
- package/dist/modules/fastImage.js.map +0 -1
- package/dist/modules/reactNavigation.d.ts +0 -5
- package/dist/modules/reactNavigation.js +0 -26
- package/dist/modules/reactNavigation.js.map +0 -1
- package/dist/modules/rnDeviceInfo.d.ts +0 -2
- package/dist/modules/rnDeviceInfo.js +0 -10
- package/dist/modules/rnDeviceInfo.js.map +0 -1
- package/dist/modules/textInputMask.d.ts +0 -10
- package/dist/modules/textInputMask.js +0 -19
- package/dist/modules/textInputMask.js.map +0 -1
- package/dist/modules/types/fileTypes.d.ts +0 -138
- package/dist/modules/types/fileTypes.js +0 -3
- package/dist/modules/types/fileTypes.js.map +0 -1
- package/dist/modules/types/textInputMask.d.ts +0 -7
- package/dist/modules/types/textInputMask.js +0 -3
- package/dist/modules/types/textInputMask.js.map +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -14
- package/dist/types/index.js.map +0 -1
- package/dist/types/utility.d.ts +0 -14
- package/dist/types/utility.js +0 -3
- package/dist/types/utility.js.map +0 -1
- package/dist/utils/KeyboardAware/context.d.ts +0 -13
- package/dist/utils/KeyboardAware/context.js +0 -63
- package/dist/utils/KeyboardAware/context.js.map +0 -1
- package/dist/utils/KeyboardAware/index.d.ts +0 -8
- package/dist/utils/KeyboardAware/index.js +0 -29
- package/dist/utils/KeyboardAware/index.js.map +0 -1
- package/dist/utils/KeyboardAware/keyboardHooks.d.ts +0 -26
- package/dist/utils/KeyboardAware/keyboardHooks.js +0 -87
- package/dist/utils/KeyboardAware/keyboardHooks.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js +0 -9
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +0 -67
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +0 -439
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.d.ts +0 -7
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js +0 -4
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js +0 -10
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js.map +0 -1
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.d.ts +0 -3
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js +0 -10
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js.map +0 -1
- package/dist/utils/KeyboardAware/types.d.ts +0 -1
- package/dist/utils/KeyboardAware/types.js +0 -7
- package/dist/utils/KeyboardAware/types.js.map +0 -1
- package/dist/utils/ModalManager/components.d.ts +0 -20
- package/dist/utils/ModalManager/components.js +0 -114
- package/dist/utils/ModalManager/components.js.map +0 -1
- package/dist/utils/ModalManager/context.d.ts +0 -48
- package/dist/utils/ModalManager/context.js +0 -201
- package/dist/utils/ModalManager/context.js.map +0 -1
- package/dist/utils/ModalManager/index.d.ts +0 -11
- package/dist/utils/ModalManager/index.js +0 -13
- package/dist/utils/ModalManager/index.js.map +0 -1
- package/dist/utils/OSAlert.d.ts +0 -32
- package/dist/utils/OSAlert.js +0 -143
- package/dist/utils/OSAlert.js.map +0 -1
- package/dist/utils/PermissionManager/context.d.ts +0 -53
- package/dist/utils/PermissionManager/context.js +0 -320
- package/dist/utils/PermissionManager/context.js.map +0 -1
- package/dist/utils/PermissionManager/index.d.ts +0 -4
- package/dist/utils/PermissionManager/index.js +0 -9
- package/dist/utils/PermissionManager/index.js.map +0 -1
- package/dist/utils/PermissionManager/types.d.ts +0 -13
- package/dist/utils/PermissionManager/types.js +0 -3
- package/dist/utils/PermissionManager/types.js.map +0 -1
- package/dist/utils/hooks.d.ts +0 -42
- package/dist/utils/hooks.js +0 -174
- package/dist/utils/hooks.js.map +0 -1
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.js +0 -36
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/input.d.ts +0 -35
- package/dist/utils/input.js +0 -49
- package/dist/utils/input.js.map +0 -1
- package/dist/utils/misc.d.ts +0 -6
- package/dist/utils/misc.js +0 -87
- package/dist/utils/misc.js.map +0 -1
- package/dist/utils/notifications.d.ts +0 -34
- package/dist/utils/notifications.js +0 -268
- package/dist/utils/notifications.js.map +0 -1
- package/dist/utils/theme.d.ts +0 -42
- package/dist/utils/theme.js +0 -50
- package/dist/utils/theme.js.map +0 -1
- package/src/components/Animated.tsx +0 -34
- package/src/components/AutoComplete/index.tsx +0 -167
- package/src/components/AutoComplete/styles.ts +0 -150
- package/src/components/MultiSelect/index.tsx +0 -148
- package/src/components/MultiSelect/styles.ts +0 -131
- package/src/components/MultiSelect/types.ts +0 -51
- package/src/components/Slider/Mark.tsx +0 -46
- package/src/components/Slider/Thumb.tsx +0 -29
- package/src/modules/textInputMask.ts +0 -11
- package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +0 -4
- package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +0 -592
- package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +0 -13
- package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +0 -6
- package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +0 -6
|
@@ -1,81 +1,21 @@
|
|
|
1
1
|
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
-
import {
|
|
2
|
+
import { InputBaseParts, InputBaseStates } from '../InputBase'
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
| 'input'
|
|
7
|
-
| 'inputFeedback'
|
|
8
|
-
| 'checkmark'
|
|
9
|
-
| 'checkmarkWrapper'
|
|
10
|
-
| 'error'
|
|
11
|
-
| `label${Capitalize<InputLabelComposition>}`
|
|
4
|
+
type AnimatableParts = 'checkmarkWrapper' | 'box'
|
|
5
|
+
export type CheckboxParts = InputBaseParts | AnimatableParts | 'checkmark'
|
|
12
6
|
|
|
13
|
-
export type
|
|
14
|
-
| CheckboxParts
|
|
15
|
-
| `${CheckboxParts}:checked`
|
|
16
|
-
| `${CheckboxParts}:disabled`
|
|
17
|
-
| `${CheckboxParts}:error`
|
|
18
|
-
const createCheckboxStyle =
|
|
19
|
-
createDefaultVariantFactory<CheckboxComposition>()
|
|
20
|
-
|
|
21
|
-
const presets = includePresets((styles) => createCheckboxStyle(() => ({ wrapper: styles })),
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
export const CheckboxStyles = {
|
|
25
|
-
...presets,
|
|
26
|
-
default: createCheckboxStyle((theme) => {
|
|
27
|
-
const size = theme.typography.baseFontSize * 1.2
|
|
7
|
+
export type CheckboxAnimationStates = 'checked' | 'unchecked' | 'disabled-checked' | 'disabled-unchecked'
|
|
28
8
|
|
|
29
|
-
|
|
30
|
-
const markWidth = size * 0.25
|
|
9
|
+
export type CheckboxStates = InputBaseStates
|
|
31
10
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...theme.presets.alignCenter,
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
labelWrapper: {
|
|
42
|
-
// flex: 1,
|
|
43
|
-
...theme.spacing.marginLeft(1),
|
|
11
|
+
export type CheckboxComposition =
|
|
12
|
+
| CheckboxParts
|
|
13
|
+
| `${CheckboxParts}:${CheckboxStates}`
|
|
14
|
+
| `${AnimatableParts}:transition`
|
|
15
|
+
| `${AnimatableParts}:${CheckboxAnimationStates}`
|
|
16
|
+
| '__props'
|
|
44
17
|
|
|
45
|
-
|
|
46
|
-
inputFeedback: {
|
|
47
|
-
type: 'opacity',
|
|
48
|
-
value: 0.5,
|
|
49
|
-
},
|
|
18
|
+
const createCheckboxStyle = createDefaultVariantFactory<CheckboxComposition>()
|
|
50
19
|
|
|
51
|
-
|
|
52
|
-
position: 'absolute',
|
|
53
|
-
top: '40%',
|
|
54
|
-
left: '50%',
|
|
20
|
+
export const CheckboxPresets = includePresets((styles) => createCheckboxStyle(() => ({ wrapper: styles })))
|
|
55
21
|
|
|
56
|
-
height: markHeight,
|
|
57
|
-
width: markWidth,
|
|
58
|
-
transform: [{ translateX }, { translateY }, { rotate: '45deg' }],
|
|
59
|
-
},
|
|
60
|
-
'checkmark:checked': {
|
|
61
|
-
...theme.border.white({
|
|
62
|
-
width: 2,
|
|
63
|
-
directions: ['right', 'bottom'],
|
|
64
|
-
}),
|
|
65
|
-
},
|
|
66
|
-
checkmarkWrapper: {
|
|
67
|
-
position: 'relative',
|
|
68
|
-
width: size,
|
|
69
|
-
borderRadius: theme.borderRadius.small,
|
|
70
|
-
height: size,
|
|
71
|
-
...theme.border.neutral(1),
|
|
72
|
-
},
|
|
73
|
-
'checkmarkWrapper:checked': {
|
|
74
|
-
backgroundColor: theme.colors.primary,
|
|
75
|
-
},
|
|
76
|
-
error: {
|
|
77
|
-
color: theme.colors.negative,
|
|
78
|
-
},
|
|
79
|
-
}
|
|
80
|
-
}),
|
|
81
|
-
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
|
|
7
7
|
} from '@codeleap/common'
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
ContentViewPresets,
|
|
10
10
|
} from './styles'
|
|
11
11
|
import { ViewProps, View, ViewComposition } from '../View'
|
|
12
12
|
import { Text } from '../Text'
|
|
@@ -23,7 +23,7 @@ export type ContentViewProps = Omit<
|
|
|
23
23
|
message?: string
|
|
24
24
|
loading?: boolean
|
|
25
25
|
styles?: StylesOf<ViewComposition>
|
|
26
|
-
} & ComponentVariants<typeof
|
|
26
|
+
} & ComponentVariants<typeof ContentViewPresets>
|
|
27
27
|
|
|
28
28
|
const WrapContent = ({ children, ...props }) => (
|
|
29
29
|
<View {...props}>{children}</View>
|
|
@@ -5,20 +5,4 @@ export type ContentViewComposition = 'placeholder' | 'wrapper' | 'loader'
|
|
|
5
5
|
const createContentViewStyle =
|
|
6
6
|
createDefaultVariantFactory<ContentViewComposition>()
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
export const ContentViewStyles = {
|
|
12
|
-
...presets,
|
|
13
|
-
default: createContentViewStyle((theme) => ({
|
|
14
|
-
wrapper: {
|
|
15
|
-
display: 'flex',
|
|
16
|
-
...theme.presets.column,
|
|
17
|
-
},
|
|
18
|
-
loader: {
|
|
19
|
-
alignSelf: 'center',
|
|
20
|
-
height: theme.values.width * 0.15,
|
|
21
|
-
width: theme.values.width * 0.15,
|
|
22
|
-
},
|
|
23
|
-
})),
|
|
24
|
-
}
|
|
8
|
+
export const ContentViewPresets = includePresets((styles) => createContentViewStyle(() => ({ wrapper: styles })))
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import React, { useRef } from 'react'
|
|
2
|
+
import { useState, useCodeleapContext, useDefaultComponentStyle, TypeGuards, useBooleanToggle, useNestedStylesByKey, useI18N } from '@codeleap/common'
|
|
3
|
+
import { DatePickerModalPresets } from './styles'
|
|
4
|
+
import DatePicker from 'react-native-date-picker'
|
|
5
|
+
import { TextInput } from '../TextInput'
|
|
6
|
+
import { ModalManager } from '../../utils'
|
|
7
|
+
import { Button } from '../Button'
|
|
8
|
+
import { StyleSheet } from 'react-native'
|
|
9
|
+
import { DatePickerModalProps } from './types'
|
|
10
|
+
|
|
11
|
+
export * from './styles'
|
|
12
|
+
export * from './types'
|
|
13
|
+
|
|
14
|
+
const OuterInputComponent:DatePickerModalProps['outerInputComponent'] = (props) => {
|
|
15
|
+
const {
|
|
16
|
+
debugName,
|
|
17
|
+
toggle,
|
|
18
|
+
valueLabel,
|
|
19
|
+
placeholder,
|
|
20
|
+
...otherProps
|
|
21
|
+
} = props
|
|
22
|
+
|
|
23
|
+
return <TextInput
|
|
24
|
+
debugName={`${debugName} outer input`}
|
|
25
|
+
onPress={toggle}
|
|
26
|
+
{...otherProps}
|
|
27
|
+
value={TypeGuards.isString(valueLabel) ? valueLabel : ''}
|
|
28
|
+
placeholder={TypeGuards.isString(placeholder) ? placeholder : ''}
|
|
29
|
+
/>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const defaultFormatDate:DatePickerModalProps['formatDate'] = (date) => {
|
|
33
|
+
if (!date) return null
|
|
34
|
+
return `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const DefaultFooter:DatePickerModalProps['footerComponent'] = (props) => {
|
|
38
|
+
const {
|
|
39
|
+
debugName,
|
|
40
|
+
commitDate,
|
|
41
|
+
showDoneButton,
|
|
42
|
+
styles,
|
|
43
|
+
confirm,
|
|
44
|
+
confirmButtonProps = {},
|
|
45
|
+
cancelButtonProps = {},
|
|
46
|
+
toggle,
|
|
47
|
+
} = props
|
|
48
|
+
|
|
49
|
+
if (commitDate == 'onConfirm') {
|
|
50
|
+
return <>
|
|
51
|
+
<Button
|
|
52
|
+
debugName={`${debugName} cancel button`}
|
|
53
|
+
styles={styles.cancel}
|
|
54
|
+
variants={['flex']}
|
|
55
|
+
text={`Cancel`}
|
|
56
|
+
onPress={toggle}
|
|
57
|
+
{...cancelButtonProps}
|
|
58
|
+
/>
|
|
59
|
+
<Button
|
|
60
|
+
debugName={`${debugName} confirm button`}
|
|
61
|
+
variants={['flex']}
|
|
62
|
+
styles={styles.confirm}
|
|
63
|
+
text={`Confirm`}
|
|
64
|
+
onPress={confirm}
|
|
65
|
+
{...confirmButtonProps}
|
|
66
|
+
/>
|
|
67
|
+
</>
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!showDoneButton) return null
|
|
72
|
+
|
|
73
|
+
return <Button
|
|
74
|
+
debugName={`${debugName} done button`}
|
|
75
|
+
onPress={confirm}
|
|
76
|
+
text={'Done'}
|
|
77
|
+
styles={styles.done}
|
|
78
|
+
|
|
79
|
+
/>
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const defaultProps:Partial<DatePickerModalProps> = {
|
|
83
|
+
outerInputComponent: OuterInputComponent,
|
|
84
|
+
formatDate: defaultFormatDate,
|
|
85
|
+
footerComponent: DefaultFooter,
|
|
86
|
+
mode: 'date',
|
|
87
|
+
commitDate: 'onConfirm',
|
|
88
|
+
showDoneButton: true,
|
|
89
|
+
isCustomModal: true,
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const DatePickerModal = (props: DatePickerModalProps) => {
|
|
93
|
+
|
|
94
|
+
const { currentTheme } = useCodeleapContext()
|
|
95
|
+
|
|
96
|
+
const allProps = {
|
|
97
|
+
...defaultProps,
|
|
98
|
+
...props,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const {
|
|
102
|
+
isCustomModal,
|
|
103
|
+
hideInput,
|
|
104
|
+
visible: _visible,
|
|
105
|
+
toggle: _toggle,
|
|
106
|
+
value: _value,
|
|
107
|
+
onValueChange,
|
|
108
|
+
formatDate,
|
|
109
|
+
debugName,
|
|
110
|
+
cancelButtonProps = {},
|
|
111
|
+
confirmButtonProps = {},
|
|
112
|
+
outerInputComponent,
|
|
113
|
+
footer,
|
|
114
|
+
variants = [],
|
|
115
|
+
styles = {},
|
|
116
|
+
placeholder = '',
|
|
117
|
+
datePickerProps,
|
|
118
|
+
mode,
|
|
119
|
+
label,
|
|
120
|
+
commitDate,
|
|
121
|
+
description,
|
|
122
|
+
showDoneButton,
|
|
123
|
+
style,
|
|
124
|
+
footerComponent,
|
|
125
|
+
...modalProps
|
|
126
|
+
} = allProps
|
|
127
|
+
|
|
128
|
+
const variantStyles = useDefaultComponentStyle<'u:DatePickerModal', typeof DatePickerModalPresets>('u:DatePickerModal', {
|
|
129
|
+
variants,
|
|
130
|
+
styles,
|
|
131
|
+
rootElement: 'inputWrapper',
|
|
132
|
+
transform: StyleSheet.flatten,
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
const [visible, toggle] = !TypeGuards.isNil(_visible) && !!_toggle ? [_visible, _toggle] : useBooleanToggle(false)
|
|
136
|
+
const [value, setValue] = [_value, onValueChange]
|
|
137
|
+
//const [value, setValue] = _value && onValueChange ? [_value, onValueChange] : useState(_value ?? new Date())
|
|
138
|
+
|
|
139
|
+
const Wrapper = isCustomModal ? ModalManager.Modal : React.Fragment
|
|
140
|
+
|
|
141
|
+
const OuterInput = outerInputComponent
|
|
142
|
+
const Footer = footerComponent
|
|
143
|
+
|
|
144
|
+
const inputStyle = useNestedStylesByKey('input', variantStyles)
|
|
145
|
+
const doneStyle = useNestedStylesByKey('doneButton', variantStyles)
|
|
146
|
+
const cancelStyle = useNestedStylesByKey('cancelButton', variantStyles)
|
|
147
|
+
const confirmStyle = useNestedStylesByKey('confirmButton', variantStyles)
|
|
148
|
+
|
|
149
|
+
const formattedDate = value ? formatDate(value) : placeholder
|
|
150
|
+
const { locale } = useI18N()
|
|
151
|
+
|
|
152
|
+
const tempDate = useRef<Date|null>(null)
|
|
153
|
+
|
|
154
|
+
const onConfirm = () => {
|
|
155
|
+
if (commitDate == 'onConfirm') {
|
|
156
|
+
setValue(tempDate.current)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (isCustomModal) {
|
|
160
|
+
toggle()
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const modalFooter = footer || <Footer
|
|
165
|
+
{...allProps}
|
|
166
|
+
confirm={onConfirm}
|
|
167
|
+
styles={{
|
|
168
|
+
done: doneStyle,
|
|
169
|
+
cancel: cancelStyle,
|
|
170
|
+
confirm: confirmStyle,
|
|
171
|
+
}}
|
|
172
|
+
confirmButtonProps={confirmButtonProps}
|
|
173
|
+
cancelButtonProps={cancelButtonProps}
|
|
174
|
+
showDoneButton={showDoneButton}
|
|
175
|
+
value={value}
|
|
176
|
+
debugName={debugName}
|
|
177
|
+
visible={visible}
|
|
178
|
+
toggle={toggle}
|
|
179
|
+
onValueChange={setValue}
|
|
180
|
+
valueLabel={formattedDate}
|
|
181
|
+
/>
|
|
182
|
+
|
|
183
|
+
const wrapperProps = isCustomModal ? {
|
|
184
|
+
title: label,
|
|
185
|
+
description: description,
|
|
186
|
+
debugName: `${debugName} Modal`,
|
|
187
|
+
visible: visible,
|
|
188
|
+
toggle: toggle,
|
|
189
|
+
styles: variantStyles,
|
|
190
|
+
footer: modalFooter,
|
|
191
|
+
...modalProps,
|
|
192
|
+
id: null,
|
|
193
|
+
} : {}
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<>
|
|
197
|
+
{!hideInput && <OuterInput
|
|
198
|
+
{...allProps}
|
|
199
|
+
styles={inputStyle}
|
|
200
|
+
value={value}
|
|
201
|
+
debugName={debugName}
|
|
202
|
+
visible={visible}
|
|
203
|
+
toggle={toggle}
|
|
204
|
+
onValueChange={setValue}
|
|
205
|
+
valueLabel={formattedDate}
|
|
206
|
+
style={style}
|
|
207
|
+
|
|
208
|
+
/>}
|
|
209
|
+
{/* @ts-expect-error */}
|
|
210
|
+
<Wrapper {...wrapperProps} >
|
|
211
|
+
<DatePicker
|
|
212
|
+
modal={!isCustomModal}
|
|
213
|
+
open={visible}
|
|
214
|
+
onCancel={toggle}
|
|
215
|
+
date={value ?? new Date()}
|
|
216
|
+
onDateChange={(date) => {
|
|
217
|
+
if (commitDate === 'onChange') {
|
|
218
|
+
setValue(date)
|
|
219
|
+
return
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
tempDate.current = date
|
|
223
|
+
}}
|
|
224
|
+
locale={locale}
|
|
225
|
+
theme={currentTheme === 'dark' ? 'dark' : 'light' }
|
|
226
|
+
textColor={variantStyles?.picker?.color}
|
|
227
|
+
androidVariant='iosClone'
|
|
228
|
+
onConfirm={setValue}
|
|
229
|
+
{...datePickerProps}
|
|
230
|
+
mode={mode}
|
|
231
|
+
|
|
232
|
+
/>
|
|
233
|
+
</Wrapper>
|
|
234
|
+
|
|
235
|
+
</>
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
DatePickerModal.defaultProps = defaultProps
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
import { ButtonComposition } from '../Button'
|
|
3
|
+
import { ModalComposition } from '../Modal'
|
|
4
|
+
import { TextInputComposition } from '../TextInput'
|
|
5
|
+
|
|
6
|
+
export type DatePickerModalComposition =
|
|
7
|
+
ModalComposition |
|
|
8
|
+
`input${Capitalize<TextInputComposition>}` |
|
|
9
|
+
`picker` |
|
|
10
|
+
`doneButton${Capitalize<ButtonComposition>}` |
|
|
11
|
+
`confirmButton${Capitalize<ButtonComposition>}` |
|
|
12
|
+
`cancelButton${Capitalize<ButtonComposition>}`
|
|
13
|
+
|
|
14
|
+
const createDatePickerModalStyle = createDefaultVariantFactory<DatePickerModalComposition>()
|
|
15
|
+
export const DatePickerModalPresets = includePresets((styles) => createDatePickerModalStyle(() => ({ inputWrapper: styles })))
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ComponentVariants, StylesOf, FormTypes } from '@codeleap/common'
|
|
3
|
+
import { DatePickerModalComposition, DatePickerModalPresets } from './styles'
|
|
4
|
+
import { DatePickerProps } from 'react-native-date-picker'
|
|
5
|
+
import { TextInputComposition } from '../TextInput'
|
|
6
|
+
import { ButtonComposition, ButtonProps } from '../Button'
|
|
7
|
+
import { ModalProps } from '../Modal'
|
|
8
|
+
|
|
9
|
+
type DatePickerModalOuterInputProps = Omit<DatePickerModalProps, 'outerInputComponent' | 'styles'> & {
|
|
10
|
+
valueLabel: FormTypes.Label
|
|
11
|
+
styles?: StylesOf<TextInputComposition>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type DatePickerModalFooterProps = Omit<DatePickerModalProps, 'outerInputComponent' | 'styles'> & {
|
|
15
|
+
valueLabel: FormTypes.Label
|
|
16
|
+
styles?: Record<
|
|
17
|
+
'confirm' | 'cancel' | 'done',
|
|
18
|
+
StylesOf<ButtonComposition>
|
|
19
|
+
>
|
|
20
|
+
confirm: () => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type DatePickerModalProps = Omit<ModalProps, 'styles' | 'variants' | 'ref'> & {
|
|
24
|
+
hideInput?: boolean
|
|
25
|
+
debugName: string
|
|
26
|
+
|
|
27
|
+
value: Date
|
|
28
|
+
|
|
29
|
+
label?: FormTypes.Label
|
|
30
|
+
|
|
31
|
+
placeholder?: FormTypes.Label
|
|
32
|
+
|
|
33
|
+
onValueChange: (date: Date) => void
|
|
34
|
+
|
|
35
|
+
styles?: StylesOf<DatePickerModalComposition>
|
|
36
|
+
|
|
37
|
+
isCustomModal?: boolean
|
|
38
|
+
mode?: DatePickerProps['mode']
|
|
39
|
+
|
|
40
|
+
cancelButtonProps?: Partial<ButtonProps>
|
|
41
|
+
confirmButtonProps?: Partial<ButtonProps>
|
|
42
|
+
|
|
43
|
+
datePickerProps?: Partial<DatePickerProps>
|
|
44
|
+
|
|
45
|
+
outerInputComponent?: React.ComponentType<DatePickerModalOuterInputProps>
|
|
46
|
+
|
|
47
|
+
formatDate?: (date: Date) => FormTypes.Label
|
|
48
|
+
|
|
49
|
+
commitDate?: 'onConfirm' | 'onChange'
|
|
50
|
+
|
|
51
|
+
showDoneButton?: boolean
|
|
52
|
+
|
|
53
|
+
footerComponent?: React.ComponentType<DatePickerModalFooterProps>
|
|
54
|
+
|
|
55
|
+
} & ComponentVariants<typeof DatePickerModalPresets>
|
|
@@ -3,9 +3,9 @@ import * as React from 'react'
|
|
|
3
3
|
import { ComponentVariants, useDefaultComponentStyle } from '@codeleap/common'
|
|
4
4
|
import { StyleSheet } from 'react-native'
|
|
5
5
|
import Modal, { ModalProps } from '../Modal'
|
|
6
|
-
import {
|
|
6
|
+
import { DrawerPresets } from './styles'
|
|
7
7
|
export * from './styles'
|
|
8
|
-
export type DrawerProps = Omit<ModalProps, 'variants'> & ComponentVariants<typeof
|
|
8
|
+
export type DrawerProps = Omit<ModalProps, 'variants'> & ComponentVariants<typeof DrawerPresets>
|
|
9
9
|
|
|
10
10
|
export const Drawer:React.FC<DrawerProps> = (props) => {
|
|
11
11
|
const { variants, styles, scrollProps, ...modalProps } = props
|
|
@@ -1,43 +1,8 @@
|
|
|
1
|
-
import { createDefaultVariantFactory } from '@codeleap/common'
|
|
2
|
-
import { ModalComposition
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
import { ModalComposition } from '../Modal'
|
|
3
3
|
|
|
4
4
|
export type DrawerComposition = ModalComposition
|
|
5
|
-
const createDrawerStyle = createDefaultVariantFactory<DrawerComposition>()
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
...ModalStyles,
|
|
9
|
-
default: createDrawerStyle((theme) => {
|
|
10
|
-
const defaultStyle = ModalStyles.default(theme)
|
|
6
|
+
const createModalStyle = createDefaultVariantFactory<DrawerComposition>()
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
...defaultStyle,
|
|
14
|
-
box: {
|
|
15
|
-
width: '100%',
|
|
16
|
-
paddingBottom: 0,
|
|
17
|
-
paddingTop: 0,
|
|
18
|
-
borderBottomLeftRadius: 0,
|
|
19
|
-
borderBottomRightRadius: 0,
|
|
20
|
-
maxHeight: '100%',
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
innerWrapper: {
|
|
24
|
-
...theme.presets.justifyEnd,
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
'box:hidden': {
|
|
29
|
-
translateY: theme.values.height,
|
|
30
|
-
opacity: 1,
|
|
31
|
-
scale: 1,
|
|
32
|
-
},
|
|
33
|
-
'box:visible': {
|
|
34
|
-
translateY: 0,
|
|
35
|
-
scale: 1,
|
|
36
|
-
opacity: 1,
|
|
37
|
-
},
|
|
38
|
-
'box:transition': {
|
|
39
|
-
translateY: theme.values.transitions.modal,
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
}),
|
|
43
|
-
}
|
|
8
|
+
export const DrawerPresets = includePresets((style) => createModalStyle(() => ({ body: style })))
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
15
|
EmptyPlaceholderComposition,
|
|
16
|
-
|
|
16
|
+
EmptyPlaceholderPresets,
|
|
17
17
|
} from './styles'
|
|
18
18
|
|
|
19
19
|
import { ImageSourcePropType, StyleSheet, Image as RNImage } from 'react-native'
|
|
@@ -33,7 +33,7 @@ export type EmptyPlaceholderProps = {
|
|
|
33
33
|
loading?: boolean
|
|
34
34
|
|
|
35
35
|
styles?: StylesOf<EmptyPlaceholderComposition>
|
|
36
|
-
variants?: ComponentVariants<typeof
|
|
36
|
+
variants?: ComponentVariants<typeof EmptyPlaceholderPresets>['variants']
|
|
37
37
|
|
|
38
38
|
renderEmpty?: (props: {
|
|
39
39
|
emptyText:string | React.ReactElement
|
|
@@ -56,7 +56,7 @@ export const EmptyPlaceholder:React.FC<EmptyPlaceholderProps> = (props: EmptyPla
|
|
|
56
56
|
} = props
|
|
57
57
|
const emptyText = title || (itemName && `No ${itemName} found.`) || 'No items.'
|
|
58
58
|
|
|
59
|
-
const componentStyles = useDefaultComponentStyle<'u:EmptyPlaceholder', typeof
|
|
59
|
+
const componentStyles = useDefaultComponentStyle<'u:EmptyPlaceholder', typeof EmptyPlaceholderPresets>('u:EmptyPlaceholder', {
|
|
60
60
|
variants,
|
|
61
61
|
transform: StyleSheet.flatten,
|
|
62
62
|
styles,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
2
|
import { ActivityIndicatorComposition } from '../ActivityIndicator'
|
|
3
3
|
|
|
4
4
|
export type EmptyPlaceholderComposition =
|
|
@@ -13,49 +13,4 @@ export type EmptyPlaceholderComposition =
|
|
|
13
13
|
|
|
14
14
|
const createEmptyPlaceholderStyle = createDefaultVariantFactory<EmptyPlaceholderComposition>()
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
export const EmptyPlaceholderStyles = {
|
|
20
|
-
...presets,
|
|
21
|
-
default: createEmptyPlaceholderStyle((theme) => ({
|
|
22
|
-
wrapper: {
|
|
23
|
-
flexGrow: 1,
|
|
24
|
-
...theme.presets.center,
|
|
25
|
-
},
|
|
26
|
-
title: {
|
|
27
|
-
...assignTextStyle('h3')(theme).text,
|
|
28
|
-
...theme.spacing.marginBottom(theme.values.innerSpacing.Y),
|
|
29
|
-
},
|
|
30
|
-
description: {
|
|
31
|
-
...assignTextStyle('p1')(theme).text,
|
|
32
|
-
},
|
|
33
|
-
imageWrapper: {
|
|
34
|
-
...theme.spacing.paddingBottom(theme.values.innerSpacing.Y * 2),
|
|
35
|
-
...theme.presets.fullWidth,
|
|
36
|
-
...theme.presets.alignCenter,
|
|
37
|
-
height: '45%',
|
|
38
|
-
},
|
|
39
|
-
image: {
|
|
40
|
-
...theme.presets.fullHeight,
|
|
41
|
-
},
|
|
42
|
-
})),
|
|
43
|
-
compact: createEmptyPlaceholderStyle((theme) => ({
|
|
44
|
-
wrapper: {
|
|
45
|
-
...theme.spacing.marginVertical(0),
|
|
46
|
-
marginBottom: theme.spacing.value(6),
|
|
47
|
-
},
|
|
48
|
-
})),
|
|
49
|
-
absolute: createEmptyPlaceholderStyle((theme) => ({
|
|
50
|
-
'wrapper:loading': {
|
|
51
|
-
...theme.presets.absolute,
|
|
52
|
-
...theme.presets.whole,
|
|
53
|
-
backgroundColor: theme.colors.background,
|
|
54
|
-
},
|
|
55
|
-
wrapper: {
|
|
56
|
-
...theme.presets.absolute,
|
|
57
|
-
...theme.presets.whole,
|
|
58
|
-
backgroundColor: theme.colors.background,
|
|
59
|
-
},
|
|
60
|
-
})),
|
|
61
|
-
}
|
|
16
|
+
export const EmptyPlaceholderPresets = includePresets((styles) => createEmptyPlaceholderStyle(() => ({ wrapper: styles })))
|
|
@@ -5,11 +5,4 @@ export type FileInputComposition = 'label' | 'wrapper' | 'input'
|
|
|
5
5
|
const createFileInputStyle =
|
|
6
6
|
createDefaultVariantFactory<FileInputComposition>()
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
export const FileInputStyles = {
|
|
12
|
-
...presets,
|
|
13
|
-
default: createFileInputStyle((theme) => ({})),
|
|
14
|
-
|
|
15
|
-
}
|
|
8
|
+
export const FileInputPresets = includePresets((styles) => createFileInputStyle(() => ({ wrapper: styles })))
|