@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
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucas Rodrigues Paixão
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @navegarti/rn-design-system
|
|
2
|
+
|
|
3
|
+
Components and functions to help navegar projects
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @navegarti/rn-design-system
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { multiply } from '@navegarti/rn-design-system';
|
|
18
|
+
|
|
19
|
+
// ...
|
|
20
|
+
|
|
21
|
+
const result = await multiply(3, 7);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Contributing
|
|
26
|
+
|
|
27
|
+
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
28
|
+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
29
|
+
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
MIT
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import { AuthError, NetworkError, NotFoundError, RateLimitError, ServerError, TimeoutError, ValidationError } from "./errors.js";
|
|
5
|
+
import { executeWithRetry } from "./retry-strategy.js";
|
|
6
|
+
import { useAuthStore } from "./stores/auth-store.js";
|
|
7
|
+
/**
|
|
8
|
+
* Axios-based HTTP adapter implementation
|
|
9
|
+
* Implements retry logic, error handling, and token management
|
|
10
|
+
*/
|
|
11
|
+
export class AxiosAdapter {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
// Initialize axios instance with configuration
|
|
14
|
+
this.axiosInstance = axios.create({
|
|
15
|
+
baseURL: config.baseURL,
|
|
16
|
+
timeout: config.timeout ?? 30000,
|
|
17
|
+
// 30 seconds default
|
|
18
|
+
headers: {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
...config.headers
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Configure retry behavior
|
|
25
|
+
this.retryConfig = {
|
|
26
|
+
maxAttempts: config.retryAttempts ?? 3,
|
|
27
|
+
baseDelay: 1000,
|
|
28
|
+
// 1 second
|
|
29
|
+
maxDelay: 10000,
|
|
30
|
+
// 10 seconds
|
|
31
|
+
retryableStatusCodes: [408, 429, 500, 502, 503, 504]
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Setup request interceptor to inject auth token
|
|
35
|
+
this.setupRequestInterceptor();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sets up request interceptor to automatically add auth token
|
|
40
|
+
*/
|
|
41
|
+
setupRequestInterceptor() {
|
|
42
|
+
this.axiosInstance.interceptors.request.use(config => {
|
|
43
|
+
const token = useAuthStore.getState().token;
|
|
44
|
+
if (token && config.headers) {
|
|
45
|
+
config.headers.Authorization = `Bearer ${token}`;
|
|
46
|
+
}
|
|
47
|
+
return config;
|
|
48
|
+
}, error => Promise.reject(error));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Maps axios error to appropriate custom error type
|
|
53
|
+
*/
|
|
54
|
+
mapError(error, url, method) {
|
|
55
|
+
// Network errors (no response received)
|
|
56
|
+
if (!error.response) {
|
|
57
|
+
if (error.code === 'ECONNABORTED' || error.message.includes('timeout')) {
|
|
58
|
+
return new TimeoutError('Request timeout - server took too long to respond', url, method);
|
|
59
|
+
}
|
|
60
|
+
return new NetworkError(error.message || 'Network error - please check your connection', url, method);
|
|
61
|
+
}
|
|
62
|
+
const statusCode = error.response.status;
|
|
63
|
+
const responseData = error.response.data;
|
|
64
|
+
const message = responseData?.message || error.message || 'An error occurred';
|
|
65
|
+
|
|
66
|
+
// Map status codes to error types
|
|
67
|
+
switch (true) {
|
|
68
|
+
case statusCode === 401 || statusCode === 403:
|
|
69
|
+
return new AuthError(message, statusCode, url, method);
|
|
70
|
+
case statusCode === 404:
|
|
71
|
+
return new NotFoundError(message, url, method);
|
|
72
|
+
case statusCode === 429:
|
|
73
|
+
return new RateLimitError(message, url, method, Number(error.response.headers['retry-after']));
|
|
74
|
+
case statusCode === 400 || statusCode === 422:
|
|
75
|
+
return new ValidationError(message, statusCode, url, method, responseData?.errors);
|
|
76
|
+
case statusCode >= 500:
|
|
77
|
+
return new ServerError(message, statusCode, url, method);
|
|
78
|
+
default:
|
|
79
|
+
return new NetworkError(message, url, method);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Transforms axios response to standardized ApiResponse format
|
|
85
|
+
*/
|
|
86
|
+
transformResponse(response) {
|
|
87
|
+
return {
|
|
88
|
+
success: true,
|
|
89
|
+
data: response.data,
|
|
90
|
+
statusCode: response.status,
|
|
91
|
+
error: ''
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Transforms error to standardized ApiResponse format
|
|
97
|
+
*/
|
|
98
|
+
transformError(error, statusCode = 0) {
|
|
99
|
+
return {
|
|
100
|
+
success: false,
|
|
101
|
+
data: null,
|
|
102
|
+
statusCode,
|
|
103
|
+
error: error.message
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Executes HTTP request with retry logic and error handling
|
|
109
|
+
*/
|
|
110
|
+
async executeRequest(requestFn, url, method) {
|
|
111
|
+
try {
|
|
112
|
+
const response = await executeWithRetry(requestFn, this.retryConfig, (attempt, delay, error) => {
|
|
113
|
+
console.log(`[API Retry] Attempt ${attempt} failed, retrying in ${delay}ms...`, error.message);
|
|
114
|
+
});
|
|
115
|
+
return this.transformResponse(response);
|
|
116
|
+
} catch (error) {
|
|
117
|
+
const mappedError = this.mapError(error, url, method);
|
|
118
|
+
const statusCode = mappedError instanceof NetworkError ? 0 : mappedError.statusCode ?? 0;
|
|
119
|
+
console.error('[API Error]', mappedError);
|
|
120
|
+
return this.transformError(mappedError, statusCode);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Performs GET request
|
|
126
|
+
*/
|
|
127
|
+
async get(url, config) {
|
|
128
|
+
return this.executeRequest(() => this.axiosInstance.get(url, config), url, 'GET');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Performs POST request
|
|
133
|
+
*/
|
|
134
|
+
async post(url, data, config) {
|
|
135
|
+
return this.executeRequest(() => this.axiosInstance.post(url, data, config), url, 'POST');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Performs PUT request
|
|
140
|
+
*/
|
|
141
|
+
async put(url, data, config) {
|
|
142
|
+
return this.executeRequest(() => this.axiosInstance.put(url, data, config), url, 'PUT');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Performs DELETE request
|
|
147
|
+
*/
|
|
148
|
+
async delete(url, config) {
|
|
149
|
+
return this.executeRequest(() => this.axiosInstance.delete(url, config), url, 'DELETE');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Adds authentication token to store
|
|
154
|
+
* Token will be automatically included in all subsequent requests
|
|
155
|
+
*/
|
|
156
|
+
addToken(token) {
|
|
157
|
+
useAuthStore.getState().setToken(token);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Removes authentication token from store
|
|
162
|
+
*/
|
|
163
|
+
removeToken() {
|
|
164
|
+
useAuthStore.getState().clearToken();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Get token from store
|
|
169
|
+
*/
|
|
170
|
+
getToken() {
|
|
171
|
+
return useAuthStore.getState().token;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=axios-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["axios","AuthError","NetworkError","NotFoundError","RateLimitError","ServerError","TimeoutError","ValidationError","executeWithRetry","useAuthStore","AxiosAdapter","constructor","config","axiosInstance","create","baseURL","timeout","headers","retryConfig","maxAttempts","retryAttempts","baseDelay","maxDelay","retryableStatusCodes","setupRequestInterceptor","interceptors","request","use","token","getState","Authorization","error","Promise","reject","mapError","url","method","response","code","message","includes","statusCode","status","responseData","data","Number","errors","transformResponse","success","transformError","executeRequest","requestFn","attempt","delay","console","log","mappedError","get","post","put","delete","addToken","setToken","removeToken","clearToken","getToken"],"sourceRoot":"../../../src","sources":["api/axios-adapter.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAKL,OAAO;AACd,SACEC,SAAS,EACTC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,YAAY,EACZC,eAAe,QACV,aAAU;AACjB,SAASC,gBAAgB,QAAQ,qBAAkB;AACnD,SAASC,YAAY,QAAQ,wBAAqB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,CAACD,KAAK;EACtC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Base class for all API errors
|
|
5
|
+
* Provides common structure and debugging information
|
|
6
|
+
*/
|
|
7
|
+
export class ApiError extends Error {
|
|
8
|
+
constructor(message, statusCode, url, method) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = this.constructor.name;
|
|
11
|
+
this.statusCode = statusCode;
|
|
12
|
+
this.url = url;
|
|
13
|
+
this.method = method;
|
|
14
|
+
this.timestamp = new Date();
|
|
15
|
+
|
|
16
|
+
// Maintains proper stack trace for where our error was thrown (only available on V8)
|
|
17
|
+
if (Error.captureStackTrace) {
|
|
18
|
+
Error.captureStackTrace(this, this.constructor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns a formatted error message for debugging
|
|
24
|
+
*/
|
|
25
|
+
toDebugString() {
|
|
26
|
+
return `[${this.name}] ${this.message}\nStatus: ${this.statusCode}\nURL: ${this.url}\nMethod: ${this.method}\nTime: ${this.timestamp.toISOString()}`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Network-related errors (no internet, DNS failure, timeout)
|
|
32
|
+
* HTTP Status: N/A (network layer)
|
|
33
|
+
*/
|
|
34
|
+
export class NetworkError extends ApiError {
|
|
35
|
+
constructor(message, url, method) {
|
|
36
|
+
super(message, 0, url, method);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Authentication errors (401, 403)
|
|
42
|
+
* Client lacks valid credentials or permissions
|
|
43
|
+
*/
|
|
44
|
+
export class AuthError extends ApiError {}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Client validation errors (400, 422)
|
|
48
|
+
* Request malformed or validation failed
|
|
49
|
+
*/
|
|
50
|
+
export class ValidationError extends ApiError {
|
|
51
|
+
constructor(message, statusCode, url, method, validationErrors) {
|
|
52
|
+
super(message, statusCode, url, method);
|
|
53
|
+
this.validationErrors = validationErrors;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Server errors (500, 502, 503, 504)
|
|
59
|
+
* Something went wrong on the server
|
|
60
|
+
*/
|
|
61
|
+
export class ServerError extends ApiError {}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Request timeout errors
|
|
65
|
+
* Request took too long to complete
|
|
66
|
+
*/
|
|
67
|
+
export class TimeoutError extends ApiError {
|
|
68
|
+
constructor(message, url, method) {
|
|
69
|
+
super(message, 408, url, method);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Resource not found errors (404)
|
|
75
|
+
*/
|
|
76
|
+
export class NotFoundError extends ApiError {
|
|
77
|
+
constructor(message, url, method) {
|
|
78
|
+
super(message, 404, url, method);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Rate limit errors (429)
|
|
84
|
+
*/
|
|
85
|
+
export class RateLimitError extends ApiError {
|
|
86
|
+
constructor(message, url, method, retryAfter) {
|
|
87
|
+
super(message, 429, url, method);
|
|
88
|
+
this.retryAfter = retryAfter;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ApiError","Error","constructor","message","statusCode","url","method","name","timestamp","Date","captureStackTrace","toDebugString","toISOString","NetworkError","AuthError","ValidationError","validationErrors","ServerError","TimeoutError","NotFoundError","RateLimitError","retryAfter"],"sourceRoot":"../../../src","sources":["api/errors.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,SAASC,KAAK,CAAC;EAMlCC,WAAWA,CACTC,OAAe,EACfC,UA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,OAAO,MAAMC,WAAW,SAASjB,QAAQ,CAAC;;AAE1C;AACA;AACA;AACA;AACA,OAAO,MAAMkB,YAAY,SAASlB,QAAQ,CAAC;EACzCE,WAAWA,CAACC,OAAe,EAAEE,GAAY,EAAEC,MAAe,EAAE;IAC1D,KAAK,CAACH,OAAO,EAAE,GAAG,EAAEE,GAAG,EAAEC,MAAM,CAAC;EAClC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMa,aAAa,SAASnB,QAAQ,CAAC;EAC1CE,WAAWA,CAACC,OAAe,EAAEE,GAAY,EAAEC,MAAe,EAAE;IAC1D,KAAK,CAACH,OAAO,EAAE,GAAG,EAAEE,GAAG,EAAEC,MAAM,CAAC;EAClC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMc,cAAc,SAASpB,QAAQ,CAAC;EAG3CE,WAAWA,CACTC,OAAe,EACfE,GAAY,EACZC,MAAe,EACfe,UAAmB,EACnB;IACA,KAAK,CAAClB,OAAO,EAAE,GAAG,EAAEE,GAAG,EAAEC,MAAM,CAAC;IAChC,IAAI,CAACe,UAAU,GAAGA,UAAU;EAC9B;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { AxiosAdapter } from "./axios-adapter.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Default API request instance
|
|
7
|
+
* Pre-configured with default settings
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { apiRequest } from '@navegarti/rn-design-system/api';
|
|
12
|
+
*
|
|
13
|
+
* const response = await apiRequest.get<User>('/users/123');
|
|
14
|
+
* if (response.success) {
|
|
15
|
+
* console.log(response.data);
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const apiRequest = new AxiosAdapter({
|
|
20
|
+
baseURL: 'https://api.example.com',
|
|
21
|
+
// Will be overridden by consumers
|
|
22
|
+
timeout: 30000,
|
|
23
|
+
retryAttempts: 3
|
|
24
|
+
});
|
|
25
|
+
export { AxiosAdapter } from "./axios-adapter.js";
|
|
26
|
+
export * from "./errors.js";
|
|
27
|
+
export { useAuthStore } from "./stores/auth-store.js";
|
|
28
|
+
// Re-export types and classes for consumer use
|
|
29
|
+
export * from "./types.js";
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AxiosAdapter","apiRequest","baseURL","timeout","retryAttempts","useAuthStore"],"sourceRoot":"../../../src","sources":["api/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,oBAAiB;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,IAAID,YAAY,CAAC;EACzCE,OAAO,EAAE,yBAAyB;EAAE;EACpCC,OAAO,EAAE,KAAK;EACdC,aAAa,EAAE;AACjB,CAAC,CAAC;AAEF,SAASJ,YAAY,QAAQ,oBAAiB;AAC9C,cAAc,aAAU;AACxB,SAASK,YAAY,QAAQ,wBAAqB;AAClD;AACA,cAAc,YAAS","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Calculates exponential backoff delay
|
|
5
|
+
* Formula: min(baseDelay * (2 ^ attempt), maxDelay)
|
|
6
|
+
*/
|
|
7
|
+
export function calculateBackoffDelay(attempt, baseDelay, maxDelay) {
|
|
8
|
+
const exponentialDelay = baseDelay * 2 ** attempt;
|
|
9
|
+
return Math.min(exponentialDelay, maxDelay);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Determines if an error is retryable based on configuration
|
|
14
|
+
*/
|
|
15
|
+
export function isRetryableError(error, retryConfig) {
|
|
16
|
+
// Network errors (no response) are always retryable
|
|
17
|
+
if (!error.response) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
const statusCode = error.response.status;
|
|
21
|
+
|
|
22
|
+
// Check if status code is in retryable list
|
|
23
|
+
return retryConfig.retryableStatusCodes.includes(statusCode);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sleep utility for retry delays
|
|
28
|
+
*/
|
|
29
|
+
export function sleep(ms) {
|
|
30
|
+
return new Promise(resolve => {
|
|
31
|
+
setTimeout(resolve, ms);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Executes a request with retry logic
|
|
37
|
+
* @template T - The expected response type
|
|
38
|
+
*/
|
|
39
|
+
export async function executeWithRetry(requestFn, retryConfig, onRetry) {
|
|
40
|
+
let lastError;
|
|
41
|
+
for (let attempt = 0; attempt < retryConfig.maxAttempts; attempt++) {
|
|
42
|
+
try {
|
|
43
|
+
return await requestFn();
|
|
44
|
+
} catch (error) {
|
|
45
|
+
const axiosError = error;
|
|
46
|
+
lastError = axiosError;
|
|
47
|
+
|
|
48
|
+
// Don't retry if not retryable or if this was the last attempt
|
|
49
|
+
const isLastAttempt = attempt === retryConfig.maxAttempts - 1;
|
|
50
|
+
if (!isRetryableError(axiosError, retryConfig) || isLastAttempt) {
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Calculate delay and wait before retrying
|
|
55
|
+
const delay = calculateBackoffDelay(attempt, retryConfig.baseDelay, retryConfig.maxDelay);
|
|
56
|
+
|
|
57
|
+
// Notify callback if provided
|
|
58
|
+
if (onRetry) {
|
|
59
|
+
onRetry(attempt + 1, delay, axiosError);
|
|
60
|
+
}
|
|
61
|
+
await sleep(delay);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// This should never be reached, but TypeScript needs it
|
|
66
|
+
throw lastError;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=retry-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["calculateBackoffDelay","attempt","baseDelay","maxDelay","exponentialDelay","Math","min","isRetryableError","error","retryConfig","response","statusCode","status","retryableStatusCodes","includes","sleep","ms","Promise","resolve","setTimeout","executeWithRetry","requestFn","onRetry","lastError","maxAttempts","axiosError","isLastAttempt","delay"],"sourceRoot":"../../../src","sources":["api/retry-strategy.ts"],"mappings":";;AAGA;AACA;AACA;AACA;AACA,OAAO,SAASA,qBAAqBA,CACnCC,OAAe,EACfC,SAAiB,EACjBC,QAAgB,EACR;EACR,MAAMC,gBAAgB,GAAGF,SAAS,GAAG,CAAC,IAAID,OAAO;EACjD,OAAOI,IAAI,CAACC,GAAG,CAACF,gBAAgB,EAAED,QAAQ,CAAC;AAC7C;;AAEA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAC9BC,KAAiB,EACjBC,WAAwB,EACf;EACT;EACA,IAAI,CAACD,KAAK,CAACE,QAAQ,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,MAAMC,UAAU,GAAGH,KAAK,CAACE,QAAQ,CAACE,MAAM;;EAExC;EACA,OAAOH,WAAW,CAACI,oBAAoB,CAACC,QAAQ,CAACH,UAAU,CAAC;AAC9D;;AAEA;AACA;AACA;AACA,OAAO,SAASI,KAAKA,CAACC,EAAU,EAAiB;EAC/C,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;IAC9BC,UAAU,CAACD,OAAO,EAAEF,EAAE,CAAC;EACzB,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA,OAAO,eAAeI,gBAAgBA,CACpCC,SAA2B,EAC3BZ,WAAwB,EACxBa,OAAqE,EACzD;EACZ,IAAIC,SAAiC;EAErC,KAAK,IAAItB,OAAO,GAAG,CAAC,EAAEA,OAAO,GAAGQ,WAAW,CAACe,WAAW,EAAEvB,OAAO,EAAE,EAAE;IAClE,IAAI;MACF,OAAO,MAAMoB,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC,OAAOb,KAAK,EAAE;MACd,MAAMiB,UAAU,GAAGjB,KAAmB;MACtCe,SAAS,GAAGE,UAAU;;MAEtB;MACA,MAAMC,aAAa,GAAGzB,OAAO,KAAKQ,WAAW,CAACe,WAAW,GAAG,CAAC;MAC7D,IAAI,CAACjB,gBAAgB,CAACkB,UAAU,EAAEhB,WAAW,CAAC,IAAIiB,aAAa,EAAE;QAC/D,MAAMlB,KAAK;MACb;;MAEA;MACA,MAAMmB,KAAK,GAAG3B,qBAAqB,CACjCC,OAAO,EACPQ,WAAW,CAACP,SAAS,EACrBO,WAAW,CAACN,QACd,CAAC;;MAED;MACA,IAAImB,OAAO,EAAE;QACXA,OAAO,CAACrB,OAAO,GAAG,CAAC,EAAE0B,KAAK,EAAEF,UAAU,CAAC;MACzC;MAEA,MAAMV,KAAK,CAACY,KAAK,CAAC;IACpB;EACF;;EAEA;EACA,MAAMJ,SAAS;AACjB","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { create } from 'zustand';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Authentication store state
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Zustand store for managing authentication token
|
|
11
|
+
* Token is stored in memory and used for Authorization header
|
|
12
|
+
*/
|
|
13
|
+
export const useAuthStore = create(set => ({
|
|
14
|
+
token: null,
|
|
15
|
+
setToken: token => {
|
|
16
|
+
set({
|
|
17
|
+
token
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
clearToken: () => {
|
|
21
|
+
set({
|
|
22
|
+
token: null
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
//# sourceMappingURL=auth-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["create","useAuthStore","set","token","setToken","clearToken"],"sourceRoot":"../../../../src","sources":["api/stores/auth-store.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,SAAS;;AAEhC;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGD,MAAM,CAAaE,GAAG,KAAM;EACtDC,KAAK,EAAE,IAAI;EAEXC,QAAQ,EAAGD,KAAa,IAAK;IAC3BD,GAAG,CAAC;MAAEC;IAAM,CAAC,CAAC;EAChB,CAAC;EAEDE,UAAU,EAAEA,CAAA,KAAM;IAChBH,GAAG,CAAC;MAAEC,KAAK,EAAE;IAAK,CAAC,CAAC;EACtB;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["api/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API module entry point.
|
|
5
|
+
* Exports HTTP client, types, errors, and stores.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export { ApiError, AuthError, NetworkError, NotFoundError, RateLimitError, ServerError, TimeoutError, ValidationError } from "./api/errors.js";
|
|
9
|
+
export { AxiosAdapter, apiRequest, useAuthStore } from "./api/index.js";
|
|
10
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ApiError","AuthError","NetworkError","NotFoundError","RateLimitError","ServerError","TimeoutError","ValidationError","AxiosAdapter","apiRequest","useAuthStore"],"sourceRoot":"../../src","sources":["api.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SACEA,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,YAAY,EACZC,eAAe,QACV,iBAAc;AACrB,SAASC,YAAY,EAAEC,UAAU,EAAEC,YAAY,QAAQ,gBAAa","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import styled from '@emotion/native';
|
|
4
|
+
import { ButtonText, DefaultButtonStyle } from "./styles.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const DefaultButton = props => /*#__PURE__*/_jsx(DefaultButtonStyle, {
|
|
7
|
+
activeOpacity: 0.5,
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
const SquareButton = styled(DefaultButton)(() => ({
|
|
11
|
+
borderRadius: 0
|
|
12
|
+
}));
|
|
13
|
+
const OutlineButton = styled(DefaultButton)(() => ({
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
borderColor: '#333',
|
|
16
|
+
backgroundColor: 'transparent'
|
|
17
|
+
}));
|
|
18
|
+
const RoundedButton = styled(DefaultButton)(() => ({
|
|
19
|
+
borderRadius: 8
|
|
20
|
+
}));
|
|
21
|
+
const PillButton = styled(DefaultButton)(() => ({
|
|
22
|
+
borderRadius: 999
|
|
23
|
+
}));
|
|
24
|
+
const Button = Object.assign(DefaultButton, {
|
|
25
|
+
Square: SquareButton,
|
|
26
|
+
Outline: OutlineButton,
|
|
27
|
+
Rounded: RoundedButton,
|
|
28
|
+
Pill: PillButton,
|
|
29
|
+
Text: ButtonText
|
|
30
|
+
});
|
|
31
|
+
export { Button };
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["styled","ButtonText","DefaultButtonStyle","jsx","_jsx","DefaultButton","props","activeOpacity","SquareButton","borderRadius","OutlineButton","borderWidth","borderColor","backgroundColor","RoundedButton","PillButton","Button","Object","assign","Square","Outline","Rounded","Pill","Text"],"sourceRoot":"../../../../src","sources":["components/Button/index.tsx"],"mappings":";;AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SAA2BC,UAAU,EAAEC,kBAAkB,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5E,MAAMC,aAAa,GAAIC,KAAkB,iBACvCF,IAAA,CAACF,kBAAkB;EAACK,aAAa,EAAE,GAAI;EAAA,GAAKD;AAAK,CAAG,CACrD;AAED,MAAME,YAAY,GAAGR,MAAM,CAACK,aAAa,CAAC,CAAC,OAAO;EAChDI,YAAY,EAAE;AAChB,CAAC,CAAC,CAAC;AAEH,MAAMC,aAAa,GAAGV,MAAM,CAACK,aAAa,CAAC,CAAC,OAAO;EACjDM,WAAW,EAAE,CAAC;EACdC,WAAW,EAAE,MAAM;EACnBC,eAAe,EAAE;AACnB,CAAC,CAAC,CAAC;AAEH,MAAMC,aAAa,GAAGd,MAAM,CAACK,aAAa,CAAC,CAAC,OAAO;EACjDI,YAAY,EAAE;AAChB,CAAC,CAAC,CAAC;AAEH,MAAMM,UAAU,GAAGf,MAAM,CAACK,aAAa,CAAC,CAAC,OAAO;EAC9CI,YAAY,EAAE;AAChB,CAAC,CAAC,CAAC;AAEH,MAAMO,MAAM,GAAGC,MAAM,CAACC,MAAM,CAACb,aAAa,EAAE;EAC1Cc,MAAM,EAAEX,YAAY;EACpBY,OAAO,EAAEV,aAAa;EACtBW,OAAO,EAAEP,aAAa;EACtBQ,IAAI,EAAEP,UAAU;EAChBQ,IAAI,EAAEtB;AACR,CAAC,CAAC;AAEF,SAASe,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import styled from '@emotion/native';
|
|
4
|
+
import { Text } from "../Text/index.js";
|
|
5
|
+
export const DefaultButtonStyle = styled.TouchableOpacity(({
|
|
6
|
+
paddingVertical,
|
|
7
|
+
paddingHorizontal,
|
|
8
|
+
color,
|
|
9
|
+
margin
|
|
10
|
+
}) => ({
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
paddingHorizontal: paddingHorizontal ?? 20,
|
|
15
|
+
paddingVertical: paddingVertical ?? 14,
|
|
16
|
+
gap: 8,
|
|
17
|
+
backgroundColor: color ?? '#333',
|
|
18
|
+
margin
|
|
19
|
+
}));
|
|
20
|
+
export const ButtonText = styled(Text)(({
|
|
21
|
+
color,
|
|
22
|
+
size
|
|
23
|
+
}) => ({
|
|
24
|
+
color: color ?? '#fff',
|
|
25
|
+
fontSize: size ?? 16
|
|
26
|
+
}));
|
|
27
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["styled","Text","DefaultButtonStyle","TouchableOpacity","paddingVertical","paddingHorizontal","color","margin","flexDirection","alignItems","justifyContent","gap","backgroundColor","ButtonText","size","fontSize"],"sourceRoot":"../../../../src","sources":["components/Button/styles.ts"],"mappings":";;AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SAASC,IAAI,QAAQ,kBAAS;AAS9B,OAAO,MAAMC,kBAAkB,GAAGF,MAAM,CAACG,gBAAgB,CACvD,CAAC;EAAEC,eAAe;EAAEC,iBAAiB;EAAEC,KAAK;EAAEC;AAAO,CAAC,MAAM;EAC1DC,aAAa,EAAE,KAAK;EACpBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBL,iBAAiB,EAAEA,iBAAiB,IAAI,EAAE;EAC1CD,eAAe,EAAEA,eAAe,IAAI,EAAE;EACtCO,GAAG,EAAE,CAAC;EACNC,eAAe,EAAEN,KAAK,IAAI,MAAM;EAChCC;AACF,CAAC,CACH,CAAC;AAED,OAAO,MAAMM,UAAU,GAAGb,MAAM,CAACC,IAAI,CAAC,CAAC,CAAC;EAAEK,KAAK;EAAEQ;AAAK,CAAC,MAAM;EAC3DR,KAAK,EAAEA,KAAK,IAAI,MAAM;EACtBS,QAAQ,EAAED,IAAI,IAAI;AACpB,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Animated, Pressable } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export function Dot({
|
|
7
|
+
isActive,
|
|
8
|
+
onPress
|
|
9
|
+
}) {
|
|
10
|
+
const progress = React.useRef(new Animated.Value(isActive ? 1 : 0)).current;
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
Animated.timing(progress, {
|
|
13
|
+
toValue: isActive ? 1 : 0,
|
|
14
|
+
duration: 150,
|
|
15
|
+
useNativeDriver: false // color animation needs native driver off
|
|
16
|
+
}).start();
|
|
17
|
+
}, [isActive, progress]);
|
|
18
|
+
const backgroundColor = progress.interpolate({
|
|
19
|
+
inputRange: [0, 1],
|
|
20
|
+
outputRange: ['#00000055', '#000000']
|
|
21
|
+
});
|
|
22
|
+
const scale = progress.interpolate({
|
|
23
|
+
inputRange: [0, 1],
|
|
24
|
+
outputRange: [1, 1.2]
|
|
25
|
+
});
|
|
26
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
27
|
+
onPress: onPress,
|
|
28
|
+
hitSlop: 10,
|
|
29
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
30
|
+
style: {
|
|
31
|
+
height: 8,
|
|
32
|
+
width: 8,
|
|
33
|
+
borderRadius: 999,
|
|
34
|
+
backgroundColor,
|
|
35
|
+
transform: [{
|
|
36
|
+
scale
|
|
37
|
+
}]
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=dot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Animated","Pressable","jsx","_jsx","Dot","isActive","onPress","progress","useRef","Value","current","useEffect","timing","toValue","duration","useNativeDriver","start","backgroundColor","interpolate","inputRange","outputRange","scale","hitSlop","children","View","style","height","width","borderRadius","transform"],"sourceRoot":"../../../../../src","sources":["components/Carousel/components/dot.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,SAAS,QAAQ,cA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|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Flex } from "../../Flex/index.js";
|
|
4
|
+
import { Padding } from "../../Padding/index.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export const CarouselFooter = ({
|
|
7
|
+
children,
|
|
8
|
+
gap = 8,
|
|
9
|
+
...flexProps
|
|
10
|
+
}) => /*#__PURE__*/_jsx(Padding, {
|
|
11
|
+
insets: {
|
|
12
|
+
all: 20
|
|
13
|
+
},
|
|
14
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
15
|
+
flexDirection: "row",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
gap: gap,
|
|
18
|
+
...flexProps,
|
|
19
|
+
children: children
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Flex","Padding","jsx","_jsx","CarouselFooter","children","gap","flexProps","insets","all","flexDirection","alignItems"],"sourceRoot":"../../../../../src","sources":["components/Carousel/components/footer.tsx"],"mappings":";;AACA,SAASA,IAAI,QAAQ,qBAAY;AACjC,SAASC,OAAO,QAAQ,wBAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIxC,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAC7BC,QAAQ;EACRC,GAAG,GAAG,CAAC;EACP,GAAGC;AACgB,CAAC,kBACpBJ,IAAA,CAACF,OAAO;EACNO,MAAM,EAAE;IACNC,GAAG,EAAE;EACP,CAAE;EAAAJ,QAAA,eAEFF,IAAA,CAACH,IAAI;IAACU,aAAa,EAAC,KAAK;IAACC,UAAU,EAAC,QAAQ;IAACL,GAAG,EAAEA,GAAI;IAAA,GAAKC,SAAS;IAAAF,QAAA,EAClEA;EAAQ,CACL;AAAC,CACA,CACV","ignoreList":[]}
|