@umituz/react-native-design-system 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/domains/icons/domain/config/IconLibraryConfig.d.ts +91 -0
- package/lib/domains/icons/domain/config/IconLibraryConfig.d.ts.map +1 -0
- package/lib/domains/icons/domain/config/IconLibraryConfig.js +85 -0
- package/lib/domains/icons/domain/config/IconLibraryConfig.js.map +1 -0
- package/lib/domains/icons/domain/entities/Icon.d.ts +111 -0
- package/lib/domains/icons/domain/entities/Icon.d.ts.map +1 -0
- package/lib/domains/icons/domain/entities/Icon.js +87 -0
- package/lib/domains/icons/domain/entities/Icon.js.map +1 -0
- package/lib/domains/icons/domain/interfaces/IIconAdapter.d.ts +114 -0
- package/lib/domains/icons/domain/interfaces/IIconAdapter.d.ts.map +1 -0
- package/lib/domains/icons/domain/interfaces/IIconAdapter.js +17 -0
- package/lib/domains/icons/domain/interfaces/IIconAdapter.js.map +1 -0
- package/lib/domains/icons/index.d.ts +84 -0
- package/lib/domains/icons/index.d.ts.map +1 -0
- package/lib/domains/icons/index.js +89 -0
- package/lib/domains/icons/index.js.map +1 -0
- package/lib/domains/icons/infrastructure/adapters/LucideAdapter.d.ts +24 -0
- package/lib/domains/icons/infrastructure/adapters/LucideAdapter.d.ts.map +1 -0
- package/lib/domains/icons/infrastructure/adapters/LucideAdapter.js +85 -0
- package/lib/domains/icons/infrastructure/adapters/LucideAdapter.js.map +1 -0
- package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.d.ts +23 -0
- package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.d.ts.map +1 -0
- package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.js +178 -0
- package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.js.map +1 -0
- package/lib/domains/icons/presentation/components/Icon.d.ts +42 -0
- package/lib/domains/icons/presentation/components/Icon.d.ts.map +1 -0
- package/lib/domains/icons/presentation/components/Icon.js +86 -0
- package/lib/domains/icons/presentation/components/Icon.js.map +1 -0
- package/lib/domains/icons/presentation/hooks/useIconLibrary.d.ts +38 -0
- package/lib/domains/icons/presentation/hooks/useIconLibrary.d.ts.map +1 -0
- package/lib/domains/icons/presentation/hooks/useIconLibrary.js +114 -0
- package/lib/domains/icons/presentation/hooks/useIconLibrary.js.map +1 -0
- package/lib/index.d.ts +66 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +106 -0
- package/lib/index.js.map +1 -0
- package/lib/infrastructure/theme/globalThemeStore.d.ts +42 -0
- package/lib/infrastructure/theme/globalThemeStore.d.ts.map +1 -0
- package/lib/infrastructure/theme/globalThemeStore.js +38 -0
- package/lib/infrastructure/theme/globalThemeStore.js.map +1 -0
- package/lib/presentation/atoms/AtomicAvatar.d.ts +48 -0
- package/lib/presentation/atoms/AtomicAvatar.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicAvatar.js +85 -0
- package/lib/presentation/atoms/AtomicAvatar.js.map +1 -0
- package/lib/presentation/atoms/AtomicAvatarGroup.d.ts +56 -0
- package/lib/presentation/atoms/AtomicAvatarGroup.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicAvatarGroup.js +83 -0
- package/lib/presentation/atoms/AtomicAvatarGroup.js.map +1 -0
- package/lib/presentation/atoms/AtomicBadge.d.ts +42 -0
- package/lib/presentation/atoms/AtomicBadge.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicBadge.js +168 -0
- package/lib/presentation/atoms/AtomicBadge.js.map +1 -0
- package/lib/presentation/atoms/AtomicButton.d.ts +22 -0
- package/lib/presentation/atoms/AtomicButton.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicButton.js +193 -0
- package/lib/presentation/atoms/AtomicButton.js.map +1 -0
- package/lib/presentation/atoms/AtomicCard.d.ts +15 -0
- package/lib/presentation/atoms/AtomicCard.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicCard.js +89 -0
- package/lib/presentation/atoms/AtomicCard.js.map +1 -0
- package/lib/presentation/atoms/AtomicChip.d.ts +53 -0
- package/lib/presentation/atoms/AtomicChip.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicChip.js +131 -0
- package/lib/presentation/atoms/AtomicChip.js.map +1 -0
- package/lib/presentation/atoms/AtomicDatePicker.d.ts +75 -0
- package/lib/presentation/atoms/AtomicDatePicker.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicDatePicker.js +246 -0
- package/lib/presentation/atoms/AtomicDatePicker.js.map +1 -0
- package/lib/presentation/atoms/AtomicDivider.d.ts +45 -0
- package/lib/presentation/atoms/AtomicDivider.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicDivider.js +58 -0
- package/lib/presentation/atoms/AtomicDivider.js.map +1 -0
- package/lib/presentation/atoms/AtomicFab.d.ts +38 -0
- package/lib/presentation/atoms/AtomicFab.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicFab.js +69 -0
- package/lib/presentation/atoms/AtomicFab.js.map +1 -0
- package/lib/presentation/atoms/AtomicFilter.d.ts +37 -0
- package/lib/presentation/atoms/AtomicFilter.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicFilter.js +104 -0
- package/lib/presentation/atoms/AtomicFilter.js.map +1 -0
- package/lib/presentation/atoms/AtomicFormError.d.ts +30 -0
- package/lib/presentation/atoms/AtomicFormError.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicFormError.js +64 -0
- package/lib/presentation/atoms/AtomicFormError.js.map +1 -0
- package/lib/presentation/atoms/AtomicIcon.d.ts +36 -0
- package/lib/presentation/atoms/AtomicIcon.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicIcon.js +30 -0
- package/lib/presentation/atoms/AtomicIcon.js.map +1 -0
- package/lib/presentation/atoms/AtomicImage.d.ts +40 -0
- package/lib/presentation/atoms/AtomicImage.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicImage.js +92 -0
- package/lib/presentation/atoms/AtomicImage.js.map +1 -0
- package/lib/presentation/atoms/AtomicInput.d.ts +71 -0
- package/lib/presentation/atoms/AtomicInput.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicInput.js +196 -0
- package/lib/presentation/atoms/AtomicInput.js.map +1 -0
- package/lib/presentation/atoms/AtomicNumberInput.d.ts +69 -0
- package/lib/presentation/atoms/AtomicNumberInput.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicNumberInput.js +125 -0
- package/lib/presentation/atoms/AtomicNumberInput.js.map +1 -0
- package/lib/presentation/atoms/AtomicPicker.d.ts +52 -0
- package/lib/presentation/atoms/AtomicPicker.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicPicker.js +299 -0
- package/lib/presentation/atoms/AtomicPicker.js.map +1 -0
- package/lib/presentation/atoms/AtomicProgress.d.ts +47 -0
- package/lib/presentation/atoms/AtomicProgress.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicProgress.js +81 -0
- package/lib/presentation/atoms/AtomicProgress.js.map +1 -0
- package/lib/presentation/atoms/AtomicSearchBar.d.ts +19 -0
- package/lib/presentation/atoms/AtomicSearchBar.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicSearchBar.js +46 -0
- package/lib/presentation/atoms/AtomicSearchBar.js.map +1 -0
- package/lib/presentation/atoms/AtomicSkeleton.d.ts +43 -0
- package/lib/presentation/atoms/AtomicSkeleton.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicSkeleton.js +84 -0
- package/lib/presentation/atoms/AtomicSkeleton.js.map +1 -0
- package/lib/presentation/atoms/AtomicSort.d.ts +72 -0
- package/lib/presentation/atoms/AtomicSort.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicSort.js +77 -0
- package/lib/presentation/atoms/AtomicSort.js.map +1 -0
- package/lib/presentation/atoms/AtomicSwitch.d.ts +43 -0
- package/lib/presentation/atoms/AtomicSwitch.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicSwitch.js +104 -0
- package/lib/presentation/atoms/AtomicSwitch.js.map +1 -0
- package/lib/presentation/atoms/AtomicText.d.ts +14 -0
- package/lib/presentation/atoms/AtomicText.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicText.js +36 -0
- package/lib/presentation/atoms/AtomicText.js.map +1 -0
- package/lib/presentation/atoms/AtomicTextArea.d.ts +85 -0
- package/lib/presentation/atoms/AtomicTextArea.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicTextArea.js +196 -0
- package/lib/presentation/atoms/AtomicTextArea.js.map +1 -0
- package/lib/presentation/atoms/AtomicTouchable.d.ts +87 -0
- package/lib/presentation/atoms/AtomicTouchable.d.ts.map +1 -0
- package/lib/presentation/atoms/AtomicTouchable.js +151 -0
- package/lib/presentation/atoms/AtomicTouchable.js.map +1 -0
- package/lib/presentation/atoms/fab/styles/fabStyles.d.ts +23 -0
- package/lib/presentation/atoms/fab/styles/fabStyles.d.ts.map +1 -0
- package/lib/presentation/atoms/fab/styles/fabStyles.js +63 -0
- package/lib/presentation/atoms/fab/styles/fabStyles.js.map +1 -0
- package/lib/presentation/atoms/fab/types/index.d.ts +76 -0
- package/lib/presentation/atoms/fab/types/index.d.ts.map +1 -0
- package/lib/presentation/atoms/fab/types/index.js +2 -0
- package/lib/presentation/atoms/fab/types/index.js.map +1 -0
- package/lib/presentation/atoms/filter/styles/filterStyles.d.ts +15 -0
- package/lib/presentation/atoms/filter/styles/filterStyles.d.ts.map +1 -0
- package/lib/presentation/atoms/filter/styles/filterStyles.js +29 -0
- package/lib/presentation/atoms/filter/styles/filterStyles.js.map +1 -0
- package/lib/presentation/atoms/filter/types/index.d.ts +76 -0
- package/lib/presentation/atoms/filter/types/index.d.ts.map +1 -0
- package/lib/presentation/atoms/filter/types/index.js +2 -0
- package/lib/presentation/atoms/filter/types/index.js.map +1 -0
- package/lib/presentation/atoms/index.d.ts +276 -0
- package/lib/presentation/atoms/index.d.ts.map +1 -0
- package/lib/presentation/atoms/index.js +149 -0
- package/lib/presentation/atoms/index.js.map +1 -0
- package/lib/presentation/atoms/input/hooks/useInputState.d.ts +7 -0
- package/lib/presentation/atoms/input/hooks/useInputState.d.ts.map +1 -0
- package/lib/presentation/atoms/input/hooks/useInputState.js +13 -0
- package/lib/presentation/atoms/input/hooks/useInputState.js.map +1 -0
- package/lib/presentation/atoms/input/styles/inputStyles.d.ts +13 -0
- package/lib/presentation/atoms/input/styles/inputStyles.d.ts.map +1 -0
- package/lib/presentation/atoms/input/styles/inputStyles.js +59 -0
- package/lib/presentation/atoms/input/styles/inputStyles.js.map +1 -0
- package/lib/presentation/atoms/input/types/index.d.ts +24 -0
- package/lib/presentation/atoms/input/types/index.d.ts.map +1 -0
- package/lib/presentation/atoms/input/types/index.js +2 -0
- package/lib/presentation/atoms/input/types/index.js.map +1 -0
- package/lib/presentation/atoms/picker/styles/pickerStyles.d.ts +96 -0
- package/lib/presentation/atoms/picker/styles/pickerStyles.d.ts.map +1 -0
- package/lib/presentation/atoms/picker/styles/pickerStyles.js +177 -0
- package/lib/presentation/atoms/picker/styles/pickerStyles.js.map +1 -0
- package/lib/presentation/atoms/picker/types/index.d.ts +38 -0
- package/lib/presentation/atoms/picker/types/index.d.ts.map +1 -0
- package/lib/presentation/atoms/picker/types/index.js +2 -0
- package/lib/presentation/atoms/picker/types/index.js.map +1 -0
- package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts +36 -0
- package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts.map +1 -0
- package/lib/presentation/atoms/touchable/styles/touchableStyles.js +62 -0
- package/lib/presentation/atoms/touchable/styles/touchableStyles.js.map +1 -0
- package/lib/presentation/atoms/touchable/types/index.d.ts +140 -0
- package/lib/presentation/atoms/touchable/types/index.d.ts.map +1 -0
- package/lib/presentation/atoms/touchable/types/index.js +2 -0
- package/lib/presentation/atoms/touchable/types/index.js.map +1 -0
- package/lib/presentation/hooks/useAppDesignTokens.d.ts +34 -0
- package/lib/presentation/hooks/useAppDesignTokens.d.ts.map +1 -0
- package/lib/presentation/hooks/useAppDesignTokens.js +39 -0
- package/lib/presentation/hooks/useAppDesignTokens.js.map +1 -0
- package/lib/presentation/hooks/useResponsive.d.ts +80 -0
- package/lib/presentation/hooks/useResponsive.d.ts.map +1 -0
- package/lib/presentation/hooks/useResponsive.js +82 -0
- package/lib/presentation/hooks/useResponsive.js.map +1 -0
- package/lib/presentation/loading/index.d.ts +23 -0
- package/lib/presentation/loading/index.d.ts.map +1 -0
- package/lib/presentation/loading/index.js +26 -0
- package/lib/presentation/loading/index.js.map +1 -0
- package/lib/presentation/loading/presentation/components/LoadingSpinner.d.ts +28 -0
- package/lib/presentation/loading/presentation/components/LoadingSpinner.d.ts.map +1 -0
- package/lib/presentation/loading/presentation/components/LoadingSpinner.js +77 -0
- package/lib/presentation/loading/presentation/components/LoadingSpinner.js.map +1 -0
- package/lib/presentation/loading/presentation/components/LoadingState.d.ts +39 -0
- package/lib/presentation/loading/presentation/components/LoadingState.d.ts.map +1 -0
- package/lib/presentation/loading/presentation/components/LoadingState.js +123 -0
- package/lib/presentation/loading/presentation/components/LoadingState.js.map +1 -0
- package/lib/presentation/loading/presentation/hooks/useLoading.d.ts +50 -0
- package/lib/presentation/loading/presentation/hooks/useLoading.d.ts.map +1 -0
- package/lib/presentation/loading/presentation/hooks/useLoading.js +49 -0
- package/lib/presentation/loading/presentation/hooks/useLoading.js.map +1 -0
- package/lib/presentation/molecules/AtomicConfirmationModal.d.ts +73 -0
- package/lib/presentation/molecules/AtomicConfirmationModal.d.ts.map +1 -0
- package/lib/presentation/molecules/AtomicConfirmationModal.js +172 -0
- package/lib/presentation/molecules/AtomicConfirmationModal.js.map +1 -0
- package/lib/presentation/molecules/EmptyState.d.ts +41 -0
- package/lib/presentation/molecules/EmptyState.d.ts.map +1 -0
- package/lib/presentation/molecules/EmptyState.js +68 -0
- package/lib/presentation/molecules/EmptyState.js.map +1 -0
- package/lib/presentation/molecules/FormField.d.ts +22 -0
- package/lib/presentation/molecules/FormField.d.ts.map +1 -0
- package/lib/presentation/molecules/FormField.js +76 -0
- package/lib/presentation/molecules/FormField.js.map +1 -0
- package/lib/presentation/molecules/GridContainer.d.ts +40 -0
- package/lib/presentation/molecules/GridContainer.d.ts.map +1 -0
- package/lib/presentation/molecules/GridContainer.js +77 -0
- package/lib/presentation/molecules/GridContainer.js.map +1 -0
- package/lib/presentation/molecules/IconContainer.d.ts +29 -0
- package/lib/presentation/molecules/IconContainer.d.ts.map +1 -0
- package/lib/presentation/molecules/IconContainer.js +60 -0
- package/lib/presentation/molecules/IconContainer.js.map +1 -0
- package/lib/presentation/molecules/LanguageSwitcher.d.ts +10 -0
- package/lib/presentation/molecules/LanguageSwitcher.d.ts.map +1 -0
- package/lib/presentation/molecules/LanguageSwitcher.js +24 -0
- package/lib/presentation/molecules/LanguageSwitcher.js.map +1 -0
- package/lib/presentation/molecules/ListItem.d.ts +5 -0
- package/lib/presentation/molecules/ListItem.d.ts.map +1 -0
- package/lib/presentation/molecules/ListItem.js +24 -0
- package/lib/presentation/molecules/ListItem.js.map +1 -0
- package/lib/presentation/molecules/ScreenHeader.d.ts +55 -0
- package/lib/presentation/molecules/ScreenHeader.d.ts.map +1 -0
- package/lib/presentation/molecules/ScreenHeader.js +94 -0
- package/lib/presentation/molecules/ScreenHeader.js.map +1 -0
- package/lib/presentation/molecules/SearchBar.d.ts +18 -0
- package/lib/presentation/molecules/SearchBar.d.ts.map +1 -0
- package/lib/presentation/molecules/SearchBar.js +47 -0
- package/lib/presentation/molecules/SearchBar.js.map +1 -0
- package/lib/presentation/molecules/SectionCard.d.ts +25 -0
- package/lib/presentation/molecules/SectionCard.d.ts.map +1 -0
- package/lib/presentation/molecules/SectionCard.js +47 -0
- package/lib/presentation/molecules/SectionCard.js.map +1 -0
- package/lib/presentation/molecules/SectionContainer.d.ts +33 -0
- package/lib/presentation/molecules/SectionContainer.d.ts.map +1 -0
- package/lib/presentation/molecules/SectionContainer.js +64 -0
- package/lib/presentation/molecules/SectionContainer.js.map +1 -0
- package/lib/presentation/molecules/SectionHeader.d.ts +37 -0
- package/lib/presentation/molecules/SectionHeader.d.ts.map +1 -0
- package/lib/presentation/molecules/SectionHeader.js +73 -0
- package/lib/presentation/molecules/SectionHeader.js.map +1 -0
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts +50 -0
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts.map +1 -0
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.js +115 -0
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.js.map +1 -0
- package/lib/presentation/molecules/confirmation-modal/types/index.d.ts +88 -0
- package/lib/presentation/molecules/confirmation-modal/types/index.d.ts.map +1 -0
- package/lib/presentation/molecules/confirmation-modal/types/index.js +7 -0
- package/lib/presentation/molecules/confirmation-modal/types/index.js.map +1 -0
- package/lib/presentation/molecules/index.d.ts +28 -0
- package/lib/presentation/molecules/index.d.ts.map +1 -0
- package/lib/presentation/molecules/index.js +18 -0
- package/lib/presentation/molecules/index.js.map +1 -0
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.d.ts +11 -0
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.d.ts.map +1 -0
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.js +6 -0
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.js.map +1 -0
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.d.ts +5 -0
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.d.ts.map +1 -0
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.js +12 -0
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.js.map +1 -0
- package/lib/presentation/molecules/listitem/styles/listItemStyles.d.ts +12 -0
- package/lib/presentation/molecules/listitem/styles/listItemStyles.d.ts.map +1 -0
- package/lib/presentation/molecules/listitem/styles/listItemStyles.js +15 -0
- package/lib/presentation/molecules/listitem/styles/listItemStyles.js.map +1 -0
- package/lib/presentation/molecules/listitem/types/index.d.ts +17 -0
- package/lib/presentation/molecules/listitem/types/index.d.ts.map +1 -0
- package/lib/presentation/molecules/listitem/types/index.js +2 -0
- package/lib/presentation/molecules/listitem/types/index.js.map +1 -0
- package/lib/presentation/organisms/AppHeader.d.ts +30 -0
- package/lib/presentation/organisms/AppHeader.d.ts.map +1 -0
- package/lib/presentation/organisms/AppHeader.js +78 -0
- package/lib/presentation/organisms/AppHeader.js.map +1 -0
- package/lib/presentation/organisms/FormContainer.d.ts +76 -0
- package/lib/presentation/organisms/FormContainer.d.ts.map +1 -0
- package/lib/presentation/organisms/FormContainer.js +127 -0
- package/lib/presentation/organisms/FormContainer.js.map +1 -0
- package/lib/presentation/organisms/ScreenLayout.d.ts +99 -0
- package/lib/presentation/organisms/ScreenLayout.d.ts.map +1 -0
- package/lib/presentation/organisms/ScreenLayout.js +78 -0
- package/lib/presentation/organisms/ScreenLayout.js.map +1 -0
- package/lib/presentation/organisms/index.d.ts +16 -0
- package/lib/presentation/organisms/index.d.ts.map +1 -0
- package/lib/presentation/organisms/index.js +14 -0
- package/lib/presentation/organisms/index.js.map +1 -0
- package/lib/presentation/tokens/AppDesignTokens.d.ts +14 -0
- package/lib/presentation/tokens/AppDesignTokens.d.ts.map +1 -0
- package/lib/presentation/tokens/AppDesignTokens.js +23 -0
- package/lib/presentation/tokens/AppDesignTokens.js.map +1 -0
- package/lib/presentation/tokens/commonStyles.d.ts +122 -0
- package/lib/presentation/tokens/commonStyles.d.ts.map +1 -0
- package/lib/presentation/tokens/commonStyles.js +220 -0
- package/lib/presentation/tokens/commonStyles.js.map +1 -0
- package/lib/presentation/tokens/core/BaseTokens.d.ts +337 -0
- package/lib/presentation/tokens/core/BaseTokens.d.ts.map +1 -0
- package/lib/presentation/tokens/core/BaseTokens.js +322 -0
- package/lib/presentation/tokens/core/BaseTokens.js.map +1 -0
- package/lib/presentation/tokens/core/ColorPalette.d.ts +216 -0
- package/lib/presentation/tokens/core/ColorPalette.d.ts.map +1 -0
- package/lib/presentation/tokens/core/ColorPalette.js +330 -0
- package/lib/presentation/tokens/core/ColorPalette.js.map +1 -0
- package/lib/presentation/tokens/core/TokenFactory.d.ts +229 -0
- package/lib/presentation/tokens/core/TokenFactory.d.ts.map +1 -0
- package/lib/presentation/tokens/core/TokenFactory.js +87 -0
- package/lib/presentation/tokens/core/TokenFactory.js.map +1 -0
- package/lib/presentation/utils/platformConstants.d.ts +100 -0
- package/lib/presentation/utils/platformConstants.d.ts.map +1 -0
- package/lib/presentation/utils/platformConstants.js +114 -0
- package/lib/presentation/utils/platformConstants.js.map +1 -0
- package/lib/presentation/utils/responsive.d.ts +218 -0
- package/lib/presentation/utils/responsive.d.ts.map +1 -0
- package/lib/presentation/utils/responsive.js +452 -0
- package/lib/presentation/utils/responsive.js.map +1 -0
- package/lib/presentation/utils/variants/compound.d.ts +10 -0
- package/lib/presentation/utils/variants/compound.d.ts.map +1 -0
- package/lib/presentation/utils/variants/compound.js +16 -0
- package/lib/presentation/utils/variants/compound.js.map +1 -0
- package/lib/presentation/utils/variants/core.d.ts +15 -0
- package/lib/presentation/utils/variants/core.d.ts.map +1 -0
- package/lib/presentation/utils/variants/core.js +23 -0
- package/lib/presentation/utils/variants/core.js.map +1 -0
- package/lib/presentation/utils/variants/helpers.d.ts +5 -0
- package/lib/presentation/utils/variants/helpers.d.ts.map +1 -0
- package/lib/presentation/utils/variants/helpers.js +10 -0
- package/lib/presentation/utils/variants/helpers.js.map +1 -0
- package/lib/presentation/utils/variants.d.ts +4 -0
- package/lib/presentation/utils/variants.d.ts.map +1 -0
- package/lib/presentation/utils/variants.js +4 -0
- package/lib/presentation/utils/variants.js.map +1 -0
- package/package.json +38 -4
- package/src/domains/icons/domain/interfaces/IIconAdapter.ts +5 -3
- package/src/domains/icons/infrastructure/adapters/LucideAdapter.ts +1 -1
- package/src/presentation/molecules/AtomicConfirmationModal.tsx +1 -1
- package/src/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.ts +1 -2
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import type { AtomicIconName } from './AtomicIcon';
|
|
4
|
+
export type AtomicInputVariant = 'outlined' | 'filled' | 'flat';
|
|
5
|
+
export type AtomicInputState = 'default' | 'error' | 'success' | 'disabled';
|
|
6
|
+
export type AtomicInputSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
export interface AtomicInputProps {
|
|
8
|
+
/** Input label */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Current input value */
|
|
11
|
+
value?: string;
|
|
12
|
+
/** Value change callback */
|
|
13
|
+
onChangeText?: (text: string) => void;
|
|
14
|
+
/** Input variant (outlined, filled, flat) */
|
|
15
|
+
variant?: AtomicInputVariant;
|
|
16
|
+
/** Input state (default, error, success, disabled) */
|
|
17
|
+
state?: AtomicInputState;
|
|
18
|
+
/** Input size (sm, md, lg) */
|
|
19
|
+
size?: AtomicInputSize;
|
|
20
|
+
/** Placeholder text */
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/** Helper text below input */
|
|
23
|
+
helperText?: string;
|
|
24
|
+
/** Leading icon (Lucide icon name) */
|
|
25
|
+
leadingIcon?: AtomicIconName;
|
|
26
|
+
/** Trailing icon (Lucide icon name) */
|
|
27
|
+
trailingIcon?: AtomicIconName;
|
|
28
|
+
/** Callback when trailing icon is pressed */
|
|
29
|
+
onTrailingIconPress?: () => void;
|
|
30
|
+
/** Show password toggle for secure inputs */
|
|
31
|
+
showPasswordToggle?: boolean;
|
|
32
|
+
/** Secure text entry (password field) */
|
|
33
|
+
secureTextEntry?: boolean;
|
|
34
|
+
/** Maximum character length */
|
|
35
|
+
maxLength?: number;
|
|
36
|
+
/** Show character counter */
|
|
37
|
+
showCharacterCount?: boolean;
|
|
38
|
+
/** Keyboard type */
|
|
39
|
+
keyboardType?: 'default' | 'email-address' | 'numeric' | 'phone-pad' | 'url' | 'number-pad' | 'decimal-pad';
|
|
40
|
+
/** Auto-capitalize */
|
|
41
|
+
autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
|
|
42
|
+
/** Auto-correct */
|
|
43
|
+
autoCorrect?: boolean;
|
|
44
|
+
/** Disabled state */
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/** Container style */
|
|
47
|
+
style?: StyleProp<ViewStyle>;
|
|
48
|
+
/** Input text style */
|
|
49
|
+
inputStyle?: StyleProp<TextStyle>;
|
|
50
|
+
/** Test ID for E2E testing */
|
|
51
|
+
testID?: string;
|
|
52
|
+
/** Blur callback */
|
|
53
|
+
onBlur?: () => void;
|
|
54
|
+
/** Focus callback */
|
|
55
|
+
onFocus?: () => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* AtomicInput - Pure React Native Text Input
|
|
59
|
+
*
|
|
60
|
+
* Features:
|
|
61
|
+
* - Pure React Native implementation (no Paper dependency)
|
|
62
|
+
* - Lucide icons for password toggle and custom icons
|
|
63
|
+
* - Outlined/filled/flat variants
|
|
64
|
+
* - Error, success, disabled states
|
|
65
|
+
* - Character counter
|
|
66
|
+
* - Responsive sizing
|
|
67
|
+
* - Full accessibility support
|
|
68
|
+
*/
|
|
69
|
+
export declare const AtomicInput: React.FC<AtomicInputProps>;
|
|
70
|
+
export type { AtomicInputProps as InputProps };
|
|
71
|
+
//# sourceMappingURL=AtomicInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AtomicInput.d.ts","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAA0C,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIvG,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAChE,MAAM,MAAM,gBA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,CAAC;IACtB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,uBAAuB;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+OlD,CAAC;AAoCF,YAAY,EAAE,gBAAgB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, TextInput, Pressable, StyleSheet } from 'react-native';
|
|
3
|
+
import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
|
|
4
|
+
import { AtomicIcon } from './AtomicIcon';
|
|
5
|
+
import { AtomicText } from './AtomicText';
|
|
6
|
+
/**
|
|
7
|
+
* AtomicInput - Pure React Native Text Input
|
|
8
|
+
*
|
|
9
|
+
* Features:
|
|
10
|
+
* - Pure React Native implementation (no Paper dependency)
|
|
11
|
+
* - Lucide icons for password toggle and custom icons
|
|
12
|
+
* - Outlined/filled/flat variants
|
|
13
|
+
* - Error, success, disabled states
|
|
14
|
+
* - Character counter
|
|
15
|
+
* - Responsive sizing
|
|
16
|
+
* - Full accessibility support
|
|
17
|
+
*/
|
|
18
|
+
export const AtomicInput = ({ variant = 'outlined', state = 'default', size = 'md', label, value = '', onChangeText, placeholder, helperText, leadingIcon, trailingIcon, onTrailingIconPress, showPasswordToggle = false, secureTextEntry = false, maxLength, showCharacterCount = false, keyboardType = 'default', autoCapitalize = 'sentences', autoCorrect = true, disabled = false, style, inputStyle, testID, onBlur, onFocus, }) => {
|
|
19
|
+
const tokens = useAppDesignTokens();
|
|
20
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
|
21
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
22
|
+
const isDisabled = state === 'disabled' || disabled;
|
|
23
|
+
const characterCount = value?.toString().length || 0;
|
|
24
|
+
const hasError = state === 'error';
|
|
25
|
+
const hasSuccess = state === 'success';
|
|
26
|
+
// Size configuration
|
|
27
|
+
const sizeConfig = {
|
|
28
|
+
sm: {
|
|
29
|
+
paddingVertical: tokens.spacing.xs,
|
|
30
|
+
paddingHorizontal: tokens.spacing.sm,
|
|
31
|
+
fontSize: tokens.typography.bodySmall.fontSize,
|
|
32
|
+
iconSize: 16,
|
|
33
|
+
minHeight: 40,
|
|
34
|
+
},
|
|
35
|
+
md: {
|
|
36
|
+
paddingVertical: tokens.spacing.sm,
|
|
37
|
+
paddingHorizontal: tokens.spacing.md,
|
|
38
|
+
fontSize: tokens.typography.bodyMedium.fontSize,
|
|
39
|
+
iconSize: 20,
|
|
40
|
+
minHeight: 48,
|
|
41
|
+
},
|
|
42
|
+
lg: {
|
|
43
|
+
paddingVertical: tokens.spacing.md,
|
|
44
|
+
paddingHorizontal: tokens.spacing.lg,
|
|
45
|
+
fontSize: tokens.typography.bodyLarge.fontSize,
|
|
46
|
+
iconSize: 24,
|
|
47
|
+
minHeight: 56,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
const config = sizeConfig[size];
|
|
51
|
+
// Get variant styles
|
|
52
|
+
const getVariantStyle = () => {
|
|
53
|
+
const baseStyle = {
|
|
54
|
+
backgroundColor: tokens.colors.surface,
|
|
55
|
+
borderRadius: tokens.borders.radius.md,
|
|
56
|
+
};
|
|
57
|
+
let borderColor = tokens.colors.border;
|
|
58
|
+
if (isFocused)
|
|
59
|
+
borderColor = tokens.colors.primary;
|
|
60
|
+
if (hasError)
|
|
61
|
+
borderColor = tokens.colors.error;
|
|
62
|
+
if (hasSuccess)
|
|
63
|
+
borderColor = tokens.colors.success;
|
|
64
|
+
if (isDisabled)
|
|
65
|
+
borderColor = tokens.colors.borderDisabled;
|
|
66
|
+
switch (variant) {
|
|
67
|
+
case 'outlined':
|
|
68
|
+
return {
|
|
69
|
+
...baseStyle,
|
|
70
|
+
borderWidth: isFocused ? 2 : 1,
|
|
71
|
+
borderColor,
|
|
72
|
+
};
|
|
73
|
+
case 'filled':
|
|
74
|
+
return {
|
|
75
|
+
...baseStyle,
|
|
76
|
+
backgroundColor: tokens.colors.surfaceSecondary,
|
|
77
|
+
borderWidth: 0,
|
|
78
|
+
borderBottomWidth: isFocused ? 2 : 1,
|
|
79
|
+
borderBottomColor: borderColor,
|
|
80
|
+
};
|
|
81
|
+
case 'flat':
|
|
82
|
+
return {
|
|
83
|
+
...baseStyle,
|
|
84
|
+
backgroundColor: 'transparent',
|
|
85
|
+
borderWidth: 0,
|
|
86
|
+
borderBottomWidth: 1,
|
|
87
|
+
borderBottomColor: borderColor,
|
|
88
|
+
borderRadius: 0,
|
|
89
|
+
};
|
|
90
|
+
default:
|
|
91
|
+
return baseStyle;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
// Get text color based on state
|
|
95
|
+
const getTextColor = () => {
|
|
96
|
+
if (isDisabled)
|
|
97
|
+
return tokens.colors.textDisabled;
|
|
98
|
+
if (hasError)
|
|
99
|
+
return tokens.colors.error;
|
|
100
|
+
if (hasSuccess)
|
|
101
|
+
return tokens.colors.success;
|
|
102
|
+
return tokens.colors.textPrimary;
|
|
103
|
+
};
|
|
104
|
+
const iconColor = isDisabled ? tokens.colors.textDisabled : tokens.colors.textSecondary;
|
|
105
|
+
const containerStyle = [
|
|
106
|
+
styles.container,
|
|
107
|
+
getVariantStyle(),
|
|
108
|
+
{
|
|
109
|
+
paddingVertical: config.paddingVertical,
|
|
110
|
+
paddingHorizontal: config.paddingHorizontal,
|
|
111
|
+
minHeight: config.minHeight,
|
|
112
|
+
opacity: isDisabled ? 0.5 : 1,
|
|
113
|
+
},
|
|
114
|
+
style,
|
|
115
|
+
];
|
|
116
|
+
const textInputStyle = [
|
|
117
|
+
styles.input,
|
|
118
|
+
{
|
|
119
|
+
fontSize: config.fontSize,
|
|
120
|
+
color: getTextColor(),
|
|
121
|
+
},
|
|
122
|
+
leadingIcon ? { paddingLeft: config.iconSize + 8 } : undefined,
|
|
123
|
+
(trailingIcon || showPasswordToggle) ? { paddingRight: config.iconSize + 8 } : undefined,
|
|
124
|
+
inputStyle,
|
|
125
|
+
];
|
|
126
|
+
return (<View testID={testID}>
|
|
127
|
+
{label && (<AtomicText type="labelMedium" color={hasError ? 'error' : hasSuccess ? 'success' : 'secondary'} style={styles.label}>
|
|
128
|
+
{label}
|
|
129
|
+
</AtomicText>)}
|
|
130
|
+
|
|
131
|
+
<View style={containerStyle}>
|
|
132
|
+
{leadingIcon && (<View style={styles.leadingIcon}>
|
|
133
|
+
<AtomicIcon name={leadingIcon} customSize={config.iconSize} customColor={iconColor}/>
|
|
134
|
+
</View>)}
|
|
135
|
+
|
|
136
|
+
<TextInput value={value} onChangeText={onChangeText} placeholder={placeholder} placeholderTextColor={tokens.colors.textSecondary} secureTextEntry={secureTextEntry && !isPasswordVisible} maxLength={maxLength} keyboardType={keyboardType} autoCapitalize={autoCapitalize} autoCorrect={autoCorrect} editable={!isDisabled} style={textInputStyle} onBlur={() => {
|
|
137
|
+
setIsFocused(false);
|
|
138
|
+
onBlur?.();
|
|
139
|
+
}} onFocus={() => {
|
|
140
|
+
setIsFocused(true);
|
|
141
|
+
onFocus?.();
|
|
142
|
+
}} testID={testID ? `${testID}-input` : undefined}/>
|
|
143
|
+
|
|
144
|
+
{(showPasswordToggle && secureTextEntry) && (<Pressable onPress={() => setIsPasswordVisible(!isPasswordVisible)} style={styles.trailingIcon}>
|
|
145
|
+
<AtomicIcon name={isPasswordVisible ? "EyeOff" : "Eye"} customSize={config.iconSize} customColor={iconColor}/>
|
|
146
|
+
</Pressable>)}
|
|
147
|
+
|
|
148
|
+
{trailingIcon && !showPasswordToggle && (<Pressable onPress={onTrailingIconPress} style={styles.trailingIcon} disabled={!onTrailingIconPress}>
|
|
149
|
+
<AtomicIcon name={trailingIcon} customSize={config.iconSize} customColor={iconColor}/>
|
|
150
|
+
</Pressable>)}
|
|
151
|
+
</View>
|
|
152
|
+
|
|
153
|
+
{(helperText || showCharacterCount) && (<View style={styles.helperRow}>
|
|
154
|
+
{helperText && (<AtomicText type="bodySmall" color={hasError ? 'error' : 'secondary'} style={styles.helperText} testID={testID ? `${testID}-helper` : undefined}>
|
|
155
|
+
{helperText}
|
|
156
|
+
</AtomicText>)}
|
|
157
|
+
{showCharacterCount && maxLength && (<AtomicText type="bodySmall" color="secondary" style={styles.characterCount} testID={testID ? `${testID}-count` : undefined}>
|
|
158
|
+
{characterCount}/{maxLength}
|
|
159
|
+
</AtomicText>)}
|
|
160
|
+
</View>)}
|
|
161
|
+
</View>);
|
|
162
|
+
};
|
|
163
|
+
const styles = StyleSheet.create({
|
|
164
|
+
container: {
|
|
165
|
+
flexDirection: 'row',
|
|
166
|
+
alignItems: 'center',
|
|
167
|
+
},
|
|
168
|
+
input: {
|
|
169
|
+
flex: 1,
|
|
170
|
+
},
|
|
171
|
+
label: {
|
|
172
|
+
marginBottom: 4,
|
|
173
|
+
},
|
|
174
|
+
leadingIcon: {
|
|
175
|
+
position: 'absolute',
|
|
176
|
+
left: 12,
|
|
177
|
+
zIndex: 1,
|
|
178
|
+
},
|
|
179
|
+
trailingIcon: {
|
|
180
|
+
position: 'absolute',
|
|
181
|
+
right: 12,
|
|
182
|
+
zIndex: 1,
|
|
183
|
+
},
|
|
184
|
+
helperRow: {
|
|
185
|
+
flexDirection: 'row',
|
|
186
|
+
justifyContent: 'space-between',
|
|
187
|
+
marginTop: 4,
|
|
188
|
+
},
|
|
189
|
+
helperText: {
|
|
190
|
+
flex: 1,
|
|
191
|
+
},
|
|
192
|
+
characterCount: {
|
|
193
|
+
marginLeft: 8,
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
//# sourceMappingURL=AtomicInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AtomicInput.js","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAmC,MAAM,cAAc,CAAC;AACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0D1C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACtD,OAAO,GAAG,UAAU,EACpB,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,IAAI,EACX,KAAK,EACL,KAAK,GAAG,EAAE,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,GAAG,KAAK,EAC1B,eAAe,GAAG,KAAK,EACvB,SAAS,EACT,kBAAkB,GAAG,KAAK,EAC1B,YAAY,GAAG,SAAS,EACxB,cAAc,GAAG,WAAW,EAC5B,WAAW,GAAG,IAAI,EAClB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,UAAU,EACV,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IACpC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,KAAK,KAAK,UA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AS,CAAC,CAEhD;cAAA,CAAC,UAAU,CACb;YAAA,EAAE,UAAU,CAAC,CACd,CACD;UAAA,CAAC,kBAAkB,IAAI,SAAS,IAAI,CAClC,CAAC,UAAU,CACT,IAAI,CAAC,WAAW,CAChB,KAAK,CAAC,WAAW,CACjB,KAAK,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAC7B,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAE/C;cAAA,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAC7B;YAAA,EAAE,UAAU,CAAC,CACd,CACH;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;KACrB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;KACR;IACD,KAAK,EAAE;QACL,YAAY,EAAE,CAAC;KAChB;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,CAAC;KACV;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,CAAC;KACV;IACD,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,CAAC;KACb;IACD,UAAU,EAAE;QACV,IAAI,EAAE,CAAC;KACR;IACD,cAAc,EAAE;QACd,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AtomicNumberInput Component
|
|
3
|
+
*
|
|
4
|
+
* A specialized number input component that wraps AtomicInput with
|
|
5
|
+
* number-specific validation and keyboard handling.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Numeric keyboard (integer or decimal)
|
|
9
|
+
* - Min/max validation
|
|
10
|
+
* - Step increment support
|
|
11
|
+
* - Automatic error states for invalid numbers
|
|
12
|
+
* - Parsed number callback (onValueChange)
|
|
13
|
+
* - Consistent styling with AtomicInput
|
|
14
|
+
* - All AtomicInput features (variants, states, sizes)
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const [age, setAge] = useState<number | null>(null);
|
|
19
|
+
*
|
|
20
|
+
* <AtomicNumberInput
|
|
21
|
+
* value={age?.toString() || ''}
|
|
22
|
+
* onValueChange={setAge}
|
|
23
|
+
* label="Age"
|
|
24
|
+
* min={0}
|
|
25
|
+
* max={150}
|
|
26
|
+
* helperText="Enter your age"
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Why This Component:
|
|
31
|
+
* - Separation of concerns (text vs number input)
|
|
32
|
+
* - Built-in number validation
|
|
33
|
+
* - Type-safe number callbacks
|
|
34
|
+
* - Prevents non-numeric input via keyboard
|
|
35
|
+
* - Consistent with AtomicInput styling
|
|
36
|
+
*
|
|
37
|
+
* @module AtomicNumberInput
|
|
38
|
+
*/
|
|
39
|
+
import React from 'react';
|
|
40
|
+
import { AtomicInputProps } from './AtomicInput';
|
|
41
|
+
/**
|
|
42
|
+
* Props for AtomicNumberInput component
|
|
43
|
+
* Extends AtomicInput but removes text-specific props
|
|
44
|
+
*/
|
|
45
|
+
export interface AtomicNumberInputProps extends Omit<AtomicInputProps, 'keyboardType' | 'secureTextEntry' | 'showPasswordToggle' | 'onChangeText'> {
|
|
46
|
+
/** Minimum allowed value */
|
|
47
|
+
min?: number;
|
|
48
|
+
/** Maximum allowed value */
|
|
49
|
+
max?: number;
|
|
50
|
+
/** Step increment (for spinners, future feature) */
|
|
51
|
+
step?: number;
|
|
52
|
+
/** Allow decimal numbers (default: false for integers only) */
|
|
53
|
+
allowDecimal?: boolean;
|
|
54
|
+
/** Callback when valid number is entered (null if invalid/empty) */
|
|
55
|
+
onValueChange?: (value: number | null) => void;
|
|
56
|
+
/** Callback when raw text changes (optional) */
|
|
57
|
+
onTextChange?: (text: string) => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* AtomicNumberInput - Specialized numeric input component
|
|
61
|
+
*
|
|
62
|
+
* Wraps AtomicInput with:
|
|
63
|
+
* - Numeric keyboard
|
|
64
|
+
* - Number validation (min, max, format)
|
|
65
|
+
* - Parsed number callbacks
|
|
66
|
+
* - Automatic error states
|
|
67
|
+
*/
|
|
68
|
+
export declare const AtomicNumberInput: React.FC<AtomicNumberInputProps>;
|
|
69
|
+
//# sourceMappingURL=AtomicNumberInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AtomicNumberInput.d.ts","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicNumberInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAe,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,sBACf,SAAQ,IAAI,CACV,gBAAgB,EAChB,cAAc,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,cAAc,CAC3E;IACD,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oEAAoE;IACpE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,gDAAgD;IAChD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA2G9D,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AtomicNumberInput Component
|
|
3
|
+
*
|
|
4
|
+
* A specialized number input component that wraps AtomicInput with
|
|
5
|
+
* number-specific validation and keyboard handling.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Numeric keyboard (integer or decimal)
|
|
9
|
+
* - Min/max validation
|
|
10
|
+
* - Step increment support
|
|
11
|
+
* - Automatic error states for invalid numbers
|
|
12
|
+
* - Parsed number callback (onValueChange)
|
|
13
|
+
* - Consistent styling with AtomicInput
|
|
14
|
+
* - All AtomicInput features (variants, states, sizes)
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const [age, setAge] = useState<number | null>(null);
|
|
19
|
+
*
|
|
20
|
+
* <AtomicNumberInput
|
|
21
|
+
* value={age?.toString() || ''}
|
|
22
|
+
* onValueChange={setAge}
|
|
23
|
+
* label="Age"
|
|
24
|
+
* min={0}
|
|
25
|
+
* max={150}
|
|
26
|
+
* helperText="Enter your age"
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Why This Component:
|
|
31
|
+
* - Separation of concerns (text vs number input)
|
|
32
|
+
* - Built-in number validation
|
|
33
|
+
* - Type-safe number callbacks
|
|
34
|
+
* - Prevents non-numeric input via keyboard
|
|
35
|
+
* - Consistent with AtomicInput styling
|
|
36
|
+
*
|
|
37
|
+
* @module AtomicNumberInput
|
|
38
|
+
*/
|
|
39
|
+
import React, { useState, useEffect } from 'react';
|
|
40
|
+
import { AtomicInput } from './AtomicInput';
|
|
41
|
+
/**
|
|
42
|
+
* AtomicNumberInput - Specialized numeric input component
|
|
43
|
+
*
|
|
44
|
+
* Wraps AtomicInput with:
|
|
45
|
+
* - Numeric keyboard
|
|
46
|
+
* - Number validation (min, max, format)
|
|
47
|
+
* - Parsed number callbacks
|
|
48
|
+
* - Automatic error states
|
|
49
|
+
*/
|
|
50
|
+
export const AtomicNumberInput = ({ min, max, step = 1, allowDecimal = false, onValueChange, onTextChange, value = '', state: externalState, helperText: externalHelperText, ...props }) => {
|
|
51
|
+
const [internalError, setInternalError] = useState(undefined);
|
|
52
|
+
/**
|
|
53
|
+
* Validate number and return error message if invalid
|
|
54
|
+
*/
|
|
55
|
+
const validateNumber = (text) => {
|
|
56
|
+
// Empty is valid (null value)
|
|
57
|
+
if (!text || text === '' || text === '-' || text === '.') {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
// Parse number
|
|
61
|
+
const num = parseFloat(text);
|
|
62
|
+
// Check if valid number
|
|
63
|
+
if (isNaN(num)) {
|
|
64
|
+
return 'Invalid number';
|
|
65
|
+
}
|
|
66
|
+
// Check min constraint
|
|
67
|
+
if (min !== undefined && num < min) {
|
|
68
|
+
return `Minimum value is ${min}`;
|
|
69
|
+
}
|
|
70
|
+
// Check max constraint
|
|
71
|
+
if (max !== undefined && num > max) {
|
|
72
|
+
return `Maximum value is ${max}`;
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Handle text change with validation
|
|
78
|
+
*/
|
|
79
|
+
const handleChangeText = (text) => {
|
|
80
|
+
// Allow empty, minus sign, and decimal point during typing
|
|
81
|
+
if (text === '' || text === '-' || (allowDecimal && text === '.')) {
|
|
82
|
+
setInternalError(undefined);
|
|
83
|
+
onTextChange?.(text);
|
|
84
|
+
onValueChange?.(null);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
// Validate format
|
|
88
|
+
const decimalRegex = allowDecimal ? /^-?\d*\.?\d*$/ : /^-?\d*$/;
|
|
89
|
+
if (!decimalRegex.test(text)) {
|
|
90
|
+
// Invalid format, don't update
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
// Validate number
|
|
94
|
+
const error = validateNumber(text);
|
|
95
|
+
setInternalError(error);
|
|
96
|
+
// Call text callback
|
|
97
|
+
onTextChange?.(text);
|
|
98
|
+
// Call value callback with parsed number
|
|
99
|
+
if (!error && text !== '' && text !== '-' && text !== '.') {
|
|
100
|
+
const num = parseFloat(text);
|
|
101
|
+
onValueChange?.(isNaN(num) ? null : num);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
onValueChange?.(null);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Validate on mount and when value/constraints change
|
|
109
|
+
*/
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (value) {
|
|
112
|
+
const error = validateNumber(value.toString());
|
|
113
|
+
setInternalError(error);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
setInternalError(undefined);
|
|
117
|
+
}
|
|
118
|
+
}, [value, min, max]);
|
|
119
|
+
// Determine final state (external state overrides internal error)
|
|
120
|
+
const finalState = externalState || (internalError ? 'error' : 'default');
|
|
121
|
+
// Determine final helper text (internal error overrides external helper)
|
|
122
|
+
const finalHelperText = internalError || externalHelperText;
|
|
123
|
+
return (<AtomicInput {...props} value={value} onChangeText={handleChangeText} keyboardType={allowDecimal ? 'decimal-pad' : 'numeric'} state={finalState} helperText={finalHelperText}/>);
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=AtomicNumberInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AtomicNumberInput.js","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicNumberInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,WAAW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,CAAC,CAAC,CAAC;IAEtB,kEAAkE;IAClE,MAAM,UAAU,GAAG,aAAa,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE1E,yEAAyE;IACzE,MAAM,eAAe,GAAG,aAAa,IAAI,kBAAkB,CAAC;IAE5D,OAAO,CACL,CAAC,WAAW,CACV,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,YAAY,CAAC,CAAC,gBAAgB,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CACvD,KAAK,CAAC,CAAC,UAAU,CAAC,CAClB,UAAU,CAAC,CAAC,eAAe,CAAC,EAC5B,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AtomicPicker Component
|
|
3
|
+
*
|
|
4
|
+
* A reusable option picker/dropdown component for selecting from a list of options.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Single and multi-select support
|
|
8
|
+
* - Modal display mode (full-screen on mobile)
|
|
9
|
+
* - Optional search/filter capability
|
|
10
|
+
* - Error and disabled states
|
|
11
|
+
* - Theme-aware styling
|
|
12
|
+
* - Icons for options
|
|
13
|
+
* - Clearable selection
|
|
14
|
+
* - react-hook-form integration ready
|
|
15
|
+
*
|
|
16
|
+
* Architecture:
|
|
17
|
+
* - Follows AtomicButton pattern with separated types and styles
|
|
18
|
+
* - Uses helper functions from picker/styles/pickerStyles.ts
|
|
19
|
+
* - Types defined in picker/types/index.ts
|
|
20
|
+
* - Zero inline StyleSheet.create()
|
|
21
|
+
*
|
|
22
|
+
* Usage:
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const [partyType, setPartyType] = useState('birthday');
|
|
25
|
+
*
|
|
26
|
+
* <AtomicPicker
|
|
27
|
+
* value={partyType}
|
|
28
|
+
* onChange={setPartyType}
|
|
29
|
+
* options={[
|
|
30
|
+
* { label: 'Birthday Party', value: 'birthday', icon: 'cake' },
|
|
31
|
+
* { label: 'Wedding', value: 'wedding', icon: 'heart' },
|
|
32
|
+
* { label: 'Corporate Event', value: 'corporate', icon: 'briefcase' },
|
|
33
|
+
* ]}
|
|
34
|
+
* label="Party Type"
|
|
35
|
+
* placeholder="Select party type"
|
|
36
|
+
* searchable
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @module AtomicPicker
|
|
41
|
+
*/
|
|
42
|
+
import React from 'react';
|
|
43
|
+
import { AtomicPickerProps } from './picker/types';
|
|
44
|
+
export type { AtomicPickerProps, PickerOption, PickerSize } from './picker/types';
|
|
45
|
+
/**
|
|
46
|
+
* AtomicPicker - Universal option picker component
|
|
47
|
+
*
|
|
48
|
+
* Displays a button that opens a modal for selection.
|
|
49
|
+
* Supports single/multi-select, search, and custom rendering.
|
|
50
|
+
*/
|
|
51
|
+
export declare const AtomicPicker: React.FC<AtomicPickerProps>;
|
|
52
|
+
//# sourceMappingURL=AtomicPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AtomicPicker.d.ts","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAA4B,MAAM,OAAO,CAAC;AAYjD,OAAO,EAAE,iBAAiB,EAAgB,MAAM,gBAAgB,CAAC;AAyBjE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAElF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAkXpD,CAAC"}
|