@codeleap/mobile 1.9.31 → 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} +23 -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 +26 -9
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.d.ts +55 -55
- package/dist/components/Modal/styles.js +5 -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} +13 -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 +85 -42
- package/src/components/Modal/styles.ts +11 -6
- 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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useDefaultComponentStyle } from '@codeleap/common'
|
|
3
|
+
import { StyleSheet } from 'react-native'
|
|
4
|
+
import { Text } from '../Text'
|
|
5
|
+
import { View } from '../View'
|
|
6
|
+
|
|
7
|
+
export const InputLabel = ({ label, variants = [], styles = {}, style, asteriskStyle = null, required = false, wrapperStyle = null }) => {
|
|
8
|
+
const labelStyles = useDefaultComponentStyle('TextInput', {
|
|
9
|
+
variants, styles, transform: StyleSheet.flatten,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
if (!label) return null
|
|
13
|
+
|
|
14
|
+
switch (typeof label) {
|
|
15
|
+
case 'string':
|
|
16
|
+
return <View style={ wrapperStyle || labelStyles.labelWrapper}>
|
|
17
|
+
<Text style={style || labelStyles.label} text={label} />
|
|
18
|
+
{required && <Text style={asteriskStyle || labelStyles.requiredAsterisk} text={' *'} />}
|
|
19
|
+
</View>
|
|
20
|
+
case 'object':
|
|
21
|
+
return label
|
|
22
|
+
default:
|
|
23
|
+
return null
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -2,22 +2,33 @@ import * as React from 'react'
|
|
|
2
2
|
import {
|
|
3
3
|
ComponentVariants,
|
|
4
4
|
FormTypes,
|
|
5
|
+
getNestedStylesByKey,
|
|
5
6
|
IconPlaceholder,
|
|
6
|
-
|
|
7
|
-
TextInputStyles,
|
|
7
|
+
|
|
8
8
|
useBooleanToggle,
|
|
9
9
|
useDefaultComponentStyle,
|
|
10
10
|
useValidate,
|
|
11
11
|
} from '@codeleap/common'
|
|
12
12
|
import { ComponentPropsWithoutRef, forwardRef, useImperativeHandle, useRef, useState } from 'react'
|
|
13
|
-
import { Text } from '
|
|
14
|
-
import { View, ViewProps } from '
|
|
15
|
-
import { StylesOf } from '
|
|
16
|
-
import { Icon } from '
|
|
13
|
+
import { Text } from '../Text'
|
|
14
|
+
import { View, ViewProps } from '../View'
|
|
15
|
+
import { StylesOf } from '../../types'
|
|
16
|
+
import { Icon } from '../Icon'
|
|
17
17
|
import { NativeSyntheticEvent, StyleSheet, TextInput as NativeTextInput, TextInputChangeEventData } from 'react-native'
|
|
18
|
-
import { Touchable, TouchableProps } from '
|
|
19
|
-
import { MaskedTextInput } from '
|
|
20
|
-
import {
|
|
18
|
+
import { Touchable, TouchableProps } from '../Touchable'
|
|
19
|
+
import { MaskedTextInput, TextInputMaskProps } from '../../modules/textInputMask'
|
|
20
|
+
import { InputLabel } from './Label'
|
|
21
|
+
|
|
22
|
+
export { InputLabel } from './Label'
|
|
23
|
+
|
|
24
|
+
export * from './styles'
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
InputIconComposition,
|
|
28
|
+
TextInputComposition,
|
|
29
|
+
TextInputStyles,
|
|
30
|
+
} from './styles'
|
|
31
|
+
import { ActionIcon, ActionIconParts, ActionIconProps } from '../ActionIcon'
|
|
21
32
|
|
|
22
33
|
type IconProp = { name: IconPlaceholder; action?: () => void }
|
|
23
34
|
|
|
@@ -35,8 +46,8 @@ export type TextInputProps =
|
|
|
35
46
|
type?: string
|
|
36
47
|
label?: React.ReactNode
|
|
37
48
|
debugName: string
|
|
38
|
-
leftIcon?:
|
|
39
|
-
rightIcon?:
|
|
49
|
+
leftIcon?: Partial<ActionIconProps>
|
|
50
|
+
rightIcon?: Partial<ActionIconProps>
|
|
40
51
|
styles?: StylesOf<TextInputComposition>
|
|
41
52
|
validate?: FormTypes.ValidatorFunctionWithoutForm | string
|
|
42
53
|
value?: string
|
|
@@ -46,7 +57,7 @@ export type TextInputProps =
|
|
|
46
57
|
onPress?: () => void
|
|
47
58
|
masking?: FormTypes.TextField['masking']
|
|
48
59
|
innerWrapperProps?: ViewProps
|
|
49
|
-
wrapperProps?: TouchableProps
|
|
60
|
+
wrapperProps?: TouchableProps
|
|
50
61
|
onChangeMask?: TextInputMaskProps['onChangeText']
|
|
51
62
|
required?:boolean
|
|
52
63
|
}
|
|
@@ -54,7 +65,6 @@ export type TextInputProps =
|
|
|
54
65
|
export const TextInput = forwardRef<NativeTextInput, TextInputProps>((rawprops, inputRef) => {
|
|
55
66
|
const {
|
|
56
67
|
onChange,
|
|
57
|
-
type,
|
|
58
68
|
value,
|
|
59
69
|
onChangeText,
|
|
60
70
|
disabled,
|
|
@@ -70,7 +80,6 @@ export const TextInput = forwardRef<NativeTextInput, TextInputProps>((rawprops,
|
|
|
70
80
|
validate,
|
|
71
81
|
password,
|
|
72
82
|
visibilityToggle,
|
|
73
|
-
touchableWrapper,
|
|
74
83
|
innerWrapperProps,
|
|
75
84
|
masking = null,
|
|
76
85
|
onChangeMask,
|
|
@@ -84,9 +93,10 @@ export const TextInput = forwardRef<NativeTextInput, TextInputProps>((rawprops,
|
|
|
84
93
|
|
|
85
94
|
const input = useRef<any>(null)
|
|
86
95
|
const [textIsVisible, setTextVisible] = useBooleanToggle(false)
|
|
87
|
-
const variantStyles = useDefaultComponentStyle('TextInput', {
|
|
96
|
+
const variantStyles = useDefaultComponentStyle<'u:TextInput', typeof TextInputStyles>('u:TextInput', {
|
|
88
97
|
variants,
|
|
89
98
|
styles,
|
|
99
|
+
transform: StyleSheet.flatten,
|
|
90
100
|
})
|
|
91
101
|
const InputElement = masking ? MaskedTextInput : NativeTextInput
|
|
92
102
|
|
|
@@ -122,29 +132,12 @@ export const TextInput = forwardRef<NativeTextInput, TextInputProps>((rawprops,
|
|
|
122
132
|
|
|
123
133
|
const { showError, error } = useValidate(value, validate)
|
|
124
134
|
|
|
125
|
-
const
|
|
126
|
-
...variantStyles.icon,
|
|
127
|
-
...(isFocused ? variantStyles['icon:focus'] : {}),
|
|
128
|
-
...(showError ? variantStyles['icon:error'] : {}),
|
|
129
|
-
...variantStyles.leftIcon,
|
|
130
|
-
...(isFocused ? variantStyles['leftIcon:focus'] : {}),
|
|
131
|
-
...(showError ? variantStyles['leftIcon:error'] : {}),
|
|
132
|
-
}
|
|
135
|
+
const commonIconStyles = getNestedStylesByKey('icon', variantStyles)
|
|
133
136
|
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
...(showError ? variantStyles['icon:error'] : {}),
|
|
138
|
-
...variantStyles.rightIcon,
|
|
139
|
-
...(isFocused ? variantStyles['rightIcon:focus'] : {}),
|
|
140
|
-
...(showError ? variantStyles['rightIcon:error'] : {}),
|
|
141
|
-
}
|
|
137
|
+
const leftIconStyles = getNestedStylesByKey('leftIcon', variantStyles)
|
|
138
|
+
|
|
139
|
+
const rightIconStyles = getNestedStylesByKey('rightIcon', variantStyles)
|
|
142
140
|
|
|
143
|
-
const buttonIconWrapperStyle = {
|
|
144
|
-
...variantStyles.buttonIconWrapper,
|
|
145
|
-
...(isFocused ? variantStyles['buttonIconWrapper:focus'] : {}),
|
|
146
|
-
...(showError ? variantStyles['buttonIconWrapper:error'] : {}),
|
|
147
|
-
}
|
|
148
141
|
function getStyles(key: TextInputComposition) {
|
|
149
142
|
const requestedStyles = [
|
|
150
143
|
variantStyles[key],
|
|
@@ -162,12 +155,19 @@ export const TextInput = forwardRef<NativeTextInput, TextInputProps>((rawprops,
|
|
|
162
155
|
}
|
|
163
156
|
}
|
|
164
157
|
|
|
158
|
+
const visibilityToggleProps = visibilityToggle ? {
|
|
159
|
+
onPress: () => setTextVisible(),
|
|
160
|
+
icon: (textIsVisible ? 'input-visiblity:visible' : 'input-visiblity:hidden') as IconPlaceholder,
|
|
161
|
+
debugName: `${debugName} toggle visibility`,
|
|
162
|
+
} : {}
|
|
163
|
+
|
|
165
164
|
return (
|
|
166
165
|
<Touchable
|
|
167
166
|
style={getStyles('wrapper')}
|
|
168
167
|
debugName={debugName}
|
|
169
168
|
onPress={handlePress}
|
|
170
169
|
{...wrapperProps}
|
|
170
|
+
android_ripple={null}
|
|
171
171
|
>
|
|
172
172
|
<InputLabel
|
|
173
173
|
label={label}
|
|
@@ -177,7 +177,14 @@ export const TextInput = forwardRef<NativeTextInput, TextInputProps>((rawprops,
|
|
|
177
177
|
required={required}
|
|
178
178
|
/>
|
|
179
179
|
<View style={getStyles('innerWrapper')} {...innerWrapperProps}>
|
|
180
|
-
<InputIcon
|
|
180
|
+
<InputIcon
|
|
181
|
+
isFocused={isFocused}
|
|
182
|
+
showError={showError}
|
|
183
|
+
styles={leftIconStyles}
|
|
184
|
+
commonStyles={commonIconStyles}
|
|
185
|
+
debugName={`${debugName} left icon`}
|
|
186
|
+
{...leftIcon}
|
|
187
|
+
/>
|
|
181
188
|
{/* @ts-ignore */}
|
|
182
189
|
<InputElement
|
|
183
190
|
ref={input}
|
|
@@ -196,14 +203,16 @@ export const TextInput = forwardRef<NativeTextInput, TextInputProps>((rawprops,
|
|
|
196
203
|
} } : {})}
|
|
197
204
|
style={getStyles('textField')}
|
|
198
205
|
/>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
<InputIcon
|
|
207
|
+
isFocused={isFocused}
|
|
208
|
+
showError={showError}
|
|
209
|
+
styles={rightIconStyles}
|
|
210
|
+
commonStyles={commonIconStyles}
|
|
211
|
+
debugName={`${debugName} right icon`}
|
|
212
|
+
{...rightIcon}
|
|
213
|
+
{...visibilityToggleProps}
|
|
214
|
+
/>
|
|
215
|
+
|
|
207
216
|
</View>
|
|
208
217
|
<FormError message={error.message} style={getStyles('error')} />
|
|
209
218
|
</Touchable>
|
|
@@ -218,32 +227,37 @@ export const FormError = ({ message, ...props }) => {
|
|
|
218
227
|
return message
|
|
219
228
|
}
|
|
220
229
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
return <Icon name={name} style={style} />
|
|
229
|
-
}
|
|
230
|
+
type InputIconProps = {
|
|
231
|
+
styles: StylesOf<InputIconComposition>
|
|
232
|
+
commonStyles: StylesOf<InputIconComposition>
|
|
233
|
+
isFocused: boolean
|
|
234
|
+
showError: boolean
|
|
235
|
+
} & Omit<ActionIconProps, 'styles'>
|
|
230
236
|
|
|
231
|
-
export const
|
|
232
|
-
|
|
233
|
-
variants, styles, transform: StyleSheet.flatten,
|
|
234
|
-
})
|
|
237
|
+
export const InputIcon:React.FC<InputIconProps> = ({ styles, commonStyles, isFocused, showError, ...props }) => {
|
|
238
|
+
if (!props.icon) return null
|
|
235
239
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
240
|
+
function getStyles(key: ActionIconParts | '') {
|
|
241
|
+
if (key === 'icon') key = ''
|
|
242
|
+
const requestedStyles = [
|
|
243
|
+
commonStyles[key],
|
|
244
|
+
isFocused ? commonStyles[key + ':focus'] : {},
|
|
245
|
+
showError ? commonStyles[key + ':error'] : {},
|
|
246
|
+
styles[key],
|
|
247
|
+
isFocused ? styles[key + ':focus'] : {},
|
|
248
|
+
showError ? styles[key + ':error'] : {},
|
|
249
|
+
]
|
|
250
|
+
return StyleSheet.flatten(requestedStyles)
|
|
251
|
+
}
|
|
252
|
+
const iconStyles = {
|
|
253
|
+
icon: getStyles('icon'),
|
|
254
|
+
touchablePressable: getStyles('touchablePressable'),
|
|
255
|
+
touchableWrapper: getStyles('touchableWrapper'),
|
|
256
|
+
touchableRipple: getStyles('touchableRipple'),
|
|
248
257
|
}
|
|
258
|
+
|
|
259
|
+
return <ActionIcon
|
|
260
|
+
styles={iconStyles}
|
|
261
|
+
{...props}
|
|
262
|
+
/>
|
|
249
263
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { assignTextStyle, createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
import { ActionIconParts } from '../ActionIcon'
|
|
3
|
+
|
|
4
|
+
export type IconParts = Exclude<ActionIconParts, 'icon' | 'icon:disabled'>
|
|
5
|
+
type InputIcons = 'icon' | 'leftIcon' | 'rightIcon'
|
|
6
|
+
|
|
7
|
+
export type InputIconComposition = `${InputIcons}${Capitalize<IconParts>}`
|
|
8
|
+
| InputIcons
|
|
9
|
+
|
|
10
|
+
type TextInputParts =
|
|
11
|
+
| 'wrapper'
|
|
12
|
+
| InputIconComposition
|
|
13
|
+
| 'textField'
|
|
14
|
+
| 'label'
|
|
15
|
+
| 'innerWrapper'
|
|
16
|
+
| 'error'
|
|
17
|
+
| 'placeholder'
|
|
18
|
+
| 'selection'
|
|
19
|
+
| 'requiredAsterisk'
|
|
20
|
+
| 'labelWrapper'
|
|
21
|
+
|
|
22
|
+
export type TextInputComposition =
|
|
23
|
+
| `${TextInputParts}:error`
|
|
24
|
+
| `${TextInputParts}:focus`
|
|
25
|
+
| TextInputParts
|
|
26
|
+
|
|
27
|
+
const createTextInputStyle =
|
|
28
|
+
createDefaultVariantFactory<TextInputComposition>()
|
|
29
|
+
|
|
30
|
+
const presets = includePresets((styles) => createTextInputStyle(() => ({ wrapper: styles })))
|
|
31
|
+
|
|
32
|
+
export const TextInputStyles = {
|
|
33
|
+
...presets,
|
|
34
|
+
default: createTextInputStyle((theme) => ({
|
|
35
|
+
textField: {
|
|
36
|
+
...theme.spacing.padding(0),
|
|
37
|
+
...theme.spacing.paddingHorizontal(1),
|
|
38
|
+
...assignTextStyle('p1')(theme).text,
|
|
39
|
+
minWidth: 1,
|
|
40
|
+
backgroundColor: 'transparent',
|
|
41
|
+
flex: 1,
|
|
42
|
+
},
|
|
43
|
+
placeholder: {
|
|
44
|
+
color: theme.colors.lightGray,
|
|
45
|
+
},
|
|
46
|
+
selection: {
|
|
47
|
+
color: theme.colors.primary,
|
|
48
|
+
},
|
|
49
|
+
wrapper: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
|
|
53
|
+
},
|
|
54
|
+
innerWrapper: {
|
|
55
|
+
...theme.spacing.paddingVertical(0.5),
|
|
56
|
+
...theme.spacing.paddingHorizontal(1),
|
|
57
|
+
...theme.presets.row,
|
|
58
|
+
...theme.border.neutral(1),
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
label: {
|
|
64
|
+
...theme.spacing.marginBottom(1),
|
|
65
|
+
...assignTextStyle('h5')(theme).text,
|
|
66
|
+
},
|
|
67
|
+
'icon': {
|
|
68
|
+
color: theme.colors.neutral,
|
|
69
|
+
},
|
|
70
|
+
'icon:error': {
|
|
71
|
+
color: theme.colors.negative,
|
|
72
|
+
},
|
|
73
|
+
'icon:focus': {
|
|
74
|
+
color: theme.colors.primary,
|
|
75
|
+
},
|
|
76
|
+
leftIconTouchableWrapper: {
|
|
77
|
+
...theme.spacing.marginRight(1),
|
|
78
|
+
},
|
|
79
|
+
rightIconTouchableWrapper: {
|
|
80
|
+
...theme.spacing.marginLeft(1),
|
|
81
|
+
},
|
|
82
|
+
error: {
|
|
83
|
+
color: theme.colors.negative,
|
|
84
|
+
...theme.spacing.marginTop(0.5),
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
'label:error': {
|
|
88
|
+
color: theme.colors.negative,
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
'innerWrapper:error': {
|
|
92
|
+
...theme.border.negative(1),
|
|
93
|
+
},
|
|
94
|
+
'innerWrapper:focus': {
|
|
95
|
+
...theme.border.primary(1),
|
|
96
|
+
},
|
|
97
|
+
requiredAsterisk: {
|
|
98
|
+
color: theme.colors.negative,
|
|
99
|
+
},
|
|
100
|
+
labelWrapper: {
|
|
101
|
+
...theme.presets.row,
|
|
102
|
+
},
|
|
103
|
+
})),
|
|
104
|
+
line: createTextInputStyle((theme) => ({
|
|
105
|
+
innerWrapper: {
|
|
106
|
+
...theme.border.neutral({ width: 1, directions: ['bottom'] }),
|
|
107
|
+
},
|
|
108
|
+
})),
|
|
109
|
+
box: createTextInputStyle((theme) => ({
|
|
110
|
+
innerWrapper: {
|
|
111
|
+
...theme.border.neutral(1),
|
|
112
|
+
},
|
|
113
|
+
})),
|
|
114
|
+
pill: createTextInputStyle((theme) => ({
|
|
115
|
+
innerWrapper: {
|
|
116
|
+
...theme.border.neutral(1),
|
|
117
|
+
borderRadius: 15,
|
|
118
|
+
},
|
|
119
|
+
})),
|
|
120
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
|
+
import {
|
|
4
|
+
ComponentVariants,
|
|
5
|
+
useDefaultComponentStyle,
|
|
6
|
+
BaseViewProps,
|
|
7
|
+
|
|
8
|
+
useCodeleapContext,
|
|
9
|
+
AnyFunction,
|
|
10
|
+
defaultPresets,
|
|
11
|
+
} from '@codeleap/common'
|
|
12
|
+
import { Platform, Pressable, StyleSheet, View as RNView } from 'react-native'
|
|
13
|
+
|
|
14
|
+
import { createAnimatableComponent } from 'react-native-animatable'
|
|
15
|
+
import { TouchableComposition, TouchableStyles } from './styles'
|
|
16
|
+
import { StylesOf } from '../../types'
|
|
17
|
+
import { View } from '../View'
|
|
18
|
+
export type TouchableProps = Omit<
|
|
19
|
+
ComponentPropsWithoutRef<typeof Pressable>,
|
|
20
|
+
'onPress'
|
|
21
|
+
> & {
|
|
22
|
+
variants?: ComponentVariants<typeof TouchableStyles>['variants']
|
|
23
|
+
component?: any
|
|
24
|
+
ref?: React.Ref<RNView>
|
|
25
|
+
debugName: string
|
|
26
|
+
activeOpacity?: number
|
|
27
|
+
debugComponent?: string
|
|
28
|
+
feedbackVariant?: 'opacity' | 'none' | 'highlight'
|
|
29
|
+
onPress?: AnyFunction
|
|
30
|
+
styles?: StylesOf<TouchableComposition>
|
|
31
|
+
} & BaseViewProps
|
|
32
|
+
export * from './styles'
|
|
33
|
+
|
|
34
|
+
const rippleStyles = {
|
|
35
|
+
paddingTop: 0,
|
|
36
|
+
paddingLeft: 0,
|
|
37
|
+
paddingRight: 0,
|
|
38
|
+
paddingBottom: 0,
|
|
39
|
+
overflow: 'hidden',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const defaultPressableStyles = {
|
|
43
|
+
marginTop: 0,
|
|
44
|
+
marginLeft: 0,
|
|
45
|
+
marginRight: 0,
|
|
46
|
+
marginBottom: 0,
|
|
47
|
+
// height: '100%',
|
|
48
|
+
minWidth: '100%',
|
|
49
|
+
// minHeight: '100%',
|
|
50
|
+
// maxHeight: '100%',
|
|
51
|
+
maxWidth: '100%',
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const Touchable: React.FC<TouchableProps> = forwardRef<
|
|
56
|
+
RNView,
|
|
57
|
+
TouchableProps
|
|
58
|
+
>((touchableProps, ref) => {
|
|
59
|
+
const {
|
|
60
|
+
variants = [],
|
|
61
|
+
children,
|
|
62
|
+
onPress,
|
|
63
|
+
style,
|
|
64
|
+
activeOpacity = 0.5,
|
|
65
|
+
debugName,
|
|
66
|
+
debugComponent,
|
|
67
|
+
styles,
|
|
68
|
+
feedbackVariant = 'opacity',
|
|
69
|
+
...props
|
|
70
|
+
} = touchableProps
|
|
71
|
+
const _feedbackVariant = onPress ? feedbackVariant : 'none'
|
|
72
|
+
const variantStyles = useDefaultComponentStyle<'u:Touchable', typeof TouchableStyles>('u:Touchable', {
|
|
73
|
+
variants,
|
|
74
|
+
transform: StyleSheet.flatten,
|
|
75
|
+
rootElement: 'wrapper',
|
|
76
|
+
styles,
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const { logger } = useCodeleapContext()
|
|
80
|
+
|
|
81
|
+
const press = () => {
|
|
82
|
+
if (!onPress) { throw { message: 'No onPress passed to touchable', touchableProps } }
|
|
83
|
+
|
|
84
|
+
logger.log(
|
|
85
|
+
`<${debugComponent || 'Touchable'}/> pressed`,
|
|
86
|
+
debugName || variants,
|
|
87
|
+
'User interaction',
|
|
88
|
+
)
|
|
89
|
+
onPress && onPress()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const _styles = StyleSheet.flatten([variantStyles.wrapper, style])
|
|
93
|
+
|
|
94
|
+
const hasRipple = (!!variantStyles.ripple || !!props.android_ripple) && _feedbackVariant !== 'none'
|
|
95
|
+
function getFeedbackStyle(pressed:boolean) {
|
|
96
|
+
if (Platform.OS === 'android' && hasRipple) return {}
|
|
97
|
+
switch (_feedbackVariant) {
|
|
98
|
+
case 'highlight':
|
|
99
|
+
return {
|
|
100
|
+
backgroundColor: pressed ? '#e0e0e0' : 'transparent',
|
|
101
|
+
}
|
|
102
|
+
break
|
|
103
|
+
case 'opacity':
|
|
104
|
+
return {
|
|
105
|
+
opacity: pressed ? activeOpacity : 1,
|
|
106
|
+
}
|
|
107
|
+
case 'none':
|
|
108
|
+
return {}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const rippleConfig = hasRipple ? {
|
|
113
|
+
...(variantStyles.ripple || {}),
|
|
114
|
+
...(props.android_ripple || {}),
|
|
115
|
+
} : null
|
|
116
|
+
|
|
117
|
+
const Wrapper = View
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<Wrapper style={[_styles, rippleStyles]}>
|
|
121
|
+
<Pressable onPress={press} style={({ pressed }) => ([
|
|
122
|
+
getFeedbackStyle(pressed),
|
|
123
|
+
variantStyles.pressable,
|
|
124
|
+
_styles,
|
|
125
|
+
defaultPressableStyles,
|
|
126
|
+
])} android_ripple={rippleConfig} {...props} ref={ref}>
|
|
127
|
+
{children}
|
|
128
|
+
</Pressable>
|
|
129
|
+
</Wrapper>
|
|
130
|
+
)
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
export const AnimatedTouchable = createAnimatableComponent(Touchable) as unknown as typeof Touchable
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
|
|
3
|
+
export type TouchableComposition = 'wrapper' | 'ripple' | 'pressable'
|
|
4
|
+
|
|
5
|
+
const createTouchableStyle = createDefaultVariantFactory<TouchableComposition>()
|
|
6
|
+
|
|
7
|
+
const presets = includePresets((styles) => createTouchableStyle(() => ({ wrapper: styles, pressable: styles })),
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
export const TouchableStyles = {
|
|
11
|
+
...presets,
|
|
12
|
+
default: createTouchableStyle((t) => ({
|
|
13
|
+
|
|
14
|
+
})),
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
useCodeleapContext,
|
|
10
|
+
} from '@codeleap/common'
|
|
11
|
+
import { View as NativeView } from 'react-native'
|
|
12
|
+
import { MotiView, MotiProps } from 'moti'
|
|
13
|
+
|
|
14
|
+
export * from './styles'
|
|
15
|
+
|
|
16
|
+
export type ViewProps = ComponentPropsWithoutRef<typeof NativeView> &
|
|
17
|
+
ComponentVariants<typeof ViewStyles> & {
|
|
18
|
+
ref?: any
|
|
19
|
+
component?: any
|
|
20
|
+
animated?: boolean
|
|
21
|
+
} & BaseViewProps
|
|
22
|
+
|
|
23
|
+
export const View: React.FC<ViewProps & Partial<MotiProps>> = forwardRef<NativeView, ViewProps & Partial<MotiProps>>((viewProps, ref) => {
|
|
24
|
+
const {
|
|
25
|
+
responsiveVariants = {},
|
|
26
|
+
variants = [],
|
|
27
|
+
children,
|
|
28
|
+
style,
|
|
29
|
+
|
|
30
|
+
component,
|
|
31
|
+
animated = false,
|
|
32
|
+
...props
|
|
33
|
+
} = viewProps
|
|
34
|
+
|
|
35
|
+
const variantStyles = useDefaultComponentStyle('View', {
|
|
36
|
+
responsiveVariants,
|
|
37
|
+
variants,
|
|
38
|
+
})
|
|
39
|
+
const Component = animated ? MotiView : (component || NativeView)
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Component style={[variantStyles.wrapper, style]} ref={ref} {...props}>
|
|
43
|
+
{children}
|
|
44
|
+
</Component>
|
|
45
|
+
)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
export const AnimatedView = Animatable.createAnimatableComponent(
|
|
49
|
+
View,
|
|
50
|
+
) as unknown as React.ForwardRefExoticComponent<
|
|
51
|
+
{ transition?: any; animation?: any } & ViewProps
|
|
52
|
+
>
|
|
53
|
+
|
|
54
|
+
type GapProps = ViewProps & {
|
|
55
|
+
value: number
|
|
56
|
+
|
|
57
|
+
defaultProps?: any
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const Gap:React.FC<GapProps> = ({ children, value, defaultProps = {}, ...props }) => {
|
|
61
|
+
const { Theme } = useCodeleapContext()
|
|
62
|
+
const horizontal = props.variants?.includes('row')
|
|
63
|
+
return (
|
|
64
|
+
<View {...props}>
|
|
65
|
+
{
|
|
66
|
+
React.Children.toArray(children).map((Element, idx, childArr) => {
|
|
67
|
+
if (React.isValidElement(Element)) {
|
|
68
|
+
const props = { ...Element.props, ...defaultProps }
|
|
69
|
+
|
|
70
|
+
let spacingFunction = horizontal ? 'marginHorizontal' : 'marginVertical'
|
|
71
|
+
switch (idx) {
|
|
72
|
+
case 0:
|
|
73
|
+
spacingFunction = horizontal ? 'marginRight' : 'marginBottom'
|
|
74
|
+
break
|
|
75
|
+
case childArr.length - 1:
|
|
76
|
+
spacingFunction = horizontal ? 'marginLeft' : 'marginTop'
|
|
77
|
+
break
|
|
78
|
+
default:
|
|
79
|
+
break
|
|
80
|
+
}
|
|
81
|
+
props.style = [props.style, Theme.spacing[spacingFunction](value / 2)]
|
|
82
|
+
return React.cloneElement(Element, props)
|
|
83
|
+
}
|
|
84
|
+
return Element
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
</View>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
|
|
3
|
+
export type ViewComposition = 'wrapper'
|
|
4
|
+
|
|
5
|
+
const createViewStyle = createDefaultVariantFactory<ViewComposition>()
|
|
6
|
+
|
|
7
|
+
const presets = includePresets((styles) => createViewStyle(() => ({ wrapper: styles })),
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
export const ViewStyles = {
|
|
11
|
+
...presets,
|
|
12
|
+
default: createViewStyle((t) => ({
|
|
13
|
+
// wrapper: {
|
|
14
|
+
// display: 'flex',
|
|
15
|
+
// },
|
|
16
|
+
})),
|
|
17
|
+
separator: createViewStyle((t) => ({
|
|
18
|
+
wrapper: {
|
|
19
|
+
width: '100%',
|
|
20
|
+
height: t.values.pixel,
|
|
21
|
+
backgroundColor: t.colors.borders,
|
|
22
|
+
},
|
|
23
|
+
})),
|
|
24
|
+
}
|
|
@@ -20,12 +20,22 @@ export * from './List'
|
|
|
20
20
|
export * from './ActivityIndicator'
|
|
21
21
|
export * from './Button'
|
|
22
22
|
export * from './ContentView'
|
|
23
|
-
export * from './Overlay'
|
|
24
23
|
export * from './Modal'
|
|
25
|
-
|
|
26
|
-
export * from './
|
|
24
|
+
export * from './Calendar'
|
|
25
|
+
export * from './ImageView'
|
|
27
26
|
export * from './Navigation'
|
|
28
27
|
export * from './Pager'
|
|
29
28
|
export * from './EmptyPlaceholder'
|
|
30
|
-
export * from './Gap'
|
|
31
29
|
export * from './Backdrop'
|
|
30
|
+
export * from './Drawer'
|
|
31
|
+
export * from './MultiSelect'
|
|
32
|
+
export * from './AutoComplete'
|
|
33
|
+
export * from './Grid'
|
|
34
|
+
export * from './ActionIcon'
|
|
35
|
+
|
|
36
|
+
import * as Legacy from './legacy'
|
|
37
|
+
export {
|
|
38
|
+
Legacy,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export * from './defaultStyles'
|