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,15 @@
|
|
|
1
|
+
import type { ApiStatus, UseMutationOptions } from './types';
|
|
2
|
+
export declare const useMutation: <TData, TVariables = void, TError = unknown>(mutationFn: (variables: TVariables, signal?: AbortSignal) => Promise<TData>, options?: UseMutationOptions<TData, TVariables, TError>) => {
|
|
3
|
+
mutate: (nextVariables: TVariables) => void;
|
|
4
|
+
mutateAsync: (nextVariables: TVariables) => Promise<TData>;
|
|
5
|
+
reset: () => void;
|
|
6
|
+
status: ApiStatus;
|
|
7
|
+
isIdle: boolean;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
isSuccess: boolean;
|
|
10
|
+
isError: boolean;
|
|
11
|
+
data: TData | null;
|
|
12
|
+
error: TError | null;
|
|
13
|
+
variables: TVariables | null;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useMutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMutation.d.ts","sourceRoot":"","sources":["../../../../src/customHooks/useMutation.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,WAAW,GAAI,KAAK,EAAE,UAAU,GAAG,IAAI,EAAE,MAAM,GAAG,OAAO,EACpE,YAAY,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,KAAK,CAAC,EAC3E,UAAS,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAM;4BA4DzC,UAAU;iCA5CJ,UAAU;;;;;;;;;;CAmEnC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ApiStatus, PaginatedFetcher, PaginatedResponse, UsePaginatedApiOptions } from './types';
|
|
2
|
+
export declare const usePaginatedApi: <TItem, TError = unknown>(fetcher: PaginatedFetcher<TItem>, options?: UsePaginatedApiOptions<TItem, TError>) => {
|
|
3
|
+
refresh: () => Promise<void>;
|
|
4
|
+
loadMore: () => Promise<PaginatedResponse<TItem> | null>;
|
|
5
|
+
reset: () => void;
|
|
6
|
+
status: ApiStatus;
|
|
7
|
+
isIdle: boolean;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
isSuccess: boolean;
|
|
10
|
+
isError: boolean;
|
|
11
|
+
items: TItem[];
|
|
12
|
+
page: number;
|
|
13
|
+
hasMore: boolean;
|
|
14
|
+
total: number | undefined;
|
|
15
|
+
error: TError | null;
|
|
16
|
+
isRefreshing: boolean;
|
|
17
|
+
isLoadingMore: boolean;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=usePaginatedApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaginatedApi.d.ts","sourceRoot":"","sources":["../../../../src/customHooks/usePaginatedApi.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,eAAe,GAAI,KAAK,EAAE,MAAM,GAAG,OAAO,EACrD,SAAS,gBAAgB,CAAC,KAAK,CAAC,EAChC,UAAS,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAM;;;;;;;;;;;;;;;;CAoJpD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ApiFetcher, UsePollingApiOptions } from './types';
|
|
2
|
+
export declare const usePollingApi: <TData, TError = unknown>(fetcher: ApiFetcher<TData>, options: UsePollingApiOptions<TData, TError>) => {
|
|
3
|
+
refetch: () => Promise<TData | null>;
|
|
4
|
+
reset: () => void;
|
|
5
|
+
status: import("./types").ApiStatus;
|
|
6
|
+
isIdle: boolean;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
isSuccess: boolean;
|
|
9
|
+
isError: boolean;
|
|
10
|
+
data: TData | null;
|
|
11
|
+
error: TError | null;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=usePollingApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePollingApi.d.ts","sourceRoot":"","sources":["../../../../src/customHooks/usePollingApi.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEhE,eAAO,MAAM,aAAa,GAAI,KAAK,EAAE,MAAM,GAAG,OAAO,EACnD,SAAS,UAAU,CAAC,KAAK,CAAC,EAC1B,SAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC;;;;;;;;;;CAuC7C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { multiply } from './multiply';
|
|
2
|
+
export * from './customFunctions';
|
|
3
|
+
export * from './customHooks';
|
|
4
|
+
export { default as CustomButton, type ButtonContentAlign, type ButtonSize, type ButtonVariant, type CustomButtonProps, type IconOnlyShape, } from './components/customButton';
|
|
5
|
+
export { default as CustomDropDown, type CustomDropDownProps, type DropDownItemImageAlign, type DropDownListItem, type DropDownMode, type DropDownOption, } from './components/customDropDown';
|
|
6
|
+
export { default as CustomCheckbox, type CheckboxLabelPosition, type CheckboxShape, type CheckboxSize, type CheckboxVariant, type CustomCheckboxProps, } from './components/CustomCheckbox';
|
|
7
|
+
export { default as CustomList, defaultKeyExtractor, getFlashList, isFlashListAvailable, type CustomListProps, type ListEngine, } from './components/customList';
|
|
8
|
+
export { default as CustomNumberPad, applyNumberPadKey, useNumberPadInput, NUMBER_PAD_ROWS, type CustomNumberPadProps, type NumberPadBottomLeftKey, type NumberPadKeyConfig, type NumberPadKeyType, type NumberPadSize, type NumberPadVariant, type UseNumberPadInputOptions, } from './components/customNumberPad';
|
|
9
|
+
export { default as CustomModal, useCustomModal, type CustomModalProps, type ModalAction, type ModalPresentation, } from './components/customModal';
|
|
10
|
+
export { default as CustomSlideTabs, type CustomSlideTabsProps, type SlideTabItem, type SlideTabSceneState, type SlideTabFetcher, type SlideTabIconComponent, } from './components/customSlideTabs';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,GAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiply.d.ts","sourceRoot":"","sources":["../../../src/multiply.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rn-custom-ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "custom react native ui",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"rn-custom-ui-source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"!ios/build",
|
|
24
|
+
"!android/build",
|
|
25
|
+
"!android/gradle",
|
|
26
|
+
"!android/gradlew",
|
|
27
|
+
"!android/gradlew.bat",
|
|
28
|
+
"!android/local.properties",
|
|
29
|
+
"!**/__tests__",
|
|
30
|
+
"!**/__fixtures__",
|
|
31
|
+
"!**/__mocks__",
|
|
32
|
+
"!**/.*"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"example": "yarn workspace rn-custom-ui-example",
|
|
36
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
37
|
+
"prepare": "bob build",
|
|
38
|
+
"typecheck": "tsc",
|
|
39
|
+
"test": "jest",
|
|
40
|
+
"release": "release-it --only-version",
|
|
41
|
+
"web": "vite",
|
|
42
|
+
"build:web": "vite build",
|
|
43
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\""
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"react-native",
|
|
47
|
+
"ios",
|
|
48
|
+
"android"
|
|
49
|
+
],
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/Mustafa-Hakimji/react-native-custom-component.git"
|
|
53
|
+
},
|
|
54
|
+
"author": "Mustafa Hakimji <mustafahussaini757@gmail.com> (https://github.com/Mustafa-Hakimji)",
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/Mustafa-Hakimji/react-native-custom-component/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/Mustafa-Hakimji/react-native-custom-component#readme",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"registry": "https://registry.npmjs.org/"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@commitlint/config-conventional": "^21.0.2",
|
|
65
|
+
"@eslint/compat": "^2.1.0",
|
|
66
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
67
|
+
"@eslint/js": "^10.0.1",
|
|
68
|
+
"@jest/globals": "^29.7.0",
|
|
69
|
+
"@react-native/babel-preset": "0.85.0",
|
|
70
|
+
"@react-native/eslint-config": "0.85.0",
|
|
71
|
+
"@react-native/jest-preset": "0.85.0",
|
|
72
|
+
"@release-it/conventional-changelog": "^11.0.1",
|
|
73
|
+
"@shopify/flash-list": "^2.2.0",
|
|
74
|
+
"@types/react": "^19.2.0",
|
|
75
|
+
"commitlint": "^21.0.2",
|
|
76
|
+
"del-cli": "^7.0.0",
|
|
77
|
+
"eslint": "^9.39.4",
|
|
78
|
+
"eslint-config-prettier": "^10.1.8",
|
|
79
|
+
"eslint-plugin-ft-flow": "^3.0.11",
|
|
80
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
81
|
+
"jest": "^29.7.0",
|
|
82
|
+
"lefthook": "^2.1.9",
|
|
83
|
+
"prettier": "^3.8.3",
|
|
84
|
+
"react": "19.2.3",
|
|
85
|
+
"react-native": "0.85.0",
|
|
86
|
+
"react-native-builder-bob": "^0.41.0",
|
|
87
|
+
"react-native-web": "~0.21.2",
|
|
88
|
+
"release-it": "^20.2.0",
|
|
89
|
+
"turbo": "^2.9.16",
|
|
90
|
+
"typescript": "^6.0.3"
|
|
91
|
+
},
|
|
92
|
+
"peerDependencies": {
|
|
93
|
+
"@shopify/flash-list": ">=1.6.0",
|
|
94
|
+
"react": "*",
|
|
95
|
+
"react-native": "*"
|
|
96
|
+
},
|
|
97
|
+
"peerDependenciesMeta": {
|
|
98
|
+
"@shopify/flash-list": {
|
|
99
|
+
"optional": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"workspaces": [
|
|
103
|
+
"example"
|
|
104
|
+
],
|
|
105
|
+
"packageManager": "yarn@4.11.0",
|
|
106
|
+
"react-native-builder-bob": {
|
|
107
|
+
"source": "src",
|
|
108
|
+
"output": "lib",
|
|
109
|
+
"targets": [
|
|
110
|
+
[
|
|
111
|
+
"module",
|
|
112
|
+
{
|
|
113
|
+
"esm": true
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"typescript",
|
|
118
|
+
{
|
|
119
|
+
"project": "tsconfig.build.json"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"jest": {
|
|
125
|
+
"preset": "@react-native/jest-preset",
|
|
126
|
+
"testEnvironmentOptions": {
|
|
127
|
+
"customExportConditions": [
|
|
128
|
+
"require",
|
|
129
|
+
"react-native",
|
|
130
|
+
"<%- project.sourceCondition -%>"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"modulePathIgnorePatterns": [
|
|
134
|
+
"<rootDir>/example/node_modules",
|
|
135
|
+
"<rootDir>/lib/"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"commitlint": {
|
|
139
|
+
"extends": [
|
|
140
|
+
"@commitlint/config-conventional"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"release-it": {
|
|
144
|
+
"git": {
|
|
145
|
+
"commitMessage": "chore: release ${version}",
|
|
146
|
+
"tagName": "v${version}"
|
|
147
|
+
},
|
|
148
|
+
"npm": {
|
|
149
|
+
"publish": true
|
|
150
|
+
},
|
|
151
|
+
"github": {
|
|
152
|
+
"release": true
|
|
153
|
+
},
|
|
154
|
+
"plugins": {
|
|
155
|
+
"@release-it/conventional-changelog": {
|
|
156
|
+
"preset": {
|
|
157
|
+
"name": "angular"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"prettier": {
|
|
163
|
+
"quoteProps": "consistent",
|
|
164
|
+
"singleQuote": true,
|
|
165
|
+
"tabWidth": 2,
|
|
166
|
+
"trailingComma": "es5",
|
|
167
|
+
"useTabs": false
|
|
168
|
+
},
|
|
169
|
+
"create-react-native-library": {
|
|
170
|
+
"type": "library",
|
|
171
|
+
"languages": "js",
|
|
172
|
+
"tools": [
|
|
173
|
+
"jest",
|
|
174
|
+
"lefthook",
|
|
175
|
+
"release-it",
|
|
176
|
+
"vite",
|
|
177
|
+
"eslint"
|
|
178
|
+
],
|
|
179
|
+
"version": "0.63.0"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { shapeStyles, sizeStyles, styles, variantTheme } from './styles';
|
|
5
|
+
import type { CustomCheckboxProps } from './types';
|
|
6
|
+
|
|
7
|
+
const CustomCheckbox = ({
|
|
8
|
+
checked,
|
|
9
|
+
onChange,
|
|
10
|
+
indeterminate = false,
|
|
11
|
+
disabled = false,
|
|
12
|
+
error = false,
|
|
13
|
+
errorMessage,
|
|
14
|
+
label,
|
|
15
|
+
description,
|
|
16
|
+
children,
|
|
17
|
+
variant = 'default',
|
|
18
|
+
size = 'md',
|
|
19
|
+
shape = 'square',
|
|
20
|
+
labelPosition = 'right',
|
|
21
|
+
containerStyle,
|
|
22
|
+
boxStyle,
|
|
23
|
+
labelStyle,
|
|
24
|
+
descriptionStyle,
|
|
25
|
+
errorStyle,
|
|
26
|
+
accessibilityLabel,
|
|
27
|
+
}: CustomCheckboxProps) => {
|
|
28
|
+
const theme = variantTheme[variant];
|
|
29
|
+
const sizing = sizeStyles[size];
|
|
30
|
+
const isActive = checked || indeterminate;
|
|
31
|
+
|
|
32
|
+
const handlePress = () => {
|
|
33
|
+
if (disabled) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
onChange?.(!checked);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const boxStyles = useMemo(
|
|
41
|
+
() => [
|
|
42
|
+
styles.box,
|
|
43
|
+
sizing.box,
|
|
44
|
+
shapeStyles[shape],
|
|
45
|
+
theme.box,
|
|
46
|
+
isActive && theme.boxChecked,
|
|
47
|
+
error && styles.boxError,
|
|
48
|
+
boxStyle,
|
|
49
|
+
],
|
|
50
|
+
[sizing.box, shape, theme.box, theme.boxChecked, isActive, error, boxStyle]
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const renderMark = () => {
|
|
54
|
+
if (indeterminate) {
|
|
55
|
+
return (
|
|
56
|
+
<View
|
|
57
|
+
style={[
|
|
58
|
+
sizing.indeterminate,
|
|
59
|
+
{ backgroundColor: theme.indeterminateColor },
|
|
60
|
+
]}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!checked) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return <Text style={[sizing.check, { color: theme.checkColor }]}>✓</Text>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const renderLabelContent = () => {
|
|
73
|
+
if (children) {
|
|
74
|
+
return children;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!label && !description) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<View
|
|
83
|
+
style={[
|
|
84
|
+
styles.labelBlock,
|
|
85
|
+
labelPosition === 'right'
|
|
86
|
+
? styles.labelBlockRight
|
|
87
|
+
: styles.labelBlockLeft,
|
|
88
|
+
]}
|
|
89
|
+
>
|
|
90
|
+
{!!label && (
|
|
91
|
+
<Text style={[styles.label, sizing.label, theme.label, labelStyle]}>
|
|
92
|
+
{label}
|
|
93
|
+
</Text>
|
|
94
|
+
)}
|
|
95
|
+
{!!description && (
|
|
96
|
+
<Text style={[styles.description, descriptionStyle]}>
|
|
97
|
+
{description}
|
|
98
|
+
</Text>
|
|
99
|
+
)}
|
|
100
|
+
</View>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const hasLabelContent = Boolean(children || label || description);
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<View style={styles.wrapper}>
|
|
108
|
+
<TouchableOpacity
|
|
109
|
+
activeOpacity={0.7}
|
|
110
|
+
disabled={disabled}
|
|
111
|
+
style={[
|
|
112
|
+
styles.container,
|
|
113
|
+
labelPosition === 'left' && styles.containerLabelLeft,
|
|
114
|
+
disabled && styles.containerDisabled,
|
|
115
|
+
containerStyle,
|
|
116
|
+
]}
|
|
117
|
+
accessibilityRole="checkbox"
|
|
118
|
+
accessibilityState={{
|
|
119
|
+
checked: indeterminate ? 'mixed' : checked,
|
|
120
|
+
disabled,
|
|
121
|
+
}}
|
|
122
|
+
accessibilityLabel={accessibilityLabel ?? label}
|
|
123
|
+
onPress={handlePress}
|
|
124
|
+
>
|
|
125
|
+
<View style={boxStyles}>{renderMark()}</View>
|
|
126
|
+
{hasLabelContent && renderLabelContent()}
|
|
127
|
+
</TouchableOpacity>
|
|
128
|
+
|
|
129
|
+
{error && !!errorMessage && (
|
|
130
|
+
<Text style={[styles.errorMessage, errorStyle]}>{errorMessage}</Text>
|
|
131
|
+
)}
|
|
132
|
+
</View>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export default CustomCheckbox;
|
|
137
|
+
export type {
|
|
138
|
+
CheckboxLabelPosition,
|
|
139
|
+
CheckboxShape,
|
|
140
|
+
CheckboxSize,
|
|
141
|
+
CheckboxVariant,
|
|
142
|
+
CustomCheckboxProps,
|
|
143
|
+
} from './types';
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { StyleSheet, type TextStyle, type ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { CheckboxShape, CheckboxSize, CheckboxVariant } from './types';
|
|
4
|
+
|
|
5
|
+
export const sizeStyles: Record<
|
|
6
|
+
CheckboxSize,
|
|
7
|
+
{
|
|
8
|
+
box: ViewStyle;
|
|
9
|
+
check: TextStyle;
|
|
10
|
+
indeterminate: ViewStyle;
|
|
11
|
+
label: TextStyle;
|
|
12
|
+
}
|
|
13
|
+
> = {
|
|
14
|
+
sm: {
|
|
15
|
+
box: { width: 18, height: 18, borderWidth: 1.5 },
|
|
16
|
+
check: { fontSize: 11, lineHeight: 13 },
|
|
17
|
+
indeterminate: { width: 8, height: 2 },
|
|
18
|
+
label: { fontSize: 13 },
|
|
19
|
+
},
|
|
20
|
+
md: {
|
|
21
|
+
box: { width: 24, height: 24, borderWidth: 2 },
|
|
22
|
+
check: { fontSize: 14, lineHeight: 16 },
|
|
23
|
+
indeterminate: { width: 10, height: 2 },
|
|
24
|
+
label: { fontSize: 14 },
|
|
25
|
+
},
|
|
26
|
+
lg: {
|
|
27
|
+
box: { width: 30, height: 30, borderWidth: 2 },
|
|
28
|
+
check: { fontSize: 18, lineHeight: 20 },
|
|
29
|
+
indeterminate: { width: 12, height: 2.5 },
|
|
30
|
+
label: { fontSize: 16 },
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const shapeStyles: Record<CheckboxShape, ViewStyle> = {
|
|
35
|
+
square: { borderRadius: 4 },
|
|
36
|
+
rounded: { borderRadius: 8 },
|
|
37
|
+
circle: { borderRadius: 999 },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const variantTheme: Record<
|
|
41
|
+
CheckboxVariant,
|
|
42
|
+
{
|
|
43
|
+
box: ViewStyle;
|
|
44
|
+
boxChecked: ViewStyle;
|
|
45
|
+
checkColor: string;
|
|
46
|
+
indeterminateColor: string;
|
|
47
|
+
label: TextStyle;
|
|
48
|
+
}
|
|
49
|
+
> = {
|
|
50
|
+
default: {
|
|
51
|
+
box: { borderColor: '#212529', backgroundColor: '#fff' },
|
|
52
|
+
boxChecked: { borderColor: '#212529', backgroundColor: '#212529' },
|
|
53
|
+
checkColor: '#fff',
|
|
54
|
+
indeterminateColor: '#fff',
|
|
55
|
+
label: { color: '#212529' },
|
|
56
|
+
},
|
|
57
|
+
primary: {
|
|
58
|
+
box: { borderColor: '#0d6efd', backgroundColor: '#fff' },
|
|
59
|
+
boxChecked: { borderColor: '#0d6efd', backgroundColor: '#0d6efd' },
|
|
60
|
+
checkColor: '#fff',
|
|
61
|
+
indeterminateColor: '#fff',
|
|
62
|
+
label: { color: '#212529' },
|
|
63
|
+
},
|
|
64
|
+
success: {
|
|
65
|
+
box: { borderColor: '#198754', backgroundColor: '#fff' },
|
|
66
|
+
boxChecked: { borderColor: '#198754', backgroundColor: '#198754' },
|
|
67
|
+
checkColor: '#fff',
|
|
68
|
+
indeterminateColor: '#fff',
|
|
69
|
+
label: { color: '#212529' },
|
|
70
|
+
},
|
|
71
|
+
danger: {
|
|
72
|
+
box: { borderColor: '#dc3545', backgroundColor: '#fff' },
|
|
73
|
+
boxChecked: { borderColor: '#dc3545', backgroundColor: '#dc3545' },
|
|
74
|
+
checkColor: '#fff',
|
|
75
|
+
indeterminateColor: '#fff',
|
|
76
|
+
label: { color: '#212529' },
|
|
77
|
+
},
|
|
78
|
+
warning: {
|
|
79
|
+
box: { borderColor: '#ffc107', backgroundColor: '#fff' },
|
|
80
|
+
boxChecked: { borderColor: '#ffc107', backgroundColor: '#ffc107' },
|
|
81
|
+
checkColor: '#212529',
|
|
82
|
+
indeterminateColor: '#212529',
|
|
83
|
+
label: { color: '#212529' },
|
|
84
|
+
},
|
|
85
|
+
outline: {
|
|
86
|
+
box: { borderColor: '#6c757d', backgroundColor: 'transparent' },
|
|
87
|
+
boxChecked: {
|
|
88
|
+
borderColor: '#6c757d',
|
|
89
|
+
backgroundColor: 'transparent',
|
|
90
|
+
},
|
|
91
|
+
checkColor: '#6c757d',
|
|
92
|
+
indeterminateColor: '#6c757d',
|
|
93
|
+
label: { color: '#212529' },
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const styles = StyleSheet.create({
|
|
98
|
+
wrapper: {
|
|
99
|
+
width: '100%',
|
|
100
|
+
},
|
|
101
|
+
container: {
|
|
102
|
+
flexDirection: 'row',
|
|
103
|
+
alignItems: 'flex-start',
|
|
104
|
+
width: '100%',
|
|
105
|
+
},
|
|
106
|
+
containerLabelLeft: {
|
|
107
|
+
flexDirection: 'row-reverse',
|
|
108
|
+
justifyContent: 'flex-end',
|
|
109
|
+
},
|
|
110
|
+
containerDisabled: {
|
|
111
|
+
opacity: 0.55,
|
|
112
|
+
},
|
|
113
|
+
box: {
|
|
114
|
+
justifyContent: 'center',
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
},
|
|
117
|
+
labelBlock: {
|
|
118
|
+
flex: 1,
|
|
119
|
+
marginHorizontal: 10,
|
|
120
|
+
},
|
|
121
|
+
labelBlockRight: {
|
|
122
|
+
marginLeft: 10,
|
|
123
|
+
marginRight: 0,
|
|
124
|
+
},
|
|
125
|
+
labelBlockLeft: {
|
|
126
|
+
marginRight: 10,
|
|
127
|
+
marginLeft: 0,
|
|
128
|
+
},
|
|
129
|
+
label: {
|
|
130
|
+
fontWeight: '500',
|
|
131
|
+
},
|
|
132
|
+
description: {
|
|
133
|
+
marginTop: 4,
|
|
134
|
+
fontSize: 12,
|
|
135
|
+
lineHeight: 18,
|
|
136
|
+
color: '#6c757d',
|
|
137
|
+
},
|
|
138
|
+
errorMessage: {
|
|
139
|
+
marginTop: 6,
|
|
140
|
+
fontSize: 12,
|
|
141
|
+
color: '#dc3545',
|
|
142
|
+
},
|
|
143
|
+
boxError: {
|
|
144
|
+
borderColor: '#dc3545',
|
|
145
|
+
},
|
|
146
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type CheckboxVariant =
|
|
5
|
+
'default' | 'primary' | 'success' | 'danger' | 'warning' | 'outline';
|
|
6
|
+
|
|
7
|
+
export type CheckboxSize = 'sm' | 'md' | 'lg';
|
|
8
|
+
|
|
9
|
+
export type CheckboxShape = 'square' | 'rounded' | 'circle';
|
|
10
|
+
|
|
11
|
+
export type CheckboxLabelPosition = 'left' | 'right';
|
|
12
|
+
|
|
13
|
+
export interface CustomCheckboxProps {
|
|
14
|
+
checked: boolean;
|
|
15
|
+
onChange?: (checked: boolean) => void;
|
|
16
|
+
indeterminate?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
error?: boolean;
|
|
19
|
+
errorMessage?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
variant?: CheckboxVariant;
|
|
24
|
+
size?: CheckboxSize;
|
|
25
|
+
shape?: CheckboxShape;
|
|
26
|
+
labelPosition?: CheckboxLabelPosition;
|
|
27
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
28
|
+
boxStyle?: StyleProp<ViewStyle>;
|
|
29
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
30
|
+
descriptionStyle?: StyleProp<TextStyle>;
|
|
31
|
+
errorStyle?: StyleProp<TextStyle>;
|
|
32
|
+
accessibilityLabel?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Image, StyleSheet, TouchableOpacity } from 'react-native';
|
|
2
|
+
import type { CloseButtonProps } from './types';
|
|
3
|
+
|
|
4
|
+
const CloseButton = ({
|
|
5
|
+
onPress = () => {},
|
|
6
|
+
imageStyle = {},
|
|
7
|
+
containerStyle = {},
|
|
8
|
+
closeImage,
|
|
9
|
+
}: CloseButtonProps) => {
|
|
10
|
+
const getImage = () => {
|
|
11
|
+
if (closeImage) {
|
|
12
|
+
return closeImage;
|
|
13
|
+
}
|
|
14
|
+
return require('../../assets/images/close.png');
|
|
15
|
+
};
|
|
16
|
+
return (
|
|
17
|
+
<TouchableOpacity
|
|
18
|
+
hitSlop={{ top: 20, bottom: 20, right: 20, left: 20 }}
|
|
19
|
+
activeOpacity={0.5}
|
|
20
|
+
style={[styles.closeImageContainer, containerStyle]}
|
|
21
|
+
onPress={onPress}
|
|
22
|
+
>
|
|
23
|
+
<Image source={getImage()} style={[styles.closeImage, imageStyle]} />
|
|
24
|
+
</TouchableOpacity>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default CloseButton;
|
|
29
|
+
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
closeImage: {
|
|
32
|
+
height: 25,
|
|
33
|
+
width: 25,
|
|
34
|
+
},
|
|
35
|
+
closeImageContainer: {
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
top: 15,
|
|
38
|
+
right: 15,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ImageSourcePropType,
|
|
3
|
+
ImageStyle,
|
|
4
|
+
StyleProp,
|
|
5
|
+
ViewStyle,
|
|
6
|
+
} from 'react-native';
|
|
7
|
+
|
|
8
|
+
export interface CloseButtonProps {
|
|
9
|
+
onPress?: () => void;
|
|
10
|
+
imageStyle?: StyleProp<ImageStyle>;
|
|
11
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
12
|
+
closeImage?: ImageSourcePropType;
|
|
13
|
+
}
|