@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,461 @@
|
|
|
1
|
+
import { LinearGradient } from "expo-linear-gradient";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { FC, useCallback } from "react";
|
|
4
|
+
import { ActivityIndicator, TouchableOpacity, View } from "react-native";
|
|
5
|
+
import { runOnJS } from "react-native-reanimated";
|
|
6
|
+
|
|
7
|
+
import { useConfirmationContext } from "../Dialog/Confirmation.context";
|
|
8
|
+
import { Display } from "../Display";
|
|
9
|
+
import { theme } from "../theme";
|
|
10
|
+
import { tv, type VariantProps } from "../theme/tw";
|
|
11
|
+
import { Typography } from "../Typography";
|
|
12
|
+
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// STYLE VARIANTS
|
|
15
|
+
// ============================================================================
|
|
16
|
+
|
|
17
|
+
const button = tv({
|
|
18
|
+
base: "rounded-lg items-center justify-center flex-row min-h-[44px]",
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
primary: "shadow-sm",
|
|
22
|
+
accent: "shadow-sm",
|
|
23
|
+
secondary: "bg-bg-card border border-primary shadow-sm",
|
|
24
|
+
outline: "bg-transparent border border-primary",
|
|
25
|
+
outlineDanger: "bg-transparent border border-danger",
|
|
26
|
+
outlineBlack: "bg-transparent border border-border-strong",
|
|
27
|
+
flat: "bg-text-primary/10",
|
|
28
|
+
link: "bg-transparent min-h-0",
|
|
29
|
+
transparent: "bg-transparent border border-border-light",
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
small: "py-1.5 px-3 min-h-[36px]",
|
|
33
|
+
medium: "py-2.5 px-4 min-h-[44px]",
|
|
34
|
+
large: "py-3 px-5 min-h-[48px]",
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
true: "opacity-70",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "primary",
|
|
42
|
+
size: "medium",
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const buttonIcon = tv({
|
|
47
|
+
base: "rounded-lg items-center justify-center aspect-square",
|
|
48
|
+
variants: {
|
|
49
|
+
variant: {
|
|
50
|
+
primary: "shadow-sm",
|
|
51
|
+
accent: "shadow-sm",
|
|
52
|
+
secondary: "bg-bg-card border border-primary shadow-sm",
|
|
53
|
+
outline: "bg-transparent border border-primary",
|
|
54
|
+
outlineDanger: "bg-transparent border border-danger",
|
|
55
|
+
outlineBlack: "bg-transparent border border-border-strong",
|
|
56
|
+
flat: "bg-text-primary/10",
|
|
57
|
+
link: "bg-transparent",
|
|
58
|
+
transparent: "bg-transparent border border-border-light",
|
|
59
|
+
},
|
|
60
|
+
size: {
|
|
61
|
+
small: "w-9 h-9",
|
|
62
|
+
medium: "w-11 h-11",
|
|
63
|
+
large: "w-[52px] h-[52px]",
|
|
64
|
+
},
|
|
65
|
+
disabled: {
|
|
66
|
+
true: "opacity-70",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
variant: "primary",
|
|
71
|
+
size: "medium",
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const textColor = tv({
|
|
76
|
+
variants: {
|
|
77
|
+
variant: {
|
|
78
|
+
primary: "text-white",
|
|
79
|
+
accent: "text-white",
|
|
80
|
+
secondary: "text-primary",
|
|
81
|
+
outline: "text-primary",
|
|
82
|
+
outlineDanger: "text-danger",
|
|
83
|
+
outlineBlack: "text-text-primary",
|
|
84
|
+
flat: "text-text-primary",
|
|
85
|
+
link: "text-primary",
|
|
86
|
+
transparent: "text-white",
|
|
87
|
+
},
|
|
88
|
+
disabled: {
|
|
89
|
+
true: "opacity-50",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
compoundVariants: [
|
|
93
|
+
{
|
|
94
|
+
variant: "primary",
|
|
95
|
+
disabled: true,
|
|
96
|
+
className: "text-white/70",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
variant: "accent",
|
|
100
|
+
disabled: true,
|
|
101
|
+
className: "text-white/70",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
variant: "transparent",
|
|
105
|
+
disabled: true,
|
|
106
|
+
className: "text-white/70",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
variant: ["secondary", "outline", "link"],
|
|
110
|
+
disabled: true,
|
|
111
|
+
className: "text-text-secondary",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
variant: "outlineDanger",
|
|
115
|
+
disabled: true,
|
|
116
|
+
className: "text-danger/50",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
variant: "outlineBlack",
|
|
120
|
+
disabled: true,
|
|
121
|
+
className: "text-text-primary/50",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
variant: "flat",
|
|
125
|
+
disabled: true,
|
|
126
|
+
className: "text-text-primary/50",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
defaultVariants: {
|
|
130
|
+
variant: "primary",
|
|
131
|
+
disabled: false,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// ============================================================================
|
|
136
|
+
// COLOR & SIZE MAPS (Dynamic with theme)
|
|
137
|
+
// ============================================================================
|
|
138
|
+
|
|
139
|
+
function getLoadingColorDynamic(variant: string): string {
|
|
140
|
+
const map: Record<string, string> = {
|
|
141
|
+
primary: theme.text.inverse,
|
|
142
|
+
accent: theme.text.inverse,
|
|
143
|
+
secondary: theme.primary,
|
|
144
|
+
outline: theme.primary,
|
|
145
|
+
outlineDanger: theme.danger,
|
|
146
|
+
outlineBlack: theme.text.primary,
|
|
147
|
+
flat: theme.text.primary,
|
|
148
|
+
link: theme.primary,
|
|
149
|
+
transparent: theme.text.inverse,
|
|
150
|
+
};
|
|
151
|
+
return map[variant] ?? theme.text.inverse;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function getIconColorDynamic(variant: string, disabled: boolean): string {
|
|
155
|
+
if (disabled) {
|
|
156
|
+
const disabledMap: Record<string, string> = {
|
|
157
|
+
primary: theme.icon.inverse + "70",
|
|
158
|
+
accent: theme.icon.inverse + "70",
|
|
159
|
+
secondary: theme.icon.disabled,
|
|
160
|
+
outline: theme.icon.disabled,
|
|
161
|
+
outlineDanger: theme.danger + "7f",
|
|
162
|
+
outlineBlack: theme.text.primary + "7f",
|
|
163
|
+
flat: theme.text.primary + "7f",
|
|
164
|
+
link: theme.icon.disabled,
|
|
165
|
+
transparent: theme.icon.inverse + "70",
|
|
166
|
+
};
|
|
167
|
+
return disabledMap[variant] ?? theme.icon.disabled;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const enabledMap: Record<string, string> = {
|
|
171
|
+
primary: theme.icon.inverse,
|
|
172
|
+
accent: theme.icon.inverse,
|
|
173
|
+
secondary: theme.primary,
|
|
174
|
+
outline: theme.primary,
|
|
175
|
+
outlineDanger: theme.danger,
|
|
176
|
+
outlineBlack: theme.text.primary,
|
|
177
|
+
flat: theme.text.primary,
|
|
178
|
+
link: theme.primary,
|
|
179
|
+
transparent: theme.icon.inverse,
|
|
180
|
+
};
|
|
181
|
+
return enabledMap[variant] ?? theme.icon.inverse;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const iconSizeMap = {
|
|
185
|
+
small: 16,
|
|
186
|
+
medium: 20,
|
|
187
|
+
large: 28,
|
|
188
|
+
} as const;
|
|
189
|
+
|
|
190
|
+
const textVariantMap = {
|
|
191
|
+
small: "buttonSmall" as const,
|
|
192
|
+
medium: "button" as const,
|
|
193
|
+
large: "buttonLarge" as const,
|
|
194
|
+
} as const;
|
|
195
|
+
|
|
196
|
+
// ============================================================================
|
|
197
|
+
// HELPER FUNCTIONS
|
|
198
|
+
// ============================================================================
|
|
199
|
+
|
|
200
|
+
function getLoadingColor(variant: string): string {
|
|
201
|
+
return getLoadingColorDynamic(variant);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function getIconColor(variant: string, disabled: boolean): string {
|
|
205
|
+
return getIconColorDynamic(variant, disabled);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function getIconSize(size: string): number {
|
|
209
|
+
return iconSizeMap[size as keyof typeof iconSizeMap] ?? 20;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function getTextVariant(size: string): "buttonSmall" | "button" | "buttonLarge" {
|
|
213
|
+
return textVariantMap[size as keyof typeof textVariantMap] ?? "button";
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// ============================================================================
|
|
217
|
+
// BUTTON COMPONENT
|
|
218
|
+
// ============================================================================
|
|
219
|
+
|
|
220
|
+
export interface ButtonProps extends VariantProps<typeof button> {
|
|
221
|
+
title: string;
|
|
222
|
+
onPress?: () => void;
|
|
223
|
+
confirm?: string;
|
|
224
|
+
loading?: boolean;
|
|
225
|
+
disabled?: boolean;
|
|
226
|
+
className?: string;
|
|
227
|
+
icon?: React.ReactNode;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const Button: FC<ButtonProps> = ({
|
|
231
|
+
title,
|
|
232
|
+
onPress,
|
|
233
|
+
confirm,
|
|
234
|
+
variant = "primary",
|
|
235
|
+
size = "medium",
|
|
236
|
+
loading = false,
|
|
237
|
+
disabled = false,
|
|
238
|
+
className,
|
|
239
|
+
icon,
|
|
240
|
+
}) => {
|
|
241
|
+
const { show, hide } = useConfirmationContext();
|
|
242
|
+
|
|
243
|
+
const textColorClass = textColor({
|
|
244
|
+
variant: (variant as any) ?? "primary",
|
|
245
|
+
disabled,
|
|
246
|
+
});
|
|
247
|
+
const loadingColorValue = getLoadingColor((variant as any) ?? "primary");
|
|
248
|
+
const textVariantValue = getTextVariant((size as any) ?? "medium");
|
|
249
|
+
|
|
250
|
+
const handlePress = useCallback(() => {
|
|
251
|
+
if (confirm && onPress) {
|
|
252
|
+
show({
|
|
253
|
+
title: "Confirmar acción",
|
|
254
|
+
message: confirm,
|
|
255
|
+
confirmText: "Confirmar",
|
|
256
|
+
cancelText: "Cancelar",
|
|
257
|
+
onConfirm: () => {
|
|
258
|
+
hide();
|
|
259
|
+
runOnJS(onPress)();
|
|
260
|
+
},
|
|
261
|
+
onCancel: () => hide(),
|
|
262
|
+
});
|
|
263
|
+
} else if (onPress) {
|
|
264
|
+
runOnJS(onPress)();
|
|
265
|
+
}
|
|
266
|
+
}, [onPress, confirm, show, hide]);
|
|
267
|
+
|
|
268
|
+
if (variant === "link") {
|
|
269
|
+
return (
|
|
270
|
+
<TouchableOpacity
|
|
271
|
+
activeOpacity={0.7}
|
|
272
|
+
className={className}
|
|
273
|
+
disabled={disabled || loading}
|
|
274
|
+
onPress={handlePress}
|
|
275
|
+
>
|
|
276
|
+
{loading ? (
|
|
277
|
+
<ActivityIndicator color={loadingColorValue} size="small" />
|
|
278
|
+
) : (
|
|
279
|
+
<Typography.Text className={textColorClass} variant={textVariantValue}>
|
|
280
|
+
{title}
|
|
281
|
+
</Typography.Text>
|
|
282
|
+
)}
|
|
283
|
+
</TouchableOpacity>
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (variant === "primary" || variant === "accent") {
|
|
288
|
+
const gradientColors: readonly [string, string] =
|
|
289
|
+
variant === "primary" ? theme.gradient.primary : theme.gradient.accent;
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<LinearGradient
|
|
293
|
+
colors={gradientColors}
|
|
294
|
+
end={{ x: 1, y: 1 }}
|
|
295
|
+
start={{ x: 0, y: 0 }}
|
|
296
|
+
style={{
|
|
297
|
+
borderRadius: 8,
|
|
298
|
+
opacity: disabled ? 0.7 : 1,
|
|
299
|
+
}}
|
|
300
|
+
>
|
|
301
|
+
<TouchableOpacity
|
|
302
|
+
activeOpacity={0.8}
|
|
303
|
+
disabled={disabled || loading}
|
|
304
|
+
onPress={handlePress}
|
|
305
|
+
>
|
|
306
|
+
<View
|
|
307
|
+
className={button({ size, disabled })}
|
|
308
|
+
style={{ backgroundColor: "transparent" }}
|
|
309
|
+
>
|
|
310
|
+
{loading ? (
|
|
311
|
+
<ActivityIndicator color={loadingColorValue} size="small" />
|
|
312
|
+
) : (
|
|
313
|
+
<>
|
|
314
|
+
{icon ? <View className="mr-2">{icon}</View> : null}
|
|
315
|
+
<Typography.Text
|
|
316
|
+
allowFontScaling={false}
|
|
317
|
+
bold
|
|
318
|
+
className={textColorClass}
|
|
319
|
+
ellipsizeMode="tail"
|
|
320
|
+
numberOfLines={1}
|
|
321
|
+
variant={textVariantValue}
|
|
322
|
+
>
|
|
323
|
+
{title}
|
|
324
|
+
</Typography.Text>
|
|
325
|
+
</>
|
|
326
|
+
)}
|
|
327
|
+
</View>
|
|
328
|
+
</TouchableOpacity>
|
|
329
|
+
</LinearGradient>
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return (
|
|
334
|
+
<TouchableOpacity
|
|
335
|
+
activeOpacity={0.8}
|
|
336
|
+
className={button({ variant, size, disabled, className })}
|
|
337
|
+
disabled={disabled || loading}
|
|
338
|
+
onPress={handlePress}
|
|
339
|
+
>
|
|
340
|
+
{loading ? (
|
|
341
|
+
<ActivityIndicator color={loadingColorValue} size="small" />
|
|
342
|
+
) : (
|
|
343
|
+
<>
|
|
344
|
+
{icon ? <View className="mr-2">{icon}</View> : null}
|
|
345
|
+
<Typography.Text
|
|
346
|
+
allowFontScaling={false}
|
|
347
|
+
bold
|
|
348
|
+
className={textColorClass}
|
|
349
|
+
ellipsizeMode="tail"
|
|
350
|
+
numberOfLines={1}
|
|
351
|
+
variant={textVariantValue}
|
|
352
|
+
>
|
|
353
|
+
{title}
|
|
354
|
+
</Typography.Text>
|
|
355
|
+
</>
|
|
356
|
+
)}
|
|
357
|
+
</TouchableOpacity>
|
|
358
|
+
);
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
// ============================================================================
|
|
362
|
+
// BUTTON ICON COMPONENT
|
|
363
|
+
// ============================================================================
|
|
364
|
+
|
|
365
|
+
export interface ButtonIconProps extends VariantProps<typeof buttonIcon> {
|
|
366
|
+
icon: string;
|
|
367
|
+
onPress?: () => void;
|
|
368
|
+
confirm?: string;
|
|
369
|
+
loading?: boolean;
|
|
370
|
+
disabled?: boolean;
|
|
371
|
+
className?: string;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const ButtonIcon: FC<ButtonIconProps> = ({
|
|
375
|
+
icon,
|
|
376
|
+
onPress,
|
|
377
|
+
confirm,
|
|
378
|
+
variant = "primary",
|
|
379
|
+
size = "medium",
|
|
380
|
+
loading = false,
|
|
381
|
+
disabled = false,
|
|
382
|
+
className,
|
|
383
|
+
}) => {
|
|
384
|
+
const { show, hide } = useConfirmationContext();
|
|
385
|
+
|
|
386
|
+
const iconColorValue = getIconColor((variant as any) ?? "primary", disabled);
|
|
387
|
+
const iconSizeValue = getIconSize((size as any) ?? "medium");
|
|
388
|
+
const loadingColorValue = getLoadingColor((variant as any) ?? "primary");
|
|
389
|
+
|
|
390
|
+
const handlePress = useCallback(() => {
|
|
391
|
+
if (confirm && onPress) {
|
|
392
|
+
show({
|
|
393
|
+
title: "Confirmar acción",
|
|
394
|
+
message: confirm,
|
|
395
|
+
confirmText: "Confirmar",
|
|
396
|
+
cancelText: "Cancelar",
|
|
397
|
+
onConfirm: () => {
|
|
398
|
+
hide();
|
|
399
|
+
runOnJS(onPress)();
|
|
400
|
+
},
|
|
401
|
+
onCancel: () => hide(),
|
|
402
|
+
});
|
|
403
|
+
} else if (onPress) {
|
|
404
|
+
runOnJS(onPress)();
|
|
405
|
+
}
|
|
406
|
+
}, [onPress, confirm, show, hide]);
|
|
407
|
+
|
|
408
|
+
if (variant === "primary") {
|
|
409
|
+
return (
|
|
410
|
+
<LinearGradient
|
|
411
|
+
colors={disabled ? ["#93c5fd", "#60a5fa"] : ["#2563eb", "#1d4ed8"]}
|
|
412
|
+
end={{ x: 1, y: 1 }}
|
|
413
|
+
start={{ x: 0, y: 0 }}
|
|
414
|
+
style={{
|
|
415
|
+
borderRadius: 8,
|
|
416
|
+
opacity: disabled ? 0.7 : 1,
|
|
417
|
+
}}
|
|
418
|
+
>
|
|
419
|
+
<TouchableOpacity
|
|
420
|
+
activeOpacity={0.8}
|
|
421
|
+
disabled={disabled || loading}
|
|
422
|
+
onPress={handlePress}
|
|
423
|
+
>
|
|
424
|
+
<View
|
|
425
|
+
className={buttonIcon({ size, disabled })}
|
|
426
|
+
style={{ backgroundColor: "transparent" }}
|
|
427
|
+
>
|
|
428
|
+
{loading ? (
|
|
429
|
+
<ActivityIndicator color={loadingColorValue} size="small" />
|
|
430
|
+
) : (
|
|
431
|
+
<Display.Icon color={iconColorValue} name={icon} size={iconSizeValue} />
|
|
432
|
+
)}
|
|
433
|
+
</View>
|
|
434
|
+
</TouchableOpacity>
|
|
435
|
+
</LinearGradient>
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
return (
|
|
440
|
+
<TouchableOpacity
|
|
441
|
+
activeOpacity={0.8}
|
|
442
|
+
className={buttonIcon({ variant, size, disabled, className })}
|
|
443
|
+
disabled={disabled || loading}
|
|
444
|
+
onPress={handlePress}
|
|
445
|
+
>
|
|
446
|
+
{loading ? (
|
|
447
|
+
<ActivityIndicator color={loadingColorValue} size="small" />
|
|
448
|
+
) : (
|
|
449
|
+
<Display.Icon color={iconColorValue} name={icon} size={iconSizeValue} />
|
|
450
|
+
)}
|
|
451
|
+
</TouchableOpacity>
|
|
452
|
+
);
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
// ============================================================================
|
|
456
|
+
// COMPOUND COMPONENT
|
|
457
|
+
// ============================================================================
|
|
458
|
+
|
|
459
|
+
const ButtonWithIcon = Object.assign(Button, { Icon: ButtonIcon });
|
|
460
|
+
|
|
461
|
+
export default ButtonWithIcon;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Checkbox } from "expo-checkbox";
|
|
2
|
+
import { Pressable, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
import { cn } from "../theme/tw";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
|
|
8
|
+
interface RowCheckBoxProps {
|
|
9
|
+
mainText?: string;
|
|
10
|
+
subText?: string;
|
|
11
|
+
rightText?: string;
|
|
12
|
+
leftComponent?: React.ReactNode;
|
|
13
|
+
rightComponent?: React.ReactNode;
|
|
14
|
+
isChecked?: boolean;
|
|
15
|
+
onCheck?: (isChecked: boolean) => void;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function RowCheckBox({
|
|
21
|
+
mainText,
|
|
22
|
+
subText,
|
|
23
|
+
rightText,
|
|
24
|
+
rightComponent,
|
|
25
|
+
leftComponent,
|
|
26
|
+
isChecked = false,
|
|
27
|
+
onCheck = () => {},
|
|
28
|
+
disabled = false,
|
|
29
|
+
className,
|
|
30
|
+
}: RowCheckBoxProps) {
|
|
31
|
+
const handlePress = () => {
|
|
32
|
+
if (!disabled) {
|
|
33
|
+
onCheck(!isChecked);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const renderLeftComponent = () => {
|
|
38
|
+
if (leftComponent) {
|
|
39
|
+
return leftComponent;
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
{mainText && <Typography.Text semibold>{mainText}</Typography.Text>}
|
|
44
|
+
{subText && (
|
|
45
|
+
<Typography.Text className="text-text-secondary" variant="bodySmall">
|
|
46
|
+
{subText}
|
|
47
|
+
</Typography.Text>
|
|
48
|
+
)}
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const renderRightComponent = () => {
|
|
54
|
+
if (rightComponent) {
|
|
55
|
+
return rightComponent;
|
|
56
|
+
}
|
|
57
|
+
if (rightText) {
|
|
58
|
+
return <Typography.Text variant="body">{rightText}</Typography.Text>;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<Pressable
|
|
65
|
+
className={cn(
|
|
66
|
+
"flex-row justify-between items-center",
|
|
67
|
+
disabled && "opacity-50",
|
|
68
|
+
className,
|
|
69
|
+
)}
|
|
70
|
+
disabled={disabled}
|
|
71
|
+
onPress={handlePress}
|
|
72
|
+
>
|
|
73
|
+
<View>{renderLeftComponent()}</View>
|
|
74
|
+
|
|
75
|
+
<View className="flex-row items-center">
|
|
76
|
+
{renderRightComponent()}
|
|
77
|
+
<Checkbox
|
|
78
|
+
className="ml-2"
|
|
79
|
+
color={theme.primary}
|
|
80
|
+
disabled={disabled}
|
|
81
|
+
pointerEvents="none"
|
|
82
|
+
value={isChecked}
|
|
83
|
+
/>
|
|
84
|
+
</View>
|
|
85
|
+
</Pressable>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export default RowCheckBox;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Control, Controller, FieldValues, Path } from "react-hook-form";
|
|
2
|
+
|
|
3
|
+
import Checkbox from "./Form.Checkbox";
|
|
4
|
+
|
|
5
|
+
interface ControlledCheckboxProps<T extends FieldValues> {
|
|
6
|
+
control: Control<T>;
|
|
7
|
+
name: Path<T>;
|
|
8
|
+
label: string;
|
|
9
|
+
subText?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ControlledCheckbox<T extends FieldValues>({
|
|
13
|
+
control,
|
|
14
|
+
name,
|
|
15
|
+
label,
|
|
16
|
+
subText,
|
|
17
|
+
}: ControlledCheckboxProps<T>) {
|
|
18
|
+
return (
|
|
19
|
+
<Controller
|
|
20
|
+
control={control}
|
|
21
|
+
name={name}
|
|
22
|
+
render={({ field: { onChange, value } }) => (
|
|
23
|
+
<Checkbox
|
|
24
|
+
isChecked={value || false}
|
|
25
|
+
mainText={label}
|
|
26
|
+
onCheck={onChange}
|
|
27
|
+
subText={subText}
|
|
28
|
+
/>
|
|
29
|
+
)}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default ControlledCheckbox;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Control, FieldValues, Path } from "react-hook-form";
|
|
2
|
+
|
|
3
|
+
export interface DropdownOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface ControlledDropdownProps<T extends FieldValues> {
|
|
9
|
+
control: Control<T>;
|
|
10
|
+
name: Path<T>;
|
|
11
|
+
label: string;
|
|
12
|
+
options: DropdownOption[];
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function ControlledDropdown<T extends FieldValues>(_props: ControlledDropdownProps<T>) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
"ControlledDropdown is not implemented yet. Use Form.Dropdown with manual Controller instead.",
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default ControlledDropdown;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Control, Controller, FieldValues, Path } from "react-hook-form";
|
|
2
|
+
|
|
3
|
+
import Input from "./Form.Input";
|
|
4
|
+
|
|
5
|
+
interface ControlledInputProps<T extends FieldValues> {
|
|
6
|
+
control: Control<T>;
|
|
7
|
+
name: Path<T>;
|
|
8
|
+
label: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
keyboardType?: "default" | "numeric" | "email-address" | "phone-pad";
|
|
11
|
+
autoCapitalize?: "none" | "sentences" | "words" | "characters";
|
|
12
|
+
multiline?: boolean;
|
|
13
|
+
numberOfLines?: number;
|
|
14
|
+
rules?: any;
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function ControlledInput<T extends FieldValues>({
|
|
19
|
+
control,
|
|
20
|
+
name,
|
|
21
|
+
label,
|
|
22
|
+
placeholder,
|
|
23
|
+
keyboardType,
|
|
24
|
+
autoCapitalize,
|
|
25
|
+
multiline,
|
|
26
|
+
numberOfLines,
|
|
27
|
+
rules,
|
|
28
|
+
error,
|
|
29
|
+
}: ControlledInputProps<T>) {
|
|
30
|
+
return (
|
|
31
|
+
<Controller
|
|
32
|
+
control={control}
|
|
33
|
+
name={name}
|
|
34
|
+
render={({ field: { onChange, onBlur, value } }) => (
|
|
35
|
+
<Input
|
|
36
|
+
autoCapitalize={autoCapitalize}
|
|
37
|
+
error={error}
|
|
38
|
+
keyboardType={keyboardType}
|
|
39
|
+
label={label}
|
|
40
|
+
multiline={multiline}
|
|
41
|
+
numberOfLines={numberOfLines}
|
|
42
|
+
onBlur={onBlur}
|
|
43
|
+
onChangeText={onChange}
|
|
44
|
+
placeholder={placeholder}
|
|
45
|
+
value={value}
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
48
|
+
rules={rules}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default ControlledInput;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Control, Controller, FieldValues, Path } from "react-hook-form";
|
|
2
|
+
|
|
3
|
+
import MonetaryInput from "./Form.MonetaryInput";
|
|
4
|
+
|
|
5
|
+
interface ControlledMonetaryInputProps<T extends FieldValues> {
|
|
6
|
+
control: Control<T>;
|
|
7
|
+
name: Path<T>;
|
|
8
|
+
label: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
currency?: string;
|
|
11
|
+
rules?: any;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function ControlledMonetaryInput<T extends FieldValues>({
|
|
16
|
+
control,
|
|
17
|
+
name,
|
|
18
|
+
label,
|
|
19
|
+
placeholder,
|
|
20
|
+
currency = "CRC",
|
|
21
|
+
rules,
|
|
22
|
+
error,
|
|
23
|
+
}: ControlledMonetaryInputProps<T>) {
|
|
24
|
+
return (
|
|
25
|
+
<Controller
|
|
26
|
+
control={control}
|
|
27
|
+
name={name}
|
|
28
|
+
render={({ field: { onChange, onBlur, value } }) => (
|
|
29
|
+
<MonetaryInput
|
|
30
|
+
amount={value}
|
|
31
|
+
currencySymbol={currency}
|
|
32
|
+
onChange={onChange}
|
|
33
|
+
placeholder={placeholder}
|
|
34
|
+
/>
|
|
35
|
+
)}
|
|
36
|
+
rules={rules}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default ControlledMonetaryInput;
|