@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,33 @@
|
|
|
1
|
+
import { Control, Controller, FieldValues, Path } from "react-hook-form";
|
|
2
|
+
|
|
3
|
+
import RadioButton from "./Form.RadioButton";
|
|
4
|
+
|
|
5
|
+
interface ControlledRadioButtonProps<T extends FieldValues> {
|
|
6
|
+
control: Control<T>;
|
|
7
|
+
name: Path<T>;
|
|
8
|
+
label: string;
|
|
9
|
+
value: any;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ControlledRadioButton<T extends FieldValues>({
|
|
13
|
+
control,
|
|
14
|
+
name,
|
|
15
|
+
label,
|
|
16
|
+
value,
|
|
17
|
+
}: ControlledRadioButtonProps<T>) {
|
|
18
|
+
return (
|
|
19
|
+
<Controller
|
|
20
|
+
control={control}
|
|
21
|
+
name={name}
|
|
22
|
+
render={({ field: { onChange, value: selectedValue } }) => (
|
|
23
|
+
<RadioButton
|
|
24
|
+
label={label}
|
|
25
|
+
onPress={() => onChange(value)}
|
|
26
|
+
selected={selectedValue === value}
|
|
27
|
+
/>
|
|
28
|
+
)}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default ControlledRadioButton;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Modal, TouchableOpacity, TouchableWithoutFeedback, View } from "react-native";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
import { Display } from "../Display";
|
|
6
|
+
import { theme } from "../theme";
|
|
7
|
+
import { Typography } from "../Typography";
|
|
8
|
+
|
|
9
|
+
const dropdown = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
button: "flex-row justify-between items-center rounded-lg px-3",
|
|
12
|
+
overlay: "flex-1 bg-black/40 justify-center items-center",
|
|
13
|
+
dropdownContainer: "rounded-xl mx-5 max-w-[320px] w-[90%] max-h-[70%]",
|
|
14
|
+
header: "flex-row justify-between items-center px-4 py-3 border-b border-border-default",
|
|
15
|
+
optionsList: "p-1",
|
|
16
|
+
option: "py-3 px-3 rounded-lg my-0.5",
|
|
17
|
+
separator: "h-[1px] bg-border-light mx-3",
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
primary: {
|
|
22
|
+
button: "bg-primary",
|
|
23
|
+
},
|
|
24
|
+
secondary: {
|
|
25
|
+
button: "bg-bg-card border border-primary",
|
|
26
|
+
},
|
|
27
|
+
outline: {
|
|
28
|
+
button: "bg-transparent border border-primary",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
xs: {
|
|
33
|
+
button: "py-1.5 min-h-[32px]",
|
|
34
|
+
},
|
|
35
|
+
small: {
|
|
36
|
+
button: "py-2 min-h-[36px]",
|
|
37
|
+
},
|
|
38
|
+
medium: {
|
|
39
|
+
button: "py-2.5 min-h-[40px]",
|
|
40
|
+
},
|
|
41
|
+
large: {
|
|
42
|
+
button: "py-3 min-h-[44px]",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
disabled: {
|
|
46
|
+
true: {
|
|
47
|
+
option: "opacity-50",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
size: "small",
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export interface DropdownOption {
|
|
58
|
+
id: string;
|
|
59
|
+
title: string;
|
|
60
|
+
onPress: () => void;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface DropdownButtonProps {
|
|
65
|
+
title: string;
|
|
66
|
+
options: DropdownOption[];
|
|
67
|
+
variant?: "primary" | "secondary" | "outline";
|
|
68
|
+
size?: "xs" | "small" | "medium" | "large";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function DropdownButton({
|
|
72
|
+
title,
|
|
73
|
+
options,
|
|
74
|
+
variant = "secondary",
|
|
75
|
+
size = "small",
|
|
76
|
+
}: DropdownButtonProps) {
|
|
77
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
78
|
+
|
|
79
|
+
const handleOptionPress = (option: DropdownOption) => {
|
|
80
|
+
if (!option.disabled) {
|
|
81
|
+
option.onPress();
|
|
82
|
+
setIsOpen(false);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const styles = dropdown({ variant, size });
|
|
87
|
+
|
|
88
|
+
const textColorClass = {
|
|
89
|
+
primary: "text-text-on-primary",
|
|
90
|
+
outline: "text-primary",
|
|
91
|
+
secondary: "text-primary",
|
|
92
|
+
}[variant];
|
|
93
|
+
|
|
94
|
+
const iconColor = {
|
|
95
|
+
primary: theme.text.onPrimary,
|
|
96
|
+
outline: theme.primary,
|
|
97
|
+
secondary: theme.primary,
|
|
98
|
+
}[variant];
|
|
99
|
+
|
|
100
|
+
const textVariant = {
|
|
101
|
+
large: "body" as const,
|
|
102
|
+
medium: "body" as const,
|
|
103
|
+
xs: "bodySmall" as const,
|
|
104
|
+
small: "bodySmall" as const,
|
|
105
|
+
}[size];
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<>
|
|
109
|
+
<TouchableOpacity
|
|
110
|
+
activeOpacity={0.7}
|
|
111
|
+
className={styles.button()}
|
|
112
|
+
onPress={() => setIsOpen(true)}
|
|
113
|
+
>
|
|
114
|
+
<Typography.Text className={textColorClass} variant={textVariant}>
|
|
115
|
+
{title}
|
|
116
|
+
</Typography.Text>
|
|
117
|
+
<Display.Icon color={iconColor} name="chevron-down" size={16} type="feather" />
|
|
118
|
+
</TouchableOpacity>
|
|
119
|
+
|
|
120
|
+
<Modal animationType="fade" transparent visible={isOpen}>
|
|
121
|
+
<TouchableWithoutFeedback onPress={() => setIsOpen(false)}>
|
|
122
|
+
<View className={styles.overlay()}>
|
|
123
|
+
<TouchableWithoutFeedback>
|
|
124
|
+
<View
|
|
125
|
+
className={styles.dropdownContainer()}
|
|
126
|
+
style={{
|
|
127
|
+
backgroundColor: theme.bg.popover,
|
|
128
|
+
...theme.shadow.lg,
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
<View className={styles.header()}>
|
|
132
|
+
<Typography.Text className="text-text-primary" semibold variant="bodyLarge">
|
|
133
|
+
{title}
|
|
134
|
+
</Typography.Text>
|
|
135
|
+
<TouchableOpacity onPress={() => setIsOpen(false)}>
|
|
136
|
+
<Display.Icon name="x" size={20} type="feather" />
|
|
137
|
+
</TouchableOpacity>
|
|
138
|
+
</View>
|
|
139
|
+
|
|
140
|
+
<View className={styles.optionsList()}>
|
|
141
|
+
{options.map((option, index) => (
|
|
142
|
+
<View key={option.id}>
|
|
143
|
+
<TouchableOpacity
|
|
144
|
+
activeOpacity={0.7}
|
|
145
|
+
className={dropdown({ disabled: option.disabled }).option()}
|
|
146
|
+
disabled={option.disabled}
|
|
147
|
+
onPress={() => handleOptionPress(option)}
|
|
148
|
+
>
|
|
149
|
+
<Typography.Text
|
|
150
|
+
className={
|
|
151
|
+
option.disabled ? "text-text-disabled" : "text-text-primary"
|
|
152
|
+
}
|
|
153
|
+
variant="body"
|
|
154
|
+
>
|
|
155
|
+
{option.title}
|
|
156
|
+
</Typography.Text>
|
|
157
|
+
</TouchableOpacity>
|
|
158
|
+
{index < options.length - 1 && <View className={styles.separator()} />}
|
|
159
|
+
</View>
|
|
160
|
+
))}
|
|
161
|
+
</View>
|
|
162
|
+
</View>
|
|
163
|
+
</TouchableWithoutFeedback>
|
|
164
|
+
</View>
|
|
165
|
+
</TouchableWithoutFeedback>
|
|
166
|
+
</Modal>
|
|
167
|
+
</>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export default DropdownButton;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { TouchableOpacity, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { tv } from "../theme/tw";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
|
|
7
|
+
const filterButton = tv({
|
|
8
|
+
base: "rounded-lg items-center justify-center py-2 px-3 min-h-[36px]",
|
|
9
|
+
variants: {
|
|
10
|
+
active: {
|
|
11
|
+
true: "bg-primary border-0",
|
|
12
|
+
false: "bg-transparent border border-brand-primary",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
active: false,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const filterText = tv({
|
|
21
|
+
base: "font-bold",
|
|
22
|
+
variants: {
|
|
23
|
+
active: {
|
|
24
|
+
true: "text-white",
|
|
25
|
+
false: "text-primary",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
active: false,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export interface FilterButtonProps {
|
|
34
|
+
title: string;
|
|
35
|
+
active: boolean;
|
|
36
|
+
onPress: () => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const FilterButton: FC<FilterButtonProps> = ({ title, active, onPress }) => {
|
|
40
|
+
return (
|
|
41
|
+
<TouchableOpacity
|
|
42
|
+
activeOpacity={0.8}
|
|
43
|
+
className={filterButton({ active })}
|
|
44
|
+
onPress={onPress}
|
|
45
|
+
>
|
|
46
|
+
<Typography.Text className={filterText({ active })} variant="buttonSmall">
|
|
47
|
+
{title}
|
|
48
|
+
</Typography.Text>
|
|
49
|
+
</TouchableOpacity>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
interface FilterButtonGroupProps {
|
|
54
|
+
children: React.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function FilterButtonGroup({ children }: FilterButtonGroupProps) {
|
|
58
|
+
return <View className="flex-row gap-2 p-3">{children}</View>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
import { StyleProp, TouchableOpacity, View, ViewStyle } from "react-native";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
import { Dialog, type EditableValueModalChip } from "../Dialog";
|
|
6
|
+
import { Display } from "../Display";
|
|
7
|
+
import { normalizeQuantity, roundTo } from "../lib/quantity";
|
|
8
|
+
import { Typography } from "../Typography";
|
|
9
|
+
|
|
10
|
+
const fractionalQuantityInput = tv({
|
|
11
|
+
slots: {
|
|
12
|
+
container: "flex-row items-center border border-brand-accent rounded-full px-1",
|
|
13
|
+
button: "w-9 h-9 rounded-full justify-center items-center",
|
|
14
|
+
valueContainer: "min-w-[60px] items-center px-3",
|
|
15
|
+
},
|
|
16
|
+
variants: {
|
|
17
|
+
disabled: {
|
|
18
|
+
true: {
|
|
19
|
+
button: "opacity-40",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
interface FractionalQuantityInputProps {
|
|
26
|
+
value: number;
|
|
27
|
+
onChange: (value: number) => void;
|
|
28
|
+
precision?: number;
|
|
29
|
+
minIncrement?: number;
|
|
30
|
+
maxValue?: number;
|
|
31
|
+
style?: StyleProp<ViewStyle>;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
quickAddIncrements?: number[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function parseLocalizedNumber(raw: string): number {
|
|
37
|
+
let s = raw.trim();
|
|
38
|
+
if (s === "") return 0;
|
|
39
|
+
s = s.replace(/[^0-9.,+-]/g, "");
|
|
40
|
+
const hasComma = s.includes(",");
|
|
41
|
+
const hasDot = s.includes(".");
|
|
42
|
+
if (hasComma && (!hasDot || s.lastIndexOf(",") > s.lastIndexOf("."))) {
|
|
43
|
+
s = s.replace(/\./g, "").replace(/,/g, ".");
|
|
44
|
+
} else {
|
|
45
|
+
if (!hasComma && hasDot) {
|
|
46
|
+
if (/^\d{1,3}(\.\d{3})+$/.test(s)) {
|
|
47
|
+
s = s.replace(/\./g, "");
|
|
48
|
+
} else if (s.split(".").length - 1 > 1) {
|
|
49
|
+
const parts = s.split(".");
|
|
50
|
+
const decimal = parts.pop();
|
|
51
|
+
s = parts.join("") + "." + decimal;
|
|
52
|
+
}
|
|
53
|
+
} else if (hasComma && hasDot) {
|
|
54
|
+
s = s.replace(/,/g, "");
|
|
55
|
+
}
|
|
56
|
+
s = s.replace(/,/g, "");
|
|
57
|
+
}
|
|
58
|
+
const n = parseFloat(s);
|
|
59
|
+
if (isNaN(n)) return 0;
|
|
60
|
+
return n;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function FractionalQuantityInput({
|
|
64
|
+
value,
|
|
65
|
+
onChange,
|
|
66
|
+
precision = 2,
|
|
67
|
+
minIncrement,
|
|
68
|
+
maxValue = 999999,
|
|
69
|
+
style,
|
|
70
|
+
disabled,
|
|
71
|
+
quickAddIncrements,
|
|
72
|
+
}: FractionalQuantityInputProps) {
|
|
73
|
+
const [modalVisible, setModalVisible] = useState(false);
|
|
74
|
+
const [draft, setDraft] = useState(String(value));
|
|
75
|
+
|
|
76
|
+
const effectiveIncrement = useMemo(() => {
|
|
77
|
+
if (minIncrement && minIncrement > 0) return minIncrement;
|
|
78
|
+
return 1 / Math.pow(10, precision);
|
|
79
|
+
}, [minIncrement, precision]);
|
|
80
|
+
|
|
81
|
+
const chips = useMemo(() => {
|
|
82
|
+
if (quickAddIncrements && quickAddIncrements.length > 0) return quickAddIncrements;
|
|
83
|
+
const base = effectiveIncrement;
|
|
84
|
+
if (base >= 1) return [1, 2, 5];
|
|
85
|
+
if (base >= 0.5) return [0.5, 1, 2];
|
|
86
|
+
if (base >= 0.25) return [0.25, 0.5, 1];
|
|
87
|
+
if (base >= 0.1) return [0.1, 0.25, 0.5];
|
|
88
|
+
return [base, base * 2, base * 5];
|
|
89
|
+
}, [effectiveIncrement, quickAddIncrements]);
|
|
90
|
+
|
|
91
|
+
const applyValue = useCallback(
|
|
92
|
+
(next: number) => {
|
|
93
|
+
if (next < 0) next = 0;
|
|
94
|
+
if (next > maxValue) next = maxValue;
|
|
95
|
+
next = normalizeQuantity(next, effectiveIncrement, precision);
|
|
96
|
+
onChange(next);
|
|
97
|
+
},
|
|
98
|
+
[onChange, maxValue, effectiveIncrement, precision],
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
function handleDecrement() {
|
|
102
|
+
applyValue(value - 1);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function handleIncrement() {
|
|
106
|
+
applyValue(value + 1);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function openModal() {
|
|
110
|
+
setDraft(String(value));
|
|
111
|
+
setModalVisible(true);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function confirmDraft() {
|
|
115
|
+
let parsed = parseLocalizedNumber(draft);
|
|
116
|
+
parsed = roundTo(parsed, precision);
|
|
117
|
+
if (parsed < 0) parsed = 0;
|
|
118
|
+
if (parsed > maxValue) parsed = maxValue;
|
|
119
|
+
onChange(parsed);
|
|
120
|
+
setModalVisible(false);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const formatted = useMemo(() => value.toFixed(precision), [value, precision]);
|
|
124
|
+
|
|
125
|
+
const modalChips: EditableValueModalChip[] = (chips as number[]).map((item) => ({
|
|
126
|
+
label: `+${item}`,
|
|
127
|
+
onPress: () => {
|
|
128
|
+
const base = parseLocalizedNumber(draft) || 0;
|
|
129
|
+
const next = roundTo(base + item, precision);
|
|
130
|
+
setDraft(String(next));
|
|
131
|
+
},
|
|
132
|
+
}));
|
|
133
|
+
|
|
134
|
+
const decrementStyles = fractionalQuantityInput({ disabled: disabled || value <= 0 });
|
|
135
|
+
const incrementStyles = fractionalQuantityInput({ disabled });
|
|
136
|
+
const containerStyles = fractionalQuantityInput();
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<View
|
|
140
|
+
accessibilityLabel={`Cantidad ${formatted}`}
|
|
141
|
+
className={containerStyles.container()}
|
|
142
|
+
style={style}
|
|
143
|
+
>
|
|
144
|
+
<TouchableOpacity
|
|
145
|
+
className={decrementStyles.button()}
|
|
146
|
+
disabled={disabled || value <= 0}
|
|
147
|
+
onPress={handleDecrement}
|
|
148
|
+
>
|
|
149
|
+
<Display.Icon name="minus" size={16} type="feather" />
|
|
150
|
+
</TouchableOpacity>
|
|
151
|
+
|
|
152
|
+
<TouchableOpacity
|
|
153
|
+
className={containerStyles.valueContainer()}
|
|
154
|
+
disabled={disabled}
|
|
155
|
+
onPress={openModal}
|
|
156
|
+
>
|
|
157
|
+
<Typography.Text semibold variant="body">
|
|
158
|
+
{formatted}
|
|
159
|
+
</Typography.Text>
|
|
160
|
+
</TouchableOpacity>
|
|
161
|
+
|
|
162
|
+
<TouchableOpacity
|
|
163
|
+
className={incrementStyles.button()}
|
|
164
|
+
disabled={disabled}
|
|
165
|
+
onPress={handleIncrement}
|
|
166
|
+
>
|
|
167
|
+
<Display.Icon name="plus" size={16} type="feather" />
|
|
168
|
+
</TouchableOpacity>
|
|
169
|
+
|
|
170
|
+
<Dialog.EditValue
|
|
171
|
+
chips={modalChips}
|
|
172
|
+
keyboardType="decimal-pad"
|
|
173
|
+
onCancel={() => setModalVisible(false)}
|
|
174
|
+
onChangeValue={setDraft}
|
|
175
|
+
onConfirm={confirmDraft}
|
|
176
|
+
placeholder={`0${precision > 0 ? ",".padEnd(precision + 1, "0") : ""}`}
|
|
177
|
+
rightAdornment={
|
|
178
|
+
<Typography.Text className="ml-1" variant="body">
|
|
179
|
+
(mín {effectiveIncrement})
|
|
180
|
+
</Typography.Text>
|
|
181
|
+
}
|
|
182
|
+
title="Editar cantidad"
|
|
183
|
+
value={draft}
|
|
184
|
+
visible={modalVisible}
|
|
185
|
+
/>
|
|
186
|
+
</View>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export default FractionalQuantityInput;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ActivityIndicator, TouchableOpacity } from "react-native";
|
|
2
|
+
|
|
3
|
+
import { Display } from "../Display";
|
|
4
|
+
import { IconType } from "../lib/icon";
|
|
5
|
+
import { theme } from "../theme";
|
|
6
|
+
import { tv, type VariantProps } from "../theme/tw";
|
|
7
|
+
|
|
8
|
+
const iconButton = tv({
|
|
9
|
+
base: "rounded-lg items-center justify-center",
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
primary: "bg-primary",
|
|
13
|
+
secondary: "bg-bg-card border border-primary",
|
|
14
|
+
tertiary: "bg-accent",
|
|
15
|
+
ghost: "bg-transparent",
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
small: "w-8 h-8",
|
|
19
|
+
medium: "w-10 h-10",
|
|
20
|
+
large: "w-12 h-12",
|
|
21
|
+
},
|
|
22
|
+
rounded: {
|
|
23
|
+
true: "rounded-full",
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
true: "opacity-50",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "ghost",
|
|
31
|
+
size: "medium",
|
|
32
|
+
rounded: false,
|
|
33
|
+
disabled: false,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
interface IconButtonProps extends VariantProps<typeof iconButton> {
|
|
38
|
+
icon?: string;
|
|
39
|
+
type?: IconType;
|
|
40
|
+
onPress: () => void;
|
|
41
|
+
loading?: boolean;
|
|
42
|
+
iconColor?: string;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function IconButton({
|
|
47
|
+
icon,
|
|
48
|
+
type = "feather",
|
|
49
|
+
onPress,
|
|
50
|
+
variant = "ghost",
|
|
51
|
+
size = "medium",
|
|
52
|
+
loading = false,
|
|
53
|
+
disabled = false,
|
|
54
|
+
rounded = false,
|
|
55
|
+
iconColor,
|
|
56
|
+
className,
|
|
57
|
+
}: IconButtonProps) {
|
|
58
|
+
const getLoadingColor = () => {
|
|
59
|
+
switch (variant) {
|
|
60
|
+
case "primary":
|
|
61
|
+
case "tertiary":
|
|
62
|
+
return theme.primary;
|
|
63
|
+
case "secondary":
|
|
64
|
+
case "ghost":
|
|
65
|
+
return theme.primary;
|
|
66
|
+
default:
|
|
67
|
+
return theme.primary;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const getIconColor = () => {
|
|
72
|
+
if (iconColor) return iconColor;
|
|
73
|
+
switch (variant) {
|
|
74
|
+
case "primary":
|
|
75
|
+
case "tertiary":
|
|
76
|
+
return theme.primary;
|
|
77
|
+
case "secondary":
|
|
78
|
+
return theme.primary;
|
|
79
|
+
case "ghost":
|
|
80
|
+
return theme.primary;
|
|
81
|
+
default:
|
|
82
|
+
return theme.primary;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<TouchableOpacity
|
|
88
|
+
activeOpacity={0.7}
|
|
89
|
+
className={iconButton({ variant, size, rounded, disabled, className })}
|
|
90
|
+
disabled={disabled || loading}
|
|
91
|
+
onPress={onPress}
|
|
92
|
+
>
|
|
93
|
+
{loading ? (
|
|
94
|
+
<ActivityIndicator color={getLoadingColor()} size="small" />
|
|
95
|
+
) : (
|
|
96
|
+
<Display.Icon color={getIconColor()} name={icon} size={24} type={type} />
|
|
97
|
+
)}
|
|
98
|
+
</TouchableOpacity>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export default IconButton;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { TextInput, type TextInputProps, View } from "react-native";
|
|
4
|
+
|
|
5
|
+
import { theme } from "../theme";
|
|
6
|
+
import { cn, tv } from "../theme/tw";
|
|
7
|
+
import { Typography } from "../Typography";
|
|
8
|
+
|
|
9
|
+
const inputContainer = tv({
|
|
10
|
+
base: "rounded-lg bg-bg-card shadow-sm",
|
|
11
|
+
variants: {
|
|
12
|
+
state: {
|
|
13
|
+
error: "border-2 border-danger",
|
|
14
|
+
focused: "border-2 border-ring",
|
|
15
|
+
default: "border border-input",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: { state: "default" },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
interface FormInputProps extends TextInputProps {
|
|
22
|
+
label: string;
|
|
23
|
+
error?: string;
|
|
24
|
+
tooltip?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function FormInput({
|
|
29
|
+
label,
|
|
30
|
+
error,
|
|
31
|
+
tooltip,
|
|
32
|
+
style,
|
|
33
|
+
multiline = false,
|
|
34
|
+
numberOfLines = 1,
|
|
35
|
+
onFocus,
|
|
36
|
+
onBlur,
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
}: FormInputProps) {
|
|
40
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
41
|
+
const hasError = Boolean(error);
|
|
42
|
+
|
|
43
|
+
const handleFocus = (e: any) => {
|
|
44
|
+
setIsFocused(true);
|
|
45
|
+
onFocus?.(e);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const handleBlur = (e: any) => {
|
|
49
|
+
setIsFocused(false);
|
|
50
|
+
onBlur?.(e);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const getState = () => {
|
|
54
|
+
if (hasError) return "error";
|
|
55
|
+
if (isFocused) return "focused";
|
|
56
|
+
return "default";
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<View className={cn("mb-2", className)}>
|
|
61
|
+
<Typography.Text className="mb-1 font-medium text-text-primary" variant="bodySmall">
|
|
62
|
+
{label}
|
|
63
|
+
</Typography.Text>
|
|
64
|
+
<View className={inputContainer({ state: getState() })}>
|
|
65
|
+
<TextInput
|
|
66
|
+
className={cn(
|
|
67
|
+
"px-3 py-2.5 text-sm min-h-[44px] text-text-primary",
|
|
68
|
+
multiline && "min-h-[64px] pt-2.5",
|
|
69
|
+
)}
|
|
70
|
+
multiline={multiline}
|
|
71
|
+
numberOfLines={numberOfLines}
|
|
72
|
+
onBlur={handleBlur}
|
|
73
|
+
onFocus={handleFocus}
|
|
74
|
+
placeholderTextColor={theme.text.tertiary}
|
|
75
|
+
textAlignVertical={multiline ? "top" : "center"}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
</View>
|
|
79
|
+
{hasError && (
|
|
80
|
+
<Typography.Text className="mt-0.5 text-danger" variant="bodySmall">
|
|
81
|
+
{error}
|
|
82
|
+
</Typography.Text>
|
|
83
|
+
)}
|
|
84
|
+
</View>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default FormInput;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { FC, useState } from "react";
|
|
2
|
+
import { TextInputProps, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { tv } from "../theme/tw";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
import TextInputF from "./Form.TextInput";
|
|
7
|
+
|
|
8
|
+
const inputFieldBorder = tv({
|
|
9
|
+
base: "rounded p-2",
|
|
10
|
+
variants: {
|
|
11
|
+
state: {
|
|
12
|
+
error: "border-2 border-danger",
|
|
13
|
+
focused: "border-2 border-ring",
|
|
14
|
+
default: "border border-input",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: { state: "default" },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export interface InputFieldProps extends TextInputProps {
|
|
21
|
+
label: string;
|
|
22
|
+
inputProps: React.ComponentProps<typeof TextInputF>;
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const InputField: FC<InputFieldProps> = ({ label, inputProps, error }) => {
|
|
27
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
28
|
+
const hasError = Boolean(error);
|
|
29
|
+
|
|
30
|
+
const handleFocus = (e: any) => {
|
|
31
|
+
setIsFocused(true);
|
|
32
|
+
inputProps?.onFocus?.(e);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const handleBlur = (e: any) => {
|
|
36
|
+
setIsFocused(false);
|
|
37
|
+
inputProps?.onBlur?.(e);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const getState = () => {
|
|
41
|
+
if (hasError) return "error";
|
|
42
|
+
if (isFocused) return "focused";
|
|
43
|
+
return "default";
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<View className="mb-4">
|
|
48
|
+
<Typography.Text className="mb-1" variant="bodyLarge">
|
|
49
|
+
{label}
|
|
50
|
+
</Typography.Text>
|
|
51
|
+
<TextInputF
|
|
52
|
+
className={inputFieldBorder({ state: getState() })}
|
|
53
|
+
{...inputProps}
|
|
54
|
+
onBlur={handleBlur}
|
|
55
|
+
onFocus={handleFocus}
|
|
56
|
+
/>
|
|
57
|
+
{error && (
|
|
58
|
+
<Typography.Text className="mt-1 text-danger" variant="bodySmall">
|
|
59
|
+
{error}
|
|
60
|
+
</Typography.Text>
|
|
61
|
+
)}
|
|
62
|
+
</View>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default InputField;
|