negodesign 0.0.80 → 0.0.82
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 +133 -133
- package/dist/components/NegoDesign.svelte +21 -21
- package/dist/components/pages/admin/01/ui/AdminContent.svelte +14 -14
- package/dist/components/pages/admin/01/ui/AdminPanel.svelte +46 -46
- package/dist/components/pages/product-details/shared/ProductDetailFilesVertical.svelte +103 -103
- package/dist/components/pages/profile-user/shared/ProfileUserAddress.svelte +83 -83
- package/dist/components/pages/profile-user/shared/ProfileUserTabs.svelte +80 -80
- package/dist/components/pages/security/auth/PageAuth01.svelte +62 -62
- package/dist/components/pages/security/auth/PageAuth02.svelte +40 -40
- package/dist/components/pages/security/auth/PageAuth03.svelte +40 -40
- package/dist/components/pages/security/login/01/ui/FormLogin.svelte +91 -63
- package/dist/components/pages/security/login/01/ui/FormLogin.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/FormLoginEmailPassword.svelte +49 -26
- package/dist/components/pages/security/login/01/ui/FormLoginEmailPassword.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/FormLoginPhonePassword.svelte +49 -26
- package/dist/components/pages/security/login/01/ui/FormLoginPhonePassword.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/FormLoginUsernamePassword.svelte +49 -26
- package/dist/components/pages/security/login/01/ui/FormLoginUsernamePassword.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/LoginCard01.svelte +148 -132
- package/dist/components/pages/security/login/01/ui/LoginCard01.svelte.d.ts +2 -0
- package/dist/components/pages/security/login/01/ui/PageLogin01.svelte +66 -64
- package/dist/components/pages/security/login/02/ui/FormLogin02.svelte +82 -72
- package/dist/components/pages/security/login/02/ui/FormLogin02.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/02/ui/FormLoginEmailPassword02.svelte +27 -26
- package/dist/components/pages/security/login/02/ui/FormLoginEmailPassword02.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/02/ui/FormLoginPhonePassword02.svelte +27 -26
- package/dist/components/pages/security/login/02/ui/FormLoginPhonePassword02.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/02/ui/FormLoginUsernamePassword02.svelte +27 -26
- package/dist/components/pages/security/login/02/ui/FormLoginUsernamePassword02.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/02/ui/LoginCard02.svelte +15 -2
- package/dist/components/pages/security/login/02/ui/LoginCard02.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/02/ui/PageLogin02.svelte +2 -0
- package/dist/components/pages/security/login/03/ui/FormLogin03.svelte +94 -91
- package/dist/components/pages/security/login/03/ui/FormLogin03.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/03/ui/FormLoginEmailPassword03.svelte +27 -26
- package/dist/components/pages/security/login/03/ui/FormLoginEmailPassword03.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/03/ui/FormLoginPhonePassword03.svelte +27 -26
- package/dist/components/pages/security/login/03/ui/FormLoginPhonePassword03.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/03/ui/FormLoginUsernamePassword03.svelte +27 -26
- package/dist/components/pages/security/login/03/ui/FormLoginUsernamePassword03.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/03/ui/LoginCard03.svelte +15 -2
- package/dist/components/pages/security/login/03/ui/LoginCard03.svelte.d.ts +1 -0
- package/dist/components/pages/security/login/03/ui/PageLogin03.svelte +2 -0
- package/dist/components/pages/security/login/PageLogin.svelte +30 -30
- package/dist/components/pages/security/login/types.d.ts +1 -0
- package/dist/components/pages/security/register/01/ui/PageRegister01.svelte +78 -76
- package/dist/components/pages/security/register/01/ui/RegisterCard01.svelte +107 -104
- package/dist/components/pages/security/register/01/ui/RegisterCard01.svelte.d.ts +1 -0
- package/dist/components/pages/security/register/02/ui/PageRegister02.svelte +2 -0
- package/dist/components/pages/security/register/02/ui/RegisterCard02.svelte +3 -1
- package/dist/components/pages/security/register/02/ui/RegisterCard02.svelte.d.ts +1 -0
- package/dist/components/pages/security/register/03/ui/PageRegister03.svelte +2 -0
- package/dist/components/pages/security/register/03/ui/RegisterCard03.svelte +3 -1
- package/dist/components/pages/security/register/03/ui/RegisterCard03.svelte.d.ts +1 -0
- package/dist/components/pages/security/register/FormRegister.svelte +148 -146
- package/dist/components/pages/security/register/FormRegister.svelte.d.ts +1 -0
- package/dist/components/pages/security/register/types.d.ts +1 -0
- package/dist/components/ui/avatar/avatar-fallback.svelte +29 -29
- package/dist/components/ui/avatar/avatar-image.svelte +38 -38
- package/dist/components/ui/avatar/avatar.svelte +39 -39
- package/dist/components/ui/badge/badge.svelte +46 -46
- package/dist/components/ui/banner/AdCardBanner.svelte +74 -74
- package/dist/components/ui/banner/CtaCardBanner.svelte +118 -118
- package/dist/components/ui/banner/CtaCardImageBanner.svelte +94 -94
- package/dist/components/ui/breadcrumb/core/breadcrumb-list.svelte +31 -31
- package/dist/components/ui/button/ButtonBack.svelte +18 -18
- package/dist/components/ui/button/ButtonLogin.svelte +19 -15
- package/dist/components/ui/button/ButtonLoginWith.svelte +57 -57
- package/dist/components/ui/button/ButtonSend.svelte +15 -15
- package/dist/components/ui/button/button.svelte +100 -86
- package/dist/components/ui/button/button.svelte.d.ts +1 -0
- package/dist/components/ui/card/core/highlight/01/CardHighlight01.svelte +103 -103
- package/dist/components/ui/card/core/highlight/02/CardHighlight02.svelte +99 -99
- package/dist/components/ui/card/core/highlight/CardHighlight.svelte +22 -22
- package/dist/components/ui/card/core/media/01/CardMedia01.svelte +133 -133
- package/dist/components/ui/card/core/media/02/CardMedia02.svelte +127 -127
- package/dist/components/ui/card/core/media/CardMedia.svelte +18 -18
- package/dist/components/ui/card/core/product/01/CardProduct01.svelte +136 -136
- package/dist/components/ui/card/core/product/02/CardProduct02.svelte +124 -124
- package/dist/components/ui/card/core/product/CardProduct.svelte +22 -22
- package/dist/components/ui/card/core/profile/01/CardProfile01.svelte +134 -134
- package/dist/components/ui/card/core/profile/02/CardProfile02.svelte +132 -132
- package/dist/components/ui/card/core/profile/CardProfile.svelte +18 -18
- package/dist/components/ui/card/core/promotion/CardPromotion.svelte +139 -139
- package/dist/components/ui/card/core/promotion/CardPromotionPrice.svelte +32 -32
- package/dist/components/ui/card/core/shared/CardButton.svelte +42 -42
- package/dist/components/ui/card/core/shared/CardCart.svelte +36 -36
- package/dist/components/ui/card/core/shared/CardDescription.svelte +41 -41
- package/dist/components/ui/card/core/shared/CardFavorite.svelte +33 -33
- package/dist/components/ui/card/core/shared/CardLogo.svelte +19 -19
- package/dist/components/ui/card/core/shared/CardPhoneOrWhatsapp.svelte +45 -45
- package/dist/components/ui/card/core/shared/CardStarRating.svelte +24 -24
- package/dist/components/ui/card/core/shared/CardTags.svelte +95 -95
- package/dist/components/ui/card/core/shared/CardThumbnailVideo.svelte +232 -232
- package/dist/components/ui/card/core/shared/CardTitlePrice.svelte +24 -24
- package/dist/components/ui/card/core/shared/TruncatableText.svelte +49 -49
- package/dist/components/ui/carousel/carousel-content.svelte +56 -56
- package/dist/components/ui/carousel/carousel-item.svelte +29 -29
- package/dist/components/ui/carousel/carousel-next.svelte +40 -40
- package/dist/components/ui/carousel/carousel-previous.svelte +40 -40
- package/dist/components/ui/carousel/carousel.svelte +225 -225
- package/dist/components/ui/carousel/core/badge/ui/CarouselBadge.svelte +108 -108
- package/dist/components/ui/carousel/core/grid/shared/ui/CarouselGridSlot.svelte +38 -38
- package/dist/components/ui/carousel/core/hero/ui/CarouselHero.svelte +181 -181
- package/dist/components/ui/carousel/core/highlights/ui/CarouselHighlights.svelte +67 -67
- package/dist/components/ui/carousel/core/product/ui/CarouselProduct.svelte +57 -57
- package/dist/components/ui/carousel/core/promotion/ui/CarouselPromotion.svelte +67 -67
- package/dist/components/ui/carousel/core/shared/ui/CarouselHeader.svelte +59 -59
- package/dist/components/ui/checkbox/checkbox.svelte +96 -96
- package/dist/components/ui/collapsible/collapsible-content.svelte +30 -30
- package/dist/components/ui/collapsible/collapsible-trigger.svelte +51 -51
- package/dist/components/ui/collapsible/collapsible.svelte +66 -66
- package/dist/components/ui/data-table/flex-render.svelte +40 -40
- package/dist/components/ui/datatable/ui/DataTableActions.svelte +28 -28
- package/dist/components/ui/datatable/ui/DataTableCheckbox.svelte +22 -22
- package/dist/components/ui/datatable/ui/DataTableContent.svelte +59 -59
- package/dist/components/ui/datatable/ui/DataTableCore.svelte +148 -148
- package/dist/components/ui/datatable/ui/DataTableDragHandle.svelte +8 -8
- package/dist/components/ui/datatable/ui/DataTableListFilter.svelte +60 -60
- package/dist/components/ui/datatable/ui/DataTableListPagination.svelte +35 -35
- package/dist/components/ui/drawer/drawer-close.svelte +41 -41
- package/dist/components/ui/drawer/drawer-content.svelte +81 -81
- package/dist/components/ui/drawer/drawer-description.svelte +19 -19
- package/dist/components/ui/drawer/drawer-footer.svelte +20 -20
- package/dist/components/ui/drawer/drawer-header.svelte +20 -20
- package/dist/components/ui/drawer/drawer-nested.svelte +34 -34
- package/dist/components/ui/drawer/drawer-overlay.svelte +25 -25
- package/dist/components/ui/drawer/drawer-portal.svelte +19 -19
- package/dist/components/ui/drawer/drawer-title.svelte +19 -19
- package/dist/components/ui/drawer/drawer-trigger.svelte +42 -42
- package/dist/components/ui/drawer/drawer.svelte +74 -74
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +25 -25
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +69 -69
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +106 -106
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +27 -27
- package/dist/components/ui/dropdown-menu/dropdown-menu-group.svelte +21 -21
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +60 -60
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +27 -27
- package/dist/components/ui/dropdown-menu/dropdown-menu-portal.svelte +6 -6
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +43 -43
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +70 -70
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +20 -20
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +33 -33
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +57 -57
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub.svelte +76 -76
- package/dist/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +68 -68
- package/dist/components/ui/dropdown-menu/dropdown-menu.svelte +53 -53
- package/dist/components/ui/empty/empty-content.svelte +19 -19
- package/dist/components/ui/empty/empty-description.svelte +19 -19
- package/dist/components/ui/empty/empty-header.svelte +19 -19
- package/dist/components/ui/empty/empty-media.svelte +41 -41
- package/dist/components/ui/empty/empty-title.svelte +19 -19
- package/dist/components/ui/empty/empty.svelte +19 -19
- package/dist/components/ui/footer/ui/Footer.svelte +18 -18
- package/dist/components/ui/form/ui/calendar/Calendar.svelte +193 -193
- package/dist/components/ui/form/ui/calendar/CalendarCard.svelte +89 -89
- package/dist/components/ui/form/ui/calendar/DaysGrid.svelte +75 -75
- package/dist/components/ui/form/ui/calendar/MonthSelect.svelte +49 -49
- package/dist/components/ui/form/ui/calendar/YearSelect.svelte +116 -116
- package/dist/components/ui/form/ui/input-base.svelte +83 -83
- package/dist/components/ui/form/ui/input-calendar-interval.svelte +178 -178
- package/dist/components/ui/form/ui/input-calendar.svelte +109 -109
- package/dist/components/ui/form/ui/input-email-or-phone.svelte +23 -23
- package/dist/components/ui/form/ui/input-email.svelte +23 -23
- package/dist/components/ui/form/ui/input-password-confirm.svelte +23 -23
- package/dist/components/ui/form/ui/input-password.svelte +23 -23
- package/dist/components/ui/form/ui/input-phone.svelte +43 -37
- package/dist/components/ui/form/ui/input-select.svelte +246 -246
- package/dist/components/ui/form/ui/input-username.svelte +22 -22
- package/dist/components/ui/grid/core/ui/01/Grid01.svelte +30 -30
- package/dist/components/ui/grid/core/ui/02/Grid02.svelte +30 -30
- package/dist/components/ui/grid/core/ui/ItemsPanel.svelte +26 -26
- package/dist/components/ui/grid/core/ui/ItemsPanelCarousel.svelte +37 -37
- package/dist/components/ui/grid/core/ui/ItemsPanelGrid.svelte +43 -43
- package/dist/components/ui/grid/core/ui/ItemsSimpleGrid.svelte +45 -45
- package/dist/components/ui/grid/core/ui/shared/DescriptionGrid.svelte +23 -23
- package/dist/components/ui/grid/core/ui/shared/IconRenderGrid.svelte +23 -23
- package/dist/components/ui/grid/core/ui/shared/TitleGrid.svelte +19 -19
- package/dist/components/ui/hero/SimpleHero.svelte +65 -65
- package/dist/components/ui/input-otp/input-otp-group.svelte +22 -22
- package/dist/components/ui/input-otp/input-otp-separator.svelte +27 -27
- package/dist/components/ui/input-otp/input-otp-slot.svelte +63 -63
- package/dist/components/ui/input-otp/input-otp.svelte +181 -181
- package/dist/components/ui/label/core/LabelOr.svelte +25 -25
- package/dist/components/ui/label/label.svelte +19 -19
- package/dist/components/ui/language-switcher/language-switcher.svelte +48 -48
- package/dist/components/ui/light-switch/light-switch.svelte +48 -48
- package/dist/components/ui/link/link-forget-password.svelte +12 -12
- package/dist/components/ui/link/link-privacy-polity.svelte +12 -12
- package/dist/components/ui/link/link-terms-of-service.svelte +12 -12
- package/dist/components/ui/modal/core/ui/ModalCore.svelte +132 -132
- package/dist/components/ui/modal/form/index.d.ts +3 -2
- package/dist/components/ui/modal/form/index.js +2 -1
- package/dist/components/ui/modal/form/types.d.ts +41 -0
- package/dist/components/ui/modal/form/ui/ModalForm.svelte +11 -6
- package/dist/components/ui/modal/form/ui/ModalFormEmailOrPhone.svelte +204 -0
- package/dist/components/ui/modal/form/ui/ModalFormEmailOrPhone.svelte.d.ts +4 -0
- package/dist/components/ui/modal/grid/ui/02/ModalGridSelection02.svelte +146 -146
- package/dist/components/ui/modal/share/ui/ModalShareSelection.svelte +156 -156
- package/dist/components/ui/nav/ui/ComplexMenu.svelte +51 -51
- package/dist/components/ui/nav/ui/Menu.svelte +72 -72
- package/dist/components/ui/nav/ui/SimpleMenu.svelte +14 -14
- package/dist/components/ui/nav/ui/mobile/ComplexMenuMobile.svelte +125 -125
- package/dist/components/ui/nav/ui/mobile/MenuMobile.svelte +54 -54
- package/dist/components/ui/nav/ui/shared/MenuButton.svelte +51 -51
- package/dist/components/ui/nav/ui/shared/MenuLinks.svelte +40 -40
- package/dist/components/ui/nav/ui/shared/MenuListItem.svelte +44 -44
- package/dist/components/ui/nav/ui/shared/MenuLogo.svelte +13 -13
- package/dist/components/ui/nav/ui/shared/dropdown/DropdownNavigationMenuItemGrid.svelte +30 -30
- package/dist/components/ui/nav/ui/shared/navigation/NavDropdown.svelte +88 -88
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItem.svelte +17 -17
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItemCard.svelte +53 -53
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItemGrid.svelte +35 -36
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItemList.svelte +24 -24
- package/dist/components/ui/nav/ui/shared/navigation/NavigationMenuItems.svelte +21 -21
- package/dist/components/ui/panel/CarouselSlot.svelte +57 -57
- package/dist/components/ui/panel/LeftHero.svelte +114 -114
- package/dist/components/ui/panel/NotFoundEmpty.svelte +66 -66
- package/dist/components/ui/phone-input/country-selector.svelte +87 -87
- package/dist/components/ui/phone-input/flag.svelte +11 -11
- package/dist/components/ui/phone-input/phone-input.svelte +163 -163
- package/dist/components/ui/popover/popover-close.svelte +25 -25
- package/dist/components/ui/popover/popover-content.svelte +92 -92
- package/dist/components/ui/popover/popover-portal.svelte +6 -6
- package/dist/components/ui/popover/popover-trigger.svelte +68 -68
- package/dist/components/ui/popover/popover.svelte +53 -53
- package/dist/components/ui/search/SearchInput.svelte +32 -32
- package/dist/components/ui/search/shared/SearchInputCore.svelte +66 -66
- package/dist/components/ui/separator/separator.svelte +28 -28
- package/dist/components/ui/sidebar/core/MenuBarSidebar.svelte +70 -70
- package/dist/components/ui/sidebar/core/ui/navbar/NavMenuBarSidebar.svelte +97 -97
- package/dist/components/ui/sidebar/core/ui/navbar/NavMenuBottomSidebar.svelte +33 -33
- package/dist/components/ui/sidebar/core/ui/navbar/NavMenuTopBarSidebar.svelte +101 -101
- package/dist/components/ui/sidebar/core/ui/navbar/nav-menu-header-sidebar.svelte +77 -77
- package/dist/components/ui/sidebar/sidebar-content.svelte +24 -24
- package/dist/components/ui/sidebar/sidebar-footer.svelte +21 -21
- package/dist/components/ui/sidebar/sidebar-group-content.svelte +21 -21
- package/dist/components/ui/sidebar/sidebar-menu-action.svelte +38 -38
- package/dist/components/ui/sidebar/sidebar-menu-button.svelte +70 -70
- package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +39 -39
- package/dist/components/ui/sidebar/sidebar-provider.svelte +62 -62
- package/dist/components/ui/sidebar/sidebar-rail.svelte +36 -36
- package/dist/components/ui/sidebar/sidebar-separator.svelte +21 -21
- package/dist/components/ui/sidebar/sidebar-trigger.svelte +36 -36
- package/dist/components/ui/sidebar/sidebar.svelte +118 -118
- package/dist/components/ui/skeleton/skeleton.svelte +19 -19
- package/dist/components/ui/star-rating/star-rating-star.svelte +66 -66
- package/dist/components/ui/star-rating/star-rating.svelte +149 -149
- package/dist/components/ui/table/table-body.svelte +15 -15
- package/dist/components/ui/table/table-caption.svelte +20 -20
- package/dist/components/ui/table/table-cell.svelte +15 -15
- package/dist/components/ui/table/table-footer.svelte +20 -20
- package/dist/components/ui/table/table-head.svelte +15 -15
- package/dist/components/ui/table/table-header.svelte +20 -20
- package/dist/components/ui/table/table-row.svelte +15 -15
- package/dist/components/ui/table/table.svelte +17 -17
- package/dist/components/ui/tabs/data/TabModel.d.ts +1 -0
- package/dist/components/ui/tabs/ui/tab-underline.svelte +47 -43
- package/dist/components/ui/underline-tabs/underline-tabs-content.svelte +33 -33
- package/dist/components/ui/underline-tabs/underline-tabs-list.svelte +40 -40
- package/dist/components/ui/underline-tabs/underline-tabs-trigger.svelte +91 -91
- package/dist/components/ui/underline-tabs/underline-tabs.svelte +61 -61
- package/dist/docs/ApiTable.svelte +42 -42
- package/dist/docs/CodeBlock.svelte +26 -26
- package/dist/docs/DocsHeader.svelte +25 -25
- package/dist/docs/DocsSidebar.svelte +108 -108
- package/dist/docs/components.js +624 -584
- package/dist/globals.css +27 -7
- package/dist/i18n/langs/en.d.ts +3 -1
- package/dist/i18n/langs/en.js +3 -1
- package/dist/i18n/langs/pt.d.ts +3 -1
- package/dist/i18n/langs/pt.js +3 -1
- package/dist/i18n/translations.d.ts +6 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/styles/globals.css +283 -283
- package/dist/types/index.d.ts +3 -1
- package/package.json +81 -81
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { t } from "../../../i18n";
|
|
3
|
-
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAnchorAttributes;
|
|
6
|
-
|
|
7
|
-
let { ...restProps }: Props = $props();
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<a {...restProps} class="text-xs
|
|
11
|
-
{$t("link.privacy-policy.label")}
|
|
12
|
-
</a>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { t } from "../../../i18n";
|
|
3
|
+
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAnchorAttributes;
|
|
6
|
+
|
|
7
|
+
let { class: className, ...restProps }: Props = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<a {...restProps} class="text-xs z-10 {className}">
|
|
11
|
+
{$t("link.privacy-policy.label")}
|
|
12
|
+
</a>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { t } from "../../../i18n";
|
|
3
|
-
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAnchorAttributes;
|
|
6
|
-
|
|
7
|
-
let { ...restProps }: Props = $props();
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<a {...restProps} class="text-xs
|
|
11
|
-
{$t("link.terms-of-service.label")}
|
|
12
|
-
</a>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { t } from "../../../i18n";
|
|
3
|
+
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAnchorAttributes;
|
|
6
|
+
|
|
7
|
+
let { class: className, ...restProps }: Props = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<a {...restProps} class="text-xs z-10 {className}">
|
|
11
|
+
{$t("link.terms-of-service.label")}
|
|
12
|
+
</a>
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from "../../../../../utils";
|
|
3
|
-
import {
|
|
4
|
-
ArrowLeft01Icon,
|
|
5
|
-
ArrowRight01Icon,
|
|
6
|
-
} from "@hugeicons/core-free-icons";
|
|
7
|
-
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
-
import type { ModalCoreProps } from "../types";
|
|
9
|
-
|
|
10
|
-
let {
|
|
11
|
-
isOpen = $bindable(false),
|
|
12
|
-
title,
|
|
13
|
-
subtitle,
|
|
14
|
-
totalSteps = 1,
|
|
15
|
-
currentStep = 1,
|
|
16
|
-
showProgress = true,
|
|
17
|
-
showBack = true,
|
|
18
|
-
showSkip = false,
|
|
19
|
-
skipText = "Skip This Step",
|
|
20
|
-
continueText = "Continue",
|
|
21
|
-
backText = "Back",
|
|
22
|
-
onBack,
|
|
23
|
-
onContinue,
|
|
24
|
-
onSkip,
|
|
25
|
-
onClose,
|
|
26
|
-
content,
|
|
27
|
-
footer,
|
|
28
|
-
class: className,
|
|
29
|
-
}: ModalCoreProps = $props();
|
|
30
|
-
|
|
31
|
-
function handleClose() {
|
|
32
|
-
isOpen = false;
|
|
33
|
-
onClose?.();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const progressPercent = $derived(
|
|
37
|
-
totalSteps > 0 ? (currentStep / totalSteps) * 100 : 0,
|
|
38
|
-
);
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
{#if isOpen}
|
|
42
|
-
<div class="fixed inset-0 z-50 flex items-center justify-center">
|
|
43
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
44
|
-
<div
|
|
45
|
-
class="absolute inset-0 bg-black/50 backdrop-blur-sm"
|
|
46
|
-
onclick={handleClose}
|
|
47
|
-
onkeydown={(e) => {
|
|
48
|
-
if (e.key === "Escape") handleClose();
|
|
49
|
-
}}
|
|
50
|
-
></div>
|
|
51
|
-
|
|
52
|
-
<div
|
|
53
|
-
class={cn(
|
|
54
|
-
"relative z-10 mx-4 flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-3xl border border-border shadow-lg bg-background",
|
|
55
|
-
"before:absolute before:-inset-px before:z-[-1] before:rounded-3xl",
|
|
56
|
-
"animate-in fade-in zoom-in-95 duration-200",
|
|
57
|
-
className,
|
|
58
|
-
)}
|
|
59
|
-
>
|
|
60
|
-
<!-- Header -->
|
|
61
|
-
<div class="px-8 pt-8">
|
|
62
|
-
<h2 class="text-2xl font-semibold tracking-tight">
|
|
63
|
-
{title}
|
|
64
|
-
</h2>
|
|
65
|
-
{#if subtitle}
|
|
66
|
-
<p class="mt-2 text-sm text-muted-foreground">{subtitle}</p>
|
|
67
|
-
{/if}
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
<!-- Content -->
|
|
71
|
-
<div class="flex-1 overflow-y-auto px-8 py-6">
|
|
72
|
-
{#if content}
|
|
73
|
-
{@render content()}
|
|
74
|
-
{/if}
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<!-- Footer -->
|
|
78
|
-
{#if footer}
|
|
79
|
-
<div class="border-t border-border px-8 py-5">
|
|
80
|
-
{@render footer()}
|
|
81
|
-
</div>
|
|
82
|
-
{:else}
|
|
83
|
-
<div class="border-t border-border px-8 py-5">
|
|
84
|
-
{#if showProgress}
|
|
85
|
-
<div class="mb-5 h-1.5 w-full overflow-hidden rounded-full">
|
|
86
|
-
<div
|
|
87
|
-
class="h-full rounded-full transition-all duration-300"
|
|
88
|
-
style="width: {progressPercent}%"
|
|
89
|
-
></div>
|
|
90
|
-
</div>
|
|
91
|
-
{/if}
|
|
92
|
-
|
|
93
|
-
<div class="flex items-center justify-between">
|
|
94
|
-
<div class="flex items-center gap-4">
|
|
95
|
-
{#if showSkip}
|
|
96
|
-
<button
|
|
97
|
-
type="button"
|
|
98
|
-
class="text-sm font-medium text-muted-foreground transition hover:text-foreground"
|
|
99
|
-
onclick={onSkip}
|
|
100
|
-
>
|
|
101
|
-
{skipText}
|
|
102
|
-
</button>
|
|
103
|
-
{/if}
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
<div class="flex items-center gap-3">
|
|
107
|
-
{#if showBack && currentStep > 1}
|
|
108
|
-
<button
|
|
109
|
-
type="button"
|
|
110
|
-
class="inline-flex items-center gap-2 rounded-full border border-border px-5 py-2.5 text-sm font-semibold transition"
|
|
111
|
-
onclick={onBack}
|
|
112
|
-
>
|
|
113
|
-
<HugeiconsIcon icon={ArrowLeft01Icon} class="size-4" />
|
|
114
|
-
{backText}
|
|
115
|
-
</button>
|
|
116
|
-
{/if}
|
|
117
|
-
|
|
118
|
-
<button
|
|
119
|
-
type="button"
|
|
120
|
-
class="inline-flex items-center gap-2 rounded-full px-6 py-2.5 text-sm font-semibold bg-primary text-white transition"
|
|
121
|
-
onclick={onContinue}
|
|
122
|
-
>
|
|
123
|
-
{continueText}
|
|
124
|
-
<HugeiconsIcon icon={ArrowRight01Icon} class="size-4" />
|
|
125
|
-
</button>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
{/if}
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../../../utils";
|
|
3
|
+
import {
|
|
4
|
+
ArrowLeft01Icon,
|
|
5
|
+
ArrowRight01Icon,
|
|
6
|
+
} from "@hugeicons/core-free-icons";
|
|
7
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
|
+
import type { ModalCoreProps } from "../types";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
isOpen = $bindable(false),
|
|
12
|
+
title,
|
|
13
|
+
subtitle,
|
|
14
|
+
totalSteps = 1,
|
|
15
|
+
currentStep = 1,
|
|
16
|
+
showProgress = true,
|
|
17
|
+
showBack = true,
|
|
18
|
+
showSkip = false,
|
|
19
|
+
skipText = "Skip This Step",
|
|
20
|
+
continueText = "Continue",
|
|
21
|
+
backText = "Back",
|
|
22
|
+
onBack,
|
|
23
|
+
onContinue,
|
|
24
|
+
onSkip,
|
|
25
|
+
onClose,
|
|
26
|
+
content,
|
|
27
|
+
footer,
|
|
28
|
+
class: className,
|
|
29
|
+
}: ModalCoreProps = $props();
|
|
30
|
+
|
|
31
|
+
function handleClose() {
|
|
32
|
+
isOpen = false;
|
|
33
|
+
onClose?.();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const progressPercent = $derived(
|
|
37
|
+
totalSteps > 0 ? (currentStep / totalSteps) * 100 : 0,
|
|
38
|
+
);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
{#if isOpen}
|
|
42
|
+
<div class="fixed inset-0 z-50 flex items-center justify-center">
|
|
43
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
44
|
+
<div
|
|
45
|
+
class="absolute inset-0 bg-black/50 backdrop-blur-sm"
|
|
46
|
+
onclick={handleClose}
|
|
47
|
+
onkeydown={(e) => {
|
|
48
|
+
if (e.key === "Escape") handleClose();
|
|
49
|
+
}}
|
|
50
|
+
></div>
|
|
51
|
+
|
|
52
|
+
<div
|
|
53
|
+
class={cn(
|
|
54
|
+
"relative z-10 mx-4 flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-3xl border border-border shadow-lg bg-background",
|
|
55
|
+
"before:absolute before:-inset-px before:z-[-1] before:rounded-3xl",
|
|
56
|
+
"animate-in fade-in zoom-in-95 duration-200",
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
>
|
|
60
|
+
<!-- Header -->
|
|
61
|
+
<div class="px-8 pt-8">
|
|
62
|
+
<h2 class="text-2xl font-semibold tracking-tight">
|
|
63
|
+
{title}
|
|
64
|
+
</h2>
|
|
65
|
+
{#if subtitle}
|
|
66
|
+
<p class="mt-2 text-sm text-muted-foreground">{subtitle}</p>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<!-- Content -->
|
|
71
|
+
<div class="flex-1 overflow-y-auto px-8 py-6">
|
|
72
|
+
{#if content}
|
|
73
|
+
{@render content()}
|
|
74
|
+
{/if}
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<!-- Footer -->
|
|
78
|
+
{#if footer}
|
|
79
|
+
<div class="border-t border-border px-8 py-5">
|
|
80
|
+
{@render footer()}
|
|
81
|
+
</div>
|
|
82
|
+
{:else}
|
|
83
|
+
<div class="border-t border-border px-8 py-5">
|
|
84
|
+
{#if showProgress}
|
|
85
|
+
<div class="mb-5 h-1.5 w-full overflow-hidden rounded-full">
|
|
86
|
+
<div
|
|
87
|
+
class="h-full rounded-full transition-all duration-300"
|
|
88
|
+
style="width: {progressPercent}%"
|
|
89
|
+
></div>
|
|
90
|
+
</div>
|
|
91
|
+
{/if}
|
|
92
|
+
|
|
93
|
+
<div class="flex items-center justify-between">
|
|
94
|
+
<div class="flex items-center gap-4">
|
|
95
|
+
{#if showSkip}
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
class="text-sm font-medium text-muted-foreground transition hover:text-foreground"
|
|
99
|
+
onclick={onSkip}
|
|
100
|
+
>
|
|
101
|
+
{skipText}
|
|
102
|
+
</button>
|
|
103
|
+
{/if}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div class="flex items-center gap-3">
|
|
107
|
+
{#if showBack && currentStep > 1}
|
|
108
|
+
<button
|
|
109
|
+
type="button"
|
|
110
|
+
class="inline-flex items-center gap-2 rounded-full border border-border px-5 py-2.5 text-sm font-semibold transition"
|
|
111
|
+
onclick={onBack}
|
|
112
|
+
>
|
|
113
|
+
<HugeiconsIcon icon={ArrowLeft01Icon} class="size-4" />
|
|
114
|
+
{backText}
|
|
115
|
+
</button>
|
|
116
|
+
{/if}
|
|
117
|
+
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
class="inline-flex items-center gap-2 rounded-full px-6 py-2.5 text-sm font-semibold bg-primary text-white transition"
|
|
121
|
+
onclick={onContinue}
|
|
122
|
+
>
|
|
123
|
+
{continueText}
|
|
124
|
+
<HugeiconsIcon icon={ArrowRight01Icon} class="size-4" />
|
|
125
|
+
</button>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
{/if}
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
{/if}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import Root from "./ui/ModalForm.svelte";
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
import ModalFormEmailOrPhone from "./ui/ModalFormEmailOrPhone.svelte";
|
|
3
|
+
export { Root, Root as ModalForm, ModalFormEmailOrPhone, };
|
|
4
|
+
export type { ModalFormProps, ModalFormEmailOrPhoneProps, ModalFormEmailOrPhoneSubmitData, ModalFormEmailOrPhoneType, FormInputConfig, FormOption, } from "./types";
|
|
@@ -36,3 +36,44 @@ export type ModalFormProps = {
|
|
|
36
36
|
onClose?: () => void;
|
|
37
37
|
class?: string;
|
|
38
38
|
};
|
|
39
|
+
export type ModalFormEmailOrPhoneType = "EMAIL" | "PHONE" | "EMAIL_OR_PHONE";
|
|
40
|
+
export type ModalFormEmailOrPhoneSubmitData = {
|
|
41
|
+
type: ModalFormEmailOrPhoneType;
|
|
42
|
+
value: string;
|
|
43
|
+
email?: string;
|
|
44
|
+
phone?: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Props do componente ModalFormEmailOrPhone — formulário em modal para envio de OTP por email ou telefone.
|
|
48
|
+
*
|
|
49
|
+
* @property title - Título principal do modal.
|
|
50
|
+
* @property subtitle - Subtítulo/descrição do modal.
|
|
51
|
+
* @property email - Email pré-existente (opcional).
|
|
52
|
+
* @property phone - Telefone pré-existente (opcional).
|
|
53
|
+
* @property isOpen - Controla a visibilidade do modal (bindable).
|
|
54
|
+
* @property submitText - Texto do botão de submissão.
|
|
55
|
+
* @property submitLoadingText - Texto durante carregamento.
|
|
56
|
+
* @property cancelText - Texto do botão cancelar.
|
|
57
|
+
* @property isLoading - Estado de carregamento.
|
|
58
|
+
* @property showCancel - Exibe o botão cancelar.
|
|
59
|
+
* @property onSubmit - Callback ao submeter o formulário com o canal e valor escolhido.
|
|
60
|
+
* @property onCancel - Chamado ao cancelar.
|
|
61
|
+
* @property onClose - Chamado ao fechar o modal.
|
|
62
|
+
* @property class - Classe CSS extra no container do modal.
|
|
63
|
+
*/
|
|
64
|
+
export type ModalFormEmailOrPhoneProps = {
|
|
65
|
+
title?: string;
|
|
66
|
+
subtitle?: string;
|
|
67
|
+
email?: string;
|
|
68
|
+
phone?: string;
|
|
69
|
+
isOpen?: boolean;
|
|
70
|
+
submitText?: string;
|
|
71
|
+
submitLoadingText?: string;
|
|
72
|
+
cancelText?: string;
|
|
73
|
+
isLoading?: boolean;
|
|
74
|
+
showCancel?: boolean;
|
|
75
|
+
onSubmit?: (data: ModalFormEmailOrPhoneSubmitData) => void;
|
|
76
|
+
onCancel?: () => void;
|
|
77
|
+
onClose?: () => void;
|
|
78
|
+
class?: string;
|
|
79
|
+
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { cn } from "../../../../../utils";
|
|
3
3
|
import ModalCore from "../../core/ui/ModalCore.svelte";
|
|
4
4
|
import Form from "../../../form/Form.svelte";
|
|
5
|
+
import { t } from "../../../../../i18n";
|
|
5
6
|
import type { ModalFormProps } from "../types";
|
|
6
7
|
|
|
7
8
|
let {
|
|
@@ -9,9 +10,9 @@
|
|
|
9
10
|
subtitle,
|
|
10
11
|
inputs = [],
|
|
11
12
|
isOpen = $bindable(false),
|
|
12
|
-
submitText
|
|
13
|
-
submitLoadingText
|
|
14
|
-
cancelText
|
|
13
|
+
submitText,
|
|
14
|
+
submitLoadingText,
|
|
15
|
+
cancelText,
|
|
15
16
|
isLoading = false,
|
|
16
17
|
showCancel = true,
|
|
17
18
|
columns = 2,
|
|
@@ -21,6 +22,10 @@
|
|
|
21
22
|
class: className,
|
|
22
23
|
}: ModalFormProps = $props();
|
|
23
24
|
|
|
25
|
+
const finalSubmitText = $derived(submitText ?? $t("label.submit") ?? "Submit");
|
|
26
|
+
const finalSubmitLoadingText = $derived(submitLoadingText ?? $t("label.submitting") ?? "Submitting...");
|
|
27
|
+
const finalCancelText = $derived(cancelText ?? $t("label.cancel") ?? "Cancel");
|
|
28
|
+
|
|
24
29
|
function handleSubmit(data: Record<string, string | string[] | boolean>) {
|
|
25
30
|
onSubmit?.(data);
|
|
26
31
|
}
|
|
@@ -44,8 +49,8 @@
|
|
|
44
49
|
<Form
|
|
45
50
|
{inputs}
|
|
46
51
|
{columns}
|
|
47
|
-
{
|
|
48
|
-
{
|
|
52
|
+
submitText={finalSubmitText}
|
|
53
|
+
submitLoadingText={finalSubmitLoadingText}
|
|
49
54
|
{isLoading}
|
|
50
55
|
onSubmit={handleSubmit}
|
|
51
56
|
/>
|
|
@@ -59,7 +64,7 @@
|
|
|
59
64
|
class="rounded-lg border border-border px-5 py-2.5 text-sm font-semibold transition hover:bg-muted"
|
|
60
65
|
onclick={handleCancel}
|
|
61
66
|
>
|
|
62
|
-
{
|
|
67
|
+
{finalCancelText}
|
|
63
68
|
</button>
|
|
64
69
|
</div>
|
|
65
70
|
{/if}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ModalCore from "../../core/ui/ModalCore.svelte";
|
|
3
|
+
import InputEmailOrPhone from "../../../form/ui/input-email-or-phone.svelte";
|
|
4
|
+
import InputEmail from "../../../form/ui/input-email.svelte";
|
|
5
|
+
import InputPhone from "../../../form/ui/input-phone.svelte";
|
|
6
|
+
import Button from "../../../button/button.svelte";
|
|
7
|
+
import { t } from "../../../../../i18n";
|
|
8
|
+
import {
|
|
9
|
+
Mail01Icon,
|
|
10
|
+
SmartPhone01Icon,
|
|
11
|
+
CheckmarkCircle02Icon,
|
|
12
|
+
Login02Icon,
|
|
13
|
+
} from "@hugeicons/core-free-icons";
|
|
14
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
15
|
+
import type {
|
|
16
|
+
ModalFormEmailOrPhoneProps,
|
|
17
|
+
ModalFormEmailOrPhoneType,
|
|
18
|
+
} from "../types";
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
title,
|
|
22
|
+
subtitle,
|
|
23
|
+
email,
|
|
24
|
+
phone,
|
|
25
|
+
isOpen = $bindable(false),
|
|
26
|
+
submitText,
|
|
27
|
+
submitLoadingText,
|
|
28
|
+
cancelText,
|
|
29
|
+
isLoading = false,
|
|
30
|
+
showCancel = true,
|
|
31
|
+
onSubmit,
|
|
32
|
+
onCancel,
|
|
33
|
+
onClose,
|
|
34
|
+
class: className,
|
|
35
|
+
}: ModalFormEmailOrPhoneProps = $props();
|
|
36
|
+
|
|
37
|
+
let userEmail = $state(email ?? "");
|
|
38
|
+
let userPhone = $state(phone ?? "");
|
|
39
|
+
let emailOrPhone = $state("");
|
|
40
|
+
let channel = $state<ModalFormEmailOrPhoneType>("EMAIL_OR_PHONE");
|
|
41
|
+
|
|
42
|
+
const hasPreset = $derived(Boolean(email || phone));
|
|
43
|
+
const isValid = $derived(
|
|
44
|
+
!hasPreset
|
|
45
|
+
? Boolean(emailOrPhone.trim())
|
|
46
|
+
: channel === "EMAIL"
|
|
47
|
+
? Boolean(userEmail.trim())
|
|
48
|
+
: Boolean(userPhone.trim()),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const finalTitle = $derived(
|
|
52
|
+
title ?? $t("label.otp-verification") ?? "Verificação OTP",
|
|
53
|
+
);
|
|
54
|
+
const finalSubtitle = $derived(
|
|
55
|
+
subtitle ??
|
|
56
|
+
$t("text.otp-verification") ??
|
|
57
|
+
"Insira o seu email ou telefone para receber o código de verificação.",
|
|
58
|
+
);
|
|
59
|
+
const finalSubmitText = $derived(submitText ?? $t("label.send") ?? "Enviar");
|
|
60
|
+
const finalLoadingText = $derived(
|
|
61
|
+
submitLoadingText ?? $t("label.submitting") ?? "A submeter...",
|
|
62
|
+
);
|
|
63
|
+
const finalCancelText = $derived(
|
|
64
|
+
cancelText ?? $t("label.cancel") ?? "Cancelar",
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
function handleSubmit(e: Event) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
if (isLoading || !isValid) return;
|
|
70
|
+
const value = !hasPreset
|
|
71
|
+
? emailOrPhone.trim()
|
|
72
|
+
: channel === "EMAIL"
|
|
73
|
+
? userEmail.trim()
|
|
74
|
+
: userPhone.trim();
|
|
75
|
+
onSubmit?.({
|
|
76
|
+
type: !hasPreset ? "EMAIL_OR_PHONE" : channel,
|
|
77
|
+
value,
|
|
78
|
+
email: hasPreset ? userEmail.trim() : undefined,
|
|
79
|
+
phone: hasPreset ? userPhone.trim() : undefined,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function handleCancel() {
|
|
84
|
+
isOpen = false;
|
|
85
|
+
onCancel?.();
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<ModalCore
|
|
90
|
+
bind:isOpen
|
|
91
|
+
title={finalTitle}
|
|
92
|
+
subtitle={finalSubtitle}
|
|
93
|
+
showProgress={false}
|
|
94
|
+
showBack={false}
|
|
95
|
+
{onClose}
|
|
96
|
+
class={className}
|
|
97
|
+
>
|
|
98
|
+
{#snippet content()}
|
|
99
|
+
<form class="space-y-4" onsubmit={handleSubmit}>
|
|
100
|
+
{#if !hasPreset}
|
|
101
|
+
<InputEmailOrPhone
|
|
102
|
+
bind:value={emailOrPhone}
|
|
103
|
+
isLabel
|
|
104
|
+
isIcon
|
|
105
|
+
disabled={isLoading}
|
|
106
|
+
/>
|
|
107
|
+
{:else}
|
|
108
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
|
109
|
+
{#each [{ type: "EMAIL" as const, label: $t("input.email.label") ?? "Email", val: email, icon: Mail01Icon }, { type: "PHONE" as const, label: $t("input.phone.label") ?? "Telefone", val: phone, icon: SmartPhone01Icon }] as item (item.type)}
|
|
110
|
+
{@const isSelected = channel === item.type}
|
|
111
|
+
<button
|
|
112
|
+
type="button"
|
|
113
|
+
class="relative flex flex-col items-start gap-1 rounded-2xl border p-4 text-left transition {isSelected
|
|
114
|
+
? 'border-primary bg-primary/5 ring-2 ring-primary/20'
|
|
115
|
+
: 'border-border bg-card hover:bg-muted/50'}"
|
|
116
|
+
onclick={() => (channel = item.type)}
|
|
117
|
+
>
|
|
118
|
+
<div class="flex w-full items-center justify-between">
|
|
119
|
+
<div
|
|
120
|
+
class="flex size-9 items-center justify-center rounded-xl {isSelected
|
|
121
|
+
? 'bg-primary text-primary-foreground'
|
|
122
|
+
: 'bg-muted text-muted-foreground'}"
|
|
123
|
+
>
|
|
124
|
+
<HugeiconsIcon icon={item.icon} size={18} />
|
|
125
|
+
</div>
|
|
126
|
+
{#if isSelected}
|
|
127
|
+
<HugeiconsIcon
|
|
128
|
+
icon={CheckmarkCircle02Icon}
|
|
129
|
+
class="size-5 text-primary"
|
|
130
|
+
/>
|
|
131
|
+
{/if}
|
|
132
|
+
</div>
|
|
133
|
+
<span class="mt-2 text-sm font-semibold">{item.label}</span>
|
|
134
|
+
{#if item.val}
|
|
135
|
+
<p class="truncate text-xs text-muted-foreground max-w-50">
|
|
136
|
+
{item.val}
|
|
137
|
+
</p>
|
|
138
|
+
{/if}
|
|
139
|
+
</button>
|
|
140
|
+
{/each}
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<div class="space-y-3 pt-1">
|
|
144
|
+
<div
|
|
145
|
+
class="transition-opacity {channel !== 'EMAIL'
|
|
146
|
+
? 'opacity-50 pointer-events-none'
|
|
147
|
+
: ''}"
|
|
148
|
+
>
|
|
149
|
+
<InputEmail
|
|
150
|
+
bind:value={userEmail}
|
|
151
|
+
isLabel
|
|
152
|
+
isIcon
|
|
153
|
+
disabled={isLoading || channel !== "EMAIL"}
|
|
154
|
+
/>
|
|
155
|
+
</div>
|
|
156
|
+
<div
|
|
157
|
+
class="transition-opacity {channel !== 'PHONE'
|
|
158
|
+
? 'opacity-50 pointer-events-none'
|
|
159
|
+
: ''}"
|
|
160
|
+
>
|
|
161
|
+
<InputPhone
|
|
162
|
+
bind:value={userPhone}
|
|
163
|
+
isLabel
|
|
164
|
+
disabled={isLoading || channel !== "PHONE"}
|
|
165
|
+
/>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
{/if}
|
|
169
|
+
|
|
170
|
+
<div class="pt-2">
|
|
171
|
+
<Button
|
|
172
|
+
type="submit"
|
|
173
|
+
{isLoading}
|
|
174
|
+
disabled={isLoading || !isValid}
|
|
175
|
+
class="w-full flex items-center justify-center gap-2 py-2.5"
|
|
176
|
+
>
|
|
177
|
+
{#if isLoading}
|
|
178
|
+
<span
|
|
179
|
+
class="size-4 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
180
|
+
></span>
|
|
181
|
+
{finalLoadingText}
|
|
182
|
+
{:else}
|
|
183
|
+
<HugeiconsIcon icon={Login02Icon} size={16} />
|
|
184
|
+
{finalSubmitText}
|
|
185
|
+
{/if}
|
|
186
|
+
</Button>
|
|
187
|
+
</div>
|
|
188
|
+
</form>
|
|
189
|
+
{/snippet}
|
|
190
|
+
|
|
191
|
+
{#snippet footer()}
|
|
192
|
+
{#if showCancel}
|
|
193
|
+
<div class="flex items-center justify-end">
|
|
194
|
+
<button
|
|
195
|
+
type="button"
|
|
196
|
+
class="rounded-lg border border-border px-5 py-2 text-sm font-semibold transition hover:bg-muted"
|
|
197
|
+
onclick={handleCancel}
|
|
198
|
+
>
|
|
199
|
+
{finalCancelText}
|
|
200
|
+
</button>
|
|
201
|
+
</div>
|
|
202
|
+
{/if}
|
|
203
|
+
{/snippet}
|
|
204
|
+
</ModalCore>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ModalFormEmailOrPhoneProps } from "../types";
|
|
2
|
+
declare const ModalFormEmailOrPhone: import("svelte").Component<ModalFormEmailOrPhoneProps, {}, "isOpen">;
|
|
3
|
+
type ModalFormEmailOrPhone = ReturnType<typeof ModalFormEmailOrPhone>;
|
|
4
|
+
export default ModalFormEmailOrPhone;
|