@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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { FilterKeys } from '@codeleap/common'
|
|
2
|
+
import { Paths } from '@codeleap/common/dist/types/pathMapping'
|
|
3
|
+
import { TextStyle, ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
type CalendarTheme = {
|
|
6
|
+
timelineContainer?: object;
|
|
7
|
+
contentStyle?: ViewStyle;
|
|
8
|
+
event?: object;
|
|
9
|
+
eventTitle?: object;
|
|
10
|
+
eventSummary?: object;
|
|
11
|
+
eventTimes?: object;
|
|
12
|
+
line?: object;
|
|
13
|
+
verticalLine?: object;
|
|
14
|
+
nowIndicatorLine?: object;
|
|
15
|
+
nowIndicatorKnob?: object;
|
|
16
|
+
timeLabel?: object;
|
|
17
|
+
todayTextColor?: string;
|
|
18
|
+
calendarBackground?: string;
|
|
19
|
+
indicatorColor?: string;
|
|
20
|
+
textSectionTitleColor?: string;
|
|
21
|
+
textSectionTitleDisabledColor?: string;
|
|
22
|
+
dayTextColor?: string;
|
|
23
|
+
selectedDayTextColor?: string;
|
|
24
|
+
monthTextColor?: string;
|
|
25
|
+
selectedDayBackgroundColor?: string;
|
|
26
|
+
arrowColor?: string;
|
|
27
|
+
textDisabledColor?: string;
|
|
28
|
+
textInactiveColor?: string;
|
|
29
|
+
backgroundColor?: string; //TODO: remove in V2
|
|
30
|
+
dotColor?: string;
|
|
31
|
+
selectedDotColor?: string;
|
|
32
|
+
disabledArrowColor?: string;
|
|
33
|
+
textDayFontFamily?: TextStyle['fontFamily'];
|
|
34
|
+
textMonthFontFamily?: TextStyle['fontFamily'];
|
|
35
|
+
textDayHeaderFontFamily?: TextStyle['fontFamily'];
|
|
36
|
+
textDayFontWeight?: TextStyle['fontWeight'];
|
|
37
|
+
textMonthFontWeight?: TextStyle['fontWeight'];
|
|
38
|
+
textDayHeaderFontWeight?: TextStyle['fontWeight'];
|
|
39
|
+
textDayFontSize?: number;
|
|
40
|
+
textMonthFontSize?: number;
|
|
41
|
+
textDayHeaderFontSize?: number;
|
|
42
|
+
agendaDayTextColor?: string;
|
|
43
|
+
agendaDayNumColor?: string;
|
|
44
|
+
agendaTodayColor?: string;
|
|
45
|
+
agendaKnobColor?: string;
|
|
46
|
+
todayButtonFontFamily?: TextStyle['fontFamily'];
|
|
47
|
+
todayButtonFontWeight?: TextStyle['fontWeight'];
|
|
48
|
+
todayButtonFontSize?: number;
|
|
49
|
+
textDayStyle?: TextStyle;
|
|
50
|
+
dotStyle?: object;
|
|
51
|
+
arrowStyle?: ViewStyle;
|
|
52
|
+
todayBackgroundColor?: string;
|
|
53
|
+
disabledDotColor?: string;
|
|
54
|
+
inactiveDotColor?: string;
|
|
55
|
+
todayDotColor?: string;
|
|
56
|
+
todayButtonTextColor?: string;
|
|
57
|
+
todayButtonPosition?: string;
|
|
58
|
+
arrowHeight?: number;
|
|
59
|
+
arrowWidth?: number;
|
|
60
|
+
weekVerticalMargin?: number;
|
|
61
|
+
stylesheet?: {
|
|
62
|
+
calendar?: {
|
|
63
|
+
main?: object;
|
|
64
|
+
header?: object;
|
|
65
|
+
};
|
|
66
|
+
day?: {
|
|
67
|
+
basic?: object;
|
|
68
|
+
period?: object;
|
|
69
|
+
};
|
|
70
|
+
dot?: object;
|
|
71
|
+
marking?: object;
|
|
72
|
+
'calendar-list'?: {
|
|
73
|
+
main?: object;
|
|
74
|
+
};
|
|
75
|
+
agenda?: {
|
|
76
|
+
main?: object;
|
|
77
|
+
list?: object;
|
|
78
|
+
};
|
|
79
|
+
expandable?: {
|
|
80
|
+
main?: object;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
type FlatStyleKeys = 'dot' | 'marking'
|
|
86
|
+
|
|
87
|
+
type StyleSheetKeys = Exclude<keyof CalendarTheme['stylesheet'], FlatStyleKeys>
|
|
88
|
+
|
|
89
|
+
type ThemeObjPrimitiveKeys = FilterKeys<CalendarTheme, string|number>
|
|
90
|
+
|
|
91
|
+
type ThemeObjCompositionKeys = Exclude<keyof CalendarTheme, ThemeObjPrimitiveKeys | 'stylesheet'>
|
|
92
|
+
|
|
93
|
+
type StyleSheetObjKeys = Exclude<Paths<CalendarTheme['stylesheet']>, StyleSheetKeys>
|
|
94
|
+
|
|
95
|
+
export type CalendarStyleGen<TCSS = any> = {
|
|
96
|
+
theme?: Partial<{
|
|
97
|
+
[P in ThemeObjPrimitiveKeys]: CalendarTheme[P]
|
|
98
|
+
}>
|
|
99
|
+
} & Partial<Record<StyleSheetObjKeys | 'wrapper' | ThemeObjCompositionKeys, TCSS>>
|
|
100
|
+
|
|
101
|
+
export type CalendarComposition = keyof CalendarStyleGen
|
|
102
|
+
export type TCalendarStyles = CalendarStyleGen<any>
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
StylesOf,
|
|
6
6
|
Form,
|
|
7
7
|
useValidate,
|
|
8
|
+
GetRefType,
|
|
9
|
+
PropsOf,
|
|
8
10
|
} from '@codeleap/common'
|
|
9
11
|
import { ComponentPropsWithRef, forwardRef, ReactNode } from 'react'
|
|
10
12
|
import { Switch as NativeCheckbox } from 'react-native'
|
|
@@ -12,8 +14,8 @@ import { InputLabel, FormError } from '../TextInput'
|
|
|
12
14
|
import { View } from '../View'
|
|
13
15
|
import { Touchable } from '../Touchable'
|
|
14
16
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
CheckboxStyles,
|
|
18
|
+
CheckboxComposition,
|
|
17
19
|
} from './styles'
|
|
18
20
|
export * from './styles'
|
|
19
21
|
|
|
@@ -29,7 +31,7 @@ type CheckboxProps = NativeCheckboxProps & {
|
|
|
29
31
|
required?: boolean
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
export const Checkbox = forwardRef<
|
|
34
|
+
export const Checkbox = forwardRef<GetRefType<PropsOf<typeof View>['ref']>, CheckboxProps>(
|
|
33
35
|
(checkboxProps, ref) => {
|
|
34
36
|
const {
|
|
35
37
|
variants = [],
|
|
@@ -65,7 +67,7 @@ export const Checkbox = forwardRef<NativeCheckbox, CheckboxProps>(
|
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
return (
|
|
68
|
-
<View style={getStyles('wrapper')} {...props}>
|
|
70
|
+
<View style={getStyles('wrapper')} ref={ref} {...props}>
|
|
69
71
|
<Touchable
|
|
70
72
|
debugName={`Set checkbox value to ${!value}`}
|
|
71
73
|
style={getStyles('input')}
|
|
@@ -9,18 +9,18 @@ type CheckboxParts =
|
|
|
9
9
|
| 'checkmarkWrapper'
|
|
10
10
|
| 'error'
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type CheckboxComposition =
|
|
13
13
|
| CheckboxParts
|
|
14
14
|
| `${CheckboxParts}:checked`
|
|
15
15
|
| `${CheckboxParts}:disabled`
|
|
16
16
|
| `${CheckboxParts}:error`
|
|
17
17
|
const createCheckboxStyle =
|
|
18
|
-
createDefaultVariantFactory<
|
|
18
|
+
createDefaultVariantFactory<CheckboxComposition>()
|
|
19
19
|
|
|
20
20
|
const presets = includePresets((styles) => createCheckboxStyle(() => ({ wrapper: styles })),
|
|
21
21
|
)
|
|
22
22
|
|
|
23
|
-
export const
|
|
23
|
+
export const CheckboxStyles = {
|
|
24
24
|
...presets,
|
|
25
25
|
default: createCheckboxStyle((theme) => {
|
|
26
26
|
const size = theme.typography.baseFontSize * 1.2
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {
|
|
3
|
+
|
|
3
4
|
ComponentVariants,
|
|
4
|
-
ContentViewStyles,
|
|
5
5
|
useDefaultComponentStyle,
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
} from '@codeleap/common'
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
ContentViewStyles,
|
|
10
|
+
} from './styles'
|
|
11
|
+
import { ViewProps, View, ViewComposition } from '../View'
|
|
12
|
+
import { Text } from '../Text'
|
|
13
|
+
import { StylesOf } from '../../types'
|
|
14
|
+
import { ActivityIndicator } from '../ActivityIndicator'
|
|
12
15
|
import { StyleSheet } from 'react-native'
|
|
13
16
|
|
|
17
|
+
export * from './styles'
|
|
18
|
+
|
|
14
19
|
export type ContentViewProps = Omit<
|
|
15
20
|
ViewProps,
|
|
16
21
|
'variants' | 'responsiveVariants'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
|
|
3
|
+
export type ContentViewComposition = 'placeholder' | 'wrapper' | 'loader'
|
|
4
|
+
|
|
5
|
+
const createContentViewStyle =
|
|
6
|
+
createDefaultVariantFactory<ContentViewComposition>()
|
|
7
|
+
|
|
8
|
+
const presets = includePresets((styles) => createContentViewStyle(() => ({ wrapper: styles })),
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
export const ContentViewStyles = {
|
|
12
|
+
...presets,
|
|
13
|
+
default: createContentViewStyle((theme) => ({
|
|
14
|
+
wrapper: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
...theme.presets.column,
|
|
17
|
+
...theme.presets.alignCenter,
|
|
18
|
+
},
|
|
19
|
+
loader: {
|
|
20
|
+
alignSelf: 'center',
|
|
21
|
+
height: 100,
|
|
22
|
+
width: 100,
|
|
23
|
+
},
|
|
24
|
+
})),
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { ComponentVariants, useDefaultComponentStyle } from '@codeleap/common'
|
|
4
|
+
import { StyleSheet } from 'react-native'
|
|
5
|
+
import Modal, { ModalProps } from '../Modal'
|
|
6
|
+
import { DrawerStyles } from './styles'
|
|
7
|
+
export * from './styles'
|
|
8
|
+
export type DrawerProps = Omit<ModalProps, 'variants'> & ComponentVariants<typeof DrawerStyles>
|
|
9
|
+
|
|
10
|
+
export const Drawer:React.FC<DrawerProps> = (props) => {
|
|
11
|
+
const { variants, styles, ...modalProps } = props
|
|
12
|
+
|
|
13
|
+
const variantStyles = useDefaultComponentStyle('u:Drawer', {
|
|
14
|
+
variants,
|
|
15
|
+
styles,
|
|
16
|
+
transform: StyleSheet.flatten,
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
return <Modal
|
|
20
|
+
styles={variantStyles}
|
|
21
|
+
|
|
22
|
+
{...modalProps}
|
|
23
|
+
/>
|
|
24
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createDefaultVariantFactory } from '@codeleap/common'
|
|
2
|
+
import { ModalComposition, ModalStyles } from '../Modal'
|
|
3
|
+
|
|
4
|
+
export type DrawerComposition = ModalComposition
|
|
5
|
+
const createDrawerStyle = createDefaultVariantFactory<DrawerComposition>()
|
|
6
|
+
|
|
7
|
+
export const DrawerStyles = {
|
|
8
|
+
...ModalStyles,
|
|
9
|
+
default: createDrawerStyle((theme) => {
|
|
10
|
+
const defaultStyle = ModalStyles.default(theme)
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
...defaultStyle,
|
|
14
|
+
box: {
|
|
15
|
+
width: '100%',
|
|
16
|
+
maxHeight: theme.values.height * 0.7,
|
|
17
|
+
paddingBottom: (theme.values.bottomNavHeight ?? 0) + theme.spacing.value(1),
|
|
18
|
+
},
|
|
19
|
+
innerWrapperScroll: {
|
|
20
|
+
...theme.presets.justifyEnd,
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
'box:hidden': {
|
|
24
|
+
translateY: theme.values.height,
|
|
25
|
+
opacity: 1,
|
|
26
|
+
scale: 1,
|
|
27
|
+
},
|
|
28
|
+
'box:visible': {
|
|
29
|
+
translateY: 0,
|
|
30
|
+
scale: 1,
|
|
31
|
+
opacity: 1,
|
|
32
|
+
},
|
|
33
|
+
'box:transition': {
|
|
34
|
+
translateY: theme.values.transitions.modal,
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
}
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import React, { useMemo } from 'react'
|
|
2
|
-
import { Icon } from '
|
|
3
|
-
import { View } from '
|
|
4
|
-
import { Text } from '
|
|
5
|
-
import { ActivityIndicator } from '
|
|
2
|
+
import { Icon } from '../Icon'
|
|
3
|
+
import { View } from '../View'
|
|
4
|
+
import { Text } from '../Text'
|
|
5
|
+
import { ActivityIndicator } from '../ActivityIndicator'
|
|
6
6
|
import {
|
|
7
7
|
ComponentVariants,
|
|
8
|
-
|
|
9
|
-
EmptyPlaceholderStyles,
|
|
8
|
+
|
|
10
9
|
getNestedStylesByKey,
|
|
11
10
|
IconPlaceholder,
|
|
12
11
|
useDefaultComponentStyle,
|
|
13
12
|
} from '@codeleap/common'
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
EmptyPlaceholderComposition,
|
|
16
|
+
EmptyPlaceholderStyles,
|
|
17
|
+
} from './styles'
|
|
18
|
+
|
|
14
19
|
import { StyleSheet } from 'react-native'
|
|
15
|
-
import { StylesOf } from '
|
|
20
|
+
import { StylesOf } from '../../types'
|
|
21
|
+
|
|
22
|
+
export * from './styles'
|
|
16
23
|
|
|
17
24
|
export type EmptyPlaceholderProps = {
|
|
18
25
|
itemName?: string
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { assignTextStyle, createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
import { ActivityIndicatorComposition } from '../ActivityIndicator'
|
|
3
|
+
|
|
4
|
+
export type EmptyPlaceholderComposition =
|
|
5
|
+
| 'wrapper:loading'
|
|
6
|
+
| `loader${Capitalize<ActivityIndicatorComposition>}`
|
|
7
|
+
| 'wrapper'
|
|
8
|
+
| 'text'
|
|
9
|
+
| 'icon'
|
|
10
|
+
|
|
11
|
+
const createEmptyPlaceholderStyle = createDefaultVariantFactory<EmptyPlaceholderComposition>()
|
|
12
|
+
|
|
13
|
+
const presets = includePresets((styles) => createEmptyPlaceholderStyle(() => ({ wrapper: styles })),
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export const EmptyPlaceholderStyles = {
|
|
17
|
+
...presets,
|
|
18
|
+
default: createEmptyPlaceholderStyle((theme) => ({
|
|
19
|
+
wrapper: {
|
|
20
|
+
...theme.presets.center,
|
|
21
|
+
minHeight: theme.values.height / 2,
|
|
22
|
+
height: '100%',
|
|
23
|
+
flex: 1,
|
|
24
|
+
},
|
|
25
|
+
loaderWrapper: {
|
|
26
|
+
|
|
27
|
+
...theme.spacing.marginVertical(8),
|
|
28
|
+
...theme.presets.center,
|
|
29
|
+
...theme.presets.flex,
|
|
30
|
+
},
|
|
31
|
+
icon: {
|
|
32
|
+
color: theme.colors.placeholder,
|
|
33
|
+
size: theme.spacing.value(24),
|
|
34
|
+
},
|
|
35
|
+
text: {
|
|
36
|
+
...assignTextStyle('p1')(theme).text,
|
|
37
|
+
...theme.presets.textCenter,
|
|
38
|
+
},
|
|
39
|
+
})),
|
|
40
|
+
compact: createEmptyPlaceholderStyle((theme) => ({
|
|
41
|
+
wrapper: {
|
|
42
|
+
...theme.spacing.marginVertical(0),
|
|
43
|
+
marginBottom: theme.spacing.value(6),
|
|
44
|
+
},
|
|
45
|
+
})),
|
|
46
|
+
absolute: createEmptyPlaceholderStyle((theme) => ({
|
|
47
|
+
'wrapper:loading': {
|
|
48
|
+
...theme.presets.absolute,
|
|
49
|
+
...theme.presets.whole,
|
|
50
|
+
backgroundColor: theme.colors.background,
|
|
51
|
+
},
|
|
52
|
+
wrapper: {
|
|
53
|
+
...theme.presets.absolute,
|
|
54
|
+
...theme.presets.whole,
|
|
55
|
+
backgroundColor: theme.colors.background,
|
|
56
|
+
},
|
|
57
|
+
})),
|
|
58
|
+
}
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import React, { forwardRef, useImperativeHandle } from 'react'
|
|
2
|
-
import { DocumentPicker, ImageCropPicker } from '
|
|
2
|
+
import { DocumentPicker, ImageCropPicker } from '../../modules/documentPicker'
|
|
3
3
|
import {
|
|
4
4
|
ComponentVariants,
|
|
5
|
-
|
|
6
|
-
FileInputStyles,
|
|
5
|
+
|
|
7
6
|
IconPlaceholder,
|
|
8
7
|
MobileInputFile,
|
|
9
8
|
parseFilePathData,
|
|
10
9
|
useDefaultComponentStyle,
|
|
11
10
|
useCodeleapContext,
|
|
11
|
+
MobileFile,
|
|
12
12
|
} from '@codeleap/common'
|
|
13
|
-
import { StylesOf } from '
|
|
14
|
-
import { Button, ButtonProps } from '
|
|
15
|
-
import { View } from '
|
|
16
|
-
import { InputLabel } from '
|
|
17
|
-
import OSAlert from '
|
|
13
|
+
import { StylesOf } from '../../types'
|
|
14
|
+
import { Button, ButtonProps } from '../Button'
|
|
15
|
+
import { View } from '../View'
|
|
16
|
+
import { InputLabel } from '../TextInput'
|
|
17
|
+
import { OSAlert } from '../../utils'
|
|
18
18
|
import { Options } from 'react-native-image-crop-picker'
|
|
19
|
-
import { DocumentPickerOptions } from '
|
|
19
|
+
import { DocumentPickerOptions } from '../../modules/types/documentPicker'
|
|
20
|
+
|
|
21
|
+
export * from './styles'
|
|
22
|
+
|
|
23
|
+
import {
|
|
24
|
+
FileInputComposition,
|
|
25
|
+
FileInputStyles,
|
|
26
|
+
} from './styles'
|
|
20
27
|
|
|
21
28
|
export type FileInputRef = {
|
|
22
29
|
openFilePicker: (string?: 'camera' | 'library') => void
|
|
@@ -44,15 +51,13 @@ export type FileInputProps = {
|
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
const pickerDefaults = {
|
|
47
|
-
width: 300,
|
|
48
|
-
height: 400,
|
|
49
54
|
cropping: true,
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
function parsePickerData(data:any):MobileInputFile {
|
|
53
58
|
|
|
54
59
|
const filePathData = parseFilePathData(data.path)
|
|
55
|
-
const d:
|
|
60
|
+
const d:MobileFile = {
|
|
56
61
|
name: filePathData.name,
|
|
57
62
|
size: data.size,
|
|
58
63
|
type: data.mime,
|
|
@@ -108,24 +113,10 @@ export const FileInput = forwardRef<
|
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
function handleError(err) {
|
|
111
|
-
const warn = DocumentPicker.isCancel(err) || String(err).includes('Error: User cancelled')
|
|
112
|
-
if (warn) {
|
|
113
|
-
// NOTE yeah, it should not be both of course but just logger.* isn't showing for some reason
|
|
114
|
-
logger.warn(err)
|
|
115
116
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
logger.error(err)
|
|
117
|
+
logger.warn('File Input Error', err, 'FILE INPUT')
|
|
118
|
+
onError?.(err)
|
|
119
119
|
|
|
120
|
-
if (onError) {
|
|
121
|
-
onError(err)
|
|
122
|
-
} else {
|
|
123
|
-
OSAlert.error({
|
|
124
|
-
title: 'Error',
|
|
125
|
-
body: err.message,
|
|
126
|
-
})
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
120
|
}
|
|
130
121
|
|
|
131
122
|
const mergedOptions = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
|
|
3
|
+
export type FileInputComposition = 'label' | 'wrapper' | 'input'
|
|
4
|
+
|
|
5
|
+
const createFileInputStyle =
|
|
6
|
+
createDefaultVariantFactory<FileInputComposition>()
|
|
7
|
+
|
|
8
|
+
const presets = includePresets((styles) => createFileInputStyle(() => ({ wrapper: styles })),
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
export const FileInputStyles = {
|
|
12
|
+
...presets,
|
|
13
|
+
default: createFileInputStyle((theme) => ({})),
|
|
14
|
+
|
|
15
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { forwardRef } from 'react'
|
|
3
|
+
import {
|
|
4
|
+
useDefaultComponentStyle,
|
|
5
|
+
ComponentVariants,
|
|
6
|
+
} from '@codeleap/common'
|
|
7
|
+
|
|
8
|
+
import { FlatGrid, FlatGridProps, GridRenderItemInfo } from 'react-native-super-grid'
|
|
9
|
+
import { RefreshControl, StyleSheet, RefreshControlProps } from 'react-native'
|
|
10
|
+
import { View, ViewProps } from '../View'
|
|
11
|
+
import { EmptyPlaceholder, EmptyPlaceholderProps } from '../EmptyPlaceholder'
|
|
12
|
+
import { GridComposition, GridStyles } from './styles'
|
|
13
|
+
import { StylesOf } from '../../types'
|
|
14
|
+
import { listenToKeyboardEvents } from '../../utils'
|
|
15
|
+
|
|
16
|
+
export type DataboundFlatGridPropsTypes = 'data' | 'renderItem' | 'keyExtractor' | 'getItemLayout'
|
|
17
|
+
|
|
18
|
+
export type ReplaceFlatGridProps<P, T> = Omit<P, DataboundFlatGridPropsTypes> & {
|
|
19
|
+
data: T[]
|
|
20
|
+
keyExtractor?: (item: T, index: number) => string
|
|
21
|
+
renderItem: (data: GridRenderItemInfo<T>) => React.ReactElement
|
|
22
|
+
onRefresh?: () => void
|
|
23
|
+
getItemLayout?: ((
|
|
24
|
+
data:T,
|
|
25
|
+
index: number,
|
|
26
|
+
) => { length: number; offset: number; index: number })
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export * from './styles'
|
|
30
|
+
|
|
31
|
+
const KeyboardAwareFlatGrid = listenToKeyboardEvents(FlatGrid)
|
|
32
|
+
|
|
33
|
+
export type GridProps<
|
|
34
|
+
T = any[],
|
|
35
|
+
Data = T extends Array<infer D> ? D : never
|
|
36
|
+
> =FlatGridProps<Data> &
|
|
37
|
+
Omit<ViewProps, 'variants'> & {
|
|
38
|
+
separators?: boolean
|
|
39
|
+
placeholder?: EmptyPlaceholderProps
|
|
40
|
+
keyboardAware?: boolean
|
|
41
|
+
styles?: StylesOf<GridComposition>
|
|
42
|
+
refreshControlProps?: Partial<RefreshControlProps>
|
|
43
|
+
} & ComponentVariants<typeof GridStyles>
|
|
44
|
+
|
|
45
|
+
const GridCP = forwardRef<FlatGrid, GridProps>(
|
|
46
|
+
(flatGridProps, ref) => {
|
|
47
|
+
const {
|
|
48
|
+
variants = [],
|
|
49
|
+
style,
|
|
50
|
+
styles = {},
|
|
51
|
+
onRefresh,
|
|
52
|
+
refreshing,
|
|
53
|
+
placeholder,
|
|
54
|
+
keyboardAware = true,
|
|
55
|
+
refreshControlProps = {},
|
|
56
|
+
...props
|
|
57
|
+
} = flatGridProps
|
|
58
|
+
|
|
59
|
+
const variantStyles = useDefaultComponentStyle<'u:Grid', typeof GridStyles>('u:Grid', {
|
|
60
|
+
variants,
|
|
61
|
+
styles,
|
|
62
|
+
transform: StyleSheet.flatten,
|
|
63
|
+
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const renderSeparator = () => {
|
|
67
|
+
return (
|
|
68
|
+
<View variants={['separator']}></View>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const separatorProp = props.separators
|
|
73
|
+
const isEmpty = !props.data || !props.data.length
|
|
74
|
+
const separator = !isEmpty && separatorProp == true && renderSeparator
|
|
75
|
+
|
|
76
|
+
const Component = keyboardAware ? KeyboardAwareFlatGrid : FlatGrid
|
|
77
|
+
const refreshStyles = StyleSheet.flatten([variantStyles.refreshControl, styles.refreshControl])
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<Component
|
|
81
|
+
style={[variantStyles.wrapper, style]}
|
|
82
|
+
contentContainerStyle={variantStyles.content}
|
|
83
|
+
ref={ref as unknown as FlatGrid}
|
|
84
|
+
ItemSeparatorComponent={separator}
|
|
85
|
+
refreshControl={
|
|
86
|
+
!!onRefresh && (
|
|
87
|
+
<RefreshControl
|
|
88
|
+
refreshing={refreshing}
|
|
89
|
+
onRefresh={onRefresh}
|
|
90
|
+
tintColor={refreshStyles?.color}
|
|
91
|
+
colors={[refreshStyles?.color]}
|
|
92
|
+
{...refreshControlProps}
|
|
93
|
+
/>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
ListEmptyComponent={<EmptyPlaceholder {...placeholder}/>}
|
|
98
|
+
{...props}
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
},
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
export type GridComponentType = <T extends any[] = any[]>(props: FlatGridProps<T>) => React.ReactElement
|
|
105
|
+
|
|
106
|
+
export const Grid = GridCP as GridComponentType
|
|
107
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createDefaultVariantFactory } from '@codeleap/common'
|
|
2
|
+
import { ListComposition, ListStyles } from '../List'
|
|
3
|
+
|
|
4
|
+
export type GridComposition = ListComposition
|
|
5
|
+
|
|
6
|
+
const createGridStyle = createDefaultVariantFactory<GridComposition>()
|
|
7
|
+
|
|
8
|
+
export const GridStyles = {
|
|
9
|
+
...ListStyles,
|
|
10
|
+
|
|
11
|
+
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import {
|
|
3
3
|
ComponentVariants,
|
|
4
|
-
|
|
5
|
-
IconStyles,
|
|
4
|
+
|
|
6
5
|
useDefaultComponentStyle,
|
|
7
6
|
useCodeleapContext,
|
|
8
7
|
arePropsEqual,
|
|
8
|
+
IconPlaceholder,
|
|
9
9
|
} from '@codeleap/common'
|
|
10
10
|
import { StyleSheet } from 'react-native'
|
|
11
|
-
import { View } from '
|
|
11
|
+
import { View } from '../View'
|
|
12
|
+
export * from './styles'
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
IconStyles,
|
|
16
|
+
} from './styles'
|
|
12
17
|
|
|
13
18
|
export type IconProps = {
|
|
14
19
|
name: IconPlaceholder
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
2
|
+
|
|
3
|
+
export type IconComposition = 'icon'
|
|
4
|
+
|
|
5
|
+
const createIconStyle = createDefaultVariantFactory<IconComposition>()
|
|
6
|
+
|
|
7
|
+
const presets = includePresets((styles) => createIconStyle(() => ({ icon: styles })))
|
|
8
|
+
|
|
9
|
+
export const IconStyles = {
|
|
10
|
+
...presets,
|
|
11
|
+
default: createIconStyle((theme) => ({
|
|
12
|
+
icon: {
|
|
13
|
+
color: theme.colors.icon,
|
|
14
|
+
},
|
|
15
|
+
})),
|
|
16
|
+
white: createIconStyle((theme) => ({
|
|
17
|
+
icon: {
|
|
18
|
+
color: theme.colors.white,
|
|
19
|
+
},
|
|
20
|
+
})),
|
|
21
|
+
|
|
22
|
+
primary: createIconStyle((theme) => ({
|
|
23
|
+
icon: {
|
|
24
|
+
color: theme.colors.primary,
|
|
25
|
+
},
|
|
26
|
+
})),
|
|
27
|
+
negative: createIconStyle((theme) => ({
|
|
28
|
+
icon: {
|
|
29
|
+
color: theme.colors.negative,
|
|
30
|
+
},
|
|
31
|
+
})),
|
|
32
|
+
positive: createIconStyle((theme) => ({
|
|
33
|
+
icon: {
|
|
34
|
+
color: theme.colors.positive,
|
|
35
|
+
},
|
|
36
|
+
})),
|
|
37
|
+
small: createIconStyle((theme) => ({
|
|
38
|
+
icon: {
|
|
39
|
+
...theme.sized(1),
|
|
40
|
+
},
|
|
41
|
+
})),
|
|
42
|
+
medium: createIconStyle((theme) => ({
|
|
43
|
+
icon: {
|
|
44
|
+
...theme.sized(2),
|
|
45
|
+
},
|
|
46
|
+
})),
|
|
47
|
+
large: createIconStyle((theme) => ({
|
|
48
|
+
icon: {
|
|
49
|
+
...theme.sized(3),
|
|
50
|
+
},
|
|
51
|
+
})),
|
|
52
|
+
}
|