@sincpro/mobile-ui 0.1.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/README.md +32 -0
- package/lib/module/Dialog/BottomSheet/BottomSheet.Root.js +481 -0
- package/lib/module/Dialog/BottomSheet/BottomSheet.Root.js.map +1 -0
- package/lib/module/Dialog/BottomSheet/index.js +4 -0
- package/lib/module/Dialog/BottomSheet/index.js.map +1 -0
- package/lib/module/Dialog/Confirmation.context.js +108 -0
- package/lib/module/Dialog/Confirmation.context.js.map +1 -0
- package/lib/module/Dialog/Dialog.Confirmation.js +69 -0
- package/lib/module/Dialog/Dialog.Confirmation.js.map +1 -0
- package/lib/module/Dialog/Dialog.EditValue.js +115 -0
- package/lib/module/Dialog/Dialog.EditValue.js.map +1 -0
- package/lib/module/Dialog/index.js +14 -0
- package/lib/module/Dialog/index.js.map +1 -0
- package/lib/module/Display/Display.Avatar.js +58 -0
- package/lib/module/Display/Display.Avatar.js.map +1 -0
- package/lib/module/Display/Display.Badge.js +72 -0
- package/lib/module/Display/Display.Badge.js.map +1 -0
- package/lib/module/Display/Display.CopyableText.js +30 -0
- package/lib/module/Display/Display.CopyableText.js.map +1 -0
- package/lib/module/Display/Display.CountRecords.js +27 -0
- package/lib/module/Display/Display.CountRecords.js.map +1 -0
- package/lib/module/Display/Display.Date.js +35 -0
- package/lib/module/Display/Display.Date.js.map +1 -0
- package/lib/module/Display/Display.Divider.js +43 -0
- package/lib/module/Display/Display.Divider.js.map +1 -0
- package/lib/module/Display/Display.Icon.js +83 -0
- package/lib/module/Display/Display.Icon.js.map +1 -0
- package/lib/module/Display/Display.Logo.js +54 -0
- package/lib/module/Display/Display.Logo.js.map +1 -0
- package/lib/module/Display/Display.MenuButton.js +101 -0
- package/lib/module/Display/Display.MenuButton.js.map +1 -0
- package/lib/module/Display/Display.Monetary.js +36 -0
- package/lib/module/Display/Display.Monetary.js.map +1 -0
- package/lib/module/Display/index.js +28 -0
- package/lib/module/Display/index.js.map +1 -0
- package/lib/module/Feedback/ErrorBoundary.js +43 -0
- package/lib/module/Feedback/ErrorBoundary.js.map +1 -0
- package/lib/module/Feedback/Feedback.DomainSplashScreen.js +101 -0
- package/lib/module/Feedback/Feedback.DomainSplashScreen.js.map +1 -0
- package/lib/module/Feedback/Feedback.Empty.js +31 -0
- package/lib/module/Feedback/Feedback.Empty.js.map +1 -0
- package/lib/module/Feedback/Feedback.Error.js +53 -0
- package/lib/module/Feedback/Feedback.Error.js.map +1 -0
- package/lib/module/Feedback/Feedback.Loading.js +24 -0
- package/lib/module/Feedback/Feedback.Loading.js.map +1 -0
- package/lib/module/Feedback/Feedback.Spinner.js +28 -0
- package/lib/module/Feedback/Feedback.Spinner.js.map +1 -0
- package/lib/module/Feedback/Feedback.Splash.js +59 -0
- package/lib/module/Feedback/Feedback.Splash.js.map +1 -0
- package/lib/module/Feedback/index.js +17 -0
- package/lib/module/Feedback/index.js.map +1 -0
- package/lib/module/Form/Form.Button.js +442 -0
- package/lib/module/Form/Form.Button.js.map +1 -0
- package/lib/module/Form/Form.Checkbox.js +71 -0
- package/lib/module/Form/Form.Checkbox.js.map +1 -0
- package/lib/module/Form/Form.ControlledCheckbox.js +29 -0
- package/lib/module/Form/Form.ControlledCheckbox.js.map +1 -0
- package/lib/module/Form/Form.ControlledDropdown.js +7 -0
- package/lib/module/Form/Form.ControlledDropdown.js.map +1 -0
- package/lib/module/Form/Form.ControlledInput.js +43 -0
- package/lib/module/Form/Form.ControlledInput.js.map +1 -0
- package/lib/module/Form/Form.ControlledMonetaryInput.js +34 -0
- package/lib/module/Form/Form.ControlledMonetaryInput.js.map +1 -0
- package/lib/module/Form/Form.ControlledRadioButton.js +28 -0
- package/lib/module/Form/Form.ControlledRadioButton.js.map +1 -0
- package/lib/module/Form/Form.Dropdown.js +163 -0
- package/lib/module/Form/Form.Dropdown.js.map +1 -0
- package/lib/module/Form/Form.FilterButton.js +59 -0
- package/lib/module/Form/Form.FilterButton.js.map +1 -0
- package/lib/module/Form/Form.FractionalQuantityInput.js +166 -0
- package/lib/module/Form/Form.FractionalQuantityInput.js.map +1 -0
- package/lib/module/Form/Form.IconButton.js +97 -0
- package/lib/module/Form/Form.IconButton.js.map +1 -0
- package/lib/module/Form/Form.Input.js +77 -0
- package/lib/module/Form/Form.Input.js.map +1 -0
- package/lib/module/Form/Form.InputField.js +63 -0
- package/lib/module/Form/Form.InputField.js.map +1 -0
- package/lib/module/Form/Form.MonetaryInput.js +65 -0
- package/lib/module/Form/Form.MonetaryInput.js.map +1 -0
- package/lib/module/Form/Form.PasswordInput.js +37 -0
- package/lib/module/Form/Form.PasswordInput.js.map +1 -0
- package/lib/module/Form/Form.QuantitySelector.js +78 -0
- package/lib/module/Form/Form.QuantitySelector.js.map +1 -0
- package/lib/module/Form/Form.RadioButton.js +56 -0
- package/lib/module/Form/Form.RadioButton.js.map +1 -0
- package/lib/module/Form/Form.SearchBar.js +63 -0
- package/lib/module/Form/Form.SearchBar.js.map +1 -0
- package/lib/module/Form/Form.TextInput.js +19 -0
- package/lib/module/Form/Form.TextInput.js.map +1 -0
- package/lib/module/Form/index.js +45 -0
- package/lib/module/Form/index.js.map +1 -0
- package/lib/module/Navigation/Navigation.Header.js +46 -0
- package/lib/module/Navigation/Navigation.Header.js.map +1 -0
- package/lib/module/Navigation/Navigation.HeaderToolbar.js +79 -0
- package/lib/module/Navigation/Navigation.HeaderToolbar.js.map +1 -0
- package/lib/module/Navigation/Navigation.RowItem.js +35 -0
- package/lib/module/Navigation/Navigation.RowItem.js.map +1 -0
- package/lib/module/Navigation/Navigation.TabIcon.js +28 -0
- package/lib/module/Navigation/Navigation.TabIcon.js.map +1 -0
- package/lib/module/Navigation/Navigation.TabItem.js +27 -0
- package/lib/module/Navigation/Navigation.TabItem.js.map +1 -0
- package/lib/module/Navigation/index.js +16 -0
- package/lib/module/Navigation/index.js.map +1 -0
- package/lib/module/Typography/Typography.Heading.js +15 -0
- package/lib/module/Typography/Typography.Heading.js.map +1 -0
- package/lib/module/Typography/Typography.Text.js +51 -0
- package/lib/module/Typography/Typography.Text.js.map +1 -0
- package/lib/module/Typography/index.js +11 -0
- package/lib/module/Typography/index.js.map +1 -0
- package/lib/module/icons/AddItemIcon.js +53 -0
- package/lib/module/icons/AddItemIcon.js.map +1 -0
- package/lib/module/icons/ArrangeCircle.js +50 -0
- package/lib/module/icons/ArrangeCircle.js.map +1 -0
- package/lib/module/icons/ArrowDownIcon.js +37 -0
- package/lib/module/icons/ArrowDownIcon.js.map +1 -0
- package/lib/module/icons/ArrowUpIcon.js +37 -0
- package/lib/module/icons/ArrowUpIcon.js.map +1 -0
- package/lib/module/icons/BoxIcon.js +35 -0
- package/lib/module/icons/BoxIcon.js.map +1 -0
- package/lib/module/icons/BoxTimeIcon.js +29 -0
- package/lib/module/icons/BoxTimeIcon.js.map +1 -0
- package/lib/module/icons/CalendarIcon.js +81 -0
- package/lib/module/icons/CalendarIcon.js.map +1 -0
- package/lib/module/icons/CardIcon.js +46 -0
- package/lib/module/icons/CardIcon.js.map +1 -0
- package/lib/module/icons/CashierIcon.js +20 -0
- package/lib/module/icons/CashierIcon.js.map +1 -0
- package/lib/module/icons/CreditIcon.js +43 -0
- package/lib/module/icons/CreditIcon.js.map +1 -0
- package/lib/module/icons/DuoIcon.js +41 -0
- package/lib/module/icons/DuoIcon.js.map +1 -0
- package/lib/module/icons/HomeIcon.js +20 -0
- package/lib/module/icons/HomeIcon.js.map +1 -0
- package/lib/module/icons/HomeIconOutlined.js +29 -0
- package/lib/module/icons/HomeIconOutlined.js.map +1 -0
- package/lib/module/icons/LogoIcon.js +38 -0
- package/lib/module/icons/LogoIcon.js.map +1 -0
- package/lib/module/icons/MoneyReceiveIcon.js +47 -0
- package/lib/module/icons/MoneyReceiveIcon.js.map +1 -0
- package/lib/module/icons/OdooIcon.js +24 -0
- package/lib/module/icons/OdooIcon.js.map +1 -0
- package/lib/module/icons/PinIcon.js +20 -0
- package/lib/module/icons/PinIcon.js.map +1 -0
- package/lib/module/icons/PrinterIcon.js +48 -0
- package/lib/module/icons/PrinterIcon.js.map +1 -0
- package/lib/module/icons/ProfileIcon.js +23 -0
- package/lib/module/icons/ProfileIcon.js.map +1 -0
- package/lib/module/icons/SettingsIcon.js +65 -0
- package/lib/module/icons/SettingsIcon.js.map +1 -0
- package/lib/module/icons/SinpeIcon.js +37 -0
- package/lib/module/icons/SinpeIcon.js.map +1 -0
- package/lib/module/icons/ToggleOffIcon.js +29 -0
- package/lib/module/icons/ToggleOffIcon.js.map +1 -0
- package/lib/module/icons/WalletMoneyIcon.js +42 -0
- package/lib/module/icons/WalletMoneyIcon.js.map +1 -0
- package/lib/module/icons/icon_getters.js +53 -0
- package/lib/module/icons/icon_getters.js.map +1 -0
- package/lib/module/icons/props.js +2 -0
- package/lib/module/icons/props.js.map +1 -0
- package/lib/module/index.js +34 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/layouts/AuthContainer.js +66 -0
- package/lib/module/layouts/AuthContainer.js.map +1 -0
- package/lib/module/layouts/Container.js +31 -0
- package/lib/module/layouts/Container.js.map +1 -0
- package/lib/module/layouts/GradientContainer.js +20 -0
- package/lib/module/layouts/GradientContainer.js.map +1 -0
- package/lib/module/layouts/PlainLayout.js +16 -0
- package/lib/module/layouts/PlainLayout.js.map +1 -0
- package/lib/module/layouts/ScrollContainer.js +37 -0
- package/lib/module/layouts/ScrollContainer.js.map +1 -0
- package/lib/module/layouts/TabNavigatorLayout.js +132 -0
- package/lib/module/layouts/TabNavigatorLayout.js.map +1 -0
- package/lib/module/lib/date.js +127 -0
- package/lib/module/lib/date.js.map +1 -0
- package/lib/module/lib/icon.js +2 -0
- package/lib/module/lib/icon.js.map +1 -0
- package/lib/module/lib/monetary.js +31 -0
- package/lib/module/lib/monetary.js.map +1 -0
- package/lib/module/lib/quantity.js +46 -0
- package/lib/module/lib/quantity.js.map +1 -0
- package/lib/module/lib/serializer.js +47 -0
- package/lib/module/lib/serializer.js.map +1 -0
- package/lib/module/lib/timezone.js +2 -0
- package/lib/module/lib/timezone.js.map +1 -0
- package/lib/module/nativewind-env.d.js +3 -0
- package/lib/module/nativewind-env.d.js.map +1 -0
- package/lib/module/notifications/index.js +5 -0
- package/lib/module/notifications/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/primitives/BaseButton.js +391 -0
- package/lib/module/primitives/BaseButton.js.map +1 -0
- package/lib/module/primitives/Box.js +19 -0
- package/lib/module/primitives/Box.js.map +1 -0
- package/lib/module/primitives/Row.js +37 -0
- package/lib/module/primitives/Row.js.map +1 -0
- package/lib/module/primitives/Stack.js +27 -0
- package/lib/module/primitives/Stack.js.map +1 -0
- package/lib/module/primitives/index.js +6 -0
- package/lib/module/primitives/index.js.map +1 -0
- package/lib/module/providers/index.js +3 -0
- package/lib/module/providers/index.js.map +1 -0
- package/lib/module/theme/active.js +13 -0
- package/lib/module/theme/active.js.map +1 -0
- package/lib/module/theme/components/ThemedActivityIndicator.js +30 -0
- package/lib/module/theme/components/ThemedActivityIndicator.js.map +1 -0
- package/lib/module/theme/components/index.js +13 -0
- package/lib/module/theme/components/index.js.map +1 -0
- package/lib/module/theme/default.js +91 -0
- package/lib/module/theme/default.js.map +1 -0
- package/lib/module/theme/globals.css +67 -0
- package/lib/module/theme/index.js +6 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/theme.js +18 -0
- package/lib/module/theme/theme.js.map +1 -0
- package/lib/module/theme/tw.js +19 -0
- package/lib/module/theme/tw.js.map +1 -0
- package/lib/module/theme/types.js +2 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/typography.js +246 -0
- package/lib/module/theme/typography.js.map +1 -0
- package/lib/module/theme/useTheme.js +5 -0
- package/lib/module/theme/useTheme.js.map +1 -0
- package/lib/module/views/AuthFormView.js +46 -0
- package/lib/module/views/AuthFormView.js.map +1 -0
- package/lib/module/views/FormViewV2.context.js +47 -0
- package/lib/module/views/FormViewV2.context.js.map +1 -0
- package/lib/module/views/FormViewV2.js +220 -0
- package/lib/module/views/FormViewV2.js.map +1 -0
- package/lib/module/views/ListViewV2.context.js +51 -0
- package/lib/module/views/ListViewV2.context.js.map +1 -0
- package/lib/module/views/ListViewV2.js +503 -0
- package/lib/module/views/ListViewV2.js.map +1 -0
- package/lib/module/views/Wizard/Wizard.context.js +111 -0
- package/lib/module/views/Wizard/Wizard.context.js.map +1 -0
- package/lib/module/views/Wizard/Wizard.js +125 -0
- package/lib/module/views/Wizard/Wizard.js.map +1 -0
- package/lib/module/views/Wizard/index.js +5 -0
- package/lib/module/views/Wizard/index.js.map +1 -0
- package/lib/module/views/types/IFormView.js +4 -0
- package/lib/module/views/types/IFormView.js.map +1 -0
- package/lib/module/views/types/IListView.js +40 -0
- package/lib/module/views/types/IListView.js.map +1 -0
- package/lib/module/views/types/UIItem.js +2 -0
- package/lib/module/views/types/UIItem.js.map +1 -0
- package/lib/module/widgets/CircleButton.js +70 -0
- package/lib/module/widgets/CircleButton.js.map +1 -0
- package/lib/module/widgets/GeoPermissionCard.js +55 -0
- package/lib/module/widgets/GeoPermissionCard.js.map +1 -0
- package/lib/module/widgets/HomeHeader.js +42 -0
- package/lib/module/widgets/HomeHeader.js.map +1 -0
- package/lib/module/widgets/JSONViewer.js +196 -0
- package/lib/module/widgets/JSONViewer.js.map +1 -0
- package/lib/module/widgets/MenuCard.js +32 -0
- package/lib/module/widgets/MenuCard.js.map +1 -0
- package/lib/module/widgets/MenuGrid.js +20 -0
- package/lib/module/widgets/MenuGrid.js.map +1 -0
- package/lib/module/widgets/ScreenHeader.js +63 -0
- package/lib/module/widgets/ScreenHeader.js.map +1 -0
- package/lib/module/widgets/TimeZoneSelector.js +73 -0
- package/lib/module/widgets/TimeZoneSelector.js.map +1 -0
- package/lib/module/widgets/TimeZoneSelectorModal.js +187 -0
- package/lib/module/widgets/TimeZoneSelectorModal.js.map +1 -0
- package/lib/module/widgets/index.js +9 -0
- package/lib/module/widgets/index.js.map +1 -0
- package/lib/typescript/Dialog/BottomSheet/BottomSheet.Root.d.ts +321 -0
- package/lib/typescript/Dialog/BottomSheet/BottomSheet.Root.d.ts.map +1 -0
- package/lib/typescript/Dialog/BottomSheet/index.d.ts +2 -0
- package/lib/typescript/Dialog/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/Dialog/Confirmation.context.d.ts +22 -0
- package/lib/typescript/Dialog/Confirmation.context.d.ts.map +1 -0
- package/lib/typescript/Dialog/Dialog.Confirmation.d.ts +13 -0
- package/lib/typescript/Dialog/Dialog.Confirmation.d.ts.map +1 -0
- package/lib/typescript/Dialog/Dialog.EditValue.d.ts +26 -0
- package/lib/typescript/Dialog/Dialog.EditValue.d.ts.map +1 -0
- package/lib/typescript/Dialog/index.d.ts +20 -0
- package/lib/typescript/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/Display/Display.Avatar.d.ts +53 -0
- package/lib/typescript/Display/Display.Avatar.d.ts.map +1 -0
- package/lib/typescript/Display/Display.Badge.d.ts +109 -0
- package/lib/typescript/Display/Display.Badge.d.ts.map +1 -0
- package/lib/typescript/Display/Display.CopyableText.d.ts +14 -0
- package/lib/typescript/Display/Display.CopyableText.d.ts.map +1 -0
- package/lib/typescript/Display/Display.CountRecords.d.ts +9 -0
- package/lib/typescript/Display/Display.CountRecords.d.ts.map +1 -0
- package/lib/typescript/Display/Display.Date.d.ts +19 -0
- package/lib/typescript/Display/Display.Date.d.ts.map +1 -0
- package/lib/typescript/Display/Display.Divider.d.ts +45 -0
- package/lib/typescript/Display/Display.Divider.d.ts.map +1 -0
- package/lib/typescript/Display/Display.Icon.d.ts +16 -0
- package/lib/typescript/Display/Display.Icon.d.ts.map +1 -0
- package/lib/typescript/Display/Display.Logo.d.ts +56 -0
- package/lib/typescript/Display/Display.Logo.d.ts.map +1 -0
- package/lib/typescript/Display/Display.MenuButton.d.ts +104 -0
- package/lib/typescript/Display/Display.MenuButton.d.ts.map +1 -0
- package/lib/typescript/Display/Display.Monetary.d.ts +20 -0
- package/lib/typescript/Display/Display.Monetary.d.ts.map +1 -0
- package/lib/typescript/Display/index.d.ts +23 -0
- package/lib/typescript/Display/index.d.ts.map +1 -0
- package/lib/typescript/Feedback/ErrorBoundary.d.ts +19 -0
- package/lib/typescript/Feedback/ErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/Feedback/Feedback.DomainSplashScreen.d.ts +12 -0
- package/lib/typescript/Feedback/Feedback.DomainSplashScreen.d.ts.map +1 -0
- package/lib/typescript/Feedback/Feedback.Empty.d.ts +7 -0
- package/lib/typescript/Feedback/Feedback.Empty.d.ts.map +1 -0
- package/lib/typescript/Feedback/Feedback.Error.d.ts +10 -0
- package/lib/typescript/Feedback/Feedback.Error.d.ts.map +1 -0
- package/lib/typescript/Feedback/Feedback.Loading.d.ts +10 -0
- package/lib/typescript/Feedback/Feedback.Loading.d.ts.map +1 -0
- package/lib/typescript/Feedback/Feedback.Spinner.d.ts +12 -0
- package/lib/typescript/Feedback/Feedback.Spinner.d.ts.map +1 -0
- package/lib/typescript/Feedback/Feedback.Splash.d.ts +12 -0
- package/lib/typescript/Feedback/Feedback.Splash.d.ts.map +1 -0
- package/lib/typescript/Feedback/index.d.ts +14 -0
- package/lib/typescript/Feedback/index.d.ts.map +1 -0
- package/lib/typescript/Form/Form.Button.d.ts +146 -0
- package/lib/typescript/Form/Form.Button.d.ts.map +1 -0
- package/lib/typescript/Form/Form.Checkbox.d.ts +14 -0
- package/lib/typescript/Form/Form.Checkbox.d.ts.map +1 -0
- package/lib/typescript/Form/Form.ControlledCheckbox.d.ts +10 -0
- package/lib/typescript/Form/Form.ControlledCheckbox.d.ts.map +1 -0
- package/lib/typescript/Form/Form.ControlledDropdown.d.ts +15 -0
- package/lib/typescript/Form/Form.ControlledDropdown.d.ts.map +1 -0
- package/lib/typescript/Form/Form.ControlledInput.d.ts +16 -0
- package/lib/typescript/Form/Form.ControlledInput.d.ts.map +1 -0
- package/lib/typescript/Form/Form.ControlledMonetaryInput.d.ts +13 -0
- package/lib/typescript/Form/Form.ControlledMonetaryInput.d.ts.map +1 -0
- package/lib/typescript/Form/Form.ControlledRadioButton.d.ts +10 -0
- package/lib/typescript/Form/Form.ControlledRadioButton.d.ts.map +1 -0
- package/lib/typescript/Form/Form.Dropdown.d.ts +15 -0
- package/lib/typescript/Form/Form.Dropdown.d.ts.map +1 -0
- package/lib/typescript/Form/Form.FilterButton.d.ts +13 -0
- package/lib/typescript/Form/Form.FilterButton.d.ts.map +1 -0
- package/lib/typescript/Form/Form.FractionalQuantityInput.d.ts +14 -0
- package/lib/typescript/Form/Form.FractionalQuantityInput.d.ts.map +1 -0
- package/lib/typescript/Form/Form.IconButton.d.ts +68 -0
- package/lib/typescript/Form/Form.IconButton.d.ts.map +1 -0
- package/lib/typescript/Form/Form.Input.d.ts +11 -0
- package/lib/typescript/Form/Form.Input.d.ts.map +1 -0
- package/lib/typescript/Form/Form.InputField.d.ts +11 -0
- package/lib/typescript/Form/Form.InputField.d.ts.map +1 -0
- package/lib/typescript/Form/Form.MonetaryInput.d.ts +9 -0
- package/lib/typescript/Form/Form.MonetaryInput.d.ts.map +1 -0
- package/lib/typescript/Form/Form.PasswordInput.d.ts +10 -0
- package/lib/typescript/Form/Form.PasswordInput.d.ts.map +1 -0
- package/lib/typescript/Form/Form.QuantitySelector.d.ts +12 -0
- package/lib/typescript/Form/Form.QuantitySelector.d.ts.map +1 -0
- package/lib/typescript/Form/Form.RadioButton.d.ts +8 -0
- package/lib/typescript/Form/Form.RadioButton.d.ts.map +1 -0
- package/lib/typescript/Form/Form.SearchBar.d.ts +10 -0
- package/lib/typescript/Form/Form.SearchBar.d.ts.map +1 -0
- package/lib/typescript/Form/Form.TextInput.d.ts +9 -0
- package/lib/typescript/Form/Form.TextInput.d.ts.map +1 -0
- package/lib/typescript/Form/index.d.ts +42 -0
- package/lib/typescript/Form/index.d.ts.map +1 -0
- package/lib/typescript/Navigation/Navigation.Header.d.ts +11 -0
- package/lib/typescript/Navigation/Navigation.Header.d.ts.map +1 -0
- package/lib/typescript/Navigation/Navigation.HeaderToolbar.d.ts +16 -0
- package/lib/typescript/Navigation/Navigation.HeaderToolbar.d.ts.map +1 -0
- package/lib/typescript/Navigation/Navigation.RowItem.d.ts +6 -0
- package/lib/typescript/Navigation/Navigation.RowItem.d.ts.map +1 -0
- package/lib/typescript/Navigation/Navigation.TabIcon.d.ts +15 -0
- package/lib/typescript/Navigation/Navigation.TabIcon.d.ts.map +1 -0
- package/lib/typescript/Navigation/Navigation.TabItem.d.ts +15 -0
- package/lib/typescript/Navigation/Navigation.TabItem.d.ts.map +1 -0
- package/lib/typescript/Navigation/index.d.ts +12 -0
- package/lib/typescript/Navigation/index.d.ts.map +1 -0
- package/lib/typescript/Typography/Typography.Heading.d.ts +13 -0
- package/lib/typescript/Typography/Typography.Heading.d.ts.map +1 -0
- package/lib/typescript/Typography/Typography.Text.d.ts +29 -0
- package/lib/typescript/Typography/Typography.Text.d.ts.map +1 -0
- package/lib/typescript/Typography/index.d.ts +8 -0
- package/lib/typescript/Typography/index.d.ts.map +1 -0
- package/lib/typescript/icons/AddItemIcon.d.ts +5 -0
- package/lib/typescript/icons/AddItemIcon.d.ts.map +1 -0
- package/lib/typescript/icons/ArrangeCircle.d.ts +5 -0
- package/lib/typescript/icons/ArrangeCircle.d.ts.map +1 -0
- package/lib/typescript/icons/ArrowDownIcon.d.ts +5 -0
- package/lib/typescript/icons/ArrowDownIcon.d.ts.map +1 -0
- package/lib/typescript/icons/ArrowUpIcon.d.ts +5 -0
- package/lib/typescript/icons/ArrowUpIcon.d.ts.map +1 -0
- package/lib/typescript/icons/BoxIcon.d.ts +5 -0
- package/lib/typescript/icons/BoxIcon.d.ts.map +1 -0
- package/lib/typescript/icons/BoxTimeIcon.d.ts +5 -0
- package/lib/typescript/icons/BoxTimeIcon.d.ts.map +1 -0
- package/lib/typescript/icons/CalendarIcon.d.ts +5 -0
- package/lib/typescript/icons/CalendarIcon.d.ts.map +1 -0
- package/lib/typescript/icons/CardIcon.d.ts +5 -0
- package/lib/typescript/icons/CardIcon.d.ts.map +1 -0
- package/lib/typescript/icons/CashierIcon.d.ts +5 -0
- package/lib/typescript/icons/CashierIcon.d.ts.map +1 -0
- package/lib/typescript/icons/CreditIcon.d.ts +8 -0
- package/lib/typescript/icons/CreditIcon.d.ts.map +1 -0
- package/lib/typescript/icons/DuoIcon.d.ts +5 -0
- package/lib/typescript/icons/DuoIcon.d.ts.map +1 -0
- package/lib/typescript/icons/HomeIcon.d.ts +5 -0
- package/lib/typescript/icons/HomeIcon.d.ts.map +1 -0
- package/lib/typescript/icons/HomeIconOutlined.d.ts +5 -0
- package/lib/typescript/icons/HomeIconOutlined.d.ts.map +1 -0
- package/lib/typescript/icons/LogoIcon.d.ts +5 -0
- package/lib/typescript/icons/LogoIcon.d.ts.map +1 -0
- package/lib/typescript/icons/MoneyReceiveIcon.d.ts +5 -0
- package/lib/typescript/icons/MoneyReceiveIcon.d.ts.map +1 -0
- package/lib/typescript/icons/OdooIcon.d.ts +7 -0
- package/lib/typescript/icons/OdooIcon.d.ts.map +1 -0
- package/lib/typescript/icons/PinIcon.d.ts +5 -0
- package/lib/typescript/icons/PinIcon.d.ts.map +1 -0
- package/lib/typescript/icons/PrinterIcon.d.ts +5 -0
- package/lib/typescript/icons/PrinterIcon.d.ts.map +1 -0
- package/lib/typescript/icons/ProfileIcon.d.ts +5 -0
- package/lib/typescript/icons/ProfileIcon.d.ts.map +1 -0
- package/lib/typescript/icons/SettingsIcon.d.ts +5 -0
- package/lib/typescript/icons/SettingsIcon.d.ts.map +1 -0
- package/lib/typescript/icons/SinpeIcon.d.ts +5 -0
- package/lib/typescript/icons/SinpeIcon.d.ts.map +1 -0
- package/lib/typescript/icons/ToggleOffIcon.d.ts +5 -0
- package/lib/typescript/icons/ToggleOffIcon.d.ts.map +1 -0
- package/lib/typescript/icons/WalletMoneyIcon.d.ts +5 -0
- package/lib/typescript/icons/WalletMoneyIcon.d.ts.map +1 -0
- package/lib/typescript/icons/icon_getters.d.ts +7 -0
- package/lib/typescript/icons/icon_getters.d.ts.map +1 -0
- package/lib/typescript/icons/props.d.ts +5 -0
- package/lib/typescript/icons/props.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +21 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/layouts/AuthContainer.d.ts +10 -0
- package/lib/typescript/layouts/AuthContainer.d.ts.map +1 -0
- package/lib/typescript/layouts/Container.d.ts +15 -0
- package/lib/typescript/layouts/Container.d.ts.map +1 -0
- package/lib/typescript/layouts/GradientContainer.d.ts +9 -0
- package/lib/typescript/layouts/GradientContainer.d.ts.map +1 -0
- package/lib/typescript/layouts/PlainLayout.d.ts +7 -0
- package/lib/typescript/layouts/PlainLayout.d.ts.map +1 -0
- package/lib/typescript/layouts/ScrollContainer.d.ts +9 -0
- package/lib/typescript/layouts/ScrollContainer.d.ts.map +1 -0
- package/lib/typescript/layouts/TabNavigatorLayout.d.ts +27 -0
- package/lib/typescript/layouts/TabNavigatorLayout.d.ts.map +1 -0
- package/lib/typescript/lib/date.d.ts +71 -0
- package/lib/typescript/lib/date.d.ts.map +1 -0
- package/lib/typescript/lib/icon.d.ts +2 -0
- package/lib/typescript/lib/icon.d.ts.map +1 -0
- package/lib/typescript/lib/monetary.d.ts +4 -0
- package/lib/typescript/lib/monetary.d.ts.map +1 -0
- package/lib/typescript/lib/quantity.d.ts +12 -0
- package/lib/typescript/lib/quantity.d.ts.map +1 -0
- package/lib/typescript/lib/serializer.d.ts +3 -0
- package/lib/typescript/lib/serializer.d.ts.map +1 -0
- package/lib/typescript/lib/timezone.d.ts +5 -0
- package/lib/typescript/lib/timezone.d.ts.map +1 -0
- package/lib/typescript/notifications/index.d.ts +2 -0
- package/lib/typescript/notifications/index.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/primitives/BaseButton.d.ts +147 -0
- package/lib/typescript/primitives/BaseButton.d.ts.map +1 -0
- package/lib/typescript/primitives/Box.d.ts +8 -0
- package/lib/typescript/primitives/Box.d.ts.map +1 -0
- package/lib/typescript/primitives/Row.d.ts +12 -0
- package/lib/typescript/primitives/Row.d.ts.map +1 -0
- package/lib/typescript/primitives/Stack.d.ts +10 -0
- package/lib/typescript/primitives/Stack.d.ts.map +1 -0
- package/lib/typescript/primitives/index.d.ts +4 -0
- package/lib/typescript/primitives/index.d.ts.map +1 -0
- package/lib/typescript/providers/index.d.ts +1 -0
- package/lib/typescript/providers/index.d.ts.map +1 -0
- package/lib/typescript/theme/active.d.ts +4 -0
- package/lib/typescript/theme/active.d.ts.map +1 -0
- package/lib/typescript/theme/components/ThemedActivityIndicator.d.ts +22 -0
- package/lib/typescript/theme/components/ThemedActivityIndicator.d.ts.map +1 -0
- package/lib/typescript/theme/components/index.d.ts +10 -0
- package/lib/typescript/theme/components/index.d.ts.map +1 -0
- package/lib/typescript/theme/default.d.ts +3 -0
- package/lib/typescript/theme/default.d.ts.map +1 -0
- package/lib/typescript/theme/index.d.ts +5 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/theme/theme.d.ts +14 -0
- package/lib/typescript/theme/theme.d.ts.map +1 -0
- package/lib/typescript/theme/tw.d.ts +11 -0
- package/lib/typescript/theme/tw.d.ts.map +1 -0
- package/lib/typescript/theme/types.d.ts +93 -0
- package/lib/typescript/theme/types.d.ts.map +1 -0
- package/lib/typescript/theme/typography.d.ts +377 -0
- package/lib/typescript/theme/typography.d.ts.map +1 -0
- package/lib/typescript/theme/useTheme.d.ts +2 -0
- package/lib/typescript/theme/useTheme.d.ts.map +1 -0
- package/lib/typescript/views/AuthFormView.d.ts +10 -0
- package/lib/typescript/views/AuthFormView.d.ts.map +1 -0
- package/lib/typescript/views/FormViewV2.context.d.ts +33 -0
- package/lib/typescript/views/FormViewV2.context.d.ts.map +1 -0
- package/lib/typescript/views/FormViewV2.d.ts +61 -0
- package/lib/typescript/views/FormViewV2.d.ts.map +1 -0
- package/lib/typescript/views/ListViewV2.context.d.ts +37 -0
- package/lib/typescript/views/ListViewV2.context.d.ts.map +1 -0
- package/lib/typescript/views/ListViewV2.d.ts +132 -0
- package/lib/typescript/views/ListViewV2.d.ts.map +1 -0
- package/lib/typescript/views/Wizard/Wizard.context.d.ts +27 -0
- package/lib/typescript/views/Wizard/Wizard.context.d.ts.map +1 -0
- package/lib/typescript/views/Wizard/Wizard.d.ts +34 -0
- package/lib/typescript/views/Wizard/Wizard.d.ts.map +1 -0
- package/lib/typescript/views/Wizard/index.d.ts +5 -0
- package/lib/typescript/views/Wizard/index.d.ts.map +1 -0
- package/lib/typescript/views/types/IFormView.d.ts +23 -0
- package/lib/typescript/views/types/IFormView.d.ts.map +1 -0
- package/lib/typescript/views/types/IListView.d.ts +35 -0
- package/lib/typescript/views/types/IListView.d.ts.map +1 -0
- package/lib/typescript/views/types/UIItem.d.ts +22 -0
- package/lib/typescript/views/types/UIItem.d.ts.map +1 -0
- package/lib/typescript/widgets/CircleButton.d.ts +16 -0
- package/lib/typescript/widgets/CircleButton.d.ts.map +1 -0
- package/lib/typescript/widgets/GeoPermissionCard.d.ts +9 -0
- package/lib/typescript/widgets/GeoPermissionCard.d.ts.map +1 -0
- package/lib/typescript/widgets/HomeHeader.d.ts +10 -0
- package/lib/typescript/widgets/HomeHeader.d.ts.map +1 -0
- package/lib/typescript/widgets/JSONViewer.d.ts +6 -0
- package/lib/typescript/widgets/JSONViewer.d.ts.map +1 -0
- package/lib/typescript/widgets/MenuCard.d.ts +14 -0
- package/lib/typescript/widgets/MenuCard.d.ts.map +1 -0
- package/lib/typescript/widgets/MenuGrid.d.ts +18 -0
- package/lib/typescript/widgets/MenuGrid.d.ts.map +1 -0
- package/lib/typescript/widgets/ScreenHeader.d.ts +20 -0
- package/lib/typescript/widgets/ScreenHeader.d.ts.map +1 -0
- package/lib/typescript/widgets/TimeZoneSelector.d.ts +8 -0
- package/lib/typescript/widgets/TimeZoneSelector.d.ts.map +1 -0
- package/lib/typescript/widgets/TimeZoneSelectorModal.d.ts +10 -0
- package/lib/typescript/widgets/TimeZoneSelectorModal.d.ts.map +1 -0
- package/lib/typescript/widgets/index.d.ts +8 -0
- package/lib/typescript/widgets/index.d.ts.map +1 -0
- package/package.json +273 -0
- package/sincpro_mobile_ui/Dialog/BottomSheet/BottomSheet.Root.tsx +509 -0
- package/sincpro_mobile_ui/Dialog/BottomSheet/index.ts +1 -0
- package/sincpro_mobile_ui/Dialog/Confirmation.context.tsx +148 -0
- package/sincpro_mobile_ui/Dialog/Dialog.Confirmation.tsx +68 -0
- package/sincpro_mobile_ui/Dialog/Dialog.EditValue.tsx +134 -0
- package/sincpro_mobile_ui/Dialog/index.ts +23 -0
- package/sincpro_mobile_ui/Display/Display.Avatar.tsx +60 -0
- package/sincpro_mobile_ui/Display/Display.Badge.tsx +72 -0
- package/sincpro_mobile_ui/Display/Display.CopyableText.tsx +38 -0
- package/sincpro_mobile_ui/Display/Display.CountRecords.tsx +26 -0
- package/sincpro_mobile_ui/Display/Display.Date.tsx +59 -0
- package/sincpro_mobile_ui/Display/Display.Divider.tsx +40 -0
- package/sincpro_mobile_ui/Display/Display.Icon.tsx +69 -0
- package/sincpro_mobile_ui/Display/Display.Logo.tsx +51 -0
- package/sincpro_mobile_ui/Display/Display.MenuButton.tsx +103 -0
- package/sincpro_mobile_ui/Display/Display.Monetary.tsx +60 -0
- package/sincpro_mobile_ui/Display/index.ts +28 -0
- package/sincpro_mobile_ui/Feedback/ErrorBoundary.tsx +51 -0
- package/sincpro_mobile_ui/Feedback/Feedback.DomainSplashScreen.tsx +135 -0
- package/sincpro_mobile_ui/Feedback/Feedback.Empty.tsx +29 -0
- package/sincpro_mobile_ui/Feedback/Feedback.Error.tsx +47 -0
- package/sincpro_mobile_ui/Feedback/Feedback.Loading.tsx +27 -0
- package/sincpro_mobile_ui/Feedback/Feedback.Spinner.tsx +34 -0
- package/sincpro_mobile_ui/Feedback/Feedback.Splash.tsx +68 -0
- package/sincpro_mobile_ui/Feedback/index.ts +17 -0
- package/sincpro_mobile_ui/Form/Form.Button.tsx +461 -0
- package/sincpro_mobile_ui/Form/Form.Checkbox.tsx +89 -0
- package/sincpro_mobile_ui/Form/Form.ControlledCheckbox.tsx +34 -0
- package/sincpro_mobile_ui/Form/Form.ControlledDropdown.tsx +22 -0
- package/sincpro_mobile_ui/Form/Form.ControlledInput.tsx +53 -0
- package/sincpro_mobile_ui/Form/Form.ControlledMonetaryInput.tsx +41 -0
- package/sincpro_mobile_ui/Form/Form.ControlledRadioButton.tsx +33 -0
- package/sincpro_mobile_ui/Form/Form.Dropdown.tsx +171 -0
- package/sincpro_mobile_ui/Form/Form.FilterButton.tsx +59 -0
- package/sincpro_mobile_ui/Form/Form.FractionalQuantityInput.tsx +190 -0
- package/sincpro_mobile_ui/Form/Form.IconButton.tsx +102 -0
- package/sincpro_mobile_ui/Form/Form.Input.tsx +88 -0
- package/sincpro_mobile_ui/Form/Form.InputField.tsx +66 -0
- package/sincpro_mobile_ui/Form/Form.MonetaryInput.tsx +66 -0
- package/sincpro_mobile_ui/Form/Form.PasswordInput.tsx +42 -0
- package/sincpro_mobile_ui/Form/Form.QuantitySelector.tsx +81 -0
- package/sincpro_mobile_ui/Form/Form.RadioButton.tsx +52 -0
- package/sincpro_mobile_ui/Form/Form.SearchBar.tsx +64 -0
- package/sincpro_mobile_ui/Form/Form.TextInput.tsx +26 -0
- package/sincpro_mobile_ui/Form/index.ts +46 -0
- package/sincpro_mobile_ui/Navigation/Navigation.Header.tsx +50 -0
- package/sincpro_mobile_ui/Navigation/Navigation.HeaderToolbar.tsx +111 -0
- package/sincpro_mobile_ui/Navigation/Navigation.RowItem.tsx +33 -0
- package/sincpro_mobile_ui/Navigation/Navigation.TabIcon.tsx +45 -0
- package/sincpro_mobile_ui/Navigation/Navigation.TabItem.tsx +43 -0
- package/sincpro_mobile_ui/Navigation/index.ts +15 -0
- package/sincpro_mobile_ui/Typography/Typography.Heading.tsx +20 -0
- package/sincpro_mobile_ui/Typography/Typography.Text.tsx +78 -0
- package/sincpro_mobile_ui/Typography/index.ts +11 -0
- package/sincpro_mobile_ui/icons/AddItemIcon.tsx +46 -0
- package/sincpro_mobile_ui/icons/ArrangeCircle.tsx +50 -0
- package/sincpro_mobile_ui/icons/ArrowDownIcon.tsx +33 -0
- package/sincpro_mobile_ui/icons/ArrowUpIcon.tsx +33 -0
- package/sincpro_mobile_ui/icons/BoxIcon.tsx +32 -0
- package/sincpro_mobile_ui/icons/BoxTimeIcon.tsx +27 -0
- package/sincpro_mobile_ui/icons/CalendarIcon.tsx +85 -0
- package/sincpro_mobile_ui/icons/CardIcon.tsx +44 -0
- package/sincpro_mobile_ui/icons/CashierIcon.tsx +15 -0
- package/sincpro_mobile_ui/icons/CreditIcon.tsx +44 -0
- package/sincpro_mobile_ui/icons/DuoIcon.tsx +39 -0
- package/sincpro_mobile_ui/icons/HomeIcon.tsx +15 -0
- package/sincpro_mobile_ui/icons/HomeIconOutlined.tsx +24 -0
- package/sincpro_mobile_ui/icons/LogoIcon.tsx +39 -0
- package/sincpro_mobile_ui/icons/MoneyReceiveIcon.tsx +46 -0
- package/sincpro_mobile_ui/icons/OdooIcon.tsx +23 -0
- package/sincpro_mobile_ui/icons/PinIcon.tsx +15 -0
- package/sincpro_mobile_ui/icons/PrinterIcon.tsx +46 -0
- package/sincpro_mobile_ui/icons/ProfileIcon.tsx +19 -0
- package/sincpro_mobile_ui/icons/SettingsIcon.tsx +66 -0
- package/sincpro_mobile_ui/icons/SinpeIcon.tsx +29 -0
- package/sincpro_mobile_ui/icons/ToggleOffIcon.tsx +25 -0
- package/sincpro_mobile_ui/icons/WalletMoneyIcon.tsx +41 -0
- package/sincpro_mobile_ui/icons/icon_getters.tsx +27 -0
- package/sincpro_mobile_ui/icons/props.ts +4 -0
- package/sincpro_mobile_ui/index.ts +38 -0
- package/sincpro_mobile_ui/layouts/AuthContainer.tsx +73 -0
- package/sincpro_mobile_ui/layouts/Container.tsx +40 -0
- package/sincpro_mobile_ui/layouts/GradientContainer.tsx +22 -0
- package/sincpro_mobile_ui/layouts/PlainLayout.tsx +14 -0
- package/sincpro_mobile_ui/layouts/ScrollContainer.tsx +37 -0
- package/sincpro_mobile_ui/layouts/TabNavigatorLayout.tsx +154 -0
- package/sincpro_mobile_ui/lib/date.ts +149 -0
- package/sincpro_mobile_ui/lib/icon.ts +10 -0
- package/sincpro_mobile_ui/lib/monetary.ts +33 -0
- package/sincpro_mobile_ui/lib/quantity.ts +52 -0
- package/sincpro_mobile_ui/lib/serializer.ts +59 -0
- package/sincpro_mobile_ui/lib/timezone.ts +4 -0
- package/sincpro_mobile_ui/nativewind-env.d.ts +1 -0
- package/sincpro_mobile_ui/notifications/index.ts +2 -0
- package/sincpro_mobile_ui/primitives/BaseButton.tsx +404 -0
- package/sincpro_mobile_ui/primitives/Box.tsx +14 -0
- package/sincpro_mobile_ui/primitives/Row.tsx +55 -0
- package/sincpro_mobile_ui/primitives/Stack.tsx +29 -0
- package/sincpro_mobile_ui/primitives/index.ts +3 -0
- package/sincpro_mobile_ui/providers/index.ts +1 -0
- package/sincpro_mobile_ui/theme/active.ts +12 -0
- package/sincpro_mobile_ui/theme/components/ThemedActivityIndicator.tsx +29 -0
- package/sincpro_mobile_ui/theme/components/index.ts +10 -0
- package/sincpro_mobile_ui/theme/default.ts +81 -0
- package/sincpro_mobile_ui/theme/globals.css +67 -0
- package/sincpro_mobile_ui/theme/index.ts +4 -0
- package/sincpro_mobile_ui/theme/theme.ts +16 -0
- package/sincpro_mobile_ui/theme/tw.ts +16 -0
- package/sincpro_mobile_ui/theme/types.ts +109 -0
- package/sincpro_mobile_ui/theme/typography.ts +271 -0
- package/sincpro_mobile_ui/theme/useTheme.ts +3 -0
- package/sincpro_mobile_ui/views/AuthFormView.tsx +46 -0
- package/sincpro_mobile_ui/views/FormViewV2.context.tsx +79 -0
- package/sincpro_mobile_ui/views/FormViewV2.tsx +248 -0
- package/sincpro_mobile_ui/views/ListViewV2.context.tsx +87 -0
- package/sincpro_mobile_ui/views/ListViewV2.tsx +575 -0
- package/sincpro_mobile_ui/views/Wizard/Wizard.context.tsx +164 -0
- package/sincpro_mobile_ui/views/Wizard/Wizard.tsx +147 -0
- package/sincpro_mobile_ui/views/Wizard/index.ts +11 -0
- package/sincpro_mobile_ui/views/types/IFormView.ts +24 -0
- package/sincpro_mobile_ui/views/types/IListView.ts +78 -0
- package/sincpro_mobile_ui/views/types/UIItem.ts +23 -0
- package/sincpro_mobile_ui/widgets/CircleButton.tsx +63 -0
- package/sincpro_mobile_ui/widgets/GeoPermissionCard.tsx +62 -0
- package/sincpro_mobile_ui/widgets/HomeHeader.tsx +50 -0
- package/sincpro_mobile_ui/widgets/JSONViewer.tsx +192 -0
- package/sincpro_mobile_ui/widgets/MenuCard.tsx +37 -0
- package/sincpro_mobile_ui/widgets/MenuGrid.tsx +33 -0
- package/sincpro_mobile_ui/widgets/ScreenHeader.tsx +72 -0
- package/sincpro_mobile_ui/widgets/TimeZoneSelector.tsx +83 -0
- package/sincpro_mobile_ui/widgets/TimeZoneSelectorModal.tsx +179 -0
- package/sincpro_mobile_ui/widgets/index.ts +7 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Dimensions,
|
|
4
|
+
Keyboard,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
TouchableWithoutFeedback,
|
|
7
|
+
View,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
|
|
10
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
11
|
+
|
|
12
|
+
import { Display } from "../Display";
|
|
13
|
+
import { theme } from "../theme";
|
|
14
|
+
import { cn } from "../theme/tw";
|
|
15
|
+
import GradientContainer from "./GradientContainer";
|
|
16
|
+
|
|
17
|
+
interface AuthContainerProps {
|
|
18
|
+
header: ReactNode;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
onBackPress?: () => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function AuthContainer({ header, children, onBackPress, className }: AuthContainerProps) {
|
|
25
|
+
const screenHeight = Dimensions.get("window").height;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<GradientContainer className={cn("flex-1", className)}>
|
|
29
|
+
<SafeAreaView className="flex-1" edges={["top"]}>
|
|
30
|
+
<View className="flex-1">
|
|
31
|
+
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
32
|
+
<View
|
|
33
|
+
className="justify-center items-center relative"
|
|
34
|
+
style={{ height: screenHeight * 0.3 }}
|
|
35
|
+
>
|
|
36
|
+
{onBackPress && (
|
|
37
|
+
<TouchableOpacity
|
|
38
|
+
className="absolute top-4 left-4 p-2 z-[1]"
|
|
39
|
+
onPress={onBackPress}
|
|
40
|
+
>
|
|
41
|
+
<Display.Icon
|
|
42
|
+
color={theme.text.inverse}
|
|
43
|
+
name="arrow-back"
|
|
44
|
+
size={24}
|
|
45
|
+
type="ionicons"
|
|
46
|
+
/>
|
|
47
|
+
</TouchableOpacity>
|
|
48
|
+
)}
|
|
49
|
+
{header}
|
|
50
|
+
</View>
|
|
51
|
+
</TouchableWithoutFeedback>
|
|
52
|
+
<View
|
|
53
|
+
className="flex-1 bg-bg-card rounded-t-3xl shadow-lg"
|
|
54
|
+
style={{ minHeight: screenHeight * 0.7 }}
|
|
55
|
+
>
|
|
56
|
+
<KeyboardAwareScrollView
|
|
57
|
+
bottomOffset={50}
|
|
58
|
+
bounces={false}
|
|
59
|
+
className="flex-1"
|
|
60
|
+
contentContainerClassName="flex-grow pb-10"
|
|
61
|
+
keyboardShouldPersistTaps="handled"
|
|
62
|
+
showsVerticalScrollIndicator={false}
|
|
63
|
+
>
|
|
64
|
+
<View className="p-4">{children}</View>
|
|
65
|
+
</KeyboardAwareScrollView>
|
|
66
|
+
</View>
|
|
67
|
+
</View>
|
|
68
|
+
</SafeAreaView>
|
|
69
|
+
</GradientContainer>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default AuthContainer;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from "react";
|
|
2
|
+
import { StatusBar, ViewStyle } from "react-native";
|
|
3
|
+
import { Edge, SafeAreaView } from "react-native-safe-area-context";
|
|
4
|
+
|
|
5
|
+
import { theme } from "../theme";
|
|
6
|
+
import { cn } from "../theme/tw";
|
|
7
|
+
|
|
8
|
+
type ContainerProps = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
style?: ViewStyle;
|
|
11
|
+
statusBarColor?: string;
|
|
12
|
+
barStyle?: "light-content" | "dark-content";
|
|
13
|
+
statusBarHidden?: boolean;
|
|
14
|
+
edges?: Edge[];
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const Container: FC<ContainerProps> = ({
|
|
19
|
+
children,
|
|
20
|
+
style,
|
|
21
|
+
statusBarColor = theme.primary,
|
|
22
|
+
barStyle = "light-content",
|
|
23
|
+
statusBarHidden = false,
|
|
24
|
+
edges = ["top", "bottom", "left", "right"],
|
|
25
|
+
className,
|
|
26
|
+
}) => {
|
|
27
|
+
return (
|
|
28
|
+
<SafeAreaView className={cn("flex-1 bg-bg-page", className)} edges={edges} style={style}>
|
|
29
|
+
<StatusBar
|
|
30
|
+
backgroundColor={statusBarColor}
|
|
31
|
+
barStyle={barStyle}
|
|
32
|
+
hidden={statusBarHidden}
|
|
33
|
+
translucent={false}
|
|
34
|
+
/>
|
|
35
|
+
{children}
|
|
36
|
+
</SafeAreaView>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default Container;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LinearGradient } from "expo-linear-gradient";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
|
|
6
|
+
interface GradientContainerProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
style?: object;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const GradientContainer = ({ children, style, className }: GradientContainerProps) => {
|
|
13
|
+
const gradientColors = theme.gradient.primary;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<LinearGradient className={className} colors={[...gradientColors]} style={style}>
|
|
17
|
+
{children}
|
|
18
|
+
</LinearGradient>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default GradientContainer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { memo, ReactNode } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
interface PlainLayoutProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const PlainLayout = memo(({ children }: PlainLayoutProps) => {
|
|
9
|
+
return <View className="flex-1">{children}</View>;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
PlainLayout.displayName = "PlainLayout";
|
|
13
|
+
|
|
14
|
+
export default PlainLayout;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { KeyboardAvoidingView, Platform, ScrollView, StatusBar, View } from "react-native";
|
|
3
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../theme/tw";
|
|
6
|
+
|
|
7
|
+
type ScrollContainerProps = {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
contentContainerStyle?: object;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function ScrollContainer({
|
|
14
|
+
children,
|
|
15
|
+
contentContainerStyle = {},
|
|
16
|
+
className,
|
|
17
|
+
}: ScrollContainerProps) {
|
|
18
|
+
return (
|
|
19
|
+
<SafeAreaView className={cn("flex-1 bg-bg-card", className)}>
|
|
20
|
+
<StatusBar barStyle="dark-content" translucent={false} />
|
|
21
|
+
<KeyboardAvoidingView
|
|
22
|
+
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
|
23
|
+
className="flex-1"
|
|
24
|
+
>
|
|
25
|
+
<ScrollView
|
|
26
|
+
contentContainerStyle={[{ flexGrow: 1, padding: 16 }, contentContainerStyle]}
|
|
27
|
+
keyboardShouldPersistTaps="handled"
|
|
28
|
+
showsVerticalScrollIndicator={false}
|
|
29
|
+
>
|
|
30
|
+
<View className="flex-1">{children}</View>
|
|
31
|
+
</ScrollView>
|
|
32
|
+
</KeyboardAvoidingView>
|
|
33
|
+
</SafeAreaView>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default ScrollContainer;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import React, { Children, isValidElement, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { TouchableOpacity, View } from "react-native";
|
|
3
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
+
|
|
5
|
+
import { Display } from "../Display";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
import Container from "./Container";
|
|
8
|
+
|
|
9
|
+
interface TabNavigatorLayoutProps {
|
|
10
|
+
className?: string;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
content?: ReactNode;
|
|
13
|
+
currentPath?: string;
|
|
14
|
+
onTabPress?: (path: string) => void;
|
|
15
|
+
persistentComponent?: ReactNode;
|
|
16
|
+
persistentRoutePath?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface TabProps {
|
|
20
|
+
path: string;
|
|
21
|
+
label: string;
|
|
22
|
+
Icon: any;
|
|
23
|
+
onReselect?: () => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface TabNavigatorProps {
|
|
27
|
+
items: TabProps[];
|
|
28
|
+
currentPath?: string;
|
|
29
|
+
onTabPress?: (path: string) => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function TabIcon({ focused, Icon }: { focused: boolean; Icon: any }): ReactElement {
|
|
33
|
+
return (
|
|
34
|
+
<View className="justify-center items-center w-10 h-10">
|
|
35
|
+
{focused && <View className="absolute w-10 h-10 rounded-full bg-primary" />}
|
|
36
|
+
<Display.Icon
|
|
37
|
+
color={focused ? "#FFFFFF" : "#6B7280"}
|
|
38
|
+
customIcon={Icon}
|
|
39
|
+
size={24}
|
|
40
|
+
type="custom"
|
|
41
|
+
/>
|
|
42
|
+
</View>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function TabNavigator({
|
|
47
|
+
items,
|
|
48
|
+
currentPath,
|
|
49
|
+
onTabPress,
|
|
50
|
+
}: TabNavigatorProps): ReactElement | null {
|
|
51
|
+
const insets = useSafeAreaInsets();
|
|
52
|
+
const Text = Typography.Text;
|
|
53
|
+
|
|
54
|
+
if (!items.length) return null;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<View
|
|
58
|
+
className="border-t border-border-default bg-bg-card"
|
|
59
|
+
style={{ paddingBottom: Math.max(insets.bottom, 8) }}
|
|
60
|
+
>
|
|
61
|
+
<View className="mt-2 h-16 flex-row justify-around items-center px-2">
|
|
62
|
+
{items.map(({ path, label, Icon, onReselect }) => {
|
|
63
|
+
const focused = currentPath === path;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<TouchableOpacity
|
|
67
|
+
className="items-center justify-center flex-1"
|
|
68
|
+
key={path}
|
|
69
|
+
onPress={() => {
|
|
70
|
+
if (focused && onReselect) {
|
|
71
|
+
onReselect();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
onTabPress?.(path);
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
<TabIcon focused={focused} Icon={Icon} />
|
|
78
|
+
<Text
|
|
79
|
+
className={`text-xs mt-1.5 font-medium ${focused ? "text-primary" : "text-text-secondary"}`}
|
|
80
|
+
>
|
|
81
|
+
{label}
|
|
82
|
+
</Text>
|
|
83
|
+
</TouchableOpacity>
|
|
84
|
+
);
|
|
85
|
+
})}
|
|
86
|
+
</View>
|
|
87
|
+
</View>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function Tabs({ children: tabsChildren }: { children?: ReactNode }) {
|
|
92
|
+
return <>{tabsChildren}</>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function Tab(_props: TabProps) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function TabNavigatorLayoutComponent({
|
|
100
|
+
className,
|
|
101
|
+
children,
|
|
102
|
+
content,
|
|
103
|
+
currentPath,
|
|
104
|
+
onTabPress,
|
|
105
|
+
persistentComponent,
|
|
106
|
+
persistentRoutePath,
|
|
107
|
+
}: TabNavigatorLayoutProps): ReactElement {
|
|
108
|
+
const tabs: TabProps[] = [];
|
|
109
|
+
|
|
110
|
+
Children.forEach(children, (child) => {
|
|
111
|
+
if (!isValidElement(child)) return;
|
|
112
|
+
if (child.type === Tabs) {
|
|
113
|
+
const tabsChildren = (child.props as { children?: ReactNode }).children;
|
|
114
|
+
|
|
115
|
+
Children.forEach(tabsChildren, (tabChild) => {
|
|
116
|
+
if (!isValidElement(tabChild)) return;
|
|
117
|
+
if (tabChild.type === Tab) {
|
|
118
|
+
tabs.push(tabChild.props as TabProps);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const isPersistentRouteActive =
|
|
125
|
+
persistentRoutePath && currentPath ? currentPath.includes(persistentRoutePath) : false;
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<Container className={className} edges={["top", "left", "right"]}>
|
|
129
|
+
<View className="flex-1 bg-bg-page">
|
|
130
|
+
{persistentComponent && (
|
|
131
|
+
<View style={{ flex: 1, display: isPersistentRouteActive ? "flex" : "none" }}>
|
|
132
|
+
{persistentComponent}
|
|
133
|
+
</View>
|
|
134
|
+
)}
|
|
135
|
+
<View style={{ flex: 1, display: isPersistentRouteActive ? "none" : "flex" }}>
|
|
136
|
+
{content}
|
|
137
|
+
</View>
|
|
138
|
+
</View>
|
|
139
|
+
<TabNavigator currentPath={currentPath} items={tabs} onTabPress={onTabPress} />
|
|
140
|
+
</Container>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
type TabLayoutComponent = ((props: TabNavigatorLayoutProps) => ReactElement) & {
|
|
145
|
+
Tabs: typeof Tabs;
|
|
146
|
+
Tab: typeof Tab;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const TabNavigatorLayout = Object.assign(TabNavigatorLayoutComponent, {
|
|
150
|
+
Tabs,
|
|
151
|
+
Tab,
|
|
152
|
+
}) as TabLayoutComponent;
|
|
153
|
+
|
|
154
|
+
export default TabNavigatorLayout;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import timezone from "dayjs/plugin/timezone";
|
|
3
|
+
import utc from "dayjs/plugin/utc";
|
|
4
|
+
import { getLocales } from "expo-localization";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_TIMEZONE = "America/Costa_Rica";
|
|
7
|
+
const DEFAULT_LOCALE = "es-CR";
|
|
8
|
+
|
|
9
|
+
dayjs.extend(utc);
|
|
10
|
+
dayjs.extend(timezone);
|
|
11
|
+
|
|
12
|
+
interface FormatDateOptions {
|
|
13
|
+
locale?: string | null;
|
|
14
|
+
showTime?: boolean; // Si no se especifica se auto-detecta según si la entrada trae hora
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Formatea una fecha en la zona horaria indicada respetando la granularidad de la entrada.
|
|
19
|
+
*
|
|
20
|
+
* Reglas de detección:
|
|
21
|
+
* 1. Si `input` es un string 'YYYY-MM-DD' (solo fecha) => se interpreta como medianoche (00:00:00)
|
|
22
|
+
* en la zona horaria destino y se devuelve SOLO la parte de fecha (sin hora).
|
|
23
|
+
* 2. Si `input` incluye componente de tiempo (ISO completo o Date) => se convierte a la zona destino
|
|
24
|
+
* y se muestra fecha + hora (HH:MM) salvo que se fuerce lo contrario mediante `options.showTime`.
|
|
25
|
+
* 3. Cuando `options.showTime` es `true` o `false` se sobre‑escribe la auto‑detección.
|
|
26
|
+
* 4. Si `timezone` es null/undefined o inválido se retorna la cadena "Error de formateo".
|
|
27
|
+
*
|
|
28
|
+
* Localización:
|
|
29
|
+
* - Usa el primer locale del dispositivo (`expo-localization`) como predeterminado.
|
|
30
|
+
* - Puedes forzar uno diferente con `options.locale` (ej: 'es-CR', 'en-US').
|
|
31
|
+
*
|
|
32
|
+
* Seguridad de zona horaria:
|
|
33
|
+
* - El parse de una fecha sin hora NO se hace en la zona local del dispositivo para luego convertir,
|
|
34
|
+
* sino directamente en la zona destino para evitar corrimientos de día.
|
|
35
|
+
*
|
|
36
|
+
* Ejemplos:
|
|
37
|
+
* ```ts
|
|
38
|
+
* formatDate('2025-09-02', 'America/Costa_Rica');
|
|
39
|
+
* // => "2 de septiembre de 2025"
|
|
40
|
+
*
|
|
41
|
+
* formatDate('2025-09-02T18:30:00Z', 'America/Costa_Rica');
|
|
42
|
+
* // => "2 de septiembre de 2025, 12:30 p. m." (dependiendo del locale real)
|
|
43
|
+
*
|
|
44
|
+
* formatDate(new Date('2025-09-02T23:15:00Z'), 'Europe/Madrid');
|
|
45
|
+
* // => "3 de septiembre de 2025, 01:15" (cambio de día por zona +02)
|
|
46
|
+
*
|
|
47
|
+
* formatDate('2025-09-02', 'America/Costa_Rica', { showTime: true });
|
|
48
|
+
* // => "2 de septiembre de 2025, 12:00 a. m." (fuerza hora)
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @param input Fecha (string ISO, 'YYYY-MM-DD' o instancia Date)
|
|
52
|
+
* @param timezone Zona horaria IANA (ej: 'America/Costa_Rica', 'Asia/Tokyo'). Si es null/undefined usa Costa Rica
|
|
53
|
+
* @param options Opcional: locale forzado y/o bandera para mostrar hora
|
|
54
|
+
* @returns Cadena localizada o "Error de formateo" si no se puede procesar
|
|
55
|
+
*/
|
|
56
|
+
export function formatDate(
|
|
57
|
+
input: string | Date,
|
|
58
|
+
timezone: string | null | undefined,
|
|
59
|
+
options?: FormatDateOptions,
|
|
60
|
+
): string {
|
|
61
|
+
// Usar timezone por defecto si no se proporciona
|
|
62
|
+
const effectiveTimezone = timezone || DEFAULT_TIMEZONE;
|
|
63
|
+
|
|
64
|
+
const fallbackLocale = DEFAULT_LOCALE.split("-")[0]; // "es" from "es-CR"
|
|
65
|
+
const deviceLocale = getLocales()?.[0]?.languageTag ?? fallbackLocale;
|
|
66
|
+
const usedLocale = options?.locale ?? deviceLocale;
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
const rawStr = typeof input === "string" ? input : input.toISOString();
|
|
70
|
+
const isDateOnly = /^\d{4}-\d{2}-\d{2}$/.test(rawStr);
|
|
71
|
+
|
|
72
|
+
// Auto-detect showTime si no se pasa explicitamente
|
|
73
|
+
const effectiveShowTime =
|
|
74
|
+
options?.showTime !== undefined
|
|
75
|
+
? options.showTime
|
|
76
|
+
: !isDateOnly && /T\d{2}:\d{2}/.test(rawStr); // tiene componente hora
|
|
77
|
+
|
|
78
|
+
const dateInstance = isDateOnly
|
|
79
|
+
? dayjs.tz(`${rawStr}T00:00:00`, effectiveTimezone)
|
|
80
|
+
: dayjs.utc(rawStr).tz(effectiveTimezone);
|
|
81
|
+
const dateInZone = dateInstance.toDate();
|
|
82
|
+
|
|
83
|
+
const formatOptions: Intl.DateTimeFormatOptions = {
|
|
84
|
+
year: "numeric",
|
|
85
|
+
month: "long",
|
|
86
|
+
day: "numeric",
|
|
87
|
+
timeZone: effectiveTimezone,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
if (effectiveShowTime) {
|
|
91
|
+
formatOptions.hour = "2-digit";
|
|
92
|
+
formatOptions.minute = "2-digit";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return new Intl.DateTimeFormat(usedLocale, formatOptions).format(dateInZone);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.warn("Error formateando fecha:", error);
|
|
98
|
+
return "Error de formateo";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Formatea una fecha usando automáticamente el timezone por defecto (Costa Rica).
|
|
104
|
+
* Útil para casos donde no se tiene acceso al timezone del usuario.
|
|
105
|
+
*
|
|
106
|
+
* @param input Fecha (string ISO, 'YYYY-MM-DD' o instancia Date)
|
|
107
|
+
* @param options Opcional: locale forzado y/o bandera para mostrar hora
|
|
108
|
+
* @returns Cadena localizada en timezone de Costa Rica
|
|
109
|
+
*/
|
|
110
|
+
export function formatDateWithDefaultTimezone(
|
|
111
|
+
input: string | Date,
|
|
112
|
+
options?: FormatDateOptions,
|
|
113
|
+
): string {
|
|
114
|
+
return formatDate(input, DEFAULT_TIMEZONE, options);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Obtiene la fecha actual en formato YYYY-MM-DD en el timezone especificado.
|
|
119
|
+
* Útil para crear fechas de programación que respeten el timezone del usuario.
|
|
120
|
+
*
|
|
121
|
+
* @param timezone Zona horaria IANA. Si es null/undefined usa Costa Rica
|
|
122
|
+
* @returns Fecha actual en formato YYYY-MM-DD en el timezone especificado
|
|
123
|
+
*/
|
|
124
|
+
export function getCurrentDateInTimezone(timezone?: string | null): string {
|
|
125
|
+
const effectiveTimezone = timezone || DEFAULT_TIMEZONE;
|
|
126
|
+
try {
|
|
127
|
+
return dayjs().tz(effectiveTimezone).format("YYYY-MM-DD");
|
|
128
|
+
} catch (error) {
|
|
129
|
+
console.warn("Error obteniendo fecha actual en timezone:", error);
|
|
130
|
+
return dayjs().format("YYYY-MM-DD"); // Fallback to local
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Obtiene la fecha y hora actual en formato ISO en el timezone especificado.
|
|
136
|
+
* Útil para timestamps que necesiten reflejar el timezone del usuario.
|
|
137
|
+
*
|
|
138
|
+
* @param timezone Zona horaria IANA. Si es null/undefined usa Costa Rica
|
|
139
|
+
* @returns Fecha actual en formato ISO en el timezone especificado
|
|
140
|
+
*/
|
|
141
|
+
export function getCurrentDateTimeInTimezone(timezone?: string | null): string {
|
|
142
|
+
const effectiveTimezone = timezone || DEFAULT_TIMEZONE;
|
|
143
|
+
try {
|
|
144
|
+
return dayjs().tz(effectiveTimezone).toISOString();
|
|
145
|
+
} catch (error) {
|
|
146
|
+
console.warn("Error obteniendo fecha/hora actual en timezone:", error);
|
|
147
|
+
return dayjs().toISOString(); // Fallback to local
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Big } from "big.js";
|
|
2
|
+
|
|
3
|
+
export function parseToMonetaryNumber(input?: string | number | null): number {
|
|
4
|
+
if (input == null) return 0;
|
|
5
|
+
const s = String(input).trim();
|
|
6
|
+
if (!/[0-9]/.test(s)) return 0;
|
|
7
|
+
|
|
8
|
+
const cleaned = s.replace(/[^0-9.-]+/g, "");
|
|
9
|
+
try {
|
|
10
|
+
return Number(new Big(cleaned).toString());
|
|
11
|
+
} catch {
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function formatTwoDecimals(value?: number | string | null): string {
|
|
17
|
+
const raw = parseToMonetaryNumber(value);
|
|
18
|
+
const rounded = new Big(raw).toFixed(2);
|
|
19
|
+
const num = Number(rounded);
|
|
20
|
+
return new Intl.NumberFormat("de-DE", {
|
|
21
|
+
minimumFractionDigits: 2,
|
|
22
|
+
maximumFractionDigits: 2,
|
|
23
|
+
}).format(num);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function calculateDiscountedTotal(total: number, discount: number): number {
|
|
27
|
+
if (discount === 0) {
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const result = (parseToMonetaryNumber(total) * discount) / 100;
|
|
32
|
+
return parseToMonetaryNumber(result);
|
|
33
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Big } from "big.js";
|
|
2
|
+
|
|
3
|
+
/** Redondea a la precisión indicada usando round half up */
|
|
4
|
+
export function roundTo(value: number, precision: number): number {
|
|
5
|
+
if (isNaN(value)) return 0;
|
|
6
|
+
const factor = new Big(10).pow(precision);
|
|
7
|
+
return Number(new Big(value).times(factor).round(0, 1).div(factor).toString());
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Normaliza la cantidad al múltiplo más cercano del incremento mínimo */
|
|
11
|
+
export function normalizeQuantity(
|
|
12
|
+
value: number,
|
|
13
|
+
minIncrement: number,
|
|
14
|
+
precision: number,
|
|
15
|
+
): number {
|
|
16
|
+
if (!isFinite(value)) return 0;
|
|
17
|
+
if (value < 0) value = 0;
|
|
18
|
+
if (minIncrement <= 0) return roundTo(value, precision);
|
|
19
|
+
const steps = Math.round(value / minIncrement);
|
|
20
|
+
const normalized = steps * minIncrement;
|
|
21
|
+
return roundTo(normalized, precision);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Convierte un valor a entero escalado según precisión para cálculos seguros */
|
|
25
|
+
export function toScaledInt(value: number, precision: number): number {
|
|
26
|
+
if (!isFinite(value)) return 0;
|
|
27
|
+
const factor = Math.pow(10, precision);
|
|
28
|
+
return Math.round(value * factor);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function fromScaledInt(scaled: number, precision: number): number {
|
|
32
|
+
const factor = Math.pow(10, precision);
|
|
33
|
+
return scaled / factor;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Multiplicación segura evitando errores binarios típicos */
|
|
37
|
+
export function safeMul(a: number, b: number, precision: number): number {
|
|
38
|
+
const factor = Math.pow(10, precision);
|
|
39
|
+
return (Math.round(a * factor) * Math.round(b * factor)) / (factor * factor);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Valida si un valor es múltiplo del incremento mínimo dentro de la precisión */
|
|
43
|
+
export function isMultipleOfIncrement(
|
|
44
|
+
value: number,
|
|
45
|
+
minIncrement: number,
|
|
46
|
+
precision: number,
|
|
47
|
+
): boolean {
|
|
48
|
+
if (minIncrement <= 0) return true;
|
|
49
|
+
const scaledValue = toScaledInt(value, precision + 3); // extra precisión para reducir error
|
|
50
|
+
const scaledInc = toScaledInt(minIncrement, precision + 3);
|
|
51
|
+
return scaledValue % scaledInc === 0;
|
|
52
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export function safeJsonStringify(obj: any, pretty: boolean = false): string {
|
|
2
|
+
const seen = new WeakSet();
|
|
3
|
+
|
|
4
|
+
if (pretty) {
|
|
5
|
+
return JSON.stringify(
|
|
6
|
+
obj,
|
|
7
|
+
(key, value) => {
|
|
8
|
+
if (key.startsWith("_")) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (value instanceof Map) {
|
|
13
|
+
return Object.fromEntries(value);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (value instanceof Set) {
|
|
17
|
+
return Array.from(value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof value === "object" && value !== null) {
|
|
21
|
+
if (seen.has(value)) {
|
|
22
|
+
return "[Circular]";
|
|
23
|
+
}
|
|
24
|
+
seen.add(value);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return value;
|
|
28
|
+
},
|
|
29
|
+
2,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return JSON.stringify(obj, (key, value) => {
|
|
34
|
+
if (key.startsWith("_")) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (value instanceof Map) {
|
|
39
|
+
return Object.fromEntries(value);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (value instanceof Set) {
|
|
43
|
+
return Array.from(value);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (typeof value === "object" && value !== null) {
|
|
47
|
+
if (seen.has(value)) {
|
|
48
|
+
return "[Circular]";
|
|
49
|
+
}
|
|
50
|
+
seen.add(value);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return value;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function safeJsonParse(json: string): any {
|
|
58
|
+
return JSON.parse(json);
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="nativewind/types" />
|