@codeleap/mobile 1.9.33 → 2.0.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/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 -11
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/{NewPager → Button}/styles.d.ts +59 -86
- package/dist/components/Button/styles.js +59 -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 +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.d.ts +52 -52
- package/dist/components/Checkbox/styles.js +2 -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/Icon/styles.d.ts +60 -0
- 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} +35 -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 +25 -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/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 -27
- package/dist/components/Pager/styles.js.map +1 -1
- package/dist/components/RadioInput/index.d.ts +4 -4
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.d.ts +53 -53
- package/dist/components/RadioInput/styles.js +11 -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.js.map +1 -1
- package/dist/components/SegmentedControl/styles.d.ts +6 -6
- package/dist/components/Select/index.d.ts +8 -0
- package/dist/components/Select/index.js +38 -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 +14 -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} +8 -4
- 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} +5 -3
- package/dist/components/{Text.js → Text/index.js} +7 -3
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Text/styles.d.ts +65 -0
- package/dist/components/Text/styles.js +23 -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} +34 -41
- package/dist/components/{TextInput.js → TextInput/index.js} +51 -48
- package/dist/components/TextInput/index.js.map +1 -0
- package/dist/components/TextInput/styles.d.ts +62 -0
- package/dist/components/TextInput/styles.js +60 -0
- package/dist/components/TextInput/styles.js.map +1 -0
- package/dist/components/{Touchable.d.ts → Touchable/index.d.ts} +8 -4
- package/dist/components/{Touchable.js → Touchable/index.js} +59 -12
- package/dist/components/Touchable/index.js.map +1 -0
- package/dist/components/Touchable/styles.d.ts +53 -0
- package/dist/components/Touchable/styles.js +19 -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 +65 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +450 -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/PermissionManager/context.js +0 -7
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +42 -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} +64 -11
- package/src/components/Button/styles.ts +105 -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 +6 -4
- package/src/components/Checkbox/styles.ts +3 -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 +88 -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 +25 -0
- package/src/components/MultiSelect/types.ts +39 -0
- package/src/components/Navigation/Navigation.tsx +1 -5
- package/src/components/Pager/index.tsx +81 -202
- package/src/components/Pager/styles.ts +58 -33
- package/src/components/RadioInput/index.tsx +5 -6
- package/src/components/RadioInput/styles.ts +8 -10
- 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 +1 -1
- package/src/components/Select/index.tsx +74 -139
- package/src/components/Select/styles.ts +42 -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} +9 -4
- package/src/components/Switch/styles.ts +37 -0
- package/src/components/{Text.tsx → Text/index.tsx} +7 -3
- package/src/components/Text/styles.ts +34 -0
- package/src/components/TextInput/Label.tsx +26 -0
- package/src/components/{TextInput.tsx → TextInput/index.tsx} +84 -70
- package/src/components/TextInput/styles.ts +120 -0
- package/src/components/Touchable/index.tsx +133 -0
- package/src/components/Touchable/styles.ts +16 -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 +608 -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/PermissionManager/context.tsx +1 -7
- 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.map +0 -1
- 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/Touchable.tsx +0 -89
- package/src/components/View.tsx +0 -48
- package/src/utils/styles.ts +0 -14
package/src/components/Image.tsx
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
ComponentVariants,
|
|
4
|
-
ImageStyles,
|
|
5
|
-
MobileInputFile,
|
|
6
|
-
useDefaultComponentStyle,
|
|
7
|
-
arePropsEqual,
|
|
8
|
-
} from '@codeleap/common'
|
|
9
|
-
import { ComponentPropsWithoutRef } from 'react'
|
|
10
|
-
import {
|
|
11
|
-
Image as NativeImage,
|
|
12
|
-
ImageStyle,
|
|
13
|
-
StyleProp,
|
|
14
|
-
StyleSheet,
|
|
15
|
-
TextStyle,
|
|
16
|
-
ViewStyle,
|
|
17
|
-
} from 'react-native'
|
|
18
|
-
import { FastImage } from '../modules/fastImage'
|
|
19
|
-
|
|
20
|
-
type NativeImageProps = ComponentPropsWithoutRef<typeof NativeImage>
|
|
21
|
-
export type ImageProps = Omit<NativeImageProps, 'source' | 'style'> & {
|
|
22
|
-
variants?: ComponentVariants<typeof ImageStyles>['variants']
|
|
23
|
-
fast?: boolean
|
|
24
|
-
style?: StyleProp<ImageStyle | TextStyle | ViewStyle>
|
|
25
|
-
source:
|
|
26
|
-
| (NativeImageProps['source'] & {
|
|
27
|
-
priority?: keyof typeof FastImage.priority
|
|
28
|
-
})
|
|
29
|
-
| MobileInputFile
|
|
30
|
-
| string
|
|
31
|
-
resizeMode?: keyof typeof FastImage.resizeMode
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const ImageComponent: React.FC<ImageProps> = (props) => {
|
|
35
|
-
const { variants, style, fast = true, resizeMode = 'contain', ...imageProps } = props
|
|
36
|
-
|
|
37
|
-
const variantStyles = useDefaultComponentStyle('Image', { variants })
|
|
38
|
-
|
|
39
|
-
const styles = StyleSheet.flatten([variantStyles.wrapper, style])
|
|
40
|
-
|
|
41
|
-
if (fast) {
|
|
42
|
-
return (
|
|
43
|
-
<FastImage
|
|
44
|
-
style={styles}
|
|
45
|
-
// @ts-ignore
|
|
46
|
-
tintColor={styles?.tintColor}
|
|
47
|
-
resizeMode={FastImage.resizeMode[resizeMode || 'contain']}
|
|
48
|
-
{...imageProps}
|
|
49
|
-
/>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
return <NativeImage style={styles} resizeMode={resizeMode} {...(imageProps as any)} />
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function areEqual(prevProps, nextProps) {
|
|
56
|
-
const check = ['source', 'style', 'variants', 'resizeMode', 'fast']
|
|
57
|
-
const res = arePropsEqual(prevProps, nextProps, { check })
|
|
58
|
-
return res
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export const Image = React.memo(ImageComponent, areEqual)
|
|
62
|
-
|
package/src/components/List.tsx
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { forwardRef, useState } from 'react'
|
|
3
|
-
import {
|
|
4
|
-
deepEqual,
|
|
5
|
-
onUpdate,
|
|
6
|
-
useDefaultComponentStyle,
|
|
7
|
-
usePrevious,
|
|
8
|
-
useCodeleapContext,
|
|
9
|
-
TypeGuards,
|
|
10
|
-
} from '@codeleap/common'
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
KeyboardAwareFlatList as KBDView,
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
} from 'react-native-keyboard-aware-scroll-view'
|
|
16
|
-
|
|
17
|
-
import { RefreshControl, FlatList, FlatListProps as RNFlatListProps, ListRenderItemInfo } from 'react-native'
|
|
18
|
-
import { View, ViewProps } from './View'
|
|
19
|
-
import { EmptyPlaceholder, EmptyPlaceholderProps } from './EmptyPlaceholder'
|
|
20
|
-
import { ActivityIndicator } from './ActivityIndicator'
|
|
21
|
-
import { Text } from './Text'
|
|
22
|
-
export type DataboundFlatListPropsTypes = 'data' | 'renderItem' | 'keyExtractor' | 'getItemLayout'
|
|
23
|
-
|
|
24
|
-
export type ReplaceFlatlistProps<P, T> = Omit<P, DataboundFlatListPropsTypes> & {
|
|
25
|
-
data: T[]
|
|
26
|
-
keyExtractor?: (item: T, index: number) => string
|
|
27
|
-
renderItem: (data: ListRenderItemInfo<T>) => React.ReactElement
|
|
28
|
-
onRefresh?: () => void
|
|
29
|
-
getItemLayout?: ((
|
|
30
|
-
data:T,
|
|
31
|
-
index: number,
|
|
32
|
-
) => { length: number; offset: number; index: number })
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type FlatListProps<
|
|
36
|
-
T = any[],
|
|
37
|
-
Data = T extends Array<infer D> ? D : never
|
|
38
|
-
> =RNFlatListProps<Data> &
|
|
39
|
-
ViewProps & {
|
|
40
|
-
refreshTimeout?: number
|
|
41
|
-
changeData?: any
|
|
42
|
-
separators?: boolean
|
|
43
|
-
refreshing?: boolean
|
|
44
|
-
placeholder?: EmptyPlaceholderProps
|
|
45
|
-
keyboardAware?: boolean
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const KeyboardAwareFlatList =
|
|
50
|
-
KBDView as unknown as React.ForwardRefExoticComponent<
|
|
51
|
-
ViewProps & {
|
|
52
|
-
refreshControl?: JSX.Element
|
|
53
|
-
ref?: FlatList
|
|
54
|
-
}
|
|
55
|
-
>
|
|
56
|
-
|
|
57
|
-
const ListCP = forwardRef<FlatList, FlatListProps>(
|
|
58
|
-
(flatListProps, ref) => {
|
|
59
|
-
const {
|
|
60
|
-
variants = [],
|
|
61
|
-
style,
|
|
62
|
-
refreshTimeout = 3000,
|
|
63
|
-
changeData,
|
|
64
|
-
placeholder,
|
|
65
|
-
keyboardAware = true,
|
|
66
|
-
...props
|
|
67
|
-
} = flatListProps
|
|
68
|
-
const hasRefresh = !!props.onRefresh
|
|
69
|
-
const [refreshingState, setRefreshing] = useState(false)
|
|
70
|
-
const refreshingDisplay = props.refreshing !== undefined ? props.refreshing : refreshingState
|
|
71
|
-
|
|
72
|
-
const timer = React.useRef(null)
|
|
73
|
-
const previousData = usePrevious(changeData)
|
|
74
|
-
|
|
75
|
-
const onRefresh = () => {
|
|
76
|
-
if (timer.current) {
|
|
77
|
-
clearTimeout(timer.current)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
setRefreshing(true)
|
|
81
|
-
|
|
82
|
-
props.onRefresh()
|
|
83
|
-
|
|
84
|
-
timer.current = setTimeout(() => {
|
|
85
|
-
setRefreshing(false)
|
|
86
|
-
}, refreshTimeout)
|
|
87
|
-
}
|
|
88
|
-
onUpdate(() => {
|
|
89
|
-
if (refreshingDisplay && !deepEqual(previousData, changeData)) {
|
|
90
|
-
setRefreshing(false)
|
|
91
|
-
if (timer.current) {
|
|
92
|
-
clearTimeout(timer.current)
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, [refreshingDisplay, changeData])
|
|
96
|
-
const { Theme } = useCodeleapContext()
|
|
97
|
-
|
|
98
|
-
const variantStyles = useDefaultComponentStyle('View', {
|
|
99
|
-
variants,
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
const renderSeparator = () => {
|
|
103
|
-
return (
|
|
104
|
-
<View variants={['separator']}></View>
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const separatorProp = props.separators
|
|
109
|
-
const isEmpty = !props.data || !props.data.length
|
|
110
|
-
const separator = !isEmpty && separatorProp == true && renderSeparator
|
|
111
|
-
|
|
112
|
-
const Component = keyboardAware ? KeyboardAwareFlatList : FlatList
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
<Component
|
|
116
|
-
style={[Theme.presets.full, style]}
|
|
117
|
-
contentContainerStyle={[variantStyles.wrapper]}
|
|
118
|
-
ref={ref as unknown as FlatList}
|
|
119
|
-
ItemSeparatorComponent={separator}
|
|
120
|
-
refreshControl={
|
|
121
|
-
hasRefresh && (
|
|
122
|
-
<RefreshControl refreshing={refreshingDisplay} onRefresh={onRefresh} />
|
|
123
|
-
)
|
|
124
|
-
}
|
|
125
|
-
ListEmptyComponent={<EmptyPlaceholder {...placeholder}/>}
|
|
126
|
-
{...props}
|
|
127
|
-
/>
|
|
128
|
-
)
|
|
129
|
-
},
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
export type PaginationIndicatorProps = {
|
|
133
|
-
isFetching?: boolean
|
|
134
|
-
hasMore?: boolean
|
|
135
|
-
noMoreItemsText: React.ReactChild
|
|
136
|
-
activityIndicator?: JSX.Element
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export const PaginationIndicator = ({ hasMore, isFetching, noMoreItemsText, activityIndicator }: PaginationIndicatorProps) => {
|
|
140
|
-
if (isFetching) {
|
|
141
|
-
return activityIndicator || <ActivityIndicator variants={['center', 'marginVertical:3']}/>
|
|
142
|
-
}
|
|
143
|
-
if (!hasMore) {
|
|
144
|
-
if (TypeGuards.isString(noMoreItemsText) || TypeGuards.isNumber(noMoreItemsText)) {
|
|
145
|
-
return <Text variants={['h4', 'marginVertical:3', 'textCenter', 'fullWidth']} text={noMoreItemsText.toString()}/>
|
|
146
|
-
}
|
|
147
|
-
return noMoreItemsText
|
|
148
|
-
}
|
|
149
|
-
return null
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export type ListComponentType = <T extends any[] = any[]>(props: FlatListProps<T>) => React.ReactElement
|
|
153
|
-
|
|
154
|
-
export const List = ListCP as ListComponentType
|
|
155
|
-
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ComponentVariants,
|
|
3
|
-
useDefaultComponentStyle,
|
|
4
|
-
} from '@codeleap/common'
|
|
5
|
-
import React, {
|
|
6
|
-
ReactNode,
|
|
7
|
-
} from 'react'
|
|
8
|
-
import { StyleSheet } from 'react-native'
|
|
9
|
-
import { StylesOf } from '../../types/utility'
|
|
10
|
-
import { View } from '../View'
|
|
11
|
-
import { NewMobilePagerStyles, NewPagerComposition } from './styles'
|
|
12
|
-
export * from './styles'
|
|
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
|
-
|
|
24
|
-
export type NewPagerProps = {
|
|
25
|
-
variants?: ComponentVariants<typeof NewMobilePagerStyles>['variants']
|
|
26
|
-
styles?: StylesOf<NewPagerComposition>
|
|
27
|
-
children?: (((pageData: PageProps) => ReactNode) | ReactNode)[]
|
|
28
|
-
page?: number
|
|
29
|
-
style?: any
|
|
30
|
-
setPage?: (page: number) => void
|
|
31
|
-
returnEarly?: boolean
|
|
32
|
-
renderPageWrapper?:React.FC<PageProps>
|
|
33
|
-
pageWrapperProps?: any
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const NewPager:React.FC<NewPagerProps> = (pagerProps) => {
|
|
37
|
-
const {
|
|
38
|
-
|
|
39
|
-
styles,
|
|
40
|
-
variants,
|
|
41
|
-
page,
|
|
42
|
-
style = {},
|
|
43
|
-
returnEarly = true,
|
|
44
|
-
renderPageWrapper,
|
|
45
|
-
pageWrapperProps = {},
|
|
46
|
-
children,
|
|
47
|
-
} = pagerProps
|
|
48
|
-
|
|
49
|
-
let variantStyles = useDefaultComponentStyle<'u:Pager', typeof NewMobilePagerStyles>(
|
|
50
|
-
'u:Pager',
|
|
51
|
-
{
|
|
52
|
-
styles,
|
|
53
|
-
transform: StyleSheet.flatten,
|
|
54
|
-
variants,
|
|
55
|
-
},
|
|
56
|
-
)
|
|
57
|
-
const nChildren = React.Children.count(children)
|
|
58
|
-
|
|
59
|
-
const lastPage = nChildren - 1
|
|
60
|
-
|
|
61
|
-
const childArr = React.Children.toArray(children)
|
|
62
|
-
|
|
63
|
-
const WrapperComponent = renderPageWrapper || View
|
|
64
|
-
|
|
65
|
-
// Reamimated seems to glitch if this is not done
|
|
66
|
-
variantStyles = JSON.parse(JSON.stringify(variantStyles))
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<View style={[variantStyles.wrapper, style]} >
|
|
70
|
-
{
|
|
71
|
-
childArr.map((child:NewPagerProps['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
|
-
}
|
|
119
|
-
</View>
|
|
120
|
-
)
|
|
121
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createDefaultVariantFactory,
|
|
3
|
-
includePresets,
|
|
4
|
-
} from '@codeleap/common'
|
|
5
|
-
import { Easing } from 'react-native'
|
|
6
|
-
|
|
7
|
-
export type NewPagerComposition =
|
|
8
|
-
| 'page'
|
|
9
|
-
| 'page:transition'
|
|
10
|
-
| 'page:previous'
|
|
11
|
-
| 'page:next'
|
|
12
|
-
| 'page:current'
|
|
13
|
-
| 'wrapper'
|
|
14
|
-
|
|
15
|
-
const createPagerStyle = createDefaultVariantFactory<NewPagerComposition>()
|
|
16
|
-
|
|
17
|
-
const presets = includePresets((style) => createPagerStyle(() => ({ wrapper: style })),
|
|
18
|
-
)
|
|
19
|
-
export const defaultPagerTransition = {
|
|
20
|
-
type: 'timing',
|
|
21
|
-
duration: 300,
|
|
22
|
-
easing: Easing.linear,
|
|
23
|
-
}
|
|
24
|
-
|
|
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,
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
'page:current': {
|
|
44
|
-
[translateProp]: 0,
|
|
45
|
-
},
|
|
46
|
-
'page:previous': {
|
|
47
|
-
[translateProp]: -translateVal,
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const NewMobilePagerStyles = {
|
|
53
|
-
...presets,
|
|
54
|
-
default: createPagerStyle((theme) => ({
|
|
55
|
-
page: {
|
|
56
|
-
width: '100%',
|
|
57
|
-
height: '100%',
|
|
58
|
-
position: 'absolute',
|
|
59
|
-
left: 0,
|
|
60
|
-
right: 0,
|
|
61
|
-
bottom: 0,
|
|
62
|
-
top: 0,
|
|
63
|
-
},
|
|
64
|
-
})),
|
|
65
|
-
horizontal: createPagerStyle((Theme) => {
|
|
66
|
-
|
|
67
|
-
const width = Theme.values.width
|
|
68
|
-
const height = Theme.values.height * 0.8
|
|
69
|
-
return pagerAnimation(height, width, 'X')
|
|
70
|
-
}),
|
|
71
|
-
vertical: createPagerStyle((Theme) => {
|
|
72
|
-
const height = Theme.values.height * 0.8
|
|
73
|
-
const width = Theme.values.width
|
|
74
|
-
return pagerAnimation(height, width, 'Y')
|
|
75
|
-
}),
|
|
76
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
ComponentVariants,
|
|
4
|
-
IconPlaceholder,
|
|
5
|
-
onUpdate,
|
|
6
|
-
OverlayComposition,
|
|
7
|
-
OverlayStyles,
|
|
8
|
-
useDefaultComponentStyle,
|
|
9
|
-
} from '@codeleap/common'
|
|
10
|
-
import { ReactNode } from 'react'
|
|
11
|
-
import { InputLabel } from './TextInput'
|
|
12
|
-
import { Button } from './Button'
|
|
13
|
-
|
|
14
|
-
import { View } from './View'
|
|
15
|
-
import { StylesOf } from '../types/utility'
|
|
16
|
-
import { StyleSheet, ViewProps } from 'react-native'
|
|
17
|
-
import { AnimatedTouchable, Touchable } from './Touchable'
|
|
18
|
-
import { useAnimationState } from 'moti'
|
|
19
|
-
|
|
20
|
-
export type OverlayProps = ViewProps & {
|
|
21
|
-
title?: ReactNode
|
|
22
|
-
visible?: boolean
|
|
23
|
-
showClose?: boolean
|
|
24
|
-
variants?: ComponentVariants<typeof OverlayStyles>
|
|
25
|
-
styles?: StylesOf<OverlayComposition>
|
|
26
|
-
style?: any
|
|
27
|
-
onPress?: () => void
|
|
28
|
-
} & React.ComponentPropsWithoutRef<typeof AnimatedTouchable>
|
|
29
|
-
|
|
30
|
-
export const Overlay: React.FC<OverlayProps> = (overlayProps) => {
|
|
31
|
-
const {
|
|
32
|
-
showClose,
|
|
33
|
-
title,
|
|
34
|
-
children,
|
|
35
|
-
visible,
|
|
36
|
-
styles = {},
|
|
37
|
-
style,
|
|
38
|
-
variants,
|
|
39
|
-
...props
|
|
40
|
-
} = overlayProps
|
|
41
|
-
|
|
42
|
-
const variantStyles = useDefaultComponentStyle('Overlay', {
|
|
43
|
-
styles,
|
|
44
|
-
transform: StyleSheet.flatten,
|
|
45
|
-
variants: variants as any,
|
|
46
|
-
}) as StylesOf<OverlayComposition>
|
|
47
|
-
|
|
48
|
-
const animation = useAnimationState({
|
|
49
|
-
visible: variantStyles['wrapper:visible'],
|
|
50
|
-
hidden: styles['wrapper:visible'],
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
onUpdate(() => {
|
|
54
|
-
animation.transitionTo(visible ? 'visible' : 'hidden')
|
|
55
|
-
}, [visible])
|
|
56
|
-
|
|
57
|
-
const viewStyles = [
|
|
58
|
-
variantStyles.wrapper,
|
|
59
|
-
styles.wrapper,
|
|
60
|
-
]
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<View animated state={animation} style={viewStyles}>
|
|
64
|
-
<Touchable
|
|
65
|
-
|
|
66
|
-
feedbackVariant='none'
|
|
67
|
-
variants={['whole', 'full', 'absolute']}
|
|
68
|
-
{...props}
|
|
69
|
-
>
|
|
70
|
-
{(title || showClose) && (
|
|
71
|
-
<View style={variantStyles.header}>
|
|
72
|
-
<InputLabel style={variantStyles.title} label={title} />
|
|
73
|
-
{showClose && (
|
|
74
|
-
<Button
|
|
75
|
-
variants={['icon']}
|
|
76
|
-
icon={'close' as IconPlaceholder}
|
|
77
|
-
style={variantStyles.closeButton}
|
|
78
|
-
debugName={'Close icon'}
|
|
79
|
-
/>
|
|
80
|
-
)}
|
|
81
|
-
</View>
|
|
82
|
-
)}
|
|
83
|
-
</Touchable>
|
|
84
|
-
</View>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
|
-
import {
|
|
4
|
-
ComponentVariants,
|
|
5
|
-
useDefaultComponentStyle,
|
|
6
|
-
BaseViewProps,
|
|
7
|
-
ViewStyles,
|
|
8
|
-
useCodeleapContext,
|
|
9
|
-
AnyFunction,
|
|
10
|
-
} from '@codeleap/common'
|
|
11
|
-
import { TouchableOpacity as NativeTouchable, Pressable, View } from 'react-native'
|
|
12
|
-
|
|
13
|
-
import { createAnimatableComponent } from 'react-native-animatable'
|
|
14
|
-
export type TouchableProps = Omit<
|
|
15
|
-
ComponentPropsWithoutRef<typeof Pressable>,
|
|
16
|
-
'onPress'
|
|
17
|
-
> & {
|
|
18
|
-
variants?: ComponentVariants<typeof ViewStyles>['variants']
|
|
19
|
-
component?: any
|
|
20
|
-
ref?: React.Ref<View>
|
|
21
|
-
debugName: string
|
|
22
|
-
activeOpacity?: number
|
|
23
|
-
debugComponent?: string
|
|
24
|
-
feedbackVariant?: 'opacity' | 'none' | 'highlight'
|
|
25
|
-
onPress?: AnyFunction
|
|
26
|
-
} & BaseViewProps
|
|
27
|
-
|
|
28
|
-
export const Touchable: React.FC<TouchableProps> = forwardRef<
|
|
29
|
-
View,
|
|
30
|
-
TouchableProps
|
|
31
|
-
>((touchableProps, ref) => {
|
|
32
|
-
const {
|
|
33
|
-
variants = [],
|
|
34
|
-
children,
|
|
35
|
-
onPress,
|
|
36
|
-
style,
|
|
37
|
-
activeOpacity = 0.5,
|
|
38
|
-
debugName,
|
|
39
|
-
debugComponent,
|
|
40
|
-
feedbackVariant = 'opacity',
|
|
41
|
-
...props
|
|
42
|
-
} = touchableProps
|
|
43
|
-
|
|
44
|
-
const variantStyles = useDefaultComponentStyle('View', {
|
|
45
|
-
variants,
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const { logger } = useCodeleapContext()
|
|
49
|
-
|
|
50
|
-
const press = () => {
|
|
51
|
-
if (!onPress) { throw { message: 'No onPress passed to touchable', touchableProps } }
|
|
52
|
-
|
|
53
|
-
logger.log(
|
|
54
|
-
`<${debugComponent || 'Touchable'}/> pressed`,
|
|
55
|
-
debugName || variants,
|
|
56
|
-
'User interaction',
|
|
57
|
-
)
|
|
58
|
-
onPress && onPress()
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const styles = [variantStyles.wrapper, style]
|
|
62
|
-
|
|
63
|
-
function getFeedbackStyle(pressed:boolean, variant: TouchableProps['feedbackVariant']) {
|
|
64
|
-
switch (variant) {
|
|
65
|
-
case 'highlight':
|
|
66
|
-
return {
|
|
67
|
-
backgroundColor: pressed ? '#e0e0e0' : 'transparent',
|
|
68
|
-
}
|
|
69
|
-
break
|
|
70
|
-
case 'opacity':
|
|
71
|
-
return {
|
|
72
|
-
opacity: pressed ? activeOpacity : 1,
|
|
73
|
-
}
|
|
74
|
-
case 'none':
|
|
75
|
-
return {}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<Pressable onPress={press} style={({ pressed }) => ([
|
|
81
|
-
getFeedbackStyle(pressed, feedbackVariant),
|
|
82
|
-
styles,
|
|
83
|
-
])} {...props} ref={ref}>
|
|
84
|
-
{children}
|
|
85
|
-
</Pressable>
|
|
86
|
-
)
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
export const AnimatedTouchable = createAnimatableComponent(Touchable) as unknown as typeof Touchable
|
package/src/components/View.tsx
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import * as Animatable from 'react-native-animatable'
|
|
3
|
-
import { ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
4
|
-
import {
|
|
5
|
-
ComponentVariants,
|
|
6
|
-
useDefaultComponentStyle,
|
|
7
|
-
ViewStyles,
|
|
8
|
-
BaseViewProps,
|
|
9
|
-
} from '@codeleap/common'
|
|
10
|
-
import { View as NativeView, ViewStyle } from 'react-native'
|
|
11
|
-
import { MotiView, MotiProps } from 'moti'
|
|
12
|
-
export type ViewProps = ComponentPropsWithoutRef<typeof NativeView> &
|
|
13
|
-
ComponentVariants<typeof ViewStyles> & {
|
|
14
|
-
ref?: any
|
|
15
|
-
component?: any
|
|
16
|
-
animated?: boolean
|
|
17
|
-
} & BaseViewProps
|
|
18
|
-
|
|
19
|
-
export const View: React.FC<ViewProps & Partial<MotiProps>> = forwardRef<NativeView, ViewProps & Partial<MotiProps>>((viewProps, ref) => {
|
|
20
|
-
const {
|
|
21
|
-
responsiveVariants = {},
|
|
22
|
-
variants = [],
|
|
23
|
-
children,
|
|
24
|
-
style,
|
|
25
|
-
onHover,
|
|
26
|
-
component,
|
|
27
|
-
animated = false,
|
|
28
|
-
...props
|
|
29
|
-
} = viewProps
|
|
30
|
-
|
|
31
|
-
const variantStyles = useDefaultComponentStyle('View', {
|
|
32
|
-
responsiveVariants,
|
|
33
|
-
variants,
|
|
34
|
-
})
|
|
35
|
-
const Component = animated ? MotiView : (component || NativeView)
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Component style={[variantStyles.wrapper, style]} ref={ref} {...props}>
|
|
39
|
-
{children}
|
|
40
|
-
</Component>
|
|
41
|
-
)
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
export const AnimatedView = Animatable.createAnimatableComponent(
|
|
45
|
-
View,
|
|
46
|
-
) as unknown as React.ForwardRefExoticComponent<
|
|
47
|
-
{ transition?: any; animation?: any } & ViewProps
|
|
48
|
-
>
|
package/src/utils/styles.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useCodeleapContext } from '@codeleap/common'
|
|
2
|
-
import { StyleSheet } from 'react-native'
|
|
3
|
-
|
|
4
|
-
export function useLogStyles() {
|
|
5
|
-
const { logger } = useCodeleapContext()
|
|
6
|
-
|
|
7
|
-
return (name, styles) => {
|
|
8
|
-
logger.debug.blue(
|
|
9
|
-
name,
|
|
10
|
-
JSON.stringify(StyleSheet.flatten(styles), null, 2),
|
|
11
|
-
'Component Styles',
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
}
|