@codeleap/mobile 1.9.33 → 2.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/components/ActionIcon/index.d.ts +13 -0
- package/dist/components/ActionIcon/index.js +54 -0
- package/dist/components/ActionIcon/index.js.map +1 -0
- package/dist/components/ActionIcon/styles.d.ts +64 -0
- package/dist/components/ActionIcon/styles.js +57 -0
- package/dist/components/ActionIcon/styles.js.map +1 -0
- package/dist/components/{ActivityIndicator.d.ts → ActivityIndicator/index.d.ts} +4 -2
- package/dist/components/{ActivityIndicator.js → ActivityIndicator/index.js} +5 -1
- package/dist/components/ActivityIndicator/index.js.map +1 -0
- package/dist/components/ActivityIndicator/styles.d.ts +59 -0
- package/dist/components/ActivityIndicator/styles.js +52 -0
- package/dist/components/ActivityIndicator/styles.js.map +1 -0
- package/dist/components/AutoComplete/index.d.ts +33 -0
- package/dist/components/AutoComplete/index.js +129 -0
- package/dist/components/AutoComplete/index.js.map +1 -0
- package/dist/components/AutoComplete/styles.d.ts +57 -0
- package/dist/components/AutoComplete/styles.js +28 -0
- package/dist/components/AutoComplete/styles.js.map +1 -0
- package/dist/components/Backdrop/index.d.ts +14 -0
- package/dist/components/{Backdrop.js → Backdrop/index.js} +21 -30
- package/dist/components/Backdrop/index.js.map +1 -0
- package/dist/components/{Backdrop.d.ts → Backdrop/styles.d.ts} +7 -20
- package/dist/components/Backdrop/styles.js +28 -0
- package/dist/components/Backdrop/styles.js.map +1 -0
- package/dist/components/Button/index.d.ts +247 -0
- package/dist/components/{Button.js → Button/index.js} +45 -13
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Button/styles.d.ts +65 -0
- package/dist/components/Button/styles.js +61 -0
- package/dist/components/Button/styles.js.map +1 -0
- package/dist/components/Calendar/index.d.ts +15 -0
- package/dist/components/Calendar/index.js +80 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Calendar/style.d.ts +4 -0
- package/dist/components/Calendar/style.js +36 -0
- package/dist/components/Calendar/style.js.map +1 -0
- package/dist/components/Calendar/types.d.ts +95 -0
- package/dist/components/Calendar/types.js +3 -0
- package/dist/components/Calendar/types.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -2
- package/dist/components/Checkbox/index.js +5 -3
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.d.ts +53 -53
- package/dist/components/Checkbox/styles.js +6 -2
- package/dist/components/Checkbox/styles.js.map +1 -1
- package/dist/components/{ContentView.d.ts → ContentView/index.d.ts} +5 -3
- package/dist/components/{ContentView.js → ContentView/index.js} +19 -4
- package/dist/components/ContentView/index.js.map +1 -0
- package/dist/components/ContentView/styles.d.ts +53 -0
- package/dist/components/ContentView/styles.js +26 -0
- package/dist/components/ContentView/styles.js.map +1 -0
- package/dist/components/Drawer/index.d.ts +7 -0
- package/dist/components/{View.js → Drawer/index.js} +18 -15
- package/dist/components/Drawer/index.js.map +1 -0
- package/dist/components/{NewModal → Drawer}/styles.d.ts +55 -56
- package/dist/components/Drawer/styles.js +37 -0
- package/dist/components/Drawer/styles.js.map +1 -0
- package/dist/components/{EmptyPlaceholder.d.ts → EmptyPlaceholder/index.d.ts} +4 -2
- package/dist/components/{EmptyPlaceholder.js → EmptyPlaceholder/index.js} +9 -5
- package/dist/components/EmptyPlaceholder/index.js.map +1 -0
- package/dist/components/EmptyPlaceholder/styles.d.ts +55 -0
- package/dist/components/EmptyPlaceholder/styles.js +32 -0
- package/dist/components/EmptyPlaceholder/styles.js.map +1 -0
- package/dist/components/{FileInput.d.ts → FileInput/index.d.ts} +8 -6
- package/dist/components/{FileInput.js → FileInput/index.js} +13 -30
- package/dist/components/FileInput/index.js.map +1 -0
- package/dist/components/FileInput/styles.d.ts +53 -0
- package/dist/components/FileInput/styles.js +19 -0
- package/dist/components/FileInput/styles.js.map +1 -0
- package/dist/components/Grid/index.d.ts +30 -0
- package/dist/components/Grid/index.js +69 -0
- package/dist/components/Grid/index.js.map +1 -0
- package/dist/components/Grid/styles.d.ts +5 -0
- package/dist/components/Grid/styles.js +19 -0
- package/dist/components/Grid/styles.js.map +1 -0
- package/dist/components/{Icon.d.ts → Icon/index.d.ts} +3 -1
- package/dist/components/{Icon.js → Icon/index.js} +6 -2
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/{NewPager → Icon}/styles.d.ts +59 -86
- package/dist/components/Icon/styles.js +45 -0
- package/dist/components/Icon/styles.js.map +1 -0
- package/dist/components/{Image.d.ts → Image/index.d.ts} +6 -4
- package/dist/components/{Image.js → Image/index.js} +38 -7
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Image/styles.d.ts +54 -0
- package/dist/components/Image/styles.js +25 -0
- package/dist/components/Image/styles.js.map +1 -0
- package/dist/components/ImageView/Spotlight.d.ts +25 -0
- package/dist/components/ImageView/Spotlight.js +155 -0
- package/dist/components/ImageView/Spotlight.js.map +1 -0
- package/dist/components/ImageView/component.d.ts +5 -0
- package/dist/components/ImageView/component.js +54 -0
- package/dist/components/ImageView/component.js.map +1 -0
- package/dist/components/ImageView/index.d.ts +2 -0
- package/dist/components/ImageView/index.js +19 -0
- package/dist/components/ImageView/index.js.map +1 -0
- package/dist/components/List/PaginationIndicator.d.ts +67 -0
- package/dist/components/List/PaginationIndicator.js +51 -0
- package/dist/components/List/PaginationIndicator.js.map +1 -0
- package/dist/components/{List.d.ts → List/index.d.ts} +12 -15
- package/dist/components/List/index.js +68 -0
- package/dist/components/List/index.js.map +1 -0
- package/dist/components/List/styles.d.ts +5 -0
- package/dist/components/List/styles.js +24 -0
- package/dist/components/List/styles.js.map +1 -0
- package/dist/components/Modal/index.d.ts +13 -3
- package/dist/components/Modal/index.js +23 -8
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.d.ts +55 -55
- package/dist/components/Modal/styles.js +4 -3
- package/dist/components/Modal/styles.js.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +6 -0
- package/dist/components/MultiSelect/index.js +106 -0
- package/dist/components/MultiSelect/index.js.map +1 -0
- package/dist/components/MultiSelect/styles.d.ts +58 -0
- package/dist/components/MultiSelect/styles.js +22 -0
- package/dist/components/MultiSelect/styles.js.map +1 -0
- package/dist/components/MultiSelect/types.d.ts +32 -0
- package/dist/components/MultiSelect/types.js +3 -0
- package/dist/components/MultiSelect/types.js.map +1 -0
- package/dist/components/Navigation/Navigation.js +1 -5
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/Navigation/utils.js +0 -1
- package/dist/components/Navigation/utils.js.map +1 -1
- package/dist/components/Pager/index.d.ts +18 -12
- package/dist/components/Pager/index.js +54 -134
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/styles.d.ts +42 -9
- package/dist/components/Pager/styles.js +53 -25
- package/dist/components/Pager/styles.js.map +1 -1
- package/dist/components/RadioInput/index.d.ts +4 -4
- package/dist/components/RadioInput/index.js +3 -1
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.d.ts +54 -54
- package/dist/components/RadioInput/styles.js +12 -7
- package/dist/components/RadioInput/styles.js.map +1 -1
- package/dist/components/Scroll/index.d.ts +18 -0
- package/dist/components/{Scroll.js → Scroll/index.js} +14 -11
- package/dist/components/Scroll/index.js.map +1 -0
- package/dist/components/Scroll/styles.d.ts +4 -0
- package/dist/components/Scroll/styles.js +27 -0
- package/dist/components/Scroll/styles.js.map +1 -0
- package/dist/components/Sections/index.d.ts +11 -0
- package/dist/components/{Sections.js → Sections/index.js} +4 -5
- package/dist/components/Sections/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.d.ts +10 -1
- package/dist/components/SegmentedControl/index.js +27 -27
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/styles.d.ts +56 -51
- package/dist/components/SegmentedControl/styles.js +10 -3
- package/dist/components/SegmentedControl/styles.js.map +1 -1
- package/dist/components/Select/index.d.ts +8 -0
- package/dist/components/Select/index.js +37 -80
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.d.ts +57 -7
- package/dist/components/Select/styles.js +17 -41
- package/dist/components/Select/styles.js.map +1 -1
- package/dist/components/Select/types.d.ts +16 -25
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +4 -0
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.d.ts +53 -0
- package/dist/components/Slider/styles.js +61 -0
- package/dist/components/Slider/styles.js.map +1 -0
- package/dist/components/Slider/types.d.ts +3 -2
- package/dist/components/{Switch.d.ts → Switch/index.d.ts} +3 -2
- package/dist/components/{Switch.js → Switch/index.js} +9 -5
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Switch/styles.d.ts +54 -0
- package/dist/components/Switch/styles.js +34 -0
- package/dist/components/Switch/styles.js.map +1 -0
- package/dist/components/{Text.d.ts → Text/index.d.ts} +7 -3
- package/dist/components/{Text.js → Text/index.js} +53 -5
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Text/styles.d.ts +70 -0
- package/dist/components/Text/styles.js +31 -0
- package/dist/components/Text/styles.js.map +1 -0
- package/dist/components/TextInput/Label.d.ts +9 -0
- package/dist/components/TextInput/Label.js +34 -0
- package/dist/components/TextInput/Label.js.map +1 -0
- package/dist/components/{TextInput.d.ts → TextInput/index.d.ts} +42 -45
- package/dist/components/TextInput/index.js +204 -0
- package/dist/components/TextInput/index.js.map +1 -0
- package/dist/components/TextInput/styles.d.ts +62 -0
- package/dist/components/TextInput/styles.js +68 -0
- package/dist/components/TextInput/styles.js.map +1 -0
- package/dist/components/Touchable/index.d.ts +20 -0
- package/dist/components/Touchable/index.js +165 -0
- package/dist/components/Touchable/index.js.map +1 -0
- package/dist/components/Touchable/styles.d.ts +58 -0
- package/dist/components/Touchable/styles.js +24 -0
- package/dist/components/Touchable/styles.js.map +1 -0
- package/dist/components/{View.d.ts → View/index.d.ts} +6 -0
- package/dist/components/View/index.js +99 -0
- package/dist/components/View/index.js.map +1 -0
- package/dist/components/View/styles.d.ts +54 -0
- package/dist/components/View/styles.js +29 -0
- package/dist/components/View/styles.js.map +1 -0
- package/dist/components/components.d.ts +10 -3
- package/dist/components/components.js +23 -3
- package/dist/components/components.js.map +1 -1
- package/dist/components/defaultStyles.d.ts +1364 -0
- package/dist/components/defaultStyles.js +63 -0
- package/dist/components/defaultStyles.js.map +1 -0
- package/dist/components/{_Modal → legacy/Modal}/index.d.ts +3 -3
- package/dist/components/{_Modal → legacy/Modal}/index.js +6 -6
- package/dist/components/legacy/Modal/index.js.map +1 -0
- package/dist/components/{_Modal → legacy/Modal}/styles.d.ts +6 -6
- package/dist/components/{_Modal → legacy/Modal}/styles.js +0 -0
- package/dist/components/legacy/Modal/styles.js.map +1 -0
- package/dist/components/legacy/Pager/index.d.ts +20 -0
- package/dist/components/legacy/Pager/index.js +168 -0
- package/dist/components/legacy/Pager/index.js.map +1 -0
- package/dist/components/legacy/Pager/styles.d.ts +54 -0
- package/dist/components/legacy/Pager/styles.js +44 -0
- package/dist/components/legacy/Pager/styles.js.map +1 -0
- package/dist/components/legacy/index.d.ts +2 -0
- package/dist/components/legacy/index.js +19 -0
- package/dist/components/legacy/index.js.map +1 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/modules/reactNavigation.d.ts +2 -0
- package/dist/modules/reactNavigation.js +16 -1
- package/dist/modules/reactNavigation.js.map +1 -1
- package/dist/modules/textInputMask.d.ts +1 -0
- package/dist/modules/textInputMask.js +15 -0
- package/dist/modules/textInputMask.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/KeyboardAware/index.d.ts +6 -0
- package/dist/utils/KeyboardAware/index.js +31 -0
- package/dist/utils/KeyboardAware/index.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js +9 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +67 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +451 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.d.ts +7 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js +4 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js +10 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js +10 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js.map +1 -0
- package/dist/utils/KeyboardAware/types.d.ts +1 -0
- package/dist/utils/KeyboardAware/types.js +7 -0
- package/dist/utils/KeyboardAware/types.js.map +1 -0
- package/dist/utils/ModalManager/components.d.ts +10 -2
- package/dist/utils/ModalManager/components.js +39 -7
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.d.ts +1 -0
- package/dist/utils/ModalManager/context.js +6 -0
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/ModalManager/index.d.ts +3 -2
- package/dist/utils/ModalManager/index.js +1 -0
- package/dist/utils/ModalManager/index.js.map +1 -1
- package/dist/utils/OSAlert.d.ts +6 -5
- package/dist/utils/OSAlert.js +7 -6
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/PermissionManager/context.js +0 -7
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/hooks.d.ts +34 -1
- package/dist/utils/hooks.js +54 -1
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +38 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/misc.d.ts +5 -1
- package/dist/utils/misc.js +62 -1
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/notifications.d.ts +34 -0
- package/dist/utils/notifications.js +268 -0
- package/dist/utils/notifications.js.map +1 -0
- package/package.json +13 -4
- package/src/components/ActionIcon/index.tsx +31 -0
- package/src/components/ActionIcon/styles.ts +92 -0
- package/src/components/{ActivityIndicator.tsx → ActivityIndicator/index.tsx} +7 -3
- package/src/components/ActivityIndicator/styles.ts +68 -0
- package/src/components/AutoComplete/index.tsx +158 -0
- package/src/components/AutoComplete/styles.ts +49 -0
- package/src/components/{Backdrop.tsx → Backdrop/index.tsx} +9 -42
- package/src/components/Backdrop/styles.ts +33 -0
- package/src/components/{Button.tsx → Button/index.tsx} +62 -13
- package/src/components/Button/styles.ts +129 -0
- package/src/components/Calendar/index.tsx +65 -0
- package/src/components/Calendar/style.ts +35 -0
- package/src/components/Calendar/types.ts +102 -0
- package/src/components/Checkbox/index.tsx +10 -5
- package/src/components/Checkbox/styles.ts +8 -3
- package/src/components/{ContentView.tsx → ContentView/index.tsx} +11 -6
- package/src/components/ContentView/styles.ts +25 -0
- package/src/components/Drawer/index.tsx +24 -0
- package/src/components/Drawer/styles.ts +38 -0
- package/src/components/{EmptyPlaceholder.tsx → EmptyPlaceholder/index.tsx} +14 -7
- package/src/components/EmptyPlaceholder/styles.ts +58 -0
- package/src/components/{FileInput.tsx → FileInput/index.tsx} +19 -28
- package/src/components/FileInput/styles.ts +15 -0
- package/src/components/Grid/index.tsx +107 -0
- package/src/components/Grid/styles.ts +11 -0
- package/src/components/{Icon.tsx → Icon/index.tsx} +8 -3
- package/src/components/Icon/styles.ts +52 -0
- package/src/components/Image/index.tsx +91 -0
- package/src/components/Image/styles.ts +20 -0
- package/src/components/ImageView/Spotlight.tsx +158 -0
- package/src/components/ImageView/component.tsx +38 -0
- package/src/components/ImageView/index.ts +2 -0
- package/src/components/List/PaginationIndicator.tsx +71 -0
- package/src/components/List/index.tsx +108 -0
- package/src/components/List/styles.ts +15 -0
- package/src/components/Modal/index.tsx +75 -39
- package/src/components/Modal/styles.ts +7 -5
- package/src/components/MultiSelect/index.tsx +120 -0
- package/src/components/MultiSelect/styles.ts +18 -0
- package/src/components/MultiSelect/types.ts +39 -0
- package/src/components/Navigation/Navigation.tsx +1 -5
- package/src/components/Navigation/utils.tsx +0 -2
- package/src/components/Pager/index.tsx +81 -202
- package/src/components/Pager/styles.ts +57 -27
- package/src/components/RadioInput/index.tsx +8 -7
- package/src/components/RadioInput/styles.ts +10 -11
- package/src/components/{Scroll.tsx → Scroll/index.tsx} +22 -24
- package/src/components/Scroll/styles.ts +18 -0
- package/src/components/{Sections.tsx → Sections/index.tsx} +5 -15
- package/src/components/SegmentedControl/index.tsx +30 -17
- package/src/components/SegmentedControl/styles.ts +29 -7
- package/src/components/Select/index.tsx +78 -142
- package/src/components/Select/styles.ts +52 -74
- package/src/components/Select/types.ts +16 -23
- package/src/components/Slider/index.tsx +2 -0
- package/src/components/Slider/styles.ts +75 -0
- package/src/components/Slider/types.ts +7 -2
- package/src/components/{Switch.tsx → Switch/index.tsx} +10 -5
- package/src/components/Switch/styles.ts +37 -0
- package/src/components/Text/index.tsx +102 -0
- package/src/components/Text/styles.ts +50 -0
- package/src/components/TextInput/Label.tsx +26 -0
- package/src/components/{TextInput.tsx → TextInput/index.tsx} +124 -75
- package/src/components/TextInput/styles.ts +130 -0
- package/src/components/Touchable/index.tsx +182 -0
- package/src/components/Touchable/styles.ts +28 -0
- package/src/components/View/index.tsx +89 -0
- package/src/components/View/styles.ts +24 -0
- package/src/components/components.ts +14 -4
- package/src/components/defaultStyles.ts +60 -0
- package/src/components/{_Modal → legacy/Modal}/index.tsx +7 -7
- package/src/components/{_Modal → legacy/Modal}/styles.ts +0 -0
- package/src/components/legacy/Pager/index.tsx +242 -0
- package/src/components/legacy/Pager/styles.ts +51 -0
- package/src/components/legacy/index.ts +2 -0
- package/src/index.ts +4 -9
- package/src/modules/reactNavigation.ts +11 -0
- package/src/modules/textInputMask.ts +2 -0
- package/src/types/index.ts +1 -0
- package/src/utils/KeyboardAware/index.ts +15 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +4 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +618 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +13 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +6 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +6 -0
- package/src/utils/KeyboardAware/types.ts +159 -0
- package/src/utils/ModalManager/components.tsx +57 -14
- package/src/utils/ModalManager/context.tsx +10 -0
- package/src/utils/ModalManager/index.ts +4 -1
- package/src/utils/OSAlert.ts +10 -10
- package/src/utils/PermissionManager/context.tsx +1 -7
- package/src/utils/hooks.ts +82 -2
- package/src/utils/index.ts +9 -0
- package/src/utils/misc.ts +61 -2
- package/src/utils/notifications.ts +206 -0
- package/dist/components/ActivityIndicator.js.map +0 -1
- package/dist/components/Backdrop.js.map +0 -1
- package/dist/components/Button.d.ts +0 -132
- package/dist/components/Button.js.map +0 -1
- package/dist/components/ContentView.js.map +0 -1
- package/dist/components/EmptyPlaceholder.js.map +0 -1
- package/dist/components/FileInput.js.map +0 -1
- package/dist/components/Gap.d.ts +0 -8
- package/dist/components/Gap.js +0 -60
- package/dist/components/Gap.js.map +0 -1
- package/dist/components/Icon.js.map +0 -1
- package/dist/components/Image.js.map +0 -1
- package/dist/components/List.js +0 -101
- package/dist/components/List.js.map +0 -1
- package/dist/components/NewModal/index.d.ts +0 -27
- package/dist/components/NewModal/index.js +0 -99
- package/dist/components/NewModal/index.js.map +0 -1
- package/dist/components/NewModal/styles.js +0 -58
- package/dist/components/NewModal/styles.js.map +0 -1
- package/dist/components/NewPager/index.d.ts +0 -26
- package/dist/components/NewPager/index.js +0 -88
- package/dist/components/NewPager/index.js.map +0 -1
- package/dist/components/NewPager/styles.js +0 -70
- package/dist/components/NewPager/styles.js.map +0 -1
- package/dist/components/Overlay.d.ts +0 -16
- package/dist/components/Overlay.js +0 -74
- package/dist/components/Overlay.js.map +0 -1
- package/dist/components/Scroll.d.ts +0 -15
- package/dist/components/Scroll.js.map +0 -1
- package/dist/components/Sections.d.ts +0 -11
- package/dist/components/Sections.js.map +0 -1
- package/dist/components/SegmentedControl.d.ts +0 -5
- package/dist/components/SegmentedControl.js +0 -32
- package/dist/components/SegmentedControl.js.map +0 -1
- package/dist/components/Switch.js.map +0 -1
- package/dist/components/Text.js.map +0 -1
- package/dist/components/TextInput.js +0 -181
- package/dist/components/TextInput.js.map +0 -1
- package/dist/components/Touchable.d.ts +0 -16
- package/dist/components/Touchable.js +0 -83
- package/dist/components/Touchable.js.map +0 -1
- package/dist/components/View.js.map +0 -1
- package/dist/components/_Modal/index.js.map +0 -1
- package/dist/components/_Modal/styles.js.map +0 -1
- package/dist/utils/PermissionManager/components.d.ts +0 -18
- package/dist/utils/PermissionManager/components.js +0 -52
- package/dist/utils/PermissionManager/components.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -1
- package/dist/utils/styles.js +0 -13
- package/dist/utils/styles.js.map +0 -1
- package/src/components/Gap.tsx +0 -40
- package/src/components/Image.tsx +0 -62
- package/src/components/List.tsx +0 -155
- package/src/components/NewPager/index.tsx +0 -121
- package/src/components/NewPager/styles.ts +0 -76
- package/src/components/Overlay.tsx +0 -86
- package/src/components/Text.tsx +0 -43
- package/src/components/Touchable.tsx +0 -89
- package/src/components/View.tsx +0 -48
- package/src/utils/styles.ts +0 -14
|
@@ -1,58 +1,52 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentVariants,
|
|
3
|
-
onUpdate,
|
|
4
3
|
useDefaultComponentStyle,
|
|
5
|
-
useDebounce,
|
|
6
|
-
useCodeleapContext,
|
|
7
4
|
} from '@codeleap/common'
|
|
8
5
|
import React, {
|
|
9
|
-
forwardRef,
|
|
10
6
|
ReactNode,
|
|
11
|
-
useImperativeHandle,
|
|
12
|
-
useMemo,
|
|
13
|
-
useRef,
|
|
14
|
-
useState,
|
|
15
7
|
} from 'react'
|
|
16
8
|
import { StyleSheet } from 'react-native'
|
|
17
9
|
import { StylesOf } from '../../types/utility'
|
|
18
|
-
import { Animated } from '../Animated'
|
|
19
|
-
import { Button } from '../Button'
|
|
20
10
|
import { View } from '../View'
|
|
21
|
-
import {
|
|
22
|
-
import { MobilePagerStyles, PagerComposition } from './styles'
|
|
23
|
-
|
|
11
|
+
import { PagerStyles, PagerComposition } from './styles'
|
|
24
12
|
export * from './styles'
|
|
25
13
|
|
|
14
|
+
type PageProps = {
|
|
15
|
+
isLast: boolean
|
|
16
|
+
isFirst: boolean
|
|
17
|
+
isActive: boolean
|
|
18
|
+
isNext: boolean
|
|
19
|
+
page: number
|
|
20
|
+
index: number
|
|
21
|
+
isPrevious: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
26
24
|
export type PagerProps = {
|
|
27
|
-
variants?: ComponentVariants<typeof
|
|
25
|
+
variants?: ComponentVariants<typeof PagerStyles>['variants']
|
|
28
26
|
styles?: StylesOf<PagerComposition>
|
|
27
|
+
children?: (((pageData: PageProps) => ReactNode) | ReactNode)[]
|
|
29
28
|
page?: number
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
style?: any
|
|
30
|
+
setPage?: (page: number) => void
|
|
31
|
+
returnEarly?: boolean
|
|
32
|
+
renderPageWrapper?:React.FC<PageProps>
|
|
33
|
+
pageWrapperProps?: any
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export
|
|
37
|
-
forward(by?: number): void
|
|
38
|
-
back(by?: number): void
|
|
39
|
-
to(index?: number): void
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const Pager = forwardRef<PagerRef, PagerProps>((pagerProps, ref) => {
|
|
36
|
+
export const Pager:React.FC<PagerProps> = (pagerProps) => {
|
|
43
37
|
const {
|
|
44
|
-
|
|
38
|
+
|
|
45
39
|
styles,
|
|
46
40
|
variants,
|
|
47
|
-
page
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
page,
|
|
42
|
+
style = {},
|
|
43
|
+
returnEarly = true,
|
|
44
|
+
renderPageWrapper,
|
|
45
|
+
pageWrapperProps = {},
|
|
46
|
+
children,
|
|
51
47
|
} = pagerProps
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const variantStyles = useDefaultComponentStyle<'u:Pager', typeof MobilePagerStyles>(
|
|
49
|
+
let variantStyles = useDefaultComponentStyle<'u:Pager', typeof PagerStyles>(
|
|
56
50
|
'u:Pager',
|
|
57
51
|
{
|
|
58
52
|
styles,
|
|
@@ -60,183 +54,68 @@ export const Pager = forwardRef<PagerRef, PagerProps>((pagerProps, ref) => {
|
|
|
60
54
|
variants,
|
|
61
55
|
},
|
|
62
56
|
)
|
|
63
|
-
const { logger } = useCodeleapContext()
|
|
64
57
|
const nChildren = React.Children.count(children)
|
|
65
58
|
|
|
66
59
|
const lastPage = nChildren - 1
|
|
67
60
|
|
|
68
|
-
const
|
|
69
|
-
forward: (by = 1) => {
|
|
70
|
-
setPage((currentPage) => {
|
|
71
|
-
if (currentPage < lastPage) {
|
|
72
|
-
return currentPage + by
|
|
73
|
-
} else if (loop) {
|
|
74
|
-
return by - 1
|
|
75
|
-
}
|
|
76
|
-
return currentPage
|
|
77
|
-
})
|
|
78
|
-
},
|
|
79
|
-
back: (by = 1) => {
|
|
80
|
-
setPage((currentPage) => {
|
|
81
|
-
if (currentPage > 0) {
|
|
82
|
-
return currentPage - by
|
|
83
|
-
} else if (loop) {
|
|
84
|
-
return nChildren - by
|
|
85
|
-
}
|
|
86
|
-
return currentPage
|
|
87
|
-
})
|
|
88
|
-
},
|
|
89
|
-
to: (n: number) => {
|
|
90
|
-
if (n >= 0 && n <= lastPage) {
|
|
91
|
-
setPage(n)
|
|
92
|
-
} else {
|
|
93
|
-
logger.warn(
|
|
94
|
-
'Attempted to go to a page which falls outside range',
|
|
95
|
-
{ currentPage: page, attemptedToGoTo: n, pageRange: [0, lastPage] },
|
|
96
|
-
'Component',
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
onUpdate(() => {
|
|
103
|
-
onPageChange?.(page)
|
|
104
|
-
}, [page])
|
|
61
|
+
const childArr = React.Children.toArray(children)
|
|
105
62
|
|
|
106
|
-
|
|
107
|
-
if (typeof propPage === 'number') {
|
|
108
|
-
setPage(propPage)
|
|
109
|
-
}
|
|
110
|
-
}, [propPage])
|
|
63
|
+
const WrapperComponent = renderPageWrapper || View
|
|
111
64
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const pagePoses = useMemo(() => {
|
|
115
|
-
return {
|
|
116
|
-
current: variantStyles['page:pose:current'],
|
|
117
|
-
next: variantStyles['page:pose:next'],
|
|
118
|
-
previous: variantStyles['page:pose:previous'],
|
|
119
|
-
}
|
|
120
|
-
}, [variantStyles])
|
|
65
|
+
// Reamimated seems to glitch if this is not done
|
|
66
|
+
variantStyles = JSON.parse(JSON.stringify(variantStyles))
|
|
121
67
|
|
|
122
68
|
return (
|
|
123
|
-
<View style={variantStyles.wrapper}>
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
69
|
+
<View style={[variantStyles.wrapper, style]} >
|
|
70
|
+
{
|
|
71
|
+
childArr.map((child:PagerProps['children'][number], index) => {
|
|
72
|
+
const isActive = index === page
|
|
73
|
+
const isLast = index === lastPage
|
|
74
|
+
const isFirst = index === 0
|
|
75
|
+
const isNext = index === page + 1
|
|
76
|
+
const isPrevious = index === page - 1
|
|
77
|
+
const shouldRender = isActive || isNext || isPrevious
|
|
78
|
+
|
|
79
|
+
if (!shouldRender && returnEarly) return null
|
|
80
|
+
let pos = 0
|
|
81
|
+
|
|
82
|
+
if (isActive) {
|
|
83
|
+
pos = 1
|
|
84
|
+
} else if (index > page) {
|
|
85
|
+
pos = 2
|
|
86
|
+
} else {
|
|
87
|
+
pos = 0
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const pageProps = {
|
|
91
|
+
isLast,
|
|
92
|
+
isActive,
|
|
93
|
+
isFirst,
|
|
94
|
+
isNext,
|
|
95
|
+
isPrevious,
|
|
96
|
+
index,
|
|
97
|
+
page,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const content = typeof child === 'function' ? child(pageProps) : child
|
|
101
|
+
|
|
102
|
+
const wrapperProps = {
|
|
103
|
+
key: index,
|
|
104
|
+
style: variantStyles.page,
|
|
105
|
+
animated: true,
|
|
106
|
+
transition: variantStyles['page:transition'],
|
|
107
|
+
animate: [variantStyles['page:previous'], variantStyles['page:current'], variantStyles['page:next']][pos],
|
|
108
|
+
...pageWrapperProps,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<WrapperComponent {...wrapperProps}>
|
|
113
|
+
{content}
|
|
114
|
+
</WrapperComponent>
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
})
|
|
118
|
+
}
|
|
147
119
|
</View>
|
|
148
|
-
|
|
149
120
|
)
|
|
150
|
-
})
|
|
151
|
-
type PageProps = PagerProps & {
|
|
152
|
-
idx: number
|
|
153
|
-
lastPage: number
|
|
154
|
-
page: number
|
|
155
|
-
pagePoses: any
|
|
156
|
-
style: any
|
|
157
|
-
}
|
|
158
|
-
const Page: React.FC<PageProps> = (pageProps) => {
|
|
159
|
-
const {
|
|
160
|
-
children: child,
|
|
161
|
-
idx,
|
|
162
|
-
loop,
|
|
163
|
-
lastPage,
|
|
164
|
-
page,
|
|
165
|
-
style,
|
|
166
|
-
pagePoses,
|
|
167
|
-
} = pageProps
|
|
168
|
-
|
|
169
|
-
if (!React.isValidElement(child)) return null
|
|
170
|
-
|
|
171
|
-
// const isLast = idx === lastPage
|
|
172
|
-
// const isFirst = idx === 0
|
|
173
|
-
|
|
174
|
-
// const isLoopNext = (loop && isFirst && page === lastPage)
|
|
175
|
-
// const isLoopPrevious = (loop && isLast && page === 0)
|
|
176
|
-
|
|
177
|
-
// const isCurrent = idx === page
|
|
178
|
-
// const isSequenceNext = idx === page + 1
|
|
179
|
-
// const isSequencePrevious = idx === page - 1
|
|
180
|
-
|
|
181
|
-
// const isNext = isSequenceNext || isLoopNext
|
|
182
|
-
|
|
183
|
-
// const isPrevious = isSequencePrevious || isLoopPrevious
|
|
184
|
-
|
|
185
|
-
// const isCurrentOrAdjacent = [
|
|
186
|
-
// isCurrent,
|
|
187
|
-
// isNext,
|
|
188
|
-
// isPrevious
|
|
189
|
-
// ].includes(true)
|
|
190
|
-
|
|
191
|
-
// if(isCurrentOrAdjacent){
|
|
192
|
-
// return <Animated
|
|
193
|
-
// key={idx}
|
|
194
|
-
// component='View'
|
|
195
|
-
// config={pagePoses}
|
|
196
|
-
// pose={isCurrent ? 'current' : (isNext ? 'next' : 'previous')}
|
|
197
|
-
// style={[{
|
|
198
|
-
// position: 'absolute',
|
|
199
|
-
// top: 0,
|
|
200
|
-
|
|
201
|
-
// },style]}
|
|
202
|
-
// >
|
|
203
|
-
// {child}
|
|
204
|
-
// </Animated>
|
|
205
|
-
// }
|
|
206
|
-
const isCurrent = idx === page
|
|
207
|
-
const isNext = idx > page
|
|
208
|
-
const [_opacity, setOpacity] = useState(isCurrent ? 1 : 0)
|
|
209
|
-
|
|
210
|
-
const [opacity, resetDebounceTimer] = useDebounce(_opacity, 800)
|
|
211
|
-
|
|
212
|
-
onUpdate(() => {
|
|
213
|
-
if (isCurrent) {
|
|
214
|
-
setOpacity(1)
|
|
215
|
-
} else {
|
|
216
|
-
setOpacity(0)
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return resetDebounceTimer
|
|
220
|
-
}, [idx, page])
|
|
221
|
-
|
|
222
|
-
return (
|
|
223
|
-
<Animated
|
|
224
|
-
key={idx}
|
|
225
|
-
component='View'
|
|
226
|
-
config={pagePoses}
|
|
227
|
-
pose={isCurrent ? 'current' : isNext ? 'next' : 'previous'}
|
|
228
|
-
style={[
|
|
229
|
-
{
|
|
230
|
-
position: 'absolute',
|
|
231
|
-
top: 0,
|
|
232
|
-
opacity: isCurrent ? _opacity : opacity,
|
|
233
|
-
},
|
|
234
|
-
style,
|
|
235
|
-
]}
|
|
236
|
-
>
|
|
237
|
-
{child}
|
|
238
|
-
</Animated>
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
// return <View style={{display:'none'}} key={idx}>{child}</View>
|
|
242
121
|
}
|
|
@@ -2,50 +2,80 @@ import {
|
|
|
2
2
|
createDefaultVariantFactory,
|
|
3
3
|
includePresets,
|
|
4
4
|
} from '@codeleap/common'
|
|
5
|
+
import { Easing } from 'react-native'
|
|
5
6
|
|
|
6
7
|
export type PagerComposition =
|
|
7
8
|
| 'page'
|
|
8
9
|
| 'page:transition'
|
|
9
|
-
| 'page:
|
|
10
|
-
| 'page:
|
|
11
|
-
| 'page:
|
|
10
|
+
| 'page:previous'
|
|
11
|
+
| 'page:next'
|
|
12
|
+
| 'page:current'
|
|
12
13
|
| 'wrapper'
|
|
13
14
|
|
|
14
15
|
const createPagerStyle = createDefaultVariantFactory<PagerComposition>()
|
|
15
16
|
|
|
16
17
|
const presets = includePresets((style) => createPagerStyle(() => ({ wrapper: style })),
|
|
17
18
|
)
|
|
19
|
+
export const defaultPagerTransition = {
|
|
20
|
+
type: 'timing',
|
|
21
|
+
duration: 300,
|
|
22
|
+
easing: Easing.linear,
|
|
23
|
+
}
|
|
18
24
|
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
export function pagerAnimation(height, width, translate = 'X', transition = defaultPagerTransition) {
|
|
26
|
+
const translateProp = `translate${translate}`
|
|
27
|
+
|
|
28
|
+
const translateVal = translate === 'X' ? width : height
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
wrapper: {
|
|
32
|
+
height,
|
|
33
|
+
width,
|
|
34
|
+
overflow: 'hidden',
|
|
35
|
+
},
|
|
36
|
+
'page:transition': {
|
|
37
|
+
[translateProp]: transition,
|
|
38
|
+
},
|
|
39
|
+
'page:next': {
|
|
40
|
+
[translateProp]: translateVal,
|
|
27
41
|
|
|
42
|
+
},
|
|
43
|
+
'page:current': {
|
|
44
|
+
[translateProp]: 0,
|
|
45
|
+
},
|
|
46
|
+
'page:previous': {
|
|
47
|
+
[translateProp]: -translateVal,
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const PagerStyles = {
|
|
53
|
+
...presets,
|
|
54
|
+
default: createPagerStyle((theme) => {
|
|
55
|
+
const width = theme.values.width
|
|
56
|
+
const height = theme.values.height * 0.8
|
|
28
57
|
return {
|
|
29
|
-
|
|
30
|
-
...Theme.presets.full,
|
|
31
|
-
},
|
|
32
|
-
'page:pose:next': {
|
|
33
|
-
left: Theme.values.width * 1.8,
|
|
34
|
-
transition: transition,
|
|
35
|
-
},
|
|
36
|
-
'page:pose:current': {
|
|
37
|
-
left: 0,
|
|
38
|
-
transition: transition,
|
|
39
|
-
},
|
|
40
|
-
'page:pose:previous': {
|
|
41
|
-
left: -Theme.values.width * 1.8,
|
|
42
|
-
transition: transition,
|
|
43
|
-
},
|
|
58
|
+
...pagerAnimation(height, width, 'X'),
|
|
44
59
|
page: {
|
|
45
60
|
width: '100%',
|
|
46
61
|
height: '100%',
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
left: 0,
|
|
64
|
+
right: 0,
|
|
65
|
+
bottom: 0,
|
|
66
|
+
top: 0,
|
|
47
67
|
},
|
|
48
68
|
}
|
|
49
69
|
}),
|
|
50
|
-
|
|
70
|
+
horizontal: createPagerStyle((Theme) => {
|
|
71
|
+
|
|
72
|
+
const width = Theme.values.width
|
|
73
|
+
const height = Theme.values.height * 0.8
|
|
74
|
+
return pagerAnimation(height, width, 'X')
|
|
75
|
+
}),
|
|
76
|
+
vertical: createPagerStyle((Theme) => {
|
|
77
|
+
const height = Theme.values.height * 0.8
|
|
78
|
+
const width = Theme.values.width
|
|
79
|
+
return pagerAnimation(height, width, 'Y')
|
|
80
|
+
}),
|
|
51
81
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { ReactNode,
|
|
3
|
-
import { v4 } from 'uuid'
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef } from 'react'
|
|
4
3
|
|
|
5
4
|
import { Text } from '../Text'
|
|
6
5
|
import { Touchable } from '../Touchable'
|
|
@@ -10,7 +9,7 @@ import {
|
|
|
10
9
|
useDefaultComponentStyle,
|
|
11
10
|
} from '@codeleap/common'
|
|
12
11
|
import { View } from '../View'
|
|
13
|
-
import {
|
|
12
|
+
import { RadioInputComposition, RadioInputStyles } from './styles'
|
|
14
13
|
|
|
15
14
|
export * from './styles'
|
|
16
15
|
|
|
@@ -27,7 +26,7 @@ export type RadioButtonProps = Omit<
|
|
|
27
26
|
> & {
|
|
28
27
|
item: RadioItem
|
|
29
28
|
select: () => void
|
|
30
|
-
style: StylesOf<
|
|
29
|
+
style: StylesOf<RadioInputComposition>
|
|
31
30
|
checked: boolean
|
|
32
31
|
defaultValue?: number
|
|
33
32
|
}
|
|
@@ -37,8 +36,8 @@ export type RadioGroupProps<T> = {
|
|
|
37
36
|
value: T
|
|
38
37
|
onValueChange(value: T): void
|
|
39
38
|
label: ReactNode
|
|
40
|
-
styles?: StylesOf<
|
|
41
|
-
} & ComponentVariants<typeof
|
|
39
|
+
styles?: StylesOf<RadioInputComposition>
|
|
40
|
+
} & ComponentVariants<typeof RadioInputStyles>
|
|
42
41
|
|
|
43
42
|
export const RadioButton: React.FC<RadioButtonProps> = ({
|
|
44
43
|
item,
|
|
@@ -48,7 +47,9 @@ export const RadioButton: React.FC<RadioButtonProps> = ({
|
|
|
48
47
|
...props
|
|
49
48
|
}) => {
|
|
50
49
|
return (
|
|
51
|
-
<Touchable onPress={select} style={style.itemWrapper} debugName={'Change radioButton value'}
|
|
50
|
+
<Touchable onPress={select} style={style.itemWrapper} debugName={'Change radioButton value'} styles={{
|
|
51
|
+
feedback: style.buttonFeedback,
|
|
52
|
+
}}>
|
|
52
53
|
<View style={[style.button, checked && style['button:checked']]}>
|
|
53
54
|
<View
|
|
54
55
|
style={[style.buttonMark, checked && style['buttonMark:checked']]}
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createDefaultVariantFactory,
|
|
3
|
-
RadioInputStyles,
|
|
2
|
+
createDefaultVariantFactory, includePresets,
|
|
4
3
|
} from '@codeleap/common'
|
|
5
|
-
type RadioParts = 'button' | 'itemWrapper' | 'text' | 'buttonMark'
|
|
4
|
+
type RadioParts = 'button' | 'itemWrapper' | 'text' | 'buttonMark' | 'buttonFeedback'
|
|
6
5
|
|
|
7
6
|
type RadioGroupParts = 'label' | 'wrapper' | 'list'
|
|
8
7
|
|
|
9
|
-
export type
|
|
8
|
+
export type RadioInputComposition =
|
|
10
9
|
| `${RadioParts}:checked`
|
|
11
10
|
| RadioParts
|
|
12
11
|
| RadioGroupParts
|
|
13
12
|
|
|
14
13
|
const createRadioStyle =
|
|
15
|
-
createDefaultVariantFactory<
|
|
14
|
+
createDefaultVariantFactory<RadioInputComposition>()
|
|
16
15
|
|
|
17
|
-
const
|
|
16
|
+
const presets = includePresets(style => createRadioStyle(() => ({ wrapper: style })))
|
|
18
17
|
|
|
19
|
-
export const
|
|
20
|
-
...
|
|
18
|
+
export const RadioInputStyles = {
|
|
19
|
+
...presets,
|
|
21
20
|
default: createRadioStyle((theme) => {
|
|
22
|
-
const style = defaultStyles(theme)
|
|
23
21
|
|
|
24
22
|
const itemHeight = theme.typography.baseFontSize * 1.2
|
|
25
23
|
const markHeight = itemHeight / 2
|
|
26
24
|
const translateX = -(markHeight / 2)
|
|
27
25
|
const translateY = -(markHeight / 2)
|
|
28
26
|
return {
|
|
29
|
-
...style,
|
|
30
27
|
itemWrapper: {
|
|
31
|
-
...
|
|
28
|
+
...theme.presets.row,
|
|
29
|
+
...theme.spacing.marginVertical(1.3),
|
|
32
30
|
},
|
|
33
31
|
button: {
|
|
34
32
|
height: itemHeight,
|
|
@@ -39,6 +37,7 @@ export const MobileRadioInputStyles = {
|
|
|
39
37
|
position: 'relative',
|
|
40
38
|
...theme.spacing.marginRight(1),
|
|
41
39
|
},
|
|
40
|
+
buttonFeedback: { type: 'opacity', value: 0.5 },
|
|
42
41
|
buttonMark: {
|
|
43
42
|
backgroundColor: theme.colors.primary,
|
|
44
43
|
position: 'absolute',
|
|
@@ -8,13 +8,12 @@ import {
|
|
|
8
8
|
useCodeleapContext,
|
|
9
9
|
} from '@codeleap/common'
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from '
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { KeyboardAwareScrollViewTypes } from '../modules'
|
|
11
|
+
import { RefreshControl, RefreshControlProps, ScrollView, StyleSheet } from 'react-native'
|
|
12
|
+
import { ViewProps } from '../View'
|
|
13
|
+
import { KeyboardAwareScrollViewTypes } from '../../modules'
|
|
14
|
+
import { StylesOf } from '../../types'
|
|
15
|
+
import { ScrollComposition, ScrollStyles } from './styles'
|
|
16
|
+
import { KeyboardAwareScrollView } from '../../utils'
|
|
18
17
|
|
|
19
18
|
type KeyboardAwareScrollViewProps = KeyboardAwareScrollViewTypes.KeyboardAwareScrollViewProps
|
|
20
19
|
|
|
@@ -25,18 +24,10 @@ export type ScrollProps = KeyboardAwareScrollViewProps &
|
|
|
25
24
|
changeData?: any
|
|
26
25
|
keyboardAware?: boolean
|
|
27
26
|
refreshing?: boolean
|
|
28
|
-
styles?:
|
|
27
|
+
styles?: StylesOf<ScrollComposition>
|
|
28
|
+
refreshControlProps?: Partial<RefreshControlProps>
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const KeyboardAwareScrollView =
|
|
32
|
-
KBDView as unknown as React.ForwardRefExoticComponent<
|
|
33
|
-
ViewProps & {
|
|
34
|
-
refreshControl?: JSX.Element
|
|
35
|
-
ref?: ScrollView
|
|
36
|
-
|
|
37
|
-
} & ScrollViewProps
|
|
38
|
-
>
|
|
39
|
-
|
|
40
31
|
export const Scroll = forwardRef<ScrollView, ScrollProps>(
|
|
41
32
|
(scrollProps, ref) => {
|
|
42
33
|
const {
|
|
@@ -45,7 +36,8 @@ export const Scroll = forwardRef<ScrollView, ScrollProps>(
|
|
|
45
36
|
refreshTimeout = 3000,
|
|
46
37
|
children,
|
|
47
38
|
changeData,
|
|
48
|
-
styles,
|
|
39
|
+
styles = {},
|
|
40
|
+
refreshControlProps = {},
|
|
49
41
|
keyboardAware = true,
|
|
50
42
|
...props
|
|
51
43
|
} = scrollProps
|
|
@@ -79,16 +71,15 @@ export const Scroll = forwardRef<ScrollView, ScrollProps>(
|
|
|
79
71
|
}, [refreshingDisplay, changeData])
|
|
80
72
|
const { Theme } = useCodeleapContext()
|
|
81
73
|
|
|
82
|
-
const variantStyles = useDefaultComponentStyle('
|
|
74
|
+
const variantStyles = useDefaultComponentStyle<'u:Scroll', typeof ScrollStyles>('u:Scroll', {
|
|
83
75
|
variants,
|
|
84
|
-
styles
|
|
85
|
-
|
|
86
|
-
},
|
|
76
|
+
styles,
|
|
77
|
+
transform: StyleSheet.flatten,
|
|
87
78
|
rootElement: 'wrapper',
|
|
88
79
|
})
|
|
89
80
|
|
|
90
81
|
const Component = keyboardAware ? KeyboardAwareScrollView : ScrollView
|
|
91
|
-
|
|
82
|
+
const refreshStyles = StyleSheet.flatten([variantStyles.refreshControl, styles.refreshControl])
|
|
92
83
|
return (
|
|
93
84
|
<Component
|
|
94
85
|
style={[Theme.presets.full, style]}
|
|
@@ -96,7 +87,13 @@ export const Scroll = forwardRef<ScrollView, ScrollProps>(
|
|
|
96
87
|
ref={ref as unknown as ScrollView}
|
|
97
88
|
refreshControl={
|
|
98
89
|
hasRefresh && (
|
|
99
|
-
<RefreshControl
|
|
90
|
+
<RefreshControl
|
|
91
|
+
refreshing={refreshingDisplay}
|
|
92
|
+
onRefresh={onRefresh}
|
|
93
|
+
tintColor={refreshStyles?.color}
|
|
94
|
+
colors={[refreshStyles?.color]}
|
|
95
|
+
{...refreshControlProps}
|
|
96
|
+
/>
|
|
100
97
|
)
|
|
101
98
|
}
|
|
102
99
|
{...props}
|
|
@@ -106,3 +103,4 @@ export const Scroll = forwardRef<ScrollView, ScrollProps>(
|
|
|
106
103
|
)
|
|
107
104
|
},
|
|
108
105
|
)
|
|
106
|
+
export * from './styles'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createDefaultVariantFactory } from '@codeleap/common'
|
|
2
|
+
|
|
3
|
+
export type ScrollComposition = 'wrapper' |'content' | 'refreshControl'
|
|
4
|
+
|
|
5
|
+
const createScrollStyle = createDefaultVariantFactory<ScrollComposition>()
|
|
6
|
+
|
|
7
|
+
export const ScrollStyles = {
|
|
8
|
+
default: createScrollStyle((theme) => {
|
|
9
|
+
return {
|
|
10
|
+
wrapper: {
|
|
11
|
+
...theme.presets.fullHeight,
|
|
12
|
+
},
|
|
13
|
+
refreshControl: {
|
|
14
|
+
color: theme.colors.primary,
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
}),
|
|
18
|
+
}
|
|
@@ -7,15 +7,13 @@ import {
|
|
|
7
7
|
usePrevious,
|
|
8
8
|
useCodeleapContext,
|
|
9
9
|
} from '@codeleap/common'
|
|
10
|
-
|
|
11
|
-
KeyboardAwareSectionListProps,
|
|
12
|
-
KeyboardAwareSectionList as KBDView,
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
} from 'react-native-keyboard-aware-scroll-view'
|
|
10
|
+
|
|
15
11
|
import { RefreshControl, SectionList } from 'react-native'
|
|
16
|
-
import { View, ViewProps } from '
|
|
12
|
+
import { View, ViewProps } from '../View'
|
|
13
|
+
import { KeyboardAwareScrollViewTypes } from '../../modules'
|
|
14
|
+
import { KeyboardAwareSectionList } from '../../utils'
|
|
17
15
|
|
|
18
|
-
export type SectionListProps = KeyboardAwareSectionListProps<any> &
|
|
16
|
+
export type SectionListProps = KeyboardAwareScrollViewTypes.KeyboardAwareSectionListProps<any> &
|
|
19
17
|
ViewProps & {
|
|
20
18
|
onRefresh?: () => void
|
|
21
19
|
refreshTimeout?: number
|
|
@@ -23,14 +21,6 @@ export type SectionListProps = KeyboardAwareSectionListProps<any> &
|
|
|
23
21
|
separators?: boolean
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
const KeyboardAwareSectionList =
|
|
27
|
-
KBDView as unknown as React.ForwardRefExoticComponent<
|
|
28
|
-
ViewProps & {
|
|
29
|
-
refreshControl?: JSX.Element
|
|
30
|
-
ref?: SectionList
|
|
31
|
-
}
|
|
32
|
-
>
|
|
33
|
-
|
|
34
24
|
export const Sections = forwardRef<SectionList, SectionListProps>(
|
|
35
25
|
(flatListProps, ref) => {
|
|
36
26
|
const {
|