@codeleap/mobile 1.9.33 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActionIcon/index.d.ts +13 -0
- package/dist/components/ActionIcon/index.js +54 -0
- package/dist/components/ActionIcon/index.js.map +1 -0
- package/dist/components/ActionIcon/styles.d.ts +64 -0
- package/dist/components/ActionIcon/styles.js +57 -0
- package/dist/components/ActionIcon/styles.js.map +1 -0
- package/dist/components/{ActivityIndicator.d.ts → ActivityIndicator/index.d.ts} +4 -2
- package/dist/components/{ActivityIndicator.js → ActivityIndicator/index.js} +5 -1
- package/dist/components/ActivityIndicator/index.js.map +1 -0
- package/dist/components/ActivityIndicator/styles.d.ts +59 -0
- package/dist/components/ActivityIndicator/styles.js +52 -0
- package/dist/components/ActivityIndicator/styles.js.map +1 -0
- package/dist/components/AutoComplete/index.d.ts +33 -0
- package/dist/components/AutoComplete/index.js +129 -0
- package/dist/components/AutoComplete/index.js.map +1 -0
- package/dist/components/AutoComplete/styles.d.ts +57 -0
- package/dist/components/AutoComplete/styles.js +28 -0
- package/dist/components/AutoComplete/styles.js.map +1 -0
- package/dist/components/Backdrop/index.d.ts +14 -0
- package/dist/components/{Backdrop.js → Backdrop/index.js} +21 -30
- package/dist/components/Backdrop/index.js.map +1 -0
- package/dist/components/{Backdrop.d.ts → Backdrop/styles.d.ts} +7 -20
- package/dist/components/Backdrop/styles.js +28 -0
- package/dist/components/Backdrop/styles.js.map +1 -0
- package/dist/components/Button/index.d.ts +247 -0
- package/dist/components/{Button.js → Button/index.js} +45 -13
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Button/styles.d.ts +65 -0
- package/dist/components/Button/styles.js +61 -0
- package/dist/components/Button/styles.js.map +1 -0
- package/dist/components/Calendar/index.d.ts +15 -0
- package/dist/components/Calendar/index.js +80 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Calendar/style.d.ts +4 -0
- package/dist/components/Calendar/style.js +36 -0
- package/dist/components/Calendar/style.js.map +1 -0
- package/dist/components/Calendar/types.d.ts +95 -0
- package/dist/components/Calendar/types.js +3 -0
- package/dist/components/Calendar/types.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -2
- package/dist/components/Checkbox/index.js +5 -3
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.d.ts +53 -53
- package/dist/components/Checkbox/styles.js +6 -2
- package/dist/components/Checkbox/styles.js.map +1 -1
- package/dist/components/{ContentView.d.ts → ContentView/index.d.ts} +5 -3
- package/dist/components/{ContentView.js → ContentView/index.js} +19 -4
- package/dist/components/ContentView/index.js.map +1 -0
- package/dist/components/ContentView/styles.d.ts +53 -0
- package/dist/components/ContentView/styles.js +26 -0
- package/dist/components/ContentView/styles.js.map +1 -0
- package/dist/components/Drawer/index.d.ts +7 -0
- package/dist/components/{View.js → Drawer/index.js} +18 -15
- package/dist/components/Drawer/index.js.map +1 -0
- package/dist/components/{NewModal → Drawer}/styles.d.ts +55 -56
- package/dist/components/Drawer/styles.js +37 -0
- package/dist/components/Drawer/styles.js.map +1 -0
- package/dist/components/{EmptyPlaceholder.d.ts → EmptyPlaceholder/index.d.ts} +4 -2
- package/dist/components/{EmptyPlaceholder.js → EmptyPlaceholder/index.js} +9 -5
- package/dist/components/EmptyPlaceholder/index.js.map +1 -0
- package/dist/components/EmptyPlaceholder/styles.d.ts +55 -0
- package/dist/components/EmptyPlaceholder/styles.js +32 -0
- package/dist/components/EmptyPlaceholder/styles.js.map +1 -0
- package/dist/components/{FileInput.d.ts → FileInput/index.d.ts} +8 -6
- package/dist/components/{FileInput.js → FileInput/index.js} +13 -30
- package/dist/components/FileInput/index.js.map +1 -0
- package/dist/components/FileInput/styles.d.ts +53 -0
- package/dist/components/FileInput/styles.js +19 -0
- package/dist/components/FileInput/styles.js.map +1 -0
- package/dist/components/Grid/index.d.ts +30 -0
- package/dist/components/Grid/index.js +69 -0
- package/dist/components/Grid/index.js.map +1 -0
- package/dist/components/Grid/styles.d.ts +5 -0
- package/dist/components/Grid/styles.js +19 -0
- package/dist/components/Grid/styles.js.map +1 -0
- package/dist/components/{Icon.d.ts → Icon/index.d.ts} +3 -1
- package/dist/components/{Icon.js → Icon/index.js} +6 -2
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/{NewPager → Icon}/styles.d.ts +59 -86
- package/dist/components/Icon/styles.js +45 -0
- package/dist/components/Icon/styles.js.map +1 -0
- package/dist/components/{Image.d.ts → Image/index.d.ts} +6 -4
- package/dist/components/{Image.js → Image/index.js} +38 -7
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Image/styles.d.ts +54 -0
- package/dist/components/Image/styles.js +25 -0
- package/dist/components/Image/styles.js.map +1 -0
- package/dist/components/ImageView/Spotlight.d.ts +25 -0
- package/dist/components/ImageView/Spotlight.js +155 -0
- package/dist/components/ImageView/Spotlight.js.map +1 -0
- package/dist/components/ImageView/component.d.ts +5 -0
- package/dist/components/ImageView/component.js +54 -0
- package/dist/components/ImageView/component.js.map +1 -0
- package/dist/components/ImageView/index.d.ts +2 -0
- package/dist/components/ImageView/index.js +19 -0
- package/dist/components/ImageView/index.js.map +1 -0
- package/dist/components/List/PaginationIndicator.d.ts +67 -0
- package/dist/components/List/PaginationIndicator.js +51 -0
- package/dist/components/List/PaginationIndicator.js.map +1 -0
- package/dist/components/{List.d.ts → List/index.d.ts} +12 -15
- package/dist/components/List/index.js +68 -0
- package/dist/components/List/index.js.map +1 -0
- package/dist/components/List/styles.d.ts +5 -0
- package/dist/components/List/styles.js +24 -0
- package/dist/components/List/styles.js.map +1 -0
- package/dist/components/Modal/index.d.ts +13 -3
- package/dist/components/Modal/index.js +23 -8
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.d.ts +55 -55
- package/dist/components/Modal/styles.js +4 -3
- package/dist/components/Modal/styles.js.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +6 -0
- package/dist/components/MultiSelect/index.js +106 -0
- package/dist/components/MultiSelect/index.js.map +1 -0
- package/dist/components/MultiSelect/styles.d.ts +58 -0
- package/dist/components/MultiSelect/styles.js +22 -0
- package/dist/components/MultiSelect/styles.js.map +1 -0
- package/dist/components/MultiSelect/types.d.ts +32 -0
- package/dist/components/MultiSelect/types.js +3 -0
- package/dist/components/MultiSelect/types.js.map +1 -0
- package/dist/components/Navigation/Navigation.js +1 -5
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/Navigation/utils.js +0 -1
- package/dist/components/Navigation/utils.js.map +1 -1
- package/dist/components/Pager/index.d.ts +18 -12
- package/dist/components/Pager/index.js +54 -134
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/styles.d.ts +42 -9
- package/dist/components/Pager/styles.js +53 -25
- package/dist/components/Pager/styles.js.map +1 -1
- package/dist/components/RadioInput/index.d.ts +4 -4
- package/dist/components/RadioInput/index.js +3 -1
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.d.ts +54 -54
- package/dist/components/RadioInput/styles.js +12 -7
- package/dist/components/RadioInput/styles.js.map +1 -1
- package/dist/components/Scroll/index.d.ts +18 -0
- package/dist/components/{Scroll.js → Scroll/index.js} +14 -11
- package/dist/components/Scroll/index.js.map +1 -0
- package/dist/components/Scroll/styles.d.ts +4 -0
- package/dist/components/Scroll/styles.js +27 -0
- package/dist/components/Scroll/styles.js.map +1 -0
- package/dist/components/Sections/index.d.ts +11 -0
- package/dist/components/{Sections.js → Sections/index.js} +4 -5
- package/dist/components/Sections/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.d.ts +10 -1
- package/dist/components/SegmentedControl/index.js +27 -27
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/styles.d.ts +56 -51
- package/dist/components/SegmentedControl/styles.js +10 -3
- package/dist/components/SegmentedControl/styles.js.map +1 -1
- package/dist/components/Select/index.d.ts +8 -0
- package/dist/components/Select/index.js +37 -80
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.d.ts +57 -7
- package/dist/components/Select/styles.js +17 -41
- package/dist/components/Select/styles.js.map +1 -1
- package/dist/components/Select/types.d.ts +16 -25
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +4 -0
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.d.ts +53 -0
- package/dist/components/Slider/styles.js +61 -0
- package/dist/components/Slider/styles.js.map +1 -0
- package/dist/components/Slider/types.d.ts +3 -2
- package/dist/components/{Switch.d.ts → Switch/index.d.ts} +3 -2
- package/dist/components/{Switch.js → Switch/index.js} +9 -5
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Switch/styles.d.ts +54 -0
- package/dist/components/Switch/styles.js +34 -0
- package/dist/components/Switch/styles.js.map +1 -0
- package/dist/components/{Text.d.ts → Text/index.d.ts} +7 -3
- package/dist/components/{Text.js → Text/index.js} +53 -5
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Text/styles.d.ts +70 -0
- package/dist/components/Text/styles.js +31 -0
- package/dist/components/Text/styles.js.map +1 -0
- package/dist/components/TextInput/Label.d.ts +9 -0
- package/dist/components/TextInput/Label.js +34 -0
- package/dist/components/TextInput/Label.js.map +1 -0
- package/dist/components/{TextInput.d.ts → TextInput/index.d.ts} +42 -45
- package/dist/components/TextInput/index.js +204 -0
- package/dist/components/TextInput/index.js.map +1 -0
- package/dist/components/TextInput/styles.d.ts +62 -0
- package/dist/components/TextInput/styles.js +68 -0
- package/dist/components/TextInput/styles.js.map +1 -0
- package/dist/components/Touchable/index.d.ts +20 -0
- package/dist/components/Touchable/index.js +165 -0
- package/dist/components/Touchable/index.js.map +1 -0
- package/dist/components/Touchable/styles.d.ts +58 -0
- package/dist/components/Touchable/styles.js +24 -0
- package/dist/components/Touchable/styles.js.map +1 -0
- package/dist/components/{View.d.ts → View/index.d.ts} +6 -0
- package/dist/components/View/index.js +99 -0
- package/dist/components/View/index.js.map +1 -0
- package/dist/components/View/styles.d.ts +54 -0
- package/dist/components/View/styles.js +29 -0
- package/dist/components/View/styles.js.map +1 -0
- package/dist/components/components.d.ts +10 -3
- package/dist/components/components.js +23 -3
- package/dist/components/components.js.map +1 -1
- package/dist/components/defaultStyles.d.ts +1364 -0
- package/dist/components/defaultStyles.js +63 -0
- package/dist/components/defaultStyles.js.map +1 -0
- package/dist/components/{_Modal → legacy/Modal}/index.d.ts +3 -3
- package/dist/components/{_Modal → legacy/Modal}/index.js +6 -6
- package/dist/components/legacy/Modal/index.js.map +1 -0
- package/dist/components/{_Modal → legacy/Modal}/styles.d.ts +6 -6
- package/dist/components/{_Modal → legacy/Modal}/styles.js +0 -0
- package/dist/components/legacy/Modal/styles.js.map +1 -0
- package/dist/components/legacy/Pager/index.d.ts +20 -0
- package/dist/components/legacy/Pager/index.js +168 -0
- package/dist/components/legacy/Pager/index.js.map +1 -0
- package/dist/components/legacy/Pager/styles.d.ts +54 -0
- package/dist/components/legacy/Pager/styles.js +44 -0
- package/dist/components/legacy/Pager/styles.js.map +1 -0
- package/dist/components/legacy/index.d.ts +2 -0
- package/dist/components/legacy/index.js +19 -0
- package/dist/components/legacy/index.js.map +1 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/modules/reactNavigation.d.ts +2 -0
- package/dist/modules/reactNavigation.js +16 -1
- package/dist/modules/reactNavigation.js.map +1 -1
- package/dist/modules/textInputMask.d.ts +1 -0
- package/dist/modules/textInputMask.js +15 -0
- package/dist/modules/textInputMask.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/KeyboardAware/index.d.ts +6 -0
- package/dist/utils/KeyboardAware/index.js +31 -0
- package/dist/utils/KeyboardAware/index.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js +9 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +67 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +451 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.d.ts +7 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js +4 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js +10 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js.map +1 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.d.ts +3 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js +10 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js.map +1 -0
- package/dist/utils/KeyboardAware/types.d.ts +1 -0
- package/dist/utils/KeyboardAware/types.js +7 -0
- package/dist/utils/KeyboardAware/types.js.map +1 -0
- package/dist/utils/ModalManager/components.d.ts +10 -2
- package/dist/utils/ModalManager/components.js +39 -7
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.d.ts +1 -0
- package/dist/utils/ModalManager/context.js +6 -0
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/ModalManager/index.d.ts +3 -2
- package/dist/utils/ModalManager/index.js +1 -0
- package/dist/utils/ModalManager/index.js.map +1 -1
- package/dist/utils/OSAlert.d.ts +6 -5
- package/dist/utils/OSAlert.js +7 -6
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/PermissionManager/context.js +0 -7
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/hooks.d.ts +34 -1
- package/dist/utils/hooks.js +54 -1
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +38 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/misc.d.ts +5 -1
- package/dist/utils/misc.js +62 -1
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/notifications.d.ts +34 -0
- package/dist/utils/notifications.js +268 -0
- package/dist/utils/notifications.js.map +1 -0
- package/package.json +13 -4
- package/src/components/ActionIcon/index.tsx +31 -0
- package/src/components/ActionIcon/styles.ts +92 -0
- package/src/components/{ActivityIndicator.tsx → ActivityIndicator/index.tsx} +7 -3
- package/src/components/ActivityIndicator/styles.ts +68 -0
- package/src/components/AutoComplete/index.tsx +158 -0
- package/src/components/AutoComplete/styles.ts +49 -0
- package/src/components/{Backdrop.tsx → Backdrop/index.tsx} +9 -42
- package/src/components/Backdrop/styles.ts +33 -0
- package/src/components/{Button.tsx → Button/index.tsx} +62 -13
- package/src/components/Button/styles.ts +129 -0
- package/src/components/Calendar/index.tsx +65 -0
- package/src/components/Calendar/style.ts +35 -0
- package/src/components/Calendar/types.ts +102 -0
- package/src/components/Checkbox/index.tsx +10 -5
- package/src/components/Checkbox/styles.ts +8 -3
- package/src/components/{ContentView.tsx → ContentView/index.tsx} +11 -6
- package/src/components/ContentView/styles.ts +25 -0
- package/src/components/Drawer/index.tsx +24 -0
- package/src/components/Drawer/styles.ts +38 -0
- package/src/components/{EmptyPlaceholder.tsx → EmptyPlaceholder/index.tsx} +14 -7
- package/src/components/EmptyPlaceholder/styles.ts +58 -0
- package/src/components/{FileInput.tsx → FileInput/index.tsx} +19 -28
- package/src/components/FileInput/styles.ts +15 -0
- package/src/components/Grid/index.tsx +107 -0
- package/src/components/Grid/styles.ts +11 -0
- package/src/components/{Icon.tsx → Icon/index.tsx} +8 -3
- package/src/components/Icon/styles.ts +52 -0
- package/src/components/Image/index.tsx +91 -0
- package/src/components/Image/styles.ts +20 -0
- package/src/components/ImageView/Spotlight.tsx +158 -0
- package/src/components/ImageView/component.tsx +38 -0
- package/src/components/ImageView/index.ts +2 -0
- package/src/components/List/PaginationIndicator.tsx +71 -0
- package/src/components/List/index.tsx +108 -0
- package/src/components/List/styles.ts +15 -0
- package/src/components/Modal/index.tsx +75 -39
- package/src/components/Modal/styles.ts +7 -5
- package/src/components/MultiSelect/index.tsx +120 -0
- package/src/components/MultiSelect/styles.ts +18 -0
- package/src/components/MultiSelect/types.ts +39 -0
- package/src/components/Navigation/Navigation.tsx +1 -5
- package/src/components/Navigation/utils.tsx +0 -2
- package/src/components/Pager/index.tsx +81 -202
- package/src/components/Pager/styles.ts +57 -27
- package/src/components/RadioInput/index.tsx +8 -7
- package/src/components/RadioInput/styles.ts +10 -11
- package/src/components/{Scroll.tsx → Scroll/index.tsx} +22 -24
- package/src/components/Scroll/styles.ts +18 -0
- package/src/components/{Sections.tsx → Sections/index.tsx} +5 -15
- package/src/components/SegmentedControl/index.tsx +30 -17
- package/src/components/SegmentedControl/styles.ts +29 -7
- package/src/components/Select/index.tsx +78 -142
- package/src/components/Select/styles.ts +52 -74
- package/src/components/Select/types.ts +16 -23
- package/src/components/Slider/index.tsx +2 -0
- package/src/components/Slider/styles.ts +75 -0
- package/src/components/Slider/types.ts +7 -2
- package/src/components/{Switch.tsx → Switch/index.tsx} +10 -5
- package/src/components/Switch/styles.ts +37 -0
- package/src/components/Text/index.tsx +102 -0
- package/src/components/Text/styles.ts +50 -0
- package/src/components/TextInput/Label.tsx +26 -0
- package/src/components/{TextInput.tsx → TextInput/index.tsx} +124 -75
- package/src/components/TextInput/styles.ts +130 -0
- package/src/components/Touchable/index.tsx +182 -0
- package/src/components/Touchable/styles.ts +28 -0
- package/src/components/View/index.tsx +89 -0
- package/src/components/View/styles.ts +24 -0
- package/src/components/components.ts +14 -4
- package/src/components/defaultStyles.ts +60 -0
- package/src/components/{_Modal → legacy/Modal}/index.tsx +7 -7
- package/src/components/{_Modal → legacy/Modal}/styles.ts +0 -0
- package/src/components/legacy/Pager/index.tsx +242 -0
- package/src/components/legacy/Pager/styles.ts +51 -0
- package/src/components/legacy/index.ts +2 -0
- package/src/index.ts +4 -9
- package/src/modules/reactNavigation.ts +11 -0
- package/src/modules/textInputMask.ts +2 -0
- package/src/types/index.ts +1 -0
- package/src/utils/KeyboardAware/index.ts +15 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +4 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +618 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +13 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +6 -0
- package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +6 -0
- package/src/utils/KeyboardAware/types.ts +159 -0
- package/src/utils/ModalManager/components.tsx +57 -14
- package/src/utils/ModalManager/context.tsx +10 -0
- package/src/utils/ModalManager/index.ts +4 -1
- package/src/utils/OSAlert.ts +10 -10
- package/src/utils/PermissionManager/context.tsx +1 -7
- package/src/utils/hooks.ts +82 -2
- package/src/utils/index.ts +9 -0
- package/src/utils/misc.ts +61 -2
- package/src/utils/notifications.ts +206 -0
- package/dist/components/ActivityIndicator.js.map +0 -1
- package/dist/components/Backdrop.js.map +0 -1
- package/dist/components/Button.d.ts +0 -132
- package/dist/components/Button.js.map +0 -1
- package/dist/components/ContentView.js.map +0 -1
- package/dist/components/EmptyPlaceholder.js.map +0 -1
- package/dist/components/FileInput.js.map +0 -1
- package/dist/components/Gap.d.ts +0 -8
- package/dist/components/Gap.js +0 -60
- package/dist/components/Gap.js.map +0 -1
- package/dist/components/Icon.js.map +0 -1
- package/dist/components/Image.js.map +0 -1
- package/dist/components/List.js +0 -101
- package/dist/components/List.js.map +0 -1
- package/dist/components/NewModal/index.d.ts +0 -27
- package/dist/components/NewModal/index.js +0 -99
- package/dist/components/NewModal/index.js.map +0 -1
- package/dist/components/NewModal/styles.js +0 -58
- package/dist/components/NewModal/styles.js.map +0 -1
- package/dist/components/NewPager/index.d.ts +0 -26
- package/dist/components/NewPager/index.js +0 -88
- package/dist/components/NewPager/index.js.map +0 -1
- package/dist/components/NewPager/styles.js +0 -70
- package/dist/components/NewPager/styles.js.map +0 -1
- package/dist/components/Overlay.d.ts +0 -16
- package/dist/components/Overlay.js +0 -74
- package/dist/components/Overlay.js.map +0 -1
- package/dist/components/Scroll.d.ts +0 -15
- package/dist/components/Scroll.js.map +0 -1
- package/dist/components/Sections.d.ts +0 -11
- package/dist/components/Sections.js.map +0 -1
- package/dist/components/SegmentedControl.d.ts +0 -5
- package/dist/components/SegmentedControl.js +0 -32
- package/dist/components/SegmentedControl.js.map +0 -1
- package/dist/components/Switch.js.map +0 -1
- package/dist/components/Text.js.map +0 -1
- package/dist/components/TextInput.js +0 -181
- package/dist/components/TextInput.js.map +0 -1
- package/dist/components/Touchable.d.ts +0 -16
- package/dist/components/Touchable.js +0 -83
- package/dist/components/Touchable.js.map +0 -1
- package/dist/components/View.js.map +0 -1
- package/dist/components/_Modal/index.js.map +0 -1
- package/dist/components/_Modal/styles.js.map +0 -1
- package/dist/utils/PermissionManager/components.d.ts +0 -18
- package/dist/utils/PermissionManager/components.js +0 -52
- package/dist/utils/PermissionManager/components.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -1
- package/dist/utils/styles.js +0 -13
- package/dist/utils/styles.js.map +0 -1
- package/src/components/Gap.tsx +0 -40
- package/src/components/Image.tsx +0 -62
- package/src/components/List.tsx +0 -155
- package/src/components/NewPager/index.tsx +0 -121
- package/src/components/NewPager/styles.ts +0 -76
- package/src/components/Overlay.tsx +0 -86
- package/src/components/Text.tsx +0 -43
- package/src/components/Touchable.tsx +0 -89
- package/src/components/View.tsx +0 -48
- package/src/utils/styles.ts +0 -14
|
@@ -6,7 +6,7 @@ import { PropsOf, useCodeleapContext, useDefaultComponentStyle } from '@codeleap
|
|
|
6
6
|
import { SegmentedControlComposition, SegmentedControlStyles } from './styles'
|
|
7
7
|
import { Touchable } from '../Touchable'
|
|
8
8
|
import { StylesOf } from '../../types/utility'
|
|
9
|
-
import { Text } from '../Text'
|
|
9
|
+
import { Text, TextProps } from '../Text'
|
|
10
10
|
import { KeyboardAwareScrollViewTypes } from '../../modules'
|
|
11
11
|
import { View } from '../View'
|
|
12
12
|
export * from './styles'
|
|
@@ -24,6 +24,8 @@ export type SegmentedControlProps<T = string> = ScrollProps & {
|
|
|
24
24
|
duration?: number
|
|
25
25
|
easing?: EasingFunction
|
|
26
26
|
}
|
|
27
|
+
textProps?: Partial<PropsOf<typeof Text>>
|
|
28
|
+
touchableProps?: Partial<PropsOf<typeof Touchable>>
|
|
27
29
|
styles?: StylesOf<SegmentedControlComposition>
|
|
28
30
|
scrollProps?: any
|
|
29
31
|
RenderButton?: (props: SegmentedControlProps & {
|
|
@@ -31,12 +33,14 @@ export type SegmentedControlProps<T = string> = ScrollProps & {
|
|
|
31
33
|
textProps: PropsOf<typeof Text>
|
|
32
34
|
option: {label: string; value: any}
|
|
33
35
|
}) => ReactElement
|
|
34
|
-
RenderAnimatedView?: (props: SegmentedControlProps) => ReactElement
|
|
36
|
+
RenderAnimatedView?: (props: Partial<SegmentedControlProps>) => ReactElement
|
|
37
|
+
getItemWidth?: (item:{label: string; value: T }, idx: number, arr: {label: string; value: T }[]) => number
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
const defaultAnimation = {
|
|
41
|
+
type: 'timing',
|
|
38
42
|
duration: 200,
|
|
39
|
-
|
|
43
|
+
easing: Easing.linear,
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
const _SegmentedControl = React.forwardRef<SegmentedControlRef, SegmentedControlProps>((props, ref) => {
|
|
@@ -49,13 +53,13 @@ const _SegmentedControl = React.forwardRef<SegmentedControlRef, SegmentedControl
|
|
|
49
53
|
animation = {},
|
|
50
54
|
variants = [],
|
|
51
55
|
scrollProps = {},
|
|
56
|
+
getItemWidth = (i) => i.label.length * 20,
|
|
52
57
|
RenderAnimatedView,
|
|
53
58
|
RenderButton,
|
|
54
|
-
|
|
59
|
+
...viewProps
|
|
55
60
|
} = props
|
|
56
|
-
const { Theme } = useCodeleapContext()
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
let _animation = {
|
|
59
63
|
...defaultAnimation, ...animation,
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -75,14 +79,10 @@ const _SegmentedControl = React.forwardRef<SegmentedControlRef, SegmentedControl
|
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
const widthStyle = useMemo(() => {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const fitMaxWidth = Theme.values.width - Theme.spacing.value(4)
|
|
83
|
-
let fitItemWidth = maxWordLength * options.length * 6
|
|
84
|
-
if (fitItemWidth * options.length < fitMaxWidth) fitItemWidth = fitMaxWidth / options.length
|
|
85
|
-
return { width: fitItemWidth }
|
|
82
|
+
const sizes = options.map(getItemWidth)
|
|
83
|
+
const maxWidth = sizes.sort((a, b) => b - a)[0]
|
|
84
|
+
|
|
85
|
+
return { width: maxWidth }
|
|
86
86
|
}, [options])
|
|
87
87
|
|
|
88
88
|
const currentOptionIdx = options.findIndex(o => o.value === value) || 0
|
|
@@ -118,6 +118,7 @@ const _SegmentedControl = React.forwardRef<SegmentedControlRef, SegmentedControl
|
|
|
118
118
|
|
|
119
119
|
const AnimatedView = RenderAnimatedView || View
|
|
120
120
|
variantStyles = JSON.parse(JSON.stringify(variantStyles))
|
|
121
|
+
_animation = JSON.parse(JSON.stringify(_animation))
|
|
121
122
|
return (
|
|
122
123
|
<Scroll
|
|
123
124
|
horizontal
|
|
@@ -128,14 +129,19 @@ const _SegmentedControl = React.forwardRef<SegmentedControlRef, SegmentedControl
|
|
|
128
129
|
ref={scrollRef}
|
|
129
130
|
>
|
|
130
131
|
<View style={variantStyles.wrapper}>
|
|
131
|
-
<AnimatedView
|
|
132
|
+
<AnimatedView
|
|
133
|
+
options={options}
|
|
134
|
+
styles={variantStyles}
|
|
135
|
+
|
|
132
136
|
animated
|
|
133
137
|
style={[variantStyles.selectedBubble, widthStyle]}
|
|
134
138
|
animate={{
|
|
135
139
|
translateX,
|
|
136
140
|
}}
|
|
141
|
+
transition={{
|
|
142
|
+
translateX: _animation,
|
|
143
|
+
}}
|
|
137
144
|
|
|
138
|
-
transition={_animation}
|
|
139
145
|
/>
|
|
140
146
|
{options.map((o, idx) => {
|
|
141
147
|
const selected = value === o.value
|
|
@@ -145,13 +151,16 @@ const _SegmentedControl = React.forwardRef<SegmentedControlRef, SegmentedControl
|
|
|
145
151
|
debugName: `Segmented Control ${debugName}, option ${o.label}`,
|
|
146
152
|
onPress: onPress(o.value, idx),
|
|
147
153
|
style: [widthStyle, variantStyles.button],
|
|
154
|
+
...props.touchableProps,
|
|
155
|
+
|
|
148
156
|
}
|
|
149
157
|
|
|
150
|
-
const textProps = {
|
|
158
|
+
const textProps:TextProps = {
|
|
151
159
|
text: o.label as string,
|
|
152
160
|
colorChangeConfig: _animation,
|
|
153
161
|
style: StyleSheet.flatten([variantStyles.text, selected && variantStyles['text:selected']]),
|
|
154
162
|
animated: true,
|
|
163
|
+
...props.textProps,
|
|
155
164
|
}
|
|
156
165
|
|
|
157
166
|
if (RenderButton) {
|
|
@@ -161,7 +170,11 @@ const _SegmentedControl = React.forwardRef<SegmentedControlRef, SegmentedControl
|
|
|
161
170
|
}
|
|
162
171
|
return <Touchable
|
|
163
172
|
{...touchableProps}
|
|
173
|
+
noFeedback={selected}
|
|
164
174
|
key={touchableProps.key}
|
|
175
|
+
styles={{
|
|
176
|
+
feedback: variantStyles.buttonFeedback,
|
|
177
|
+
}}
|
|
165
178
|
>
|
|
166
179
|
<Text
|
|
167
180
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
|
|
1
|
+
import { createDefaultVariantFactory, includePresets, StylesOf } from '@codeleap/common'
|
|
2
|
+
import { TouchableStylesGen } from '../Touchable'
|
|
2
3
|
|
|
3
4
|
export type SegmentedControlStates = 'selected'
|
|
4
5
|
|
|
@@ -10,9 +11,20 @@ export type SegmentedControlComposition =
|
|
|
10
11
|
'text' |
|
|
11
12
|
`text:${SegmentedControlStates}` |
|
|
12
13
|
'button' |
|
|
14
|
+
'buttonFeedback' |
|
|
13
15
|
`button:${SegmentedControlStates}`
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
export type SegmentedControlStylesGen<TCSS = any> =
|
|
18
|
+
StylesOf<
|
|
19
|
+
Exclude<SegmentedControlComposition, 'buttonFeedback'>
|
|
20
|
+
> & {
|
|
21
|
+
buttonFeedback?: TouchableStylesGen['feedback']
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const createSegmentedControlStyle = createDefaultVariantFactory<
|
|
25
|
+
SegmentedControlComposition,
|
|
26
|
+
SegmentedControlStylesGen
|
|
27
|
+
>()
|
|
16
28
|
|
|
17
29
|
const presets = includePresets((style) => createSegmentedControlStyle(() => ({ scrollContent: style })))
|
|
18
30
|
|
|
@@ -21,7 +33,10 @@ export const SegmentedControlStyles = {
|
|
|
21
33
|
default: createSegmentedControlStyle((theme) => {
|
|
22
34
|
|
|
23
35
|
return {
|
|
24
|
-
|
|
36
|
+
buttonFeedback: {
|
|
37
|
+
type: 'opacity',
|
|
38
|
+
value: 0.5,
|
|
39
|
+
},
|
|
25
40
|
text: {
|
|
26
41
|
color: theme.colors.text,
|
|
27
42
|
},
|
|
@@ -34,21 +49,28 @@ export const SegmentedControlStyles = {
|
|
|
34
49
|
},
|
|
35
50
|
scrollContent: {
|
|
36
51
|
// borderRadius: Theme.borderRadius.large,
|
|
52
|
+
...theme.presets.row,
|
|
37
53
|
...theme.spacing.paddingHorizontal(2),
|
|
54
|
+
...theme.presets.alignStretch,
|
|
38
55
|
},
|
|
39
56
|
button: {
|
|
40
57
|
backgroundColor: 'transparent',
|
|
41
58
|
...theme.presets.alignCenter,
|
|
42
|
-
color: 'red',
|
|
43
|
-
...theme.spacing.padding(2),
|
|
44
59
|
...theme.presets.justifyCenter,
|
|
60
|
+
|
|
61
|
+
borderRadius: theme.borderRadius.large,
|
|
62
|
+
...theme.spacing.padding(1),
|
|
63
|
+
minHeight: '100%',
|
|
64
|
+
|
|
45
65
|
},
|
|
46
66
|
selectedBubble: {
|
|
47
67
|
position: 'absolute',
|
|
48
68
|
zIndex: -1,
|
|
49
69
|
...theme.spacing.padding(2),
|
|
50
|
-
maxHeight: 50,
|
|
51
|
-
minHeight: 50,
|
|
70
|
+
// maxHeight: 50,
|
|
71
|
+
// minHeight: 50,
|
|
72
|
+
top: 0,
|
|
73
|
+
bottom: 0,
|
|
52
74
|
borderRadius: theme.borderRadius.large,
|
|
53
75
|
backgroundColor: theme.colors.primary,
|
|
54
76
|
},
|
|
@@ -1,14 +1,32 @@
|
|
|
1
|
-
import { IconPlaceholder,
|
|
1
|
+
import { IconPlaceholder,
|
|
2
|
+
getNestedStylesByKey,
|
|
3
|
+
useDefaultComponentStyle,
|
|
4
|
+
TypeGuards } from '@codeleap/common'
|
|
2
5
|
import React, { useMemo } from 'react'
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { StyleSheet } from 'react-native'
|
|
7
|
+
import { List } from '../List'
|
|
8
|
+
import { Text } from '../Text'
|
|
9
|
+
import { TextInput } from '../TextInput'
|
|
7
10
|
import { Touchable } from '../Touchable'
|
|
8
|
-
import {
|
|
9
|
-
import { MobileSelectStyles } from './styles'
|
|
11
|
+
import { SelectStyles } from './styles'
|
|
10
12
|
import { CustomSelectProps } from './types'
|
|
13
|
+
import { ModalManager } from '../../utils'
|
|
14
|
+
import { Icon } from '../Icon'
|
|
15
|
+
|
|
16
|
+
export const SelectItem = ({ item, icon = null, isSelected, styles, onPress }) => {
|
|
17
|
+
return <Touchable style={[
|
|
18
|
+
styles.itemWrapper,
|
|
19
|
+
isSelected && styles['itemWrapper:selected'],
|
|
20
|
+
]} onPress={onPress} debugName={`Select ${item.value}`}>
|
|
21
|
+
<Text text={item.label} style={[
|
|
22
|
+
styles.itemText,
|
|
23
|
+
isSelected && styles['itemText:selected'],
|
|
24
|
+
]}/>
|
|
25
|
+
{icon ? <Icon name={icon} style={[styles?.itemIcon, isSelected && styles?.['itemIcon:selected']]}/> : null}
|
|
26
|
+
</Touchable>
|
|
27
|
+
}
|
|
11
28
|
|
|
29
|
+
export * from './styles'
|
|
12
30
|
export const Select = <T extends string|number = string>(selectProps:CustomSelectProps<T>) => {
|
|
13
31
|
const {
|
|
14
32
|
value,
|
|
@@ -20,29 +38,15 @@ export const Select = <T extends string|number = string>(selectProps:CustomSelec
|
|
|
20
38
|
variants,
|
|
21
39
|
renderItem,
|
|
22
40
|
closeOnSelect = true,
|
|
23
|
-
|
|
24
|
-
showClose = true,
|
|
25
|
-
showLabelOnModal = true,
|
|
41
|
+
listProps,
|
|
26
42
|
placeholder = 'Select',
|
|
27
43
|
arrowIconName = 'selectArrow',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
closeButtonProps,
|
|
32
|
-
modalLabel,
|
|
33
|
-
textInputProps = {},
|
|
34
|
-
visible = null,
|
|
35
|
-
toggle = null,
|
|
36
|
-
renderList,
|
|
37
|
-
...props
|
|
44
|
+
inputProps = {},
|
|
45
|
+
hideInput = false,
|
|
46
|
+
...drawerProps
|
|
38
47
|
} = selectProps
|
|
39
48
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const isModalVisible = visible ?? _isModalVisible
|
|
43
|
-
const setModalVisibility = toggle ?? _setModalVisibility
|
|
44
|
-
|
|
45
|
-
const variantStyles = useDefaultComponentStyle<'u:MobileSelect', typeof MobileSelectStyles>('u:MobileSelect', {
|
|
49
|
+
const variantStyles = useDefaultComponentStyle<'u:Select', typeof SelectStyles>('u:Select', {
|
|
46
50
|
transform: StyleSheet.flatten,
|
|
47
51
|
rootElement: 'inputWrapper',
|
|
48
52
|
styles,
|
|
@@ -54,21 +58,16 @@ export const Select = <T extends string|number = string>(selectProps:CustomSelec
|
|
|
54
58
|
[variantStyles],
|
|
55
59
|
)
|
|
56
60
|
|
|
57
|
-
const
|
|
58
|
-
() => getNestedStylesByKey('modalCloseButton', variantStyles),
|
|
59
|
-
[variantStyles],
|
|
60
|
-
)
|
|
61
|
+
const close = () => drawerProps?.toggle?.()
|
|
61
62
|
|
|
62
|
-
const ListComponent = scroll ? Scroll : View
|
|
63
|
-
|
|
64
|
-
const close = () => setModalVisibility()
|
|
65
63
|
const select = (value) => {
|
|
66
64
|
|
|
67
65
|
onValueChange(value)
|
|
68
66
|
if (closeOnSelect) {
|
|
69
|
-
close()
|
|
67
|
+
close?.()
|
|
70
68
|
}
|
|
71
69
|
}
|
|
70
|
+
|
|
72
71
|
const selectedLabel:string = useMemo(() => {
|
|
73
72
|
const current = options.find(o => o.value === value)
|
|
74
73
|
|
|
@@ -77,116 +76,53 @@ export const Select = <T extends string|number = string>(selectProps:CustomSelec
|
|
|
77
76
|
return TypeGuards.isString(display) ? display : ''
|
|
78
77
|
}, [value, placeholder, options])
|
|
79
78
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
editable={false}
|
|
89
|
-
touchableWrapper
|
|
90
|
-
wrapperProps={{
|
|
91
|
-
debugName: 'Select',
|
|
92
|
-
onPress: close,
|
|
93
|
-
}}
|
|
94
|
-
pointerEvents={'none'}
|
|
95
|
-
label={label}
|
|
96
|
-
debugName={'Select input'}
|
|
97
|
-
styles={inputStyles}
|
|
98
|
-
style={style}
|
|
99
|
-
{...textInputProps}
|
|
79
|
+
const Item = renderItem || SelectItem
|
|
80
|
+
|
|
81
|
+
const renderListItem = ({ item }) => {
|
|
82
|
+
return <Item
|
|
83
|
+
isSelected={value === item.value}
|
|
84
|
+
item={item}
|
|
85
|
+
onPress={() => select(item.value)}
|
|
86
|
+
styles={variantStyles}
|
|
100
87
|
/>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
88
|
+
}
|
|
89
|
+
return <>
|
|
90
|
+
{
|
|
91
|
+
!hideInput && (
|
|
92
|
+
<TextInput
|
|
93
|
+
caretHidden
|
|
94
|
+
value={selectedLabel}
|
|
95
|
+
rightIcon={{
|
|
96
|
+
icon: arrowIconName as IconPlaceholder,
|
|
97
|
+
}}
|
|
98
|
+
editable={false}
|
|
99
|
+
touchableWrapper
|
|
100
|
+
onPress={close}
|
|
101
|
+
wrapperProps={{
|
|
102
|
+
debugName: 'Select',
|
|
103
|
+
|
|
104
|
+
}}
|
|
105
|
+
pointerEvents={'none'}
|
|
106
|
+
label={label}
|
|
107
|
+
debugName={'Select input'}
|
|
108
|
+
styles={inputStyles}
|
|
109
|
+
style={style}
|
|
110
|
+
{...inputProps}
|
|
111
|
+
/>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
<ModalManager.Drawer scroll={false} title={label} {...drawerProps} styles={variantStyles}>
|
|
116
|
+
<List<CustomSelectProps<any>['options']>
|
|
117
|
+
data={options}
|
|
118
|
+
style={variantStyles.list}
|
|
119
|
+
contentContainerStyle={variantStyles.listContent}
|
|
120
|
+
keyExtractor={(i) => i.value}
|
|
121
|
+
renderItem={renderListItem}
|
|
122
|
+
{...listProps}
|
|
132
123
|
/>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<View style={variantStyles.modalBox}>
|
|
136
|
-
{
|
|
137
|
-
(showClose || showLabelOnModal || header) && (
|
|
138
|
-
<View style={variantStyles.modalHeader}>
|
|
139
|
-
{
|
|
140
|
-
header ? header : <>
|
|
141
|
-
{showLabelOnModal && <InputLabel label={modalLabel || label} style={variantStyles.modalLabelText}/>}
|
|
142
|
-
{showClose && <Button
|
|
143
|
-
icon={modalCloseIconName as IconPlaceholder}
|
|
144
|
-
onPress={close}
|
|
145
|
-
styles={closeButtonStyles}
|
|
146
|
-
debugName={'Close modal'}
|
|
147
|
-
{...closeButtonProps}
|
|
148
|
-
/>}
|
|
149
|
-
</>
|
|
150
|
-
}
|
|
151
|
-
</View>
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
<ListComponent style={variantStyles.modalList}>
|
|
155
|
-
{
|
|
156
|
-
renderList ? renderList({
|
|
157
|
-
...selectProps,
|
|
158
|
-
isEmpty: !options.length,
|
|
159
|
-
|
|
160
|
-
}) : options.map((item, idx) => {
|
|
161
|
-
const isSelected = value === item.value
|
|
162
|
-
if (renderItem) {
|
|
163
|
-
return renderItem({
|
|
164
|
-
...item,
|
|
165
|
-
index: idx,
|
|
166
|
-
selected: isSelected,
|
|
167
|
-
onPress: close,
|
|
168
|
-
styles: variantStyles,
|
|
169
|
-
})
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return <Touchable key={idx} style={[
|
|
173
|
-
variantStyles.modalItem,
|
|
174
|
-
isSelected && variantStyles['modalItem:selected'],
|
|
175
|
-
]} onPress={() => select(item.value)} debugName={`Select ${item.value}`}>
|
|
176
|
-
<InputLabel label={item.label} style={[variantStyles.modalItemText, isSelected && variantStyles['modalItemText:selected']]}/>
|
|
177
|
-
</Touchable>
|
|
178
|
-
})
|
|
179
|
-
}
|
|
180
|
-
</ListComponent>
|
|
181
|
-
|
|
182
|
-
{
|
|
183
|
-
footer && <View style={variantStyles.modalFooter}>
|
|
184
|
-
{footer}
|
|
185
|
-
</View>
|
|
186
|
-
}
|
|
187
|
-
</View>
|
|
188
|
-
</View>
|
|
189
|
-
</Modal>
|
|
124
|
+
</ModalManager.Drawer>
|
|
125
|
+
|
|
190
126
|
</>
|
|
191
127
|
}
|
|
192
128
|
|
|
@@ -1,81 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
`CloseButton${Capitalize<ButtonParts>}`
|
|
1
|
+
import { createDefaultVariantFactory, TextInputComposition } from '@codeleap/common'
|
|
2
|
+
import { DrawerComposition, DrawerStyles } from '../Drawer'
|
|
3
|
+
type ItemStates = '' | ':selected'
|
|
4
|
+
export type SelectComposition =
|
|
5
|
+
DrawerComposition |
|
|
6
|
+
`input${TextInputComposition}` |
|
|
7
|
+
'list' |
|
|
8
|
+
'listContent' |
|
|
9
|
+
`itemWrapper${ItemStates}` |
|
|
10
|
+
`itemText${ItemStates}` |
|
|
11
|
+
'scroll' |
|
|
12
|
+
'scrollContent' |
|
|
13
|
+
`itemIcon${ItemStates}`
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
const createSelectStyle = createDefaultVariantFactory<SelectComposition>()
|
|
17
16
|
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
export const SelectStyles = {
|
|
18
|
+
...DrawerStyles,
|
|
19
|
+
default: createSelectStyle((theme) => {
|
|
20
|
+
const defaultStyle = DrawerStyles.default(theme)
|
|
21
|
+
return {
|
|
22
|
+
...defaultStyle,
|
|
23
|
+
box: {
|
|
24
|
+
...theme.spacing.paddingHorizontal(0),
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
},
|
|
27
|
+
itemWrapper: {
|
|
28
|
+
...theme.presets.row,
|
|
29
|
+
...theme.presets.justifySpaceBetween,
|
|
30
|
+
...theme.presets.alignCenter,
|
|
31
|
+
...theme.spacing.padding(1.4),
|
|
32
|
+
height: 50,
|
|
33
|
+
},
|
|
34
|
+
'itemWrapper:selected': {
|
|
35
|
+
backgroundColor: theme.colors.primary,
|
|
36
|
+
},
|
|
37
|
+
'itemText:selected': {
|
|
38
|
+
color: theme.colors.white,
|
|
25
39
|
|
|
26
|
-
|
|
40
|
+
},
|
|
41
|
+
'itemIcon:selected': {
|
|
42
|
+
color: theme.colors.white,
|
|
43
|
+
...theme.sized(3),
|
|
44
|
+
},
|
|
45
|
+
itemIcon: {
|
|
46
|
+
width: 0,
|
|
47
|
+
height: 0,
|
|
48
|
+
},
|
|
49
|
+
list: {
|
|
50
|
+
height: 'auto',
|
|
27
51
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
backgroundColor: theme.colors.background,
|
|
33
|
-
borderTopLeftRadius: 20,
|
|
34
|
-
borderTopRightRadius: 20,
|
|
35
|
-
zIndex: 1,
|
|
36
|
-
elevation: 5,
|
|
37
|
-
},
|
|
38
|
-
modalWrapper: {
|
|
39
|
-
// ...MobileModalStyles.default(theme).wrapper,
|
|
40
|
-
flex: 1,
|
|
41
|
-
alignItems: 'stretch',
|
|
42
|
-
justifyContent: 'flex-end',
|
|
43
|
-
},
|
|
44
|
-
modalItem: {
|
|
45
|
-
...theme.spacing.paddingVertical(1),
|
|
46
|
-
...theme.spacing.paddingHorizontal(2),
|
|
47
|
-
color: theme.colors.text,
|
|
48
|
-
},
|
|
49
|
-
'modalItemText:selected': {
|
|
50
|
-
color: theme.colors.primary,
|
|
51
|
-
},
|
|
52
|
-
modalList: {
|
|
53
|
-
...theme.spacing.marginVertical(0.6),
|
|
54
|
-
},
|
|
55
|
-
backdrop: {
|
|
56
|
-
// ...MobileModalStyles.default(theme).overlay,
|
|
57
|
-
zIndex: 10,
|
|
58
|
-
flex: 1,
|
|
52
|
+
},
|
|
53
|
+
listContent: {
|
|
54
|
+
paddingBottom: theme.values.bottomNavHeight + theme.spacing.value(1),
|
|
55
|
+
},
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
'backdrop:hidden': {
|
|
63
|
-
opacity: 0,
|
|
64
|
-
},
|
|
65
|
-
'backdrop:visible': {
|
|
66
|
-
opacity: 0.4,
|
|
67
|
-
},
|
|
68
|
-
modalHeader: {
|
|
69
|
-
...theme.spacing.padding(2),
|
|
70
|
-
flexDirection: 'row',
|
|
71
|
-
...theme.presets.alignCenter,
|
|
72
|
-
...theme.presets.justifySpaceBetween,
|
|
73
|
-
},
|
|
74
|
-
modalLabelText: {
|
|
75
|
-
...assignTextStyle('p2')(theme).text,
|
|
76
|
-
},
|
|
77
|
-
modalCloseButtonWrapper: {
|
|
78
|
-
backgroundColor: 'transparent',
|
|
79
|
-
},
|
|
80
|
-
})),
|
|
57
|
+
}
|
|
58
|
+
}),
|
|
81
59
|
}
|
|
@@ -3,44 +3,37 @@ import {
|
|
|
3
3
|
FormTypes,
|
|
4
4
|
IconPlaceholder,
|
|
5
5
|
} from '@codeleap/common'
|
|
6
|
-
import { ReactElement } from 'react'
|
|
7
6
|
import { StylesOf } from '../../types/utility'
|
|
8
|
-
import {
|
|
7
|
+
import { DrawerProps } from '../Drawer'
|
|
8
|
+
import { FlatListProps } from '../List'
|
|
9
9
|
import { TextInputProps } from '../TextInput'
|
|
10
|
-
import {
|
|
10
|
+
import { SelectComposition, SelectStyles } from './styles'
|
|
11
11
|
|
|
12
|
-
export type SelectRenderFNProps<T> =
|
|
13
|
-
styles: StylesOf<
|
|
12
|
+
export type SelectRenderFNProps<T> = & {
|
|
13
|
+
styles: StylesOf<SelectComposition>
|
|
14
14
|
onPress: () => void
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
isSelected?: boolean
|
|
16
|
+
item: FormTypes.Options<T>[number]
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export type SelectRenderFN<T> = (props: SelectRenderFNProps<T>) => JSX.Element
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
type SelectDrawerProps = Omit<DrawerProps, 'variants' | 'styles'>
|
|
22
|
+
|
|
23
|
+
export type CustomSelectProps<T> = SelectDrawerProps & {
|
|
22
24
|
value: T
|
|
23
25
|
placeholder?: FormTypes.Label
|
|
24
26
|
label?: FormTypes.Label
|
|
25
27
|
options?: FormTypes.Options<T>
|
|
26
|
-
onDropdownToggle?: (isOpen?: boolean) => void
|
|
27
28
|
onValueChange?: (value: T) => void
|
|
28
29
|
renderItem?: SelectRenderFN<T>
|
|
29
|
-
styles?: StylesOf<
|
|
30
|
+
styles?: StylesOf<SelectComposition>
|
|
30
31
|
style?: any
|
|
32
|
+
hideInput?: boolean
|
|
33
|
+
|
|
31
34
|
arrowIconName?: IconPlaceholder
|
|
32
|
-
scroll?: boolean
|
|
33
35
|
closeOnSelect?: boolean
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
modalCloseIconName?: IconPlaceholder
|
|
38
|
-
showClose?: boolean
|
|
39
|
-
modalLabel?: string
|
|
40
|
-
textInputProps?: Partial<TextInputProps>
|
|
41
|
-
closeButtonProps?: Partial<ButtonProps>
|
|
42
|
-
toggle: (isOpen?: boolean) => void
|
|
43
|
-
visible: boolean
|
|
44
|
-
renderList?: (props:CustomSelectProps<T> & {isEmpty: boolean}) => JSX.Element
|
|
45
|
-
} & ComponentVariants<typeof MobileSelectStyles> & TextInputProps
|
|
36
|
+
inputProps?: Partial<TextInputProps>
|
|
37
|
+
listProps?: Partial<FlatListProps>
|
|
38
|
+
} & ComponentVariants<typeof SelectStyles>
|
|
46
39
|
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
import { InputLabel } from '../TextInput'
|
|
13
13
|
import { SliderProps } from './types'
|
|
14
14
|
|
|
15
|
+
export * from './styles'
|
|
16
|
+
|
|
15
17
|
export const Slider: React.FC<SliderProps> = (sliderProps) => {
|
|
16
18
|
const [tooltipVisible, setTooltipVisible] = React.useState(false)
|
|
17
19
|
|