@navegarti/rn-design-system 0.2.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 +37 -0
- package/lib/module/api/axios-adapter.js +174 -0
- package/lib/module/api/axios-adapter.js.map +1 -0
- package/lib/module/api/errors.js +91 -0
- package/lib/module/api/errors.js.map +1 -0
- package/lib/module/api/index.js +30 -0
- package/lib/module/api/index.js.map +1 -0
- package/lib/module/api/retry-strategy.js +68 -0
- package/lib/module/api/retry-strategy.js.map +1 -0
- package/lib/module/api/stores/auth-store.js +26 -0
- package/lib/module/api/stores/auth-store.js.map +1 -0
- package/lib/module/api/types.js +4 -0
- package/lib/module/api/types.js.map +1 -0
- package/lib/module/api.js +10 -0
- package/lib/module/api.js.map +1 -0
- package/lib/module/components/Button/index.js +32 -0
- package/lib/module/components/Button/index.js.map +1 -0
- package/lib/module/components/Button/styles.js +27 -0
- package/lib/module/components/Button/styles.js.map +1 -0
- package/lib/module/components/Carousel/components/dot.js +42 -0
- package/lib/module/components/Carousel/components/dot.js.map +1 -0
- package/lib/module/components/Carousel/components/footer.js +22 -0
- package/lib/module/components/Carousel/components/footer.js.map +1 -0
- package/lib/module/components/Carousel/components/list.js +55 -0
- package/lib/module/components/Carousel/components/list.js.map +1 -0
- package/lib/module/components/Carousel/components/pagination.js +29 -0
- package/lib/module/components/Carousel/components/pagination.js.map +1 -0
- package/lib/module/components/Carousel/components/see-all-button.js +24 -0
- package/lib/module/components/Carousel/components/see-all-button.js.map +1 -0
- package/lib/module/components/Carousel/context.js +15 -0
- package/lib/module/components/Carousel/context.js.map +1 -0
- package/lib/module/components/Carousel/index.js +142 -0
- package/lib/module/components/Carousel/index.js.map +1 -0
- package/lib/module/components/Carousel/styles.js +10 -0
- package/lib/module/components/Carousel/styles.js.map +1 -0
- package/lib/module/components/Carousel/types.js +4 -0
- package/lib/module/components/Carousel/types.js.map +1 -0
- package/lib/module/components/Checkbox/index.js +34 -0
- package/lib/module/components/Checkbox/index.js.map +1 -0
- package/lib/module/components/Checkbox/styles.js +9 -0
- package/lib/module/components/Checkbox/styles.js.map +1 -0
- package/lib/module/components/FAB/components/extended-fab.js +17 -0
- package/lib/module/components/FAB/components/extended-fab.js.map +1 -0
- package/lib/module/components/FAB/index.js +24 -0
- package/lib/module/components/FAB/index.js.map +1 -0
- package/lib/module/components/FAB/styles.js +40 -0
- package/lib/module/components/FAB/styles.js.map +1 -0
- package/lib/module/components/FAB/utils.js +49 -0
- package/lib/module/components/FAB/utils.js.map +1 -0
- package/lib/module/components/Flex/index.js +4 -0
- package/lib/module/components/Flex/index.js.map +1 -0
- package/lib/module/components/Flex/styles.js +31 -0
- package/lib/module/components/Flex/styles.js.map +1 -0
- package/lib/module/components/FormLabel/index.js +10 -0
- package/lib/module/components/FormLabel/index.js.map +1 -0
- package/lib/module/components/FormLabel/styles.js +10 -0
- package/lib/module/components/FormLabel/styles.js.map +1 -0
- package/lib/module/components/Input/components/input-control.js +25 -0
- package/lib/module/components/Input/components/input-control.js.map +1 -0
- package/lib/module/components/Input/components/input-error.js +17 -0
- package/lib/module/components/Input/components/input-error.js.map +1 -0
- package/lib/module/components/Input/components/input-field.js +48 -0
- package/lib/module/components/Input/components/input-field.js.map +1 -0
- package/lib/module/components/Input/components/input-icon.js +10 -0
- package/lib/module/components/Input/components/input-icon.js.map +1 -0
- package/lib/module/components/Input/components/input-password-toggle.js +30 -0
- package/lib/module/components/Input/components/input-password-toggle.js.map +1 -0
- package/lib/module/components/Input/components/input-root.js +45 -0
- package/lib/module/components/Input/components/input-root.js.map +1 -0
- package/lib/module/components/Input/context.js +12 -0
- package/lib/module/components/Input/context.js.map +1 -0
- package/lib/module/components/Input/index.js +18 -0
- package/lib/module/components/Input/index.js.map +1 -0
- package/lib/module/components/Input/styles.js +40 -0
- package/lib/module/components/Input/styles.js.map +1 -0
- package/lib/module/components/Input/utils.js +24 -0
- package/lib/module/components/Input/utils.js.map +1 -0
- package/lib/module/components/Margin/index.js +4 -0
- package/lib/module/components/Margin/index.js.map +1 -0
- package/lib/module/components/Margin/styles.js +15 -0
- package/lib/module/components/Margin/styles.js.map +1 -0
- package/lib/module/components/OTPInput/index.js +85 -0
- package/lib/module/components/OTPInput/index.js.map +1 -0
- package/lib/module/components/OTPInput/styles.js +23 -0
- package/lib/module/components/OTPInput/styles.js.map +1 -0
- package/lib/module/components/OTPInput/utils.js +24 -0
- package/lib/module/components/OTPInput/utils.js.map +1 -0
- package/lib/module/components/Padding/index.js +4 -0
- package/lib/module/components/Padding/index.js.map +1 -0
- package/lib/module/components/Padding/styles.js +15 -0
- package/lib/module/components/Padding/styles.js.map +1 -0
- package/lib/module/components/Radio/components/radio-item.js +52 -0
- package/lib/module/components/Radio/components/radio-item.js.map +1 -0
- package/lib/module/components/Radio/context.js +5 -0
- package/lib/module/components/Radio/context.js.map +1 -0
- package/lib/module/components/Radio/index.js +30 -0
- package/lib/module/components/Radio/index.js.map +1 -0
- package/lib/module/components/Radio/styles.js +33 -0
- package/lib/module/components/Radio/styles.js.map +1 -0
- package/lib/module/components/Radio/utils.js +15 -0
- package/lib/module/components/Radio/utils.js.map +1 -0
- package/lib/module/components/Select/components/error-icon.js +8 -0
- package/lib/module/components/Select/components/error-icon.js.map +1 -0
- package/lib/module/components/Select/components/select-error.js +17 -0
- package/lib/module/components/Select/components/select-error.js.map +1 -0
- package/lib/module/components/Select/components/select-field.js +67 -0
- package/lib/module/components/Select/components/select-field.js.map +1 -0
- package/lib/module/components/Select/context.js +12 -0
- package/lib/module/components/Select/context.js.map +1 -0
- package/lib/module/components/Select/index.js +26 -0
- package/lib/module/components/Select/index.js.map +1 -0
- package/lib/module/components/Select/styles.js +15 -0
- package/lib/module/components/Select/styles.js.map +1 -0
- package/lib/module/components/Skeleton/index.js +44 -0
- package/lib/module/components/Skeleton/index.js.map +1 -0
- package/lib/module/components/Switch/index.js +55 -0
- package/lib/module/components/Switch/index.js.map +1 -0
- package/lib/module/components/Switch/styles.js +31 -0
- package/lib/module/components/Switch/styles.js.map +1 -0
- package/lib/module/components/Switch/utils.js +12 -0
- package/lib/module/components/Switch/utils.js.map +1 -0
- package/lib/module/components/Text/index.js +4 -0
- package/lib/module/components/Text/index.js.map +1 -0
- package/lib/module/components/Text/styles.js +25 -0
- package/lib/module/components/Text/styles.js.map +1 -0
- package/lib/module/components.js +23 -0
- package/lib/module/components.js.map +1 -0
- package/lib/module/form.js +10 -0
- package/lib/module/form.js.map +1 -0
- package/lib/module/formValidators/ZodTypeValidator.js +38 -0
- package/lib/module/formValidators/ZodTypeValidator.js.map +1 -0
- package/lib/module/formValidators/index.js +8 -0
- package/lib/module/formValidators/index.js.map +1 -0
- package/lib/module/formValidators/types.js +4 -0
- package/lib/module/formValidators/types.js.map +1 -0
- package/lib/module/hooks/useAppIsActive.js +20 -0
- package/lib/module/hooks/useAppIsActive.js.map +1 -0
- package/lib/module/hooks/useAppSecurity.js +26 -0
- package/lib/module/hooks/useAppSecurity.js.map +1 -0
- package/lib/module/hooks/useNetworkStatus.js +55 -0
- package/lib/module/hooks/useNetworkStatus.js.map +1 -0
- package/lib/module/hooks/useStatusBar.js +26 -0
- package/lib/module/hooks/useStatusBar.js.map +1 -0
- package/lib/module/hooks.js +12 -0
- package/lib/module/hooks.js.map +1 -0
- package/lib/module/index.js +53 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/libs/tanstack-form.js +5 -0
- package/lib/module/libs/tanstack-form.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/utils/camelCase.js +7 -0
- package/lib/module/utils/camelCase.js.map +1 -0
- package/lib/module/utils/camelCaseJSONKeys.js +29 -0
- package/lib/module/utils/camelCaseJSONKeys.js.map +1 -0
- package/lib/module/utils/capitalizeWord.js +5 -0
- package/lib/module/utils/capitalizeWord.js.map +1 -0
- package/lib/module/utils/createLinkingPhoneNumberString.js +10 -0
- package/lib/module/utils/createLinkingPhoneNumberString.js.map +1 -0
- package/lib/module/utils/dateFormatters.js +34 -0
- package/lib/module/utils/dateFormatters.js.map +1 -0
- package/lib/module/utils/debounce.js +12 -0
- package/lib/module/utils/debounce.js.map +1 -0
- package/lib/module/utils/deepLinkParser.js +117 -0
- package/lib/module/utils/deepLinkParser.js.map +1 -0
- package/lib/module/utils/getAge.js +13 -0
- package/lib/module/utils/getAge.js.map +1 -0
- package/lib/module/utils/getOnlyNumbers.js +4 -0
- package/lib/module/utils/getOnlyNumbers.js.map +1 -0
- package/lib/module/utils/isArray.js +7 -0
- package/lib/module/utils/isArray.js.map +1 -0
- package/lib/module/utils/isObject.js +7 -0
- package/lib/module/utils/isObject.js.map +1 -0
- package/lib/module/utils/masks.js +5 -0
- package/lib/module/utils/masks.js.map +1 -0
- package/lib/module/utils/priceFormatter.js +9 -0
- package/lib/module/utils/priceFormatter.js.map +1 -0
- package/lib/module/utils/removeTextAccents.js +5 -0
- package/lib/module/utils/removeTextAccents.js.map +1 -0
- package/lib/module/utils/shadowStyledIos.js +8 -0
- package/lib/module/utils/shadowStyledIos.js.map +1 -0
- package/lib/module/utils/sortBy.js +18 -0
- package/lib/module/utils/sortBy.js.map +1 -0
- package/lib/module/utils/uniqBy.js +15 -0
- package/lib/module/utils/uniqBy.js.map +1 -0
- package/lib/module/utils/userFullnameInitialsExtractor.js +19 -0
- package/lib/module/utils/userFullnameInitialsExtractor.js.map +1 -0
- package/lib/module/utils.js +26 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/api/axios-adapter.d.ts +61 -0
- package/lib/typescript/src/api/axios-adapter.d.ts.map +1 -0
- package/lib/typescript/src/api/errors.d.ts +63 -0
- package/lib/typescript/src/api/errors.d.ts.map +1 -0
- package/lib/typescript/src/api/index.d.ts +21 -0
- package/lib/typescript/src/api/index.d.ts.map +1 -0
- package/lib/typescript/src/api/retry-strategy.d.ts +21 -0
- package/lib/typescript/src/api/retry-strategy.d.ts.map +1 -0
- package/lib/typescript/src/api/stores/auth-store.d.ts +15 -0
- package/lib/typescript/src/api/stores/auth-store.d.ts.map +1 -0
- package/lib/typescript/src/api/types.d.ts +68 -0
- package/lib/typescript/src/api/types.d.ts.map +1 -0
- package/lib/typescript/src/api.d.ts +8 -0
- package/lib/typescript/src/api.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/index.d.ts +478 -0
- package/lib/typescript/src/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/styles.d.ts +318 -0
- package/lib/typescript/src/components/Button/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/components/dot.d.ts +7 -0
- package/lib/typescript/src/components/Carousel/components/dot.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/components/footer.d.ts +6 -0
- package/lib/typescript/src/components/Carousel/components/footer.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/components/list.d.ts +8 -0
- package/lib/typescript/src/components/Carousel/components/list.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/components/pagination.d.ts +2 -0
- package/lib/typescript/src/components/Carousel/components/pagination.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/components/see-all-button.d.ts +7 -0
- package/lib/typescript/src/components/Carousel/components/see-all-button.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/context.d.ts +4 -0
- package/lib/typescript/src/components/Carousel/context.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/index.d.ts +394 -0
- package/lib/typescript/src/components/Carousel/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/styles.d.ts +79 -0
- package/lib/typescript/src/components/Carousel/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Carousel/types.d.ts +40 -0
- package/lib/typescript/src/components/Carousel/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Checkbox/index.d.ts +10 -0
- package/lib/typescript/src/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Checkbox/styles.d.ts +154 -0
- package/lib/typescript/src/components/Checkbox/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/FAB/components/extended-fab.d.ts +3 -0
- package/lib/typescript/src/components/FAB/components/extended-fab.d.ts.map +1 -0
- package/lib/typescript/src/components/FAB/index.d.ts +8 -0
- package/lib/typescript/src/components/FAB/index.d.ts.map +1 -0
- package/lib/typescript/src/components/FAB/styles.d.ts +807 -0
- package/lib/typescript/src/components/FAB/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/FAB/utils.d.ts +19 -0
- package/lib/typescript/src/components/FAB/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/Flex/index.d.ts +2 -0
- package/lib/typescript/src/components/Flex/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Flex/styles.d.ts +135 -0
- package/lib/typescript/src/components/Flex/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/FormLabel/index.d.ts +3 -0
- package/lib/typescript/src/components/FormLabel/index.d.ts.map +1 -0
- package/lib/typescript/src/components/FormLabel/styles.d.ts +158 -0
- package/lib/typescript/src/components/FormLabel/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/components/input-control.d.ts +3 -0
- package/lib/typescript/src/components/Input/components/input-control.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/components/input-error.d.ts +3 -0
- package/lib/typescript/src/components/Input/components/input-error.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/components/input-field.d.ts +7 -0
- package/lib/typescript/src/components/Input/components/input-field.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/components/input-icon.d.ts +3 -0
- package/lib/typescript/src/components/Input/components/input-icon.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/components/input-password-toggle.d.ts +2 -0
- package/lib/typescript/src/components/Input/components/input-password-toggle.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/components/input-root.d.ts +9 -0
- package/lib/typescript/src/components/Input/components/input-root.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/context.d.ts +15 -0
- package/lib/typescript/src/components/Input/context.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/index.d.ts +17 -0
- package/lib/typescript/src/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/styles.d.ts +738 -0
- package/lib/typescript/src/components/Input/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/utils.d.ts +3 -0
- package/lib/typescript/src/components/Input/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/Margin/index.d.ts +2 -0
- package/lib/typescript/src/components/Margin/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Margin/styles.d.ts +144 -0
- package/lib/typescript/src/components/Margin/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/OTPInput/index.d.ts +18 -0
- package/lib/typescript/src/components/OTPInput/index.d.ts.map +1 -0
- package/lib/typescript/src/components/OTPInput/styles.d.ts +214 -0
- package/lib/typescript/src/components/OTPInput/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/OTPInput/utils.d.ts +3 -0
- package/lib/typescript/src/components/OTPInput/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/Padding/index.d.ts +2 -0
- package/lib/typescript/src/components/Padding/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Padding/styles.d.ts +144 -0
- package/lib/typescript/src/components/Padding/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Radio/components/radio-item.d.ts +8 -0
- package/lib/typescript/src/components/Radio/components/radio-item.d.ts.map +1 -0
- package/lib/typescript/src/components/Radio/context.d.ts +8 -0
- package/lib/typescript/src/components/Radio/context.d.ts.map +1 -0
- package/lib/typescript/src/components/Radio/index.d.ts +86 -0
- package/lib/typescript/src/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Radio/styles.d.ts +348 -0
- package/lib/typescript/src/components/Radio/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Radio/utils.d.ts +2 -0
- package/lib/typescript/src/components/Radio/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/Select/components/error-icon.d.ts +2 -0
- package/lib/typescript/src/components/Select/components/error-icon.d.ts.map +1 -0
- package/lib/typescript/src/components/Select/components/select-error.d.ts +3 -0
- package/lib/typescript/src/components/Select/components/select-error.d.ts.map +1 -0
- package/lib/typescript/src/components/Select/components/select-field.d.ts +5 -0
- package/lib/typescript/src/components/Select/components/select-field.d.ts.map +1 -0
- package/lib/typescript/src/components/Select/context.d.ts +7 -0
- package/lib/typescript/src/components/Select/context.d.ts.map +1 -0
- package/lib/typescript/src/components/Select/index.d.ts +11 -0
- package/lib/typescript/src/components/Select/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Select/styles.d.ts +315 -0
- package/lib/typescript/src/components/Select/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Skeleton/index.d.ts +11 -0
- package/lib/typescript/src/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Switch/index.d.ts +11 -0
- package/lib/typescript/src/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Switch/styles.d.ts +344 -0
- package/lib/typescript/src/components/Switch/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Switch/utils.d.ts +2 -0
- package/lib/typescript/src/components/Switch/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/Text/index.d.ts +3 -0
- package/lib/typescript/src/components/Text/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Text/styles.d.ts +169 -0
- package/lib/typescript/src/components/Text/styles.d.ts.map +1 -0
- package/lib/typescript/src/components.d.ts +20 -0
- package/lib/typescript/src/components.d.ts.map +1 -0
- package/lib/typescript/src/form.d.ts +7 -0
- package/lib/typescript/src/form.d.ts.map +1 -0
- package/lib/typescript/src/formValidators/ZodTypeValidator.d.ts +11 -0
- package/lib/typescript/src/formValidators/ZodTypeValidator.d.ts.map +1 -0
- package/lib/typescript/src/formValidators/index.d.ts +4 -0
- package/lib/typescript/src/formValidators/index.d.ts.map +1 -0
- package/lib/typescript/src/formValidators/types.d.ts +16 -0
- package/lib/typescript/src/formValidators/types.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useAppIsActive.d.ts +2 -0
- package/lib/typescript/src/hooks/useAppIsActive.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useAppSecurity.d.ts +8 -0
- package/lib/typescript/src/hooks/useAppSecurity.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNetworkStatus.d.ts +7 -0
- package/lib/typescript/src/hooks/useNetworkStatus.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useStatusBar.d.ts +7 -0
- package/lib/typescript/src/hooks/useStatusBar.d.ts.map +1 -0
- package/lib/typescript/src/hooks.d.ts +9 -0
- package/lib/typescript/src/hooks.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +45 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/libs/tanstack-form.d.ts +3 -0
- package/lib/typescript/src/libs/tanstack-form.d.ts.map +1 -0
- package/lib/typescript/src/utils/camelCase.d.ts +2 -0
- package/lib/typescript/src/utils/camelCase.d.ts.map +1 -0
- package/lib/typescript/src/utils/camelCaseJSONKeys.d.ts +3 -0
- package/lib/typescript/src/utils/camelCaseJSONKeys.d.ts.map +1 -0
- package/lib/typescript/src/utils/capitalizeWord.d.ts +3 -0
- package/lib/typescript/src/utils/capitalizeWord.d.ts.map +1 -0
- package/lib/typescript/src/utils/createLinkingPhoneNumberString.d.ts +3 -0
- package/lib/typescript/src/utils/createLinkingPhoneNumberString.d.ts.map +1 -0
- package/lib/typescript/src/utils/dateFormatters.d.ts +7 -0
- package/lib/typescript/src/utils/dateFormatters.d.ts.map +1 -0
- package/lib/typescript/src/utils/debounce.d.ts +2 -0
- package/lib/typescript/src/utils/debounce.d.ts.map +1 -0
- package/lib/typescript/src/utils/deepLinkParser.d.ts +7 -0
- package/lib/typescript/src/utils/deepLinkParser.d.ts.map +1 -0
- package/lib/typescript/src/utils/getAge.d.ts +2 -0
- package/lib/typescript/src/utils/getAge.d.ts.map +1 -0
- package/lib/typescript/src/utils/getOnlyNumbers.d.ts +2 -0
- package/lib/typescript/src/utils/getOnlyNumbers.d.ts.map +1 -0
- package/lib/typescript/src/utils/isArray.d.ts +2 -0
- package/lib/typescript/src/utils/isArray.d.ts.map +1 -0
- package/lib/typescript/src/utils/isObject.d.ts +2 -0
- package/lib/typescript/src/utils/isObject.d.ts.map +1 -0
- package/lib/typescript/src/utils/masks.d.ts +3 -0
- package/lib/typescript/src/utils/masks.d.ts.map +1 -0
- package/lib/typescript/src/utils/priceFormatter.d.ts +2 -0
- package/lib/typescript/src/utils/priceFormatter.d.ts.map +1 -0
- package/lib/typescript/src/utils/removeTextAccents.d.ts +3 -0
- package/lib/typescript/src/utils/removeTextAccents.d.ts.map +1 -0
- package/lib/typescript/src/utils/shadowStyledIos.d.ts +3 -0
- package/lib/typescript/src/utils/shadowStyledIos.d.ts.map +1 -0
- package/lib/typescript/src/utils/sortBy.d.ts +2 -0
- package/lib/typescript/src/utils/sortBy.d.ts.map +1 -0
- package/lib/typescript/src/utils/uniqBy.d.ts +2 -0
- package/lib/typescript/src/utils/uniqBy.d.ts.map +1 -0
- package/lib/typescript/src/utils/userFullnameInitialsExtractor.d.ts +3 -0
- package/lib/typescript/src/utils/userFullnameInitialsExtractor.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +23 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/package.json +234 -0
- package/src/api/axios-adapter.ts +272 -0
- package/src/api/errors.ts +113 -0
- package/src/api/index.ts +27 -0
- package/src/api/retry-strategy.ts +86 -0
- package/src/api/stores/auth-store.ts +26 -0
- package/src/api/types.ts +91 -0
- package/src/api.tsx +17 -0
- package/src/components/Button/index.tsx +35 -0
- package/src/components/Button/styles.ts +28 -0
- package/src/components/Carousel/components/dot.tsx +43 -0
- package/src/components/Carousel/components/footer.tsx +21 -0
- package/src/components/Carousel/components/list.tsx +81 -0
- package/src/components/Carousel/components/pagination.tsx +16 -0
- package/src/components/Carousel/components/see-all-button.tsx +25 -0
- package/src/components/Carousel/context.tsx +19 -0
- package/src/components/Carousel/index.tsx +191 -0
- package/src/components/Carousel/styles.ts +8 -0
- package/src/components/Carousel/types.ts +45 -0
- package/src/components/Checkbox/index.tsx +42 -0
- package/src/components/Checkbox/styles.ts +7 -0
- package/src/components/FAB/components/extended-fab.tsx +17 -0
- package/src/components/FAB/index.tsx +22 -0
- package/src/components/FAB/styles.ts +61 -0
- package/src/components/FAB/utils.ts +45 -0
- package/src/components/Flex/index.tsx +1 -0
- package/src/components/Flex/styles.ts +47 -0
- package/src/components/FormLabel/index.tsx +6 -0
- package/src/components/FormLabel/styles.ts +8 -0
- package/src/components/Input/components/input-control.tsx +20 -0
- package/src/components/Input/components/input-error.tsx +14 -0
- package/src/components/Input/components/input-field.tsx +55 -0
- package/src/components/Input/components/input-icon.tsx +7 -0
- package/src/components/Input/components/input-password-toggle.tsx +19 -0
- package/src/components/Input/components/input-root.tsx +55 -0
- package/src/components/Input/context.tsx +26 -0
- package/src/components/Input/index.tsx +17 -0
- package/src/components/Input/styles.ts +45 -0
- package/src/components/Input/utils.ts +27 -0
- package/src/components/Margin/index.tsx +1 -0
- package/src/components/Margin/styles.ts +23 -0
- package/src/components/OTPInput/index.tsx +116 -0
- package/src/components/OTPInput/styles.ts +23 -0
- package/src/components/OTPInput/utils.ts +31 -0
- package/src/components/Padding/index.tsx +1 -0
- package/src/components/Padding/styles.ts +23 -0
- package/src/components/Radio/components/radio-item.tsx +53 -0
- package/src/components/Radio/context.tsx +10 -0
- package/src/components/Radio/index.tsx +32 -0
- package/src/components/Radio/styles.ts +38 -0
- package/src/components/Radio/utils.ts +19 -0
- package/src/components/Select/components/error-icon.tsx +3 -0
- package/src/components/Select/components/select-error.tsx +14 -0
- package/src/components/Select/components/select-field.tsx +72 -0
- package/src/components/Select/context.tsx +17 -0
- package/src/components/Select/index.tsx +24 -0
- package/src/components/Select/styles.ts +15 -0
- package/src/components/Skeleton/index.tsx +60 -0
- package/src/components/Switch/index.tsx +61 -0
- package/src/components/Switch/styles.ts +32 -0
- package/src/components/Switch/utils.ts +15 -0
- package/src/components/Text/index.tsx +2 -0
- package/src/components/Text/styles.ts +44 -0
- package/src/components.tsx +20 -0
- package/src/form.tsx +7 -0
- package/src/formValidators/ZodTypeValidator.ts +58 -0
- package/src/formValidators/index.ts +8 -0
- package/src/formValidators/types.ts +21 -0
- package/src/hooks/useAppIsActive.ts +28 -0
- package/src/hooks/useAppSecurity.tsx +35 -0
- package/src/hooks/useNetworkStatus.ts +75 -0
- package/src/hooks/useStatusBar.ts +34 -0
- package/src/hooks.tsx +9 -0
- package/src/index.tsx +50 -0
- package/src/libs/tanstack-form.tsx +3 -0
- package/src/utils/camelCase.ts +6 -0
- package/src/utils/camelCaseJSONKeys.ts +31 -0
- package/src/utils/capitalizeWord.ts +4 -0
- package/src/utils/createLinkingPhoneNumberString.ts +13 -0
- package/src/utils/dateFormatters.ts +48 -0
- package/src/utils/debounce.ts +15 -0
- package/src/utils/deepLinkParser.ts +88 -0
- package/src/utils/getAge.ts +12 -0
- package/src/utils/getOnlyNumbers.ts +1 -0
- package/src/utils/isArray.ts +4 -0
- package/src/utils/isObject.ts +4 -0
- package/src/utils/masks.ts +3 -0
- package/src/utils/priceFormatter.ts +11 -0
- package/src/utils/removeTextAccents.ts +4 -0
- package/src/utils/shadowStyledIos.ts +6 -0
- package/src/utils/sortBy.ts +21 -0
- package/src/utils/uniqBy.ts +20 -0
- package/src/utils/userFullnameInitialsExtractor.ts +23 -0
- package/src/utils.tsx +23 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utils module entry point.
|
|
5
|
+
* Exports all utility functions from the design system.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export { camelCase } from "./utils/camelCase.js";
|
|
9
|
+
export { camelCaseJSONKeys } from "./utils/camelCaseJSONKeys.js";
|
|
10
|
+
export { capitalizeWord } from "./utils/capitalizeWord.js";
|
|
11
|
+
export { createLinkingPhoneNumberString } from "./utils/createLinkingPhoneNumberString.js";
|
|
12
|
+
export * from "./utils/dateFormatters.js";
|
|
13
|
+
export { debounce } from "./utils/debounce.js";
|
|
14
|
+
export { deepLinkParser } from "./utils/deepLinkParser.js";
|
|
15
|
+
export { getAge } from "./utils/getAge.js";
|
|
16
|
+
export { getOnlyNumbers } from "./utils/getOnlyNumbers.js";
|
|
17
|
+
export { isArray } from "./utils/isArray.js";
|
|
18
|
+
export { isObject } from "./utils/isObject.js";
|
|
19
|
+
export { Masks } from "./utils/masks.js";
|
|
20
|
+
export { priceFormatter } from "./utils/priceFormatter.js";
|
|
21
|
+
export { removeTextAccents } from "./utils/removeTextAccents.js";
|
|
22
|
+
export { shadowStyledIos } from "./utils/shadowStyledIos.js";
|
|
23
|
+
export { sortBy } from "./utils/sortBy.js";
|
|
24
|
+
export { uniqBy } from "./utils/uniqBy.js";
|
|
25
|
+
export { userFullnameInitialsExtractor } from "./utils/userFullnameInitialsExtractor.js";
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["camelCase","camelCaseJSONKeys","capitalizeWord","createLinkingPhoneNumberString","debounce","deepLinkParser","getAge","getOnlyNumbers","isArray","isObject","Masks","priceFormatter","removeTextAccents","shadowStyledIos","sortBy","uniqBy","userFullnameInitialsExtractor"],"sourceRoot":"../../src","sources":["utils.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,QAAQ,sBAAmB;AAC7C,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,8BAA8B,QAAQ,2CAAwC;AACvF,cAAc,2BAAwB;AACtC,SAASC,QAAQ,QAAQ,qBAAkB;AAC3C,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,MAAM,QAAQ,mBAAgB;AACvC,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,OAAO,QAAQ,oBAAiB;AACzC,SAASC,QAAQ,QAAQ,qBAAkB;AAC3C,SAASC,KAAK,QAAQ,kBAAe;AACrC,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,eAAe,QAAQ,4BAAyB;AACzD,SAASC,MAAM,QAAQ,mBAAgB;AACvC,SAASC,MAAM,QAAQ,mBAAgB;AACvC,SAASC,6BAA6B,QAAQ,0CAAuC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type AxiosRequestConfig } from 'axios';
|
|
2
|
+
import type { ApiConfig, ApiResponse, IHttpAdapter } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Axios-based HTTP adapter implementation
|
|
5
|
+
* Implements retry logic, error handling, and token management
|
|
6
|
+
*/
|
|
7
|
+
export declare class AxiosAdapter implements IHttpAdapter {
|
|
8
|
+
private readonly axiosInstance;
|
|
9
|
+
private readonly retryConfig;
|
|
10
|
+
constructor(config: ApiConfig);
|
|
11
|
+
/**
|
|
12
|
+
* Sets up request interceptor to automatically add auth token
|
|
13
|
+
*/
|
|
14
|
+
private setupRequestInterceptor;
|
|
15
|
+
/**
|
|
16
|
+
* Maps axios error to appropriate custom error type
|
|
17
|
+
*/
|
|
18
|
+
private mapError;
|
|
19
|
+
/**
|
|
20
|
+
* Transforms axios response to standardized ApiResponse format
|
|
21
|
+
*/
|
|
22
|
+
private transformResponse;
|
|
23
|
+
/**
|
|
24
|
+
* Transforms error to standardized ApiResponse format
|
|
25
|
+
*/
|
|
26
|
+
private transformError;
|
|
27
|
+
/**
|
|
28
|
+
* Executes HTTP request with retry logic and error handling
|
|
29
|
+
*/
|
|
30
|
+
private executeRequest;
|
|
31
|
+
/**
|
|
32
|
+
* Performs GET request
|
|
33
|
+
*/
|
|
34
|
+
get<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
35
|
+
/**
|
|
36
|
+
* Performs POST request
|
|
37
|
+
*/
|
|
38
|
+
post<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
39
|
+
/**
|
|
40
|
+
* Performs PUT request
|
|
41
|
+
*/
|
|
42
|
+
put<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
43
|
+
/**
|
|
44
|
+
* Performs DELETE request
|
|
45
|
+
*/
|
|
46
|
+
delete<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
47
|
+
/**
|
|
48
|
+
* Adds authentication token to store
|
|
49
|
+
* Token will be automatically included in all subsequent requests
|
|
50
|
+
*/
|
|
51
|
+
addToken(token: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Removes authentication token from store
|
|
54
|
+
*/
|
|
55
|
+
removeToken(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get token from store
|
|
58
|
+
*/
|
|
59
|
+
getToken(): string | null;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=axios-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axios-adapter.d.ts","sourceRoot":"","sources":["../../../../src/api/axios-adapter.ts"],"names":[],"mappings":"AAAA,OAAc,EAGZ,KAAK,kBAAkB,EAExB,MAAM,OAAO,CAAC;AAYf,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;gBAE9B,MAAM,EAAE,SAAS;IAuB7B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAe/B;;OAEG;IACH,OAAO,CAAC,QAAQ;IA0DhB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IASzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;YACW,cAAc;IA+B5B;;OAEG;IACG,GAAG,CAAC,CAAC,GAAG,OAAO,EACnB,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAQ1B;;OAEG;IACG,IAAI,CAAC,CAAC,GAAG,OAAO,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAQ1B;;OAEG;IACG,GAAG,CAAC,CAAC,GAAG,OAAO,EACnB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAQ1B;;OAEG;IACG,MAAM,CAAC,CAAC,GAAG,OAAO,EACtB,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAQ1B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B;;OAEG;IACH,WAAW,IAAI,IAAI;IAInB;;OAEG;IACH,QAAQ,IAAI,MAAM,GAAG,IAAI;CAG1B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for all API errors
|
|
3
|
+
* Provides common structure and debugging information
|
|
4
|
+
*/
|
|
5
|
+
export declare class ApiError extends Error {
|
|
6
|
+
readonly statusCode: number;
|
|
7
|
+
readonly url?: string;
|
|
8
|
+
readonly method?: string;
|
|
9
|
+
readonly timestamp: Date;
|
|
10
|
+
constructor(message: string, statusCode: number, url?: string, method?: string);
|
|
11
|
+
/**
|
|
12
|
+
* Returns a formatted error message for debugging
|
|
13
|
+
*/
|
|
14
|
+
toDebugString(): string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Network-related errors (no internet, DNS failure, timeout)
|
|
18
|
+
* HTTP Status: N/A (network layer)
|
|
19
|
+
*/
|
|
20
|
+
export declare class NetworkError extends ApiError {
|
|
21
|
+
constructor(message: string, url?: string, method?: string);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Authentication errors (401, 403)
|
|
25
|
+
* Client lacks valid credentials or permissions
|
|
26
|
+
*/
|
|
27
|
+
export declare class AuthError extends ApiError {
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Client validation errors (400, 422)
|
|
31
|
+
* Request malformed or validation failed
|
|
32
|
+
*/
|
|
33
|
+
export declare class ValidationError extends ApiError {
|
|
34
|
+
readonly validationErrors?: Record<string, string[]>;
|
|
35
|
+
constructor(message: string, statusCode: number, url?: string, method?: string, validationErrors?: Record<string, string[]>);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Server errors (500, 502, 503, 504)
|
|
39
|
+
* Something went wrong on the server
|
|
40
|
+
*/
|
|
41
|
+
export declare class ServerError extends ApiError {
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Request timeout errors
|
|
45
|
+
* Request took too long to complete
|
|
46
|
+
*/
|
|
47
|
+
export declare class TimeoutError extends ApiError {
|
|
48
|
+
constructor(message: string, url?: string, method?: string);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Resource not found errors (404)
|
|
52
|
+
*/
|
|
53
|
+
export declare class NotFoundError extends ApiError {
|
|
54
|
+
constructor(message: string, url?: string, method?: string);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Rate limit errors (429)
|
|
58
|
+
*/
|
|
59
|
+
export declare class RateLimitError extends ApiError {
|
|
60
|
+
readonly retryAfter?: number;
|
|
61
|
+
constructor(message: string, url?: string, method?: string, retryAfter?: number);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/api/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChC,SAAgB,SAAS,EAAE,IAAI,CAAC;gBAG9B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM;IAejB;;OAEG;IACH,aAAa,IAAI,MAAM;CAGxB;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAG3D;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,QAAQ;CAAG;AAE1C;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C,SAAgB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;gBAG1D,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;CAK9C;AAED;;;GAGG;AACH,qBAAa,WAAY,SAAQ,QAAQ;CAAG;AAE5C;;;GAGG;AACH,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAG3D;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,QAAQ;gBAC7B,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAG3D;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAGlC,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM;CAKtB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AxiosAdapter } from './axios-adapter';
|
|
2
|
+
/**
|
|
3
|
+
* Default API request instance
|
|
4
|
+
* Pre-configured with default settings
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { apiRequest } from '@navegarti/rn-design-system/api';
|
|
9
|
+
*
|
|
10
|
+
* const response = await apiRequest.get<User>('/users/123');
|
|
11
|
+
* if (response.success) {
|
|
12
|
+
* console.log(response.data);
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const apiRequest: AxiosAdapter;
|
|
17
|
+
export { AxiosAdapter } from './axios-adapter';
|
|
18
|
+
export * from './errors';
|
|
19
|
+
export { useAuthStore } from './stores/auth-store';
|
|
20
|
+
export * from './types';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,cAIrB,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AxiosError } from 'axios';
|
|
2
|
+
import type { RetryConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates exponential backoff delay
|
|
5
|
+
* Formula: min(baseDelay * (2 ^ attempt), maxDelay)
|
|
6
|
+
*/
|
|
7
|
+
export declare function calculateBackoffDelay(attempt: number, baseDelay: number, maxDelay: number): number;
|
|
8
|
+
/**
|
|
9
|
+
* Determines if an error is retryable based on configuration
|
|
10
|
+
*/
|
|
11
|
+
export declare function isRetryableError(error: AxiosError, retryConfig: RetryConfig): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Sleep utility for retry delays
|
|
14
|
+
*/
|
|
15
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Executes a request with retry logic
|
|
18
|
+
* @template T - The expected response type
|
|
19
|
+
*/
|
|
20
|
+
export declare function executeWithRetry<T>(requestFn: () => Promise<T>, retryConfig: RetryConfig, onRetry?: (attempt: number, delay: number, error: AxiosError) => void): Promise<T>;
|
|
21
|
+
//# sourceMappingURL=retry-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry-strategy.d.ts","sourceRoot":"","sources":["../../../../src/api/retry-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,WAAW,GACvB,OAAO,CAUT;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,GACpE,OAAO,CAAC,CAAC,CAAC,CAkCZ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication store state
|
|
3
|
+
*/
|
|
4
|
+
interface AuthState {
|
|
5
|
+
token: string | null;
|
|
6
|
+
setToken: (token: string) => void;
|
|
7
|
+
clearToken: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Zustand store for managing authentication token
|
|
11
|
+
* Token is stored in memory and used for Authorization header
|
|
12
|
+
*/
|
|
13
|
+
export declare const useAuthStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AuthState>>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=auth-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-store.d.ts","sourceRoot":"","sources":["../../../../../src/api/stores/auth-store.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,wEAUtB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* Standardized API response format
|
|
4
|
+
* @template T - The type of data returned on success
|
|
5
|
+
*/
|
|
6
|
+
export interface ApiResponse<T = unknown> {
|
|
7
|
+
success: boolean;
|
|
8
|
+
data: T | null;
|
|
9
|
+
statusCode: number;
|
|
10
|
+
error: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Configuration options for API adapter
|
|
14
|
+
*/
|
|
15
|
+
export interface ApiConfig {
|
|
16
|
+
baseURL: string;
|
|
17
|
+
timeout?: number;
|
|
18
|
+
retryAttempts?: number;
|
|
19
|
+
headers?: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Interface for HTTP client adapter
|
|
23
|
+
* Defines the contract all HTTP adapters must implement
|
|
24
|
+
*/
|
|
25
|
+
export interface IHttpAdapter {
|
|
26
|
+
/**
|
|
27
|
+
* Performs a GET request
|
|
28
|
+
* @template T - Expected response data type
|
|
29
|
+
*/
|
|
30
|
+
get<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
31
|
+
/**
|
|
32
|
+
* Performs a POST request
|
|
33
|
+
* @template T - Expected response data type
|
|
34
|
+
*/
|
|
35
|
+
post<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
36
|
+
/**
|
|
37
|
+
* Performs a PUT request
|
|
38
|
+
* @template T - Expected response data type
|
|
39
|
+
*/
|
|
40
|
+
put<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
41
|
+
/**
|
|
42
|
+
* Performs a DELETE request
|
|
43
|
+
* @template T - Expected response data type
|
|
44
|
+
*/
|
|
45
|
+
delete<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
46
|
+
/**
|
|
47
|
+
* Adds authentication token to all subsequent requests
|
|
48
|
+
*/
|
|
49
|
+
addToken(token: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Removes authentication token from requests
|
|
52
|
+
*/
|
|
53
|
+
removeToken(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Get token from store
|
|
56
|
+
*/
|
|
57
|
+
getToken(): string | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Retry configuration
|
|
61
|
+
*/
|
|
62
|
+
export interface RetryConfig {
|
|
63
|
+
maxAttempts: number;
|
|
64
|
+
baseDelay: number;
|
|
65
|
+
maxDelay: number;
|
|
66
|
+
retryableStatusCodes: number[];
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,GAAG,CAAC,CAAC,GAAG,OAAO,EACb,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3B;;;OAGG;IACH,IAAI,CAAC,CAAC,GAAG,OAAO,EACd,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3B;;;OAGG;IACH,GAAG,CAAC,CAAC,GAAG,OAAO,EACb,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3B;;;OAGG;IACH,MAAM,CAAC,CAAC,GAAG,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB;;OAEG;IACH,QAAQ,IAAI,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module entry point.
|
|
3
|
+
* Exports HTTP client, types, errors, and stores.
|
|
4
|
+
*/
|
|
5
|
+
export { ApiError, AuthError, NetworkError, NotFoundError, RateLimitError, ServerError, TimeoutError, ValidationError, } from './api/errors';
|
|
6
|
+
export { AxiosAdapter, apiRequest, useAuthStore } from './api/index';
|
|
7
|
+
export type { ApiConfig, ApiResponse, IHttpAdapter } from './api/types';
|
|
8
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/api.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACrE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|