rn-custom-ui 1.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/LICENSE +20 -0
- package/README.md +477 -0
- package/lib/module/assets/images/close.png +0 -0
- package/lib/module/components/CustomCheckbox/index.js +99 -0
- package/lib/module/components/CustomCheckbox/index.js.map +1 -0
- package/lib/module/components/CustomCheckbox/styles.js +213 -0
- package/lib/module/components/CustomCheckbox/styles.js.map +1 -0
- package/lib/module/components/CustomCheckbox/types.js +4 -0
- package/lib/module/components/CustomCheckbox/types.js.map +1 -0
- package/lib/module/components/closeButton/index.js +45 -0
- package/lib/module/components/closeButton/index.js.map +1 -0
- package/lib/module/components/closeButton/types.js +4 -0
- package/lib/module/components/closeButton/types.js.map +1 -0
- package/lib/module/components/customButton/index.js +176 -0
- package/lib/module/components/customButton/index.js.map +1 -0
- package/lib/module/components/customButton/styles.js +282 -0
- package/lib/module/components/customButton/styles.js.map +1 -0
- package/lib/module/components/customButton/types.js +4 -0
- package/lib/module/components/customButton/types.js.map +1 -0
- package/lib/module/components/customDropDown/DropDownBottomSheet.js +57 -0
- package/lib/module/components/customDropDown/DropDownBottomSheet.js.map +1 -0
- package/lib/module/components/customDropDown/DropDownList.js +51 -0
- package/lib/module/components/customDropDown/DropDownList.js.map +1 -0
- package/lib/module/components/customDropDown/DropDownListItem.js +38 -0
- package/lib/module/components/customDropDown/DropDownListItem.js.map +1 -0
- package/lib/module/components/customDropDown/DropDownListModal.js +63 -0
- package/lib/module/components/customDropDown/DropDownListModal.js.map +1 -0
- package/lib/module/components/customDropDown/index.js +143 -0
- package/lib/module/components/customDropDown/index.js.map +1 -0
- package/lib/module/components/customDropDown/styles.js +189 -0
- package/lib/module/components/customDropDown/styles.js.map +1 -0
- package/lib/module/components/customDropDown/types.js +4 -0
- package/lib/module/components/customDropDown/types.js.map +1 -0
- package/lib/module/components/customDropDown/utils.js +17 -0
- package/lib/module/components/customDropDown/utils.js.map +1 -0
- package/lib/module/components/customList/ListEmpty.js +33 -0
- package/lib/module/components/customList/ListEmpty.js.map +1 -0
- package/lib/module/components/customList/ListFooterLoader.js +14 -0
- package/lib/module/components/customList/ListFooterLoader.js.map +1 -0
- package/lib/module/components/customList/defaultKeyExtractor.js +9 -0
- package/lib/module/components/customList/defaultKeyExtractor.js.map +1 -0
- package/lib/module/components/customList/getFlashList.js +19 -0
- package/lib/module/components/customList/getFlashList.js.map +1 -0
- package/lib/module/components/customList/index.js +117 -0
- package/lib/module/components/customList/index.js.map +1 -0
- package/lib/module/components/customList/styles.js +45 -0
- package/lib/module/components/customList/styles.js.map +1 -0
- package/lib/module/components/customList/types.js +4 -0
- package/lib/module/components/customList/types.js.map +1 -0
- package/lib/module/components/customModal/ModalFooter.js +44 -0
- package/lib/module/components/customModal/ModalFooter.js.map +1 -0
- package/lib/module/components/customModal/index.js +132 -0
- package/lib/module/components/customModal/index.js.map +1 -0
- package/lib/module/components/customModal/styles.js +123 -0
- package/lib/module/components/customModal/styles.js.map +1 -0
- package/lib/module/components/customModal/types.js +4 -0
- package/lib/module/components/customModal/types.js.map +1 -0
- package/lib/module/components/customModal/useCustomModal.js +23 -0
- package/lib/module/components/customModal/useCustomModal.js.map +1 -0
- package/lib/module/components/customNumberPad/NumberPadKey.js +39 -0
- package/lib/module/components/customNumberPad/NumberPadKey.js.map +1 -0
- package/lib/module/components/customNumberPad/index.js +156 -0
- package/lib/module/components/customNumberPad/index.js.map +1 -0
- package/lib/module/components/customNumberPad/styles.js +131 -0
- package/lib/module/components/customNumberPad/styles.js.map +1 -0
- package/lib/module/components/customNumberPad/types.js +4 -0
- package/lib/module/components/customNumberPad/types.js.map +1 -0
- package/lib/module/components/customNumberPad/useNumberPadInput.js +44 -0
- package/lib/module/components/customNumberPad/useNumberPadInput.js.map +1 -0
- package/lib/module/components/customNumberPad/utils.js +38 -0
- package/lib/module/components/customNumberPad/utils.js.map +1 -0
- package/lib/module/components/customSlideTabs/AnimatedTabIndicator.js +66 -0
- package/lib/module/components/customSlideTabs/AnimatedTabIndicator.js.map +1 -0
- package/lib/module/components/customSlideTabs/TabBarItem.js +61 -0
- package/lib/module/components/customSlideTabs/TabBarItem.js.map +1 -0
- package/lib/module/components/customSlideTabs/TabScene.js +88 -0
- package/lib/module/components/customSlideTabs/TabScene.js.map +1 -0
- package/lib/module/components/customSlideTabs/index.js +277 -0
- package/lib/module/components/customSlideTabs/index.js.map +1 -0
- package/lib/module/components/customSlideTabs/styles.js +132 -0
- package/lib/module/components/customSlideTabs/styles.js.map +1 -0
- package/lib/module/components/customSlideTabs/tabBarScroll.js +65 -0
- package/lib/module/components/customSlideTabs/tabBarScroll.js.map +1 -0
- package/lib/module/components/customSlideTabs/types.js +4 -0
- package/lib/module/components/customSlideTabs/types.js.map +1 -0
- package/lib/module/components/loading/index.js +34 -0
- package/lib/module/components/loading/index.js.map +1 -0
- package/lib/module/customFunctions/array.js +61 -0
- package/lib/module/customFunctions/array.js.map +1 -0
- package/lib/module/customFunctions/async.js +62 -0
- package/lib/module/customFunctions/async.js.map +1 -0
- package/lib/module/customFunctions/date.js +109 -0
- package/lib/module/customFunctions/date.js.map +1 -0
- package/lib/module/customFunctions/general.js +29 -0
- package/lib/module/customFunctions/general.js.map +1 -0
- package/lib/module/customFunctions/id.js +20 -0
- package/lib/module/customFunctions/id.js.map +1 -0
- package/lib/module/customFunctions/index.js +29 -0
- package/lib/module/customFunctions/index.js.map +1 -0
- package/lib/module/customFunctions/number.js +94 -0
- package/lib/module/customFunctions/number.js.map +1 -0
- package/lib/module/customFunctions/object.js +39 -0
- package/lib/module/customFunctions/object.js.map +1 -0
- package/lib/module/customFunctions/string.js +63 -0
- package/lib/module/customFunctions/string.js.map +1 -0
- package/lib/module/customFunctions/types.js +2 -0
- package/lib/module/customFunctions/types.js.map +1 -0
- package/lib/module/customFunctions/validation.js +34 -0
- package/lib/module/customFunctions/validation.js.map +1 -0
- package/lib/module/customHooks/errors.js +61 -0
- package/lib/module/customHooks/errors.js.map +1 -0
- package/lib/module/customHooks/fetchJson.js +36 -0
- package/lib/module/customHooks/fetchJson.js.map +1 -0
- package/lib/module/customHooks/index.js +10 -0
- package/lib/module/customHooks/index.js.map +1 -0
- package/lib/module/customHooks/internal.js +49 -0
- package/lib/module/customHooks/internal.js.map +1 -0
- package/lib/module/customHooks/types.js +2 -0
- package/lib/module/customHooks/types.js.map +1 -0
- package/lib/module/customHooks/useApi.js +91 -0
- package/lib/module/customHooks/useApi.js.map +1 -0
- package/lib/module/customHooks/useLazyApi.js +80 -0
- package/lib/module/customHooks/useLazyApi.js.map +1 -0
- package/lib/module/customHooks/useMutation.js +69 -0
- package/lib/module/customHooks/useMutation.js.map +1 -0
- package/lib/module/customHooks/usePaginatedApi.js +127 -0
- package/lib/module/customHooks/usePaginatedApi.js.map +1 -0
- package/lib/module/customHooks/usePollingApi.js +37 -0
- package/lib/module/customHooks/usePollingApi.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/multiply.js +6 -0
- package/lib/module/multiply.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/CustomCheckbox/index.d.ts +5 -0
- package/lib/typescript/src/components/CustomCheckbox/index.d.ts.map +1 -0
- package/lib/typescript/src/components/CustomCheckbox/styles.d.ts +67 -0
- package/lib/typescript/src/components/CustomCheckbox/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/CustomCheckbox/types.d.ts +28 -0
- package/lib/typescript/src/components/CustomCheckbox/types.d.ts.map +1 -0
- package/lib/typescript/src/components/closeButton/index.d.ts +4 -0
- package/lib/typescript/src/components/closeButton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/closeButton/types.d.ts +8 -0
- package/lib/typescript/src/components/closeButton/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customButton/index.d.ts +5 -0
- package/lib/typescript/src/components/customButton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customButton/styles.d.ts +231 -0
- package/lib/typescript/src/components/customButton/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customButton/types.d.ts +46 -0
- package/lib/typescript/src/components/customButton/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/DropDownBottomSheet.d.ts +18 -0
- package/lib/typescript/src/components/customDropDown/DropDownBottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/DropDownList.d.ts +17 -0
- package/lib/typescript/src/components/customDropDown/DropDownList.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/DropDownListItem.d.ts +15 -0
- package/lib/typescript/src/components/customDropDown/DropDownListItem.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/DropDownListModal.d.ts +19 -0
- package/lib/typescript/src/components/customDropDown/DropDownListModal.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/index.d.ts +5 -0
- package/lib/typescript/src/components/customDropDown/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/styles.d.ts +190 -0
- package/lib/typescript/src/components/customDropDown/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/types.d.ts +37 -0
- package/lib/typescript/src/components/customDropDown/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customDropDown/utils.d.ts +4 -0
- package/lib/typescript/src/components/customDropDown/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/ListEmpty.d.ts +10 -0
- package/lib/typescript/src/components/customList/ListEmpty.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/ListFooterLoader.d.ts +3 -0
- package/lib/typescript/src/components/customList/ListFooterLoader.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/defaultKeyExtractor.d.ts +2 -0
- package/lib/typescript/src/components/customList/defaultKeyExtractor.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/getFlashList.d.ts +6 -0
- package/lib/typescript/src/components/customList/getFlashList.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/index.d.ts +11 -0
- package/lib/typescript/src/components/customList/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/styles.d.ts +42 -0
- package/lib/typescript/src/components/customList/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customList/types.d.ts +33 -0
- package/lib/typescript/src/components/customList/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/ModalFooter.d.ts +12 -0
- package/lib/typescript/src/components/customModal/ModalFooter.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/index.d.ts +6 -0
- package/lib/typescript/src/components/customModal/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/styles.d.ts +83 -0
- package/lib/typescript/src/components/customModal/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/types.d.ts +36 -0
- package/lib/typescript/src/components/customModal/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customModal/useCustomModal.d.ts +8 -0
- package/lib/typescript/src/components/customModal/useCustomModal.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/NumberPadKey.d.ts +23 -0
- package/lib/typescript/src/components/customNumberPad/NumberPadKey.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/index.d.ts +7 -0
- package/lib/typescript/src/components/customNumberPad/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/styles.d.ts +37 -0
- package/lib/typescript/src/components/customNumberPad/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/types.d.ts +47 -0
- package/lib/typescript/src/components/customNumberPad/types.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/useNumberPadInput.d.ts +16 -0
- package/lib/typescript/src/components/customNumberPad/useNumberPadInput.d.ts.map +1 -0
- package/lib/typescript/src/components/customNumberPad/utils.d.ts +4 -0
- package/lib/typescript/src/components/customNumberPad/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/AnimatedTabIndicator.d.ts +16 -0
- package/lib/typescript/src/components/customSlideTabs/AnimatedTabIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/TabBarItem.d.ts +23 -0
- package/lib/typescript/src/components/customSlideTabs/TabBarItem.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/TabScene.d.ts +21 -0
- package/lib/typescript/src/components/customSlideTabs/TabScene.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/index.d.ts +5 -0
- package/lib/typescript/src/components/customSlideTabs/index.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/styles.d.ts +130 -0
- package/lib/typescript/src/components/customSlideTabs/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/tabBarScroll.d.ts +15 -0
- package/lib/typescript/src/components/customSlideTabs/tabBarScroll.d.ts.map +1 -0
- package/lib/typescript/src/components/customSlideTabs/types.d.ts +68 -0
- package/lib/typescript/src/components/customSlideTabs/types.d.ts.map +1 -0
- package/lib/typescript/src/components/loading/index.d.ts +7 -0
- package/lib/typescript/src/components/loading/index.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/array.d.ts +7 -0
- package/lib/typescript/src/customFunctions/array.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/async.d.ts +9 -0
- package/lib/typescript/src/customFunctions/async.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/date.d.ts +18 -0
- package/lib/typescript/src/customFunctions/date.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/general.d.ts +7 -0
- package/lib/typescript/src/customFunctions/general.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/id.d.ts +4 -0
- package/lib/typescript/src/customFunctions/id.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/index.d.ts +26 -0
- package/lib/typescript/src/customFunctions/index.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/number.d.ts +15 -0
- package/lib/typescript/src/customFunctions/number.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/object.d.ts +6 -0
- package/lib/typescript/src/customFunctions/object.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/string.d.ts +20 -0
- package/lib/typescript/src/customFunctions/string.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/types.d.ts +22 -0
- package/lib/typescript/src/customFunctions/types.d.ts.map +1 -0
- package/lib/typescript/src/customFunctions/validation.d.ts +11 -0
- package/lib/typescript/src/customFunctions/validation.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/errors.d.ts +16 -0
- package/lib/typescript/src/customHooks/errors.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/fetchJson.d.ts +5 -0
- package/lib/typescript/src/customHooks/fetchJson.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/index.d.ts +9 -0
- package/lib/typescript/src/customHooks/index.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/internal.d.ts +12 -0
- package/lib/typescript/src/customHooks/internal.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/types.d.ts +49 -0
- package/lib/typescript/src/customHooks/types.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/useApi.d.ts +13 -0
- package/lib/typescript/src/customHooks/useApi.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/useLazyApi.d.ts +14 -0
- package/lib/typescript/src/customHooks/useLazyApi.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/useMutation.d.ts +15 -0
- package/lib/typescript/src/customHooks/useMutation.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/usePaginatedApi.d.ts +19 -0
- package/lib/typescript/src/customHooks/usePaginatedApi.d.ts.map +1 -0
- package/lib/typescript/src/customHooks/usePollingApi.d.ts +13 -0
- package/lib/typescript/src/customHooks/usePollingApi.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +11 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/multiply.d.ts +2 -0
- package/lib/typescript/src/multiply.d.ts.map +1 -0
- package/package.json +181 -0
- package/src/assets/images/close.png +0 -0
- package/src/components/CustomCheckbox/index.tsx +143 -0
- package/src/components/CustomCheckbox/styles.ts +146 -0
- package/src/components/CustomCheckbox/types.ts +33 -0
- package/src/components/closeButton/index.tsx +40 -0
- package/src/components/closeButton/types.ts +13 -0
- package/src/components/customButton/index.tsx +288 -0
- package/src/components/customButton/styles.ts +247 -0
- package/src/components/customButton/types.ts +71 -0
- package/src/components/customDropDown/DropDownBottomSheet.tsx +70 -0
- package/src/components/customDropDown/DropDownList.tsx +88 -0
- package/src/components/customDropDown/DropDownListItem.tsx +74 -0
- package/src/components/customDropDown/DropDownListModal.tsx +86 -0
- package/src/components/customDropDown/index.tsx +213 -0
- package/src/components/customDropDown/styles.ts +184 -0
- package/src/components/customDropDown/types.ts +48 -0
- package/src/components/customDropDown/utils.ts +24 -0
- package/src/components/customList/ListEmpty.tsx +36 -0
- package/src/components/customList/ListFooterLoader.tsx +11 -0
- package/src/components/customList/defaultKeyExtractor.ts +7 -0
- package/src/components/customList/getFlashList.ts +26 -0
- package/src/components/customList/index.tsx +142 -0
- package/src/components/customList/styles.ts +43 -0
- package/src/components/customList/types.ts +60 -0
- package/src/components/customModal/ModalFooter.tsx +57 -0
- package/src/components/customModal/index.tsx +166 -0
- package/src/components/customModal/styles.ts +131 -0
- package/src/components/customModal/types.ts +48 -0
- package/src/components/customModal/useCustomModal.ts +25 -0
- package/src/components/customNumberPad/NumberPadKey.tsx +81 -0
- package/src/components/customNumberPad/index.tsx +204 -0
- package/src/components/customNumberPad/styles.ts +146 -0
- package/src/components/customNumberPad/types.ts +53 -0
- package/src/components/customNumberPad/useNumberPadInput.ts +56 -0
- package/src/components/customNumberPad/utils.ts +54 -0
- package/src/components/customSlideTabs/AnimatedTabIndicator.tsx +103 -0
- package/src/components/customSlideTabs/TabBarItem.tsx +118 -0
- package/src/components/customSlideTabs/TabScene.tsx +136 -0
- package/src/components/customSlideTabs/index.tsx +385 -0
- package/src/components/customSlideTabs/styles.ts +136 -0
- package/src/components/customSlideTabs/tabBarScroll.ts +92 -0
- package/src/components/customSlideTabs/types.ts +87 -0
- package/src/components/loading/index.tsx +34 -0
- package/src/customFunctions/array.ts +83 -0
- package/src/customFunctions/async.ts +85 -0
- package/src/customFunctions/date.ts +158 -0
- package/src/customFunctions/general.ts +35 -0
- package/src/customFunctions/id.ts +25 -0
- package/src/customFunctions/index.ts +91 -0
- package/src/customFunctions/number.ts +139 -0
- package/src/customFunctions/object.ts +59 -0
- package/src/customFunctions/string.ts +119 -0
- package/src/customFunctions/types.ts +25 -0
- package/src/customFunctions/validation.ts +49 -0
- package/src/customHooks/errors.ts +87 -0
- package/src/customHooks/fetchJson.ts +49 -0
- package/src/customHooks/index.ts +20 -0
- package/src/customHooks/internal.ts +67 -0
- package/src/customHooks/types.ts +71 -0
- package/src/customHooks/useApi.ts +107 -0
- package/src/customHooks/useLazyApi.ts +92 -0
- package/src/customHooks/useMutation.ts +97 -0
- package/src/customHooks/usePaginatedApi.ts +168 -0
- package/src/customHooks/usePollingApi.ts +48 -0
- package/src/index.tsx +63 -0
- package/src/multiply.tsx +3 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
export const sizeStyles = {
|
|
5
|
+
sm: {
|
|
6
|
+
box: {
|
|
7
|
+
width: 18,
|
|
8
|
+
height: 18,
|
|
9
|
+
borderWidth: 1.5
|
|
10
|
+
},
|
|
11
|
+
check: {
|
|
12
|
+
fontSize: 11,
|
|
13
|
+
lineHeight: 13
|
|
14
|
+
},
|
|
15
|
+
indeterminate: {
|
|
16
|
+
width: 8,
|
|
17
|
+
height: 2
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
fontSize: 13
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
md: {
|
|
24
|
+
box: {
|
|
25
|
+
width: 24,
|
|
26
|
+
height: 24,
|
|
27
|
+
borderWidth: 2
|
|
28
|
+
},
|
|
29
|
+
check: {
|
|
30
|
+
fontSize: 14,
|
|
31
|
+
lineHeight: 16
|
|
32
|
+
},
|
|
33
|
+
indeterminate: {
|
|
34
|
+
width: 10,
|
|
35
|
+
height: 2
|
|
36
|
+
},
|
|
37
|
+
label: {
|
|
38
|
+
fontSize: 14
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
lg: {
|
|
42
|
+
box: {
|
|
43
|
+
width: 30,
|
|
44
|
+
height: 30,
|
|
45
|
+
borderWidth: 2
|
|
46
|
+
},
|
|
47
|
+
check: {
|
|
48
|
+
fontSize: 18,
|
|
49
|
+
lineHeight: 20
|
|
50
|
+
},
|
|
51
|
+
indeterminate: {
|
|
52
|
+
width: 12,
|
|
53
|
+
height: 2.5
|
|
54
|
+
},
|
|
55
|
+
label: {
|
|
56
|
+
fontSize: 16
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export const shapeStyles = {
|
|
61
|
+
square: {
|
|
62
|
+
borderRadius: 4
|
|
63
|
+
},
|
|
64
|
+
rounded: {
|
|
65
|
+
borderRadius: 8
|
|
66
|
+
},
|
|
67
|
+
circle: {
|
|
68
|
+
borderRadius: 999
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
export const variantTheme = {
|
|
72
|
+
default: {
|
|
73
|
+
box: {
|
|
74
|
+
borderColor: '#212529',
|
|
75
|
+
backgroundColor: '#fff'
|
|
76
|
+
},
|
|
77
|
+
boxChecked: {
|
|
78
|
+
borderColor: '#212529',
|
|
79
|
+
backgroundColor: '#212529'
|
|
80
|
+
},
|
|
81
|
+
checkColor: '#fff',
|
|
82
|
+
indeterminateColor: '#fff',
|
|
83
|
+
label: {
|
|
84
|
+
color: '#212529'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
primary: {
|
|
88
|
+
box: {
|
|
89
|
+
borderColor: '#0d6efd',
|
|
90
|
+
backgroundColor: '#fff'
|
|
91
|
+
},
|
|
92
|
+
boxChecked: {
|
|
93
|
+
borderColor: '#0d6efd',
|
|
94
|
+
backgroundColor: '#0d6efd'
|
|
95
|
+
},
|
|
96
|
+
checkColor: '#fff',
|
|
97
|
+
indeterminateColor: '#fff',
|
|
98
|
+
label: {
|
|
99
|
+
color: '#212529'
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
success: {
|
|
103
|
+
box: {
|
|
104
|
+
borderColor: '#198754',
|
|
105
|
+
backgroundColor: '#fff'
|
|
106
|
+
},
|
|
107
|
+
boxChecked: {
|
|
108
|
+
borderColor: '#198754',
|
|
109
|
+
backgroundColor: '#198754'
|
|
110
|
+
},
|
|
111
|
+
checkColor: '#fff',
|
|
112
|
+
indeterminateColor: '#fff',
|
|
113
|
+
label: {
|
|
114
|
+
color: '#212529'
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
danger: {
|
|
118
|
+
box: {
|
|
119
|
+
borderColor: '#dc3545',
|
|
120
|
+
backgroundColor: '#fff'
|
|
121
|
+
},
|
|
122
|
+
boxChecked: {
|
|
123
|
+
borderColor: '#dc3545',
|
|
124
|
+
backgroundColor: '#dc3545'
|
|
125
|
+
},
|
|
126
|
+
checkColor: '#fff',
|
|
127
|
+
indeterminateColor: '#fff',
|
|
128
|
+
label: {
|
|
129
|
+
color: '#212529'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
warning: {
|
|
133
|
+
box: {
|
|
134
|
+
borderColor: '#ffc107',
|
|
135
|
+
backgroundColor: '#fff'
|
|
136
|
+
},
|
|
137
|
+
boxChecked: {
|
|
138
|
+
borderColor: '#ffc107',
|
|
139
|
+
backgroundColor: '#ffc107'
|
|
140
|
+
},
|
|
141
|
+
checkColor: '#212529',
|
|
142
|
+
indeterminateColor: '#212529',
|
|
143
|
+
label: {
|
|
144
|
+
color: '#212529'
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
outline: {
|
|
148
|
+
box: {
|
|
149
|
+
borderColor: '#6c757d',
|
|
150
|
+
backgroundColor: 'transparent'
|
|
151
|
+
},
|
|
152
|
+
boxChecked: {
|
|
153
|
+
borderColor: '#6c757d',
|
|
154
|
+
backgroundColor: 'transparent'
|
|
155
|
+
},
|
|
156
|
+
checkColor: '#6c757d',
|
|
157
|
+
indeterminateColor: '#6c757d',
|
|
158
|
+
label: {
|
|
159
|
+
color: '#212529'
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
export const styles = StyleSheet.create({
|
|
164
|
+
wrapper: {
|
|
165
|
+
width: '100%'
|
|
166
|
+
},
|
|
167
|
+
container: {
|
|
168
|
+
flexDirection: 'row',
|
|
169
|
+
alignItems: 'flex-start',
|
|
170
|
+
width: '100%'
|
|
171
|
+
},
|
|
172
|
+
containerLabelLeft: {
|
|
173
|
+
flexDirection: 'row-reverse',
|
|
174
|
+
justifyContent: 'flex-end'
|
|
175
|
+
},
|
|
176
|
+
containerDisabled: {
|
|
177
|
+
opacity: 0.55
|
|
178
|
+
},
|
|
179
|
+
box: {
|
|
180
|
+
justifyContent: 'center',
|
|
181
|
+
alignItems: 'center'
|
|
182
|
+
},
|
|
183
|
+
labelBlock: {
|
|
184
|
+
flex: 1,
|
|
185
|
+
marginHorizontal: 10
|
|
186
|
+
},
|
|
187
|
+
labelBlockRight: {
|
|
188
|
+
marginLeft: 10,
|
|
189
|
+
marginRight: 0
|
|
190
|
+
},
|
|
191
|
+
labelBlockLeft: {
|
|
192
|
+
marginRight: 10,
|
|
193
|
+
marginLeft: 0
|
|
194
|
+
},
|
|
195
|
+
label: {
|
|
196
|
+
fontWeight: '500'
|
|
197
|
+
},
|
|
198
|
+
description: {
|
|
199
|
+
marginTop: 4,
|
|
200
|
+
fontSize: 12,
|
|
201
|
+
lineHeight: 18,
|
|
202
|
+
color: '#6c757d'
|
|
203
|
+
},
|
|
204
|
+
errorMessage: {
|
|
205
|
+
marginTop: 6,
|
|
206
|
+
fontSize: 12,
|
|
207
|
+
color: '#dc3545'
|
|
208
|
+
},
|
|
209
|
+
boxError: {
|
|
210
|
+
borderColor: '#dc3545'
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","sizeStyles","sm","box","width","height","borderWidth","check","fontSize","lineHeight","indeterminate","label","md","lg","shapeStyles","square","borderRadius","rounded","circle","variantTheme","default","borderColor","backgroundColor","boxChecked","checkColor","indeterminateColor","color","primary","success","danger","warning","outline","styles","create","wrapper","container","flexDirection","alignItems","containerLabelLeft","justifyContent","containerDisabled","opacity","labelBlock","flex","marginHorizontal","labelBlockRight","marginLeft","marginRight","labelBlockLeft","fontWeight","description","marginTop","errorMessage","boxError"],"sourceRoot":"../../../../src","sources":["components/CustomCheckbox/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAwC,cAAc;AAIzE,OAAO,MAAMC,UAQZ,GAAG;EACFC,EAAE,EAAE;IACFC,GAAG,EAAE;MAAEC,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEC,WAAW,EAAE;IAAI,CAAC;IAChDC,KAAK,EAAE;MAAEC,QAAQ,EAAE,EAAE;MAAEC,UAAU,EAAE;IAAG,CAAC;IACvCC,aAAa,EAAE;MAAEN,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACtCM,KAAK,EAAE;MAAEH,QAAQ,EAAE;IAAG;EACxB,CAAC;EACDI,EAAE,EAAE;IACFT,GAAG,EAAE;MAAEC,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEC,WAAW,EAAE;IAAE,CAAC;IAC9CC,KAAK,EAAE;MAAEC,QAAQ,EAAE,EAAE;MAAEC,UAAU,EAAE;IAAG,CAAC;IACvCC,aAAa,EAAE;MAAEN,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE;IAAE,CAAC;IACvCM,KAAK,EAAE;MAAEH,QAAQ,EAAE;IAAG;EACxB,CAAC;EACDK,EAAE,EAAE;IACFV,GAAG,EAAE;MAAEC,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEC,WAAW,EAAE;IAAE,CAAC;IAC9CC,KAAK,EAAE;MAAEC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GAAG,EAAE;IACHoC,cAAc,EAAE,QAAQ;IACxBF,UAAU,EAAE;EACd,CAAC;EACDK,UAAU,EAAE;IACVC,IAAI,EAAE,CAAC;IACPC,gBAAgB,EAAE;EACpB,CAAC;EACDC,eAAe,EAAE;IACfC,UAAU,EAAE,EAAE;IACdC,WAAW,EAAE;EACf,CAAC;EACDC,cAAc,EAAE;IACdD,WAAW,EAAE,EAAE;IACfD,UAAU,EAAE;EACd,CAAC;EACDnC,KAAK,EAAE;IACLsC,UAAU,EAAE;EACd,CAAC;EACDC,WAAW,EAAE;IACXC,SAAS,EAAE,CAAC;IACZ3C,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdiB,KAAK,EAAE;EACT,CAAC;EACD0B,YAAY,EAAE;IACZD,SAAS,EAAE,CAAC;IACZ3C,QAAQ,EAAE,EAAE;IACZkB,KAAK,EAAE;EACT,CAAC;EACD2B,QAAQ,EAAE;IACRhC,WAAW,EAAE;EACf;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/CustomCheckbox/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Image, StyleSheet, TouchableOpacity } from 'react-native';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const CloseButton = ({
|
|
6
|
+
onPress = () => {},
|
|
7
|
+
imageStyle = {},
|
|
8
|
+
containerStyle = {},
|
|
9
|
+
closeImage
|
|
10
|
+
}) => {
|
|
11
|
+
const getImage = () => {
|
|
12
|
+
if (closeImage) {
|
|
13
|
+
return closeImage;
|
|
14
|
+
}
|
|
15
|
+
return require('../../assets/images/close.png');
|
|
16
|
+
};
|
|
17
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
18
|
+
hitSlop: {
|
|
19
|
+
top: 20,
|
|
20
|
+
bottom: 20,
|
|
21
|
+
right: 20,
|
|
22
|
+
left: 20
|
|
23
|
+
},
|
|
24
|
+
activeOpacity: 0.5,
|
|
25
|
+
style: [styles.closeImageContainer, containerStyle],
|
|
26
|
+
onPress: onPress,
|
|
27
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
28
|
+
source: getImage(),
|
|
29
|
+
style: [styles.closeImage, imageStyle]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export default CloseButton;
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
closeImage: {
|
|
36
|
+
height: 25,
|
|
37
|
+
width: 25
|
|
38
|
+
},
|
|
39
|
+
closeImageContainer: {
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
top: 15,
|
|
42
|
+
right: 15
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Image","StyleSheet","TouchableOpacity","jsx","_jsx","CloseButton","onPress","imageStyle","containerStyle","closeImage","getImage","require","hitSlop","top","bottom","right","left","activeOpacity","style","styles","closeImageContainer","children","source","create","height","width","position"],"sourceRoot":"../../../../src","sources":["components/closeButton/index.tsx"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGnE,MAAMC,WAAW,GAAGA,CAAC;EACnBC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClBC,UAAU,GAAG,CAAC,CAAC;EACfC,cAAc,GAAG,CAAC,CAAC;EACnBC;AACgB,CAAC,KAAK;EACtB,MAAMC,QAAQ,GAAGA,CAAA,KAAM;IACrB,IAAID,UAAU,EAAE;MACd,OAAOA,UAAU;IACnB;IACA,OAAOE,OAAO,CAAC,+BAA+B,CAAC;EACjD,CAAC;EACD,oBACEP,IAAA,CAACF,gBAAgB;IACfU,OAAO,EAAE;MAAEC,GAAG,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEC,KAAK,EAAE,EAAE;MAAEC,IAAI,EAAE;IAAG,CAAE;IACtDC,aAAa,EAAE,GAAI;IACnBC,KAAK,EAAE,CAACC,MAAM,CAACC,mBAAmB,EAAEZ,cAAc,CAAE;IACpDF,OAAO,EAAEA,OAAQ;IAAAe,QAAA,eAEjBjB,IAAA,CAACJ,KAAK;MAACsB,MAAM,EAAEZ,QAAQ,CAAC,CAAE;MAACQ,KAAK,EAAE,CAACC,MAAM,CAACV,UAAU,EAAEF,UAAU;IAAE,CAAE;EAAC,CACrD,CAAC;AAEvB,CAAC;AAED,eAAeF,WAAW;AAE1B,MAAMc,MAAM,GAAGlB,UAAU,CAACsB,MAAM,CAAC;EAC/Bd,UAAU,EAAE;IACVe,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE;EACT,CAAC;EACDL,mBAAmB,EAAE;IACnBM,QAAQ,EAAE,UAAU;IACpBb,GAAG,EAAE,EAAE;IACPE,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/closeButton/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Image, Text, TouchableOpacity, View } from 'react-native';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { iconOnlySizeStyles, sizeStyles, contentAlignStyles, styles, variantTheme } from "./styles.js";
|
|
6
|
+
import Loader from "../loading/index.js";
|
|
7
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const toColorString = (color, fallback) => typeof color === 'string' ? color : fallback;
|
|
9
|
+
const CustomButton = ({
|
|
10
|
+
text = 'Submit',
|
|
11
|
+
children,
|
|
12
|
+
variant = 'default',
|
|
13
|
+
size = 'md',
|
|
14
|
+
contentAlign = 'center',
|
|
15
|
+
iconOnly = false,
|
|
16
|
+
iconOnlyShape = 'square',
|
|
17
|
+
rightImage,
|
|
18
|
+
leftImage,
|
|
19
|
+
style,
|
|
20
|
+
buttonStyles,
|
|
21
|
+
textStyles,
|
|
22
|
+
opacity = 0.7,
|
|
23
|
+
onPress,
|
|
24
|
+
imageStyles,
|
|
25
|
+
imageOuterStyle,
|
|
26
|
+
rotateRight = '0deg',
|
|
27
|
+
rotateLeft = '0deg',
|
|
28
|
+
disabled = false,
|
|
29
|
+
isLoading = false,
|
|
30
|
+
itemCount,
|
|
31
|
+
showCount = false,
|
|
32
|
+
isCapital = false,
|
|
33
|
+
borderRadius = 0,
|
|
34
|
+
RightIcon,
|
|
35
|
+
LeftIcon,
|
|
36
|
+
rightIconColor,
|
|
37
|
+
leftIconColor,
|
|
38
|
+
rightIconSize,
|
|
39
|
+
leftIconSize,
|
|
40
|
+
rightIconProps = {},
|
|
41
|
+
leftIconProps = {},
|
|
42
|
+
accessibilityRole = 'button',
|
|
43
|
+
accessibilityLabel,
|
|
44
|
+
accessibilityState,
|
|
45
|
+
...touchableProps
|
|
46
|
+
}) => {
|
|
47
|
+
const iconOnlyMetrics = iconOnlySizeStyles[size];
|
|
48
|
+
const theme = variantTheme[variant];
|
|
49
|
+
const fallbackIconColor = toColorString(theme.text.color, '#000000');
|
|
50
|
+
const resolvedLeftIconColor = leftIconColor ?? fallbackIconColor;
|
|
51
|
+
const resolvedRightIconColor = rightIconColor ?? fallbackIconColor;
|
|
52
|
+
const resolvedLeftIconSize = leftIconSize ?? (iconOnly ? iconOnlyMetrics.iconSize : 20);
|
|
53
|
+
const resolvedRightIconSize = rightIconSize ?? (iconOnly ? iconOnlyMetrics.iconSize : 20);
|
|
54
|
+
const resolvedImageSize = iconOnly ? iconOnlyMetrics.imageSize : undefined;
|
|
55
|
+
const IconComponent = LeftIcon ?? RightIcon;
|
|
56
|
+
const imageSource = leftImage ?? rightImage;
|
|
57
|
+
const hasIconOnlyContent = Boolean(IconComponent || imageSource || children);
|
|
58
|
+
if (__DEV__ && iconOnly && !hasIconOnlyContent) {
|
|
59
|
+
console.warn('CustomButton: iconOnly requires LeftIcon, RightIcon, leftImage, rightImage, or children.');
|
|
60
|
+
}
|
|
61
|
+
if (__DEV__ && iconOnly && !accessibilityLabel && !text) {
|
|
62
|
+
console.warn('CustomButton: iconOnly buttons should include accessibilityLabel for screen readers.');
|
|
63
|
+
}
|
|
64
|
+
const alignment = iconOnly ? contentAlignStyles.center : contentAlignStyles[contentAlign];
|
|
65
|
+
const iconOnlyBorderRadius = iconOnly && iconOnlyShape === 'circle' ? iconOnlyMetrics.button.width / 2 : borderRadius;
|
|
66
|
+
const buttonStyle = useMemo(() => [styles.button, theme.button, !iconOnly && sizeStyles[size], iconOnly && iconOnlyMetrics.button, disabled && styles.disabledButton, buttonStyles, style, {
|
|
67
|
+
borderRadius: iconOnly ? iconOnlyBorderRadius : borderRadius
|
|
68
|
+
}], [theme.button, size, iconOnly, iconOnlyMetrics.button, disabled, buttonStyles, style, iconOnlyBorderRadius, borderRadius]);
|
|
69
|
+
const labelStyle = useMemo(() => [styles.text, alignment.text, theme.text, textStyles, disabled && styles.disabledText], [alignment.text, theme.text, textStyles, disabled]);
|
|
70
|
+
const imageTintStyle = theme.imageTint ? {
|
|
71
|
+
tintColor: theme.imageTint
|
|
72
|
+
} : undefined;
|
|
73
|
+
const getLabel = () => {
|
|
74
|
+
if (typeof text !== 'string') {
|
|
75
|
+
return text;
|
|
76
|
+
}
|
|
77
|
+
return isCapital ? text.toUpperCase() : text;
|
|
78
|
+
};
|
|
79
|
+
const renderLabel = () => {
|
|
80
|
+
if (iconOnly) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (children) {
|
|
84
|
+
return children;
|
|
85
|
+
}
|
|
86
|
+
const label = getLabel();
|
|
87
|
+
if (!label) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
91
|
+
style: labelStyle,
|
|
92
|
+
children: label
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const renderIconOnlyContent = () => {
|
|
96
|
+
if (!iconOnly) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
if (children) {
|
|
100
|
+
return children;
|
|
101
|
+
}
|
|
102
|
+
if (IconComponent) {
|
|
103
|
+
return /*#__PURE__*/_jsx(IconComponent, {
|
|
104
|
+
size: LeftIcon ? resolvedLeftIconSize : resolvedRightIconSize,
|
|
105
|
+
color: LeftIcon ? resolvedLeftIconColor : resolvedRightIconColor,
|
|
106
|
+
...(LeftIcon ? leftIconProps : rightIconProps)
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (imageSource) {
|
|
110
|
+
return /*#__PURE__*/_jsx(Image, {
|
|
111
|
+
resizeMode: "contain",
|
|
112
|
+
source: imageSource,
|
|
113
|
+
style: [iconOnly && resolvedImageSize != null && {
|
|
114
|
+
width: resolvedImageSize,
|
|
115
|
+
height: resolvedImageSize
|
|
116
|
+
}, imageTintStyle, imageStyles]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
};
|
|
121
|
+
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
122
|
+
...touchableProps,
|
|
123
|
+
accessibilityRole: accessibilityRole,
|
|
124
|
+
accessibilityLabel: accessibilityLabel ?? text,
|
|
125
|
+
accessibilityState: {
|
|
126
|
+
disabled: disabled || isLoading,
|
|
127
|
+
busy: isLoading,
|
|
128
|
+
...accessibilityState
|
|
129
|
+
},
|
|
130
|
+
disabled: disabled || isLoading,
|
|
131
|
+
activeOpacity: opacity,
|
|
132
|
+
style: buttonStyle,
|
|
133
|
+
onPress: onPress,
|
|
134
|
+
children: [showCount && /*#__PURE__*/_jsx(View, {
|
|
135
|
+
style: styles.countContainer,
|
|
136
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
137
|
+
style: styles.countText,
|
|
138
|
+
children: itemCount
|
|
139
|
+
})
|
|
140
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
141
|
+
style: [styles.container, alignment.container, iconOnly && styles.iconOnlyContainer, imageOuterStyle],
|
|
142
|
+
children: iconOnly ? renderIconOnlyContent() : /*#__PURE__*/_jsxs(_Fragment, {
|
|
143
|
+
children: [LeftIcon && /*#__PURE__*/_jsx(LeftIcon, {
|
|
144
|
+
size: resolvedLeftIconSize,
|
|
145
|
+
color: resolvedLeftIconColor,
|
|
146
|
+
...leftIconProps
|
|
147
|
+
}), leftImage && /*#__PURE__*/_jsx(Image, {
|
|
148
|
+
resizeMode: "contain",
|
|
149
|
+
source: leftImage,
|
|
150
|
+
style: [styles.leftImage, imageTintStyle, imageStyles, {
|
|
151
|
+
transform: [{
|
|
152
|
+
rotate: rotateLeft
|
|
153
|
+
}]
|
|
154
|
+
}]
|
|
155
|
+
}), renderLabel(), RightIcon && /*#__PURE__*/_jsx(RightIcon, {
|
|
156
|
+
size: resolvedRightIconSize,
|
|
157
|
+
color: resolvedRightIconColor,
|
|
158
|
+
...rightIconProps
|
|
159
|
+
}), rightImage && /*#__PURE__*/_jsx(Image, {
|
|
160
|
+
resizeMode: "contain",
|
|
161
|
+
source: rightImage,
|
|
162
|
+
style: [styles.rightImage, imageTintStyle, imageStyles, {
|
|
163
|
+
transform: [{
|
|
164
|
+
rotate: rotateRight
|
|
165
|
+
}]
|
|
166
|
+
}]
|
|
167
|
+
})]
|
|
168
|
+
})
|
|
169
|
+
}), isLoading && /*#__PURE__*/_jsx(Loader, {
|
|
170
|
+
small: true,
|
|
171
|
+
color: theme.loaderColor
|
|
172
|
+
})]
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
export default CustomButton;
|
|
176
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Image","Text","TouchableOpacity","View","useMemo","iconOnlySizeStyles","sizeStyles","contentAlignStyles","styles","variantTheme","Loader","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","toColorString","color","fallback","CustomButton","text","children","variant","size","contentAlign","iconOnly","iconOnlyShape","rightImage","leftImage","style","buttonStyles","textStyles","opacity","onPress","imageStyles","imageOuterStyle","rotateRight","rotateLeft","disabled","isLoading","itemCount","showCount","isCapital","borderRadius","RightIcon","LeftIcon","rightIconColor","leftIconColor","rightIconSize","leftIconSize","rightIconProps","leftIconProps","accessibilityRole","accessibilityLabel","accessibilityState","touchableProps","iconOnlyMetrics","theme","fallbackIconColor","resolvedLeftIconColor","resolvedRightIconColor","resolvedLeftIconSize","iconSize","resolvedRightIconSize","resolvedImageSize","imageSize","undefined","IconComponent","imageSource","hasIconOnlyContent","Boolean","__DEV__","console","warn","alignment","center","iconOnlyBorderRadius","button","width","buttonStyle","disabledButton","labelStyle","disabledText","imageTintStyle","imageTint","tintColor","getLabel","toUpperCase","renderLabel","label","renderIconOnlyContent","resizeMode","source","height","busy","activeOpacity","countContainer","countText","container","iconOnlyContainer","transform","rotate","small","loaderColor"],"sourceRoot":"../../../../src","sources":["components/customButton/index.tsx"],"mappings":";;AAAA,SACEA,KAAK,EACLC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,QAEC,cAAc;AACrB,SAASC,OAAO,QAAQ,OAAO;AAG/B,SACEC,kBAAkB,EAClBC,UAAU,EACVC,kBAAkB,EAClBC,MAAM,EACNC,YAAY,QACP,aAAU;AACjB,OAAOC,MAAM,MAAM,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhC,MAAMC,aAAa,GAAGA,CAACC,KAA6B,EAAEC,QAAgB,KACpE,OAAOD,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGC,QAAQ;AAE9C,MAAMC,YAAY,GAAGA,CAAC;EACpBC,IAAI,GAAG,QAAQ;EACfC,QAAQ;EACRC,OAAO,GAAG,SA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